This commit is contained in:
Daiki Ueno
2011-02-23 05:14:14 +09:00
parent 2c067482de
commit caf105cbd9
6 changed files with 245 additions and 38 deletions

View File

@ -8,15 +8,15 @@
<bookinfo> <bookinfo>
<title>libeek Reference Manual</title> <title>libeek Reference Manual</title>
<releaseinfo> <releaseinfo>
for libeek 0.0.5. for libeek 0.90.0.
</releaseinfo> </releaseinfo>
<copyright> <copyright>
<year>2010</year> <year>2010-2011</year>
<holder>Daiki Ueno</holder> <holder>Daiki Ueno</holder>
</copyright> </copyright>
<copyright> <copyright>
<year>2010</year> <year>2010-2011</year>
<holder>Red Hat, Inc.</holder> <holder>Red Hat, Inc.</holder>
</copyright> </copyright>

View File

@ -97,7 +97,7 @@ HTML_IMAGES=
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
GTKDOC_CFLAGS = $(GIO2_CFLAGS) GTKDOC_CFLAGS = $(GIO2_CFLAGS)
GTKDOC_LIBS = $(top_builddir)/eekboard/libeekboard.la GTKDOC_LIBS = $(top_builddir)/eekboard/libeekboard.la $(GIO2_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize. # This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make include $(top_srcdir)/gtk-doc.make

View File

@ -8,25 +8,44 @@
<bookinfo> <bookinfo>
<title>eekboard Reference Manual</title> <title>eekboard Reference Manual</title>
<releaseinfo> <releaseinfo>
for eekboard [VERSION]. for eekboard 0.90.0.
The latest version of this documentation can be found on-line at
<ulink role="online-location" url="http://[SERVER]/eekboard/index.html">http://[SERVER]/eekboard/</ulink>.
</releaseinfo> </releaseinfo>
<copyright>
<year>2011</year>
<holder>Daiki Ueno</holder>
</copyright>
<copyright>
<year>2011</year>
<holder>Red Hat, Inc.</holder>
</copyright>
<legalnotice>
<para>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts and
no Back-Cover Texts. A copy of the license is included in the
section entitled "GNU Free Documentation License".
</para>
</legalnotice>
</bookinfo> </bookinfo>
<chapter> <part id="apireference">
<title>[Insert title here]</title> <title>API Manual</title>
<xi:include href="xml/eekboard-proxy.xml"/> <chapter>
<title>D-Bus proxy to eekboard-server</title>
</chapter> <xi:include href="xml/eekboard-server.xml"/>
<chapter id="object-tree"> <xi:include href="xml/eekboard-context.xml"/>
<title>Object Hierarchy</title> </chapter>
<xi:include href="xml/tree_index.sgml"/> <chapter id="object-tree">
</chapter> <title>Object Hierarchy</title>
<index id="api-index-full"> <xi:include href="xml/tree_index.sgml"/>
<title>API Index</title> </chapter>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> <index id="api-index-full">
</index> <title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> </index>
</part>
</book> </book>

View File

@ -1,20 +1,47 @@
<SECTION> <SECTION>
<FILE>eekboard-proxy</FILE> <FILE>eekboard-server</FILE>
EekboardProxy <TITLE>EekboardServer</TITLE>
EekboardProxyClass EekboardServer
eekboard_proxy_new EekboardServerClass
eekboard_proxy_set_keyboard EekboardServerPrivate
eekboard_proxy_set_group eekboard_server_new
eekboard_proxy_show eekboard_server_create_context
eekboard_proxy_hide eekboard_server_push_context
eekboard_proxy_press_key eekboard_server_pop_context
eekboard_proxy_release_key eekboard_server_destroy_context
<SUBSECTION Standard> <SUBSECTION Standard>
EEKBOARD_PROXY EEKBOARD_SERVER
EEKBOARD_IS_PROXY EEKBOARD_IS_SERVER
EEKBOARD_TYPE_PROXY EEKBOARD_TYPE_SERVER
EEKBOARD_PROXY_CLASS eekboard_server_get_type
EEKBOARD_IS_PROXY_CLASS EEKBOARD_SERVER_CLASS
EEKBOARD_PROXY_GET_CLASS EEKBOARD_IS_SERVER_CLASS
EEKBOARD_SERVER_GET_CLASS
</SECTION>
<SECTION>
<FILE>eekboard-context</FILE>
<TITLE>EekboardContext</TITLE>
EekboardContext
EekboardContextClass
EekboardContextPrivate
eekboard_context_new
eekboard_context_set_keyboard
eekboard_context_show_keyboard
eekboard_context_hide_keyboard
eekboard_context_set_group
eekboard_context_press_key
eekboard_context_release_key
eekboard_context_is_keyboard_visible
eekboard_context_set_enabled
eekboard_context_is_enabled
<SUBSECTION Standard>
EEKBOARD_CONTEXT
EEKBOARD_IS_CONTEXT
EEKBOARD_TYPE_CONTEXT
eekboard_context_get_type
EEKBOARD_CONTEXT_CLASS
EEKBOARD_IS_CONTEXT_CLASS
EEKBOARD_CONTEXT_GET_CLASS
</SECTION> </SECTION>

View File

@ -15,6 +15,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/**
* SECTION:eekboard-context
* @short_description: input context maintained by #EekboardServer.
*
* The #EekboardContext class provides a client access to remote input
* context.
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif /* HAVE_CONFIG_H */ #endif /* HAVE_CONFIG_H */
@ -151,6 +160,12 @@ eekboard_context_class_init (EekboardContextClass *klass)
gobject_class->dispose = eekboard_context_dispose; gobject_class->dispose = eekboard_context_dispose;
/**
* EekboardContext::enabled:
* @context: an #EekboardContext
*
* The ::enabled signal is emitted each time @context is enabled.
*/
signals[ENABLED] = signals[ENABLED] =
g_signal_new ("enabled", g_signal_new ("enabled",
G_TYPE_FROM_CLASS(gobject_class), G_TYPE_FROM_CLASS(gobject_class),
@ -162,6 +177,12 @@ eekboard_context_class_init (EekboardContextClass *klass)
G_TYPE_NONE, G_TYPE_NONE,
0); 0);
/**
* EekboardContext::disabled:
* @context: an #EekboardContext
*
* The ::disabled signal is emitted each time @context is disabled.
*/
signals[DISABLED] = signals[DISABLED] =
g_signal_new ("disabled", g_signal_new ("disabled",
G_TYPE_FROM_CLASS(gobject_class), G_TYPE_FROM_CLASS(gobject_class),
@ -173,6 +194,14 @@ eekboard_context_class_init (EekboardContextClass *klass)
G_TYPE_NONE, G_TYPE_NONE,
0); 0);
/**
* EekboardContext::key-pressed:
* @context: an #EekboardContext
* @keycode: keycode
*
* The ::key-pressed signal is emitted each time a key is pressed
* in @context.
*/
signals[KEY_PRESSED] = signals[KEY_PRESSED] =
g_signal_new ("key-pressed", g_signal_new ("key-pressed",
G_TYPE_FROM_CLASS(gobject_class), G_TYPE_FROM_CLASS(gobject_class),
@ -185,6 +214,14 @@ eekboard_context_class_init (EekboardContextClass *klass)
1, 1,
G_TYPE_UINT); G_TYPE_UINT);
/**
* EekboardContext::key-released:
* @context: an #EekboardContext
* @keycode: keycode
*
* The ::key-released signal is emitted each time a key is released
* in @context.
*/
signals[KEY_RELEASED] = signals[KEY_RELEASED] =
g_signal_new ("key-released", g_signal_new ("key-released",
G_TYPE_FROM_CLASS(gobject_class), G_TYPE_FROM_CLASS(gobject_class),
@ -209,6 +246,16 @@ eekboard_context_init (EekboardContext *self)
priv->enabled = FALSE; priv->enabled = FALSE;
} }
/**
* eekboard_context_new:
* @connection: a #GDBusConnection
* @object_path: object path
* @cancellable: a #GCancellable
*
* Create a D-Bus proxy of an input context maintained by
* eekboard-server. This function is seldom called from applications
* since eekboard_server_create_context() calls it implicitly.
*/
EekboardContext * EekboardContext *
eekboard_context_new (GDBusConnection *connection, eekboard_context_new (GDBusConnection *connection,
const gchar *object_path, const gchar *object_path,
@ -250,6 +297,14 @@ context_async_ready_callback (GObject *source_object,
g_variant_unref (result); g_variant_unref (result);
} }
/**
* eekboard_context_set_keyboard:
* @context: an #EekboardContext
* @keyboard: an #EekKeyboard
* @cancellable: a #GCancellable
*
* Set the keyboard description of @context to @keyboard.
*/
void void
eekboard_context_set_keyboard (EekboardContext *context, eekboard_context_set_keyboard (EekboardContext *context,
EekKeyboard *keyboard, EekKeyboard *keyboard,
@ -278,6 +333,14 @@ eekboard_context_set_keyboard (EekboardContext *context,
g_variant_unref (variant); g_variant_unref (variant);
} }
/**
* eekboard_context_set_group:
* @context: an #EekboardContext
* @group: group number
* @cancellable: a #GCancellable
*
* Set the keyboard group of @context.
*/
void void
eekboard_context_set_group (EekboardContext *context, eekboard_context_set_group (EekboardContext *context,
gint group, gint group,
@ -303,6 +366,14 @@ eekboard_context_set_group (EekboardContext *context,
NULL); NULL);
} }
/**
* eekboard_context_show_keyboard:
* @context: an #EekboardContext
* @cancellable: a #GCancellable
*
* Request eekboard-server to show a keyboard set by
* eekboard_context_set_keyboard().
*/
void void
eekboard_context_show_keyboard (EekboardContext *context, eekboard_context_show_keyboard (EekboardContext *context,
GCancellable *cancellable) GCancellable *cancellable)
@ -325,6 +396,13 @@ eekboard_context_show_keyboard (EekboardContext *context,
NULL); NULL);
} }
/**
* eekboard_context_hide_keyboard:
* @context: an #EekboardContext
* @cancellable: a #GCancellable
*
* Request eekboard-server to hide a keyboard.
*/
void void
eekboard_context_hide_keyboard (EekboardContext *context, eekboard_context_hide_keyboard (EekboardContext *context,
GCancellable *cancellable) GCancellable *cancellable)
@ -347,6 +425,14 @@ eekboard_context_hide_keyboard (EekboardContext *context,
NULL); NULL);
} }
/**
* eekboard_context_press_key:
* @context: an #EekboardContext
* @keycode: keycode number
* @cancellable: a #GCancellable
*
* Tell eekboard-server that a key identified by @keycode is pressed.
*/
void void
eekboard_context_press_key (EekboardContext *context, eekboard_context_press_key (EekboardContext *context,
guint keycode, guint keycode,
@ -370,6 +456,14 @@ eekboard_context_press_key (EekboardContext *context,
NULL); NULL);
} }
/**
* eekboard_context_release_key:
* @context: an #EekboardContext
* @keycode: keycode number
* @cancellable: a #GCancellable
*
* Tell eekboard-server that a key identified by @keycode is released.
*/
void void
eekboard_context_release_key (EekboardContext *context, eekboard_context_release_key (EekboardContext *context,
guint keycode, guint keycode,
@ -393,6 +487,12 @@ eekboard_context_release_key (EekboardContext *context,
NULL); NULL);
} }
/**
* eekboard_context_is_keyboard_visible:
* @context: an #EekboardContext
*
* Check if keyboard is visible.
*/
gboolean gboolean
eekboard_context_is_keyboard_visible (EekboardContext *context) eekboard_context_is_keyboard_visible (EekboardContext *context)
{ {
@ -404,6 +504,15 @@ eekboard_context_is_keyboard_visible (EekboardContext *context)
return priv->enabled && priv->keyboard_visible; return priv->enabled && priv->keyboard_visible;
} }
/**
* eekboard_context_set_enabled:
* @context: an #EekboardContext
* @enabled: flag to indicate if @context is enabled
*
* Set @context enabled or disabled. This function is seldom called
* since the flag is set via D-Bus signal #EekboardContext::enabled
* and #EekboardContext::disabled.
*/
void void
eekboard_context_set_enabled (EekboardContext *context, eekboard_context_set_enabled (EekboardContext *context,
gboolean enabled) gboolean enabled)
@ -416,6 +525,12 @@ eekboard_context_set_enabled (EekboardContext *context,
priv->enabled = enabled; priv->enabled = enabled;
} }
/**
* eekboard_context_is_enabled:
* @context: an #EekboardContext
*
* Check if @context is enabled.
*/
gboolean gboolean
eekboard_context_is_enabled (EekboardContext *context) eekboard_context_is_enabled (EekboardContext *context)
{ {

View File

@ -15,6 +15,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/**
* SECTION:eekboard-server
* @short_description: D-Bus proxy of eekboard-server
*
* The #EekboardServer class provides a client side access to eekboard-server.
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif /* HAVE_CONFIG_H */ #endif /* HAVE_CONFIG_H */
@ -68,6 +76,13 @@ eekboard_server_init (EekboardServer *self)
(GDestroyNotify)g_object_unref); (GDestroyNotify)g_object_unref);
} }
/**
* eekboard_server_new:
* @connection: a #GDBusConnection
* @cancellable: a #GCancellable
*
* Create a D-Bus proxy of eekboard-server.
*/
EekboardServer * EekboardServer *
eekboard_server_new (GDBusConnection *connection, eekboard_server_new (GDBusConnection *connection,
GCancellable *cancellable) GCancellable *cancellable)
@ -92,6 +107,14 @@ eekboard_server_new (GDBusConnection *connection,
return NULL; return NULL;
} }
/**
* eekboard_server_create_context:
* @server: an #EekboardServer
* @client_name: name of the client
* @cancellable: a #GCancellable
*
* Create a new input context.
*/
EekboardContext * EekboardContext *
eekboard_server_create_context (EekboardServer *server, eekboard_server_create_context (EekboardServer *server,
const gchar *client_name, const gchar *client_name,
@ -148,6 +171,14 @@ server_async_ready_callback (GObject *source_object,
g_variant_unref (result); g_variant_unref (result);
} }
/**
* eekboard_server_push_context:
* @server: an #EekboardServer
* @context: an #EekboardContext
* @cancellable: a #GCancellable
*
* Enable the input context @context and disable the others.
*/
void void
eekboard_server_push_context (EekboardServer *server, eekboard_server_push_context (EekboardServer *server,
EekboardContext *context, EekboardContext *context,
@ -177,6 +208,13 @@ eekboard_server_push_context (EekboardServer *server,
NULL); NULL);
} }
/**
* eekboard_server_pop_context:
* @server: an #EekboardServer
* @cancellable: a #GCancellable
*
* Disable the current input context and enable the previous one.
*/
void void
eekboard_server_pop_context (EekboardServer *server, eekboard_server_pop_context (EekboardServer *server,
GCancellable *cancellable) GCancellable *cancellable)
@ -193,6 +231,14 @@ eekboard_server_pop_context (EekboardServer *server,
NULL); NULL);
} }
/**
* eekboard_server_destroy_context:
* @server: an #EekboardServer
* @context: an #EekboardContext
* @cancellable: a #GCancellable
*
* Remove @context from @server.
*/
void void
eekboard_server_destroy_context (EekboardServer *server, eekboard_server_destroy_context (EekboardServer *server,
EekboardContext *context, EekboardContext *context,