summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-21 14:01:45 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-21 14:01:45 -0400
commit893985eb457eb931c0e32664b05f0b0e3f509a9d (patch)
tree0cfa8214f3fa522b0375baca4aa2d28798280600
parentc71d45ba21db355a70513eb633bdc6d0b674f097 (diff)
wheel shade test
-rwxr-xr-xscripts/shade2.sh14
-rw-r--r--src/e_mod_main.c1
-rw-r--r--src/e_mod_main.h1
-rw-r--r--src/shade2.c58
4 files changed, 74 insertions, 0 deletions
diff --git a/scripts/shade2.sh b/scripts/shade2.sh
new file mode 100755
index 0000000..3142955
--- /dev/null
+++ b/scripts/shade2.sh
@@ -0,0 +1,14 @@
1#!/bin/bash -e
2
3export T=$(basename $0 .sh)
4source $(dirname $0)/env
5export PS1='$ '
6if [ -n "$DB" ] ; then
7 DB="$(eval echo $DB)"
8fi
9
10if [ -z "$SCREENS" ] ; then
11 SCREENS="-fake-xinerama-screen 1024x768+0+0"
12fi
13
14$DB enlightenment -i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it $SCREENS
diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index 2228236..37a83db 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -501,6 +501,7 @@ tests_start()
501 RUN_TEST(session_recovery_placement); 501 RUN_TEST(session_recovery_placement);
502 RUN_TEST(settings); 502 RUN_TEST(settings);
503 RUN_TEST(shade); 503 RUN_TEST(shade);
504 RUN_TEST(shade2);
504 RUN_TEST(shelf_autohide); 505 RUN_TEST(shelf_autohide);
505 RUN_TEST(shot_key); 506 RUN_TEST(shot_key);
506 RUN_TEST(shot_mouse); 507 RUN_TEST(shot_mouse);
diff --git a/src/e_mod_main.h b/src/e_mod_main.h
index 728e5eb..2c4f6da 100644
--- a/src/e_mod_main.h
+++ b/src/e_mod_main.h
@@ -69,6 +69,7 @@ TEST_FN(session_recovery_maximize);
69TEST_FN(session_recovery_placement); 69TEST_FN(session_recovery_placement);
70TEST_FN(settings); 70TEST_FN(settings);
71TEST_FN(shade); 71TEST_FN(shade);
72TEST_FN(shade2);
72TEST_FN(shelf_autohide); 73TEST_FN(shelf_autohide);
73TEST_FN(shot_key); 74TEST_FN(shot_key);
74TEST_FN(shot_mouse); 75TEST_FN(shot_mouse);
diff --git a/src/shade2.c b/src/shade2.c
new file mode 100644
index 0000000..12c81d3
--- /dev/null
+++ b/src/shade2.c
@@ -0,0 +1,58 @@
1#include "e_mod_main.h"
2
3static double border_shade_speed;
4static int height;
5static Eina_Bool shaded;
6
7static void
8shade()
9{
10 if (!shaded) FAIL();
11 quit();
12}
13
14static void
15unshade()
16{
17 E_Client *ec = e_client_focused_get();
18 if (!shaded) FAIL();
19 shaded = 0;
20 mouse_wheel(ec->x + (ec->w / 2), ec->y + 10, 1, 0);
21}
22
23static void
24shade_done()
25{
26 shaded = 1;
27}
28
29static void
30unshading()
31{
32 timed_shot_next((height / border_shade_speed) + 0.05, shade);
33}
34
35static void
36shading()
37{
38 timed_shot_next((height / border_shade_speed) + 0.05, unshade);
39}
40
41static void
42launched()
43{
44 E_Client *ec = e_client_focused_get();
45 height = ec->client.h;
46 evas_object_smart_callback_add(ec->frame, "shading", shading, NULL);
47 evas_object_smart_callback_add(ec->frame, "unshading", unshading, NULL);
48 evas_object_smart_callback_add(ec->frame, "shade_done", shade_done, NULL);
49 mouse_wheel(ec->x + (ec->w / 2), ec->y + 10, 0, 0);
50}
51
52TEST_FN(shade2)
53{
54 quit_intercept(launched);
55 TEST(settings)();
56 border_shade_speed = e_config->border_shade_speed;
57 fprintf(stderr, "border_shade_speed = %g\n", border_shade_speed);
58}