Commit 9b452c0f authored by Daiki Ueno's avatar Daiki Ueno

Initial commit.

parents
((c-mode . ((c-basic-offset . 4)
(indent-tabs-mode . nil))))
\ No newline at end of file
*.la
*.lo
*.loT
*.o
*.so
*~
Makefile
Makefile.in
.deps
.libs
INSTALL
aclocal.m4
autom4te.cache
compile
config.guess
config.h
config.h.in
config.log
config.rpath
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1
libkeyactor*.tar.*
mkinstalldirs
docs/reference/eek/eek-overrides.txt
docs/reference/eek/eek-sections.txt
docs/reference/eek/eek.types
m4/*.m4
gtk-doc.make
eek/eek-special-keysym-labels.h
eek/eek-unicode-keysym-labels.h
eek/eek-keyname-keysym-labels.h
\ No newline at end of file
This diff is collapsed.
# Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
# Copyright (C) 2010 Red Hat, Inc.
# 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = eek examples tests docs
eek - easy embedded keyboard
*NOTE* This is not usable by now. It has still a lot of bugs and lacks
many essentital features.
* How to test
$ git clone git://github.com/ueno/eek.git
$ cd eek
$ ./autogen.sh --prefix=/usr --enable-gtk-doc
$ make
$ ./examples/eek-clutter-xkb-test --geometry=winbook --symbols=in
* API
There are two kinds of objects in eek. One is "keyboard element" and
another is "keyboard layout engine". A keyboard element represents
either a keyboard, a section, or a key. Each element implements the
Builder pattern so that it can be converted into a UI widget
(ClutterActor, GTK+ button, ...). A keyboard layout engine arranges
keyboard elements using layout rules from external configuration
mechanisms (XKB, matchbox-keyboard layouts in XML, ...)
Here is a sample code which utilizes Clutter-based keyboard elements
and an XKB-based layout engine:
EekKeyboard *keyboard;
EekLayout *layout;
/* Create a keyboard layout from XKB configuration. */
layout = eek_xkb_layout_new (NULL, "winbook", "in");
/* Create a keyboard that is implemented as ClutterActor. */
keyboard = eek_clutter_keyboard_new ();
/* Apply the layout to the keyboard. */
eek_keyboard_set_layout (keyboard, layout);
clutter_group_add (CLUTTER_GROUP(stage), CLUTTER_ACTOR(keyboard));
- modifier handling
- step-by-step scaling of key labels
- GTK+ keyboard elements
- matchbox-keyboard layout engine
- emit key events using libfakekey or xtest
- .spec
- .pc
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="eek"
(test -f $srcdir/configure.ac \
&& test -f $srcdir/README ) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
which gnome-autogen.sh || {
echo "You need to install gnome-common from the GNOME CVS"
exit 1
}
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
REQUIRED_AUTOMAKE_VERSION=1.8
. gnome-autogen.sh
# Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
# Copyright (C) 2010 Red Hat, Inc.
# 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
AC_INIT([eek], [0.0.0], [ueno@unixuser.org])
AC_CONFIG_SRCDIR([configure.ac])
AC_PREREQ(2.63)
AM_INIT_AUTOMAKE
AM_PROG_CC_C_O
AC_CONFIG_MACRO_DIR([m4])
LT_INIT
PKG_CHECK_MODULES([GLIB2], [glib-2.0], ,
[AC_MSG_ERROR([GLib2 not found])])
PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0], ,
[AC_MSG_ERROR([GObject2 not found])])
PKG_CHECK_MODULES([CAIRO], [cairo], ,
[AC_MSG_ERROR([Cairo not found])])
PKG_CHECK_MODULES([PANGO], [pango], ,
[AC_MSG_ERROR([Pango not found])])
PKG_CHECK_MODULES([CLUTTER], [clutter-1.0], ,
[AC_MSG_ERROR([Clutter not found])])
PKG_CHECK_MODULES([XKB], [gtk+-2.0 gdk-2.0 x11], ,
[AC_MSG_ERROR([XKB support not found])])
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
EEK_API_VERSION=0.1
AC_SUBST(EEK_API_VERSION)
AC_CONFIG_HEADERS([eek/config.h])
AC_CONFIG_FILES([Makefile
eek/Makefile
examples/Makefile
tests/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/eek/Makefile])
AC_OUTPUT
# Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
# Copyright (C) 2010 Red Hat, Inc.
# 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
SUBDIRS = reference
\ No newline at end of file
# Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
# Copyright (C) 2010 Red Hat, Inc.
# 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
SUBDIRS = eek
# Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
# Copyright (C) 2010 Red Hat, Inc.
# 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
## Process this file with automake to produce Makefile.in
# We require automake 1.6 at least.
AUTOMAKE_OPTIONS = 1.6
# This is a blank Makefile.am for using gtk-doc.
# Copy this to your project's API docs directory and modify the variables to
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
# of using the various options.
# The name of the module, e.g. 'glib'.
DOC_MODULE=eek
# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
#DOC_MODULE_VERSION=2
# The top-level SGML file. You can change this if you want to.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
DOC_SOURCE_DIR=../../../eek
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS=
# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
MKDB_OPTIONS=--sgml-mode --output-format=xml
# Extra options to supply to gtkdoc-mktmpl
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
MKTMPL_OPTIONS=
# Extra options to supply to gtkdoc-mkhtml
MKHTML_OPTIONS=
# Extra options to supply to gtkdoc-fixref. Not normally needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=
# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(top_srcdir)/eek/*.h
CFILE_GLOB=$(top_srcdir)/eek/*.c
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
EXTRA_HFILES=
# Header files to ignore when scanning. Use base file name, no paths
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
IGNORE_HFILES= eek-private.h \
eek-clutter-private.h \
eek-keysyms.h \
$(NULL)
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
HTML_IMAGES=
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
content_files=
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
# These files must be listed here *and* in content_files
# e.g. expand_content_files=running.sgml
expand_content_files=
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
# signals and properties.
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
GTKDOC_CFLAGS = $(GOBJECT2_CFLAGS)
GTKDOC_LIBS = $(top_srcdir)/eek/libeek.la \
$(top_srcdir)/eek/libeek-clutter.la \
$(top_srcdir)/eek/libeek-xkb.la \
$(GOBJECT2_LIBS) \
$(CLUTTER_LIBS) \
$(XKB_LIBS) \
$(NULL)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
EXTRA_DIST +=
# Files not to distribute
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
#DISTCLEANFILES +=
# Comment this out if you want your docs-status tested during 'make check'
if ENABLE_GTK_DOC
#TESTS_ENVIRONMENT = cd $(srcsrc) &&
#TESTS = $(GTKDOC_CHECK)
endif
-include $(top_srcdir)/gtk-doc.mk
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<book id="index">
<bookinfo>
<title>eek Reference Manual</title>
<releaseinfo>
for eek 0.0.0.
</releaseinfo>
</bookinfo>
<chapter>
<title>Base classes and interfaces</title>
<xi:include href="xml/eek-keyboard.xml"/>
<xi:include href="xml/eek-section.xml"/>
<xi:include href="xml/eek-key.xml"/>
<xi:include href="xml/eek-layout.xml"/>
</chapter>
<chapter>
<title>Clutter keyboard elements</title>
<xi:include href="xml/eek-clutter-keyboard.xml"/>
<xi:include href="xml/eek-clutter-section.xml"/>
<xi:include href="xml/eek-clutter-key.xml"/>
</chapter>
<chapter>
<title>XKB layout engine</title>
<xi:include href="xml/eek-xkb-layout.xml"/>
</chapter>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>
# Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
# Copyright (C) 2010 Red Hat, Inc.
# 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
lib_LTLIBRARIES = libeek.la libeek-clutter.la libeek-xkb.la
libeek_la_SOURCES = \
eek-layout.c \
eek-layout.h \
eek-keyboard.c \
eek-keyboard.h \
eek-section.c \
eek-section.h \
eek-key.c \
eek-key.h \
eek-simple-keyboard.c \
eek-simple-keyboard.h \
eek-simple-section.c \
eek-simple-section.h \
eek-simple-key.c \
eek-simple-key.h \
eek-private.c \
eek-private.h \
eek-types.h \
eek-types.c \
eek-keysym.h \
eek-keysym.c \
eek-special-keysym-labels.h \
eek-unicode-keysym-labels.h \
eek-keyname-keysym-labels.h \
$(NULL)
libeek_la_CFLAGS = $(GOBJECT2_CFLAGS) $(CAIRO_CFLAGS) $(PANGO_CFLAGS)
libeek_la_LIBADD = $(GOBJECT2_LIBS) $(CAIRO_LIBS) $(PANGO_LIBS)
libeek_clutter_la_SOURCES = \
eek-clutter-keyboard.c \
eek-clutter-keyboard.h \
eek-clutter-section.c \
eek-clutter-section.h \
eek-clutter-key.c \
eek-clutter-key.h \
eek-clutter-private.c \
eek-clutter-private.h \
eek-clutter.h \
$(NULL)
libeek_clutter_la_CFLAGS = $(CLUTTER_CFLAGS)
libeek_clutter_la_LIBADD = libeek.la $(CLUTTER_LIBS)
libeek_xkb_la_SOURCES = \
eek-xkb-layout.h \
eek-xkb-layout.c \
$(NULL)
libeek_xkb_la_CFLAGS = $(XKB_CFLAGS)
libeek_xkb_la_LIBADD = libeek.la $(XKB_LIBS)
eekdir = $(includedir)/eek-$(EEK_API_VERSION)/eek
eek_HEADERS = \
$(top_srcdir)/eek/eek-keyboard.h \
$(top_srcdir)/eek/eek-section.h \
$(top_srcdir)/eek/eek-key.h \
$(top_srcdir)/eek/eek-layout.h \
$(top_srcdir)/eek/eek-keysym.h \
$(top_srcdir)/eek/eek-types.h \
$(top_srcdir)/eek/eek-clutter-keyboard.h \
$(top_srcdir)/eek/eek-clutter-section.h \
$(top_srcdir)/eek/eek-clutter-key.h \
$(top_srcdir)/eek/eek-xkb-layout.h \
$(top_srcdir)/eek/eek.h \
$(top_srcdir)/eek/eek-clutter.h \
$(top_srcdir)/eek/eek-xkb.h
eek-keysym.c: eek-special-keysym-labels.h eek-unicode-keysym-labels.h eek-keyname-keysym-labels.h
eek-special-keysym-labels.h: special-keysym-labels.txt
./gen-keysym-labels.py $< special_keysym_labels > $@
eek-unicode-keysym-labels.h: unicode-keysym-labels.txt
./gen-keysym-labels.py $< unicode_keysym_labels > $@
eek-keyname-keysym-labels.h: keyname-keysym-labels.txt
./gen-keysym-labels.py $< keyname_keysym_labels > $@
DISTCLEANFILES = \
eek-special-keysym-labels.h \
eek-unicode-keysym-labels.h \
eek-keyname-keysym-labels.h
EXTRA_DIST = \
gen-keysym-labels.py \
special-keysym-labels.txt \
unicode-keysym-labels.txt \
keyname-keysym-labels.txt
This diff is collapsed.
/*
* Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
* Copyright (C) 2010 Red Hat, Inc.
*
* 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef EEK_CLUTTER_KEY_H
#define EEK_CLUTTER_KEY_H 1
#include <clutter/clutter.h>
#include "eek-key.h"
G_BEGIN_DECLS
#define EEK_TYPE_CLUTTER_KEY (eek_clutter_key_get_type())
#define EEK_CLUTTER_KEY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEK_TYPE_CLUTTER_KEY, EekClutterKey))
#define EEK_CLUTTER_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEK_TYPE_CLUTTER_KEY, EekClutterKeyClass))
#define EEK_IS_CLUTTER_KEY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEK_TYPE_CLUTTER_KEY))
#define EEK_IS_CLUTTER_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEK_TYPE_CLUTTER_KEY))
#define EEK_CLUTTER_KEY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEK_TYPE_CLUTTER_KEY, EekClutterKeyClass))
typedef struct _EekClutterKey EekClutterKey;
typedef struct _EekClutterKeyClass EekClutterKeyClass;
typedef struct _EekClutterKeyPrivate EekClutterKeyPrivate;
struct _EekClutterKey
{
/*< private >*/
ClutterGroup parent;
/*< private >*/
EekClutterKeyPrivate *priv;
};
struct _EekClutterKeyClass
{
/*< private >*/
ClutterGroupClass parent_class;
};
GType eek_clutter_key_get_type (void) G_GNUC_CONST;
ClutterActor *eek_clutter_key_create_texture (EekClutterKey *key);
void eek_clutter_key_set_texture (EekClutterKey *key,
ClutterActor *texture);
G_END_DECLS
#endif /* EEK_CLUTTER_KEY_H */
/*
* Copyright (C) 2010 Daiki Ueno <ueno@unixuser.org>
* Copyright (C) 2010 Red Hat, Inc.
*
* 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 License, 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., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
/**
* SECTION:eek-clutter-keyboard
* @short_description: #EekKeyboard implemented as a #ClutterActor
*
* The #EekClutterKeyboard class implements the #EekKeyboardIface
* interface as a #ClutterActor.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include "eek-clutter-keyboard.h"
#include "eek-clutter-private.h"
#include "eek-simple-keyboard.h"
enum {
PROP_0,
PROP_BOUNDS,
PROP_LAST
};
static void eek_keyboard_iface_init (EekKeyboardIface *iface);
G_DEFINE_TYPE_WITH_CODE (EekClutterKeyboard, eek_clutter_keyboard,
CLUTTER_TYPE_GROUP,
G_IMPLEMENT_INTERFACE (EEK_TYPE_KEYBOARD,
eek_keyboard_iface_init));
#define EEK_CLUTTER_KEYBOARD_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), EEK_TYPE_CLUTTER_KEYBOARD, EekClutterKeyboardPrivate))
struct _EekClutterKeyboardPrivate
{
EekSimpleKeyboard *simple;
};
static void
eek_clutter_keyboard_real_set_bounds (EekKeyboard *self,
EekBounds *bounds)
{
EekClutterKeyboardPrivate *priv = EEK_CLUTTER_KEYBOARD_GET_PRIVATE(self);
fflush (stdout);
g_return_if_fail (priv);
eek_keyboard_set_bounds (EEK_KEYBOARD(priv->simple), bounds);
clutter_actor_set_position (CLUTTER_ACTOR(self), bounds->x, bounds->y);
clutter_actor_set_size (CLUTTER_ACTOR(self), bounds->w, bounds->h);
}
static void
eek_clutter_keyboard_real_get_bounds (EekKeyboard *self,
EekBounds *bounds)
{
EekClutterKeyboardPrivate *priv = EEK_CLUTTER_KEYBOARD_GET_PRIVATE(self);
g_return_if_fail (priv);
return eek_keyboard_get_bounds (EEK_KEYBOARD(priv->simple), bounds);
}
static EekSection *
eek_clutter_keyboard_real_create_section (EekKeyboard *self,
const gchar *name,
gint angle,
EekBounds *bounds)
{
EekSection *section;
g_return_if_fail (EEK_IS_CLUTTER_KEYBOARD(self));
section = g_object_new (EEK_TYPE_CLUTTER_SECTION,
"name", name,
"angle", angle,
"bounds", bounds,
NULL);
clutter_container_add_actor (CLUTTER_CONTAINER(self),
CLUTTER_ACTOR(section));
return section;
}
static void
eek_clutter_keyboard_real_foreach_section (EekKeyboard *self,
GFunc func,
gpointer user_data)
{
EekClutterCallbackData data;
g_return_if_fail (EEK_IS_CLUTTER_KEYBOARD(self));
data.func = func;
data.user_data = user_data;
clutter_container_foreach (CLUTTER_CONTAINER(self),
eek_clutter_callback,
&data);
}
static void
eek_clutter_keyboard_real_set_layout (EekKeyboard *self,
EekLayout *layout)
{
g_return_if_fail (EEK_IS_KEYBOARD(self));
g_return_if_fail (EEK_IS_LAYOUT(layout));
EEK_LAYOUT_GET_CLASS(layout)->apply_to_keyboard (layout, self);
if (g_object_is_floating (layout))
g_object_unref (layout);
}
static void
eek_keyboard_iface_init (EekKeyboardIface *iface)
{
iface->set_bounds = eek_clutter_keyboard_real_set_bounds;
iface->get_bounds = eek_clutter_keyboard_real_get_bounds;
iface->create_section = eek_clutter_keyboard_real_create_section;
iface->foreach_section = eek_clutter_keyboard_real_foreach_section;
iface->set_layout = eek_clutter_keyboard_real_set_layout;
}
static void
eek_clutter_keyboard_dispose (GObject *object)
{
clutter_group_remove_all (CLUTTER_GROUP(object));
G_OBJECT_CLASS (eek_clutter_keyboard_parent_class)->dispose (object);
}
static void
eek_clutter_keyboard_finalize (GObject *object)
{
EekClutterKeyboardPrivate *priv = EEK_CLUTTER_KEYBOARD_GET_PRIVATE(object);
g_object_unref (priv->simple);
G_OBJECT_CLASS (eek_clutter_keyboard_parent_class)->finalize (object);
}
static void
eek_clutter_keyboard_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
EekClutterKeyboardPrivate *priv = EEK_CLUTTER_KEYBOARD_GET_PRIVATE(object);