Back to index

nux  3.0.0
Public Member Functions | Static Public Member Functions
MockIBusIMEContext Class Reference
Inheritance diagram for MockIBusIMEContext:
Inheritance graph
Collaboration diagram for MockIBusIMEContext:
Collaboration graph

List of all members.

Public Member Functions

virtual void Focus ()
virtual void Blur ()
virtual void Reset ()
virtual bool FilterKeyEvent (const KeyEvent &event)
virtual void SetSurrounding (const std::wstring &text, int cursor_pos)
bool IsConnected () const
bool IsHotkeyEvent (EventType type, unsigned long keysym, unsigned long modifiers) const

Static Public Member Functions

static std::vector< EventParseIBusHotkeys (const gchar **keybindings)

Detailed Description

Definition at line 29 of file gtest-nux-inputmethodibus.cpp.

Member Function Documentation

void nux::IBusIMEContext::Blur ( ) [virtual, inherited]

Definition at line 80 of file InputMethodIBus.cpp.

    if (!is_focused_)

    is_focused_ = false;

    if (context_)
bool nux::IBusIMEContext::FilterKeyEvent ( const KeyEvent event) [virtual, inherited]

Definition at line 97 of file InputMethodIBus.cpp.

    guint keyval = event.key_sym(); // todo(jaytaoko): ui::GdkKeyCodeForWindowsKeyCode(event.key_code(), event.IsShiftDown() ^ event.IsCapsLockDown());

    if (context_) {
      guint modifiers = 0;

      if (event.flags() & IBUS_IGNORED_MASK)
        return false;

      if (event.type() == EVENT_KEY_UP)
        modifiers |= IBUS_RELEASE_MASK;

      if (event.IsShiftDown())
        modifiers |= IBUS_SHIFT_MASK;
      if (event.IsControlDown())
        modifiers |= IBUS_CONTROL_MASK;
      if (event.IsAltDown())
        modifiers |= IBUS_MOD1_MASK;
      if (event.IsCapsLockDown())
        modifiers |= IBUS_LOCK_MASK;

        keyval, event.key_code() - 8, modifiers,
        new ProcessKeyEventData(this, event));

      return true;
    return false;

Here is the call graph for this function:

void nux::IBusIMEContext::Focus ( ) [virtual, inherited]

Definition at line 70 of file InputMethodIBus.cpp.

    if (is_focused_)
    is_focused_ = true;

    if (context_)
bool nux::IBusIMEContext::IsConnected ( ) const [inherited]

Definition at line 192 of file InputMethodIBus.cpp.

    return context_;
bool nux::IBusIMEContext::IsHotkeyEvent ( EventType  type,
unsigned long  keysym,
unsigned long  modifiers 
) const [inherited]

Definition at line 503 of file InputMethodIBus.cpp.

    for (Event const& ev : hotkeys_)
      if (ev.x11_keysym == keysym && (ev.type == type || type == EVENT_KEY_DOWN))
        if (ev.type == EVENT_KEY_UP)
          return (modifiers & ev.key_modifiers);
          return (ev.key_modifiers == modifiers);

    return false;
static std::vector<Event> MockIBusIMEContext::ParseIBusHotkeys ( const gchar **  keybindings) [inline, static]

Reimplemented from nux::IBusIMEContext.

Definition at line 32 of file gtest-nux-inputmethodibus.cpp.

    return IBusIMEContext::ParseIBusHotkeys(keybindings);

Here is the call graph for this function:

void nux::IBusIMEContext::Reset ( ) [virtual, inherited]

Definition at line 91 of file InputMethodIBus.cpp.

    if (context_)
void nux::IBusIMEContext::SetSurrounding ( const std::wstring &  text,
int  cursor_pos 
) [virtual, inherited]

Definition at line 131 of file InputMethodIBus.cpp.

      // TODO(penghuang) support surrounding

The documentation for this class was generated from the following file: