Beispiel #1
0
EOLIAN static Eo *
_efl_ui_pager_efl_object_constructor(Eo *obj,
                                     Efl_Ui_Pager_Data *pd)
{
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);

   if (!elm_widget_theme_klass_get(obj))
     elm_widget_theme_klass_set(obj, "pager");

   obj = efl_constructor(efl_super(obj, MY_CLASS));

   if (elm_widget_theme_object_set(obj, wd->resize_obj,
                                       elm_widget_theme_klass_get(obj),
                                       elm_widget_theme_element_get(obj),
                                       elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC)
     CRI("Failed to set layout!");

   pd->cnt = 0;
   pd->loop = EFL_UI_PAGER_LOOP_DISABLED;

   pd->curr.page = -1;
   pd->curr.pos = 0.0;

   pd->transition = NULL;
   pd->indicator = NULL;

   pd->fill_width = EINA_TRUE;
   pd->fill_height = EINA_TRUE;

   pd->page_spec.sz.w = -1;
   pd->page_spec.sz.h = -1;

   elm_widget_can_focus_set(obj, EINA_TRUE);

   pd->page_root = efl_add(EFL_CANVAS_GROUP_CLASS, evas_object_evas_get(obj));
   efl_content_set(efl_part(obj, "efl.page_root"), pd->page_root);

   efl_event_callback_add(pd->page_root, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _resize_cb, pd);
   efl_event_callback_add(pd->page_root, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _move_cb, pd);

   pd->page_box = efl_add(EFL_UI_BOX_CLASS, obj);
   efl_ui_widget_internal_set(pd->page_box, EINA_TRUE);
   efl_canvas_group_member_add(pd->page_root, pd->page_box);

   pd->foreclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
                          evas_object_evas_get(obj));
   efl_canvas_group_member_add(pd->page_root, pd->foreclip);
   evas_object_static_clip_set(pd->foreclip, EINA_TRUE);
   efl_canvas_object_clipper_set(pd->page_box, pd->foreclip);

   pd->backclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
                          evas_object_evas_get(obj));
   efl_canvas_group_member_add(pd->page_root, pd->backclip);
   evas_object_static_clip_set(pd->backclip, EINA_TRUE);
   efl_gfx_entity_visible_set(pd->backclip, EINA_FALSE);

   return obj;
}
Beispiel #2
0
static void
_notify_theme_apply(Evas_Object *obj)
{
   const char *style = elm_widget_style_get(obj);
   double ax, ay;

   ELM_NOTIFY_DATA_GET(obj, sd);

   ax = sd->horizontal_align;
   ay = sd->vertical_align;
   if ((elm_widget_mirrored_get(obj)) && (ax != ELM_NOTIFY_ALIGN_FILL)) ax = 1.0 - ax;

   if (ay == 0.0)
     elm_widget_theme_object_set(obj, sd->notify, "notify", "top", style);
   else if (ay == 1.0)
     elm_widget_theme_object_set(obj, sd->notify, "notify", "bottom", style);
   else if (ax == 0.0)
     elm_widget_theme_object_set(obj, sd->notify, "notify", "left", style);
   else if (ax == 1.0)
     elm_widget_theme_object_set(obj, sd->notify, "notify", "right", style);
   else
     elm_widget_theme_object_set(obj, sd->notify, "notify", "center", style);
}
Beispiel #3
0
static void
_notify_theme_apply(Evas_Object *obj)
{
   const char *style = elm_widget_style_get(obj);
   const char *position;
   double ax, ay;

   ELM_NOTIFY_DATA_GET(obj, sd);

   ax = sd->horizontal_align;
   ay = sd->vertical_align;
   if ((elm_widget_mirrored_get(obj)) && (ax != ELM_NOTIFY_ALIGN_FILL)) ax = 1.0 - ax;

   if (ay == 0.0)
     {
        if (ax == 0.0)
          position = "top_left";
        else if (ax == 1.0)
          position = "top_right";
        else
          position = "top";
     }
   else if (ay == 1.0)
     {
        if (ax == 0.0)
          position = "bottom_left";
        else if (ax == 1.0)
          position = "bottom_right";
        else
          position = "bottom";
     }
   else
     {
        if (ax == 0.0)
          position = "left";
        else if (ax == 1.0)
          position = "right";
        else
          position = "center";
     }

   elm_widget_theme_object_set(obj, sd->notify, "notify", position, style);
}
Beispiel #4
0
static Eina_Bool
_elm_photo_smart_theme(Evas_Object *obj)
{
   ELM_PHOTO_DATA_GET(obj, sd);

   if (!ELM_WIDGET_CLASS(_elm_photo_parent_sc)->theme(obj))
     return EINA_FALSE;

   edje_object_mirrored_set
     (ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_mirrored_get(obj));

   elm_widget_theme_object_set
     (obj, ELM_WIDGET_DATA(sd)->resize_obj, "photo", "base",
     elm_widget_style_get(obj));

   elm_object_scale_set(sd->icon, elm_widget_scale_get(obj));

   edje_object_scale_set(ELM_WIDGET_DATA(sd)->resize_obj,
                         elm_widget_scale_get(obj) * elm_config_scale_get());
   _sizing_eval(obj);

   return EINA_TRUE;
}
Beispiel #5
0
EOLIAN static Eina_Error
_elm_photo_efl_ui_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
{
   Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);

   int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
   if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;

   edje_object_mirrored_set
     (wd->resize_obj, efl_ui_mirrored_get(obj));

   elm_widget_theme_object_set
     (obj, wd->resize_obj, "photo", "base",
     elm_widget_style_get(obj));

   elm_object_scale_set(sd->icon, efl_gfx_entity_scale_get(obj));

   edje_object_scale_set(wd->resize_obj,
                         efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
   _sizing_eval(obj);

   return int_ret;
}
Beispiel #6
0
EOLIAN static Elm_Theme_Apply
_elm_photo_elm_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
{
   Elm_Theme_Apply int_ret = ELM_THEME_APPLY_FAILED;
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);

   int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS));
   if (!int_ret) return ELM_THEME_APPLY_FAILED;

   edje_object_mirrored_set
     (wd->resize_obj, elm_widget_mirrored_get(obj));

   elm_widget_theme_object_set
     (obj, wd->resize_obj, "photo", "base",
     elm_widget_style_get(obj));

   elm_object_scale_set(sd->icon, elm_widget_scale_get(obj));

   edje_object_scale_set(wd->resize_obj,
                         elm_widget_scale_get(obj) * elm_config_scale_get());
   _sizing_eval(obj);

   return int_ret;
}