Beispiel #1
0
static void scrollbarEflEdjeMessage(void* data, Evas_Object*, Edje_Message_Type messageType, int id, void* message)
{
    if (!id) {
        EINA_LOG_ERR("Unknown message id '%d' from scroll bar theme.", id);
        return;
    }

    if (messageType != EDJE_MESSAGE_FLOAT) {
        EINA_LOG_ERR("Message id '%d' of incorrect type from scroll bar theme. "
                     "Expected '%d', got '%d'.",
                     id, EDJE_MESSAGE_FLOAT, messageType);
        return;
    }

    ScrollbarEfl* that = static_cast<ScrollbarEfl*>(data);

    Edje_Message_Float* messageFloat = static_cast<Edje_Message_Float*>(message);
    int value = messageFloat->val * (that->totalSize() - that->visibleSize());
    that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), value);
}
Beispiel #2
0
static void scrollbarEflEdjeMessage(void* data, Evas_Object* o, Edje_Message_Type type, int id, void* msg)
{
    ScrollbarEfl* that = static_cast<ScrollbarEfl*>(data);
    Edje_Message_Float* m;
    int v;

    if (!id) {
        EINA_LOG_ERR("Unknown message id '%d' from scroll bar theme.", id);
        return;
    }

    if (type != EDJE_MESSAGE_FLOAT) {
        EINA_LOG_ERR("Message id '%d' of incorrect type from scroll bar theme. "
                     "Expected '%d', got '%d'.",
                     id, EDJE_MESSAGE_FLOAT, type);
        return;
    }

    m = static_cast<Edje_Message_Float*>(msg);
    v = m->val * (that->totalSize() - that->visibleSize());
    that->setValue(v);
}