diff options
author | Carsten Haitzler <raster@rasterman.com> | 2008-11-25 08:05:58 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2008-11-25 08:05:58 +0000 |
commit | 5a29e1f6b5f834cea564cc305bb8f856c3f79cbd (patch) | |
tree | 1dca33de9c96d906278cf6b684fa78a201aeb639 | |
parent | b9d7bcd3775dece81d8a4bb6ea0640e683126aae (diff) | |
download | enlightenment-5a29e1f6b5f834cea564cc305bb8f856c3f79cbd.tar.gz |
syscon module added - provides a system entry in main menu (build in one gone
now). syscon has a poup with buttons (configurale) that offer all the
logout/reboot etc. stuff. also able to extend with more items or inline them
into the theme too.
not complete. need config for being able to extend the syscon popup (and use
it) and no gui config for configuring what should appear and how it should
look. possibly theme should have custon elements for the ones curently using
button + icon look. also no keyboard control.
SVN revision: 37797
33 files changed, 1644 insertions, 248 deletions
diff --git a/config/default/e.src b/config/default/e.src index e6a56b55e4..0f941213c4 100644 --- a/config/default/e.src +++ b/config/default/e.src @@ -1,5 +1,5 @@ group "E_Config" struct { - value "config_version" int: 65834; + value "config_version" int: 65835; value "show_splash" int: 0; value "init_default_theme" string: "default.edj"; value "desktop_default_name" string: "Desktop %i, %i"; @@ -522,4 +522,9 @@ group "E_Config" struct { value "idle_cursor" uchar: 1; value "default_system_menu" string: ""; value "cfgdlg_normal_wins" uchar: 0; + value "syscon.main.icon_size" int: 64; + value "syscon.secondary.icon_size" int: 48; + value "syscon.extra.icon_size" int: 48; + value "syscon.timeout" double: 0.0; + value "syscon.do_input" uchar: 0; } diff --git a/config/illume/e.src b/config/illume/e.src index 93fc236219..31f97a8e6c 100644 --- a/config/illume/e.src +++ b/config/illume/e.src @@ -1,5 +1,5 @@ group "E_Config" struct { - value "config_version" int: 65834; + value "config_version" int: 65835; value "show_splash" int: 1; value "init_default_theme" string: "default.edj"; value "desktop_default_name" string: "Desktop %i, %i"; @@ -240,11 +240,12 @@ group "E_Config" struct { value "priority" int: 0; } } - group "font_defaults" list { - group "E_Font_Default" struct { - value "text_class" string: "default"; - value "font" string: "Vera"; - value "size" int: 10; + group "modules" list { + group "E_Config_Module" struct { + value "name" string: "syscon"; + value "enabled" uchar: 1; + value "delayed" uchar: 1; + value "priority" int: 0; } } group "themes" list { @@ -257,19 +258,9 @@ group "E_Config" struct { group "E_Config_Binding_Key" struct { value "context" int: 9; value "modifiers" int: 0; - value "key" string: "Keycode-177"; - value "action" string: "simple_lock"; - value "params" string: ""; - value "any_mod" uchar: 1; - } - } - group "key_bindings" list { - group "E_Config_Binding_Key" struct { - value "context" int: 9; - value "modifiers" int: 0; value "key" string: "Execute"; value "action" string: "delayed_action"; - value "params" string: "[0.0 exec dbus-send --system --dest=org.openmoko.Power / org.openmoko.Power.Core.RequestResourceState string:cpu string:illume-cmdline string:off] [2.0 halt_now]"; + value "params" string: "[0.0 syscon] [2.0 halt_now]"; value "any_mod" uchar: 1; } } @@ -788,4 +779,35 @@ group "E_Config" struct { value "idle_cursor" uchar: 0; value "default_system_menu" string: ""; value "cfgdlg_normal_wins" uchar: 1; + value "syscon.main.icon_size" int: 64; + value "syscon.secondary.icon_size" int: 48; + value "syscon.extra.icon_size" int: 48; + value "syscon.timeout" double: 5.0; + value "syscon.do_input" uchar: 0; + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "suspend"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/suspend"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "desk_lock"; + value "button" string: "button"; + value "icon" string: "enlightenment/desklock_menu"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "halt"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/halt"; + value "is_main" int: 0; + } + } } diff --git a/config/minimalist/e.src b/config/minimalist/e.src index 843e250a7a..93275133f5 100644 --- a/config/minimalist/e.src +++ b/config/minimalist/e.src @@ -1,5 +1,5 @@ group "E_Config" struct { - value "config_version" int: 65834; + value "config_version" int: 65835; value "show_splash" int: 1; value "init_default_theme" string: "default.edj"; value "desktop_default_background" string: "Light_Gradient.edj"; @@ -370,11 +370,12 @@ group "E_Config" struct { value "priority" int: 0; } } - group "font_defaults" list { - group "E_Font_Default" struct { - value "text_class" string: "default"; - value "font" string: "Vera"; - value "size" int: 10; + group "modules" list { + group "E_Config_Module" struct { + value "name" string: "syscon"; + value "enabled" uchar: 1; + value "delayed" uchar: 1; + value "priority" int: 0; } } group "themes" list { @@ -1935,4 +1936,62 @@ group "E_Config" struct { value "idle_cursor" uchar: 1; value "default_system_menu" string: ""; value "cfgdlg_normal_wins" uchar: 0; + value "syscon.main.icon_size" int: 64; + value "syscon.secondary.icon_size" int: 48; + value "syscon.extra.icon_size" int: 48; + value "syscon.timeout" double: 5.0; + value "syscon.do_input" uchar: 1; + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "halt"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/halt"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "suspend"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/suspend"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "desk_lock"; + value "button" string: "button"; + value "icon" string: "enlightenment/desklock_menu"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "reboot"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/reboot"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "hibernate"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/hibernate"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "logout"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/logout"; + value "is_main" int: 0; + } + } } diff --git a/config/netbook/e.src b/config/netbook/e.src index 94a24c6daa..3d677b1543 100644 --- a/config/netbook/e.src +++ b/config/netbook/e.src @@ -1,5 +1,5 @@ group "E_Config" struct { - value "config_version" int: 65834; + value "config_version" int: 65835; value "show_splash" int: 1; value "init_default_theme" string: "default.edj"; value "desktop_default_background" string: "Dark_Gradient.edj"; @@ -434,11 +434,12 @@ group "E_Config" struct { value "priority" int: 0; } } - group "font_defaults" list { - group "E_Font_Default" struct { - value "text_class" string: "default"; - value "font" string: "Vera"; - value "size" int: 10; + group "modules" list { + group "E_Config_Module" struct { + value "name" string: "syscon"; + value "enabled" uchar: 1; + value "delayed" uchar: 1; + value "priority" int: 0; } } group "themes" list { @@ -1999,4 +2000,62 @@ group "E_Config" struct { value "idle_cursor" uchar: 1; value "default_system_menu" string: ""; value "cfgdlg_normal_wins" uchar: 0; + value "syscon.main.icon_size" int: 64; + value "syscon.secondary.icon_size" int: 48; + value "syscon.extra.icon_size" int: 48; + value "syscon.timeout" double: 5.0; + value "syscon.do_input" uchar: 1; + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "halt"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/halt"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "suspend"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/suspend"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "desk_lock"; + value "button" string: "button"; + value "icon" string: "enlightenment/desklock_menu"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "reboot"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/reboot"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "hibernate"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/hibernate"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "logout"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/logout"; + value "is_main" int: 0; + } + } } diff --git a/config/scaleable/e.src b/config/scaleable/e.src index 561aaefc2e..2ff3a1921f 100644 --- a/config/scaleable/e.src +++ b/config/scaleable/e.src @@ -1,5 +1,5 @@ group "E_Config" struct { - value "config_version" int: 65834; + value "config_version" int: 65835; value "show_splash" int: 1; value "init_default_theme" string: "default.edj"; value "desktop_default_name" string: "Desktop %i, %i"; @@ -457,11 +457,12 @@ group "E_Config" struct { value "priority" int: -100; } } - group "font_defaults" list { - group "E_Font_Default" struct { - value "text_class" string: "default"; - value "font" string: "Vera"; - value "size" int: 10; + group "modules" list { + group "E_Config_Module" struct { + value "name" string: "syscon"; + value "enabled" uchar: 1; + value "delayed" uchar: 1; + value "priority" int: 0; } } group "themes" list { @@ -2022,4 +2023,62 @@ group "E_Config" struct { value "idle_cursor" uchar: 1; value "default_system_menu" string: ""; value "cfgdlg_normal_wins" uchar: 0; + value "syscon.main.icon_size" int: 64; + value "syscon.secondary.icon_size" int: 48; + value "syscon.extra.icon_size" int: 48; + value "syscon.timeout" double: 5.0; + value "syscon.do_input" uchar: 1; + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "halt"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/halt"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "suspend"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/suspend"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "desk_lock"; + value "button" string: "button"; + value "icon" string: "enlightenment/desklock_menu"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "reboot"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/reboot"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "hibernate"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/hibernate"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "logout"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/logout"; + value "is_main" int: 0; + } + } } diff --git a/config/standard/e.src b/config/standard/e.src index 236f52e384..b18c50d616 100644 --- a/config/standard/e.src +++ b/config/standard/e.src @@ -1,5 +1,5 @@ group "E_Config" struct { - value "config_version" int: 65834; + value "config_version" int: 65835; value "show_splash" int: 1; value "init_default_theme" string: "default.edj"; value "desktop_default_name" string: "Desktop %i, %i"; @@ -457,11 +457,12 @@ group "E_Config" struct { value "priority" int: -100; } } - group "font_defaults" list { - group "E_Font_Default" struct { - value "text_class" string: "default"; - value "font" string: "Vera"; - value "size" int: 10; + group "modules" list { + group "E_Config_Module" struct { + value "name" string: "syscon"; + value "enabled" uchar: 1; + value "delayed" uchar: 1; + value "priority" int: 0; } } group "themes" list { @@ -2022,4 +2023,62 @@ group "E_Config" struct { value "idle_cursor" uchar: 1; value "default_system_menu" string: ""; value "cfgdlg_normal_wins" uchar: 0; + value "syscon.main.icon_size" int: 64; + value "syscon.secondary.icon_size" int: 48; + value "syscon.extra.icon_size" int: 48; + value "syscon.timeout" double: 5.0; + value "syscon.do_input" uchar: 1; + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "halt"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/halt"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "suspend"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/suspend"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "desk_lock"; + value "button" string: "button"; + value "icon" string: "enlightenment/desklock_menu"; + value "is_main" int: 1; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "reboot"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/reboot"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "hibernate"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/hibernate"; + value "is_main" int: 0; + } + } + group "syscon.actions" list { + group "E_Config_Syscon_Action" struct { + value "action" string: "logout"; + value "params" string: "now"; + value "button" string: "button"; + value "icon" string: "enlightenment/logout"; + value "is_main" int: 0; + } + } } diff --git a/configure.ac b/configure.ac index ba71aa3c49..91d53601f7 100644 --- a/configure.ac +++ b/configure.ac @@ -431,6 +431,8 @@ src/modules/illume/Makefile src/modules/illume/module.desktop src/modules/illume/keyboards/Makefile src/modules/illume/dicts/Makefile +src/modules/syscon/Makefile +src/modules/syscon/module.desktop src/preload/Makefile data/Makefile data/images/Makefile diff --git a/data/themes/default.edc b/data/themes/default.edc index 1f03eea2fd..e88cb43d56 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -10035,6 +10035,12 @@ collections { /* begin the collection of edje groups that are in this file */ /*** MOD: EXEBUF ***/ group { name: "e/widgets/exebuf/main"; + images { + image: "base_bg.png" COMP; + image: "inset_sunk.png" COMP; + image: "menu_sel_bg.png" COMP; + image: "menu_sel_fg.png" COMP; + } parts { part { name: "base"; mouse_events: 0; @@ -10402,6 +10408,606 @@ collections { /* begin the collection of edje groups that are in this file */ } ///////////////////////////////////////////////////////////////////////////// + /*** MOD: SYSCON ***/ + +/* + group { name: "e/wizard/main"; + images { + image: "vgrad_dark.png" COMP; + image: "grill_dark_tiny_pattern.png" COMP; + 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; + } + parts { + part { name: "background_image"; + description { state: "default" 0.0; + image.normal: "vgrad_dark.png"; + fill { + smooth: 0; + size { + relative: 0 1.0; + offset: 36 0; + } + } + } + } + part { name: "grill"; + description { state: "default" 0.0; + image.normal: "grill_dark_tiny_pattern.png"; + fill { + size { + relative: 0 0; + offset: 144 144; + } + } + } + } + part { name: "e.text.title"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 8; + } + rel2 { + relative: 1.0 0.0; + offset: -1 8; + } + color: 255 255 255 255; + color3: 0 0 0 32; + text { + font: "Sans:style=Bold"; + size: 20; + min: 1 1; + align: 0.5 0.5; + } + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to_y: "e.text.title"; + relative: 0.5 1.0; + offset: 0 8; + } + rel2 { + to_y: "button_image"; + relative: 0.5 0.0; + offset: 0 -9; + } + } + } + part { name: "button_image"; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel1.offset: 0 -9; + rel2.relative: 0.5 1.0; + rel2.offset: 0 -9; + min: 64 32; + max: 64 32; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + } + } + part { name: "e.text.label"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1 { + to: "button_image"; + relative: 0.0 0.0; + offset: 3 3; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + to: "button_image"; + } + color: 224 224 224 255; + color3: 0 0 0 64; + color_class: "button_text"; + text { + text: "Close"; + font: "Sans"; + size: 10; + min: 1 1; + align: 0.5 0.5; + text_class: "button"; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + color_class: "button_text_disabled"; + } + } + part { name: "over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button_image"; + rel2.to: "button_image"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "over2"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button_image"; + rel2.to: "button_image"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "over3"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button_image"; + rel2.to: "button_image"; + visible: 0; + color: 255 255 255 0; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "block"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "button_image"; + rel2.to: "button_image"; + visible: 0; + color: 0 0 0 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + 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,next" ""; + } + program { name: "button_enable"; + signal: "e,state,next,enable"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "button_image"; + target: "e.text.label"; + target: "over1"; + target: "over2"; + target: "block"; + } + program { name: "button_disable"; + signal: "e,state,next,disable"; + source: "e"; + action: STATE_SET "disabled" 0.0; + target: "button_image"; + target: "e.text.label"; + target: "over1"; + target: "over2"; + target: "block"; + } + } + } +*/ + group { name: "e/widgets/syscon/main"; + images { + image: "base_bg.png" COMP; + 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; + } + parts { + part { name: "base"; + mouse_events: 0; + description { state: "default" 0.0; + image { + normal: "base_bg.png"; + border: 2 2 2 2; + } + fill.smooth: 0; + } + } + part { name: "e.swallow.main"; + type: SWALLOW; + description { state: "default" 0.0; + align: 0.5 0.0; + rel1.offset: 12 12; + rel2.relative: 1.0 0.0; + rel2.offset: -13 12; + } + } + part { name: "e.swallow.secondary"; + type: SWALLOW; + description { state: "default" 0.0; + min: 32 32; + rel1.to: "e.swallow.main"; + rel1.relative: 0.0 1.0; + rel1.offset: 0 12; + rel2.to: "e.swallow.extra"; + rel2.relative: 1.0 0.0; + rel2.offset: -1 -13; + } + } + part { name: "e.swallow.extra"; + type: SWALLOW; + description { state: "default" 0.0; + align: 0.5 1.0; + rel1.relative: 0.0 1.0; + rel1.offset: 12 -13; + rel2.to_y: "button_image"; + rel2.relative: 1.0 0.0; + rel2.offset: -13 -13; + } + } + part { name: "button_image"; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel1.offset: 0 -13; + rel2.relative: 0.5 1.0; + rel2.offset: 0 -13; + min: 64 32; + max: 64 32; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + } + } + part { name: "e.text.label"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1 { + to: "button_image"; + relative: 0.0 0.0; + offset: 3 3; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + to: "button_image"; + } + color: 224 224 224 255; + color3: 0 0 0 64; + color_class: "button_text"; + text { + text: "Cancel"; + font: "Sans"; + size: 10; + min: 1 1; + align: 0.5 0.5; + text_class: "button"; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + color_class: "button_text_disabled"; + } + } + part { name: "over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button_image"; + rel2.to: "button_image"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "over2"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button_image"; + rel2.to: "button_image"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "over3"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button_image"; + rel2.to: "button_image"; + visible: 0; + color: 255 255 255 0; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + } + 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,close" ""; + } + } + } + + group { name: "e/widgets/syscon/item/button"; + 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; + } + parts { + part { name: "button_image"; + mouse_events: 1; + description { state: "default" 0.0; + min: 32 16; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + } + } + part { + name: "e.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + aspect: 1.0 1.0; + aspect_preference: BOTH; + align: 0.5 0.5; + rel1 { + relative: 0.0 0.0; + offset: 3 3; + to: "button_image"; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + to: "button_image"; + } + } + } + part { name: "over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "over2"; + mouse_events: 0; + description { state: "default" 0.0; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "over3"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + 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: "disable"; + signal: "e,state,disabled"; + source: "e"; + action: STATE_SET "disabled" 0.0; + target: "button_image"; + target: "over1"; + target: "disabler"; + } + program { + name: "enable"; + signal: "e,state,enabled"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "button_image"; + target: "over1"; + target: "disabler"; + } + } + } + +///////////////////////////////////////////////////////////////////////////// /*** MOD: MIXER ***/ // FIXME: Add code for making sound circles fade between states. @@ -21203,7 +21809,7 @@ group { name: "e/toolbar/default/base"; color3: 0 0 0 64; color_class: "button_text"; text { - text: "Close"; + text: "Next"; font: "Sans"; size: 10; min: 1 1; diff --git a/data/themes/images/icon_desklock_menu.png b/data/themes/images/icon_desklock_menu.png Binary files differindex 720db33033..2b43b9da6f 100644 --- a/data/themes/images/icon_desklock_menu.png +++ b/data/themes/images/icon_desklock_menu.png diff --git a/data/themes/images/icon_halt.png b/data/themes/images/icon_halt.png Binary files differindex fd3187e97f..3b56c20935 100644 --- a/data/themes/images/icon_halt.png +++ b/data/themes/images/icon_halt.png diff --git a/data/themes/images/icon_hibernate.png b/data/themes/images/icon_hibernate.png Binary files differindex 256e4f3522..c633ad3fbd 100644 --- a/data/themes/images/icon_hibernate.png +++ b/data/themes/images/icon_hibernate.png diff --git a/data/themes/images/icon_logout.png b/data/themes/images/icon_logout.png Binary files differindex 440b308ce6..21ec4649fe 100644 --- a/data/themes/images/icon_logout.png +++ b/data/themes/images/icon_logout.png diff --git a/data/themes/images/icon_reboot.png b/data/themes/images/icon_reboot.png Binary files differindex 1861fb2e94..47fd9bc3f9 100644 --- a/data/themes/images/icon_reboot.png +++ b/data/themes/images/icon_reboot.png diff --git a/data/themes/images/icon_reset.png b/data/themes/images/icon_reset.png Binary files differindex ef1aadd61d..47fd9bc3f9 100644 --- a/data/themes/images/icon_reset.png +++ b/data/themes/images/icon_reset.png diff --git a/data/themes/images/icon_suspend.png b/data/themes/images/icon_suspend.png Binary files differindex b2b8e8db33..2d933f96cb 100644 --- a/data/themes/images/icon_suspend.png +++ b/data/themes/images/icon_suspend.png diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c index 7e9e9d1f22..c2f4728897 100644 --- a/src/bin/e_actions.c +++ b/src/bin/e_actions.c @@ -1409,7 +1409,6 @@ _e_actions_menu_find(const char *name) else if (!strcmp(name, "clients")) return e_int_menus_clients_new(); else if (!strcmp(name, "lost_clients")) return e_int_menus_lost_clients_new(); else if (!strcmp(name, "configuration")) return e_int_menus_config_new(); - else if (!strcmp(name, "system")) return e_int_menus_sys_new(); return NULL; } ACT_FN_GO(menu_show) diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 0535e67012..6bed453be3 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -41,6 +41,7 @@ static E_Config_DD *_e_config_gadcon_client_edd = NULL; static E_Config_DD *_e_config_shelf_edd = NULL; static E_Config_DD *_e_config_shelf_desk_edd = NULL; static E_Config_DD *_e_config_mime_icon_edd = NULL; +static E_Config_DD *_e_config_syscon_action_edd = NULL; EAPI int E_EVENT_CONFIG_ICON_THEME = 0; @@ -381,6 +382,18 @@ e_config_init(void) E_CONFIG_VAL(D, T, mime, STR); E_CONFIG_VAL(D, T, icon, STR); + _e_config_syscon_action_edd = E_CONFIG_DD_NEW("E_Config_Syscon_Action", + E_Config_Syscon_Action); +#undef T +#undef D +#define T E_Config_Syscon_Action +#define D _e_config_syscon_action_edd + E_CONFIG_VAL(D, T, action, STR); + E_CONFIG_VAL(D, T, params, STR); + E_CONFIG_VAL(D, T, button, STR); + E_CONFIG_VAL(D, T, icon, STR); + E_CONFIG_VAL(D, T, is_main, INT); + _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config); #undef T #undef D @@ -635,12 +648,19 @@ e_config_init(void) E_CONFIG_VAL(D, T, scale.use_dpi, UCHAR); E_CONFIG_VAL(D, T, scale.use_custom, UCHAR); - E_CONFIG_VAL(D, T, show_cursor, UCHAR); /**/ - E_CONFIG_VAL(D, T, idle_cursor, UCHAR); /**/ + E_CONFIG_VAL(D, T, show_cursor, UCHAR); + E_CONFIG_VAL(D, T, idle_cursor, UCHAR); E_CONFIG_VAL(D, T, default_system_menu, STR); - E_CONFIG_VAL(D, T, cfgdlg_normal_wins, UCHAR); /**/ + E_CONFIG_VAL(D, T, cfgdlg_normal_wins, UCHAR); + + E_CONFIG_VAL(D, T, syscon.main.icon_size, INT); + E_CONFIG_VAL(D, T, syscon.secondary.icon_size, INT); + E_CONFIG_VAL(D, T, syscon.extra.icon_size, INT); + E_CONFIG_VAL(D, T, syscon.timeout, DOUBLE); + E_CONFIG_VAL(D, T, syscon.do_input, UCHAR); + E_CONFIG_LIST(D, T, syscon.actions, _e_config_syscon_action_edd); e_config_load(); @@ -669,6 +689,8 @@ e_config_shutdown(void) E_CONFIG_DD_FREE(_e_config_gadcon_client_edd); E_CONFIG_DD_FREE(_e_config_shelf_edd); E_CONFIG_DD_FREE(_e_config_shelf_desk_edd); + E_CONFIG_DD_FREE(_e_config_mime_icon_edd); + E_CONFIG_DD_FREE(_e_config_syscon_action_edd); return 1; } @@ -775,7 +797,8 @@ e_config_load(void) #define IFCFG(v) if ((e_config->config_version & 0xffff) < (v)) { #define IFCFGEND } #define COPYVAL(x) do {e_config->x = tcfg->x;} while (0) -#define COPYSTR(x) do {e_config->x = tcfg->x; tcfg->x = NULL;} while (0) +#define COPYPTR(x) do {e_config->x = tcfg->x; tcfg->x = NULL;} while (0) +#define COPYSTR(x) COPYPTR(x) if (tcfg) { /* some sort of upgrade is needed */ @@ -824,6 +847,10 @@ e_config_load(void) COPYVAL(cfgdlg_normal_wins); IFCFGEND; + IFCFG(0x012c); + COPYPTR(syscon.actions); + IFCFGEND; + e_config->config_version = E_CONFIG_FILE_VERSION; _e_config_free(tcfg); } @@ -1573,6 +1600,18 @@ _e_config_free(E_Config *ecf) if (ecf->wallpaper_import_last_path) eina_stringshare_del(ecf->wallpaper_import_last_path); if (ecf->theme_default_border_style) eina_stringshare_del(ecf->theme_default_border_style); if (ecf->desklock_custom_desklock_cmd) eina_stringshare_del(ecf->desklock_custom_desklock_cmd); + while (ecf->syscon.actions) + { + E_Config_Syscon_Action *sca; + + sca = ecf->syscon.actions->data; + if (sca->action) eina_stringshare_del(sca->action); + if (sca->params) eina_stringshare_del(sca->params); + if (sca->button) eina_stringshare_del(sca->button); + if (sca->icon) eina_stringshare_del(sca->icon); + E_FREE(sca); + ecf->syscon.actions = eina_list_remove_list(ecf->syscon.actions, ecf->syscon.actions); + } E_FREE(ecf); } diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 9598260716..ef55a247bb 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -19,6 +19,7 @@ typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client; typedef struct _E_Config_Shelf E_Config_Shelf; typedef struct _E_Config_Shelf_Desk E_Config_Shelf_Desk; typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon; +typedef struct _E_Config_Syscon_Action E_Config_Syscon_Action; typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme; @@ -33,7 +34,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme; /* increment this whenever a new set of config values are added but the users * config doesn't need to be wiped - simply new values need to be put in */ -#define E_CONFIG_FILE_GENERATION 0x012b +#define E_CONFIG_FILE_GENERATION 0x012c #define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION) #define E_EVAS_ENGINE_DEFAULT 0 @@ -284,10 +285,10 @@ struct _E_Config int ping_clients_interval; int cache_flush_poll_interval; // GUI - int thumbscroll_enable; - int thumbscroll_threshhold; - double thumbscroll_momentum_threshhold; - double thumbscroll_friction; + int thumbscroll_enable; // GUI + int thumbscroll_threshhold; // GUI + double thumbscroll_momentum_threshhold; // GUI + double thumbscroll_friction; // GUI int hal_desktop; @@ -304,12 +305,12 @@ struct _E_Config } border_keyboard; struct { - double min; - double max; - double factor; - int base_dpi; - unsigned char use_dpi; - unsigned char use_custom; + double min; // GUI + double max; // GUI + double factor; // GUI + int base_dpi; // GUI + unsigned char use_dpi; // GUI + unsigned char use_custom; // GUI } scale; unsigned char show_cursor; // GUI @@ -317,7 +318,25 @@ struct _E_Config const char *default_system_menu; - unsigned char cfgdlg_normal_wins; + unsigned char cfgdlg_normal_wins; // GUI + + struct { + struct { + int icon_size; + } main, secondary, extra; + double timeout; + unsigned char do_input; + Eina_List *actions; + } syscon; +}; + +struct _E_Config_Syscon_Action +{ + const char *action; + const char *params; + const char *button; + const char *icon; + int is_main; }; struct _E_Config_Module diff --git a/src/bin/e_flowlayout.c b/src/bin/e_flowlayout.c index bbad398a42..929f9a876b 100644 --- a/src/bin/e_flowlayout.c +++ b/src/bin/e_flowlayout.c @@ -758,6 +758,16 @@ _e_flowlayout_smart_extents_calcuate(E_Smart_Data *sd) sd->rows = 1; count = eina_list_count(sd->items); sd->cols = sd->w/minw; + if (count < sd->cols) sd->cols = count; + sd->rows = 0; + if (sd->cols > 0) + { + while (count > 0) + { + count -= sd->cols; + sd->rows++; + } + } } else { @@ -766,6 +776,16 @@ _e_flowlayout_smart_extents_calcuate(E_Smart_Data *sd) sd->cols = 1; count = eina_list_count(sd->items); sd->rows = sd->h/minh; + if (count < sd->cols) sd->rows = count; + sd->cols = 0; + if (sd->rows > 0) + { + while (count > 0) + { + count -= sd->rows; + sd->cols++; + } + } } minw *= sd->cols; diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index 3917b8c7d0..691f12f6e1 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -15,22 +15,12 @@ struct _Main_Data E_Menu *enlightenment; E_Menu *config; E_Menu *lost_clients; - E_Menu *sys; }; /* local subsystem functions */ static void _e_int_menus_main_del_hook (void *obj); static void _e_int_menus_main_about (void *data, E_Menu *m, E_Menu_Item *mi); //static void _e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi); -static int _e_int_menus_main_lock_defer_cb (void *data); -static void _e_int_menus_main_lock (void *data, E_Menu *m, E_Menu_Item*mi); -static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_main_logout (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_main_exit (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_main_halt (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_main_reboot (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_main_suspend (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_main_hibernate (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_apps_scan (E_Menu *m, Efreet_Menu *menu); static void _e_int_menus_apps_start (void *data, E_Menu *m); static void _e_int_menus_apps_free_hook (void *obj); @@ -61,8 +51,6 @@ static void _e_int_menus_themes_about (void *data, E_Menu *m, E_Menu_Item static void _e_int_menus_lost_clients_pre_cb (void *data, E_Menu *m); static void _e_int_menus_lost_clients_free_hook (void *obj); static void _e_int_menus_lost_clients_item_cb (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_sys_pre_cb (void *data, E_Menu *m); -static void _e_int_menus_sys_free_hook (void *obj); static void _e_int_menus_augmentation_add (E_Menu *m, Eina_List *augmentation); static void _e_int_menus_augmentation_del (E_Menu *m, Eina_List *augmentation); static void _e_int_menus_shelves_pre_cb (void *data, E_Menu *m); @@ -70,6 +58,8 @@ static void _e_int_menus_shelves_item_cb (void *data, E_Menu *m, E_Menu_Item static void _e_int_menus_shelves_add_cb (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_shelves_del_cb (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_main_showhide (void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_int_menus_main_exit (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_desk_item_cb (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_items_del_hook (void *obj); static void _e_int_menus_item_label_set (Efreet_Menu *entry, E_Menu_Item *mi); @@ -225,13 +215,6 @@ e_int_menus_main_new(void) l = evas_hash_find(_e_int_menus_augmentation, "main/10"); if (l) _e_int_menus_augmentation_add(m, l); - subm = e_int_menus_sys_new(); - dat->sys = subm; - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("System")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/system"); - e_menu_item_submenu_set(mi, subm); - l = evas_hash_find(_e_int_menus_augmentation, "main/11"); if (l) _e_int_menus_augmentation_add(m, l); @@ -341,16 +324,6 @@ e_int_menus_lost_clients_new(void) return m; } -EAPI E_Menu * -e_int_menus_sys_new(void) -{ - E_Menu *m; - - m = e_menu_new(); - e_menu_pre_activate_callback_set(m, _e_int_menus_sys_pre_cb, NULL); - return m; -} - EAPI E_Int_Menu_Augmentation * e_int_menus_menu_augmentation_add(const char *menu, void (*func_add) (void *data, E_Menu *m), @@ -427,7 +400,6 @@ _e_int_menus_main_del_hook(void *obj) e_object_del(E_OBJECT(dat->enlightenment)); e_object_del(E_OBJECT(dat->config)); if (dat->lost_clients) e_object_del(E_OBJECT(dat->lost_clients)); - e_object_del(E_OBJECT(dat->sys)); free(dat); } _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/0")); @@ -470,24 +442,6 @@ _e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi) } */ -/* FIXME: this is a workaround for menus' haveing a key grab AND exebuf - * wanting one too - */ -static int -_e_int_menus_main_lock_defer_cb(void *data) -{ - e_desklock_show(); - return 0; -} - -static void -_e_int_menus_main_lock(void *data, E_Menu *m, E_Menu_Item *mi) -{ - /* this is correct - should be after other idle enteres have run - i.e. - * after e_menu's idler_enterer has been run */ - ecore_idle_enterer_add(_e_int_menus_main_lock_defer_cb, m->zone); -} - static void _e_int_menus_main_showhide(void *data, E_Menu *m, E_Menu_Item *mi) { @@ -507,15 +461,6 @@ _e_int_menus_main_restart(void *data, E_Menu *m, E_Menu_Item *mi) } static void -_e_int_menus_main_logout(void *data, E_Menu *m, E_Menu_Item *mi) -{ - E_Action *a; - - a = e_action_find("logout"); - if ((a) && (a->func.go)) a->func.go(NULL, NULL); -} - -static void _e_int_menus_main_exit(void *data, E_Menu *m, E_Menu_Item *mi) { E_Action *a; @@ -525,42 +470,6 @@ _e_int_menus_main_exit(void *data, E_Menu *m, E_Menu_Item *mi) } static void -_e_int_menus_main_halt(void *data, E_Menu *m, E_Menu_Item *mi) -{ - E_Action *a; - - a = e_action_find("halt"); - if ((a) && (a->func.go)) a->func.go(NULL, NULL); -} - -static void -_e_int_menus_main_reboot(void *data, E_Menu *m, E_Menu_Item *mi) -{ - E_Action *a; - - a = e_action_find("reboot"); - if ((a) && (a->func.go)) a->func.go(NULL, NULL); -} - -static void -_e_int_menus_main_suspend(void *data, E_Menu *m, E_Menu_Item *mi) -{ - E_Action *a; - - a = e_action_find("suspend"); - if ((a) && (a->func.go)) a->func.go(NULL, NULL); -} - -static void -_e_int_menus_main_hibernate(void *data, E_Menu *m, E_Menu_Item *mi) -{ - E_Action *a; - - a = e_action_find("hibernate"); - if ((a) && (a->func.go)) a->func.go(NULL, NULL); -} - -static void _e_int_menus_apps_scan(E_Menu *m, Efreet_Menu *menu) { E_Menu_Item *mi; @@ -858,95 +767,6 @@ _e_int_menus_config_free_hook(void *obj) _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "config/2")); } -static void -_e_int_menus_sys_pre_cb(void *data, E_Menu *m) -{ - E_Menu_Item *mi; - Eina_List *l = NULL; - - e_menu_pre_activate_callback_set(m, NULL, NULL); - - l = evas_hash_find(_e_int_menus_augmentation, "sys/0"); - if (l) - { - _e_int_menus_augmentation_add(m, l); - - mi = e_menu_item_new(m); - e_menu_item_separator_set(mi, 1); - } - - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Lock Screen")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/desklock_menu"); - e_menu_item_callback_set(mi, _e_int_menus_main_lock, NULL); - - mi = e_menu_item_new(m); - e_menu_item_separator_set(mi, 1); - - if (e_sys_action_possible_get(E_SYS_HALT) || - e_sys_action_possible_get(E_SYS_REBOOT) || - e_sys_action_possible_get(E_SYS_SUSPEND) || - e_sys_action_possible_get(E_SYS_HIBERNATE)) - { - if (e_sys_action_possible_get(E_SYS_SUSPEND)) - { - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Suspend")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/suspend"); - e_menu_item_callback_set(mi, _e_int_menus_main_suspend, NULL); - } - if (e_sys_action_possible_get(E_SYS_HIBERNATE)) - { - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Hibernate")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/hibernate"); - e_menu_item_callback_set(mi, _e_int_menus_main_hibernate, NULL); - } - if (e_sys_action_possible_get(E_SYS_REBOOT)) - { - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Reboot")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/reboot"); - e_menu_item_callback_set(mi, _e_int_menus_main_reboot, NULL); - } - if (e_sys_action_possible_get(E_SYS_HALT)) - { - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Shut Down")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/halt"); - e_menu_item_callback_set(mi, _e_int_menus_main_halt, NULL); - } - mi = e_menu_item_new(m); - e_menu_item_separator_set(mi, 1); - } - - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Logout")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/logout"); - e_menu_item_callback_set(mi, _e_int_menus_main_logout, NULL); - - l = evas_hash_find(_e_int_menus_augmentation, "sys/1"); - if (l) - { - _e_int_menus_augmentation_add(m, l); - - mi = e_menu_item_new(m); - e_menu_item_separator_set(mi, 1); - } - - e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_sys_free_hook); -} - -static void -_e_int_menus_sys_free_hook(void *obj) -{ - E_Menu *m; - - m = obj; - _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "sys/0")); - _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "sys/1")); -} - static int _e_int_menus_clients_group_desk_cb(const void *d1, const void *d2) { diff --git a/src/bin/e_int_menus.h b/src/bin/e_int_menus.h index 865345f933..ed269ad0b1 100644 --- a/src/bin/e_int_menus.h +++ b/src/bin/e_int_menus.h @@ -45,7 +45,6 @@ EAPI E_Menu *e_int_menus_all_apps_new(void); EAPI E_Menu *e_int_menus_config_new(void); EAPI E_Menu *e_int_menus_lost_clients_new(void); EAPI E_Menu *e_int_menus_shelves_new(void); -EAPI E_Menu *e_int_menus_sys_new(void); EAPI E_Int_Menu_Augmentation *e_int_menus_menu_augmentation_add(const char *menu, void (*func_add) (void *data, E_Menu *m), diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c index 3e765cbe36..e4c52b035e 100644 --- a/src/bin/e_sys.c +++ b/src/bin/e_sys.c @@ -69,7 +69,7 @@ e_sys_action_possible_get(E_Sys_Action a) case E_SYS_EXIT_NOW: return 1; case E_SYS_LOGOUT: - return 0; + return 1; case E_SYS_HALT: case E_SYS_HALT_NOW: return _e_sys_can_halt; diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index c91b01949b..d4c1b6c3ef 100644 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -55,7 +55,8 @@ mixer \ conf_window_remembers \ conf_scale \ connman \ -illume +illume \ +syscon if HAVE_TEMPERATURE SUBDIRS += temperature diff --git a/src/modules/illume/e_mod_win.c b/src/modules/illume/e_mod_win.c index 2618d2512e..41cb7c4c47 100644 --- a/src/modules/illume/e_mod_win.c +++ b/src/modules/illume/e_mod_win.c @@ -644,7 +644,11 @@ _cb_slipshelf_close(const void *data, E_Slipshelf *ess, E_Slipshelf_Action actio } else { - e_syswin_show(slipwin); + E_Action *a; + + a = e_action_find("syscon"); + if ((a) && (a->func.go)) a->func.go(NULL, NULL); +// e_syswin_show(slipwin); } } diff --git a/src/modules/syscon/.cvsignore b/src/modules/syscon/.cvsignore new file mode 100644 index 0000000000..06d064a845 --- /dev/null +++ b/src/modules/syscon/.cvsignore @@ -0,0 +1,7 @@ +.deps +.libs +Makefile +Makefile.in +*.lo +module.la +module.desktop diff --git a/src/modules/syscon/Makefile.am b/src/modules/syscon/Makefile.am new file mode 100644 index 0000000000..59995bcef1 --- /dev/null +++ b/src/modules/syscon/Makefile.am @@ -0,0 +1,31 @@ +MAINTAINERCLEANFILES = Makefile.in +MODULE = syscon + +# 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_srcdir)/src/lib \ + -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_syscon.c \ + e_syscon.h + +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/syscon/e-module-syscon.edj b/src/modules/syscon/e-module-syscon.edj Binary files differnew file mode 100644 index 0000000000..05da0becf0 --- /dev/null +++ b/src/modules/syscon/e-module-syscon.edj diff --git a/src/modules/syscon/e_mod_main.c b/src/modules/syscon/e_mod_main.c new file mode 100644 index 0000000000..95b59e7eb8 --- /dev/null +++ b/src/modules/syscon/e_mod_main.c @@ -0,0 +1,138 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#include "e.h" +#include "e_mod_main.h" + +/***************************************************************************/ +/**/ +/* actual module specifics */ + +static void _e_mod_action_syscon_cb(E_Object *obj, const char *params); +static int _e_mod_syscon_defer_cb(void *data); +static void _e_mod_syscon_cb(void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_mod_menu_add(void *data, E_Menu *m); + +static E_Module *conf_module = NULL; +static E_Action *act = NULL; +static E_Int_Menu_Augmentation *maug = NULL; + +/**/ +/***************************************************************************/ + +/***************************************************************************/ +/**/ + +/**/ +/***************************************************************************/ + +/***************************************************************************/ +/**/ +/* module setup */ +EAPI E_Module_Api e_modapi = +{ + E_MODULE_API_VERSION, + "Syscon" +}; + +EAPI void * +e_modapi_init(E_Module *m) +{ + conf_module = m; + e_syscon_init(); + /* add module supplied action */ + act = e_action_add("syscon"); + if (act) + { + act->func.go = _e_mod_action_syscon_cb; + e_action_predef_name_set(_("System"), _("System Control"), "syscon", + NULL, NULL, 0); + } + maug = e_int_menus_menu_augmentation_add("main/10", _e_mod_menu_add, NULL, NULL, NULL); + e_module_delayed_set(m, 1); + return m; +} + +EAPI int +e_modapi_shutdown(E_Module *m) +{ + /* remove module-supplied menu additions */ + if (maug) + { + e_int_menus_menu_augmentation_del("main/10", maug); + maug = NULL; + } + /* remove module-supplied action */ + if (act) + { + e_action_predef_name_del(_("System"), _("System Controls")); + e_action_del("syscon"); + act = NULL; + } + e_syscon_shutdown(); + conf_module = NULL; + return 1; +} + +EAPI int +e_modapi_save(E_Module *m) +{ + return 1; +} + +/* action callback */ +static void +_e_mod_action_syscon_cb(E_Object *obj, const char *params) +{ + E_Zone *zone = NULL; + + // params = syscon action + now: + // desk_lock + // logout + // halt + // reboot + // suspend + // hibernate + if (obj) + { + if (obj->type == E_MANAGER_TYPE) + zone = e_util_zone_current_get((E_Manager *)obj); + else if (obj->type == E_CONTAINER_TYPE) + zone = e_util_zone_current_get(((E_Container *)obj)->manager); + else if (obj->type == E_ZONE_TYPE) + zone = e_util_zone_current_get(((E_Zone *)obj)->container->manager); + else + zone = e_util_zone_current_get(e_manager_current_get()); + } + if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); + if (zone) e_syscon_show(zone, params); +} + +/* menu item callback(s) */ +static int +_e_mod_syscon_defer_cb(void *data) +{ + E_Zone *zone; + + zone = data; + if (zone) e_syscon_show(zone, NULL); + return 0; +} + +static void +_e_mod_syscon_cb(void *data, E_Menu *m, E_Menu_Item *mi) +{ + ecore_idle_enterer_add(_e_mod_syscon_defer_cb, m->zone); +} + +/* menu item add hook */ +static void +_e_mod_menu_add(void *data, E_Menu *m) +{ + E_Menu_Item *mi; + + mi = e_menu_item_new(m); + e_menu_item_label_set(mi, _("System")); + e_util_menu_item_edje_icon_set(mi, "enlightenment/system"); + e_menu_item_callback_set(mi, _e_mod_syscon_cb, NULL); +} diff --git a/src/modules/syscon/e_mod_main.h b/src/modules/syscon/e_mod_main.h new file mode 100644 index 0000000000..80737e6f5b --- /dev/null +++ b/src/modules/syscon/e_mod_main.h @@ -0,0 +1,19 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#ifndef E_MOD_MAIN_H +#define E_MOD_MAIN_H + +#define E_TYPEDEFS 1 +#include "e_syscon.h" + +#undef E_TYPEDEFS +#include "e_syscon.h" + +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); + +#endif diff --git a/src/modules/syscon/e_syscon.c b/src/modules/syscon/e_syscon.c new file mode 100644 index 0000000000..787359fc86 --- /dev/null +++ b/src/modules/syscon/e_syscon.c @@ -0,0 +1,406 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#include "e.h" +#include "e_mod_main.h" + +/* local subsystem functions */ +static int _cb_key_down(void *data, int type, void *event); +static int _cb_mouse_down(void *data, int type, void *event); +static int _cb_mouse_up(void *data, int type, void *event); +static int _cb_mouse_move(void *data, int type, void *event); +static int _cb_mouse_wheel(void *data, int type, void *event); +static void _cb_signal_close(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _cb_signal_syscon(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _cb_signal_action(void *data, Evas_Object *obj, const char *emission, const char *source); +static int _cb_timeout_defaction(void *data); + +/* local subsystem globals */ +static E_Popup *popup = NULL; +static Ecore_X_Window input_window = 0; +static const char *do_defact = NULL; +static Eina_List *handlers = NULL; +static Evas_Object *o_bg = NULL; +static Evas_Object *o_flow_main = NULL; +static Evas_Object *o_flow_secondary = NULL; +static Evas_Object *o_flow_extra = NULL; +static int inevas = 0; +static Ecore_Timer *deftimer = NULL; + +/* externally accessible functions */ +EAPI int +e_syscon_init(void) +{ + return 1; +} + +EAPI int +e_syscon_shutdown(void) +{ + e_syscon_hide(); + return 1; +} + +EAPI int +e_syscon_show(E_Zone *zone, const char *defact) +{ + Evas_Object *o, *o2; + Evas_Coord mw, mh; + int x, y, w, h; + int iw, ih; + Eina_List *l; + + if (popup) return 0; + + input_window = ecore_x_window_input_new(zone->container->win, zone->x, + zone->y, zone->w, zone->h); + ecore_x_window_show(input_window); + if (!e_grabinput_get(input_window, 1, input_window)) + { + ecore_x_window_del(input_window); + input_window = 0; + return 0; + } + + popup = e_popup_new(zone, 0, 0, 1, 1); + if (!popup) + { + e_grabinput_release(input_window, input_window); + ecore_x_window_del(input_window); + input_window = 0; + return 0; + } + evas_event_freeze(popup->evas); + e_popup_layer_set(popup, 500); + + handlers = eina_list_append + (handlers, ecore_event_handler_add + (ECORE_X_EVENT_KEY_DOWN, _cb_key_down, NULL)); + handlers = eina_list_append + (handlers, ecore_event_handler_add + (ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _cb_mouse_down, NULL)); + handlers = eina_list_append + (handlers, ecore_event_handler_add + (ECORE_X_EVENT_MOUSE_BUTTON_UP, _cb_mouse_up, NULL)); + handlers = eina_list_append + (handlers, ecore_event_handler_add + (ECORE_X_EVENT_MOUSE_MOVE, _cb_mouse_move, NULL)); + handlers = eina_list_append + (handlers, ecore_event_handler_add + (ECORE_X_EVENT_MOUSE_WHEEL, _cb_mouse_wheel, NULL)); + + o = edje_object_add(popup->evas); + o_bg = o; + e_theme_edje_object_set(o, "base/theme/syscon", + "e/widgets/syscon/main"); + edje_object_part_text_set(o, "e.text.label", _("Cancel")); + edje_object_signal_callback_add(o, "e,action,close", "", _cb_signal_close, NULL); + edje_object_signal_callback_add(o, "e,action,syscon", "*", _cb_signal_syscon, NULL); + + // main (default): + // halt | suspend | desk_lock + // secondary (default): + // reboot | hibernate | logout + // extra (example for illume): + // home | close | kill + + iw = 64 * e_scale; + ih = 64 * e_scale; + + o = e_flowlayout_add(popup->evas); + o_flow_main = o; + e_flowlayout_orientation_set(o, 1); + e_flowlayout_flowdirection_set(o, 1, 1); + e_flowlayout_homogenous_set(o, 1); + + o = e_flowlayout_add(popup->evas); + o_flow_secondary = o; + e_flowlayout_orientation_set(o, 1); + e_flowlayout_flowdirection_set(o, 1, 1); + e_flowlayout_homogenous_set(o, 1); + + o = e_flowlayout_add(popup->evas); + o_flow_extra = o; + e_flowlayout_orientation_set(o, 1); + e_flowlayout_flowdirection_set(o, 1, 1); + e_flowlayout_homogenous_set(o, 1); + + for (l = e_config->syscon.actions; l; l = l->next) + { + E_Config_Syscon_Action *sca; + char buf[1024]; + E_Action *a; + int disabled; + + sca = l->data; + if (!sca->action) continue; + a = e_action_find(sca->action); + if (!a) continue; + disabled = 0; + if ((!strcmp(sca->action, "logout")) && + (!e_sys_action_possible_get(E_SYS_LOGOUT))) disabled = 1; + else if ((!strcmp(sca->action, "halt")) && + (!e_sys_action_possible_get(E_SYS_HALT))) disabled = 1; + else if ((!strcmp(sca->action, "halt_now")) && + (!e_sys_action_possible_get(E_SYS_HALT_NOW))) disabled = 1; + else if ((!strcmp(sca->action, "reboot")) && + (!e_sys_action_possible_get(E_SYS_REBOOT))) disabled = 1; + else if ((!strcmp(sca->action, "suspend")) && + (!e_sys_action_possible_get(E_SYS_SUSPEND))) disabled = 1; + else if ((!strcmp(sca->action, "hibernate")) && + (!e_sys_action_possible_get(E_SYS_HIBERNATE))) disabled = 1; + o = edje_object_add(popup->evas); + edje_object_signal_callback_add(o, "e,action,click", "", _cb_signal_action, sca); + if (sca->button) + { + snprintf(buf, sizeof(buf), "e/widgets/syscon/item/%s", + sca->button); + e_theme_edje_object_set(o, "base/theme/widgets", buf); + } + else + e_theme_edje_object_set(o, "base/theme/widgets", + "e/widgets/syscon/item/button"); +// edje_object_part_text_set(o, "e.text.label", sca->action); + if (sca->icon) + { + o2 = edje_object_add(popup->evas); + e_util_edje_icon_set(o2, sca->icon); + edje_object_part_swallow(o, "e.swallow.icon", o2); + evas_object_show(o2); + if (disabled) + edje_object_signal_emit(o2, "e,state,disabled", "e"); + } + if (disabled) + edje_object_signal_emit(o, "e,state,disabled", "e"); + if (sca->is_main) + { + e_flowlayout_pack_end(o_flow_main, o); + iw = ih = e_config->syscon.main.icon_size * e_scale; + } + else + { + e_flowlayout_pack_end(o_flow_secondary, o); + iw = ih = e_config->syscon.secondary.icon_size * e_scale; + } + e_flowlayout_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, + iw, ih, iw, ih); + evas_object_show(o); + } + // FIXME: "extra" list needs to be handled + + e_flowlayout_fill_set(o_flow_main, 1); + edje_object_part_swallow(o_bg, "e.swallow.main", o_flow_main); + e_flowlayout_fill_set(o_flow_secondary, 1); + edje_object_part_swallow(o_bg, "e.swallow.secondary", o_flow_secondary); + e_flowlayout_fill_set(o_flow_extra, 1); + edje_object_part_swallow(o_bg, "e.swallow.extra", o_flow_extra); + + evas_object_resize(o_bg, zone->w, zone->h); + edje_object_calc_force(o_bg); + + e_flowlayout_min_size_get(o_flow_main, &mw, &mh); + edje_extern_object_min_size_set(o_flow_main, mw, mh); + edje_object_part_swallow(o_bg, "e.swallow.main", o_flow_main); + e_flowlayout_min_size_get(o_flow_secondary, &mw, &mh); + edje_extern_object_min_size_set(o_flow_secondary, mw, mh); + edje_object_part_swallow(o_bg, "e.swallow.secondary", o_flow_secondary); + e_flowlayout_min_size_get(o_flow_extra, &mw, &mh); + edje_extern_object_min_size_set(o_flow_extra, mw, mh); + edje_object_part_swallow(o_bg, "e.swallow.extra", o_flow_extra); + + edje_object_size_min_calc(o_bg, &mw, &mh); + w = mw; + if (w > zone->w) w = zone->w; + x = (zone->w - w) / 2; + h = mh; + if (h > zone->h) h = zone->h; + y = (zone->h - h) / 2; + + e_popup_move_resize(popup, x, y, w, h); + evas_object_move(o_bg, 0, 0); + evas_object_resize(o_bg, w, h); + evas_object_show(o_bg); + e_popup_edje_bg_object_set(popup, o_bg); + + if (e_config->syscon.do_input) + { + deftimer = ecore_timer_add(e_config->syscon.timeout, _cb_timeout_defaction, NULL); + if (defact) do_defact = eina_stringshare_add(defact); + } + + evas_event_thaw(popup->evas); + inevas = 0; + e_popup_show(popup); + return 1; +} + +EAPI void +e_syscon_hide(void) +{ + if (!popup) return; + + if (deftimer) + { + ecore_timer_del(deftimer); + deftimer = NULL; + } + if (do_defact) eina_stringshare_del(do_defact); + do_defact = NULL; + while (handlers) + { + ecore_event_handler_del(handlers->data); + handlers = eina_list_remove_list(handlers, handlers); + } + e_popup_hide(popup); + e_object_del(E_OBJECT(popup)); + popup = NULL; + e_grabinput_release(input_window, input_window); + ecore_x_window_del(input_window); + input_window = 0; +} + +/* local subsystem functions */ +static int +_cb_key_down(void *data, int type, void *event) +{ + Ecore_X_Event_Key_Down *ev; + + ev = event; + if (ev->event_win != input_window) return 1; + if (!strcmp(ev->keysymbol, "Escape")) + { + e_syscon_hide(); + } + else if (!strcmp(ev->keysymbol, "Up")) + { + // FIXME: implement focus and key control... eventually + } + + return 1; +} + +static int +_cb_mouse_down(void *data, int type, void *event) +{ + Ecore_X_Event_Mouse_Button_Down *ev; + Evas_Button_Flags flags = EVAS_BUTTON_NONE; + + ev = event; + if (ev->event_win != input_window) return 1; + if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK; + if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK; + if ((ev->x < popup->x) || (ev->x >= (popup->x + popup->w)) || + (ev->y < popup->y) || (ev->y >= (popup->y + popup->h))) + { + e_syscon_hide(); + return 1; + } + evas_event_feed_mouse_down(popup->evas, + ev->button, flags, + ev->time, NULL); + return 1; +} + +static int +_cb_mouse_up(void *data, int type, void *event) +{ + Ecore_X_Event_Mouse_Button_Up *ev; + + ev = event; + if (ev->event_win != input_window) return 1; + evas_event_feed_mouse_up(popup->evas, + ev->button, EVAS_BUTTON_NONE, + ev->time, NULL); + return 1; +} + +static int +_cb_mouse_move(void *data, int type, void *event) +{ + Ecore_X_Event_Mouse_Move *ev; + + ev = event; + if (ev->event_win != input_window) return 1; + if (!inevas) + { + evas_event_feed_mouse_in(popup->evas, ev->time, NULL); + inevas = 1; + } + evas_event_feed_mouse_move(popup->evas, + ev->x - popup->x, + ev->y - popup->y, + ev->time, NULL); + return 1; +} + +static int +_cb_mouse_wheel(void *data, int type, void *event) +{ + Ecore_X_Event_Mouse_Wheel *ev; + + ev = event; + if (ev->event_win != input_window) return 1; + evas_event_feed_mouse_wheel(popup->evas, + ev->direction, ev->z, + ev->time, NULL); + return 1; +} + +static void +_cb_signal_close(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + e_syscon_hide(); +} + +static void +_do_action_name(const char *action) +{ + Eina_List *l; + + for (l = e_config->syscon.actions; l; l = l->next) + { + E_Config_Syscon_Action *sca; + E_Action *a; + + sca = l->data; + if (!sca->action) continue; + if (!strcmp(sca->action, action)) + { + a = e_action_find(sca->action); + if (!a) break; + if (a) a->func.go(NULL, sca->params); + break; + } + } +} + +static void +_cb_signal_syscon(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + e_syscon_hide(); + _do_action_name(source); +} + +static void +_cb_signal_action(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + E_Config_Syscon_Action *sca; + E_Action *a; + + e_syscon_hide(); + sca = data; + if (!sca) return; + a = e_action_find(sca->action); + if (!a) return; + if (a) a->func.go(NULL, sca->params); +} + +static int +_cb_timeout_defaction(void *data) +{ + deftimer = NULL; + if (!do_defact) return 0; + e_syscon_hide(); + _do_action_name(do_defact); + return 0; +} diff --git a/src/modules/syscon/e_syscon.h b/src/modules/syscon/e_syscon.h new file mode 100644 index 0000000000..2187b0509f --- /dev/null +++ b/src/modules/syscon/e_syscon.h @@ -0,0 +1,17 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#ifdef E_TYPEDEFS + +#else +#ifndef E_SYSCON_H +#define E_SYSCON_H + +EAPI int e_syscon_init(void); +EAPI int e_syscon_shutdown(void); + +EAPI int e_syscon_show(E_Zone *zone, const char *defact); +EAPI void e_syscon_hide(void); + +#endif +#endif diff --git a/src/modules/syscon/module.desktop.in b/src/modules/syscon/module.desktop.in new file mode 100644 index 0000000000..243e71e63a --- /dev/null +++ b/src/modules/syscon/module.desktop.in @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Link +Name=System Controls +Icon=e-module-syscon +Comment=<title>System Controls Module</title><br>This module provides a unified popup<br>dialog for all the system actions<br>in Enlightenment. +X-Enlightenment-ModuleType=system @@ -1,10 +1,10 @@ #!/bin/sh -Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 & +#Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 & #Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640 & #Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480x16 & #Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480 & -#Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 & +Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 & #Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320 & #Xephyr :1 -noreset -ac -br -dpi 186 -screen 272x480x16 & #Xephyr :1 -noreset -ac -br -dpi 186 -screen 272x480 & |