- gint x,
- gint y,
- gint w,
- gint h);
-static void ibus_engine_set_capabilities
- (IBusEngine *engine,
- guint caps);
-static void ibus_engine_page_up (IBusEngine *engine);
-static void ibus_engine_page_down (IBusEngine *engine);
-static void ibus_engine_cursor_up (IBusEngine *engine);
-static void ibus_engine_cursor_down (IBusEngine *engine);
-static void ibus_engine_property_activate
- (IBusEngine *engine,
- const gchar *prop_name,
- guint prop_state);
-static void ibus_engine_property_show (IBusEngine *engine,
- const gchar *prop_name);
-static void ibus_engine_property_hide (IBusEngine *engine,
- const gchar *prop_name);
-
-
-static IBusServiceClass *parent_class = NULL;
-
-GType
-ibus_engine_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusEngineClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_engine_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusEngine),
- 0,
- (GInstanceInitFunc) ibus_engine_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERVICE,
- "IBusEngine",
- &type_info,
- (GTypeFlags) 0);
- }
- return type;
-}
-
-IBusEngine *
-ibus_engine_new (const gchar *name,
- const gchar *path,
- IBusConnection *connection)
-{
- g_assert (path);
- g_assert (IBUS_IS_CONNECTION (connection));
-
- IBusEngine *engine;
-
- engine = (IBusEngine *) g_object_new (IBUS_TYPE_ENGINE,
- "name", name,
- "path", path,
- "connection", connection,
- NULL);
-
- return engine;
-}
+ IBusText *text,
+ guint cursor_pos,
+ guint anchor_pos);
+static void ibus_engine_process_hand_writing_event
+ (IBusEngine *engine,
+ const gdouble *coordinates,
+ guint coordinates_len);
+static void ibus_engine_cancel_hand_writing
+ (IBusEngine *engine,
+ guint n_strokes);
+static void ibus_engine_emit_signal (IBusEngine *engine,
+ const gchar *signal_name,
+ GVariant *parameters);
+
+
+G_DEFINE_TYPE (IBusEngine, ibus_engine, IBUS_TYPE_SERVICE)
+
+static const gchar introspection_xml[] =
+ "<node>"
+ " <interface name='org.freedesktop.IBus.Engine'>"
+ /* FIXME methods */
+ " <method name='ProcessKeyEvent'>"
+ " <arg direction='in' type='u' name='keyval' />"
+ " <arg direction='in' type='u' name='keycode' />"
+ " <arg direction='in' type='u' name='state' />"
+ " <arg direction='out' type='b' />"
+ " </method>"
+ " <method name='SetCursorLocation'>"
+ " <arg direction='in' type='i' name='x' />"
+ " <arg direction='in' type='i' name='y' />"
+ " <arg direction='in' type='i' name='w' />"
+ " <arg direction='in' type='i' name='h' />"
+ " </method>"
+ " <method name='ProcessHandWritingEvent'>"
+ " <arg direction='in' type='ad' name='coordinates' />"
+ " </method>"
+ " <method name='CancelHandWriting'>"
+ " <arg direction='in' type='u' name='n_strokes' />"
+ " </method>"
+ " <method name='SetCapabilities'>"
+ " <arg direction='in' type='u' name='caps' />"
+ " </method>"
+ " <method name='PropertyActivate'>"
+ " <arg direction='in' type='s' name='name' />"
+ " <arg direction='in' type='u' name='state' />"
+ " </method>"
+ " <method name='PropertyShow'>"
+ " <arg direction='in' type='s' name='name' />"
+ " </method>"
+ " <method name='PropertyHide'>"
+ " <arg direction='in' type='s' name='name' />"
+ " </method>"
+ " <method name='CandidateClicked'>"
+ " <arg direction='in' type='u' name='index' />"
+ " <arg direction='in' type='u' name='button' />"
+ " <arg direction='in' type='u' name='state' />"
+ " </method>"
+ " <method name='FocusIn' />"
+ " <method name='FocusOut' />"
+ " <method name='Reset' />"
+ " <method name='Enable' />"
+ " <method name='Disable' />"
+ " <method name='PageUp' />"
+ " <method name='PageDown' />"
+ " <method name='CursorUp' />"
+ " <method name='CursorDown' />"
+ " <method name='SetSurroundingText'>"
+ " <arg direction='in' type='v' name='text' />"
+ " <arg direction='in' type='u' name='cursor_pos' />"
+ " <arg direction='in' type='u' name='anchor_pos' />"
+ " </method>"
+ /* FIXME signals */
+ " <signal name='CommitText'>"
+ " <arg type='v' name='text' />"
+ " </signal>"
+ " <signal name='UpdatePreeditText'>"
+ " <arg type='v' name='text' />"
+ " <arg type='u' name='cursor_pos' />"
+ " <arg type='b' name='visible' />"
+ " <arg type='u' name='mode' />"
+ " </signal>"
+ " <signal name='UpdateAuxiliaryText'>"
+ " <arg type='v' name='text' />"
+ " <arg type='b' name='visible' />"
+ " </signal>"
+ " <signal name='UpdateLookupTable'>"
+ " <arg type='v' name='table' />"
+ " <arg type='b' name='visible' />"
+ " </signal>"
+ " <signal name='RegisterProperties'>"
+ " <arg type='v' name='props' />"
+ " </signal>"
+ " <signal name='UpdateProperty'>"
+ " <arg type='v' name='prop' />"
+ " </signal>"
+ " <signal name='ForwardKeyEvent'>"
+ " <arg type='u' name='keyval' />"
+ " <arg type='u' name='keycode' />"
+ " <arg type='u' name='state' />"
+ " </signal>"
+ " </interface>"
+ "</node>";