*/
/**
* SECTION: ibusinternal
- * @short_description: IBus housekeeping functions.
+ * @short_description: IBus DBus setting functions for internal use.
* @stability: Stable
+ * @see_also: #IBusMainLoop
*
* This section contain several IBus house keeping functions.
*/
#define I_(string) g_intern_static_string (string)
+/**
+ * dbus_server_setup:
+ * @server: the server
+ * @context: the #GMainContext or #NULL for default
+ *
+ * Sets the watch and timeout functions of a #DBusServer
+ * to integrate the server with the GLib main loop.
+ * In most cases the context argument should be #NULL.
+ *
+ * If called twice for the same context, does nothing the second
+ * time. If called once with context A and once with context B,
+ * context B replaces context A as the context monitoring the
+ * connection.
+ */
void dbus_server_setup (DBusServer *server,
GMainContext *context);
+
+/**
+ * dbus_connection_setup:
+ * @connection: the connection
+ * @context: the #GMainContext or #NULL for default context
+ *
+ * Sets the watch and timeout functions of a #DBusConnection
+ * to integrate the connection with the GLib main loop.
+ * Pass in #NULL for the #GMainContext unless you're
+ * doing something specialized.
+ *
+ * If called twice for the same context, does nothing the second
+ * time. If called once with context A and once with context B,
+ * context B replaces context A as the context monitoring the
+ * connection.
+ */
void dbus_connection_setup (DBusConnection *connection,
GMainContext *context);
* @keymap: Keymap table. IME developers normally don have to touch this.
*
* A keymap object in IBus.
- *
*/
struct _IBusKeymap {
IBusObject parent;
* @keymap: An IBusKeymap.
* @keycode: A scancode to be converted.
* @state: Modifier flags(such as Ctrl, Shift).
- * @return Corresponding keysym.
+ * @returns: Corresponding keysym.
*
* Convert the scancode to keysym, given the keymap.
*/
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION: ibuskeysyms
+ * @short_description: Key symbol definition.
+ * @stability: Stable
+ * @see_also: #IBusKeymap, #IBusHotkeyProfile
+ *
+ * This section defines the key symbols (keysym) used in IBus.
+ * Those keysym data is converted from keysymdef.h in
+ * FreeDesktop.
+ *
+ * Most of the key symbols are not explicit documented,
+ * because they are self-explaining.
+ */
#ifndef __IBUS_KEYSYMS_H__
#define __IBUS_KEYSYMS_H__
#define IBUS_Sys_Req 0xff15
#define IBUS_Escape 0xff1b
#define IBUS_Delete 0xffff
+
+
+/**
+ * IBUS_Multi_key:
+ *
+ * Key for composing characters.
+ * A.k.a. Compose Key.
+ */
#define IBUS_Multi_key 0xff20
+
+/**
+ * IBUS_Codeinput:
+ *
+ * International and multi-key character composition.
+ */
#define IBUS_Codeinput 0xff37
#define IBUS_SingleCandidate 0xff3c
#define IBUS_MultipleCandidate 0xff3d
#define IBUS_PreviousCandidate 0xff3e
+
+/**
+ * IBUS_Kanji:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Kanji 0xff21
+
+/**
+ * IBUS_Muhenkan:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Muhenkan 0xff22
+
+/**
+ * IBUS_Henkan_Mode:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Henkan_Mode 0xff23
+
+/**
+ * IBUS_Henkan:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Henkan 0xff23
+
+/**
+ * IBUS_Romaji:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Romaji 0xff24
+
+/**
+ * IBUS_Hiragana:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Hiragana 0xff25
+
+/**
+ * IBUS_Katakana:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Katakana 0xff26
+
+/**
+ * IBUS_Hiragana_Katakana:
+ *
+ * Japanese keyboard support.
+ */
#define IBUS_Hiragana_Katakana 0xff27
#define IBUS_Zenkaku 0xff28
#define IBUS_Hankaku 0xff29
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION: ibusmainloop
+ * @short_description: DBus server and connection setup functions.
+ * @stability: Stable
+ *
+ * This section defines the DBus server and connection setup functions,
+ * and prototypes of their callback functions.
+ */
+
#ifndef __IBUS_MAINLOOP_H_
#define __IBUS_MAINLOOP_H_
#include <glib.h>
#include <dbus/dbus.h>
+/**
+ * DBusConnectionSetupFunc:
+ * @connection: A DBusConnection
+ * @user_data: User data to be passed to callback function.
+ *
+ * A prototype of callback to DBus connection setup function.
+ */
typedef void (* DBusConnectionSetupFunc) (DBusConnection *connection,
gpointer user_data);
+
+/**
+ * DBusServerSetupFunc:
+ * @server: A DBusConnection
+ * @user_data: User data to be passed to callback function.
+ *
+ * A prototype of DBus server setup function.
+ */
typedef void (* DBusServerSetupFunc) (DBusServer *server,
gpointer user_data);
+/**
+ * ibus_mainloop_setup:
+ * @connection_func: A DBus connection setup function.
+ * @server_func: A prototype of DBus server setup function.
+ * @user_data: User data to be passed to callback function.
+ *
+ * Sets the watch and timeout functions of a #DBusConnection
+ * and #DBusServer to integrate the connection with the GLib main loop.
+ *
+ * Parameter @user_data should be in type #GMainContext.
+ * It will be passed to both callback functions,
+ * however, normally %NULL is sufficient.
+ *
+ * If called twice for the same user_data, does nothing the second
+ * time. If called once with user_data A and once with user_data B,
+ * user_data B replaces user_data A as the context monitoring the
+ * connection.
+ *
+ * @see_also: ibus_dbus_connection_setup(), ibus_dbus_server_setup().
+ */
void ibus_mainloop_setup (DBusConnectionSetupFunc connection_func,
DBusServerSetupFunc server_func,
gpointer user_data);
+
+/**
+ * ibus_dbus_server_setup:
+ * @server: A DBusServer.
+ *
+ * Sets the watch and timeout functions of a #DBusServer
+ * to integrate the server with the GLib main loop.
+ *
+ * This function uses the parameter @user_data and
+ * server_func set with ibus_mainloop_setup(),
+ * or fall back to NULL and dbus_server_setup() if those are not defined.
+ *
+ * @see_also: ibus_mainloop_setup(), dbus_server_setup().
+ */
void ibus_dbus_server_setup (DBusServer *server);
+
+/**
+ * dbus_connection_setup:
+ * @connection: A DBusConnection.
+ *
+ * Sets the watch and timeout functions of a #DBusConnection
+ * to integrate the connection with the GLib main loop.
+ *
+ * This function uses the parameter @user_data and
+ * connection_func set with ibus_mainloop_setup(),
+ * or fall back to NULL and dbus_connection_setup() if those are not defined.
+ *
+ * @see_also: ibus_mainloop_setup(), dbus_connection_setup().
+ */
void ibus_dbus_connection_setup (DBusConnection *connection);
#endif
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION: ibusmessage
+ * @short_description: A DBusMessage in IBus.
+ * @stability: Stable
+ *
+ * An IBusMessage is essentially a DBusMessage, which representing a message received from or to
+ * be sent to another application.
+ *
+ * Besides DBusMessage functions, An IBusMessage can be manipulated
+ * with its own specific functions, which are defined in this section.
+ */
#ifndef __IBUS_MESSAGE_H_
#define __IBUS_MESSAGE_H_
G_BEGIN_DECLS
+/**
+ * IBusMessage:
+ *
+ * An opaque data structure that represents IBusMessage.
+ */
typedef DBusMessage IBusMessage;
+
+/**
+ * IBusMessageIter:
+ *
+ * An opaque data structure that represents IBusMessageIter.
+ */
typedef DBusMessageIter IBusMessageIter;
GType ibus_type_get_object_path (void);
GType ibus_type_get_dict_entry (void);
GType ibus_type_get_variant (void);
+/**
+ * ibus_message_new:
+ * @message_type: Type of the message.
+ * @returns: A newly allocated IBusMessage according to @message_type.
+ *
+ * New an IBusMessage.
+ * Valid D-Bus message types include:
+ * <itemizedlist>
+ * <listitem>
+ * <para>#DBUS_MESSAGE_TYPE_METHOD_CALL</para>
+ * </listitem>
+ * <listitem>
+ * <para>#DBUS_MESSAGE_TYPE_METHOD_RETURN</para>
+ * </listitem>
+ * <listitem>
+ * <para>#DBUS_MESSAGE_TYPE_METHOD_ERROR</para>
+ * </listitem>
+ * <listitem>
+ * <para>#DBUS_MESSAGE_TYPE_METHOD_SIGNAL</para>
+ * </listitem>
+ * </itemizedlist>
+ * These are defined in dbus-protocol.h in D-Bus.
+ */
IBusMessage *ibus_message_new (gint message_type);
+
+/**
+ * ibus_message_ref:
+ * @message An IBusMessage
+ *
+ * ncrements the reference count of an IBusMessage.
+ */
IBusMessage *ibus_message_ref (IBusMessage *message);
void ibus_message_unref (IBusMessage *message);
IBusMessage *ibus_message_new_method_call (const gchar *destination,