images {
image: "sl_bg.png" COMP;
image: "sl_bg_over.png" COMP;
- image: "sl_bt_0.png" COMP;
- image: "sl_bt_1.png" COMP;
- image: "sl_bt_2.png" COMP;
- image: "sl_bt_3.png" COMP;
- image: "sl_bt2_0_0.png" COMP;
- image: "sl_bt2_0_1.png" COMP;
- image: "sl_bt2_0_2.png" COMP;
- image: "sl_bt2_1.png" COMP;
- image: "sl_bt2_2.png" COMP;
+
image: "sl_units.png" COMP;
}
- script {
- public value_hide = 0;
- public set_value_show() {
- set_int(value_hide, 0);
- }
- public set_value_hide() {
- set_int(value_hide, 1);
- }
- public thumb_down() {
- if (get_int(value_hide) == 1) {
- set_state(PART:"elm.indicator", "default", 0.0);
- set_state(PART:"button3", "default", 0.0);
- set_state(PART:"button4", "default", 0.0);
- set_state(PART:"button5", "default", 0.0);
- set_state(PART:"button6", "default", 0.0);
- set_state(PART:"button7", "default", 0.0);
- } else {
- set_state(PART:"elm.indicator", "visible", 0.0);
- set_state(PART:"button3", "visible", 0.0);
- set_state(PART:"button4", "visible", 0.0);
- set_state(PART:"button5", "visible", 0.0);
- set_state(PART:"button6", "visible", 0.0);
- set_state(PART:"button7", "visible", 0.0);
- }
- }
- public thumb_up() {
- set_state(PART:"elm.indicator", "default", 0.0);
- set_state(PART:"button3", "default", 0.0);
- set_state(PART:"button4", "default", 0.0);
- set_state(PART:"button5", "default", 0.0);
- set_state(PART:"button6", "default", 0.0);
- set_state(PART:"button7", "default", 0.0);
- }
- }
parts {
part { name: "base";
mouse_events: 0;
}
}
part { name: "elm.dragable.slider";
- type: RECT;
- mouse_events: 0;
+ type: GROUP;
+ source: "elm/slider/horizontal/indicator/default";
+ mouse_events: 1;
+ repeat_events: 1;
scale: 1;
dragable {
x: 1 1 0;
color: 255 0 0 100;
}
}
- part { name: "button_events";
+ part { name: "disabler";
type: RECT;
- dragable {
- events: "elm.dragable.slider";
- }
- mouse_events: 1;
description { state: "default" 0.0;
- fixed: 1 1;
- min: 16 16;
- aspect: 1.0 1.0;
- aspect_preference: VERTICAL;
- rel1.to_x: "elm.dragable.slider";
- rel2.to_x: "elm.dragable.slider";
color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
}
}
- part { name: "button0";
- mouse_events: 0;
- description { state: "default" 0.0;
- fixed: 1 1;
- max: 17 999;
- min: 17 24;
- rel1.to: "elm.dragable.slider";
- rel2.to: "elm.dragable.slider";
- image {
- normal: "sl_bt_0.png";
- border: 5 5 5 10;
+ }
+ programs {
+ 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.icon";
+ }
+ program { name: "icon_hide";
+ signal: "elm,state,icon,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.icon";
+ }
+ program { name: "end_show";
+ signal: "elm,state,end,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.end";
+ }
+ program { name: "end_hide";
+ signal: "elm,state,end,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.end";
+ }
+ program { name: "units_show";
+ signal: "elm,state,units,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.units";
+ target: "units";
+ }
+ program { name: "units_hide";
+ signal: "elm,state,units,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.units";
+ target: "units";
+ }
+ program { name: "invert_on";
+ signal: "elm,state,inverted,on";
+ source: "elm";
+ action: STATE_SET "inverted" 0.0;
+ target: "level";
+ target: "level2";
+ }
+ program { name: "invert_off";
+ signal: "elm,state,inverted,off";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "level";
+ target: "level2";
+ }
+ program {
+ name: "go_disabled";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+// target: "button0";
+ 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.units", st, 30, vl);
+ if (!strcmp(st, "visible"))
+ set_state(PART:"elm.units", "disabled_visible", 0.0);
+ else
+ set_state(PART:"elm.units", "disabled", 0.0);
+
+ get_state(PART:"level2", st, 30, vl);
+ if (!strcmp(st, "inverted"))
+ {
+ set_state(PART:"level", "disabled_inverted", 0.0);
+ set_state(PART:"level2", "disabled_inverted", 0.0);
}
- fill.smooth: 0;
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- image {
- normal: "sl_bt_3.png";
- border: 5 5 5 10;
+ else
+ {
+ set_state(PART:"level", "disabled", 0.0);
+ set_state(PART:"level2", "disabled", 0.0);
}
}
}
- part { name: "button1";
- mouse_events: 0;
- description { state: "default" 0.0;
- rel1.to: "button0";
- rel2 {
- to: "button0";
- relative: 1.0 0.5;
- offset: -1 -5;
+ program { name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+// target: "button0";
+ target: "disabler";
+ 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.units", st, 30, vl);
+ if (!strcmp(st, "disabled_visible"))
+ set_state(PART:"elm.units", "visible", 0.0);
+ else
+ set_state(PART:"elm.units", "default", 0.0);
+
+ get_state(PART:"level2", st, 30, vl);
+ if (!strcmp(st, "disabled_inverted"))
+ {
+ set_state(PART:"level", "inverted", 0.0);
+ set_state(PART:"level2", "inverted", 0.0);
}
- image {
- normal: "sl_bt_1.png";
- border: 5 5 5 0;
+ else
+ {
+ set_state(PART:"level", "default", 0.0);
+ set_state(PART:"level2", "default", 0.0);
}
}
}
- part { name: "button2";
+ }
+ }
+
+ group { name: "elm/slider/vertical/default";
+ images {
+ image: "slv_bg.png" COMP;
+ image: "slv_bg_over.png" COMP;
+
+ image: "slv_units.png" COMP;
+ }
+ parts {
+ part { name: "base";
mouse_events: 0;
description { state: "default" 0.0;
- rel1.to: "button0";
- rel2.to: "button0";
- image {
- normal: "sl_bt_2.png";
- border: 5 5 5 10;
+ max: 6 99999;
+ min: 6 0;
+ rel1 { to: "bg";
+ offset: 1 0;
+ }
+ rel2 { to: "bg";
+ offset: -2 -1;
}
+ image.normal: "slv_bg.png";
fill.smooth: 0;
}
}
- part { name: "button3";
- mouse_events: 0;
- description { state: "default" 0.0;
- fixed: 1 1;
- visible: 0;
- min: 8 32;
- align: 1.0 0.5;
- rel1 {
- to_x: "elm.indicator";
- to_y: "button4";
- relative: 0.0 0.0;
- offset: -7 0;
- }
- rel2 {
- to: "button4";
- relative: 0.0 1.0;
- offset: -1 -1;
- }
- image {
- normal: "sl_bt2_0_0.png";
- border: 6 0 6 12;
- }
- fill.smooth: 0;
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part { name: "button4";
- mouse_events: 0;
- description { state: "default" 0.0;
- visible: 0;
- max: 15 999;
- min: 15 32;
- rel1 {
- to_x: "button0";
- to_y: "elm.indicator";
- offset: 0 0;
- }
- rel2.to: "button0";
- image {
- normal: "sl_bt2_0_1.png";
- border: 0 0 6 12;
- }
- fill.smooth: 0;
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part { name: "button5";
- mouse_events: 0;
- description { state: "default" 0.0;
- fixed: 1 1;
- visible: 0;
- min: 8 32;
- align: 0.0 0.5;
- rel1 {
- to: "button4";
- relative: 1.0 0.0;
- offset: 0 0;
- }
- rel2 {
- to_x: "elm.indicator";
- to_y: "button4";
- relative: 1.0 1.0;
- offset: 6 -1;
- }
- image {
- normal: "sl_bt2_0_2.png";
- border: 0 6 6 12;
- }
- fill.smooth: 0;
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part { name: "elm.indicator";
- type: TEXT;
- mouse_events: 0;
- effect: SOFT_SHADOW;
- scale: 1;
- description { state: "default" 0.0;
- visible: 0;
- fixed: 1 1;
- align: 0.5 1.0;
- rel1 {
- to: "button0";
- relative: 0.0 -0.25;
- offset: 0 0;
- }
- rel2 {
- to_x: "button0";
- relative: 1.0 -0.25;
- offset: -1 0;
- }
- color: 224 224 224 255;
- color3: 0 0 0 64;
- text {
- font: "Sans,Edje-Vera";
- size: 10;
- min: 0 0;
- align: 0.5 0.5;
- }
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- text.min: 1 1;
- rel1.offset: 0 -1;
- rel2.offset: -1 -1;
- }
- }
- part { name: "button6";
- mouse_events: 0;
- description { state: "default" 0.0;
- visible: 0;
- rel1.to: "button3";
- rel2 {
- to: "button5";
- relative: 1.0 0.3;
- offset: -1 -1;
- }
- image {
- normal: "sl_bt2_1.png";
- border: 5 5 5 0;
- }
- fill.smooth: 0;
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part { name: "button7";
- mouse_events: 0;
- description { state: "default" 0.0;
- visible: 0;
- rel1.to: "button3";
- rel2.to: "button5";
- image {
- normal: "sl_bt2_2.png";
- border: 5 5 5 0;
- middle: 0;
- }
- fill.smooth: 0;
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 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: "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.icon";
- }
- program { name: "icon_hide";
- signal: "elm,state,icon,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.swallow.icon";
- }
- program { name: "end_show";
- signal: "elm,state,end,visible";
- source: "elm";
- action: STATE_SET "visible" 0.0;
- target: "elm.swallow.end";
- }
- program { name: "end_hide";
- signal: "elm,state,end,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.swallow.end";
- }
- program { name: "units_show";
- signal: "elm,state,units,visible";
- source: "elm";
- action: STATE_SET "visible" 0.0;
- target: "elm.units";
- target: "units";
- }
- program { name: "units_hide";
- signal: "elm,state,units,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.units";
- target: "units";
- }
- program { name: "invert_on";
- signal: "elm,state,inverted,on";
- source: "elm";
- action: STATE_SET "inverted" 0.0;
- target: "level";
- target: "level2";
- }
- program { name: "invert_off";
- signal: "elm,state,inverted,off";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "level";
- target: "level2";
- }
- program { name: "set_val_show";
- signal: "elm,state,val,show";
- source: "elm";
- script {
- set_value_show();
- }
- }
- program { name: "set_val_hide";
- signal: "elm,state,val,hide";
- source: "elm";
- script {
- set_value_hide();
- }
- }
- program { name: "val_show";
- signal: "mouse,down,*";
- source: "elm.dragable.slider";
- script {
- thumb_down();
- }
-
- }
- program { name: "val_hide";
- signal: "mouse,up,*";
- source: "elm.dragable.slider";
- script {
- thumb_up();
- }
- }
- program {
- name: "go_disabled";
- signal: "elm,state,disabled";
- source: "elm";
- action: STATE_SET "disabled" 0.0;
- target: "button0";
- 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.units", st, 30, vl);
- if (!strcmp(st, "visible"))
- set_state(PART:"elm.units", "disabled_visible", 0.0);
- else
- set_state(PART:"elm.units", "disabled", 0.0);
-
- get_state(PART:"level2", st, 30, vl);
- if (!strcmp(st, "inverted"))
- {
- set_state(PART:"level", "disabled_inverted", 0.0);
- set_state(PART:"level2", "disabled_inverted", 0.0);
- }
- else
- {
- set_state(PART:"level", "disabled", 0.0);
- set_state(PART:"level2", "disabled", 0.0);
- }
- }
- }
- program { name: "enable";
- signal: "elm,state,enabled";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "button0";
- target: "disabler";
- 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.units", st, 30, vl);
- if (!strcmp(st, "disabled_visible"))
- set_state(PART:"elm.units", "visible", 0.0);
- else
- set_state(PART:"elm.units", "default", 0.0);
-
- get_state(PART:"level2", st, 30, vl);
- if (!strcmp(st, "disabled_inverted"))
- {
- set_state(PART:"level", "inverted", 0.0);
- set_state(PART:"level2", "inverted", 0.0);
- }
- else
- {
- set_state(PART:"level", "default", 0.0);
- set_state(PART:"level2", "default", 0.0);
- }
- }
- }
- }
- }
-
- group { name: "elm/slider/vertical/default";
- images {
- image: "slv_bg.png" COMP;
- image: "slv_bg_over.png" COMP;
-
- image: "sl_bt_0.png" COMP;
- image: "sl_bt_1.png" COMP;
- image: "sl_bt_2.png" COMP;
- image: "sl_bt_3.png" COMP;
- image: "sl_bt2_0_0.png" COMP;
- image: "sl_bt2_0_1.png" COMP;
- image: "sl_bt2_0_2.png" COMP;
- image: "sl_bt2_1.png" COMP;
- image: "sl_bt2_2.png" COMP;
-
- image: "slv_units.png" COMP;
- }
- script {
- public value_hide = 0;
- public set_value_show() {
- set_int(value_hide, 0);
- }
- public set_value_hide() {
- set_int(value_hide, 1);
- }
- public thumb_down() {
- if (get_int(value_hide) == 1) {
- set_state(PART:"elm.indicator", "default", 0.0);
- set_state(PART:"button3", "default", 0.0);
- set_state(PART:"button4", "default", 0.0);
- set_state(PART:"button5", "default", 0.0);
- set_state(PART:"button6", "default", 0.0);
- set_state(PART:"button7", "default", 0.0);
- } else {
- set_state(PART:"elm.indicator", "visible", 0.0);
- set_state(PART:"button3", "visible", 0.0);
- set_state(PART:"button4", "visible", 0.0);
- set_state(PART:"button5", "visible", 0.0);
- set_state(PART:"button6", "visible", 0.0);
- set_state(PART:"button7", "visible", 0.0);
- }
- }
- public thumb_up() {
- set_state(PART:"elm.indicator", "default", 0.0);
- set_state(PART:"button3", "default", 0.0);
- set_state(PART:"button4", "default", 0.0);
- set_state(PART:"button5", "default", 0.0);
- set_state(PART:"button6", "default", 0.0);
- set_state(PART:"button7", "default", 0.0);
- }
- }
- parts {
- part { name: "base";
- mouse_events: 0;
- description { state: "default" 0.0;
- max: 6 99999;
- min: 6 0;
- rel1 { to: "bg";
- offset: 1 0;
- }
- rel2 { to: "bg";
- offset: -2 -1;
- }
- image.normal: "slv_bg.png";
- fill.smooth: 0;
- }
- }
- part { name: "level";
- type: RECT;
+ part { name: "level";
+ type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
fixed: 1 1;
}
}
part { name: "elm.dragable.slider";
- type: RECT;
- mouse_events: 0;
+ type: GROUP;
+ source: "elm/slider/vertical/indicator/default";
+ mouse_events: 1;
+ repeat_events: 1;
scale: 1;
dragable {
x: 0 0 0;
relative: 0.5 0.0;
to_y: "bg";
}
- rel2 {
- relative: 0.5 1.0;
- to_y: "bg";
+ rel2 {
+ relative: 0.5 1.0;
+ to_y: "bg";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ 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: "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.icon";
+ }
+ program { name: "icon_hide";
+ signal: "elm,state,icon,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.icon";
+ }
+ program { name: "end_show";
+ signal: "elm,state,end,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.end";
+ }
+ program { name: "end_hide";
+ signal: "elm,state,end,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.end";
+ }
+ program { name: "units_show";
+ signal: "elm,state,units,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.units";
+ target: "units";
+ }
+ program { name: "units_hide";
+ signal: "elm,state,units,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.units";
+ target: "units";
+ }
+ program { name: "invert_on";
+ signal: "elm,state,inverted,on";
+ source: "elm";
+ action: STATE_SET "inverted" 0.0;
+ target: "level";
+ target: "level2";
+ }
+ program { name: "invert_off";
+ signal: "elm,state,inverted,off";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "level";
+ target: "level2";
+ }
+ program {
+ name: "go_disabled";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+// target: "button0";
+ 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.units", st, 30, vl);
+ if (!strcmp(st, "visible"))
+ set_state(PART:"elm.units", "disabled_visible", 0.0);
+ else
+ set_state(PART:"elm.units", "disabled", 0.0);
+
+ get_state(PART:"level2", st, 30, vl);
+ if (!strcmp(st, "inverted"))
+ {
+ set_state(PART:"level", "disabled_inverted", 0.0);
+ set_state(PART:"level2", "disabled_inverted", 0.0);
+ }
+ else
+ {
+ set_state(PART:"level", "disabled", 0.0);
+ set_state(PART:"level2", "disabled", 0.0);
+ }
+ }
+ }
+
+ program { name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+// target: "button0";
+ target: "disabler";
+ 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.units", st, 30, vl);
+ if (!strcmp(st, "disabled_visible"))
+ set_state(PART:"elm.units", "visible", 0.0);
+ else
+ set_state(PART:"elm.units", "default", 0.0);
+
+ get_state(PART:"level2", st, 30, vl);
+ if (!strcmp(st, "disabled_inverted"))
+ {
+ set_state(PART:"level", "inverted", 0.0);
+ set_state(PART:"level2", "inverted", 0.0);
}
- color: 0 0 0 0;
+ else
+ {
+ set_state(PART:"level", "default", 0.0);
+ set_state(PART:"level2", "default", 0.0);
+ }
+ }
+ }
+ }
+ }
+ group { name: "elm/slider/horizontal/indicator/default";
+ alias: "elm/slider/horizontal/indicator/disabled";
+ alias: "elm/slider/vertical/indicator/default";
+ alias: "elm/slider/vertical/indicator/disabled";
+ images {
+ image: "sl_bt_0.png" COMP;
+ image: "sl_bt_1.png" COMP;
+ image: "sl_bt_2.png" COMP;
+ image: "sl_bt_3.png" COMP;
+ image: "sl_bt2_0_0.png" COMP;
+ image: "sl_bt2_0_1.png" COMP;
+ image: "sl_bt2_0_2.png" COMP;
+ image: "sl_bt2_1.png" COMP;
+ image: "sl_bt2_2.png" COMP;
+ }
+ script {
+ public value_hide = 0;
+ public set_value_show() {
+ set_int(value_hide, 0);
+ }
+ public set_value_hide() {
+ set_int(value_hide, 1);
+ }
+ public thumb_down() {
+ if (get_int(value_hide) == 1) {
+ set_state(PART:"elm.indicator", "default", 0.0);
+ set_state(PART:"button3", "default", 0.0);
+ set_state(PART:"button4", "default", 0.0);
+ set_state(PART:"button5", "default", 0.0);
+ set_state(PART:"button6", "default", 0.0);
+ set_state(PART:"button7", "default", 0.0);
+ } else {
+ set_state(PART:"elm.indicator", "visible", 0.0);
+ set_state(PART:"button3", "visible", 0.0);
+ set_state(PART:"button4", "visible", 0.0);
+ set_state(PART:"button5", "visible", 0.0);
+ set_state(PART:"button6", "visible", 0.0);
+ set_state(PART:"button7", "visible", 0.0);
}
}
+ public thumb_up() {
+ set_state(PART:"elm.indicator", "default", 0.0);
+ set_state(PART:"button3", "default", 0.0);
+ set_state(PART:"button4", "default", 0.0);
+ set_state(PART:"button5", "default", 0.0);
+ set_state(PART:"button6", "default", 0.0);
+ set_state(PART:"button7", "default", 0.0);
+ }
+ }
+ parts {
part { name: "button_events";
type: RECT;
- dragable {
- events: "elm.dragable.slider";
- }
mouse_events: 1;
description { state: "default" 0.0;
fixed: 1 1;
min: 16 16;
aspect: 1.0 1.0;
- aspect_preference: HORIZONTAL;
- rel1.to_y: "elm.dragable.slider";
- rel2.to_y: "elm.dragable.slider";
+ aspect_preference: VERTICAL;
color: 0 0 0 0;
}
}
fixed: 1 1;
max: 17 999;
min: 17 24;
- rel1.to: "elm.dragable.slider";
- rel2.to: "elm.dragable.slider";
image {
normal: "sl_bt_0.png";
border: 5 5 5 10;
part { name: "button3";
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
visible: 0;
min: 8 32;
align: 1.0 0.5;
visible: 0;
max: 15 999;
min: 15 32;
- fixed: 1 1;
rel1 {
to_x: "button0";
to_y: "elm.indicator";
- offset: 0 -7;
+ offset: 0 0;
}
rel2.to: "button0";
image {
part { name: "button5";
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
visible: 0;
min: 8 32;
align: 0.0 0.5;
align: 0.5 1.0;
rel1 {
to: "button0";
- relative: 0.0 -1.0;
+ relative: 0.0 -0.25;
offset: 0 0;
}
rel2 {
- to: "button0";
- relative: 1.0 -1.0;
+ to_x: "button0";
+ relative: 1.0 -0.25;
offset: -1 0;
}
color: 224 224 224 255;
visible: 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: "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.icon";
- }
- program { name: "icon_hide";
- signal: "elm,state,icon,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.swallow.icon";
- }
- program { name: "end_show";
- signal: "elm,state,end,visible";
- source: "elm";
- action: STATE_SET "visible" 0.0;
- target: "elm.swallow.end";
- }
- program { name: "end_hide";
- signal: "elm,state,end,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.swallow.end";
- }
- program { name: "units_show";
- signal: "elm,state,units,visible";
- source: "elm";
- action: STATE_SET "visible" 0.0;
- target: "elm.units";
- target: "units";
- }
- program { name: "units_hide";
- signal: "elm,state,units,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.units";
- target: "units";
- }
- program { name: "invert_on";
- signal: "elm,state,inverted,on";
- source: "elm";
- action: STATE_SET "inverted" 0.0;
- target: "level";
- target: "level2";
- }
- program { name: "invert_off";
- signal: "elm,state,inverted,off";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "level";
- target: "level2";
- }
program { name: "set_val_show";
signal: "elm,state,val,show";
source: "elm";
}
program { name: "val_show";
signal: "mouse,down,*";
- source: "elm.dragable.slider";
+ source: "button_events";
script {
thumb_down();
}
+
}
program { name: "val_hide";
signal: "mouse,up,*";
- source: "elm.dragable.slider";
+ source: "button_events";
script {
thumb_up();
}
}
- program {
- name: "go_disabled";
- signal: "elm,state,disabled";
- source: "elm";
- action: STATE_SET "disabled" 0.0;
- target: "button0";
- 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.units", st, 30, vl);
- if (!strcmp(st, "visible"))
- set_state(PART:"elm.units", "disabled_visible", 0.0);
- else
- set_state(PART:"elm.units", "disabled", 0.0);
-
- get_state(PART:"level2", st, 30, vl);
- if (!strcmp(st, "inverted"))
- {
- set_state(PART:"level", "disabled_inverted", 0.0);
- set_state(PART:"level2", "disabled_inverted", 0.0);
- }
- else
- {
- set_state(PART:"level", "disabled", 0.0);
- set_state(PART:"level2", "disabled", 0.0);
- }
- }
- }
-
- program { name: "enable";
- signal: "elm,state,enabled";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "button0";
- target: "disabler";
- 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.units", st, 30, vl);
- if (!strcmp(st, "disabled_visible"))
- set_state(PART:"elm.units", "visible", 0.0);
- else
- set_state(PART:"elm.units", "default", 0.0);
-
- get_state(PART:"level2", st, 30, vl);
- if (!strcmp(st, "disabled_inverted"))
- {
- set_state(PART:"level", "inverted", 0.0);
- set_state(PART:"level2", "inverted", 0.0);
- }
- else
- {
- set_state(PART:"level", "default", 0.0);
- set_state(PART:"level2", "default", 0.0);
- }
- }
- }
}
}
+
////////////////////////////////////////////////////////////////////////////////
// actionslider
////////////////////////////////////////////////////////////////////////////////
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void
_del_pre_hook(Evas_Object *obj)
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ elm_widget_mirrored_set(wd->hover, rtl);
+}
+
+static void
+_theme_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
+}
+
+static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
evas_object_move(wd->pop, info->x, info->y);
evas_object_resize(wd->pop, info->w, info->h);
wd->hover = elm_hover_add(obj);
+ elm_widget_mirrored_set(wd->hover, elm_widget_mirrored_get((Evas_Object *) data));
if (wd->hover_style)
elm_object_style_set(wd->hover, wd->hover_style);
hover_parent = wd->hover_parent;
if (py < (y + (h / 3))) ei.hover_top = 0;
ei.hover_bottom = 1;
if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0;
+
+ if (elm_widget_mirrored_get(wd->hover))
+ { /* Swap right and left because they switch sides in RTL */
+ Eina_Bool tmp = ei.hover_left;
+ ei.hover_left = ei.hover_right;
+ ei.hover_right = tmp;
+ }
+
evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, &ei);
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data);
evas_object_show(wd->hover);
elm_widget_data_set(obj, wd);
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_del_hook_set(obj, _del_hook);
+ elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_can_focus_set(obj, EINA_TRUE);
wd->entry = elm_entry_add(parent);
evas_object_smart_callback_add(wd->entry, "anchor,clicked",
_anchor_clicked, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
// TODO: convert Elementary to subclassing of Evas_Smart_Class
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void
_del_pre_hook(Evas_Object *obj)
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ elm_widget_mirrored_set(wd->hover, rtl);
+}
+
+static void
+_theme_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
+}
+
+static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
evas_object_move(wd->pop, info->x, info->y);
evas_object_resize(wd->pop, info->w, info->h);
wd->hover = elm_hover_add(obj);
+ elm_widget_mirrored_set(wd->hover, elm_widget_mirrored_get((Evas_Object *) data));
if (wd->hover_style) elm_object_style_set(wd->hover, wd->hover_style);
hover_parent = wd->hover_parent;
if (!hover_parent) hover_parent = obj;
if (py < (y + (h / 3))) ei.hover_top = 0;
ei.hover_bottom = 1;
if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0;
+
+ if (elm_widget_mirrored_get(wd->hover))
+ { /* Swap right and left because they switch sides in RTL */
+ Eina_Bool tmp = ei.hover_left;
+ ei.hover_left = ei.hover_right;
+ ei.hover_right = tmp;
+ }
+
evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, &ei);
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data);
evas_object_show(wd->hover);
elm_widget_data_set(obj, wd);
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_del_hook_set(obj, _del_hook);
+ elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_can_focus_set(obj, EINA_TRUE);
wd->scroller = elm_scroller_add(parent);
evas_object_smart_callback_add(wd->entry, "anchor,clicked",
_anchor_clicked, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
// TODO: convert Elementary to subclassing of Evas_Smart_Class
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ elm_widget_mirrored_set(wd->cancel_button, rtl);
+ elm_widget_mirrored_set(wd->ok_button, rtl);
+ elm_widget_mirrored_set(wd->files_list, rtl);
+ elm_widget_mirrored_set(wd->up_button, rtl);
+ elm_widget_mirrored_set(wd->home_button, rtl);
+ edje_object_mirrored_set(wd->edje, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
#undef SWALLOW
edje_object_message_signal_process(wd->edje);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
edje_object_scale_set
(wd->edje, elm_widget_scale_get(obj) * _elm_config->scale);
_sizing_eval(obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ elm_widget_mirrored_set(wd->btn, rtl);
+ elm_widget_mirrored_set(wd->fs, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
char buf[4096];
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
snprintf(buf, sizeof(buf), "fileselector_button/%s",
elm_widget_style_get(obj));
elm_object_style_set(wd->btn, buf);
wd->fsw = _new_window_add(wd);
wd->fs = elm_fileselector_add(wd->fsw);
+ elm_widget_mirrored_set(wd->fs, elm_widget_mirrored_get(wd->self));
elm_fileselector_expandable_set(wd->fs, wd->fsd.expandable);
elm_fileselector_folder_only_set(wd->fs, wd->fsd.folder_only);
elm_fileselector_is_save_set(wd->fs, wd->fsd.is_save);
SIG_FWD(UNPRESSED)
#undef SIG_FWD
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
+
static void
_FILE_CHOSEN_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info)
{
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ elm_widget_mirrored_set(wd->button, rtl);
+ edje_object_mirrored_set(wd->edje, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
char buf[1024];
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->edje, "fileselector_entry", "base", style);
if (elm_object_disabled_get(obj))
edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm");
SIG_FWD(SELECTION_CUT);
#undef SIG_FWD
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
// TODO: convert Elementary to subclassing of Evas_Smart_Class
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ elm_widget_mirrored_set(wd->btn, rtl);
+ elm_widget_mirrored_set(wd->hover, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
snprintf(buf, sizeof(buf), "hoversel_vertical/%s", elm_widget_style_get(obj));
elm_object_style_set(wd->btn, buf);
elm_object_disabled_set(wd->btn, elm_widget_disabled_get(obj));
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
}
static void
EINA_LIST_FOREACH(wd->items, l, item)
{
bt = elm_button_add(wd->hover);
+ elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj));
elm_object_style_set(bt, buf);
elm_button_label_set(bt, item->label);
if (item->icon_file)
free(wd);
}
+static Elm_Actionslider_Pos
+_get_pos_by_orientation(const Evas_Object *obj, Elm_Actionslider_Pos pos)
+{
+ if (elm_widget_mirrored_get(obj))
+ {
+ switch (pos)
+ {
+ case ELM_ACTIONSLIDER_LEFT:
+ pos = ELM_ACTIONSLIDER_RIGHT;
+ break;
+ case ELM_ACTIONSLIDER_RIGHT:
+ pos = ELM_ACTIONSLIDER_LEFT;
+ break;
+ default:
+ break;
+ }
+ }
+ return pos;
+}
+
+static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ double pos;
+
+ if (!wd) return;
+ if (edje_object_mirrored_get(wd->as) == rtl)
+ return;
+
+ edje_object_mirrored_set(wd->as, rtl);
+ if (!elm_widget_mirrored_get(obj))
+ {
+ edje_object_part_text_set(wd->as, "elm.text.left", wd->text_left);
+ edje_object_part_text_set(wd->as, "elm.text.right", wd->text_right);
+ }
+ else
+ {
+ edje_object_part_text_set(wd->as, "elm.text.left", wd->text_right);
+ edje_object_part_text_set(wd->as, "elm.text.right", wd->text_left);
+ }
+ edje_object_part_drag_value_get(wd->as, "elm.drag_button_base", &pos, NULL);
+ edje_object_part_drag_value_set(wd->as, "elm.drag_button_base", 1.0 - pos, 0.5);
+}
+
static void
_sizing_eval(Evas_Object *obj)
{
_elm_theme_object_set(obj, wd->drag_button_base, "actionslider",
"drag_button", elm_widget_style_get(obj));
edje_object_part_swallow(wd->as, "elm.drag_button_base", wd->drag_button_base);
- edje_object_part_text_set(wd->as, "elm.text.left", wd->text_left);
- edje_object_part_text_set(wd->as, "elm.text.right", wd->text_right);
+
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
edje_object_part_text_set(wd->as, "elm.text.center", wd->text_center);
edje_object_part_text_set(wd->as, "elm.text.indicator", wd->indicator_label);
edje_object_message_signal_process(wd->as);
static void
_drag_button_move_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
- Evas_Object *as = (Evas_Object *) data;
- Widget_Data *wd = elm_widget_data_get(as);
+ Evas_Object *obj = (Evas_Object *) data;
+ Widget_Data *wd = elm_widget_data_get(obj);
double pos = 0.0;
if (!wd) return;
if (!wd->mouse_down) return;
edje_object_part_drag_value_get(wd->as, "elm.drag_button_base", &pos, NULL);
if (pos == 0.0)
- evas_object_smart_callback_call(as, SIG_CHANGED, "left");
+ evas_object_smart_callback_call(obj, SIG_CHANGED,
+ (void *) ((!elm_widget_mirrored_get(obj)) ?
+ "left" : "right"));
else if (pos == 1.0)
- evas_object_smart_callback_call(as, SIG_CHANGED, "right");
+ evas_object_smart_callback_call(obj, SIG_CHANGED,
+ (void *) ((!elm_widget_mirrored_get(obj)) ?
+ "right" : "left"));
else if (pos >= 0.45 && pos <= 0.55)
- evas_object_smart_callback_call(as, SIG_CHANGED, "center");
+ evas_object_smart_callback_call(obj, SIG_CHANGED, (void *)"center");
}
static Eina_Bool
_button_animation(void *data)
{
- Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Object *obj = data;
+ Widget_Data *wd = elm_widget_data_get(obj);
double cur_position = 0.0, new_position = 0.0;
double move_amount = 0.05;
Eina_Bool flag_finish_animation = EINA_FALSE;
edje_object_part_drag_value_get(wd->as,
"elm.drag_button_base", &cur_position, NULL);
- if ((wd->final_position == 0.0) ||
- (wd->final_position == 0.5 && cur_position >= wd->final_position))
{
- new_position = cur_position - move_amount;
- if (new_position <= wd->final_position)
+ double adjusted_final;
+ adjusted_final = (!elm_widget_mirrored_get(obj)) ?
+ wd->final_position : 1.0 - wd->final_position;
+ if ((adjusted_final == 0.0) ||
+ (adjusted_final == 0.5 && cur_position >= adjusted_final))
{
- new_position = wd->final_position;
- flag_finish_animation = EINA_TRUE;
+ new_position = cur_position - move_amount;
+ if (new_position <= adjusted_final)
+ {
+ new_position = adjusted_final;
+ flag_finish_animation = EINA_TRUE;
+ }
}
- }
- else if ((wd->final_position == 1.0) ||
- (wd->final_position == 0.5 && cur_position < wd->final_position))
- {
- new_position = cur_position + move_amount;
- if (new_position >= wd->final_position)
+ else if ((adjusted_final == 1.0) ||
+ (adjusted_final == 0.5 && cur_position < adjusted_final))
{
- new_position = wd->final_position;
- flag_finish_animation = EINA_TRUE;
+ new_position = cur_position + move_amount;
+ if (new_position >= adjusted_final)
+ {
+ new_position = adjusted_final;
+ flag_finish_animation = EINA_TRUE;
+ }
}
+ edje_object_part_drag_value_set(wd->as,
+ "elm.drag_button_base", new_position, 0.5);
}
- edje_object_part_drag_value_set(wd->as,
- "elm.drag_button_base", new_position, 0.5);
+
if (flag_finish_animation)
{
if ((!wd->final_position) &&
static void
_drag_button_up_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
- Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Object *obj = (Evas_Object *) data;
+ Widget_Data *wd = elm_widget_data_get(obj);
double position = 0.0;
if (!wd) return;
edje_object_part_drag_value_get(wd->as, "elm.drag_button_base",
&position, NULL);
- if (position == 0.0 && (wd->enabled_position & ELM_ACTIONSLIDER_LEFT))
+ if ((wd->enabled_position & ELM_ACTIONSLIDER_LEFT) &&
+ ((!elm_widget_mirrored_get(obj) && position == 0.0) ||
+ (elm_widget_mirrored_get(obj) && position == 1.0)))
{
wd->final_position = 0;
evas_object_smart_callback_call(data, SIG_SELECTED,
- (void *)wd->text_left);
+ (void *) wd->text_left);
return;
}
if (position >= 0.45 && position <= 0.55 &&
(void *)wd->text_center);
return;
}
- if (position == 1.0 && (wd->enabled_position & ELM_ACTIONSLIDER_RIGHT))
+ if ((wd->enabled_position & ELM_ACTIONSLIDER_RIGHT) &&
+ ((!elm_widget_mirrored_get(obj) && position == 1.0) ||
+ (elm_widget_mirrored_get(obj) && position == 0.0)))
{
wd->final_position = 1;
evas_object_smart_callback_call(data, SIG_SELECTED,
- (void *)wd->text_right);
+ (void *) wd->text_right);
return;
}
if (wd->magnet_position == ELM_ACTIONSLIDER_NONE) return;
+#define _FINAL_POS_BY_ORIENTATION(x) (x)
+#define _POS_BY_ORIENTATION(x) \
+ ((!elm_widget_mirrored_get(obj)) ? \
+ x : 1.0 - x)
+
+ position = _POS_BY_ORIENTATION(position);
+
if (position < 0.3)
{
if (wd->magnet_position & ELM_ACTIONSLIDER_LEFT)
- wd->final_position = 0;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(0);
else if (wd->magnet_position & ELM_ACTIONSLIDER_CENTER)
wd->final_position = 0.5;
else if (wd->magnet_position & ELM_ACTIONSLIDER_RIGHT)
- wd->final_position = 1;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(1);
}
else if ((position >= 0.3) && (position <= 0.7))
{
else if (position < 0.5)
{
if (wd->magnet_position & ELM_ACTIONSLIDER_LEFT)
- wd->final_position = 0;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(0);
else
- wd->final_position = 1;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(1);
}
else
{
if (wd->magnet_position & ELM_ACTIONSLIDER_RIGHT)
- wd->final_position = 1;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(1);
else
- wd->final_position = 0;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(0);
}
}
else
{
if (wd->magnet_position & ELM_ACTIONSLIDER_RIGHT)
- wd->final_position = 1;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(1);
else if (wd->magnet_position & ELM_ACTIONSLIDER_CENTER)
wd->final_position = 0.5;
else
- wd->final_position = 0;
+ wd->final_position = _FINAL_POS_BY_ORIENTATION(0);
}
wd->button_animator = ecore_animator_add(_button_animation, data);
+
+#undef _FINAL_POS_BY_ORIENTATION
}
/**
_drag_button_move_cb, obj);
evas_object_smart_callbacks_descriptions_set(obj, _signals);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
Widget_Data *wd = elm_widget_data_get(obj);
double position = 0.0;
if (!wd) return;
+ pos = _get_pos_by_orientation(obj, pos);
if (pos == ELM_ACTIONSLIDER_CENTER) position = 0.5;
else if (pos == ELM_ACTIONSLIDER_RIGHT) position = 1.0;
edje_object_part_drag_value_set(wd->as, "elm.drag_button_base", position, 0.5);
edje_object_part_drag_value_get(wd->as, "elm.drag_button_base", &position, NULL);
if (position < 0.3)
- return ELM_ACTIONSLIDER_LEFT;
+ return _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_LEFT);
else if (position < 0.7)
return ELM_ACTIONSLIDER_CENTER;
else
- return ELM_ACTIONSLIDER_RIGHT;
+ return _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_RIGHT);
}
/**
if (!wd) return;
eina_stringshare_replace(&wd->text_left, left_label);
- edje_object_part_text_set(wd->as, "elm.text.left", left_label);
eina_stringshare_replace(&wd->text_center, center_label);
- edje_object_part_text_set(wd->as, "elm.text.center", center_label);
eina_stringshare_replace(&wd->text_right, right_label);
- edje_object_part_text_set(wd->as, "elm.text.right", right_label);
+ if (!elm_widget_mirrored_get(obj))
+ {
+ edje_object_part_text_set(wd->as, "elm.text.left", wd->text_left);
+ edje_object_part_text_set(wd->as, "elm.text.right", wd->text_right);
+ }
+ else
+ {
+ edje_object_part_text_set(wd->as, "elm.text.left", wd->text_right);
+ edje_object_part_text_set(wd->as, "elm.text.right", wd->text_left);
+ }
+ edje_object_part_text_set(wd->as, "elm.text.center", center_label);
}
/**
}
static void
+_theme_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ evas_object_smart_calculate(wd->box);
+}
+
+static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
static void
_layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
{
- Widget_Data *wd = data;
+ Evas_Object *obj = (Evas_Object *) data;
+ Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- _els_box_layout(o, priv, wd->horizontal, wd->homogeneous);
+ _els_box_layout(o, priv, wd->horizontal, wd->homogeneous,
+ elm_widget_mirrored_get(obj));
}
static Eina_Bool
elm_widget_focus_next_hook_set(obj, _elm_box_focus_next_hook);
elm_widget_can_focus_set(obj, EINA_FALSE);
elm_widget_highlight_ignore_set(obj, EINA_TRUE);
+ elm_widget_theme_hook_set(obj, _theme_hook);
wd->box = evas_object_box_add(e);
/*evas_object_box_layout_set(wd->box, evas_object_box_layout_vertical,
NULL, NULL);*/
- evas_object_box_layout_set(wd->box, _layout, wd, NULL);
+ evas_object_box_layout_set(wd->box, _layout, obj, NULL);
evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
if (cb)
evas_object_box_layout_set(wd->box, cb, data, free_data);
else
- evas_object_box_layout_set(wd->box, _layout, wd, NULL);
+ evas_object_box_layout_set(wd->box, _layout, obj, NULL);
}
/**
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->bbl, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->bbl, "bubble", wd->corner,
elm_widget_style_get(obj));
edje_object_part_text_set(wd->bbl, "elm.text", wd->label);
wd->corner = eina_stringshare_add("base");
wd->bbl = edje_object_add(e);
- _elm_theme_object_set(obj, wd->bbl, "bubble", "base", "default");
elm_widget_resize_object_set(obj, wd->bbl);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
_mouse_up, obj);
evas_object_smart_callbacks_descriptions_set(obj, _signals);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
+ _elm_theme_object_set(obj, wd->bbl, "bubble", wd->corner,
+ elm_widget_style_get(obj));
_sizing_eval(obj);
return obj;
}
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->btn, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
const char *str;
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->btn, "button", "base", elm_widget_style_get(obj));
if (wd->icon)
edje_object_part_swallow(wd->btn, "elm.swallow.content", wd->icon);
static const char *widtype = NULL;
static void _on_focus_hook(void *data, Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static const char *_days_abbrev[] =
{
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->calendar, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_elm_theme_object_set(obj, wd->calendar, "calendar", "base",
elm_widget_style_get(obj));
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_set_headers(obj);
_populate(obj);
edje_object_message_signal_process(wd->calendar);
_set_headers(obj);
_populate(obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _disable_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->chk, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->chk, "check", "base", elm_widget_style_get(obj));
if (wd->icon)
edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
// TODO: convert Elementary to subclassing of Evas_Smart_Class
/* local function prototypes */
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static Eina_Bool _prop_change(void *data, int type, void *event);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->base, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->base, "conformant", "base", elm_widget_style_get(obj));
if (wd->content)
edje_object_part_swallow(wd->base, "elm.swallow.content", wd->content);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static Eina_Bool _drag_drop_cb(void *data, Evas_Object *obj, Elm_Selection_Data *);
#endif
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _disable_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ edje_object_mirrored_set(wd->ent, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
const char *t;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
t = eina_stringshare_add(elm_entry_entry_get(obj));
_elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
// if found - hook in
if ((wd->api) && (wd->api->obj_hook)) wd->api->obj_hook(obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
// TODO: convert Elementary to subclassing of Evas_Smart_Class
// TODO: and save some bytes, making descriptions per-class and not instance!
evas_object_smart_callbacks_descriptions_set(obj, _signals);
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->frm, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->frm, "frame", "base", elm_widget_style_get(obj));
edje_object_part_text_set(wd->frm, "elm.text", wd->label);
if (wd->content)
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static Eina_Bool _deselect_all_items(Widget_Data *wd);
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static Eina_Bool
_event_hook(Evas_Object *obj,
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Elm_Gengrid_Item *item;
+ if (!wd) return;
+ elm_smart_scroller_mirrored_set(wd->scr, rtl);
+ if (!wd->items) return;
+ item = ELM_GENGRID_ITEM_FROM_INLIST(wd->items);
+
+ while (item)
+ {
+ edje_object_mirrored_set(item->base.view, rtl);
+ elm_gengrid_item_update(item);
+ item = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next);
+ }
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base",
elm_widget_style_get(obj));
}
minh /= 2;
if ((adx > minw) || (ady > minh))
{
+ const char *left_drag, *right_drag;
+ if (!elm_widget_mirrored_get(item->wd->self))
+ {
+ left_drag = "drag,start,left";
+ right_drag = "drag,start,right";
+ }
+ else
+ {
+ left_drag = "drag,start,right";
+ right_drag = "drag,start,left";
+ }
+
item->dragging = 1;
if (item->long_timer)
{
{
if (dx < 0)
evas_object_smart_callback_call(item->wd->self,
- "drag,start,left", item);
+ left_drag, item);
}
}
else
{
if (dx < 0)
evas_object_smart_callback_call(item->wd->self,
- "drag,start,left", item);
+ left_drag, item);
else
evas_object_smart_callback_call(item->wd->self,
- "drag,start,right", item);
+ right_drag, item);
}
}
}
item->base.view = edje_object_add(evas_object_evas_get(item->wd->self));
edje_object_scale_set(item->base.view, elm_widget_scale_get(item->wd->self) *
_elm_config->scale);
+ edje_object_mirrored_set(item->base.view, elm_widget_mirrored_get(item->base.widget));
evas_object_smart_member_add(item->base.view, item->wd->pan_smart);
elm_widget_sub_object_add(item->wd->self, item->base.view);
snprintf(style, sizeof(style), "item/%s",
{
Evas_Coord x, y, ox, oy, cvx, cvy, cvw, cvh;
Evas_Coord tch, tcw, alignw = 0, alignh = 0, vw, vh;
-
item->x = cx;
item->y = cy;
evas_object_geometry_get(item->wd->pan_smart, &ox, &oy, &vw, &vh);
}
x = cx * item->wd->item_width - item->wd->pan_x + ox + alignw;
+ if (elm_widget_mirrored_get(item->wd->self))
+ { /* Switch items side and componsate for pan_x when in RTL mode */
+ Evas_Coord ww;
+ evas_object_geometry_get(item->wd->self, NULL, NULL, &ww, NULL);
+ x = ww - x - item->wd->item_width - item->wd->pan_x - item->wd->pan_x;
+ }
+
y = cy * item->wd->item_height - item->wd->pan_y + oy + alignh;
Eina_Bool was_realized = item->realized;
_pan_set, _pan_get, _pan_max_get,
_pan_min_get, _pan_child_size_get);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
return obj;
}
static const char *widtype = NULL;
static void _item_cache_zero(Widget_Data *wd);
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
//static void _show_region_hook(void *data, Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ _item_cache_zero(wd);
+ elm_smart_scroller_mirrored_set(wd->scr, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Item_Block *itb;
if (!wd) return;
_item_cache_zero(wd);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base",
elm_widget_style_get(obj));
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
_elm_theme_object_set(it->base.widget, it->base.view, "genlist", buf,
elm_widget_style_get(it->base.widget));
+ edje_object_mirrored_set(it->base.view,
+ elm_widget_mirrored_get(it->base.widget));
it->spacer =
evas_object_rectangle_add(evas_object_evas_get(it->base.widget));
evas_object_color_set(it->spacer, 0, 0, 0, 0);
it->spacer = NULL;
}
else
- _item_cache_add(it);
+ {
+ edje_object_mirrored_set(it->base.view, elm_widget_mirrored_get(it->base.widget));
+ _item_cache_add(it);
+ }
elm_widget_stringlist_free(it->labels);
it->labels = NULL;
elm_widget_stringlist_free(it->icons);
&minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static const char *widtype = NULL;
static void _del_pre_hook(Evas_Object *obj);
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _reval_content(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->cov, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
// FIXME: hover contents doesn't seem to propagate resizes properly
_elm_theme_object_set(obj, wd->cov, "hover", "base", elm_widget_style_get(obj));
edje_object_scale_set(wd->cov, elm_widget_scale_get(obj) *
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
- Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0;
+ Evas_Coord ofs_x, x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0;
if (!wd) return;
if (wd->parent) evas_object_geometry_get(wd->parent, &x, &y, &w, &h);
if (wd->hov) evas_object_geometry_get(wd->hov, &x2, &y2, &w2, &h2);
+
+ if (elm_widget_mirrored_get(obj))
+ ofs_x = w - (x2 - x) - w2;
+ else
+ ofs_x = x2 - x;
+
evas_object_move(wd->cov, x, y);
evas_object_resize(wd->cov, w, h);
- evas_object_size_hint_min_set(wd->offset, x2 - x, y2 - y);
+ evas_object_size_hint_min_set(wd->offset, ofs_x, y2 - y);
evas_object_size_hint_min_set(wd->size, w2, h2);
edje_object_part_swallow(wd->cov, "elm.swallow.offset", wd->offset);
edje_object_part_swallow(wd->cov, "elm.swallow.size", wd->size);
elm_hover_parent_set(obj, parent);
evas_object_smart_callbacks_descriptions_set(obj, _signals);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
evas_object_smart_callback_call(obj, SIG_SMART_LOCATION_CHANGED,
(void *)smart_dir);
+ if (elm_widget_mirrored_get(obj))
+ {
+ if (smart_dir == _HOV_BOTTOM_LEFT)
+ smart_dir = _HOV_BOTTOM_RIGHT;
+ else if (smart_dir == _HOV_BOTTOM_RIGHT)
+ smart_dir = _HOV_BOTTOM_LEFT;
+ else if (smart_dir == _HOV_RIGHT)
+ smart_dir = _HOV_LEFT;
+ else if (smart_dir == _HOV_LEFT)
+ smart_dir = _HOV_RIGHT;
+ else if (smart_dir == _HOV_TOP_RIGHT)
+ smart_dir = _HOV_TOP_LEFT;
+ else if (smart_dir == _HOV_TOP_LEFT)
+ smart_dir = _HOV_TOP_RIGHT;
+ }
snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", smart_dir);
edje_object_part_swallow(wd->cov, buf, wd->smt_sub);
}
};
static const char *widtype = NULL;
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level);
{
Widget_Data *wd = data;
if (!wd) return;
- _els_box_layout(o, priv, wd->horizontal, 1);
+ _els_box_layout(o, priv, wd->horizontal, 1, 0);
}
static void
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (!wd->horizontal)
+ edje_object_mirrored_set(wd->base, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Evas_Coord minw = 0, minh = 0;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+
_index_box_clear(obj, wd->bx[0], 0);
_index_box_clear(obj, wd->bx[1], 1);
if (wd->horizontal)
_elm_theme_object_set(obj, wd->base, "index", "base/horizontal", elm_widget_style_get(obj));
else
- _elm_theme_object_set(obj, wd->base, "index", "base/vertical", elm_widget_style_get(obj));
+ {
+ _elm_theme_object_set(obj, wd->base, "index", "base/vertical", elm_widget_style_get(obj));
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
+ }
edje_object_part_swallow(wd->base, "elm.swallow.event.0", wd->event[0]);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(wd->event[0], minw, minh);
_index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ Eina_Bool rtl;
Eina_List *l;
Elm_Index_Item *it;
Evas_Coord mw, mh, w, h;
int i = 0;
if (!wd) return;
if (wd->level_active[level]) return;
+ rtl = elm_widget_mirrored_get(obj);
evas_object_geometry_get(box, NULL, NULL, &w, &h);
EINA_LIST_FOREACH(wd->items, l, it)
{
if (it->level != level) continue;
o = edje_object_add(evas_object_evas_get(obj));
it->base.view = o;
+ edje_object_mirrored_set(it->base.view, rtl);
if (i & 0x1)
_elm_theme_object_set(obj, o, "index", "item_odd/vertical", elm_widget_style_get(obj));
else
{
Widget_Data *wd = elm_widget_data_get(data);
Evas_Event_Mouse_Down *ev = event_info;
- Evas_Coord x, y;
+ Evas_Coord x, y, w;
if (!wd) return;
if (ev->button != 1) return;
wd->down = 1;
- evas_object_geometry_get(wd->base, &x, &y, NULL, NULL);
+ evas_object_geometry_get(wd->base, &x, &y, &w, NULL);
wd->dx = ev->canvas.x - x;
wd->dy = ev->canvas.y - y;
elm_index_active_set(data, 1);
_sel_eval(data, ev->canvas.x, ev->canvas.y);
edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer",
- wd->dx, wd->dy);
+ (!edje_object_mirrored_get(wd->base)) ? wd->dx : (wd->dx - w), wd->dy);
}
static void
{
Widget_Data *wd = elm_widget_data_get(data);
Evas_Event_Mouse_Move *ev = event_info;
- Evas_Coord minw = 0, minh = 0, x, y, dx, adx;
+ Evas_Coord minw = 0, minh = 0, x, y, dx, adx, w;
char buf[1024];
if (!wd) return;
if (!wd->down) return;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
- evas_object_geometry_get(wd->base, &x, &y, NULL, NULL);
+ evas_object_geometry_get(wd->base, &x, &y, &w, NULL);
x = ev->cur.canvas.x - x;
y = ev->cur.canvas.y - y;
dx = x - wd->dx;
adx = dx;
if (adx < 0) adx = -dx;
- edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer", x, y);
+ edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer"
+ , (!edje_object_mirrored_get(wd->base)) ? x : (x - w), y);
if (!wd->horizontal)
{
if (adx > minw)
evas_object_show(wd->bx[1]);
}
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static int _get_value_in_key_string(const char *oldstring, const char *key, char **value);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->lbl, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_theme_change(obj);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
edje_object_scale_set(wd->lbl, elm_widget_scale_get(obj) *
wd->label = eina_stringshare_add("<br>");
edje_object_part_text_set(wd->lbl, "elm.text", "<br>");
elm_widget_resize_object_set(obj, wd->lbl);
-
+
evas_object_event_callback_add(wd->lbl, EVAS_CALLBACK_RESIZE, _resize, obj);
-
+
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
wd->changed = 1;
_sizing_eval(obj);
return obj;
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Widget_Data *wd);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->lay, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
edje_object_scale_set(wd->lay, elm_widget_scale_get(obj) *
_elm_config->scale);
_sizing_eval(wd);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_request_sizing_eval(wd);
return obj;
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _disable_hook(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Elm_List_Item *it;
+ Eina_List *n;
+
+ if (!wd) return;
+ if (wd->scr)
+ elm_smart_scroller_mirrored_set(wd->scr, rtl);
+
+ EINA_LIST_FOREACH(wd->items, n, it)
+ edje_object_mirrored_set(it->base.view, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Eina_List *n;
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
+
if (wd->scr)
{
Evas_Object *edj;
it->func = func;
it->base.data = data;
it->base.view = edje_object_add(evas_object_evas_get(obj));
+ edje_object_mirrored_set(it->base.view, elm_widget_mirrored_get(obj));
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN,
_mouse_down, it);
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP,
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
{
EINA_LIST_FOREACH(l, _l, item)
{
+ edje_object_mirrored_set(item->base.view, elm_widget_mirrored_get(obj));
ll = eina_list_append(ll, item->submenu.items);
if (item->separator)
_elm_theme_object_set(obj, item->base.view, "menu", "separator",
x_p = wd->xloc;
y_p = wd->yloc;
+ if (elm_widget_mirrored_get(obj))
+ x_p -= w_p;
+
if (x_p+bw > x2+w2) x_p -= x_p+bw - (x2+w2);
if (x_p < x2) x_p += x2 - x_p;
if (y_p+h_p+bh > y2+h2) y_p -= y_p+h_p+bh - (y2+h2);
if (y_p < y2) y_p += y2 - y_p;
+
evas_object_move(wd->location, x_p, y_p);
evas_object_resize(wd->location, bw, h_p);
evas_object_size_hint_min_set(wd->location, bw, h_p);
x_p = x2+w2;
y_p = y2;
+ /* If it overflows on the right, adjust the x */
+ if ((x_p + bw > px + pw) || elm_widget_mirrored_get(parent->base.widget))
+ x_p = x2-bw;
+
+ /* If it overflows on the left, adjust the x - usually only happens
+ * with an RTL interface */
+ if (x_p < px)
+ x_p = x2 + w2;
+
+ /* If after all the adjustments it still overflows, fix it */
if (x_p + bw > px + pw)
x_p = x2-bw;
Widget_Data *wd = elm_widget_data_get(item->base.widget);
if (!wd) return;
item->base.view = edje_object_add(evas_object_evas_get(wd->bx));
+ edje_object_mirrored_set(item->base.view, elm_widget_mirrored_get(item->base.widget));
evas_object_size_hint_weight_set(item->base.view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(item->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL);
_elm_theme_object_set(item->base.widget, item->base.view, "menu", "item", elm_widget_style_get(item->base.widget));
if (!wd) return;
item->submenu.location = elm_icon_add(wd->bx);
item->submenu.hv = elm_hover_add(wd->bx);
+ elm_widget_mirrored_set(item->submenu.hv, EINA_FALSE);
elm_hover_target_set(item->submenu.hv, item->submenu.location);
elm_hover_parent_set(item->submenu.hv, wd->parent);
elm_object_style_set(item->submenu.hv, "submenu");
item->submenu.bx = elm_box_add(wd->bx);
+ elm_widget_mirrored_set(item->submenu.bx, EINA_FALSE);
evas_object_size_hint_weight_set(item->submenu.bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(item->submenu.bx);
elm_hover_content_set(item->submenu.hv, elm_hover_best_content_location_get(item->submenu.hv, ELM_HOVER_AXIS_VERTICAL), item->submenu.bx);
+ edje_object_mirrored_set(item->base.view, elm_widget_mirrored_get(item->base.widget));
_elm_theme_object_set(item->base.widget, item->base.view, "menu", "item_with_submenu", elm_widget_style_get(item->base.widget));
elm_menu_item_label_set(item, item->label);
elm_menu_item_icon_set(item, item->icon_str);
wd->obj = obj;
wd->hv = elm_hover_add(obj);
+ elm_widget_mirrored_set(wd->hv, EINA_FALSE);
elm_hover_parent_set(wd->hv, parent);
elm_hover_target_set(wd->hv, wd->location);
elm_object_style_set(wd->hv, "menu");
evas_object_smart_callback_add(wd->hv, "clicked", _hover_clicked_cb, obj);
wd->bx = elm_box_add(obj);
+ elm_widget_mirrored_set(wd->bx, EINA_FALSE);
evas_object_size_hint_weight_set(wd->bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(wd->bx);
elm_hover_content_set(wd->hv, elm_hover_best_content_location_get(wd->hv, ELM_HOVER_AXIS_VERTICAL), wd->bx);
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
free(wd);
}
+/**
+ * Return Notification orientation with RTL
+ *
+ * This function switches-sides of notification area when in RTL mode.
+ *
+ * @param obj notification object.
+ *
+ * @param orient Original notification orientation.
+ *
+ * @return notification orientation with respect to the object RTL mode.
+ *
+ * @internal
+ **/
+static Elm_Notify_Orient
+_notify_orientation_with_rtl(Evas_Object *obj, Elm_Notify_Orient orient)
+{
+ if (elm_widget_mirrored_get(obj))
+ {
+ switch (orient)
+ {
+ case ELM_NOTIFY_ORIENT_LEFT:
+ orient = ELM_NOTIFY_ORIENT_RIGHT;
+ break;
+ case ELM_NOTIFY_ORIENT_RIGHT:
+ orient = ELM_NOTIFY_ORIENT_LEFT;
+ break;
+ case ELM_NOTIFY_ORIENT_TOP_LEFT:
+ orient = ELM_NOTIFY_ORIENT_TOP_RIGHT;
+ break;
+ case ELM_NOTIFY_ORIENT_TOP_RIGHT:
+ orient = ELM_NOTIFY_ORIENT_TOP_LEFT;
+ break;
+ case ELM_NOTIFY_ORIENT_BOTTOM_LEFT:
+ orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;
+ break;
+ case ELM_NOTIFY_ORIENT_BOTTOM_RIGHT:
+ orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return orient;
+}
+
+
static void
_notify_theme_apply(Evas_Object *obj)
{
}
}
+/**
+ * Moves notification to orientation.
+ *
+ * This fucntion moves notification to orientation
+ * according to object RTL orientation.
+ *
+ * @param obj notification object.
+ *
+ * @param orient notification orientation.
+ *
+ * @internal
+ **/
+static void
+_notify_move_to_orientation(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ int offx;
+ int offy;
+ Evas_Coord minw = -1, minh = -1;
+ Evas_Coord x, y, w, h;
+
+ if (!wd) return;
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
+ edje_object_size_min_get(wd->notify, &minw, &minh);
+ edje_object_size_min_restricted_calc(wd->notify, &minw, &minh, minw, minh);
+ offx = (w - minw) / 2;
+ offy = (h - minh) / 2;
+
+ switch (_notify_orientation_with_rtl(obj, wd->orient))
+ {
+ case ELM_NOTIFY_ORIENT_TOP:
+ evas_object_move(wd->notify, x + offx, y);
+ break;
+ case ELM_NOTIFY_ORIENT_CENTER:
+ evas_object_move(wd->notify, x + offx, y + offy);
+ break;
+ case ELM_NOTIFY_ORIENT_BOTTOM:
+ evas_object_move(wd->notify, x + offx, y + h - minh);
+ break;
+ case ELM_NOTIFY_ORIENT_LEFT:
+ evas_object_move(wd->notify, x, y + offy);
+ break;
+ case ELM_NOTIFY_ORIENT_RIGHT:
+ evas_object_move(wd->notify, x + w - minw, y + offy);
+ break;
+ case ELM_NOTIFY_ORIENT_TOP_LEFT:
+ evas_object_move(wd->notify, x, y);
+ break;
+ case ELM_NOTIFY_ORIENT_TOP_RIGHT:
+ evas_object_move(wd->notify, x + w - minw, y);
+ break;
+ case ELM_NOTIFY_ORIENT_BOTTOM_LEFT:
+ evas_object_move(wd->notify, x, y + h - minh);
+ break;
+ case ELM_NOTIFY_ORIENT_BOTTOM_RIGHT:
+ evas_object_move(wd->notify, x + w - minw, y + h - minh);
+ break;
+ case ELM_NOTIFY_ORIENT_LAST:
+ break;
+ }
+}
+
static void
_block_events_theme_apply(Evas_Object *obj)
{
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->notify, rtl);
+ _notify_move_to_orientation(obj);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_notify_theme_apply(obj);
if (wd->block_events) _block_events_theme_apply(obj);
edje_object_scale_set(wd->notify, elm_widget_scale_get(obj) *
if (wd->content)
{
- int offx = (w - minw) / 2;
- int offy = (h - minh) / 2;
-
- switch (wd->orient)
- {
- case ELM_NOTIFY_ORIENT_TOP:
- evas_object_move(wd->notify, x + offx, y);
- break;
- case ELM_NOTIFY_ORIENT_CENTER:
- evas_object_move(wd->notify, x + offx, y + offy);
- break;
- case ELM_NOTIFY_ORIENT_BOTTOM:
- evas_object_move(wd->notify, x + offx, y + h - minh);
- break;
- case ELM_NOTIFY_ORIENT_LEFT:
- evas_object_move(wd->notify, x, y + offy);
- break;
- case ELM_NOTIFY_ORIENT_RIGHT:
- evas_object_move(wd->notify, x + w - minw, y + offy);
- break;
- case ELM_NOTIFY_ORIENT_TOP_LEFT:
- evas_object_move(wd->notify, x, y);
- break;
- case ELM_NOTIFY_ORIENT_TOP_RIGHT:
- evas_object_move(wd->notify, x + w - minw, y);
- break;
- case ELM_NOTIFY_ORIENT_BOTTOM_LEFT:
- evas_object_move(wd->notify, x, y + h - minh);
- break;
- case ELM_NOTIFY_ORIENT_BOTTOM_RIGHT:
- evas_object_move(wd->notify, x + w - minw, y + h - minh);
- break;
- case ELM_NOTIFY_ORIENT_LAST:
- break;
- }
+ _notify_move_to_orientation(obj);
evas_object_resize(wd->notify, minw, minh);
}
_sizing_eval(obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
evas_object_smart_callbacks_descriptions_set(obj, _signals);
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Eina_List *l;
+ Item *it;
+ if (!wd) return;
+ EINA_LIST_FOREACH(wd->stack, l, it)
+ edje_object_mirrored_set(it->base, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Eina_List *l;
Item *it;
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
EINA_LIST_FOREACH(wd->stack, l, it)
{
_elm_theme_object_set(obj, it->base, "pager", "base",
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
free(wd);
}
+static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ if (wd->scr)
+ {
+ elm_widget_mirrored_set(wd->bx, rtl);
+ elm_panel_orient_set(obj, elm_panel_orient_get(obj));
+ }
+}
+
static void
_theme_hook(Evas_Object *obj)
{
Evas_Object *edj;
const char *str;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base",
elm_widget_style_get(obj));
// scale = (elm_widget_scale_get(obj) * _elm_config->scale);
else
elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
}
+
_sizing_eval(obj);
}
{
Widget_Data *wd = data;
if (!wd) return;
- _els_box_layout(o, priv, EINA_TRUE, EINA_FALSE);
+ _els_box_layout(o, priv, EINA_TRUE, EINA_FALSE, EINA_FALSE);
}
static void
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE, _resize, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "bottom");
break;
case ELM_PANEL_ORIENT_LEFT:
- elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "left");
+ if (!elm_widget_mirrored_get(obj))
+ elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "left");
+ else
+ elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "right");
break;
case ELM_PANEL_ORIENT_RIGHT:
- elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "right");
+ if (!elm_widget_mirrored_get(obj))
+ elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "right");
+ else
+ elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "left");
break;
}
+
_sizing_eval(obj);
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->panes, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
double size;
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
size = elm_panes_content_left_size_get(obj);
if (wd->horizontal)
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->frm, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(wd->frm, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->frm, "photo", "base",
elm_widget_style_get(obj));
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img);
_icon_move_resize, obj);
evas_object_event_callback_add(icon, EVAS_CALLBACK_RESIZE,
_icon_move_resize, obj);
+
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->progressbar, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
if (wd->horizontal)
_elm_theme_object_set(obj, wd->progressbar, "progressbar", "horizontal", elm_widget_style_get(obj));
else
_val_set(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ Eina_Bool rtl;
double pos;
if (!wd) return;
pos = wd->val;
- if (wd->inverted) pos = MAX_RATIO_LVL - pos;
+ rtl = elm_widget_mirrored_get(obj);
+ if ((!rtl && wd->inverted) || (rtl &&
+ ((!wd->horizontal && wd->inverted) ||
+ (wd->horizontal && !wd->inverted)))) pos = MAX_RATIO_LVL - pos;
edje_object_part_drag_value_set(wd->progressbar, "elm.cur.progressbar", pos, pos);
}
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
_units_set(obj);
_val_set(obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static const char *widtype = NULL;
static void _state_set(Evas_Object *obj, Eina_Bool state);
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _disable_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->radio, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->radio, "radio", "base", elm_widget_style_get(obj));
if (wd->icon)
edje_object_signal_emit(wd->radio, "elm,state,icon,visible", "elm");
wd->group->radios = eina_list_append(wd->group->radios, obj);
wd->state = 0;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
// TODO: convert Elementary to subclassing of Evas_Smart_Class
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (wd->scr)
+ elm_smart_scroller_mirrored_set(wd->scr, mirrored);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *edj;
const char *str;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_smart_scroller_object_theme_set(obj, wd->scr,
wd->widget_name, wd->widget_base,
elm_widget_style_get(obj));
// TODO: convert Elementary to subclassing of Evas_Smart_Class
// TODO: and save some bytes, making descriptions per-class and not instance!
evas_object_smart_callbacks_descriptions_set(obj, _signals);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
return obj;
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->sep, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
if (wd->horizontal)
_elm_theme_object_set(obj, wd->sep, "separator", "horizontal", elm_widget_style_get(obj));
else
wd->sep = edje_object_add(e);
_elm_theme_object_set(obj, wd->sep, "separator", "vertical", "default");
elm_widget_resize_object_set(obj, wd->sep);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _disable_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->slider, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
if (wd->horizontal)
_elm_theme_object_set(obj, wd->slider, "slider", "horizontal", elm_widget_style_get(obj));
else
static void
_val_fetch(Evas_Object *obj)
{
+ Eina_Bool rtl;
Widget_Data *wd = elm_widget_data_get(obj);
double posx = 0.0, posy = 0.0, pos = 0.0, val;
if (!wd) return;
&posx, &posy);
if (wd->horizontal) pos = posx;
else pos = posy;
- if (wd->inverted) pos = 1.0 - pos;
+
+ rtl = elm_widget_mirrored_get(obj);
+ if ((!rtl && wd->inverted) || (rtl &&
+ ((!wd->horizontal && wd->inverted) ||
+ (wd->horizontal && !wd->inverted)))) pos = 1.0 - pos;
val = (pos * (wd->val_max - wd->val_min)) + wd->val_min;
if (val != wd->val)
{
static void
_val_set(Evas_Object *obj)
{
+ Eina_Bool rtl;
Widget_Data *wd = elm_widget_data_get(obj);
double pos;
if (!wd) return;
pos = 0.0;
if (pos < 0.0) pos = 0.0;
else if (pos > 1.0) pos = 1.0;
- if (wd->inverted) pos = 1.0 - pos;
+
+ rtl = elm_widget_mirrored_get(obj);
+ if ((!rtl && wd->inverted) || (rtl &&
+ ((!wd->horizontal && wd->inverted) ||
+ (wd->horizontal && !wd->inverted)))) pos = 1.0 - pos;
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", pos, pos);
}
{
const char *buf;
buf = wd->indicator_format_func(wd->val);
- edje_object_part_text_set(wd->slider, "elm.indicator", buf);
+ edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", buf);
}
else if (wd->indicator)
{
char buf[1024];
snprintf(buf, sizeof(buf), wd->indicator, wd->val);
- edje_object_part_text_set(wd->slider, "elm.indicator", buf);
+ edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", buf);
}
else
- edje_object_part_text_set(wd->slider, "elm.indicator", NULL);
+ edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", NULL);
}
static void
evas_object_event_callback_add(wd->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_cb, obj);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
// TODO: convert Elementary to subclassing of Evas_Smart_Class
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->slideshow, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->slideshow, "slideshow", "base", elm_widget_style_get(obj));
edje_object_scale_set(wd->slideshow, elm_widget_scale_get(obj) *
_elm_config->scale);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
Evas_Callback_Type type, void *event_info);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
+
static void
_del_hook(Evas_Object *obj)
{
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->spinner, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->spinner, "spinner", "base", elm_widget_style_get(obj));
edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
_write_label(obj);
}
static void
-_drag(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
+_drag(void *data, Evas_Object *_obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
- Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Object *obj = data;
+ Widget_Data *wd = elm_widget_data_get(obj);
double pos = 0.0, offset, delta;
if (!wd) return;
if (wd->entry_visible) return;
&pos, NULL);
offset = wd->step;
delta = (pos - wd->drag_start_pos) * offset;
+ /* If we are on rtl mode, change the delta to be negative on such changes */
+ if (elm_widget_mirrored_get(obj))
+ delta *= -1;
if (_value_set(data, delta)) _write_label(data);
wd->drag_start_pos = pos;
wd->dragging = 1;
edje_object_signal_callback_add(wd->spinner, "elm,action,entry,toggle",
"*", _toggle_entry, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_write_label(obj);
_sizing_eval(obj);
return obj;
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
+static void _theme_hook(Evas_Object *obj);
static void
_del_pre_hook(Evas_Object *obj)
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if ((!wd) || (!wd->tbl))
+ return;
+
+ evas_object_table_mirrored_set(wd->tbl, rtl);
+}
+
+static void
+_theme_hook(Evas_Object *obj)
+{
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
+}
+
+static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_widget_focus_next_hook_set(obj, _elm_table_focus_next_hook);
elm_widget_can_focus_set(obj, EINA_FALSE);
elm_widget_highlight_ignore_set(obj, EINA_FALSE);
+ elm_widget_theme_hook_set(obj, _theme_hook);
wd->tbl = evas_object_table_add(e);
evas_object_event_callback_add(wd->tbl, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
return obj;
}
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_mirrored_set(wd->tgl, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->tgl, "toggle", "base", elm_widget_style_get(obj));
if (wd->icon)
edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm");
elm_widget_event_hook_set(obj, _event_hook);
wd->tgl = edje_object_add(e);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
_elm_theme_object_set(obj, wd->tgl, "toggle", "base", "default");
wd->ontext = eina_stringshare_add("ON");
wd->offtext = eina_stringshare_add("OFF");
edje_object_part_text_set(wd->tgl, "elm.offtext", wd->offtext);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ edje_object_signal_emit(wd->tgl, "elm,state,toggle,off", "elm");
_sizing_eval(obj);
static void _item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled);
static void _del_pre_hook(Evas_Object *obj);
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool mirrored);
+static void _mirrored_set_item(Evas_Object *obj, Elm_Toolbar_Item *it, Eina_Bool mirrored);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void
+_mirrored_set_item(Evas_Object *obj __UNUSED__, Elm_Toolbar_Item *it, Eina_Bool mirrored)
+{
+ edje_object_mirrored_set(it->base.view, mirrored);
+ elm_widget_mirrored_set(it->o_menu, mirrored);
+}
+
+static void
_theme_hook_item(Evas_Object *obj, Elm_Toolbar_Item *it, double scale, int icon_size)
{
Evas_Object *view = it->base.view;
Evas_Coord mw, mh;
const char *style = elm_widget_style_get(obj);
+ _mirrored_set_item(obj, it, elm_widget_mirrored_get(obj));
edje_object_scale_set(view, scale);
if (!it->separator)
{
}
static void
+_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Elm_Toolbar_Item *it;
+
+ EINA_INLIST_FOREACH(wd->items, it)
+ _mirrored_set_item(obj, it, mirrored);
+ if (wd->more_item)
+ _mirrored_set_item(obj, wd->more_item, mirrored);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_smart_scroller_object_theme_set(obj, wd->scr, "toolbar", "base", elm_widget_style_get(obj));
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
scale = (elm_widget_scale_get(obj) * _elm_config->scale);
edje_object_scale_set(wd->scr, scale);
wd->icon_size = _elm_toolbar_icon_size_get(wd);
Widget_Data *wd = elm_widget_data_get(data);
Evas_Coord mw, mh, vw, vh, w, h;
Elm_Toolbar_Item *it;
+ Evas_Object *obj = (Evas_Object *) data;
if (!wd) return;
wd->resize_job = NULL;
}
}
}
+
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
}
static void
static void
_layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
{
- Widget_Data *wd = data;
+ Evas_Object *obj = (Evas_Object *) data;
+ Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- _els_box_layout(o, priv, 1, wd->homogeneous);
+ _els_box_layout(o, priv, 1, wd->homogeneous, elm_widget_mirrored_get(obj));
}
static Elm_Toolbar_Item *
wd->bx = evas_object_box_add(e);
evas_object_size_hint_align_set(wd->bx, wd->align, 0.5);
- evas_object_box_layout_set(wd->bx, _layout, wd, NULL);
+ evas_object_box_layout_set(wd->bx, _layout, obj, NULL);
elm_widget_sub_object_add(obj, wd->bx);
elm_smart_scroller_child_set(wd->scr, wd->bx);
evas_object_show(wd->bx);
}
void
-_els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous)
+_els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous, int rtl)
{
Evas_Coord x, y, w, h, xx, yy;
const Eina_List *l;
if (wy > 0.0) xh = 1;
if (horizontal)
{
+ Evas_Coord ww, hh, ow, oh;
+
if (homogeneous)
{
- Evas_Coord ww, hh, ow, oh;
-
ww = (w / (Evas_Coord)count);
- hh = h;
- ow = mnw;
- if (fw) ow = ww;
- if ((mxw >= 0) && (mxw < ow))
- ow = mxw;
- oh = mnh;
- if (fh) oh = hh;
- if ((mxh >= 0) && (mxh < oh))
- oh = mxh;
- evas_object_move(obj,
- xx + (Evas_Coord)(((double)(ww - ow)) * ax),
- yy + (Evas_Coord)(((double)(hh - oh)) * ay));
- evas_object_resize(obj, ow, oh);
- xx += ww;
}
else
{
- Evas_Coord ww, hh, ow, oh;
-
ww = mnw;
if ((expand > 0) && (xw))
{
wdif -= ow;
ww += ow;
}
- hh = h;
- ow = mnw;
- if (fw) ow = ww;
- if ((mxw >= 0) && (mxw < ow)) ow = mxw;
- oh = mnh;
- if (fh) oh = hh;
- if ((mxh >= 0) && (mxh < oh)) oh = mxh;
- evas_object_move(obj,
- xx + (Evas_Coord)(((double)(ww - ow)) * ax),
- yy + (Evas_Coord)(((double)(hh - oh)) * ay));
- evas_object_resize(obj, ow, oh);
- xx += ww;
}
+ hh = h;
+ ow = mnw;
+ if (fw) ow = ww;
+ if ((mxw >= 0) && (mxw < ow)) ow = mxw;
+ oh = mnh;
+ if (fh) oh = hh;
+ if ((mxh >= 0) && (mxh < oh)) oh = mxh;
+ evas_object_move(obj,
+ ((!rtl) ? (xx) : (x + (w - (xx - x) - ww)))
+ + (Evas_Coord)(((double)(ww - ow)) * ax),
+ yy + (Evas_Coord)(((double)(hh - oh)) * ay));
+ evas_object_resize(obj, ow, oh);
+ xx += ww;
}
else
{
+ Evas_Coord ww, hh, ow, oh;
+
if (homogeneous)
{
- Evas_Coord ww, hh, ow, oh;
-
- ww = w;
hh = (h / (Evas_Coord)count);
- ow = mnw;
- if (fw) ow = ww;
- if ((mxw >= 0) && (mxw < ow)) ow = mxw;
- oh = mnh;
- if (fh) oh = hh;
- if ((mxh >= 0) && (mxh < oh)) oh = mxh;
- evas_object_move(obj,
- xx + (Evas_Coord)(((double)(ww - ow)) * ax),
- yy + (Evas_Coord)(((double)(hh - oh)) * ay));
- evas_object_resize(obj, ow, oh);
- yy += hh;
}
else
{
- Evas_Coord ww, hh, ow, oh;
-
- ww = w;
hh = mnh;
if ((expand > 0) && (xh))
{
hdif -= oh;
hh += oh;
}
- ow = mnw;
- if (fw) ow = ww;
- if ((mxw >= 0) && (mxw < ow)) ow = mxw;
- oh = mnh;
- if (fh) oh = hh;
- if ((mxh >= 0) && (mxh < oh)) oh = mxh;
- evas_object_move(obj,
- xx + (Evas_Coord)(((double)(ww - ow)) * ax),
- yy + (Evas_Coord)(((double)(hh - oh)) * ay));
- evas_object_resize(obj, ow, oh);
- yy += hh;
}
+ ww = w;
+ ow = mnw;
+ if (fw) ow = ww;
+ if ((mxw >= 0) && (mxw < ow)) ow = mxw;
+ oh = mnh;
+ if (fh) oh = hh;
+ if ((mxh >= 0) && (mxh < oh)) oh = mxh;
+ evas_object_move(obj,
+ xx + (Evas_Coord)(((double)(ww - ow)) * ax),
+ yy + (Evas_Coord)(((double)(hh - oh)) * ay));
+ evas_object_resize(obj, ow, oh);
+ yy += hh;
}
}
}
-void _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous);
+void _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous, int rtl);
elm_smart_scroller_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
{
API_ENTRY return;
- Evas_Coord px, py, wx;
+ Evas_Coord wx;
if (sd->is_mirrored == mirrored)
return;