Exemple #1
0
int
main (int argc, char *argv[])
{
  GtkWidget *window2;

#ifdef ENABLE_NLS
  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
  textdomain (GETTEXT_PACKAGE);
#endif

  gtk_set_locale ();
  gtk_init (&argc, &argv);

  add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");

  /*
   * 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.
   */
  window2 = create_window2 ();
  gtk_widget_show (window2);

  gtk_main ();
  return 0;
}
Exemple #2
0
void
on_button3_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{
    GtkWidget *mac_set;
	mac_set = create_window2 ();
 	gtk_widget_show (mac_set);
	return;
}
Exemple #3
0
void show_window_second()
{
	GtkWidget *window;

	FILE*fp;
	_WT_IN_FILE InText;
	
	fp = fopen (IN_TEXT_FILE, "w");
	if(fp<0){
		printf(" System is not able to create file \n");
	}
	else{
		printf("ip is ready \n");
		ClearOutPutFile();
		//WriteEntryFile();
		strcpy(InText.InBuf,"Swipe");
		
		fwrite(&InText,sizeof(InText),1,fp);
		printf("File has been Updated for login \n");
		fclose(fp);
		StartTimer = 1;
		TimerInit();

	}
	
	if(!init_second_window) {
		   GError *error=NULL;
		InitialBuilder = gtk_builder_new ();
		if (!gtk_builder_add_from_file (InitialBuilder, INITIAL_UI_FILE, &error))
		{
		  g_critical ("Couldn't load builder file: %s", error->message);
		  g_error_free (error);
		}
		create_window2();
		init_second_window = 1;
	}
	window = GTK_WIDGET (gtk_builder_get_object (InitialBuilder, INITIAL_WINDOW));
	gtk_widget_show(window);
	cur_active_screen = initial_scrn;
	//cur_active_screen = login_scrn;
}
void
init_interface (int *argcp, char ***argvp)
{
printf("init_interface started\n");
  GL_realizer::gl_init (argcp, argvp);

  main_window = create_main_window ();
  Publisher::init (main_window);
  fill_toolbar_with_icons();
  
  Kit::external_widget =
    (GtkBox *) lookup_widget (main_window, "properties_vbox");
  g_signal_connect ((gpointer) main_window, "destroy",
		    G_CALLBACK (gtk_main_quit), NULL);

  window2 = create_window2 ();
  g_signal_connect ((gpointer) window2, "destroy", G_CALLBACK (gtk_main_quit),
		    NULL);
  gtk_window_set_transient_for (GTK_WINDOW (window2),
				GTK_WINDOW (main_window));
		    
  quit_dialog = create_quit_dialog();
  gtk_window_set_transient_for (GTK_WINDOW (quit_dialog),
				GTK_WINDOW (main_window));

  new_dialog = create_new_dialog();
  gtk_window_set_transient_for (GTK_WINDOW (new_dialog),
				GTK_WINDOW (main_window));

  GtkWidget *fcd = gtk_file_chooser_dialog_new (_("Choose a file"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, NULL);

printf("Wins created, not shown\n"); 


#ifdef EDITOR_FULL
  osg::ref_ptr < TopView > top =
    new TopView (lookup_widget (main_window, "main_drawingarea"));
  osg::ref_ptr < PerspectiveView > perspective =
    new PerspectiveView (lookup_widget (window2, "drawingarea2"));
  static Editor editor (top.get ());
  editor.addPerspectiveView (perspective.get ());
  perspective->
    unsetNodeMask (Editor::Masks::nm_Nodes | Editor::Masks::nm_Maps);
#else
  Publisher::set_status_msg (3, "Publisher::set_status_msg(...)");
  static foo realizer2 (lookup_widget (window2, "drawingarea2"));
  static foo realizer1 (lookup_widget (main_window, "main_drawingarea"));
  static Editor editor;
  // printf("foos created\n"); _sleep(4444);
#endif
printf("Win show attempt\n"); 
  gtk_widget_show (main_window);
  gtk_widget_show (window2);
printf("Wins shown\n"); 

#ifndef EDITOR_FULL

  Kit *kit = new Kit[3];
  
  kit[1].addIntEntry ("Malinowski", 0, 100, 1, 1);
  kit[1].addIntEntry ("Kowalski", 0, 1000, 1, 555);
  kit[1].addFileSel ("Majewski", "C:\\WINDOWS\\Desktop\\Editor\\src","(*.h$)|(*.o$)","Konarski");
  kit[0].addTextEntry ("Wisniewski", "");
  kit[0].addTextEntry ("Bednarski", "");
  kit[0].addTextEntry ("Jankowski", "");
  kit[0].addTextEntry ("Kozlowski", "");
  kit[0].addTextEntry ("Jaworski", "");
  kit[0].addTextEntry ("Janowski", "");
  kit[0].addTextEntry ("Zalewski", "");
  kit[0].addButton ("Borowski", 1, 0);
  // kit[0].addFileSel ("Majewski", "C:\\WINDOWS\\Desktop","*.*","Zielinski");
  std::vector<std::string> p, e;
  p.push_back(std::string("*.*"));
  /*
  e.push_back(std::string("emb #1"));
  e.push_back(std::string("emb #2"));
  e.push_back(std::string("emb #3"));
  */
  kit[0].addFileSel ("Majewski", "C:\\WINDOWS\\Desktop",p,"Zielinski",3,true,e);
  static Kit::Item gajewski_item = kit[0].addButton ("Gajewski", 1, 1);
  // gajewski_item.switching();

  // kit[1].activate();
  gtk_timeout_add (7000, to_handler, kit);
  //gtk_timeout_add (1000, gajewski_h, &kit[0]);

#endif

  Undo::init ( lookup_widget(main_window,"undo_toolbutton"),
             lookup_widget(main_window,"record_toolbutton") );
             
  g_timeout_add(AUTOSAVE_DELAY_SECONDS*1000,autosave_callback,NULL);
};
Exemple #5
0
void xneur_preference(void)
{
	wPreference = create_window2();
	gtk_widget_show(wPreference);

	// Mode set
	GtkWidget *widgetPtrToBefound = lookup_widget(wPreference, "combobox1");
	gtk_combo_box_set_active(GTK_COMBO_BOX(widgetPtrToBefound), xconfig->get_current_mode(xconfig));

	// Exclude App set
	widgetPtrToBefound = lookup_widget(wPreference, "treeview1");

	store_exclude_app = gtk_list_store_new (1, G_TYPE_STRING);
	gtk_tree_view_set_model(GTK_TREE_VIEW(widgetPtrToBefound), GTK_TREE_MODEL(store_exclude_app));
	gtk_widget_show(widgetPtrToBefound);

	for (int i = 0; i < xconfig->excluded_apps->data_count; i++)
	{
		GtkTreeIter iter;
		gtk_list_store_append(GTK_LIST_STORE(store_exclude_app), &iter);
		gtk_list_store_set(GTK_LIST_STORE(store_exclude_app), &iter, 0, xconfig->excluded_apps->data[i].string, -1);
	}

	GtkCellRenderer *cell = gtk_cell_renderer_text_new();

	GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes(_("Application"), cell, "text", 0, NULL);
	gtk_tree_view_append_column(GTK_TREE_VIEW(widgetPtrToBefound), GTK_TREE_VIEW_COLUMN(column));

	// Adding/Removing Exclude App
	widgetPtrToBefound = lookup_widget(wPreference, "button2");

	g_signal_connect_swapped(G_OBJECT(widgetPtrToBefound), "clicked", G_CALLBACK(xneur_add_exclude_app), G_OBJECT(wPreference));

	widgetPtrToBefound = lookup_widget(wPreference, "button3");
	g_signal_connect_swapped(G_OBJECT(widgetPtrToBefound), "clicked", G_CALLBACK(xneur_rem_exclude_app), G_OBJECT(wPreference));

	// Auto App Set
	widgetPtrToBefound = lookup_widget(wPreference, "treeview2");

	store_auto_app = gtk_list_store_new(1, G_TYPE_STRING);
	gtk_tree_view_set_model(GTK_TREE_VIEW(widgetPtrToBefound), GTK_TREE_MODEL(store_auto_app));
	gtk_widget_show(widgetPtrToBefound);

	for (int i = 0; i < xconfig->auto_apps->data_count; i++)
	{
		GtkTreeIter iter;
		gtk_list_store_append(GTK_LIST_STORE(store_auto_app), &iter);
		gtk_list_store_set(GTK_LIST_STORE(store_auto_app), &iter, 0, xconfig->auto_apps->data[i].string, -1);
	}

	cell = gtk_cell_renderer_text_new();

	column = gtk_tree_view_column_new_with_attributes(_("Application"), cell, "text", 0, NULL);
	gtk_tree_view_append_column(GTK_TREE_VIEW(widgetPtrToBefound), GTK_TREE_VIEW_COLUMN(column));

	// Adding/Removing Auto App
	widgetPtrToBefound = lookup_widget(wPreference, "button19");

	g_signal_connect_swapped(G_OBJECT(widgetPtrToBefound), "clicked", G_CALLBACK(xneur_add_auto_app), G_OBJECT(wPreference));
	widgetPtrToBefound = lookup_widget(wPreference, "button20");

	g_signal_connect_swapped(G_OBJECT(widgetPtrToBefound), "clicked", G_CALLBACK(xneur_rem_auto_app), G_OBJECT(wPreference));

	// Manual App Set
	widgetPtrToBefound = lookup_widget(wPreference, "treeview3");
	
	store_manual_app = gtk_list_store_new(1, G_TYPE_STRING);
	gtk_tree_view_set_model(GTK_TREE_VIEW(widgetPtrToBefound), GTK_TREE_MODEL(store_manual_app));
	gtk_widget_show(widgetPtrToBefound);	

	for (int i = 0; i < xconfig->manual_apps->data_count; i++)
	{
		GtkTreeIter iter;
		gtk_list_store_append(GTK_LIST_STORE(store_manual_app), &iter);
		gtk_list_store_set(GTK_LIST_STORE(store_manual_app), &iter, 0, xconfig->manual_apps->data[i].string, -1);
	}				

	cell = gtk_cell_renderer_text_new();

	column = gtk_tree_view_column_new_with_attributes(_("Application"), cell, "text", 0, NULL);
	gtk_tree_view_append_column(GTK_TREE_VIEW(widgetPtrToBefound), GTK_TREE_VIEW_COLUMN(column));

	// Adding/Removing Manual App
	widgetPtrToBefound = lookup_widget(wPreference, "button21");
	g_signal_connect_swapped(G_OBJECT(widgetPtrToBefound), "clicked", G_CALLBACK(xneur_add_manual_app), G_OBJECT(wPreference));

	widgetPtrToBefound = lookup_widget(wPreference, "button22");
	g_signal_connect_swapped(G_OBJECT(widgetPtrToBefound), "clicked", G_CALLBACK(xneur_rem_manual_app), G_OBJECT(wPreference));

	// Keyboard Bind set
	fill_binds(0, "combobox10", "combobox3", TRUE);
	fill_binds(1, "combobox11", "combobox5", TRUE);
	fill_binds(2, "combobox6", "combobox7", TRUE);
	fill_binds(3, "combobox8", "combobox9", TRUE);
	fill_binds(4, "combobox17", "combobox18", TRUE);
	fill_binds(5, "combobox19", "combobox20", TRUE);

	// Languages
	static const char *language_name_boxes[MAX_LANGUAGES] = {"combobox21", "combobox22", "combobox23", "combobox24"};
	static const char *language_combo_boxes[MAX_LANGUAGES] = {"combobox13", "combobox14", "combobox15", "combobox16"};

	for (int lang = 0; lang < xconfig->total_languages && lang < MAX_LANGUAGES; lang++)
	{
		//GtkWidget *dir = lookup_widget(wPreference, file_choose_buttons[lang]);
		GtkWidget *name = lookup_widget(wPreference, language_name_boxes[lang]);
		widgetPtrToBefound = lookup_widget(wPreference, language_combo_boxes[lang]);

		gtk_combo_box_set_active(GTK_COMBO_BOX(widgetPtrToBefound), xconfig->get_lang_group(xconfig, lang));

		const char *lang_name = xconfig->get_lang_name(xconfig, lang);
		if (strcmp(lang_name, "English") == 0)
			gtk_combo_box_set_active(GTK_COMBO_BOX(name), 1);
		if (strcmp(lang_name, "Russian") == 0)
			gtk_combo_box_set_active(GTK_COMBO_BOX(name), 2);
		if (strcmp(lang_name, "Ukrainian") == 0)
			gtk_combo_box_set_active(GTK_COMBO_BOX(name), 3);
		if (strcmp(lang_name, "Belarussian") == 0)
			gtk_combo_box_set_active(GTK_COMBO_BOX(name), 4);
		if (strcmp(lang_name, "French") == 0)
			gtk_combo_box_set_active(GTK_COMBO_BOX(name), 5);
		if (strcmp(lang_name, "Romanian") == 0)
			gtk_combo_box_set_active(GTK_COMBO_BOX(name), 6);
	}
	
	// Mouse Grab 
	widgetPtrToBefound = lookup_widget(wPreference, "checkbutton1");
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgetPtrToBefound), xconfig->mouse_processing_mode);
	
	// Education Mode
	widgetPtrToBefound = lookup_widget(wPreference, "checkbutton2");
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgetPtrToBefound), xconfig->education_mode);
	
	// Layout Remember Mode
	widgetPtrToBefound = lookup_widget(wPreference, "checkbutton3");
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgetPtrToBefound), xconfig->layout_remember_mode);
	
	// Saving Selection Mode
	widgetPtrToBefound = lookup_widget(wPreference, "checkbutton4");
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgetPtrToBefound), xconfig->save_selection_mode);
	
	// Button OK
	widgetPtrToBefound = lookup_widget(wPreference, "button5");
	g_signal_connect_swapped((gpointer) widgetPtrToBefound, "clicked", G_CALLBACK(xneur_save_preference), GTK_OBJECT(widgetPtrToBefound));
}