EOLIAN static void
_elm_flipselector_item_elm_widget_item_part_text_set(Eo *eo_item,
        Elm_Flipselector_Item_Data *item,
        const char *part,
        const char *label)
{
    Eina_List *l;

    if (!label) return;

    if (part && strcmp(part, "default")) return;

    ELM_FLIPSELECTOR_DATA_GET(WIDGET(item), sd);

    if (!sd->items) return;

    l = eina_list_data_find_list(sd->items, eo_item);
    if (!l) return;

    eina_stringshare_del(item->label);
    item->label = eina_stringshare_add_length(label, sd->max_len);

    if (strlen(label) > strlen(elm_object_item_text_get(DATA_GET(sd->sentinel))))
        sd->sentinel = l;

    if (sd->current == l)
    {
        _update_view(WIDGET(item));
        elm_layout_sizing_eval(WIDGET(item));
    }
}
Beispiel #2
0
EOLIAN static void
_efl_ui_text_alert_popup_efl_ui_popup_popup_size_set(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, Eina_Size2D size)
{
   pd->size = size;

   efl_gfx_entity_size_set(obj, size);

   elm_layout_sizing_eval(obj);
}
static void
_size_changed_cb(void *data, Evas_Object *layout, const char *emission, const char *source)
{
   Evas_Object *edje;
   Evas_Coord w, h;

   elm_layout_sizing_eval(layout);
   edje = elm_layout_edje_get(layout);
   edje_object_size_min_calc(edje, &w, &h);
   printf("Minimum size for this theme: %dx%d\n", w, h);
}
Beispiel #4
0
static Eina_Bool
_elm_conformant_smart_theme(Evas_Object *obj)
{
   if (!ELM_WIDGET_CLASS(_elm_conformant_parent_sc)->theme(obj))
     return EINA_FALSE;

   _conformant_parts_swallow(obj);

   elm_layout_sizing_eval(obj);

   return EINA_TRUE;
}
Beispiel #5
0
static void
_elm_panes_smart_theme(Eo *obj, void *_pd, va_list *list)
{
   double size;
   Evas_Coord minw = 0, minh = 0;

   Elm_Panes_Smart_Data *sd = _pd;
   Eina_Bool *ret = va_arg(*list, Eina_Bool *);
   if (ret) *ret = EINA_FALSE;
   Eina_Bool int_ret = EINA_FALSE;
   ELM_LAYOUT_DATA_GET(obj, ld);

   if (sd->horizontal)
     eina_stringshare_replace(&ld->group, "horizontal");
   else
     eina_stringshare_replace(&ld->group, "vertical");

   evas_object_hide(sd->event);
   elm_coords_finger_size_adjust(1, &minw, 1, &minh);
   evas_object_size_hint_min_set(sd->event, minw, minh);

   eo_do_super(obj, MY_CLASS, elm_wdg_theme(&int_ret));
   if (!int_ret) return;

   size = elm_panes_content_left_size_get(obj);

   if (sd->fixed)
     {
        elm_layout_signal_emit(obj, "elm,panes,fixed", "elm");

        //TODO: remove this signal on EFL 2.0.
        // I left this due to the backward compatibility.
        elm_layout_signal_emit(obj, "elm.panes.fixed", "elm");
     }

   elm_layout_sizing_eval(obj);

   elm_panes_content_left_size_set(obj, size);

   if (ret) *ret = EINA_TRUE;
}
Beispiel #6
0
void Layout::relayout()
{
    elm_layout_sizing_eval(getHandle());
}
Beispiel #7
0
static Eina_Bool
_elm_fileselector_smart_theme(Evas_Object *obj)
{
   const char *style;
   const char *data;
   char buf[1024];

   ELM_FILESELECTOR_DATA_GET(obj, sd);

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

   style = elm_widget_style_get(obj);
   _mirrored_set(obj, elm_widget_mirrored_get(obj));

   data = edje_object_data_get
       (ELM_WIDGET_DATA(sd)->resize_obj, "path_separator");
   if (data) sd->path_separator = data;
   else sd->path_separator = "/";

   snprintf(buf, sizeof(buf), "fileselector/%s", style);

#define SWALLOW(part_name, object_ptn)                          \
  if (object_ptn)                                               \
    {                                                           \
       elm_widget_style_set(object_ptn, buf);                   \
       if (!elm_layout_content_set(obj, part_name, object_ptn)) \
         evas_object_hide(object_ptn);                          \
    }

   SWALLOW("elm.swallow.up", sd->up_button);
   SWALLOW("elm.swallow.home", sd->home_button);
   SWALLOW("elm.swallow.spinner", sd->spinner);
   elm_object_style_set(sd->spinner, "wheel");

   if (sd->mode == ELM_FILESELECTOR_LIST)
     {
        if (elm_layout_content_set(obj, "elm.swallow.files", sd->files_list))
          evas_object_hide(sd->files_grid);
        else evas_object_hide(sd->files_list);
     }
   else
     {
        if (elm_layout_content_set(obj, "elm.swallow.files", sd->files_grid))
          evas_object_hide(sd->files_list);
        else evas_object_hide(sd->files_grid);
     }

   SWALLOW("elm.swallow.filename", sd->filename_entry);
   SWALLOW("elm.swallow.path", sd->path_entry);

   snprintf(buf, sizeof(buf), "fileselector/actions/%s", style);
   SWALLOW("elm.swallow.cancel", sd->cancel_button);
   SWALLOW("elm.swallow.ok", sd->ok_button);

#undef SWALLOW

   edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);

   elm_layout_sizing_eval(obj);

   return EINA_TRUE;
}
Beispiel #8
0
EOLIAN static void
_jk_spinner_efl_canvas_group_group_add(Eo *obj, Jk_Spinner_Data *priv)
{
  printf("jk spinner group group add \n");
  ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
  JK_SPINNER_DATA_GET(obj, sd);


  efl_canvas_group_add(efl_super(obj, JK_SPINNER_CLASS));
  elm_widget_sub_object_parent_add(obj);

  /*
     pd->rect = evas_object_rectangle_add(evas_object_evas_get(obj));
  //evas_object_color_set(pd->rect, rand() % 255, rand() % 255, rand() % 255, 255/2);
  evas_object_show(pd->rect);
  evas_object_color_set(pd->rect, rand() % 255, rand() % 255, rand() % 255, 255/2);
  int r,g,b,a;
  evas_object_color_get(pd->rect, &r, &g, &b, &a);
  printf("color before : %d, %d, %d, %d \n", r, g, b, a);
  // evas_object_smart_member_add(pd->rect, obj);
  //elm_layout_content_set(obj, "elm.swallow.content", pd->rect);
  evas_object_color_get(pd->rect, &r, &g, &b, &a);
  printf("color after : %d, %d, %d, %d \n", r, g, b, a);
  evas_object_color_set(pd->rect, rand() % 255, rand() % 255, rand() % 255, 255/2);

  elm_widget_sub_object_add(obj, pd->rect);

  evas_object_color_get(pd->rect, &r, &g, &b, &a);
  printf("color after 222: %d, %d, %d, %d \n", r, g, b, a);

*/


  elm_layout_file_set(obj, "edc/entry.edj", "main");

  Evas_Object* en = elm_entry_add(obj);
  elm_entry_single_line_set(en, EINA_TRUE);
  elm_entry_editable_set(en, EINA_FALSE);
  //pd->entry = en;

  evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
  //evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
  evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
  //evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
  //elm_object_text_set(en, "<align=center>hello</align>");
  //elm_entry_text_style_user_push(en, "DEFAULT='align=center'");
  //elm_entry_text_style_user_push(en, "DEFAULT='color=#0f0'");
  elm_entry_text_style_user_push(en, user_style);
  evas_object_data_set(obj, "realentry", en);

  const char* cur_style = elm_entry_text_style_user_peek(en);

  /*
  if (cur_style)
  printf("Current style user: %s\n", cur_style);
  else
  printf("Style user stack is empty.\n");
  */

  const char* yep = "aaa";
  /*
  elm_object_text_set(en, "aaa");
  if (test == 1)
  yep = "xxx";
  if (test == 2)
  yep = "yyy";
  if (test == 3)
  yep = "zzz";
  test++;
  */

  elm_object_text_set(en, yep);
  evas_object_name_set(en, yep);

  //elm_entry_scrollable_set(en, EINA_TRUE);
  //elm_entry_scrollbar_policy_set(en,
  //      ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);

  //evas_object_smart_member_add(rect, en);
  elm_layout_content_set(obj, "content", en);
  elm_widget_sub_object_add(obj, en);
  evas_object_show(en);


  elm_widget_can_focus_set(obj, EINA_TRUE);
  elm_layout_sizing_eval(obj);
  evas_object_data_set(en, "smart", obj);

  /*
  evas_object_smart_callback_add(en, "activated", _entry_activated, obj);
  evas_object_smart_callback_add(en, "unfocused", _entry_unfocused, obj);
  evas_object_smart_callback_add(en, "changed,user", _entry_changed, obj);
  //evas_object_smart_callback_add(en, "focused", _select_all, pd);
  //evas_object_smart_callback_add(en, "selection,changed", _print_signal, "selection changed");
  evas_object_smart_callback_add(en, "selection,cleared", _entry_cleared, pd);
  //evas_object_smart_callback_add(en, "selection,start", _print_signal, "selection start");
  //evas_object_smart_callback_add(en, "clicked", _print_signal, "clicked");
  //evas_object_smart_callback_add(en, "cursor,changed", _print_signal, "cursor,changed");
  //evas_object_smart_callback_add(en, "cursor,changed,manual", _print_signal, "cursor,changed,manual");

  elm_layout_signal_callback_add(obj, "mouse,down,1", "bg",_ondown, pd);
  elm_layout_signal_callback_add(obj, "mouse,move", "bg", _onmove, obj);
  elm_layout_signal_callback_add(obj, "mouse,up,1", "bg", _onup, obj);
  elm_layout_signal_callback_add(obj, "mouse,clicked,1", "bg", _onclicked, pd);

  elm_layout_signal_callback_add(obj, "drag", "*", _drag_cb, obj);
  elm_layout_signal_callback_add(obj, "drag,start", "*", _drag_start_cb, obj);
  elm_layout_signal_callback_add(obj, "drag,stop", "*", _drag_stop_cb, obj);
  elm_layout_signal_callback_add(obj, "drag,step", "*", _drag_stop_cb, obj);
  elm_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop_cb, obj);
  */
}