diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2009-02-23 15:05:50 +0800 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2009-02-23 15:05:50 +0800 |
commit | f86438bf0ee2f83f4744226e4d640503ff985b12 (patch) | |
tree | 7f73098d0132966f223a620fa466c694ca71e068 /bus | |
parent | 4c180f55b8e485aa0ac1bc1af2aa0d1b99886470 (diff) | |
download | ibus-f86438bf0ee2f83f4744226e4d640503ff985b12.tar.gz ibus-f86438bf0ee2f83f4744226e4d640503ff985b12.tar.xz ibus-f86438bf0ee2f83f4744226e4d640503ff985b12.zip |
Add Disable menu item on Input Menu. Use it to disable InputContext.
Diffstat (limited to 'bus')
-rw-r--r-- | bus/inputcontext.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/bus/inputcontext.c b/bus/inputcontext.c index 866c837..6ba7322 100644 --- a/bus/inputcontext.c +++ b/bus/inputcontext.c @@ -799,6 +799,40 @@ _ic_set_capabilities (BusInputContext *context, } static IBusMessage * +_ic_enable (BusInputContext *context, + IBusMessage *message, + BusConnection *connection) +{ + g_assert (BUS_IS_INPUT_CONTEXT (context)); + g_assert (message != NULL); + g_assert (BUS_IS_CONNECTION (connection)); + + IBusMessage *reply; + + bus_input_context_enable (context); + + reply = ibus_message_new_method_return (message); + return reply; +} + +static IBusMessage * +_ic_disable (BusInputContext *context, + IBusMessage *message, + BusConnection *connection) +{ + g_assert (BUS_IS_INPUT_CONTEXT (context)); + g_assert (message != NULL); + g_assert (BUS_IS_CONNECTION (connection)); + + IBusMessage *reply; + + bus_input_context_disable (context); + + reply = ibus_message_new_method_return (message); + return reply; +} + +static IBusMessage * _ic_is_enabled (BusInputContext *context, IBusMessage *message, BusConnection *connection) @@ -945,6 +979,8 @@ bus_input_context_ibus_message (BusInputContext *context, { IBUS_INTERFACE_INPUT_CONTEXT, "FocusOut", _ic_focus_out }, { IBUS_INTERFACE_INPUT_CONTEXT, "Reset", _ic_reset }, { IBUS_INTERFACE_INPUT_CONTEXT, "SetCapabilities", _ic_set_capabilities }, + { IBUS_INTERFACE_INPUT_CONTEXT, "Enable", _ic_enable }, + { IBUS_INTERFACE_INPUT_CONTEXT, "Disable", _ic_disable }, { IBUS_INTERFACE_INPUT_CONTEXT, "IsEnabled", _ic_is_enabled }, { IBUS_INTERFACE_INPUT_CONTEXT, "SetEngine", _ic_set_engine }, { IBUS_INTERFACE_INPUT_CONTEXT, "GetEngine", _ic_get_engine }, |