clean up toggle turds :)
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 16 Mar 2012 23:45:48 +0000 (23:45 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 16 Mar 2012 23:45:48 +0000 (23:45 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69478 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

21 files changed:
data/edje_externals/Makefile.am
data/edje_externals/ico_toggle.png [deleted file]
data/edje_externals/icons.edc
data/themes/Makefile.am
data/themes/default.edc
data/themes/widgets/check.edc
data/themes/widgets/toggle.edc [deleted file]
doc/Makefile.am
doc/examples.dox
doc/widgets/Makefile.am
doc/widgets/widget_preview_toggle.c [deleted file]
elementary.pc.in
po/POTFILES.in
src/bin/Makefile.am
src/bin/config.c
src/bin/test.c
src/bin/test_check.c
src/bin/test_toggle.c [deleted file]
src/edje_externals/modules.inc
src/examples/Makefile.am
src/examples/toggle_example_01.c [deleted file]

index 59de514..cdf7363 100644 (file)
@@ -33,7 +33,6 @@ ico_slider.png \
 ico_slideshow.png \
 ico_spinner.png \
 ico_thumb.png \
-ico_toggle.png \
 ico_toolbar.png
 
 icons.edj: Makefile $(EXTRA_DIST)
diff --git a/data/edje_externals/ico_toggle.png b/data/edje_externals/ico_toggle.png
deleted file mode 100644 (file)
index e22086a..0000000
Binary files a/data/edje_externals/ico_toggle.png and /dev/null differ
index e36ccea..34962c0 100644 (file)
@@ -31,7 +31,6 @@ ICON("slider")
 ICON("slideshow")
 ICON("spinner")
 ICON("thumb")
-ICON("toggle")
 ICON("toolbar")
 ICON("slideshow")
 
index 56ac20f..dd091bb 100644 (file)
@@ -41,7 +41,6 @@ widgets/thumb.edc \
 widgets/clock.edc \
 widgets/icon.edc \
 widgets/photocam.edc \
-widgets/toggle.edc \
 widgets/colorselector.edc \
 widgets/index.edc \
 widgets/photo.edc \
index 7615b92..28824e0 100644 (file)
@@ -322,7 +322,6 @@ collections {
 #include "widgets/scroller.edc"
 #include "widgets/label.edc"
 #include "widgets/button.edc"
-#include "widgets/toggle.edc"
 #include "widgets/clock.edc"
 #include "widgets/datetime.edc"
 #include "widgets/dayselector.edc"
index 28b554a..ba63cec 100644 (file)
@@ -247,3 +247,448 @@ group { name: "elm/check/base/default";
       }
    }
 }
+
+group { name: "elm/check/base/toggle";
+   images {
+      image: "shelf_inset.png" COMP;
+      image: "bt_basew.png" COMP;
+      image: "bt_bases.png" COMP;
+      image: "bt_hilightw.png" COMP;
+      image: "tog_base_on.png" COMP;
+      image: "tog_base_off.png" COMP;
+      image: "tog_dis_base_on.png" COMP;
+      image: "tog_dis_base_off.png" COMP;
+   }
+   script {
+      public is_rtl;
+   }
+   parts {
+      part { name: "bg";
+         type: RECT;
+         mouse_events: 0;
+         scale: 1;
+         description { state: "default" 0.0;
+            rel1.relative: 1.0 0.0;
+            rel1.offset: -4 3;
+            rel2.offset: -4 -4;
+            align: 1.0 0.5;
+            min: 96 16;
+            max: 96 16;
+            aspect: 4.0 4.0;
+            aspect_preference: VERTICAL;
+            color: 255 255 255 255;
+         }
+      }
+      part { name: "clipper";
+         type: RECT;
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            rel1.to: "bg";
+            rel2.to: "bg";
+            color: 255 255 255 255;
+         }
+      }
+      part { name: "button";
+         type: RECT;
+         scale: 1;
+         clip_to: "clipper";
+         mouse_events: 1;
+         dragable {
+            x: 1 1 0;
+            y: 0 0 0;
+            confine: "bg";
+         }
+         description { state: "default" 0.0;
+            fixed: 1 1;
+            rel1.to: "bg";
+            rel2.to: "bg";
+            min: 16 16;
+            max: 16 16;
+            aspect: 1.0 1.0;
+            aspect_preference: VERTICAL;
+            color: 0 0 0 0;
+         }
+      }
+      part { name: "button_events";
+         type: RECT;
+         dragable {
+            events: "button";
+         }
+         description { state: "default" 0.0;
+            rel1.to_x: "bg";
+            rel1.offset: 0 0;
+            rel1.relative: 0.0 0.0;
+            rel2.to_x: "bg";
+            rel2.offset: -1 -1;
+            rel2.relative: 1.0 1.0;
+            color: 0 0 0 0;
+         }
+      }
+      part { name: "onrect";
+         type: IMAGE;
+         scale: 1;
+         clip_to: "clipper";
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            rel1.to: "button";
+            rel1.relative: -5.0 0.0;
+            rel2.to: "button";
+            rel2.relative: 0.5 1.0;
+            image.normal: "tog_base_on.png";
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            image.normal: "tog_dis_base_on.png";
+         }
+      }
+      part { name: "offrect";
+         type: IMAGE;
+         scale: 1;
+         clip_to: "clipper";
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            rel1.to: "button";
+            rel1.relative: 0.5 0.0;
+            rel2.to: "button";
+            rel2.relative: 6.0 1.0;
+            image.normal: "tog_base_off.png";
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            image.normal: "tog_dis_base_off.png";
+         }
+      }
+      part { name: "elm.offtext";
+         type: TEXT;
+         mouse_events:  0;
+         scale: 1;
+         clip_to: "clipper";
+         description { state: "default" 0.0;
+            fixed: 1 1;
+            rel1.to_x: "button";
+            rel1.relative: 1.0 0.0;
+            rel2.to_x: "offrect";
+            color: 0 0 0 255;
+            text {
+               font:     "Sans,Edje-Vera";
+               size:     10;
+               min:      0 1;
+               align:    0.5 0.5;
+               text:     "OFF";
+            }
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            color: 128 128 128 128;
+         }
+      }
+      part { name: "elm.ontext";
+         type: TEXT;
+         effect: SOFT_SHADOW;
+         mouse_events:  0;
+         scale: 1;
+         clip_to: "clipper";
+         description { state: "default" 0.0;
+            fixed: 1 1;
+            rel1.to_x: "onrect";
+            rel1.offset: 1 1;
+            rel2.to_x: "button";
+            rel2.offset: 0 0;
+            rel2.relative: 0.0 1.0;
+            color: 224 224 224 255;
+            color3: 0 0 0 64;
+            text {
+               font:     "Sans,Edje-Vera";
+               size:     10;
+               min:      0 1;
+               align:    0.5 0.5;
+               text:     "ON";
+            }
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            color: 128 128 128 128;
+            color3: 0 0 0 24;
+         }
+      }
+      part { name: "conf_over";
+         mouse_events:  0;
+         description { state: "default" 0.0;
+            rel1.offset: -1 -1;
+            rel1.to: "bg";
+            rel2.offset: 0 0;
+            rel2.to: "bg";
+            image {
+               normal: "shelf_inset.png";
+               border: 7 7 7 7;
+               middle: 0;
+            }
+            fill.smooth : 0;
+         }
+      }
+      part { name: "button0";
+         mouse_events:  0;
+         clip_to: "clipper";
+         description { state: "default" 0.0;
+            rel1.to: "button2";
+            rel1.offset: -4 -4;
+            rel2.to: "button2";
+            rel2.offset: 3 3;
+            image {
+               normal: "bt_bases.png";
+               border: 11 11 11 11;
+            }
+            image.middle: SOLID;
+            color: 255 255 255 128;
+         }
+      }
+      part { name: "button2";
+         mouse_events:  0;
+         clip_to: "clipper";
+         description { state: "default" 0.0;
+            rel1.to: "button";
+            rel1.offset: -2 -2;
+            rel2.to: "button";
+            rel2.offset: 1 1;
+            image {
+               normal: "bt_basew.png";
+               border: 7 7 7 7;
+            }
+            image.middle: SOLID;
+         }
+      }
+      part { name: "button3";
+         mouse_events:  0;
+         clip_to: "clipper";
+         description { state: "default" 0.0;
+            rel1.to: "button2";
+            rel2.to: "button2";
+            rel2.relative: 1.0 0.5;
+            image {
+               normal: "bt_hilightw.png";
+               border: 4 4 4 0;
+            }
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+            fixed: 1 0;
+            visible: 0;
+            align: 0.0 0.5;
+            rel1.offset: 4 4;
+            rel2.relative: 0.0 1.0;
+            rel2.offset: 3 -5;
+         }
+         description { state: "visible" 0.0;
+            inherit: "default" 0.0;
+            visible: 1;
+            aspect: 1.0 1.0;
+            rel2.offset: 4 -5;
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            color: 128 128 128 128;
+         }
+         description { state: "disabled_visible" 0.0;
+            inherit: "default" 0.0;
+            color: 128 128 128 128;
+            visible: 1;
+            aspect: 1.0 1.0;
+         }
+      }
+      part { name: "elm.text";
+         type: TEXT;
+         mouse_events: 0;
+         scale: 1;
+         description { state: "default" 0.0;
+            visible: 0;
+            rel1.to_x: "elm.swallow.content";
+            rel1.relative: 1.0 0.0;
+            rel1.offset: 0 4;
+            rel2.to_x: "bg";
+            rel2.relative: 0.0 1.0;
+            rel2.offset: -5 -5;
+            color: 0 0 0 255;
+            text {
+               font: "Sans,Edje-Vera";
+               size: 10;
+               min: 0 0;
+               align: 0.0 0.5;
+            }
+         }
+         description { state: "visible" 0.0;
+            inherit: "default" 0.0;
+            visible: 1;
+            text.min: 1 1;
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            color: 128 128 128 128;
+         }
+         description { state: "disabled_visible" 0.0;
+            inherit: "default" 0.0;
+            color: 128 128 128 128;
+            visible: 1;
+            text.min: 1 1;
+         }
+      }
+      part { name: "disabler";
+         type: RECT;
+         description { state: "default" 0.0;
+            color: 0 0 0 0;
+            visible: 0;
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            visible: 1;
+         }
+      }
+   }
+   programs {
+      program { name:   "drag_end";
+         signal: "mouse,up,1";
+         source: "button";
+         script {
+            new Float:dx, Float:dy;
+            get_drag(PART:"button", dx, dy);
+            if (dx > 0.5)
+            {
+               set_drag(PART:"button", 1.0, 0.0);
+            }
+            else
+            {
+               set_drag(PART:"button", 0.0, 0.0);
+            }
+            if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
+            (get_int(is_rtl) == 0) && (dx > 0.5)) {
+               emit("elm,action,check,on", "");
+            }
+            else {
+               emit("elm,action,check,off", "");
+            }
+
+         }
+      }
+      program { name: "check_on";
+         signal: "elm,state,check,on";
+         source: "elm";
+         script {
+            new Float:drag;
+            if (get_int(is_rtl) == 0) {
+               drag = 100.0;
+            }
+            else {
+               drag = 0.0;
+            }
+            set_drag(PART:"button", drag, 0.0);
+         }
+      }
+      program { name: "check_off";
+         signal: "elm,state,check,off";
+         source: "elm";
+         script {
+            new Float:drag;
+            if (get_int(is_rtl) == 0) {
+               drag = 0.0;
+            }
+            else {
+               drag = 100.0;
+            }
+            set_drag(PART:"button", drag, 0.0);
+         }
+      }
+      program { name: "text_show";
+         signal: "elm,state,text,visible";
+         source: "elm";
+         action:  STATE_SET "visible" 0.0;
+         target: "elm.text";
+      }
+      program { name: "text_hide";
+         signal: "elm,state,text,hidden";
+         source: "elm";
+         action:  STATE_SET "default" 0.0;
+         target: "elm.text";
+      }
+      program { name: "icon_show";
+         signal: "elm,state,icon,visible";
+         source: "elm";
+         action:  STATE_SET "visible" 0.0;
+         target: "elm.swallow.content";
+      }
+      program { name: "icon_hide";
+         signal: "elm,state,icon,hidden";
+         source: "elm";
+         action:  STATE_SET "default" 0.0;
+         target: "elm.swallow.content";
+      }
+      program { name: "disable";
+         signal: "elm,state,disabled";
+         source: "elm";
+         action: STATE_SET "disabled" 0.0;
+         target: "elm.offtext";
+         target: "elm.ontext";
+         target: "onrect";
+         target: "offrect";
+         target: "disabler";
+         after: "disable_text";
+      }
+      program { name: "disable_text";
+         script {
+            new st[31];
+            new Float:vl;
+            get_state(PART:"elm.text", st, 30, vl);
+            if (!strcmp(st, "visible"))
+            set_state(PART:"elm.text", "disabled_visible", 0.0);
+            else
+            set_state(PART:"elm.text", "disabled", 0.0);
+
+            get_state(PART:"elm.swallow.content", st, 30, vl);
+            if (!strcmp(st, "visible"))
+            set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
+            else
+            set_state(PART:"elm.swallow.content", "disabled", 0.0);
+         }
+      }
+      program { name: "enable";
+         signal: "elm,state,enabled";
+         source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "disabler";
+         target: "onrect";
+         target: "offrect";
+         after: "enable_text";
+      }
+      program { name: "enable_text";
+         script {
+            new st[31];
+            new Float:vl;
+            get_state(PART:"elm.text", st, 30, vl);
+            if (!strcmp(st, "disabled_visible"))
+            set_state(PART:"elm.text", "visible", 0.0);
+            else
+            set_state(PART:"elm.text", "default", 0.0);
+
+            get_state(PART:"elm.swallow.content", st, 30, vl);
+            if (!strcmp(st, "visible"))
+            set_state(PART:"elm.swallow.content", "visible", 0.0);
+            else
+            set_state(PART:"elm.swallow.content", "default", 0.0);
+         }
+      }
+      program { name: "to_rtl";
+         signal: "edje,state,rtl";
+         source: "edje";
+         script {
+            set_int(is_rtl, 1);
+         }
+      }
+      program { name: "to_ltr";
+         signal: "edje,state,ltr";
+         source: "edje";
+         script {
+            set_int(is_rtl, 0);
+         }
+      }
+   }
+}
diff --git a/data/themes/widgets/toggle.edc b/data/themes/widgets/toggle.edc
deleted file mode 100644 (file)
index 8194d54..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-group { name: "elm/check/base/toggle";
-   images {
-      image: "shelf_inset.png" COMP;
-      image: "bt_basew.png" COMP;
-      image: "bt_bases.png" COMP;
-      image: "bt_hilightw.png" COMP;
-      image: "tog_base_on.png" COMP;
-      image: "tog_base_off.png" COMP;
-      image: "tog_dis_base_on.png" COMP;
-      image: "tog_dis_base_off.png" COMP;
-   }
-   script {
-      public is_rtl;
-   }
-   parts {
-      part { name: "bg";
-         type: RECT;
-         mouse_events: 0;
-         scale: 1;
-         description { state: "default" 0.0;
-            rel1.relative: 1.0 0.0;
-            rel1.offset: -4 3;
-            rel2.offset: -4 -4;
-            align: 1.0 0.5;
-            min: 96 16;
-            max: 96 16;
-            aspect: 4.0 4.0;
-            aspect_preference: VERTICAL;
-            color: 255 255 255 255;
-         }
-      }
-      part { name: "clipper";
-         type: RECT;
-         mouse_events: 0;
-         description { state: "default" 0.0;
-            rel1.to: "bg";
-            rel2.to: "bg";
-            color: 255 255 255 255;
-         }
-      }
-      part { name: "button";
-         type: RECT;
-         scale: 1;
-         clip_to: "clipper";
-         mouse_events: 1;
-         dragable {
-            x: 1 1 0;
-            y: 0 0 0;
-            confine: "bg";
-         }
-         description { state: "default" 0.0;
-            fixed: 1 1;
-            rel1.to: "bg";
-            rel2.to: "bg";
-            min: 16 16;
-            max: 16 16;
-            aspect: 1.0 1.0;
-            aspect_preference: VERTICAL;
-            color: 0 0 0 0;
-         }
-      }
-      part { name: "button_events";
-         type: RECT;
-         dragable {
-            events: "button";
-         }
-         description { state: "default" 0.0;
-            rel1.to_x: "bg";
-            rel1.offset: 0 0;
-            rel1.relative: 0.0 0.0;
-            rel2.to_x: "bg";
-            rel2.offset: -1 -1;
-            rel2.relative: 1.0 1.0;
-            color: 0 0 0 0;
-         }
-      }
-      part { name: "onrect";
-         type: IMAGE;
-         scale: 1;
-         clip_to: "clipper";
-         mouse_events: 0;
-         description { state: "default" 0.0;
-            rel1.to: "button";
-            rel1.relative: -5.0 0.0;
-            rel2.to: "button";
-            rel2.relative: 0.5 1.0;
-            image.normal: "tog_base_on.png";
-         }
-         description { state: "disabled" 0.0;
-            inherit: "default" 0.0;
-            image.normal: "tog_dis_base_on.png";
-         }
-      }
-      part { name: "offrect";
-         type: IMAGE;
-         scale: 1;
-         clip_to: "clipper";
-         mouse_events: 0;
-         description { state: "default" 0.0;
-            rel1.to: "button";
-            rel1.relative: 0.5 0.0;
-            rel2.to: "button";
-            rel2.relative: 6.0 1.0;
-            image.normal: "tog_base_off.png";
-         }
-         description { state: "disabled" 0.0;
-            inherit: "default" 0.0;
-            image.normal: "tog_dis_base_off.png";
-         }
-      }
-      part { name: "elm.offtext";
-         type: TEXT;
-         mouse_events:  0;
-         scale: 1;
-         clip_to: "clipper";
-         description { state: "default" 0.0;
-            fixed: 1 1;
-            rel1.to_x: "button";
-            rel1.relative: 1.0 0.0;
-            rel2.to_x: "offrect";
-            color: 0 0 0 255;
-            text {
-               font:     "Sans,Edje-Vera";
-               size:     10;
-               min:      0 1;
-               align:    0.5 0.5;
-               text:     "OFF";
-            }
-         }
-         description { state: "disabled" 0.0;
-            inherit: "default" 0.0;
-            color: 128 128 128 128;
-         }
-      }
-      part { name: "elm.ontext";
-         type: TEXT;
-         effect: SOFT_SHADOW;
-         mouse_events:  0;
-         scale: 1;
-         clip_to: "clipper";
-         description { state: "default" 0.0;
-            fixed: 1 1;
-            rel1.to_x: "onrect";
-            rel1.offset: 1 1;
-            rel2.to_x: "button";
-            rel2.offset: 0 0;
-            rel2.relative: 0.0 1.0;
-            color: 224 224 224 255;
-            color3: 0 0 0 64;
-            text {
-               font:     "Sans,Edje-Vera";
-               size:     10;
-               min:      0 1;
-               align:    0.5 0.5;
-               text:     "ON";
-            }
-         }
-         description { state: "disabled" 0.0;
-            inherit: "default" 0.0;
-            color: 128 128 128 128;
-            color3: 0 0 0 24;
-         }
-      }
-      part { name: "conf_over";
-         mouse_events:  0;
-         description { state: "default" 0.0;
-            rel1.offset: -1 -1;
-            rel1.to: "bg";
-            rel2.offset: 0 0;
-            rel2.to: "bg";
-            image {
-               normal: "shelf_inset.png";
-               border: 7 7 7 7;
-               middle: 0;
-            }
-            fill.smooth : 0;
-         }
-      }
-      part { name: "button0";
-         mouse_events:  0;
-         clip_to: "clipper";
-         description { state: "default" 0.0;
-            rel1.to: "button2";
-            rel1.offset: -4 -4;
-            rel2.to: "button2";
-            rel2.offset: 3 3;
-            image {
-               normal: "bt_bases.png";
-               border: 11 11 11 11;
-            }
-            image.middle: SOLID;
-            color: 255 255 255 128;
-         }
-      }
-      part { name: "button2";
-         mouse_events:  0;
-         clip_to: "clipper";
-         description { state: "default" 0.0;
-            rel1.to: "button";
-            rel1.offset: -2 -2;
-            rel2.to: "button";
-            rel2.offset: 1 1;
-            image {
-               normal: "bt_basew.png";
-               border: 7 7 7 7;
-            }
-            image.middle: SOLID;
-         }
-      }
-      part { name: "button3";
-         mouse_events:  0;
-         clip_to: "clipper";
-         description { state: "default" 0.0;
-            rel1.to: "button2";
-            rel2.to: "button2";
-            rel2.relative: 1.0 0.5;
-            image {
-               normal: "bt_hilightw.png";
-               border: 4 4 4 0;
-            }
-         }
-      }
-      part { name: "elm.swallow.content";
-         type: SWALLOW;
-         description { state: "default" 0.0;
-            fixed: 1 0;
-            visible: 0;
-            align: 0.0 0.5;
-            rel1.offset: 4 4;
-            rel2.relative: 0.0 1.0;
-            rel2.offset: 3 -5;
-         }
-         description { state: "visible" 0.0;
-            inherit: "default" 0.0;
-            visible: 1;
-            aspect: 1.0 1.0;
-            rel2.offset: 4 -5;
-         }
-         description { state: "disabled" 0.0;
-            inherit: "default" 0.0;
-            color: 128 128 128 128;
-         }
-         description { state: "disabled_visible" 0.0;
-            inherit: "default" 0.0;
-            color: 128 128 128 128;
-            visible: 1;
-            aspect: 1.0 1.0;
-         }
-      }
-      part { name: "elm.text";
-         type: TEXT;
-         mouse_events: 0;
-         scale: 1;
-         description { state: "default" 0.0;
-            visible: 0;
-            rel1.to_x: "elm.swallow.content";
-            rel1.relative: 1.0 0.0;
-            rel1.offset: 0 4;
-            rel2.to_x: "bg";
-            rel2.relative: 0.0 1.0;
-            rel2.offset: -5 -5;
-            color: 0 0 0 255;
-            text {
-               font: "Sans,Edje-Vera";
-               size: 10;
-               min: 0 0;
-               align: 0.0 0.5;
-            }
-         }
-         description { state: "visible" 0.0;
-            inherit: "default" 0.0;
-            visible: 1;
-            text.min: 1 1;
-         }
-         description { state: "disabled" 0.0;
-            inherit: "default" 0.0;
-            color: 128 128 128 128;
-         }
-         description { state: "disabled_visible" 0.0;
-            inherit: "default" 0.0;
-            color: 128 128 128 128;
-            visible: 1;
-            text.min: 1 1;
-         }
-      }
-      part { name: "disabler";
-         type: RECT;
-         description { state: "default" 0.0;
-            color: 0 0 0 0;
-            visible: 0;
-         }
-         description { state: "disabled" 0.0;
-            inherit: "default" 0.0;
-            visible: 1;
-         }
-      }
-   }
-   programs {
-      program { name:   "drag_end";
-         signal: "mouse,up,1";
-         source: "button";
-         script {
-            new Float:dx, Float:dy;
-            get_drag(PART:"button", dx, dy);
-            if (dx > 0.5)
-            {
-               set_drag(PART:"button", 1.0, 0.0);
-            }
-            else
-            {
-               set_drag(PART:"button", 0.0, 0.0);
-            }
-            if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
-            (get_int(is_rtl) == 0) && (dx > 0.5)) {
-               emit("elm,action,check,on", "");
-            }
-            else {
-               emit("elm,action,check,off", "");
-            }
-
-         }
-      }
-      program { name: "check_on";
-         signal: "elm,state,check,on";
-         source: "elm";
-         script {
-            new Float:drag;
-            if (get_int(is_rtl) == 0) {
-               drag = 100.0;
-            }
-            else {
-               drag = 0.0;
-            }
-            set_drag(PART:"button", drag, 0.0);
-         }
-      }
-      program { name: "check_off";
-         signal: "elm,state,check,off";
-         source: "elm";
-         script {
-            new Float:drag;
-            if (get_int(is_rtl) == 0) {
-               drag = 0.0;
-            }
-            else {
-               drag = 100.0;
-            }
-            set_drag(PART:"button", drag, 0.0);
-         }
-      }
-      program { name: "text_show";
-         signal: "elm,state,text,visible";
-         source: "elm";
-         action:  STATE_SET "visible" 0.0;
-         target: "elm.text";
-      }
-      program { name: "text_hide";
-         signal: "elm,state,text,hidden";
-         source: "elm";
-         action:  STATE_SET "default" 0.0;
-         target: "elm.text";
-      }
-      program { name: "icon_show";
-         signal: "elm,state,icon,visible";
-         source: "elm";
-         action:  STATE_SET "visible" 0.0;
-         target: "elm.swallow.content";
-      }
-      program { name: "icon_hide";
-         signal: "elm,state,icon,hidden";
-         source: "elm";
-         action:  STATE_SET "default" 0.0;
-         target: "elm.swallow.content";
-      }
-      program { name: "disable";
-         signal: "elm,state,disabled";
-         source: "elm";
-         action: STATE_SET "disabled" 0.0;
-         target: "elm.offtext";
-         target: "elm.ontext";
-         target: "onrect";
-         target: "offrect";
-         target: "disabler";
-         after: "disable_text";
-      }
-      program { name: "disable_text";
-         script {
-            new st[31];
-            new Float:vl;
-            get_state(PART:"elm.text", st, 30, vl);
-            if (!strcmp(st, "visible"))
-            set_state(PART:"elm.text", "disabled_visible", 0.0);
-            else
-            set_state(PART:"elm.text", "disabled", 0.0);
-
-            get_state(PART:"elm.swallow.content", st, 30, vl);
-            if (!strcmp(st, "visible"))
-            set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
-            else
-            set_state(PART:"elm.swallow.content", "disabled", 0.0);
-         }
-      }
-      program { name: "enable";
-         signal: "elm,state,enabled";
-         source: "elm";
-         action: STATE_SET "default" 0.0;
-         target: "disabler";
-         target: "onrect";
-         target: "offrect";
-         after: "enable_text";
-      }
-      program { name: "enable_text";
-         script {
-            new st[31];
-            new Float:vl;
-            get_state(PART:"elm.text", st, 30, vl);
-            if (!strcmp(st, "disabled_visible"))
-            set_state(PART:"elm.text", "visible", 0.0);
-            else
-            set_state(PART:"elm.text", "default", 0.0);
-
-            get_state(PART:"elm.swallow.content", st, 30, vl);
-            if (!strcmp(st, "visible"))
-            set_state(PART:"elm.swallow.content", "visible", 0.0);
-            else
-            set_state(PART:"elm.swallow.content", "default", 0.0);
-         }
-      }
-      program { name: "to_rtl";
-         signal: "edje,state,rtl";
-         source: "edje";
-         script {
-            set_int(is_rtl, 1);
-         }
-      }
-      program { name: "to_ltr";
-         signal: "edje,state,ltr";
-         source: "edje";
-         script {
-            set_int(is_rtl, 0);
-         }
-      }
-   }
-}
index 81d4cd7..53b696b 100644 (file)
@@ -63,7 +63,6 @@ WGT_PREVIEW = \
        pager:preview-00.png:widget_preview_pager:100:100 \
        separator:preview-00.png:widget_preview_separator:10:80 \
        radio:preview-00.png:widget_preview_radio:60:20 \
-       toggle:preview-00.png:widget_preview_toggle:150:30 \
        panel:preview-00.png:widget_preview_panel:150:50 \
        gengrid:preview-00.png:widget_preview_gengrid:200:160 \
        genlist:preview-00.png:widget_preview_genlist1:200:200 \
index 1e58e67..d43fe46 100644 (file)
  *
  * By default map is disabled. So just setting content isn't enough.
  * Alpha and smooth settings will be applied when map is enabled.
- * So we'll add a toggle for that. Everytime the map properties
+ * So we'll add a check for that. Everytime the map properties
  * are changed, map will need to be enabled again. So if you
  * want to play a bit with our example, remember to always enable
  * map again after concluding your changes.
- * @skipline toggle_add
+ * @skipline check_add
  * @until show
  *
- * We have added a callback function to this toggle, so it will enable
+ * We have added a callback function to this check, so it will enable
  * or disable map:
  * @dontinclude mapbuf_example.c
  * @skip static
  * By default, mapbuf would enable alpha blending and smooth rendering,
  * so we need to check boxes to be consistent with its behavior.
  *
- * Callback functions look like the one added to the toggle. This way we
+ * Callback functions look like the one added to the check. This way we
  * could enable or disable the both properties:
  * @dontinclude mapbuf_example.c
  * @skip static
  * whose value it should change:
  * @until show
  *
- * We also set the callback that will be called when the toggles value changes:
+ * We also set the callback that will be called when the check value changes:
  * @until smart_callback
  *
  * For our second toggle it important to note that we set the states labels,
index f1583bd..cb2e00f 100644 (file)
@@ -72,7 +72,6 @@ widget_preview_hover \
 widget_preview_flip \
 widget_preview_separator \
 widget_preview_radio \
-widget_preview_toggle \
 widget_preview_panel \
 widget_preview_gengrid \
 widget_preview_genlist1 \
@@ -152,7 +151,6 @@ EXTRA_DIST = \
        widget_preview_popup.c \
        widget_preview_separator.c \
        widget_preview_radio.c \
-       widget_preview_toggle.c \
        widget_preview_panel.c \
        widget_preview_gengrid.c \
        widget_preview_genlist1.c \
diff --git a/doc/widgets/widget_preview_toggle.c b/doc/widgets/widget_preview_toggle.c
deleted file mode 100644 (file)
index b6b85ad..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "widget_preview_tmpl_head.c"
-
-Evas_Object *o = elm_check_add(win);
-elm_object_style_set(o, "toggle");
-evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-elm_win_resize_object_add(win, o);
-evas_object_show(o);
-
-elm_object_text_set(o, "toggle");
-
-#include "widget_preview_tmpl_foot.c"
index 9ad55ff..b0bc2a1 100644 (file)
@@ -5,8 +5,6 @@ includedir=@includedir@
 
 Name: elementary
 Description: Mobile device touchscreen widget library
-@pkgconfig_requires_private@: @requirement_elm@
 Version: @VERSION@
 Libs: -L${libdir} -lelementary @my_libs@ @ELEMENTARY_LIBS@ @EVIL_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_ETHUMB_LIBS@ @ELEMENTARY_WEB_LIBS@ @ELEMENTARY_EMAP_LIBS@ @ELEMENTARY_ECORE_IMF_LIBS@ @ELEMENTARY_ECORE_CON_LIBS@
-Libs.private: @dlopen_libs@ @my_libs@ @ELEMENTARY_LIBS@ @EVIL_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_ETHUMB_LIBS@ @ELEMENTARY_WEB_LIBS@ @ELEMENTARY_EMAP_LIBS@ @ELEMENTARY_ECORE_IMF_LIBS@ @ELEMENTARY_ECORE_CON_LIBS@
 Cflags: -I${includedir}/elementary-@VMAJ@ @ELEMENTARY_CFLAGS@ @EVIL_CFLAGS@ @ELEMENTARY_EFREET_CFLAGS@ @ELEMENTARY_EDBUS_CFLAGS@ @ELEMENTARY_ETHUMB_CFLAGS@ @ELEMENTARY_WEB_CFLAGS@ @ELEMENTARY_EMAP_CFLAGS@ @ELEMENTARY_ECORE_IMF_CFLAGS@ @ELEMENTARY_ECORE_CON_CFLAGS@
index 2dcd6e4..4648aa5 100644 (file)
@@ -56,7 +56,6 @@
 ./src/bin/test_store.c
 ./src/bin/test_table.c
 ./src/bin/test_thumb.c
-./src/bin/test_toggle.c
 ./src/bin/test_toolbar.c
 ./src/bin/test_tooltip.c
 ./src/bin/test_transit.c
@@ -87,7 +86,6 @@
 ./src/edje_externals/elm_slideshow.c
 ./src/edje_externals/elm_spinner.c
 ./src/edje_externals/elm_thumb.c
-./src/edje_externals/elm_toggle.c
 ./src/edje_externals/elm_toolbar.c
 ./src/lib/elc_ctxpopup.c
 ./src/lib/elc_fileselector_button.c
 ./src/lib/elm_table.c
 ./src/lib/elm_theme.c
 ./src/lib/elm_thumb.c
-./src/lib/elm_toggle.c
 ./src/lib/elm_toolbar.c
 ./src/lib/elm_transit.c
 ./src/lib/elm_util.c
index a6aff48..15d63c5 100644 (file)
@@ -104,7 +104,6 @@ test_spinner.c \
 test_store.c \
 test_table.c \
 test_thumb.c \
-test_toggle.c \
 test_toolbar.c \
 test_tooltip.c \
 test_transit.c \
index 532e00a..6334c36 100644 (file)
@@ -791,6 +791,7 @@ _font_overlay_set_all(void            *data,
         tc->size = tc_data->size;
      }
 
+   elm_config_all_flush();
    elm_config_save();
 }
 
@@ -827,6 +828,7 @@ _font_overlay_reset(void            *data,
    ELM_LIST_DISABLE(fstyles);
    ELM_LIST_DISABLE(fsizes);
 
+   elm_config_all_flush();
    elm_config_save();
 }
 
@@ -866,6 +868,7 @@ _font_overlay_reset_all(void            *data,
    ELM_LIST_DISABLE(fstyles);
    ELM_LIST_DISABLE(fsizes);
 
+   elm_config_all_flush();
    elm_config_save();
 }
 
@@ -893,9 +896,9 @@ _font_overlay_change(void *data       __UNUSED__,
           elm_config_font_overlay_unset(tc_data->name);
      }
 
-   elm_config_save();
    elm_config_font_overlay_apply();
    elm_config_all_flush();
+   elm_config_save();
 
    /* TODO: apply hinting */
 }
@@ -1032,6 +1035,7 @@ _engine_use(void            *data,
      return;
 
    elm_config_engine_set(selection);
+   elm_config_all_flush();
    elm_config_save(); /* make sure new engine has its data dir */
 }
 
@@ -1060,6 +1064,7 @@ _profile_use(void            *data,
    elm_config_profile_set(selection); /* just here to update info for getters below */
 
    _profile_change_do(elm_object_top_widget_get(li), selection);
+   elm_config_all_flush();
    elm_config_save(); /* make sure new profile has its data dir */
 }
 
@@ -1084,6 +1089,7 @@ _profile_reset(void            *data,
    selection = elm_object_item_data_get(elm_list_selected_item_get(li));
    curr = elm_config_profile_get();
 
+   elm_config_all_flush();
    elm_config_save(); /* dump config into old profile's data dir */
 
    pdir = elm_config_profile_dir_get(selection, EINA_TRUE);
@@ -1096,6 +1102,7 @@ _profile_reset(void            *data,
    elm_config_reload();
 
    _profile_change_do(elm_object_top_widget_get(li), curr);
+   elm_config_all_flush();
    elm_config_save(); /* make sure new profile has its data dir */
 }
 
@@ -1112,8 +1119,8 @@ _theme_use(void *data       __UNUSED__,
    th = elm_object_theme_get(sample);
    defth = elm_theme_get(th);
    elm_theme_set(NULL, defth);
-   elm_config_save();
    elm_config_all_flush();
+   elm_config_save();
 }
 
 static void
index 8d6bd19..d967c45 100644 (file)
@@ -30,11 +30,11 @@ void test_transit8(void *data, Evas_Object *obj, void *event_info);
 void test_transit9(void *data, Evas_Object *obj, void *event_info);
 void test_fileselector_button(void *data, Evas_Object *obj, void *event_info);
 void test_fileselector_entry(void *data, Evas_Object *obj, void *event_info);
-void test_toggle(void *data, Evas_Object *obj, void *event_info);
 void test_clock(void *data, Evas_Object *obj, void *event_info);
 void test_clock2(void *data, Evas_Object *obj, void *event_info);
 void test_clock3(void *data, Evas_Object *obj, void *event_info);
 void test_check(void *data, Evas_Object *obj, void *event_info);
+void test_check2(void *data, Evas_Object *obj, void *event_info);
 void test_radio(void *data, Evas_Object *obj, void *event_info);
 void test_layout(void *data, Evas_Object *obj, void *event_info);
 void test_hover(void *data, Evas_Object *obj, void *event_info);
@@ -504,7 +504,7 @@ add_tests:
 
    //------------------------------//
    ADD_TEST(NULL, "Booleans", "Checks", test_check);
-   ADD_TEST(NULL, "Booleans", "Toggles", test_toggle);
+   ADD_TEST(NULL, "Booleans", "Checks 2", test_check2);
 
    //------------------------------//
    ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup);
index bbbcc15..6760d5b 100644 (file)
@@ -114,4 +114,92 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
 
    evas_object_show(win);
 }
+
+void
+test_check2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+   Evas_Object *win, *bg, *bx, *ic, *tg;
+   char buf[PATH_MAX];
+
+   win = elm_win_add(NULL, "check2", ELM_WIN_BASIC);
+   elm_win_title_set(win, "Checks 2");
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bx);
+   evas_object_show(bx);
+
+   ic = elm_icon_add(win);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+   elm_icon_file_set(ic, buf, NULL);
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5);
+   elm_object_text_set(tg, "Icon sized to toggle");
+   elm_object_part_content_set(tg, "icon", ic);
+   elm_check_state_set(tg, EINA_TRUE);
+   elm_object_part_text_set(tg, "on", "Yes");
+   elm_object_part_text_set(tg, "off", "No");
+   elm_box_pack_end(bx, tg);
+   evas_object_show(tg);
+   evas_object_show(ic);
+
+   ic = elm_icon_add(win);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+   elm_icon_file_set(ic, buf, NULL);
+   elm_icon_resizable_set(ic, 0, 0);
+
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_text_set(tg, "Icon no scale");
+   elm_object_part_content_set(tg, "icon", ic);
+   elm_box_pack_end(bx, tg);
+   evas_object_show(tg);
+   evas_object_show(ic);
+
+   ic = elm_icon_add(win);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+   elm_icon_file_set(ic, buf, NULL);
+   elm_icon_resizable_set(ic, 0, 0);
+
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_text_set(tg, "Icon no scale");
+   elm_object_part_content_set(tg, "icon", ic);
+   elm_object_disabled_set(tg, EINA_TRUE);
+   elm_box_pack_end(bx, tg);
+   evas_object_show(tg);
+   evas_object_show(ic);
+
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_text_set(tg, "Label Only");
+   elm_object_part_text_set(tg, "on", "Big long fun times label");
+   elm_object_part_text_set(tg, "off", "Small long happy fun label");
+   elm_box_pack_end(bx, tg);
+   evas_object_show(tg);
+
+   ic = elm_icon_add(win);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
+   elm_icon_file_set(ic, buf, NULL);
+   elm_icon_resizable_set(ic, 0, 0);
+
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_part_content_set(tg, "icon", ic);
+   elm_box_pack_end(bx, tg);
+   evas_object_show(tg);
+   evas_object_show(ic);
+
+   evas_object_show(win);
+}
 #endif
diff --git a/src/bin/test_toggle.c b/src/bin/test_toggle.c
deleted file mode 100644 (file)
index 7bda066..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#include <Elementary.h>
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-#ifndef ELM_LIB_QUICKLAUNCH
-void
-test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
-{
-   Evas_Object *win, *bg, *bx, *ic, *tg;
-   char buf[PATH_MAX];
-
-   win = elm_win_add(NULL, "toggles", ELM_WIN_BASIC);
-   elm_win_title_set(win, "Toggles");
-   elm_win_autodel_set(win, EINA_TRUE);
-
-   bg = elm_bg_add(win);
-   elm_win_resize_object_add(win, bg);
-   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_show(bg);
-
-   bx = elm_box_add(win);
-   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   elm_win_resize_object_add(win, bx);
-   evas_object_show(bx);
-
-   ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
-   elm_icon_file_set(ic, buf, NULL);
-   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-
-   tg = elm_check_add(win);
-   elm_object_style_set(tg, "toggle");
-   evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5);
-   elm_object_text_set(tg, "Icon sized to toggle");
-   elm_object_part_content_set(tg, "icon", ic);
-   elm_check_state_set(tg, EINA_TRUE);
-   elm_object_part_text_set(tg, "on", "Yes");
-   elm_object_part_text_set(tg, "off", "No");
-   elm_box_pack_end(bx, tg);
-   evas_object_show(tg);
-   evas_object_show(ic);
-
-   ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
-   elm_icon_file_set(ic, buf, NULL);
-   elm_icon_resizable_set(ic, 0, 0);
-
-   tg = elm_check_add(win);
-   elm_object_style_set(tg, "toggle");
-   elm_object_text_set(tg, "Icon no scale");
-   elm_object_part_content_set(tg, "icon", ic);
-   elm_box_pack_end(bx, tg);
-   evas_object_show(tg);
-   evas_object_show(ic);
-
-   ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
-   elm_icon_file_set(ic, buf, NULL);
-   elm_icon_resizable_set(ic, 0, 0);
-
-   tg = elm_check_add(win);
-   elm_object_style_set(tg, "toggle");
-   elm_object_text_set(tg, "Disabled check");
-   elm_object_part_content_set(tg, "icon", ic);
-   elm_object_disabled_set(tg, EINA_TRUE);
-   elm_box_pack_end(bx, tg);
-   evas_object_show(tg);
-   evas_object_show(ic);
-
-   tg = elm_check_add(win);
-   elm_object_style_set(tg, "toggle");
-   elm_object_text_set(tg, "Label Only");
-   elm_object_part_text_set(tg, "on", "Big long fun times label");
-   elm_object_part_text_set(tg, "off", "Small long happy fun label");
-   elm_box_pack_end(bx, tg);
-   evas_object_show(tg);
-
-   ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
-   elm_icon_file_set(ic, buf, NULL);
-   elm_icon_resizable_set(ic, 0, 0);
-
-   tg = elm_check_add(win);
-   elm_object_style_set(tg, "toggle");
-   elm_object_part_content_set(tg, "icon", ic);
-   elm_box_pack_end(bx, tg);
-   evas_object_show(tg);
-   evas_object_show(ic);
-
-   evas_object_show(win);
-}
-#endif
index 9d789ca..efb1a53 100644 (file)
@@ -23,7 +23,6 @@ DEFINE_TYPE(slider)
 DEFINE_TYPE(slideshow)
 DEFINE_TYPE(spinner)
 DEFINE_TYPE(thumb)
-DEFINE_TYPE(toggle)
 DEFINE_TYPE(toolbar)
 DEFINE_TYPE(notify)
 DEFINE_TYPE(label)
index bc496d5..3687d99 100644 (file)
@@ -208,7 +208,6 @@ examples_PROGRAMS += \
        index_example_02 \
        separator_example_01 \
        radio_example_01 \
-       toggle_example_01 \
        panel_example_01 \
        gengrid_example \
        genlist_example_01 \
@@ -297,7 +296,6 @@ SCREENSHOTS = \
        ctxpopup_example_01:ctxpopup_example_01.png:0.0 \
        separator_example_01:separator_example_01.png:0.0 \
        radio_example_01:radio_example_01.png:0.0 \
-       toggle_example_01:toggle_example_01.png:0.0 \
        panel_example_01:panel_example_01.png:0.0 \
        gengrid_example:gengrid_example.png:0.0 \
        genlist_example_01:genlist_example_01.png:0.1 \
diff --git a/src/examples/toggle_example_01.c b/src/examples/toggle_example_01.c
deleted file mode 100644 (file)
index f676502..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//Compile with:
-//gcc -g `pkg-config --cflags --libs elementary` toggle_example_01.c -o toggle_example_01
-
-#include <Elementary.h>
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-
-static void _cb(void *data, Evas_Object *obj, void *event_info);
-static void _cb2(void *data, Evas_Object *obj, void *event_info);
-
-static Eina_Bool val = EINA_FALSE;
-
-EAPI_MAIN int
-elm_main(int argc, char **argv)
-{
-   Evas_Object *win, *bg, *bx, *toggle, *ic;
-
-   win = elm_win_add(NULL, "toggle", ELM_WIN_BASIC);
-   elm_win_title_set(win, "toggle");
-   elm_win_autodel_set(win, EINA_TRUE);
-   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
-
-   bg = elm_bg_add(win);
-   elm_win_resize_object_add(win, bg);
-   evas_object_show(bg);
-
-   bx = elm_box_add(win);
-   elm_box_horizontal_set(bx, EINA_FALSE);
-   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   elm_win_resize_object_add(win, bx);
-   evas_object_show(bx);
-
-   toggle = elm_check_add(win);
-   elm_object_style_set(toggle, "toggle");
-   elm_object_part_text_set(toggle, "on", "ON");
-   elm_object_part_text_set(toggle, "off", "OFF");
-   elm_object_text_set(toggle, "Toggle 1");
-   ic = elm_icon_add(win);
-   elm_icon_standard_set(ic, "home");
-   elm_object_part_content_set(toggle, "icon", ic);
-   elm_check_state_pointer_set(toggle, &val);
-   elm_box_pack_end(bx, toggle);
-   evas_object_size_hint_weight_set(toggle, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(toggle, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   evas_object_show(toggle);
-   evas_object_smart_callback_add(toggle, "changed", _cb, NULL);
-
-   toggle = elm_check_add(win);
-   elm_object_style_set(toggle, "toggle");
-   elm_object_part_text_set(toggle, "on", "Enabled");
-   elm_object_part_text_set(toggle, "off", "Disabled");
-   elm_object_text_set(toggle, "Toggle 2");
-   elm_check_state_set(toggle, EINA_TRUE);
-   elm_box_pack_end(bx, toggle);
-   evas_object_size_hint_weight_set(toggle, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(toggle, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   evas_object_show(toggle);
-   evas_object_smart_callback_add(toggle, "changed", _cb2, NULL);
-
-   evas_object_show(win);
-
-   elm_run();
-
-   return 0;
-}
-ELM_MAIN()
-
-static void
-_cb(void *data, Evas_Object *obj, void *event_info)
-{
-   printf("val is now: %s\n", val ? "true" : "false");
-}
-
-static void
-_cb2(void *data, Evas_Object *obj, void *event_info)
-{
-   printf("toggle2's state is now: %s\n", elm_check_state_get(obj) ? "true" : "false");
-}