6 #include <glib-object.h>
9 #define GNT_TYPE_OBJECT (gnt_object_get_gtype())
10 #define GNT_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_OBJECT, GntObject))
11 #define GNT_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_OBJECT, GntObjectClass))
12 #define GNT_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_OBJECT))
13 #define GNT_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_OBJECT))
14 #define GNT_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_OBJECT, GntObjectClass))
16 #define GNTDEBUG fprintf(stderr, "%s\n", __FUNCTION__)
18 typedef struct _GnObject GntObject
;
19 typedef struct _GnObjectClass GntObjectClass
;
30 GHashTable
*remaps
; /* Key remaps */
31 GHashTable
*actions
; /* name -> Action */
32 GHashTable
*bindings
; /* key -> ActionParam */
34 void (*gnt_reserved1
)(void);
35 void (*gnt_reserved2
)(void);
36 void (*gnt_reserved3
)(void);
37 void (*gnt_reserved4
)(void);
42 GType
gnt_object_get_gtype(void);
47 const char * gnt_object_remap_keys(GntObject
*object
, const char *text
);
52 typedef gboolean (*GntObjectActionCallback
) (GntObject
*object
, GList
*params
);
53 typedef gboolean (*GntObjectActionCallbackNoParam
)(GntObject
*object
);
55 typedef struct _GnObjectAction GntObjectAction
;
56 typedef struct _GnObjectActionParam GntObjectActionParam
;
58 struct _GnObjectAction
60 char *name
; /* The name of the action */
62 gboolean (*action
)(GntObject
*object
, GList
*params
);
63 gboolean (*action_noparam
)(GntObject
*object
);
67 struct _GnObjectActionParam
69 GntObjectAction
*action
;
74 /*GntObjectAction *gnt_object_action_parse(const char *name);*/
76 void gnt_object_action_free(GntObjectAction
*action
);
77 void gnt_object_action_param_free(GntObjectActionParam
*param
);
79 void gnt_object_class_register_action(GntObjectClass
*klass
, const char *name
,
80 GntObjectActionCallback callback
, const char *trigger
, ...);
81 void gnt_object_register_binding(GntObjectClass
*klass
, const char *name
,
82 const char *trigger
, ...);
84 gboolean
gnt_object_perform_action_key(GntObject
*object
, const char *keys
);
85 gboolean
gnt_object_perform_action_named(GntObject
*object
, const char *name
, ...);
89 #endif /* GNT_OBJECT_H */