Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

gtask-ui.c

Go to the documentation of this file.
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     /* set up the loop back connection, any data written to the
00021      * input fd on this connection, comes right back out
00022      * the output fd. This connection is mainly used to facilitate
00023      * the ui-fallback features of the library
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 }

Generated on Mon Feb 2 21:33:25 2004 for libgtask-ui by doxygen 1.3.4