00001 #ifndef GTASK_EVENT_DISPATCHER_H
00002 #define GTASK_EVENT_DISPATCHER_H
00003
00004 #include <gtask/gtask-stream-parser.h>
00005 #include <glib.h>
00006
00009
00010
00011 typedef struct _GTaskEventDispatcher GTaskEventDispatcher;
00012 typedef struct _GTaskEventDispatcherPrivate GTaskEventDispatcherPrivate;
00013 typedef struct _GTaskEventDispatcherClass GTaskEventDispatcherClass;
00014
00016 #define GTASK_EVENT_DISPATCHER_TYPE (gtask_event_dispatcher_get_type())
00017
00019 #define GTASK_EVENT_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
00020 GTASK_EVENT_DISPATCHER_TYPE, \
00021 GTaskEventDispatcher ))
00022
00024 #define GTASK_EVENT_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST( (klass), \
00025 GTASK_EVENT_DISPATCHER_TYPE, \
00026 GTaskEventDispatcherClass ))
00027
00032 #define GTASK_IS_EVENT_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE( (obj), \
00033 GTASK_EVENT_DISPATCHER_TYPE ))
00034
00039 #define GTASK_IS_EVENT_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE( (klass), \
00040 GTASK_EVENT_DISPATCHER_TYPE ))
00041
00042 #define GTASK_EVENT_DISPATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS( (obj), \
00043 GTASK_EVENT_DISPATCHER_TYPE, \
00044 GTaskEventDispatcherClass ))
00045
00049 struct _GTaskEventDispatcherPrivate {
00050 GTaskStreamParser *parser;
00051
00052 guint next_watch_id;
00053
00054 GArray *watches;
00055
00056 gboolean dispose_has_run;
00057 };
00058
00059 struct _GTaskEventDispatcher {
00060 GObject parent;
00061 GTaskEventDispatcherPrivate *private;
00062 };
00063
00064 struct _GTaskEventDispatcherClass {
00065 GObjectClass parent;
00066 };
00067
00068 typedef gboolean (*GTaskEventFunc) ( GTaskEventDispatcher *,
00069 GObject *,
00070 gpointer );
00071
00072 GType gtask_event_dispatcher_get_type( void );
00073
00074 GTaskEventDispatcher *
00075 gtask_event_dispatcher_new_with_parser( GTaskStreamParser *parser );
00076
00077 guint
00078 gtask_event_dispatcher_add_watch( GTaskEventDispatcher *dispatch,
00079 GType watch_type,
00080 GTaskEventFunc func,
00081 gpointer user_data );
00082
00083 void
00084 gtask_event_dispatcher_remove_watch( GTaskEventDispatcher *dispatch,
00085 guint watch_id );
00086
00087 GTaskStreamParser *
00088 gtask_event_dispatcher_get_stream_parser( GTaskEventDispatcher *dispatch );
00089
00090 gboolean
00091 gtask_event_dispatcher_private_parse_callback( GIOChannel *chann,
00092 GIOCondition cond,
00093 gpointer data );
00094
00095
00096
00097 #endif