Example #1
0
int
main (int argc,
      char **argv)
{
	CORBA_ORB orb;

	bindtextdomain (PACKAGE, LOCALE_DIRECTORY);
	textdomain (PACKAGE);

	gnome_init_with_popt_table ("Evolution Yank", VERSION,
				    argc, argv, oaf_popt_options, 0, NULL);
	orb = oaf_init (argc, argv);

	gdk_rgb_init ();
	if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) {
		g_error (_("Yank component could not initialize Bonobo.\n"));
		exit (1);
	}

	glade_gnome_init ();
	gnome_vfs_init ();

	/* Start our component */
	component_factory_init ();

	bonobo_main ();

	return 0;
}
Example #2
0
File: ggcov.c Project: ggcov/ggcov
int
main(int argc, char **argv)
{
    ui_log_init();

    /* stash a copy of argv[] in case we want to dump it for debugging */
    stash_argv(argc, argv);

    ggcov_params_t params;
    argparse::parser_t parser(params);

#if HAVE_GNOME_PROGRAM_INIT
    GnomeProgram *prog;
    poptContext popt_context;

    prog = gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE,
			      argc, argv,
			      GNOME_PARAM_POPT_TABLE, parser.get_popt_table(),
			      GNOME_PROGRAM_STANDARD_PROPERTIES,
			      GNOME_PARAM_NONE);
    g_object_get(prog, GNOME_PARAM_POPT_CONTEXT, &popt_context, (char *)0);
    parser.handle_popt_tail(popt_context);
#elif GTK2
    gtk_init(&argc, &argv);
    /* As of 2.0 we don't need to explicitly initialise libGlade anymore */
    parser.parse(argc, argv);
#else
    poptContext popt_context;
    gnome_init_with_popt_table(PACKAGE, VERSION, argc, argv,
			       parser.get_popt_table(), /*popt flags*/0,
			       &popt_context);
    glade_gnome_init();
    parser.handle_popt_tail(popt_context);
#endif

    int r = cov_read_files(params);
    if (r < 0)
	exit(1);    /* error message in cov_read_files() */

    cov_dump();
    ui_create(params, argv[0], r);
    gtk_main();

    return 0;
}
Example #3
0
int main (int argc, char *argv[])
{
    LEErrorCode   fontStatus = LE_NO_ERROR;
    poptContext   ptctx;
    GtkWidget    *app;
    const char   *defaultArgs[] = {"Sample.txt", NULL};
    const char  **args;
    int i;

    FT_Init_FreeType(&engine);

    gnome_init_with_popt_table("gnomelayout", "0.1", argc, argv, NULL, 0, &ptctx);

    guiSupport = gs_gnomeGuiSupportOpen();
    fontMap    = fm_gnomeFontMapOpen(engine, "FontMap.Gnome", 24, guiSupport, &fontStatus);
    font       = le_scriptCompositeFontOpen(fontMap);

    if (LE_FAILURE(fontStatus)) {
        FT_Done_FreeType(engine);
        return 1;
    }

    args = poptGetArgs(ptctx);
    
    if (args == NULL) {
        args = defaultArgs;
    }

    for (i = 0; args[i] != NULL; i += 1) {
       app = newSample(args[i]);
           
       gtk_widget_show_all(app);
    }
    
    poptFreeContext(ptctx);
    
    gtk_main();

    le_fontClose(font);
    gs_gnomeGuiSupportClose(guiSupport);

    FT_Done_FreeType(engine);

    exit(0);
}
Example #4
0
int
main (int argc, char *argv [])
{
	GtkWidget *label;
	GnomeClient *client;

	gnome_score_init("same-gnome");

	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
	textdomain (PACKAGE);

	gnome_init_with_popt_table ("same-gnome", VERSION, argc, argv, options, 0, NULL);

	gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-gsame.png");
	client= gnome_master_client ();

	gtk_signal_connect (GTK_OBJECT (client), "save_yourself",
			    GTK_SIGNAL_FUNC (save_state), argv[0]);
	gtk_signal_connect (GTK_OBJECT (client), "die",
			    GTK_SIGNAL_FUNC (client_die), NULL);

	if (GNOME_CLIENT_RESTARTED (client)){
		gnome_config_push_prefix (gnome_client_get_config_prefix (client));
	    
		restart ();
		restarted = 1;
		
		gnome_config_pop_prefix ();
	}

	srand (time (NULL));

	app = gnome_app_new("same-gnome", _("Same Gnome"));

        gtk_window_set_policy(GTK_WINDOW(app), FALSE, FALSE, TRUE);
	gtk_signal_connect (GTK_OBJECT(app), "delete_event",
			    (GtkSignalFunc)game_quit_callback, NULL);

	appbar = gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_USER);
	gnome_app_set_statusbar(GNOME_APP (app), GTK_WIDGET(appbar));

	gnome_appbar_set_status(GNOME_APPBAR (appbar),
				_("Welcome to Same Gnome!"));

	gnome_app_create_menus(GNOME_APP(app), mainmenu);

	gnome_app_install_menu_hints(GNOME_APP (app), mainmenu);
  
        vb = gtk_vbox_new (FALSE, 0);
	gnome_app_set_contents (GNOME_APP (app), vb);

	if (!fname) {
		fname = gnome_config_get_string
			("/same-gnome/Preferences/Scenario=stones.png");
	}

	create_same_board (fname);

	label = gtk_label_new (_("Score: "));
	scorew = gtk_label_new ("");
	set_score (score);

	gtk_box_pack_start(GTK_BOX(appbar), label, FALSE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(appbar), scorew, FALSE, TRUE, 0);
	
	if (!restarted)
		new_game ();
	
	g_free (fname);

	gtk_widget_show (vb);
	gtk_widget_show (GTK_WIDGET(label));
	gtk_widget_show (GTK_WIDGET(scorew));
        gtk_widget_show (app);

	gtk_main ();
	return 0;
}
Example #5
0
int
fe_args (int argc, char *argv[])
{
#ifdef USE_GNOME
    struct poptOption options[] = {
        {"cfgdir", 'd', POPT_ARG_STRING, 0, 0, _("Config dir"), 0},
        {"noauto", 'a', POPT_ARG_NONE, 0, 0, _("Don't Auto connect"), 0},
#ifdef USE_PANEL
        {"no-panel", 'n', POPT_ARG_NONE, 0, 0, _("Don't use GNOME Panel"), 0},
#endif
        POPT_AUTOHELP {0, '\0', 0, 0}
    };
#endif

    if (argc > 1)
    {
        if (!strcasecmp (argv[1], "-a") || !strcasecmp (argv[1], "--noauto"))
        {
            auto_connect = 0;
        }
#ifdef USE_PANEL
        if (!strcasecmp (argv[1], "-n") || !strcasecmp (argv[1], "--no-panel"))
        {
            nopanel = TRUE;
        }
#endif
        if (!strcasecmp (argv[1], "-v") || !strcasecmp (argv[1], "--version"))
        {
            printf (PACKAGE" "VERSION"\n");
            return 0;
        }
#ifndef USE_GNOME
#ifdef ENABLE_NLS
        bindtextdomain (PACKAGE, PREFIX"/share/locale");
        textdomain (PACKAGE);
#endif
        if (!strcasecmp (argv[1], "-h") || !strcasecmp (argv[1], "--help"))
        {
            printf(_("%s %s Options:\n\n"
                     "   --cfgdir <dir> -d\t : use a different config dir\n"
                     "   --noauto       -a\t : don't auto connect\n"
                     "   --version      -v\t : show version information\n"
                    ), PACKAGE, VERSION);
            return 0;
        }
#endif
    }
#ifdef ENABLE_NLS
#ifdef USE_GNOME
    bindtextdomain (PACKAGE, PREFIX"/share/locale");
    textdomain (PACKAGE);
#endif
#endif

    if (argc > 2)
    {
        if (!strcasecmp (argv[1], "-d") || !strcasecmp (argv[1], "--cfgdir"))
        {
            xdir = strdup (argv[2]);
            if (xdir[strlen (xdir) - 1] == '/')
                xdir[strlen (xdir) - 1] = 0;
        }
    }

#ifndef USE_GNOME
    gtk_set_locale ();
#endif

#ifdef USE_PANEL
    if (nopanel)
        gnome_init_with_popt_table (argv[0], VERSION, argc, argv, options, 0, 0);
    else {
        CORBA_Environment ev;
        CORBA_exception_init (&ev);

        gnome_CORBA_init_with_popt_table (argv[0], VERSION,
                                          &argc, argv, options, 0, 0,
                                          GNORBA_INIT_SERVER_FUNC, &ev);
        CORBA_exception_free (&ev);
    }
#else
#ifdef USE_GNOME
    gnome_init_with_popt_table (argv[0], VERSION, argc, argv, options, 0, 0);
#else
    gtk_init (&argc, &argv);
#endif
#endif

#ifndef USE_GNOME
#ifdef USE_GDK_PIXBUF
    gdk_rgb_init();
#endif
#endif

#ifdef USE_XLIB
    proxy_invisible = gtk_invisible_new ();
    gtk_widget_show (proxy_invisible);

    /* Make the root window send events to the invisible proxy widget */
    gdk_window_set_user_data (GDK_ROOT_PARENT (), proxy_invisible);

    /* Select for PropertyNotify events from the root window */
    XSelectInput (GDK_DISPLAY (), GDK_ROOT_WINDOW (), PropertyChangeMask);

    gtk_signal_connect (GTK_OBJECT (proxy_invisible), "property-notify-event",
                        GTK_SIGNAL_FUNC (handle_property_notify), NULL);
#endif

    return 1;
}