Mercurial > pidgin.yaz
comparison console/libgnt/gnttree.h @ 13964:0a0d2a1fd2bc
[gaim-migrate @ 16520]
Add multi-column support for GntTree. Use it for email-notifications.
Restore colors before exiting.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 19 Jul 2006 07:12:59 +0000 |
parents | 841a5ffbfee4 |
children | df8183b7fa2c |
comparison
equal
deleted
inserted
replaced
13963:f7cfaee79982 | 13964:0a0d2a1fd2bc |
---|---|
21 typedef struct _GnTree GntTree; | 21 typedef struct _GnTree GntTree; |
22 typedef struct _GnTreePriv GntTreePriv; | 22 typedef struct _GnTreePriv GntTreePriv; |
23 typedef struct _GnTreeClass GntTreeClass; | 23 typedef struct _GnTreeClass GntTreeClass; |
24 | 24 |
25 typedef struct _GnTreeRow GntTreeRow; | 25 typedef struct _GnTreeRow GntTreeRow; |
26 typedef struct _GnTreeCol GntTreeCol; | |
26 | 27 |
27 struct _GnTree | 28 struct _GnTree |
28 { | 29 { |
29 GntWidget parent; | 30 GntWidget parent; |
30 | 31 |
31 GntTreeRow *current; /* current selection */ | 32 GntTreeRow *current; /* current selection */ |
32 | 33 |
33 GntTreeRow *top; /* The topmost visible item */ | 34 GntTreeRow *top; /* The topmost visible item */ |
34 GntTreeRow *bottom; /* The bottommost visible item */ | 35 GntTreeRow *bottom; /* The bottommost visible item */ |
35 | 36 |
36 GntTreeRow *root; /* The root of all evil */ | 37 GntTreeRow *root; /* The root of all evil */ |
37 | 38 |
38 GList *list; /* List of GntTreeRow s */ | 39 GList *list; /* List of GntTreeRow s */ |
39 GHashTable *hash; /* XXX: We may need this for quickly referencing the rows */ | 40 GHashTable *hash; /* XXX: We may need this for quickly referencing the rows */ |
41 | |
42 int ncol; /* No. of columns */ | |
43 struct _GntTreeColInfo | |
44 { | |
45 int width; | |
46 int *name; | |
47 } *columns; /* Would a GList be better? */ | |
40 }; | 48 }; |
41 | 49 |
42 struct _GnTreeClass | 50 struct _GnTreeClass |
43 { | 51 { |
44 GntWidgetClass parent; | 52 GntWidgetClass parent; |
53 | 61 |
54 G_BEGIN_DECLS | 62 G_BEGIN_DECLS |
55 | 63 |
56 GType gnt_tree_get_gtype(void); | 64 GType gnt_tree_get_gtype(void); |
57 | 65 |
58 GntWidget *gnt_tree_new(); | 66 GntWidget *gnt_tree_new(); /* A tree with just one column */ |
67 | |
68 GntWidget *gnt_tree_new_with_columns(int columns); | |
59 | 69 |
60 void gnt_tree_set_visible_rows(GntTree *tree, int rows); | 70 void gnt_tree_set_visible_rows(GntTree *tree, int rows); |
61 | 71 |
62 int gnt_tree_get_visible_rows(GntTree *tree); | 72 int gnt_tree_get_visible_rows(GntTree *tree); |
63 | 73 |
64 void gnt_tree_scroll(GntTree *tree, int count); | 74 void gnt_tree_scroll(GntTree *tree, int count); |
65 | 75 |
66 GntTreeRow *gnt_tree_add_row_after(GntTree *tree, void *key, const char *text, void *parent, void *bigbro); | 76 GntTreeRow *gnt_tree_add_row_after(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); |
67 | 77 |
68 gpointer gnt_tree_get_selection_data(GntTree *tree); | 78 gpointer gnt_tree_get_selection_data(GntTree *tree); |
69 | 79 |
70 const char *gnt_tree_get_selection_text(GntTree *tree); | 80 char *gnt_tree_get_selection_text(GntTree *tree); |
71 | 81 |
72 void gnt_tree_remove(GntTree *tree, gpointer key); | 82 void gnt_tree_remove(GntTree *tree, gpointer key); |
73 | 83 |
74 /* Returns the visible line number of the selected row */ | 84 /* Returns the visible line number of the selected row */ |
75 int gnt_tree_get_selection_visible_line(GntTree *tree); | 85 int gnt_tree_get_selection_visible_line(GntTree *tree); |
76 | 86 |
77 void gnt_tree_change_text(GntTree *tree, gpointer key, const char *text); | 87 void gnt_tree_change_text(GntTree *tree, gpointer key, int colno, const char *text); |
78 | 88 |
79 GntTreeRow *gnt_tree_add_choice(GntTree *tree, void *key, const char *text, void *parent, void *bigbro); | 89 GntTreeRow *gnt_tree_add_choice(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); |
80 | 90 |
81 void gnt_tree_set_choice(GntTree *tree, void *key, gboolean set); | 91 void gnt_tree_set_choice(GntTree *tree, void *key, gboolean set); |
82 | 92 |
83 gboolean gnt_tree_get_choice(GntTree *tree, void *key); | 93 gboolean gnt_tree_get_choice(GntTree *tree, void *key); |
84 | 94 |
85 void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags); | 95 void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags); |
86 | 96 |
87 void gnt_tree_set_selected(GntTree *tree , void *key); | 97 void gnt_tree_set_selected(GntTree *tree , void *key); |
88 | 98 |
99 GntTreeRow *gnt_tree_create_row(GntTree *tree, ...); | |
100 | |
101 void gnt_tree_set_col_width(GntTree *tree, int col, int width); | |
102 | |
89 G_END_DECLS | 103 G_END_DECLS |
90 | 104 |
91 #endif /* GNT_TREE_H */ | 105 #endif /* GNT_TREE_H */ |