示例#1
0
int main(int argc,char *argv[])
{
  int ret;
  bool found_check_db=false;
  CmdSwitch *cmd=new CmdSwitch(argc,argv,"rdadmin",MDBADMIN_USAGE);
  for(unsigned i=0;i<cmd->keys();i++) {
    if(cmd->key(i)=="--check-db") {
      found_check_db=true;
      cmd->setProcessed(i,true);
    }
    if(cmd->key(i)=="--mysql-admin-user") {
      admin_admin_username=cmd->value(i);
      cmd->setProcessed(i,true);
    }
    if(cmd->key(i)=="--mysql-admin-password") {
      admin_admin_password=cmd->value(i);
      cmd->setProcessed(i,true);
    }
  }
  if(found_check_db) {
    ret=cmdline_main(argc,argv);
  }
  else {
    ret=gui_main(argc,argv);
  }
  return ret;
}
示例#2
0
int main()
{
	//Drill-------------------------------------------------------

	Lines_window win{ Point{ 100,100 },600,400,"lines" };
	return gui_main();
}
示例#3
0
文件: 01.cpp 项目: fanqo/PPPCpp
int main()
  try{
    Lines_window win {Point{100, 100}, 600, 400, "lines"};
    return gui_main();
  }
catch (exception& e) {
  cerr << "exception: " << e.what() << endl;
  return 1;
}
catch (...) {
  cerr << "Some exception\n";
  return 2;
}
示例#4
0
文件: test.c 项目: dejarc/372Project
int testGUImain(int argc, char *argv[]) {
    Gui gui = gui_ctor();
    word mem[100] = {0};
    mem[2] = 99;
    word r[16] = {0};
    r[4] = -1;
    gui_connect_memory(gui, mem, 100);
    gui_connect_registers(gui, r, REG_NAMES, 16);
//    gui_connect_step(gui, &func);
//    gui_connect_pc(gui, &pc);
//    gui_connect_open_file(gui, &open_file);
    gui_main();
    return 0;
}
int main()
try {
	if(H112 != 201401L)error("Error: incorrect std_lib_facilities_4.h version ",
		  	   H112);
	Pic_window win1(Point(100,100),1000,800,"AggieSnap");
	return gui_main();
}
catch(exception& e) {
	cerr << "exception: " << e.what() << '\n';
	return 1;
}
catch (...) {
	cerr << "Some exception\n";
	return 2;
}
示例#6
0
int main(int argc, char **argv) //@ : main
    //@ requires 0 <= argc &*& [_]argv(argv, argc, _);
    //@ ensures true;
{
    struct widget *window = 0;
       
    gui_init();
    
    window = gui_window_new();
    gui_widget_show(window);
       
    gui_main();
    
    return 0;
}
示例#7
0
int main()
{
  try
  {
	Game_screen spl(Point (100,100),800,600,"Flap God");
    
    return gui_main();
  }
  catch(exception& e)
  {
  	cerr << "error: " << e.what() << endl;
  }
  catch(...)
  {
  	cerr << "unknown error." << endl;
  }
}
示例#8
0
int main()
{
    try 
    {
        Game_window win1(Point(200,200),1000,800,"IHOP Training Program");

        win1.show();
        return gui_main();
    }
    catch(exception& e) {
        cerr << "exception: " << e.what() << '\n';
        return 1;
    }
    catch (...) {
        cerr << "Some exception\n";
        return 2;
    }
}
示例#9
0
void save_game_menu(void) {
	gui_window *save_win;
	gui_button *okay_btn;

	save_session = gui_create_session();

	save_win = gui_create_window(250, 250, 300, 100, save_session);
	okay_btn = gui_create_button(357, 320, 85, 22, "Okay", save_session);

	gui_button_set_callback(okay_btn, okay_btn_handle);

	gui_session_show_all(save_session);
	epiar_render_text(gui_font_normal, white, 0, AFONT_RENDER_BLENDED, screen, 330, 280, "Feature not implemented");

	gui_main(save_session);
	SDL_ShowCursor(1);

	gui_session_destroy_all(save_session);
	gui_destroy_session(save_session);
}
示例#10
0
文件: main.c 项目: dejarc/372Project
/* *****************************************************************************
 * main
 * *****************************************************************************
 * Creates the LC2200, sets up the GUI and connects functions to it, and then
 * launches the GUI connected to the ASM and LC2200.
 */
int main(int argc, char *argv[]) {
	LC2200 = LC2200_ctor();

//	testSystem(LC2200);

	Gui gui = gui_ctor();
	gui_connect_pc(gui, &LC2200->pc->pc);
	gui_connect_memory(gui, LC2200->mem->MEM, MAX_MEM);
    gui_connect_asm_print(gui, &asm_print);
	//gui_connect_memory(gui, LC2200->mem->MEM, (int)(MAX_MEM/10));
	gui_connect_registers(gui, LC2200->reg->REG, REG_NAMES, REG_NUM);
	gui_connect_step_in(gui, &step_in);
	gui_connect_step_out(gui, &step_out);
	gui_connect_run(gui, &run);
	gui_connect_open_file(gui, &open_file);
	gui_main();

	LC2200_kill(LC2200);

	return 0;
}
示例#11
0
int main()
{
	try
	{
		/*Inventory inv("inventory.txt");
		inv.print();*/
		//Inventory inv;

		//inv.addNewStock(Stock(std::string("Peacock"), Item(25, 8.99)));
		//inv.addNewStock(Stock(std::string("Chevron"), Item(17, 6.99)));
		//inv.addNewStock(Stock(std::string("Batman"), Item(10, 12.99)));
		//inv.addNewStock(Stock(std::string("dandelion"), Item(4, 6.99)));
		//inv.addNewStock(Stock(std::string("critters"), Item(10, 3.99)));

		//std::cout << "Press enter to continue:";
		//std::cin.get();

		//inv.addStock(Stock(std::string("chevron"), Item(7, 7.99)));
		//inv.addStock(Stock(std::string("chevron"), Item(10, 6.49)));
		//inv.addStock(Stock(std::string("chevron"), Item(5, 8.79)));

		//inv.addStock(Stock(std::string("batman"), Item(10, 10.99)));
		//inv.addStock(Stock(std::string("batman"), Item(4, 14.99)));
		//inv.addStock(Stock(std::string("batman"), Item(15, 6.99)));

		//inv.addStock(Stock(std::string("peacock"), Item(3, 10.99)));
		//inv.addStock(Stock(std::string("peacock"), Item(15, 5.99)));
		//inv.addStock(Stock(std::string("peacock"), Item(3, 7.99)));

		//inv.addStock(Stock(std::string("dandelion"), Item(5, 8.99)));
		//inv.addStock(Stock(std::string("dandelion"), Item(4, 10.99)));

		//inv.addStock(Stock(std::string("critters"), Item(4, 4.99)));
		//inv.addStock(Stock(std::string("critters"), Item(2, 5.99)));
		//inv.addStock(Stock(std::string("critters"), Item(6, 3.99)));

		//std::cout << "Press enter to continue:";
		//std::cin.get();

		//inv.subtractStock("peacock", 15);

		//inv.print();
		//inv.printBreakdown(std::string("peacock"));
		//inv.printBreakdown(std::string("chevron"));
		//inv.printBreakdown(std::string("batman"));

		//std::vector<Stock> stocks(inv.getAllStock());
		//for(std::vector<Stock>::const_iterator i = stocks.begin();
		//	i != stocks.end(); ++i)
		//{
		//	std::cout << i->name << std::endl;
		//}
		//Stock s(inv.getStock(std::string("batman")));
		//std::cout << "-----" << std::endl;
		//std::cout << s.name << std::endl;
		
		InventoryWin iw(Point(500,400), 550, 300, "Inventory Manager 1.0", "inventory.txt");
		return gui_main();
	}
	catch(std::exception &e)
	{
		std::cout << e.what() << std::endl;
		std::cin.get();
	}
}
示例#12
0
文件: main.c 项目: JasonGross/gummi
int main (int argc, char *argv[]) {
    /* set up i18n */
    bindtextdomain (PACKAGE, LOCALEDIR);
    setlocale (LC_ALL, "");
    textdomain (PACKAGE);

    GError* error = NULL;
    GOptionContext* context = g_option_context_new ("files");
    g_option_context_add_main_entries (context, entries, PACKAGE);
    g_option_context_parse (context, &argc, &argv, &error);
    if (error) g_error("%s\n", error->message);

    /* initialize GTK */
    g_thread_init (NULL);
    gdk_threads_init ();
    gtk_init (&argc, &argv);
    GError* ui_error = NULL;
    GtkBuilder* builder = gtk_builder_new ();
    gchar* ui = g_build_filename (DATADIR, "ui", "gummi.glade", NULL);
    
    // exit program when gummi.glade can not be located:
    if (!g_file_test (ui, G_FILE_TEST_EXISTS)) {
        printf("Could not locate Glade interface file at:\n%s\n", ui);
        return 0;
    }
    
    gtk_builder_add_from_file (builder, ui, &ui_error);
    if (ui_error) {
        g_error ("%s\n", ui_error->message);
    }
    gtk_builder_set_translation_domain (builder, PACKAGE);
    g_free (ui);

    /* Initialize logging */
    slog_init (debug);
    slog (L_INFO, PACKAGE_NAME" version: "PACKAGE_VERSION"\n");

    /* Initialize configuration */
    gchar* configname = g_build_filename (g_get_user_config_dir (), "gummi",
                                  "gummi.cfg", NULL);
    config_init (configname);
    config_load ();
    g_free (configname);

    /* Initialize signals */
    gummi_signals_register ();

    /* Initialize Classes */
    gchar* snippetsname = g_build_filename (g_get_user_config_dir (), "gummi",
            "snippets.cfg", NULL);

    // why do we not load this from environment, like gui-main does? -A
    GuMotion* motion = motion_init ();
    GuIOFunc* io = iofunctions_init();
    GuLatex* latex = latex_init (); 
    GuBiblio* biblio = biblio_init (builder);
    GuTemplate* templ = template_init (builder);
    GuTabmanager* tabm = tabmanager_init ();
    GuProject* proj = project_init ();

    GuSnippets* snippets = snippets_init (snippetsname);
    gummi = gummi_init (motion, io, latex, biblio, templ, snippets, tabm, proj);
    slog (L_DEBUG, "Gummi created!\n");
    g_free (snippetsname);

    /* Initialize GUI */
    gui = gui_init (builder);
    
    slog_set_gui_parent (gui->mainwindow);
    slog (L_DEBUG, "GummiGui created!\n");

    /* Start compile thread */
    if (external_exists (config_get_value("typesetter"))) {
        typesetter_setup ();
        motion_start_compile_thread (motion);
    }
    else {
        infoscreengui_enable (gui->infoscreengui, "program_error");
        slog (L_ERROR, "Could not locate the typesetter program\n");
    }

    /* Install acceleration group to mainwindow */
    gtk_window_add_accel_group (gui->mainwindow, snippets->accel_group);

    if (argc != 2)
        tabmanager_create_tab (A_DEFAULT, NULL, NULL);
    else {
        if (!g_file_test(argv[1], G_FILE_TEST_EXISTS)) {
            slog(L_ERROR, "Failed to open file '%s': No such file or "
                    "directory\n", argv[1]);
            exit(1);
        }
        tabmanager_create_tab (A_LOAD, argv[1], NULL);
    }
        
    if (config_get_value ("autosaving")) iofunctions_start_autosave ();

    gui_main (builder);
    config_save ();
    config_clean_up ();
    return 0;
}