Move eekboard-client from src to examples; rename eekboard-desktop-client to eekboard.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -72,3 +72,5 @@ po/Makefile.in.in
|
|||||||
po/POTFILES
|
po/POTFILES
|
||||||
po/stamp-it
|
po/stamp-it
|
||||||
bindings/vala/*.vapi
|
bindings/vala/*.vapi
|
||||||
|
py-compile
|
||||||
|
|
||||||
|
|||||||
24
README
24
README
@ -26,7 +26,7 @@ OPTIONAL: fakekey, CSPI, Clutter, Clutter-Gtk, Vala, gobject-introspection
|
|||||||
|
|
||||||
* How to test
|
* How to test
|
||||||
|
|
||||||
eekboard currently includes 4 tools to implement your own virtual
|
eekboard currently includes 3 tools to implement your own virtual
|
||||||
keyboard.
|
keyboard.
|
||||||
|
|
||||||
** eekboard-server
|
** eekboard-server
|
||||||
@ -38,14 +38,14 @@ do that with:
|
|||||||
|
|
||||||
$ eekboard-server &
|
$ eekboard-server &
|
||||||
|
|
||||||
** eekboard-desktop-client
|
** eekboard
|
||||||
|
|
||||||
eekboard-desktop-client is a client of eekboard-server. It listens
|
eekboard is a client of eekboard-server. It listens desktop events
|
||||||
desktop events (keyboard change, focus in/out, and keystroke) and
|
(keyboard change, focus in/out, and keystroke) and generates key
|
||||||
generates key events when some keys are pressed on the on-screen
|
events when some keys are pressed on the on-screen keyboard. It can
|
||||||
keyboard. It can be started with:
|
be started with:
|
||||||
|
|
||||||
$ eekboard-desktop-client
|
$ eekboard
|
||||||
|
|
||||||
** eekboard-xml
|
** eekboard-xml
|
||||||
|
|
||||||
@ -60,16 +60,6 @@ You can display the dumped layout with:
|
|||||||
|
|
||||||
$ eekboard-xml --load keyboard.xml
|
$ eekboard-xml --load keyboard.xml
|
||||||
|
|
||||||
** eekboard-client
|
|
||||||
|
|
||||||
eekboard-client is a simple test client of eekboard-server. To upload
|
|
||||||
the keyboard description to the server, display it, and listen
|
|
||||||
key events.
|
|
||||||
|
|
||||||
$ eekboard-client --set-keyboard keyboard.xml --show-keyboard --listen
|
|
||||||
KeyPressed XXXXX
|
|
||||||
KeyReleased XXXXX
|
|
||||||
|
|
||||||
* Documentation
|
* Documentation
|
||||||
|
|
||||||
See file:docs/reference/eek/html/index.html
|
See file:docs/reference/eek/html/index.html
|
||||||
|
|||||||
@ -248,6 +248,7 @@ data/themes/Makefile
|
|||||||
data/keyboards/Makefile
|
data/keyboards/Makefile
|
||||||
examples/Makefile
|
examples/Makefile
|
||||||
examples/eekboard-inscript/Makefile
|
examples/eekboard-inscript/Makefile
|
||||||
|
examples/simple-client/Makefile
|
||||||
eek/eek-${EEK_API_VERSION}.pc
|
eek/eek-${EEK_API_VERSION}.pc
|
||||||
eek/eek-clutter-${EEK_API_VERSION}.pc
|
eek/eek-clutter-${EEK_API_VERSION}.pc
|
||||||
eek/eek-gtk-${EEK_API_VERSION}.pc
|
eek/eek-gtk-${EEK_API_VERSION}.pc
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
SUBDIRS = icons themes keyboards
|
SUBDIRS = icons themes keyboards
|
||||||
|
EXTRA_DIST = eekboard.desktop
|
||||||
|
|||||||
9
data/eekboard.desktop
Normal file
9
data/eekboard.desktop
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=Eekboard
|
||||||
|
GenericName=Eekboard Virtual Keyboard
|
||||||
|
Comment=Virtual Keyboard
|
||||||
|
Exec=eekboard-desktop-client
|
||||||
|
Icon=eekboard
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
Categories=GTK;Utility;
|
||||||
@ -1 +1 @@
|
|||||||
SUBDIRS = eekboard-inscript
|
SUBDIRS = eekboard-inscript simple-client
|
||||||
|
|||||||
12
examples/simple-client/Makefile.am
Normal file
12
examples/simple-client/Makefile.am
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
noinst_PROGRAMS = simple-client
|
||||||
|
|
||||||
|
simple_client_CFLAGS = \
|
||||||
|
-I$(top_srcdir) \
|
||||||
|
$(GIO2_CFLAGS)
|
||||||
|
|
||||||
|
simple_client_LDADD = \
|
||||||
|
$(top_builddir)/eekboard/libeekboard.la \
|
||||||
|
$(top_builddir)/eek/libeek.la \
|
||||||
|
$(GIO2_LIBS)
|
||||||
|
|
||||||
|
simple_client_SOURCES = main.c
|
||||||
217
examples/simple-client/main.c
Normal file
217
examples/simple-client/main.c
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
|
#include "eekboard/eekboard.h"
|
||||||
|
|
||||||
|
static gboolean opt_system = FALSE;
|
||||||
|
static gboolean opt_session = FALSE;
|
||||||
|
static gchar *opt_address = NULL;
|
||||||
|
|
||||||
|
static gchar *opt_set_keyboard = NULL;
|
||||||
|
static gint opt_set_group = -1;
|
||||||
|
static gboolean opt_show_keyboard = FALSE;
|
||||||
|
static gboolean opt_hide_keyboard = FALSE;
|
||||||
|
static gint opt_press_key = -1;
|
||||||
|
static gint opt_release_key = -1;
|
||||||
|
static gboolean opt_listen = FALSE;
|
||||||
|
|
||||||
|
static const GOptionEntry options[] = {
|
||||||
|
{"system", 'y', 0, G_OPTION_ARG_NONE, &opt_system,
|
||||||
|
N_("Connect to the system bus")},
|
||||||
|
{"session", 'e', 0, G_OPTION_ARG_NONE, &opt_session,
|
||||||
|
N_("Connect to the session bus")},
|
||||||
|
{"address", 'a', 0, G_OPTION_ARG_STRING, &opt_address,
|
||||||
|
N_("Connect to the given D-Bus address")},
|
||||||
|
{"set-keyboard", '\0', 0, G_OPTION_ARG_STRING, &opt_set_keyboard,
|
||||||
|
N_("Upload keyboard description from an XML file")},
|
||||||
|
{"set-group", '\0', 0, G_OPTION_ARG_INT, &opt_set_group,
|
||||||
|
N_("Set group of the keyboard")},
|
||||||
|
{"show-keyboard", '\0', 0, G_OPTION_ARG_NONE, &opt_show_keyboard,
|
||||||
|
N_("Show keyboard")},
|
||||||
|
{"hide-keyboard", '\0', 0, G_OPTION_ARG_NONE, &opt_hide_keyboard,
|
||||||
|
N_("Hide keyboard")},
|
||||||
|
{"press-key", '\0', 0, G_OPTION_ARG_INT, &opt_press_key,
|
||||||
|
N_("Press key")},
|
||||||
|
{"release-key", '\0', 0, G_OPTION_ARG_INT, &opt_release_key,
|
||||||
|
N_("Release key")},
|
||||||
|
{"listen", '\0', 0, G_OPTION_ARG_NONE, &opt_listen,
|
||||||
|
N_("Listen events")},
|
||||||
|
{NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_key_pressed (guint keycode, 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char **argv)
|
||||||
|
{
|
||||||
|
EekboardEekboard *eekboard = NULL;
|
||||||
|
EekboardContext *context = NULL;
|
||||||
|
GBusType bus_type;
|
||||||
|
GDBusConnection *connection = NULL;
|
||||||
|
GError *error;
|
||||||
|
GOptionContext *option_context;
|
||||||
|
GMainLoop *loop = NULL;
|
||||||
|
gint retval = 0;
|
||||||
|
|
||||||
|
g_type_init ();
|
||||||
|
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
|
||||||
|
|
||||||
|
option_context = g_option_context_new ("eekboard-client");
|
||||||
|
g_option_context_add_main_entries (option_context, options, NULL);
|
||||||
|
g_option_context_parse (option_context, &argc, &argv, NULL);
|
||||||
|
g_option_context_free (option_context);
|
||||||
|
|
||||||
|
if (opt_system)
|
||||||
|
bus_type = G_BUS_TYPE_SYSTEM;
|
||||||
|
else if (opt_address)
|
||||||
|
bus_type = G_BUS_TYPE_NONE;
|
||||||
|
else
|
||||||
|
bus_type = G_BUS_TYPE_SESSION;
|
||||||
|
|
||||||
|
switch (bus_type) {
|
||||||
|
case G_BUS_TYPE_SYSTEM:
|
||||||
|
case G_BUS_TYPE_SESSION:
|
||||||
|
error = NULL;
|
||||||
|
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
|
||||||
|
if (connection == NULL) {
|
||||||
|
g_printerr ("Can't connect to the bus: %s\n", error->message);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case G_BUS_TYPE_NONE:
|
||||||
|
error = NULL;
|
||||||
|
connection = g_dbus_connection_new_for_address_sync (opt_address,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&error);
|
||||||
|
if (connection == NULL) {
|
||||||
|
g_printerr ("Can't connect to the bus at %s: %s\n",
|
||||||
|
opt_address,
|
||||||
|
error->message);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
g_assert_not_reached ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
eekboard = eekboard_eekboard_new (connection, NULL);
|
||||||
|
if (eekboard == NULL) {
|
||||||
|
g_printerr ("Can't create eekboard proxy\n");
|
||||||
|
retval = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
context = eekboard_eekboard_create_context (eekboard,
|
||||||
|
"eekboard-client",
|
||||||
|
NULL);
|
||||||
|
if (context == NULL) {
|
||||||
|
g_printerr ("Can't create context\n");
|
||||||
|
retval = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
eekboard_eekboard_push_context (eekboard, context, NULL);
|
||||||
|
|
||||||
|
if (opt_set_keyboard) {
|
||||||
|
GFile *file;
|
||||||
|
GFileInputStream *input;
|
||||||
|
EekLayout *layout;
|
||||||
|
EekKeyboard *keyboard;
|
||||||
|
guint keyboard_id;
|
||||||
|
|
||||||
|
file = g_file_new_for_path (opt_set_keyboard);
|
||||||
|
|
||||||
|
error = NULL;
|
||||||
|
input = g_file_read (file, NULL, &error);
|
||||||
|
if (error) {
|
||||||
|
g_printerr ("Can't read file %s: %s\n",
|
||||||
|
opt_set_keyboard, error->message);
|
||||||
|
retval = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout = eek_xml_layout_new (G_INPUT_STREAM(input));
|
||||||
|
g_object_unref (input);
|
||||||
|
keyboard = eek_keyboard_new (layout, 640, 480);
|
||||||
|
g_object_unref (layout);
|
||||||
|
|
||||||
|
keyboard_id = eekboard_context_add_keyboard (context, keyboard, NULL);
|
||||||
|
g_object_unref (keyboard);
|
||||||
|
|
||||||
|
eekboard_context_set_keyboard (context, keyboard_id, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt_set_group >= 0) {
|
||||||
|
eekboard_context_set_group (context, opt_set_group, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt_show_keyboard) {
|
||||||
|
eekboard_context_show_keyboard (context, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt_hide_keyboard) {
|
||||||
|
eekboard_context_hide_keyboard (context, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt_press_key >= 0) {
|
||||||
|
eekboard_context_press_key (context, opt_press_key, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt_release_key >= 0) {
|
||||||
|
eekboard_context_release_key (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);
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
if (context)
|
||||||
|
g_object_unref (context);
|
||||||
|
if (connection)
|
||||||
|
g_object_unref (connection);
|
||||||
|
if (loop)
|
||||||
|
g_main_loop_unref (loop);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
src/server-server.c
|
src/server-server.c
|
||||||
src/server-context.c
|
src/server-context.c
|
||||||
src/client-main.c
|
|
||||||
src/desktop-client.c
|
|
||||||
src/desktop-client-main.c
|
|
||||||
src/xml-main.c
|
|
||||||
src/server-main.c
|
src/server-main.c
|
||||||
|
src/client.c
|
||||||
|
src/client-main.c
|
||||||
|
src/xml-main.c
|
||||||
|
examples/simple-client/main.c
|
||||||
|
|||||||
@ -18,14 +18,13 @@
|
|||||||
|
|
||||||
if ENABLE_EEKBOARD
|
if ENABLE_EEKBOARD
|
||||||
bin_PROGRAMS = \
|
bin_PROGRAMS = \
|
||||||
eekboard-desktop-client \
|
eekboard \
|
||||||
eekboard-client \
|
|
||||||
eekboard-server \
|
eekboard-server \
|
||||||
eekboard-xml
|
eekboard-xml
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libxklutil.la
|
noinst_LTLIBRARIES = libxklutil.la
|
||||||
|
|
||||||
eekboard_desktop_client_CFLAGS = \
|
eekboard_CFLAGS = \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
$(GIO2_CFLAGS) \
|
$(GIO2_CFLAGS) \
|
||||||
$(GTK_CFLAGS) \
|
$(GTK_CFLAGS) \
|
||||||
@ -33,7 +32,7 @@ eekboard_desktop_client_CFLAGS = \
|
|||||||
$(XKB_CFLAGS) \
|
$(XKB_CFLAGS) \
|
||||||
$(LIBXKLAVIER_CFLAGS)
|
$(LIBXKLAVIER_CFLAGS)
|
||||||
|
|
||||||
eekboard_desktop_client_LDADD = \
|
eekboard_LDADD = \
|
||||||
$(builddir)/libxklutil.la \
|
$(builddir)/libxklutil.la \
|
||||||
$(top_builddir)/eekboard/libeekboard.la \
|
$(top_builddir)/eekboard/libeekboard.la \
|
||||||
$(top_builddir)/eek/libeek.la \
|
$(top_builddir)/eek/libeek.la \
|
||||||
@ -45,21 +44,21 @@ eekboard_desktop_client_LDADD = \
|
|||||||
$(LIBXKLAVIER_LIBS)
|
$(LIBXKLAVIER_LIBS)
|
||||||
|
|
||||||
if ENABLE_FAKEKEY
|
if ENABLE_FAKEKEY
|
||||||
eekboard_desktop_client_CFLAGS += \
|
eekboard_CFLAGS += \
|
||||||
$(FAKEKEY_CFLAGS)
|
$(FAKEKEY_CFLAGS)
|
||||||
eekboard_desktop_client_LDADD += \
|
eekboard_LDADD += \
|
||||||
$(FAKEKEY_LIBS)
|
$(FAKEKEY_LIBS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_CSPI
|
if ENABLE_CSPI
|
||||||
eekboard_desktop_client_CFLAGS += \
|
eekboard_CFLAGS += \
|
||||||
$(CSPI_CFLAGS)
|
$(CSPI_CFLAGS)
|
||||||
eekboard_desktop_client_LDADD += \
|
eekboard_LDADD += \
|
||||||
$(CSPI_LIBS)
|
$(CSPI_LIBS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
eekboard_desktop_client_headers = desktop-client.h
|
eekboard_headers = client.h
|
||||||
eekboard_desktop_client_SOURCES = desktop-client.c desktop-client-main.c
|
eekboard_SOURCES = client.c client-main.c
|
||||||
|
|
||||||
eekboard_server_CFLAGS = \
|
eekboard_server_CFLAGS = \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
@ -82,17 +81,6 @@ endif
|
|||||||
eekboard_server_headers = server-server.h server-context.h
|
eekboard_server_headers = server-server.h server-context.h
|
||||||
eekboard_server_SOURCES = server-server.c server-context.c server-main.c
|
eekboard_server_SOURCES = server-server.c server-context.c server-main.c
|
||||||
|
|
||||||
eekboard_client_CFLAGS = \
|
|
||||||
-I$(top_srcdir) \
|
|
||||||
$(GIO2_CFLAGS)
|
|
||||||
|
|
||||||
eekboard_client_LDADD = \
|
|
||||||
$(top_builddir)/eekboard/libeekboard.la \
|
|
||||||
$(top_builddir)/eek/libeek.la \
|
|
||||||
$(GIO2_LIBS)
|
|
||||||
|
|
||||||
eekboard_client_SOURCES = client-main.c
|
|
||||||
|
|
||||||
eekboard_xml_CFLAGS = \
|
eekboard_xml_CFLAGS = \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
$(GIO2_CFLAGS) \
|
$(GIO2_CFLAGS) \
|
||||||
@ -125,8 +113,7 @@ eekboard_HEADERS = \
|
|||||||
$(libeekboard_headers)
|
$(libeekboard_headers)
|
||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
$(eekboard_desktop_client_headers) \
|
$(eekboard_headers) \
|
||||||
$(eekboard_client_headers) \
|
|
||||||
$(eekboard_server_headers) \
|
$(eekboard_server_headers) \
|
||||||
$(eekboard_xml_headers) \
|
$(eekboard_xml_headers) \
|
||||||
$(libxklutil_la_headers)
|
$(libxklutil_la_headers)
|
||||||
|
|||||||
@ -20,21 +20,27 @@
|
|||||||
#endif /* HAVE_CONFIG_H */
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <cspi/spi.h>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
#include <gconf/gconf-client.h>
|
||||||
#include "eekboard/eekboard.h"
|
#include "eekboard/eekboard.h"
|
||||||
|
#include "client.h"
|
||||||
|
|
||||||
static gboolean opt_system = FALSE;
|
static gboolean opt_system = FALSE;
|
||||||
static gboolean opt_session = FALSE;
|
static gboolean opt_session = FALSE;
|
||||||
static gchar *opt_address = NULL;
|
static gchar *opt_address = NULL;
|
||||||
|
|
||||||
static gchar *opt_set_keyboard = NULL;
|
#ifdef HAVE_CSPI
|
||||||
static gint opt_set_group = -1;
|
static gboolean opt_focus = FALSE;
|
||||||
static gboolean opt_show_keyboard = FALSE;
|
static gboolean opt_keystroke = FALSE;
|
||||||
static gboolean opt_hide_keyboard = FALSE;
|
#endif /* HAVE_CSPI */
|
||||||
static gint opt_press_key = -1;
|
|
||||||
static gint opt_release_key = -1;
|
static gchar *opt_model = NULL;
|
||||||
static gboolean opt_listen = FALSE;
|
static gchar *opt_layouts = NULL;
|
||||||
|
static gchar *opt_options = NULL;
|
||||||
|
|
||||||
|
static gboolean opt_fullscreen = FALSE;
|
||||||
|
|
||||||
static const GOptionEntry options[] = {
|
static const GOptionEntry options[] = {
|
||||||
{"system", 'y', 0, G_OPTION_ARG_NONE, &opt_system,
|
{"system", 'y', 0, G_OPTION_ARG_NONE, &opt_system,
|
||||||
@ -43,51 +49,75 @@ static const GOptionEntry options[] = {
|
|||||||
N_("Connect to the session bus")},
|
N_("Connect to the session bus")},
|
||||||
{"address", 'a', 0, G_OPTION_ARG_STRING, &opt_address,
|
{"address", 'a', 0, G_OPTION_ARG_STRING, &opt_address,
|
||||||
N_("Connect to the given D-Bus address")},
|
N_("Connect to the given D-Bus address")},
|
||||||
{"set-keyboard", '\0', 0, G_OPTION_ARG_STRING, &opt_set_keyboard,
|
#ifdef HAVE_CSPI
|
||||||
N_("Upload keyboard description from an XML file")},
|
{"listen-focus", 'f', 0, G_OPTION_ARG_NONE, &opt_focus,
|
||||||
{"set-group", '\0', 0, G_OPTION_ARG_INT, &opt_set_group,
|
N_("Listen focus change events with AT-SPI")},
|
||||||
N_("Set group of the keyboard")},
|
{"listen-keystroke", 's', 0, G_OPTION_ARG_NONE, &opt_keystroke,
|
||||||
{"show-keyboard", '\0', 0, G_OPTION_ARG_NONE, &opt_show_keyboard,
|
N_("Listen keystroke events with AT-SPI")},
|
||||||
N_("Show keyboard")},
|
#endif /* HAVE_CSPI */
|
||||||
{"hide-keyboard", '\0', 0, G_OPTION_ARG_NONE, &opt_hide_keyboard,
|
{"model", '\0', 0, G_OPTION_ARG_STRING, &opt_model,
|
||||||
N_("Hide keyboard")},
|
N_("Specify model")},
|
||||||
{"press-key", '\0', 0, G_OPTION_ARG_INT, &opt_press_key,
|
{"layouts", '\0', 0, G_OPTION_ARG_STRING, &opt_layouts,
|
||||||
N_("Press key")},
|
N_("Specify layouts")},
|
||||||
{"release-key", '\0', 0, G_OPTION_ARG_INT, &opt_release_key,
|
{"options", '\0', 0, G_OPTION_ARG_STRING, &opt_options,
|
||||||
N_("Release key")},
|
N_("Specify options")},
|
||||||
{"listen", '\0', 0, G_OPTION_ARG_NONE, &opt_listen,
|
{"fullscreen", 'F', 0, G_OPTION_ARG_NONE, &opt_fullscreen,
|
||||||
N_("Listen events")},
|
N_("Create window in fullscreen mode")},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_key_pressed (guint keycode, gpointer user_data)
|
on_notify_keyboard_visible (GObject *object,
|
||||||
|
GParamSpec *spec,
|
||||||
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
g_print ("KeyPressed %u\n", keycode);
|
GMainLoop *loop = user_data;
|
||||||
|
gboolean visible;
|
||||||
|
|
||||||
|
g_object_get (object, "keyboard-visible", &visible, NULL);
|
||||||
|
|
||||||
|
/* user explicitly closed the window */
|
||||||
|
if (!visible && eekboard_context_is_enabled (EEKBOARD_CONTEXT(object)))
|
||||||
|
g_main_loop_quit (loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_key_released (guint keycode, gpointer user_data)
|
on_context_destroyed (EekboardContext *context,
|
||||||
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
g_print ("KeyReleased %u\n", keycode);
|
GMainLoop *loop = user_data;
|
||||||
|
|
||||||
|
g_main_loop_quit (loop);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_destroyed (EekboardEekboard *eekboard,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
GMainLoop *loop = user_data;
|
||||||
|
|
||||||
|
g_main_loop_quit (loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
EekboardEekboard *eekboard = NULL;
|
EekboardClient *client;
|
||||||
EekboardContext *context = NULL;
|
EekboardEekboard *eekboard;
|
||||||
|
EekboardContext *context;
|
||||||
GBusType bus_type;
|
GBusType bus_type;
|
||||||
GDBusConnection *connection = NULL;
|
GDBusConnection *connection;
|
||||||
GError *error;
|
GError *error;
|
||||||
|
GConfClient *gconfc;
|
||||||
GOptionContext *option_context;
|
GOptionContext *option_context;
|
||||||
GMainLoop *loop = NULL;
|
GMainLoop *loop;
|
||||||
gint retval = 0;
|
|
||||||
|
|
||||||
g_type_init ();
|
if (!gtk_init_check (&argc, &argv)) {
|
||||||
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
|
g_printerr ("Can't init GTK\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
option_context = g_option_context_new ("eekboard-client");
|
option_context = g_option_context_new ("eekboard-desktop-client");
|
||||||
g_option_context_add_main_entries (option_context, options, NULL);
|
g_option_context_add_main_entries (option_context, options, NULL);
|
||||||
g_option_context_parse (option_context, &argc, &argv, NULL);
|
g_option_context_parse (option_context, &argc, &argv, NULL);
|
||||||
g_option_context_free (option_context);
|
g_option_context_free (option_context);
|
||||||
@ -128,90 +158,88 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
eekboard = eekboard_eekboard_new (connection, NULL);
|
client = eekboard_client_new (connection);
|
||||||
if (eekboard == NULL) {
|
if (client == NULL) {
|
||||||
g_printerr ("Can't create eekboard proxy\n");
|
g_printerr ("Can't create a client\n");
|
||||||
retval = 1;
|
exit (1);
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
context = eekboard_eekboard_create_context (eekboard,
|
gconfc = gconf_client_get_default ();
|
||||||
"eekboard-client",
|
|
||||||
NULL);
|
|
||||||
if (context == NULL) {
|
|
||||||
g_printerr ("Can't create context\n");
|
|
||||||
retval = 1;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
eekboard_eekboard_push_context (eekboard, context, NULL);
|
|
||||||
|
|
||||||
if (opt_set_keyboard) {
|
|
||||||
GFile *file;
|
|
||||||
GFileInputStream *input;
|
|
||||||
EekLayout *layout;
|
|
||||||
EekKeyboard *keyboard;
|
|
||||||
guint keyboard_id;
|
|
||||||
|
|
||||||
file = g_file_new_for_path (opt_set_keyboard);
|
|
||||||
|
|
||||||
|
#ifdef HAVE_CSPI
|
||||||
error = NULL;
|
error = NULL;
|
||||||
input = g_file_read (file, NULL, &error);
|
if (opt_focus || opt_keystroke) {
|
||||||
if (error) {
|
if (gconf_client_get_bool (gconfc,
|
||||||
g_printerr ("Can't read file %s: %s\n",
|
"/desktop/gnome/interface/accessibility",
|
||||||
opt_set_keyboard, error->message);
|
&error) ||
|
||||||
retval = 1;
|
gconf_client_get_bool (gconfc,
|
||||||
goto out;
|
"/desktop/gnome/interface/accessibility2",
|
||||||
|
&error)) {
|
||||||
|
if (SPI_init () != 0) {
|
||||||
|
g_printerr ("Can't init CSPI\n");
|
||||||
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
layout = eek_xml_layout_new (G_INPUT_STREAM(input));
|
if (opt_focus &&
|
||||||
g_object_unref (input);
|
!eekboard_client_enable_cspi_focus (client)) {
|
||||||
keyboard = eek_keyboard_new (layout, 640, 480);
|
g_printerr ("Can't register focus change event listeners\n");
|
||||||
g_object_unref (layout);
|
exit (1);
|
||||||
|
|
||||||
keyboard_id = eekboard_context_add_keyboard (context, keyboard, NULL);
|
|
||||||
g_object_unref (keyboard);
|
|
||||||
|
|
||||||
eekboard_context_set_keyboard (context, keyboard_id, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_set_group >= 0) {
|
if (opt_keystroke &&
|
||||||
eekboard_context_set_group (context, opt_set_group, NULL);
|
!eekboard_client_enable_cspi_keystroke (client)) {
|
||||||
|
g_printerr ("Can't register keystroke event listeners\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
g_printerr ("Desktop accessibility support is disabled\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* HAVE_CSPI */
|
||||||
|
|
||||||
|
if (opt_model || opt_layouts || opt_options) {
|
||||||
|
if (!eekboard_client_set_xkl_config (client,
|
||||||
|
opt_model,
|
||||||
|
opt_layouts,
|
||||||
|
opt_options)) {
|
||||||
|
g_printerr ("Can't set xklavier config\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
} else if (!eekboard_client_enable_xkl (client)) {
|
||||||
|
g_printerr ("Can't register xklavier event listeners\n");
|
||||||
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_show_keyboard) {
|
#ifdef HAVE_FAKEKEY
|
||||||
eekboard_context_show_keyboard (context, NULL);
|
if (!eekboard_client_enable_fakekey (client)) {
|
||||||
|
g_printerr ("Can't init fakekey\n");
|
||||||
|
exit (1);
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_FAKEKEY */
|
||||||
|
|
||||||
if (opt_hide_keyboard) {
|
|
||||||
eekboard_context_hide_keyboard (context, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opt_press_key >= 0) {
|
|
||||||
eekboard_context_press_key (context, opt_press_key, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opt_release_key >= 0) {
|
|
||||||
eekboard_context_release_key (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);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
g_main_loop_run (loop);
|
if (!opt_focus) {
|
||||||
|
g_object_get (client, "context", &context, NULL);
|
||||||
|
g_signal_connect (context, "notify::keyboard-visible",
|
||||||
|
G_CALLBACK(on_notify_keyboard_visible), loop);
|
||||||
|
g_signal_connect (context, "destroyed",
|
||||||
|
G_CALLBACK(on_context_destroyed), loop);
|
||||||
|
g_object_unref (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
if (opt_fullscreen) {
|
||||||
if (context)
|
g_object_get (client, "context", &context, NULL);
|
||||||
|
eekboard_context_set_fullscreen (context, TRUE, NULL);
|
||||||
g_object_unref (context);
|
g_object_unref (context);
|
||||||
if (connection)
|
}
|
||||||
g_object_unref (connection);
|
|
||||||
if (loop)
|
g_object_get (client, "eekboard", &eekboard, NULL);
|
||||||
|
g_signal_connect (eekboard, "destroyed",
|
||||||
|
G_CALLBACK(on_destroyed), loop);
|
||||||
|
|
||||||
|
g_main_loop_run (loop);
|
||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
|
|
||||||
return retval;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
#include "eek/eek.h"
|
#include "eek/eek.h"
|
||||||
#include "eek/eek-xkl.h"
|
#include "eek/eek-xkl.h"
|
||||||
#include "eekboard/eekboard.h"
|
#include "eekboard/eekboard.h"
|
||||||
#include "desktop-client.h"
|
#include "client.h"
|
||||||
#include "xklutil.h"
|
#include "xklutil.h"
|
||||||
|
|
||||||
#define CSW 640
|
#define CSW 640
|
||||||
@ -48,9 +48,9 @@ enum {
|
|||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _EekboardDesktopClientClass EekboardDesktopClientClass;
|
typedef struct _EekboardClientClass EekboardClientClass;
|
||||||
|
|
||||||
struct _EekboardDesktopClient {
|
struct _EekboardClient {
|
||||||
GObject parent;
|
GObject parent;
|
||||||
|
|
||||||
EekboardEekboard *eekboard;
|
EekboardEekboard *eekboard;
|
||||||
@ -78,11 +78,11 @@ struct _EekboardDesktopClient {
|
|||||||
#endif /* HAVE_FAKEKEY */
|
#endif /* HAVE_FAKEKEY */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _EekboardDesktopClientClass {
|
struct _EekboardClientClass {
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (EekboardDesktopClient, eekboard_desktop_client, G_TYPE_OBJECT);
|
G_DEFINE_TYPE (EekboardClient, eekboard_client, G_TYPE_OBJECT);
|
||||||
|
|
||||||
static GdkFilterReturn filter_xkl_event (GdkXEvent *xev,
|
static GdkFilterReturn filter_xkl_event (GdkXEvent *xev,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
@ -106,19 +106,19 @@ static SPIBoolean keystroke_listener_cb
|
|||||||
(const AccessibleKeystroke *stroke,
|
(const AccessibleKeystroke *stroke,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
#endif /* HAVE_CSPI */
|
#endif /* HAVE_CSPI */
|
||||||
static gboolean set_keyboard (EekboardDesktopClient *client,
|
static gboolean set_keyboard (EekboardClient *client,
|
||||||
gboolean show,
|
gboolean show,
|
||||||
const gchar *model,
|
const gchar *model,
|
||||||
const gchar *layouts,
|
const gchar *layouts,
|
||||||
const gchar *options);
|
const gchar *options);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eekboard_desktop_client_set_property (GObject *object,
|
eekboard_client_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = EEKBOARD_DESKTOP_CLIENT(object);
|
EekboardClient *client = EEKBOARD_CLIENT(object);
|
||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
@ -129,7 +129,7 @@ eekboard_desktop_client_set_property (GObject *object,
|
|||||||
if (client->eekboard != NULL) {
|
if (client->eekboard != NULL) {
|
||||||
client->context =
|
client->context =
|
||||||
eekboard_eekboard_create_context (client->eekboard,
|
eekboard_eekboard_create_context (client->eekboard,
|
||||||
"eekboard-desktop-client",
|
"eekboard",
|
||||||
NULL);
|
NULL);
|
||||||
if (client->context == NULL) {
|
if (client->context == NULL) {
|
||||||
g_object_unref (client->eekboard);
|
g_object_unref (client->eekboard);
|
||||||
@ -149,12 +149,12 @@ eekboard_desktop_client_set_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eekboard_desktop_client_get_property (GObject *object,
|
eekboard_client_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = EEKBOARD_DESKTOP_CLIENT(object);
|
EekboardClient *client = EEKBOARD_CLIENT(object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_EEKBOARD:
|
case PROP_EEKBOARD:
|
||||||
@ -172,19 +172,19 @@ eekboard_desktop_client_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eekboard_desktop_client_dispose (GObject *object)
|
eekboard_client_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = EEKBOARD_DESKTOP_CLIENT(object);
|
EekboardClient *client = EEKBOARD_CLIENT(object);
|
||||||
|
|
||||||
eekboard_desktop_client_disable_xkl (client);
|
eekboard_client_disable_xkl (client);
|
||||||
|
|
||||||
#ifdef HAVE_CSPI
|
#ifdef HAVE_CSPI
|
||||||
eekboard_desktop_client_disable_cspi_focus (client);
|
eekboard_client_disable_cspi_focus (client);
|
||||||
eekboard_desktop_client_disable_cspi_keystroke (client);
|
eekboard_client_disable_cspi_keystroke (client);
|
||||||
#endif /* HAVE_CSPI */
|
#endif /* HAVE_CSPI */
|
||||||
|
|
||||||
#ifdef HAVE_FAKEKEY
|
#ifdef HAVE_FAKEKEY
|
||||||
eekboard_desktop_client_disable_fakekey (client);
|
eekboard_client_disable_fakekey (client);
|
||||||
#endif /* HAVE_FAKEKEY */
|
#endif /* HAVE_FAKEKEY */
|
||||||
|
|
||||||
if (client->context) {
|
if (client->context) {
|
||||||
@ -217,18 +217,18 @@ eekboard_desktop_client_dispose (GObject *object)
|
|||||||
client->display = NULL;
|
client->display = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
G_OBJECT_CLASS (eekboard_desktop_client_parent_class)->dispose (object);
|
G_OBJECT_CLASS (eekboard_client_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eekboard_desktop_client_class_init (EekboardDesktopClientClass *klass)
|
eekboard_client_class_init (EekboardClientClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
GParamSpec *pspec;
|
GParamSpec *pspec;
|
||||||
|
|
||||||
gobject_class->set_property = eekboard_desktop_client_set_property;
|
gobject_class->set_property = eekboard_client_set_property;
|
||||||
gobject_class->get_property = eekboard_desktop_client_get_property;
|
gobject_class->get_property = eekboard_client_get_property;
|
||||||
gobject_class->dispose = eekboard_desktop_client_dispose;
|
gobject_class->dispose = eekboard_client_dispose;
|
||||||
|
|
||||||
pspec = g_param_spec_object ("connection",
|
pspec = g_param_spec_object ("connection",
|
||||||
"Connection",
|
"Connection",
|
||||||
@ -259,7 +259,7 @@ eekboard_desktop_client_class_init (EekboardDesktopClientClass *klass)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eekboard_desktop_client_init (EekboardDesktopClient *client)
|
eekboard_client_init (EekboardClient *client)
|
||||||
{
|
{
|
||||||
client->eekboard = NULL;
|
client->eekboard = NULL;
|
||||||
client->context = NULL;
|
client->context = NULL;
|
||||||
@ -281,7 +281,7 @@ eekboard_desktop_client_init (EekboardDesktopClient *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
eekboard_desktop_client_set_xkl_config (EekboardDesktopClient *client,
|
eekboard_client_set_xkl_config (EekboardClient *client,
|
||||||
const gchar *model,
|
const gchar *model,
|
||||||
const gchar *layouts,
|
const gchar *layouts,
|
||||||
const gchar *options)
|
const gchar *options)
|
||||||
@ -302,7 +302,7 @@ eekboard_desktop_client_set_xkl_config (EekboardDesktopClient *client,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
eekboard_desktop_client_enable_xkl (EekboardDesktopClient *client)
|
eekboard_client_enable_xkl (EekboardClient *client)
|
||||||
{
|
{
|
||||||
if (!client->display) {
|
if (!client->display) {
|
||||||
client->display = gdk_display_get_default ();
|
client->display = gdk_display_get_default ();
|
||||||
@ -346,7 +346,7 @@ eekboard_desktop_client_enable_xkl (EekboardDesktopClient *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
eekboard_desktop_client_disable_xkl (EekboardDesktopClient *client)
|
eekboard_client_disable_xkl (EekboardClient *client)
|
||||||
{
|
{
|
||||||
if (client->xkl_engine)
|
if (client->xkl_engine)
|
||||||
xkl_engine_stop_listen (client->xkl_engine, XKLL_TRACK_KEYBOARD_STATE);
|
xkl_engine_stop_listen (client->xkl_engine, XKLL_TRACK_KEYBOARD_STATE);
|
||||||
@ -362,7 +362,7 @@ eekboard_desktop_client_disable_xkl (EekboardDesktopClient *client)
|
|||||||
|
|
||||||
#ifdef HAVE_CSPI
|
#ifdef HAVE_CSPI
|
||||||
gboolean
|
gboolean
|
||||||
eekboard_desktop_client_enable_cspi_focus (EekboardDesktopClient *client)
|
eekboard_client_enable_cspi_focus (EekboardClient *client)
|
||||||
{
|
{
|
||||||
client->focus_listener = SPI_createAccessibleEventListener
|
client->focus_listener = SPI_createAccessibleEventListener
|
||||||
((AccessibleEventListenerCB)focus_listener_cb,
|
((AccessibleEventListenerCB)focus_listener_cb,
|
||||||
@ -380,7 +380,7 @@ eekboard_desktop_client_enable_cspi_focus (EekboardDesktopClient *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
eekboard_desktop_client_disable_cspi_focus (EekboardDesktopClient *client)
|
eekboard_client_disable_cspi_focus (EekboardClient *client)
|
||||||
{
|
{
|
||||||
if (client->focus_listener) {
|
if (client->focus_listener) {
|
||||||
SPI_deregisterGlobalEventListenerAll (client->focus_listener);
|
SPI_deregisterGlobalEventListenerAll (client->focus_listener);
|
||||||
@ -390,7 +390,7 @@ eekboard_desktop_client_disable_cspi_focus (EekboardDesktopClient *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
eekboard_desktop_client_enable_cspi_keystroke (EekboardDesktopClient *client)
|
eekboard_client_enable_cspi_keystroke (EekboardClient *client)
|
||||||
{
|
{
|
||||||
client->keystroke_listener =
|
client->keystroke_listener =
|
||||||
SPI_createAccessibleKeystrokeListener (keystroke_listener_cb,
|
SPI_createAccessibleKeystrokeListener (keystroke_listener_cb,
|
||||||
@ -408,7 +408,7 @@ eekboard_desktop_client_enable_cspi_keystroke (EekboardDesktopClient *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
eekboard_desktop_client_disable_cspi_keystroke (EekboardDesktopClient *client)
|
eekboard_client_disable_cspi_keystroke (EekboardClient *client)
|
||||||
{
|
{
|
||||||
if (client->keystroke_listener) {
|
if (client->keystroke_listener) {
|
||||||
SPI_deregisterAccessibleKeystrokeListener (client->keystroke_listener,
|
SPI_deregisterAccessibleKeystrokeListener (client->keystroke_listener,
|
||||||
@ -422,7 +422,7 @@ static SPIBoolean
|
|||||||
focus_listener_cb (const AccessibleEvent *event,
|
focus_listener_cb (const AccessibleEvent *event,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
Accessible *accessible = event->source;
|
Accessible *accessible = event->source;
|
||||||
AccessibleStateSet *state_set = Accessible_getStateSet (accessible);
|
AccessibleStateSet *state_set = Accessible_getStateSet (accessible);
|
||||||
AccessibleRole role = Accessible_getRole (accessible);
|
AccessibleRole role = Accessible_getRole (accessible);
|
||||||
@ -466,7 +466,7 @@ static SPIBoolean
|
|||||||
keystroke_listener_cb (const AccessibleKeystroke *stroke,
|
keystroke_listener_cb (const AccessibleKeystroke *stroke,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
EekKey *key;
|
EekKey *key;
|
||||||
|
|
||||||
/* Ignore modifiers since the keystroke listener does not called
|
/* Ignore modifiers since the keystroke listener does not called
|
||||||
@ -489,10 +489,10 @@ keystroke_listener_cb (const AccessibleKeystroke *stroke,
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_CSPI */
|
#endif /* HAVE_CSPI */
|
||||||
|
|
||||||
EekboardDesktopClient *
|
EekboardClient *
|
||||||
eekboard_desktop_client_new (GDBusConnection *connection)
|
eekboard_client_new (GDBusConnection *connection)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = g_object_new (EEKBOARD_TYPE_DESKTOP_CLIENT,
|
EekboardClient *client = g_object_new (EEKBOARD_TYPE_CLIENT,
|
||||||
"connection", connection,
|
"connection", connection,
|
||||||
NULL);
|
NULL);
|
||||||
if (client->context)
|
if (client->context)
|
||||||
@ -505,7 +505,7 @@ filter_xkl_event (GdkXEvent *xev,
|
|||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
XEvent *xevent = (XEvent *)xev;
|
XEvent *xevent = (XEvent *)xev;
|
||||||
|
|
||||||
xkl_engine_filter_events (client->xkl_engine, xevent);
|
xkl_engine_filter_events (client->xkl_engine, xevent);
|
||||||
@ -516,7 +516,7 @@ static void
|
|||||||
on_xkl_config_changed (XklEngine *xklengine,
|
on_xkl_config_changed (XklEngine *xklengine,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
gboolean retval;
|
gboolean retval;
|
||||||
|
|
||||||
retval = set_keyboard (client, FALSE, NULL, NULL, NULL);
|
retval = set_keyboard (client, FALSE, NULL, NULL, NULL);
|
||||||
@ -529,7 +529,7 @@ on_xkl_config_changed (XklEngine *xklengine,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
set_keyboard (EekboardDesktopClient *client,
|
set_keyboard (EekboardClient *client,
|
||||||
gboolean show,
|
gboolean show,
|
||||||
const gchar *model,
|
const gchar *model,
|
||||||
const gchar *layouts,
|
const gchar *layouts,
|
||||||
@ -608,7 +608,7 @@ on_xkl_state_changed (XklEngine *xklengine,
|
|||||||
gboolean restore,
|
gboolean restore,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
|
|
||||||
if (type == GROUP_CHANGED && client->keyboard) {
|
if (type == GROUP_CHANGED && client->keyboard) {
|
||||||
gint group = eek_element_get_group (EEK_ELEMENT(client->keyboard));
|
gint group = eek_element_get_group (EEK_ELEMENT(client->keyboard));
|
||||||
@ -641,7 +641,7 @@ on_key_pressed (EekKeyboard *keyboard,
|
|||||||
EekKey *key,
|
EekKey *key,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
EekSymbol *symbol;
|
EekSymbol *symbol;
|
||||||
|
|
||||||
g_assert (client->fakekey);
|
g_assert (client->fakekey);
|
||||||
@ -671,14 +671,14 @@ on_key_released (EekKeyboard *keyboard,
|
|||||||
EekKey *key,
|
EekKey *key,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
EekboardDesktopClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
|
|
||||||
g_assert (client->fakekey);
|
g_assert (client->fakekey);
|
||||||
fakekey_release (client->fakekey);
|
fakekey_release (client->fakekey);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
eekboard_desktop_client_enable_fakekey (EekboardDesktopClient *client)
|
eekboard_client_enable_fakekey (EekboardClient *client)
|
||||||
{
|
{
|
||||||
if (!client->display) {
|
if (!client->display) {
|
||||||
client->display = gdk_display_get_default ();
|
client->display = gdk_display_get_default ();
|
||||||
@ -701,7 +701,7 @@ eekboard_desktop_client_enable_fakekey (EekboardDesktopClient *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
eekboard_desktop_client_disable_fakekey (EekboardDesktopClient *client)
|
eekboard_client_disable_fakekey (EekboardClient *client)
|
||||||
{
|
{
|
||||||
if (client->fakekey)
|
if (client->fakekey)
|
||||||
fakekey_release (client->fakekey);
|
fakekey_release (client->fakekey);
|
||||||
58
src/client.h
Normal file
58
src/client.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* 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_CLIENT_H
|
||||||
|
#define EEKBOARD_CLIENT_H 1
|
||||||
|
|
||||||
|
#include <gio/gio.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#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_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEKBOARD_TYPE_CLIENT))
|
||||||
|
#define EEKBOARD_IS_CLIENT_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 _EekboardClient EekboardClient;
|
||||||
|
|
||||||
|
EekboardClient * eekboard_client_new (GDBusConnection *connection);
|
||||||
|
|
||||||
|
gboolean eekboard_client_set_xkl_config (EekboardClient *client,
|
||||||
|
const gchar *model,
|
||||||
|
const gchar *layouts,
|
||||||
|
const gchar *options);
|
||||||
|
|
||||||
|
gboolean eekboard_client_enable_xkl (EekboardClient *client);
|
||||||
|
void eekboard_client_disable_xkl (EekboardClient *client);
|
||||||
|
|
||||||
|
gboolean eekboard_client_enable_cspi_focus
|
||||||
|
(EekboardClient *client);
|
||||||
|
void eekboard_client_disable_cspi_focus
|
||||||
|
(EekboardClient *client);
|
||||||
|
|
||||||
|
gboolean eekboard_client_enable_cspi_keystroke
|
||||||
|
(EekboardClient *client);
|
||||||
|
void eekboard_client_disable_cspi_keystroke
|
||||||
|
(EekboardClient *client);
|
||||||
|
|
||||||
|
gboolean eekboard_client_enable_fakekey (EekboardClient *client);
|
||||||
|
void eekboard_client_disable_fakekey (EekboardClient *client);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
#endif /* EEKBOARD_CLIENT_H */
|
||||||
@ -1,245 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif /* HAVE_CONFIG_H */
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <cspi/spi.h>
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#include <glib/gi18n.h>
|
|
||||||
#include <gconf/gconf-client.h>
|
|
||||||
#include "eekboard/eekboard.h"
|
|
||||||
#include "desktop-client.h"
|
|
||||||
|
|
||||||
static gboolean opt_system = FALSE;
|
|
||||||
static gboolean opt_session = FALSE;
|
|
||||||
static gchar *opt_address = NULL;
|
|
||||||
|
|
||||||
#ifdef HAVE_CSPI
|
|
||||||
static gboolean opt_focus = FALSE;
|
|
||||||
static gboolean opt_keystroke = FALSE;
|
|
||||||
#endif /* HAVE_CSPI */
|
|
||||||
|
|
||||||
static gchar *opt_model = NULL;
|
|
||||||
static gchar *opt_layouts = NULL;
|
|
||||||
static gchar *opt_options = NULL;
|
|
||||||
|
|
||||||
static gboolean opt_fullscreen = FALSE;
|
|
||||||
|
|
||||||
static const GOptionEntry options[] = {
|
|
||||||
{"system", 'y', 0, G_OPTION_ARG_NONE, &opt_system,
|
|
||||||
N_("Connect to the system bus")},
|
|
||||||
{"session", 'e', 0, G_OPTION_ARG_NONE, &opt_session,
|
|
||||||
N_("Connect to the session bus")},
|
|
||||||
{"address", 'a', 0, G_OPTION_ARG_STRING, &opt_address,
|
|
||||||
N_("Connect to the given D-Bus address")},
|
|
||||||
#ifdef HAVE_CSPI
|
|
||||||
{"listen-focus", 'f', 0, G_OPTION_ARG_NONE, &opt_focus,
|
|
||||||
N_("Listen focus change events with AT-SPI")},
|
|
||||||
{"listen-keystroke", 's', 0, G_OPTION_ARG_NONE, &opt_keystroke,
|
|
||||||
N_("Listen keystroke events with AT-SPI")},
|
|
||||||
#endif /* HAVE_CSPI */
|
|
||||||
{"model", '\0', 0, G_OPTION_ARG_STRING, &opt_model,
|
|
||||||
N_("Specify model")},
|
|
||||||
{"layouts", '\0', 0, G_OPTION_ARG_STRING, &opt_layouts,
|
|
||||||
N_("Specify layouts")},
|
|
||||||
{"options", '\0', 0, G_OPTION_ARG_STRING, &opt_options,
|
|
||||||
N_("Specify options")},
|
|
||||||
{"fullscreen", 'F', 0, G_OPTION_ARG_NONE, &opt_fullscreen,
|
|
||||||
N_("Create window in fullscreen mode")},
|
|
||||||
{NULL}
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_notify_keyboard_visible (GObject *object,
|
|
||||||
GParamSpec *spec,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GMainLoop *loop = user_data;
|
|
||||||
gboolean visible;
|
|
||||||
|
|
||||||
g_object_get (object, "keyboard-visible", &visible, NULL);
|
|
||||||
|
|
||||||
/* user explicitly closed the window */
|
|
||||||
if (!visible && eekboard_context_is_enabled (EEKBOARD_CONTEXT(object)))
|
|
||||||
g_main_loop_quit (loop);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_context_destroyed (EekboardContext *context,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GMainLoop *loop = user_data;
|
|
||||||
|
|
||||||
g_main_loop_quit (loop);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_destroyed (EekboardEekboard *eekboard,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GMainLoop *loop = user_data;
|
|
||||||
|
|
||||||
g_main_loop_quit (loop);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
main (int argc, char **argv)
|
|
||||||
{
|
|
||||||
EekboardDesktopClient *client;
|
|
||||||
EekboardEekboard *eekboard;
|
|
||||||
EekboardContext *context;
|
|
||||||
GBusType bus_type;
|
|
||||||
GDBusConnection *connection;
|
|
||||||
GError *error;
|
|
||||||
GConfClient *gconfc;
|
|
||||||
GOptionContext *option_context;
|
|
||||||
GMainLoop *loop;
|
|
||||||
|
|
||||||
if (!gtk_init_check (&argc, &argv)) {
|
|
||||||
g_printerr ("Can't init GTK\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
option_context = g_option_context_new ("eekboard-desktop-client");
|
|
||||||
g_option_context_add_main_entries (option_context, options, NULL);
|
|
||||||
g_option_context_parse (option_context, &argc, &argv, NULL);
|
|
||||||
g_option_context_free (option_context);
|
|
||||||
|
|
||||||
if (opt_system)
|
|
||||||
bus_type = G_BUS_TYPE_SYSTEM;
|
|
||||||
else if (opt_address)
|
|
||||||
bus_type = G_BUS_TYPE_NONE;
|
|
||||||
else
|
|
||||||
bus_type = G_BUS_TYPE_SESSION;
|
|
||||||
|
|
||||||
switch (bus_type) {
|
|
||||||
case G_BUS_TYPE_SYSTEM:
|
|
||||||
case G_BUS_TYPE_SESSION:
|
|
||||||
error = NULL;
|
|
||||||
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
|
|
||||||
if (connection == NULL) {
|
|
||||||
g_printerr ("Can't connect to the bus: %s\n", error->message);
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case G_BUS_TYPE_NONE:
|
|
||||||
error = NULL;
|
|
||||||
connection = g_dbus_connection_new_for_address_sync (opt_address,
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
&error);
|
|
||||||
if (connection == NULL) {
|
|
||||||
g_printerr ("Can't connect to the bus at %s: %s\n",
|
|
||||||
opt_address,
|
|
||||||
error->message);
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
client = eekboard_desktop_client_new (connection);
|
|
||||||
if (client == NULL) {
|
|
||||||
g_printerr ("Can't create a client\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
gconfc = gconf_client_get_default ();
|
|
||||||
|
|
||||||
#ifdef HAVE_CSPI
|
|
||||||
error = NULL;
|
|
||||||
if (opt_focus || opt_keystroke) {
|
|
||||||
if (gconf_client_get_bool (gconfc,
|
|
||||||
"/desktop/gnome/interface/accessibility",
|
|
||||||
&error) ||
|
|
||||||
gconf_client_get_bool (gconfc,
|
|
||||||
"/desktop/gnome/interface/accessibility2",
|
|
||||||
&error)) {
|
|
||||||
if (SPI_init () != 0) {
|
|
||||||
g_printerr ("Can't init CSPI\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opt_focus &&
|
|
||||||
!eekboard_desktop_client_enable_cspi_focus (client)) {
|
|
||||||
g_printerr ("Can't register focus change event listeners\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opt_keystroke &&
|
|
||||||
!eekboard_desktop_client_enable_cspi_keystroke (client)) {
|
|
||||||
g_printerr ("Can't register keystroke event listeners\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
g_printerr ("Desktop accessibility support is disabled\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* HAVE_CSPI */
|
|
||||||
|
|
||||||
if (opt_model || opt_layouts || opt_options) {
|
|
||||||
if (!eekboard_desktop_client_set_xkl_config (client,
|
|
||||||
opt_model,
|
|
||||||
opt_layouts,
|
|
||||||
opt_options)) {
|
|
||||||
g_printerr ("Can't set xklavier config\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
} else if (!eekboard_desktop_client_enable_xkl (client)) {
|
|
||||||
g_printerr ("Can't register xklavier event listeners\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_FAKEKEY
|
|
||||||
if (!eekboard_desktop_client_enable_fakekey (client)) {
|
|
||||||
g_printerr ("Can't init fakekey\n");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
#endif /* HAVE_FAKEKEY */
|
|
||||||
|
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
|
||||||
if (!opt_focus) {
|
|
||||||
g_object_get (client, "context", &context, NULL);
|
|
||||||
g_signal_connect (context, "notify::keyboard-visible",
|
|
||||||
G_CALLBACK(on_notify_keyboard_visible), loop);
|
|
||||||
g_signal_connect (context, "destroyed",
|
|
||||||
G_CALLBACK(on_context_destroyed), loop);
|
|
||||||
g_object_unref (context);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opt_fullscreen) {
|
|
||||||
g_object_get (client, "context", &context, NULL);
|
|
||||||
eekboard_context_set_fullscreen (context, TRUE, NULL);
|
|
||||||
g_object_unref (context);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_get (client, "eekboard", &eekboard, NULL);
|
|
||||||
g_signal_connect (eekboard, "destroyed",
|
|
||||||
G_CALLBACK(on_destroyed), loop);
|
|
||||||
|
|
||||||
g_main_loop_run (loop);
|
|
||||||
g_main_loop_unref (loop);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_DESKTOP_CLIENT_H
|
|
||||||
#define EEKBOARD_DESKTOP_CLIENT_H 1
|
|
||||||
|
|
||||||
#include <gio/gio.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define EEKBOARD_TYPE_DESKTOP_CLIENT (eekboard_desktop_client_get_type())
|
|
||||||
#define EEKBOARD_DESKTOP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEKBOARD_TYPE_DESKTOP_CLIENT, EekboardDesktopClient))
|
|
||||||
#define EEKBOARD_DESKTOP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEKBOARD_TYPE_DESKTOP_CLIENT, EekboardDesktopClientClass))
|
|
||||||
#define EEKBOARD_IS_DESKTOP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEKBOARD_TYPE_DESKTOP_CLIENT))
|
|
||||||
#define EEKBOARD_IS_DESKTOP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEKBOARD_TYPE_DESKTOP_CLIENT))
|
|
||||||
#define EEKBOARD_DESKTOP_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEKBOARD_TYPE_DESKTOP_CLIENT, EekboardDesktopClientClass))
|
|
||||||
|
|
||||||
typedef struct _EekboardDesktopClient EekboardDesktopClient;
|
|
||||||
|
|
||||||
EekboardDesktopClient * eekboard_desktop_client_new
|
|
||||||
(GDBusConnection *connection);
|
|
||||||
|
|
||||||
gboolean eekboard_desktop_client_set_xkl_config
|
|
||||||
(EekboardDesktopClient *client,
|
|
||||||
const gchar *model,
|
|
||||||
const gchar *layouts,
|
|
||||||
const gchar *options);
|
|
||||||
|
|
||||||
gboolean eekboard_desktop_client_enable_xkl
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
void eekboard_desktop_client_disable_xkl
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
|
|
||||||
gboolean eekboard_desktop_client_enable_cspi_focus
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
void eekboard_desktop_client_disable_cspi_focus
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
|
|
||||||
gboolean eekboard_desktop_client_enable_cspi_keystroke
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
void eekboard_desktop_client_disable_cspi_keystroke
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
|
|
||||||
gboolean eekboard_desktop_client_enable_fakekey
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
void eekboard_desktop_client_disable_fakekey
|
|
||||||
(EekboardDesktopClient *client);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
#endif /* EEKBOARD_DESKTOP_CLIENT_H */
|
|
||||||
Reference in New Issue
Block a user