mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
0e671286fc
Add support for parsing command line options with GApplication. You can add GOptionGroup and GOptionEntry using two new APIs: g_application_add_option_group() and g_application_add_main_option_entries(). Also add a "handle-local-options" signal that allows handling of commandline arguments in the local process without having to override local_command_line. As a special feature, you can have a %NULL @arg_data in a GOptionEntry which will cause the argument to be stored in a GVariantDict. This dictionary is available for inspection and modification by the "handle-local-options" signal and can be forwarded to the primary instance in cases of command line invocation (where it can be fetched using g_application_command_line_get_options()). https://bugzilla.gnome.org/show_bug.cgi?id=721977
45 lines
2.5 KiB
C
45 lines
2.5 KiB
C
#include "giotypes.h"
|
|
|
|
typedef struct _GApplicationImpl GApplicationImpl;
|
|
|
|
typedef struct
|
|
{
|
|
gchar *name;
|
|
|
|
GVariantType *parameter_type;
|
|
gboolean enabled;
|
|
GVariant *state;
|
|
} RemoteActionInfo;
|
|
|
|
void g_application_impl_destroy (GApplicationImpl *impl);
|
|
|
|
GApplicationImpl * g_application_impl_register (GApplication *application,
|
|
const gchar *appid,
|
|
GApplicationFlags flags,
|
|
GActionGroup *exported_actions,
|
|
GRemoteActionGroup **remote_actions,
|
|
GCancellable *cancellable,
|
|
GError **error);
|
|
|
|
void g_application_impl_activate (GApplicationImpl *impl,
|
|
GVariant *platform_data);
|
|
|
|
void g_application_impl_open (GApplicationImpl *impl,
|
|
GFile **files,
|
|
gint n_files,
|
|
const gchar *hint,
|
|
GVariant *platform_data);
|
|
|
|
int g_application_impl_command_line (GApplicationImpl *impl,
|
|
const gchar *const *arguments,
|
|
GVariant *platform_data);
|
|
|
|
void g_application_impl_flush (GApplicationImpl *impl);
|
|
|
|
GDBusConnection * g_application_impl_get_dbus_connection (GApplicationImpl *impl);
|
|
|
|
const gchar * g_application_impl_get_dbus_object_path (GApplicationImpl *impl);
|
|
|
|
void g_application_impl_set_busy_state (GApplicationImpl *impl,
|
|
gboolean busy);
|