Mercurial > pidgin.yaz
annotate finch/libgnt/gntbox.h @ 17593:759cd72bd2ff
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Mon, 18 Jun 2007 12:37:29 +0000 |
parents | f00f2e283ffb |
children | 8410511f4dbb |
rev | line source |
---|---|
15818 | 1 #ifndef GNT_BOX_H |
2 #define GNT_BOX_H | |
3 | |
4 #include "gnt.h" | |
5 #include "gntwidget.h" | |
6 | |
7 #define GNT_TYPE_BOX (gnt_box_get_gtype()) | |
8 #define GNT_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_BOX, GntBox)) | |
9 #define GNT_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_BOX, GntBoxClass)) | |
10 #define GNT_IS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_BOX)) | |
11 #define GNT_IS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_BOX)) | |
12 #define GNT_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_BOX, GntBoxClass)) | |
13 | |
15931
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
14 typedef struct _GntBox GntBox; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
15 typedef struct _GntBoxClass GntBoxClass; |
15818 | 16 |
17 typedef enum | |
18 { | |
19 /* These for vertical boxes */ | |
20 GNT_ALIGN_LEFT, | |
21 GNT_ALIGN_RIGHT, | |
22 | |
23 GNT_ALIGN_MID, | |
24 | |
25 /* These for horizontal boxes */ | |
26 GNT_ALIGN_TOP, | |
27 GNT_ALIGN_BOTTOM | |
28 } GntAlignment; | |
29 | |
15931
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
30 struct _GntBox |
15818 | 31 { |
32 GntWidget parent; | |
33 | |
34 gboolean vertical; | |
35 gboolean homogeneous; | |
36 gboolean fill; | |
37 GList *list; /* List of widgets */ | |
38 | |
39 GntWidget *active; | |
40 int pad; /* Number of spaces to use between widgets */ | |
41 GntAlignment alignment; /* How are the widgets going to be aligned? */ | |
42 | |
43 char *title; | |
44 GList *focus; /* List of widgets to cycle focus (only valid for parent boxes) */ | |
45 | |
46 void (*gnt_reserved1)(void); | |
47 void (*gnt_reserved2)(void); | |
48 void (*gnt_reserved3)(void); | |
49 void (*gnt_reserved4)(void); | |
50 }; | |
51 | |
15931
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
52 struct _GntBoxClass |
15818 | 53 { |
54 GntWidgetClass parent; | |
55 | |
56 void (*gnt_reserved1)(void); | |
57 void (*gnt_reserved2)(void); | |
58 void (*gnt_reserved3)(void); | |
59 void (*gnt_reserved4)(void); | |
60 }; | |
61 | |
62 G_BEGIN_DECLS | |
63 | |
64 GType gnt_box_get_gtype(void); | |
65 | |
66 #define gnt_vbox_new(homo) gnt_box_new(homo, TRUE) | |
67 #define gnt_hbox_new(homo) gnt_box_new(homo, FALSE) | |
68 | |
69 GntWidget *gnt_box_new(gboolean homo, gboolean vert); | |
70 | |
71 void gnt_box_add_widget(GntBox *box, GntWidget *widget); | |
72 | |
73 void gnt_box_set_title(GntBox *box, const char *title); | |
74 | |
75 void gnt_box_set_pad(GntBox *box, int pad); | |
76 | |
77 void gnt_box_set_toplevel(GntBox *box, gboolean set); | |
78 | |
79 void gnt_box_sync_children(GntBox *box); | |
80 | |
81 void gnt_box_set_alignment(GntBox *box, GntAlignment alignment); | |
82 | |
83 void gnt_box_remove(GntBox *box, GntWidget *widget); /* XXX: does NOT destroy widget */ | |
84 | |
85 void gnt_box_remove_all(GntBox *box); /* Removes AND destroys all the widgets in it */ | |
86 | |
87 void gnt_box_readjust(GntBox *box); | |
88 | |
89 void gnt_box_set_fill(GntBox *box, gboolean fill); | |
90 | |
91 void gnt_box_move_focus(GntBox *box, int dir); /* +1 to move forward, -1 for backward */ | |
92 | |
93 void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget); | |
94 | |
95 G_END_DECLS | |
96 | |
97 #endif /* GNT_BOX_H */ | |
98 |