Commit bb85885e authored by Daiki Ueno's avatar Daiki Ueno

Revamp server-client API.

parent dd085be7
......@@ -41,6 +41,7 @@ eek/*.typelib
eekboard/*.pc
eekboard/*.gir
eekboard/*.typelib
eekboard/eekboard-marshalers.[ch]
tests/eek-simple-test
tests/eek-xkb-test
tests/eek-xml-test
......
......@@ -21,7 +21,7 @@ import gobject
from context import Context
class Eekboard(gobject.GObject):
__gtype_name__ = "PYEekboardEekboard"
__gtype_name__ = "PYEekboardClient"
__gsignals__ = {
'destroyed': (
gobject.SIGNAL_RUN_LAST,
......@@ -32,18 +32,18 @@ class Eekboard(gobject.GObject):
def __init__(self):
super(Eekboard, self).__init__()
self.__connection = Gio.bus_get_sync(Gio.BusType.SESSION, None)
self.__eekboard = gi.repository.Eekboard.Eekboard.new(self.__connection, None);
self.__eekboard.connect('destroyed', lambda *args: self.emit('destroyed'))
self.__client = gi.repository.Eekboard.Client.new(self.__connection, None);
self.__client.connect('destroyed', lambda *args: self.emit('destroyed'))
def create_context(self, client_name):
context = self.__eekboard.create_context(client_name, None)
context = self.__client.create_context(client_name, None)
return Context(context)
def push_context(self, context):
self.__eekboard.push_context(context.get_giobject(), None)
self.__client.push_context(context.get_giobject(), None)
def pop_context(self):
self.__eekboard.pop_context(None)
self.__client.pop_context(None)
def destroy_context(self, context):
self.__eekboard.destroy_context(context.get_giobject(), None)
self.__client.destroy_context(context.get_giobject(), None)
......@@ -18,29 +18,43 @@
lib_LTLIBRARIES = libeekboard.la
libeekboard_headers = \
eekboard.h \
eekboard-eekboard.h \
eekboard-context.h
libeekboard_private_headers = \
libeekboard_headers = \
eekboard-service.h \
eekboard-context-service.h \
eekboard-client.h \
eekboard-context.h \
eekboard-xklutil.h
libeekboard_private_headers = \
eekboard-marshalers.h
libeekboard_sources = \
eekboard-eekboard.c \
eekboard-context.c
eekboard-service.c \
eekboard-context-service.c \
eekboard-client.c \
eekboard-context.c \
eekboard-xklutil.c
libeekboard_marshalers_sources = \
eekboard-marshalers.c \
eekboard-marshalers.c \
eekboard-marshalers.h
BUILT_SOURCES = \
BUILT_SOURCES = \
$(libeekboard_marshalers_sources)
libeekboard_la_SOURCES = \
$(libeekboard_sources) \
libeekboard_la_SOURCES = \
$(libeekboard_sources) \
eekboard-marshalers.c
libeekboard_la_CFLAGS = -DEEKBOARD_COMPILATION=1 -I$(top_srcdir) $(GIO2_CFLAGS)
libeekboard_la_LIBADD = $(top_builddir)/eek/libeek.la $(GIO2_LIBS)
libeekboard_la_CFLAGS = \
-DEEKBOARD_COMPILATION=1 \
-DKEYBOARDDIR=\"$(pkgdatadir)/keyboards\" \
-I$(top_srcdir) \
$(GIO2_CFLAGS) \
$(LIBXKLAVIER_CFLAGS)
libeekboard_la_LIBADD = \
$(top_builddir)/eek/libeek.la \
$(top_builddir)/eek/libeek-xkl.la \
$(GIO2_LIBS) \
$(LIBXKLAVIER_LIBS)
eekboarddir = $(includedir)/eekboard-$(EEK_API_VERSION)/eekboard
eekboard_HEADERS = $(libeekboard_headers)
......
......@@ -15,67 +15,61 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EEKBOARD_CLIENT_H
#define EEKBOARD_CLIENT_H 1
#if !defined(__EEKBOARD_H_INSIDE__) && !defined(EEKBOARD_COMPILATION)
#error "Only <eekboard/eekboard.h> can be included directly."
#endif
#ifndef EEKBOARD_EEKBOARD_H
#define EEKBOARD_EEKBOARD_H 1
#define __EEKBOARD_CLIENT_H_INSIDE__ 1
#include <gio/gio.h>
#include "eekboard/eekboard-context.h"
G_BEGIN_DECLS
#define EEKBOARD_TYPE_EEKBOARD (eekboard_eekboard_get_type())
#define EEKBOARD_EEKBOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEKBOARD_TYPE_EEKBOARD, EekboardEekboard))
#define EEKBOARD_EEKBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEKBOARD_TYPE_EEKBOARD, EekboardEekboardClass))
#define EEKBOARD_IS_EEKBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEKBOARD_TYPE_EEKBOARD))
#define EEKBOARD_IS_EEKBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEKBOARD_TYPE_EEKBOARD))
#define EEKBOARD_EEKBOARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEKBOARD_TYPE_EEKBOARD, EekboardEekboardClass))
#define EEKBOARD_TYPE_CLIENT (eekboard_client_get_type())
#define EEKBOARD_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEKBOARD_TYPE_CLIENT, EekboardClient))
#define EEKBOARD_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEKBOARD_TYPE_CLIENT, EekboardClientClass))
#define EEKBOARD_IS_EEKBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEKBOARD_TYPE_CLIENT))
#define EEKBOARD_IS_EEKBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEKBOARD_TYPE_CLIENT))
#define EEKBOARD_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEKBOARD_TYPE_CLIENT, EekboardClientClass))
typedef struct _EekboardEekboard EekboardEekboard;
typedef struct _EekboardEekboardClass EekboardEekboardClass;
typedef struct _EekboardEekboardPrivate EekboardEekboardPrivate;
typedef struct _EekboardClient EekboardClient;
typedef struct _EekboardClientClass EekboardClientClass;
typedef struct _EekboardClientPrivate EekboardClientPrivate;
struct _EekboardEekboard {
struct _EekboardClient {
/*< private >*/
GDBusProxy parent;
EekboardEekboardPrivate *priv;
EekboardClientPrivate *priv;
};
struct _EekboardEekboardClass {
struct _EekboardClientClass {
/*< private >*/
GDBusProxyClass parent_class;
/* signals */
void (* destroyed) (EekboardEekboard *self);
void (* destroyed) (EekboardClient *self);
/*< private >*/
/* padding */
gpointer pdummy[23];
};
GType eekboard_eekboard_get_type (void) G_GNUC_CONST;
GType eekboard_client_get_type (void) G_GNUC_CONST;
EekboardEekboard *eekboard_eekboard_new (GDBusConnection *connection,
GCancellable *cancellable);
EekboardContext *eekboard_eekboard_create_context
(EekboardEekboard *eekboard,
const gchar *client_name,
GCancellable *cancellable);
void eekboard_eekboard_push_context
(EekboardEekboard *eekboard,
EekboardContext *context,
GCancellable *cancellable);
void eekboard_eekboard_pop_context (EekboardEekboard *eekboard,
GCancellable *cancellable);
void eekboard_eekboard_destroy_context
(EekboardEekboard *eekboard,
EekboardContext *context,
GCancellable *cancellable);
EekboardClient *eekboard_client_new (GDBusConnection *connection,
GCancellable *cancellable);
EekboardContext *eekboard_client_create_context (EekboardClient *eekboard,
const gchar *client_name,
GCancellable *cancellable);
void eekboard_client_push_context (EekboardClient *eekboard,
EekboardContext *context,
GCancellable *cancellable);
void eekboard_client_pop_context (EekboardClient *eekboard,
GCancellable *cancellable);
void eekboard_client_destroy_context (EekboardClient *eekboard,
EekboardContext *context,
GCancellable *cancellable);
G_END_DECLS
#endif /* EEKBOARD_EEKBOARD_H */
#endif /* EEKBOARD_CLIENT_H */
/*
* Copyright (C) 2010-2011 Daiki Ueno <ueno@unixuser.org>
* Copyright (C) 2010-2011 Red Hat, Inc.
*
* 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 of the License, or
* (at your option) any later version.
*
* This program 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 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/>.
*/
#if !defined(__EEKBOARD_SERVICE_H_INSIDE__) && !defined(EEKBOARD_COMPILATION)
#error "Only <eekboard/eekboard-service.h> can be included directly."
#endif
#ifndef EEKBOARD_CONTEXT_SERVICE_H
#define EEKBOARD_CONTEXT_SERVICE_H 1
#include <eek/eek.h>
G_BEGIN_DECLS
#define EEKBOARD_CONTEXT_SERVICE_PATH "/org/fedorahosted/Eekboard/Context_%d"
#define EEKBOARD_CONTEXT_SERVICE_INTERFACE "org.fedorahosted.Eekboard.Context"
#define EEKBOARD_TYPE_CONTEXT_SERVICE (eekboard_context_service_get_type())
#define EEKBOARD_CONTEXT_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEKBOARD_TYPE_CONTEXT_SERVICE, EekboardContextService))
#define EEKBOARD_CONTEXT_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEKBOARD_TYPE_CONTEXT_SERVICE, EekboardContextServiceClass))
#define EEKBOARD_IS_CONTEXT_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEKBOARD_TYPE_CONTEXT_SERVICE))
#define EEKBOARD_IS_CONTEXT_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEKBOARD_TYPE_CONTEXT_SERVICE))
#define EEKBOARD_CONTEXT_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEKBOARD_TYPE_CONTEXT_SERVICE, EekboardContextServiceClass))
typedef struct _EekboardContextService EekboardContextService;
typedef struct _EekboardContextServiceClass EekboardContextServiceClass;
typedef struct _EekboardContextServicePrivate EekboardContextServicePrivate;
struct _EekboardContextService {
GObject parent;
EekboardContextServicePrivate *priv;
};
struct _EekboardContextServiceClass {
/*< private >*/
GObjectClass parent_class;
EekKeyboard *(*create_keyboard) (EekboardContextService *self,
const gchar *keyboard_type);
void (*show_keyboard) (EekboardContextService *self);
void (*hide_keyboard) (EekboardContextService *self);
/* signals */
void (*enabled) (EekboardContextService *self);
void (*disabled) (EekboardContextService *self);
/*< private >*/
/* padding */
gpointer pdummy[24];
};
GType eekboard_context_service_get_type
(void) G_GNUC_CONST;
void eekboard_context_service_enable
(EekboardContextService *context);
void eekboard_context_service_disable
(EekboardContextService *context);
const EekKeyboard *eekboard_context_service_get_keyboard
(EekboardContextService *context);
gboolean eekboard_context_service_get_fullscreen
(EekboardContextService *context);
const gchar * eekboard_context_service_get_client_name
(EekboardContextService *context);
G_END_DECLS
#endif /* EEKBOARD_CONTEXT_SERVICE_H */
......@@ -45,7 +45,7 @@ static guint signals[LAST_SIGNAL] = { 0, };
enum {
PROP_0,
PROP_KEYBOARD_VISIBLE,
PROP_VISIBLE,
PROP_LAST
};
......@@ -56,7 +56,7 @@ G_DEFINE_TYPE (EekboardContext, eekboard_context, G_TYPE_DBUS_PROXY);
struct _EekboardContextPrivate
{
gboolean keyboard_visible;
gboolean visible;
gboolean enabled;
gboolean fullscreen;
gint group;
......@@ -99,13 +99,13 @@ eekboard_context_real_g_signal (GDBusProxy *self,
return;
}
if (g_strcmp0 (signal_name, "KeyboardVisibilityChanged") == 0) {
gboolean keyboard_visible = FALSE;
if (g_strcmp0 (signal_name, "VisibilityChanged") == 0) {
gboolean visible = FALSE;
g_variant_get (parameters, "(b)", &keyboard_visible);
if (keyboard_visible != priv->keyboard_visible) {
priv->keyboard_visible = keyboard_visible;
g_object_notify (G_OBJECT(context), "keyboard-visible");
g_variant_get (parameters, "(b)", &visible);
if (visible != priv->visible) {
priv->visible = visible;
g_object_notify (G_OBJECT(context), "visible");
}
return;
}
......@@ -159,8 +159,8 @@ eekboard_context_get_property (GObject *object,
{
EekboardContextPrivate *priv = EEKBOARD_CONTEXT_GET_PRIVATE(object);
switch (prop_id) {
case PROP_KEYBOARD_VISIBLE:
g_value_set_boolean (value, priv->keyboard_visible);
case PROP_VISIBLE:
g_value_set_boolean (value, priv->visible);
break;
default:
g_object_get_property (object,
......@@ -190,17 +190,17 @@ eekboard_context_class_init (EekboardContextClass *klass)
gobject_class->get_property = eekboard_context_get_property;
/**
* EekboardContext:keyboard-visible:
* EekboardContext:visible:
*
* Flag to indicate if keyboard is visible or not.
*/
pspec = g_param_spec_boolean ("keyboard-visible",
"Keyboard-visible",
pspec = g_param_spec_boolean ("visible",
"visible",
"Flag that indicates if keyboard is visible",
FALSE,
G_PARAM_READABLE);
g_object_class_install_property (gobject_class,
PROP_KEYBOARD_VISIBLE,
PROP_VISIBLE,
pspec);
/**
......@@ -321,7 +321,7 @@ eekboard_context_new (GDBusConnection *connection,
g_initable_new (EEKBOARD_TYPE_CONTEXT,
cancellable,
&error,
"g-name", "org.fedorahosted.Eekboard.Server",
"g-name", "org.fedorahosted.Eekboard",
"g-connection", connection,
"g-interface-name", "org.fedorahosted.Eekboard.Context",
"g-object-path", object_path,
......@@ -563,7 +563,7 @@ eekboard_context_hide_keyboard (EekboardContext *context,
}
/**
* eekboard_context_press_key:
* eekboard_context_press_keycode:
* @context: an #EekboardContext
* @keycode: keycode number
* @cancellable: a #GCancellable
......@@ -571,9 +571,9 @@ eekboard_context_hide_keyboard (EekboardContext *context,
* Tell eekboard-server that a key identified by @keycode is pressed.
*/
void
eekboard_context_press_key (EekboardContext *context,
guint keycode,
GCancellable *cancellable)
eekboard_context_press_keycode (EekboardContext *context,
guint keycode,
GCancellable *cancellable)
{
EekboardContextPrivate *priv;
......@@ -584,7 +584,7 @@ eekboard_context_press_key (EekboardContext *context,
return;
g_dbus_proxy_call (G_DBUS_PROXY(context),
"PressKey",
"PressKeycode",
g_variant_new ("(u)", keycode),
G_DBUS_CALL_FLAGS_NONE,
-1,
......@@ -594,15 +594,15 @@ eekboard_context_press_key (EekboardContext *context,
}
/**
* eekboard_context_release_key:
* @context: an #EekboardContext
* eekboard_context_release_keycode:
* @Context: an #EekboardContext
* @keycode: keycode number
* @cancellable: a #GCancellable
*
* Tell eekboard-server that a key identified by @keycode is released.
*/
void
eekboard_context_release_key (EekboardContext *context,
eekboard_context_release_keycode (EekboardContext *context,
guint keycode,
GCancellable *cancellable)
{
......@@ -615,7 +615,7 @@ eekboard_context_release_key (EekboardContext *context,
return;
g_dbus_proxy_call (G_DBUS_PROXY(context),
"ReleaseKey",
"ReleaseKeycode",
g_variant_new ("(u)", keycode),
G_DBUS_CALL_FLAGS_NONE,
-1,
......@@ -625,20 +625,20 @@ eekboard_context_release_key (EekboardContext *context,
}
/**
* eekboard_context_is_keyboard_visible:
* eekboard_context_is_visible:
* @context: an #EekboardContext
*
* Check if keyboard is visible.
*/
gboolean
eekboard_context_is_keyboard_visible (EekboardContext *context)
eekboard_context_is_visible (EekboardContext *context)
{
EekboardContextPrivate *priv;
g_assert (EEKBOARD_IS_CONTEXT(context));
priv = EEKBOARD_CONTEXT_GET_PRIVATE (context);
return priv->enabled && priv->keyboard_visible;
return priv->enabled && priv->visible;
}
/**
......
......@@ -15,9 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__EEKBOARD_H_INSIDE__) && !defined(EEKBOARD_COMPILATION)
#error "Only <eekboard/eekboard.h> can be included directly."
#if !defined(__EEKBOARD_CLIENT_H_INSIDE__) && !defined(EEKBOARD_COMPILATION)
#error "Only <eekboard/eekboard-client.h> can be included directly."
#endif
#ifndef EEKBOARD_CONTEXT_H
......@@ -100,12 +99,12 @@ void eekboard_context_set_group (EekboardContext *context,
GCancellable *cancellable);
gint eekboard_context_get_group (EekboardContext *context,
GCancellable *cancellable);
void eekboard_context_press_key (EekboardContext *context,
guint keycode,
GCancellable *cancellable);
void eekboard_context_release_key (EekboardContext *context,
void eekboard_context_press_keycode (EekboardContext *context,
guint keycode,
GCancellable *cancellable);
void eekboard_context_release_keycode (EekboardContext *context,
guint keycode,
GCancellable *cancellable);
gboolean eekboard_context_is_keyboard_visible
(EekboardContext *context);
void eekboard_context_set_enabled (EekboardContext *context,
......
/*
* Copyright (C) 2010-2011 Daiki Ueno <ueno@unixuser.org>
* Copyright (C) 2010-2011 Red Hat, Inc.
*
* 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 of the License, or
* (at your option) any later version.
*
* This program 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 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/>.
*/
#ifndef EEKBOARD_SERVICE_H
#define EEKBOARD_SERVICE_H 1
#define __EEKBOARD_SERVICE_H_INSIDE__ 1
#include "eekboard/eekboard-context-service.h"
G_BEGIN_DECLS
#define EEKBOARD_SERVICE_PATH "/org/fedorahosted/Eekboard"
#define EEKBOARD_SERVICE_INTERFACE "org.fedorahosted.Eekboard"
#define EEKBOARD_TYPE_SERVICE (eekboard_service_get_type())
#define EEKBOARD_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEKBOARD_TYPE_SERVICE, EekboardService))
#define EEKBOARD_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEKBOARD_TYPE_SERVICE, EekboardServiceClass))
#define EEKBOARD_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEKBOARD_TYPE_SERVICE))
#define EEKBOARD_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEKBOARD_TYPE_SERVICE))
#define EEKBOARD_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEKBOARD_TYPE_SERVICE, EekboardServiceClass))
typedef struct _EekboardService EekboardService;
typedef struct _EekboardServiceClass EekboardServiceClass;
typedef struct _EekboardServicePrivate EekboardServicePrivate;
struct _EekboardService {
GObject parent;
EekboardServicePrivate *priv;
};
struct _EekboardServiceClass {
/*< private >*/
GObjectClass parent_class;
/*< public >*/
EekboardContextService *(*create_context) (EekboardService *self,
const gchar *client_name,
const gchar *object_path);
/*< private >*/
/* padding */
gpointer pdummy[24];
};
GType eekboard_service_get_type (void) G_GNUC_CONST;
EekboardService * eekboard_service_new (const gchar *object_path,
GDBusConnection *connection);
G_END_DECLS
#endif /* EEKBOARD_SERVICE_H */
......@@ -18,7 +18,7 @@
* 02110-1301 USA
*/
#include <string.h>
#include "xklutil.h"
#include "eekboard/eekboard-xklutil.h"
XklConfigRec *
eekboard_xkl_config_rec_from_string (const gchar *layouts)
......
......@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <glib/gi18n.h>
#include "eekboard/eekboard.h"
#include "eekboard/eekboard-client.h"
static gboolean opt_system = FALSE;
static gboolean opt_session = FALSE;
......@@ -61,21 +61,19 @@ static const GOptionEntry options[] = {
};
static void
on_key_pressed (guint keycode, gpointer user_data)
on_key_pressed (EekboardContext *context,
const gchar *keyname,
EekSymbol *symbol,
guint modifiers,
gpointer user_data)
{
g_print ("KeyPressed %u\n", keycode);
}
static void
on_key_released (guint keycode, gpointer user_data)
{
g_print ("KeyReleased %u\n", keycode);
g_print ("KeyPressed %s %s\n", keyname, eek_symbol_get_name (symbol));
}
int
main (int argc, char **argv)
{
EekboardEekboard *eekboard = NULL;
EekboardClient *eekboard = NULL;
EekboardContext *context = NULL;
GBusType bus_type;
GDBusConnection *connection = NULL;
......@@ -84,7 +82,7 @@ main (int argc, char **argv)
GMainLoop *loop = NULL;
gint retval = 0;
g_type_init ();
eek_init ();
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
option_context = g_option_context_new ("eekboard-client");
......@@ -128,14 +126,14 @@ main (int argc, char **argv)
break;
}
eekboard = eekboard_eekboard_new (connection, NULL);
eekboard = eekboard_client_new (connection, NULL);
if (eekboard == NULL) {
g_printerr ("Can't create eekboard proxy\n");
retval = 1;
goto out;
}
context = eekboard_eekboard_create_context (eekboard,
context = eekboard_client_create_context (eekboard,
"eekboard-client",
NULL);
if (context == NULL) {
......@@ -144,7 +142,7 @@ main (int argc, char **argv)
goto out;
}
eekboard_eekboard_push_context (eekboard, context, NULL);
eekboard_client_push_context (eekboard, context, NULL);
if (opt_set_keyboard) {
guint keyboard_id;
......@@ -173,18 +171,16 @@ main (int argc, char **argv)
}
if (opt_press_key >= 0) {
eekboard_context_press_key (context, opt_press_key, NULL);
eekboard_context_press_keycode (context, opt_press_key, NULL);
}
if (opt_release_key >= 0) {
eekboard_context_release_key (context, opt_release_key, NULL);
eekboard_context_release_keycode (context, opt_release_key, NULL);
}
if (opt_listen) {
g_signal_connect (context, "key-pressed",
G_CALLBACK(on_key_pressed), NULL);
g_signal_connect (context, "key-released",
G_CALLBACK(on_key_released), NULL);
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
}
......
......@@ -21,8 +21,6 @@ bin_PROGRAMS = \
eekboard-server \
eekboard-xml
noinst_LTLIBRARIES = libxklutil.la
eekboard_CFLAGS = \
-I$(top_srcdir) \
$(GIO2_CFLAGS) \
......@@ -32,7 +30,6 @@ eekboard_CFLAGS = \
-DKEYBOARDDIR=\"$(pkgdatadir)/keyboards\"
eekboard_LDADD = \
$(builddir)/libxklutil.la \
$(top_builddir)/eekboard/libeekboard.la \
$(top_builddir)/eek/libeek.la \
$(top_builddir)/eek/libeek-xkl.la \
......@@ -74,7 +71,6 @@ eekboard_server_CFLAGS = \
-DKEYBOARDDIR=\"$(pkgdatadir)/keyboards\"
eekboard_server_LDADD = \
$(builddir)/libxklutil.la \
$(top_builddir)/eekboard/libeekboard.la \
$(top_builddir)/eek/libeek.la \
$(top_builddir)/eek/libeek-gtk.la \
......@@ -93,8 +89,8 @@ eekboard_server_CFLAGS += $(XDOCK_CFLAGS)
eekboard_server_LDADD += $(XDOCK_LIBS)
endif
eekboard_server_headers = server-server.h server-context.h
eekboard_server_SOURCES = server-server.c server-context.c server-main.c
eekboard_server_headers = server-service.h server-context-service.h
eekboard_server_SOURCES = server-service.c server-context-service.c server-main.c
eekboard_xml_CFLAGS = \
-I$(top_srcdir) \
......@@ -103,7 +99,7 @@ eekboard_xml_CFLAGS = \
$(LIBXKLAVIER_CFLAGS)
eekboard_xml_LDADD = \
$(builddir)/libxklutil.la \
$(top_builddir)/eekboard/libeekboard.la \
$(top_builddir)/eek/libeek.la \
$(top_builddir)/eek/libeek-xkl.la \
$(top_builddir)/eek/libeek-gtk.la \
......@@ -118,11 +114,6 @@ endif
eekboard_xml_SOURCES = xml-main.c
libxklutil_la_headers = xklutil.h
libxklutil_la_SOURCES = xklutil.c
libxklutil_la_CFLAGS = $(LIBXKLAVIER_CFLAGS)
libxklutil_la_LIBADD = $(LIBXKLAVIER_LIBS)
eekboarddir = $(includedir)/eekboard-$(EEK_API_VERSION)/eekboard
eekboard_HEADERS = \
$(libeekboard_headers)
......@@ -130,5 +121,4 @@ eekboard_HEADERS = \
noinst_HEADERS = \
$(eekboard_headers) \
$(eekboard_server_headers) \
$(eekboard_xml_headers) \
$(libxklutil_la_headers)
$(eekboard_xml_headers)
......@@ -29,7 +29,7 @@
#endif /* HAVE_IBUS */
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "eekboard/eekboard.h"
#include "eekboard/eekboard-client.h"
#include "client.h"
#define DEFAULT_KEYBOARD "us"
......@@ -64,14 +64,14 @@ static const GOptionEntry options[] = {
};
static void
on_notify_keyboard_visible (GObject *object,
GParamSpec *spec,
gpointer user_data)
on_notify_visible (GObject *object,
GParamSpec *spec,
gpointer user_data)
{
GMainLoop *loop = user_data;
gboolean visible;
g_object_get (object, "keyboard-visible", &visible, NULL);
g_object_get (object, "visible", &visible, NULL);
/* user explicitly closed the window */
if (!visible && eekboard_context_is_enabled (EEKBOARD_CONTEXT(object)))
......@@ -88,7 +88,7 @@ on_context_destroyed (EekboardContext *context,
}
static void
on_destroyed (EekboardEekboard *eekboard,
on_destroyed (EekboardClient *eekboard,
gpointer user_data)
{
GMainLoop *loop = user_data;
......@@ -96,23 +96,23 @@ on_destroyed (EekboardEekboard *eekboard,
g_main_loop_quit (loop);
}
enum {
enum FocusListenerType {
FOCUS_NONE,
FOCUS_ATSPI,