claws-mail/src/gtk/gtksctree.h
Colin Leroy 8781b7b147 2006-05-23 [colin] 2.2.0cvs48
* src/folder.c
	* src/folderview.c
	* src/msgcache.c
	* src/summaryview.c
	* src/gtk/gtksctree.c
	* src/gtk/gtksctree.h
		More timings
		Fix slow loading problem, which was caused by the
		use of some gtk_ctree funcs and their use of
		g_list_position while gtk_ctree_(un)link'ing.
		Reap more functions from gtkctree.c to be sure we
		use our (fast) version instead of theirs.
	* src/mh.c
		Fix copy of unread mails
2006-05-23 17:42:52 +00:00

112 lines
4.1 KiB
C

/* Mail Summary tree widget for Sylpheed */
#ifndef __GTK_SCTREE_H__
#define __GTK_SCTREE_H__
#include <gtk/gtk.h>
#include <gtk/gtkclist.h>
#include <gtk/gtkctree.h>
/* This code is based on "gtkflist.{h,c}" from mc-4.5.42 .*/
#define TYPE_GTK_SCTREE (gtk_sctree_get_type ())
#define GTK_SCTREE(obj) (GTK_CHECK_CAST ((obj), TYPE_GTK_SCTREE, GtkSCTree))
#define GTK_SCTREE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_GTK_SCTREE, GtkSCTreeClass))
#define GTK_IS_SCTREE(obj) (GTK_CHECK_TYPE ((obj), TYPE_GTK_SCTREE))
#define GTK_IS_SCTREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_GTK_SCTREE))
typedef struct _GtkSCTree GtkSCTree;
typedef struct _GtkSCTreeClass GtkSCTreeClass;
struct _GtkSCTree {
GtkCTree ctree;
/* The anchor row for range selections */
GtkCTreeNode *anchor_row;
/* Mouse button and position saved on button press */
gint dnd_press_button;
gint dnd_press_x, dnd_press_y;
/* Delayed selection information */
gint dnd_select_pending;
guint dnd_select_pending_state;
gint dnd_select_pending_row;
gboolean selecting_range;
gboolean sorting;
};
struct _GtkSCTreeClass {
GtkCTreeClass parent_class;
/* Signal: invoke the popup menu for rows */
void (* row_popup_menu) (GtkSCTree *sctree, GdkEventButton *event);
/* Signal: invoke the popup menu for empty areas */
void (* empty_popup_menu) (GtkSCTree *sctree, GdkEventButton *event);
/* Signal: open the file in the selected row */
void (* open_row) (GtkSCTree *sctree);
/* Signal: initiate a drag and drop operation */
void (* start_drag) (GtkSCTree *sctree, gint button, GdkEvent *event);
};
GType gtk_sctree_get_type (void);
GtkWidget *gtk_sctree_new_with_titles (gint columns,
gint tree_column,
gchar *titles[]);
void gtk_sctree_select (GtkSCTree *sctree,
GtkCTreeNode *node);
void gtk_sctree_select_with_state (GtkSCTree *sctree,
GtkCTreeNode *node,
int state);
void gtk_sctree_unselect_all (GtkSCTree *sctree);
void gtk_sctree_set_anchor_row (GtkSCTree *sctree,
GtkCTreeNode *node);
void gtk_sctree_remove_node (GtkSCTree *sctree,
GtkCTreeNode *node);
/***********************************************************
* Tree sorting functions *
***********************************************************/
void gtk_sctree_sort_node (GtkCTree *ctree, GtkCTreeNode *node);
void gtk_sctree_sort_recursive (GtkCTree *ctree, GtkCTreeNode *node);
GtkCTreeNode* gtk_sctree_insert_node (GtkCTree *ctree,
GtkCTreeNode *parent,
GtkCTreeNode *sibling,
gchar *text[],
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
GdkPixmap *pixmap_opened,
GdkBitmap *mask_opened,
gboolean is_leaf,
gboolean expanded);
void gtk_sctree_set_node_info (GtkCTree *ctree,
GtkCTreeNode *node,
const gchar *text,
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
GdkPixmap *pixmap_opened,
GdkBitmap *mask_opened,
gboolean is_leaf,
gboolean expanded);
GtkCTreeNode *
gtk_sctree_insert_gnode (GtkCTree *ctree,
GtkCTreeNode *parent,
GtkCTreeNode *sibling,
GNode *gnode,
GtkCTreeGNodeFunc func,
gpointer data);
#endif /* __GTK_SCTREE_H__ */