예제 #1
0
int 
main (int argc, char *argv [])
{
    GOptionContext *context;
    GError *error;
    gint retval;

    bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
    textdomain (GETTEXT_PACKAGE);

    context = g_option_context_new ("");
    g_option_context_add_group (context, gtk_get_option_group (TRUE));

    seahorse_secure_memory_init ();
    
    error = NULL; 
 	if (!g_option_context_parse (context, &argc, &argv, &error)) { 
     	if (error) { 
         	g_printerr ("Cannot parse arguments: %s.\n", 
         	error->message); 
         	g_error_free (error); 
     	} else 
         	g_printerr ("Cannot parse arguments.\n"); 
         	
     	g_option_context_free (context); 
     	
     	return 1; 
 	}
    
    gtk_init (&argc, &argv);
    
    retval =  panel_applet_factory_main ("SeahorseAppletFactory", TRUE,
                                      SEAHORSE_TYPE_APPLET,
                                      seahorse_applet_factory, NULL);
                                      
    g_option_context_free (context);
    
    return retval;

}
예제 #2
0
gint _vala_main (char** args, int args_length1) {
	gint result = 0;
	GError * _inner_error_;
	GOptionContext* context;
	gint retval;
	_inner_error_ = NULL;
	g_setenv ("GLOBALMENU_GNOME_ARGS", "--disable", TRUE);
	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
	context = g_option_context_new ("- GlobalMenu.PanelApplet");
	g_option_context_set_help_enabled (context, TRUE);
	g_option_context_add_main_entries (context, options, NULL);
	g_option_context_add_group (context, gtk_get_option_group (TRUE));
	g_option_context_add_group (context, bonobo_activation_get_goption_group ());
	{
		g_option_context_parse (context, &args_length1, &args, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch20_g_error;
		}
	}
	goto __finally20;
	__catch20_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
			g_error ("main.vala:25: parsing options failed: %s", e->message);
			_g_error_free0 (e);
		}
	}
	__finally20:
	if (_inner_error_ != NULL) {
		_g_option_context_free0 (context);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	if (!verbose) {
		GLogFunc _tmp0_;
		GDestroyNotify handler_target_destroy_notify = NULL;
		void* handler_target = NULL;
		GLogFunc handler;
		handler = (_tmp0_ = __lambda7__glog_func, handler_target = NULL, handler_target_destroy_notify = NULL, _tmp0_);
		g_log_set_handler ("libgnomenu", G_LOG_LEVEL_DEBUG, handler, handler_target);
		g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, handler, handler_target);
		(handler_target_destroy_notify == NULL) ? NULL : (handler_target_destroy_notify (handler_target), NULL);
		handler = NULL;
		handler_target = NULL;
		handler_target_destroy_notify = NULL;
	}
	gtk_rc_parse_string ("\n" \
"\t\tstyle \"globalmenu_event_box_style\"\n" \
"\t\t{\n" \
"\t\t\tGtkWidget::focus-line-width=0\n" \
"\t\t\tGtkWidget::focus-padding=0\n" \
"\t\t}\n" \
"\t\tstyle \"globalmenu_menu_bar_style\"\n" \
"\t\t{\n" \
"\t\t\tythickness = 0\n" \
"\t\t\tGtkMenuBar::shadow-type = none\n" \
"\t\t\tGtkMenuBar::internal-padding = 0\n" \
"\t\t}\n" \
"\t\tclass \"GtkEventBox\" style \"globalmenu_event_box_style\"\n" \
"\t\tclass \"GnomenuMenuBar\" style:highest \"globalmenu_menu_bar_style" \
"\"\n");
	gtk_init (&args_length1, &args);
	if (!bonobo_init (&args_length1, args)) {
		g_error ("main.vala:52: Cannot initialize bonobo.");
	}
	retval = panel_applet_factory_main (FACTORY_IID, TYPE_APPLET, __lambda8__panel_applet_factory_callback, NULL);
	result = retval;
	_g_option_context_free0 (context);
	return result;
}