rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=b395d9f4c19b8b337e6a6b9ad83644dac4d95a74

commit b395d9f4c19b8b337e6a6b9ad83644dac4d95a74
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Mon Jan 11 15:01:35 2016 +0000

    live_frame: update text, signal and swallow
---
 src/bin/ui/live_view/elementary/live_frame.c | 85 +++++++++++++++++++++-------
 1 file changed, 65 insertions(+), 20 deletions(-)

diff --git a/src/bin/ui/live_view/elementary/live_frame.c 
b/src/bin/ui/live_view/elementary/live_frame.c
index 56da5f8..82f2639 100644
--- a/src/bin/ui/live_view/elementary/live_frame.c
+++ b/src/bin/ui/live_view/elementary/live_frame.c
@@ -21,42 +21,87 @@
 #include "widget_macro.h"
 
 static void
-_on_frame_swallow_check(void *data __UNUSED__,
+_on_frame_swallow_check(void *data,
                         Evas_Object *obj __UNUSED__,
-                        void *ei __UNUSED__)
+                        void *ei)
 {
-   TODO("Remake on_swallow_check, so that would be used everywhere.")
-   ERR(N_("Complex widgets are not implemented yet."))
+   Demo_Part *part = (Demo_Part *)ei;
+   Evas_Object *frame_obj = NULL;
+   Evas_Object *content = NULL;
+
+   assert(data != NULL);
+   Eina_List *frame_list = elm_box_children_get(data);
+
+   EINA_LIST_FREE(frame_list, frame_obj)
+     {
+        int content_type = part->swallow_content;
+
+        if (part->change)
+          {
+             if ((content_type == CONTENT_NONE) && (part->object))
+               {
+                  content = elm_object_part_content_unset(frame_obj, 
part->name);
+                  evas_object_del(content);
+                  content = NULL;
+                  part->object = NULL;
+               }
+
+             content = object_generate(part, frame_obj);
+             part->change = false;
+             part->object = content;
+             elm_object_part_content_set(frame_obj, part->name, content);
+          }
+
+        if (part->object)
+          {
+             evas_object_color_set(content,
+                                   part->r,
+                                   part->g,
+                                   part->b,
+                                   part->a);
+
+             evas_object_size_hint_min_set(content,
+                                           part->min_w,
+                                           part->min_h);
+             evas_object_size_hint_max_set(content,
+                                           part->max_w,
+                                           part->max_h);
+          }
+     }
 }
 
 static void
-_on_frame_text_check(void *data __UNUSED__,
+_on_frame_text_check(void *data,
                      Evas_Object *obj __UNUSED__,
-                     void *ei __UNUSED__)
+                     void *ei)
 {
-   TODO("Remake on_text_check, so that would be used everywhere.")
-   ERR(N_("Complex widgets are not implemented yet."))
+   Demo_Part *part = (Demo_Part *)ei;
+   Evas_Object *frame_obj = NULL;
+
+   assert(data != NULL);
+   Eina_List *frame_list = elm_box_children_get(data);
+
+   EINA_LIST_FREE(frame_list, frame_obj)
+     elm_object_part_text_set(frame_obj, part->name, part->text_content);
 }
 
 static void
 _frame_send_signal(void *data,
-                   Evas_Object *obj,
-                   void *ei __UNUSED__)
+                   Evas_Object *obj __UNUSED__,
+                   void *ei)
 {
+   Demo_Signal *sig = (Demo_Signal *)ei;
    Evas_Object *frame_obj = NULL;
 
    assert(data != NULL);
 
    Eina_List* frame_list = elm_box_children_get(data);
-
-   const char *name = evas_object_data_get(obj, SIGNAL_NAME);
-   const char *source = evas_object_data_get(obj, SIGNAL_SOURCE);
-
-   assert(name != NULL);
-   assert(source != NULL);
+   assert(sig != NULL);
+   assert(sig->sig_name != NULL);
+   assert(sig->source_name != NULL);
 
    EINA_LIST_FREE(frame_list, frame_obj)
-     elm_layout_signal_emit(frame_obj, name, source);
+     elm_layout_signal_emit(frame_obj, sig->sig_name, sig->source_name);
 }
 
 Evas_Object *
@@ -78,9 +123,9 @@ widget_frame_create(Evas_Object *parent, const Group *group)
    elm_box_pack_end(object, frame);
    elm_object_style_set(frame, group->style);
 
-   evas_object_data_set(object, SWALLOW_FUNC, _on_frame_swallow_check);
-   evas_object_data_set(object, TEXT_FUNC, _on_frame_text_check);
-   evas_object_data_set(object, SIGNAL_FUNC, _frame_send_signal);
+   evas_object_smart_callback_add(ap.win, SIGNAL_DEMO_SWALLOW_SET, 
_on_frame_swallow_check, object);
+   evas_object_smart_callback_add(ap.win, SIGNAL_DEMO_TEXT_SET, 
_on_frame_text_check, object);
+   evas_object_smart_callback_add(ap.win, SIGNAL_DEMO_SIGNAL_SEND, 
_frame_send_signal, object);
 
    return object;
 }

-- 


Reply via email to