Back to index

unity  6.0.0
test_glib_object_utils.h
Go to the documentation of this file.
00001 /*
00002  * GObject Class to allow simple gobject testing
00003  */
00004 
00005 #ifndef _TEST_GOBJECT_H_
00006 #define _TEST_GOBJECT_H_
00007 
00008 #include <glib-object.h>
00009 
00010 G_BEGIN_DECLS
00011 
00012 #define TEST_TYPE_GOBJECT (test_gobject_get_type ())
00013 
00014 #define TEST_GOBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
00015   TEST_TYPE_GOBJECT, TestGObject))
00016 
00017 #define TEST_GOBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),\
00018   TEST_TYPE_GOBJECT, TestGObjectClass))
00019 
00020 #define TEST_IS_GOBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
00021   TEST_TYPE_GOBJECT))
00022 
00023 #define TEST_IS_GOBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
00024   TEST_TYPE_GOBJECT))
00025 
00026 #define TEST_GOBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
00027   TEST_TYPE_GOBJECT, TestGObjectClass))
00028 
00029 #define TEST_GOBJECT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
00030   TEST_TYPE_GOBJECT, TestGObjectPrivate))
00031 
00032 typedef struct _TestGObject TestGObject;
00033 typedef struct _TestGObjectClass TestGObjectClass;
00034 typedef struct _TestGObjectPrivate TestGObjectPrivate;
00035 
00036 struct _TestGObject
00037 {
00038   GObject parent;
00039   gint public_value;
00040 
00041   /*< private >*/
00042   TestGObjectPrivate *priv;
00043 };
00044 
00045 struct _TestGObjectClass
00046 {
00047   GObjectClass parent_class;
00048 };
00049 
00050 GType test_gobject_get_type(void) G_GNUC_CONST;
00051 
00052 TestGObject* test_gobject_new();
00053 void test_gobject_set_public_value(TestGObject *self, gint value);
00054 gint test_gobject_get_public_value(TestGObject *self);
00055 void test_gobject_set_private_value(TestGObject *self, gint value);
00056 gint test_gobject_get_private_value(TestGObject *self);
00057 
00058 G_END_DECLS
00059 
00060 #endif /* _TEST_SIGNALS_H_ */