cedric pushed a commit to branch master.

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

commit 73f8b3b78f0ff92ddfc1c16426bf7c176f10293a
Author: Sungtaek Hong <sth253.h...@samsung.com>
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 <ced...@osg.samsung.com>
---
 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 LABEL    2
+#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(PART:"elm.text", "default", 0.0);
+               set_state(PART:"icon_clip", "disabled", 0.0);
+               set_state(PART:"event", "disabled", 0.0);
+            }
+         } else if (m1 == (LABEL)) {
+            if (!d) {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"icon_clip", "default", 0.0);
+               set_state(PART:"event", "default", 0.0);
+               if (!p)
+                  set_state(PART:"elm.text", "textonly", 0.0);
+               else
+                  set_state(PART:"elm.text", "pressed_textonly", 0.0);
+            } else {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"elm.text", "disabled_textonly", 0.0);
+               set_state(PART:"icon_clip", "disabled", 0.0);
+               set_state(PART:"event", "disabled", 0.0);
+            }
+         } else {
+            if (!d) {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"icon_clip", "default", 0.0);
+               set_state(PART:"event", "default", 0.0);
+            } else {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"icon_clip", "disabled", 0.0);
+               set_state(PART:"event", "disabled", 0.0);
+            }
+         }
+      }
+   }
+   parts {
+      image { "base";
+         desc { "default";
+            image.normal: "button_normal.png";
+            image.border: 4 4 3 5;
+            image.middle: SOLID;
+            rel1.offset: -1 0;
+            rel2.offset: 0 1;
+            fill.smooth: 0;
+            color_class: "button_bg";
+         }
+         desc { "pressed";
+            inherit: "default";
+            image.normal: "button_clicked.png";
+            image.border: 5 5 4 6;
+            color_class: "button_bg_pressed";
+         }
+         desc { "disabled";
+            inherit: "default";
+            color_class: "button_bg_disabled";
+         }
+         desc { "hidden";
+            inherit: "default";
+            visible: 0;
+         }
+      }
+      swallow { "elm.swallow.background"; nomouse;
+         required;
+         desc { "default";
+            rel1.to: "base";
+            rel2.to: "base";
+            visible: 0;
+         }
+         desc { "visible";
+            inherit: "default";
+            visible: 1;
+         }
+      }
+      rect { "icon_clip";
+         desc { "default";
+            color_class: "button_icon";
+         }
+         desc { "pressed";
+            inherit: "default";
+            color_class: "button_icon_pressed";
+         }
+         desc { "disabled";
+            inherit: "default";
+            color_class: "button_icon_disabled";
+         }
+      }
+      swallow { "elm.swallow.content"; nomouse;
+         clip_to: "icon_clip";
+         required;
+         desc { "default";
+            fixed: 1 0;
+            align: 0.0 0.5;
+            rel1.offset: 6 5;
+            rel1.to: "base";
+            rel2.relative: 0.0 1.0;
+            rel2.offset: 6 -8;
+            rel2.to: "base";
+            visible: 0;
+         }
+         desc { "visible";
+            inherit: "default";
+            fixed: 1 0;
+            aspect: 1.0 1.0;
+            visible: 1;
+         }
+         desc { "icononly";
+            inherit: "default";
+            fixed: 0 0;
+            align: 0.5 0.5;
+            rel2.relative: 1.0 1.0;
+            rel2.offset: -7 -8;
+            visible: 1;
+         }
+      }
+      text { "sizer.content"; nomouse;
+         scale: 1;
+         desc { "default";
+//            fixed: 1 1;
+            visible: 0;
+            text { font: FN; size: 10;
+               min: 0 0;
+               text_class: "button_text";
+            }
+         }
+         desc { "visible";
+            inherit: "default";
+            rel1.to: "elm.swallow.content";
+            rel2.to: "elm.swallow.content";
+            text {
+               min: 1 1;
+               ellipsis: -1;
+               text: "M";
+            }
+         }
+         desc { "icononly";
+            inherit: "default";
+            rel1.to: "elm.swallow.content";
+            rel2.to: "elm.swallow.content";
+            text {
+               min: 1 1;
+               ellipsis: -1;
+               text: "M";
+            }
+         }
+      }
+      text { "elm.text"; nomouse;
+         effect: SHADOW BOTTOM;
+         scale;
+         required;
+         desc { "default";
+            rel1.offset: 0 5;
+            rel1.relative: 1.0 0.0;
+            rel1.to_x: "elm.swallow.content";
+            rel1.to_y: "base";
+            rel2.offset: -8 -8;
+            rel2.to: "base";
+            color_class: "button_text";
+            color3: 255 255 255 255;
+            text { font: FN; size: 10;
+               align: 0.5 0.5;
+               min: 0 0;
+               text_class: "button";
+            }
+            visible: 0;
+            fixed: 1 1;
+         }
+         desc { "visible";
+            inherit: "default";
+            rel1.offset: 2 5;
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+            fixed: 0 0;
+         }
+         desc { "pressed_visible";
+            inherit: "default";
+            rel1.offset: 2 5;
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+            fixed: 0 0;
+            color_class: "button_text_pressed";
+         }
+         desc { "textonly";
+            inherit: "default";
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+            fixed: 0 0;
+         }
+         desc { "pressed_textonly";
+            inherit: "default";
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+            fixed: 0 0;
+            color_class: "button_text_pressed";
+         }
+         desc { "disabled_visible";
+            inherit: "default";
+            rel1.offset: 2 5;
+            color_class: "button_text_disabled";
+            color3: 255 255 255 255;
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+            fixed: 0 0;
+         }
+         desc { "disabled_textonly";
+            inherit: "default";
+            color_class: "button_text_disabled";
+            color3: 255 255 255 255;
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+            fixed: 0 0;
+         }
+      }
+      rect { "event";
+         desc { "default";
+            color: 0 0 0 0;
+         }
+         desc { "disabled";
+            inherit: "default";
+            visible: 0;
+         }
+      }
+   }
+   programs {
+      program {
+         signal: "mouse,down,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,press" "elm";
+         after: "button_click_anim";
+      }
+      program { name: "button_click_anim";
+         script {
+            new m = get_int(btmode);
+            m |= PRESSED; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_unclick";
+         signal: "mouse,up,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,unpress" "elm";
+         after: "button_unclick_anim";
+      }
+      program { name: "button_unclick_anim";
+         script {
+            new m = get_int(btmode);
+            m &= ~PRESSED; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "buttonactivate";
+         signal: "elm,anim,activate"; source: "elm";
+         action: STATE_SET "pressed" 0.0;
+         target: "base";
+         after: "button_unpressed_anim";
+      }
+      program { name: "button_unpressed_anim";
+         action: STATE_SET "default" 0.0;
+         in: 0.5 0.0;
+         target: "base";
+      }
+      program {
+         signal: "mouse,clicked,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,click" "elm";
+      }
+      program { name: "button_text_visible";
+         signal: "elm,state,elm.text,set"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m |= LABEL; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_text_hidden";
+         signal: "elm,state,elm.text,unset"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m &= ~LABEL; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_icon_visible";
+         signal: "elm,state,content,set"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m |= ICON; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_icon_hidden";
+         signal: "elm,state,content,unset"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m &= ~ICON; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_background_visible";
+         signal: "elm,state,background,set"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m |= BACKGROUND; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_background_hidden";
+         signal: "elm,state,background,unset"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m &= ~BACKGROUND; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_state_disabled";
+         signal: "elm,state,disabled"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m |= DISABLE; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_state_enabled";
+         signal: "elm,state,enabled"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m &= ~DISABLE; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+   }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
+#undef PRESSED
+#undef BACKGROUND
 }
 
-group { "efl/button:anchor";
-   inherit: "elm/button/base/anchor";
+group { name: "efl/button:anchor";
+   images.image: "horizontal_separated_bar_small_glow.png" COMP;
+#define ICON     1
+#define LABEL    2
+#define MASK     3
+#define DISABLE  4
+   script {
+      public btmode;
+      public eval_mode(m) {
+         new m1 = m & MASK;
+         new d = m & DISABLE;
+         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:"elm.text", "visible", 0.0);
+               set_state(PART:"icon_clip", "default", 0.0);
+               set_state(PART:"bar", "default", 0.0);
+               set_state(PART:"event", "default", 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:"bar", "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:"elm.text", "default", 0.0);
+               set_state(PART:"icon_clip", "default", 0.0);
+               set_state(PART:"bar", "default", 0.0);
+               set_state(PART:"event", "default", 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:"bar", "disabled", 0.0);
+               set_state(PART:"event", "disabled", 0.0);
+            }
+         } else if (m1 == (LABEL)) {
+            if (!d) {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"elm.text", "textonly", 0.0);
+               set_state(PART:"icon_clip", "default", 0.0);
+               set_state(PART:"bar", "default", 0.0);
+               set_state(PART:"event", "default", 0.0);
+            } else {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"elm.text", "disabled_textonly", 0.0);
+               set_state(PART:"icon_clip", "disabled", 0.0);
+               set_state(PART:"bar", "disabled", 0.0);
+               set_state(PART:"event", "disabled", 0.0);
+            }
+         } else {
+            if (!d) {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"icon_clip", "default", 0.0);
+               set_state(PART:"bar", "default", 0.0);
+               set_state(PART:"event", "default", 0.0);
+            } else {
+               set_state(PART:"elm.swallow.content", "default", 0.0);
+               set_state(PART:"sizer.content", "default", 0.0);
+               set_state(PART:"icon_clip", "disabled", 0.0);
+               set_state(PART:"bar", "disabled", 0.0);
+               set_state(PART:"event", "disabled", 0.0);
+            }
+         }
+      }
+   }
+   parts {
+      rect { "base";
+         desc { "default";
+            color: 0 0 0 0;
+         }
+      }
+      rect { "icon_clip";
+         desc { "default";
+         }
+         desc { "disabled";
+            inherit: "default";
+            color: 255 255 255 64;
+         }
+      }
+      swallow { "elm.swallow.background"; nomouse;
+         desc { "default";
+            rel1.to: "base";
+            rel2.to: "base";
+            visible: 0;
+         }
+         desc { "visible";
+            inherit: "default";
+            visible: 1;
+         }
+      }
+      swallow { "elm.swallow.content"; nomouse;
+         clip_to: "icon_clip";
+         desc { "default";
+            fixed: 1 0;
+            align: 0.0 0.5;
+            rel1.offset: 0 4;
+            rel1.to: "base";
+            rel2.relative: 0.0 1.0;
+            rel2.offset: 0 -5;
+            rel2.to: "base";
+            visible: 0;
+         }
+         desc { "visible";
+            inherit: "default";
+            fixed: 1 0;
+            aspect: 1.0 1.0;
+            visible: 1;
+         }
+         desc { "icononly";
+            inherit: "default";
+            fixed: 0 0;
+            align: 0.5 0.5;
+            rel2.relative: 1.0 1.0;
+            rel2.offset: -1 -5;
+            visible: 1;
+         }
+      }
+      text { "sizer.content"; nomouse;
+         scale: 1;
+         desc { "default";
+            visible: 0;
+            text { font: FN; size: 10;
+               min: 0 0;
+               text_class: "button_text";
+            }
+         }
+         desc { "visible";
+            inherit: "default";
+            rel1.to: "elm.swallow.content";
+            rel2.to: "elm.swallow.content";
+            text {
+               min: 1 1;
+               ellipsis: -1;
+               text: "M";
+            }
+         }
+         desc { "icononly";
+            inherit: "default";
+            rel1.to: "elm.swallow.content";
+            rel2.to: "elm.swallow.content";
+            text {
+               min: 1 1;
+               ellipsis: -1;
+               text: "M";
+            }
+         }
+      }
+      text { "elm.text"; nomouse;
+         effect: GLOW;
+         scale: 1;
+         desc { "default";
+            rel1.offset: -2 0;
+            rel1.relative: 1.0 0.0;
+            rel1.to_x: "elm.swallow.content";
+            rel1.to_y: "base";
+            rel2.offset: -1 -1;
+            rel2.to: "base";
+            color_class: "button_text_anchor";
+            color2: 255 255 255 255;
+            color3: 255 255 255 255;
+            text { font: FN; size: 10;
+               align: 0.5 0.5;
+               min: 0 0;
+               text_class: "button_anchor";
+            }
+            visible: 0;
+         }
+         desc { "visible";
+            inherit: "default";
+            rel1.offset: 0 0;
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+         }
+         desc { "textonly";
+            inherit: "default";
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+         }
+         desc { "disabled_visible";
+            inherit: "default";
+            rel1.offset: 0 0;
+            color_class: "button_text_anchor_disabled";
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+         }
+         desc { "disabled_textonly";
+            inherit: "default";
+            color_class: "button_text_anchor_disabled";
+            text.min: 1 1;
+            text.ellipsis: -1;
+            visible: 1;
+         }
+      }
+      text { "text2"; nomouse;
+         effect: GLOW;
+         scale: 1;
+         desc { "default";
+            fixed: 1 1;
+            rel1.to: "elm.text";
+            rel2.to: "elm.text";
+            color_class: "button_text_anchor";
+            color2: 255 255 255 255;
+            color3: 255 255 255 255;
+            text { font: FN; size: 10;
+               text_source: "elm.text";
+               min: 1 1;
+               ellipsis: -1;
+               text_class: "button_anchor";
+            }
+            visible: 0;
+         }
+         desc { "clicked";
+            inherit: "default";
+            visible: 1;
+         }
+      }
+      image { "bar"; nomouse;
+         desc { "default";
+            image.normal: "horizontal_separated_bar_small_glow.png";
+            image.border: 4 4 4 4;
+            fill.smooth: 0;
+            fixed: 0 1;
+            rel1.relative: 0.0 1.0;
+            rel1.offset: -3 -6;
+            rel2.offset: 2 3;
+         }
+         desc { "disabled";
+            inherit: "default";
+            color: 255 255 255 64;
+         }
+      }
+      image { "bar2"; nomouse;
+         desc { "default";
+            image.normal: "horizontal_separated_bar_small_glow.png";
+            image.border: 4 4 4 4;
+            fill.smooth: 0;
+            rel1.to: "bar";
+            rel2.to: "bar";
+            color: 255 255 255 0;
+            visible: 0;
+         }
+         desc { "clicked";
+            inherit: "default";
+            color: 255 255 255 255;
+            visible: 1;
+         }
+      }
+      rect { "event";
+         desc { "default";
+            color: 0 0 0 0;
+         }
+         desc { "disabled";
+            inherit: "default";
+            visible: 0;
+         }
+      }
+   }
+   programs {
+      program {
+         signal: "mouse,down,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,press" "elm";
+         after: "button_click_anim";
+      }
+      program { name: "button_click_anim";
+         action: STATE_SET "clicked" 0.0;
+         target: "bar2";
+         target: "text2";
+      }
+      program {
+         signal: "mouse,up,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,unpress" "elm";
+         after: "button_unclick_anim";
+      }
+      program { name: "button_unclick_anim";
+         action: STATE_SET "default" 0.0;
+         target: "bar2";
+         target: "text2";
+      }
+      program {
+         signal: "elm,anim,activate"; source: "elm";
+         action: STATE_SET "clicked" 0.0;
+         target: "bar2";
+         target: "text2";
+         after: "button_unpressed_anim";
+      }
+      program { name: "button_unpressed_anim";
+         action: STATE_SET "default" 0.0;
+         in: 0.5 0.0;
+         target: "bar2";
+         target: "text2";
+      }
+      program {
+         signal: "mouse,clicked,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,click" "elm";
+      }
+      program { name: "button_text_visible";
+         signal: "elm,state,elm.text,set"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m |= LABEL; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_text_hidden";
+         signal: "elm,state,elm.text,unset"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m &= ~LABEL; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_icon_visible";
+         signal: "elm,state,content,set"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m |= ICON; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_icon_hidden";
+         signal: "elm,state,content,unset"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m &= ~ICON; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_background_visible";
+         signal: "elm,state,background,set"; source: "elm";
+         action: STATE_SET "visible" 0.0;
+         target: "elm.swallow.background";
+      }
+      program { name: "button_background_hidden";
+         signal: "elm,state,background,unset"; source: "elm";
+         action:  STATE_SET "default" 0.0;
+         target: "elm.swallow.background";
+      }
+      program { name: "button_state_disabled";
+         signal: "elm,state,disabled"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m |= DISABLE; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+      program { name: "button_state_enabled";
+         signal: "elm,state,enabled"; source: "elm";
+         script {
+            new m = get_int(btmode);
+            m &= ~DISABLE; set_int(btmode, m);
+            eval_mode(m);
+         }
+      }
+   }
+#undef ICON
+#undef LABEL
+#undef MASK
+#undef DISABLE
 }
-
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index f737b02005..2b9ab7dc71 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -61,7 +61,6 @@ elm_public_eolian_files = \
        lib/elementary/efl_ui_focus_layer.eo \
        lib/elementary/efl_ui_focus_composition.eo \
        lib/elementary/efl_ui_focus_util.eo \
-       lib/elementary/efl_ui_button_part.eo \
        lib/elementary/efl_ui_flip_part.eo \
        lib/elementary/efl_ui_layout_factory.eo \
        lib/elementary/efl_ui_layout_part.eo \
@@ -107,6 +106,7 @@ elm_public_eolian_files = \
 # More public files -- FIXME
 elm_public_eolian_files += \
        lib/elementary/efl_ui_legacy.eo \
+       lib/elementary/efl_ui_button_legacy_part.eo \
        lib/elementary/elm_spinner.eo \
        lib/elementary/elm_multibuttonentry_item.eo \
        lib/elementary/elm_interface_scrollable.eo \
diff --git a/src/lib/elementary/efl_ui_button.c 
b/src/lib/elementary/efl_ui_button.c
index b47fafd1bd..e9a5fcb632 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -10,7 +10,6 @@
 #include "elm_priv.h"
 #include "efl_ui_button_private.h"
 #include "elm_widget_layout.h"
-#include "efl_ui_button_part.eo.h"
 #include "elm_part_helper.h"
 
 #define MY_CLASS EFL_UI_BUTTON_CLASS
@@ -100,70 +99,6 @@ _efl_ui_button_efl_ui_widget_on_access_activate(Eo *obj, 
Efl_Ui_Button_Data *_pd
    return EINA_TRUE;
 }
 
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-static void
-_icon_signal_emit(Evas_Object *obj)
-{
-   char buf[64];
-
-   if (!elm_widget_resize_object_get(obj)) return;
-   snprintf(buf, sizeof(buf), "elm,state,icon,%s",
-            elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
-
-   elm_layout_signal_emit(obj, buf, "elm");
-   edje_object_message_signal_process(elm_layout_edje_get(obj));
-   elm_layout_sizing_eval(obj);
-}
-
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Button_Data *_pd 
EINA_UNUSED)
-{
-   Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
-
-   int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
-   if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
-   _icon_signal_emit(obj);
-
-   return int_ret;
-}
-
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-EOLIAN static Eina_Bool
-_efl_ui_button_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Button_Data 
*_pd EINA_UNUSED, Evas_Object *sobj)
-{
-   Eina_Bool int_ret = EINA_FALSE;
-
-   int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
-   if (!int_ret) return EINA_FALSE;
-
-   _icon_signal_emit(obj);
-
-   return EINA_TRUE;
-}
-
-/* FIXME: replicated from elm_layout just because button's icon spot
- * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
- * can changed the theme API */
-static Eina_Bool
-_efl_ui_button_content_set(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, const 
char *part, Evas_Object *content)
-{
-   Eina_Bool int_ret = EINA_FALSE;
-
-   int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), 
content);
-   if (!int_ret) return EINA_FALSE;
-
-   _icon_signal_emit(obj);
-
-   return EINA_TRUE;
-}
-
 static Eina_Bool
 _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
 {
@@ -405,20 +340,6 @@ ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_button, 
Efl_Ui_Button_Data)
 ELM_PART_CONTENT_DEFAULT_GET(efl_ui_button, _content_aliases[0].real_part)
 ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
 
-/* Efl.Part begin */
-
-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"
-
-/* Efl.Part end */
-
 EAPI void
 elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t)
 {
@@ -471,6 +392,7 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
 #include "efl_ui_button.eo.c"
 
 #include "efl_ui_button_legacy.eo.h"
+#include "efl_ui_button_legacy_part.eo.h"
 
 #define MY_CLASS_NAME_LEGACY "elm_button"
 
@@ -488,6 +410,84 @@ _efl_ui_button_legacy_efl_object_constructor(Eo *obj, void 
*_pd EINA_UNUSED)
    return obj;
 }
 
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static void
+_icon_signal_emit(Evas_Object *obj)
+{
+   char buf[64];
+
+   if (!elm_widget_resize_object_get(obj)) return;
+   snprintf(buf, sizeof(buf), "elm,state,icon,%s",
+            elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+
+   elm_layout_signal_emit(obj, buf, "elm");
+   edje_object_message_signal_process(elm_layout_edje_get(obj));
+   elm_layout_sizing_eval(obj);
+}
+
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Efl_Ui_Theme_Apply
+_efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
+{
+   Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+
+   int_ret = efl_ui_widget_theme_apply(efl_super(obj, 
EFL_UI_BUTTON_LEGACY_CLASS));
+   if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+   _icon_signal_emit(obj);
+
+   return int_ret;
+}
+
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+EOLIAN static Eina_Bool
+_efl_ui_button_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd 
EINA_UNUSED, Evas_Object *sobj)
+{
+   Eina_Bool int_ret = EINA_FALSE;
+
+   int_ret = elm_widget_sub_object_del(efl_super(obj, 
EFL_UI_BUTTON_LEGACY_CLASS), sobj);
+   if (!int_ret) return EINA_FALSE;
+
+   _icon_signal_emit(obj);
+
+   return EINA_TRUE;
+}
+
+/* FIXME: replicated from elm_layout just because button's icon spot
+ * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
+ * can changed the theme API */
+static Eina_Bool
+_efl_ui_button_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char 
*part, Evas_Object *content)
+{
+   Eina_Bool int_ret = EINA_FALSE;
+
+   int_ret = efl_content_set(efl_part(efl_super(obj, 
EFL_UI_BUTTON_LEGACY_CLASS), part), content);
+   if (!int_ret) return EINA_FALSE;
+
+   _icon_signal_emit(obj);
+
+   return EINA_TRUE;
+}
+
+/* Efl.Part begin */
+
+static Eina_Bool
+_part_is_efl_ui_button_legacy_part(const Eo *obj EINA_UNUSED, const char *part)
+{
+   return eina_streq(part, "elm.swallow.content");
+}
+
+ELM_PART_OVERRIDE_PARTIAL(efl_ui_button_legacy, EFL_UI_BUTTON_LEGACY, void, 
_part_is_efl_ui_button_legacy_part)
+ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_button_legacy, EFL_UI_BUTTON_LEGACY, void)
+#include "efl_ui_button_legacy_part.eo.c"
+
+/* Efl.Part end */
+
 EAPI Evas_Object *
 elm_button_add(Evas_Object *parent)
 {
diff --git a/src/lib/elementary/efl_ui_button.eo 
b/src/lib/elementary/efl_ui_button.eo
index 883bd34a96..e00707c620 100644
--- a/src/lib/elementary/efl_ui_button.eo
+++ b/src/lib/elementary/efl_ui_button.eo
@@ -15,11 +15,8 @@ class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, 
Efl.Ui.Autorepeat,
       Efl.Ui.Autorepeat.autorepeat_enabled { set; get; }
       Efl.Ui.Autorepeat.autorepeat_supported { get;}
       Efl.Ui.Widget.on_access_activate;
-      Efl.Ui.Widget.theme_apply;
-      Efl.Ui.Widget.widget_sub_object_del;
       Efl.Ui.Widget.widget_event;
       Efl.Access.Widget.Action.elm_actions { get; }
-      Efl.Part.part;
       Efl.Content.content { get; set; }
       Efl.Content.content_unset;
       Efl.Text.text { get; set; }
diff --git a/src/lib/elementary/efl_ui_button_legacy.eo 
b/src/lib/elementary/efl_ui_button_legacy.eo
index 91f104b89d..f867a0734c 100644
--- a/src/lib/elementary/efl_ui_button_legacy.eo
+++ b/src/lib/elementary/efl_ui_button_legacy.eo
@@ -9,5 +9,8 @@ class Efl.Ui.Button_Legacy (Efl.Ui.Button, Efl.Ui.Legacy)
    implements {
       class.constructor;
       Efl.Object.constructor;
+      Efl.Ui.Widget.theme_apply;
+      Efl.Ui.Widget.widget_sub_object_del;
+      Efl.Part.part;
    }
 }
diff --git a/src/lib/elementary/efl_ui_button_part.eo 
b/src/lib/elementary/efl_ui_button_legacy_part.eo
similarity index 66%
rename from src/lib/elementary/efl_ui_button_part.eo
rename to src/lib/elementary/efl_ui_button_legacy_part.eo
index d4c807dcc6..88b05c13f5 100644
--- a/src/lib/elementary/efl_ui_button_part.eo
+++ b/src/lib/elementary/efl_ui_button_legacy_part.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Button.Part (Efl.Ui.Layout.Part_Content)
+class Efl.Ui.Button_Legacy.Part (Efl.Ui.Layout.Part_Content)
 {
    [[Elementary button internal part class]]
    data: null;
diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index 6f15bb0629..7fe97fd0d7 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -158,11 +158,30 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd)
 
 /* common content cases for layout objects: icon and text */
 static inline void
+_signals_emit(Eo *obj,
+              const char *type,
+              Eina_Bool set)
+{
+   char buf[1024];
+
+   if (elm_widget_is_legacy(obj))
+     {
+        snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
+                 set ? "visible" : "hidden");
+     }
+   else
+     {
+        snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
+                 set ? "set" : "unset");
+     }
+   efl_layout_signal_emit(obj, buf, "elm");
+}
+
+static inline void
 _icon_signal_emit(Efl_Ui_Layout_Data *sd,
                   Efl_Ui_Layout_Sub_Object_Data *sub_d,
                   Eina_Bool visible)
 {
-   char buf[1024];
    const char *type;
    Eo *edje;
    int i;
@@ -173,10 +192,13 @@ _icon_signal_emit(Efl_Ui_Layout_Data *sd,
    //FIXME: Don't limit to the icon and end here.
    // send signals for all contents after elm 2.0
    if (sub_d->type != SWALLOW) return;
-   for (i = 0;; i++)
+   if (elm_widget_is_legacy(sd->obj))
      {
-        if (!_efl_ui_layout_swallow_parts[i]) return;
-        if (!strcmp(sub_d->part, _efl_ui_layout_swallow_parts[i])) break;
+        for (i = 0;; i++)
+          {
+              if (!_efl_ui_layout_swallow_parts[i]) return;
+              if (!strcmp(sub_d->part, _efl_ui_layout_swallow_parts[i])) break;
+          }
      }
 
    if (!strncmp(sub_d->part, "elm.swallow.", strlen("elm.swallow.")))
@@ -184,13 +206,10 @@ _icon_signal_emit(Efl_Ui_Layout_Data *sd,
    else
      type = sub_d->part;
 
-   snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
-            visible ? "visible" : "hidden");
-
-   edje_object_signal_emit(edje, buf, "elm");
+   _signals_emit(sd->obj, type, visible);
 
    /* themes might need immediate action here */
-   edje_object_message_signal_process(edje);
+   efl_layout_signal_process(sd->obj, EINA_FALSE);
 }
 
 static inline void
@@ -215,18 +234,19 @@ _text_signal_emit(Efl_Ui_Layout_Data *sd,
    else
      type = sub_d->part;
 
-   snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
-            visible ? "visible" : "hidden");
-   edje_object_signal_emit(wd->resize_obj, buf, "elm");
+   _signals_emit(sd->obj, type, visible);
 
    /* TODO: is this right? It was like that, but IMO it should be removed: */
-   snprintf(buf, sizeof(buf),
-            visible ? "elm,state,text,visible" : "elm,state,text,hidden");
 
-   edje_object_signal_emit(wd->resize_obj, buf, "elm");
+   if (elm_widget_is_legacy(sd->obj))
+     {
+        snprintf(buf, sizeof(buf),
+                 visible ? "elm,state,text,visible" : "elm,state,text,hidden");
+        efl_layout_signal_emit(sd->obj, buf, "elm");
+     }
 
    /* themes might need immediate action here */
-   edje_object_message_signal_process(wd->resize_obj);
+   efl_layout_signal_process(sd->obj, EINA_FALSE);
 }
 
 static void

-- 


Reply via email to