taskbar++!
authorCarsten Haitzler <raster@rasterman.com>
Sun, 30 Oct 2011 07:36:54 +0000 (07:36 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Sun, 30 Oct 2011 07:36:54 +0000 (07:36 +0000)
one more todo item being knocked off. but there.
also no proper icon for it yet. mostly code from the old taskbar with
lots of little things fixed.

SVN revision: 64518

13 files changed:
AUTHORS
config/standard/e.src
configure.ac
data/themes/default.edc
src/bin/e_gadcon.c
src/bin/e_shelf.c
src/modules/Makefile.am
src/modules/tasks/Makefile.am [new file with mode: 0644]
src/modules/tasks/e-module-tasks.edj [new file with mode: 0644]
src/modules/tasks/e_mod_config.c [new file with mode: 0644]
src/modules/tasks/e_mod_main.c [new file with mode: 0644]
src/modules/tasks/e_mod_main.h [new file with mode: 0644]
src/modules/tasks/module.desktop.in [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
index aab879d..6b35c02 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -28,3 +28,4 @@ Leif Middelschulte <leif.middelschulte@gmail.com>
 yoz (Michael Bouchaud) <michael.bouchaud@gmail.com>
 billiob (Boris Faure) <billiob@gmail.com>
 Jihoon Kim <jihoon48.kim@samsung.com>
+Sthitha <iamsthitha@gmail>
index 88ac387..a3941ec 100644 (file)
@@ -250,7 +250,7 @@ group "E_Config" struct {
                     value "name" string: "pager";
                     value "id" string: "pager";
                     value "geom.pos" int: 32;
-                    value "geom.size" int: 120;
+                    value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
                     value "geom.pos_y" double: 0.0000000000000000000000000;
@@ -265,7 +265,7 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "ibox";
                     value "id" string: "ibox.1";
-                    value "geom.pos" int: 152;
+                    value "geom.pos" int: 64;
                     value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
@@ -281,8 +281,8 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "ibar";
                     value "id" string: "ibar.1";
-                    value "geom.pos" int: 350;
-                    value "geom.size" int: 200;
+                    value "geom.pos" int: 96;
+                    value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
                     value "geom.pos_y" double: 0.0000000000000000000000000;
@@ -297,7 +297,7 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "backlight";
                     value "id" string: "backlight";
-                    value "geom.pos" int: 559;
+                    value "geom.pos" int: 128;
                     value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
@@ -313,7 +313,7 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "temperature";
                     value "id" string: "temperature.1";
-                    value "geom.pos" int: 672;
+                    value "geom.pos" int: 160;
                     value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
@@ -329,7 +329,7 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "cpufreq";
                     value "id" string: "cpufreq";
-                    value "geom.pos" int: 704;
+                    value "geom.pos" int: 192;
                     value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
@@ -345,7 +345,7 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "battery";
                     value "id" string: "battery";
-                    value "geom.pos" int: 736;
+                    value "geom.pos" int: 224;
                     value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
@@ -361,7 +361,7 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "clock";
                     value "id" string: "clock";
-                    value "geom.pos" int: 768;
+                    value "geom.pos" int: 256;
                     value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
@@ -377,7 +377,7 @@ group "E_Config" struct {
                 group "E_Config_Gadcon_Client" struct {
                     value "name" string: "connman";
                     value "id" string: "connman";
-                    value "geom.pos" int: 768;
+                    value "geom.pos" int: 288;
                     value "geom.size" int: 32;
                     value "geom.res" int: 800;
                     value "geom.pos_x" double: 0.0000000000000000000000000;
@@ -390,6 +390,22 @@ group "E_Config" struct {
                     value "autoscroll" uchar: 0;
                     value "resizable" uchar: 0;
                 }
+                group "E_Config_Gadcon_Client" struct {
+                    value "name" string: "tasks";
+                    value "id" string: "tasks.0";
+                    value "geom.pos" int: 320;
+                    value "geom.size" int: 32;
+                    value "geom.res" int: 800;
+                    value "geom.pos_x" double: 0.0000000000000000000000000;
+                    value "geom.pos_y" double: 0.0000000000000000000000000;
+                    value "geom.size_w" double: 0.0000000000000000000000000;
+                    value "geom.size_h" double: 0.0000000000000000000000000;
+                    value "state_info.seq" int: 12;
+                    value "state_info.flags" int: 0;
+                    value "style" string: "inset";
+                    value "autoscroll" uchar: 1;
+                    value "resizable" uchar: 0;
+                }
             }
             value "name" string: "shelf";
             value "id" int: 1;
index 30d4eb9..db6a760 100644 (file)
@@ -739,6 +739,7 @@ AC_E_OPTIONAL_MODULE([systray], true)
 AC_E_OPTIONAL_MODULE([comp], true)
 AC_E_OPTIONAL_MODULE([shot], true)
 AC_E_OPTIONAL_MODULE([backlight], true)
+AC_E_OPTIONAL_MODULE([tasks], true)
 
 SUSPEND=""
 HIBERNATE=""
@@ -890,6 +891,8 @@ src/modules/shot/Makefile
 src/modules/shot/module.desktop
 src/modules/backlight/Makefile
 src/modules/backlight/module.desktop
+src/modules/tasks/Makefile
+src/modules/tasks/module.desktop
 src/preload/Makefile
 data/Makefile
 data/images/Makefile
index 77ae2cb..b6fdd0a 100644 (file)
@@ -261,6 +261,16 @@ color_classes {
       name: "comp_focus-out_color";
       color: 255 255 255 220;
    }
+   color_class {
+      name: "tasks_text";
+      color: 0 0 0 255;
+      color3: 0 0 0 0;
+   }
+   color_class {
+      name: "tasks_text_focused";
+      color: 224 224 224 255;
+      color3: 0 0 0 64;
+   }
 }
 
 /*
@@ -40637,4 +40647,670 @@ collections {
         }
       }
    }
+
+/////////////////////////////////////////////////////////////////////////////
+/*** MOD: TASKS ***/
+
+   group { name:"modules/tasks/item";
+      images {
+         image: "bt_base1.png" COMP;
+         image: "bt_base2.png" COMP;
+         image: "bt_hilight.png" COMP;
+         image: "bt_shine.png" COMP;
+         image: "bt_glow.png" COMP;
+         image: "bt_dis_base.png" COMP;
+         image: "bt_dis_hilight.png" COMP;
+         image: "exclam.png" COMP;
+      }
+      parts {
+         part { name: "button_image";
+            mouse_events: 1;
+            description { state: "default" 0.0;
+               image {
+                  normal: "bt_dis_base.png";
+                  border: 4 4 4 4;
+               }
+            }
+            description { state: "clicked" 0.0;
+               inherit: "default" 0.0;
+               image.normal: "bt_base1.png";
+            }
+            description { state: "focused" 0.0;
+               inherit: "default" 0.0;
+               image {
+                  normal: "bt_base2.png";
+                  border: 7 7 7 7;
+               }
+            }
+         }
+         part { name: "icon_area"; type: RECT;
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               aspect: 1.0 1.0;
+               aspect_preference: VERTICAL;
+               align: 0.0 0.5;
+               rel1 {
+                  relative: 0.0 0.0;
+                  offset: 3  3;
+                  to: "button_image";
+               }
+               rel2 {
+                  relative: 0.0 1.0;
+                  offset: 3   -4;
+                  to: "button_image";
+               }
+            }
+            description { state: "iconified" 0.0;
+               inherit: "default" 0.0;
+               rel1.relative: 0.0 0.25;
+               rel2.relative: 0.0 0.75;
+            }
+         }
+         part { name: "icon_area2"; type: RECT;
+            description { state: "default" 0.0;
+               visible: 0;
+               rel1.to: "icon_area";
+               rel2.to: "icon_area";
+            }
+            description { state: "uw0" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -3 -2;
+               rel2.offset: -4 -3;
+            }
+            description { state: "uw1" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: 5 -2;
+               rel2.offset: 4 -3;
+            }
+            description { state: "uw2" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -1 4;
+               rel2.offset: -2 3;
+            }
+            description { state: "uw3" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -2 -1;
+               rel2.offset: -3 -2;
+            }
+            description { state: "uw4" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -4 1;
+               rel2.offset: -5 0;
+            }
+         }
+         part { name: "e.swallow.icon";
+            type: SWALLOW;
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               aspect: 1.0 1.0;
+               rel1.to: "icon_area2";
+               rel2.to: "icon_area2";
+            }
+         }
+         part { name: "urgent";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               color: 255 255 255 0;
+               aspect: 1.0 1.0;
+               aspect_preference: BOTH;
+               rel1.to: "icon_area";
+               rel2.to: "icon_area";
+               image.normal: "exclam.png";
+            }
+            description { state: "visible" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "urgent2";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               color: 255 255 255 0;
+               aspect: 1.0 1.0;
+               aspect_preference: BOTH;
+               rel1.to: "icon_area";
+               rel2.to: "icon_area";
+               image.normal: "exclam.png";
+            }
+            description { state: "visible" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+               color: 255 255 255 255;
+            }
+            description { state: "faded" 0.0;
+               inherit: "default" 0.0;
+               rel1.relative: -1.0 -1.0;
+               rel2.relative: 2.0 2.0;
+               visible: 1;
+               color: 255 255 255 0;
+            }
+         }
+         part { name: "e.text.label"; type: TEXT;
+            effect: SOFT_SHADOW;
+            mouse_events: 0;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1 {
+                  relative: 1.0  0.0;
+                  offset: 2    3;
+                  to_x: "icon_area";
+                  to_y: "button_image";
+               }
+               rel2 {
+                  relative: 1.0  1.0;
+                  offset: -4   -4;
+                  to: "button_image";
+               }
+               color_class: "tasks_text";
+               text {
+                  font: "Sans";
+                  size: 10;
+                  min: 0 1;
+                  align: 0.0 0.5;
+                  text_class: "tasks_text";
+               }
+            }
+            description { state: "clicked" 0.0;
+               inherit: "default" 0.0;
+               color_class: "tasks_text_focused";
+               text.font: "Sans:style=Bold";
+               text.text_class: "tasks_text_focused";
+            }
+            description { state: "focused" 0.0;
+               inherit: "default" 0.0;
+               color_class: "tasks_text_focused";
+               text.font: "Sans:style=Bold";
+               text.text_class: "tasks_text_focused";
+            }
+         }
+         part { name: "over1";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               rel2.relative: 1.0 0.5;
+               image {
+                  normal: "bt_dis_hilight.png";
+                  border: 4 4 4 0;
+               }
+            }
+            description { state: "focused" 0.0;
+               inherit: "default" 0.0;
+               image {
+                  normal: "bt_hilight.png";
+                  border: 7 7 7 0;
+               }
+            }
+         }
+         part { name: "over2";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               rel1.to: "button_image";
+               rel2.to: "button_image";
+               image {
+                  normal: "bt_shine.png";
+                  border: 7 7 7 7;
+               }
+            }
+            description { state: "focused" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+         part { name: "over3";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               color: 255 255 255 0;
+               image {
+                  normal: "bt_glow.png";
+                  border: 7 7 9 9;
+               }
+               fill.smooth : 0;
+            }
+            description { state: "clicked" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+               color: 255 255 255 255;
+            }
+         }
+      }
+      programs {
+         program { name: "button_click";
+            signal: "mouse,down,1";
+            source: "button_image";
+            action: STATE_SET "clicked" 0.0;
+            target: "button_image";
+            target: "over3";
+            target: "e.text.label";
+         }
+         program { name: "button_unclick";
+            signal: "mouse,up,1";
+            source: "button_image";
+            action: STATE_SET "default" 0.0;
+            target: "button_image";
+            target: "over3";
+            target: "e.text.label";
+         }
+         program { name: "button_unclick2";
+            signal: "mouse,clicked,1";
+            source: "button_image";
+            action: SIGNAL_EMIT "e,action,click" "";
+         }
+         program { name: "focused";
+            signal: "e,state,focused";
+            source: "e";
+            action: STATE_SET "focused" 0.0;
+            target: "button_image";
+            target: "over1";
+            target: "e.text.label";
+         }
+         program { name: "unfocused";
+            signal: "e,state,unfocused";
+            source: "e";
+            action: STATE_SET "default" 0.0;
+            target: "button_image";
+            target: "over1";
+            target: "e.text.label";
+         }
+         program { name: "urgent";
+            signal: "e,state,urgent";
+            source: "e";
+            action: STATE_SET "visible" 0.0;
+            transition: DECELERATE 0.5;
+            target: "urgent";
+            target: "urgent2";
+            after: "urgent2";
+         }
+         program { name: "urgent2";
+            action: STATE_SET "faded" 0.0;
+            transition: LINEAR 0.5;
+            target: "urgent2";
+            after: "urgent3";
+         }
+         program { name: "urgent3";
+            action: STATE_SET "visible" 0.0;
+            target: "urgent2";
+            after: "urgent2";
+         }
+         program { name: "urgentw0";
+            signal: "e,state,urgent";
+            source: "e";
+            action: STATE_SET "default" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw1";
+         }
+         program { name: "urgentw1";
+            action: STATE_SET "uw1" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw2";
+         }
+         program { name: "urgentw2";
+            action: STATE_SET "uw2" 0.0;
+            target: "icon_area2";
+            transition: DECELERATE 0.1;
+            after: "urgentw3";
+         }
+         program { name: "urgentw3";
+            action: STATE_SET "uw3" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw4";
+         }
+         program { name: "urgentw4";
+            action: STATE_SET "uw4" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw0";
+         }
+         program { name: "not_urgent";
+            signal: "e,state,not_urgent";
+            source: "e";
+            action: ACTION_STOP;
+            target: "urgentw0";
+            target: "urgentw1";
+            target: "urgentw2";
+            target: "urgentw3";
+            target: "urgentw4";
+            target: "urgent";
+            target: "urgent2";
+            target: "urgent3";
+            after: "not_urgent2";
+         }
+         program { name: "not_urgent2";
+            action: STATE_SET "default" 0.0;
+            target: "urgent";
+            target: "urgent2";
+            target: "icon_area2";
+         }
+         program { name: "iconified";
+            signal: "e,state,iconified";
+            source: "e";
+            action: STATE_SET "iconified" 0.0;
+            transition: DECELERATE 1.0;
+            target: "icon_area";
+         }
+         program { name: "uniconified";
+            signal: "e,state,uniconified";
+            source: "e";
+            action: STATE_SET "default" 0.0;
+            transition: DECELERATE 1.0;
+            target: "icon_area";
+         }
+      }
+   }
+   group { name:"modules/tasks/item_vert";
+      images {
+         image: "bt_base1.png" COMP;
+         image: "bt_base2.png" COMP;
+         image: "bt_hilight.png" COMP;
+         image: "bt_shine.png" COMP;
+         image: "bt_glow.png" COMP;
+         image: "bt_dis_base.png" COMP;
+         image: "bt_dis_hilight.png" COMP;
+         image: "exclam.png" COMP;
+      }
+      parts {
+         part { name: "button_image";
+            mouse_events: 1;
+            description { state: "default" 0.0;
+               image {
+                  normal: "bt_dis_base.png";
+                  border: 4 4 4 4;
+               }
+            }
+            description { state: "clicked" 0.0;
+               inherit: "default" 0.0;
+               image.normal: "bt_base1.png";
+            }
+            description { state: "focused" 0.0;
+               inherit: "default" 0.0;
+               image {
+                  normal: "bt_base2.png";
+                  border: 7 7 7 7;
+               }
+            }
+         }
+         part { name: "icon_area"; type: RECT;
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               aspect: 1.0 1.0;
+               aspect_preference: BOTH;
+               align: 0.5 0.5;
+               rel1 {
+                  offset: 3  3;
+                  to: "button_image";
+               }
+               rel2 {
+                  offset: -4   -4;
+                  to: "button_image";
+               }
+            }
+            description { state: "iconified" 0.0;
+               inherit: "default" 0.0;
+               rel1.relative: 0.25 0.25;
+               rel2.relative: 0.75 0.75;
+            }
+         }
+         part { name: "icon_area2"; type: RECT;
+            description { state: "default" 0.0;
+               visible: 0;
+               rel1.to: "icon_area";
+               rel2.to: "icon_area";
+            }
+            description { state: "uw0" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -3 -2;
+               rel2.offset: -4 -3;
+            }
+            description { state: "uw1" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: 5 -2;
+               rel2.offset: 4 -3;
+            }
+            description { state: "uw2" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -1 4;
+               rel2.offset: -2 3;
+            }
+            description { state: "uw3" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -2 -1;
+               rel2.offset: -3 -2;
+            }
+            description { state: "uw4" 0.0;
+               inherit: "default" 0.0;
+               rel1.offset: -4 1;
+               rel2.offset: -5 0;
+            }
+         }
+         part { name: "e.swallow.icon";
+            type: SWALLOW;
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               aspect: 1.0 1.0;
+               rel1.to: "icon_area2";
+               rel2.to: "icon_area2";
+            }
+         }
+         part { name: "urgent";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               color: 255 255 255 0;
+               aspect: 1.0 1.0;
+               aspect_preference: BOTH;
+               rel1.to: "icon_area";
+               rel2.to: "icon_area";
+               image.normal: "exclam.png";
+            }
+            description { state: "visible" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "urgent2";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               color: 255 255 255 0;
+               aspect: 1.0 1.0;
+               aspect_preference: BOTH;
+               rel1.to: "icon_area";
+               rel2.to: "icon_area";
+               image.normal: "exclam.png";
+            }
+            description { state: "visible" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+               color: 255 255 255 255;
+            }
+            description { state: "faded" 0.0;
+               inherit: "default" 0.0;
+               rel1.relative: -1.0 -1.0;
+               rel2.relative: 2.0 2.0;
+               visible: 1;
+               color: 255 255 255 0;
+            }
+         }
+         part { name: "over1";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               rel2.relative: 1.0 0.5;
+               image {
+                  normal: "bt_dis_hilight.png";
+                  border: 4 4 4 0;
+               }
+            }
+            description { state: "focused" 0.0;
+               inherit: "default" 0.0;
+               image {
+                  normal: "bt_hilight.png";
+                  border: 7 7 7 0;
+               }
+            }
+         }
+         part { name: "over2";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               rel1.to: "button_image";
+               rel2.to: "button_image";
+               image {
+                  normal: "bt_shine.png";
+                  border: 7 7 7 7;
+               }
+            }
+            description { state: "focused" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+         part { name: "over3";
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible: 0;
+               color: 255 255 255 0;
+               image {
+                  normal: "bt_glow.png";
+                  border: 7 7 9 9;
+               }
+               fill.smooth : 0;
+            }
+            description { state: "clicked" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+               color: 255 255 255 255;
+            }
+         }
+      }
+      programs {
+         program { name: "button_click";
+            signal: "mouse,down,1";
+            source: "button_image";
+            action: STATE_SET "clicked" 0.0;
+            target: "button_image";
+            target: "over3";
+         }
+         program { name: "button_unclick";
+            signal: "mouse,up,1";
+            source: "button_image";
+            action: STATE_SET "default" 0.0;
+            target: "button_image";
+            target: "over3";
+         }
+         program { name: "button_unclick2";
+            signal: "mouse,clicked,1";
+            source: "button_image";
+            action: SIGNAL_EMIT "e,action,click" "";
+         }
+         program { name: "focused";
+            signal: "e,state,focused";
+            source: "e";
+            action: STATE_SET "focused" 0.0;
+            target: "button_image";
+            target: "over1";
+         }
+         program { name: "unfocused";
+            signal: "e,state,unfocused";
+            source: "e";
+            action: STATE_SET "default" 0.0;
+            target: "button_image";
+            target: "over1";
+         }
+         program { name: "urgent";
+            signal: "e,state,urgent";
+            source: "e";
+            action: STATE_SET "visible" 0.0;
+            transition: DECELERATE 0.5;
+            target: "urgent";
+            target: "urgent2";
+            after: "urgent2";
+         }
+         program { name: "urgent2";
+            action: STATE_SET "faded" 0.0;
+            transition: LINEAR 0.5;
+            target: "urgent2";
+            after: "urgent3";
+         }
+         program { name: "urgent3";
+            action: STATE_SET "visible" 0.0;
+            target: "urgent2";
+            after: "urgent2";
+         }
+         program { name: "urgentw0";
+            signal: "e,state,urgent";
+            source: "e";
+            action: STATE_SET "default" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw1";
+         }
+         program { name: "urgentw1";
+            action: STATE_SET "uw1" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw2";
+         }
+         program { name: "urgentw2";
+            action: STATE_SET "uw2" 0.0;
+            target: "icon_area2";
+            transition: DECELERATE 0.1;
+            after: "urgentw3";
+         }
+         program { name: "urgentw3";
+            action: STATE_SET "uw3" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw4";
+         }
+         program { name: "urgentw4";
+            action: STATE_SET "uw4" 0.0;
+            transition: DECELERATE 0.1;
+            target: "icon_area2";
+            after: "urgentw0";
+         }
+         program { name: "not_urgent";
+            signal: "e,state,not_urgent";
+            source: "e";
+            action: ACTION_STOP;
+            target: "urgentw0";
+            target: "urgentw1";
+            target: "urgentw2";
+            target: "urgentw3";
+            target: "urgentw4";
+            target: "urgent";
+            target: "urgent2";
+            target: "urgent3";
+            after: "not_urgent2";
+         }
+         program { name: "not_urgent2";
+            action: STATE_SET "default" 0.0;
+            target: "urgent";
+            target: "urgent2";
+            target: "icon_area2";
+         }
+         program { name: "iconified";
+            signal: "e,state,iconified";
+            source: "e";
+            action: STATE_SET "iconified" 0.0;
+            transition: DECELERATE 1.0;
+            target: "icon_area";
+         }
+         program { name: "uniconified";
+            signal: "e,state,uniconified";
+            source: "e";
+            action: STATE_SET "default" 0.0;
+            transition: DECELERATE 1.0;
+            target: "icon_area";
+         }
+      }
+   }
 }
index 18debd0..6eb87e1 100644 (file)
@@ -1132,7 +1132,7 @@ e_gadcon_client_min_size_set(E_Gadcon_Client *gcc, Evas_Coord w, Evas_Coord h)
    E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
    gcc->min.w = w;
    gcc->min.h = h;
-   if ((!gcc->autoscroll) && (!gcc->resizable))
+   if (!gcc->resizable)
      {
        if (gcc->o_frame)
          e_gadcon_layout_pack_min_size_set(gcc->o_frame, w + gcc->pad.w, 
@@ -1679,7 +1679,7 @@ _e_gadcon_moveresize_handle(E_Gadcon_Client *gcc)
    Evas_Coord w, h;
 
    evas_object_geometry_get(gcc->o_box, NULL, NULL, &w, &h);
-   if ((gcc->autoscroll) || (gcc->resizable))
+   if (gcc->resizable)
      {
        if (e_box_orientation_get(gcc->o_box))
          {
@@ -1692,14 +1692,25 @@ _e_gadcon_moveresize_handle(E_Gadcon_Client *gcc)
               h = (w * gcc->aspect.h) / gcc->aspect.w;
          }
      }
+   if (gcc->autoscroll)
+     {
+       if (e_box_orientation_get(gcc->o_box))
+         {
+             w = gcc->min.w;
+         }
+       else
+         {
+             h = gcc->min.h;
+         }
+     }
    if (gcc->o_base)
      e_box_pack_options_set(gcc->o_base,
-                           1, 1, /* fill */
-                           1, 1, /* expand */
-                           0.5, 0.5, /* align */
-                           w, h, /* min */
-                           w, h /* max */
-                           );
+                            1, 1, /* fill */
+                            1, 1, /* expand */
+                            0.5, 0.5, /* align */
+                            w, h, /* min */
+                            w, h /* max */
+                           );
 }
 
 static Eina_Bool
@@ -3270,6 +3281,7 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
    E_Gadcon_Layout_Item *bi;
    E_Layout_Item_Container *lc;
    int i, set_prev_pos = 0;
+   static int recurse = 0;
 
    if (sd->frozen) return;
    if (sd->doing_config)
@@ -3278,6 +3290,7 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
        return;
      }
 
+   recurse++;
    min = mino = cur = 0;
 
    _e_gadcon_layout_smart_min_cur_size_calc(sd, &min, &mino, &cur); 
@@ -3301,7 +3314,7 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
             sd->req = sd->minw;     
          }
      }
-   _e_gadcon_layout_smart_gadcons_width_adjust(sd, min, cur);
+   if (recurse == 1) _e_gadcon_layout_smart_gadcons_width_adjust(sd, min, cur);
 
    if (sd->w <= sd->req)
      { 
@@ -3359,7 +3372,7 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
        bi->h = sd->h;
        xx = sd->x + bi->x;
        yy = sd->y; // + ((sd->h - bi->h) / 2);
-
+        
        if (sd->horizontal)
          {
             evas_object_move(obj, xx, yy);
@@ -3393,6 +3406,7 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
             evas_object_smart_callback_call(sd->obj, "size_request", NULL);
          }
      }
+   recurse--;
 }
 
 static void
@@ -3620,6 +3634,7 @@ _e_gadcon_layout_smart_min_cur_size_calc(E_Smart_Data *sd, int *min, int *mino,
          }
        else
          {
+             bi->ask.size2 = bi->ask.size = bi->min.w;
             *min += bi->min.w;
             if (bi->min.h > *mino) *mino = bi->min.h;
             if (bi->ask.size < bi->min.w)
@@ -3708,6 +3723,7 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
    else
      return;
 
+   
    sd->items = eina_list_sort(sd->items, eina_list_count(sd->items), 
                              _e_gadcon_layout_smart_width_smart_sort_reverse_cb);
 
@@ -3755,7 +3771,7 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
          { 
             int reduce_by, c2; 
 
-            while (need)
+            while (need > 0)
               { 
                  reduce_by = 1;
                  while (1) 
@@ -3768,11 +3784,14 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
                  c2 = c;
                  EINA_LIST_REVERSE_FOREACH(sd->items, l2, item)
                    { 
-                      if ((!c2) || (!need)) break;
+                      if ((c2 <= 0) || (need <= 0)) break;
                       bi2 = evas_object_data_get(item, "e_gadcon_layout_data");
-                      bi2->ask.size2 -= reduce_by; 
-                      need -= reduce_by; 
-                      c2--;
+                       if (bi2->gcc->autoscroll)
+                         {
+                            bi2->ask.size2 -= reduce_by;
+                            need -= reduce_by; 
+                            c2--;
+                         }
                    } 
               }
          } 
index 2f2c826..2e77db9 100644 (file)
@@ -882,7 +882,7 @@ static void
 _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h)
 {
    E_Shelf *es;
-   Evas_Coord nx, ny, nw, nh, ww, hh;
+   Evas_Coord nx, ny, nw, nh, ww, hh, wantw, wanth;
 
    es = data;
    nx = es->x;
@@ -919,6 +919,8 @@ _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord
      }
    e_gadcon_swallowed_min_size_set(gc, w, h);
    edje_object_size_min_calc(es->o_base, &nw, &nh);
+   wantw = nw;
+   wanth = nh;
    switch (gc->orient)
      {
       case E_GADCON_ORIENT_FLOAT:
@@ -1041,6 +1043,9 @@ _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord
       default:
        break;
      }
+   w -= (wantw - nw);
+   h -= (wanth - nh);
+   e_gadcon_swallowed_min_size_set(gc, w, h);
    e_shelf_move_resize(es, nx, ny, nw, nh);
    e_zone_useful_geometry_dirty(es->zone);
 }
index bc8df5f..7eadd76 100644 (file)
@@ -182,3 +182,7 @@ endif
 if USE_MODULE_BACKLIGHT
 SUBDIRS += backlight
 endif
+
+if USE_MODULE_TASKS
+SUBDIRS += tasks
+endif
diff --git a/src/modules/tasks/Makefile.am b/src/modules/tasks/Makefile.am
new file mode 100644 (file)
index 0000000..ac61e16
--- /dev/null
@@ -0,0 +1,29 @@
+MAINTAINERCLEANFILES = Makefile.in
+MODULE = tasks
+
+# data files for the module
+filesdir = $(libdir)/enlightenment/modules/$(MODULE)
+files_DATA = \
+e-module-$(MODULE).edj module.desktop
+
+EXTRA_DIST = $(files_DATA)
+
+# the module .so file
+INCLUDES               = -I. \
+                         -I$(top_srcdir) \
+                         -I$(top_srcdir)/src/modules/$(MODULE) \
+                         -I$(top_srcdir)/src/bin \
+                         -I$(top_builddir)/src/bin \
+                         -I$(top_srcdir)/src/modules \
+                         @e_cflags@
+pkgdir                 = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
+pkg_LTLIBRARIES        = module.la
+module_la_SOURCES      = e_mod_main.c \
+                         e_mod_main.h \
+                         e_mod_config.c
+module_la_LIBADD       = @e_libs@ @dlopen_libs@
+module_la_LDFLAGS      = -module -avoid-version
+module_la_DEPENDENCIES = $(top_builddir)/config.h
+
+uninstall:
+       rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
diff --git a/src/modules/tasks/e-module-tasks.edj b/src/modules/tasks/e-module-tasks.edj
new file mode 100644 (file)
index 0000000..75aa3dc
Binary files /dev/null and b/src/modules/tasks/e-module-tasks.edj differ
diff --git a/src/modules/tasks/e_mod_config.c b/src/modules/tasks/e_mod_config.c
new file mode 100644 (file)
index 0000000..a183ea0
--- /dev/null
@@ -0,0 +1,104 @@
+#include <e.h>
+#include "e_mod_main.h"
+
+struct _E_Config_Dialog_Data
+{
+   int show_all;
+   int minw, minh;
+};
+
+/* Protos */
+static void *_create_data(E_Config_Dialog *cfd);
+static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
+static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+
+void
+_config_tasks_module(Config_Item *ci)
+{
+   E_Config_Dialog *cfd;
+   E_Config_Dialog_View *v;
+   E_Container *con;
+
+   v = E_NEW(E_Config_Dialog_View, 1);
+
+   v->create_cfdata = _create_data;
+   v->free_cfdata = _free_data;
+   v->basic.apply_cfdata = _basic_apply_data;
+   v->basic.create_widgets = _basic_create_widgets;
+
+   con = e_container_current_get(e_manager_current_get());
+   cfd = e_config_dialog_new(con, D_("Tasks Configuration"), "Tasks", 
+                             "_e_modules_tasks_config_dialog", NULL, 0, v, ci);
+   if (tasks_config->config_dialog)
+     e_object_del(E_OBJECT(tasks_config->config_dialog));
+   tasks_config->config_dialog = cfd;
+}
+
+static void
+_fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
+{
+   cfdata->show_all = ci->show_all;
+   cfdata->minw = ci->minw;
+   cfdata->minh = ci->minh;
+}
+
+static void *
+_create_data(E_Config_Dialog *cfd)
+{
+   E_Config_Dialog_Data *cfdata;
+   Config_Item *ci;
+
+   ci = cfd->data;
+   cfdata = E_NEW(E_Config_Dialog_Data, 1);
+   _fill_data(ci, cfdata);
+   return cfdata;
+}
+
+static void
+_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
+{
+   if (!tasks_config) return;
+   tasks_config->config_dialog = NULL;
+   free(cfdata);
+}
+
+static Evas_Object *
+_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
+{
+   Evas_Object *o, *of, *ob, *ow;
+
+   o = e_widget_list_add(evas, 0, 0);
+
+   of = e_widget_framelist_add(evas, D_("Display"), 0);
+   ob = e_widget_check_add(evas, D_("Show windows from all desktops"),
+                           &(cfdata->show_all));
+   e_widget_framelist_object_append(of, ob);
+   ow = e_widget_label_add(evas, _("Minimum Width"));
+   e_widget_framelist_object_append(of, ow);
+   ow = e_widget_slider_add(evas, 1, 0, _("%1.0f px"), 20, 420, 1, 0,
+                            NULL, &(cfdata->minw), 100);
+   e_widget_framelist_object_append(of, ow);
+   ow = e_widget_label_add(evas, _("Minimum Height"));
+   e_widget_framelist_object_append(of, ow);
+   ow = e_widget_slider_add(evas, 1, 0, _("%1.0f px"), 20, 420, 1, 0,
+                            NULL, &(cfdata->minh), 100);
+   e_widget_framelist_object_append(of, ow);
+   
+   e_widget_list_object_append(o, of, 1, 1, 0.5);
+   return o;
+}
+
+static int
+_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+   Config_Item *ci;
+
+   ci = cfd->data;
+   ci->show_all = cfdata->show_all;
+   ci->minw = cfdata->minw;
+   ci->minh = cfdata->minh;
+   e_config_save_queue();
+   _tasks_config_updated(ci);
+   return 1;
+}
diff --git a/src/modules/tasks/e_mod_main.c b/src/modules/tasks/e_mod_main.c
new file mode 100644 (file)
index 0000000..2739977
--- /dev/null
@@ -0,0 +1,899 @@
+#include "e.h"
+#include "e_mod_main.h"
+
+/***************************************************************************/
+ /**/
+/* gadcon requirements */
+static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
+static void _gc_shutdown(E_Gadcon_Client *gcc);
+static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
+static char *_gc_label(E_Gadcon_Client_Class *client_class);
+static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas);
+static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
+
+/* and actually define the gadcon class that this module provides (just 1) */
+static E_Gadcon_Client_Class _gadcon_class = {
+   GADCON_CLIENT_CLASS_VERSION,
+   "tasks",
+   {
+      _gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL, NULL
+   },
+   E_GADCON_CLIENT_STYLE_PLAIN
+};
+/**/
+/***************************************************************************/
+/***************************************************************************/
+/**/
+/* actual module specifics */
+
+typedef struct _Tasks Tasks;
+typedef struct _Tasks_Item Tasks_Item;
+
+struct _Tasks
+{
+   E_Gadcon_Client *gcc;        // The gadcon client
+   Evas_Object *o_items;        // Table of items
+   Eina_List *items;            // List of items
+   E_Zone *zone;                // Current Zone
+   Config_Item *config;         // Configuration
+   int horizontal;
+};
+
+struct _Tasks_Item
+{
+   Tasks *tasks;            // Parent tasks
+   E_Border *border;            // The border this item points to
+   Evas_Object *o_item;         // The edje theme object
+   Evas_Object *o_icon;         // The icon
+};
+
+static Tasks *_tasks_new(Evas *evas, E_Zone *zone, const char *id);
+static void _tasks_free(Tasks *tasks);
+static void _tasks_refill(Tasks *tasks);
+static void _tasks_refill_all();
+static void _tasks_refill_border(E_Border *border);
+static void _tasks_signal_emit(E_Border *border, char *sig, char *src);
+
+static Tasks_Item *_tasks_item_find(Tasks *tasks, E_Border *border);
+static Tasks_Item *_tasks_item_new(Tasks *tasks, E_Border *border);
+
+static int _tasks_item_check_add(Tasks *tasks, E_Border *border);
+static void _tasks_item_add(Tasks *tasks, E_Border *border);
+static void _tasks_item_remove(Tasks_Item *item);
+static void _tasks_item_refill(Tasks_Item *item);
+static void _tasks_item_fill(Tasks_Item *item);
+static void _tasks_item_free(Tasks_Item *item);
+static void _tasks_item_signal_emit(Tasks_Item *item, char *sig, char *src);
+
+static Config_Item *_tasks_config_item_get(const char *id);
+
+static void _tasks_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _tasks_cb_item_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _tasks_cb_item_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
+
+static Eina_Bool _tasks_cb_event_border_add(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_remove(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_iconify(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_uniconify(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_icon_change(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_zone_set(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_desk_set(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_window_focus_in(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_window_focus_out(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_property(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_desk_show(void *data, int type, void *event);
+static Eina_Bool _tasks_cb_event_border_urgent_change(void *data, int type, void *event);
+
+static E_Config_DD *conf_edd = NULL;
+static E_Config_DD *conf_item_edd = NULL;
+
+Config *tasks_config = NULL;
+
+/* module setup */
+EAPI E_Module_Api e_modapi =
+{
+   E_MODULE_API_VERSION,
+   "Tasks"
+};
+
+EAPI void *
+e_modapi_init(E_Module *m)
+{
+   char buf[4096];
+
+   snprintf(buf, sizeof(buf), "%s/locale", e_module_dir_get(m));
+   bindtextdomain(PACKAGE, buf);
+   bind_textdomain_codeset(PACKAGE, "UTF-8");
+
+   conf_item_edd = E_CONFIG_DD_NEW("Tasks_Config_Item", Config_Item);
+
+#undef T
+#undef D
+#define T Config_Item
+#define D conf_item_edd
+   E_CONFIG_VAL(D, T, id, STR);
+   E_CONFIG_VAL(D, T, show_all, INT);
+   E_CONFIG_VAL(D, T, minw, INT);
+   E_CONFIG_VAL(D, T, minh, INT);
+
+   conf_edd = E_CONFIG_DD_NEW("Tasks_Config", Config);
+
+#undef T
+#undef D
+#define T Config
+#define D conf_edd
+   E_CONFIG_LIST(D, T, items, conf_item_edd);
+
+   tasks_config = e_config_domain_load("module.tasks", conf_edd);
+   if (!tasks_config)
+     {
+        Config_Item *config;
+        
+        tasks_config = E_NEW(Config, 1);
+        config = E_NEW(Config_Item, 1);
+        config->id = eina_stringshare_add("0");
+        config->show_all = 0;
+        config->minw = 80;
+        config->minh = 32;
+        tasks_config->items = eina_list_append(tasks_config->items, config);
+     }
+
+   tasks_config->module = m;
+
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_ADD, _tasks_cb_event_border_add, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_REMOVE, _tasks_cb_event_border_remove, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_ICONIFY, _tasks_cb_event_border_iconify, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_UNICONIFY, _tasks_cb_event_border_uniconify, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_ICON_CHANGE, _tasks_cb_event_border_icon_change, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_DESK_SET, _tasks_cb_event_border_desk_set, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_ZONE_SET, _tasks_cb_event_border_zone_set, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_FOCUS_IN, _tasks_cb_window_focus_in, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_FOCUS_OUT, _tasks_cb_window_focus_out, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_PROPERTY, _tasks_cb_event_border_property, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_DESK_SHOW, _tasks_cb_event_desk_show, NULL));
+   tasks_config->handlers = eina_list_append
+     (tasks_config->handlers, ecore_event_handler_add
+         (E_EVENT_BORDER_URGENT_CHANGE, _tasks_cb_event_border_urgent_change, NULL));
+   
+   tasks_config->borders = eina_list_clone(e_border_client_list());
+   
+   e_gadcon_provider_register(&_gadcon_class);
+   return m;
+}
+
+EAPI int
+e_modapi_shutdown(E_Module *m)
+{
+   Ecore_Event_Handler *eh;
+   Tasks *tasks;
+
+   e_gadcon_provider_unregister(&_gadcon_class);
+
+   EINA_LIST_FREE(tasks_config->tasks, tasks)
+     {
+        _tasks_free(tasks);
+     }
+
+   if (tasks_config->config_dialog)
+     e_object_del(E_OBJECT(tasks_config->config_dialog));
+
+   EINA_LIST_FREE(tasks_config->handlers, eh)
+     {
+        ecore_event_handler_del(eh);
+     }
+
+   eina_list_free(tasks_config->borders);
+
+   free(tasks_config);
+   tasks_config = NULL;
+   E_CONFIG_DD_FREE(conf_item_edd);
+   E_CONFIG_DD_FREE(conf_edd);
+   return 1;
+}
+
+EAPI int
+e_modapi_save(E_Module *m)
+{
+   e_config_domain_save("module.tasks", conf_edd, tasks_config);
+   return 1;
+}
+
+/**************************************************************/
+
+static E_Gadcon_Client *
+_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
+{
+   Tasks *tasks;
+   Evas_Object *o;
+   E_Gadcon_Client *gcc;
+   Evas_Coord x, y, w, h;
+   int cx, cy, cw, ch;
+
+   tasks = _tasks_new(gc->evas, gc->zone, id);
+   
+   o = tasks->o_items;
+   gcc = e_gadcon_client_new(gc, name, id, style, o);
+   gcc->data = tasks;
+   tasks->gcc = gcc;
+   
+   e_gadcon_canvas_zone_geometry_get(gcc->gadcon, &cx, &cy, &cw, &ch);
+   evas_object_geometry_get(o, &x, &y, &w, &h);
+   
+   tasks_config->tasks = eina_list_append(tasks_config->tasks, tasks);
+
+   // Fill on initial config
+   _tasks_config_updated(tasks->config);
+
+   return gcc;
+}
+
+static void
+_gc_shutdown(E_Gadcon_Client *gcc)
+{
+   Tasks *tasks;
+   
+   tasks = (Tasks *)gcc->data;
+   tasks_config->tasks = eina_list_remove(tasks_config->tasks, tasks);
+   _tasks_free(tasks);
+}
+
+/* TODO */
+static void
+_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
+{
+   Tasks *tasks;
+
+   tasks = (Tasks *)gcc->data;
+
+   switch (orient)
+     {
+      case E_GADCON_ORIENT_FLOAT:
+      case E_GADCON_ORIENT_HORIZ:
+      case E_GADCON_ORIENT_TOP:
+      case E_GADCON_ORIENT_BOTTOM:
+      case E_GADCON_ORIENT_CORNER_TL:
+      case E_GADCON_ORIENT_CORNER_TR:
+      case E_GADCON_ORIENT_CORNER_BL:
+      case E_GADCON_ORIENT_CORNER_BR:
+       if (!tasks->horizontal)
+         {
+             tasks->horizontal = 1;
+             e_box_orientation_set(tasks->o_items, tasks->horizontal);
+             _tasks_refill(tasks);
+         }
+       break;
+      case E_GADCON_ORIENT_VERT:
+      case E_GADCON_ORIENT_LEFT:
+      case E_GADCON_ORIENT_RIGHT:
+      case E_GADCON_ORIENT_CORNER_LT:
+      case E_GADCON_ORIENT_CORNER_RT:
+      case E_GADCON_ORIENT_CORNER_LB:
+      case E_GADCON_ORIENT_CORNER_RB:
+       if (tasks->horizontal)
+         {
+             tasks->horizontal = 0;
+             e_box_orientation_set(tasks->o_items, tasks->horizontal);
+             _tasks_refill(tasks);
+         }
+       break;
+      default:
+       break;
+     }
+   e_box_align_set(tasks->o_items, 0.5, 0.5);
+}
+
+static char *
+_gc_label(E_Gadcon_Client_Class *client_class)
+{
+   return D_("Tasks");
+}
+
+static Evas_Object *
+_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
+{
+   Evas_Object *o;
+   char buf[4096];
+
+   o = edje_object_add(evas);
+   snprintf(buf, sizeof(buf), "%s/e-module-tasks.edj",
+            e_module_dir_get(tasks_config->module));
+   edje_object_file_set(o, buf, "icon");
+   return o;
+}
+
+static const char *
+_gc_id_new(E_Gadcon_Client_Class *client_class)
+{
+   Config_Item *config;
+
+   config = _tasks_config_item_get(NULL);
+   return config->id;
+}
+
+/***************************************************************************/
+
+static Tasks *
+_tasks_new(Evas *evas, E_Zone *zone, const char *id)
+{
+   Tasks *tasks;
+
+   tasks = E_NEW(Tasks, 1);
+   tasks->config = _tasks_config_item_get(id);
+   tasks->o_items = e_box_add(evas);
+   tasks->horizontal = 1;
+
+   e_box_homogenous_set(tasks->o_items, 1);
+   e_box_orientation_set(tasks->o_items, tasks->horizontal);
+   e_box_align_set(tasks->o_items, 0.5, 0.5);
+   tasks->zone = zone;
+   return tasks;
+}
+
+static void
+_tasks_free(Tasks *tasks)
+{
+   Tasks_Item *item;
+   EINA_LIST_FREE(tasks->items, item) _tasks_item_free(item);
+   evas_object_del(tasks->o_items);
+   free(tasks);
+}
+
+static void 
+_tasks_refill(Tasks *tasks)
+{
+   Eina_List *l;
+   E_Border *border;
+   Tasks_Item *item;
+   Evas_Coord w, h;
+
+   while (tasks->items)
+     {
+        item = tasks->items->data;
+        _tasks_item_remove(item);
+     }
+   EINA_LIST_FOREACH(tasks_config->borders, l, border)
+     {
+        _tasks_item_check_add(tasks, border);
+     }
+   if (tasks->items)
+     {
+        item = tasks->items->data;
+       edje_object_size_min_calc(item->o_item, &w, &h);
+        if (tasks->horizontal)
+          {
+             if (w < tasks->config->minw) w = tasks->config->minw;
+          }
+        else
+          {
+             if (h < tasks->config->minh) h = tasks->config->minh;
+          }
+       if (!tasks->gcc->resizable)
+         {
+            if (tasks->horizontal)
+               e_gadcon_client_min_size_set(tasks->gcc, 
+                                            w * eina_list_count(tasks->items),
+                                            h);
+            else
+               e_gadcon_client_min_size_set(tasks->gcc, 
+                                            w,
+                                            h * eina_list_count(tasks->items));
+          }
+     }
+}
+
+static void
+_tasks_refill_all(void)
+{
+   const Eina_List *l;
+   Tasks *tasks;
+
+   EINA_LIST_FOREACH(tasks_config->tasks, l, tasks)
+     {
+        _tasks_refill(tasks);
+     }
+}
+
+
+static void
+_tasks_refill_border(E_Border *border)
+{
+   const Eina_List *l;
+   Tasks *tasks;
+   
+   EINA_LIST_FOREACH(tasks_config->tasks, l, tasks)
+     {
+       const Eina_List *m;
+       Tasks_Item *item;
+       EINA_LIST_FOREACH(tasks->items, m, item)
+          {
+             if (item->border == border) _tasks_item_refill(item);
+          }
+     }
+}
+
+static void 
+_tasks_signal_emit(E_Border *border, char *sig, char *src)
+{
+   const Eina_List *l;
+   Tasks *tasks;
+   
+   EINA_LIST_FOREACH(tasks_config->tasks, l, tasks)
+     {
+       const Eina_List *m;
+       Tasks_Item *item;
+        
+       EINA_LIST_FOREACH(tasks->items, m, item)
+          {
+             if (item->border == border)
+               _tasks_item_signal_emit(item, sig, src);
+          }
+     }
+}
+
+static Tasks_Item *
+_tasks_item_find(Tasks *tasks, E_Border *border)
+{
+   const Eina_List *l;
+   Tasks_Item *item;
+
+   EINA_LIST_FOREACH(tasks->items, l, item)
+     {
+        if (item->border == border) return item;
+     }
+   return NULL;
+}
+
+static Tasks_Item *
+_tasks_item_new(Tasks *tasks, E_Border *border)
+{
+   Tasks_Item *item;
+
+   item = E_NEW(Tasks_Item, 1);
+   e_object_ref(E_OBJECT(border));
+   item->tasks = tasks;
+   item->border = border;
+   item->o_item = edje_object_add(evas_object_evas_get(tasks->o_items));
+   if (tasks->horizontal)
+     e_theme_edje_object_set(item->o_item, 
+                             "base/theme/modules/tasks", 
+                             "modules/tasks/item");
+   else
+     {
+        if (!e_theme_edje_object_set(item->o_item, 
+                                     "base/theme/modules/tasks", 
+                                     "modules/tasks/item_vert"))
+          e_theme_edje_object_set(item->o_item, 
+                                  "base/theme/modules/tasks", 
+                                  "modules/tasks/item");
+     }
+   evas_object_event_callback_add(item->o_item, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _tasks_cb_item_mouse_down, item);
+   evas_object_event_callback_add(item->o_item, EVAS_CALLBACK_MOUSE_UP,
+                                  _tasks_cb_item_mouse_up, item);
+   evas_object_show(item->o_item);
+   
+   _tasks_item_fill(item);
+   return item;
+}
+
+static int
+_tasks_item_check_add(Tasks *tasks, E_Border *border)
+{
+   if (border->user_skip_winlist) return 1;
+   if (border->client.netwm.state.skip_taskbar) return 1;
+   if (_tasks_item_find(tasks, border)) return 1;
+   if (!tasks->config) return 1;
+   if (!(tasks->config->show_all))
+     {
+        if (border->zone != tasks->zone) return 1;
+        if ((border->desk != e_desk_current_get(border->zone)) && 
+            (!border->sticky))
+          return 1;
+     }
+   _tasks_item_add(tasks, border);
+   return 0;
+}
+
+static void
+_tasks_item_add(Tasks *tasks, E_Border *border)
+{
+   Tasks_Item *item;
+
+   item = _tasks_item_new(tasks, border);
+   e_box_pack_end(tasks->o_items, item->o_item);
+   e_box_pack_options_set(item->o_item,
+                          1, 1, /* fill */
+                          1, 1, /* expand */
+                          0.5, 0.5, /* align */
+                          1, 1, /* min */
+                          9999, 9999 /* max */
+                         );
+   tasks->items = eina_list_append(tasks->items, item);
+}
+
+static void
+_tasks_item_remove(Tasks_Item *item)
+{
+   item->tasks->items = eina_list_remove(item->tasks->items, item);
+   e_box_unpack(item->o_item);
+   evas_object_del(item->o_item);
+   _tasks_item_free(item);
+}
+
+static void
+_tasks_item_free(Tasks_Item *item)
+{
+   if (item->o_icon) evas_object_del(item->o_icon);
+   e_object_unref(E_OBJECT(item->border));
+   evas_object_del(item->o_item);
+   free(item);
+}
+
+static void
+_tasks_item_refill(Tasks_Item *item)
+{
+   if (item->o_icon) evas_object_del(item->o_icon);
+   _tasks_item_fill(item);
+}
+
+static void
+_tasks_item_fill(Tasks_Item *item)
+{
+   const char *label;
+   
+   item->o_icon = e_border_icon_add(item->border, evas_object_evas_get(item->tasks->o_items));
+   edje_object_part_swallow(item->o_item, "e.swallow.icon", item->o_icon);
+   evas_object_pass_events_set(item->o_icon, 1);
+   evas_object_show(item->o_icon);
+   
+   label = e_border_name_get(item->border);
+   edje_object_part_text_set(item->o_item, "e.text.label", label);
+   
+   if (item->border->iconic)
+     _tasks_item_signal_emit(item, "e,state,iconified", "e");
+   else
+     _tasks_item_signal_emit(item, "e,state,uniconified", "e");
+   if (item->border->focused)
+     _tasks_item_signal_emit(item, "e,state,focused", "e");
+   else
+     _tasks_item_signal_emit(item, "e,state,unfocused", "e");
+   if (item->border->client.icccm.urgent)
+     _tasks_item_signal_emit(item, "e,state,urgent", "e");
+   else
+     _tasks_item_signal_emit(item, "e,state,not_urgent", "e");
+}
+
+static void
+_tasks_item_signal_emit(Tasks_Item *item, char *sig, char *src)
+{
+   if (item->o_item) edje_object_signal_emit(item->o_item, sig, src);
+   if (item->o_icon) edje_object_signal_emit(item->o_icon, sig, src);
+}
+
+static Config_Item *
+_tasks_config_item_get(const char *id)
+{
+   Eina_List *l;
+   Config_Item *config;
+   char buf[128];
+   
+   if (!id)
+     {
+        int num = 0;
+        
+        /* Create id */
+        if (tasks_config->items)
+          {
+             const char *p;
+             
+             config = eina_list_last(tasks_config->items)->data;
+             p = strrchr(config->id, '.');
+             if (p) num = atoi(p + 1) + 1;
+          }
+        snprintf(buf, sizeof(buf), "%s.%d", _gadcon_class.name, num);
+        id = buf;
+     }
+   else
+     {
+       EINA_LIST_FOREACH(tasks_config->items, l, config)
+          {
+             if (!config->id) continue;
+             if (!strcmp(config->id, id)) return config;
+          }
+     }
+
+   config = E_NEW(Config_Item, 1);
+   config->id = eina_stringshare_add(id);
+   config->show_all = 0;
+
+   tasks_config->items = eina_list_append(tasks_config->items, config);
+
+   return config;
+}
+
+void
+_tasks_config_updated(Config_Item *config)
+{
+   const Eina_List *l;
+   Tasks *tasks;
+   
+   if (!tasks_config) return;
+   EINA_LIST_FOREACH(tasks_config->tasks, l, tasks)
+     {
+        if (tasks->config == config) _tasks_refill(tasks);
+     }
+}
+
+static void
+_tasks_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+   Tasks *tasks;
+
+   tasks = (Tasks *) data;
+   _config_tasks_module(tasks->config);
+}
+
+static void
+_tasks_cb_item_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   Evas_Event_Mouse_Down *ev;
+   Tasks_Item *item;
+   
+   item = (Tasks_Item *) data;
+   ev = event_info;
+   if (ev->button == 3) 
+     {
+        E_Menu *m;
+       E_Menu_Item *mi;
+        int cx, cy, cw, ch;
+        
+        e_gadcon_canvas_zone_geometry_get(item->tasks->gcc->gadcon, &cx, &cy, &cw, &ch);
+        
+       e_int_border_menu_create(item->border);
+        
+       mi = e_menu_item_new(item->border->border_menu);
+       e_menu_item_separator_set(mi, 1);
+        
+       m = e_menu_new();
+        mi = e_menu_item_new(m);
+       e_menu_item_label_set(mi, D_("Settings"));
+       e_util_menu_item_theme_icon_set(mi, "preferences-system");
+       e_menu_item_callback_set(mi, _tasks_cb_menu_configure, item->tasks);
+        
+       m = e_gadcon_client_util_menu_items_append(item->tasks->gcc, m, 0);
+        
+        mi = e_menu_item_new(item->border->border_menu);
+        e_menu_item_label_set(mi, D_("Tasks"));
+        e_menu_item_submenu_set(mi, m);
+       e_util_menu_item_theme_icon_set(mi, "preferences-system");
+        
+       e_menu_activate_mouse(item->border->border_menu,
+                              e_util_zone_current_get(e_manager_current_get()),
+                              cx + ev->output.x, cy + ev->output.y, 1, 1,
+                              E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
+        evas_event_feed_mouse_up(item->tasks->gcc->gadcon->evas, ev->button,
+                                 EVAS_BUTTON_NONE, ev->timestamp, NULL);
+     }
+   
+}
+
+static void
+_tasks_cb_item_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   Evas_Event_Mouse_Up *ev;
+   Tasks_Item *item;
+   
+   ev = event_info;
+   item = data;
+   if (ev->button == 1)
+     {
+        if (!item->border->sticky && item->tasks->config->show_all)
+          e_desk_show(item->border->desk);
+        if (evas_key_modifier_is_set(ev->modifiers, "Alt"))
+          {
+             if (item->border->iconic)
+               e_border_uniconify(item->border);
+             else
+               e_border_iconify(item->border);
+          }
+        else if (evas_key_modifier_is_set(ev->modifiers, "Control"))
+          {
+             if (item->border->maximized)
+               e_border_unmaximize(item->border, e_config->maximize_policy);
+             else
+               e_border_maximize(item->border, e_config->maximize_policy);
+          }
+        else if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
+          {
+             if (item->border->shaded)
+               e_border_unshade(item->border, item->border->shade.dir);
+             else
+               e_border_shade(item->border, item->border->shade.dir);
+          }
+        else if (evas_key_modifier_is_set(ev->modifiers, "Super"))
+          {
+             e_border_act_close_begin(item->border);
+          }
+        else
+          {
+             if (item->border->iconic)
+               {
+                  e_border_uniconify(item->border);
+                  e_border_focus_set(item->border, 1, 1);
+               }
+             else
+               {
+                  if (item->border->focused)
+                    {
+                       e_border_iconify(item->border);
+                    }
+                  else
+                    {
+                       e_border_raise(item->border);
+                       e_border_focus_set(item->border, 1, 1);
+                    }
+               }
+          }
+     }
+   else if (ev->button == 2)
+     {
+        if (!item->border->sticky && item->tasks->config->show_all)
+          e_desk_show(item->border->desk);
+        e_border_raise(item->border);
+        e_border_focus_set(item->border, 1, 1);
+        if (item->border->maximized)
+          e_border_unmaximize(item->border, e_config->maximize_policy);
+        else
+          e_border_maximize(item->border, e_config->maximize_policy);
+     }
+}
+
+/************ BORDER CALLBACKS *********************/
+
+static Eina_Bool
+_tasks_cb_event_border_add(void *data, int type, void *event)
+{
+   E_Event_Border_Add *ev;
+
+   ev = event;
+   tasks_config->borders = eina_list_append(tasks_config->borders, ev->border);
+   _tasks_refill_all();
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_remove(void *data, int type, void *event)
+{
+   E_Event_Border_Remove *ev;
+
+   ev = event;
+   tasks_config->borders = eina_list_remove(tasks_config->borders, ev->border);
+   _tasks_refill_all();
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_iconify(void *data, int type, void *event)
+{
+   E_Event_Border_Iconify *ev;
+
+   ev = event;
+   _tasks_signal_emit(ev->border, "e,state,iconified", "e");
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_uniconify(void *data, int type, void *event)
+{
+   E_Event_Border_Uniconify *ev;
+
+   ev = event;
+   _tasks_signal_emit(ev->border, "e,state,uniconified", "e");
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_window_focus_in(void *data, int type, void *event)
+{
+   E_Event_Border_Focus_In *ev;
+
+   ev = event;
+   _tasks_signal_emit(ev->border, "e,state,focused", "e");
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_window_focus_out(void *data, int type, void *event)
+{
+   E_Event_Border_Focus_Out *ev;
+
+   ev = event;
+   _tasks_signal_emit(ev->border, "e,state,unfocused", "e");
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_urgent_change(void *data, int type, void *event)
+{
+   E_Event_Border_Urgent_Change *ev;
+
+   ev = event;
+   if (ev->border->client.icccm.urgent)
+     _tasks_signal_emit(ev->border, "e,state,urgent", "e");
+   else
+     _tasks_signal_emit(ev->border, "e,state,not_urgent", "e");
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_property(void *data, int type, void *event)
+{
+   E_Event_Border_Property *ev;
+   E_Border *border;
+
+   ev = event;
+   border = ev->border;
+   if (border) _tasks_refill_border(border);
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_icon_change(void *data, int type, void *event)
+{
+   E_Event_Border_Icon_Change *ev;
+   E_Border *border;
+   
+   ev = event;
+   border = ev->border;
+   if (border) _tasks_refill_border(border);
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_zone_set(void *data, int type, void *event)
+{
+   _tasks_refill_all();
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_border_desk_set(void *data, int type, void *event)
+{
+   _tasks_refill_all();
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_tasks_cb_event_desk_show(void *data, int type, void *event)
+{
+   _tasks_refill_all();
+   return EINA_TRUE;
+}
+
+/***************************************************************************/
+ /**/
+
+ /**/
+/***************************************************************************/
diff --git a/src/modules/tasks/e_mod_main.h b/src/modules/tasks/e_mod_main.h
new file mode 100644 (file)
index 0000000..2c01bdb
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef E_MOD_MAIN_H
+#define E_MOD_MAIN_H
+
+#ifdef ENABLE_NLS
+# include <libintl.h>
+# define D_(string) dgettext(PACKAGE, string)
+#else
+# define bindtextdomain(domain,dir)
+# define bind_textdomain_codeset(domain,codeset)
+# define D_(string) (string)
+#endif
+
+typedef struct _Config Config;
+typedef struct _Config_Item Config_Item;
+
+struct _Config
+{
+   E_Module *module;
+   Eina_List *tasks;
+   Eina_List *borders;
+   Eina_List *items;
+   E_Menu *menu;
+   Eina_List *handlers;
+   E_Config_Dialog *config_dialog;
+};
+
+struct _Config_Item
+{
+   const char *id;
+   int show_all;
+   int minw, minh;
+};
+
+EAPI extern E_Module_Api e_modapi;
+
+EAPI void *e_modapi_init(E_Module *m);
+EAPI int e_modapi_shutdown(E_Module *m);
+EAPI int e_modapi_save(E_Module *m);
+
+void _config_tasks_module(Config_Item *ci);
+void _tasks_config_updated(Config_Item *ci);
+extern Config *tasks_config;
+
+#endif
diff --git a/src/modules/tasks/module.desktop.in b/src/modules/tasks/module.desktop.in
new file mode 100644 (file)
index 0000000..368a334
--- /dev/null
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Type=Link
+Name=Tasks
+Icon=e-module-tasks
+X-Enlightenment-ModuleType=utils
+Comment=Gadget to allow you to switch tasks