static int main_window_start(char* conf_file, char* tsp_prov_url) { char name[1024]; int ret = FALSE; printf("Loading '%s' conf file\n", conf_file); /* Load configuration file and initialise list of asked symbols */ if (load_config(conf_file, &conf_data)) { tsp = TSP_consumer_connect_url(tsp_prov_url); if(NULL!=tsp) { if(TSP_STATUS_OK==TSP_consumer_request_open(tsp, 0, 0)) { if(TSP_STATUS_OK==TSP_consumer_request_filtered_information(tsp,TSP_FILTER_MINIMAL,MINIMAL_STRING)) { if(TSP_STATUS_OK==TSP_consumer_request_sample(tsp, &conf_data.tsp_requested)) { /* Create the list of variable per provider global id */ init_index2vars(); if(TSP_STATUS_OK==TSP_consumer_request_sample_init(tsp,0,0)) { sprintf(name, "%s @ %s", conf_file, TSP_consumer_get_connected_name(tsp)); create_mainwin(&conf_data, name); ret = TRUE; } else { fprintf(stderr, "Error while initializing data stream '%s'\n", tsp_prov_url); } } else { fprintf(stderr, "Error while asking for TSP symbols session on host '%s'\n", tsp_prov_url); TSP_consumer_print_invalid_symbols(stderr,&conf_data.tsp_requested,tsp_prov_url); fprintf(stderr, "Check your configuration file <%s>.\n", conf_file); } } else { fprintf(stderr, "Error while asking for TSP information on host '%s'\n", tsp_prov_url); } } else { fprintf(stderr, "Error while opening TSP session on host '%s'\n", tsp_prov_url); } } else { fprintf(stderr, "unable to find any TSP provider on host '%s'\n", tsp_prov_url); } } return ret; }
int main (int argc, char *argv[]) { #ifdef ENABLE_NLS bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); textdomain (PACKAGE); #endif gtk_set_locale (); gtk_init (&argc, &argv); add_pixmap_directory (PACKAGE_DATA_DIR "/pixmaps"); add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); e = evas_new(); evas_set_output_method(e, RENDER_METHOD_ALPHA_SOFTWARE); { Visual *vis; Colormap cmap; vis = evas_get_optimal_visual(e, GDK_WINDOW_XDISPLAY(GDK_ROOT_PARENT())); gdk_vis = gdkx_visual_get(XVisualIDFromVisual(vis)); cmap = evas_get_optimal_colormap(e, GDK_WINDOW_XDISPLAY(GDK_ROOT_PARENT())); gdk_cmap = gdkx_colormap_get(cmap); /* workaround for bug in gdk - well oversight in api */ ((GdkColormapPrivate *)gdk_cmap)->visual = gdk_vis; } /* * The following code was added by Glade to create one of each component * (except popup menus), just so that you see something after building * the project. Delete any components that you don't want shown initially. */ mainwin = create_mainwin (); gtk_widget_show (mainwin); gtk_main (); return 0; }
int main (int argc, char *argv[]) { gnome_init ("slim", VERSION, argc, argv); /* * The following code was added by Glade to create one of each component * (except popup menus), just so that you see something after building * the project. Delete any components that you don't want shown initially. */ mainwin = create_mainwin (); gtk_widget_show (mainwin); sbStatus = lookup_widget(mainwin, "sbStatus"); tbRotor = lookup_widget(mainwin, "tbRotor"); tbProgrun = lookup_widget(mainwin, "tbProgrun"); btnProgreset = lookup_widget(mainwin, "btnProgreset"); gtk_main (); return 0; }