这篇教程C++ G_APPLICATION函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中G_APPLICATION函数的典型用法代码示例。如果您正苦于以下问题:C++ G_APPLICATION函数的具体用法?C++ G_APPLICATION怎么用?C++ G_APPLICATION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了G_APPLICATION函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main (int argc, char **argv) { GtkApplication *app; int status; app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); return status;}
开发者ID:HoarFrostProject,项目名称:HoarFrost,代码行数:11,
示例2: mainint main(int argc, char* argv[]){ GtkApplication* app; int status; app = gtk_application_new("atommed.github.io.learn_gtk", G_APPLICATION_FLAGS_NONE); g_signal_connect(app, "activate", G_CALLBACK(activate), NULL); status = g_application_run(G_APPLICATION(app), argc, argv); g_object_unref(app); return status;}
开发者ID:atommed,项目名称:OP_repo,代码行数:12,
示例3: mainint main(int argc, char** argv){ bindtextdomain("gnome-twitch", GT_LOCALE_DIR); bind_textdomain_codeset("gnome-twitch", "UTF-8"); textdomain("gnome-twitch"); gst_init(0, NULL); main_app = gt_app_new(); return g_application_run(G_APPLICATION(main_app), argc, argv);}
开发者ID:pfent,项目名称:gnome-twitch,代码行数:12,
示例4: mainintmain (int argc, char *argv[]){ gint retval; NautilusApplication *application; #if defined (HAVE_MALLOPT) && defined(M_MMAP_THRESHOLD) /* Nautilus uses lots and lots of small and medium size allocations, * and then a few large ones for the desktop background. By default * glibc uses a dynamic treshold for how large allocations should * be mmaped. Unfortunately this triggers quickly for nautilus when * it does the desktop background allocations, raising the limit * such that a lot of temporary large allocations end up on the * heap and are thus not returned to the OS. To fix this we set * a hardcoded limit. I don't know what a good value is, but 128K * was the old glibc static limit, lets use that. */ mallopt (M_MMAP_THRESHOLD, 128 *1024);#endif g_type_init (); g_thread_init (NULL); /* This will be done by gtk+ later, but for now, force it to GNOME */ g_desktop_app_info_set_desktop_env ("GNOME"); if (g_getenv ("NAUTILUS_DEBUG") != NULL) { eel_make_warnings_and_criticals_stop_in_debugger (); } /* Initialize gettext support */ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); g_set_prgname ("nautilus");#ifdef HAVE_EXEMPI xmp_init();#endif /* Run the nautilus application. */ application = nautilus_application_get_singleton (); retval = g_application_run (G_APPLICATION (application), argc, argv); g_object_unref (application); eel_debug_shut_down (); return retval;}
开发者ID:kleopatra999,项目名称:nautilus,代码行数:53,
示例5: photos_thumbnailer_finalizestatic voidphotos_thumbnailer_finalize (GObject *object){ PhotosThumbnailer *self = PHOTOS_THUMBNAILER (object); g_free (self->address); if (g_application_get_is_registered (G_APPLICATION (self))) gegl_exit (); G_OBJECT_CLASS (photos_thumbnailer_parent_class)->finalize (object);}
开发者ID:GNOME,项目名称:gnome-photos,代码行数:12,
示例6: mainint main(int argc, char** argv){ GtkApplication* app; int status; indexHome((char*)"/home/ananth"); app=gtk_application_new("com.gmail.ananth1987.test",G_APPLICATION_FLAGS_NONE); g_signal_connect(app,"activate",G_CALLBACK(button_activate),NULL); status=g_application_run(G_APPLICATION(app),argc,argv); g_object_unref(app); return status;}
开发者ID:ananthvyas,项目名称:GSistant,代码行数:12,
示例7: mainintmain (int argc, char **argv){ ArvViewer *viewer; int status; GOptionContext *context; GError *error = NULL; bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); arv_g_thread_init (NULL); gtk_init (&argc, &argv); gst_init (&argc, &argv); context = g_option_context_new (NULL); g_option_context_add_main_entries (context, arv_viewer_option_entries, NULL); g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_add_group (context, gst_init_get_option_group ()); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_option_context_free (context); g_print ("Option parsing failed: %s/n", error->message); g_error_free (error); return EXIT_FAILURE; } g_option_context_free (context); arv_debug_enable (arv_viewer_option_debug_domains); viewer = arv_viewer_new (); if (!ARV_IS_VIEWER (viewer)) return EXIT_FAILURE; arv_viewer_set_options (viewer, arv_viewer_option_auto_socket_buffer, !arv_viewer_option_no_packet_resend, arv_viewer_option_packet_timeout, arv_viewer_option_frame_retention); notify_init ("Aravis Viewer"); status = g_application_run (G_APPLICATION (viewer), argc, argv); g_object_unref (viewer); notify_uninit (); return status;}
开发者ID:epicsdeb,项目名称:aravis,代码行数:52,
示例8: mainintmain (int argc, char **argv){ MxApplication *app; app = mx_application_new ("org.clutter-project.Mx.TestWindow", 0); g_signal_connect_after (app, "startup", G_CALLBACK (startup_cb), NULL); g_application_run (G_APPLICATION (app), argc, argv); return 0;}
开发者ID:kalfa,项目名称:mx,代码行数:13,
示例9: mainintmain(int argc, char **argv){ int ret = 1; GApplication *app = NULL; virt_viewer_util_init(_("Remote Viewer")); app = G_APPLICATION(remote_viewer_new()); ret = g_application_run(app, argc, argv); g_object_unref(app); return ret;}
开发者ID:etrunko,项目名称:virt-viewer,代码行数:13,
示例10: mainintmain (int argc, char *argv[]){ MxApplication *application; application = mx_application_new ("org.clutter-project.Mx.TestKineticScrollView", 0); g_signal_connect_after (application, "startup", G_CALLBACK (startup_cb), NULL); /* run the application */ g_application_run (G_APPLICATION (application), argc, argv); return 0;}
开发者ID:rodrmoya,项目名称:mx,代码行数:13,
示例11: gedit_app_initstatic voidgedit_app_init (GeditApp *app){ GeditAppPrivate *priv; priv = gedit_app_get_instance_private (app); g_set_application_name ("gedit"); gtk_window_set_default_icon_name ("accessories-text-editor"); priv->monitor = g_network_monitor_get_default (); g_signal_connect (priv->monitor, "network-changed", G_CALLBACK (get_network_available), app); g_application_add_main_option_entries (G_APPLICATION (app), options);#ifdef ENABLE_INTROSPECTION g_application_add_option_group (G_APPLICATION (app), g_irepository_get_option_group ());#endif}
开发者ID:TheLazyPerson,项目名称:gedit,代码行数:22,
示例12: mainintmain (int argc, char *argv[]){ GtdApplication *app; int status;#ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE);#endif app = gtd_application_new (); g_application_set_default (G_APPLICATION (app)); status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); return status;}
开发者ID:GeorgesStavracas,项目名称:gnome-todo,代码行数:22,
示例13: terminal_app_new_windowTerminalWindow *terminal_app_new_window (TerminalApp *app, GdkScreen *screen){ TerminalWindow *window; window = terminal_window_new (G_APPLICATION (app)); if (screen) gtk_window_set_screen (GTK_WINDOW (window), screen); return window;}
开发者ID:pledges,项目名称:gnome-terminal,代码行数:13,
示例14: photos_thumbnailer_initstatic voidphotos_thumbnailer_init (PhotosThumbnailer *self){ setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); photos_gegl_ensure_builtins (); self->cancellables = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, g_object_unref); g_application_add_main_option_entries (G_APPLICATION (self), COMMAND_LINE_OPTIONS);}
开发者ID:GNOME,项目名称:gnome-photos,代码行数:14,
示例15: main/*********************************************************************** main */intmain (int argc, char **argv){ int status; bmd_widgets *a = g_malloc (sizeof (bmd_widgets)); a->app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE); g_signal_connect (a->app, "activate", G_CALLBACK (bmd_activate), (gpointer) a); status = g_application_run (G_APPLICATION (a->app), argc, argv); g_object_unref (a->app); g_free (a); return status;}
开发者ID:mhorauer,项目名称:GTK-Demo-Examples,代码行数:15,
示例16: sflphone_quitvoidsflphone_quit(gboolean force_quit, SFLPhoneClient *client){ if (force_quit || calllist_get_size(current_calls_tab) == 0 || main_window_ask_quit(client)) { dbus_unregister(getpid()); dbus_clean(); account_list_free(); calllist_clean(current_calls_tab); calllist_clean(contacts_tab); calllist_clean(history_tab); free_addressbook(); // make sure all open dialogs get a response signal so that they can close GList* top_level_windows = gtk_window_list_toplevels(); g_list_foreach(top_level_windows, (GFunc)send_response_to_dialogs, NULL);#if GLIB_CHECK_VERSION(2,32,0) g_application_quit(G_APPLICATION(client));#else g_application_release(G_APPLICATION(client));#endif }}
开发者ID:dot-Sean,项目名称:telephony,代码行数:23,
示例17: gbp_greeter_application_addin_add_option_entriesstatic voidgbp_greeter_application_addin_add_option_entries (IdeApplicationAddin *addin, IdeApplication *app){ g_assert (IDE_IS_APPLICATION_ADDIN (addin)); g_assert (G_IS_APPLICATION (app)); g_application_add_main_option (G_APPLICATION (app), "greeter", 'g', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, _("Display a new greeter window"), NULL); g_application_add_main_option (G_APPLICATION (app), "clone", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, _("Begin cloning project from URI"), "URI");}
开发者ID:GNOME,项目名称:gnome-builder,代码行数:23,
示例18: mainint main(int argc, char **argv){ GApplicationFlags flags; GmpvApplication *app; gint status; flags = G_APPLICATION_HANDLES_COMMAND_LINE|G_APPLICATION_HANDLES_OPEN; app = gmpv_application_new(APP_ID, flags); status = g_application_run(G_APPLICATION(app), argc, argv); g_object_unref(app); return status;}
开发者ID:warmsun0220,项目名称:gnome-mpv,代码行数:14,
示例19: terminal_app_initstatic voidterminal_app_init (TerminalApp *app){ gs_unref_object GSettings *settings; gtk_window_set_default_icon_name (GNOME_TERMINAL_ICON_NAME); /* Desktop proxy settings */ app->system_proxy_settings = g_settings_new (SYSTEM_PROXY_SETTINGS_SCHEMA); /* Desktop Interface settings */ app->desktop_interface_settings = g_settings_new (DESKTOP_INTERFACE_SETTINGS_SCHEMA); /* Terminal global settings */ app->global_settings = g_settings_new (TERMINAL_SETTING_SCHEMA);#if GTK_CHECK_VERSION (3, 19, 0) { GtkSettings *gtk_settings; gtk_settings = gtk_settings_get_default (); terminal_app_theme_variant_changed_cb (app->global_settings, TERMINAL_SETTING_THEME_VARIANT_KEY, gtk_settings); g_signal_connect (app->global_settings, "changed::" TERMINAL_SETTING_THEME_VARIANT_KEY, G_CALLBACK (terminal_app_theme_variant_changed_cb), gtk_settings); }#endif /* GTK+ 3.19 */ /* Check if we need to migrate from gconf to dconf */ maybe_migrate_settings (app); /* Get the profiles */ app->profiles_list = terminal_profiles_list_new (); /* Get the encodings */ app->encodings = terminal_encodings_get_builtins (); terminal_app_encoding_list_notify_cb (app->global_settings, "encodings", app); g_signal_connect (app->global_settings, "changed::encodings", G_CALLBACK (terminal_app_encoding_list_notify_cb), app); app->screen_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); settings = g_settings_get_child (app->global_settings, "keybindings"); terminal_accels_init (G_APPLICATION (app), settings);}
开发者ID:PARAG00991,项目名称:gnome-terminal,代码行数:49,
示例20: mainintmain(int argc, char *argv[]){#ifdef ENABLE_NLS bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE);#endif gtk_init(&argc, &argv); /* Create configuration dir ~/.chimara */ gchar *configdir = g_build_filename(g_get_home_dir(), ".chimara", NULL); if(!g_file_test(configdir, G_FILE_TEST_IS_DIR) && g_mkdir(configdir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) g_error("Cannot create configuration directory ~/.chimara"); g_free(configdir); /* Initialize settings file; it can be overridden by a "chimara-config" file in the current directory */ gchar *keyfile; if(g_file_test("chimara-config", G_FILE_TEST_IS_REGULAR)) keyfile = g_strdup("chimara-config"); else keyfile = g_build_filename(g_get_home_dir(), ".chimara", "config", NULL); GSettingsBackend *backend = g_keyfile_settings_backend_new(keyfile, "/org/chimara-if/player/", NULL); prefs_settings = g_settings_new_with_backend("org.chimara-if.player.preferences", backend); state_settings = g_settings_new_with_backend("org.chimara-if.player.state", backend); g_free(keyfile); app = gtk_application_new("org.chimara-if.player", G_APPLICATION_HANDLES_OPEN); g_signal_connect(app, "activate", G_CALLBACK(on_activate), NULL); g_signal_connect(app, "open", G_CALLBACK(on_open), NULL); if( !create_window() ) { error_dialog(NULL, NULL, "Error while building interface."); return 1; } int status = g_application_run(G_APPLICATION(app), argc, argv); g_object_unref(app); chimara_glk_stop(CHIMARA_GLK(glk)); chimara_glk_wait(CHIMARA_GLK(glk)); g_object_unref( G_OBJECT(builder) ); return status;}
开发者ID:chimara,项目名称:Chimara,代码行数:49,
示例21: maingintmain (gint argc, gchar *argv[]){ GtkApplication *app; PhotosRemoteDisplayManager *remote_display_mngr; gint exit_status; bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); g_set_prgname (PACKAGE_TARNAME); app = photos_application_new (); if (g_getenv ("PHOTOS_PERSIST") != NULL) g_application_hold (G_APPLICATION (app)); remote_display_mngr = photos_remote_display_manager_dup_singleton (); exit_status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (remote_display_mngr); g_object_unref (app); return exit_status;}
开发者ID:UIKit0,项目名称:gnome-photos,代码行数:24,
示例22: mainintmain (int argc, char **argv){ gst_init(&argc,&argv); GtkApplication *app; int status; init_socket(); app = gtk_application_new ("smart.house", G_APPLICATION_FLAGS_NONE); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); return status;}
开发者ID:matansagee,项目名称:EEProject,代码行数:15,
示例23: action_killstatic voidaction_kill (GSimpleAction *action, GVariant *parameter, gpointer user_data){ GtkApplication *application = user_data; GList *windows; /* this will also destroy the desktop windows */ windows = gtk_application_get_windows (application); g_list_foreach (windows, (GFunc) gtk_widget_destroy, NULL); /* we have been asked to force quit */ g_application_quit (G_APPLICATION (application));}
开发者ID:KapTmaN,项目名称:nautilus,代码行数:15,
示例24: g_application_finalizestatic voidg_application_finalize (GObject *object){ GApplication *application = G_APPLICATION (object); if (application->priv->impl) g_application_impl_destroy (application->priv->impl); g_free (application->priv->id); if (application->priv->mainloop) g_main_loop_unref (application->priv->mainloop); G_OBJECT_CLASS (g_application_parent_class) ->finalize (object);}
开发者ID:zsx,项目名称:glib,代码行数:15,
示例25: maingintmain (gint argc, gchar *argv[]){ setlocale (LC_CTYPE, ""); bindtextdomain (LOCALE_PACKAGE, LOCALE_DIR); textdomain (LOCALE_PACKAGE); g_print (COLOR_RED APP_NAME " rel. " APP_VERSION COLOR_RESET"/n"); g_print (APP_DESCRIPTION "/n/n"); g_print (APP_COPYRIGHT " " APP_AUTHOR_EMAIL "/n"); g_print (APP_LICENSE "/n"); g_print (APP_GNU_WARN "/n/n"); app_application = gtk_application_new (APP_ID, G_APPLICATION_FLAGS_NONE); g_signal_connect (app_application, "activate", G_CALLBACK (app_activate), NULL); g_signal_connect (app_application, "shutdown", G_CALLBACK (app_shutdown), NULL); g_signal_connect (app_application, "startup", G_CALLBACK (app_startup), NULL); g_application_set_default (G_APPLICATION (app_application)); return g_application_run (G_APPLICATION (app_application), argc, argv);}
开发者ID:strippato,项目名称:gnome-arcade,代码行数:24,
示例26: xfdashboard_application_quit_forcedvoid xfdashboard_application_quit_forced(void){ if(G_LIKELY(application!=NULL)) { /* Quit also any other running instance */ if(g_application_get_is_remote(G_APPLICATION(application))==TRUE) { g_action_group_activate_action(G_ACTION_GROUP(application), "Quit", NULL); } /* Quit this instance */ _xfdashboard_application_quit(application, TRUE); } else clutter_main_quit();}
开发者ID:Zeioth,项目名称:xfdashboard,代码行数:15,
示例27: mainintmain (int argc, char *argv[]){ int ret; const char *xdg_data_dirs; char **dirs = NULL; char *schemas_dir; /* Save XDG_DATA_DIRS to set GSETTINGS_SCHEME_DIR, otherwise we * won't find the sytem schemas. */ xdg_data_dirs = g_getenv ("XDG_DATA_DIRS"); if (xdg_data_dirs) dirs = g_strsplit (xdg_data_dirs, ":", -1); /* We can only use one directory, so use the first one or the system default. */ schemas_dir = g_build_filename (dirs ? dirs[0] : "/usr/share", "glib-2.0", "schemas", NULL); g_setenv ("GSETTINGS_SCHEMA_DIR", schemas_dir, TRUE); g_strfreev (dirs); g_free (schemas_dir); g_setenv ("XDG_DATA_DIRS", TEST_DIR, TRUE); g_setenv ("XDG_DATA_HOME", TEST_DIR, TRUE); gtk_test_init (&argc, &argv); ephy_debug_init (); if (!ephy_file_helpers_init (NULL, EPHY_FILE_HELPERS_PRIVATE_PROFILE | EPHY_FILE_HELPERS_ENSURE_EXISTS, NULL)) { g_debug ("Something wrong happened with ephy_file_helpers_init()"); return -1; } _ephy_shell_create_instance (EPHY_EMBED_SHELL_MODE_TEST); g_application_register (G_APPLICATION (ephy_embed_shell_get_default ()), NULL, NULL); g_test_add_func ("/embed/ephy-embed-shell/launch_handler", test_ephy_embed_shell_launch_handler); g_test_add_func ("/embed/ephy-embed-shell/web-view-created", test_ephy_embed_shell_web_view_created); ret = g_test_run (); g_object_unref (ephy_embed_shell_get_default ()); ephy_file_helpers_shutdown (); return ret;}
开发者ID:Igalia,项目名称:epiphany-gnomeos,代码行数:48,
示例28: gw_application_command_linestatic int gw_application_command_line (GApplication *application, GApplicationCommandLine *command_line){ //Declarations LwDictionary *dictionary; GwSearchWindow *window; GwDictionaryList *dictionarylist; GwApplicationPrivate *priv; gint argc; gchar **argv; gint position; //Initializations priv = GW_APPLICATION (application)->priv; dictionarylist = gw_application_get_installed_dictionarylist (GW_APPLICATION (application)); argv = NULL; if (command_line != NULL) { argv = g_application_command_line_get_arguments (command_line, &argc); gw_application_parse_args (GW_APPLICATION (application), &argc, &argv); } g_application_activate (G_APPLICATION (application)); window = gw_application_get_last_focused_searchwindow (GW_APPLICATION (application)); if (window == NULL) return 0; dictionary = lw_dictionarylist_get_dictionary_fuzzy (LW_DICTIONARYLIST (dictionarylist), priv->arg_dictionary); //Set the initial dictionary if (dictionary != NULL) { position = lw_dictionarylist_get_position (LW_DICTIONARYLIST (dictionarylist), dictionary); gw_searchwindow_set_dictionary (window, position); } //Set the initial query text if it was passed as an argument to the program if (priv->arg_query != NULL) { gw_searchwindow_entry_set_text (window, priv->arg_query); gw_searchwindow_search_cb (GTK_WIDGET (window), window); } //Cleanup if (argv != NULL) g_strfreev (argv); argv = NULL; return 0;}
开发者ID:kyoushuu,项目名称:gwaei,代码行数:48,
注:本文中的G_APPLICATION函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ G_APPLICATION_CLASS函数代码示例 C++ G_ADD_PRIVATE函数代码示例 |