[EGIT] [core/efl] master 01/10: efl.ui.layout: change signal name for icon/text

2018-02-14 Thread Sungtaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=73f8b3b78f0ff92ddfc1c16426bf7c176f10293a

commit 73f8b3b78f0ff92ddfc1c16426bf7c176f10293a
Author: Sungtaek Hong 
Date:   Wed Feb 14 11:29:19 2018 -0800

efl.ui.layout: change signal name for icon/text

Summary:
when set/unset icon and text,
signal "elm,state,[part],visible/hidden" is emitted.
This is wrong because visible/hidden should be handled by
Efl.Gfx.visible, not Efl.Text nor Efl.Content.
This should be changed into elm,state,[part],set/unset"
All relating edc should be fixed.

Test Plan: run elementary_test->button, Efl.Ui.Button

Reviewers: jpeg, cedric, woohyun, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5798

Signed-off-by: Cedric Bail 
---
 data/elementary/themes/edc/efl/button.edc  | 783 -
 src/Makefile_Elementary.am |   2 +-
 src/lib/elementary/efl_ui_button.c | 158 ++---
 src/lib/elementary/efl_ui_button.eo|   3 -
 src/lib/elementary/efl_ui_button_legacy.eo |   3 +
 ...button_part.eo => efl_ui_button_legacy_part.eo} |   2 +-
 src/lib/elementary/efl_ui_layout.c |  52 +-
 7 files changed, 898 insertions(+), 105 deletions(-)

diff --git a/data/elementary/themes/edc/efl/button.edc 
b/data/elementary/themes/edc/efl/button.edc
index 1fe935b37e..cf4333bea2 100644
--- a/data/elementary/themes/edc/efl/button.edc
+++ b/data/elementary/themes/edc/efl/button.edc
@@ -1,8 +1,781 @@
-group { "efl/button";
-   inherit: "elm/button/base/default";
+group { name: "efl/button";
+   images.image: "button_normal.png" COMP;
+   images.image: "button_clicked.png" COMP;
+#define ICON 1
+#define LABEL2
+#define MASK 3
+#define DISABLE  4
+#define PRESSED  8
+#define BACKGROUND  16
+   script {
+  public btmode;
+  public eval_mode(m) {
+ new m1 = m & MASK;
+ new d = m & DISABLE;
+ new p = m & PRESSED;
+ new bg = m & BACKGROUND;
+ if (bg) {
+set_state(PART:"base", "hidden", 0.0);
+set_state(PART:"elm.swallow.background", "visible", 0.0);
+ } else {
+set_state(PART:"elm.swallow.background", "default", 0.0);
+if (!d) {
+   if (!p)
+ {
+  set_state(PART:"base", "default", 0.0);
+  set_state(PART:"base", "default", 0.0);
+ }
+   else {
+set_state(PART:"base", "pressed", 0.0);
+ }
+} else {
+   set_state(PART:"base", "disabled", 0.0);
+}
+ }
+ if (m1 == (ICON | LABEL)) {
+if (!d) {
+   set_state(PART:"elm.swallow.content", "visible", 0.0);
+   set_state(PART:"sizer.content", "visible", 0.0);
+   set_state(PART:"event", "default", 0.0);
+   if (!p) {
+  set_state(PART:"elm.text", "visible", 0.0);
+  set_state(PART:"icon_clip", "default", 0.0);
+   } else {
+  set_state(PART:"elm.text", "pressed_visible", 0.0);
+  set_state(PART:"icon_clip", "pressed", 0.0);
+   }
+} else {
+   set_state(PART:"elm.swallow.content", "visible", 0.0);
+   set_state(PART:"sizer.content", "visible", 0.0);
+   set_state(PART:"elm.text", "disabled_visible", 0.0);
+   set_state(PART:"icon_clip", "disabled", 0.0);
+   set_state(PART:"event", "disabled", 0.0);
+}
+ } else if (m1 == (ICON)) {
+if (!d) {
+   set_state(PART:"elm.swallow.content", "icononly", 0.0);
+   set_state(PART:"sizer.content", "icononly", 0.0);
+   set_state(PART:"event", "default", 0.0);
+   set_state(PART:"elm.text", "default", 0.0);
+   if (!p)
+  set_state(PART:"icon_clip", "default", 0.0);
+   else
+  set_state(PART:"icon_clip", "pressed", 0.0);
+} else {
+   set_state(PART:"elm.swallow.content", "icononly", 0.0);
+   set_state(PART:"sizer.content", "icononly", 0.0);
+   set_state

[EGIT] [core/efl] master 01/01: efl_part: call Efl.Text of each class' part

2018-02-08 Thread Sungtaek Hong
herdsman pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b380e63b0769c664c5a00be0879fddab9b0c98a5

commit b380e63b0769c664c5a00be0879fddab9b0c98a5
Author: Sungtaek Hong 
Date:   Thu Feb 8 11:37:51 2018 +0200

efl_part: call Efl.Text of each class' part

Summary:
Macro ELM_PART_TEXT_DEFAULT_IMPLEMENT calls
super class' Efl.Text interface, rather than this class.

Reviewers: jpeg, woohyun, Jaehyun_Cho, herdsman

Subscribers: cedric, id213sin

Differential Revision: https://phab.enlightenment.org/D5799
---
 src/lib/elementary/elm_part_helper.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/elementary/elm_part_helper.h 
b/src/lib/elementary/elm_part_helper.h
index 9b63e94e62..d135dda6c5 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -178,34 +178,34 @@ _ ## full ## _efl_text_markup_markup_set(Eo *obj, void 
*_pd EINA_UNUSED, const c
 EOLIAN static void \
 _ ## type ## _efl_text_text_set(Eo *obj, typedata *sd EINA_UNUSED, const char 
*text) \
 { \
-   efl_text_set(efl_part(efl_super(obj, MY_CLASS), 
efl_ui_widget_default_text_part_get(obj)), text); \
+   efl_text_set(efl_part(obj, efl_ui_widget_default_text_part_get(obj)), 
text); \
 } \
 EOLIAN static const char * \
 _ ## type ## _efl_text_text_get(Eo *obj, typedata *sd EINA_UNUSED) \
 { \
-  return efl_text_get(efl_part(efl_super(obj, MY_CLASS), 
efl_ui_widget_default_text_part_get(obj))); \
+  return efl_text_get(efl_part(obj, 
efl_ui_widget_default_text_part_get(obj))); \
 } \
 EOLIAN static void \
 _ ## type ## _efl_ui_translatable_translatable_text_set(Eo *obj, typedata *sd 
EINA_UNUSED, const char *label, const char *domain) \
 { \
-   efl_ui_translatable_text_set(efl_part(efl_super(obj, MY_CLASS), 
efl_ui_widget_default_text_part_get(obj)), label, domain); \
+   efl_ui_translatable_text_set(efl_part(obj, 
efl_ui_widget_default_text_part_get(obj)), label, domain); \
 } \
 EOLIAN static const char * \
 _ ## type ## _efl_ui_translatable_translatable_text_get(Eo *obj, typedata *sd 
EINA_UNUSED, const char **domain) \
 { \
-  return efl_ui_translatable_text_get(efl_part(efl_super(obj, MY_CLASS), 
efl_ui_widget_default_text_part_get(obj)), domain); \
+  return efl_ui_translatable_text_get(efl_part(obj, 
efl_ui_widget_default_text_part_get(obj)), domain); \
 }
 
 #define ELM_PART_MARKUP_DEFAULT_IMPLEMENT(type, typedata) \
 EOLIAN static const char * \
 _ ## type ## _efl_text_markup_markup_get(Eo *obj, typedata *sd EINA_UNUSED) \
 { \
-  return efl_text_markup_get(efl_part(efl_super(obj, MY_CLASS), 
efl_ui_widget_default_text_part_get(obj))); \
+  return efl_text_markup_get(efl_part(obj, 
efl_ui_widget_default_text_part_get(obj))); \
 } \
 EOLIAN static void \
 _ ## type ## _efl_text_markup_markup_set(Eo *obj, typedata *sd EINA_UNUSED, 
const char *markup) \
 { \
-  efl_text_markup_set(efl_part(efl_super(obj, MY_CLASS), 
efl_ui_widget_default_text_part_get(obj)), markup); \
+  efl_text_markup_set(efl_part(obj, efl_ui_widget_default_text_part_get(obj)), 
markup); \
 }
 
 #endif

-- 




[EGIT] [core/efl] master 02/02: efl_part: use efl_ui_widget's default_part_get

2018-02-07 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=08d86d3941ee7d4f5e89520fb8d29870a903300b

commit 08d86d3941ee7d4f5e89520fb8d29870a903300b
Author: Sungtaek Hong 
Date:   Thu Feb 8 14:53:59 2018 +0900

efl_part: use efl_ui_widget's default_part_get

Summary:
efl_part macros are using each widget's internally defined
default_part_get() functions to get default part name.
This might potentially cause errors when future widgets
inherits the widget but not overriding Efl.Text.text and
Efl.Content.content.

Reviewers: jpeg, cedric, woohyun, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5797
---
 src/lib/elementary/efl_ui_button.c  |  4 +++-
 src/lib/elementary/efl_ui_frame.c   |  1 +
 src/lib/elementary/efl_ui_popup.c   |  3 ++-
 src/lib/elementary/efl_ui_progressbar.c |  4 +++-
 src/lib/elementary/efl_ui_radio.c   |  7 +-
 src/lib/elementary/efl_ui_radio.eo  |  2 --
 src/lib/elementary/efl_ui_slider.c  |  4 +++-
 src/lib/elementary/elc_popup.c  |  4 ++--
 src/lib/elementary/elm_part_helper.h| 38 -
 9 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/src/lib/elementary/efl_ui_button.c 
b/src/lib/elementary/efl_ui_button.c
index 7f4f691386..b47fafd1bd 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -464,7 +464,9 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_button), \
-   EFL_CANVAS_GROUP_ADD_OPS(efl_ui_button)
+   EFL_CANVAS_GROUP_ADD_OPS(efl_ui_button), \
+   ELM_PART_TEXT_DEFAULT_OPS(efl_ui_button), \
+   ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_button)
 
 #include "efl_ui_button.eo.c"
 
diff --git a/src/lib/elementary/efl_ui_frame.c 
b/src/lib/elementary/efl_ui_frame.c
index d7dacda407..e4bb944733 100644
--- a/src/lib/elementary/efl_ui_frame.c
+++ b/src/lib/elementary/efl_ui_frame.c
@@ -217,6 +217,7 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_frame)
 #define EFL_UI_FRAME_EXTRA_OPS \
EFL_CANVAS_GROUP_ADD_OPS(efl_ui_frame), \
ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_frame), \
+   ELM_PART_TEXT_DEFAULT_OPS(efl_ui_frame), \
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_frame), \
ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_frame)
 
diff --git a/src/lib/elementary/efl_ui_popup.c 
b/src/lib/elementary/efl_ui_popup.c
index ccb815ad5c..e5071daf4a 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -395,6 +395,7 @@ _efl_ui_popup_part_efl_file_file_set(Eo *obj, void *_pd 
EINA_UNUSED, const char
 /* Internal EO APIs and hidden overrides */
 
 #define EFL_UI_POPUP_EXTRA_OPS \
-   ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup)
+   ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup), \
+   ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_popup)
 
 #include "efl_ui_popup.eo.c"
diff --git a/src/lib/elementary/efl_ui_progressbar.c 
b/src/lib/elementary/efl_ui_progressbar.c
index b9000d6350..4506c5941d 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -737,7 +737,9 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_progressbar)
ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_progressbar), \
ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_progressbar), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_progressbar), \
-   EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_progressbar)
+   EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_progressbar), \
+   ELM_PART_TEXT_DEFAULT_OPS(efl_ui_progressbar), \
+   ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_progressbar)
 
 #include "efl_ui_progressbar.eo.c"
 
diff --git a/src/lib/elementary/efl_ui_radio.c 
b/src/lib/elementary/efl_ui_radio.c
index 8a3c537bda..0a49b3c5fc 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -357,11 +357,6 @@ _efl_ui_radio_efl_access_state_set_get(Eo *obj, 
Efl_Ui_Radio_Data *pd EINA_UNUSE
return ret;
 }
 
-/* Part APIs */
-
-ELM_PART_CONTENT_DEFAULT_GET(efl_ui_radio, "elm.swallow.content")
-ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_radio, Efl_Ui_Radio_Data)
-
 /* Internal EO APIs and hidden overrides */
 
 ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_radio, Efl_Ui_Radio_Data)
@@ -410,4 +405,4 @@ elm_radio_value_get(const Evas_Object *obj)
return efl_ui_nstate_value_get(obj);
 }
 
-#include "efl_ui_radio_legacy.eo.c"
\ No newline at end of file
+#include "efl_ui_radio_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_radio.eo 
b/src/lib/elementary/efl_ui_radio.eo
index f3ec5d60ee..c561eac409 100644
--- a/src/lib/elementary/efl_ui_radio.eo
+++ b/src/lib/elementary/efl_ui_radio.eo
@@ -66,8 +66,6 @@ class Efl.Ui.Radio (Efl.Ui.Check, Efl.Access.Widget.Action, 
Efl.Content)
   Efl.Ui.Widget.widget_event;
   Efl.Access.state_set { get; }
   Efl.Access.Wi

[EGIT] [core/efl] efl-1.20 09/45: elm_index: fix documentation of wrong param name

2018-02-06 Thread Sungtaek Hong
raster pushed a commit to branch efl-1.20.

http://git.enlightenment.org/core/efl.git/commit/?id=664c81abca6b0d8a2cbd1b5384161dab41e3b0cf

commit 664c81abca6b0d8a2cbd1b5384161dab41e3b0cf
Author: Sungtaek Hong 
Date:   Mon Jan 29 21:17:26 2018 +0900

elm_index: fix documentation of wrong param name

Reviewers: jpeg, woohyun, eunue, conr2d, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5767
---
 src/lib/elementary/elm_index.eo | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_index.eo b/src/lib/elementary/elm_index.eo
index bbff132bc4..431cf4df1a 100644
--- a/src/lib/elementary/elm_index.eo
+++ b/src/lib/elementary/elm_index.eo
@@ -122,7 +122,7 @@ class Elm.Index (Elm.Layout, Efl.Orientation,
$item will be the pointer returned back on $"changed",
"delay,changed" and $"selected" smart events.
 
-   Note: If $relative is $NULL this function will behave as
+   Note: If $after is $NULL this function will behave as
elm_index_item_append().]]
 
  return: Elm.Widget.Item; [[A handle to the item added or $NULL, on 
errors]]
@@ -151,7 +151,7 @@ class Elm.Index (Elm.Layout, Efl.Orientation,
$item will be the pointer returned back on $"changed",
"delay,changed" and $"selected" smart events.
 
-   Note: If $relative is $NULL this function will behave as
+   Note: If $before is $NULL this function will behave as
elm_index_item_prepend().]]
 
  return: Elm.Widget.Item; [[A handle to the item added or $NULL, on 
errors]]

-- 




[EGIT] [core/efl] master 02/12: elm_test: add elementary_test for Efl.Ui.Button

2018-01-30 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f3d3104a14868a3fa97346aff3c643e4c037d2bb

commit f3d3104a14868a3fa97346aff3c643e4c037d2bb
Author: Sungtaek Hong 
Date:   Mon Jan 29 13:22:26 2018 +0900

elm_test: add elementary_test for Efl.Ui.Button

Test Plan: Run elementary_test->Efl.Ui.Button

Reviewers: jpeg, cedric, Jaehyun_Cho

Reviewed By: jpeg

Subscribers: jsuya

Differential Revision: https://phab.enlightenment.org/D5741
---
 src/Makefile_Elementary.am  |  1 +
 src/bin/elementary/Makefile.am  |  1 +
 src/bin/elementary/test.c   |  2 +
 src/bin/elementary/test_ui_button.c | 78 +
 4 files changed, 82 insertions(+)

diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index f93805136d..db53d2aba7 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -861,6 +861,7 @@ bin/elementary/test_bg.c \
 bin/elementary/test_box.c \
 bin/elementary/test_bubble.c \
 bin/elementary/test_button.c \
+bin/elementary/test_ui_button.c \
 bin/elementary/test_calendar.c \
 bin/elementary/test_check.c \
 bin/elementary/test_clock.c \
diff --git a/src/bin/elementary/Makefile.am b/src/bin/elementary/Makefile.am
index 43c72f412d..0749293876 100644
--- a/src/bin/elementary/Makefile.am
+++ b/src/bin/elementary/Makefile.am
@@ -48,6 +48,7 @@ test_bg.c \
 test_box.c \
 test_bubble.c \
 test_button.c \
+test_ui_button.c \
 test_calendar.c \
 test_check.c \
 test_clock.c \
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 0f7fdacfe3..6c0d4ee1e0 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -31,6 +31,7 @@ void test_box_align(void *data, Evas_Object *obj, void 
*event_info);
 void test_box_stack(void *data, Evas_Object *obj, void *event_info);
 void test_ui_box(void *data, Evas_Object *obj, void *event_info);
 void test_button(void *data, Evas_Object *obj, void *event_info);
+void test_ui_button(void *data, Evas_Object *obj, void *event_info);
 void test_cnp(void *data, Evas_Object *obj, void *event_info);
 void test_events(void *data, Evas_Object *obj, void *event_info);
 void test_transit(void *data, Evas_Object *obj, void *event_info);
@@ -848,6 +849,7 @@ add_tests:
 
//--//
ADD_TEST(NULL, "Buttons", "Button", test_button);
+   ADD_TEST_EO(NULL, "Buttons", "Efl.Ui.Button", test_ui_button);
 
//--//
ADD_TEST(NULL, "Prefs", "Prefs", test_prefs);
diff --git a/src/bin/elementary/test_ui_button.c 
b/src/bin/elementary/test_ui_button.c
new file mode 100644
index 00..f0e39842fa
--- /dev/null
+++ b/src/bin/elementary/test_ui_button.c
@@ -0,0 +1,78 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include 
+
+static void
+_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
+{
+   printf("Button is clicked!!!\n");
+}
+
+static void
+_pressed(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
+{
+   printf("Button is pressed!!!\n");
+}
+
+static void
+_unpressed(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
+{
+   printf("Button is unpressed!!!\n");
+}
+
+void
+test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
+{
+   Eo *win, *bx, *btn;
+   char buf[PATH_MAX];
+
+   win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Button"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE)
+);
+
+   bx = efl_add(EFL_UI_BOX_CLASS, win,
+efl_content_set(win, efl_added),
+efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
+
+   // Text Only Button
+   efl_add(EFL_UI_BUTTON_CLASS, bx,
+   efl_text_set(efl_added, "Text"),
+   efl_pack(bx, efl_added),
+   efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, 
NULL),
+   efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, _pressed, 
NULL),
+   efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, 
_unpressed, NULL)
+  );
+
+   // Icon Only Button
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", 
elm_app_data_dir_get());
+   btn = efl_add(EFL_UI_BUTTON_CLASS, bx,
+ efl_pack(bx, efl_added),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 
_clicked, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, 
_pressed, NULL),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, 
_unpressed, NULL)
+);
+   efl_add(EFL_UI_IMAGE_CLASS, btn,
+   efl_file_set(efl_added, buf, NULL),
+   efl_content_set(btn, efl_added)
+  

[EGIT] [core/efl] master 01/12: Efl.Ui.Image: remove previous image when NULL is set

2018-01-30 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=30593b19ba6ea7986514fbedd86fac5f6569ff1c

commit 30593b19ba6ea7986514fbedd86fac5f6569ff1c
Author: Sungtaek Hong 
Date:   Mon Jan 29 13:21:49 2018 +0900

Efl.Ui.Image: remove previous image when NULL is set

Summary:
when Efl.Ui.Image has an image,
 efl_file_set(efl_added, NULL, NULL) is not working.
 I think this should remove prevous image and go back to empty 
image.
 @fix

Reviewers: jpeg, cedric, eunue, woohyun, Jaehyun_Cho

Subscribers: Blackmole

Differential Revision: https://phab.enlightenment.org/D5742
---
 src/lib/elementary/efl_ui_image.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_image.c 
b/src/lib/elementary/efl_ui_image.c
index 4b0faf8552..a2e0effea8 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -1129,11 +1129,11 @@ _efl_ui_image_efl_file_file_set(Eo *obj, 
Efl_Ui_Image_Data *sd, const char *file
 sd->anim = EINA_FALSE;
  }
 
-   if (!file && !sd->prev_img) return EINA_FALSE;
-   else if (!file &&  sd->prev_img)
+   if (!file)
  {
-_prev_img_del(sd);
-return EINA_TRUE;
+if (sd->prev_img)
+  _prev_img_del(sd);
+return _efl_ui_image_smart_internal_file_set(obj, sd, file, NULL, 
key);;
  }
 
if (_efl_ui_image_is_remote(file))

-- 




[EGIT] [core/efl] master 03/12: edje_object: fix typo in EAPI edje_object_color_class_description_get

2018-01-30 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=eb50ece0826aa63f2428aa7cb5bca6cfebe6e73b

commit eb50ece0826aa63f2428aa7cb5bca6cfebe6e73b
Author: Sungtaek Hong 
Date:   Tue Jan 30 14:25:39 2018 +0900

edje_object: fix typo in EAPI edje_object_color_class_description_get

Reviewers: woohyun, jpeg, cedric, conr2d

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D5766
---
 src/lib/edje/edje_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 5a72652a44..e55091df19 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -900,7 +900,7 @@ _efl_canvas_layout_efl_gfx_color_class_color_class_get(Eo 
*obj EINA_UNUSED, Edje
 }
 
 EAPI const char *
-edje_objcet_color_class_description_get(const Evas_Object *obj, const char 
*color_class)
+edje_object_color_class_description_get(const Evas_Object *obj, const char 
*color_class)
 {
return efl_gfx_color_class_description_get(obj, color_class);
 }

-- 




[EGIT] [core/efl] master 01/01: Efl.Ui.Check: fix changed callback is called twice

2018-01-29 Thread Sungtaek Hong
ami pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=596c88f8992d34f14bde6026993b2db785ada36b

commit 596c88f8992d34f14bde6026993b2db785ada36b
Author: Sungtaek Hong 
Date:   Mon Jan 29 22:36:11 2018 +0900

Efl.Ui.Check: fix changed callback is called twice

Summary:
Efl.Ui.Check inherits Efl.i.Nstate which also calls changed callback.

fixes T6639

Test Plan: run elementary_test->check->click 'icon not resizable'

Reviewers: woohyun, cedric, jpeg, singh.amitesh

Reviewed By: singh.amitesh

Maniphest Tasks: T6639

Differential Revision: https://phab.enlightenment.org/D5768
---
 src/lib/elementary/efl_ui_check.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_check.c 
b/src/lib/elementary/efl_ui_check.c
index d119a8e6b9..d36cdb0b1a 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -75,8 +75,6 @@ _activate(Evas_Object *obj)
  _elm_access_say(E_("State: Off"));
  }
 
-   efl_event_callback_legacy_call(obj, EFL_UI_CHECK_EVENT_CHANGED, NULL);
-
if (_elm_config->atspi_mode)
efl_access_state_changed_signal_emit(obj,
 
EFL_ACCESS_STATE_CHECKED,

-- 




[EGIT] [core/efl] master 01/01: elm_index: fix documentation of wrong param name

2018-01-29 Thread Sungtaek Hong
jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=dc28a344cca342ba68c83a304e159345a2cd9104

commit dc28a344cca342ba68c83a304e159345a2cd9104
Author: Sungtaek Hong 
Date:   Mon Jan 29 21:17:26 2018 +0900

elm_index: fix documentation of wrong param name

Reviewers: jpeg, woohyun, eunue, conr2d, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5767
---
 src/lib/elementary/elm_index.eo | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_index.eo b/src/lib/elementary/elm_index.eo
index ee79dd34d1..c0c12c31a9 100644
--- a/src/lib/elementary/elm_index.eo
+++ b/src/lib/elementary/elm_index.eo
@@ -98,7 +98,7 @@ class Elm.Index (Efl.Ui.Layout, Efl.Ui.Direction,
$item will be the pointer returned back on $"changed",
"delay,changed" and $"selected" smart events.
 
-   Note: If $relative is $NULL this function will behave as
+   Note: If $after is $NULL this function will behave as
elm_index_item_append().]]
 
  return: Elm.Widget.Item; [[A handle to the item added or $NULL, on 
errors]]
@@ -127,7 +127,7 @@ class Elm.Index (Efl.Ui.Layout, Efl.Ui.Direction,
$item will be the pointer returned back on $"changed",
"delay,changed" and $"selected" smart events.
 
-   Note: If $relative is $NULL this function will behave as
+   Note: If $before is $NULL this function will behave as
elm_index_item_prepend().]]
 
  return: Elm.Widget.Item; [[A handle to the item added or $NULL, on 
errors]]

-- 




[EGIT] [core/efl] master 01/01: efl_ui_bg_widget_legacy: ignore ELM_SCALE

2018-01-29 Thread Sungtaek Hong
jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=09d3d5b85ad4a0b7441b5b1e508db0e595bef395

commit 09d3d5b85ad4a0b7441b5b1e508db0e595bef395
Author: Sungtaek Hong 
Date:   Mon Jan 29 16:57:41 2018 +0900

efl_ui_bg_widget_legacy: ignore ELM_SCALE

Summary:
For legacy efl_ui_bg_widget or elm_bg, ELM_SCALE is ignored
when calculating internal image size.

Test Plan:
compare elementary_test->bg option with
ELM_SCALE=2.0 elementary_test->bg option

Reviewers: woohyun, jpeg, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, id213sin

Differential Revision: https://phab.enlightenment.org/D5763
---
 src/lib/elementary/efl_ui_bg_widget.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lib/elementary/efl_ui_bg_widget.c 
b/src/lib/elementary/efl_ui_bg_widget.c
index dba5dd7a34..3cc8fb1c58 100644
--- a/src/lib/elementary/efl_ui_bg_widget.c
+++ b/src/lib/elementary/efl_ui_bg_widget.c
@@ -244,6 +244,8 @@ _efl_ui_bg_widget_legacy_efl_object_constructor(Eo *obj, 
void *_pd EINA_UNUSED)
 {
obj = efl_constructor(efl_super(obj, EFL_UI_BG_WIDGET_LEGACY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+   EFL_UI_BG_WIDGET_DATA_GET_OR_RETURN_VAL(obj, pd, obj);
+   elm_image_no_scale_set(pd->img, EINA_TRUE);
 
return obj;
 }

-- 




[EGIT] [core/efl] master 04/04: eolian_gen: remove reference to elm_entry because it is not installed

2018-01-24 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=549c78131053114416b947eb8f0369e1132ffb9c

commit 549c78131053114416b947eb8f0369e1132ffb9c
Author: Sungtaek Hong 
Date:   Wed Jan 24 18:51:25 2018 +0900

eolian_gen: remove reference to elm_entry because it is not installed

Summary:
elm_entry.eo is not installed to system directory like
 "/usr/local/share/eolian/include/elementary-1", and
 eolian_gen tries to refer elm_entry.eo which results in failure.

Test Plan:
Create any eo class file which inherits Efl.Ui.Layout.
   eolian_gen eo_file.eo
   observe eolian_gen finishes

Reviewers: jpeg, herdsman, woohyun, Jaehyun_Cho, cedric

Subscribers: conr2d, id213sin, JongminLee

Differential Revision: https://phab.enlightenment.org/D5760
---
 src/lib/elementary/efl_ui_text.eo  |  1 -
 src/lib/elementary/elm_general.eot | 12 
 2 files changed, 13 deletions(-)

diff --git a/src/lib/elementary/efl_ui_text.eo 
b/src/lib/elementary/efl_ui_text.eo
index 5146d2ce8e..4e65f5053c 100644
--- a/src/lib/elementary/efl_ui_text.eo
+++ b/src/lib/elementary/efl_ui_text.eo
@@ -1,5 +1,4 @@
 import elm_general;
-import elm_entry;
 
 class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
  Efl.Access.Text, Efl.Access.Editable.Text, Efl.File,
diff --git a/src/lib/elementary/elm_general.eot 
b/src/lib/elementary/elm_general.eot
index 783894f697..55d310f6be 100644
--- a/src/lib/elementary/elm_general.eot
+++ b/src/lib/elementary/elm_general.eot
@@ -142,8 +142,6 @@ struct @extern Efl_Access_Action_Data; [[Efl access action 
data]]
 enum Elm.Text_Format
 {
[[Text Format types.
-
- See also @Elm.Entry.file_text_format.
]]
plain_utf8, [[ Plain UTF8 type ]]
markup_utf8 [[ Markup UTF8 type ]]
@@ -153,7 +151,6 @@ enum Elm.Input.Panel.Layout
 {
[[Input panel (virtual keyboard) layout types.
  Type of input panel (virtual keyboard) to use - this is a hint and may 
not provide exactly what is desired.
- See also @Elm.Entry.input_panel_layout.set.
]]
normal,  [[Default layout.]]
number,  [[Number layout.]]
@@ -181,8 +178,6 @@ enum Elm.Input.Panel.Layout
 enum Elm.Input.Panel.Lang
 {
[[Input panel (virtual keyboard) language modes.
-
-  See also @Elm.Entry.input_panel_language.set.
]]
automatic,[[Automatic]]
alphabet  [[Alphabet]]
@@ -192,8 +187,6 @@ enum Elm.Autocapital.Type
 {
[[Autocapitalization Types.
  Choose method of auto-capitalization.
-
- See also @Elm.Entry.autocapital_type.set.
]]
none, [[No auto-capitalization when typing.]]
word, [[Autocapitalize each word typed.]]
@@ -204,8 +197,6 @@ enum Elm.Autocapital.Type
 enum Elm.Input.Panel.Return_Key.Type
 {
[["Return" Key types on the input panel (virtual keyboard).
- See also @Elm.Entry.input_panel_return_key_type.set.
-
]]
default, [[Default.]]
done,[[Done.]]
@@ -278,9 +269,6 @@ enum Elm.Cnp_Mode
 {
[[
  Enum of entry's copy & paste policy.
-
- See also @Elm.Entry.cnp_mode.set,
- @Elm.Entry.cnp_mode.get.
]]
markup,[[ copy & paste text with markup tag ]]
no_image,  [[ copy & paste text without item(image) tag ]]

-- 




[EGIT] [core/efl] master 02/04: efl_ui_legacy: add new interface to indicate legacy widget

2018-01-24 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cb25699dacde420a0e0c3434065ab8dac242ee6e

commit cb25699dacde420a0e0c3434065ab8dac242ee6e
Author: Sungtaek Hong 
Date:   Wed Jan 24 15:50:58 2018 +0900

efl_ui_legacy: add new interface to indicate legacy widget

Summary:
For now, how to check whether a widget is legacy or not
is to check flags in private data or static flag, which is set
during elm_legacy_add.
If Efl.Ui.Legacy interface is added, it can be easilly checked
by efl_isa(obj, EFL_UI_LEGACY_INTERFACE)

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Subscribers: conr2d, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5748
---
 src/Makefile_Elementary.am |  19 +
 src/lib/elementary/efl_ui_bg_widget.c  |  44 +-
 src/lib/elementary/efl_ui_bg_widget.eo |   1 -
 ..._ui_bg_widget.eo => efl_ui_bg_widget_legacy.eo} |   9 +-
 src/lib/elementary/efl_ui_button.c |  42 +-
 src/lib/elementary/efl_ui_button.eo|   1 -
 src/lib/elementary/efl_ui_button_legacy.eo |  13 +
 src/lib/elementary/efl_ui_check.c  |  42 +-
 src/lib/elementary/efl_ui_check.eo |   1 -
 src/lib/elementary/efl_ui_check_legacy.eo  |  15 +
 src/lib/elementary/efl_ui_clock.c  |   8 -
 src/lib/elementary/efl_ui_clock.eo |   1 -
 src/lib/elementary/efl_ui_clock_legacy.eo  |   9 +
 src/lib/elementary/efl_ui_flip.c   |  42 +-
 src/lib/elementary/efl_ui_flip.eo  |   1 -
 src/lib/elementary/efl_ui_flip_legacy.eo   |   9 +
 src/lib/elementary/efl_ui_frame.c  |  42 +-
 src/lib/elementary/efl_ui_frame.eo |   1 -
 src/lib/elementary/efl_ui_frame_legacy.eo  |  14 +
 src/lib/elementary/efl_ui_image.c  |  52 ++-
 src/lib/elementary/efl_ui_image.eo |   1 -
 src/lib/elementary/efl_ui_image_legacy.eo  |   9 +
 src/lib/elementary/efl_ui_image_zoomable.c |  47 +-
 src/lib/elementary/efl_ui_image_zoomable_legacy.eo |   9 +
 src/lib/elementary/efl_ui_layout.c | 514 +++--
 src/lib/elementary/efl_ui_layout.eo|   1 -
 src/lib/elementary/efl_ui_layout_legacy.eo |   9 +
 src/lib/elementary/efl_ui_legacy.c |   8 +
 src/lib/elementary/efl_ui_legacy.eo|   9 +
 src/lib/elementary/efl_ui_multibuttonentry.c   |  39 +-
 .../elementary/efl_ui_multibuttonentry_legacy.eo   |   9 +
 src/lib/elementary/efl_ui_panes.c  |  33 +-
 src/lib/elementary/efl_ui_panes.eo |   1 -
 src/lib/elementary/efl_ui_panes_legacy.eo  |   9 +
 src/lib/elementary/efl_ui_progressbar.c|  30 +-
 src/lib/elementary/efl_ui_progressbar.eo   |   1 -
 src/lib/elementary/efl_ui_progressbar_legacy.eo|   9 +
 src/lib/elementary/efl_ui_radio.c  |  29 +-
 src/lib/elementary/efl_ui_radio.eo |   1 -
 src/lib/elementary/efl_ui_radio_legacy.eo  |   9 +
 src/lib/elementary/efl_ui_slider.c |  54 ++-
 src/lib/elementary/efl_ui_slider.eo|   1 -
 src/lib/elementary/efl_ui_slider_legacy.eo |   9 +
 src/lib/elementary/efl_ui_video.c  |  63 +--
 src/lib/elementary/efl_ui_video.eo |   1 -
 src/lib/elementary/efl_ui_video_legacy.eo  |   9 +
 src/lib/elementary/efl_ui_widget.c |  16 -
 src/lib/elementary/efl_ui_win.c| 136 +++---
 src/lib/elementary/efl_ui_win_legacy.eo|   9 +
 src/lib/elementary/elm_actionslider.eo |   2 +-
 src/lib/elementary/elm_box.eo  |   2 +-
 src/lib/elementary/elm_bubble.eo   |   2 +-
 src/lib/elementary/elm_calendar.eo |   3 +-
 src/lib/elementary/elm_clock.eo|   2 +-
 src/lib/elementary/elm_code.h  |   1 +
 src/lib/elementary/elm_code_diff_widget.c  |   4 +-
 src/lib/elementary/elm_code_widget.c   |   9 +-
 src/lib/elementary/elm_code_widget_legacy.eo   |   5 +
 src/lib/elementary/elm_colorselector.eo|   2 +-
 src/lib/elementary/elm_combobox.eo |   2 +-
 src/lib/elementary/elm_conformant.eo   |   2 +-
 src/lib/elementary/elm_ctxpopup.eo |   2 +-
 src/lib/elementary/elm_ctxpopup_item.eo|   3 +-
 src/lib/elementary/elm_datetime.c  |  22 +-
 src/lib/elementary/elm_dayselector.eo  |   2 +-
 src/lib/elementary/elm_diskselector.eo |   2 +-
 src/lib/elementary/elm_diskselector_item.eo|   2 +-
 src/lib/elementary/elm_entry.eo|   3 +-
 src/lib/elementary/elm_fileselector.eo |   2 +-
 src/lib/element

[EGIT] [core/efl] master 03/03: elm_tooltip: set theme group to NULL

2018-01-16 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=959571b9955babc40367cf3a634dddba7a7cdcc2

commit 959571b9955babc40367cf3a634dddba7a7cdcc2
Author: Sungtaek Hong 
Date:   Wed Jan 17 13:39:52 2018 +0900

elm_tooltip: set theme group to NULL

Summary:
Even though elm_tooltip does not support EO API, for now,
Efl.Ui.Widget will support elm_tooltip-like feature.
This change group name compatible with new group name policy.

Reviewers: jpeg, woohyun, herdsman, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5739
---
 src/lib/elementary/els_tooltip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/elementary/els_tooltip.c b/src/lib/elementary/els_tooltip.c
index fa777ca50b..e4e53523ba 100644
--- a/src/lib/elementary/els_tooltip.c
+++ b/src/lib/elementary/els_tooltip.c
@@ -437,7 +437,7 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
 const char *style = tt->style ? tt->style : "default";
 const char *str;
 if (!_elm_theme_object_set(tt->tt_win ? NULL : tt->owner, tt->tooltip,
-  "tooltip", "base", style))
+  "tooltip", NULL, style))
   {
  ERR("Could not apply the theme to the tooltip! style=%s", style);
  if (tt->tt_win) evas_object_del(tt->tt_win);

-- 




[EGIT] [core/efl] master 02/03: elm_datetime: use legacy elm_button

2018-01-16 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fe346d2ee23eb0d9fca0544f6732c709ec3a4b8b

commit fe346d2ee23eb0d9fca0544f6732c709ec3a4b8b
Author: Sungtaek Hong 
Date:   Wed Jan 17 13:39:33 2018 +0900

elm_datetime: use legacy elm_button

Summary:
elm_datetime and Efl.Ui.Clock uses same module: clock_input_ctxpopup.
The module creates internal field object.
Use legay button for field object until Efl.Clock and datetime module
policy is fixed.

Reviewers: jpeg, CHAN, woohyun

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5725
---
 src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c 
b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c
index d40e82be0b..73b73e87e2 100644
--- a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c
+++ b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c
@@ -314,10 +314,7 @@ field_create(Efl_Ui_Clock_Module_Data *module_data, 
Efl_Ui_Clock_Type  field_typ
 
if (field_type == EFL_UI_CLOCK_TYPE_AMPM)
  {
-field_obj = efl_add(EFL_UI_BUTTON_CLASS, ctx_mod->mod_data.base,
-elm_widget_element_update(ctx_mod->mod_data.base,
-efl_added,
-
PART_NAME_ARRAY[field_type]));
+field_obj = elm_button_add(ctx_mod->mod_data.base);
 efl_event_callback_add
(field_obj, EFL_UI_EVENT_CLICKED, _ampm_clicked_cb, ctx_mod);
  }

-- 




[EGIT] [core/efl] master 02/03: efl_ui_bg_widget: replace internal image to efl_ui_image

2017-12-18 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=81ba035f6935128b2c025c88de05cf2b8f2c0ead

commit 81ba035f6935128b2c025c88de05cf2b8f2c0ead
Author: Sungtaek Hong 
Date:   Tue Dec 12 20:05:55 2017 +0900

efl_ui_bg_widget: replace internal image to efl_ui_image
---
 src/lib/elementary/efl_ui_bg_widget.c | 277 --
 src/lib/elementary/efl_ui_bg_widget.eo|   5 +-
 src/lib/elementary/efl_ui_bg_widget_private.h |   7 -
 3 files changed, 90 insertions(+), 199 deletions(-)

diff --git a/src/lib/elementary/efl_ui_bg_widget.c 
b/src/lib/elementary/efl_ui_bg_widget.c
index d1e1c73044..5c39790706 100644
--- a/src/lib/elementary/efl_ui_bg_widget.c
+++ b/src/lib/elementary/efl_ui_bg_widget.c
@@ -21,78 +21,6 @@ static const Elm_Layout_Part_Alias_Description 
_content_aliases[] =
{NULL, NULL}
 };
 
-EOLIAN static void
-_efl_ui_bg_widget_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Bg_Widget_Data *sd)
-{
-   Evas_Coord iw = 0, ih = 0, mw = -1, mh = -1;
-   Evas_Coord bx = 0, by = 0, bw = 0, bh = 0;
-   Evas_Coord fx = 0, fy = 0, fw = 0, fh = 0;
-   const char *p;
-
-   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
-   if ((!sd->img) || (!sd->file)) return;
-   if (((p = strrchr(sd->file, '.'))) && (!strcasecmp(p, ".edj"))) return;
-
-   /* grab image size */
-   evas_object_image_size_get(sd->img, &iw, &ih);
-   if ((iw < 1) || (ih < 1)) return;
-
-   /* grab base object dimensions */
-   evas_object_geometry_get
- (wd->resize_obj, &bx, &by, &bw, &bh);
-
-   switch (sd->scale_type)
- {
-   case EFL_IMAGE_SCALE_TYPE_NONE:
- fw = mw = iw;
- fh = mh = ih;
- break;
-   case EFL_IMAGE_SCALE_TYPE_FILL:
- fw = bw;
- fh = bh;
- break;
-   case EFL_IMAGE_SCALE_TYPE_FIT_INSIDE:
- mw = fw = bw;
- mh = fh = ((ih * fw) / iw);
- if (fh > bh)
-   {
-  mh = fh = bh;
-  mw = fw = ((iw * fh) / ih);
-   }
- break;
-   case EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE:
- fw = bw;
- fh = ((ih * fw) / iw);
- if (fh < bh)
-   {
-  fh = bh;
-  fw = ((iw * fh) / ih);
-   }
- fx = ((bw - fw) / 2);
- fy = ((bh - fh) / 2);
- break;
-   case EFL_IMAGE_SCALE_TYPE_TILE:
- fw = iw;
- fh = ih;
- break;
- }
-
-   evas_object_image_fill_set(sd->img, fx, fy, fw, fh);
-
-   evas_object_size_hint_min_set(sd->img, mw, mh);
-   evas_object_size_hint_max_set(sd->img, mw, mh);
-}
-
-static void
-_on_resize(void *data,
-   Evas *e EINA_UNUSED,
-   Evas_Object *obj EINA_UNUSED,
-   void *event_info EINA_UNUSED)
-{
-   elm_layout_sizing_eval(data);
-}
-
 EAPI Evas_Object *
 elm_bg_add(Evas_Object *parent)
 {
@@ -111,7 +39,6 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, 
Efl_Ui_Bg_Widget_Data *pd)
obj = efl_constructor(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
-   evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _on_resize, obj);
 
if (!elm_widget_theme_object_set(obj, wd->resize_obj,
elm_widget_theme_klass_get(obj),
@@ -119,11 +46,14 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, 
Efl_Ui_Bg_Widget_Data *pd)
elm_widget_theme_style_get(obj)))
  CRI("Failed to set layout!");
 
-   pd->scale_type = EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE;
pd->rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj,
   efl_gfx_color_set(efl_added, 0, 0, 0, 0),
   efl_content_set(efl_part(obj, "elm.swallow.rectangle"), 
efl_added));
 
+   pd->img = efl_add(EFL_UI_IMAGE_CLASS, obj,
+ efl_image_scale_type_set(efl_added, 
EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
+ efl_content_set(efl_part(obj, "elm.swallow.background"), 
efl_added));
+
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
efl_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED);
 
@@ -132,134 +62,72 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, 
Efl_Ui_Bg_Widget_Data *pd)
return obj;
 }
 
-EOLIAN static Eina_Bool
-_efl_ui_bg_widget_efl_file_file_set(Eo *obj, Efl_Ui_Bg_Widget_Data *sd, const 
char *file, const char *group)
+EAPI void
+elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option)
 {
-   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
-
-   const char *p;
-   Eina_Bool int_ret;
+   Efl_Image_Scale_Type type;
 
-   ELM_SAFE_FREE(sd->img, evas_object_del);
-   if (!file)
- {
-ELM_SAFE_FREE(sd->file, eina_stringshare_del);
-ELM_SAFE_FREE(sd->group, eina_stringshare_del);
-return EINA_TRUE;
- }
-   eina_stringshare_replace(&sd

[EGIT] [core/efl] master 01/03: efl_ui_bg: add Efl.Ui.Bg interface

2017-12-18 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=25136ddf8ccbf384b21d89a7ce3939c1d4db00a6

commit 25136ddf8ccbf384b21d89a7ce3939c1d4db00a6
Author: Sungtaek Hong 
Date:   Mon Dec 18 13:55:25 2017 +0900

efl_ui_bg: add Efl.Ui.Bg interface

Summary:
- Previous class efl_ui_bg moved to efl_ui_bg_widget.
- Scale_type moved to efl_image from efl_ui_image.
- Previous enum Efl_Ui_Image_Scale_Type moved to Efl_Image_Scale_Type.

Test Plan:
Run elementary_test
1.Image Scale Type
2.Efl.Ui.Bg
3.Efl.Ui.Win
4.Part Background

Reviewers: jpeg, woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D5616
---
 src/Makefile_Elementary.am |   5 +-
 src/bin/elementary/test_bg.c   |  20 +-
 src/bin/elementary/test_efl_gfx_map.c  |   2 +-
 src/bin/elementary/test_evas_map.c |   2 +-
 src/bin/elementary/test_image.c|  16 +-
 src/bin/elementary/test_part_bg.c  |   8 +-
 src/examples/elementary/bg_cxx_example_02.cc   |   2 +-
 src/examples/elementary/icon_cxx_example_01.cc |   2 +-
 src/lib/efl/interfaces/efl_image.eo|  28 ++
 src/lib/elementary/Efl_Ui.h|   3 +-
 src/lib/elementary/Elementary.h|   2 +
 src/lib/elementary/efl_ui_bg.c | 358 -
 src/lib/elementary/efl_ui_bg.eo|  11 +-
 src/lib/elementary/efl_ui_bg_eo.h  |   1 -
 .../elementary/{efl_ui_bg.c => efl_ui_bg_widget.c} | 131 
 .../{efl_ui_bg.eo => efl_ui_bg_widget.eo}  |   6 +-
 ..._ui_bg_private.h => efl_ui_bg_widget_private.h} |  22 +-
 src/lib/elementary/efl_ui_image.c  |  30 +-
 src/lib/elementary/efl_ui_image.eo |  34 +-
 src/lib/elementary/efl_ui_widget_image.h   |   2 +-
 src/lib/elementary/efl_ui_widget_part_bg.eo|   2 +-
 src/lib/elementary/efl_ui_win.c|   4 +-
 src/lib/elementary/elm_bg.h|   3 -
 src/lib/elementary/elm_bg_legacy.h |   2 +-
 src/lib/elementary/elm_widget.c|  12 +-
 25 files changed, 159 insertions(+), 549 deletions(-)

diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 6e4b3bee82..5a1aaa379c 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -4,6 +4,7 @@
 elm_public_eolian_files = \
lib/elementary/elm_widget.eo \
lib/elementary/efl_ui_bg.eo \
+   lib/elementary/efl_ui_bg_widget.eo \
lib/elementary/efl_ui_button.eo \
lib/elementary/efl_ui_calendar.eo \
lib/elementary/efl_ui_calendar_item.eo \
@@ -275,7 +276,7 @@ includesunstable_HEADERS = \
lib/elementary/elm_widget_box.h \
lib/elementary/elm_widget_bubble.h \
lib/elementary/efl_ui_button_private.h \
-   lib/elementary/efl_ui_bg_private.h \
+   lib/elementary/efl_ui_bg_widget_private.h \
lib/elementary/elm_widget_calendar.h \
lib/elementary/efl_ui_calendar_private.h \
lib/elementary/efl_ui_check_private.h \
@@ -394,7 +395,6 @@ includesub_HEADERS = \
lib/elementary/elm_atspi_app_object.h \
lib/elementary/elm_authors.h \
lib/elementary/elm_bg.h \
-   lib/elementary/efl_ui_bg_eo.h \
lib/elementary/elm_bg_legacy.h \
lib/elementary/elm_box.h \
lib/elementary/elm_box_legacy.h \
@@ -598,6 +598,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_atspi_app_object.c \
lib/elementary/elm_atspi_bridge.c \
lib/elementary/efl_ui_bg.c \
+   lib/elementary/efl_ui_bg_widget.c \
lib/elementary/elm_box.c \
lib/elementary/elm_bubble.c \
lib/elementary/efl_ui_button.c \
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index 7ec6fe615a..a0e2399dff 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -317,7 +317,7 @@ _image_cb(void *data, const Efl_Event *ev)
  {
 efl_file_get(ev->object, &f, &k);
 o = efl_add(EFL_UI_IMAGE_CLASS, win,
-efl_ui_image_scale_type_set(efl_added, 
EFL_UI_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
+efl_image_scale_type_set(efl_added, 
EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
 efl_file_set(efl_added, f, k)
 );
 efl_content_set(efl_part(win, "background"), o);
@@ -375,7 +375,7 @@ _cb_radio_changed_scale_type(void *data, const Efl_Event 
*ev)
 {
Evas_Object *o_bg = data;
 
-   efl_ui_image_scale_type_set(o_bg, efl_ui_nstate_value_get(ev->object));
+   efl_image_scale_type_set(o_bg, efl_ui_nstate_value_get(ev->object));
 }
 
 static void
@@ -407,7 +407,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e

[EGIT] [core/efl] master 03/03: efl_ui_image: apply load_size when API is called

2017-12-18 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a2309c5083a643011b4e69347d6be4da3a0adee8

commit a2309c5083a643011b4e69347d6be4da3a0adee8
Author: Sungtaek Hong 
Date:   Mon Dec 18 17:33:49 2017 +0900

efl_ui_image: apply load_size when API is called

Summary:
when  efl_image_load_size_set() is called, image only sets
internal variable and not apply to the internal image.
elm_image_prescale_set() is also affected.

Test Plan: Run elementary_test->Image Prescale

Reviewers: jpeg, eunue, woohyun

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5645
---
 src/bin/elementary/test.c|  2 +
 src/bin/elementary/test_image.c  | 75 
 src/lib/elementary/efl_ui_image.c| 35 +++
 src/lib/elementary/efl_ui_widget_image.h |  2 +-
 4 files changed, 96 insertions(+), 18 deletions(-)

diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 114cd7927a..7484a2545d 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -285,6 +285,7 @@ void test_dayselector(void *data, Evas_Object *obj, void 
*event_info);
 void test_image(void *data, Evas_Object *obj, void *event_info);
 void test_image_scale_type(void *data, Evas_Object *obj, void *event_info);
 void test_image_swallow_align(void *data, Evas_Object *obj, void *event_info);
+void test_image_prescale(void *data, Evas_Object *obj, void *event_info);
 void test_remote_image(void *data, Evas_Object *obj, void *event_info);
 void test_click_image(void *data, Evas_Object *obj, void *event_info);
 void test_load_image(void *data, Evas_Object *obj, void *event_info);
@@ -773,6 +774,7 @@ add_tests:
ADD_TEST(NULL, "Images", "Image Remote", test_remote_image);
ADD_TEST(NULL, "Images", "Image Click", test_click_image);
ADD_TEST(NULL, "Images", "Image Async Load", test_load_image);
+   ADD_TEST(NULL, "Images", "Image Prescale", test_image_prescale);
ADD_TEST(NULL, "Images", "Slideshow", test_slideshow);
ADD_TEST(NULL, "Images", "Video", test_video);
 
diff --git a/src/bin/elementary/test_image.c b/src/bin/elementary/test_image.c
index 08232dff20..0dbdbef0b0 100644
--- a/src/bin/elementary/test_image.c
+++ b/src/bin/elementary/test_image.c
@@ -658,3 +658,78 @@ test_load_image(void *data EINA_UNUSED, Evas_Object *obj  
EINA_UNUSED, void *eve
evas_object_resize(win, 320, 480);
evas_object_show(win);
 }
+
+static void
+_cb_prescale_radio_changed(void *data, Evas_Object *obj, void *event 
EINA_UNUSED)
+{
+   Evas_Object *o_bg = data;
+   int size;
+   size = elm_radio_value_get((Evas_Object *)obj);
+   elm_image_prescale_set(o_bg, size);
+}
+
+void
+test_image_prescale(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
+{
+   Evas_Object *win, *im;
+   Evas_Object *box, *hbox;
+   Evas_Object *rd, *rdg;
+   char buf[PATH_MAX];
+
+
+   win = elm_win_util_standard_add("image-prescale", "Image Prescale Test");
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   im = elm_image_add(win);
+   snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", 
elm_app_data_dir_get());
+   elm_image_file_set(im, buf, NULL);
+   evas_object_size_hint_weight_set(im, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(im, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, im);
+   evas_object_show(im);
+
+   hbox = elm_box_add(win);
+   elm_box_horizontal_set(hbox, EINA_TRUE);
+   evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, 50);
+   elm_object_text_set(rd, "50");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _cb_prescale_radio_changed, 
im);
+   elm_box_pack_end(hbox, rd);
+   evas_object_show(rd);
+   rdg = rd;
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, 100);
+   elm_radio_group_add(rd, rdg);
+   elm_object_text_set(rd, "100");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _cb_prescale_radio_changed, 
im);
+   elm_box_pack_end(hbox, rd);
+   evas_object_show(rd);
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, 200);
+   elm_radio_group_add(rd, rdg);
+   elm_object_text_set(rd, "200");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ 

[EGIT] [core/efl] master 01/01: efl_ui_popup_scroll: remove build warnings

2017-12-11 Thread Sungtaek Hong
jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cd1a466fd76c3382c2f9e206b78a05b694abd50d

commit cd1a466fd76c3382c2f9e206b78a05b694abd50d
Author: Sungtaek Hong 
Date:   Mon Dec 11 17:10:06 2017 +0900

efl_ui_popup_scroll: remove build warnings

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5640
---
 src/lib/elementary/efl_ui_popup_alert_scroll.c | 4 
 src/lib/elementary/efl_ui_popup_alert_text.c   | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.c 
b/src/lib/elementary/efl_ui_popup_alert_scroll.c
index c7c5194b9e..9adcf961c3 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.c
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.c
@@ -14,8 +14,6 @@
 #define MY_CLASS EFL_UI_POPUP_ALERT_SCROLL_CLASS
 #define MY_CLASS_NAME "Efl.Ui.Popup_Alert_Scroll"
 
-static const char PART_NAME_SCROLLER[] = "scroller";
-
 static void
 _scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd,
   Eina_Size2D exp_scr_min, Eina_Size2D min)
@@ -273,10 +271,8 @@ _efl_ui_popup_alert_scroll_efl_object_constructor(Eo *obj,
 
elm_widget_sub_object_parent_add(obj);
 
-   // TODO: Change internal component to Efl.Ui.Widget
pd->scroller = elm_scroller_add(obj);
elm_object_style_set(pd->scroller, "popup/no_inset_shadow");
-   //elm_widget_element_update(obj, pd->scroller, PART_NAME_SCROLLER);
elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_AUTO,
ELM_SCROLLER_POLICY_AUTO);
 
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.c 
b/src/lib/elementary/efl_ui_popup_alert_text.c
index b8d50a3282..ddada43e99 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.c
+++ b/src/lib/elementary/efl_ui_popup_alert_text.c
@@ -12,7 +12,6 @@
 #define MY_CLASS EFL_UI_POPUP_ALERT_TEXT_CLASS
 #define MY_CLASS_NAME "Efl.Ui.Popup_Alert_Text"
 
-static const char PART_NAME_SCROLLER[] = "scroller";
 static const char PART_NAME_TEXT[] = "text";
 
 EOLIAN static void
@@ -109,10 +108,8 @@ _efl_ui_popup_alert_text_efl_object_constructor(Eo *obj,
 
elm_widget_sub_object_parent_add(obj);
 
-   // TODO: Change internal component to Efl.Ui.Widget
pd->scroller = elm_scroller_add(obj);
elm_object_style_set(pd->scroller, "popup/no_inset_shadow");
-   //elm_widget_element_update(obj, pd->scroller, PART_NAME_SCROLLER);
elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_OFF,
ELM_SCROLLER_POLICY_AUTO);
 

-- 




[EGIT] [core/efl] feature/eo_theme 01/01: efl_ui_popup_alert: refactor popup_alert_part

2017-12-04 Thread Sungtaek Hong
jaehyun pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=300961c84b656df2cf4e429f701e6664a8a9342b

commit 300961c84b656df2cf4e429f701e6664a8a9342b
Author: Sungtaek Hong 
Date:   Tue Dec 5 10:41:20 2017 +0900

efl_ui_popup_alert: refactor popup_alert_part

Summary: remove redundant logic for button part.

Test Plan: Run elementary_test->Efl.Ui.Popup_alert

Reviewers: jpeg, Jaehyun_Cho, woohyun

Reviewed By: Jaehyun_Cho

Subscribers: cedric, Blackmole, herb

Differential Revision: https://phab.enlightenment.org/D5577
---
 src/lib/elementary/efl_ui_popup_alert.c | 191 
 1 file changed, 72 insertions(+), 119 deletions(-)

diff --git a/src/lib/elementary/efl_ui_popup_alert.c 
b/src/lib/elementary/efl_ui_popup_alert.c
index 4fb26326d8..e242a312e3 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -18,6 +18,11 @@ static const char 
PART_NAME_BUTTON_LAYOUT[EFL_UI_POPUP_ALERT_BUTTON_COUNT][15] =
  "button_layout2",
  "button_layout3"};
 
+static const char BUTTON_SWALLOW_NAME[EFL_UI_POPUP_ALERT_BUTTON_COUNT][20] =
+{"elm.swallow.button1",
+ "elm.swallow.button2",
+ "elm.swallow.button3"};
+
 EOLIAN static void
 _efl_ui_popup_alert_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Data 
*pd EINA_UNUSED)
 {
@@ -37,19 +42,19 @@ _efl_ui_popup_alert_text_set(Eo *obj, 
Efl_Ui_Popup_Alert_Data *pd, const char *p
 {
if (eina_streq(part, "title") || eina_streq(part, "elm.text.title"))
  {
-if (pd->title_text)
+Eina_Bool changed = eina_stringshare_replace(&pd->title_text, label);
+if (changed)
   {
- eina_stringshare_del(pd->title_text);
- pd->title_text = NULL;
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), "title"), label);
+ if (label)
+   elm_layout_signal_emit(obj, "elm,title,show", "elm");
+ else
+   elm_layout_signal_emit(obj, "elm,title,hide", "elm");
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+ edje_object_message_signal_process(wd->resize_obj);
+ elm_layout_sizing_eval(obj);
   }
-
-pd->title_text = eina_stringshare_add(label);
-efl_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text.title"), 
label);
-elm_layout_signal_emit(obj, "elm,title,show", "elm");
-
-ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
-edje_object_message_signal_process(wd->resize_obj);
-elm_layout_sizing_eval(obj);
  }
else
  efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
@@ -72,8 +77,7 @@ _efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, 
Efl_Ui_Popup_Alert_Data *pd, c
 }
 
 static void
-_positive_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
-void *event_info EINA_UNUSED)
+_positive_button_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
 {
Eo *popup_obj = data;
 
@@ -84,8 +88,7 @@ _positive_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
 }
 
 static void
-_negative_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
-void *event_info EINA_UNUSED)
+_negative_button_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
 {
Eo *popup_obj = data;
 
@@ -96,8 +99,7 @@ _negative_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
 }
 
 static void
-_user_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
-void *event_info EINA_UNUSED)
+_user_button_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
 {
Eo *popup_obj = data;
 
@@ -110,117 +112,73 @@ _user_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
 EOLIAN static void
 _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, 
Efl_Ui_Popup_Alert_Button type, const char *text)
 {
-   if (pd->button[type])
- {
-efl_del(pd->button[type]);
-pd->button[type] = NULL;
- }
-   pd->button[type] = efl_add(EFL_UI_BUTTON_CLASS, obj,
-  elm_widget_element_update(obj, efl_added, 
PART_NAME_BUTTON),
-  efl_text_set(efl_added, text));
+   int i;
+   Eo *cur_content;
 
-   switch (type)
+   if ((type < EFL_UI_POPUP_ALERT_BUTTON_POSITIVE) || (type > 
EFL_UI_POPUP_ALERT_BUTTON_USER))
  {
-  case EFL_UI_POPUP_ALERT_BUTTON_POSITIVE:
- evas_object_smart_callback_add(pd->button[type], "clicked",
-   

[EGIT] [core/efl] feature/eo_theme 01/01: elm: introduce ELM_PART_OVERRIDE_PARTIAL

2017-12-03 Thread Sungtaek Hong
jaehyun pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=7c9b2f55134f4a2f2c399a5b0f9387cd329354cd

commit 7c9b2f55134f4a2f2c399a5b0f9387cd329354cd
Author: Sungtaek Hong 
Date:   Mon Dec 4 16:01:51 2017 +0900

elm: introduce ELM_PART_OVERRIDE_PARTIAL

Summary:
ELM_PART_OVERRIDE_PARTIAL replaces ELM_PART_OVERRIDE and
ELM_PART_OVERRIDE_ONLY_ALIASES.
The difference is ELM_PART_OVERRIDE_PARTIAL calls super
ELM_PART_IMPLEMENT when subclass of part is not needed.

Test Plan:
Run elementary_test, Part Background, background part is well set.
   Run efl.ui.panes/efl.ui.flip, check content is well set.

Reviewers: jpeg, Jaehyun_Cho, woohyun

Reviewed By: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5566
---
 data/elementary/themes/edc/efl/panes.edc |  8 
 data/elementary/themes/edc/efl/popup.edc |  5 +++--
 src/lib/elementary/efl_ui_button.c   |  8 +++-
 src/lib/elementary/efl_ui_flip.c |  8 +++-
 src/lib/elementary/efl_ui_multibuttonentry.c | 18 --
 src/lib/elementary/efl_ui_panes.c| 15 ++-
 src/lib/elementary/efl_ui_popup_alert.c  | 16 
 src/lib/elementary/elm_part_helper.h | 24 +---
 8 files changed, 60 insertions(+), 42 deletions(-)

diff --git a/data/elementary/themes/edc/efl/panes.edc 
b/data/elementary/themes/edc/efl/panes.edc
index 38f178c99c..46a1c07d1c 100644
--- a/data/elementary/themes/edc/efl/panes.edc
+++ b/data/elementary/themes/edc/efl/panes.edc
@@ -13,10 +13,18 @@
 
 group { "efl/panes/vertical";
inherit: "elm/panes/vertical/default";
+   parts {
+  alias: "first" "elm.swallow.left";
+  alias: "second" "elm.swallow.right";
+   }
 }
 
 group { "efl/panes/horizontal";
inherit: "elm/panes/horizontal/default";
+   parts {
+  alias: "first" "elm.swallow.left";
+  alias: "second" "elm.swallow.right";
+   }
 }
 
 group { "efl/panes/vertical:flush";
diff --git a/data/elementary/themes/edc/efl/popup.edc 
b/data/elementary/themes/edc/efl/popup.edc
index 407a28b5dd..491d483b42 100644
--- a/data/elementary/themes/edc/efl/popup.edc
+++ b/data/elementary/themes/edc/efl/popup.edc
@@ -28,12 +28,13 @@ group { "efl/popup_alert";
alias: "efl/popup_alert_text";
images.image: "rounded_square.png" COMP;
parts {
+  alias: "title" "elm.text.title";
   image { "bg";
  desc { "default";
 min: 100 100;
 image.border: 15 15 15 15;
 image.normal: "rounded_square.png";
-  }
+  }
   }
   spacer { "base";
  desc { "default";
@@ -256,4 +257,4 @@ group { "efl/popup_alert_scroll/scroller";
 
 group { "efl/popup_alert_text/text";
inherit: "efl/text";
-}
\ No newline at end of file
+}
diff --git a/src/lib/elementary/efl_ui_button.c 
b/src/lib/elementary/efl_ui_button.c
index 2f194ea52a..500851fb84 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -420,7 +420,13 @@ ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_button, 
Efl_Ui_Button_Data)
 
 /* Efl.Part begin */
 
-ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_button, EFL_UI_BUTTON, 
Efl_Ui_Button_Data, _content_aliases)
+static Eina_Bool
+_part_is_efl_ui_button_part(const Eo *obj EINA_UNUSED, const char *part)
+{
+   return eina_streq(part, "elm.swallow.content");
+}
+
+ELM_PART_OVERRIDE_PARTIAL(efl_ui_button, EFL_UI_BUTTON, Efl_Ui_Button_Data, 
_part_is_efl_ui_button_part)
 ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_button, EFL_UI_BUTTON, Efl_Ui_Button_Data)
 #include "efl_ui_button_part.eo.c"
 
diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c
index c001567b5d..e7381d69e6 100644
--- a/src/lib/elementary/efl_ui_flip.c
+++ b/src/lib/elementary/efl_ui_flip.c
@@ -2349,7 +2349,13 @@ elm_flip_interaction_direction_enabled_get(Efl_Ui_Flip 
*obj, Elm_Flip_Direction
 
 /* Efl.Part begin */
 
-ELM_PART_OVERRIDE(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data)
+static Eina_Bool
+_part_is_efl_ui_flip_entry_part(const Eo *obj EINA_UNUSED, const char *part)
+{
+   return ((eina_streq(part, "front")) || (eina_streq(part, "back")));
+}
+
+ELM_PART_OVERRIDE_PARTIAL(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data, 
_part_is_efl_ui_flip_entry_part)
 ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data)
 ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data)
 ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data)
diff --git a/src/lib/elementary/efl_ui_mult

[EGIT] [core/efl] feature/eo_theme 01/01: efl_ui_popup: remove unnecessary overides

2017-11-30 Thread Sungtaek Hong
jaehyun pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=8e2639fdd693176b7a7c95166c9aecede3a92024

commit 8e2639fdd693176b7a7c95166c9aecede3a92024
Author: Sungtaek Hong 
Date:   Thu Nov 30 18:15:11 2017 +0900

efl_ui_popup: remove unnecessary overides

Summary:
efl_ui_popup parts overrides efl_content and efl_text
 which are sometimes not needed.

Test Plan: Run elementary_test -> efl_ui_popup tests

Reviewers: jpeg, cedric, woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: Jaehyun_Cho, Blackmole, herb

Differential Revision: https://phab.enlightenment.org/D5556
---
 src/lib/elementary/efl_ui_popup.c | 24 -
 src/lib/elementary/efl_ui_popup_alert.c   | 37 ---
 src/lib/elementary/efl_ui_popup_alert_part.eo |  4 +--
 src/lib/elementary/efl_ui_popup_part.eo   |  4 +--
 4 files changed, 13 insertions(+), 56 deletions(-)

diff --git a/src/lib/elementary/efl_ui_popup.c 
b/src/lib/elementary/efl_ui_popup.c
index 285ae39935..ab9ce2cce8 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -241,35 +241,11 @@ _efl_ui_popup_elm_layout_sizing_eval(Eo *obj, 
Efl_Ui_Popup_Data *pd EINA_UNUSED)
_calc_align(obj);
 }
 
-static Eina_Bool
-_efl_ui_popup_content_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, const 
char *part, Eo *content)
-{
-   return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
-}
-
-Eo *
-_efl_ui_popup_content_get(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, const 
char *part)
-{
-   return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
-}
-
-static Eo *
-_efl_ui_popup_content_unset(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, const 
char *part)
-{
-   return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
-}
-
 /* Standard widget overrides */
 
 ELM_PART_CONTENT_DEFAULT_SET(efl_ui_popup, "elm.swallow.content")
 ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_popup, Efl_Ui_Popup_Data)
 
-/* Efl.Part begin */
-
-ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_popup, EFL_UI_POPUP, Efl_Ui_Popup_Data)
-ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_popup, EFL_UI_POPUP, Efl_Ui_Popup_Data)
-ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_popup, EFL_UI_POPUP, Efl_Ui_Popup_Data)
-
 EOLIAN static Eo *
 _efl_ui_popup_efl_part_part(const Eo *obj, Efl_Ui_Popup_Data *_pd EINA_UNUSED, 
const char *part)
 {
diff --git a/src/lib/elementary/efl_ui_popup_alert.c 
b/src/lib/elementary/efl_ui_popup_alert.c
index 9a23d23f49..0249977dea 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -12,6 +12,13 @@
 #define MY_CLASS EFL_UI_POPUP_ALERT_CLASS
 #define MY_CLASS_NAME "Efl.Ui.Popup.Alert"
 
+static const Elm_Layout_Part_Alias_Description _text_aliases[] =
+{
+   {"title", "title"},
+   {"elm.text.title", "elm.text.title"},
+   {NULL, NULL}
+};
+
 static const char PART_NAME_BUTTON[] = "button";
 static const char PART_NAME_BUTTON_LAYOUT[EFL_UI_POPUP_ALERT_BUTTON_COUNT][15] 
=
 {"button_layout1",
@@ -35,7 +42,7 @@ _efl_ui_popup_alert_elm_layout_sizing_eval(Eo *obj, 
Efl_Ui_Popup_Alert_Data *pd
 static Eina_Bool
 _efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, const char 
*part, const char *label)
 {
-   if (part && !strcmp(part, "title"))
+   if (eina_streq(part, "title") || eina_streq(part, "elm.text.title"))
  {
 if (pd->title_text)
   {
@@ -44,7 +51,7 @@ _efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data 
*pd, const char *p
   }
 
 pd->title_text = eina_stringshare_add(label);
-elm_object_part_text_set(obj, "elm.text.title", label);
+efl_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text.title"), 
label);
 elm_layout_signal_emit(obj, "elm,title,show", "elm");
 
 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -60,7 +67,7 @@ _efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data 
*pd, const char *p
 const char *
 _efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Data *pd, 
const char *part)
 {
-   if (part && !strcmp(part, "title"))
+   if (eina_streq(part, "title") || eina_streq(part, "elm.text.title"))
  {
 if (pd->title_text)
   return pd->title_text;
@@ -71,24 +78,6 @@ _efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, 
Efl_Ui_Popup_Alert_Data *pd, c
return efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
 }
 
-static Eina_Bool
-_efl_ui_popup_alert_content_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd 
EINA_UNUSED, const char *part, Eo *content)
-{
-   return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), 

[EGIT] [core/efl] feature/eo_theme 01/01: efl_ui_popup: apply new theme logic for alert_scroll, alert_text

2017-11-29 Thread Sungtaek Hong
taxi2se pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=4f5cc3682c1e7c54b58e85d286718d64f734ce54

commit 4f5cc3682c1e7c54b58e85d286718d64f734ce54
Author: Sungtaek Hong 
Date:   Wed Nov 29 21:54:24 2017 +0900

efl_ui_popup: apply new theme logic for alert_scroll, alert_text
---
 data/elementary/themes/edc/efl/popup.edc   | 37 --
 src/lib/elementary/efl_ui_popup_alert.c|  2 +-
 src/lib/elementary/efl_ui_popup_alert_scroll.c |  6 +
 src/lib/elementary/efl_ui_popup_alert_text.c   |  9 +++
 src/lib/elementary/efl_ui_popup_anchor.c   |  2 +-
 5 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/data/elementary/themes/edc/efl/popup.edc 
b/data/elementary/themes/edc/efl/popup.edc
index f617b30bfd..407a28b5dd 100644
--- a/data/elementary/themes/edc/efl/popup.edc
+++ b/data/elementary/themes/edc/efl/popup.edc
@@ -23,7 +23,9 @@ group { "efl/popup";
}
 }
 
-group { "efl/popup.alert";
+group { "efl/popup_alert";
+   alias: "efl/popup_alert_scroll";
+   alias: "efl/popup_alert_text";
images.image: "rounded_square.png" COMP;
parts {
   image { "bg";
@@ -108,13 +110,15 @@ group { "efl/popup.alert";
}
 }
 
-group { "efl/popup.anchor";
+group { "efl/popup_anchor";
inherit: "efl/popup";
 }
 
 group { "efl/popup/backwall";
-   alias: "efl/popup.alert/backwall";
-   alias: "efl/popup.anchor/backwall";
+   alias: "efl/popup_alert/backwall";
+   alias: "efl/popup_alert_scroll/backwall";
+   alias: "efl/popup_alert_text/backwall";
+   alias: "efl/popup_anchor/backwall";
parts {
   rect { "base";
  desc { "default";
@@ -163,14 +167,18 @@ group { "efl/popup/backwall";
}
 }
 
-group { "efl/popup.alert/button_layout1";
+group { "efl/popup_alert/button_layout1";
+   alias: "efl/popup_alert_scroll/button_layout1";
+   alias: "efl/popup_alert_text/button_layout1";
parts {
   swallow { "elm.swallow.button1";
   }
}
 }
 
-group { "efl/popup.alert/button_layout2";
+group { "efl/popup_alert/button_layout2";
+   alias: "efl/popup_alert_scroll/button_layout2";
+   alias: "efl/popup_alert_text/button_layout2";
parts {
   spacer { "div1";
  desc { "default";
@@ -194,7 +202,9 @@ group { "efl/popup.alert/button_layout2";
}
 }
 
-group { "efl/popup.alert/button_layout3";
+group { "efl/popup_alert/button_layout3";
+   alias: "efl/popup_alert_scroll/button_layout3";
+   alias: "efl/popup_alert_text/button_layout3";
parts {
   spacer { "div1";
  desc { "default";
@@ -233,6 +243,17 @@ group { "efl/popup.alert/button_layout3";
}
 }
 
-group { "efl/popup.alert/button";
+group { "efl/popup_alert/button";
inherit: "efl/button";
+   alias: "efl/popup_alert_scroll/button";
+   alias: "efl/popup_alert_text/button";
+}
+
+group { "efl/popup_alert_scroll/scroller";
+   inherit: "elm/scroller/base/popup/no_inset_shadow";
+   alias: "efl/popup_alert_text/scroller";
+}
+
+group { "efl/popup_alert_text/text";
+   inherit: "efl/text";
 }
\ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_popup_alert.c 
b/src/lib/elementary/efl_ui_popup_alert.c
index 39f7592f13..9a23d23f49 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -252,7 +252,7 @@ _efl_ui_popup_alert_efl_object_constructor(Eo *obj,
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
 
if (!elm_widget_theme_klass_get(obj))
- elm_widget_theme_klass_set(obj, "popup.alert");
+ elm_widget_theme_klass_set(obj, "popup_alert");
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
 
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.c 
b/src/lib/elementary/efl_ui_popup_alert_scroll.c
index ed790db052..93b703a51a 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.c
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.c
@@ -12,6 +12,8 @@
 #define MY_CLASS EFL_UI_POPUP_ALERT_SCROLL_CLASS
 #define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Scroll"
 
+static const char PART_NAME_SCROLLER[] = "scroller";
+
 EOLIAN static void
 _efl_ui_popup_alert_scroll_elm_layout_sizing_eval(Eo *obj, 
Efl_Ui_Popup_Alert_Scroll_Data *pd EINA_UNUSED)
 {
@@ -95,13 +97,17 @@ _efl_ui_popup_alert_scroll_efl_object_constructor(Eo *obj,
 {
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
 
+   if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj,

[EGIT] [core/efl] feature/eo_theme 01/01: efl_ui_popup: apply new theme logic for efl_ui_popup

2017-11-29 Thread Sungtaek Hong
taxi2se pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=a2a082ab2715436ae8cebcf810f1c07b512d6352

commit a2a082ab2715436ae8cebcf810f1c07b512d6352
Author: Sungtaek Hong 
Date:   Wed Nov 29 20:21:14 2017 +0900

efl_ui_popup: apply new theme logic for efl_ui_popup
---
 data/elementary/themes/Makefile.am   |   1 +
 data/elementary/themes/default.edc   |   1 +
 data/elementary/themes/edc/efl/popup.edc | 238 +++
 data/elementary/themes/edc/elm/popup.edc | 229 -
 src/lib/elementary/efl_ui_popup.c|  12 +-
 src/lib/elementary/efl_ui_popup_alert.c  |  57 +---
 src/lib/elementary/efl_ui_popup_anchor.c |   2 +
 7 files changed, 291 insertions(+), 249 deletions(-)

diff --git a/data/elementary/themes/Makefile.am 
b/data/elementary/themes/Makefile.am
index 758f7781c2..4bc6ec9987 100644
--- a/data/elementary/themes/Makefile.am
+++ b/data/elementary/themes/Makefile.am
@@ -1028,6 +1028,7 @@ elementary/themes/edc/efl/multibuttonentry.edc \
 elementary/themes/edc/efl/nstate.edc \
 elementary/themes/edc/efl/panes.edc \
 elementary/themes/edc/efl/photocam.edc \
+elementary/themes/edc/efl/popup.edc \
 elementary/themes/edc/efl/progress.edc \
 elementary/themes/edc/efl/radio.edc \
 elementary/themes/edc/efl/scroller.edc \
diff --git a/data/elementary/themes/default.edc 
b/data/elementary/themes/default.edc
index d3254be0e2..1bbd492217 100644
--- a/data/elementary/themes/default.edc
+++ b/data/elementary/themes/default.edc
@@ -179,6 +179,7 @@ collections {
 #include "edc/efl/slider.edc"
 #include "edc/efl/radio.edc"
 #include "edc/efl/panes.edc"
+#include "edc/efl/popup.edc"
 #include "edc/efl/video.edc"
 #include "edc/efl/focus.edc"
 #include "edc/efl/multibuttonentry.edc"
diff --git a/data/elementary/themes/edc/efl/popup.edc 
b/data/elementary/themes/edc/efl/popup.edc
new file mode 100644
index 00..f617b30bfd
--- /dev/null
+++ b/data/elementary/themes/edc/efl/popup.edc
@@ -0,0 +1,238 @@
+//Efl.Ui.Popup Themes
+group { "efl/popup";
+   images.image: "rounded_square.png" COMP;
+   parts {
+  spacer { "base";
+ desc { "default";
+rel1.offset: 10 10;
+rel2.offset: -11 -11;
+ }
+  }
+  image { "bg";
+ desc { "default";
+min: 100 100;
+image.border: 15 15 15 15;
+image.normal: "rounded_square.png";
+ }
+  }
+  swallow { "elm.swallow.content";
+ desc { "default";
+rel.to: "base";
+ }
+  }
+   }
+}
+
+group { "efl/popup.alert";
+   images.image: "rounded_square.png" COMP;
+   parts {
+  image { "bg";
+ desc { "default";
+min: 100 100;
+image.border: 15 15 15 15;
+image.normal: "rounded_square.png";
+  }
+  }
+  spacer { "base";
+ desc { "default";
+rel.to: "bg";
+rel1.offset: 10 10;
+rel2.offset: -11 -11;
+ }
+  }
+  rect { "title_bg";
+ desc { "default";
+fixed: 0 1;
+min: 0 0;
+rel.to: "base";
+rel2.relative: 1.0 0.0;
+align: 0.5 0.0;
+color: 0 0 0 0;
+ }
+ desc { "title_visible";
+inherit: "default";
+min: 0 20;
+ }
+  }
+  textblock { "elm.text.title";
+ scale;
+ desc { "default";
+fixed: 1 1;
+text {
+  style: "popup_title_style_ellipsis";
+}
+rel.to: "title_bg";
+hid;
+ }
+ desc { "title_visible";
+inherit: "default";
+vis;
+ }
+  }
+  swallow { "buttons";
+ desc { "default";
+fixed: 0 1;
+rel.to: "base";
+rel1.relative: 0.0 1.0;
+align: 0.5 1.0;
+min: 0 0;
+ }
+ desc { "button_visible";
+inherit: "default";
+min: 0 30;
+ }
+  }
+  swallow { "elm.swallow.content";
+ desc { "default";
+rel1.to_x: "base";
+rel1.to_y: "title_bg";
+rel2.to_x: "base";
+rel2.to_y: "buttons";
+rel1.relative: 0.0 1.0;
+rel2.relative: 1.0 0.0;
+ }
+  }
+   }
+   programs {
+  program {
+ signal: "elm,title,show"; source: "elm";
+ action: STATE_SET &quo

[EGIT] [core/efl] feature/eo_theme 04/07: efl_ui_widget: find theme just once in layout inherited widget

2017-11-28 Thread Sungtaek Hong
jpeg pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=0ab10ddd4068c34b872417962fd741722018a10e

commit 0ab10ddd4068c34b872417962fd741722018a10e
Author: Sungtaek Hong 
Date:   Tue Nov 14 22:03:25 2017 +0900

efl_ui_widget: find theme just once in layout inherited widget

When a widget inherits layout in tries to set theme in group_add or in
constructor. When another widget inherits the previous widget, it sets
layout again with new klass name. This sets klass in the widget and
sets layout in super class, so that it can set layout only once.

Test Plan: Run efl_ui_widget related elementary test.

Reviewers: jpeg, cedric, woohyun, singh.amitesh

Differential Revision: https://phab.enlightenment.org/D5473
---
 src/lib/elementary/efl_ui_bg.c |  8 ++-
 src/lib/elementary/efl_ui_button.c |  8 ++-
 src/lib/elementary/efl_ui_calendar.c   |  8 +--
 src/lib/elementary/efl_ui_check.c  |  5 ++--
 src/lib/elementary/efl_ui_clock.c  | 12 +++---
 src/lib/elementary/efl_ui_frame.c  |  7 +-
 src/lib/elementary/efl_ui_multibuttonentry.c   |  8 +--
 src/lib/elementary/efl_ui_nstate.c |  5 ++--
 src/lib/elementary/efl_ui_panes.c  |  8 +--
 src/lib/elementary/efl_ui_progressbar.c|  8 +--
 src/lib/elementary/efl_ui_radio.c  |  5 ++--
 src/lib/elementary/efl_ui_slider.c |  8 +--
 src/lib/elementary/efl_ui_video.c  |  8 ++-
 src/lib/elementary/elm_code_widget.c   | 28 --
 .../clock_input_ctxpopup/clock_input_ctxpopup.c|  5 +++-
 15 files changed, 97 insertions(+), 34 deletions(-)

diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c
index 3a38c4a284..38ac41a37c 100644
--- a/src/lib/elementary/efl_ui_bg.c
+++ b/src/lib/elementary/efl_ui_bg.c
@@ -97,10 +97,13 @@ _on_resize(void *data,
 EOLIAN static void
 _efl_ui_bg_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Bg_Data *priv)
 {
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
 
priv->rect = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(priv->rect, 0, 0, 0, 0);
 
+   if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "bg");
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -109,7 +112,10 @@ _efl_ui_bg_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Bg_Data *priv)
 
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _on_resize, obj);
 
-   if (!elm_layout_theme_set(obj, "bg", "base", elm_widget_style_get(obj)))
+   if (!efl_ui_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)))
  CRI("Failed to set layout!");
elm_layout_content_set(obj, "elm.swallow.rectangle", priv->rect);
 }
diff --git a/src/lib/elementary/efl_ui_button.c 
b/src/lib/elementary/efl_ui_button.c
index 36eaebd5bf..879d420409 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -270,6 +270,8 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Button_Data *_pd EINA_
 {
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
 
+   if (!elm_widget_theme_klass_get(obj))
+ elm_widget_theme_klass_set(obj, "button");
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
 
@@ -292,7 +294,11 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Button_Data *_pd EINA_
  (_elm_access_info_get(obj), ELM_ACCESS_STATE, _access_state_cb, obj);
 
elm_widget_can_focus_set(obj, EINA_TRUE);
-   if (!elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj)))
+
+   if (!efl_ui_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)))
  CRI("Failed to set layout!");
 }
 
diff --git a/src/lib/elementary/efl_ui_calendar.c 
b/src/lib/elementary/efl_ui_calendar.c
index df5e9d6a38..1a8f43f5f5 100644
--- a/src/lib/elementary/efl_ui_calendar.c
+++ b/src/lib/elementary/efl_ui_calendar.c
@@ -1000,8 +1000,12 @@ _efl_ui_calendar_constructor_internal(Eo *obj, 
Efl_Ui_Calendar_Data *priv)
 
elm_widget_can_focus_set(obj, EINA_TRUE);
 
-   if (!elm_layout_theme_set(obj, "calendar", "base",
- elm_object_style_get(obj)))
+   if 

[EGIT] [core/efl] feature/eo_theme 02/07: efl_ui_widget: find new edc resource for efl_ui_widgets

2017-11-28 Thread Sungtaek Hong
jpeg pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=9be5ffc877ff5cc124b1b886e8bd7ee9b6a52f6b

commit 9be5ffc877ff5cc124b1b886e8bd7ee9b6a52f6b
Author: Sungtaek Hong 
Date:   Tue Nov 14 19:59:42 2017 +0900

efl_ui_widget: find new edc resource for efl_ui_widgets

new eo widgets(efl_ui_ prefix) finds new edc group in
data/elementary/themes/edc/efl/*.edc.
New group name is "klass/group:style" and "base" group name and
"default" style name can be omitted.

for now, separator for style is ':' but needs to be decided.
---
 data/elementary/themes/Makefile.am |  25 +-
 data/elementary/themes/default.edc |  25 +-
 data/elementary/themes/edc/efl/bg.edc  |  11 +
 data/elementary/themes/edc/efl/border.edc  |  21 ++
 data/elementary/themes/edc/efl/button.edc  |   8 +
 data/elementary/themes/edc/efl/calendar.edc|   3 +
 data/elementary/themes/edc/efl/check.edc   |   7 +
 data/elementary/themes/edc/efl/cursor.edc  |  91 ++
 data/elementary/themes/edc/efl/focus.edc   |   7 +
 data/elementary/themes/edc/efl/frame.edc   |   3 +
 .../elementary/themes/edc/efl/multibuttonentry.edc |  19 ++
 data/elementary/themes/edc/{elm => efl}/nstate.edc |   4 +-
 data/elementary/themes/edc/efl/panes.edc   |  44 +++
 data/elementary/themes/edc/efl/photocam.edc|   3 +
 data/elementary/themes/edc/efl/progress.edc|  20 ++
 data/elementary/themes/edc/efl/radio.edc   |   3 +
 data/elementary/themes/edc/efl/scroller.edc|  12 +
 data/elementary/themes/edc/efl/slider.edc  |  73 +
 data/elementary/themes/edc/efl/text.edc| 328 +
 data/elementary/themes/edc/efl/textpath.edc|   3 +
 data/elementary/themes/edc/efl/tooltip.edc |  15 +
 data/elementary/themes/edc/efl/uiclock.edc | 223 ++
 data/elementary/themes/edc/efl/video.edc   |   3 +
 data/elementary/themes/edc/efl/win.edc |   3 +
 src/lib/elementary/efl_ui_panes.c  |  68 -
 src/lib/elementary/efl_ui_slider.c |  12 +-
 src/lib/elementary/efl_ui_text.c   |  79 +++--
 src/lib/elementary/efl_ui_win.c|  20 +-
 src/lib/elementary/elm_priv.h  |   3 +-
 src/lib/elementary/elm_spinner.c   |   7 +-
 src/lib/elementary/elm_theme.c |  26 +-
 src/lib/elementary/elm_widget.c|  10 +
 src/lib/elementary/els_cursor.c|   6 +-
 src/lib/elementary/elu_ews_wm.c|   8 +-
 34 files changed, 1105 insertions(+), 88 deletions(-)

diff --git a/data/elementary/themes/Makefile.am 
b/data/elementary/themes/Makefile.am
index f1ee7b15e8..758f7781c2 100644
--- a/data/elementary/themes/Makefile.am
+++ b/data/elementary/themes/Makefile.am
@@ -130,7 +130,6 @@ elementary/themes/edc/elm/menu.edc \
 elementary/themes/edc/elm/multibuttonentry.edc \
 elementary/themes/edc/elm/naviframe.edc \
 elementary/themes/edc/elm/notify.edc \
-elementary/themes/edc/elm/nstate.edc \
 elementary/themes/edc/elm/panel.edc \
 elementary/themes/edc/elm/panes.edc \
 elementary/themes/edc/elm/photocam.edc \
@@ -1016,8 +1015,28 @@ elementary/themes/snd/kbd-tap5.wav \
 elementary/themes/snd/kbd-tap.wav
 
 efl_ui_themes_files = \
-elementary/themes/edc/efl/button.edc
-
+elementary/themes/edc/efl/bg.edc \
+elementary/themes/edc/efl/border.edc \
+elementary/themes/edc/efl/button.edc \
+elementary/themes/edc/efl/calendar.edc \
+elementary/themes/edc/efl/check.edc \
+elementary/themes/edc/efl/uiclock.edc \
+elementary/themes/edc/efl/cursor.edc \
+elementary/themes/edc/efl/focus.edc \
+elementary/themes/edc/efl/frame.edc \
+elementary/themes/edc/efl/multibuttonentry.edc \
+elementary/themes/edc/efl/nstate.edc \
+elementary/themes/edc/efl/panes.edc \
+elementary/themes/edc/efl/photocam.edc \
+elementary/themes/edc/efl/progress.edc \
+elementary/themes/edc/efl/radio.edc \
+elementary/themes/edc/efl/scroller.edc \
+elementary/themes/edc/efl/slider.edc \
+elementary/themes/edc/efl/text.edc \
+elementary/themes/edc/efl/textpath.edc \
+elementary/themes/edc/efl/tooltip.edc \
+elementary/themes/edc/efl/video.edc \
+elementary/themes/edc/efl/win.edc
 
 elementary_fdo_actions_128_files = \
elementary/themes/fdo/actions/128/address-book-new.png \
diff --git a/data/elementary/themes/default.edc 
b/data/elementary/themes/default.edc
index 9d615295b1..d3254be0e2 100644
--- a/data/elementary/themes/default.edc
+++ b/data/elementary/themes/default.edc
@@ -13,7 +13,6 @@ collections {
 // elm
 #include "edc/elm/bg.edc"
 #include "edc/elm/button.edc"
-#include "edc/elm/nstate.edc"
 // XXX: mobile mode needs invisible scrollers... make signals that do this
 #include "edc/elm/scroller.edc"

[EGIT] [core/efl] feature/eo_theme 03/07: efl_ui_widget: use elm_widget_element_update to set subobj edc

2017-11-28 Thread Sungtaek Hong
jpeg pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=a088b73bc0cb6385776db1736ba1266c65d6d47d

commit a088b73bc0cb6385776db1736ba1266c65d6d47d
Author: Sungtaek Hong 
Date:   Tue Nov 14 20:38:49 2017 +0900

efl_ui_widget: use elm_widget_element_update to set subobj edc

affected widget list:
efl_ui_clock: test, ampm
efl_ui_multibuttonentry: guidetext, label, closedbutton
efl_ui_slider: popup(indicator)
efl_ui_text: scroller, handler, magnifier, cursor, selection, anchor
---
 src/lib/elementary/efl_ui_clock.c|   2 +
 src/lib/elementary/efl_ui_clock_private.h|   9 ++
 src/lib/elementary/efl_ui_layout.c   |  11 ++
 src/lib/elementary/efl_ui_layout.eo  |   1 +
 src/lib/elementary/efl_ui_multibuttonentry.c |  34 ++---
 src/lib/elementary/efl_ui_progressbar.c  |  68 +-
 src/lib/elementary/efl_ui_slider.c   | 178 +--
 src/lib/elementary/efl_ui_slider_interval.c  |   1 +
 src/lib/elementary/efl_ui_text.c |  79 +---
 src/lib/elementary/efl_ui_win.c  |   1 +
 10 files changed, 247 insertions(+), 137 deletions(-)

diff --git a/src/lib/elementary/efl_ui_clock.c 
b/src/lib/elementary/efl_ui_clock.c
index bd11bc8d60..b32e7aa8dd 100644
--- a/src/lib/elementary/efl_ui_clock.c
+++ b/src/lib/elementary/efl_ui_clock.c
@@ -517,6 +517,8 @@ _efl_ui_clock_elm_widget_theme_apply(Eo *obj, 
Efl_Ui_Clock_Data *sd)
for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++)
  {
 field = sd->field_list + idx;
+// TODO: Different group name for each field_obj may be needed.
+elm_widget_element_update(obj, field->item_obj, PART_NAME_ARRAY[idx]);
 if (field->fmt_exist && field->visible)
   {
  snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
diff --git a/src/lib/elementary/efl_ui_clock_private.h 
b/src/lib/elementary/efl_ui_clock_private.h
index 94c9d702e7..e37a8ceff3 100644
--- a/src/lib/elementary/efl_ui_clock_private.h
+++ b/src/lib/elementary/efl_ui_clock_private.h
@@ -33,6 +33,15 @@ typedef struct _Format_Map   Format_Map;
 #define EFL_UI_CLOCK_MAX_FORMAT_LEN   64
 #define EFL_UI_CLOCK_MAX_FIELD_FORMAT_LEN 3
 
+const char *PART_NAME_ARRAY[EFL_UI_CLOCK_TYPE_COUNT] = { "text",
+ "text",
+ "text",
+ "text",
+ "text",
+ "text",
+ "text",
+ "ampm"};
+
 struct _Efl_Ui_Clock_Module_Data
 {
Evas_Object *base;
diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index 353caa945f..aabff8ca2e 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2071,6 +2071,17 @@ EOLIAN static void 
_efl_ui_layout_class_constructor(Efl_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
 }
 
+EOLIAN static Efl_Object*
+_efl_ui_layout_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED)
+{
+   Eo *eo;
+
+   eo = efl_finalize(efl_super(obj, MY_CLASS));
+   efl_ui_widget_theme_apply(eo);
+
+   return eo;
+}
+
 EOLIAN static void
 _efl_ui_layout_efl_canvas_layout_signal_message_send(Eo *obj, 
Efl_Ui_Layout_Data *pd EINA_UNUSED, int id, const Eina_Value msg)
 {
diff --git a/src/lib/elementary/efl_ui_layout.eo 
b/src/lib/elementary/efl_ui_layout.eo
index 7bb5aa0ca1..7f75a747e9 100644
--- a/src/lib/elementary/efl_ui_layout.eo
+++ b/src/lib/elementary/efl_ui_layout.eo
@@ -45,6 +45,7 @@ class Efl.Ui.Layout (Elm.Widget, Efl.Part, Efl.Container, 
Efl.File,
implements {
   class.constructor;
   Efl.Object.constructor;
+  Efl.Object.finalize;
   Efl.File.file { get; set; }
   Efl.File.mmap { get; set; }
   Efl.Canvas.Group.group_calculate;
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c 
b/src/lib/elementary/efl_ui_multibuttonentry.c
index 0ff7c5e555..577faeb7f8 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry.c
+++ b/src/lib/elementary/efl_ui_multibuttonentry.c
@@ -35,6 +35,11 @@ static const char SIG_UNFOCUSED[] = "unfocused";
 static const char SIG_EXPANDED[] = "expanded";
 static const char SIG_CONTRACTED[] = "contracted";
 static const char SIG_EXPAND_STATE_CHANGED[] = "expand,state,changed";
+
+static const char PART_NAME_BUTTON[] = "btn";
+static const char PART_NAME_GUIDE_TEXT[] = "guidetext";
+static const char PART_NAME_LABEL[] = "label";
+static const char PART_NA

[EGIT] [core/efl] feature/eo_theme 01/07: efl_ui_widget: add new internal EAPI for new group name

2017-11-28 Thread Sungtaek Hong
jpeg pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=589c7924e937a611625082626839205277c90a5d

commit 589c7924e937a611625082626839205277c90a5d
Author: Sungtaek Hong 
Date:   Tue Nov 14 18:42:48 2017 +0900

efl_ui_widget: add new internal EAPI for new group name

theme_klass: set/get klass name used for resize_obj
theme_element: set/get group name used for resize_obj
theme_style: set/get style name used for resize_obj
element_update: automatically sets and apply theme for
 sub object of widget.
---
 src/lib/elementary/efl_ui_layout.c  |  29 +++
 src/lib/elementary/efl_ui_panes.c   |   5 +-
 src/lib/elementary/efl_ui_progressbar.c |   5 +-
 src/lib/elementary/efl_ui_slider.c  |   9 +--
 src/lib/elementary/elc_hoversel.c   |   4 +-
 src/lib/elementary/elm_bubble.c |   5 +-
 src/lib/elementary/elm_index.c  |   5 +-
 src/lib/elementary/elm_scroller.c   |   8 +-
 src/lib/elementary/elm_separator.c  |   5 +-
 src/lib/elementary/elm_widget.c | 133 
 src/lib/elementary/elm_widget.h |  10 +++
 src/lib/elementary/elm_widget_layout.h  |   2 -
 12 files changed, 177 insertions(+), 43 deletions(-)

diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index 15534c7b7d..353caa945f 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -362,8 +362,10 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data 
*sd)
if (!sd->file_set)
  {
 ret = elm_widget_theme_object_set
-(obj, wd->resize_obj, sd->klass, sd->group,
- elm_widget_style_get(obj));
+(obj, wd->resize_obj,
+elm_widget_theme_klass_get(obj), 
+elm_widget_theme_element_get(obj),
+elm_widget_theme_style_get(obj));
  }
 
if (ret)
@@ -682,9 +684,6 @@ _efl_ui_layout_efl_canvas_group_group_del(Eo *obj, 
Efl_Ui_Layout_Data *sd)
eina_hash_free(sd->factories);
sd->factories = NULL;
 
-   eina_stringshare_del(sd->klass);
-   eina_stringshare_del(sd->group);
-
/* let's make our Edje object the *last* to be processed, since it
 * may (smart) parent other sub objects here */
EINA_LIST_FOREACH(wd->subobjs, l, child)
@@ -799,6 +798,7 @@ _efl_ui_layout_efl_file_mmap_get(Eo *obj, 
Efl_Ui_Layout_Data *sd EINA_UNUSED, co
 EOLIAN static Efl_Ui_Theme_Apply
 _efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, 
const char *group, const char *style)
 {
+   Eina_Bool changed = EINA_FALSE;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
 
if (!wd->legacy && efl_finalized_get(obj))
@@ -808,11 +808,14 @@ _efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, 
const char *klass, con
  }
 
if (sd->file_set) sd->file_set = EINA_FALSE;
-   eina_stringshare_replace(&(sd->klass), klass);
-   eina_stringshare_replace(&(sd->group), group);
-   eina_stringshare_replace(&(wd->style), style);
 
-   return _efl_ui_layout_theme_internal(obj, sd);
+   changed |= elm_widget_theme_klass_set(obj, klass);
+   changed |= elm_widget_theme_element_set(obj, group);
+   changed |= elm_widget_theme_style_set(obj, style);
+
+   if (changed)
+ return efl_ui_widget_theme_apply(obj);
+   return EFL_UI_THEME_APPLY_SUCCESS;
 }
 
 EOLIAN static void
@@ -2376,7 +2379,7 @@ elm_layout_theme_set(Evas_Object *obj, const char *klass, 
const char *group, con
 /* Efl.Part implementation */
 
 EOLIAN static Eo *
-_efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd, const char 
*part)
+_efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd 
EINA_UNUSED, const char *part)
 {
Efl_Canvas_Layout_Part_Type type;
 
@@ -2397,7 +2400,7 @@ _efl_ui_layout_efl_part_part(const Eo *obj, 
Efl_Ui_Layout_Data *sd, const char *
   const char *file = NULL, *key = NULL;
   efl_file_get(wd->resize_obj, &file, &key);
   WRN("Layout has a background but it's not a swallow: '%s'",
-  sd->group);
+  elm_widget_theme_element_get(obj));
}
  return efl_part(efl_super(obj, MY_CLASS), part);
   }
@@ -2407,7 +2410,7 @@ _efl_ui_layout_efl_part_part(const Eo *obj, 
Efl_Ui_Layout_Data *sd, const char *
 
if (type >= EFL_CANVAS_LAYOUT_PART_TYPE_LAST)
  {
-ERR("Invalid type found for part '%s' in group '%s'", part, sd->group);
+ERR("Invalid type found for part '%s' in group '%s'", part, 
elm_widget_theme_element_get(obj));
 return NULL;
  }
 
@@ -2422,7 +2425,7 @@ _efl_ui_layout_efl_part_part(const Eo *obj, 
Efl_Ui_Layout_Data *sd, const char *
   case EFL_CAN

[EGIT] [core/efl] feature/eo_theme 05/07: efl_ui_widget: make Elm.Widget.theme, Elm.Widget.theme_object internal

2017-11-28 Thread Sungtaek Hong
jpeg pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=9d94d7c6331ce2171b9034a475c8483c6528e4cd

commit 9d94d7c6331ce2171b9034a475c8483c6528e4cd
Author: Sungtaek Hong 
Date:   Fri Nov 17 17:24:39 2017 +0900

efl_ui_widget: make Elm.Widget.theme, Elm.Widget.theme_object internal
---
 src/lib/elementary/efl_ui_bg.c   |  2 +-
 src/lib/elementary/efl_ui_button.c   |  2 +-
 src/lib/elementary/efl_ui_calendar.c |  2 +-
 src/lib/elementary/efl_ui_clock.c|  2 +-
 src/lib/elementary/efl_ui_frame.c|  2 +-
 src/lib/elementary/efl_ui_multibuttonentry.c |  2 +-
 src/lib/elementary/efl_ui_panes.c|  2 +-
 src/lib/elementary/efl_ui_progressbar.c  |  2 +-
 src/lib/elementary/efl_ui_slider.c   |  6 ++---
 src/lib/elementary/efl_ui_text.c |  2 +-
 src/lib/elementary/efl_ui_video.c|  2 +-
 src/lib/elementary/efl_ui_win.c  | 18 ++---
 src/lib/elementary/elm_widget.c  | 40 +---
 src/lib/elementary/elm_widget.eo | 20 --
 src/lib/elementary/els_cursor.c  |  6 ++---
 15 files changed, 37 insertions(+), 73 deletions(-)

diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c
index 38ac41a37c..79991a2179 100644
--- a/src/lib/elementary/efl_ui_bg.c
+++ b/src/lib/elementary/efl_ui_bg.c
@@ -112,7 +112,7 @@ _efl_ui_bg_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Bg_Data *priv)
 
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _on_resize, obj);
 
-   if (!efl_ui_widget_theme_object_set(obj, wd->resize_obj,
+   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)))
diff --git a/src/lib/elementary/efl_ui_button.c 
b/src/lib/elementary/efl_ui_button.c
index 879d420409..2f194ea52a 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -295,7 +295,7 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Button_Data *_pd EINA_
 
elm_widget_can_focus_set(obj, EINA_TRUE);
 
-   if (!efl_ui_widget_theme_object_set(obj, wd->resize_obj,
+   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)))
diff --git a/src/lib/elementary/efl_ui_calendar.c 
b/src/lib/elementary/efl_ui_calendar.c
index 1a8f43f5f5..3e629a75b3 100644
--- a/src/lib/elementary/efl_ui_calendar.c
+++ b/src/lib/elementary/efl_ui_calendar.c
@@ -1002,7 +1002,7 @@ _efl_ui_calendar_constructor_internal(Eo *obj, 
Efl_Ui_Calendar_Data *priv)
 
if (!elm_widget_theme_klass_get(obj))
  elm_widget_theme_klass_set(obj, "calendar");
-   if (!efl_ui_widget_theme_object_set(obj, wd->resize_obj,
+   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)))
diff --git a/src/lib/elementary/efl_ui_clock.c 
b/src/lib/elementary/efl_ui_clock.c
index fea20899bf..f3aa340b90 100644
--- a/src/lib/elementary/efl_ui_clock.c
+++ b/src/lib/elementary/efl_ui_clock.c
@@ -828,7 +828,7 @@ _efl_ui_clock_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Clock_Data *priv)
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
 
-   if (!efl_ui_widget_theme_object_set(obj, wd->resize_obj,
+   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)))
diff --git a/src/lib/elementary/efl_ui_frame.c 
b/src/lib/elementary/efl_ui_frame.c
index e3679af604..3e3fcb7f5c 100644
--- a/src/lib/elementary/efl_ui_frame.c
+++ b/src/lib/elementary/efl_ui_frame.c
@@ -131,7 +131,7 @@ _efl_ui_frame_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Frame_Data *_pd EINA_UN
 
elm_widget_can_focus_set(obj, EINA_FALSE);
 
-   if (!efl_ui_widget_theme_object_set(obj, wd->resize_obj,
+   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)))
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c 
b/src/lib/elementary/efl_ui_multibuttonentry.c
index 0ae8c20bfa..a8

[EGIT] [core/efl] feature/eo_theme 06/07: elm_code_widget: change efl_add to legacy_add

2017-11-28 Thread Sungtaek Hong
jpeg pushed a commit to branch feature/eo_theme.

http://git.enlightenment.org/core/efl.git/commit/?id=0882213915b57806b0f086b03cbe6ee4259bc545

commit 0882213915b57806b0f086b03cbe6ee4259bc545
Author: Sungtaek Hong 
Date:   Tue Nov 28 20:50:53 2017 +0900

elm_code_widget: change efl_add to legacy_add

Summary:
elm_code_widget is legacy add, thus efl_add is not available.

Signed-off-by: Sungtaek Hong 

Reviewers: jpeg, cedric, ajwillia.ms, woohyun

Differential Revision: https://phab.enlightenment.org/D5548
---
 src/bin/elementary/test_code.c  | 32 +
 src/lib/elementary/elm_code_widget.c|  3 ++-
 src/tests/elementary/elm_code_test_widget.c |  2 +-
 3 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/src/bin/elementary/test_code.c b/src/bin/elementary/test_code.c
index 235adde00b..571b086824 100644
--- a/src/bin/elementary/test_code.c
+++ b/src/bin/elementary/test_code.c
@@ -59,7 +59,11 @@ _elm_code_test_welcome_setup(Evas_Object *parent)
Elm_Code_Widget *widget;
 
code = elm_code_create();
-   widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, 
elm_obj_code_widget_code_set(efl_added, code));
+   widget = elm_code_widget_add(parent, code);
+   evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(widget);
+
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, 
_elm_code_test_line_done_cb, NULL);
efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, 
_elm_code_test_line_clicked_cb, code);
 
@@ -90,7 +94,11 @@ _elm_code_test_editor_setup(Evas_Object *parent, Eina_Bool 
log)
Elm_Code_Widget *widget;
 
code = elm_code_create();
-   widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, 
elm_obj_code_widget_code_set(efl_added, code));
+   widget = elm_code_widget_add(parent, code);
+   evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(widget);
+
elm_obj_code_widget_font_set(widget, NULL, 14);
elm_obj_code_widget_editable_set(widget, EINA_TRUE);
elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE);
@@ -118,7 +126,11 @@ _elm_code_test_syntax_setup(Evas_Object *parent)
Elm_Code_Widget *widget;
 
code = elm_code_create();
-   widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, 
elm_obj_code_widget_code_set(efl_added, code));
+   widget = elm_code_widget_add(parent, code);
+   evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(widget);
+
elm_obj_code_widget_editable_set(widget, EINA_TRUE);
elm_obj_code_widget_syntax_enabled_set(widget, EINA_TRUE);
elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc";
@@ -144,12 +156,13 @@ _elm_code_test_mirror_setup(Elm_Code *code, char 
*font_name, Evas_Object *parent
 {
Elm_Code_Widget *widget;
 
-   widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, 
elm_obj_code_widget_code_set(efl_added, code));
-   elm_obj_code_widget_font_set(widget, font_name, 11);
-   elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE);
-
+   widget = elm_code_widget_add(parent, code);
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(widget);
+
+   elm_obj_code_widget_font_set(widget, font_name, 11);
+   elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE);
 
return widget;
 }
@@ -161,7 +174,10 @@ _elm_code_test_diff_inline_setup(Evas_Object *parent)
Elm_Code *code;
 
code = elm_code_create();
-   diff = efl_add(ELM_CODE_WIDGET_CLASS, parent, 
elm_obj_code_widget_code_set(efl_added, code));
+   diff = elm_code_widget_add(parent, code);
+   evas_object_size_hint_weight_set(diff, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(diff, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(diff);
 
elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_DIFF);
elm_code_file_open(code, PACKAGE_DATA_DIR "/testdiff.diff");
diff --git a/src/lib/elementary/elm_code_widget.c 
b/src/lib/elementary/elm_code_widget.c
index 2fd8e258f4..fd9f59c9f6 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -2040,7 +2040,8 @@ _elm_code_widget_code_set(Eo *obj, Elm_Code_Widget_Data 
*pd, Elm_Code *code)
 
pd->code = code;
 
-   code->widgets = eina_list_append(code->widgets, obj);
+   if (code)
+ code->widgets = eina_list_append(code->widgets, obj);
 }
 
 EOLIAN static Elm_Code *
diff --git a/src/tests/elementary/elm_code_test_widget.c 
b/src/tests/elementary/elm_code_test_widget.c
index c9fd6e8740.

[EGIT] [core/efl] master 01/01: elc_combobox: use elm_legacy_add for internal component

2017-11-27 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8193864d7d89adfc4585a5ce8432b765fabfb96c

commit 8193864d7d89adfc4585a5ce8432b765fabfb96c
Author: Sungtaek Hong 
Date:   Tue Nov 28 11:47:42 2017 +0900

elc_combobox: use elm_legacy_add for internal component

Summary:
elm_combobox has entry, genlist, hover as its component.
Those components should be marked as legacy during efl_add.

Test Plan:
Run elementary test.
   Run combobox test.

Reviewers: jpeg, cedric, woohyun

Differential Revision: https://phab.enlightenment.org/D5542
---
 src/lib/elementary/elc_combobox.c | 40 ++-
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/src/lib/elementary/elc_combobox.c 
b/src/lib/elementary/elc_combobox.c
index 54c6c20022..81c33d30a4 100644
--- a/src/lib/elementary/elc_combobox.c
+++ b/src/lib/elementary/elc_combobox.c
@@ -288,6 +288,25 @@ _on_clicked(void *data, const Efl_Event *event EINA_UNUSED)
elm_combobox_hover_begin(data);
 }
 
+static Eo *
+_elm_combobox_component_add(Eo *obj, Eo *parent, const Efl_Class *klass, char 
*style)
+{
+   Eo *component;
+
+   if (elm_widget_is_legacy(obj))
+ {
+component = elm_legacy_add(klass, parent,
+   efl_ui_widget_style_set(efl_added, style));
+ }
+   else
+ {
+component = efl_add(klass, parent,
+   efl_ui_widget_style_set(efl_added, style));
+ }
+
+   return component;
+}
+
 EOLIAN static void
 _elm_combobox_efl_canvas_group_group_add(Eo *obj, Elm_Combobox_Data *sd 
EINA_UNUSED)
 {
@@ -361,19 +380,8 @@ _elm_combobox_efl_object_constructor(Eo *obj, 
Elm_Combobox_Data *sd)
snprintf(buf, sizeof(buf), "combobox_vertical/%s", 
elm_widget_style_get(obj));
 
//hover
-   if (elm_widget_is_legacy(obj))
- {
-sd->hover = elm_legacy_add(ELM_HOVER_CLASS, sd->hover_parent,
-   efl_gfx_visible_set(efl_added, EINA_FALSE),
-   efl_ui_widget_style_set(efl_added, buf));
- }
-   else
- {
-sd->hover = efl_add(ELM_HOVER_CLASS, sd->hover_parent,
-efl_gfx_visible_set(efl_added, EINA_FALSE),
-efl_ui_widget_style_set(efl_added, buf));
- }
-
+   sd->hover = _elm_combobox_component_add(obj, sd->hover_parent, 
ELM_HOVER_CLASS, buf);
+   efl_gfx_visible_set(sd->hover, EINA_FALSE);
evas_object_layer_set(sd->hover, EVAS_LAYER_MAX);
efl_ui_mirrored_automatic_set(sd->hover, EINA_FALSE);
elm_hover_target_set(sd->hover, obj);
@@ -397,8 +405,7 @@ _elm_combobox_efl_object_constructor(Eo *obj, 
Elm_Combobox_Data *sd)
elm_table_pack(sd->tbl, sd->spacer, 0, 0, 1, 1);
 
// This is the genlist object that will take over the genlist call
-   sd->genlist = gl = efl_add(ELM_GENLIST_CLASS, obj,
-  efl_ui_widget_style_set(efl_added, buf));
+   sd->genlist = gl = _elm_combobox_component_add(obj, obj, ELM_GENLIST_CLASS, 
buf);
elm_genlist_filter_set(gl, NULL);
efl_ui_mirrored_automatic_set(gl, EINA_FALSE);
efl_ui_mirrored_set(gl, efl_ui_mirrored_get(obj));
@@ -412,8 +419,7 @@ _elm_combobox_efl_object_constructor(Eo *obj, 
Elm_Combobox_Data *sd)
elm_table_pack(sd->tbl, gl, 0, 0, 1, 1);
 
// This is the entry object that will take over the entry call
-   sd->entry = entry = efl_add(ELM_ENTRY_CLASS, obj,
-   efl_ui_widget_style_set(efl_added, buf));
+   sd->entry = entry = _elm_combobox_component_add(obj, obj, ELM_ENTRY_CLASS, 
buf);
efl_ui_mirrored_automatic_set(entry, EINA_FALSE);
efl_ui_mirrored_set(entry, efl_ui_mirrored_get(obj));
elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF,

-- 




[EGIT] [core/efl] master 01/01: efl_ui_bg: add Efl.Gfx.color_get.

2017-11-26 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b8789e52ae5852a1769830786e8ed8971d05c9c3

commit b8789e52ae5852a1769830786e8ed8971d05c9c3
Author: Sungtaek Hong 
Date:   Mon Nov 27 11:55:24 2017 +0900

efl_ui_bg: add Efl.Gfx.color_get.

Summary:
since legacy elm_bg_color_set/get is changed to efl_gfx_color_set/get,
efl_gfx_color_get also should get color of inner rect.

@fix

Test Plan:
1) run elementary test.
   2) run Bg EO API(Efl.Ui.Bg)
   3) set/unset "Bg color" check.
   4) observe printed color values.

Reviewers: jpeg, woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D5429
---
 src/bin/elementary/test_bg.c| 11 ++---
 src/lib/elementary/efl_ui_bg.c  | 53 +
 src/lib/elementary/efl_ui_bg.eo |  3 ++-
 3 files changed, 43 insertions(+), 24 deletions(-)

diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index 5ebf59f8e8..7ec6fe615a 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -382,11 +382,16 @@ static void
 _cb_check_changed_scale_type(void *data, const Efl_Event *ev)
 {
Evas_Object *o_bg = data;
+   int r, g, b, a;
 
if (efl_ui_check_selected_get(ev->object))
  efl_gfx_color_set(o_bg, 255, 128, 128, 255);
else
  efl_gfx_color_set(o_bg, 0, 0, 0, 0);
+
+   efl_gfx_color_get(o_bg, &r, &g, &b, &a);
+   printf("bg color: %d %d %d %d\n", r, g, b, a);
+   fflush(stdout);
 }
 
 void
@@ -431,7 +436,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
 efl_gfx_size_hint_weight_set(efl_added, 
EFL_GFX_SIZE_HINT_EXPAND, 0.0),
 efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, 
_cb_radio_changed_scale_type, o_bg),
 efl_pack(hbox, efl_added));
-   
+
rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
 efl_ui_radio_state_value_set(efl_added, 
EFL_UI_IMAGE_SCALE_TYPE_FIT_INSIDE),
 efl_ui_radio_group_add(efl_added, rdg),
@@ -440,7 +445,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
 efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, 
_cb_radio_changed_scale_type, o_bg),
 efl_pack(hbox, efl_added));
 
-   
+
rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
 efl_ui_radio_state_value_set(efl_added, 
EFL_UI_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
 efl_ui_radio_group_add(efl_added, rdg),
@@ -448,7 +453,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
 efl_gfx_size_hint_weight_set(efl_added, 
EFL_GFX_SIZE_HINT_EXPAND, 0.0),
 efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, 
_cb_radio_changed_scale_type, o_bg),
 efl_pack(hbox, efl_added));
-   
+
rd = efl_add(EFL_UI_RADIO_CLASS, hbox,
 efl_ui_radio_state_value_set(efl_added, 
EFL_UI_IMAGE_SCALE_TYPE_NONE),
 efl_ui_radio_group_add(efl_added, rdg),
diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c
index a3838b71d4..3a38c4a284 100644
--- a/src/lib/elementary/efl_ui_bg.c
+++ b/src/lib/elementary/efl_ui_bg.c
@@ -98,6 +98,9 @@ EOLIAN static void
 _efl_ui_bg_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Bg_Data *priv)
 {
 
+   priv->rect = evas_object_rectangle_add(evas_object_evas_get(obj));
+   evas_object_color_set(priv->rect, 0, 0, 0, 0);
+
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -108,6 +111,7 @@ _efl_ui_bg_efl_canvas_group_group_add(Eo *obj, 
Efl_Ui_Bg_Data *priv)
 
if (!elm_layout_theme_set(obj, "bg", "base", elm_widget_style_get(obj)))
  CRI("Failed to set layout!");
+   elm_layout_content_set(obj, "elm.swallow.rectangle", priv->rect);
 }
 
 EAPI Evas_Object *
@@ -129,6 +133,20 @@ _efl_ui_bg_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Data 
*_pd EINA_UNUSED)
return obj;
 }
 
+/* FIXME: Efl.Canvas.group_member_add in Elm.Widget sets child's colors as the 
same
+ *with that of obj. The color of resize_obj of Bg should not be changed
+ *because actual color is the color of rectangle in resize_obj.
+ */
+EOLIAN static void
+_efl_ui_bg_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_Bg_Data *_pd 
EINA_UNUSED, Evas_Object *child)
+{
+   efl_canvas_group_member_add(efl_super(obj, MY_CLASS), child);
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+   if (wd->resize_obj == child)
+ evas_object_color_set(child, 255, 255, 255, 255);
+}
+
 EOLIAN static Eina_Bool
 _efl_ui_bg_efl_file_file_set(Eo *obj, Efl_Ui_Bg_Data *sd, const char *file, 
const char *group)
 {
@@ -265,31 +283,20 @@ elm_bg_color_set(Evas_Object

[EGIT] [core/efl] master 01/02: efl_ui_layout: create efl_ui_bg when efl_part for background is called.

2017-11-23 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3c47a4f9f9ef7705992a61148f1f53311bcade49

commit 3c47a4f9f9ef7705992a61148f1f53311bcade49
Author: Sungtaek Hong 
Date:   Fri Nov 24 14:41:31 2017 +0900

efl_ui_layout: create efl_ui_bg when efl_part for background is called.

Reviewers: woohyun, jpeg, cedric

Subscribers: felipealmeida, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5151
---
 src/Makefile_Elementary.am  |   3 +
 src/bin/elementary/Makefile.am  |   1 +
 src/bin/elementary/test.c   |   4 +
 src/bin/elementary/test_part_bg.c   | 183 
 src/lib/elementary/Elementary.h |   2 +
 src/lib/elementary/efl_ui_layout.c  |  79 +++-
 src/lib/elementary/efl_ui_layout_part_bg.eo |  11 ++
 src/lib/elementary/efl_ui_widget_part_bg.eo |  22 
 src/lib/elementary/elm_part_helper.h|   2 +
 src/lib/elementary/elm_widget.c | 108 +++-
 src/lib/elementary/elm_widget.h |   1 +
 11 files changed, 411 insertions(+), 5 deletions(-)

diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 5c45cd62e1..be45275fa8 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -54,6 +54,7 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_layout_part_content.eo \
lib/elementary/efl_ui_layout_part_text.eo \
lib/elementary/efl_ui_layout_part_table.eo \
+   lib/elementary/efl_ui_layout_part_bg.eo \
lib/elementary/efl_ui_layout_part_legacy.eo \
lib/elementary/efl_ui_multibuttonentry_part.eo \
lib/elementary/efl_ui_panes_part.eo \
@@ -61,6 +62,7 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_slider_part.eo \
lib/elementary/efl_ui_textpath_part.eo \
lib/elementary/efl_ui_widget_part.eo \
+   lib/elementary/efl_ui_widget_part_bg.eo \
lib/elementary/efl_ui_win_part.eo \
lib/elementary/efl_access.eo \
lib/elementary/efl_access_action.eo \
@@ -862,6 +864,7 @@ bin/elementary/test_notify.c \
 bin/elementary/test_nstate.c \
 bin/elementary/test_panel.c \
 bin/elementary/test_panes.c \
+bin/elementary/test_part_bg.c \
 bin/elementary/test_photo.c \
 bin/elementary/test_photocam.c \
 bin/elementary/test_popup.c \
diff --git a/src/bin/elementary/Makefile.am b/src/bin/elementary/Makefile.am
index df71027a38..0ce67b0483 100644
--- a/src/bin/elementary/Makefile.am
+++ b/src/bin/elementary/Makefile.am
@@ -113,6 +113,7 @@ test_notify.c \
 test_nstate.c \
 test_panel.c \
 test_panes.c \
+test_part_bg.c \
 test_photo.c \
 test_photocam.c \
 test_popup.c \
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 07afe07ed0..e4ba05f74c 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -302,6 +302,7 @@ void test_win_dialog(void *data, Evas_Object *obj, void 
*event_info);
 void test_win_modal(void *data, Evas_Object *obj, void *event_info);
 void test_box_disable(void *data, Evas_Object *obj, void *event_info);
 void test_layout_disable(void *data, Evas_Object *obj, void *event_info);
+void test_part_background(void *data, Evas_Object *obj, void *event_info);
 
 void test_colorclass(void *data, Evas_Object *obj, void *event_info);
 
@@ -1130,6 +1131,9 @@ add_tests:
//--//
ADD_TEST(NULL, "Widgets Disable/Enable", "Box", test_box_disable);
ADD_TEST(NULL, "Widgets Disable/Enable", "Layout", test_layout_disable);
+
+   //--//
+   ADD_TEST(NULL, "Widgets Part", "Part Background", test_part_background);
 #undef ADD_TEST
 
if (autorun)
diff --git a/src/bin/elementary/test_part_bg.c 
b/src/bin/elementary/test_part_bg.c
new file mode 100644
index 00..cdad4845f7
--- /dev/null
+++ b/src/bin/elementary/test_part_bg.c
@@ -0,0 +1,183 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include 
+
+const Efl_Class *content_class[17];
+
+
+static void
+_reset_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+   Evas_Object *radio = data;
+   Evas_Object *target;
+
+   radio = efl_ui_radio_selected_object_get(radio);
+   target = evas_object_data_get(radio, "data");
+
+   efl_gfx_color_set(efl_part(target, "background"), 0, 0, 0, 0);
+   efl_file_set(efl_part(target, "background"), NULL, NULL);
+}
+
+static void
+_color_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+   Evas_Object *radio = data;
+   Evas_Object *target;
+   static Eina_Bool i;
+
+   radio = efl_ui_radio_selected_object_get(radio);
+   target = evas_object_data_get(radio, "data");
+   i ^= EINA_TRUE;
+   efl_gfx_color_set(efl_part(target, "background"), (i) ? 255 : 0, (i) ? 0 : 
255, 0, 255);
+}
+
+static void
+_scale_type_cb(void *data, const Efl_Event *e

[EGIT] [core/efl] master 01/02: efl_ui_widget: secure elm_legacy_add flag

2017-11-23 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8f2369c5b6b756619f23cc96f312e4e97030ab7c

commit 8f2369c5b6b756619f23cc96f312e4e97030ab7c
Author: Sungtaek Hong 
Date:   Fri Nov 24 14:32:36 2017 +0900

efl_ui_widget: secure elm_legacy_add flag

Summary:
_elm_legacy_add goes back to EINA_FALSE after setting sd->legacy.
if constructor get called again after going back to EINA_FALSE,
sd->legacy should remain EINA_TRUE.
also, elm_legacy_add() should not be called non-elm_widget.

Test Plan:
Run elementary test->Efl.Ui.Text.Label.
Check legacy flag in _elm_theme_object_set() for efl_ui_win.
Check legacy flag for efl_ui_text after scrollable text is added.

Reviewers: jpeg, woohyun

Reviewed By: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5529
---
 src/lib/elementary/elm_interface_scrollable.c | 2 +-
 src/lib/elementary/elm_widget.c   | 7 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/elm_interface_scrollable.c 
b/src/lib/elementary/elm_interface_scrollable.c
index 8f1371f027..522deba236 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -192,7 +192,7 @@ _elm_pan_content_size_get(Eo *obj EINA_UNUSED, 
Elm_Pan_Smart_Data *psd, Evas_Coo
 static Evas_Object *
 _elm_pan_add(Evas *evas)
 {
-   return elm_legacy_add(MY_PAN_CLASS, evas);
+   return efl_add(MY_PAN_CLASS, evas, 
efl_canvas_object_legacy_ctor(efl_added));
 }
 
 EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 3b122a9b84..5531bb7a87 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -5046,8 +5046,11 @@ _elm_widget_efl_object_constructor(Eo *obj, 
Elm_Widget_Smart_Data *sd EINA_UNUSE
Eo *parent = NULL;
 
sd->on_create = EINA_TRUE;
-   sd->legacy = _elm_legacy_add;
-   _elm_legacy_add = EINA_FALSE;
+   if (_elm_legacy_add)
+ {
+sd->legacy = _elm_legacy_add;
+_elm_legacy_add = EINA_FALSE;
+ }
efl_canvas_group_clipped_set(obj, EINA_FALSE);
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);

-- 




[EGIT] [core/efl] master 11/12: efl_ui_bg: fix unclipped image on EFL_UI_IMAGE_SCALE_TYPE_NONE

2017-11-23 Thread Sungtaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1f35c2363a7d96bb4108ad189d636a5f189bd62c

commit 1f35c2363a7d96bb4108ad189d636a5f189bd62c
Author: Sungtaek Hong 
Date:   Thu Nov 23 15:43:23 2017 -0800

efl_ui_bg: fix unclipped image on EFL_UI_IMAGE_SCALE_TYPE_NONE

@fix

Summary:
efl_ui_bg has internal image and image may be larger than
 resize_obj when EFL.UI.IMAGE.SCALE_TYPE is none.
 Now resize_obj clips the internal image.

Test Plan:
1.Run elementary_test, part background(will be added soon)
2.Create a bg in a box with other widgets.
  Set bg as EFL_UI_IMAGE_SCALYE_TYPE_NONE.

Reviewers: jpeg, cedric

Reviewed By: cedric

Subscribers: woohyun

Differential Revision: https://phab.enlightenment.org/D5509

Signed-off-by: Cedric Bail 
---
 data/elementary/themes/edc/elm/bg.edc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/data/elementary/themes/edc/elm/bg.edc 
b/data/elementary/themes/edc/elm/bg.edc
index ed5034f92d..48bdfcdedc 100644
--- a/data/elementary/themes/edc/elm/bg.edc
+++ b/data/elementary/themes/edc/elm/bg.edc
@@ -10,6 +10,10 @@ group { name: "elm/bg/base/default";
data.item: "version" "119";
images.image: "bevel_dark_out.png" COMP;
parts {
+  part { name: "clipper"; type: RECT;
+ description { state: "default" 0.0;
+ }
+  }
   part { name: "base"; type: RECT;
  description { state: "default" 0.0;
 color_class: "dialog_base";
@@ -21,7 +25,9 @@ group { name: "elm/bg/base/default";
  }
   }
   part { name: "elm.swallow.background"; type: SWALLOW;
+ clip_to: "clipper";
  description { state: "default" 0.0;
+fixed: 1 1;
  }
   }
   part { name: "bevel";

-- 




[EGIT] [core/efl] master 01/01: efl_ui_radio: keep radio state when theme is changed

2017-11-07 Thread Sungtaek Hong
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=439fbe4bcb4c34ff7dabd802bd4e139b57f6dd50

commit 439fbe4bcb4c34ff7dabd802bd4e139b57f6dd50
Author: Sungtaek Hong 
Date:   Tue Nov 7 21:08:40 2017 +0900

efl_ui_radio: keep radio state when theme is changed

Summary:
during elm_widget_theme_apply() state was set to off when state is on.
@fix

Test Plan: change locale/theme when a radio is on.

Reviewers: jpeg, cedric, woohyun

Differential Revision: https://phab.enlightenment.org/D5432
---
 src/lib/elementary/efl_ui_radio.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_radio.c 
b/src/lib/elementary/efl_ui_radio.c
index 3281fecaa9..c6ef4f0904 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -157,8 +157,6 @@ _efl_ui_radio_elm_widget_theme_apply(Eo *obj, 
Efl_Ui_Radio_Data *sd)
if (sd->state) elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
else elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
 
-   if (sd->state) _state_set(obj, EINA_FALSE, EINA_FALSE);
-
edje_object_message_signal_process(wd->resize_obj);
 
/* FIXME: replicated from elm_layout just because radio's icon

-- 




[EGIT] [core/efl] master 01/01: edje_cc_script: remove build warning

2017-11-03 Thread Sungtaek Hong
conr2d pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=70b23b5fc7caa15f4a91371126bf463159a7df09

commit 70b23b5fc7caa15f4a91371126bf463159a7df09
Author: Sungtaek Hong 
Date:   Sat Nov 4 14:41:44 2017 +0900

edje_cc_script: remove build warning

Summary: initiate pointer var with NULL to remove build warning

Reviewers: conr2d

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5423
---
 src/bin/edje/edje_cc_script.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/edje/edje_cc_script.c b/src/bin/edje/edje_cc_script.c
index 4e81fb3e53..840945ed73 100644
--- a/src/bin/edje/edje_cc_script.c
+++ b/src/bin/edje/edje_cc_script.c
@@ -66,7 +66,7 @@ code_parse(Code *code)
 static void
 code_parse_internal(Code *code)
 {
-   Code_Symbol *sym = NULL, *func;
+   Code_Symbol *sym = NULL, *func = NULL;
Token *token, *tmp;
char *begin = code->shared;
char *end = begin + strlen(begin);

-- 




[EGIT] [core/efl] master 01/01: efl_ui_radio: remove some legacy code

2017-11-01 Thread Sungtaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5f7710f561dd91b7d417a10e65b9f767e1d11da0

commit 5f7710f561dd91b7d417a10e65b9f767e1d11da0
Author: Sungtaek Hong 
Date:   Wed Nov 1 10:15:48 2017 -0700

efl_ui_radio: remove some legacy code

Summary:
This uses constructor/destructor instead of group_add/group_del.

Note: finalize can't be used for theme loading as any action done
inside
efl_add(...) would be lost (eg. part text set).

Test Plan: 1) run elementary_test -to radio

Reviewers: jpeg, woohyun, cedric

Subscribers: akanad

Differential Revision: https://phab.enlightenment.org/D5404

Signed-off-by: Cedric BAIL 
---
 src/lib/elementary/efl_ui_check.c  |  1 -
 src/lib/elementary/efl_ui_radio.c  | 56 +++---
 src/lib/elementary/efl_ui_radio.eo |  1 +
 3 files changed, 23 insertions(+), 35 deletions(-)

diff --git a/src/lib/elementary/efl_ui_check.c 
b/src/lib/elementary/efl_ui_check.c
index 0cce3e3951..6a23310d92 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -323,7 +323,6 @@ _efl_ui_check_efl_object_constructor(Eo *obj, 
Efl_Ui_Check_Data *pd EINA_UNUSED)
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
-   elm_widget_sub_object_parent_add(obj);
 
if (!elm_layout_theme_set(obj, "check", "base", elm_widget_style_get(obj)))
  CRI("Failed to set layout!");
diff --git a/src/lib/elementary/efl_ui_radio.c 
b/src/lib/elementary/efl_ui_radio.c
index da7521ac5d..c2edeb7b21 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -26,7 +26,7 @@ static const Elm_Layout_Part_Alias_Description 
_text_aliases[] =
 
 static const char SIG_CHANGED[] = "changed";
 static const Evas_Smart_Cb_Description _smart_callbacks[] = {
-   {SIG_CHANGED, ""},
+   {SIG_CHANGED, ""}, /**< handled by efl_ui_check */
{SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
{SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
{SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
@@ -202,61 +202,50 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
return strdup(E_("State: Off"));
 }
 
-EOLIAN static void
-_efl_ui_radio_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Radio_Data *priv)
+EAPI Evas_Object *
+elm_radio_add(Evas_Object *parent)
 {
-   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+   return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+}
 
-   efl_canvas_group_add(efl_super(obj, EFL_UI_CHECK_CLASS));
-   elm_widget_sub_object_parent_add(obj);
+EOLIAN static Eo *
+_efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd)
+{
+   obj = efl_constructor(efl_super(obj, MY_CLASS));
+   efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+   evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
 
if (!elm_layout_theme_set(obj, "radio", "base", elm_widget_style_get(obj)))
  CRI("Failed to set layout!");
 
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
elm_layout_signal_callback_add
  (obj, "elm,action,radio,toggle", "*", _radio_on_cb, obj);
 
-   priv->group = calloc(1, sizeof(Group));
-   priv->group->radios = eina_list_append(priv->group->radios, obj);
-
-   elm_widget_can_focus_set(obj, EINA_TRUE);
+   pd->group = calloc(1, sizeof(Group));
+   pd->group->radios = eina_list_append(pd->group->radios, obj);
 
elm_layout_sizing_eval(obj);
 
-   _elm_access_object_register(obj, wd->resize_obj);
+   efl_access_role_set(obj, EFL_ACCESS_ROLE_RADIO_BUTTON);
_elm_access_text_set
  (_elm_access_info_get(obj), ELM_ACCESS_TYPE, E_("Radio"));
_elm_access_callback_set
  (_elm_access_info_get(obj), ELM_ACCESS_INFO, _access_info_cb, obj);
_elm_access_callback_set
  (_elm_access_info_get(obj), ELM_ACCESS_STATE, _access_state_cb, obj);
-}
 
-EOLIAN static void
-_efl_ui_radio_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Radio_Data *sd)
-{
-   sd->group->radios = eina_list_remove(sd->group->radios, obj);
-   if (!sd->group->radios) free(sd->group);
-
-   efl_canvas_group_del(efl_super(obj, EFL_UI_CHECK_CLASS));
-}
-
-EAPI Evas_Object *
-elm_radio_add(Evas_Object *parent)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-   return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+   return obj;
 }
 
-EOLIAN static Eo *
-_efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *_pd 
EINA_UNUSED)
+EOLIAN static void
+_efl_ui_radio_efl_object_destructo

[EGIT] [core/elementary] master 02/03: map: separate name, route source logic

2016-03-22 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=635b02a440bc0d95d4eb043e1ee4dd55181ce93b

commit 635b02a440bc0d95d4eb043e1ee4dd55181ce93b
Author: SungTaek Hong 
Date:   Tue Mar 22 15:58:18 2016 -0700

map: separate name, route source logic

Summary:
 - So far, elm_map only provides Open Street Map
   and lacks ability to expand to other map providers
   since it's xml parse only fits into that of OSM.
 - This patch is to make route and name source same to
   tile source, which supports other map tile providers.

Reviewers: woohyun, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3303

Signed-off-by: Cedric BAIL 
---
 src/lib/elm_map.c  | 31 ---
 src/lib/elm_widget_map.h   |  6 ++
 src/modules/test_map/mod.c | 19 +++
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c
index b4f9152..b64129f 100644
--- a/src/lib/elm_map.c
+++ b/src/lib/elm_map.c
@@ -274,12 +274,13 @@ static const Source_Tile src_tiles[] =
 _scale_cb}
 };
 
+static void _kml_parse(Elm_Map_Route *r);
 // FIXME: Fix more open sources
 static const Source_Route src_routes[] =
 {
-   {"Yours", _yours_url_cb}// http://www.yournavigation.org/
-   //{"Monav", _monav_url_cb},
-   //{"ORS", _ors_url_cb}, // http://www.openrouteservice.org
+   {"Yours", _yours_url_cb, _kml_parse}// http://www.yournavigation.org/
+   //{"Monav", _monav_url_cb, _kml_parse},
+   //{"ORS", _ors_url_cb, _kml_parse)}, // http://www.openrouteservice.org
 };
 
 // Scale in meters
@@ -289,10 +290,12 @@ static const double _scale_tb[] =
2, 1, 5000, 2000, 1000, 500, 500, 200, 100, 50, 20, 10, 5, 2, 1
 };
 
+static void _name_parse(Elm_Map_Name *n);
+static void _name_list_parse(Elm_Map_Name_List *nl);
 // FIXME: Add more open sources
 static const Source_Name src_names[] =
 {
-   {"Nominatim", _nominatim_url_cb}
+   {"Nominatim", _nominatim_url_cb, _name_parse, _name_list_parse}
 };
 
 static int id_num = 1;
@@ -3068,7 +3071,7 @@ _route_cb(void *data,
route->job = NULL;
if (status == 200)
  {
-_kml_parse(route);
+sd->src_route->route_parse_cb(route);
 INF("Route request success from (%lf, %lf) to (%lf, %lf)",
 route->flon, route->flat, route->tlon, route->tlat);
 if (route->cb) route->cb(route->data, sd->obj, route);
@@ -3105,7 +3108,7 @@ _name_cb(void *data,
name->job = NULL;
if (status == 200)
  {
-_name_parse(name);
+sd->src_name->name_parse_cb(name);
 INF("Name request success address:%s, lon:%lf, lat:%lf",
 name->address, name->lon, name->lat);
 if (name->cb) name->cb(name->data, sd->obj, name);
@@ -3141,7 +3144,7 @@ _name_list_cb(void *data,
name_list->job = NULL;
if (status == 200)
  {
-_name_list_parse(name_list);
+sd->src_name->name_list_parse_cb(name_list);
 INF("Name List request success address");
 if (name_list->cb)
   name_list->cb(name_list->data, wd->obj,
@@ -3476,6 +3479,8 @@ _source_mod_cb(Eina_Module *m,
Elm_Map_Module_Tile_Geo_to_Coord_Func geo_to_coord;
Elm_Map_Module_Tile_Coord_to_Geo_Func coord_to_geo;
Elm_Map_Module_Route_Url_Func route_url_cb;
+   Elm_Map_Module_Name_Parse_Func name_parse_cb;
+   Elm_Map_Module_Name_List_Parse_Func name_list_parse_cb;
Elm_Map_Module_Name_Url_Func name_url_cb;
 
EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
@@ -3539,6 +3544,9 @@ _source_mod_cb(Eina_Module *m,
 s = ELM_NEW(Source_Route);
 s->name = name_cb();
 s->url_cb = route_url_cb;
+s->route_parse_cb = eina_module_symbol_get(m, 
"map_module_route_source_parse");
+if (!s->route_parse_cb)
+  s->route_parse_cb = _kml_parse;
 sd->src_routes = eina_list_append(sd->src_routes, s);
  }
 
@@ -3551,6 +3559,12 @@ _source_mod_cb(Eina_Module *m,
 s = ELM_NEW(Source_Name);
 s->name = name_cb();
 s->url_cb = name_url_cb;
+s->name_parse_cb = eina_module_symbol_get(m, 
"map_module_name_source_parse");
+if (!s->name_parse_cb)
+  s->name_parse_cb = _name_parse;
+s->name_list_parse_cb = eina_module_symbol_get(m, 
"map_module_name_list_source_parse");
+if (!s->name_list_parse_cb)
+  s->name_list_parse_cb = _name_list_parse;
 sd->src_names = eina_list_append(sd->src_names, s);
  }
return EINA_TRUE;
@@ -3622,6 +3636,7 @@ _source_all_load(Elm_Map_Data *sd)
 src_r

[EGIT] [core/elementary] master 10/11: map: fix memory leak

2016-03-04 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=f7f362d0417f3cea2f24b20d2a5474e1343136a6

commit f7f362d0417f3cea2f24b20d2a5474e1343136a6
Author: SungTaek Hong 
Date:   Fri Mar 4 16:02:15 2016 -0800

map: fix memory leak

Summary:
- in dump_cb buf is allocated by malloc() ->strdup() -> free.
  This is needless.
- And buf allocated in dump_cb is strdup again.
  This may cause memory leak.

Reviewers: Hermet, woohyun, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3752

Signed-off-by: Cedric BAIL 
---
 src/lib/elm_map.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c
index b88edac..3dc 100644
--- a/src/lib/elm_map.c
+++ b/src/lib/elm_map.c
@@ -2791,11 +2791,9 @@ _xml_route_dump_cb(void *data,
  snprintf(buf, length, "%s", value);
  if (dump->id == ROUTE_XML_DISTANCE) dump->distance = _elm_atof(buf);
  else if (!(dump->description) && (dump->id == ROUTE_XML_DESCRIPTION))
-   dump->description = strdup(buf);
+   dump->description = buf;
  else if (dump->id == ROUTE_XML_COORDINATES)
-   dump->coordinates = strdup(buf);
-
- free(buf);
+   dump->coordinates = buf;
   }
   break;
 
@@ -2844,8 +2842,7 @@ _xml_name_dump_cb(void *data,
 
  if (!buf) return EINA_FALSE;
  snprintf(buf, length + 1, "%s", value);
- if (dump->id == NAME_XML_NAME) dump->address = strdup(buf);
- free(buf);
+ if (dump->id == NAME_XML_NAME) dump->address = buf;
   }
   break;
 
@@ -2871,7 +2868,7 @@ _xml_name_dump_list_cb(void *data,
  {
 name = calloc(1, sizeof(Elm_Map_Name));
 if (!name) return EINA_FALSE;
-name->address = strdup(dump.address);
+name->address = dump.address;
 name->lon = dump.lon;
 name->lat = dump.lat;
 name->wsd = name_list->wsd;
@@ -2941,6 +2938,7 @@ _kml_parse(Elm_Map_Route *r)
   free(str[0]);
   free(str);
}
+ free(dump.description);
   }
 else WRN("description is not found !");
 
@@ -2970,6 +2968,7 @@ _kml_parse(Elm_Map_Route *r)
   free(str[0]);
   free(str);
}
+ free(dump.coordinates);
   }
  }
 }
@@ -3011,7 +3010,7 @@ _name_parse(Elm_Map_Name *n)
 if (dump.address)
   {
  INF("[%lf : %lf] ADDRESS : %s", n->lon, n->lat, dump.address);
- n->address = strdup(dump.address);
+ n->address = dump.address;
   }
 n->lon = dump.lon;
 n->lat = dump.lat;

-- 




[EGIT] [core/elementary] master 02/02: edje_external: check icon param after other param is set in entry

2016-02-18 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=512fe5fd3d1561e2d7b7c4517ceee24da3744ddc

commit 512fe5fd3d1561e2d7b7c4517ceee24da3744ddc
Author: SungTaek Hong 
Date:   Thu Feb 18 13:31:26 2016 -0800

edje_external: check icon param after other param is set in entry

Summary:
- icon param add an elm_icon and content set to icon part.
- entry's style is changing as other params are set and
  icon part may not exist in certain condition(default has no icon part)
- checking icon param later than other params will set icon part
  after the style is changed.

Reviewers: cedric, woohyun, jpeg, herdsman, tasn

Reviewed By: tasn

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D3693

Signed-off-by: Cedric BAIL 
---
 src/edje_externals/elm_entry.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/edje_externals/elm_entry.c b/src/edje_externals/elm_entry.c
index 973a8bb..51f3c08 100644
--- a/src/edje_externals/elm_entry.c
+++ b/src/edje_externals/elm_entry.c
@@ -57,8 +57,6 @@ external_entry_state_set(void *data EINA_UNUSED, Evas_Object 
*obj,
 
if (p->label)
  elm_object_text_set(obj, p->label);
-   if (p->icon)
- elm_object_part_content_set(obj, "icon", p->icon);
if (p->entry)
  elm_object_text_set(obj, p->entry);
if (p->scrollable_exists)
@@ -84,6 +82,8 @@ external_entry_state_set(void *data EINA_UNUSED, Evas_Object 
*obj,
 line_wrap = _entry_line_wrap_choices_setting_get(p->line_wrap);
 elm_entry_line_wrap_set(obj, line_wrap);
  }
+   if (p->icon)
+ elm_object_part_content_set(obj, "icon", p->icon);
 }
 
 static Eina_Bool

-- 




[EGIT] [core/elementary] master 06/06: map: add scale_cb for map module

2016-02-17 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=3dd12dd120206c7199597449cb13eca370b79cb3

commit 3dd12dd120206c7199597449cb13eca370b79cb3
Author: SungTaek Hong 
Date:   Wed Feb 17 17:03:10 2016 -0800

map: add scale_cb for map module

Summary:
- in elm_map's _source_mod_cb(), scale_cb is needed to
  load MAP tile module.
- currently, test_map mod.c lacks this scale_cb
  and fails to load Map Tile source.

Reviewers: woohyun, Hermet, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3702

Signed-off-by: Cedric BAIL 
---
 src/modules/test_map/mod.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/modules/test_map/mod.c b/src/modules/test_map/mod.c
index 7699390..39bc524 100644
--- a/src/modules/test_map/mod.c
+++ b/src/modules/test_map/mod.c
@@ -62,6 +62,12 @@ map_module_tile_coord_to_geo(const Evas_Object *obj 
EINA_UNUSED, int zoom EINA_U
return EINA_FALSE;
 }
 
+EAPI double
+map_module_tile_scale_get(const Evas_Object *obj EINA_UNUSED, double lon 
EINA_UNUSED, double lat EINA_UNUSED, int zoom EINA_UNUSED)
+{
+   return 0;
+}
+
 static Eina_Bool
 _module_init(void)
 {

-- 




[EGIT] [core/elementary] master 04/06: edje_external: fix wrong logic in index

2016-02-17 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=b704aa0ce2eaafa267db0b46c654e00fe74c5fbf

commit b704aa0ce2eaafa267db0b46c654e00fe74c5fbf
Author: SungTaek Hong 
Date:   Wed Feb 17 16:56:30 2016 -0800

edje_external: fix wrong logic in index

Summary:
- Eina_Bool active_exists is to check whether Eina_Bool active
  is valid or not.
- Setting active_exists to autohide_disabled_set is apparently wrong.

Reviewers: Hermet, cedric, jpeg, woohyun

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D3695

Signed-off-by: Cedric BAIL 
---
 src/edje_externals/elm_index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/edje_externals/elm_index.c b/src/edje_externals/elm_index.c
index 30994e2..05415c8 100644
--- a/src/edje_externals/elm_index.c
+++ b/src/edje_externals/elm_index.c
@@ -20,7 +20,7 @@ external_index_state_set(void *data EINA_UNUSED, Evas_Object 
*obj,
else return;
 
if (p->active_exists)
- elm_index_autohide_disabled_set(obj, p->active_exists);
+ elm_index_autohide_disabled_set(obj, p->active);
 }
 
 static Eina_Bool

-- 




[EGIT] [core/elementary] master 04/06: layout: send signal when content is set to bg

2016-02-12 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=f5b3d50b8801d4ec450d4dfbc5e64ecebba8265e

commit f5b3d50b8801d4ec450d4dfbc5e64ecebba8265e
Author: SungTaek Hong 
Date:   Fri Feb 12 20:59:44 2016 +0100

layout: send signal when content is set to bg

Summary:
 - elm.swallow.background is a part reserved for customized bg.
 - When default bg image is already set, default bg has to be hidden when 
customized bg is set.
 - Emitting signal when a content is set to this part makes this hiding 
process a lot easier.

Reviewers: kimcinoo, cedric

Subscribers: cedric, kimcinoo

Differential Revision: https://phab.enlightenment.org/D3653

Signed-off-by: Cedric BAIL 
---
 src/lib/elm_layout.c | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index bc99d75..86d020c 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -40,6 +40,13 @@ static const Elm_Layout_Part_Alias_Description 
_content_aliases[] =
{NULL, NULL}
 };
 
+static const char *_elm_layout_swallow_parts[] = {
+   "elm.swallow.icon",
+   "elm.swallow.end",
+   "elm.swallow.background",
+   NULL
+};
+
 /* these are data operated by layout's class functions internally, and
  * should not be messed up by inhering classes */
 typedef struct _Elm_Layout_Sub_Object_Data   Elm_Layout_Sub_Object_Data;
@@ -133,12 +140,16 @@ _icon_signal_emit(Elm_Layout_Smart_Data *sd,
 {
char buf[1024];
const char *type;
+   int i;
 
//FIXME: Don't limit to the icon and end here.
// send signals for all contents after elm 2.0
-   if (sub_d->type != SWALLOW ||
-   (strcmp("elm.swallow.icon", sub_d->part) &&
-(strcmp("elm.swallow.end", sub_d->part return;
+   if (sub_d->type != SWALLOW) return;
+   for (i = 0;; i++)
+ {
+if (!_elm_layout_swallow_parts[i]) return;
+if (!strcmp(sub_d->part, _elm_layout_swallow_parts[i])) break;
+ }
 
if (!strncmp(sub_d->part, "elm.swallow.", strlen("elm.swallow.")))
  type = sub_d->part + strlen("elm.swallow.");

-- 




[EGIT] [core/elementary] master 11/12: button: remove unnecessary action in program

2016-02-04 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=ddd4d9c25bf086a48deb2c69dbd695f120e1e639

commit ddd4d9c25bf086a48deb2c69dbd695f120e1e639
Author: SungTaek Hong 
Date:   Fri Feb 5 08:21:13 2016 +0100

button: remove unnecessary action in program

Summary: @fix

Reviewers: kimcinoo, Hermet, cedric

Differential Revision: https://phab.enlightenment.org/D3658

Signed-off-by: Cedric BAIL 
---
 data/themes/edc/elm/button.edc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/data/themes/edc/elm/button.edc b/data/themes/edc/elm/button.edc
index 0dfb4d2..9982c17 100644
--- a/data/themes/edc/elm/button.edc
+++ b/data/themes/edc/elm/button.edc
@@ -342,7 +342,6 @@ group { name: "elm/button/base/default";
   }
   program { name: "button_icon_hidden";
  signal: "elm,state,icon,hidden"; source: "elm";
- action:  STATE_SET "default" 0.0;
  script {
 new m = get_int(btmode);
 m &= ~ICON; set_int(btmode, m);
@@ -703,7 +702,6 @@ group { name: "elm/button/base/anchor";
   }
   program { name: "button_icon_hidden";
  signal: "elm,state,icon,hidden"; source: "elm";
- action:  STATE_SET "default" 0.0;
  script {
 new m = get_int(btmode);
 m &= ~ICON; set_int(btmode, m);

-- 




[EGIT] [core/elementary] master 12/12: button: add elm.swallow.background part

2016-02-04 Thread SungTaek Hong
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=d4f02c0901e33f880219f6dc17cb545689cee211

commit d4f02c0901e33f880219f6dc17cb545689cee211
Author: SungTaek Hong 
Date:   Fri Feb 5 08:21:54 2016 +0100

button: add elm.swallow.background part

Summary:
- This swallow part is for custom bg image.
- previous bg has to be hid.

Reviewers: kimcinoo

Differential Revision: https://phab.enlightenment.org/D3657

Signed-off-by: Cedric BAIL 
---
 data/themes/edc/elm/button.edc | 98 +-
 1 file changed, 77 insertions(+), 21 deletions(-)

diff --git a/data/themes/edc/elm/button.edc b/data/themes/edc/elm/button.edc
index 9982c17..d6cfb08 100644
--- a/data/themes/edc/elm/button.edc
+++ b/data/themes/edc/elm/button.edc
@@ -8,12 +8,32 @@ group { name: "elm/button/base/default";
 #define MASK 3
 #define DISABLE  4
 #define PRESSED  8
+#define BACKGROUND  16
script {
   public btmode;
   public eval_mode(m) {
  new m1 = m & MASK;
  new d = m & DISABLE;
  new p = m & PRESSED;
+ new bg = m & BACKGROUND;
+ if (bg) {
+set_state(PART:"base", "hidden", 0.0);
+set_state(PART:"elm.swallow.background", "visible", 0.0);
+ } else {
+set_state(PART:"elm.swallow.background", "default", 0.0);
+if (!d) {
+   if (!p)
+ {
+  set_state(PART:"base", "default", 0.0);
+  set_state(PART:"base", "default", 0.0);
+ }
+   else {
+set_state(PART:"base", "pressed", 0.0);
+ }
+} else {
+   set_state(PART:"base", "disabled", 0.0);
+}
+ }
  if (m1 == (ICON | LABEL)) {
 if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
@@ -22,11 +42,9 @@ group { name: "elm/button/base/default";
if (!p) {
   set_state(PART:"elm.text", "visible", 0.0);
   set_state(PART:"icon_clip", "default", 0.0);
-  set_state(PART:"base", "default", 0.0);
} else {
   set_state(PART:"elm.text", "pressed_visible", 0.0);
   set_state(PART:"icon_clip", "pressed", 0.0);
-  set_state(PART:"base", "pressed", 0.0);
}
 } else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
@@ -34,7 +52,6 @@ group { name: "elm/button/base/default";
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
-   set_state(PART:"base", "disabled", 0.0);
 }
  } else if (m1 == (ICON)) {
 if (!d) {
@@ -42,20 +59,16 @@ group { name: "elm/button/base/default";
set_state(PART:"sizer.content", "icononly", 0.0);
set_state(PART:"event", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
-   if (!p) {
+   if (!p)
   set_state(PART:"icon_clip", "default", 0.0);
-  set_state(PART:"base", "default", 0.0);
-   } else {
+   else
   set_state(PART:"icon_clip", "pressed", 0.0);
-  set_state(PART:"base", "pressed", 0.0);
-   }
 } else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
-   set_state(PART:"base", "disabled", 0.0);
 }
  } else if (m1 == (LABEL)) {
 if (!d) {
@@ -63,20 +76,16 @@ group { name: "elm/button/base/default";
set_state(PART:"sizer.content", "default", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_stat