• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ G_APPLICATION函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中G_APPLICATION函数的典型用法代码示例。如果您正苦于以下问题:C++ G_APPLICATION函数的具体用法?C++ G_APPLICATION怎么用?C++ G_APPLICATION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了G_APPLICATION函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int 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,代码来源:helloworld.c


示例2: main

int 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,代码来源:main.c


示例3: main

int 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,代码来源:main.c


示例4: main

int
main (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,代码来源:nautilus-main.c


示例5: photos_thumbnailer_finalize

static void
photos_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,代码来源:photos-thumbnailer.c


示例6: main

int 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,代码来源:GSistant.cpp


示例7: main

int
main (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,代码来源:main.c


示例8: main

int
main (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,代码来源:test-window.c


示例9: main

int
main(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,代码来源:remote-viewer-main.c


示例10: main

int
main (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,代码来源:test-kinetic-scroll-view.c


示例11: gedit_app_init

static void
gedit_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,代码来源:gedit-app.c


示例12: main

int
main (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,代码来源:main.c


示例13: terminal_app_new_window

TerminalWindow *
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,代码来源:terminal-app.c


示例14: photos_thumbnailer_init

static void
photos_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,代码来源:photos-thumbnailer.c


示例15: main

/*********************************************************************** main */
int
main (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,代码来源:bmd_classicmenu.c


示例16: sflphone_quit

void
sflphone_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,代码来源:actions.c


示例17: gbp_greeter_application_addin_add_option_entries

static void
gbp_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,代码来源:gbp-greeter-application-addin.c


示例18: main

int 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,代码来源:gmpv_main.c


示例19: terminal_app_init

static void
terminal_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,代码来源:terminal-app.c


示例20: main

int
main(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,代码来源:main.c



注:本文中的G_APPLICATION函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ G_APPLICATION_CLASS函数代码示例发布时间:2022-05-30
下一篇:
C++ G_ADD_PRIVATE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap