1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright © 2010 Red Hat, Inc
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Authors: Colin Walters <walters@verbum.org>
21 * Emmanuele Bassi <ebassi@linux.intel.com>
29 #include <gobject/gvaluecollector.h>
31 #include "gapplication.h"
32 #include "gio-marshal.h"
37 #include "gdbusconnection.h"
38 #include "gdbusintrospection.h"
39 #include "gdbusmethodinvocation.h"
44 * SECTION: gapplication
45 * @title: GApplication
46 * @short_description: Core application class
48 * A #GApplication is the foundation of an application, unique for
49 * a given application identifier. The #GApplication wraps some
50 * low-level platform-specific services; it's expected that most
51 * software will use a higher-level application class such as
52 * #GtkApplication or #MxApplication.
54 * In addition to single-instance-ness, #GApplication provides support
55 * for 'actions', which can be presented to the user in a platform-specific
56 * way (e.g. Windows 7 jump lists). Note that these are just simple actions
57 * without parameters. For more flexible scriptability, implementing a
58 * a separate D-Bus interface is recommended, see e.g.
59 * <xref linkend="gdbus-convenience"/>.
61 * Before using #GApplication, you must choose an "application identifier".
62 * The expected form of an application identifier is very close to that of
63 * of a <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
64 * Examples include: "com.example.MyApp" "org.example.internal-apps.Calculator"
65 * For convenience, the restrictions on application identifiers are reproduced
68 * <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-" and must not begin with a digit.</listitem>
69 * <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least two elements).</listitem>
70 * <listitem>Application identifiers must not begin with a '.' (period) character.</listitem>
71 * <listitem>Application identifiers must not exceed 255 characters.</listitem>
74 * <refsect2><title>D-Bus implementation</title>
76 * On UNIX systems using D-Bus, #GApplication is implemented by claiming the
77 * application identifier as a bus name on the session bus. The implementation
78 * exports an object at the object path that is created by replacing '.' with
79 * '/' in the application identifier (e.g. the object path for the
80 * application id 'org.gtk.TestApp' is '/org/gtk/TestApp'). The object
81 * implements the org.gtk.Application interface.
83 * <classsynopsis class="interface">
84 * <ooclass><interfacename>org.gtk.Application</interfacename></ooclass>
87 * <methodname>Activate</methodname>
88 * <methodparam><modifier>in</modifier><type>aay</type><parameter>arguments</parameter></methodparam>
89 * <methodparam><modifier>in</modifier><type>a{sv}</type><parameter>data</parameter></methodparam>
93 * <methodname>InvokeAction</methodname>
94 * <methodparam><modifier>in</modifier><type>s</type><parameter>action</parameter></methodparam>
95 * <methodparam><modifier>in</modifier><type>u</type><parameter>timestamp</parameter></methodparam>
98 * <type>a{s(sb)}</type>
99 * <methodname>ListActions</methodname>
104 * <methodname>Quit</methodname>
105 * <methodparam><modifier>in</modifier><type>u</type><parameter>timestamp</parameter></methodparam>
108 * <modifier>Signal</modifier>
110 * <methodname>ActionsChanged</methodname>
115 * The <methodname>Activate</methodname> function is called on the existing
116 * application instance when a second instance fails to take the bus name.
117 * @arguments contains the commandline arguments given to the second instance
118 * and @data contains platform-specific additional data, see
119 * g_application_format_activation_data().
122 * The <methodname>InvokeAction</methodname> function can be called to invoke
123 * one of the actions exported by the application. The @timestamp parameter
124 * should be taken from the user event that triggered the method call (e.g.
125 * a button press event).
128 * The <methodname>ListActions</methodname> function returns a dictionary
129 * with the exported actions of the application. The keys of the dictionary
130 * are the action names, and the values are structs containing the description
131 * for the action and a boolean that represents if the action is enabled or not.
134 * The <methodname>Quit</methodname> function can be called to terminate
135 * the application. The @timestamp parameter should be taken from the user
136 * event that triggered the method call (e.g. a button press event).
139 * The <methodname>ActionsChanged</methodname> signal is emitted when the
140 * exported actions change (i.e. an action is added, removed, enabled,
141 * disabled, or otherwise changed).
144 * #GApplication is supported since Gio 2.26.
149 G_DEFINE_TYPE (GApplication, g_application, G_TYPE_OBJECT);
169 static guint application_signals[LAST_SIGNAL] = { 0 };
175 } GApplicationAction;
177 struct _GApplicationPrivate
180 GHashTable *actions; /* name -> GApplicationAction */
183 guint default_quit : 1;
186 guint actions_changed_id;
190 GDBusConnection *session_bus;
194 static GApplication *primary_application = NULL;
195 static GHashTable *instances_for_appid = NULL;
197 static void _g_application_platform_init (GApplication *app);
198 static gboolean _g_application_platform_acquire_single_instance (GApplication *app,
200 static void _g_application_platform_remote_invoke_action (GApplication *app,
203 static void _g_application_platform_remote_quit (GApplication *app,
205 static void _g_application_platform_activate (GApplication *app,
206 GVariant *data) G_GNUC_NORETURN;
207 static void _g_application_platform_on_actions_changed (GApplication *app);
210 #include "gdbusapplication.c"
212 #include "gnullapplication.c"
216 _g_application_validate_id (const char *id)
220 if (strlen (id) > 255)
223 if (!g_ascii_isalpha (*id))
230 if (g_ascii_isalnum (*id) || (*id == '-') || (*id == '_'))
232 else if (allow_dot && *id == '.')
241 init_appid_statics (gpointer data)
243 instances_for_appid = g_hash_table_new (g_str_hash, g_str_equal);
247 static GApplication *
248 application_for_appid (const char *appid)
250 static GOnce appid_once = G_ONCE_INIT;
252 g_once (&appid_once, init_appid_statics, NULL);
254 return g_hash_table_lookup (instances_for_appid, appid);
258 g_application_default_quit (GApplication *application,
261 g_return_val_if_fail (application->priv->mainloop != NULL, FALSE);
262 g_main_loop_quit (application->priv->mainloop);
268 g_application_default_run (GApplication *application)
270 if (application->priv->mainloop == NULL)
271 application->priv->mainloop = g_main_loop_new (NULL, TRUE);
273 g_main_loop_run (application->priv->mainloop);
277 _g_application_handle_activation (GApplication *app,
280 GVariant *platform_data)
282 GVariantBuilder builder;
286 g_variant_builder_init (&builder, G_VARIANT_TYPE ("(aaya{sv})"));
287 g_variant_builder_open (&builder, G_VARIANT_TYPE ("aay"));
289 for (i = 1; i < argc; i++)
294 g_variant_builder_open (&builder, G_VARIANT_TYPE ("ay"));
296 argv_bytes = (guint8*) argv[i];
297 for (j = 0; argv_bytes[j]; j++)
298 g_variant_builder_add_value (&builder,
299 g_variant_new_byte (argv_bytes[j]));
300 g_variant_builder_close (&builder);
302 g_variant_builder_close (&builder);
305 g_variant_builder_add (&builder, "@a{sv}", platform_data);
308 g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}"));
309 g_variant_builder_close (&builder);
312 message = g_variant_builder_end (&builder);
313 _g_application_platform_activate (app, message);
314 g_variant_unref (message);
318 timeout_handle_actions_changed (gpointer user_data)
320 GApplication *application = user_data;
322 application->priv->actions_changed_id = 0;
324 _g_application_platform_on_actions_changed (application);
330 queue_actions_change_notification (GApplication *application)
332 GApplicationPrivate *priv = application->priv;
334 if (priv->actions_changed_id == 0)
335 priv->actions_changed_id = g_timeout_add (0, timeout_handle_actions_changed, application);
339 g_application_action_free (gpointer data)
341 if (G_LIKELY (data != NULL))
343 GApplicationAction *action = data;
345 g_free (action->name);
346 g_free (action->description);
348 g_slice_free (GApplicationAction, action);
355 * @appid: System-dependent application identifier
357 * Create a new #GApplication. The application is initially in
358 * "remote" mode. Almost certainly, you want to call
359 * g_application_register() immediately after this function, which
360 * will finish initialization.
362 * As a convenience, this function is defined to call g_type_init() as
363 * its very first action.
365 * Returns: (transfer full): An application instance
370 g_application_new (const gchar *appid)
374 return G_APPLICATION (g_object_new (G_TYPE_APPLICATION, "application-id", appid, NULL));
378 * g_application_register_with_data:
379 * @application: A #GApplication
380 * @argc: System argument count
381 * @argv: (array length=argc): System argument vector
382 * @platform_data: (allow-none): Arbitrary platform-specific data, must have signature "a{sv}"
384 * Ensure the current process is the unique owner of the application.
385 * If successful, the #GApplication:is-remote property will be changed
386 * to %FALSE, and it is safe to continue creating other resources
387 * such as graphics windows.
389 * If the given @appid is already running in another process, the
390 * #GApplication:default-exit property will be evaluated. If it's
391 * %TRUE, then a platform-specific action such as bringing any
392 * graphics windows associated with the application to the foreground
393 * may be initiated. After that, the current process will terminate.
394 * If %FALSE, then the application remains in the #GApplication:is-remote
395 * state, and you can e.g. call g_application_invoke_action().
398 g_application_register_with_data (GApplication *application,
401 GVariant *platform_data)
403 g_return_if_fail (application->priv->appid != NULL);
404 g_return_if_fail (application->priv->is_remote);
405 g_return_if_fail (platform_data == NULL
406 || strcmp (g_variant_get_type_string (platform_data), "a{sv}") == 0);
408 if (!_g_application_platform_acquire_single_instance (application, NULL))
410 if (application->priv->default_quit)
411 _g_application_handle_activation (application, argc, argv, platform_data);
416 application->priv->is_remote = FALSE;
418 _g_application_platform_init (application);
422 * g_application_new_and_register:
423 * @appid: An application identifier
424 * @argc: System argument count
425 * @argv: (array length=argc): System argument vector
427 * This is a convenience function which combines g_application_new()
428 * with g_application_register_with_data().
431 g_application_new_and_register (const gchar *appid,
435 GApplication *app = g_application_new (appid);
436 g_application_register_with_data (app, argc, argv, NULL);
441 * g_application_add_action:
442 * @application: a #GApplication
443 * @name: the action name
444 * @description: the action description; can be a translatable
447 * Adds an action @name to the list of exported actions of @application.
449 * It is an error to call this function if @application is a proxy for
450 * a remote application.
452 * You can invoke an action using g_application_invoke_action().
454 * The newly added action is enabled by default; you can call
455 * g_application_set_action_enabled() to disable it.
460 g_application_add_action (GApplication *application,
462 const gchar *description)
464 GApplicationPrivate *priv;
465 GApplicationAction *action;
467 g_return_if_fail (G_IS_APPLICATION (application));
468 g_return_if_fail (name != NULL && *name != '\0');
469 g_return_if_fail (!application->priv->is_remote);
471 priv = application->priv;
473 g_return_if_fail (g_hash_table_lookup (priv->actions, name) == NULL);
475 action = g_slice_new (GApplicationAction);
476 action->name = g_strdup (name);
477 action->description = g_strdup (description);
478 action->enabled = TRUE;
480 g_hash_table_insert (priv->actions, action->name, action);
481 queue_actions_change_notification (application);
485 * g_application_remove_action:
486 * @application: a #GApplication
487 * @name: the name of the action to remove
489 * Removes the action @name from the list of exported actions of @application.
491 * It is an error to call this function if @application is a proxy for
492 * a remote application.
497 g_application_remove_action (GApplication *application,
500 GApplicationPrivate *priv;
502 g_return_if_fail (G_IS_APPLICATION (application));
503 g_return_if_fail (name != NULL && *name != '\0');
504 g_return_if_fail (!application->priv->is_remote);
506 priv = application->priv;
508 g_return_if_fail (g_hash_table_lookup (priv->actions, name) != NULL);
510 g_hash_table_remove (priv->actions, name);
511 queue_actions_change_notification (application);
515 * g_application_invoke_action:
516 * @application: a #GApplication
517 * @name: the name of the action to invoke
518 * @timestamp: the timestamp that is going to be passed to
519 * the #GApplication::action signal
521 * Invokes the action @name of the passed #GApplication.
523 * This function has different behavior depending on whether @application
524 * is acting as a proxy for another process. In the normal case where
525 * the current process is hosting the application, and the specified
526 * action exists and is enabled, the #GApplication::action signal will
529 * If @application is a proxy, then the specified action will be invoked
530 * in the remote process. It is not necessary to call
531 * g_application_add_action() in the current process in order to invoke
537 g_application_invoke_action (GApplication *application,
541 GApplicationPrivate *priv;
542 GApplicationAction *action;
544 g_return_if_fail (G_IS_APPLICATION (application));
545 g_return_if_fail (name != NULL);
547 priv = application->priv;
551 _g_application_platform_remote_invoke_action (application, name, timestamp);
555 action = g_hash_table_lookup (priv->actions, name);
556 g_return_if_fail (action != NULL);
557 if (!action->enabled)
560 g_signal_emit (application, application_signals[ACTION],
561 g_quark_from_string (name),
567 * g_application_list_actions:
568 * @application: a #GApplication
570 * Retrieves the list of action names currently exported by @application.
572 * It is an error to call this function if @application is a proxy for
573 * a remote application.
575 * Return value: (transfer full): a newly allocation, %NULL-terminated array
576 * of strings containing action names; use g_strfreev() to free the
577 * resources used by the returned array
582 g_application_list_actions (GApplication *application)
584 GApplicationPrivate *priv;
590 g_return_val_if_fail (G_IS_APPLICATION (application), NULL);
591 g_return_val_if_fail (!application->priv->is_remote, NULL);
593 priv = application->priv;
595 retval = g_new (gchar*, g_hash_table_size (priv->actions));
598 g_hash_table_iter_init (&iter, priv->actions);
599 while (g_hash_table_iter_next (&iter, &key, NULL))
600 retval[i++] = g_strdup (key);
608 * g_application_set_action_enabled:
609 * @application: a #GApplication
610 * @name: the name of the application
611 * @enabled: whether to enable or disable the action @name
613 * Sets whether the action @name inside @application should be enabled
616 * It is an error to call this function if @application is a proxy for
617 * a remote application.
619 * Invoking a disabled action will not result in the #GApplication::action
620 * signal being emitted.
625 g_application_set_action_enabled (GApplication *application,
629 GApplicationAction *action;
631 g_return_if_fail (G_IS_APPLICATION (application));
632 g_return_if_fail (name != NULL);
633 g_return_if_fail (!application->priv->is_remote);
637 action = g_hash_table_lookup (application->priv->actions, name);
638 g_return_if_fail (action != NULL);
639 if (action->enabled == enabled)
642 action->enabled = enabled;
644 queue_actions_change_notification (application);
649 * g_application_get_action_description:
650 * @application: a #GApplication
653 * Gets the description of the action @name.
655 * It is an error to call this function if @application is a proxy for
656 * a remote application.
658 * Returns: Description for the given action named @name
662 G_CONST_RETURN gchar *
663 g_application_get_action_description (GApplication *application,
666 GApplicationAction *action;
668 g_return_val_if_fail (G_IS_APPLICATION (application), NULL);
669 g_return_val_if_fail (name != NULL, NULL);
670 g_return_val_if_fail (!application->priv->is_remote, NULL);
672 action = g_hash_table_lookup (application->priv->actions, name);
673 g_return_val_if_fail (action != NULL, NULL);
675 return action->description;
680 * g_application_get_action_enabled:
681 * @application: a #GApplication
682 * @name: the name of the action
684 * Retrieves whether the action @name is enabled or not.
686 * See g_application_set_action_enabled().
688 * It is an error to call this function if @application is a proxy for
689 * a remote application.
691 * Return value: %TRUE if the action was enabled, and %FALSE otherwise
696 g_application_get_action_enabled (GApplication *application,
699 GApplicationAction *action;
701 g_return_val_if_fail (G_IS_APPLICATION (application), FALSE);
702 g_return_val_if_fail (name != NULL, FALSE);
703 g_return_val_if_fail (!application->priv->is_remote, FALSE);
705 action = g_hash_table_lookup (application->priv->actions, name);
706 g_return_val_if_fail (action != NULL, FALSE);
708 return action->enabled;
713 * @application: a #GApplication
715 * Starts the application.
717 * The default implementation of this virtual function will simply run
720 * It is an error to call this function if @application is a proxy for
721 * a remote application.
726 g_application_run (GApplication *application)
728 g_return_if_fail (G_IS_APPLICATION (application));
729 g_return_if_fail (!application->priv->is_remote);
731 G_APPLICATION_GET_CLASS (application)->run (application);
735 * g_application_quit:
736 * @application: a #GApplication
737 * @timestamp: Platform-specific event timestamp, may be 0 for default
739 * Request that the application quits.
741 * This function has different behavior depending on whether @application
742 * is acting as a proxy for another process. In the normal case where
743 * the current process is hosting the application, the default
744 * implementation will quit the main loop created by g_application_run().
746 * If @application is a proxy, then the remote process will be asked
749 * Returns: %TRUE if the application accepted the request, %FALSE otherwise
754 g_application_quit (GApplication *application,
757 gboolean retval = FALSE;
759 g_return_val_if_fail (G_IS_APPLICATION (application), FALSE);
761 if (application->priv->is_remote)
763 _g_application_platform_remote_quit (application, timestamp);
767 g_signal_emit (application, application_signals[QUIT], 0, timestamp, &retval);
773 * g_application_get_instance:
775 * In the normal case where there is exactly one #GApplication instance
776 * in this process, return that instance. If there are multiple, the
777 * first one created will be returned. Otherwise, return %NULL.
779 * Returns: (transfer none): The primary instance of #GApplication,
780 * or %NULL if none is set
785 g_application_get_instance (void)
787 return primary_application;
791 * g_application_get_id:
793 * Retrieves the platform-specific identifier for the #GApplication.
795 * Return value: The platform-specific identifier. The returned string
796 * is owned by the #GApplication instance and it should never be
801 G_CONST_RETURN gchar *
802 g_application_get_id (GApplication *application)
804 g_return_val_if_fail (G_IS_APPLICATION (application), NULL);
806 return application->priv->appid;
810 * g_application_is_remote:
811 * @application: a #GApplication
813 * Returns: %TRUE if this object represents a proxy for a remote application.
816 g_application_is_remote (GApplication *application)
818 g_return_val_if_fail (G_IS_APPLICATION (application), FALSE);
820 return application->priv->is_remote;
824 g_application_init (GApplication *app)
826 app->priv = G_TYPE_INSTANCE_GET_PRIVATE (app,
828 GApplicationPrivate);
830 app->priv->actions = g_hash_table_new_full (g_str_hash, g_str_equal,
832 g_application_action_free);
833 app->priv->default_quit = TRUE;
834 app->priv->is_remote = TRUE;
838 g_application_get_property (GObject *object,
843 GApplication *app = G_APPLICATION (object);
847 case PROP_APPLICATION_ID:
848 g_value_set_string (value, g_application_get_id (app));
851 case PROP_DEFAULT_QUIT:
852 g_value_set_boolean (value, app->priv->default_quit);
856 g_value_set_boolean (value, g_application_is_remote (app));
860 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
865 g_application_set_property (GObject *object,
870 GApplication *app = G_APPLICATION (object);
874 case PROP_APPLICATION_ID:
875 g_return_if_fail (_g_application_validate_id (g_value_get_string (value)));
876 app->priv->appid = g_value_dup_string (value);
879 case PROP_DEFAULT_QUIT:
880 app->priv->default_quit = g_value_get_boolean (value);
884 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
889 g_application_constructor (GType type,
890 guint n_construct_properties,
891 GObjectConstructParam *construct_params)
895 const char *appid = NULL;
898 for (i = 0; i < n_construct_properties; i++)
900 GObjectConstructParam *param = &construct_params[i];
901 if (strcmp (param->pspec->name, "application-id") == 0)
902 appid = g_value_get_string (param->value);
905 g_return_val_if_fail (appid != NULL, NULL);
907 app = application_for_appid (appid);
909 return g_object_ref (app);
911 object = (* G_OBJECT_CLASS (g_application_parent_class)->constructor) (type,
912 n_construct_properties,
914 app = G_APPLICATION (object);
916 if (primary_application == NULL)
917 primary_application = app;
918 g_hash_table_insert (instances_for_appid, g_strdup (appid), app);
924 g_application_finalize (GObject *object)
926 GApplication *app = G_APPLICATION (object);
928 g_free (app->priv->appid);
929 if (app->priv->actions)
930 g_hash_table_unref (app->priv->actions);
931 if (app->priv->actions_changed_id)
932 g_source_remove (app->priv->actions_changed_id);
933 if (app->priv->mainloop)
934 g_main_loop_unref (app->priv->mainloop);
937 g_free (app->priv->dbus_path);
938 if (app->priv->session_bus)
939 g_object_unref (app->priv->session_bus);
942 G_OBJECT_CLASS (g_application_parent_class)->finalize (object);
946 g_application_class_init (GApplicationClass *klass)
948 GObjectClass *gobject_class G_GNUC_UNUSED = G_OBJECT_CLASS (klass);
950 g_type_class_add_private (klass, sizeof (GApplicationPrivate));
952 gobject_class->constructor = g_application_constructor;
953 gobject_class->set_property = g_application_set_property;
954 gobject_class->get_property = g_application_get_property;
956 gobject_class->finalize = g_application_finalize;
958 klass->run = g_application_default_run;
959 klass->quit = g_application_default_quit;
962 * GApplication::quit:
963 * @application: the object on which the signal is emitted
964 * @timestamp: Platform-specific event timestamp, may be 0 for default
966 * This signal is emitted when the Quit action is invoked on the
969 * The default handler for this signal exits the mainloop of the
972 * Returns: %TRUE if the signal has been handled, %FALSE to continue
975 application_signals[QUIT] =
976 g_signal_new (g_intern_static_string ("quit"),
977 G_OBJECT_CLASS_TYPE (klass),
979 G_STRUCT_OFFSET (GApplicationClass, quit),
980 g_signal_accumulator_true_handled, NULL,
981 _gio_marshal_BOOLEAN__UINT,
986 * GApplication::action:
987 * @application: the object on which the signal is emitted
988 * @name: The name of the activated action
989 * @timestamp: Platform-specific event timestamp, may be 0 for default
991 * This signal is emitted when an action is activated. The action name
992 * is passed as the first argument, but also as signal detail, so it
993 * is possible to connect to this signal for individual actions.
995 * The signal is never emitted for disabled actions.
997 application_signals[ACTION] =
998 g_signal_new (g_intern_static_string ("action"),
999 G_OBJECT_CLASS_TYPE (klass),
1000 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED,
1001 G_STRUCT_OFFSET (GApplicationClass, action),
1003 _gio_marshal_VOID__STRING_INT,
1009 * GApplication::prepare-activation:
1010 * @application: the object on which the signal is emitted
1011 * @arguments: A #GVariant with the signature "aay"
1012 * @platform_data: A #GVariant with the signature "a{sv}"
1014 * This signal is emitted when a non-primary process for a given
1015 * application is invoked while your application is running; for
1016 * example, when a file browser launches your program to open a
1017 * file. The raw operating system arguments are passed in the
1018 * @arguments variant. Additional platform-dependent data is
1019 * stored in @platform_data.
1021 application_signals[PREPARE_ACTIVATION] =
1022 g_signal_new (g_intern_static_string ("prepare-activation"),
1023 G_OBJECT_CLASS_TYPE (klass),
1025 G_STRUCT_OFFSET (GApplicationClass, prepare_activation),
1027 _gio_marshal_VOID__BOXED_BOXED,
1033 * GApplication:application-id:
1035 * The unique identifier for this application. See the documentation for
1036 * #GApplication for more information about this property.
1039 g_object_class_install_property (gobject_class,
1040 PROP_APPLICATION_ID,
1041 g_param_spec_string ("application-id",
1042 P_("Application ID"),
1043 P_("Identifier for this application"),
1046 G_PARAM_CONSTRUCT_ONLY |
1047 G_PARAM_STATIC_STRINGS));
1050 * GApplication:default-quit:
1052 * By default, if a different process is running this application, the
1053 * process will be exited. Set this property to %FALSE to allow custom
1054 * interaction with the remote process.
1057 g_object_class_install_property (gobject_class,
1059 g_param_spec_boolean ("default-quit",
1061 P_("Exit the process by default"),
1064 G_PARAM_CONSTRUCT_ONLY |
1065 G_PARAM_STATIC_STRINGS));
1069 * GApplication:is-remote:
1071 * This property is %TRUE if this application instance represents a proxy
1072 * to the instance of this application in another process.
1075 g_object_class_install_property (gobject_class,
1077 g_param_spec_boolean ("is-remote",
1079 P_("Whether this application is a proxy for another process"),
1081 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
1084 #define __G_APPLICATION_C__
1085 #include "gioaliasdef.c"