Esempio n. 1
0
static void
cem_application_class_init(CemApplicationClass *klass)
{
  G_APPLICATION_CLASS(klass)->startup = cem_application_startup;
  G_APPLICATION_CLASS(klass)->activate = cem_application_activate;
  G_APPLICATION_CLASS(klass)->open = cem_application_open;
}
Esempio n. 2
0
static void
oregano_class_init (OreganoClass *klass)
{ 
	G_APPLICATION_CLASS (klass)->activate = oregano_activate;
	G_APPLICATION_CLASS (klass)->open = oregano_open;
	G_OBJECT_CLASS (klass)->finalize = oregano_finalize;
}
Esempio n. 3
0
int
main (int argc, char *argv[])
{
  GtkApplication *app;
  GObjectClass *app_class;
  gint retval;

  g_type_init ();

#ifdef HAVE_CHEESE
  /* Used by the avatar chooser */
  g_return_val_if_fail (cheese_gtk_init (&argc, &argv), 1);
#endif

  empathy_init ();

  g_set_application_name (_("Empathy Accounts"));

  /* Make empathy and empathy-accounts appear as the same app in gnome-shell */
  gdk_set_program_class ("Empathy");
  gtk_window_set_default_icon_name ("empathy");

  app = gtk_application_new (EMPATHY_ACCOUNTS_DBUS_NAME, G_APPLICATION_FLAGS_NONE);
  app_class = G_OBJECT_GET_CLASS (app);
  G_APPLICATION_CLASS (app_class)->local_command_line = local_cmdline;
  G_APPLICATION_CLASS (app_class)->activate = app_activate;

  retval = g_application_run (G_APPLICATION (app), argc, argv);

  g_object_unref (app);

  return retval;
}
Esempio n. 4
0
static void
sereneplayer_class_init (SereneplayerClass *klass)
{
	G_APPLICATION_CLASS (klass)->activate = sereneplayer_activate;
	G_APPLICATION_CLASS (klass)->open = sereneplayer_open;

	g_type_class_add_private (klass, sizeof (SereneplayerPrivate));

	G_OBJECT_CLASS (klass)->finalize = sereneplayer_finalize;
}
Esempio n. 5
0
static void
shabdarth_class_init (ShabdarthClass *klass)
{
	G_APPLICATION_CLASS (klass)->activate = shabdarth_activate;
	G_APPLICATION_CLASS (klass)->open = shabdarth_open;

	g_type_class_add_private (klass, sizeof (ShabdarthPrivate));

	G_OBJECT_CLASS (klass)->finalize = shabdarth_finalize;
}
Esempio n. 6
0
static void
brio_application_class_init (BrioApplicationClass *klass)
{
  G_APPLICATION_CLASS (klass)->activate = brio_application_activate;
  G_APPLICATION_CLASS (klass)->startup = brio_application_startup;

  G_OBJECT_CLASS (klass)->finalize = brio_application_finalize;

  g_type_class_add_private ((gpointer) klass, sizeof(BrioApplicationPrivate));
}
Esempio n. 7
0
static void
twitux_app_class_init (TwituxAppClass *klass)
{
  G_APPLICATION_CLASS (klass)->activate = twitux_app_activate;
  G_APPLICATION_CLASS (klass)->startup = twitux_app_startup;

  G_OBJECT_CLASS (klass)->finalize = twitux_app_finalize;

  g_type_class_add_private ((gpointer) klass, sizeof(TwituxAppPrivate));
}
static gboolean
gom_application_dbus_register (GApplication *application,
                               GDBusConnection *connection,
                               const gchar *object_path,
                               GError **error)
{
  GomApplication *self = GOM_APPLICATION (application);
  gboolean retval = FALSE;

  if (!G_APPLICATION_CLASS (gom_application_parent_class)->dbus_register (application,
                                                                          connection,
                                                                          object_path,
                                                                          error))
    goto out;

  if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self->skeleton),
                                         connection,
                                         object_path,
                                         error))
    goto out;

  retval = TRUE;

 out:
  return retval;
}
Esempio n. 9
0
static void
cem_application_startup(GApplication * app)
{
  GtkBuilder *builder;
  GMenuModel *app_menu;

  const gchar *quit_accels[2] ={"<Ctrl >Q", NULL};


  G_APPLICATION_CLASS(cem_application_parent_class)->startup(app);

  g_action_map_add_action_entries (G_ACTION_MAP(app),
    app_entries, G_N_ELEMENTS(app_entries), app);


  gtk_application_set_accels_for_action(GTK_APPLICATION(app), "app.quit", quit_accels);

  builder = gtk_builder_new_from_resource("/org/bandari/cem/glade/cem_menu.glade");

//  app_menu = G_MENU_MODEL (gtk_builder_get_object(builder, "appmenu"));

//  gtk_application_set_app_menu(GTK_APPLICATION(app), app_menu);

  g_object_unref(builder);
}
Esempio n. 10
0
static gboolean
terminal_app_dbus_register (GApplication    *application,
                            GDBusConnection *connection,
                            const gchar     *object_path,
                            GError         **error)
{
  TerminalApp *app = TERMINAL_APP (application);
  gs_unref_object TerminalObjectSkeleton *object = NULL;
  gs_unref_object TerminalFactory *factory = NULL;

  if (!G_APPLICATION_CLASS (terminal_app_parent_class)->dbus_register (application,
                                                                       connection,
                                                                       object_path,
                                                                       error))
    return FALSE;

  object = terminal_object_skeleton_new (TERMINAL_FACTORY_OBJECT_PATH);
  factory = terminal_factory_impl_new ();
  terminal_object_skeleton_set_factory (object, factory);

  app->object_manager = g_dbus_object_manager_server_new (TERMINAL_OBJECT_PATH_PREFIX);
  g_dbus_object_manager_server_export (app->object_manager, G_DBUS_OBJECT_SKELETON (object));

  /* And export the object */
  g_dbus_object_manager_server_set_connection (app->object_manager, connection);
  return TRUE;
}
Esempio n. 11
0
static void
terminal_app_startup (GApplication *application)
{
  const GActionEntry app_menu_actions[] = {
    { "preferences", app_menu_preferences_cb,   NULL, NULL, NULL },
    { "help",        app_menu_help_cb,          NULL, NULL, NULL },
    { "about",       app_menu_about_cb,         NULL, NULL, NULL },
    { "quit",        app_menu_quit_cb,          NULL, NULL, NULL }
  };

  gs_unref_object GtkBuilder *builder;
  GError *error = NULL;

  G_APPLICATION_CLASS (terminal_app_parent_class)->startup (application);

  /* Need to set the WM class (bug #685742) */
  gdk_set_program_class("Gnome-terminal");

  g_action_map_add_action_entries (G_ACTION_MAP (application),
                                   app_menu_actions, G_N_ELEMENTS (app_menu_actions),
                                   application);

  builder = gtk_builder_new ();
  gtk_builder_add_from_resource (builder,
                                 TERMINAL_RESOURCES_PATH_PREFIX "ui/terminal-appmenu.ui",
                                 &error);
  g_assert_no_error (error);

  gtk_application_set_app_menu (GTK_APPLICATION (application),
                                G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu")));

  _terminal_debug_print (TERMINAL_DEBUG_SERVER, "Startup complete\n");
}
Esempio n. 12
0
static gboolean
photos_application_dbus_register (GApplication *application,
                                  GDBusConnection *connection,
                                  const gchar *object_path,
                                  GError **error)
{
  PhotosApplication *self = PHOTOS_APPLICATION (application);
  gboolean ret_val = FALSE;
  gchar *search_provider_path = NULL;

  if (!G_APPLICATION_CLASS (photos_application_parent_class)->dbus_register (application,
                                                                             connection,
                                                                             object_path,
                                                                             error))
    goto out;

  search_provider_path = g_strconcat (object_path, PHOTOS_SEARCH_PROVIDER_PATH_SUFFIX, NULL);
  if (!photos_search_provider_dbus_export (self->priv->search_provider, connection, search_provider_path, error))
    goto out;

  ret_val = TRUE;

 out:
  g_free (search_provider_path);
  return ret_val;
}
Esempio n. 13
0
static void
gedit_app_class_init (GeditAppClass *klass)
{
	GObjectClass *object_class = G_OBJECT_CLASS (klass);
	GApplicationClass *app_class = G_APPLICATION_CLASS (klass);

	object_class->dispose = gedit_app_dispose;
	object_class->get_property = gedit_app_get_property;

	app_class->startup = gedit_app_startup;
	app_class->activate = gedit_app_activate;
	app_class->command_line = gedit_app_command_line;
	app_class->handle_local_options = gedit_app_handle_local_options;
	app_class->open = gedit_app_open;
	app_class->shutdown = gedit_app_shutdown;

	klass->show_help = gedit_app_show_help_impl;
	klass->help_link_id = gedit_app_help_link_id_impl;
	klass->set_window_title = gedit_app_set_window_title_impl;
	klass->create_window = gedit_app_create_window_impl;

	g_object_class_install_property (object_class,
					 PROP_LOCKDOWN,
					 g_param_spec_flags ("lockdown",
							     "Lockdown",
							     "The lockdown mask",
							     GEDIT_TYPE_LOCKDOWN_MASK,
							     0,
							     G_PARAM_READABLE |
							     G_PARAM_STATIC_STRINGS));
}
static void
screenshot_application_startup (GApplication *app)
{
  ScreenshotApplication *self = SCREENSHOT_APPLICATION (app);
  GtkBuilder *builder;
  GMenuModel *menu;

  G_APPLICATION_CLASS (screenshot_application_parent_class)->startup (app);

  gtk_window_set_default_icon_name (SCREENSHOOTER_ICON);
  screenshooter_init_stock_icons ();

  g_action_map_add_action_entries (G_ACTION_MAP (self), action_entries,
                                   G_N_ELEMENTS (action_entries), self);

  builder = gtk_builder_new ();
  gtk_builder_add_from_resource (builder, "/org/gnome/screenshot/screenshot-app-menu.ui", NULL);
  menu = G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"));
  gtk_application_set_app_menu (GTK_APPLICATION (self), menu);

  g_object_unref (builder);
  g_object_unref (menu);

  /* interactive mode: trigger the dialog and wait for the response */
  if (screenshot_config->interactive)
    screenshot_show_interactive_dialog (self);
  else
    screenshot_start (self);
}
Esempio n. 15
0
static void refimpl_app_startup(GApplication* application) {
    RefImplApp* app = REFIMPL_APP(application);

    G_APPLICATION_CLASS(refimpl_app_parent_class)->startup(application);

    g_action_map_add_action_entries(G_ACTION_MAP(app), app_entries, G_N_ELEMENTS(app_entries), app);

    if (refimpl_app_has_app_menu(app)) {
	GtkBuilder* builder;
	GError* error = NULL;

	builder = gtk_builder_new();
	if (!gtk_builder_add_from_resource(builder,
					   "/com/bobtacoindustries/N3888_RefImpl/refimpl_menu.ui",
					   &error)) {
	    g_warning("Loading menu builder file failed. Message: %s", error->message);
	    g_error_free(error);
	}
	else {
	    GMenuModel* appMenu;
	    appMenu = G_MENU_MODEL(gtk_builder_get_object(builder, "app_menu"));
	    gtk_application_set_app_menu(GTK_APPLICATION(application), appMenu);
	}

	g_object_unref(builder);
    }

    //setup_accelerators(app);
}
Esempio n. 16
0
static void
terminal_app_dbus_unregister (GApplication    *application,
                              GDBusConnection *connection,
                              const gchar     *object_path)
{
  TerminalApp *app = TERMINAL_APP (application);

  if (app->object_manager) {
    g_dbus_object_manager_server_unexport (app->object_manager, TERMINAL_FACTORY_OBJECT_PATH);
    g_object_unref (app->object_manager);
    app->object_manager = NULL;
  }

#ifdef ENABLE_SEARCH_PROVIDER
  if (app->search_provider) {
    terminal_search_provider_dbus_unregister (app->search_provider, connection, TERMINAL_SEARCH_PROVIDER_PATH);
    g_object_unref (app->search_provider);
    app->search_provider = NULL;
  }
#endif /* ENABLE_SEARCH_PROVIDER */

  G_APPLICATION_CLASS (terminal_app_parent_class)->dbus_unregister (application,
                                                                    connection,
                                                                    object_path);
}
Esempio n. 17
0
static void
fcitx_config_app_class_init (FcitxConfigAppClass *klass)
{
    G_OBJECT_CLASS (klass)->finalize= fcitx_config_app_finalize;

    G_APPLICATION_CLASS (klass)->activate = fcitx_config_app_activate;
}
Esempio n. 18
0
static void
pragha_application_shutdown (GApplication *application)
{
	PraghaApplication *pragha = PRAGHA_APPLICATION (application);

	CDEBUG(DBG_INFO, "Pragha shutdown: Saving curret state.");

	if (pragha_preferences_get_restore_playlist (pragha->preferences))
		pragha_playlist_save_playlist_state (pragha->playlist);

	pragha_window_save_settings (pragha);

	pragha_playback_stop (pragha);

	/* Shutdown plugins can hide sidebar before save settings. */
	if (pragha->sidebar2_binding) {
		g_object_unref (pragha->sidebar2_binding);
		pragha->sidebar2_binding = NULL;
	}

#ifdef HAVE_LIBPEAS
	pragha_plugins_engine_shutdown (pragha->plugins_engine);
#endif

	gtk_widget_destroy (pragha->mainwindow);

	G_APPLICATION_CLASS (pragha_application_parent_class)->shutdown (application);
}
Esempio n. 19
0
static void
nemo_main_application_quit_mainloop (GApplication *app)
{
    nemo_main_application_notify_unmount_done (NEMO_APPLICATION (app), NULL);

    G_APPLICATION_CLASS (nemo_main_application_parent_class)->quit_mainloop (app);
}
Esempio n. 20
0
static void
gcal_application_startup (GApplication *app)
{
  GcalApplicationPrivate *priv;
  GError *error;
  priv = GCAL_APPLICATION (app)->priv;

  G_APPLICATION_CLASS (gcal_application_parent_class)->startup (app);

  if (gtk_clutter_init (NULL, NULL) < 0)
   {
     g_error (_("Unable to initialize GtkClutter"));
     g_application_quit (app);
   }

  if (priv->provider == NULL)
   {
     priv->provider = gtk_css_provider_new ();
     gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
                                                GTK_STYLE_PROVIDER (priv->provider),
                                                G_MAXUINT);

     error = NULL;
     gtk_css_provider_load_from_path (priv->provider, CSS_FILE, &error);
     if (error != NULL)
       g_warning ("Error loading stylesheet from file %s. %s", CSS_FILE, error->message);
   }

  priv->manager = gcal_manager_new ();

  gcal_application_set_app_menu (app);
}
Esempio n. 21
0
static void
photos_thumbnailer_shutdown (GApplication *application)
{
  photos_debug (PHOTOS_DEBUG_THUMBNAILER, "Thumbnailer exiting");

  G_APPLICATION_CLASS (photos_thumbnailer_parent_class)->shutdown (application);
}
Esempio n. 22
0
static void
terminal_app_startup (GApplication *application)
{
  const GActionEntry app_menu_actions[] = {
    { "preferences", app_menu_preferences_cb,   NULL, NULL, NULL },
    { "help",        app_menu_help_cb,          NULL, NULL, NULL },
    { "about",       app_menu_about_cb,         NULL, NULL, NULL },
    { "quit",        app_menu_quit_cb,          NULL, NULL, NULL }
  };

  g_application_set_resource_base_path (application, TERMINAL_RESOURCES_PATH_PREFIX);

  G_APPLICATION_CLASS (terminal_app_parent_class)->startup (application);

  /* Need to set the WM class (bug #685742) */
  gdk_set_program_class("Gnome-terminal");

  g_action_map_add_action_entries (G_ACTION_MAP (application),
                                   app_menu_actions, G_N_ELEMENTS (app_menu_actions),
                                   application);


  app_load_css (application);

  _terminal_debug_print (TERMINAL_DEBUG_SERVER, "Startup complete\n");
}
Esempio n. 23
0
static void
eog_application_startup (GApplication *application)
{
	G_APPLICATION_CLASS (eog_application_parent_class)->startup (application);

	eog_application_init_app_menu (EOG_APPLICATION (application));
}
Esempio n. 24
0
static void
glarea_app_class_init (GlareaAppClass *klass)
{
  GApplicationClass *app_class = G_APPLICATION_CLASS (klass);

  app_class->startup = glarea_app_startup;
  app_class->activate = glarea_app_activate;
}
Esempio n. 25
0
static void
photos_thumbnailer_startup (GApplication *application)
{
  G_APPLICATION_CLASS (photos_thumbnailer_parent_class)->startup (application);

  photos_gegl_init ();
  photos_debug (PHOTOS_DEBUG_THUMBNAILER, "Thumbnailer ready");
}
Esempio n. 26
0
static void
ag_app_class_init(AgAppClass *klass)
{
    GApplicationClass *application_class = G_APPLICATION_CLASS(klass);

    application_class->startup = startup;
    application_class->open    = ag_app_import;
}
Esempio n. 27
0
static void
irc_application_startup (GApplication *self)
{
	g_resources_register (irc_get_resource ());
	g_application_set_resource_base_path (self, "/se/tingping/IrcClient");

    G_APPLICATION_CLASS (irc_application_parent_class)->startup (self);
}
Esempio n. 28
0
static void refimpl_app_class_init(RefImplAppClass* cls) {
    GObjectClass* objectClass = G_OBJECT_CLASS(cls);
    GApplicationClass* applicationClass = G_APPLICATION_CLASS(cls);

    applicationClass->startup = refimpl_app_startup;

    objectClass->dispose = refimpl_app_dispose;
}
Esempio n. 29
0
static void
fr_application_startup (GApplication *application)
{
	G_APPLICATION_CLASS (fr_application_parent_class)->startup (application);

	fr_application_register_archive_manager_service (FR_APPLICATION (application));
	initialize_data ();
	initialize_app_menu (application);
}
Esempio n. 30
0
static void
roadmap_class_init (RoadmapClass *klass)
{
	G_APPLICATION_CLASS (klass)->activate = roadmap_activate;

	g_type_class_add_private (klass, sizeof (RoadmapPrivate));

	G_OBJECT_CLASS (klass)->finalize = roadmap_finalize;
}