"IBUS_IFACE_ENGINE_FACTORY",
"IBUS_IFACE_INPUT_CONTEXT",
"IBUS_IFACE_NOTIFICATIONS",
+ "ORIENTATION_HORIZONTAL",
+ "ORIENTATION_VERTICAL",
+ "ORIENTATION_SYSTEM",
"default_reply_handler",
"default_error_handler",
"DEFAULT_ASYNC_HANDLERS",
IBUS_IFACE_INPUT_CONTEXT = "org.freedesktop.IBus.InputContext"
IBUS_IFACE_NOTIFICATIONS = "org.freedesktop.IBus.Notifications"
+# define orientation
+ORIENTATION_HORIZONTAL = 0
+ORIENTATION_VERTICAL = 1
+ORIENTATION_SYSTEM = 2
+
def default_reply_handler( *args):
pass
class LookupTable(Serializable):
__gtype_name__ = "PYIBusLookupTable"
__NAME__ = "IBusLookupTable"
- def __init__(self, page_size=5, cursor_pos=0, coursor_visible=True, round=False, candidates=None, labels=None):
+ def __init__(self, page_size=5, cursor_pos=0, coursor_visible=True, round=False, orientation=2, candidates=None, labels=None):
super(LookupTable, self).__init__()
self.__cursor_pos = cursor_pos
self.__cursor_visible = True
self.__round = round
+ self.__orientation = orientation
if candidates == None:
self.__candidates = list()
else:
def get_labels(self):
return self.__labels
- def show_cursor(self, show = True):
+ def show_cursor(self, show=True):
self.__cursor_visible = show
def is_cursor_visible(self):
return False
self.__cursor_pos = pos
return True
+ def set_orientation(self, orientation):
+ self.__orientation = orientation
+ def get_orientation(self):
+ return self.__orientation
def page_up(self):
if self.__cursor_pos < self.__page_size:
struct.append(dbus.UInt32(self.__cursor_pos))
struct.append(dbus.Boolean(self.__cursor_visible))
struct.append(dbus.Boolean(self.__round))
+ struct.append(dbus.Int32(self.__orientation))
candidates = map(lambda c: serialize_object(c), self.__candidates)
struct.append(dbus.Array(candidates, signature="v"))
labels = map(lambda c: serialize_object(c), self.__labels)
self.__cursor_pos % self.__page_size,
self.__cursor_visible,
self.__round,
+ self.__orientation,
candidates,
self.__labels)
self.__cursor_pos = struct.pop(0)
self.__cursor_visible = struct.pop(0)
self.__round = struct.pop(0)
+ self.__orientation = struct.pop(0)
self.__candidates = map(deserialize_object, struct.pop(0))
self.__labels = map(deserialize_object, struct.pop(0))
serializable_class->deserialize = (IBusSerializableDeserializeFunc) ibus_lookup_table_deserialize;
serializable_class->copy = (IBusSerializableCopyFunc) ibus_lookup_table_copy;
- g_string_append (serializable_class->signature, "uubbavav");
+ g_string_append (serializable_class->signature, "uubbiavav");
}
static void
retval = ibus_message_iter_append (iter, G_TYPE_BOOLEAN, &table->round);
g_return_val_if_fail (retval, FALSE);
+ retval = ibus_message_iter_append (iter, G_TYPE_INT, &table->orientation);
+ g_return_val_if_fail (retval, FALSE);
+
// append candidates
retval = ibus_message_iter_open_container (iter,
IBUS_TYPE_ARRAY,
g_return_val_if_fail (retval, FALSE);
ibus_message_iter_next (iter);
+ retval = ibus_message_iter_get (iter, G_TYPE_INT, &table->orientation);
+ g_return_val_if_fail (retval, FALSE);
+ ibus_message_iter_next (iter);
+
// deserialize candidates
retval = ibus_message_iter_recurse (iter, IBUS_TYPE_ARRAY, &array_iter);
g_return_val_if_fail (retval, FALSE);
table->cursor_pos = cursor_pos;
table->cursor_visible = cursor_visible;
table->round = round;
+ table->orientation = IBUS_ORIENTATION_SYSTEM;
return table;
}
* @cursor_pos: position index of cursor.
* @cursor_visible: whether the cursor is visible.
* @round: TRUE for lookup table wrap around.
+ * @orientation: orientation of the table.
* @candidates: Candidate words/phrases.
* @labels: Candidate labels which identify individual candidates in the same page. Default is 1, 2, 3, 4 ...
*
guint cursor_pos;
gboolean cursor_visible;
gboolean round;
+ gint orientation;
GArray *candidates;
GArray *labels;
} IBusCapabilite;
/**
+ * IBusOrientation:
+ * @IBUS_ORIENTATION_HORIZONTAL: Horizontal orientation.
+ * @IBUS_ORIENTATION_VERTICAL: Vertival orientation.
+ * @IBUS_ORIENTATION_SYSTEM: Use ibus global orientation setup.
+ *
+ * Orientation of UI.
+ */
+typedef enum {
+ IBUS_ORIENTATION_HORIZONTAL = 0,
+ IBUS_ORIENTATION_VERTICAL = 1,
+ IBUS_ORIENTATION_SYSTEM = 2,
+} IBusOrientation;
+
+/**
* IBusRectangle:
* @x: x coordinate.
* @y: y coordinate.