1 --- clutter-1.6.0/doc/cookbook/examples/cb-button.h.wiget 2011-02-03 14:52:55.838124992 +0100
2 +++ clutter-1.6.0/doc/cookbook/examples/cb-button.h 2011-02-03 14:53:12.305129788 +0100
5 +#ifndef __CB_BUTTON_H__
6 +#define __CB_BUTTON_H__
8 +/* include any dependencies */
9 +#include <clutter/clutter.h>
11 +/* GObject implementation */
13 +/* declare this function signature to remove compilation errors with -Wall;
14 + * the cb_button_get_type() function is actually added via the
15 + * G_DEFINE_TYPE macro in the .c file
17 +GType cb_button_get_type (void);
19 +/* GObject type macros */
20 +/* returns the class type identifier (GType) for CbButton */
21 +#define CB_TYPE_BUTTON (cb_button_get_type ())
23 +/* cast obj to a CbButton object structure*/
24 +#define CB_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CB_TYPE_BUTTON, CbButton))
26 +/* check whether obj is a CbButton */
27 +#define CB_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CB_TYPE_BUTTON))
29 +/* cast klass to CbButtonClass class structure */
30 +#define CB_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CB_TYPE_BUTTON, CbButtonClass))
32 +/* check whether klass is a member of the CbButtonClass */
33 +#define CB_IS_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CB_TYPE_BUTTON))
35 +/* get the CbButtonClass structure for a CbButton obj */
36 +#define CB_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CB_TYPE_BUTTON, CbButtonClass))
39 + * Private instance fields; see
40 + * http://www.gotw.ca/gotw/024.htm for the rationale
42 +typedef struct _CbButtonPrivate CbButtonPrivate;
43 +typedef struct _CbButton CbButton;
44 +typedef struct _CbButtonClass CbButtonClass;
46 +/* object structure */
50 + ClutterActor parent_instance;
52 + /* structure containing private members */
54 + CbButtonPrivate *priv;
57 +/* class structure */
58 +struct _CbButtonClass
61 + void (* clicked)(CbButton *button);
64 + ClutterActorClass parent_class;
69 +/* constructor - note this returns a ClutterActor instance */
70 +ClutterActor *cb_button_new (void);
73 +G_CONST_RETURN gchar * cb_button_get_text (CbButton *self);
75 +/* setters - these are wrappers round functions
76 + * which change properties of the internal actors
78 +void cb_button_set_text (CbButton *self,
81 +void cb_button_set_background_color (CbButton *self,
82 + const ClutterColor *color);
84 +void cb_button_set_text_color (CbButton *self,
85 + const ClutterColor *color);
87 +#endif /* __CB_BUTTON_H__ */