changes needed to make it compile, remove some win32 stuff
[rofl0r-ixchat.git] / src / fe-gtk / custom-list.h
blobb0bd5a4d8a0ae06cf69de2125def63621fecec27
1 #ifndef _custom_list_h_included_
2 #define _custom_list_h_included_
4 #include <gtk/gtk.h>
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 */
18 enum
20 CUSTOM_LIST_COL_NAME,
21 CUSTOM_LIST_COL_USERS,
22 CUSTOM_LIST_COL_TOPIC,
23 CUSTOM_LIST_N_COLUMNS
26 enum
28 SORT_ID_CHANNEL,
29 SORT_ID_USERS,
30 SORT_ID_TOPIC
33 typedef struct
35 char *topic;
36 char *collation_key;
37 guint32 pos; /* pos within the array */
38 guint32 users;
39 /* channel string lives beyond "users" */
40 #define GET_CHAN(row) (((char *)row)+sizeof(chanlistrow))
42 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
54 * structure. */
55 struct _CustomList
57 GObject parent;
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 */
64 gint n_columns;
65 GType column_types[CUSTOM_LIST_N_COLUMNS];
67 gint sort_id;
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_ */