summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2016-11-03 19:10:51 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-12-19 14:58:35 -0200
commit7ef5f6c3a0a6893552a7f13aa2777e3b9480e343 (patch)
tree7d239524cfd097251e10c601c68b17279c5a01e0 /src
parentbb3fd015de8ab75fd509602a3c868ea9fdce9bb3 (diff)
examples/edje: add multiseat example
Diffstat (limited to 'src')
-rw-r--r--src/examples/edje/.gitignore1
-rw-r--r--src/examples/edje/Makefile.am3
-rw-r--r--src/examples/edje/edje-multiseat.c211
-rw-r--r--src/examples/edje/multiseat.edc740
4 files changed, 955 insertions, 0 deletions
diff --git a/src/examples/edje/.gitignore b/src/examples/edje/.gitignore
index 5b5f5f0cd7..a10bdf9061 100644
--- a/src/examples/edje/.gitignore
+++ b/src/examples/edje/.gitignore
@@ -11,6 +11,7 @@
11/edje-drag 11/edje-drag
12/edje-edit-part-box 12/edje-edit-part-box
13/edje-entry 13/edje-entry
14/edje-multiseat
14/edje-multisense 15/edje-multisense
15/edje-perspective 16/edje-perspective
16/edje-signals-messages 17/edje-signals-messages
diff --git a/src/examples/edje/Makefile.am b/src/examples/edje/Makefile.am
index 7dff1e3c86..6198ccf125 100644
--- a/src/examples/edje/Makefile.am
+++ b/src/examples/edje/Makefile.am
@@ -43,6 +43,7 @@ external_elm_panes.edc \
43external_emotion_elm.edc \ 43external_emotion_elm.edc \
44lua_script.edc \ 44lua_script.edc \
45messages_echo.edc \ 45messages_echo.edc \
46multiseat.edc \
46perspective.edc \ 47perspective.edc \
47signals-messages.edc \ 48signals-messages.edc \
48signalsBubble.edc \ 49signalsBubble.edc \
@@ -140,6 +141,7 @@ edje-color-class.c \
140edje-drag.c \ 141edje-drag.c \
141edje-edit-part-box.c \ 142edje-edit-part-box.c \
142edje-entry.c \ 143edje-entry.c \
144edje-multiseat.c \
143edje-multisense.c \ 145edje-multisense.c \
144edje-perspective.c \ 146edje-perspective.c \
145edje-signals-messages.c \ 147edje-signals-messages.c \
@@ -213,6 +215,7 @@ edje-color-class \
213edje-drag\ 215edje-drag\
214edje-edit-part-box \ 216edje-edit-part-box \
215edje-entry \ 217edje-entry \
218edje-multiseat \
216edje-perspective \ 219edje-perspective \
217edje-signals-messages \ 220edje-signals-messages \
218edje-swallow \ 221edje-swallow \
diff --git a/src/examples/edje/edje-multiseat.c b/src/examples/edje/edje-multiseat.c
new file mode 100644
index 0000000000..4fbc77c842
--- /dev/null
+++ b/src/examples/edje/edje-multiseat.c
@@ -0,0 +1,211 @@
1/**
2 * Edje example demonstrating how to use multiseat features.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one) that supports multiseat. It may be wayland or
6 * X11 with VNC support. Using other engines will lead you to a
7 * situation where all seats are reported as the same one ("default").
8 *
9 * @verbatim
10 * edje_cc multiseat.edc && gcc -o edje-multiseat edje-multiseat.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
11 * @endverbatim
12 */
13
14#ifdef HAVE_CONFIG_H
15# include "config.h"
16#else
17# define EINA_UNUSED
18#endif
19
20#ifndef PACKAGE_DATA_DIR
21#define PACKAGE_DATA_DIR "."
22#endif
23
24#include <Ecore.h>
25#include <Ecore_Evas.h>
26#include <Edje.h>
27
28#define WIDTH 400
29#define HEIGHT 400
30
31static const char *GROUPNAME = "example/main";
32static const char *PARTNAME_KNOB1 = "example/knob1";
33static const char *PARTNAME_KNOB2 = "example/knob2";
34
35static void
36_on_destroy(Ecore_Evas *ee EINA_UNUSED)
37{
38 ecore_main_loop_quit();
39}
40
41static void
42_on_canvas_resize(Ecore_Evas *ee)
43{
44 Evas_Object *bg;
45 Evas_Object *edje_obj;
46 int w, h;
47
48 bg = ecore_evas_data_get(ee, "background");
49 edje_obj = ecore_evas_data_get(ee, "edje_obj");
50
51 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
52 evas_object_resize(bg, w, h);
53 evas_object_resize(edje_obj, w, h);
54}
55
56static void
57_on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o, void *event_info)
58{
59 Evas_Event_Key_Down *ev = event_info;
60 Efl_Input_Device *seat;
61
62 seat = efl_input_device_seat_get(ev->dev);
63 printf("Seat %s (%s) pressed key %s\n", efl_input_device_name_get(seat),
64 edje_obj_seat_name_get(o, seat), ev->key);
65}
66
67static void
68_on_drag_started(void *data EINA_UNUSED, Evas_Object *o, const char *emission, const char *source)
69{
70 Eina_Stringshare *seat_name;
71 const char *seat_name_str;
72 Efl_Input_Device *seat;
73
74 seat_name_str = emission + strlen("drag,start,");
75 seat_name = eina_stringshare_add(seat_name_str);
76 seat = edje_obj_seat_get(o, seat_name);
77 printf("Seat %s (%s) started drag %s\n", efl_input_device_name_get(seat),
78 seat_name, source);
79 eina_stringshare_del(seat_name);
80}
81
82static void
83_setup_drag(Evas_Object *edje_obj, const char *partname)
84{
85 if (!edje_object_part_drag_size_set(edje_obj, partname, 1.0, 0.4))
86 printf("error when setting drag size.\n");
87
88 if (!edje_object_part_drag_step_set(edje_obj, partname, 0.0, 0.1))
89 printf("error when setting drag step size.\n");
90
91 if (!edje_object_part_drag_page_set(edje_obj, partname, 0.0, 0.3))
92 printf("error when setting drag page step size.\n");
93
94 edje_object_signal_callback_add(edje_obj, "drag,start,*", partname,
95 _on_drag_started, NULL);
96}
97
98static void
99_edje_load_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
100{
101 printf("Edje loaded\n");
102}
103
104static void
105_edje_seat_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, const char *emission, const char *source EINA_UNUSED)
106{
107 const char *sig;
108
109 sig = emission + strlen("seat,");
110 printf("Device %s\n", sig);
111}
112
113static void
114_device_added(void *data, const Efl_Event *event)
115{
116 Efl_Input_Device *dev = event->info;
117 Evas_Object *edje_obj = data;
118
119 if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
120 return;
121
122 efl_canvas_object_seat_focus_add(edje_obj, dev);
123}
124
125int
126main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
127{
128 const char *edje_file = PACKAGE_DATA_DIR"/multiseat.edj";
129 const Eina_List *devices, *l;
130 Evas_Object *edje_obj, *bg;
131 Efl_Input_Device *dev;
132 Ecore_Evas *ee;
133 Evas *evas;
134
135 if (!ecore_evas_init())
136 return EXIT_FAILURE;
137
138 if (!edje_init())
139 goto shutdown_ecore_evas;
140
141 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
142 if (!ee) goto shutdown_edje;
143
144 ecore_evas_callback_destroy_set(ee, _on_destroy);
145 ecore_evas_callback_resize_set(ee, _on_canvas_resize);
146 ecore_evas_title_set(ee, "Edje Multiseat Example");
147
148 evas = ecore_evas_get(ee);
149
150 bg = evas_object_rectangle_add(evas);
151 evas_object_color_set(bg, 255, 255, 255, 255);
152 evas_object_resize(bg, WIDTH, HEIGHT);
153 evas_object_show(bg);
154 ecore_evas_data_set(ee, "background", bg);
155
156 edje_obj = edje_object_add(evas);
157
158 if (!edje_object_file_set(edje_obj, edje_file, GROUPNAME))
159 printf("failed to set file %s.\n", edje_file);
160
161 evas_object_move(edje_obj, 0, 0);
162 evas_object_resize(edje_obj, WIDTH, HEIGHT);
163 evas_object_show(edje_obj);
164 ecore_evas_data_set(ee, "edje_obj", edje_obj);
165
166 _setup_drag(edje_obj, PARTNAME_KNOB1);
167 _setup_drag(edje_obj, PARTNAME_KNOB2);
168
169 edje_object_part_text_set(edje_obj, "example/text1", "Type here : ");
170 edje_object_part_text_cursor_end_set(edje_obj, "example/text1",
171 EDJE_CURSOR_MAIN);
172
173 edje_object_part_text_set(edje_obj, "example/text2", "Or maybe here : ");
174 edje_object_part_text_cursor_end_set(edje_obj, "example/text2",
175 EDJE_CURSOR_MAIN);
176
177 devices = evas_device_list(evas, NULL);
178 EINA_LIST_FOREACH(devices, l, dev)
179 {
180 if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
181 efl_canvas_object_seat_focus_add(edje_obj, dev);
182
183 }
184 efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_ADDED,
185 _device_added, edje_obj);
186 evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_KEY_DOWN,
187 _on_key_down, NULL);
188 edje_object_signal_callback_add(edje_obj, "seat,*", "",
189 _edje_seat_cb, NULL);
190 edje_object_signal_callback_add(edje_obj, "load", "",
191 _edje_load_cb, NULL);
192
193 printf("Running example on evas engine %s\n",
194 ecore_evas_engine_name_get(ee));
195 ecore_evas_show(ee);
196
197 ecore_main_loop_begin();
198
199 ecore_evas_free(ee);
200 ecore_evas_shutdown();
201 edje_shutdown();
202
203 return EXIT_SUCCESS;
204
205shutdown_edje:
206 edje_shutdown();
207shutdown_ecore_evas:
208 ecore_evas_shutdown();
209
210 return EXIT_FAILURE;
211}
diff --git a/src/examples/edje/multiseat.edc b/src/examples/edje/multiseat.edc
new file mode 100644
index 0000000000..aa16309d2f
--- /dev/null
+++ b/src/examples/edje/multiseat.edc
@@ -0,0 +1,740 @@
1collections {
2
3 styles {
4 style {
5 name: "entry_style";
6 base: "font="sans" font_size=10 color=#000 wrap="word" left_margin=2 right_margin=2";
7 }
8 }
9
10 group {
11 name: "example/main";
12 min: 400 400;
13
14 parts {
15 part {
16 name: "bg";
17 type: RECT;
18 mouse_events: 0;
19 description {
20 state: "default" 0.0;
21 }
22 }
23
24 part {
25 name: "title";
26 type: TEXT;
27 mouse_events: 0;
28 description {
29 state: "default" 0.0;
30 color: 0 0 0 255;
31 rel1 {
32 relative: 0.0 0.0;
33 offset: 0 0;
34 to: "bg";
35 }
36 rel2 {
37 relative: 1.0 0.2;
38 offset: -1 -1;
39 to: "bg";
40 }
41 text {
42 text: "Multiseat Example";
43 size: 16;
44 font: "sans";
45 min: 1 1;
46 }
47 }
48 }
49
50 part {
51 name: "drag_area1";
52 type: RECT;
53 mouse_events: 0;
54 description {
55 state: "default" 0.0;
56 color: 0 0 0 255;
57 rel1 {
58 relative: 0.1 0.25;
59 offset: -5 0;
60 }
61 rel2 {
62 relative: 0.1 0.9;
63 offset: 4 0;
64 }
65 }
66 }
67
68 part {
69 name: "example/knob1";
70 type: RECT;
71 mouse_events: 1;
72 dragable {
73 confine: "drag_area1";
74 x: 0 0 0;
75 y: 1 1 0;
76 }
77 description {
78 state: "default" 0.0;
79 min: 10 10;
80 color: 200 200 200 255;
81 }
82 description {
83 state: "focused,s1" 0.0;
84 inherit: "default" 0.0;
85 color: 200 0 0 255;
86 }
87 description {
88 state: "focused,s2" 0.0;
89 inherit: "default" 0.0;
90 color: 0 200 0 255;
91 }
92 }
93
94 part {
95 name: "drag_area2";
96 type: RECT;
97 mouse_events: 0;
98 description {
99 state: "default" 0.0;
100 color: 0 0 0 255;
101 rel1 {
102 relative: 0.2 0.25;
103 offset: -5 0;
104 }
105 rel2 {
106 relative: 0.2 0.9;
107 offset: 4 0;
108 }
109 }
110 }
111
112 part {
113 name: "example/knob2";
114 type: RECT;
115 mouse_events: 1;
116 dragable {
117 confine: "drag_area2";
118 x: 0 0 0;
119 y: 1 1 0;
120 }
121 description {
122 state: "default" 0.0;
123 min: 10 10;
124 color: 200 200 200 255;
125 }
126 description {
127 state: "focused,s1" 0.0;
128 inherit: "default" 0.0;
129 color: 200 0 0 255;
130 }
131 description {
132 state: "focused,s2" 0.0;
133 inherit: "default" 0.0;
134 color: 0 200 0 255;
135 }
136 }
137
138 part {
139 name: "bg_text1";
140 type: RECT;
141 mouse_events: 0;
142 description {
143 state: "default" 0.0;
144 min: 10 50;
145 rel1.relative: 0.3 0.25;
146 rel2.relative: 0.9 0.4;
147 color: 200 200 200 255;
148 }
149 description {
150 state: "focused,s1" 0.0;
151 inherit: "default" 0.0;
152 color: 200 0 0 255;
153 }
154 description {
155 state: "focused,s2" 0.0;
156 inherit: "default" 0.0;
157 color: 0 200 0 255;
158 }
159 }
160
161 part {
162 name: "example/text1";
163 type: TEXTBLOCK;
164 scale: 1;
165 entry_mode: EDITABLE;
166 select_mode: DEFAULT;
167 cursor_mode: UNDER;
168 mouse_events: 1;
169 multiline: 1;
170 source: "example/selection";
171 source4: "example/cursor";
172 description {
173 state: "default" 0.0;
174 min: 12 50;
175 rel1 {
176 to: "bg_text1";
177 offset: 2 2;
178 }
179 rel2 {
180 to: "bg_text1";
181 offset: -3 -3;
182 }
183 text {
184 style: "entry_style";
185 min: 0 1;
186 align: 0.0 0.0;
187 }
188 }
189 }
190
191 part {
192 name: "bg_text2";
193 type: RECT;
194 mouse_events: 0;
195 description {
196 state: "default" 0.0;
197 min: 10 50;
198 rel1.relative: 0.3 0.45;
199 rel2.relative: 0.9 0.6;
200 color: 200 200 200 255;
201 }
202 description {
203 state: "focused,s1" 0.0;
204 inherit: "default" 0.0;
205 color: 200 0 0 255;
206 }
207 description {
208 state: "focused,s2" 0.0;
209 inherit: "default" 0.0;
210 color: 0 200 0 255;
211 }
212 }
213
214 part {
215 name: "example/text2";
216 type: TEXTBLOCK;
217 scale: 1;
218 entry_mode: EDITABLE;
219 select_mode: DEFAULT;
220 cursor_mode: UNDER;
221 mouse_events: 1;
222 multiline: 1;
223 source: "example/selection";
224 source4: "example/cursor";
225 description {
226 state: "default" 0.0;
227 min: 12 50;
228 rel1 {
229 to: "bg_text2";
230 offset: 2 2;
231 }
232 rel2 {
233 to: "bg_text2";
234 offset: -3 -3;
235 }
236 text {
237 style: "entry_style";
238 min: 0 1;
239 align: 0.0 0.0;
240 }
241 }
242 }
243
244 part {
245 name: "button_bg";
246 type: RECT;
247 mouse_events: 1;
248 description {
249 state: "default" 0.0;
250 rel1.relative: 0.3 0.65;
251 rel2.relative: 0.9 0.9;
252 color: 200 200 200 255;
253 }
254 }
255
256 part {
257 name: "button_area";
258 type: RECT;
259 mouse_events: 0;
260 description {
261 state: "default" 0.0;
262 rel1 {
263 to: "button_bg";
264 offset: 10 10;
265 }
266 rel2 {
267 to: "button_bg";
268 offset: -11 -11;
269 }
270 color: 0 0 0 0;
271 }
272 }
273
274 part {
275 name: "button_left_over";
276 type: RECT;
277 mouse_events: 0;
278 description {
279 state: "default" 0.0;
280 rel1 {
281 to: "button_area";
282 relative: 0.0 0.0;
283 }
284 rel2 {
285 to: "button_area";
286 relative: 0.5 0.5;
287 }
288 color: 255 0 0 100;
289 }
290 description {
291 state: "on" 0.0;
292 inherit: "default" 0.0;
293 color: 255 0 0 255;
294 }
295 }
296
297 part {
298 name: "button_left_over_label";
299 type: TEXT;
300 mouse_events: 0;
301 description {
302 state: "default" 0.0;
303 color: 0 0 0 255;
304 rel1.to: "button_left_over";
305 rel2.to: "button_left_over";
306 text {
307 text: "Seat 1 over";
308 size: 12;
309 font: "sans";
310 min: 1 1;
311 }
312 }
313 }
314
315 part {
316 name: "button_left_focus";
317 type: RECT;
318 mouse_events: 0;
319 description {
320 state: "default" 0.0;
321 rel1 {
322 to: "button_area";
323 relative: 0.0 0.5;
324 }
325 rel2 {
326 to: "button_area";
327 relative: 0.5 1.0;
328 }
329 color: 255 0 0 100;
330 }
331 description {
332 state: "on" 0.0;
333 inherit: "default" 0.0;
334 color: 255 0 0 255;
335 }
336 }
337
338 part {
339 name: "button_left_focus_label";
340 type: TEXT;
341 mouse_events: 0;
342 description {
343 state: "default" 0.0;
344 color: 0 0 0 255;
345 rel1.to: "button_left_focus";
346 rel2.to: "button_left_focus";
347 text {
348 text: "Seat 1 focus";
349 size: 12;
350 font: "sans";
351 min: 1 1;
352 }
353 }
354 }
355
356 part {
357 name: "button_right_over";
358 type: RECT;
359 mouse_events: 0;
360 description {
361 state: "default" 0.0;
362 rel1 {
363 to: "button_area";
364 relative: 0.5 0.0;
365 }
366 rel2 {
367 to: "button_area";
368 relative: 1.0 0.5;
369 }
370 color: 0 255 0 100;
371 }
372 description {
373 state: "on" 0.0;
374 inherit: "default" 0.0;
375 color: 0 255 0 255;
376 }
377 }
378
379 part {
380 name: "button_right_over_label";
381 type: TEXT;
382 mouse_events: 0;
383 description {
384 state: "default" 0.0;
385 color: 0 0 0 255;
386 rel1.to: "button_right_over";
387 rel2.to: "button_right_over";
388 text {
389 text: "Seat 2 over";
390 size: 12;
391 font: "sans";
392 min: 1 1;
393 }
394 }
395 }
396
397 part {
398 name: "button_right_focus";
399 type: RECT;
400 mouse_events: 0;
401 description {
402 state: "default" 0.0;
403 rel1 {
404 to: "button_area";
405 relative: 0.5 0.5;
406 }
407 rel2 {
408 to: "button_area";
409 relative: 1.0 1.0;
410 }
411 color: 0 255 0 100;
412 }
413 description {
414 state: "on" 0.0;
415 inherit: "default" 0.0;
416 color: 0 255 0 255;
417 }
418 }
419
420 part {
421 name: "button_right_focus_label";
422 type: TEXT;
423 mouse_events: 0;
424 description {
425 state: "default" 0.0;
426 color: 0 0 0 255;
427 rel1.to: "button_right_focus";
428 rel2.to: "button_right_focus";
429 text {
430 text: "Seat 2 focus";
431 size: 12;
432 font: "sans";
433 min: 1 1;
434 }
435 }
436 }
437 }
438
439 programs {
440 program {
441 name: "focus";
442 signal: "load";
443 source: "";
444 action: FOCUS_SET "seat1";
445 target: "example/text1";
446 }
447
448 program {
449 name: "focus,t1,s1";
450 signal: "mouse,clicked,1,seat1";
451 source: "example/text1";
452 action: FOCUS_SET "seat1";
453 target: "example/text1";
454 }
455
456 program {
457 name: "focus,color,t1,s1";
458 signal: "focus,part,in,seat1";
459 source: "example/text1";
460 action: STATE_SET "focused,s1" 0.0;
461 target: "bg_text1";
462 }
463
464 program {
465 name: "unfocus,color,t1,s1";
466 signal: "focus,part,out,seat1";
467 source: "example/text1";
468 action: STATE_SET "default" 0.0;
469 target: "bg_text1";
470 }
471
472 program {
473 name: "focus,t2,s1";
474 signal: "mouse,clicked,1,seat1";
475 source: "example/text2";
476 action: FOCUS_SET "seat1";
477 target: "example/text2";
478 }
479
480 program {
481 name: "focus,color,t2,s1";
482 signal: "focus,part,in,seat1";
483 source: "example/text2";
484 action: STATE_SET "focused,s1" 0.0;
485 target: "bg_text2";
486 }
487
488 program {
489 name: "unfocus,color,t2,s1";
490 signal: "focus,part,out,seat1";
491 source: "example/text2";
492 action: STATE_SET "default" 0.0;
493 target: "bg_text2";
494 }
495
496 program {
497 name: "focus,t1,s2";
498 signal: "mouse,clicked,1,seat2";
499 source: "example/text1";
500 action: FOCUS_SET "seat2";
501 target: "example/text1";
502 }
503
504 program {
505 name: "focus,color,t1,s2";
506 signal: "focus,part,in,seat2";
507 source: "example/text1";
508 action: STATE_SET "focused,s2" 0.0;
509 target: "bg_text1";
510 }
511
512 program {
513 name: "unfocus,color,t1,s2";
514 signal: "focus,part,out,seat2";
515 source: "example/text1";
516 action: STATE_SET "default" 0.0;
517 target: "bg_text1";
518 }
519
520 program {
521 name: "focus,t2,s2";
522 signal: "mouse,clicked,1,seat2";
523 source: "example/text2";
524 action: FOCUS_SET "seat2";
525 target: "example/text2";
526 }
527
528 program {
529 name: "focus,color,t2,s2";
530 signal: "focus,part,in,seat2";
531 source: "example/text2";
532 action: STATE_SET "focused,s2" 0.0;
533 target: "bg_text2";
534 }
535
536 program {
537 name: "unfocus,color,t2,s2";
538 signal: "focus,part,out,seat2";
539 source: "example/text2";
540 action: STATE_SET "default" 0.0;
541 target: "bg_text2";
542 }
543
544 program {
545 name: "button,left,in";
546 signal: "mouse,in,seat1";
547 source: "button_bg";
548 action: STATE_SET "on" 0.0;
549 target: "button_left_over";
550 }
551
552 program {
553 name: "button,left,out";
554 signal: "mouse,out,seat1";
555 source: "button_bg";
556 action: STATE_SET "default" 0.0;
557 target: "button_left_over";
558 }
559
560 program {
561 name: "button,left,focus";
562 signal: "mouse,clicked,1,seat1";
563 source: "button_bg";
564 action: FOCUS_SET "seat1";
565 target: "button_bg";
566 }
567
568 program {
569 name: "button,left,focused";
570 signal: "focus,part,in,seat1";
571 source: "button_bg";
572 action: STATE_SET "on" 0.0;
573 target: "button_left_focus";
574 }
575
576 program {
577 name: "button,left,unfocused";
578 signal: "focus,part,out,seat1";
579 source: "button_bg";
580 action: STATE_SET "default" 0.0;
581 target: "button_left_focus";
582 }
583
584 program {
585 name: "button,right,in";
586 signal: "mouse,in,seat2";
587 source: "button_bg";
588 action: STATE_SET "on" 0.0;
589 target: "button_right_over";
590 }
591
592 program {
593 name: "button,right,out";
594 signal: "mouse,out,seat2";
595 source: "button_bg";
596 action: STATE_SET "default" 0.0;
597 target: "button_right_over";
598 }
599
600 program {
601 name: "button,right,focus";
602 signal: "mouse,clicked,1,seat2";
603 source: "button_bg";
604 action: FOCUS_SET "seat2";
605 target: "button_bg";
606 }
607
608 program {
609 name: "button,right,focused";
610 signal: "focus,part,in,seat2";
611 source: "button_bg";
612 action: STATE_SET "on" 0.0;
613 target: "button_right_focus";
614 }
615
616 program {
617 name: "button,right,unfocused";
618 signal: "focus,part,out,seat2";
619 source: "button_bg";
620 action: STATE_SET "default" 0.0;
621 target: "button_right_focus";
622 }
623
624 program {
625 name: "knob1,s1";
626 signal: "drag,start,seat1";
627 source: "example/knob1";
628 action: STATE_SET "focused,s1" 0.0;
629 target: "example/knob1";
630 }
631
632 program {
633 name: "knob1,s2";
634 signal: "drag,start,seat2";
635 source: "example/knob1";
636 action: STATE_SET "focused,s2" 0.0;
637 target: "example/knob1";
638 }
639
640 program {
641 name: "knob1,seat1";
642 signal: "drag,stop,*";
643 source: "example/knob1";
644 action: STATE_SET "default" 0.0;
645 target: "example/knob1";
646 }
647
648 program {
649 name: "knob2,s1";
650 signal: "drag,start,seat1";
651 source: "example/knob2";
652 action: STATE_SET "focused,s1" 0.0;
653 target: "example/knob2";
654 }
655
656 program {
657 name: "knob2,s2";
658 signal: "drag,start,seat2";
659 source: "example/knob2";
660 action: STATE_SET "focused,s2" 0.0;
661 target: "example/knob2";
662 }
663
664 program {
665 name: "knob2,seat1";
666 signal: "drag,stop,*";
667 source: "example/knob2";
668 action: STATE_SET "default" 0.0;
669 target: "example/knob2";
670 }
671 }
672 }
673
674 group {
675 name: "example/selection";
676
677 parts {
678 part {
679 name: "selection";
680 type: RECT;
681 mouse_events: 0;
682 description {
683 state: "default" 0.0;
684 color: 180 180 180 255;
685 }
686 }
687 }
688 }
689
690 group {
691 name: "example/cursor";
692 min: 1 0;
693
694 parts {
695 part {
696 name: "cursor";
697 type: RECT;
698 mouse_events: 0;
699 description {
700 state: "default" 0.0;
701 min: 2 12;
702 color: 0 0 0 255;
703 }
704 description {
705 state: "hidden" 0.0;
706 inherit: "default" 0.0;
707 color: 0 0 0 0;
708 }
709 }
710 }
711
712 programs {
713 program {
714 name: "cursor_hide";
715 signal: "load";
716 source: "";
717 action: STATE_SET "hidden" 0.0;
718 target: "cursor";
719 transition: SINUSOIDAL 0.2;
720 after: "cursor_hide_timer";
721 }
722 program {
723 name: "cursor_hide_timer";
724 in: 0.2 0.0;
725 after: "cursor_show";
726 }
727 program {
728 name: "cursor_show";
729 action: STATE_SET "default" 0.0;
730 target: "cursor";
731 after: "cursor_show_timer";
732 }
733 program {
734 name: "cursor_show_timer";
735 in: 0.5 0.0;
736 after: "cursor_hide";
737 }
738 }
739 }
740}