summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-10-29 11:51:19 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-10-29 11:51:19 +0000
commit6890023f7145e52ba1803495bd8177f9031673de (patch)
treeb8106f48e1f7090cd38f4271666d2748ce7e7d95
parentd329126dea516dc6b4f5952c474b3975cd73014d (diff)
a scrollview smart plus gfx for it.
SVN revision: 18103
-rw-r--r--configure.in2
-rw-r--r--data/themes/Makefile.am3
-rw-r--r--data/themes/default.edc3
-rw-r--r--data/themes/default_scrollframe.edc737
-rw-r--r--data/themes/images/Makefile.am16
-rw-r--r--data/themes/images/e17_sb_barh1.pngbin0 -> 2092 bytes
-rw-r--r--data/themes/images/e17_sb_barh2.pngbin0 -> 2078 bytes
-rw-r--r--data/themes/images/e17_sb_barv1.pngbin0 -> 2268 bytes
-rw-r--r--data/themes/images/e17_sb_barv2.pngbin0 -> 2230 bytes
-rw-r--r--data/themes/images/e17_sb_btd1.pngbin0 -> 726 bytes
-rw-r--r--data/themes/images/e17_sb_btd2.pngbin0 -> 718 bytes
-rw-r--r--data/themes/images/e17_sb_btl1.pngbin0 -> 725 bytes
-rw-r--r--data/themes/images/e17_sb_btl2.pngbin0 -> 715 bytes
-rw-r--r--data/themes/images/e17_sb_btr1.pngbin0 -> 720 bytes
-rw-r--r--data/themes/images/e17_sb_btr2.pngbin0 -> 718 bytes
-rw-r--r--data/themes/images/e17_sb_btu1.pngbin0 -> 721 bytes
-rw-r--r--data/themes/images/e17_sb_btu2.pngbin0 -> 715 bytes
-rw-r--r--data/themes/images/e17_sb_runnerh.pngbin0 -> 144 bytes
-rw-r--r--data/themes/images/e17_sb_runnerv.pngbin0 -> 150 bytes
-rw-r--r--src/bin/Makefile.am2
-rw-r--r--src/bin/e_includes.h1
-rw-r--r--src/bin/e_intl.c1
-rw-r--r--src/bin/e_pan.c12
-rw-r--r--src/bin/e_pan.h16
-rw-r--r--src/bin/e_scrollframe.c611
-rw-r--r--src/bin/e_scrollframe.h30
-rw-r--r--src/bin/e_test.c25
27 files changed, 1440 insertions, 19 deletions
diff --git a/configure.in b/configure.in
index a75809b..564f825 100644
--- a/configure.in
+++ b/configure.in
@@ -166,7 +166,7 @@ CPPFLAGS="${PCPPFLAGS}"
166AC_SUBST(cf_cflags) 166AC_SUBST(cf_cflags)
167AC_SUBST(cf_libs) 167AC_SUBST(cf_libs)
168 168
169ALL_LINGUAS="bg de es fi fr ja pl pt ru zh_CN hu sl it cs da sk sv nb" 169ALL_LINGUAS="bg de es fi fr ja pl pt ru zh_CN hu sl it cs da sk sv nb nl"
170AC_SUBST(ALL_LINGUAS) 170AC_SUBST(ALL_LINGUAS)
171 171
172AM_GNU_GETTEXT([external]) 172AM_GNU_GETTEXT([external])
diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am
index 5082182..34101b0 100644
--- a/data/themes/Makefile.am
+++ b/data/themes/Makefile.am
@@ -45,7 +45,8 @@ default_check.edc \
45default_radio.edc \ 45default_radio.edc \
46default_frame.edc \ 46default_frame.edc \
47default_label.edc \ 47default_label.edc \
48default_button.edc 48default_button.edc \
49default_scrollframe.edc
49 50
50default.edj: Makefile $(EXTRA_DIST) 51default.edj: Makefile $(EXTRA_DIST)
51 $(EDJE_CC) $(EDJE_FLAGS) \ 52 $(EDJE_CC) $(EDJE_FLAGS) \
diff --git a/data/themes/default.edc b/data/themes/default.edc
index 21b6cf1..e86cb98 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -54,6 +54,7 @@ collections {
54#include "default_radio.edc" 54#include "default_radio.edc"
55#include "default_frame.edc" 55#include "default_frame.edc"
56#include "default_button.edc" 56#include "default_button.edc"
57#include "default_label.edc" 57#include "default_label.edc"
58#include "default_scrollframe.edc"
58} 59}
59 60
diff --git a/data/themes/default_scrollframe.edc b/data/themes/default_scrollframe.edc
new file mode 100644
index 0000000..5e17aa3
--- /dev/null
+++ b/data/themes/default_scrollframe.edc
@@ -0,0 +1,737 @@
1images {
2 image: "e17_ibar_bg_v.png" COMP;
3 image: "e17_ibar_over_v.png" COMP;
4 image: "e17_sb_btd1.png" COMP;
5 image: "e17_sb_btd2.png" COMP;
6 image: "e17_sb_btu1.png" COMP;
7 image: "e17_sb_btu2.png" COMP;
8 image: "e17_sb_btl1.png" COMP;
9 image: "e17_sb_btl2.png" COMP;
10 image: "e17_sb_btr1.png" COMP;
11 image: "e17_sb_btr2.png" COMP;
12 image: "e17_sb_btu1.png" COMP;
13 image: "e17_sb_barh1.png" COMP;
14 image: "e17_sb_barh2.png" COMP;
15 image: "e17_sb_barv1.png" COMP;
16 image: "e17_sb_barv2.png" COMP;
17 image: "e17_sb_runnerh.png" COMP;
18 image: "e17_sb_runnerv.png" COMP;
19 image: "e17_scrollbar_hdrag_thumb.png" COMP;
20 image: "e17_scrollbar_vdrag_thumb.png" COMP;
21}
22
23group {
24 name: "widgets/scrollframe";
25 parts {
26 part {
27 name: "bg";
28 mouse_events: 0;
29 description {
30 state: "default" 0.0;
31 image {
32 normal: "e17_ibar_bg_v.png";
33 border: 7 7 7 7;
34 }
35 fill {
36 smooth : 0;
37 }
38 }
39 }
40 part {
41 name: "clipper";
42 type: RECT;
43 mouse_events: 0;
44 description {
45 state: "default" 0.0;
46 rel1 {
47 to: "bg";
48 offset: 4 4;
49 }
50 rel2 {
51 to: "bg";
52 offset: -5 -5;
53 }
54 }
55 }
56 part {
57 name: "item";
58 clip_to: "clipper";
59 type: SWALLOW;
60 mouse_events: 0;
61 description {
62 state: "default" 0.0;
63 color: 0 0 0 0;
64 rel2 {
65 relative: 0.0 0.0;
66 offset: -1 -1;
67 to_x: "sb_vbar";
68 to_y: "sb_hbar";
69 }
70 }
71 }
72 part {
73 name: "conf_over";
74 mouse_events: 0;
75 description {
76 state: "default" 0.0;
77 rel1 {
78 to: "bg";
79 }
80 rel2 {
81 to: "bg";
82 }
83 image {
84 normal: "e17_ibar_over_v.png";
85 border: 13 13 13 13;
86 }
87 fill {
88 smooth : 0;
89 }
90 }
91 }
92 part {
93 name: "sb_vbar";
94 type: RECT;
95 mouse_events: 0;
96 description {
97 state: "default" 0.0;
98 min: 16 16;
99 align: 1.0 0.0;
100 rel1 {
101 to: "bg";
102 relative: 1.0 0.0;
103 offset: -5 4;
104 }
105 rel2 {
106 to: "bg";
107 relative: 1.0 0.0;
108 offset: -5 -1;
109 to_y: "sb_hbar";
110 }
111 }
112 description {
113 state: "hidden" 0.0;
114 visible: 0;
115 max: 0 99999;
116 rel1 {
117 to: "bg";
118 relative: 1.0 0.0;
119 offset: -4 4;
120 }
121 rel2 {
122 to: "bg";
123 relative: 1.0 0.0;
124 offset: -4 -1;
125 to_y: "sb_hbar";
126 }
127 }
128 }
129 part {
130 name: "sb_vbar_base";
131 type: RECT;
132 clip_to: "sb_vbar";
133 mouse_events: 1;
134 description {
135 state: "default" 0.0;
136 color: 0 0 0 0;
137 rel1 {
138 relative: 0.0 1.0;
139 offset: 0 0;
140 to: "sb_vbar_a1";
141 }
142 rel2 {
143 relative: 1.0 0.0;
144 offset: -1 -1;
145 to: "sb_vbar_a2";
146 }
147 }
148 }
149 part {
150 name: "sb_vbar_runner";
151 clip_to: "sb_vbar";
152 mouse_events: 0;
153 description {
154 state: "default" 0.0;
155 max: 2 99999;
156 rel1 {
157 to: "sb_vbar_base";
158 }
159 rel2 {
160 to: "sb_vbar_base";
161 }
162 image {
163 normal: "e17_sb_runnerv.png";
164 border: 0 0 4 4;
165 }
166 fill {
167 smooth: 0;
168 }
169 }
170 }
171 part {
172 name: "sb_vbar_p1";
173 type: RECT;
174 clip_to: "sb_vbar";
175 mouse_events: 1;
176 description {
177 state: "default" 0.0;
178 color: 0 0 0 0;
179 rel1 {
180 relative: 0.0 1.0;
181 offset: 0 0;
182 to: "sb_vbar_a1";
183 }
184 rel2 {
185 relative: 1.0 0.0;
186 offset: -1 -1;
187 to: "vbar_bar";
188 }
189 }
190 }
191 part {
192 name: "sb_vbar_p2";
193 type: RECT;
194 clip_to: "sb_vbar";
195 mouse_events: 1;
196 description {
197 state: "default" 0.0;
198 color: 0 0 0 0;
199 rel1 {
200 relative: 0.0 1.0;
201 offset: 0 0;
202 to: "vbar_bar";
203 }
204 rel2 {
205 relative: 1.0 0.0;
206 offset: -1 -1;
207 to: "sb_vbar_a2";
208 }
209 }
210 }
211 part {
212 name: "vbar_bar";
213 clip_to: "sb_vbar";
214 mouse_events: 1;
215 dragable {
216 x: 0 0 0;
217 y: 1 1 0;
218 confine: "sb_vbar_base";
219 }
220 description {
221 state: "default" 0.0;
222 min: 16 16;
223 rel1 {
224 relative: 0.5 0.5;
225 offset: 0 0;
226 to: "sb_vbar_base";
227 }
228 rel2 {
229 relative: 0.5 0.5;
230 offset: 0 0;
231 to: "sb_vbar_base";
232 }
233 image {
234 normal: "e17_sb_barv1.png";
235 border: 5 5 5 5;
236 }
237 }
238 description {
239 state: "clicked" 0.0;
240 inherit: "default" 0.0;
241 image {
242 normal: "e17_sb_barv2.png";
243 }
244 }
245 }
246 part {
247 name: "vbar_bar_thumb";
248 clip_to: "sb_vbar";
249 mouse_events: 0;
250 description {
251 state: "default" 0.0;
252 max: 8 8;
253 min: 8 8;
254 rel1 {
255 to: "vbar_bar";
256 }
257 rel2 {
258 to: "vbar_bar";
259 }
260 image {
261 normal: "e17_scrollbar_vdrag_thumb.png";
262 }
263 }
264 }
265 part {
266 name: "sb_vbar_a1";
267 type: IMAGE;
268 mouse_events: 1;
269 clip_to: "sb_vbar";
270 description {
271 state: "default" 0.0;
272 align: 0.5 0.0;
273 aspect: 1.0 1.0;
274 aspect_preference: HORIZONTAL;
275 rel1 {
276 to: "sb_vbar";
277 relative: 0.0 0.0;
278 offset: 0 0;
279 }
280 rel2 {
281 to: "sb_vbar";
282 relative: 1.0 0.0;
283 offset: -1 0;
284 }
285 image {
286 normal: "e17_sb_btu1.png";
287 }
288 }
289 description {
290 state: "clicked" 0.0;
291 inherit: "default" 0.0;
292 image {
293 normal: "e17_sb_btu2.png";
294 }
295 }
296 }
297 part {
298 name: "sb_vbar_a2";
299 type: IMAGE;
300 mouse_events: 1;
301 clip_to: "sb_vbar";
302 description {
303 state: "default" 0.0;
304 align: 0.5 1.0;
305 aspect: 1.0 1.0;
306 aspect_preference: HORIZONTAL;
307 rel1 {
308 to: "sb_vbar";
309 relative: 0.0 1.0;
310 offset: 0 -1;
311 }
312 rel2 {
313 to: "sb_vbar";
314 relative: 1.0 1.0;
315 offset: -1 -1;
316 }
317 image {
318 normal: "e17_sb_btd1.png";
319 }
320 }
321 description {
322 state: "clicked" 0.0;
323 inherit: "default" 0.0;
324 image {
325 normal: "e17_sb_btd2.png";
326 }
327 }
328 }
329 part {
330 name: "sb_hbar";
331 type: RECT;
332 mouse_events: 0;
333 description {
334 state: "default" 0.0;
335 min: 16 16;
336 align: 0.0 1.0;
337 rel1 {
338 to: "bg";
339 relative: 0.0 1.0;
340 offset: 4 -5;
341 }
342 rel2 {
343 to: "bg";
344 relative: 0.0 1.0;
345 offset: -1 -5;
346 to_x: "sb_vbar";
347 }
348 }
349 description {
350 state: "hidden" 0.0;
351 visible: 0;
352 rel1 {
353 to: "bg";
354 relative: 0.0 1.0;
355 offset: 0 -4;
356 }
357 rel2 {
358 to: "bg";
359 relative: 0.0 1.0;
360 offset: -1 -4;
361 to_x: "sb_vbar";
362 }
363 }
364 }
365 part {
366 name: "sb_hbar_base";
367 type: RECT;
368 clip_to: "sb_hbar";
369 mouse_events: 1;
370 description {
371 state: "default" 0.0;
372 color: 0 0 0 0;
373 rel1 {
374 relative: 1.0 0.0;
375 offset: 0 0;
376 to: "sb_hbar_a1";
377 }
378 rel2 {
379 relative: 0.0 1.0;
380 offset: -1 -1;
381 to: "sb_hbar_a2";
382 }
383 }
384 }
385 part {
386 name: "sb_hbar_runner";
387 clip_to: "sb_hbar";
388 mouse_events: 0;
389 description {
390 state: "default" 0.0;
391 max: 99999 2;
392 rel1 {
393 to: "sb_hbar_base";
394 }
395 rel2 {
396 to: "sb_hbar_base";
397 }
398 image {
399 normal: "e17_sb_runnerh.png";
400 border: 4 4 0 0;
401 }
402 fill {
403 smooth: 0;
404 }
405 }
406 }
407 part {
408 name: "sb_hbar_p1";
409 type: RECT;
410 clip_to: "sb_hbar";
411 mouse_events: 1;
412 description {
413 state: "default" 0.0;
414 color: 0 0 0 0;
415 rel1 {
416 relative: 1.0 0.0;
417 offset: 0 0;
418 to: "sb_hbar_a1";
419 }
420 rel2 {
421 relative: 0.0 1.0;
422 offset: -1 -1;
423 to: "hbar_bar";
424 }
425 }
426 }
427 part {
428 name: "sb_hbar_p2";
429 type: RECT;
430 clip_to: "sb_hbar";
431 mouse_events: 1;
432 description {
433 state: "default" 0.0;
434 color: 0 0 0 0;
435 rel1 {
436 relative: 1.0 0.0;
437 offset: 0 0;
438 to: "hbar_bar";
439 }
440 rel2 {
441 relative: 0.0 1.0;
442 offset: -1 -1;
443 to: "sb_hbar_a2";
444 }
445 }
446 }
447 part {
448 name: "hbar_bar";
449 clip_to: "sb_hbar";
450 mouse_events: 1;
451 dragable {
452 x: 1 1 0;
453 y: 0 0 0;
454 confine: "sb_hbar_base";
455 }
456 description {
457 state: "default" 0.0;
458 min: 16 16;
459 rel1 {
460 relative: 0.5 0.5;
461 offset: 0 0;
462 to: "sb_hbar_base";
463 }
464 rel2 {
465 relative: 0.5 0.5;
466 offset: 0 0;
467 to: "sb_hbar_base";
468 }
469 image {
470 normal: "e17_sb_barh1.png";
471 border: 5 5 5 5;
472 }
473 }
474 description {
475 state: "clicked" 0.0;
476 inherit: "default" 0.0;
477 image {
478 normal: "e17_sb_barh2.png";
479 }
480 }
481 }
482 part {
483 name: "hbar_bar_thumb";
484 clip_to: "sb_hbar";
485 mouse_events: 0;
486 description {
487 state: "default" 0.0;
488 max: 8 8;
489 min: 8 8;
490 rel1 {
491 to: "hbar_bar";
492 }
493 rel2 {
494 to: "hbar_bar";
495 }
496 image {
497 normal: "e17_scrollbar_hdrag_thumb.png";
498 }
499 }
500 }
501 part {
502 name: "sb_hbar_a1";
503 type: IMAGE;
504 mouse_events: 1;
505 clip_to: "sb_hbar";
506 description {
507 state: "default" 0.0;
508 align: 0.0 0.5;
509 aspect: 1.0 1.0;
510 aspect_preference: VERTICAL;
511 rel1 {
512 to: "sb_hbar";
513 relative: 0.0 0.0;
514 offset: 0 0;
515 }
516 rel2 {
517 to: "sb_hbar";
518 relative: 0.0 1.0;
519 offset: 0 -1;
520 }
521 image {
522 normal: "e17_sb_btl1.png";
523 }
524 }
525 description {
526 state: "clicked" 0.0;
527 inherit: "default" 0.0;
528 image {
529 normal: "e17_sb_btl2.png";
530 }
531 }
532 }
533 part {
534 name: "sb_hbar_a2";
535 type: IMAGE;
536 mouse_events: 1;
537 clip_to: "sb_hbar";
538 description {
539 state: "default" 0.0;
540 align: 1.0 0.5;
541 aspect: 1.0 1.0;
542 aspect_preference: VERTICAL;
543 rel1 {
544 to: "sb_hbar";
545 relative: 1.0 0.0;
546 offset: -1 0;
547 }
548 rel2 {
549 to: "sb_hbar";
550 relative: 1.0 1.0;
551 offset: -1 -1;
552 }
553 image {
554 normal: "e17_sb_btr1.png";
555 }
556 }
557 description {
558 state: "clicked" 0.0;
559 inherit: "default" 0.0;
560 image {
561 normal: "e17_sb_btr2.png";
562 }
563 }
564 }
565 }
566 programs {
567 program {
568 name: "sb_vbar_show";
569 signal: "vbar";
570 source: "show";
571 action: STATE_SET "default" 0.0;
572 target: "sb_vbar";
573 }
574 program {
575 name: "sb_vbar_hide";
576 signal: "vbar";
577 source: "hide";
578 action: STATE_SET "hidden" 0.0;
579 target: "sb_vbar";
580 }
581 program {
582 name: "sb_hbar_show";
583 signal: "hbar";
584 source: "show";
585 action: STATE_SET "default" 0.0;
586 target: "sb_hbar";
587 }
588 program {
589 name: "sb_hbar_hide";
590 signal: "hbar";
591 source: "hide";
592 action: STATE_SET "hidden" 0.0;
593 target: "sb_hbar";
594 }
595
596 program {
597 name: "sb_vbar_a1_down";
598 signal: "mouse,down,1";
599 source: "sb_vbar_a1";
600 action: STATE_SET "clicked" 0.0;
601 target: "sb_vbar_a1";
602 }
603 program {
604 name: "sb_vbar_a1_down2";
605 signal: "mouse,down,1";
606 source: "sb_vbar_a1";
607 action: DRAG_VAL_STEP 0.0 -1.0;
608 target: "vbar_bar";
609 }
610 program {
611 name: "sb_vbar_a1_up";
612 signal: "mouse,up,1";
613 source: "sb_vbar_a1";
614 action: STATE_SET "default" 0.0;
615 target: "sb_vbar_a1";
616 }
617 program {
618 name: "sb_vbar_a2_down";
619 signal: "mouse,down,1";
620 source: "sb_vbar_a2";
621 action: STATE_SET "clicked" 0.0;
622 target: "sb_vbar_a2";
623 }
624 program {
625 name: "sb_vbar_a2_down2";
626 signal: "mouse,down,1";
627 source: "sb_vbar_a2";
628 action: DRAG_VAL_STEP 0.0 1.0;
629 target: "vbar_bar";
630 }
631 program {
632 name: "sb_vbar_a2_up";
633 signal: "mouse,up,1";
634 source: "sb_vbar_a2";
635 action: STATE_SET "default" 0.0;
636 target: "sb_vbar_a2";
637 }
638 program {
639 name: "sb_vbar_p1_down";
640 signal: "mouse,down,1";
641 source: "sb_vbar_p1";
642 action: DRAG_VAL_PAGE 0.0 -1.0;
643 target: "vbar_bar";
644 }
645 program {
646 name: "sb_vbar_p2_down";
647 signal: "mouse,down,1";
648 source: "sb_vbar_p2";
649 action: DRAG_VAL_PAGE 0.0 1.0;
650 target: "vbar_bar";
651 }
652 program {
653 name: "sb_vbar_down";
654 signal: "mouse,down,1";
655 source: "vbar_bar";
656 action: STATE_SET "clicked" 0.0;
657 target: "vbar_bar";
658 }
659 program {
660 name: "sb_vbar_up";
661 signal: "mouse,up,1";
662 source: "vbar_bar";
663 action: STATE_SET "default" 0.0;
664 target: "vbar_bar";
665 }
666 program {
667 name: "sb_hbar_a1_down";
668 signal: "mouse,down,1";
669 source: "sb_hbar_a1";
670 action: STATE_SET "clicked" 0.0;
671 target: "sb_hbar_a1";
672 }
673 program {
674 name: "sb_hbar_a1_down2";
675 signal: "mouse,down,1";
676 source: "sb_hbar_a1";
677 action: DRAG_VAL_STEP -1.0 0.0;
678 target: "hbar_bar";
679 }
680 program {
681 name: "sb_hbar_a1_up";
682 signal: "mouse,up,1";
683 source: "sb_hbar_a1";
684 action: STATE_SET "default" 0.0;
685 target: "sb_hbar_a1";
686 }
687 program {
688 name: "sb_hbar_a2_down";
689 signal: "mouse,down,1";
690 source: "sb_hbar_a2";
691 action: STATE_SET "clicked" 0.0;
692 target: "sb_hbar_a2";
693 }
694 program {
695 name: "sb_hbar_a2_down2";
696 signal: "mouse,down,1";
697 source: "sb_hbar_a2";
698 action: DRAG_VAL_STEP 1.0 0.0;
699 target: "hbar_bar";
700 }
701 program {
702 name: "sb_hbar_a2_up";
703 signal: "mouse,up,1";
704 source: "sb_hbar_a2";
705 action: STATE_SET "default" 0.0;
706 target: "sb_hbar_a2";
707 }
708 program {
709 name: "sb_hbar_p1_down";
710 signal: "mouse,down,1";
711 source: "sb_hbar_p1";
712 action: DRAG_VAL_PAGE -1.0 0.0;
713 target: "hbar_bar";
714 }
715 program {
716 name: "sb_hbar_p2_down";
717 signal: "mouse,down,1";
718 source: "sb_hbar_p2";
719 action: DRAG_VAL_PAGE 1.0 0.0;
720 target: "hbar_bar";
721 }
722 program {
723 name: "sb_hbar_down";
724 signal: "mouse,down,1";
725 source: "hbar_bar";
726 action: STATE_SET "clicked" 0.0;
727 target: "hbar_bar";
728 }
729 program {
730 name: "sb_hbar_up";
731 signal: "mouse,up,1";
732 source: "hbar_bar";
733 action: STATE_SET "default" 0.0;
734 target: "hbar_bar";
735 }
736 }
737}
diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am
index 0203af2..e4bbe17 100644
--- a/data/themes/images/Makefile.am
+++ b/data/themes/images/Makefile.am
@@ -403,4 +403,18 @@ e17_button_sm.png \
403e17_button_sm2.png \ 403e17_button_sm2.png \
404e17_button_sm_disabled.png \ 404e17_button_sm_disabled.png \
405e17_menu_check0.png \ 405e17_menu_check0.png \
406e17_menu_radio0.png 406e17_menu_radio0.png \
407e17_sb_barh1.png \
408e17_sb_barh2.png \
409e17_sb_barv1.png \
410e17_sb_barv2.png \
411e17_sb_btd1.png \
412e17_sb_btd2.png \
413e17_sb_btl1.png \
414e17_sb_btl2.png \
415e17_sb_btr1.png \
416e17_sb_btr2.png \
417e17_sb_btu1.png \
418e17_sb_btu2.png \
419e17_sb_runnerh.png \
420e17_sb_runnerv.png
diff --git a/data/themes/images/e17_sb_barh1.png b/data/themes/images/e17_sb_barh1.png
new file mode 100644
index 0000000..c62c1e4
--- /dev/null
+++ b/data/themes/images/e17_sb_barh1.png
Binary files differ
diff --git a/data/themes/images/e17_sb_barh2.png b/data/themes/images/e17_sb_barh2.png
new file mode 100644
index 0000000..147012d
--- /dev/null
+++ b/data/themes/images/e17_sb_barh2.png
Binary files differ
diff --git a/data/themes/images/e17_sb_barv1.png b/data/themes/images/e17_sb_barv1.png
new file mode 100644
index 0000000..a0e5d18
--- /dev/null
+++ b/data/themes/images/e17_sb_barv1.png
Binary files differ
diff --git a/data/themes/images/e17_sb_barv2.png b/data/themes/images/e17_sb_barv2.png
new file mode 100644
index 0000000..200b6d7
--- /dev/null
+++ b/data/themes/images/e17_sb_barv2.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btd1.png b/data/themes/images/e17_sb_btd1.png
new file mode 100644
index 0000000..9ee7b5a
--- /dev/null
+++ b/data/themes/images/e17_sb_btd1.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btd2.png b/data/themes/images/e17_sb_btd2.png
new file mode 100644
index 0000000..92d8f7c
--- /dev/null
+++ b/data/themes/images/e17_sb_btd2.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btl1.png b/data/themes/images/e17_sb_btl1.png
new file mode 100644
index 0000000..444b3f6
--- /dev/null
+++ b/data/themes/images/e17_sb_btl1.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btl2.png b/data/themes/images/e17_sb_btl2.png
new file mode 100644
index 0000000..8ecdf72
--- /dev/null
+++ b/data/themes/images/e17_sb_btl2.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btr1.png b/data/themes/images/e17_sb_btr1.png
new file mode 100644
index 0000000..8405f47
--- /dev/null
+++ b/data/themes/images/e17_sb_btr1.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btr2.png b/data/themes/images/e17_sb_btr2.png
new file mode 100644
index 0000000..2a834b1
--- /dev/null
+++ b/data/themes/images/e17_sb_btr2.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btu1.png b/data/themes/images/e17_sb_btu1.png
new file mode 100644
index 0000000..3546c89
--- /dev/null
+++ b/data/themes/images/e17_sb_btu1.png
Binary files differ
diff --git a/data/themes/images/e17_sb_btu2.png b/data/themes/images/e17_sb_btu2.png
new file mode 100644
index 0000000..655a62c
--- /dev/null
+++ b/data/themes/images/e17_sb_btu2.png
Binary files differ
diff --git a/data/themes/images/e17_sb_runnerh.png b/data/themes/images/e17_sb_runnerh.png
new file mode 100644
index 0000000..0e883ab
--- /dev/null
+++ b/data/themes/images/e17_sb_runnerh.png
Binary files differ
diff --git a/data/themes/images/e17_sb_runnerv.png b/data/themes/images/e17_sb_runnerv.png
new file mode 100644
index 0000000..cb24134
--- /dev/null
+++ b/data/themes/images/e17_sb_runnerv.png
Binary files differ
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index af9e52a..6c298a6 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -106,6 +106,7 @@ e_int_border_remember.h \
106e_eap_editor.h \ 106e_eap_editor.h \
107e_widget_iconsel.h \ 107e_widget_iconsel.h \
108e_widget_fileman.h \ 108e_widget_fileman.h \
109e_scrollframe.h \
109e_file_selector.h \ 110e_file_selector.h \
110e_file_dialog.h 111e_file_dialog.h
111 112
@@ -194,6 +195,7 @@ e_int_border_remember.c \
194e_eap_editor.c \ 195e_eap_editor.c \
195e_widget_iconsel.c \ 196e_widget_iconsel.c \
196e_widget_fileman.c \ 197e_widget_fileman.c \
198e_scrollframe.c \
197e_file_selector.c \ 199e_file_selector.c \
198e_file_dialog.c \ 200e_file_dialog.c \
199$(ENLIGHTENMENTHEADERS) 201$(ENLIGHTENMENTHEADERS)
diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h
index 2f528f4..dd5ee82 100644
--- a/src/bin/e_includes.h
+++ b/src/bin/e_includes.h
@@ -84,6 +84,7 @@
84#include "e_thumb.h" 84#include "e_thumb.h"
85#include "e_int_border_remember.h" 85#include "e_int_border_remember.h"
86#include "e_eap_editor.h" 86#include "e_eap_editor.h"
87#include "e_scrollframe.h"
87#include "e_file_selector.h" 88#include "e_file_selector.h"
88#include "e_file_dialog.h" 89#include "e_file_dialog.h"
89#include "e_widget_fileman.h" 90#include "e_widget_fileman.h"
diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c
index e41c46a..713d6c6 100644
--- a/src/bin/e_intl.c
+++ b/src/bin/e_intl.c
@@ -85,6 +85,7 @@ e_intl_init(void)
85 ADD_LANG("sk_SK.UTF-8"); 85 ADD_LANG("sk_SK.UTF-8");
86 ADD_LANG("sv_SV.UTF-8"); 86 ADD_LANG("sv_SV.UTF-8");
87 ADD_LANG("nb_NO.UTF-8"); 87 ADD_LANG("nb_NO.UTF-8");
88 ADD_LANG("nl_NL.UTF-8");
88 89
89 _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", E_Input_Method_Config); 90 _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", E_Input_Method_Config);
90 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, version, INT); 91 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, version, INT);
diff --git a/src/bin/e_pan.c b/src/bin/e_pan.c
index abe0bfc..34f9479 100644
--- a/src/bin/e_pan.c
+++ b/src/bin/e_pan.c
@@ -89,13 +89,13 @@ void
89e_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) 89e_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
90{ 90{
91 API_ENTRY return; 91 API_ENTRY return;
92 sd->px = x; 92 if (x > (sd->child_w - sd->w)) x = sd->child_w - sd->w;
93 sd->py = y; 93 if (y > (sd->child_h - sd->h)) y = sd->child_h - sd->h;
94 if (x > (sd->w - sd->child_w)) x = sd->w - sd->child_w;
95 if (y > (sd->h - sd->child_h)) y = sd->h - sd->child_h;
96 if (x < 0) x = 0; 94 if (x < 0) x = 0;
97 if (y < 0) y = 0; 95 if (y < 0) y = 0;
98 if ((x == sd->px) && (y == sd->py)) return; 96 if ((x == sd->px) && (y == sd->py)) return;
97 sd->px = x;
98 sd->py = y;
99 _e_smart_reconfigure(sd); 99 _e_smart_reconfigure(sd);
100 evas_object_smart_callback_call(sd->smart_obj, "changed", NULL); 100 evas_object_smart_callback_call(sd->smart_obj, "changed", NULL);
101} 101}
@@ -114,12 +114,12 @@ e_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
114 API_ENTRY return; 114 API_ENTRY return;
115 if (x) 115 if (x)
116 { 116 {
117 if (sd->w > sd->child_w) *x = sd->w - sd->child_w; 117 if (sd->w < sd->child_w) *x = sd->child_w - sd->w;
118 else *x = 0; 118 else *x = 0;
119 } 119 }
120 if (y) 120 if (y)
121 { 121 {
122 if (sd->h > sd->child_h) *y = sd->h - sd->child_h; 122 if (sd->h < sd->child_h) *y = sd->child_h - sd->h;
123 else *y = 0; 123 else *y = 0;
124 } 124 }
125} 125}
diff --git a/src/bin/e_pan.h b/src/bin/e_pan.h
index 64e742e..bff3736 100644
--- a/src/bin/e_pan.h
+++ b/src/bin/e_pan.h
@@ -6,15 +6,13 @@
6#ifndef E_PAN_H 6#ifndef E_PAN_H
7#define E_PAN_H 7#define E_PAN_H
8 8
9EAPI Evas_Object *e_pan_add(Evas *evas); 9EAPI Evas_Object *e_pan_add (Evas *evas);
10void e_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y); 10EAPI void e_pan_child_set (Evas_Object *obj, Evas_Object *child);
11void e_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); 11EAPI Evas_Object *e_pan_child_get (Evas_Object *obj);
12void e_pan_child_set(Evas_Object *obj, Evas_Object *child); 12EAPI void e_pan_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
13Evas_Object *e_pan_child_get(Evas_Object *obj); 13EAPI void e_pan_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
14void e_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y); 14EAPI void e_pan_max_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
15void e_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); 15EAPI void e_pan_child_size_get (Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
16void e_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
17void e_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
18 16
19#endif 17#endif
20#endif 18#endif
diff --git a/src/bin/e_scrollframe.c b/src/bin/e_scrollframe.c
new file mode 100644
index 0000000..33d5854
--- /dev/null
+++ b/src/bin/e_scrollframe.c
@@ -0,0 +1,611 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4#include "e.h"
5
6#define SMART_NAME "e_scrollframe"
7#define API_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME)))
8#define INTERNAL_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if (!sd) return;
9typedef struct _E_Smart_Data E_Smart_Data;
10
11struct _E_Smart_Data
12{
13 Evas_Coord x, y, w, h;
14
15 Evas_Object *smart_obj;
16 Evas_Object *child_obj;
17 Evas_Object *pan_obj;
18 Evas_Object *edje_obj;
19 Evas_Object *event_obj;
20
21 E_Scrollframe_Policy hbar_flags, vbar_flags;
22
23 struct {
24 Evas_Coord w, h;
25 } child;
26 struct {
27 Evas_Coord x, y;
28 } step, page;
29
30 unsigned char hbar_visible : 1;
31 unsigned char vbar_visible : 1;
32};
33
34/* local subsystem functions */
35static void _e_smart_child_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
36static void _e_smart_child_resize_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
37static void _e_smart_event_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info);
38static void _e_smart_edje_drag_v(void *data, Evas_Object *obj, const char *emission, const char *source);
39static void _e_smart_edje_drag_h(void *data, Evas_Object *obj, const char *emission, const char *source);
40static void _e_smart_scrollbar_read(E_Smart_Data *sd);
41static void _e_smart_scrollbar_reset(E_Smart_Data *sd);
42static int _e_smart_scrollbar_bar_h_visibility_adjust(E_Smart_Data *sd);
43static int _e_smart_scrollbar_bar_v_visibility_adjust(E_Smart_Data *sd);
44static void _e_smart_scrollbar_bar_visibility_adjust(E_Smart_Data *sd);
45static void _e_smart_scrollbar_size_adjust(E_Smart_Data *sd);
46static void _e_smart_reconfigure(E_Smart_Data *sd);
47static void _e_smart_add(Evas_Object *obj);
48static void _e_smart_del(Evas_Object *obj);
49static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
50static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
51static void _e_smart_show(Evas_Object *obj);
52static void _e_smart_hide(Evas_Object *obj);
53static void _e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a);
54static void _e_smart_clip_set(Evas_Object *obj, Evas_Object * clip);
55static void _e_smart_clip_unset(Evas_Object *obj);
56static void _e_smart_init(void);
57
58/* local subsystem globals */
59static Evas_Smart *_e_smart = NULL;
60
61/* externally accessible functions */
62Evas_Object *
63e_scrollframe_add(Evas *evas)
64{
65 _e_smart_init();
66 return evas_object_smart_add(evas, _e_smart);
67}
68
69void
70e_scrollframe_child_set(Evas_Object *obj, Evas_Object *child)
71{
72 Evas_Coord w, h;
73
74 API_ENTRY return;
75 if (sd->child_obj)
76 {
77 e_pan_child_set(sd->pan_obj, NULL);
78 evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_FREE, _e_smart_child_del_hook);
79 evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_RESIZE, _e_smart_child_resize_hook);
80 }
81
82 sd->child_obj = child;
83 if (!child) return;
84
85 evas_object_event_callback_add(child, EVAS_CALLBACK_FREE, _e_smart_child_del_hook, sd);
86 evas_object_event_callback_add(child, EVAS_CALLBACK_RESIZE, _e_smart_child_resize_hook, sd);
87 evas_object_geometry_get(child, NULL, NULL, &w, &h);
88 sd->child.w = w;
89 sd->child.h = h;
90 e_pan_child_set(sd->pan_obj, sd->child_obj);
91 _e_smart_scrollbar_size_adjust(sd);
92 _e_smart_scrollbar_reset(sd);
93}
94
95void
96e_scrollframe_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
97{
98 Evas_Coord mx = 0, my = 0;
99 double vx, vy;
100
101 API_ENTRY return;
102 e_pan_max_get(sd->pan_obj, &mx, &my);
103 if (mx > 0) vx = (double)x / (double)mx;
104 else vx = 0.0;
105 if (vx < 0.0) vx = 0.0;
106 else if (vx > 1.0) vx = 1.0;
107 if (my > 0) vy = (double)y / (double)my;
108 else vy = 0.0;
109 if (vy < 0.0) vy = 0.0;
110 else if (vy > 1.0) vy = 1.0;
111 edje_object_part_drag_value_set(sd->edje_obj, "vbar_bar", 0.0, vy);
112 edje_object_part_drag_value_set(sd->edje_obj, "hbar_bar", vx, 0.0);
113 e_pan_set(sd->pan_obj, x, y);
114}
115
116void
117e_scrollframe_child_pos_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
118{
119 API_ENTRY return;
120 e_pan_get(sd->pan_obj, x, y);
121}
122
123void
124e_scrollframe_child_viewport_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
125{
126 API_ENTRY return;
127 evas_object_geometry_get(sd->pan_obj, NULL, NULL, w, h);
128}
129
130void
131e_scrollframe_step_size_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
132{
133 API_ENTRY return;
134 if (x < 1) x = 1;
135 if (y < 1) y = 1;
136 sd->step.x = x;
137 sd->step.y = y;
138 _e_smart_scrollbar_size_adjust(sd);
139}
140
141void
142e_scrollframe_step_size_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
143{
144 API_ENTRY return;
145 if (x) *x = sd->step.x;
146 if (y) *y = sd->step.y;
147}
148
149void
150e_scrollframe_page_size_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
151{
152 API_ENTRY return;
153 sd->page.x = x;
154 sd->page.y = y;
155 _e_smart_scrollbar_size_adjust(sd);
156}
157
158void
159e_scrollframe_page_size_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
160{
161 API_ENTRY return;
162 if (x) *x = sd->page.x;
163 if (y) *y = sd->page.y;
164}
165
166void
167e_scrollframe_policy_set(Evas_Object *obj, E_Scrollframe_Policy hbar, E_Scrollframe_Policy vbar)
168{
169 API_ENTRY return;
170 if ((sd->hbar_flags == hbar) && (sd->vbar_flags == vbar)) return;
171 sd->hbar_flags = hbar;
172 sd->vbar_flags = vbar;
173 _e_smart_scrollbar_size_adjust(sd);
174}
175
176void
177e_scrollframe_policy_get(Evas_Object *obj, E_Scrollframe_Policy *hbar, E_Scrollframe_Policy *vbar)
178{
179 API_ENTRY return;
180 if (hbar) *hbar = sd->hbar_flags;
181 if (vbar) *vbar = sd->vbar_flags;
182}
183
184/* local subsystem functions */
185static void
186_e_smart_edje_drag_v(void *data, Evas_Object *obj, const char *emission, const char *source)
187{
188 E_Smart_Data *sd;
189
190 sd = data;
191 _e_smart_scrollbar_read(sd);
192}
193
194static void
195_e_smart_edje_drag_h(void *data, Evas_Object *obj, const char *emission, const char *source)
196{
197 E_Smart_Data *sd;
198
199 sd = data;
200 _e_smart_scrollbar_read(sd);
201}
202
203static void
204_e_smart_child_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
205{
206 E_Smart_Data *sd;
207
208 sd = data;
209 sd->child_obj = NULL;
210 _e_smart_scrollbar_size_adjust(sd);
211 _e_smart_scrollbar_reset(sd);
212}
213
214static void
215_e_smart_child_resize_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
216{
217 Evas_Coord w, h;
218 E_Smart_Data *sd;
219
220 sd = data;
221 evas_object_geometry_get(sd->child_obj, NULL, NULL, &w, &h);
222 if ((w != sd->child.w) || (h != sd->child.h))
223 {
224 sd->child.w = w;
225 sd->child.h = h;
226 _e_smart_scrollbar_size_adjust(sd);
227 }
228}
229
230static void
231_e_smart_event_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
232{
233 Evas_Event_Mouse_Wheel *ev;
234 E_Smart_Data *sd;
235 Evas_Coord x = 0, y = 0;
236
237 sd = data;
238 ev = event_info;
239 e_scrollframe_child_pos_get(sd->smart_obj, &x, &y);
240 y += ev->z * sd->step.y;
241 e_scrollframe_child_pos_set(sd->smart_obj, x, y);
242}
243
244static void
245_e_smart_scrollbar_read(E_Smart_Data *sd)
246{
247 Evas_Coord x, y, mx = 0, my = 0;
248 double vx, vy;
249
250 edje_object_part_drag_value_get(sd->edje_obj, "vbar_bar", NULL, &vy);
251 edje_object_part_drag_value_get(sd->edje_obj, "hbar_bar", &vx, NULL);
252 e_pan_max_get(sd->pan_obj, &mx, &my);
253 x = vx * (double)mx;
254 y = vy * (double)my;
255 e_pan_set(sd->pan_obj, x, y);
256}
257
258static void
259_e_smart_scrollbar_reset(E_Smart_Data *sd)
260{
261 edje_object_part_drag_value_set(sd->edje_obj, "vbar_bar", 0.0, 0.0);
262 edje_object_part_drag_value_set(sd->edje_obj, "hbar_bar", 0.0, 0.0);
263 if (!sd->child_obj)
264 {
265 edje_object_part_drag_size_set(sd->edje_obj, "vbar_bar", 1.0, 1.0);
266 edje_object_part_drag_size_set(sd->edje_obj, "hbar_bar", 1.0, 1.0);
267 }
268 e_pan_set(sd->pan_obj, 0, 0);
269}
270
271static int
272_e_smart_scrollbar_bar_v_visibility_adjust(E_Smart_Data *sd)
273{
274 int scroll_v_vis_change = 0;
275 Evas_Coord w, h, vw, vh;
276
277 w = sd->child.w;
278 h = sd->child.h;
279 evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh);
280 if (sd->vbar_visible)
281 {
282 if (sd->vbar_flags == E_SCROLLFRAME_POLICY_AUTO)
283 {
284 if (sd->child_obj)
285 {
286 if (h <= vh)
287 {
288 scroll_v_vis_change = 1;
289 sd->vbar_visible = 0;
290 }
291 }
292 else
293 {
294 scroll_v_vis_change = 1;
295 sd->vbar_visible = 0;
296 }
297 }
298 else if (sd->vbar_flags == E_SCROLLFRAME_POLICY_OFF)
299 {
300 scroll_v_vis_change = 1;
301 sd->vbar_visible = 0;
302 }
303 }
304 else
305 {
306 if (sd->vbar_flags == E_SCROLLFRAME_POLICY_AUTO)
307 {
308 if (sd->child_obj)
309 {
310 if (h > vh)
311 {
312 scroll_v_vis_change = 1;
313 sd->vbar_visible = 1;
314 }
315 }
316 }
317 else if (sd->vbar_flags == E_SCROLLFRAME_POLICY_ON)
318 {
319 scroll_v_vis_change = 1;
320 sd->vbar_visible = 1;
321 }
322 }
323 if (scroll_v_vis_change)
324 {
325 if (sd->vbar_visible)
326 edje_object_signal_emit(sd->edje_obj, "vbar", "show");
327 else
328 edje_object_signal_emit(sd->edje_obj, "vbar", "hide");
329 edje_object_message_signal_process(sd->edje_obj);
330 _e_smart_scrollbar_size_adjust(sd);
331 }
332 return scroll_v_vis_change;
333}
334
335static int
336_e_smart_scrollbar_bar_h_visibility_adjust(E_Smart_Data *sd)
337{
338 int scroll_h_vis_change = 0;
339 Evas_Coord w, h, vw, vh;
340
341 w = sd->child.w;
342 h = sd->child.h;
343 evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh);
344 if (sd->hbar_visible)
345 {
346 if (sd->hbar_flags == E_SCROLLFRAME_POLICY_AUTO)
347 {
348 if (sd->child_obj)
349 {
350 if (w <= vw)
351 {
352 scroll_h_vis_change = 1;
353 sd->hbar_visible = 0;
354 }
355 }
356 else
357 {
358 scroll_h_vis_change = 1;
359 sd->hbar_visible = 0;
360 }
361 }
362 else if (sd->hbar_flags == E_SCROLLFRAME_POLICY_OFF)
363 {
364 scroll_h_vis_change = 1;
365 sd->hbar_visible = 0;
366 }
367 }
368 else
369 {
370 if (sd->hbar_flags == E_SCROLLFRAME_POLICY_AUTO)
371 {
372 if (sd->child_obj)
373 {
374 if (w > vw)
375 {
376 scroll_h_vis_change = 1;
377 sd->hbar_visible = 1;
378 }
379 }
380 }
381 else if (sd->hbar_flags == E_SCROLLFRAME_POLICY_ON)
382 {
383 scroll_h_vis_change = 1;
384 sd->hbar_visible = 1;
385 }
386 }
387 if (scroll_h_vis_change)
388 {
389 if (sd->hbar_visible)
390 edje_object_signal_emit(sd->edje_obj, "hbar", "show");
391 else
392 edje_object_signal_emit(sd->edje_obj, "hbar", "hide");
393 edje_object_message_signal_process(sd->edje_obj);
394 _e_smart_scrollbar_size_adjust(sd);
395 }
396 return scroll_h_vis_change;
397}
398
399static void
400_e_smart_scrollbar_bar_visibility_adjust(E_Smart_Data *sd)
401{
402 int changed = 0;
403
404 changed |= _e_smart_scrollbar_bar_h_visibility_adjust(sd);
405 changed |= _e_smart_scrollbar_bar_v_visibility_adjust(sd);
406 if (changed)
407 {
408 _e_smart_scrollbar_bar_h_visibility_adjust(sd);
409 _e_smart_scrollbar_bar_v_visibility_adjust(sd);
410 }
411}
412
413static void
414_e_smart_scrollbar_size_adjust(E_Smart_Data *sd)
415{
416 if (sd->child_obj)
417 {
418 Evas_Coord x, y, w, h, mx = 0, my = 0, vw = 0, vh = 0;
419 double vx, vy, size;
420
421 evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh);
422 w = sd->child.w;
423 if (w < 1) w = 1;
424 size = (double)vw / (double)w;
425 if (size > 1.0)
426 {
427 size = 1.0;
428 edje_object_part_drag_value_set(sd->edje_obj, "hbar_bar", 0.0, 0.0);
429 }
430 edje_object_part_drag_size_set(sd->edje_obj, "hbar_bar", size, 1.0);
431
432 h = sd->child.h;
433 if (h < 1) h = 1;
434 size = (double)vh / (double)h;
435 if (size > 1.0)
436 {
437 size = 1.0;
438 edje_object_part_drag_value_set(sd->edje_obj, "vbar_bar", 0.0, 0.0);
439 }
440 edje_object_part_drag_size_set(sd->edje_obj, "vbar_bar", 1.0, size);
441
442 edje_object_part_drag_value_get(sd->edje_obj, "hbar_bar", &vx, NULL);
443 edje_object_part_drag_value_get(sd->edje_obj, "vbar_bar", NULL, &vy);
444 e_pan_max_get(sd->pan_obj, &mx, &my);
445 x = vx * mx;
446 y = vy * my;
447
448 edje_object_part_drag_step_set(sd->edje_obj, "hbar_bar", (double)sd->step.x / (double)w, 0.0);
449 edje_object_part_drag_step_set(sd->edje_obj, "vbar_bar", 0.0, (double)sd->step.y / (double)h);
450 if (sd->page.x > 0)
451 edje_object_part_drag_page_set(sd->edje_obj, "hbar_bar", (double)sd->page.x / (double)w, 0.0);
452 else
453 edje_object_part_drag_page_set(sd->edje_obj, "hbar_bar", -((double)sd->page.x * ((double)vw / (double)w)) / 100.0, 0.0);
454 if (sd->page.y > 0)
455 edje_object_part_drag_page_set(sd->edje_obj, "vbar_bar", 0.0, (double)sd->page.y / (double)h);
456 else
457 edje_object_part_drag_page_set(sd->edje_obj, "vbar_bar", 0.0, -((double)sd->page.y * ((double)vh / (double)h)) / 100.0);
458
459 e_pan_set(sd->pan_obj, x, y);
460 }
461 else
462 {
463 edje_object_part_drag_size_set(sd->edje_obj, "vbar_bar", 1.0, 1.0);
464 edje_object_part_drag_size_set(sd->edje_obj, "hbar_bar", 1.0, 1.0);
465 e_pan_set(sd->pan_obj, 0, 0);
466 }
467 _e_smart_scrollbar_bar_visibility_adjust(sd);
468}
469
470static void
471_e_smart_reconfigure(E_Smart_Data *sd)
472{
473 evas_object_move(sd->edje_obj, sd->x, sd->y);
474 evas_object_resize(sd->edje_obj, sd->w, sd->h);
475 evas_object_move(sd->event_obj, sd->x, sd->y);
476 evas_object_resize(sd->event_obj, sd->w, sd->h);
477 _e_smart_scrollbar_size_adjust(sd);
478}
479
480static void
481_e_smart_add(Evas_Object *obj)
482{
483 E_Smart_Data *sd;
484 Evas_Object *o;
485
486 sd = calloc(1, sizeof(E_Smart_Data));
487 if (!sd) return;
488 evas_object_smart_data_set(obj, sd);
489
490 sd->smart_obj = obj;
491 sd->x = 0;
492 sd->y = 0;
493 sd->w = 0;
494 sd->h = 0;
495 sd->step.x = 32;
496 sd->step.y = 32;
497 sd->page.x = -50;
498 sd->page.y = -50;
499 sd->hbar_flags = E_SCROLLFRAME_POLICY_AUTO;
500 sd->vbar_flags = E_SCROLLFRAME_POLICY_AUTO;
501 sd->hbar_visible = 1;
502 sd->vbar_visible = 1;
503
504 o = edje_object_add(evas_object_evas_get(obj));
505 sd->edje_obj = o;
506 e_theme_edje_object_set(o, "base/theme/widgets",
507 "widgets/scrollframe");
508 edje_object_signal_callback_add(o, "drag*", "vbar_bar", _e_smart_edje_drag_v, sd);
509 edje_object_signal_callback_add(o, "drag*", "hbar_bar", _e_smart_edje_drag_h, sd);
510 evas_object_smart_member_add(o, obj);
511
512 o = e_pan_add(evas_object_evas_get(obj));
513 sd->pan_obj = o;
514 evas_object_show(o);
515 edje_object_part_swallow(sd->edje_obj, "item", o);
516
517 o = evas_object_rectangle_add(evas_object_evas_get(obj));
518 sd->event_obj = o;
519 evas_object_color_set(o, 0, 0, 0, 0);
520 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, _e_smart_event_wheel, sd);
521 evas_object_smart_member_add(o, obj);
522 evas_object_repeat_events_set(o, 1);
523 evas_object_show(o);
524
525 _e_smart_scrollbar_reset(sd);
526}
527
528static void
529_e_smart_del(Evas_Object *obj)
530{
531 INTERNAL_ENTRY;
532 e_scrollframe_child_set(obj, NULL);
533 evas_object_del(sd->pan_obj);
534 evas_object_del(sd->edje_obj);
535 evas_object_del(sd->event_obj);
536 free(sd);
537}
538
539static void
540_e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
541{
542 INTERNAL_ENTRY;
543 sd->x = x;
544 sd->y = y;
545 _e_smart_reconfigure(sd);
546}
547
548static void
549_e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
550{
551 INTERNAL_ENTRY;
552 sd->w = w;
553 sd->h = h;
554 _e_smart_reconfigure(sd);
555}
556
557static void
558_e_smart_show(Evas_Object *obj)
559{
560 INTERNAL_ENTRY;
561 evas_object_show(sd->edje_obj);
562}
563
564static void
565_e_smart_hide(Evas_Object *obj)
566{
567 INTERNAL_ENTRY;
568 evas_object_hide(sd->edje_obj);
569}
570
571static void
572_e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
573{
574 INTERNAL_ENTRY;
575 evas_object_color_set(sd->edje_obj, r, g, b, a);
576}
577
578static void
579_e_smart_clip_set(Evas_Object *obj, Evas_Object * clip)
580{
581 INTERNAL_ENTRY;
582 evas_object_clip_set(sd->edje_obj, clip);
583}
584
585static void
586_e_smart_clip_unset(Evas_Object *obj)
587{
588 INTERNAL_ENTRY;
589 evas_object_clip_unset(sd->edje_obj);
590}
591
592/* never need to touch this */
593
594static void
595_e_smart_init(void)
596{
597 if (_e_smart) return;
598 _e_smart = evas_smart_new(SMART_NAME,
599 _e_smart_add,
600 _e_smart_del,
601 NULL, NULL, NULL, NULL, NULL,
602 _e_smart_move,
603 _e_smart_resize,
604 _e_smart_show,
605 _e_smart_hide,
606 _e_smart_color_set,
607 _e_smart_clip_set,
608 _e_smart_clip_unset,
609 NULL);
610}
611
diff --git a/src/bin/e_scrollframe.h b/src/bin/e_scrollframe.h
new file mode 100644
index 0000000..b29df71
--- /dev/null
+++ b/src/bin/e_scrollframe.h
@@ -0,0 +1,30 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4#ifdef E_TYPEDEFS
5#else
6#ifndef E_SCROLLFRAME_H
7#define E_SCROLLFRAME_H
8
9typedef enum _E_Scrollframe_Policy
10{
11 E_SCROLLFRAME_POLICY_OFF,
12 E_SCROLLFRAME_POLICY_ON,
13 E_SCROLLFRAME_POLICY_AUTO
14}
15E_Scrollframe_Policy;
16
17EAPI Evas_Object *e_scrollframe_add (Evas *evas);
18EAPI void e_scrollframe_child_set (Evas_Object *obj, Evas_Object *child);
19EAPI void e_scrollframe_child_pos_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
20EAPI void e_scrollframe_child_pos_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
21EAPI void e_scrollframe_child_viewport_size_get (Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
22EAPI void e_scrollframe_step_size_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
23EAPI void e_scrollframe_step_size_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
24EAPI void e_scrollframe_page_size_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
25EAPI void e_scrollframe_page_size_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
26EAPI void e_scrollframe_policy_set (Evas_Object *obj, E_Scrollframe_Policy hbar, E_Scrollframe_Policy vbar);
27EAPI void e_scrollframe_policy_get (Evas_Object *obj, E_Scrollframe_Policy *hbar, E_Scrollframe_Policy *vbar);
28
29#endif
30#endif
diff --git a/src/bin/e_test.c b/src/bin/e_test.c
index b9da9ee..d4769f8 100644
--- a/src/bin/e_test.c
+++ b/src/bin/e_test.c
@@ -307,6 +307,31 @@ _e_test_internal(E_Container *con)
307 e_win_centered_set(dia->win, 1); 307 e_win_centered_set(dia->win, 1);
308 e_dialog_show(dia); 308 e_dialog_show(dia);
309} 309}
310#elif 0
311static void
312_e_test_internal(E_Container *con)
313{
314 E_Dialog *dia;
315 Evas_Object *o, *o2;
316
317 dia = e_dialog_new(con);
318 e_dialog_title_set(dia, "A Test Dialog");
319
320 o = e_icon_add(dia->win->evas);
321 e_icon_file_set(o, "/home/raster/t.png");
322 evas_object_resize(o, 1024, 768);
323 evas_object_show(o);
324
325 o2 = e_scrollframe_add(dia->win->evas);
326 evas_object_resize(o2, 200, 300);
327 evas_object_show(o2);
328 e_scrollframe_child_set(o2, o);
329
330 e_dialog_content_set(dia, o2, 500, 300);
331 e_dialog_button_add(dia, "OK", NULL, NULL, NULL);
332 e_win_centered_set(dia->win, 1);
333 e_dialog_show(dia);
334}
310#else 335#else
311static void 336static void
312_e_test_internal(E_Container *con) 337_e_test_internal(E_Container *con)