00001 #include <unistd.h>
00002
00003 #include <gtask-ui/gtask-ui.h>
00004
00005 #include <gtask/gtask.h>
00006
00007 static GTaskUIManager *ui_manager = NULL;
00008
00009 void
00010 gtask_ui_init( int *argc, char ***argv, GTaskRole role ) {
00011 GTaskConnectionGroup *conn_group;
00012 GTaskConnection *conn;
00013 GTaskEventDispatcher *dispatcher;
00014
00015 if( ui_manager != NULL )
00016 return;
00017
00018 gtask_init( argc, argv, role );
00019
00020
00021
00022
00023
00024
00025 conn = gtask_connection_new_with_properties( "loopback", role );
00026
00027 conn_group = gtask_factory_get_connection_group( NULL );
00028
00031 gtask_connection_connect_loopback( conn );
00032
00033 dispatcher = gtask_connection_get_event_dispatcher( conn );
00034
00035 ui_manager = gtask_ui_manager_new( );
00036
00037 gtask_event_dispatcher_add_watch( dispatcher,
00038 GTASK_TASK_PACKET_TYPE,
00039 gtask_ui_manager_private_task_event,
00040 ui_manager );
00041
00042 gtask_connection_group_add_connection( conn_group, conn );
00043
00044 g_object_unref( (GObject *) conn );
00045 }