Пример #1
0
IBusProperty *
ibus_property_new (const gchar   *key,
                   IBusPropType   type,
                   IBusText      *label,
                   const gchar   *icon,
                   IBusText      *tooltip,
                   gboolean       sensitive,
                   gboolean       visible,
                   IBusPropState  state,
                   IBusPropList  *prop_list)
{
    g_return_val_if_fail (key != NULL, NULL);
    g_return_val_if_fail (type >= PROP_TYPE_NORMAL &&
                          type <= PROP_TYPE_SEPARATOR,
                          NULL);

    IBusProperty *prop;

    prop = (IBusProperty *)g_object_new (IBUS_TYPE_PROPERTY, NULL);

    prop->key = g_strdup (key);
    prop->type = type;
    
    ibus_property_set_label (prop, label);
    ibus_property_set_icon (prop, icon);
    ibus_property_set_tooltip (prop, tooltip);
    ibus_property_set_sensitive (prop, sensitive);
    ibus_property_set_visible (prop, visible);
    ibus_property_set_state (prop, state);
    ibus_property_set_sub_props (prop, prop_list);

    return prop;
}
Пример #2
0
void
SetupLauncher::init()
{
    ibus_property_set_label (*this, m_info.label);
    ibus_property_set_icon (*this, m_info.icon.c_str());
    ibus_property_set_tooltip (*this, m_info.tooltip);
    ibus_property_set_visible (*this, TRUE);
}
Пример #3
0
void
SunPinyinProperty::init(bool state)
{
    m_state = state;
    int which = m_state ? 1 : 0;
    PropertyInfo& info = m_info[which];
    ibus_property_set_label(*this, info.label);
    ibus_property_set_icon(*this, info.icon.c_str());
    ibus_property_set_tooltip(*this, info.tooltip);
    ibus_property_set_visible(*this, TRUE);
    ibus_property_set_state(*this, state ? PROP_STATE_CHECKED : PROP_STATE_UNCHECKED);
}