Verified Commit 63b4b16a authored by Zander Brown's avatar Zander Brown
Browse files

Some inital work for implementing the dbus interface

parent 4f18f096
.buildconfig
*~
build
.vscode
project('kgx', 'c', version: '0.1.0',
meson_version: '>= 0.42.0',
meson_version: '>= 0.46.0',
)
i18n = import('i18n')
......
......@@ -20,6 +20,7 @@
#include <vte/vte.h>
#include "rgba.h"
#include "terminal-interface.h"
#include "kgx.h"
#include "kgx-config.h"
......@@ -142,6 +143,41 @@ kgx_application_startup (GApplication *app)
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
}
static gboolean
create_instance (TerminalFactory *interface,
GDBusMethodInvocation *invocation,
const gchar *greeting,
gpointer user_data)
{
terminal_factory_complete_create_instance (interface, invocation, "/org/gnome/Terminal/Factory0/");
return TRUE;
}
static gboolean
kgx_application_dbus_register (GApplication *app,
GDBusConnection *connection,
const gchar *object_path,
GError **error)
{
TerminalFactory *interface = terminal_factory_skeleton_new ();
g_signal_connect (interface,
"handle-create-instance",
G_CALLBACK (create_instance),
app);
if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (interface),
connection,
"/org/gnome/Terminal/Factory0",
error))
{
/* handle error */
}
return TRUE;
}
static void
kgx_application_class_init (KgxApplicationClass *klass)
{
......@@ -153,6 +189,7 @@ kgx_application_class_init (KgxApplicationClass *klass)
app_class->activate = kgx_application_activate;
app_class->startup = kgx_application_startup;
app_class->dbus_register = kgx_application_dbus_register;
pspecs[PROP_THEME] =
g_param_spec_enum ("theme", "Theme", "Terminal theme",
......
......@@ -17,6 +17,13 @@ kgx_sources += gnome.compile_resources('kgx-resources',
c_name: 'kgx'
)
kgx_sources += gnome.gdbus_codegen('terminal-interface',
sources: 'org.gnome.Terminal.xml',
interface_prefix : 'org.gnome.',
object_manager: true,
namespace : 'Terminal'
)
kgx_sources += gnome.mkenums_simple('kgx-enums', sources: 'kgx.h')
executable('kgx', kgx_sources,
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Introspection 0.1//EN"
"http://www.freedesktop.org/software/dbus/introspection.dtd">
<!--
Copyright © 2011 Christian Persch
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope conf it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<node>
<interface name="org.gnome.Terminal.Factory0">
<annotation name="org.gtk.GDBus.C.Name" value="Factory" />
<method name="CreateInstance">
<arg type="a{sv}" name="options" direction="in" />
<arg type="o" name="receiver" direction="out" />
</method>
</interface>
<interface name="org.gnome.Terminal.Terminal0">
<annotation name="org.gtk.GDBus.C.Name" value="Receiver" />
<method name="Exec">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true" />
<arg type="a{sv}" name="options" direction="in" />
<arg type="aay" name="arguments" direction="in">
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="true" />
</arg>
</method>
<signal name="ChildExited">
<arg type="i" name="exit_code" direction="in" />
</signal>
</interface>
</node>
......@@ -7,7 +7,7 @@
}
vte-terminal {
padding: 6px 12px;
padding: 1px 12px;
}
.terminal-window scrolledwindow undershoot.top,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment