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;
}
Exemplo n.º 2
0
static void
_content_set(Evas_Object *obj, Evas_Object *content)
{
   Widget_Data *wd = elm_widget_data_get(obj);
   if (!wd) return;

   if (wd->content == content) return;
   if (wd->content) evas_object_del(wd->content);
   wd->content = content;
   if (content)
     {
        elm_widget_sub_object_add(obj, content);
        evas_object_event_callback_add(content,
                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                       _changed_size_hints, obj);
        edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
     }
   _sizing_eval(obj);
}
Exemplo n.º 3
0
static void
_icon_set(Evas_Object *obj, Evas_Object* icon)
{
   Widget_Data *wd = elm_widget_data_get(obj);
   if (!wd) return;
   if (wd->icon == icon) return;
   if (wd->icon) evas_object_del(wd->icon);
   wd->icon = icon;
   if (icon)
     {
        elm_widget_sub_object_add(obj, icon);
        edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
        evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                       _changed_size_hints, obj);
        edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
        edje_object_message_signal_process(wd->bbl);
     }
   _sizing_eval(obj);
}
Exemplo n.º 4
0
static void
_conformant_parts_swallow(Evas_Object *obj)
{
   Evas *e;
   ELM_CONFORMANT_DATA_GET(obj, sd);
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
   e = evas_object_evas_get(obj);

   sd->scroller = NULL;

   //Virtual Keyboard
   if (edje_object_part_exists(wd->resize_obj, VIRTUALKEYPAD_PART))
     {
        if (!sd->virtualkeypad)
          {
             sd->virtualkeypad = evas_object_rectangle_add(e);
             elm_widget_sub_object_add(obj, sd->virtualkeypad);
             evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
          }
        else
          _conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);

        evas_object_color_set(sd->virtualkeypad, 0, 0, 0, 0);
        elm_layout_content_set(obj, VIRTUALKEYPAD_PART, sd->virtualkeypad);
     }
   else
     ELM_SAFE_FREE(sd->virtualkeypad, evas_object_del);

   //Clipboard
   if (edje_object_part_exists(wd->resize_obj, CLIPBOARD_PART))
     {
        if (!sd->clipboard)
          {
             sd->clipboard = evas_object_rectangle_add(e);
             evas_object_size_hint_min_set(sd->clipboard, -1, 0);
             evas_object_size_hint_max_set(sd->clipboard, -1, 0);
          }
        else
          _conformant_part_sizing_eval(obj, ELM_CONFORMANT_CLIPBOARD_PART);

        evas_object_color_set(sd->clipboard, 0, 0, 0, 0);
        elm_layout_content_set(obj, CLIPBOARD_PART, sd->clipboard);
     }
   else
     ELM_SAFE_FREE(sd->clipboard, evas_object_del);

   //Softkey
   if (edje_object_part_exists(wd->resize_obj, SOFTKEY_PART))
     {
        if (!sd->softkey)
          {
             sd->softkey = evas_object_rectangle_add(e);
             evas_object_size_hint_min_set(sd->softkey, -1, 0);
             evas_object_size_hint_max_set(sd->softkey, -1, 0);
          }
        else
          _conformant_part_sizing_eval(obj, ELM_CONFORMANT_SOFTKEY_PART);

        evas_object_color_set(sd->softkey, 0, 0, 0, 0);
        elm_layout_content_set(obj, SOFTKEY_PART, sd->softkey);
     }
   else
     ELM_SAFE_FREE(sd->softkey, evas_object_del);
}
Exemplo n.º 5
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);
  */
}
Exemplo n.º 6
0
static void
_conformant_parts_swallow(Evas_Object *obj)
{
   Evas *e;

   ELM_CONFORMANT_DATA_GET(obj, sd);

   e = evas_object_evas_get(obj);

   sd->scroller = NULL;

   //Indicator
   if (!sd->indicator)
     {
        sd->indicator = evas_object_rectangle_add(e);
        evas_object_size_hint_min_set(sd->indicator, -1, 0);
        evas_object_size_hint_max_set(sd->indicator, -1, 0);
     }
   else
     _conformant_part_sizing_eval(obj, ELM_CONFORMANT_INDICATOR_PART);

   evas_object_color_set(sd->indicator, 0, 0, 0, 0);
   elm_layout_content_set(obj, "elm.swallow.indicator", sd->indicator);

   //Virtual Keyboard
   if (!sd->virtualkeypad)
     {
        sd->virtualkeypad = evas_object_rectangle_add(e);
        elm_widget_sub_object_add(obj, sd->virtualkeypad);
        evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
     }
   else
     _conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);

   evas_object_color_set(sd->virtualkeypad, 0, 0, 0, 0);
   elm_layout_content_set(obj, "elm.swallow.virtualkeypad", sd->virtualkeypad);

   //Clipboard
   if (!sd->clipboard)
     {
        sd->clipboard = evas_object_rectangle_add(e);
        evas_object_size_hint_min_set(sd->clipboard, -1, 0);
        evas_object_size_hint_max_set(sd->clipboard, -1, 0);
     }
   else
     _conformant_part_sizing_eval(obj, ELM_CONFORMANT_CLIPBOARD_PART);

   evas_object_color_set(sd->clipboard, 0, 0, 0, 0);
   elm_layout_content_set(obj, "elm.swallow.clipboard", sd->clipboard);

   //Softkey
   if (!sd->softkey)
     {
        sd->softkey = evas_object_rectangle_add(e);
        evas_object_size_hint_min_set(sd->softkey, -1, 0);
        evas_object_size_hint_max_set(sd->softkey, -1, 0);
     }
   else
     _conformant_part_sizing_eval(obj, ELM_CONFORMANT_SOFTKEY_PART);

   evas_object_color_set(sd->softkey, 0, 0, 0, 0);
   elm_layout_content_set(obj, "elm.swallow.softkey", sd->softkey);
}