summaryrefslogtreecommitdiff
path: root/ibus
diff options
context:
space:
mode:
authorTakao Fujiwara <takao.fujiwara1@gmail.com>2011-04-08 09:18:23 -0400
committerPeng Huang <shawn.p.huang@gmail.com>2011-04-08 09:18:23 -0400
commit37e6e58792bef4284653e4d8f4c93c901780eafd (patch)
tree5cbcfe6451e8ec5992e5b7ee2cb7411cb7500640 /ibus
parentac30990eddbe9e4a0f9b08cc86155654d8fb3c3d (diff)
downloadibus-37e6e58792bef4284653e4d8f4c93c901780eafd.tar.gz
Implement APIs for another non-Python panel.
1. Support icon and prop_list = null in ibus_property_new with GIR. 2. Add getter methods in IBusText and IBusProperty since GJS cannot access the members in C-Structure. 3. Add ibus_get_language_name() since GIR libxml2 does not provide the useful APIs. 4. Implement flags in ibus_bus_request_name() to follow DBus RequestName signal spec. http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-names This is needed to terminate the current IBus panel. E.g. IBus GTK panel is launched by ibus-daemon but another panel is launched by gnome-shell. 5. Support IBUS_BUS_NAME_FLAG_ALLOW_REPLACEMENT in ui/gtk/main.py 6. Fix bus_component_set_factory() not to call bus_component_factory_destroy_cb() twice. 7. Hide ibus_text_new_from_static_string() for GIR. 8. Add ibus_is_running_gnome_shell() for ibus-ui-gtk because gnome-shell runs earlier than ibus-ui-gtk. Review URL: http://codereview.appspot.com/4279042 Patch from Takao Fujiwara <takao.fujiwara1@gmail.com>.
Diffstat (limited to 'ibus')
-rw-r--r--ibus/bus.py3
-rw-r--r--ibus/common.py24
2 files changed, 26 insertions, 1 deletions
diff --git a/ibus/bus.py b/ibus/bus.py
index b9151905..5738fade 100644
--- a/ibus/bus.py
+++ b/ibus/bus.py
@@ -108,6 +108,9 @@ class Bus(object.Object):
def release_name(self, name):
return self.__dbus.ReleaseName(name)
+ def list_queued_owners(self, name):
+ return self.__dbus.ListQueuedOwners(name)
+
def get_name_owner(self, name):
return self.__dbus.GetNameOwner(name)
diff --git a/ibus/common.py b/ibus/common.py
index e105f180..38717d17 100644
--- a/ibus/common.py
+++ b/ibus/common.py
@@ -33,6 +33,13 @@ __all__ = (
"ORIENTATION_HORIZONTAL",
"ORIENTATION_VERTICAL",
"ORIENTATION_SYSTEM",
+ "BUS_NAME_FLAG_ALLOW_REPLACEMENT",
+ "BUS_NAME_FLAG_REPLACE_EXISTING",
+ "BUS_NAME_FLAG_DO_NOT_QUEUE",
+ "BUS_REQUEST_NAME_REPLY_PRIMARY_OWNER",
+ "BUS_REQUEST_NAME_REPLY_IN_QUEUE",
+ "BUS_REQUEST_NAME_REPLY_EXISTS",
+ "BUS_REQUEST_NAME_REPLY_ALREADY_OWNER",
"default_reply_handler",
"default_error_handler",
"DEFAULT_ASYNC_HANDLERS",
@@ -45,7 +52,8 @@ __all__ = (
"main_quit",
"main_iteration",
"get_address",
- "get_socket_path"
+ "get_socket_path",
+ "is_running_gnome_shell",
)
import os
@@ -104,6 +112,9 @@ get_address.restype=ctypes.c_char_p
get_socket_path = libibus.ibus_get_socket_path
get_socket_path.restype=ctypes.c_char_p
+is_running_gnome_shell = libibus.ibus_is_running_gnome_shell
+is_running_gnome_shell.restype = ctypes.c_bool
+
# __session_id = os.getenv ("IBUS_SESSION_ID")
#
# IBUS_ADDR = "unix:path=/tmp/ibus-%s%s/ibus-%s-%s" % (__username,
@@ -132,6 +143,17 @@ ORIENTATION_HORIZONTAL = 0
ORIENTATION_VERTICAL = 1
ORIENTATION_SYSTEM = 2
+# define bus name flag
+BUS_NAME_FLAG_ALLOW_REPLACEMENT = (1 << 0)
+BUS_NAME_FLAG_REPLACE_EXISTING = (1 << 1)
+BUS_NAME_FLAG_DO_NOT_QUEUE = (1 << 2)
+
+# define bus request name reply
+BUS_REQUEST_NAME_REPLY_PRIMARY_OWNER = 1
+BUS_REQUEST_NAME_REPLY_IN_QUEUE = 2
+BUS_REQUEST_NAME_REPLY_EXISTS = 3
+BUS_REQUEST_NAME_REPLY_ALREADY_OWNER = 4
+
def default_reply_handler( *args):
pass