mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-28 01:57:14 +02:00
GApplication: merge DBus interface into C source
instead of having it in a separate file that causes problems to the build system (I want to avoid using EXTRA_DIST here).
This commit is contained in:
@@ -30,10 +30,85 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "gapplicationimpl-dbus-interface.c"
|
||||
#include "gapplicationcommandline.h"
|
||||
#include "gdbusmethodinvocation.h"
|
||||
|
||||
/* DBus Interface definition {{{1 */
|
||||
static const GDBusArgInfo platform_data_arg = { -1, (gchar *) "platform_data", (gchar *) "a{sv}" };
|
||||
|
||||
static const GDBusArgInfo open_uris_arg = { -1, (gchar *) "uris", (gchar *) "as" };
|
||||
static const GDBusArgInfo open_hint_arg = { -1, (gchar *) "hint", (gchar *) "s" };
|
||||
|
||||
static const GDBusArgInfo invoke_action_name_arg = { -1, (gchar *) "name", (gchar *) "s" };
|
||||
static const GDBusArgInfo invoke_action_args_arg = { -1, (gchar *) "args", (gchar *) "v" };
|
||||
|
||||
static const GDBusArgInfo cmdline_path_arg = { -1, (gchar *) "path", (gchar *) "o" };
|
||||
static const GDBusArgInfo cmdline_arguments_arg = { -1, (gchar *) "arguments", (gchar *) "aay" };
|
||||
static const GDBusArgInfo cmdline_exit_status_arg = { -1, (gchar *) "exit_status", (gchar *) "i" };
|
||||
|
||||
static const GDBusArgInfo *activate_in[] = { &platform_data_arg, NULL };
|
||||
static const GDBusArgInfo *activate_out[] = { NULL };
|
||||
|
||||
static const GDBusArgInfo *open_in[] = { &open_uris_arg, &open_hint_arg, &platform_data_arg, NULL };
|
||||
static const GDBusArgInfo *open_out[] = { NULL };
|
||||
|
||||
static const GDBusArgInfo *cmdline_in[] = { &cmdline_path_arg, &cmdline_arguments_arg, &platform_data_arg, NULL };
|
||||
static const GDBusArgInfo *cmdline_out[] = { &cmdline_exit_status_arg, NULL };
|
||||
|
||||
static const GDBusMethodInfo activate_method = {
|
||||
-1, (gchar *) "Activate",
|
||||
(GDBusArgInfo **) activate_in,
|
||||
(GDBusArgInfo **) activate_out
|
||||
};
|
||||
|
||||
static const GDBusMethodInfo open_method = {
|
||||
-1, (gchar *) "Open",
|
||||
(GDBusArgInfo **) open_in,
|
||||
(GDBusArgInfo **) open_out
|
||||
};
|
||||
|
||||
static const GDBusMethodInfo command_line_method = {
|
||||
-1, (gchar *) "CommandLine",
|
||||
(GDBusArgInfo **) cmdline_in,
|
||||
(GDBusArgInfo **) cmdline_out
|
||||
};
|
||||
|
||||
static const GDBusMethodInfo *application_methods[] = {
|
||||
&activate_method, &open_method, &command_line_method, NULL
|
||||
};
|
||||
|
||||
const GDBusInterfaceInfo org_gtk_Application = {
|
||||
-1, (gchar *) "org.gtk.Application",
|
||||
(GDBusMethodInfo **) application_methods
|
||||
};
|
||||
|
||||
static const GDBusArgInfo message_arg = { -1, (gchar *) "message", (gchar *) "s" };
|
||||
static const GDBusArgInfo *print_in[] = { &message_arg, NULL };
|
||||
static const GDBusArgInfo *print_out[] = { NULL };
|
||||
|
||||
static const GDBusMethodInfo stdout_method = {
|
||||
-1, (gchar *) "Print",
|
||||
(GDBusArgInfo **) print_in,
|
||||
(GDBusArgInfo **) print_out
|
||||
};
|
||||
|
||||
static const GDBusMethodInfo stderr_method = {
|
||||
-1, (gchar *) "PrintError",
|
||||
(GDBusArgInfo **) print_in,
|
||||
(GDBusArgInfo **) print_out
|
||||
};
|
||||
|
||||
static const GDBusMethodInfo *cmdline_methods[] = {
|
||||
&stdout_method, &stderr_method, NULL
|
||||
};
|
||||
|
||||
const GDBusInterfaceInfo org_gtk_private_Cmdline = {
|
||||
-1, (gchar *) "org.gtk.private.CommandLine",
|
||||
(GDBusMethodInfo **) cmdline_methods
|
||||
};
|
||||
|
||||
|
||||
/* GApplication implementation {{{1 */
|
||||
struct _GApplicationImpl
|
||||
{
|
||||
GDBusConnection *session_bus;
|
||||
@@ -427,8 +502,7 @@ g_application_impl_flush (GApplicationImpl *impl)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* GDBusCommandLine implementation {{{1 */
|
||||
|
||||
typedef GApplicationCommandLineClass GDBusCommandLineClass;
|
||||
static GType g_dbus_command_line_get_type (void);
|
||||
@@ -526,3 +600,7 @@ g_dbus_command_line_new (GDBusMethodInvocation *invocation)
|
||||
|
||||
return G_APPLICATION_COMMAND_LINE (gdbcl);
|
||||
}
|
||||
|
||||
/* Epilogue {{{1 */
|
||||
|
||||
/* vim:set foldmethod=marker: */
|
||||
|
Reference in New Issue
Block a user