1 #ifndef _custom_list_h_included_
2 #define _custom_list_h_included_
6 /* Some boilerplate GObject defines. 'klass' is used
7 * instead of 'class', because 'class' is a C++ keyword */
9 #define CUSTOM_TYPE_LIST (custom_list_get_type ())
10 #define CUSTOM_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CUSTOM_TYPE_LIST, CustomList))
11 #define CUSTOM_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CUSTOM_TYPE_LIST, CustomListClass))
12 #define CUSTOM_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CUSTOM_TYPE_LIST))
13 #define CUSTOM_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CUSTOM_TYPE_LIST))
14 #define CUSTOM_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CUSTOM_TYPE_LIST, CustomListClass))
16 /* The data columns that we export via the tree model interface */
21 CUSTOM_LIST_COL_USERS
,
22 CUSTOM_LIST_COL_TOPIC
,
37 guint32 pos
; /* pos within the array */
39 /* channel string lives beyond "users" */
40 #define GET_CHAN(row) (((char *)row)+sizeof(chanlistrow))
44 typedef struct _CustomList CustomList
;
45 typedef struct _CustomListClass CustomListClass
;
49 /* CustomList: this structure contains everything we need for our
50 * model implementation. You can add extra fields to
51 * this structure, e.g. hashtables to quickly lookup
52 * rows or whatever else you might need, but it is
53 * crucial that 'parent' is the first member of the
59 guint num_rows
; /* number of rows that we have used */
60 guint num_alloc
; /* number of rows allocated */
61 chanlistrow
**rows
; /* a dynamically allocated array of pointers to the
62 * CustomRecord structure for each row */
65 GType column_types
[CUSTOM_LIST_N_COLUMNS
];
68 GtkSortType sort_order
;
72 /* CustomListClass: more boilerplate GObject stuff */
74 struct _CustomListClass
76 GObjectClass parent_class
;
80 CustomList
*custom_list_new (void);
81 void custom_list_append (CustomList
*, chanlistrow
*);
82 void custom_list_resort (CustomList
*);
83 void custom_list_clear (CustomList
*);
84 GType
custom_list_get_type (void);
86 #endif /* _custom_list_h_included_ */