| 1 |
#ifndef __GI_CPP_EXAMPLE_H__ |
| 2 |
#define __GI_CPP_EXAMPLE_H__ |
| 3 |
|
| 4 |
#include <glib-object.h> |
| 5 |
#include <glib.h> |
| 6 |
|
| 7 |
G_BEGIN_DECLS |
| 8 |
|
| 9 |
|
| 10 |
typedef enum _CEnum { ENUM_VALUE_0, ENUM_VALUE_1 } CEnum; |
| 11 |
GType gi_cpp_enum_get_type(void); |
| 12 |
#define GI_CPP_TYPE_ENUM (gi_cpp_enum_get_type()) |
| 13 |
|
| 14 |
|
| 15 |
typedef enum _CFlags { FLAG_VALUE_0 = 1, FLAG_VALUE_1 = 2 } CFlags; |
| 16 |
GType gi_cpp_flags_get_type(void); |
| 17 |
#define GI_CPP_TYPE_FLAGS (gi_cpp_flags_get_type()) |
| 18 |
|
| 19 |
|
| 20 |
GType gi_cpp_example_get_type(); |
| 21 |
|
| 22 |
#define GI_CPP_TYPE_EXAMPLE (gi_cpp_example_get_type()) |
| 23 |
#define GI_CPP_EXAMPLE(obj) \ |
| 24 |
(G_TYPE_CHECK_INSTANCE_CAST((obj), GI_CPP_TYPE_EXAMPLE, GICppExample)) |
| 25 |
#define GI_CPP_EXAMPLE_CLASS(klass) \ |
| 26 |
(G_TYPE_CHECK_CLASS_CAST((klass), GI_CPP_TYPE_EXAMPLE, GICppExampleClass)) |
| 27 |
#define GI_IS_CPP_EXAMPLE(obj) \ |
| 28 |
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GI_CPP_TYPE_EXAMPLE)) |
| 29 |
#define GI_IS_CPP_EXAMPLE_CLASS(klass) \ |
| 30 |
(G_TYPE_CHECK_CLASS_TYPE((klass), GI_CPP_TYPE_EXAMPLE)) |
| 31 |
|
| 32 |
typedef struct _GICppExample GICppExample; |
| 33 |
typedef struct _GICppExampleClass GICppExampleClass; |
| 34 |
|
| 35 |
struct _GICppExampleClass |
| 36 |
{ |
| 37 |
GObjectClass parent_class; |
| 38 |
|
| 39 |
|
| 40 |
int (*vmethod)(GICppExample *, int a, int b); |
| 41 |
int (*cmethod)(GICppExample *, int a, int b); |
| 42 |
}; |
| 43 |
|
| 44 |
enum { |
| 45 |
PROP_0, |
| 46 |
PROP_DATA, |
| 47 |
PROP_NUMBER, |
| 48 |
PROP_FNUMBER, |
| 49 |
PROP_OBJECT, |
| 50 |
PROP_PRESENT, |
| 51 |
PROP_ENUM, |
| 52 |
PROP_FLAGS, |
| 53 |
PROP_ERROR, |
| 54 |
PROP_LAST = PROP_ERROR |
| 55 |
}; |
| 56 |
|
| 57 |
#define NAME_NUMBER "number" |
| 58 |
#define NAME_FNUMBER "fnumber" |
| 59 |
#define NAME_DATA "data" |
| 60 |
#define NAME_PRESENT "present" |
| 61 |
#define NAME_OBJECT "object" |
| 62 |
#define NAME_ENUM "choice" |
| 63 |
#define NAME_FLAGS "flags" |
| 64 |
#define NAME_ERROR "error" |
| 65 |
|
| 66 |
#define NAME_INUMBER "itf-number" |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
GICppExample *gi_cpp_example_new(); |
| 71 |
|
| 72 |
typedef struct _GICppExampleItf GICppExampleItf; |
| 73 |
typedef struct _GICppExampleInterface GICppExampleInterface; |
| 74 |
|
| 75 |
struct _GICppExampleInterface |
| 76 |
{ |
| 77 |
GTypeInterface iface; |
| 78 |
|
| 79 |
|
| 80 |
int (*vmethod)(GICppExampleItf *, int a); |
| 81 |
int (*imethod)(GICppExampleItf *, int a); |
| 82 |
}; |
| 83 |
|
| 84 |
GType gi_cpp_example_interface_get_type(); |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
typedef struct _GICppPropertyItf GICppPropertyItf; |
| 89 |
typedef struct _GICppPropertyInterface GICppPropertyInterface; |
| 90 |
|
| 91 |
struct _GICppPropertyInterface |
| 92 |
{ |
| 93 |
GTypeInterface iface; |
| 94 |
}; |
| 95 |
|
| 96 |
GType gi_cpp_property_interface_get_type(); |
| 97 |
|
| 98 |
G_END_DECLS |
| 99 |
|
| 100 |
#endif |