mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01: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:
parent
8ff9150e44
commit
0ce1462d1a
@ -148,6 +148,7 @@ application_sources = \
|
||||
gaction.c \
|
||||
gsimpleaction.c \
|
||||
gapplicationcommandline.c \
|
||||
gapplicationimpl.h \
|
||||
gapplicationimpl-dbus.c \
|
||||
gapplication.c
|
||||
|
||||
|
@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 Codethink Limited
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the licence, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Author: Ryan Lortie <desrt@desrt.ca>
|
||||
*/
|
||||
|
||||
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
|
||||
};
|
@ -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: */
|
||||
|
Loading…
Reference in New Issue
Block a user