当前位置: 首页>>代码示例>>C++>>正文


C++ G_APPLICATION函数代码示例

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


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


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