Exemplo n.º 1
0
void
FrontEndHotkeyMatcher::add_hotkeys (const KeyEventList &keys, FrontEndHotkeyAction action)
{
    if (!keys.size () || action < SCIM_FRONTEND_HOTKEY_TRIGGER || action > SCIM_FRONTEND_HOTKEY_SHOW_FACTORY_MENU) return;

    m_impl->m_matcher.add_hotkeys (keys, (int) action);
}
Exemplo n.º 2
0
size_t
HotkeyMatcher::find_hotkeys     (int id, KeyEventList &keys) const
{
    keys.clear ();

    for (HotkeyRepository::iterator it = m_impl->m_hotkeys.begin (); it != m_impl->m_hotkeys.end (); ++it) {
        if (it->second == id) keys.push_back (it->first);
    }

    return keys.size ();
}
Exemplo n.º 3
0
size_t
HotkeyMatcher::get_all_hotkeys (KeyEventList &keys, std::vector <int> &ids) const
{
    keys.clear ();
    ids.clear ();

    for (HotkeyRepository::iterator it = m_impl->m_hotkeys.begin (); it != m_impl->m_hotkeys.end (); ++it) {
        keys.push_back (it->first);
        ids.push_back (it->second);
    }

    return keys.size ();
}
Exemplo n.º 4
0
size_t
IMEngineHotkeyMatcher::get_all_hotkeys (KeyEventList &keys, std::vector <String> &uuids) const
{
    keys.clear ();
    uuids.clear ();
    std::vector <int> ids;

    if (m_impl->m_matcher.get_all_hotkeys (keys, ids) > 0) {
        for (size_t i = 0; i < ids.size (); ++i)
            uuids.push_back (m_impl->m_uuids [ids [i]]);
    }

    return keys.size ();
}
Exemplo n.º 5
0
size_t
FrontEndHotkeyMatcher::get_all_hotkeys (KeyEventList &keys, std::vector <FrontEndHotkeyAction> &actions) const
{
    keys.clear ();
    actions.clear ();

    std::vector <int> ids;

    m_impl->m_matcher.get_all_hotkeys (keys, ids);

    for (size_t i = 0; i < ids.size (); ++i)
        actions.push_back (static_cast<FrontEndHotkeyAction> (ids [i]));

    return keys.size ();
}
Exemplo n.º 6
0
void
IMEngineHotkeyMatcher::add_hotkeys (const KeyEventList &keys, const String &uuid)
{
    if (!keys.size () || !uuid.length ()) return;

    size_t i;

    for (i = 0; i < m_impl->m_uuids.size (); ++i) {
        if (m_impl->m_uuids [i] == uuid)
            break;
    }

    if (i == m_impl->m_uuids.size ())
        m_impl->m_uuids.push_back (uuid);

    m_impl->m_matcher.add_hotkeys (keys, i);
}