Ejemplo n.º 1
0
/**
 * @brief Get state set of accessible object
 *
 * @param obj object instance
 *
 * @returns referred AtkStateSet object
 */
static AtkStateSet *
eail_naviframe_page_ref_state_set(AtkObject *obj)
{
   EailNaviframePage *page;
   AtkStateSet *state_set;
   Evas_Object *widget;

   g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), NULL);

   page = EAIL_NAVIFRAME_PAGE(obj);
   if (!page->naviframe) return NULL;

   widget = elm_object_part_content_get(page->naviframe, "default");

   state_set = atk_state_set_new();

   /* only item-page on top is visible*/
   if (elm_naviframe_top_item_get(page->naviframe) == page->page)
     {
        atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
        atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
     }

   if (!elm_object_disabled_get(widget))
     atk_state_set_add_state(state_set, ATK_STATE_ENABLED);

   return state_set;
}
Ejemplo n.º 2
0
static void
win_back_key_cb(void *data, Evas_Object *obj, void *event_info)
{
    interface *intf = data;
    /* Hide the sidebar first */
    Evas_Object *sidebar = sidebar_get_widget(intf->sidebar);
    if (!elm_object_disabled_get(sidebar) && !elm_panel_hidden_get(sidebar)) {
        elm_panel_hidden_set(sidebar, EINA_TRUE);
    }
    /* Hide the audio_player then */
    else if (audio_player_handle_back_key(intf->p_mini_player) == true) { //FIXME
        return;
    }
    /* Finally pop out the stack */
    else {
        /* Get the top of the NaviFrame Stack */
        Elm_Object_Item *it = elm_naviframe_top_item_get(intf->nf_content);
        interface_view *view = (interface_view *)elm_object_item_data_get(it);
        if (view) {
            if (view->pf_event != NULL &&
                view->pf_event(view->p_view_sys, INTERFACE_VIEW_EVENT_BACK) == true) {
                /* View has accepted the event */
                return;
            }
        }
        intf_pop_view(intf);
    }
}
Ejemplo n.º 3
0
static void
left_panel_button_clicked_cb(void *data, Evas_Object * obj, void *event_info)
{
    interface *intf = data;
    /* Disable the panel when left button is pressed */
    if (!elm_object_disabled_get(sidebar_get_widget(intf->sidebar))) elm_panel_toggle(sidebar_get_widget(intf->sidebar));
}
Ejemplo n.º 4
0
/**
 * @brief 'release' action callback
 *
 * @param action AtkAction instance
 * @param data user data passed to callback
 *
 * @returns TRUE if action was successfull, FALSE otherwise
 */
static gboolean
eail_button_action_release_cb(AtkAction *action, void *data)
{
   Evas_Object *widget;

   widget = eail_widget_get_widget(EAIL_WIDGET(action));
   if (!widget) return FALSE;

   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
     return FALSE;

   evas_object_smart_callback_call(widget, "unpressed", NULL);
   eail_button_atk_notify_release(action, NULL, NULL);

   return TRUE;
}
Ejemplo n.º 5
0
/**
 * @brief Implementation of do action from AtkAction interface
 *
 * @param action EailSlideshow instance
 * @param i action index
 *
 * @returns TRUE on success, FALSE otherwise
 */
static gboolean
eail_slideshow_do_action(AtkAction *action, gint i)
{
   Evas_Object *widget;
   gboolean result;
   double slideshow_timeout;

   g_return_val_if_fail(EAIL_IS_SLIDESHOW(action), FALSE);

   widget = eail_widget_get_widget(EAIL_WIDGET(action));
   if (!widget) return FALSE;

   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
     return FALSE;

   switch (i)
     {
       case 0:
           elm_slideshow_next(widget);
           result = TRUE;
           break;
       case 1:
           elm_slideshow_previous(widget);
           result = TRUE;
           break;
       case 2:
           elm_slideshow_timeout_set(widget, 0.0);
           result = TRUE;
           break;
       case 3:
           slideshow_timeout = elm_slideshow_timeout_get(widget);
           if (_double_cmp(slideshow_timeout, 0.0, 1))
             {
                result = TRUE;
                elm_slideshow_timeout_set(widget, SLIDESHOW_DEFAULT_TIMEOUT);
                break;
             }
           result = FALSE;
           break;
       default:
           result = FALSE;
           break;
     }

   return result;
}
Ejemplo n.º 6
0
/**
 * @brief Shrink action callback
 *
 * @param action an AtkAction
 * @param data user data passed to callback
 *
 * @returns TRUE on action success, FALSE otherwise
 */
static gboolean
eail_multibuttonentry_action_shrink_cb(AtkAction *action, void *data)
{
   Evas_Object *widget;

   widget = eail_widget_get_widget(EAIL_WIDGET(action));
   if (!widget) return FALSE;

   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
     return FALSE;

   if (!elm_multibuttonentry_expanded_get(widget)) return FALSE;

   elm_multibuttonentry_expanded_set(widget, EINA_FALSE);
   atk_object_notify_state_change(ATK_OBJECT(action), ATK_STATE_EXPANDED, FALSE);

   return TRUE;
}
Ejemplo n.º 7
0
/**
 * @brief Action handler for 'click'
 *
 * @param action an AtkAction object (EailCheck)
 * @param data additional data (unused here)
 *
 * @returns TRUE on success, FALSE otherwise
 */
static gboolean
eail_check_action_click_cb(AtkAction *action, void *data)
{
   Evas_Object *widget;
   Eina_Bool state;

   widget = eail_widget_get_widget(EAIL_WIDGET(action));
   if (!widget) return FALSE;

   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
     return FALSE;

   state = elm_check_state_get(widget);
   elm_check_state_set(widget, !state);

   evas_object_smart_callback_call(widget, "changed", NULL);
   eail_check_atk_notify_change(action, widget, NULL);

   return TRUE;
}
Ejemplo n.º 8
0
/**
 * @brief Performs the specified action on the object
 *
 * Implementation of do_action from AtkAction interface.
 *
 * @param action AtkAction instance
 * @param i action index
 *
 * @return TRUE on success, FALSE otherwise
 */
static gboolean
eail_ctxpopup_do_action(AtkAction *action,
                        int i)
{
   Evas_Object *widget;

   widget = eail_widget_get_widget(EAIL_WIDGET(action));
   if (!widget) return FALSE;

   if ((elm_object_disabled_get(widget)) || (!evas_object_visible_get(widget)))
     return FALSE;

   const char *action_name = atk_action_get_name(action, i);
   if (!action_name) return FALSE;

   if (!g_strcmp0(action_name, "dismiss"))
     elm_ctxpopup_dismiss(widget);
   else
     return FALSE;

   return TRUE;
}
Ejemplo n.º 9
0
bool Object::getDisabled ()
{
  return elm_object_disabled_get (o);
}