raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=f35241a1540b30c0a592f967f3db6cfd1ceca1c4

commit f35241a1540b30c0a592f967f3db6cfd1ceca1c4
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Jul 20 23:38:02 2014 +0900

    rage - add (un)/fullscreen button/status gadget and close in fs mode
---
 TODO                                      |   2 +-
 data/themes/default.edc                   | 195 ++++++++++++++++++++++++++++++
 data/themes/images/Makefile.am            |   9 +-
 data/themes/images/icon_close.png         | Bin 0 -> 3939 bytes
 data/themes/images/icon_close2.png        | Bin 0 -> 4066 bytes
 data/themes/images/icon_fullscreen.png    | Bin 0 -> 3880 bytes
 data/themes/images/icon_fullscreen2.png   | Bin 0 -> 4093 bytes
 data/themes/images/icon_unfullscreen.png  | Bin 0 -> 4541 bytes
 data/themes/images/icon_unfullscreen2.png | Bin 0 -> 4611 bytes
 src/bin/controls.c                        |  26 ++++
 src/bin/key.c                             |   2 +-
 11 files changed, 231 insertions(+), 3 deletions(-)

diff --git a/TODO b/TODO
index a46f3c1..96f18a8 100644
--- a/TODO
+++ b/TODO
@@ -15,4 +15,4 @@
 * hide mouse on timeout in fullscreen move
 * fullscreen mode should request suspend of screensaver (needs elm work)
 * detect letterboxing and auto-crop
-* add fullscreen/unfullscreen controls
+
diff --git a/data/themes/default.edc b/data/themes/default.edc
index 50f602c..f3ea3e6 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -28,6 +28,9 @@ collections {
       images.image: "icon_arrow_right.png" COMP;
 
       images.image: "icon_spanner.png" COMP;
+      images.image: "icon_fullscreen.png" COMP;
+      images.image: "icon_unfullscreen.png" COMP;
+      images.image: "icon_close.png" COMP;
       
       images.image: "horizontal_separated_bar_small_glow.png" COMP;
       images.image: "vgrad_shadow_bi.png" COMP;
@@ -43,6 +46,9 @@ collections {
       images.image: "icon_pause2.png" COMP;
       images.image: "icon_volume2.png" COMP;
       images.image: "icon_spanner2.png" COMP;
+      images.image: "icon_fullscreen2.png" COMP;
+      images.image: "icon_unfullscreen2.png" COMP;
+      images.image: "icon_close2.png" COMP;
       
       images.image: "tv-bg.png" COMP;
       images.image: "tv-over.png" COMP;
@@ -698,6 +704,43 @@ collections {
             scale: 1;
             description { state: "default" 0.0;
                fixed: 1 1;
+               rel1.relative: 0.0 0.0;
+               rel1.offset: -6 0;
+               rel1.to: "rage.win.fullscreen";
+               rel2.relative: 0.0 1.0;
+               rel2.offset: -6 -1;
+               rel2.to: "rage.win.fullscreen";
+               min: 20 20;
+               align: 1.0 0.0;
+            }
+         }
+         part { name: "rage.win.fullscreen"; type: SWALLOW;
+            scale: 1;
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.relative: 0.0 0.0;
+               rel1.offset: -6 0;
+               rel1.to: "rage.win.close";
+               rel2.relative: 0.0 1.0;
+               rel2.offset: -6 -1;
+               rel2.to: "rage.win.close";
+               min: 20 20;
+               align: 1.0 0.0;
+            }
+         }
+         part { name: "rage.win.close"; type: SWALLOW;
+            scale: 1;
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.relative: 1.0 0.0;
+               rel1.offset: 0 5;
+               rel2.relative: 1.0 0.0;
+               rel2.offset: 0 5;
+               min: 20 20;
+               align: 0.0 0.0;
+            }
+            description { state: "fullscreen" 0.0;
+               fixed: 1 1;
                rel1.relative: 1.0 0.0;
                rel1.offset: -6 5;
                rel2.relative: 1.0 0.0;
@@ -771,6 +814,144 @@ collections {
             target: "vol";
          }
          
+         part { name: "close";
+            scale: 1;
+            clip_to: "posclip";
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.to: "rage.win.close";
+               rel2.to: "rage.win.close";
+               image.normal: "icon_close.png";
+               min: 20 20; max: 20 20;
+            }
+            description { state: "active" 0.0;
+               inherit: "default" 0.0;
+               image.normal: "icon_close2.png";
+            }
+         }
+         part { name: "closeev"; type: RECT;
+            description { state: "default" 0.0;
+               rel1.to: "rage.win.close";
+               rel2.to: "rage.win.close";
+               color: 0 0 0 0;
+            }
+         }
+         program {
+            signal: "mouse,down,1"; source: "closeev";
+            action: STATE_SET "active" 0.0;
+            target: "close";
+         }
+         program {
+            signal: "mouse,up,1"; source: "closeev";
+            action: STATE_SET "default" 0.0;
+            target: "close";
+         }
+         
+         part { name: "fullscreenclip"; type: RECT;
+            clip_to: "posclip";
+            description { state: "default" 0.0;
+               rel1.to: "fullscreen";
+               rel2.to: "fullscreen";
+               visible: 1;
+            }
+            description { state: "fullscreen" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part { name: "unfullscreenclip"; type: RECT;
+            clip_to: "posclip";
+            description { state: "default" 0.0;
+               rel1.to: "unfullscreen";
+               rel2.to: "unfullscreen";
+               visible: 0;
+            }
+            description { state: "fullscreen" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+         program {
+            signal: "state,win,fullscreen"; source: "rage";
+            action: STATE_SET "fullscreen" 0.0;
+            target: "fullscreenclip";
+            target: "unfullscreenclip";
+            target: "rage.win.close";
+         }
+         program {
+            signal: "state,win,normal"; source: "rage";
+            action: STATE_SET "default" 0.0;
+            target: "fullscreenclip";
+            target: "unfullscreenclip";
+            target: "rage.win.close";
+         }
+         part { name: "fullscreen";
+            scale: 1;
+            clip_to: "fullscreenclip";
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.to: "rage.win.fullscreen";
+               rel2.to: "rage.win.fullscreen";
+               image.normal: "icon_fullscreen.png";
+               min: 20 20; max: 20 20;
+            }
+            description { state: "active" 0.0;
+               inherit: "default" 0.0;
+               image.normal: "icon_fullscreen2.png";
+            }
+         }
+         part { name: "fullscreenev"; type: RECT;
+            clip_to: "fullscreenclip";
+            description { state: "default" 0.0;
+               rel1.to: "rage.win.fullscreen";
+               rel2.to: "rage.win.fullscreen";
+               color: 0 0 0 0;
+            }
+         }
+         program {
+            signal: "mouse,down,1"; source: "fullscreenev";
+            action: STATE_SET "active" 0.0;
+            target: "fullscreen";
+         }
+         program {
+            signal: "mouse,up,1"; source: "fullscreenev";
+            action: STATE_SET "default" 0.0;
+            target: "fullscreen";
+         }
+         part { name: "unfullscreen";
+            scale: 1;
+            clip_to: "unfullscreenclip";
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.to: "rage.win.fullscreen";
+               rel2.to: "rage.win.fullscreen";
+               image.normal: "icon_unfullscreen.png";
+               min: 20 20; max: 20 20;
+            }
+            description { state: "active" 0.0;
+               inherit: "default" 0.0;
+               image.normal: "icon_unfullscreen2.png";
+            }
+         }
+         part { name: "unfullscreenev"; type: RECT;
+            clip_to: "unfullscreenclip";
+            description { state: "default" 0.0;
+               rel1.to: "rage.win.fullscreen";
+               rel2.to: "rage.win.fullscreen";
+               color: 0 0 0 0;
+            }
+         }
+         program {
+            signal: "mouse,down,1"; source: "unfullscreenev";
+            action: STATE_SET "active" 0.0;
+            target: "unfullscreen";
+         }
+         program {
+            signal: "mouse,up,1"; source: "unfullscreenev";
+            action: STATE_SET "default" 0.0;
+            target: "unfullscreen";
+         }
+         
          part { name: "opt";
             scale: 1;
             clip_to: "posclip";
@@ -975,6 +1156,20 @@ collections {
          }
          
          program {
+            signal: "mouse,clicked,1"; source: "fullscreenev";
+            action: SIGNAL_EMIT "win,fullscreen" "rage";
+         }
+         program {
+            signal: "mouse,clicked,1"; source: "unfullscreenev";
+            action: SIGNAL_EMIT "win,unfullscreen" "rage";
+         }
+         
+         program {
+            signal: "mouse,clicked,1"; source: "closeev";
+            action: SIGNAL_EMIT "win,close" "rage";
+         }
+         
+         program {
             signal: "mouse,clicked,1"; source: "pos_prevev";
             action: SIGNAL_EMIT "pos,action,prev" "rage";
          }
diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am
index 7700642..2d10d85 100644
--- a/data/themes/images/Makefile.am
+++ b/data/themes/images/Makefile.am
@@ -39,5 +39,12 @@ r-0.png \
 r-1.png \
 r-2.png \
 r-3.png \
-r-4.png
+r-4.png \
+icon_close.png \
+icon_close2.png \
+icon_fullscreen.png \
+icon_fullscreen2.png \
+icon_unfullscreen.png \
+icon_unfullscreen2.png
+
 
diff --git a/data/themes/images/icon_close.png 
b/data/themes/images/icon_close.png
new file mode 100644
index 0000000..717e15e
Binary files /dev/null and b/data/themes/images/icon_close.png differ
diff --git a/data/themes/images/icon_close2.png 
b/data/themes/images/icon_close2.png
new file mode 100644
index 0000000..1c2603f
Binary files /dev/null and b/data/themes/images/icon_close2.png differ
diff --git a/data/themes/images/icon_fullscreen.png 
b/data/themes/images/icon_fullscreen.png
new file mode 100644
index 0000000..cbdf390
Binary files /dev/null and b/data/themes/images/icon_fullscreen.png differ
diff --git a/data/themes/images/icon_fullscreen2.png 
b/data/themes/images/icon_fullscreen2.png
new file mode 100644
index 0000000..574ede1
Binary files /dev/null and b/data/themes/images/icon_fullscreen2.png differ
diff --git a/data/themes/images/icon_unfullscreen.png 
b/data/themes/images/icon_unfullscreen.png
new file mode 100644
index 0000000..03ea780
Binary files /dev/null and b/data/themes/images/icon_unfullscreen.png differ
diff --git a/data/themes/images/icon_unfullscreen2.png 
b/data/themes/images/icon_unfullscreen2.png
new file mode 100644
index 0000000..c3009e4
Binary files /dev/null and b/data/themes/images/icon_unfullscreen2.png differ
diff --git a/src/bin/controls.c b/src/bin/controls.c
index dc433bd..666ff5d 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -63,6 +63,24 @@ _cb_list_hide(void *data, Evas_Object *obj EINA_UNUSED, 
const char *emission EIN
 }
 
 static void
+_cb_win_fullscreen(void *data EINA_UNUSED, Evas_Object *obj, const char 
*emission EINA_UNUSED, const char *source EINA_UNUSED)
+{
+   elm_win_fullscreen_set(elm_object_top_widget_get(obj), EINA_TRUE);
+}
+
+static void
+_cb_win_unfullscreen(void *data EINA_UNUSED, Evas_Object *obj, const char 
*emission EINA_UNUSED, const char *source EINA_UNUSED)
+{
+   elm_win_fullscreen_set(elm_object_top_widget_get(obj), EINA_FALSE);
+}
+
+static void
+_cb_win_close(void *data EINA_UNUSED, Evas_Object *obj, const char *emission 
EINA_UNUSED, const char *source EINA_UNUSED)
+{
+   evas_object_del(elm_object_top_widget_get(obj));
+}
+
+static void
 _time_print(double t, double max, int size, char *buf, Eina_Bool subsec)
 {
    double tsf;
@@ -128,6 +146,12 @@ controls_init(Evas_Object *win, Evas_Object *lay)
                                   _cb_list_show, win);
    elm_layout_signal_callback_add(lay, "list,hide", "rage",
                                   _cb_list_hide, win);
+   elm_layout_signal_callback_add(lay, "win,fullscreen", "rage",
+                                  _cb_win_fullscreen, win);
+   elm_layout_signal_callback_add(lay, "win,unfullscreen", "rage",
+                                  _cb_win_unfullscreen, win);
+   elm_layout_signal_callback_add(lay, "win,close", "rage",
+                                  _cb_win_close, win);
    sz = 0;
    elm_coords_finger_size_adjust(1, &sz, 1, &sz);
 
@@ -141,6 +165,8 @@ controls_init(Evas_Object *win, Evas_Object *lay)
    FINGER_SIZE("rage.pos.swallow");
    FINGER_SIZE("rage.vol.swallow");
    FINGER_SIZE("rage.options.swallow");
+   FINGER_SIZE("rage.win.fullscreen");
+   FINGER_SIZE("rage.win.close");
    FINGER_SIZE("rage.pos.prev.swallow");
    FINGER_SIZE("rage.pos.play.swallow");
    FINGER_SIZE("rage.pos.next.swallow");
diff --git a/src/bin/key.c b/src/bin/key.c
index 6f38702..8d24ee3 100644
--- a/src/bin/key.c
+++ b/src/bin/key.c
@@ -151,7 +151,7 @@ key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
    else if ((!strcmp(ev->keyname, "q")) ||
             (!strcmp(ev->key, "Escape")))
      {
-        elm_exit();
+        evas_object_del(win);
      }
    else if ((!strcmp(ev->keyname, "f")) ||
             (!strcmp(ev->key, "F11")))

-- 


Reply via email to