3 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 name: "elm/panes/vertical/default";
23 image: "00_splite_handler_bg_v.png" COMP;
24 image: "00_splite_handler_bg_press.png" COMP;
25 image: "00_splite_handler_v.png" COMP;
37 rel1.to_x: "pad_left";
38 rel2.to_x: "pad_right";
47 rel2.relative:0.0 1.0;
48 min: PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC 0;
55 inherit: "default" 0.0;
65 rel1.relative: 1.0 0.0;
66 min: PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC 0;
73 inherit: "default" 0.0;
98 inherit: "default" 0.0;
104 name: "elm.swallow.left";
106 clip_to: "whole_left";
109 state: "default" 0.0;
112 rel1.to: "whole_left";
113 rel2.to: "whole_left";
118 inherit: "default" 0.0;
119 rel1.relative: -1.0 0.0;
120 rel2.relative: 0.0 1.0;
130 state: "default" 0.0;
143 name: "elm.swallow.right";
145 clip_to: "whole_right";
148 state: "default" 0.0;
151 rel1.to: "whole_right";
152 rel2.to: "whole_right";
156 part { name: "elm.bar";
164 description { state: "default" 0.0;
165 min: PANES_STYLE_DEFAULT_MOVABLE_SIZE_INC 999999;
168 rel1.relative: 0.0 0.5;
169 rel2.relative: 1.0 0.5;
172 description { state: "default" 0.1;
173 inherit: "default" 0.0;
176 description { state: "disabled" 0.0;
177 inherit: "default" 0.0;
178 min: PANES_STYLE_DEFAULT_FIXED_SIZE_INC 999999;
180 description { state: "disabled" 0.1;
181 inherit: "default" 0.1;
184 part { name: "pad_bar_left";
188 description { state: "default" 0.0;
189 min: PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC 0;
191 rel1.to_x: "elm.bar";
201 inherit: "default" 0.0;
205 part { name: "pad_bar_right";
209 description { state: "default" 0.0;
210 min: PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC 0;
216 rel2.to_x: "elm.bar";
222 inherit: "default" 0.0;
226 part { name: "bar_bg";
229 description { state: "default" 0.0;
232 to_x: "pad_bar_left";
236 to_x: "pad_bar_right";
240 normal: "00_splite_handler_bg_v.png";
245 description { state: "clicked" 0.0;
246 inherit: "default" 0.0;
247 image.normal: "00_splite_handler_bg_press.png";
250 part { name:"bar_handler";
252 description { state:"default" 0.0;
262 min: 0 PANES_STYLE_DEFAULT_MIDDLE_SIZE_INC;
263 image.normal: "00_splite_handler_v.png";
265 description { state:"clicked" 0.0;
266 inherit: "default" 0.0;
268 description { state: "disabled" 0.0;
269 inherit: "default" 0.0;
273 part { name: "over2";
277 ignore_flags: ON_HOLD;
278 description { state: "default" 0.0;
283 description { state: "disabled" 0.0;
284 inherit: "default" 0.0;
288 part { name: "over3";
292 description { state: "default" 0.0;
297 description { state: "clicked" 0.0;
298 inherit: "default" 0.0;
301 part { name:"bar_disabled";
303 description { state:"default" 0.0;
304 rel1.to_x: "elm.bar";
305 rel2.to_x: "elm.bar";
309 description { state: "disabled" 0.0;
310 inherit: "default" 0.0;
316 public state_pair = 1; //0:both contents are not set, 1:both contents are set
317 public frame_num, whole_drag;
319 public drag_effect(val) {
320 new Float:time, Float:cur_drag, Float:drag;
323 num = get_int(frame_num);
324 drag = get_float(whole_drag);
327 time = 0.06 * num; // decide speed
328 cur_drag = drag - drag * sin(time * 90, DEGREES);
330 set_int(frame_num, num);
332 if (time < 1.0 && cur_drag > 0.0) {
333 set_drag(PART:"elm.bar", cur_drag, 0.0);
334 timer(0.02, "drag_effect", val);
337 set_drag(PART:"elm.bar", 0.0, 0.0);
338 run_program(PROGRAM:"left_content_reset");
348 set_int(state_pair, 1);
352 name: "drag_effect_start";
353 signal: "left,hide,effect";
356 new Float:x, Float:y;
358 get_drag(PART:"elm.bar", x, y);
359 set_float(whole_drag, x);
360 set_int(frame_num, 0);
362 timer(0.02, "drag_effect", 0);
364 after: "left_content_hide";
367 name: "left_content_hide";
368 action: STATE_SET "hide" 0.0;
369 transition: DECELERATE 0.4;
370 target: "elm.swallow.left";
371 target: "whole_left";
374 name: "left_content_reset";
375 action: STATE_SET "default" 0.0;
376 target: "elm.swallow.left";
377 target: "whole_left";
378 after: "effect_finished";
381 name: "effect_finished";
382 action: SIGNAL_EMIT "left,hide,effect,finished" "";
386 signal: "elm,panes,pair";
391 set_int(state_pair, 1);
392 get_state(PART:"elm.bar", st, 30, vl);
393 set_state(PART:"elm.bar", st, 0.0);
394 set_state(PART:"pad_left", "default", 0.0);
395 set_state(PART:"pad_right", "default", 0.0);
396 set_state(PART:"pad_bar_left", "default", 0.0);
397 set_state(PART:"pad_bar_right", "default", 0.0);
401 name: "panes_unpair";
402 signal: "elm,panes,unpair";
407 set_int(state_pair, 0);
408 get_state(PART:"elm.bar", st, 30, vl);
409 set_state(PART:"elm.bar", st, 0.1);
410 set_state(PART:"pad_left", "hidden", 0.0);
411 set_state(PART:"pad_right", "hidden", 0.0);
412 set_state(PART:"pad_bar_left", "hidden", 0.0);
413 set_state(PART:"pad_bar_right", "hidden", 0.0);
417 name: "button_click";
418 signal: "mouse,down,1";
420 action: SIGNAL_EMIT "elm,action,press" "";
421 after: "button_click_anim";
424 name: "button_click_anim";
426 set_state(PART:"bar_bg", "clicked", 0.0);
430 name: "button_unclick";
431 signal: "mouse,up,1";
433 action: SIGNAL_EMIT "elm,action,unpress" "";
434 after: "button_unclick_anim";
437 name: "button_unclick_anim";
439 set_state(PART:"bar_bg", "default", 0.0);
443 name: "button_click2";
444 signal: "mouse,down,1";
446 action: STATE_SET "clicked" 0.0;
450 name: "button_unclick2";
451 signal: "mouse,up,1";
453 action: STATE_SET "default" 0.0;
454 transition: DECELERATE 0.5;
458 name: "button_unclick3";
459 signal: "mouse,up,1";
461 action: SIGNAL_EMIT "elm,action,click" "";
464 name: "button_down_double";
465 signal: "mouse,down,1,double";
467 action: SIGNAL_EMIT "elm,action,click,double" "";
472 signal: "elm.panes.fixed";
474 action: STATE_SET "disabled" 0.0;
475 target: "bar_disabled";
476 target: "bar_handler";
477 after: "after_fixed";
482 if (get_int(state_pair))
483 set_state(PART:"elm.bar", "disabled", 0.0);
485 set_state(PART:"elm.bar", "disabled", 0.1);
488 //allow the movement by interaction
490 name: "panes_unfixed";
491 signal: "elm.panes.unfixed";
493 action: STATE_SET "default" 0.0;
494 target: "bar_disabled";
495 target: "bar_handler";
496 after: "after_unfixed";
499 name: "after_unfixed";
501 if (get_int(state_pair))
502 set_state(PART:"elm.bar", "default", 0.0);
504 set_state(PART:"elm.bar", "default", 0.1);
511 name: "elm/panes/horizontal/default";
513 image: "00_splite_handler_bg_h.png" COMP;
514 image: "00_splite_handler_bg_press.png" COMP;
515 image: "00_splite_handler_h.png" COMP;
518 public state_pair = 1; //0:both contents are not set, 1:both contents are set
528 state: "default" 0.0;
530 rel1.to_y: "pad_left";
531 rel2.to_y: "pad_right";
539 state: "default" 0.0;
540 rel2.relative:1.0 0.0;
541 min: 0 PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC;
548 inherit: "default" 0.0;
557 state: "default" 0.0;
558 rel1.relative: 0.0 1.0;
559 min: 0 PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC;
566 inherit: "default" 0.0;
578 state: "default" 0.0;
591 name: "elm.swallow.left";
593 clip_to: "whole_left";
596 state: "default" 0.0;
599 rel1.to: "whole_left";
600 rel2.to: "whole_left";
610 state: "default" 0.0;
623 name: "elm.swallow.right";
625 clip_to: "whole_right";
628 state: "default" 0.0;
631 rel1.to: "whole_right";
632 rel2.to: "whole_right";
636 part { name: "elm.bar";
644 description { state: "default" 0.0;
645 min: 999999 PANES_STYLE_DEFAULT_MOVABLE_SIZE_INC;
648 rel1.relative: 0.5 0.0;
649 rel2.relative: 0.5 1.0;
652 description { state: "default" 0.1;
653 inherit: "default" 0.0;
656 description { state: "disabled" 0.0;
657 inherit: "default" 0.0;
658 min: 999999 PANES_STYLE_DEFAULT_FIXED_SIZE_INC;
661 description { state: "disabled" 0.1;
662 inherit: "default" 0.1;
665 part { name: "pad_bar_left";
669 description { state: "default" 0.0;
670 min: 0 PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC;
672 rel1.to_y: "elm.bar";
682 inherit: "default" 0.0;
686 part { name: "pad_bar_right";
690 description { state: "default" 0.0;
691 min: 0 PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC;
697 rel2.to_y: "elm.bar";
702 state: "visible" 0.0;
703 inherit: "default" 0.0;
707 part { name: "bar_bg";
710 description { state: "default" 0.0;
713 to_y: "pad_bar_left";
717 to_y: "pad_bar_right";
721 normal: "00_splite_handler_bg_h.png";
726 description { state: "clicked" 0.0;
727 inherit: "default" 0.0;
728 image.normal: "00_splite_handler_bg_press.png";
731 part { name:"bar_handler";
733 description { state:"default" 0.0;
743 min: PANES_STYLE_DEFAULT_MIDDLE_SIZE_INC 0;
744 image.normal: "00_splite_handler_h.png";
746 description { state:"clicked" 0.0;
747 inherit: "default" 0.0;
749 description { state: "disabled" 0.0;
750 inherit: "default" 0.0;
754 part { name: "over2";
758 ignore_flags: ON_HOLD;
759 description { state: "default" 0.0;
764 description { state: "disabled" 0.0;
765 inherit: "default" 0.0;
769 part { name: "over3";
773 description { state: "default" 0.0;
778 description { state: "clicked" 0.0;
779 inherit: "default" 0.0;
782 part { name:"bar_disabled";
784 description { state:"default" 0.0;
785 rel1.to_y: "elm.bar";
786 rel2.to_y: "elm.bar";
790 description { state: "disabled" 0.0;
791 inherit: "default" 0.0;
802 set_int(state_pair, 1);
807 signal: "elm,panes,pair";
812 set_int(state_pair, 1);
813 get_state(PART:"elm.bar", st, 30, vl);
814 set_state(PART:"elm.bar", st, 0.0);
815 set_state(PART:"pad_left", "default", 0.0);
816 set_state(PART:"pad_right", "default", 0.0);
817 set_state(PART:"pad_bar_left", "default", 0.0);
818 set_state(PART:"pad_bar_right", "default", 0.0);
822 name: "panes_unpair";
823 signal: "elm,panes,unpair";
828 set_int(state_pair, 0);
829 get_state(PART:"elm.bar", st, 30, vl);
830 set_state(PART:"elm.bar", st, 0.1);
831 set_state(PART:"pad_left", "hidden", 0.0);
832 set_state(PART:"pad_right", "hidden", 0.0);
833 set_state(PART:"pad_bar_left", "hidden", 0.0);
834 set_state(PART:"pad_bar_right", "hidden", 0.0);
838 name: "button_click";
839 signal: "mouse,down,1";
841 action: SIGNAL_EMIT "elm,action,press" "";
842 after: "button_click_anim";
845 name: "button_click_anim";
847 set_state(PART:"bar_bg", "clicked", 0.0);
851 name: "button_unclick";
852 signal: "mouse,up,1";
854 action: SIGNAL_EMIT "elm,action,unpress" "";
855 after: "button_unclick_anim";
858 name: "button_unclick_anim";
860 set_state(PART:"bar_bg", "default", 0.0);
864 name: "button_click2";
865 signal: "mouse,down,1";
867 action: STATE_SET "clicked" 0.0;
871 name: "button_unclick2";
872 signal: "mouse,up,1";
874 action: STATE_SET "default" 0.0;
875 transition: DECELERATE 0.5;
879 name: "button_unclick3";
880 signal: "mouse,up,1";
882 action: SIGNAL_EMIT "elm,action,click" "";
885 name: "button_down_double";
886 signal: "mouse,down,1,double";
888 action: SIGNAL_EMIT "elm,action,click,double" "";
893 signal: "elm.panes.fixed";
895 action: STATE_SET "disabled" 0.0;
896 target: "bar_disabled";
897 target: "bar_handler";
898 after: "after_fixed";
903 if (get_int(state_pair))
904 set_state(PART:"elm.bar", "disabled", 0.0);
906 set_state(PART:"elm.bar", "disabled", 0.1);
909 //allow the movement by interaction
911 name: "panes_unfixed";
912 signal: "elm.panes.unfixed";
914 action: STATE_SET "default" 0.0;
915 target: "bar_disabled";
916 target: "bar_handler";
917 after: "after_unfixed";
920 name: "after_unfixed";
922 if (get_int(state_pair))
923 set_state(PART:"elm.bar", "default", 0.0);
925 set_state(PART:"elm.bar", "default", 0.1);