本文整理汇总了C++中G_APPLICATION_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ G_APPLICATION_CLASS函数的具体用法?C++ G_APPLICATION_CLASS怎么用?C++ G_APPLICATION_CLASS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_APPLICATION_CLASS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cem_application_class_init
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;
}
示例2: oregano_class_init
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;
}
示例3: main
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;
}
示例4: sereneplayer_class_init
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;
}
示例5: shabdarth_class_init
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;
}
示例6: brio_application_class_init
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));
}
示例7: gom_application_dbus_register
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;
}
示例8: cem_application_startup
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);
}
示例9: terminal_app_dbus_register
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;
}
示例10: terminal_app_startup
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");
}
示例11: photos_application_dbus_register
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;
}
示例12: gedit_app_class_init
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));
}
示例13: screenshot_application_startup
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);
}
示例14: refimpl_app_startup
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);
}
示例15: terminal_app_dbus_unregister
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);
}