EAPI Evas_Object *
elm_separator_add(Evas_Object *parent)
{
   Evas_Object *obj;
   Evas *e;
   Widget_Data *wd;

   ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);

   ELM_SET_WIDTYPE(widtype, "separator");
   wd->horizontal = EINA_FALSE;
   elm_widget_type_set(obj, "separator");
   elm_widget_sub_object_add(parent, obj);
   elm_widget_data_set(obj, wd);
   elm_widget_del_hook_set(obj, _del_hook);
   elm_widget_theme_hook_set(obj, _theme_hook);
   elm_widget_can_focus_set(obj, EINA_FALSE);

   wd->sep = edje_object_add(e);
   _elm_theme_object_set(obj, wd->sep, "separator", "vertical", "default");
   elm_widget_resize_object_set(obj, wd->sep);
   _mirrored_set(obj, elm_widget_mirrored_get(obj));
   _sizing_eval(obj);
   return obj;
}
Esempio n. 2
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;
}
Esempio n. 3
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);
  */
}