diff --git a/TODO b/TODO index 36f0c0f91..04d0ba724 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,8 @@ Some of the things (in very short form) that need to be done to E17... BUGS / FIXES ------------------------------------------------------------------------------- +* BUG: pager dnd is broken when shelf below (in desktop canvas) and @ of rows + is > 1. * BUG: ghost windows happen if windows close when on another desktop or if windows are very short-lived * BUG: k3b has minimization issues when burning cds (it tries to unminimize diff --git a/data/themes/default_ibox.edc b/data/themes/default_ibox.edc index d39b4f301..86d46b3b6 100644 --- a/data/themes/default_ibox.edc +++ b/data/themes/default_ibox.edc @@ -1,260 +1,9 @@ images { - image: "e17_ibar_bg_h.png" COMP; - image: "e17_ibar_bg_v.png" COMP; - image: "e17_ibar_lamp_d.png" COMP; - image: "e17_ibar_lamp_l.png" COMP; - image: "e17_ibar_lamp_r.png" COMP; - image: "e17_ibar_lamp_u.png" COMP; - image: "e17_ibar_over_h.png" COMP; - image: "e17_ibar_over_v.png" COMP; -} -group { - name: "modules/ibox/main"; - data { - // item: "item_list", "item item2 item3"; - } - script { - public orient; - } - parts { - part { - name: "background"; - mouse_events: 1; - description { - state: "default" 0.0; - rel1 { - to: "overlay"; - } - rel2 { - to: "overlay"; - } - image { - normal: "e17_ibar_bg_h.png"; - border: 6 6 6 6; - } - fill { - smooth: 0; - } - } - description { - state: "vert" 0.0; - inherit: "default" 0.0; - } - } - part { - name: "items_clip"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "background"; - offset: 4 4; - } - rel2 { - to: "background"; - offset: -5 -5; - } - color: 255 255 255 255; - } - } - part { - name: "items"; - type: SWALLOW; - mouse_events: 0; - clip_to: "items_clip"; - description { - state: "default" 0.0; - rel1 { - offset: 4 4; - } - rel2 { - offset: -5 -5; - } - color: 0 0 0 0; - } - description { - state: "top" 0.0; - inherit: "default" 0.0; - } - description { - state: "left" 0.0; - inherit: "default" 0.0; - } - description { - state: "right" 0.0; - inherit: "default" 0.0; - } - } - part { - name: "overlay"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "e17_ibar_over_h.png"; - border: 13 13 13 13; - middle: 0; - } - fill { - smooth: 0; - } - } - description { - state: "top" 0.0; - inherit: "default" 0.0; - } - description { - state: "left" 0.0; - inherit: "default" 0.0; - } - description { - state: "right" 0.0; - inherit: "default" 0.0; - } - } - part { - name: "inn"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - } - programs { - program { - name: "orient"; - signal: "set_orientation"; - source: "*"; - script { - // sig, src - if (!strcmp(src, "left")) { - set_int(orient, 0); - set_state(PART:"background", "vert", 0.0); - set_state(PART:"overlay", "left", 0.0); - set_state(PART:"items", "left", 0.0); - } - else if (!strcmp(src, "right")) { - set_int(orient, 1); - set_state(PART:"background", "vert", 0.0); - set_state(PART:"overlay", "right", 0.0); - set_state(PART:"items", "right", 0.0); - } - else if (!strcmp(src, "top")) { - set_int(orient, 2); - set_state(PART:"background", "default", 0.0); - set_state(PART:"overlay", "top", 0.0); - set_state(PART:"items", "top", 0.0); - } - else if (!strcmp(src, "bottom")) { - set_int(orient, 3); - set_state(PART:"background", "default", 0.0); - set_state(PART:"overlay", "default", 0.0); - set_state(PART:"items", "default", 0.0); - } - } - } - } -} - -group { - name: "modules/ibox/follower"; - min: 56 56; - data { - // item: "item_list", "item item2 item3"; - } - parts { - part { - name: "top"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 0 -14; - } - rel2 { - relative: 1.0 0.0; - offset: -1 26; - } - image { - normal: "e17_ibar_lamp_d.png"; - } - } - description { - state: "top" 0.0; - rel1 { - relative: 0.0 1.0; - offset: 0 -26; - } - rel2 { - relative: 1.0 1.0; - offset: -1 14; - } - image { - normal: "e17_ibar_lamp_u.png"; - } - } - description { - state: "right" 0.0; - rel1 { - relative: 0.0 0.0; - offset: -14 0; - } - rel2 { - relative: 0.0 1.0; - offset: 26 -1; - } - image { - normal: "e17_ibar_lamp_r.png"; - } - } - description { - state: "left" 0.0; - rel1 { - relative: 1.0 0.0; - offset: -26 0; - } - rel2 { - relative: 1.0 1.0; - offset: 14 -1; - } - image { - normal: "e17_ibar_lamp_l.png"; - } - } - } - program { - name: "orient"; - signal: "set_orientation"; - source: "bottom"; - action: STATE_SET "default" 0.0; - target: "top"; - } - program { - name: "orient2"; - signal: "set_orientation"; - source: "top"; - action: STATE_SET "top" 0.0; - target: "top"; - } - program { - name: "orient3"; - signal: "set_orientation"; - source: "left"; - action: STATE_SET "left" 0.0; - target: "top"; - } - program { - name: "orient4"; - signal: "set_orientation"; - source: "right"; - action: STATE_SET "right" 0.0; - target: "top"; - } - } + image: "e17_ibar_arrow_d.png" COMP; + image: "e17_ibar_arrow_l.png" COMP; + image: "e17_ibar_arrow_r.png" COMP; + image: "e17_ibar_arrow_u.png" COMP; + image: "e17_pager_desk.png" COMP; } group { @@ -264,22 +13,99 @@ group { // item: "item_list" "item item2 item3"; } parts { + part { + name: "item_clip"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "faded" 0.0; + color: 255 255 255 64; + } + } part { name: "item"; type: SWALLOW; mouse_events: 0; + clip_to: "item_clip"; description { state: "default" 0.0; rel1 { relative: 0.0 0.0; - offset: 4 4; + offset: 2 2; } rel2 { relative: 1.0 1.0; - offset: -5 -5; + offset: -3 -3; } color: 0 0 0 0; } + description { + state: "bigger" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -1; + } + } + } + part { + name: "over"; + type: RECT; + repeat_events: 0; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + } + programs { + program { + name: "hover_in"; + signal: "mouse,in"; + source: "over"; + action: STATE_SET "bigger" 0.0; + transition: LINEAR 0.1; + target: "item"; + } + program { + name: "hover_out"; + signal: "mouse,out"; + source: "over"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "item"; + } + program { + name: "exec_start"; + signal: "start"; + source: ""; + action: STATE_SET "faded" 0.0; + transition: LINEAR 0.5; + target: "item_clip"; + } + program { + name: "exec_exec"; + signal: "exec"; + source: ""; + action: STATE_SET "faded" 0.0; + transition: LINEAR 0.5; + target: "item_clip"; + after: "exec_stop"; + } + program { + name: "exec_stop"; + signal: "stop"; + source: ""; + action: STATE_SET "default" 0.0; + target: "item_clip"; } } } @@ -296,14 +122,6 @@ group { mouse_events: 0; description { state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } color: 255 255 255 0; } } @@ -313,42 +131,48 @@ group { mouse_events: 0; description { state: "default" 0.0; + visible: 0; rel1 { - relative: 0.0 0.0; - offset: 0 0; to: "base"; } rel2 { - relative: 1.0 1.0; - offset: -1 -1; to: "base"; } color: 255 255 255 0; } description { state: "visible" 0.0; + visible: 1; rel1 { - relative: 0.0 0.0; - offset: 0 0; to: "base"; } rel2 { - relative: 1.0 1.0; - offset: -1 -1; to: "base"; } color: 255 255 255 255; } description { state: "hidden" 0.0; + visible: 1; rel1 { relative: -0.5 -0.5; - offset: 0 0; to: "base"; } rel2 { relative: 1.5 1.5; - offset: -1 -1; + to: "base"; + } + color: 255 255 255 0; + } + description { + state: "huge" 0.0; + visible: 1; + rel1 { + relative: -2.0 -2.0; + to: "base"; + } + rel2 { + relative: 3.0 3.0; to: "base"; } color: 255 255 255 0; @@ -362,18 +186,56 @@ group { description { state: "default" 0.0; rel1 { - relative: 0.0 0.0; - offset: 0 0; to: "background"; } rel2 { - relative: 1.0 1.0; - offset: -1 -1; to: "background"; } color: 0 0 0 0; } } + part { + name: "label"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { + relative: 0.0 1.0; + offset: 0 -1; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -1; + } + color: 255 255 255 0; + color3: 0 0 0 0; + text { + text: "Icon Name"; + font: "Edje-Vera-Bold"; + size: 10; + min: 1 1; + align: 0.5 0.5; + text_class: "module_normal"; + } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -1; + } + color: 255 255 255 255; + color3: 0 0 0 42; + } + } } programs { program { @@ -384,6 +246,14 @@ group { target: "background"; after: "go_active2"; } + program { + name: "go_activeB"; + signal: "label_active"; + source: ""; + action: STATE_SET "visible" 0.0; + transition: SINUSOIDAL 0.5; + target: "label"; + } program { name: "go_active2"; signal: ""; @@ -402,6 +272,14 @@ group { target: "go_active2"; after: "go_passive2"; } + program { + name: "go_passiveB"; + signal: "label_passive"; + source: ""; + action: STATE_SET "default" 0.0; + transition: SINUSOIDAL 1.0; + target: "label"; + } program { name: "go_passive2"; signal: ""; @@ -409,6 +287,790 @@ group { action: STATE_SET "default" 0.0; target: "background"; } + program { + name: "go_big"; + action: STATE_SET "visible" 0.0; + target: "background"; + after: "go_big2"; + } + program { + name: "go_big2"; + action: STATE_SET "huge" 0.0; + transition: LINEAR 0.5; + target: "background"; + } + program { + name: "exec_start"; + signal: "start"; + source: ""; + action: ACTION_STOP; + target: "go_active"; + target: "go_active2"; + target: "go_passive"; + target: "go_passive2"; + target: "go_big"; + target: "go_big2"; + after: "go_big"; + } + program { + name: "exec_exec"; + signal: "exec"; + source: ""; + after: "exec_start"; + } + program { + name: "exec_stop"; + signal: "stop"; + source: ""; +// action: SIGNAL_EMIT "active" 0.0; + } + } +} + +group { + name: "modules/ibox/drop"; + parts { + part { + name: "bg"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "e17_pager_desk.png"; + border: 2 2 2 2; + middle: 0; + } + } + } + } +} + +group { + name: "modules/ibox/drop_overlay"; + parts { + part { + name: "l1"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 1.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -1 0; + } + rel2 { + relative: 0.0 1.0; + offset: -1 -1; + } + image { + normal: "e17_ibar_arrow_r.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "l2"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 1.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -1 0; + to: "l1"; + } + rel2 { + relative: 0.0 1.0; + offset: -1 -1; + to: "l1"; + } + image { + normal: "e17_ibar_arrow_r.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "l3"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 1.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -1 0; + to: "l2"; + } + rel2 { + relative: 0.0 1.0; + offset: -1 -1; + to: "l2"; + } + image { + normal: "e17_ibar_arrow_r.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "l4"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 1.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -1 0; + to: "l3"; + } + rel2 { + relative: 0.0 1.0; + offset: -1 -1; + to: "l3"; + } + image { + normal: "e17_ibar_arrow_r.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "r1"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 1.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + offset: 0 -1; + } + image { + normal: "e17_ibar_arrow_l.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "r2"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 1.0 0.0; + offset: 0 0; + to: "r1"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 -1; + to: "r1"; + } + image { + normal: "e17_ibar_arrow_l.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "r3"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 1.0 0.0; + offset: 0 0; + to: "r2"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 -1; + to: "r2"; + } + image { + normal: "e17_ibar_arrow_l.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "r4"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.5; + min: 21 20; + max: 21 20; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 1.0 0.0; + offset: 0 0; + to: "r3"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 -1; + to: "r3"; + } + image { + normal: "e17_ibar_arrow_l.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "t1"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 1.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: 0 -1; + } + rel2 { + relative: 1.0 0.0; + offset: -1 -1; + } + image { + normal: "e17_ibar_arrow_d.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "t2"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 1.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: 0 -1; + to: "t1"; + } + rel2 { + relative: 1.0 0.0; + offset: -1 -1; + to: "t1"; + } + image { + normal: "e17_ibar_arrow_d.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "t3"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 1.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: 0 -1; + to: "t2"; + } + rel2 { + relative: 1.0 0.0; + offset: -1 -1; + to: "t2"; + } + image { + normal: "e17_ibar_arrow_d.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "t4"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 1.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: 0 -1; + to: "t3"; + } + rel2 { + relative: 1.0 0.0; + offset: -1 -1; + to: "t3"; + } + image { + normal: "e17_ibar_arrow_d.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "b1"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 0.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "e17_ibar_arrow_u.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "b2"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 0.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 1.0; + offset: 0 0; + to: "b1"; + } + rel2 { + relative: 1.0 1.0; + offset: -1 0; + to: "b1"; + } + image { + normal: "e17_ibar_arrow_u.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "b3"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 0.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 1.0; + offset: 0 0; + to: "b2"; + } + rel2 { + relative: 1.0 1.0; + offset: -1 0; + to: "b2"; + } + image { + normal: "e17_ibar_arrow_u.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "b4"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 0.0; + min: 29 21; + max: 29 21; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 1.0; + offset: 0 0; + to: "b3"; + } + rel2 { + relative: 1.0 1.0; + offset: -1 0; + to: "b3"; + } + image { + normal: "e17_ibar_arrow_u.png"; + } + } + description { + state: "default2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + } + programs { + program { + name: "go"; + signal: "show"; + source: ""; + after: "l1a"; + after: "r1a"; + after: "t1a"; + after: "b1a"; + } + program { + name: "l1a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "l4"; + after: "l1b"; + after: "l2a"; + } + program { + name: "l1b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "l4"; + } + program { + name: "l2a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "l3"; + after: "l2b"; + after: "l3a"; + } + program { + name: "l2b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "l3"; + } + program { + name: "l3a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "l2"; + after: "l3b"; + after: "l4a"; + } + program { + name: "l3b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "l2"; + } + program { + name: "l4a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "l1"; + after: "l4b"; + after: "l1a"; + } + program { + name: "l4b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "l1"; + } + program { + name: "r1a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "r4"; + after: "r1b"; + after: "r2a"; + } + program { + name: "r1b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "r4"; + } + program { + name: "r2a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "r3"; + after: "r2b"; + after: "r3a"; + } + program { + name: "r2b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "r3"; + } + program { + name: "r3a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "r2"; + after: "r3b"; + after: "r4a"; + } + program { + name: "r3b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "r2"; + } + program { + name: "r4a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "r1"; + after: "r4b"; + after: "r1a"; + } + program { + name: "r4b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "r1"; + } + program { + name: "t1a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "t4"; + after: "t1b"; + after: "t2a"; + } + program { + name: "t1b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "t4"; + } + program { + name: "t2a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "t3"; + after: "t2b"; + after: "t3a"; + } + program { + name: "t2b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "t3"; + } + program { + name: "t3a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "t2"; + after: "t3b"; + after: "t4a"; + } + program { + name: "t3b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "t2"; + } + program { + name: "t4a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "t1"; + after: "t4b"; + after: "t1a"; + } + program { + name: "t4b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "t1"; + } + program { + name: "b1a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "b4"; + after: "b1b"; + after: "b2a"; + } + program { + name: "b1b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "b4"; + } + program { + name: "b2a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "b3"; + after: "b2b"; + after: "b3a"; + } + program { + name: "b2b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "b3"; + } + program { + name: "b3a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "b2"; + after: "b3b"; + after: "b4a"; + } + program { + name: "b3b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "b2"; + } + program { + name: "b4a"; + action: STATE_SET "default2" 0.0; + transition: SINUSOIDAL 0.25; + target: "b1"; + after: "b4b"; + after: "b1a"; + } + program { + name: "b4b"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.75; + target: "b1"; + } } } diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 86959d3e1..ca410e507 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -649,7 +649,7 @@ e_config_init(void) CFG_MODULE("start", 1); CFG_MODULE("ibar", 1); - CFG_MODULE("ibox", 0); + CFG_MODULE("ibox", 1); CFG_MODULE("dropshadow", 1); CFG_MODULE("clock", 1); CFG_MODULE("battery", 1); @@ -1094,31 +1094,33 @@ e_config_init(void) CFG_GADCON_CLIENT("ibar", "default", 800, 200, 400 - (16 / 2), "inset", 1, 0); CFG_GADCON_CLIENT("temperature", "default", 800, 32, - 800 - (4 * 32), NULL, 0, 0); + 800 - (5 * 32), NULL, 0, 0); CFG_GADCON_CLIENT("cpufreq", "default", 800, 32, - 800 - (3 * 32), NULL, 0, 0); + 800 - (4 * 32), NULL, 0, 0); CFG_GADCON_CLIENT("battery", "default", 800, 32, - 800 - (2 * 32), NULL, 0, 0); + 800 - (3 * 32), NULL, 0, 0); CFG_GADCON_CLIENT("clock", "default", 800, 32, - 800 - (1 * 32), NULL, 0, 0); + 800 - (2 * 32), NULL, 0, 0); + CFG_GADCON_CLIENT("ibox", "default", 800, 200, + 400 - (1 * 32), "inset", 1, 0); /* additional shelves for up to 3 more heads by default */ CFG_GADCON("shelf", "1"); CFG_GADCON_CLIENT("pager", "default2", 800, 120, 0, "inset", 0, 0); - CFG_GADCON_CLIENT("ibar", "default2", 800, 200, - 400 - (16 / 2), "inset", 1, 0); + CFG_GADCON_CLIENT("ibox", "default", 800, 200, + 400 - (1 * 32), "inset", 1, 0); CFG_GADCON("shelf", "2"); CFG_GADCON_CLIENT("pager", "default3", 800, 120, 0, "inset", 0, 0); - CFG_GADCON_CLIENT("ibar", "default2", 800, 200, - 400 - (16 / 2), "inset", 1, 0); + CFG_GADCON_CLIENT("ibox", "default", 800, 200, + 400 - (1 * 32), "inset", 1, 0); CFG_GADCON("shelf", "3"); CFG_GADCON_CLIENT("pager", "default4", 800, 120, 0, "inset", 0, 0); - CFG_GADCON_CLIENT("ibar", "default2", 800, 200, - 400 - (16 / 2), "inset", 1, 0); + CFG_GADCON_CLIENT("ibox", "default", 800, 200, + 400 - (1 * 32), "inset", 1, 0); } IFCFGEND; diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index f182e3340..685fc1f0a 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -89,6 +89,7 @@ static IBar_Icon *_ibar_icon_new(IBar *b, E_App *a); static void _ibar_icon_free(IBar_Icon *ic); static void _ibar_icon_fill(IBar_Icon *ic); static void _ibar_icon_empty(IBar_Icon *ic); +static void _ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char *src); static void _ibar_cb_app_change(void *data, E_App *a, E_App_Change ch); static int _ibar_cb_timer_drop_recalc(void *data); static void _ibar_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -599,18 +600,23 @@ _ibar_icon_fill(IBar_Icon *ic) static void _ibar_icon_empty(IBar_Icon *ic) { - evas_object_del(ic->o_icon); - evas_object_del(ic->o_icon2); + if (ic->o_icon) evas_object_del(ic->o_icon); + if (ic->o_icon2) evas_object_del(ic->o_icon2); ic->o_icon = NULL; + ic->o_icon2 = NULL; } static void _ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char *src) { - edje_object_signal_emit(ic->o_holder, sig, src); - edje_object_signal_emit(ic->o_icon, sig, src); - edje_object_signal_emit(ic->o_holder2, sig, src); - edje_object_signal_emit(ic->o_icon2, sig, src); + if (ic->o_holder) + edje_object_signal_emit(ic->o_holder, sig, src); + if (ic->o_icon) + edje_object_signal_emit(ic->o_icon, sig, src); + if (ic->o_holder2) + edje_object_signal_emit(ic->o_holder2, sig, src); + if (ic->o_icon2) + edje_object_signal_emit(ic->o_icon2, sig, src); } static void @@ -1220,6 +1226,7 @@ _ibar_inst_cb_drop(void *data, const char *type, void *event_info) inst->ibar->o_drop = NULL; evas_object_del(inst->ibar->o_drop_over); inst->ibar->o_drop_over = NULL; + _ibar_empty_handle(inst->ibar); _ibar_resize_handle(inst->ibar); _gc_orient(inst->gcc); } diff --git a/src/modules/ibox/Makefile.am b/src/modules/ibox/Makefile.am index 16f7aa25e..1552b5450 100644 --- a/src/modules/ibox/Makefile.am +++ b/src/modules/ibox/Makefile.am @@ -4,6 +4,7 @@ MODULE = ibox # data files for the module filesdir = $(libdir)/enlightenment/modules/$(MODULE) files_DATA = \ +module.eap \ module_icon.png EXTRA_DIST = $(files_DATA) @@ -19,9 +20,7 @@ INCLUDES = -I. \ 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 \ - e_mod_config.h + e_mod_main.h module_la_LIBADD = @e_libs@ @dlopen_libs@ module_la_LDFLAGS = -module -avoid-version module_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/src/modules/ibox/e_mod_config.c b/src/modules/ibox/e_mod_config.c deleted file mode 100644 index f2a941c83..000000000 --- a/src/modules/ibox/e_mod_config.c +++ /dev/null @@ -1,175 +0,0 @@ -#include "e.h" -#include "e_mod_main.h" -#include "e_mod_config.h" -#include "config.h" - -struct _E_Config_Dialog_Data -{ - int autofit; - int follower; - int iconsize; - double follow_speed; - double autoscroll_speed; -}; - -/* 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); -static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); -static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); - -void -_config_ibox_module(E_Container *con, IBox *ibox) -{ - E_Config_Dialog *cfd; - E_Config_Dialog_View *v; - - v = E_NEW(E_Config_Dialog_View, 1); - - /* Dialog Methods */ - v->create_cfdata = _create_data; - v->free_cfdata = _free_data; - v->basic.apply_cfdata = _basic_apply_data; - v->basic.create_widgets = _basic_create_widgets; - v->advanced.apply_cfdata = _advanced_apply_data; - v->advanced.create_widgets = _advanced_create_widgets; - - /* Create The Dialog */ - cfd = e_config_dialog_new(con, _("IBox Configuration"), NULL, 0, v, ibox); - ibox->config_dialog = cfd; -} - -static void -_fill_data(IBox *ib, E_Config_Dialog_Data *cfdata) -{ - cfdata->autofit = (ib->conf->width == IBOX_WIDTH_AUTO); - cfdata->follower = ib->conf->follower; - cfdata->iconsize = ib->conf->iconsize; - cfdata->follow_speed = ib->conf->follow_speed; - cfdata->autoscroll_speed = ib->conf->autoscroll_speed; -} - -static void * -_create_data(E_Config_Dialog *cfd) -{ - E_Config_Dialog_Data *cfdata; - IBox *ib; - - ib = cfd->data; - cfdata = E_NEW(E_Config_Dialog_Data, 1); - _fill_data(ib, cfdata); - return cfdata; -} - -static void -_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) -{ - IBox *ib; - - ib = cfd->data; - ib->config_dialog = NULL; - free(cfdata); -} - -static Evas_Object * -_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) -{ - Evas_Object *o, *ob; - - o = e_widget_list_add(evas, 0, 0); - ob = e_widget_check_add(evas, _("Show Follower"), &(cfdata->follower)); - e_widget_list_object_append(o, ob, 1, 1, 0.5); - ob = e_widget_check_add(evas, _("Auto Fit Icons"), &(cfdata->autofit)); - e_widget_list_object_append(o, ob, 1, 1, 0.5); - return o; -} - -static int -_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) -{ - IBox *ib; - - ib = cfd->data; - e_border_button_bindings_ungrab_all(); - if ((cfdata->follower) && (!ib->conf->follower)) - ib->conf->follower = 1; - else if (!(cfdata->follower) && (ib->conf->follower)) - ib->conf->follower = 0; - - if ((cfdata->autofit) && (ib->conf->width == IBOX_WIDTH_FIXED)) - ib->conf->width = IBOX_WIDTH_AUTO; - else if (!(cfdata->autofit) && (ib->conf->width == IBOX_WIDTH_AUTO)) - ib->conf->width = IBOX_WIDTH_FIXED; - - e_border_button_bindings_grab_all(); - e_config_save_queue(); - - _ibox_box_cb_config_updated(ib); - return 1; -} - -static Evas_Object * -_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) -{ - Evas_Object *o, *of, *ob; - - o = e_widget_list_add(evas, 0, 0); - - of = e_widget_framelist_add(evas, _("Follower"), 0); - ob = e_widget_check_add(evas, _("Visible"), &(cfdata->follower)); - e_widget_framelist_object_append(of, ob); - ob = e_widget_label_add(evas, _("Follow Speed")); - e_widget_framelist_object_append(of, ob); - ob = e_widget_slider_add(evas, 1, 0, _("%1.2f px/s"), 0.0, 1.0, 0.01, 0, &(cfdata->follow_speed), NULL,200); - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); - - of = e_widget_framelist_add(evas, _("Icon Size"), 0); - ob = e_widget_slider_add(evas, 1, 0, _("%3.0f pixels"), 8.0, 128.0, 1.0, 0, NULL, &(cfdata->iconsize), 200); - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); - - of = e_widget_framelist_add(evas, _("Width"), 0); - ob = e_widget_check_add(evas, _("Auto Fit"), &(cfdata->autofit)); - e_widget_framelist_object_append(of, ob); - ob = e_widget_label_add(evas, _("Autoscroll Speed:")); - e_widget_framelist_object_append(of, ob); - ob = e_widget_slider_add(evas, 1, 0, _("%1.2f px/s"), 0.0, 1.0, 0.01, 0, &(cfdata->autoscroll_speed), NULL,200); - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); - - return o; -} - -static int -_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) -{ - IBox *ib; - - ib = cfd->data; - e_border_button_bindings_ungrab_all(); - if ((cfdata->follower) && (!ib->conf->follower)) - ib->conf->follower = 1; - else if (!(cfdata->follower) && (ib->conf->follower)) - ib->conf->follower = 0; - - if ((cfdata->autofit) && (ib->conf->width == IBOX_WIDTH_FIXED)) - ib->conf->width = IBOX_WIDTH_AUTO; - else if (!(cfdata->autofit) && (ib->conf->width == IBOX_WIDTH_AUTO)) - ib->conf->width = IBOX_WIDTH_FIXED; - - if (cfdata->iconsize != ib->conf->iconsize) - ib->conf->iconsize = cfdata->iconsize; - if (cfdata->follow_speed != ib->conf->follow_speed) - ib->conf->follow_speed = cfdata->follow_speed; - if (cfdata->autoscroll_speed != ib->conf->autoscroll_speed) - ib->conf->autoscroll_speed = cfdata->autoscroll_speed; - - e_border_button_bindings_grab_all(); - e_config_save_queue(); - - _ibox_box_cb_config_updated(ib); - return 1; -} diff --git a/src/modules/ibox/e_mod_config.h b/src/modules/ibox/e_mod_config.h deleted file mode 100644 index 388c5c863..000000000 --- a/src/modules/ibox/e_mod_config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef E_TYPEDEFS -#else -#ifndef E_MOD_CONFIG_H -#define E_MOD_CONFIG_H -#include "e_mod_main.h" -void _config_ibox_module(E_Container *con, IBox *ibox); -#endif -#endif diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c index de6562e20..e9ce8f895 100644 --- a/src/modules/ibox/e_mod_main.c +++ b/src/modules/ibox/e_mod_main.c @@ -3,87 +3,1072 @@ */ #include "e.h" #include "e_mod_main.h" -#include "e_mod_config.h" -#include -/* TODO List: - * - * * Create separate config for each box - * * Fix menu - * - * * icon labels & label tooltips supported for the name of the app - * * use part list to know how many icons & where to put in the overlay of an icon - * * description bubbles/tooltips for icons - * * support dynamic iconsize change on the fly - * * app subdirs - need to somehow handle these... - * * use overlay object and repeat events for doing auto hide/show - * * emit signals on hide/show due to autohide/show - * * virtualise autoshow/hide to later allow for key bindings, mouse events elsewhere, ipc and other singals to show/hide - * - * BONUS Features (maybe do this later): - * - * * allow ibox icons to be dragged around to re-order/delete - * - */ +/***************************************************************************/ +/**/ +/* gadcon requirements */ +static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style); +static void _gc_shutdown(E_Gadcon_Client *gcc); +static void _gc_orient(E_Gadcon_Client *gcc); +static char *_gc_label(void); +static Evas_Object *_gc_icon(Evas *evas); +/* and actually define the gadcon class that this module provides (just 1) */ +static const E_Gadcon_Client_Class _gadcon_class = +{ + GADCON_CLIENT_CLASS_VERSION, + "ibox", + { + _gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon + } +}; +/**/ +/***************************************************************************/ -static int box_count; -static E_Config_DD *conf_edd; -static E_Config_DD *conf_box_edd; +/***************************************************************************/ +/**/ +/* actual module specifics */ -/* const strings */ -static const char *_ibox_main_orientation[] = -{"left", "right", "top", "bottom"}; +typedef struct _Instance Instance; -/* module private routines */ -static IBox *_ibox_new(); -static void _ibox_free(IBox *ib); -static void _ibox_config_menu_new(IBox *ib); +typedef struct _IBox IBox; +typedef struct _IBox_Icon IBox_Icon; -static IBox_Box *_ibox_box_new(IBox *ib, E_Container *con); -static void _ibox_box_free(IBox_Box *ibb); -static void _ibox_box_menu_new(IBox_Box *ibb); -static void _ibox_box_disable(IBox_Box *ibb); -static void _ibox_box_frame_resize(IBox_Box *ibb); -static void _ibox_box_edge_change(IBox_Box *ibb, int edge); -static void _ibox_box_update_policy(IBox_Box *ibb); -static void _ibox_box_motion_handle(IBox_Box *ibb, Evas_Coord mx, Evas_Coord my); -static void _ibox_box_timer_handle(IBox_Box *ibb); -static void _ibox_box_follower_reset(IBox_Box *ibb); +struct _Instance +{ + E_Gadcon_Client *gcc; + Evas_Object *o_ibox; + IBox *ibox; + E_Drop_Handler *drop_handler; + Ecore_Timer *drop_recalc_timer; +}; -static IBox_Icon *_ibox_icon_new(IBox_Box *ibb, E_Border *bd); -static void _ibox_icon_free(IBox_Icon *ic); -static IBox_Icon *_ibox_icon_find(IBox_Box *ibb, E_Border *bd); +struct _IBox +{ + Instance *inst; + Evas_Object *o_box; + Evas_Object *o_drop; + Evas_Object *o_drop_over; + Evas_Object *o_empty; + IBox_Icon *ic_drop_before; + int drop_before; + Evas_List *icons; + int show_label; + E_Zone *zone; +}; -static void _ibox_box_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change); -static void _ibox_box_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); -static void _ibox_box_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); -static void _ibox_box_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_box_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_box_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_box_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_box_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); -static int _ibox_box_cb_timer(void *data); -static int _ibox_box_cb_animator(void *data); +struct _IBox_Icon +{ + IBox *ibox; + Evas_Object *o_holder; + Evas_Object *o_icon; + Evas_Object *o_holder2; + Evas_Object *o_icon2; + E_Border *border; + struct { + unsigned char start : 1; + unsigned char dnd : 1; + int x, y; + int dx, dy; + } drag; +}; -static int _ibox_box_cb_event_border_iconify(void *data, int type, void *event); -static int _ibox_box_cb_event_border_uniconify(void *data, int type, void *event); -static int _ibox_box_cb_event_border_remove(void *data, int type, void *event); +static IBox *_ibox_new(Evas *evas, E_Zone *zone); +static void _ibox_free(IBox *b); +static void _ibox_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_empty_handle(IBox *b); +static void _ibox_fill(IBox *b); +static void _ibox_empty(IBox *b); +static void _ibox_orient_set(IBox *b, int horizontal); +static void _ibox_resize_handle(IBox *b); +static void _ibox_instance_drop_zone_recalc(Instance *inst); +static IBox_Icon *_ibox_icon_find(IBox *b, E_Border *bd); +static IBox_Icon *_ibox_icon_at_coord(IBox *b, Evas_Coord x, Evas_Coord y); +static IBox_Icon *_ibox_icon_new(IBox *b, E_Border *bd); +static void _ibox_icon_free(IBox_Icon *ic); +static void _ibox_icon_fill(IBox_Icon *ic); +static void _ibox_icon_empty(IBox_Icon *ic); +static void _ibox_icon_signal_emit(IBox_Icon *ic, char *sig, char *src); +static IBox *_ibox_zone_find(E_Zone *zone); +static int _ibox_cb_timer_drop_recalc(void *data); +static void _ibox_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_menu_post(void *data, E_Menu *m); +static void _ibox_cb_icon_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_icon_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_icon_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_icon_resize(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibox_cb_drag_finished(E_Drag *drag, int dropped); +static void _ibox_inst_cb_enter(void *data, const char *type, void *event_info); +static void _ibox_inst_cb_move(void *data, const char *type, void *event_info); +static void _ibox_inst_cb_leave(void *data, const char *type, void *event_info); +static void _ibox_inst_cb_drop(void *data, const char *type, void *event_info); +static int _ibox_cb_event_border_add(void *data, int type, void *event); +static int _ibox_cb_event_border_remove(void *data, int type, void *event); +static int _ibox_cb_event_border_iconify(void *data, int type, void *event); +static int _ibox_cb_event_border_uniconify(void *data, int type, void *event); +static int _ibox_cb_event_border_icon_change(void *data, int type, void *event); +static int _ibox_cb_event_border_zone_set(void *data, int type, void *event); -static void _ibox_icon_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); -static void _ibox_icon_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); -static void _ibox_icon_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_icon_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_icon_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_box_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi); -static void _ibox_box_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi); +Config *ibox_config = NULL; -/* Config Updated Function Protos */ -static void _ibox_box_cb_width_auto(void *data); -static void _ibox_box_cb_follower(void *data); -static void _ibox_box_cb_iconsize_change(void *data); +static E_Gadcon_Client * +_gc_init(E_Gadcon *gc, char *name, char *id, char *style) +{ + IBox *b; + Evas_Object *o; + E_Gadcon_Client *gcc; + Instance *inst; + Evas_Coord x, y, w, h; + int cx, cy, cw, ch; + const char *drop[] = { "enlightenment/border" }; + Evas_List *l; + + inst = E_NEW(Instance, 1); -/* public module routines. all modules must have these */ + b = _ibox_new(gc->evas, gc->zone); + b->show_label = 1; + b->inst = inst; + inst->ibox = b; + o = b->o_box; + gcc = e_gadcon_client_new(gc, name, id, style, o); + gcc->data = inst; + + inst->gcc = gcc; + inst->o_ibox = o; + + e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch); + evas_object_geometry_get(o, &x, &y, &w, &h); + inst->drop_handler = + e_drop_handler_add(inst, + _ibox_inst_cb_enter, _ibox_inst_cb_move, + _ibox_inst_cb_leave, _ibox_inst_cb_drop, + drop, 1, cx + x, cy + y, w, h); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, + _ibox_cb_obj_moveresize, inst); + evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, + _ibox_cb_obj_moveresize, inst); + ibox_config->instances = evas_list_append(ibox_config->instances, inst); + /* FIXME: HACK!!!! */ + inst->drop_recalc_timer = ecore_timer_add(1.0, _ibox_cb_timer_drop_recalc, + inst); + return gcc; +} + +static void +_gc_shutdown(E_Gadcon_Client *gcc) +{ + Instance *inst; + + inst = gcc->data; + ecore_timer_del(inst->drop_recalc_timer); + ibox_config->instances = evas_list_remove(ibox_config->instances, inst); + e_drop_handler_del(inst->drop_handler); + _ibox_free(inst->ibox); + free(inst); +} + +static void +_gc_orient(E_Gadcon_Client *gcc) +{ + Instance *inst; + + inst = gcc->data; + switch (gcc->gadcon->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: + _ibox_orient_set(inst->ibox, 1); + e_gadcon_client_aspect_set(gcc, evas_list_count(inst->ibox->icons) * 16, 16); + 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: + _ibox_orient_set(inst->ibox, 0); + e_gadcon_client_aspect_set(gcc, 16, evas_list_count(inst->ibox->icons) * 16); + break; + default: + break; + } + if (evas_list_count(inst->ibox->icons) < 1) + e_gadcon_client_aspect_set(gcc, 16, 16); + e_gadcon_client_min_size_set(gcc, 16, 16); +} + +static char * +_gc_label(void) +{ + return _("IBox"); +} + +static Evas_Object * +_gc_icon(Evas *evas) +{ + Evas_Object *o; + char buf[4096]; + + o = edje_object_add(evas); + snprintf(buf, sizeof(buf), "%s/module.eap", + e_module_dir_get(ibox_config->module)); + edje_object_file_set(o, buf, "icon"); + return o; +} +/**/ +/***************************************************************************/ + +/***************************************************************************/ +/**/ + +static IBox * +_ibox_new(Evas *evas, E_Zone *zone) +{ + IBox *b; + char buf[4096]; + + b = E_NEW(IBox, 1); + b->o_box = e_box_add(evas); + e_box_homogenous_set(b->o_box, 1); + e_box_orientation_set(b->o_box, 1); + e_box_align_set(b->o_box, 0.5, 0.5); + b->zone = zone; + _ibox_fill(b); + return b; +} + +static void +_ibox_free(IBox *b) +{ + _ibox_empty(b); + evas_object_del(b->o_box); + if (b->o_drop) evas_object_del(b->o_drop); + if (b->o_drop_over) evas_object_del(b->o_drop_over); + if (b->o_empty) evas_object_del(b->o_empty); + free(b); +} + +static void +_ibox_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev; + IBox *b; + + ev = event_info; + b = data; + if (!ibox_config->menu) + { + E_Menu *mn; + E_Menu_Item *mi; + int cx, cy, cw, ch; + + mn = e_menu_new(); + e_menu_post_deactivate_callback_set(mn, _ibox_cb_menu_post, NULL); + ibox_config->menu = mn; + + e_gadcon_client_util_menu_items_append(b->inst->gcc, mn, 0); + + e_gadcon_canvas_zone_geometry_get(b->inst->gcc->gadcon, + &cx, &cy, &cw, &ch); + e_menu_activate_mouse(mn, + 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(b->inst->gcc->gadcon->evas, ev->button, + EVAS_BUTTON_NONE, ev->timestamp, NULL); + } +} + +static void +_ibox_empty_handle(IBox *b) +{ + if (!b->icons) + { + if (!b->o_empty) + { + Evas_Coord w, h; + + b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box)); + evas_object_event_callback_add(b->o_empty, EVAS_CALLBACK_MOUSE_DOWN, _ibox_cb_empty_mouse_down, b); + evas_object_color_set(b->o_empty, 0, 0, 0, 0); + evas_object_show(b->o_empty); + e_box_pack_end(b->o_box, b->o_empty); + evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h); + if (e_box_orientation_get(b->o_box)) + w = h; + else + h = w; + e_box_pack_options_set(b->o_empty, + 1, 1, /* fill */ + 1, 1, /* expand */ + 0.5, 0.5, /* align */ + w, h, /* min */ + w, h /* max */ + ); + } + } + else if (b->o_empty) + { + evas_object_del(b->o_empty); + b->o_empty = NULL; + } +} + +static void +_ibox_fill(IBox *b) +{ + IBox_Icon *ic; + E_Border_List *bl; + E_Border *bd; + + bl = e_container_border_list_first(b->zone->container); + while ((bd = e_container_border_list_next(bl))) + { + if ((bd->zone == b->zone) && (bd->iconic)) + { + ic = _ibox_icon_new(b, bd); + b->icons = evas_list_append(b->icons, ic); + e_box_pack_end(b->o_box, ic->o_holder); + } + } + + _ibox_empty_handle(b); + _ibox_resize_handle(b); +} + +static void +_ibox_empty(IBox *b) +{ + while (b->icons) + { + _ibox_icon_free(b->icons->data); + b->icons = evas_list_remove_list(b->icons, b->icons); + } + _ibox_empty_handle(b); +} + +static void +_ibox_orient_set(IBox *b, int horizontal) +{ + e_box_orientation_set(b->o_box, horizontal); + e_box_align_set(b->o_box, 0.5, 0.5); +} + +static void +_ibox_resize_handle(IBox *b) +{ + Evas_List *l; + IBox_Icon *ic; + Evas_Coord w, h; + + evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h); + if (e_box_orientation_get(b->o_box)) + w = h; + else + h = w; + e_box_freeze(b->o_box); + for (l = b->icons; l; l = l->next) + { + ic = l->data; + e_box_pack_options_set(ic->o_holder, + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + w, h, /* min */ + w, h /* max */ + ); + } + e_box_thaw(b->o_box); +} + +static void +_ibox_instance_drop_zone_recalc(Instance *inst) +{ + Evas_Coord x, y, w, h; + int cx, cy, cw, ch; + + evas_object_geometry_get(inst->o_ibox, &x, &y, &w, &h); + e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch); + e_drop_handler_geometry_set(inst->drop_handler, cx + x, cy + y, w, h); +} + +static IBox_Icon * +_ibox_icon_find(IBox *b, E_Border *bd) +{ + Evas_List *l; + IBox_Icon *ic; + + for (l = b->icons; l; l = l->next) + { + ic = l->data; + + if (ic->border == bd) return ic; + } + return NULL; +} + +static IBox_Icon * +_ibox_icon_at_coord(IBox *b, Evas_Coord x, Evas_Coord y) +{ + Evas_List *l; + IBox_Icon *ic; + + for (l = b->icons; l; l = l->next) + { + Evas_Coord dx, dy, dw, dh; + ic = l->data; + + evas_object_geometry_get(ic->o_holder, &dx, &dy, &dw, &dh); + if (E_INSIDE(x, y, dx, dy, dw, dh)) return ic; + } + return NULL; +} + +static IBox_Icon * +_ibox_icon_new(IBox *b, E_Border *bd) +{ + IBox_Icon *ic; + + ic = E_NEW(IBox_Icon, 1); + e_object_ref(E_OBJECT(bd)); + ic->ibox = b; + ic->border = bd; + ic->o_holder = edje_object_add(evas_object_evas_get(b->o_box)); + e_theme_edje_object_set(ic->o_holder, "base/theme/modules/ibox", + "modules/ibox/icon"); + evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_IN, _ibox_cb_icon_mouse_in, ic); + evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_OUT, _ibox_cb_icon_mouse_out, ic); + evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_DOWN, _ibox_cb_icon_mouse_down, ic); + evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_UP, _ibox_cb_icon_mouse_up, ic); + evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_MOVE, _ibox_cb_icon_mouse_move, ic); + evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOVE, _ibox_cb_icon_move, ic); + evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_RESIZE, _ibox_cb_icon_resize, ic); + evas_object_show(ic->o_holder); + + ic->o_holder2 = edje_object_add(evas_object_evas_get(b->o_box)); + e_theme_edje_object_set(ic->o_holder2, "base/theme/modules/ibox", + "modules/ibox/icon_overlay"); + evas_object_layer_set(ic->o_holder2, 9999); + evas_object_pass_events_set(ic->o_holder2, 1); + evas_object_show(ic->o_holder2); + + _ibox_icon_fill(ic); + return ic; +} + +static void +_ibox_icon_free(IBox_Icon *ic) +{ + Evas_Object *o; + + if (ibox_config->menu) + { + e_menu_post_deactivate_callback_set(ibox_config->menu, NULL, NULL); + e_object_del(E_OBJECT(ibox_config->menu)); + ibox_config->menu = NULL; + } + if (ic->ibox->ic_drop_before == ic) + ic->ibox->ic_drop_before = NULL; + _ibox_icon_empty(ic); + evas_object_del(ic->o_holder); + evas_object_del(ic->o_holder2); + e_object_unref(E_OBJECT(ic->border)); + free(ic); +} + +static void +_ibox_icon_fill(IBox_Icon *ic) +{ + char *label; + + ic->o_icon = e_border_icon_add(ic->border, evas_object_evas_get(ic->ibox->o_box)); + edje_object_part_swallow(ic->o_holder, "item", ic->o_icon); + evas_object_pass_events_set(ic->o_icon, 1); + evas_object_show(ic->o_icon); + ic->o_icon2 = e_border_icon_add(ic->border, evas_object_evas_get(ic->ibox->o_box)); + edje_object_part_swallow(ic->o_holder2, "item", ic->o_icon2); + evas_object_pass_events_set(ic->o_icon2, 1); + evas_object_show(ic->o_icon2); + + /* FIXME: preferences for icon name */ + label = ic->border->client.netwm.icon_name; + if (!label) label = ic->border->client.icccm.icon_name; + if (!label) label = ic->border->client.icccm.class; + if (!label) label = ic->border->client.netwm.name; + if (!label) label = ic->border->client.icccm.title; + if (!label) label = "?"; + edje_object_part_text_set(ic->o_holder, "label", label); + edje_object_part_text_set(ic->o_holder2, "label", label); +} + +static void +_ibox_icon_empty(IBox_Icon *ic) +{ + if (ic->o_icon) evas_object_del(ic->o_icon); + if (ic->o_icon2) evas_object_del(ic->o_icon2); + ic->o_icon = NULL; + ic->o_icon2 = NULL; +} + +static void +_ibox_icon_signal_emit(IBox_Icon *ic, char *sig, char *src) +{ + if (ic->o_holder) + edje_object_signal_emit(ic->o_holder, sig, src); + if (ic->o_icon) + edje_object_signal_emit(ic->o_icon, sig, src); + if (ic->o_holder2) + edje_object_signal_emit(ic->o_holder2, sig, src); + if (ic->o_icon2) + edje_object_signal_emit(ic->o_icon2, sig, src); +} + +static IBox * +_ibox_zone_find(E_Zone *zone) +{ + Evas_List *l; + + for (l = ibox_config->instances; l; l = l->next) + { + Instance *inst; + + inst = l->data; + if (inst->ibox->zone == zone) return inst->ibox; + } + return NULL; +} + +static int +_ibox_cb_timer_drop_recalc(void *data) +{ + Instance *inst; + + inst = data; + _ibox_instance_drop_zone_recalc(inst); + return 1; +} + +static void +_ibox_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Instance *inst; + + inst = data; + _ibox_resize_handle(inst->ibox); + _ibox_instance_drop_zone_recalc(inst); +} + +static void +_ibox_cb_menu_post(void *data, E_Menu *m) +{ + if (!ibox_config->menu) return; + e_object_del(E_OBJECT(ibox_config->menu)); + ibox_config->menu = NULL; +} + +static void +_ibox_cb_icon_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_In *ev; + IBox_Icon *ic; + + ev = event_info; + ic = data; + _ibox_icon_signal_emit(ic, "active", ""); + if (ic->ibox->show_label) + _ibox_icon_signal_emit(ic, "label_active", ""); +} + +static void +_ibox_cb_icon_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Out *ev; + IBox_Icon *ic; + + ev = event_info; + ic = data; + _ibox_icon_signal_emit(ic, "passive", ""); + if (ic->ibox->show_label) + _ibox_icon_signal_emit(ic, "label_passive", ""); +} + +static void +_ibox_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev; + IBox_Icon *ic; + + ev = event_info; + ic = data; + if (ev->button == 1) + { + ic->drag.x = ev->output.x; + ic->drag.y = ev->output.y; + ic->drag.start = 1; + ic->drag.dnd = 0; + } + else if ((ev->button == 3) && (!ibox_config->menu)) + { + E_Menu *mn; + E_Menu_Item *mi; + int cx, cy, cw, ch; + + mn = e_menu_new(); + e_menu_post_deactivate_callback_set(mn, _ibox_cb_menu_post, NULL); + ibox_config->menu = mn; + + /* FIXME: other icon options go here too */ + + e_gadcon_client_util_menu_items_append(ic->ibox->inst->gcc, mn, 0); + + e_gadcon_canvas_zone_geometry_get(ic->ibox->inst->gcc->gadcon, + &cx, &cy, &cw, &ch); + e_menu_activate_mouse(mn, + 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(ic->ibox->inst->gcc->gadcon->evas, ev->button, + EVAS_BUTTON_NONE, ev->timestamp, NULL); + } +} + +static void +_ibox_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Up *ev; + IBox_Icon *ic; + + ev = event_info; + ic = data; + if ((ev->button == 1) && (!ic->drag.dnd)) + e_border_uniconify(ic->border); +} + +static void +_ibox_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Move *ev; + IBox_Icon *ic; + + ev = event_info; + ic = data; + if (ic->drag.start) + { + int dx, dy; + + dx = ev->cur.output.x - ic->drag.x; + dy = ev->cur.output.y - ic->drag.y; + if (((dx * dx) + (dy * dy)) > + (e_config->drag_resist * e_config->drag_resist)) + { + E_Drag *d; + Evas_Object *o; + Evas_Coord x, y, w, h; + const char *drag_types[] = { "enlightenment/border" }; + + ic->drag.dnd = 1; + ic->drag.start = 0; + + evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h); + d = e_drag_new(ic->ibox->inst->gcc->gadcon->zone->container, + x, y, drag_types, 1, + ic->border, -1, _ibox_cb_drag_finished); + o = e_border_icon_add(ic->border, e_drag_evas_get(d)); + e_drag_object_set(d, o); + + e_drag_resize(d, w, h); + e_drag_start(d, ic->drag.x, ic->drag.y); + evas_event_feed_mouse_up(ic->ibox->inst->gcc->gadcon->evas, + 1, EVAS_BUTTON_NONE, + ecore_x_current_time_get(), NULL); + e_object_ref(E_OBJECT(ic->border)); + ic->ibox->icons = evas_list_remove(ic->ibox->icons, ic); + _ibox_resize_handle(ic->ibox); + _gc_orient(ic->ibox->inst->gcc); + _ibox_icon_free(ic); + } + } +} + +static void +_ibox_cb_icon_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + IBox_Icon *ic; + Evas_Coord x, y; + + ic = data; + evas_object_geometry_get(ic->o_holder, &x, &y, NULL, NULL); + evas_object_move(ic->o_holder2, x, y); + evas_object_raise(ic->o_holder2); +} + +static void +_ibox_cb_icon_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + IBox_Icon *ic; + Evas_Coord w, h; + + ic = data; + evas_object_geometry_get(ic->o_holder, NULL, NULL, &w, &h); + evas_object_resize(ic->o_holder2, w, h); + evas_object_raise(ic->o_holder2); +} + +static void +_ibox_cb_drag_finished(E_Drag *drag, int dropped) +{ + E_Border *bd; + + bd = drag->data; + if (!dropped) e_border_uniconify(bd); + e_object_unref(E_OBJECT(bd)); +} + +static void +_ibox_cb_drop_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + IBox *b; + Evas_Coord x, y; + + b = data; + evas_object_geometry_get(b->o_drop, &x, &y, NULL, NULL); + evas_object_move(b->o_drop_over, x, y); +} + +static void +_ibox_cb_drop_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + IBox *b; + Evas_Coord w, h; + + b = data; + evas_object_geometry_get(b->o_drop, NULL, NULL, &w, &h); + evas_object_resize(b->o_drop_over, w, h); +} + +static void +_ibox_inst_cb_enter(void *data, const char *type, void *event_info) +{ + E_Event_Dnd_Enter *ev; + Instance *inst; + Evas_Object *o, *o2; + IBox_Icon *ic; + int cx, cy, cw, ch; + + ev = event_info; + inst = data; + o = edje_object_add(evas_object_evas_get(inst->ibox->o_box)); + inst->ibox->o_drop = o; + o2 = edje_object_add(evas_object_evas_get(inst->ibox->o_box)); + inst->ibox->o_drop_over = o2; + evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, _ibox_cb_drop_move, inst->ibox); + evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, _ibox_cb_drop_resize, inst->ibox); + e_theme_edje_object_set(o, "base/theme/modules/ibox", + "modules/ibox/drop"); + e_theme_edje_object_set(o2, "base/theme/modules/ibox", + "modules/ibox/drop_overlay"); + evas_object_layer_set(o2, 19999); + evas_object_show(o); + evas_object_show(o2); + e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch); + ic = _ibox_icon_at_coord(inst->ibox, ev->x - cx, ev->y - cy); + inst->ibox->ic_drop_before = ic; + if (ic) + { + Evas_Coord ix, iy, iw, ih; + int before = 0; + + evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih); + if (e_box_orientation_get(inst->ibox->o_box)) + { + if ((ev->x - cx) < (ix + (iw / 2))) before = 1; + } + else + { + if ((ev->y - cy) < (iy + (ih / 2))) before = 1; + } + if (before) + e_box_pack_before(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); + else + e_box_pack_after(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); + inst->ibox->drop_before = before; + } + else e_box_pack_end(inst->ibox->o_box, o); + e_box_pack_options_set(o, + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + 1, 1, /* min */ + -1, -1 /* max */ + ); + _ibox_resize_handle(inst->ibox); + _gc_orient(inst->gcc); +} + +static void +_ibox_inst_cb_move(void *data, const char *type, void *event_info) +{ + E_Event_Dnd_Move *ev; + Instance *inst; + IBox_Icon *ic; + int cx, cy, cw, ch; + + ev = event_info; + inst = data; + e_box_unpack(inst->ibox->o_drop); + e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch); + ic = _ibox_icon_at_coord(inst->ibox, ev->x - cx, ev->y - cy); + inst->ibox->ic_drop_before = ic; + if (ic) + { + Evas_Coord ix, iy, iw, ih; + int before = 0; + + evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih); + if (e_box_orientation_get(inst->ibox->o_box)) + { + if ((ev->x - cx) < (ix + (iw / 2))) before = 1; + } + else + { + if ((ev->y - cy) < (iy + (ih / 2))) before = 1; + } + if (before) + e_box_pack_before(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); + else + e_box_pack_after(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); + inst->ibox->drop_before = before; + } + else e_box_pack_end(inst->ibox->o_box, inst->ibox->o_drop); + e_box_pack_options_set(inst->ibox->o_drop, + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + 1, 1, /* min */ + -1, -1 /* max */ + ); + _ibox_resize_handle(inst->ibox); + _gc_orient(inst->gcc); +} + +static void +_ibox_inst_cb_leave(void *data, const char *type, void *event_info) +{ + E_Event_Dnd_Leave *ev; + Instance *inst; + + ev = event_info; + inst = data; + inst->ibox->ic_drop_before = NULL; + evas_object_del(inst->ibox->o_drop); + inst->ibox->o_drop = NULL; + evas_object_del(inst->ibox->o_drop_over); + inst->ibox->o_drop_over = NULL; + _ibox_resize_handle(inst->ibox); + _gc_orient(inst->gcc); +} + +static void +_ibox_inst_cb_drop(void *data, const char *type, void *event_info) +{ + E_Event_Dnd_Drop *ev; + Instance *inst; + E_Border *bd = NULL; + IBox *b; + IBox_Icon *ic, *ic2; + Evas_List *l; + + ev = event_info; + inst = data; + if (!strcmp(type, "enlightenment/border")) + { + bd = ev->data; + if (!bd) return; + } + + ic2 = inst->ibox->ic_drop_before; + if (ic2) + { + /* Add new eapp before this icon */ + if (!inst->ibox->drop_before) + { + for (l = inst->ibox->icons; l; l = l->next) + { + if (l->data == ic2) + { + if (l->next) + ic2 = l->next->data; + else + ic2 = NULL; + break; + } + } + } + if (!ic2) goto atend; + b = inst->ibox; + if (_ibox_icon_find(b, bd)) return; + ic = _ibox_icon_new(b, bd); + if (!ic) return; + b->icons = evas_list_prepend_relative(b->icons, ic, ic2); + e_box_pack_before(b->o_box, ic->o_holder, ic2->o_holder); + } + else + { + atend: + b = inst->ibox; + if (_ibox_icon_find(b, bd)) return; + ic = _ibox_icon_new(b, bd); + if (!ic) return; + b->icons = evas_list_append(b->icons, ic); + e_box_pack_end(b->o_box, ic->o_holder); + } + + evas_object_del(inst->ibox->o_drop); + inst->ibox->o_drop = NULL; + evas_object_del(inst->ibox->o_drop_over); + inst->ibox->o_drop_over = NULL; + _ibox_empty_handle(b); + _ibox_resize_handle(inst->ibox); + _gc_orient(inst->gcc); +} + +static int +_ibox_cb_event_border_add(void *data, int type, void *event) +{ + E_Event_Border_Add *ev; + IBox *b; + IBox_Icon *ic; + + ev = event; + /* add if iconic */ + if (ev->border->iconic) + { + b = _ibox_zone_find(ev->border->zone); + if (!b) return 1; + if (_ibox_icon_find(b, ev->border)) return 1; + ic = _ibox_icon_new(b, ev->border); + if (!ic) return 1; + b->icons = evas_list_append(b->icons, ic); + e_box_pack_end(b->o_box, ic->o_holder); + _ibox_empty_handle(b); + _ibox_resize_handle(b); + _gc_orient(b->inst->gcc); + } + return 1; +} + +static int +_ibox_cb_event_border_remove(void *data, int type, void *event) +{ + E_Event_Border_Remove *ev; + IBox *b; + IBox_Icon *ic; + + ev = event; + /* find icon and remove if there */ + b = _ibox_zone_find(ev->border->zone); + if (!b) return 1; + ic = _ibox_icon_find(b, ev->border); + if (!ic) return 1; + _ibox_icon_free(ic); + b->icons = evas_list_remove(b->icons, ic); + _ibox_empty_handle(b); + _ibox_resize_handle(b); + _gc_orient(b->inst->gcc); + return 1; +} + +static int +_ibox_cb_event_border_iconify(void *data, int type, void *event) +{ + E_Event_Border_Iconify *ev; + IBox *b; + IBox_Icon *ic; + + ev = event; + /* add icon for ibox for right zone */ + /* do some sort of anim when iconifying */ + b = _ibox_zone_find(ev->border->zone); + if (!b) return 1; + if (_ibox_icon_find(b, ev->border)) return 1; + ic = _ibox_icon_new(b, ev->border); + if (!ic) return 1; + b->icons = evas_list_append(b->icons, ic); + e_box_pack_end(b->o_box, ic->o_holder); + _ibox_empty_handle(b); + _ibox_resize_handle(b); + _gc_orient(b->inst->gcc); + return 1; +} + +static int +_ibox_cb_event_border_uniconify(void *data, int type, void *event) +{ + E_Event_Border_Uniconify *ev; + IBox *b; + IBox_Icon *ic; + + ev = event; + /* del icon for ibox for right zone */ + /* do some sort of anim when uniconifying */ + b = _ibox_zone_find(ev->border->zone); + if (!b) return 1; + ic = _ibox_icon_find(b, ev->border); + if (!ic) return 1; + _ibox_icon_free(ic); + b->icons = evas_list_remove(b->icons, ic); + _ibox_empty_handle(b); + _ibox_resize_handle(b); + _gc_orient(b->inst->gcc); + return 1; +} + +static int +_ibox_cb_event_border_icon_change(void *data, int type, void *event) +{ + E_Event_Border_Icon_Change *ev; + IBox *b; + IBox_Icon *ic; + + ev = event; + /* update icon */ + b = _ibox_zone_find(ev->border->zone); + if (!b) return 1; + ic = _ibox_icon_find(b, ev->border); + if (!ic) return 1; + _ibox_icon_empty(ic); + _ibox_icon_fill(ic); + return 1; +} + +static int +_ibox_cb_event_border_zone_set(void *data, int type, void *event) +{ + E_Event_Border_Zone_Set *ev; + IBox *b; + IBox_Icon *ic; + + ev = event; + /* delete from current zone ibox, add to new one */ + if (ev->border->iconic) + { + } + return 1; +} + +/***************************************************************************/ +/**/ +/* module setup */ EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, @@ -93,42 +1078,74 @@ EAPI E_Module_Api e_modapi = EAPI void * e_modapi_init(E_Module *m) { - IBox *ib; - - /* actually init ibox */ - ib = _ibox_new(); - m->config_menu = ib->config_menu; - return ib; + ibox_config = E_NEW(Config, 1); + + ibox_config->module = m; + + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_ADD, _ibox_cb_event_border_add, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_REMOVE, _ibox_cb_event_border_remove, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_ICONIFY, _ibox_cb_event_border_iconify, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_UNICONIFY, _ibox_cb_event_border_uniconify, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_ICON_CHANGE, _ibox_cb_event_border_icon_change, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_ZONE_SET, _ibox_cb_event_border_zone_set, NULL)); + +/* FIXME: add these later for things taskbar-like functionality + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_DESK_SET, _ibox_cb_event_border_zone_set, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_SHOW, _ibox_cb_event_border_zone_set, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_HIDE, _ibox_cb_event_border_zone_set, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_STACK, _ibox_cb_event_border_zone_set, NULL)); + ibox_config->handlers = evas_list_append + (ibox_config->handlers, ecore_event_handler_add + (E_EVENT_BORDER_STICK, _ibox_cb_event_border_zone_set, NULL)); + */ + e_gadcon_provider_register(&_gadcon_class); + return 1; } EAPI int e_modapi_shutdown(E_Module *m) { - IBox *ib; - - if (m->config_menu) - m->config_menu = NULL; - - ib = m->data; - if (ib) + e_gadcon_provider_unregister(&_gadcon_class); + + while (ibox_config->handlers) { - if (ib->config_dialog) - { - e_object_del(E_OBJECT(ib->config_dialog)); - ib->config_dialog = NULL; - } - _ibox_free(ib); - } + ecore_event_handler_del(ibox_config->handlers->data); + ibox_config->handlers = evas_list_remove_list(ibox_config->handlers, ibox_config->handlers); + } + if (ibox_config->menu) + { + e_menu_post_deactivate_callback_set(ibox_config->menu, NULL, NULL); + e_object_del(E_OBJECT(ibox_config->menu)); + ibox_config->menu = NULL; + } + free(ibox_config); + ibox_config = NULL; return 1; } EAPI int e_modapi_save(E_Module *m) { - IBox *ib; - - ib = m->data; - e_config_domain_save("module.ibox", conf_edd, ib->conf); return 1; } @@ -136,7 +1153,7 @@ EAPI int e_modapi_info(E_Module *m) { char buf[4096]; - + snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m)); m->icon_file = strdup(buf); return 1; @@ -151,1129 +1168,5 @@ e_modapi_about(E_Module *m) return 1; } -EAPI int -e_modapi_config(E_Module *m) -{ - IBox *e; - Evas_List *l; - - e = m->data; - if (!e) return 0; - if (!e->boxes) return 0; - - for (l = e->boxes; l; l = l->next) - { - IBox_Box *face; - face = l->data; - if (!face) return 0; - if (face->con == e_container_current_get(e_manager_current_get())) - { - _config_ibox_module(face->con, face->ibox); - break; - } - } - return 1; -} - -/* module private routines */ -static IBox * -_ibox_new() -{ - IBox *ib; - Evas_List *managers, *l, *l2, *cl; - - box_count = 0; - ib = E_NEW(IBox, 1); - if (!ib) return NULL; - - conf_box_edd = E_CONFIG_DD_NEW("IBox_Config_Box", Config_Box); -#undef T -#undef D -#define T Config_Box -#define D conf_box_edd - E_CONFIG_VAL(D, T, enabled, UCHAR); - - conf_edd = E_CONFIG_DD_NEW("IBox_Config", Config); -#undef T -#undef D -#define T Config -#define D conf_edd - E_CONFIG_VAL(D, T, follower, INT); - E_CONFIG_VAL(D, T, follow_speed, DOUBLE); - E_CONFIG_VAL(D, T, autoscroll_speed, DOUBLE); - E_CONFIG_VAL(D, T, iconsize, INT); - E_CONFIG_VAL(D, T, width, INT); - E_CONFIG_LIST(D, T, boxes, conf_box_edd); - - ib->conf = e_config_domain_load("module.ibox", conf_edd); - if (!ib->conf) - { - ib->conf = E_NEW(Config, 1); - ib->conf->follower = 1; - ib->conf->follow_speed = 0.9; - ib->conf->autoscroll_speed = 0.95; - ib->conf->iconsize = 24; - ib->conf->width = IBOX_WIDTH_AUTO; - } - E_CONFIG_LIMIT(ib->conf->follow_speed, 0.01, 1.0); - E_CONFIG_LIMIT(ib->conf->autoscroll_speed, 0.01, 1.0); - E_CONFIG_LIMIT(ib->conf->iconsize, 2, 400); - E_CONFIG_LIMIT(ib->conf->width, -2, -1); - - _ibox_config_menu_new(ib); - - managers = e_manager_list(); - cl = ib->conf->boxes; - for (l = managers; l; l = l->next) - { - E_Manager *man; - - man = l->data; - for (l2 = man->containers; l2; l2 = l2->next) - { - E_Container *con; - IBox_Box *ibb; - /* Config */ - con = l2->data; - ibb = _ibox_box_new(ib, con); - if (ibb) - { - E_Menu_Item *mi; - - if (!cl) - { - ibb->conf = E_NEW(Config_Box, 1); - ibb->conf->enabled = 1; - ib->conf->boxes = evas_list_append(ib->conf->boxes, ibb->conf); - } - else - { - ibb->conf = cl->data; - cl = cl->next; - } - /* Menu */ - _ibox_box_menu_new(ibb); - - /* Add main menu to box menu */ - mi = e_menu_item_new(ib->config_menu); - e_menu_item_label_set(mi, _("Configuration")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/configuration"); - e_menu_item_callback_set(mi, _ibox_box_cb_menu_configure, ibb); - - mi = e_menu_item_new(ib->config_menu); - e_menu_item_label_set(mi, con->name); - e_menu_item_submenu_set(mi, ibb->menu); - - /* Setup */ - if (!ibb->conf->enabled) - _ibox_box_disable(ibb); - - } - } - } - return ib; -} - -static void -_ibox_free(IBox *ib) -{ - E_CONFIG_DD_FREE(conf_edd); - E_CONFIG_DD_FREE(conf_box_edd); - - while (ib->boxes) - _ibox_box_free(ib->boxes->data); - - e_object_del(E_OBJECT(ib->config_menu)); - evas_list_free(ib->conf->boxes); - free(ib->conf); - free(ib); -} - -static IBox_Box * -_ibox_box_new(IBox *ib, E_Container *con) -{ - IBox_Box *ibb; - Evas_Object *o; - E_Gadman_Policy policy; - Evas_Coord x, y, w, h; - E_Border_List *bl; - E_Border *bd; - - ibb = E_NEW(IBox_Box, 1); - if (!ibb) return NULL; - ibb->ibox = ib; - ib->boxes = evas_list_append(ib->boxes, ibb); - - ibb->con = con; - e_object_ref(E_OBJECT(con)); - ibb->evas = con->bg_evas; - - ibb->x = ibb->y = ibb->w = ibb->h = -1; - - evas_event_freeze(ibb->evas); - o = edje_object_add(ibb->evas); - ibb->box_object = o; - e_theme_edje_object_set(o, "base/theme/modules/ibox", - "modules/ibox/main"); - evas_object_show(o); - - if (ibb->ibox->conf->follower) - { - o = edje_object_add(ibb->evas); - ibb->overlay_object = o; - evas_object_layer_set(o, 1); - e_theme_edje_object_set(o, "base/theme/modules/ibox", - "modules/ibox/follower"); - evas_object_show(o); - } - - o = evas_object_rectangle_add(ibb->evas); - ibb->event_object = o; - evas_object_layer_set(o, 2); - evas_object_repeat_events_set(o, 1); - evas_object_color_set(o, 0, 0, 0, 0); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibox_box_cb_mouse_in, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibox_box_cb_mouse_out, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibox_box_cb_mouse_down, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibox_box_cb_mouse_up, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ibox_box_cb_mouse_move, ibb); - evas_object_show(o); - - o = e_box_add(ibb->evas); - ibb->item_object = o; - evas_object_intercept_move_callback_add(o, _ibox_box_cb_intercept_move, ibb); - evas_object_intercept_resize_callback_add(o, _ibox_box_cb_intercept_resize, ibb); - e_box_freeze(o); - edje_object_part_swallow(ibb->box_object, "items", o); - evas_object_show(o); - - ibb->ev_handler_border_iconify = - ecore_event_handler_add(E_EVENT_BORDER_ICONIFY, _ibox_box_cb_event_border_iconify, ibb); - ibb->ev_handler_border_uniconify = - ecore_event_handler_add(E_EVENT_BORDER_UNICONIFY, _ibox_box_cb_event_border_uniconify, ibb); - ibb->ev_handler_border_remove = - ecore_event_handler_add(E_EVENT_BORDER_REMOVE, _ibox_box_cb_event_border_remove, ibb); - - bl = e_container_border_list_first(ibb->con); - while ((bd = e_container_border_list_next(bl))) - { - IBox_Icon *ic; - - if (!bd->iconic) continue; - - ic = _ibox_icon_new(ibb, bd); - } - e_container_border_list_free(bl); - - ibb->align_req = 0.5; - ibb->align = 0.5; - e_box_align_set(ibb->item_object, 0.5, 0.5); - - evas_object_resize(ibb->box_object, 1000, 1000); - edje_object_calc_force(ibb->box_object); - edje_object_part_geometry_get(ibb->box_object, "items", &x, &y, &w, &h); - ibb->box_inset.l = x; - ibb->box_inset.r = 1000 - (x + w); - ibb->box_inset.t = y; - ibb->box_inset.b = 1000 - (y + h); - - /* Calculate icon inset */ - o = edje_object_add(ibb->evas); - e_theme_edje_object_set(o, "base/theme/modules/ibox", - "modules/ibox/icon"); - evas_object_resize(o, 100, 100); - edje_object_calc_force(o); - edje_object_part_geometry_get(o, "item", &x, &y, &w, &h); - ibb->icon_inset.l = x; - ibb->icon_inset.r = 100 - (x + w); - ibb->icon_inset.t = y; - ibb->icon_inset.b = 100 - (y + h); - evas_object_del(o); - - e_box_thaw(ibb->item_object); - - ibb->gmc = e_gadman_client_new(ibb->con->gadman); - e_gadman_client_domain_set(ibb->gmc, "module.ibox", box_count++); - policy = E_GADMAN_POLICY_EDGES | E_GADMAN_POLICY_HMOVE | E_GADMAN_POLICY_VMOVE; - if (ibb->ibox->conf->width == IBOX_WIDTH_FIXED) - policy |= E_GADMAN_POLICY_VSIZE; - - e_gadman_client_policy_set(ibb->gmc, policy); - e_gadman_client_min_size_set(ibb->gmc, 8, 8); - e_gadman_client_max_size_set(ibb->gmc, 3200, 3200); - e_gadman_client_auto_size_set(ibb->gmc, -1, -1); - e_gadman_client_align_set(ibb->gmc, 1.0, 1.0); - e_gadman_client_resize(ibb->gmc, 400, 32 + ibb->box_inset.t + ibb->box_inset.b); - e_gadman_client_change_func_set(ibb->gmc, _ibox_box_cb_gmc_change, ibb); - e_gadman_client_edge_set(ibb->gmc, E_GADMAN_EDGE_BOTTOM); - e_gadman_client_load(ibb->gmc); - - evas_event_thaw(ibb->evas); - - /* We need to resize, if the width is auto and the number - * of apps has changed since last startup */ - _ibox_box_frame_resize(ibb); - - /* - edje_object_signal_emit(ibb->box_object, "passive", ""); - edje_object_signal_emit(ibb->overlay_object, "passive", ""); - */ - - return ibb; -} - -static void -_ibox_box_free(IBox_Box *ibb) -{ - e_object_unref(E_OBJECT(ibb->con)); - e_object_del(E_OBJECT(ibb->menu)); - - ecore_event_handler_del(ibb->ev_handler_border_iconify); - ecore_event_handler_del(ibb->ev_handler_border_uniconify); - ecore_event_handler_del(ibb->ev_handler_border_remove); - - while (ibb->icons) - _ibox_icon_free(ibb->icons->data); - - if (ibb->timer) ecore_timer_del(ibb->timer); - if (ibb->animator) ecore_animator_del(ibb->animator); - evas_object_del(ibb->box_object); - if (ibb->overlay_object) evas_object_del(ibb->overlay_object); - evas_object_del(ibb->item_object); - evas_object_del(ibb->event_object); - - e_gadman_client_save(ibb->gmc); - e_object_del(E_OBJECT(ibb->gmc)); - - ibb->ibox->boxes = evas_list_remove(ibb->ibox->boxes, ibb); - - free(ibb->conf); - free(ibb); - box_count--; -} - -static void -_ibox_box_menu_new(IBox_Box *ibb) -{ - E_Menu *mn; - E_Menu_Item *mi; - - mn = e_menu_new(); - ibb->menu = mn; - - /* Config */ - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, _("Configuration")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/configuration"); - e_menu_item_callback_set(mi, _ibox_box_cb_menu_configure, ibb); - - /* Edit */ - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, _("Edit Mode")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/gadgets"); - e_menu_item_callback_set(mi, _ibox_box_cb_menu_edit, ibb); -} - -static void -_ibox_box_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox_Box *ibb; - - ibb = (IBox_Box *)data; - if (!ibb) return; - _config_ibox_module(ibb->con, ibb->ibox); -} - -static void -_ibox_box_disable(IBox_Box *ibb) -{ - ibb->conf->enabled = 0; - evas_object_hide(ibb->box_object); - if (ibb->overlay_object) evas_object_hide(ibb->overlay_object); - evas_object_hide(ibb->item_object); - evas_object_hide(ibb->event_object); - e_config_save_queue(); -} - -static IBox_Icon * -_ibox_icon_new(IBox_Box *ibb, E_Border *bd) -{ - IBox_Icon *ic; - Evas_Object *o; - Evas_Coord w, h; - - /* FIXME: Add default icon! */ - if (!bd->icon_object) return NULL; - - ic = E_NEW(IBox_Icon, 1); - if (!ic) return NULL; - ic->ibb = ibb; - ic->border = bd; - e_object_ref(E_OBJECT(bd)); - ibb->icons = evas_list_append(ibb->icons, ic); - - o = evas_object_rectangle_add(ibb->evas); - ic->event_object = o; - evas_object_layer_set(o, 1); - evas_object_clip_set(o, evas_object_clip_get(ibb->item_object)); - evas_object_color_set(o, 0, 0, 0, 0); - evas_object_repeat_events_set(o, 1); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibox_icon_cb_mouse_in, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibox_icon_cb_mouse_out, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibox_icon_cb_mouse_up, ic); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->bg_object = o; - evas_object_intercept_move_callback_add(o, _ibox_icon_cb_intercept_move, ic); - evas_object_intercept_resize_callback_add(o, _ibox_icon_cb_intercept_resize, ic); - e_theme_edje_object_set(o, "base/theme/modules/ibox", - "modules/ibox/icon"); - evas_object_show(o); - - o = e_border_icon_add(ic->border, ibb->evas); - ic->icon_object = o; - evas_object_resize(o, ibb->ibox->conf->iconsize, ibb->ibox->conf->iconsize); - edje_object_part_swallow(ic->bg_object, "item", o); - evas_object_pass_events_set(o, 1); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->overlay_object = o; - evas_object_intercept_move_callback_add(o, _ibox_icon_cb_intercept_move, ic); - evas_object_intercept_resize_callback_add(o, _ibox_icon_cb_intercept_resize, ic); - e_theme_edje_object_set(o, "base/theme/modules/ibox", - "modules/ibox/icon_overlay"); - evas_object_show(o); - - evas_object_raise(ic->event_object); - - w = ibb->ibox->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r; - h = ibb->ibox->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b; - e_box_pack_end(ibb->item_object, ic->bg_object); - e_box_pack_options_set(ic->bg_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - w, h /* max */ - ); - - /* - str = (char *)edje_object_data_get(ic->icon_object, "raise_on_hilight"); - if (str) - { - if (atoi(str) == 1) ic->raise_on_hilight = 1; - } - */ - - edje_object_signal_emit(ic->bg_object, "passive", ""); - edje_object_signal_emit(ic->overlay_object, "passive", ""); - return ic; -} - -static void -_ibox_icon_free(IBox_Icon *ic) -{ - if (!ic) return; - - ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic); - if (ic->bg_object) evas_object_del(ic->bg_object); - if (ic->overlay_object) evas_object_del(ic->overlay_object); - if (ic->icon_object) evas_object_del(ic->icon_object); - if (ic->event_object) evas_object_del(ic->event_object); - e_object_unref(E_OBJECT(ic->border)); - free(ic); -} - -static IBox_Icon * -_ibox_icon_find(IBox_Box *ibb, E_Border *bd) -{ - Evas_List *l; - - for (l = ibb->icons; l; l = l->next) - { - IBox_Icon *ic; - - ic = l->data; - if (ic->border == bd) return ic; - } - return NULL; -} - -void -_ibox_config_menu_new(IBox *ib) -{ - E_Menu *mn; - - mn = e_menu_new(); - ib->config_menu = mn; -} - -static void -_ibox_box_frame_resize(IBox_Box *ibb) -{ - Evas_Coord w, h, bw, bh; - /* Not finished loading config yet! */ - if ((ibb->x == -1) || - (ibb->y == -1) || - (ibb->w == -1) || - (ibb->h == -1)) - return; - - evas_event_freeze(ibb->evas); - e_box_freeze(ibb->item_object); - - if (e_box_pack_count_get(ibb->item_object)) - e_box_min_size_get(ibb->item_object, &w, &h); - else - { - /* FIXME: This isn't correct with FIXED_WIDTH! */ - w = ibb->ibox->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r; - h = ibb->ibox->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b; - } - edje_extern_object_min_size_set(ibb->item_object, w, h); - edje_object_part_swallow(ibb->box_object, "items", ibb->item_object); - edje_object_size_min_calc(ibb->box_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->item_object, 0, 0); - edje_object_part_swallow(ibb->box_object, "items", ibb->item_object); - - e_box_thaw(ibb->item_object); - evas_event_thaw(ibb->evas); - - if (ibb->ibox->conf->width == IBOX_WIDTH_AUTO) - { - e_gadman_client_resize(ibb->gmc, bw, bh); - } - else - { - if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) - { - /* h is the width of the box */ - e_gadman_client_resize(ibb->gmc, bw, ibb->h); - } - else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM)) - { - /* w is the width of the box */ - e_gadman_client_resize(ibb->gmc, ibb->w, bh); - } - } -} - -static void -_ibox_box_edge_change(IBox_Box *ibb, int edge) -{ - Evas_List *l; - Evas_Coord bw, bh, tmp; - Evas_Object *o; - E_Gadman_Policy policy; - int changed; - - evas_event_freeze(ibb->evas); - o = ibb->box_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[edge]); - edje_object_message_signal_process(o); - - if (ibb->overlay_object) - { - o = ibb->overlay_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[edge]); - edje_object_message_signal_process(o); - } - - e_box_freeze(ibb->item_object); - - for (l = ibb->icons; l; l = l->next) - { - IBox_Icon *ic; - - ic = l->data; - o = ic->bg_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[edge]); - edje_object_message_signal_process(o); - - o = ic->overlay_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[edge]); - edje_object_message_signal_process(o); - - bw = ibb->ibox->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r; - bh = ibb->ibox->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b; - e_box_pack_options_set(ic->bg_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - bw, bh, /* min */ - bw, bh /* max */ - ); - } - - ibb->align_req = 0.5; - ibb->align = 0.5; - e_box_align_set(ibb->item_object, 0.5, 0.5); - - policy = E_GADMAN_POLICY_EDGES | E_GADMAN_POLICY_HMOVE | E_GADMAN_POLICY_VMOVE; - - if ((edge == E_GADMAN_EDGE_BOTTOM) || - (edge == E_GADMAN_EDGE_TOP)) - { - changed = (e_box_orientation_get(ibb->item_object) != 1); - if (changed) - { - e_box_orientation_set(ibb->item_object, 1); - if (ibb->ibox->conf->width == IBOX_WIDTH_FIXED) - policy |= E_GADMAN_POLICY_HSIZE; - e_gadman_client_policy_set(ibb->gmc, policy); - tmp = ibb->w; - ibb->w = ibb->h; - ibb->h = tmp; - } - } - else if ((edge == E_GADMAN_EDGE_LEFT) || - (edge == E_GADMAN_EDGE_RIGHT)) - { - changed = (e_box_orientation_get(ibb->item_object) != 0); - if (changed) - { - e_box_orientation_set(ibb->item_object, 0); - if (ibb->ibox->conf->width == IBOX_WIDTH_FIXED) - policy |= E_GADMAN_POLICY_VSIZE; - e_gadman_client_policy_set(ibb->gmc, policy); - tmp = ibb->w; - ibb->w = ibb->h; - ibb->h = tmp; - } - } - - e_box_thaw(ibb->item_object); - evas_event_thaw(ibb->evas); - - _ibox_box_frame_resize(ibb); -} - -static void -_ibox_box_update_policy(IBox_Box *ibb) -{ - E_Gadman_Policy policy; - - policy = E_GADMAN_POLICY_EDGES | E_GADMAN_POLICY_HMOVE | E_GADMAN_POLICY_VMOVE; - - if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP)) - { - if (ibb->ibox->conf->width == IBOX_WIDTH_FIXED) - policy |= E_GADMAN_POLICY_HSIZE; - e_gadman_client_policy_set(ibb->gmc, policy); - } - else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) - { - if (ibb->ibox->conf->width == IBOX_WIDTH_FIXED) - policy |= E_GADMAN_POLICY_VSIZE; - e_gadman_client_policy_set(ibb->gmc, policy); - } -} - -static void -_ibox_box_motion_handle(IBox_Box *ibb, Evas_Coord mx, Evas_Coord my) -{ - Evas_Coord x, y, w, h; - double relx, rely; - - evas_object_geometry_get(ibb->item_object, &x, &y, &w, &h); - if (w > 0) relx = (double)(mx - x) / (double)w; - else relx = 0.0; - if (h > 0) rely = (double)(my - y) / (double)h; - else rely = 0.0; - if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP)) - { - ibb->align_req = 1.0 - relx; - ibb->follow_req = relx; - } - else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) - { - ibb->align_req = 1.0 - rely; - ibb->follow_req = rely; - } -} - -static void -_ibox_box_timer_handle(IBox_Box *ibb) -{ - if (!ibb->timer) - ibb->timer = ecore_timer_add(0.01, _ibox_box_cb_timer, ibb); - if (!ibb->animator) - ibb->animator = ecore_animator_add(_ibox_box_cb_animator, ibb); -} - -static void -_ibox_box_follower_reset(IBox_Box *ibb) -{ - Evas_Coord ww, hh, bx, by, bw, bh, d1, d2, mw, mh; - - if (!ibb->overlay_object) return; - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - evas_object_geometry_get(ibb->item_object, &bx, &by, &bw, &bh); - edje_object_size_min_get(ibb->overlay_object, &mw, &mh); - if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP)) - { - d1 = bx; - d2 = ww - (bx + bw); - if (bw > 0) - { - if (d1 < d2) - ibb->follow_req = -((double)(d1 + (mw * 4)) / (double)bw); - else - ibb->follow_req = 1.0 + ((double)(d2 + (mw * 4)) / (double)bw); - } - } - else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) - { - d1 = by; - d2 = hh - (by + bh); - if (bh > 0) - { - if (d1 < d2) - ibb->follow_req = -((double)(d1 + (mh * 4)) / (double)bh); - else - ibb->follow_req = 1.0 + ((double)(d2 + (mh * 4)) / (double)bh); - } - } -} - -static void -_ibox_icon_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) -{ - IBox_Icon *ic; - - ic = data; - evas_object_move(o, x, y); - evas_object_move(ic->event_object, x, y); - evas_object_move(ic->overlay_object, x, y); -} - -static void -_ibox_icon_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) -{ - IBox_Icon *ic; - - ic = data; - evas_object_resize(o, w, h); - evas_object_resize(ic->event_object, w, h); - evas_object_resize(ic->overlay_object, w, h); -} - -static void -_ibox_box_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) -{ - IBox_Box *ibb; - - ibb = data; - evas_object_move(o, x, y); - evas_object_move(ibb->event_object, x, y); -} - -static void -_ibox_box_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) -{ - IBox_Box *ibb; - - ibb = data; - - evas_object_resize(o, w, h); - evas_object_resize(ibb->event_object, w, h); -} - -static void -_ibox_icon_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_In *ev; - IBox_Icon *ic; - - ev = event_info; - ic = data; - evas_event_freeze(ic->ibb->evas); - evas_object_raise(ic->event_object); - if (ic->raise_on_hilight) - evas_object_stack_below(ic->bg_object, ic->event_object); - evas_object_stack_below(ic->overlay_object, ic->event_object); - evas_event_thaw(ic->ibb->evas); - edje_object_signal_emit(ic->bg_object, "active", ""); - edje_object_signal_emit(ic->overlay_object, "active", ""); - if (ic->ibb->overlay_object) - edje_object_signal_emit(ic->ibb->overlay_object, "active", ""); -} - -static void -_ibox_icon_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Out *ev; - IBox_Icon *ic; - - ev = event_info; - ic = data; - edje_object_signal_emit(ic->bg_object, "passive", ""); - edje_object_signal_emit(ic->overlay_object, "passive", ""); - if (ic->ibb->overlay_object) - edje_object_signal_emit(ic->ibb->overlay_object, "passive", ""); -} - -static void -_ibox_icon_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Up *ev; - IBox_Icon *ic; - - ev = event_info; - ic = data; - if (ev->button == 1) - e_border_uniconify(ic->border); -} - -static void -_ibox_box_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_In *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - if (ibb->overlay_object) - edje_object_signal_emit(ibb->overlay_object, "active", ""); - _ibox_box_motion_handle(ibb, ev->canvas.x, ev->canvas.y); - _ibox_box_timer_handle(ibb); -} - -static void -_ibox_box_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Out *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - if (ibb->overlay_object) - edje_object_signal_emit(ibb->overlay_object, "passive", ""); - _ibox_box_follower_reset(ibb); - _ibox_box_timer_handle(ibb); -} - -static void -_ibox_box_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Down *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - if (ev->button == 3) - { - e_menu_activate_mouse(ibb->menu, e_zone_current_get(ibb->con), - ev->output.x, ev->output.y, 1, 1, - E_MENU_POP_DIRECTION_DOWN, ev->timestamp); - e_util_container_fake_mouse_up_later(ibb->con, 3); - } -} - -static void -_ibox_box_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Up *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; -} - -static void -_ibox_box_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Move *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - _ibox_box_motion_handle(ibb, ev->cur.canvas.x, ev->cur.canvas.y); - _ibox_box_timer_handle(ibb); -} - -static int -_ibox_box_cb_timer(void *data) -{ - IBox_Box *ibb; - double dif, dif2; - double v; - - ibb = data; - v = ibb->ibox->conf->autoscroll_speed; - ibb->align = (ibb->align_req * (1.0 - v)) + (ibb->align * v); - v = ibb->ibox->conf->follow_speed; - ibb->follow = (ibb->follow_req * (1.0 - v)) + (ibb->follow * v); - - dif = ibb->align - ibb->align_req; - if (dif < 0) dif = -dif; - if (dif < 0.001) ibb->align = ibb->align_req; - - dif2 = ibb->follow - ibb->follow_req; - if (dif2 < 0) dif2 = -dif2; - if (dif2 < 0.001) ibb->follow = ibb->follow_req; - - if ((dif < 0.001) && (dif2 < 0.001)) - { - ibb->timer = NULL; - return 0; - } - return 1; -} - -static int -_ibox_box_cb_animator(void *data) -{ - IBox_Box *ibb; - Evas_Coord x, y, w, h, mw, mh; - - ibb = data; - - if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP)) - { - e_box_min_size_get(ibb->item_object, &mw, &mh); - evas_object_geometry_get(ibb->item_object, NULL, NULL, &w, &h); - if (mw > w) - e_box_align_set(ibb->item_object, ibb->align, 0.5); - else - e_box_align_set(ibb->item_object, 0.5, 0.5); - - if (ibb->overlay_object) - { - evas_object_geometry_get(ibb->item_object, &x, &y, &w, &h); - edje_object_size_min_get(ibb->overlay_object, &mw, &mh); - evas_object_resize(ibb->overlay_object, mw, h); - evas_object_move(ibb->overlay_object, x + (w * ibb->follow) - (mw / 2), y); - } - } - else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) || - (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) - { - e_box_min_size_get(ibb->item_object, &mw, &mh); - evas_object_geometry_get(ibb->item_object, NULL, NULL, &w, &h); - if (mh > h) - e_box_align_set(ibb->item_object, 0.5, ibb->align); - else - e_box_align_set(ibb->item_object, 0.5, 0.5); - - if (ibb->overlay_object) - { - evas_object_geometry_get(ibb->item_object, &x, &y, &w, &h); - edje_object_size_min_get(ibb->overlay_object, &mw, &mh); - evas_object_resize(ibb->overlay_object, w, mh); - evas_object_move(ibb->overlay_object, x, y + (h * ibb->follow) - (mh / 2)); - } - } - if (ibb->timer) return 1; - ibb->animator = NULL; - return 0; -} - -static int -_ibox_box_cb_event_border_iconify(void *data, int type, void *event) -{ - E_Event_Border_Iconify *ev; - IBox_Box *ibb; - IBox_Icon *ic; - - ev = event; - ibb = data; - - if (!_ibox_icon_find(ibb, ev->border)) - ic = _ibox_icon_new(ibb, ev->border); - _ibox_box_frame_resize(ibb); - - return 1; -} - -static int -_ibox_box_cb_event_border_uniconify(void *data, int type, void *event) -{ - E_Event_Border_Uniconify *ev; - IBox_Box *ibb; - IBox_Icon *ic; - - ev = event; - ibb = data; - - ic = _ibox_icon_find(ibb, ev->border); - if (ic) - _ibox_icon_free(ic); - _ibox_box_frame_resize(ibb); - - return 1; -} - -static int -_ibox_box_cb_event_border_remove(void *data, int type, void *event) -{ - E_Event_Border_Remove *ev; - IBox_Box *ibb; - IBox_Icon *ic; - - ev = event; - ibb = data; - - ic = _ibox_icon_find(ibb, ev->border); - if (ic) - _ibox_icon_free(ic); - _ibox_box_frame_resize(ibb); - - return 1; -} - -static void -_ibox_box_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change) -{ - IBox_Box *ibb; - - ibb = data; - switch (change) - { - case E_GADMAN_CHANGE_MOVE_RESIZE: - e_gadman_client_geometry_get(ibb->gmc, &ibb->x, &ibb->y, &ibb->w, &ibb->h); - - edje_extern_object_min_size_set(ibb->item_object, 0, 0); - edje_object_part_swallow(ibb->box_object, "items", ibb->item_object); - - evas_object_move(ibb->box_object, ibb->x, ibb->y); - evas_object_resize(ibb->box_object, ibb->w, ibb->h); - - _ibox_box_follower_reset(ibb); - _ibox_box_timer_handle(ibb); - - break; - case E_GADMAN_CHANGE_EDGE: - _ibox_box_edge_change(ibb, e_gadman_client_edge_get(ibb->gmc)); - break; - case E_GADMAN_CHANGE_RAISE: - case E_GADMAN_CHANGE_ZONE: - /* Ignore */ - break; - } -} - -static void -_ibox_box_cb_width_auto(void *data) -{ - IBox *ib; - IBox_Box *ibb; - Evas_List *l; - - ib = (IBox *)data; - for (l = ib->boxes; l; l = l->next) - { - ibb = l->data; - _ibox_box_update_policy(ibb); - _ibox_box_frame_resize(ibb); - } -} - -static void -_ibox_box_cb_iconsize_change(void *data) -{ - IBox *ib; - IBox_Box *ibb; - Evas_List *l, *ll; - - ib = (IBox *)data; - for (l = ib->boxes; l; l = l->next) - { - ibb = l->data; - - e_box_freeze(ibb->item_object); - for (ll = ibb->icons; ll; ll = ll->next) - { - IBox_Icon *ic; - Evas_Object *o; - Evas_Coord bw, bh; - - ic = ll->data; - o = ic->icon_object; - evas_object_resize(o, ibb->ibox->conf->iconsize, ibb->ibox->conf->iconsize); - edje_object_part_swallow(ic->bg_object, "item", o); - - bw = ibb->ibox->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r; - bh = ibb->ibox->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b; - e_box_pack_options_set(ic->bg_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - bw, bh, /* min */ - bw, bh /* max */ - ); - } - e_box_thaw(ibb->item_object); - _ibox_box_frame_resize(ibb); - } -} - -static void -_ibox_box_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox_Box *ibb; - - ibb = data; - e_gadman_mode_set(ibb->gmc->gadman, E_GADMAN_MODE_EDIT); -} - -static void -_ibox_box_cb_follower(void *data) -{ - IBox *ib; - IBox_Box *ibb; - unsigned char enabled; - Evas_List *l; - - ib = (IBox *)data; - enabled = ib->conf->follower; - if (enabled) - { - for (l = ib->boxes; l; l = l->next) - { - Evas_Object *o; - - ibb = l->data; - if (ibb->overlay_object) continue; - o = edje_object_add(ibb->evas); - ibb->overlay_object = o; - evas_object_layer_set(o, 1); - e_theme_edje_object_set(o, "base/theme/modules/ibox", - "modules/ibox/follower"); - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[e_gadman_client_edge_get(ibb->gmc)]); - edje_object_message_signal_process(o); - evas_object_show(o); - } - } - else if (!enabled) - { - for (l = ib->boxes; l; l = l->next) - { - ibb = l->data; - if (!ibb->overlay_object) continue; - evas_object_del(ibb->overlay_object); - ibb->overlay_object = NULL; - } - } -} - -void -_ibox_box_cb_config_updated(void *data) -{ - /* Call Any Needed Funcs To Let Module Handle Config Changes */ - _ibox_box_cb_follower(data); - _ibox_box_cb_width_auto(data); - _ibox_box_cb_iconsize_change(data); -} +/**/ +/***************************************************************************/ diff --git a/src/modules/ibox/e_mod_main.h b/src/modules/ibox/e_mod_main.h index dd3d4f6b6..2d40474b0 100644 --- a/src/modules/ibox/e_mod_main.h +++ b/src/modules/ibox/e_mod_main.h @@ -5,84 +5,14 @@ #define E_MOD_MAIN_H typedef struct _Config Config; -typedef struct _Config_Box Config_Box; -typedef struct _IBox IBox; -typedef struct _IBox_Box IBox_Box; -typedef struct _IBox_Icon IBox_Icon; - -#define IBOX_WIDTH_AUTO -1 -#define IBOX_WIDTH_FIXED -2 struct _Config { - double follow_speed; - int follower; - double autoscroll_speed; - int iconsize; - int width; - Evas_List *boxes; -}; - -struct _Config_Box -{ - unsigned char enabled; -}; - -struct _IBox -{ - Evas_List *boxes; - E_Menu *config_menu; - - Config *conf; - E_Config_Dialog *config_dialog; -}; - -struct _IBox_Box -{ - IBox *ibox; - E_Container *con; - Evas *evas; - E_Menu *menu; - - Evas_Object *box_object; - Evas_Object *overlay_object; - Evas_Object *item_object; - Evas_Object *event_object; - - Evas_List *icons; - - Ecore_Event_Handler *ev_handler_border_iconify; - Ecore_Event_Handler *ev_handler_border_uniconify; - Ecore_Event_Handler *ev_handler_border_remove; - - double align, align_req; - double follow, follow_req; - Ecore_Timer *timer; - Ecore_Animator *animator; - - Evas_Coord x, y, w, h; - struct { - Evas_Coord l, r, t, b; - } box_inset; - struct { - Evas_Coord l, r, t, b; - } icon_inset; - - E_Gadman_Client *gmc; - - Config_Box *conf; -}; - -struct _IBox_Icon -{ - IBox_Box *ibb; - E_Border *border; - Evas_Object *bg_object; - Evas_Object *overlay_object; - Evas_Object *icon_object; - Evas_Object *event_object; - - unsigned char raise_on_hilight : 1; + /* just config state */ + E_Module *module; + Evas_List *instances; + E_Menu *menu; + Evas_List *handlers; }; EAPI extern E_Module_Api e_modapi; @@ -92,8 +22,5 @@ EAPI int e_modapi_shutdown (E_Module *m); EAPI int e_modapi_save (E_Module *m); EAPI int e_modapi_info (E_Module *m); EAPI int e_modapi_about (E_Module *m); -EAPI int e_modapi_config (E_Module *m); - -void _ibox_box_cb_config_updated(void *data); #endif diff --git a/src/modules/ibox/module.eap b/src/modules/ibox/module.eap new file mode 100644 index 000000000..75b958c49 Binary files /dev/null and b/src/modules/ibox/module.eap differ diff --git a/src/modules/ibox/module_icon.png b/src/modules/ibox/module_icon.png index 1bf397d02..77e235fa5 100644 Binary files a/src/modules/ibox/module_icon.png and b/src/modules/ibox/module_icon.png differ diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index 00cda8323..fc57b30ab 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -1569,6 +1569,7 @@ _pager_inst_cb_drop(void *data, const char *type, void *event_info) { Evas_Coord nx, ny; + if (bd->iconic) e_border_uniconify(bd); e_border_desk_set(bd, pd->desk); if ((!pw) || ((pw) && (!pw->drag.no_place))) {