'everyshizzle' update:
- new thumb view: use + for zoom - moved plugins to subdirs - theme tweaks - fix fuzzy match once again - hash border and app items SVN revision: 41961
This commit is contained in:
parent
6051d5f3a6
commit
09a4d35a07
|
@ -560,6 +560,9 @@ src/modules/illume2/module.desktop
|
|||
src/modules/syscon/Makefile
|
||||
src/modules/syscon/module.desktop
|
||||
src/modules/everything/Makefile
|
||||
src/modules/everything/sources/Makefile
|
||||
src/modules/everything/actions/Makefile
|
||||
src/modules/everything/views/Makefile
|
||||
src/modules/everything/module.desktop
|
||||
src/modules/everything/everything.pc
|
||||
src/modules/systray/Makefile
|
||||
|
|
|
@ -26581,7 +26581,7 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/*** MOD: EVERYTHING ***/
|
||||
/* #define DROP_SHADOW 1 */
|
||||
#define DROP_SHADOW 1
|
||||
|
||||
ICON("everything-launch","icon_advanced.png",64)
|
||||
|
||||
|
@ -26614,8 +26614,7 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
border: 50 50 50 50;
|
||||
}
|
||||
fill.smooth: 0;
|
||||
color: 255 255 255 100;
|
||||
|
||||
color: 255 255 255 200;
|
||||
}
|
||||
}
|
||||
part { name: "bg";
|
||||
|
@ -26630,7 +26629,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
border: 7 7 5 5;
|
||||
}
|
||||
color: 255 255 255 255;
|
||||
|
||||
}
|
||||
description { state: "wide" 0;
|
||||
inherit: "default" 0.0;
|
||||
|
@ -26650,7 +26648,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
border: 7 7 5 5;
|
||||
}
|
||||
color: 255 255 255 255;
|
||||
|
||||
}
|
||||
description { state: "wide" 0;
|
||||
inherit: "default" 0.0;
|
||||
|
@ -26729,7 +26726,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
visible: 1;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "over1";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -26749,7 +26745,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
rel1.to: "bg";
|
||||
rel2.to: "bg";
|
||||
rel2.offset: -1 40;
|
||||
|
||||
image {
|
||||
normal: "bt_shine.png";
|
||||
border: 7 7 7 0;
|
||||
|
@ -26779,7 +26774,8 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
|
||||
group { name: "e/modules/everything/selector_item";
|
||||
images {
|
||||
image: "gadman_border.png" COMP;
|
||||
image: "everything_border.png" COMP;
|
||||
image: "everything_item_bg.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "clip";
|
||||
|
@ -26789,14 +26785,30 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "border";
|
||||
part { name: "border_bg";
|
||||
clip_to: "clip";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 32;
|
||||
rel1.offset: 2 2;
|
||||
rel2.offset: -3 -3;
|
||||
image {
|
||||
normal: "gadman_border.png";
|
||||
normal: "everything_item_bg.png";
|
||||
border: 5 5 5 5;
|
||||
}
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 64;
|
||||
}
|
||||
}
|
||||
part { name: "border";
|
||||
clip_to: "clip";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 64;
|
||||
image {
|
||||
normal: "everything_border.png";
|
||||
border: 10 10 10 10;
|
||||
}
|
||||
}
|
||||
|
@ -26805,7 +26817,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
color: 255 255 255 128;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "inner_clip";
|
||||
type: RECT;
|
||||
clip_to: "clip";
|
||||
|
@ -26815,7 +26826,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
rel2.offset: -11 -11;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "icon_clip";
|
||||
type: RECT;
|
||||
clip_to: "inner_clip";
|
||||
|
@ -26828,7 +26838,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
color: 255 255 255 200;
|
||||
}
|
||||
}
|
||||
|
||||
part {
|
||||
name: "e.swallow.icons";
|
||||
type: SWALLOW;
|
||||
|
@ -26907,6 +26916,7 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
action: STATE_SET "selected" 0.0;
|
||||
transition: SINUSOIDAL 0.2;
|
||||
target: "border";
|
||||
target: "border_bg";
|
||||
}
|
||||
program { name: "unsel";
|
||||
signal: "e,state,unselected";
|
||||
|
@ -26914,6 +26924,7 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
action: STATE_SET "default" 0.0;
|
||||
transition: SINUSOIDAL 0.3;
|
||||
target: "border";
|
||||
target: "border_bg";
|
||||
}
|
||||
program { name: "update";
|
||||
signal: "e,signal,update";
|
||||
|
@ -26943,17 +26954,15 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
image: "drop.png" COMP;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* offset to main popup */
|
||||
#ifdef DROP_SHADOW
|
||||
data.item: "offset_y" "-52";
|
||||
min: 450 285;
|
||||
min: 480 315;
|
||||
#else
|
||||
data.item: "offset_y" "-2";
|
||||
min: 350 235;
|
||||
min: 380 265;
|
||||
#endif
|
||||
data.item: "shaped" "1";
|
||||
|
||||
parts {
|
||||
#ifdef DROP_SHADOW
|
||||
part { name: "shadow";
|
||||
|
@ -27051,13 +27060,11 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
rel2.offset: -1 24;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "bg";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to_x: "base";
|
||||
rel1.to_y: "input_base";
|
||||
rel2.to: "base";
|
||||
|
||||
image {
|
||||
normal: "base_bg.png";
|
||||
border: 2 2 2 2;
|
||||
|
@ -27066,7 +27073,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
color: 205 205 205 255;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "bar_base";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -27128,7 +27134,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
state: "default" 0.0;
|
||||
rel1.to: "bar_clip";
|
||||
rel1.offset: -1 0;
|
||||
|
||||
rel2.to: "bar_clip";
|
||||
rel2.offset: -1 -1;
|
||||
}
|
||||
|
@ -27162,8 +27167,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
color: 255 255 255 128;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
part { name: "input_bg";
|
||||
clip_to: "input_base";
|
||||
description { state: "default" 0.0;
|
||||
|
@ -27250,7 +27253,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
visible: 1;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "list_clip";
|
||||
type: RECT;
|
||||
clip_to: "base";
|
||||
|
@ -27258,12 +27260,12 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
relative: 0.0 0.0;
|
||||
offset: 2 2;
|
||||
offset: 2 0;
|
||||
to: "base";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
offset: -3 -2;
|
||||
offset: -3 0;
|
||||
to_y: "bar_base";
|
||||
to_x: "base";
|
||||
}
|
||||
|
@ -27323,7 +27325,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
}
|
||||
fill.smooth : 0;
|
||||
color: 200 200 200 255;
|
||||
|
||||
}
|
||||
}
|
||||
part { name: "list_over2";
|
||||
|
@ -27344,7 +27345,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
}
|
||||
fill.smooth : 0;
|
||||
color: 200 200 200 255;
|
||||
|
||||
}
|
||||
}
|
||||
part { name: "box";
|
||||
|
@ -27362,7 +27362,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
}
|
||||
fill.smooth : 1;
|
||||
color: 255 255 255 250;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27423,14 +27422,12 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
group { name: "e/modules/everything/tab_item";
|
||||
images {
|
||||
image: "toolbar_sel.png" COMP;
|
||||
}
|
||||
min: 70 10;
|
||||
max: 100 10;
|
||||
|
||||
parts {
|
||||
part { name: "label2";
|
||||
type: TEXT;
|
||||
|
@ -27523,7 +27520,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
image: "bt_dis_hilight.png" COMP;
|
||||
}
|
||||
min: 140 28;
|
||||
|
||||
parts {
|
||||
part { name: "list_bg";
|
||||
type: RECT;
|
||||
|
@ -27650,7 +27646,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
relative: 1.0 1.0;
|
||||
offset: -3 -2;
|
||||
}
|
||||
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
|
@ -27765,6 +27760,7 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
}
|
||||
rel2 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -1 -4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27818,7 +27814,6 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
rel2.relative: 0.9999 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "e.swallow.icon3";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -27877,3 +27872,622 @@ MIMEBASE("application/x-font-bdf","icon_mime_font_generic.png", ".BDF", 128);
|
|||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/*** WALLPAPER MAIN DIALOG ***/
|
||||
group { name: "e/modules/everything/thumbview/main/window";
|
||||
images {
|
||||
image: "vgrad_dark.png" COMP;
|
||||
image: "dia_topshad.png" COMP;
|
||||
image: "dia_botshad.png" COMP;
|
||||
image: "dia_botshad.png" COMP;
|
||||
image: "topsh.png" COMP;
|
||||
image: "wp-bot1.png" COMP;
|
||||
image: "wp-bot2.png" COMP;
|
||||
image: "wp-tb1.png" COMP;
|
||||
image: "wp-tb2.png" COMP;
|
||||
image: "wp-tb3.png" COMP;
|
||||
image: "wp-tbs.png" COMP;
|
||||
image: "big_arrow_up.png" COMP;
|
||||
|
||||
image: "busy-1.png" COMP;
|
||||
image: "busy-2.png" COMP;
|
||||
image: "busy-3.png" COMP;
|
||||
image: "busy-4.png" COMP;
|
||||
image: "busy-5.png" COMP;
|
||||
image: "busy-6.png" COMP;
|
||||
image: "busy-7.png" COMP;
|
||||
image: "busy-8.png" COMP;
|
||||
image: "busy-9.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "base";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color_class: "dialog_base";
|
||||
image.normal: "vgrad_dark.png";
|
||||
rel1 {
|
||||
relative: 0.0 0.0;
|
||||
offset: 0 -3;
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -1 6;
|
||||
/* to_y: "bot1"; */
|
||||
}
|
||||
fill {
|
||||
smooth: 0;
|
||||
/* size {
|
||||
* relative: 0.0 1.0;
|
||||
* offset: 64 0;
|
||||
* } */
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.preview";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "events";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.list";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1 {
|
||||
relative: 0.0 0.0;
|
||||
offset: 6 1;
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -3 -3;
|
||||
/* to_y: "bot1"; */
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "cover";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "out" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "shadow2";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.relative: 0.0 1.0;
|
||||
rel1.offset: 0 -4;
|
||||
image.normal: "dia_botshad.png";
|
||||
fill {
|
||||
smooth: 0;
|
||||
size {
|
||||
relative: 0.0 1.0;
|
||||
offset: 64 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "busy_clip";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
visible: 1;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part { name: "busy";
|
||||
mouse_events: 0;
|
||||
clip_to: "busy_clip";
|
||||
description { state: "default" 0.0;
|
||||
min: 32 32;
|
||||
max: 32 32;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
rel1 {
|
||||
relative: 0.5 0.5;
|
||||
offset: 0 0;
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.5 0.5;
|
||||
offset: -1 1;
|
||||
}
|
||||
image {
|
||||
normal: "busy-9.png";
|
||||
tween: "busy-1.png";
|
||||
tween: "busy-2.png";
|
||||
tween: "busy-3.png";
|
||||
tween: "busy-4.png";
|
||||
tween: "busy-5.png";
|
||||
tween: "busy-6.png";
|
||||
tween: "busy-7.png";
|
||||
tween: "busy-8.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "busy1";
|
||||
signal: "e,state,busy,on";
|
||||
source: "e";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: LINEAR 1.0;
|
||||
target: "busy_clip";
|
||||
}
|
||||
program { name: "busy_anim";
|
||||
signal: "e,state,busy,on";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.3333;
|
||||
target: "busy";
|
||||
after: "busy_anim";
|
||||
}
|
||||
program { name: "busy2";
|
||||
signal: "e,state,busy,off";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 1.0;
|
||||
target: "busy_clip";
|
||||
after: "busy3";
|
||||
}
|
||||
program { name: "busy3";
|
||||
action: ACTION_STOP;
|
||||
target: "busy_anim";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/modules/everything/thumbview/main/mini";
|
||||
images {
|
||||
image: "e17_mini_button_shadow2.png" COMP;
|
||||
image: "everything_item_bg.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "bg";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
/* visible: 0; */
|
||||
rel1 {
|
||||
to: "base";
|
||||
offset: -1 -3;
|
||||
}
|
||||
rel2 {
|
||||
to: "base";
|
||||
offset: 0 2;
|
||||
}
|
||||
fill.smooth: 0;
|
||||
image {
|
||||
normal: "everything_item_bg.png";
|
||||
border: 5 5 5 5;
|
||||
}
|
||||
color: 255 255 255 32;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
}
|
||||
}
|
||||
part { name: "base";
|
||||
mouse_events: 0;
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
rel1 {
|
||||
relative: 0.0 0.0;
|
||||
offset: 0 4;
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -5 -5;
|
||||
}
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content";
|
||||
clip_to: "base";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1 {
|
||||
to: "base";
|
||||
relative: 0.0 0.0;
|
||||
offset: 2 0;
|
||||
}
|
||||
rel2 {
|
||||
to: "base";
|
||||
relative: 1.0 1.0;
|
||||
offset: -3 -11;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.icon";
|
||||
clip_to: "base";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1 {
|
||||
to: "base";
|
||||
relative: 0.0 0.0;
|
||||
offset: 5 3;
|
||||
}
|
||||
rel2 {
|
||||
to: "base";
|
||||
relative: 1.0 1.0;
|
||||
offset: -6 -13;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "e.text.label";
|
||||
type: TEXT;
|
||||
clip_to: "base";
|
||||
effect: SOFT_SHADOW;
|
||||
mouse_events: 0;
|
||||
scale: 1;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
rel1 {
|
||||
offset: 2 -12;
|
||||
relative: 0.0 1.0;
|
||||
}
|
||||
rel2.offset: -2 -4;
|
||||
color: 210 210 210 255;
|
||||
color3: 0 0 0 0;
|
||||
text {
|
||||
font: "Sans";
|
||||
size: 10;
|
||||
min: 0 1;
|
||||
align: 0.5 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "events";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "sel";
|
||||
signal: "e,state,selected";
|
||||
source: "e";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: DECELERATE 0.1;
|
||||
target: "bg";
|
||||
}
|
||||
program { name: "unsel";
|
||||
signal: "e,state,unselected";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: SINUSOIDAL 0.2;
|
||||
target: "bg";
|
||||
}
|
||||
program { name: "thumb_gen";
|
||||
signal: "e,action,thumb,gen";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.0;
|
||||
target: "base";
|
||||
after: "thumb_ungen";
|
||||
}
|
||||
program { name: "thumb_ungen";
|
||||
signal: "e,action,thumb,ungen";
|
||||
source: "e";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: SINUSOIDAL 0.15;
|
||||
target: "base";
|
||||
}
|
||||
program { name: "thumb_show_delayed";
|
||||
signal: "e,action,thumb,show_delayed";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.2;
|
||||
target: "base";
|
||||
after: "thumb_show_delayed2";
|
||||
}
|
||||
program { name: "thumb_show_delayed2";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: SINUSOIDAL 0.6;
|
||||
target: "base";
|
||||
}
|
||||
program { name: "thumb_show";
|
||||
signal: "e,action,thumb,show";
|
||||
source: "e";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: SINUSOIDAL 0.1;
|
||||
target: "base";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/modules/everything/thumbview/main/scrollframe";
|
||||
images {
|
||||
image: "arrow_up.png" COMP;
|
||||
image: "arrow_down.png" COMP;
|
||||
image: "bt_sm_base1.png" COMP;
|
||||
image: "bt_sm_base2.png" COMP;
|
||||
image: "bt_sm_shine.png" COMP;
|
||||
image: "bt_sm_hilight.png" COMP;
|
||||
image: "sb_runnerv.png" COMP;
|
||||
}
|
||||
parts {
|
||||
// part { name: "clipper";
|
||||
// type: RECT;
|
||||
// mouse_events: 0;
|
||||
// description { state: "default" 0.0;
|
||||
// }
|
||||
// }
|
||||
part { name: "e.swallow.content";
|
||||
// clip_to: "clipper";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 0 0;
|
||||
rel2 {
|
||||
relative: 0.0 1.0;
|
||||
offset: 2 -1;
|
||||
to_x: "sb_vbar";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar";
|
||||
type: RECT;
|
||||
mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
min: 7 17;
|
||||
align: 1.0 0.0;
|
||||
rel1 {
|
||||
relative: 1.0 0.0;
|
||||
offset: -1 0;
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -1 -1;
|
||||
}
|
||||
}
|
||||
description { state: "hidden" 0.0;
|
||||
visible: 0;
|
||||
max: 0 99999;
|
||||
rel1 {
|
||||
relative: 1.0 0.0;
|
||||
offset: -1 0;
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -1 -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_base";
|
||||
type: RECT;
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
rel1 {
|
||||
relative: 0.0 1.0;
|
||||
offset: 0 -1;
|
||||
to: "sb_vbar_a1";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
offset: -1 0;
|
||||
to: "sb_vbar_a2";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_runner";
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
max: 3 99999;
|
||||
rel1.to: "sb_vbar_base";
|
||||
rel1.offset: -2 0;
|
||||
rel2.to: "sb_vbar_base";
|
||||
image {
|
||||
normal: "sb_runnerv.png";
|
||||
border: 0 0 4 4;
|
||||
}
|
||||
fill.smooth: 0;
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_p1";
|
||||
type: RECT;
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
rel1 {
|
||||
relative: 0.0 1.0;
|
||||
to: "sb_vbar_a1";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
to: "e.dragable.vbar";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_p2";
|
||||
type: RECT;
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
rel1 {
|
||||
relative: 0.0 1.0;
|
||||
to: "e.dragable.vbar";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
to: "sb_vbar_a2";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "e.dragable.vbar";
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 1;
|
||||
scale: 1;
|
||||
dragable {
|
||||
x: 0 0 0;
|
||||
y: 1 1 0;
|
||||
confine: "sb_vbar_base";
|
||||
}
|
||||
description { state: "default" 0.0;
|
||||
min: 7 17;
|
||||
rel1 {
|
||||
relative: 0.5 0.5;
|
||||
offset: -1 0;
|
||||
to: "sb_vbar_base";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.5 0.5;
|
||||
offset: -1 0;
|
||||
to: "sb_vbar_base";
|
||||
}
|
||||
image {
|
||||
normal: "bt_sm_base2.png";
|
||||
border: 6 6 6 6;
|
||||
}
|
||||
}
|
||||
description { state: "clicked" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "bt_sm_base1.png";
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_over1";
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "e.dragable.vbar";
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to: "e.dragable.vbar";
|
||||
image {
|
||||
normal: "bt_sm_hilight.png";
|
||||
border: 6 6 6 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_over2";
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "e.dragable.vbar";
|
||||
rel2.to: "e.dragable.vbar";
|
||||
image {
|
||||
normal: "bt_sm_shine.png";
|
||||
border: 6 6 6 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "sb_vbar_a1";
|
||||
type: RECT;
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
min: 7 17;
|
||||
align: 0.5 0.0;
|
||||
/* aspect: 1.0 1.0; */
|
||||
aspect_preference: HORIZONTAL;
|
||||
color: 0 0 0 0;
|
||||
rel1 { to: "sb_vbar";
|
||||
relative: 0.0 0.0;
|
||||
offset: 0 0;
|
||||
}
|
||||
rel2 { to: "sb_vbar";
|
||||
relative: 1.0 0.0;
|
||||
offset: -1 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_a2";
|
||||
type: RECT;
|
||||
clip_to: "sb_vbar";
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
min: 7 17;
|
||||
align: 0.5 1.0;
|
||||
/* aspect: 1.0 1.0; */
|
||||
aspect_preference: HORIZONTAL;
|
||||
color: 0 0 0 0;
|
||||
rel1 {
|
||||
to: "sb_vbar";
|
||||
relative: 0.0 1.0;
|
||||
offset: 0 0;
|
||||
}
|
||||
rel2 {
|
||||
to: "sb_vbar";
|
||||
relative: 1.0 1.0;
|
||||
offset: -1 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "sb_vbar_show";
|
||||
signal: "e,action,show,vbar";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "sb_vbar";
|
||||
}
|
||||
program { name: "sb_vbar_hide";
|
||||
signal: "e,action,hide,vbar";
|
||||
source: "e";
|
||||
action: STATE_SET "hidden" 0.0;
|
||||
target: "sb_vbar";
|
||||
}
|
||||
program { name: "sb_vbar_a1_down2";
|
||||
signal: "mouse,down,1";
|
||||
source: "sb_vbar_a1";
|
||||
action: DRAG_VAL_STEP 0.0 -1.0;
|
||||
target: "e.dragable.vbar";
|
||||
}
|
||||
program { name: "sb_vbar_a2_down2";
|
||||
signal: "mouse,down,1";
|
||||
source: "sb_vbar_a2";
|
||||
action: DRAG_VAL_STEP 0.0 1.0;
|
||||
target: "e.dragable.vbar";
|
||||
}
|
||||
program { name: "sb_vbar_p1_down";
|
||||
signal: "mouse,down,1";
|
||||
source: "sb_vbar_p1";
|
||||
action: DRAG_VAL_PAGE 0.0 -1.0;
|
||||
target: "e.dragable.vbar";
|
||||
}
|
||||
program { name: "sb_vbar_p2_down";
|
||||
signal: "mouse,down,1";
|
||||
source: "sb_vbar_p2";
|
||||
action: DRAG_VAL_PAGE 0.0 1.0;
|
||||
target: "e.dragable.vbar";
|
||||
}
|
||||
program { name: "sb_vbar_down";
|
||||
signal: "mouse,down,1";
|
||||
source: "e.dragable.vbar";
|
||||
action: STATE_SET "clicked" 0.0;
|
||||
target: "e.dragable.vbar";
|
||||
}
|
||||
program { name: "sb_vbar_up";
|
||||
signal: "mouse,up,1";
|
||||
source: "e.dragable.vbar";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "e.dragable.vbar";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 745 B |
Binary file not shown.
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 271 B |
Binary file not shown.
After Width: | Height: | Size: 347 B |
|
@ -1,6 +1,8 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in everything.pc
|
||||
MODULE = everything
|
||||
|
||||
SUBDIRS = sources actions views
|
||||
|
||||
# data files for the module
|
||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||
files_DATA = \
|
||||
|
@ -29,7 +31,8 @@ module_la_SOURCES = $(EVRYHEADERS) \
|
|||
evry.c \
|
||||
evry_config.c \
|
||||
evry_plug_aggregator.c \
|
||||
evry_plug_actions.c
|
||||
evry_plug_actions.c \
|
||||
evry_view_plugin_tabs.c
|
||||
|
||||
|
||||
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
|
@ -42,99 +45,6 @@ installed_headers_DATA = $(EVRYHEADERS)
|
|||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = everything.pc
|
||||
|
||||
plugindir = $(libdir)/enlightenment/everything_plugins/core/$(MODULE_ARCH)
|
||||
|
||||
evry_plug_appsdir = $(plugindir)
|
||||
evry_plug_apps_LTLIBRARIES = evry_plug_apps.la
|
||||
evry_plug_apps_la_SOURCES = evry_plug_apps.c
|
||||
evry_plug_apps_la_LIBADD = @e_libs@
|
||||
evry_plug_apps_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_apps_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_borderdir = $(plugindir)
|
||||
evry_plug_border_LTLIBRARIES = evry_plug_border.la
|
||||
evry_plug_border_la_SOURCES = evry_plug_border.c
|
||||
evry_plug_border_la_LIBADD = @e_libs@
|
||||
evry_plug_border_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_border_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_border_actdir = $(plugindir)
|
||||
evry_plug_border_act_LTLIBRARIES = evry_plug_border_act.la
|
||||
evry_plug_border_act_la_SOURCES = evry_plug_border_act.c
|
||||
evry_plug_border_act_la_LIBADD = @e_libs@
|
||||
evry_plug_border_act_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_border_act_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_dir_browsedir = $(plugindir)
|
||||
evry_plug_dir_browse_LTLIBRARIES = evry_plug_dir_browse.la
|
||||
evry_plug_dir_browse_la_SOURCES = evry_plug_dir_browse.c
|
||||
evry_plug_dir_browse_la_LIBADD = @e_libs@
|
||||
evry_plug_dir_browse_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_dir_browse_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_trackerdir = $(plugindir)
|
||||
evry_plug_tracker_LTLIBRARIES = evry_plug_tracker.la
|
||||
evry_plug_tracker_la_SOURCES = evry_plug_tracker.c
|
||||
evry_plug_tracker_la_LIBADD = @e_libs@
|
||||
evry_plug_tracker_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_tracker_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_calcdir = $(plugindir)
|
||||
evry_plug_calc_LTLIBRARIES = evry_plug_calc.la
|
||||
evry_plug_calc_la_SOURCES = evry_plug_calc.c
|
||||
evry_plug_calc_la_LIBADD = @e_libs@
|
||||
evry_plug_calc_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_calc_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_configdir = $(plugindir)
|
||||
evry_plug_config_LTLIBRARIES = evry_plug_config.la
|
||||
evry_plug_config_la_SOURCES = evry_plug_config.c
|
||||
evry_plug_config_la_LIBADD = @e_libs@
|
||||
evry_plug_config_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_config_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_aspelldir = $(plugindir)
|
||||
evry_plug_aspell_LTLIBRARIES = evry_plug_aspell.la
|
||||
evry_plug_aspell_la_SOURCES = evry_plug_aspell.c
|
||||
evry_plug_aspell_la_LIBADD = @e_libs@
|
||||
evry_plug_aspell_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_aspell_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_clipboarddir = $(plugindir)
|
||||
evry_plug_clipboard_LTLIBRARIES = evry_plug_clipboard.la
|
||||
evry_plug_clipboard_la_SOURCES = evry_plug_clipboard.c
|
||||
evry_plug_clipboard_la_LIBADD = @e_libs@
|
||||
evry_plug_clipboard_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_clipboard_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_previewdir = $(plugindir)
|
||||
evry_plug_preview_LTLIBRARIES = evry_plug_preview.la
|
||||
evry_plug_preview_la_SOURCES = evry_plug_preview.c
|
||||
evry_plug_preview_la_LIBADD = @e_libs@
|
||||
evry_plug_preview_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_preview_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_view_listdir = $(plugindir)
|
||||
evry_plug_view_list_LTLIBRARIES = evry_plug_view_list.la
|
||||
evry_plug_view_list_la_SOURCES = evry_plug_view_list.c
|
||||
evry_plug_view_list_la_LIBADD = @e_libs@
|
||||
evry_plug_view_list_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_view_list_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_view_helpdir = $(plugindir)
|
||||
evry_plug_view_help_LTLIBRARIES = evry_plug_view_help.la
|
||||
evry_plug_view_help_la_SOURCES = evry_plug_view_help.c
|
||||
evry_plug_view_help_la_LIBADD = @e_libs@
|
||||
evry_plug_view_help_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_view_help_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_wallpaperdir = $(plugindir)
|
||||
evry_plug_wallpaper_LTLIBRARIES = evry_plug_wallpaper.la
|
||||
evry_plug_wallpaper_la_SOURCES = evry_plug_wallpaper.c
|
||||
evry_plug_wallpaper_la_LIBADD = @e_libs@
|
||||
evry_plug_wallpaper_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_wallpaper_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
uninstall:
|
||||
rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
|
||||
|
||||
rm -rf $(DESTDIR)$(libdir)/enlightenment/everything_plugins/core/
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
typedef struct _Config Config;
|
||||
typedef struct _Evry_Selector Evry_Selector;
|
||||
typedef struct _Tab_View Tab_View;
|
||||
|
||||
struct _Config
|
||||
{
|
||||
|
@ -57,8 +58,26 @@ struct _Evry_Selector
|
|||
|
||||
/* all plugins that belong to this selector*/
|
||||
Eina_List *plugins;
|
||||
|
||||
Evry_View *view;
|
||||
};
|
||||
|
||||
struct _Tab_View
|
||||
{
|
||||
Evas *evas;
|
||||
const Evry_State *state;
|
||||
|
||||
Evas_Object *o_tabs;
|
||||
Eina_List *tabs;
|
||||
|
||||
void (*update) (Tab_View *tv);
|
||||
void (*clear) (Tab_View *tv);
|
||||
int (*key_down) (Tab_View *tv, const Ecore_Event_Key *ev);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
EAPI extern E_Module_Api e_modapi;
|
||||
|
||||
EAPI void *e_modapi_init (E_Module *m);
|
||||
|
@ -77,6 +96,9 @@ void evry_plug_aggregator_free(Evry_Plugin *plugin);
|
|||
Evry_Plugin *evry_plug_actions_new(void);
|
||||
void evry_plug_actions_free(Evry_Plugin *plugin);
|
||||
|
||||
Tab_View *evry_tab_view_new(const Evry_State *s, Evas *e);
|
||||
void evry_tab_view_free(Tab_View *v);
|
||||
|
||||
extern Config *evry_conf;
|
||||
extern Evry_Selector **selectors;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
#define INPUTLEN 40
|
||||
#define MATCH_LAG 0.33
|
||||
#define MAX_FUZZ 150
|
||||
#define MAX_FUZZ 100
|
||||
#define MAX_WORDS 5
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ static void _evry_matches_update(Evry_Selector *sel);
|
|||
static void _evry_plugin_action(Evry_Selector *sel, int finished);
|
||||
static void _evry_plugin_select(Evry_State *s, Evry_Plugin *p);
|
||||
static void _evry_plugin_list_insert(Evry_State *s, Evry_Plugin *p);
|
||||
static void _evry_backspace(Evry_State *s);
|
||||
static int _evry_backspace(Evry_State *s);
|
||||
static void _evry_update(Evry_State *s, int fetch);
|
||||
static void _evry_update_text_label(Evry_State *s);
|
||||
static int _evry_clear(Evry_State *s);
|
||||
|
@ -59,7 +59,7 @@ static int _evry_selector_subjects_get(const char *plugin_name);
|
|||
static int _evry_selector_actions_get(Evry_Item *it);
|
||||
static int _evry_selector_objects_get(Evry_Action *act);
|
||||
|
||||
static void _evry_browse_item(Evry_Selector *sel);
|
||||
static int _evry_browse_item(Evry_Selector *sel);
|
||||
static void _evry_browse_back(Evry_Selector *sel);
|
||||
|
||||
static Evry_Window *_evry_window_new(E_Zone *zone);
|
||||
|
@ -245,7 +245,7 @@ evry_clear_input(void)
|
|||
}
|
||||
|
||||
|
||||
/* static int item_cnt = 0; */
|
||||
static int item_cnt = 0;
|
||||
|
||||
EAPI Evry_Item *
|
||||
evry_item_new(Evry_Item *base, Evry_Plugin *p, const char *label, void (*cb_free) (Evry_Item *item))
|
||||
|
@ -267,7 +267,7 @@ evry_item_new(Evry_Item *base, Evry_Plugin *p, const char *label, void (*cb_free
|
|||
|
||||
it->ref = 1;
|
||||
|
||||
/* item_cnt++; */
|
||||
item_cnt++;
|
||||
|
||||
return it;
|
||||
}
|
||||
|
@ -283,13 +283,10 @@ evry_item_free(Evry_Item *it)
|
|||
|
||||
/* printf("%d, %d\t free: %s\n",
|
||||
* it->ref, item_cnt - 1,
|
||||
* it->label);
|
||||
* item_cnt--; */
|
||||
* it->label); */
|
||||
item_cnt--;
|
||||
|
||||
if (it->label) eina_stringshare_del(it->label);
|
||||
/* if (it->uri) eina_stringshare_del(it->uri);
|
||||
* if (it->mime) eina_stringshare_del(it->mime); */
|
||||
|
||||
if (it->o_bg) evas_object_del(it->o_bg);
|
||||
if (it->o_icon) evas_object_del(it->o_icon);
|
||||
|
||||
|
@ -423,6 +420,7 @@ evry_fuzzy_match(const char *str, const char *match)
|
|||
unsigned int m_num = 0;
|
||||
unsigned int m_cnt = 0;
|
||||
unsigned int m_min[MAX_WORDS];
|
||||
unsigned int m_len = 0;
|
||||
|
||||
if (!match || !str) return 0;
|
||||
|
||||
|
@ -440,6 +438,11 @@ evry_fuzzy_match(const char *str, const char *match)
|
|||
for (m = match; ip && (*m != 0); m++)
|
||||
if (ip && ispunct(*m)) ip = 0;
|
||||
|
||||
m_len = strlen(match);
|
||||
|
||||
/* with less than 3 chars match must be a prefix */
|
||||
if (m_len < 3) m_len = 0;
|
||||
|
||||
next = str;
|
||||
m = match;
|
||||
|
||||
|
@ -489,11 +492,11 @@ evry_fuzzy_match(const char *str, const char *match)
|
|||
else
|
||||
offset += 3;
|
||||
|
||||
if (offset < 10)
|
||||
if (offset <= m_len * 3)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (min < MAX_FUZZ && offset < 10)
|
||||
if (min < MAX_FUZZ && offset <= m_len * 3)
|
||||
{
|
||||
/* first offset of match in word */
|
||||
if (!first)
|
||||
|
@ -1087,24 +1090,25 @@ _evry_state_pop(Evry_Selector *sel)
|
|||
sel->state = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
_evry_browse_item(Evry_Selector *sel)
|
||||
{
|
||||
Evry_State *s = sel->state;
|
||||
Evry_Item *it;
|
||||
Eina_List *l, *plugins = NULL;
|
||||
Evry_Plugin *p, *plugin;
|
||||
Evry_View *view = NULL;
|
||||
const char *type_out;
|
||||
|
||||
it = s->sel_item;
|
||||
|
||||
if (!it || !it->browseable)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
type_out = it->plugin->type_out;
|
||||
|
||||
if (!type_out)
|
||||
return;
|
||||
return 1;
|
||||
|
||||
if (it->plugin->begin &&
|
||||
(p = it->plugin->begin(it->plugin, it)))
|
||||
|
@ -1126,13 +1130,32 @@ _evry_browse_item(Evry_Selector *sel)
|
|||
}
|
||||
}
|
||||
|
||||
if (!plugins) return;
|
||||
_evry_view_hide(s->view);
|
||||
if (!plugins) return 1;
|
||||
|
||||
if (s->view)
|
||||
{
|
||||
_evry_view_hide(s->view);
|
||||
view = s->view->id;
|
||||
}
|
||||
|
||||
_evry_state_new(sel, plugins);
|
||||
_evry_matches_update(sel);
|
||||
_evry_selector_update(sel);
|
||||
_evry_list_win_update(sel->state);
|
||||
s = sel->state;
|
||||
|
||||
if (view && list->visible && s)
|
||||
{
|
||||
s->view = view->create(view, s, list->o_main);
|
||||
if (s->view)
|
||||
{
|
||||
_evry_view_show(s->view);
|
||||
s->view->update(s->view);
|
||||
}
|
||||
}
|
||||
|
||||
_evry_update_text_label(sel->state);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1281,15 +1304,18 @@ _evry_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
{
|
||||
if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT)
|
||||
_evry_plugin_action(selector, 0);
|
||||
else
|
||||
else if (!_evry_browse_item(selector))
|
||||
_evry_plugin_action(selector, 1);
|
||||
}
|
||||
else if (!strcmp(key, "Escape"))
|
||||
else if (!strcmp(key, "Escape"))
|
||||
evry_hide();
|
||||
else if (!strcmp(key, "Tab"))
|
||||
_evry_selectors_switch();
|
||||
else if (!strcmp(key, "BackSpace"))
|
||||
_evry_backspace(s);
|
||||
{
|
||||
if (!_evry_backspace(s))
|
||||
_evry_browse_back(selector);
|
||||
}
|
||||
else if (!strcmp(key, "Delete"))
|
||||
_evry_backspace(s);
|
||||
else if (_evry_view_key_press(s, ev))
|
||||
|
@ -1319,7 +1345,7 @@ _evry_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
_evry_backspace(Evry_State *s)
|
||||
{
|
||||
int len, val, pos;
|
||||
|
@ -1336,8 +1362,12 @@ _evry_backspace(Evry_State *s)
|
|||
|
||||
if ((pos == 0) || !isspace(val))
|
||||
_evry_update(s, 1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -38,7 +38,7 @@ _cb_sort(const void *data1, const void *data2)
|
|||
if (it1->priority - it2->priority)
|
||||
return (it1->priority - it2->priority);
|
||||
|
||||
return 0;
|
||||
return strcasecmp(it1->label, it2->label);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
# the module .so file
|
||||
INCLUDES = -I.. \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||
-I$(top_srcdir)/src/bin \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/modules \
|
||||
@e_cflags@
|
||||
|
||||
|
||||
plugindir = $(libdir)/enlightenment/everything_plugins/core/$(MODULE_ARCH)
|
||||
|
||||
evry_plug_appsdir = $(plugindir)
|
||||
evry_plug_apps_LTLIBRARIES = evry_plug_apps.la
|
||||
evry_plug_apps_la_SOURCES = evry_plug_apps.c
|
||||
evry_plug_apps_la_LIBADD = @e_libs@
|
||||
evry_plug_apps_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_apps_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_borderdir = $(plugindir)
|
||||
evry_plug_border_LTLIBRARIES = evry_plug_border.la
|
||||
evry_plug_border_la_SOURCES = evry_plug_border.c
|
||||
evry_plug_border_la_LIBADD = @e_libs@
|
||||
evry_plug_border_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_border_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_dir_browsedir = $(plugindir)
|
||||
evry_plug_dir_browse_LTLIBRARIES = evry_plug_dir_browse.la
|
||||
evry_plug_dir_browse_la_SOURCES = evry_plug_dir_browse.c
|
||||
evry_plug_dir_browse_la_LIBADD = @e_libs@
|
||||
evry_plug_dir_browse_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_dir_browse_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_trackerdir = $(plugindir)
|
||||
evry_plug_tracker_LTLIBRARIES = evry_plug_tracker.la
|
||||
evry_plug_tracker_la_SOURCES = evry_plug_tracker.c
|
||||
evry_plug_tracker_la_LIBADD = @e_libs@
|
||||
evry_plug_tracker_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_tracker_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_calcdir = $(plugindir)
|
||||
evry_plug_calc_LTLIBRARIES = evry_plug_calc.la
|
||||
evry_plug_calc_la_SOURCES = evry_plug_calc.c
|
||||
evry_plug_calc_la_LIBADD = @e_libs@
|
||||
evry_plug_calc_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_calc_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_configdir = $(plugindir)
|
||||
evry_plug_config_LTLIBRARIES = evry_plug_config.la
|
||||
evry_plug_config_la_SOURCES = evry_plug_config.c
|
||||
evry_plug_config_la_LIBADD = @e_libs@
|
||||
evry_plug_config_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_config_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_aspelldir = $(plugindir)
|
||||
evry_plug_aspell_LTLIBRARIES = evry_plug_aspell.la
|
||||
evry_plug_aspell_la_SOURCES = evry_plug_aspell.c
|
||||
evry_plug_aspell_la_LIBADD = @e_libs@
|
||||
evry_plug_aspell_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_aspell_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
|
|
@ -20,11 +20,16 @@ static Evry_Action *act3;
|
|||
static Evry_Action *act4;
|
||||
static Eina_List *exe_path = NULL;
|
||||
|
||||
static void _hash_free(void *data)
|
||||
{
|
||||
ITEM_APP(app, data);
|
||||
evry_item_free(EVRY_ITEM(app));
|
||||
}
|
||||
|
||||
|
||||
static Evry_Plugin *
|
||||
_begin(Evry_Plugin *plugin, const Evry_Item *item)
|
||||
{
|
||||
/* Plugin *p = (Plugin*) plugin; */
|
||||
PLUGIN(p, plugin);
|
||||
|
||||
const char *mime;
|
||||
|
@ -53,6 +58,8 @@ _begin(Evry_Plugin *plugin, const Evry_Item *item)
|
|||
}
|
||||
}
|
||||
|
||||
p->added = eina_hash_string_small_new(_hash_free);
|
||||
|
||||
return EVRY_PLUGIN(p);
|
||||
}
|
||||
|
||||
|
@ -61,8 +68,10 @@ _item_free(Evry_Item *item)
|
|||
{
|
||||
ITEM_APP(app, item);
|
||||
|
||||
if (app->file) eina_stringshare_del(app->file);
|
||||
if (app->desktop) efreet_desktop_free(app->desktop);
|
||||
if (app->desktop)
|
||||
efreet_desktop_free(app->desktop);
|
||||
if (app->file)
|
||||
eina_stringshare_del(app->file);
|
||||
|
||||
E_FREE(app);
|
||||
}
|
||||
|
@ -73,7 +82,9 @@ _cleanup(Evry_Plugin *plugin)
|
|||
PLUGIN(p, plugin);
|
||||
Efreet_Desktop *desktop;
|
||||
|
||||
EVRY_PLUGIN_ITEMS_FREE(p);
|
||||
eina_hash_free(p->added);
|
||||
|
||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||
|
||||
EINA_LIST_FREE(p->apps_mime, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
|
@ -94,6 +105,17 @@ _item_add(Plugin *p, Efreet_Desktop *desktop, char *file, int match)
|
|||
|
||||
if (!file) return 0;
|
||||
|
||||
if ((app = eina_hash_find(p->added, file)) &&
|
||||
(!desktop || (desktop == app->desktop)))
|
||||
{
|
||||
if (!eina_list_data_find_list(EVRY_PLUGIN(p)->items, app))
|
||||
{
|
||||
EVRY_ITEM(app)->fuzzy_match = match;
|
||||
EVRY_PLUGIN_ITEM_APPEND(p, app);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!desktop)
|
||||
{
|
||||
char match[4096];
|
||||
|
@ -101,9 +123,6 @@ _item_add(Plugin *p, Efreet_Desktop *desktop, char *file, int match)
|
|||
int len;
|
||||
char *tmp;
|
||||
|
||||
if (eina_hash_find(p->added, file))
|
||||
return 0;
|
||||
|
||||
len = strlen(file);
|
||||
tmp = ecore_file_app_exe_get(file);
|
||||
snprintf(match, sizeof(match), "%s*", tmp);
|
||||
|
@ -121,22 +140,12 @@ _item_add(Plugin *p, Efreet_Desktop *desktop, char *file, int match)
|
|||
}
|
||||
|
||||
free(tmp);
|
||||
|
||||
if (!desktop)
|
||||
eina_hash_add(p->added, file, file);
|
||||
}
|
||||
|
||||
if (desktop)
|
||||
{
|
||||
if ((d2 = eina_hash_find(p->added, file)) &&
|
||||
((desktop == d2) ||
|
||||
(!strcmp(desktop->exec, d2->exec))))
|
||||
return 0;
|
||||
|
||||
if (!already_refd)
|
||||
efreet_desktop_ref(desktop);
|
||||
eina_hash_add(p->added, file, desktop);
|
||||
file = NULL;
|
||||
}
|
||||
|
||||
app = E_NEW(Evry_Item_App, 1);
|
||||
|
@ -147,11 +156,14 @@ _item_add(Plugin *p, Efreet_Desktop *desktop, char *file, int match)
|
|||
evry_item_new(EVRY_ITEM(app), EVRY_PLUGIN(p), file, _item_free);
|
||||
|
||||
app->desktop = desktop;
|
||||
app->file = file;
|
||||
app->file = eina_stringshare_add(file);
|
||||
|
||||
EVRY_ITEM(app)->fuzzy_match = match;
|
||||
|
||||
EVRY_PLUGIN_ITEM_APPEND(p, app);
|
||||
|
||||
eina_hash_add(p->added, file, app);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -232,9 +244,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
char *file;
|
||||
int prio = 0;
|
||||
|
||||
p->added = eina_hash_string_small_new(NULL);
|
||||
|
||||
EVRY_PLUGIN_ITEMS_FREE(p);
|
||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||
|
||||
/* add apps for a given mimetype */
|
||||
if (plugin->type == type_action)
|
||||
|
@ -283,53 +293,52 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
_item_add(p, NULL, file, 1);
|
||||
}
|
||||
|
||||
/* TODO make this an action */
|
||||
/* show 'Run Command' item */
|
||||
if (input)
|
||||
{
|
||||
int found = 0;
|
||||
char *end;
|
||||
char *dir;
|
||||
char cmd[1024];
|
||||
char path[1024];
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "%s", input);
|
||||
|
||||
if ((end = strchr(input, ' ')))
|
||||
{
|
||||
int len = (end - input) + 1;
|
||||
if (len >= 0)
|
||||
snprintf(cmd, len, "%s", input);
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(exe_path, l, dir)
|
||||
{
|
||||
snprintf(path, sizeof(path), "%s/%s", dir, cmd);
|
||||
if (ecore_file_exists(path))
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
Evry_Item_App *app;
|
||||
app = E_NEW(Evry_Item_App, 1);
|
||||
evry_item_new(EVRY_ITEM(app), plugin, _("Run Command"), _item_free);
|
||||
app->file = eina_stringshare_add(input);
|
||||
EVRY_ITEM(app)->priority = 9999;
|
||||
EVRY_PLUGIN_ITEM_APPEND(p, app);
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "xterm -hold -e %s", input);
|
||||
app = E_NEW(Evry_Item_App, 1);
|
||||
evry_item_new(EVRY_ITEM(app), plugin, _("Run in Terminal"), _item_free);
|
||||
app->file = eina_stringshare_add(cmd);
|
||||
EVRY_ITEM(app)->priority = 1000;
|
||||
EVRY_PLUGIN_ITEM_APPEND(p, app);
|
||||
}
|
||||
}
|
||||
|
||||
eina_hash_free(p->added);
|
||||
/* if (input)
|
||||
* {
|
||||
* int found = 0;
|
||||
* char *end;
|
||||
* char *dir;
|
||||
* char cmd[1024];
|
||||
* char path[1024];
|
||||
*
|
||||
* snprintf(cmd, sizeof(cmd), "%s", input);
|
||||
*
|
||||
* if ((end = strchr(input, ' ')))
|
||||
* {
|
||||
* int len = (end - input) + 1;
|
||||
* if (len >= 0)
|
||||
* snprintf(cmd, len, "%s", input);
|
||||
* }
|
||||
*
|
||||
* EINA_LIST_FOREACH(exe_path, l, dir)
|
||||
* {
|
||||
* snprintf(path, sizeof(path), "%s/%s", dir, cmd);
|
||||
* if (ecore_file_exists(path))
|
||||
* {
|
||||
* found = 1;
|
||||
* break;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* if (found)
|
||||
* {
|
||||
* Evry_Item_App *app;
|
||||
* app = E_NEW(Evry_Item_App, 1);
|
||||
* evry_item_new(EVRY_ITEM(app), plugin, _("Run Command"), _item_free);
|
||||
* app->file = eina_stringshare_add(input);
|
||||
* EVRY_ITEM(app)->priority = 9999;
|
||||
* EVRY_PLUGIN_ITEM_APPEND(p, app);
|
||||
*
|
||||
* snprintf(cmd, sizeof(cmd), "xterm -hold -e %s", input);
|
||||
* app = E_NEW(Evry_Item_App, 1);
|
||||
* evry_item_new(EVRY_ITEM(app), plugin, _("Run in Terminal"), _item_free);
|
||||
* app->file = eina_stringshare_add(cmd);
|
||||
* EVRY_ITEM(app)->priority = 1000;
|
||||
* EVRY_PLUGIN_ITEM_APPEND(p, app);
|
||||
* }
|
||||
* } */
|
||||
|
||||
if (!plugin->items) return 0;
|
||||
|
||||
|
@ -376,16 +385,12 @@ static int
|
|||
_app_action(const Evry_Item *it1, const Evry_Item *it2)
|
||||
{
|
||||
E_Zone *zone;
|
||||
/* Evry_App *app = NULL; */
|
||||
Eina_List *files = NULL;
|
||||
char *exe = NULL;
|
||||
|
||||
if (!it1) return 0;
|
||||
/* app = it_app->data[0]; */
|
||||
ITEM_APP(app, it1);
|
||||
|
||||
if (!app) return 0;
|
||||
|
||||
zone = e_util_zone_current_get(e_manager_current_get());
|
||||
|
||||
if (app->desktop)
|
||||
|
@ -468,7 +473,6 @@ static int
|
|||
_open_with_action(Evry_Plugin *plugin, const Evry_Item *it)
|
||||
{
|
||||
PLUGIN(p, plugin);
|
||||
/* Plugin *p = (Plugin*) plugin; */
|
||||
|
||||
if (p->candidate)
|
||||
return _app_action(it, p->candidate);
|
||||
|
@ -480,7 +484,7 @@ static int
|
|||
_edit_app_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
||||
{
|
||||
ITEM_APP(app, it);
|
||||
/* Evry_App *app = it->data[0]; */
|
||||
|
||||
if (app->desktop)
|
||||
return 1;
|
||||
|
||||
|
@ -501,7 +505,7 @@ _edit_app_action(Evry_Action *act)
|
|||
snprintf(buf, 128, "%s/.local/share/applications/%s.desktop",
|
||||
e_user_homedir_get(), app->file);
|
||||
desktop = efreet_desktop_empty_new(eina_stringshare_add(buf));
|
||||
/* XXX check if this gets freed by efreet*/
|
||||
/* XXX check if this is freed by efreet*/
|
||||
desktop->exec = strdup(app->file);
|
||||
}
|
||||
|
||||
|
@ -514,7 +518,7 @@ static int
|
|||
_new_app_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
||||
{
|
||||
ITEM_APP(app, it);
|
||||
/* Evry_App *app = it->data[0]; */
|
||||
|
||||
if (app->desktop)
|
||||
return 1;
|
||||
|
||||
|
@ -527,7 +531,6 @@ _new_app_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
|||
static int
|
||||
_new_app_action(Evry_Action *act)
|
||||
{
|
||||
/* Evry_App *app; */
|
||||
char *name;
|
||||
char buf[4096];
|
||||
char *end;
|
||||
|
@ -535,7 +538,6 @@ _new_app_action(Evry_Action *act)
|
|||
int i;
|
||||
|
||||
ITEM_APP(app, act->item1);
|
||||
/* app = act->item1->data[0]; */
|
||||
|
||||
if (app->desktop)
|
||||
name = strdup(app->desktop->name);
|
||||
|
@ -571,8 +573,6 @@ _new_app_action(Evry_Action *act)
|
|||
else
|
||||
{
|
||||
efreet_desktop_save_as(app->desktop, buf);
|
||||
/* efreet_desktop_new(app->desktop->orig_path); */
|
||||
|
||||
desktop = efreet_desktop_new(buf);
|
||||
}
|
||||
|
||||
|
@ -607,14 +607,10 @@ _exec_border_action(Evry_Action *act)
|
|||
static int
|
||||
_exec_border_intercept(Evry_Action *act)
|
||||
{
|
||||
/* Evry_Item *it = E_NEW(Evry_Item, 1); */
|
||||
Evry_Item_App *app = E_NEW(Evry_Item_App, 1);
|
||||
E_Border *bd = act->item1->data;
|
||||
|
||||
app->desktop = bd->desktop;
|
||||
/* it->data[0] = app; */
|
||||
|
||||
/* act->item1 = it; */
|
||||
act->item1 = EVRY_ITEM(app);
|
||||
|
||||
return 1;
|
||||
|
@ -624,12 +620,8 @@ _exec_border_intercept(Evry_Action *act)
|
|||
static void
|
||||
_exec_border_cleanup(Evry_Action *act)
|
||||
{
|
||||
/* Evry_Item *it = (Evry_Item*) act->item1;
|
||||
* Evry_App *app = it->data[0]; */
|
||||
ITEM_APP(app, act->item1);
|
||||
|
||||
E_FREE(app);
|
||||
/* E_FREE(it); */
|
||||
}
|
||||
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
static Evry_Plugin *plugin;
|
||||
static Eina_List *handlers = NULL;
|
||||
|
||||
static Eina_Hash *border_hash = NULL;
|
||||
|
||||
static int
|
||||
_cb_border_remove(void *data, int type, void *event)
|
||||
|
@ -20,6 +20,7 @@ _cb_border_remove(void *data, int type, void *event)
|
|||
if (it->data == ev->border)
|
||||
{
|
||||
p->items = eina_list_remove(p->items, it);
|
||||
eina_hash_del_by_key(border_hash, ev->border);
|
||||
evry_item_free(it);
|
||||
evry_plugin_async_update(p, EVRY_ASYNC_UPDATE_ADD);
|
||||
break;
|
||||
|
@ -29,6 +30,12 @@ _cb_border_remove(void *data, int type, void *event)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void _hash_free(void *data)
|
||||
{
|
||||
Evry_Item *it = data;
|
||||
evry_item_free(it);
|
||||
}
|
||||
|
||||
static Evry_Plugin *
|
||||
_begin(Evry_Plugin *p, const Evry_Item *it)
|
||||
{
|
||||
|
@ -36,17 +43,20 @@ _begin(Evry_Plugin *p, const Evry_Item *it)
|
|||
(handlers, ecore_event_handler_add
|
||||
(E_EVENT_BORDER_REMOVE, _cb_border_remove, p));
|
||||
|
||||
border_hash = eina_hash_pointer_new(_hash_free);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
static void
|
||||
_cleanup(Evry_Plugin *p)
|
||||
{
|
||||
Evry_Item *it;
|
||||
Ecore_Event_Handler *h;
|
||||
|
||||
EINA_LIST_FREE(p->items, it)
|
||||
evry_item_free(it);
|
||||
eina_hash_free(border_hash);
|
||||
border_hash = NULL;
|
||||
|
||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||
|
||||
EINA_LIST_FREE(handlers, h)
|
||||
ecore_event_handler_del(h);
|
||||
|
@ -65,7 +75,15 @@ _item_free(Evry_Item *it)
|
|||
static void
|
||||
_item_add(Evry_Plugin *p, E_Border *bd, int match, int *prio)
|
||||
{
|
||||
Evry_Item *it;
|
||||
Evry_Item *it = NULL;
|
||||
|
||||
if ((it = eina_hash_find(border_hash, &bd)))
|
||||
{
|
||||
it->priority = *prio;
|
||||
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
||||
*prio += 1;
|
||||
return;
|
||||
}
|
||||
|
||||
it = evry_item_new(NULL, p, e_border_name_get(bd), _item_free);
|
||||
|
||||
|
@ -73,9 +91,10 @@ _item_add(Evry_Plugin *p, E_Border *bd, int match, int *prio)
|
|||
it->data = bd;
|
||||
it->fuzzy_match = match;
|
||||
it->priority = *prio;
|
||||
|
||||
*prio += 1;
|
||||
|
||||
eina_hash_add(border_hash, &bd, it);
|
||||
|
||||
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
||||
}
|
||||
|
||||
|
@ -100,7 +119,7 @@ _fetch(Evry_Plugin *p, const char *input)
|
|||
int prio = 0;
|
||||
int m1, m2;
|
||||
|
||||
_cleanup(p);
|
||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||
|
||||
zone = e_util_zone_current_get(e_manager_current_get());
|
||||
|
|
@ -15,7 +15,7 @@ struct _Plugin
|
|||
/* current list of files */
|
||||
Eina_List *cur;
|
||||
Eina_Bool command;
|
||||
Ecore_Idler *idler;
|
||||
Ecore_Idle_Enterer *idler;
|
||||
};
|
||||
|
||||
static Evry_Plugin *p1;
|
||||
|
@ -87,7 +87,7 @@ _dirbrowse_idler(void *data)
|
|||
Plugin *p = data;
|
||||
Eina_List *l;
|
||||
Evry_Item_File *file;
|
||||
int cnt = 10;
|
||||
int cnt = 20;
|
||||
|
||||
EINA_LIST_FOREACH(p->files, l, file)
|
||||
{
|
||||
|
@ -109,6 +109,8 @@ _dirbrowse_idler(void *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
e_util_wakeup();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -156,7 +158,7 @@ _read_directory(Plugin *p)
|
|||
free(filename);
|
||||
}
|
||||
|
||||
p->idler = ecore_idler_add(_dirbrowse_idler, p);
|
||||
p->idler = ecore_idle_enterer_before_add(_dirbrowse_idler, p);
|
||||
}
|
||||
|
||||
static Evry_Plugin *
|
||||
|
@ -205,7 +207,7 @@ _cleanup(Evry_Plugin *plugin)
|
|||
evry_item_free(EVRY_ITEM(file));
|
||||
|
||||
if (p->idler)
|
||||
ecore_idler_del(p->idler);
|
||||
ecore_idle_enterer_del(p->idler);
|
||||
|
||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||
|
|
@ -22,6 +22,7 @@ static E_DBus_Connection *conn = NULL;
|
|||
static Eina_List *plugins = NULL;
|
||||
static int _prio = 5;
|
||||
|
||||
|
||||
static Evry_Plugin *
|
||||
_begin(Evry_Plugin *plugin, const Evry_Item *it)
|
||||
{
|
||||
|
@ -105,11 +106,12 @@ _item_add(Plugin *p, char *path, char *mime, int prio)
|
|||
evry_item_new(EVRY_ITEM(file), EVRY_PLUGIN(p), filename, _item_free);
|
||||
file->uri = eina_stringshare_add(path);
|
||||
|
||||
EVRY_ITEM(file)->priority = prio;
|
||||
/* EVRY_ITEM(file)->priority = prio; */
|
||||
|
||||
if (folder)
|
||||
{
|
||||
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
||||
EVRY_ITEM(file)->priority = 1;
|
||||
file->mime = eina_stringshare_add("x-directory/normal");
|
||||
}
|
||||
else
|
||||
|
@ -148,7 +150,10 @@ _cb_sort(const void *data1, const void *data2)
|
|||
it1 = data1;
|
||||
it2 = data2;
|
||||
|
||||
return (it2->priority - it1->priority);
|
||||
if (it1->priority - it2->priority)
|
||||
return (it1->priority - it2->priority);
|
||||
|
||||
return strcasecmp(it1->label, it2->label);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -362,7 +367,7 @@ _plugin_new(const char *name, int type, char *service, int max_hits, int begin)
|
|||
evry_plugin_new(EVRY_PLUGIN(p), name, type, "", "FILE", 0, NULL, NULL,
|
||||
NULL, _cleanup, _fetch,
|
||||
NULL, _icon_get, NULL, NULL);
|
||||
else
|
||||
else if (type == type_object)
|
||||
evry_plugin_new(EVRY_PLUGIN(p), name, type, "APPLICATION", "FILE", 0, NULL, NULL,
|
||||
_begin, _cleanup, _fetch,
|
||||
NULL, _icon_get, NULL, NULL);
|
||||
|
@ -372,6 +377,71 @@ _plugin_new(const char *name, int type, char *service, int max_hits, int begin)
|
|||
evry_plugin_register(EVRY_PLUGIN(p), _prio++);
|
||||
}
|
||||
|
||||
static void
|
||||
_dbus_cb_version(void *data, DBusMessage *msg, DBusError *error)
|
||||
{
|
||||
DBusMessageIter iter;
|
||||
Plugin *p;
|
||||
int version;
|
||||
|
||||
if (dbus_error_is_set(error))
|
||||
{
|
||||
printf("Error: %s - %s\n", error->name, error->message);
|
||||
e_dbus_connection_close(conn);
|
||||
|
||||
EINA_LIST_FREE(plugins, p)
|
||||
{
|
||||
if (p->condition[0]) free(p->condition);
|
||||
|
||||
EVRY_PLUGIN_FREE(p);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
dbus_message_iter_init(msg, &iter);
|
||||
|
||||
if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_INT32)
|
||||
dbus_message_iter_get_basic(&iter, &version);
|
||||
|
||||
printf("tracker version %d\n", version);
|
||||
|
||||
if (version < 690)
|
||||
{
|
||||
e_dbus_connection_close(conn);
|
||||
|
||||
EINA_LIST_FREE(plugins, p)
|
||||
{
|
||||
if (p->condition[0]) free(p->condition);
|
||||
|
||||
EVRY_PLUGIN_FREE(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_get_version(void)
|
||||
{
|
||||
DBusMessage *msg;
|
||||
|
||||
msg = dbus_message_new_method_call("org.freedesktop.Tracker",
|
||||
"/org/freedesktop/Tracker",
|
||||
"org.freedesktop.Tracker",
|
||||
"GetVersion");
|
||||
|
||||
e_dbus_message_send(conn, msg, _dbus_cb_version, -1, NULL);
|
||||
dbus_message_unref(msg);
|
||||
}
|
||||
|
||||
|
||||
/* static Evry_Plugin *
|
||||
* _begin_subject(Evry_Plugin *plugin, const Evry_Item *it)
|
||||
* {
|
||||
* if (!conn) return NULL;
|
||||
*
|
||||
* return plugin;
|
||||
* } */
|
||||
|
||||
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
|
@ -389,6 +459,8 @@ _init(void)
|
|||
_plugin_new("Find Files", type_object, "Files", 20, 1);
|
||||
_plugin_new("Folders", type_object, "Folders", 20, 0);
|
||||
|
||||
_get_version();
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
# the module .so file
|
||||
INCLUDES = -I.. \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||
-I$(top_srcdir)/src/bin \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/modules \
|
||||
@e_cflags@
|
||||
|
||||
plugindir = $(libdir)/enlightenment/everything_plugins/core/$(MODULE_ARCH)
|
||||
|
||||
|
||||
evry_plug_previewdir = $(plugindir)
|
||||
evry_plug_preview_LTLIBRARIES = evry_plug_preview.la
|
||||
evry_plug_preview_la_SOURCES = evry_plug_preview.c
|
||||
evry_plug_preview_la_LIBADD = @e_libs@
|
||||
evry_plug_preview_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_preview_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_view_listdir = $(plugindir)
|
||||
evry_plug_view_list_LTLIBRARIES = evry_plug_view_list.la
|
||||
evry_plug_view_list_la_SOURCES = evry_plug_view_list.c
|
||||
evry_plug_view_list_la_LIBADD = @e_libs@
|
||||
evry_plug_view_list_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_view_list_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_view_helpdir = $(plugindir)
|
||||
evry_plug_view_help_LTLIBRARIES = evry_plug_view_help.la
|
||||
evry_plug_view_help_la_SOURCES = evry_plug_view_help.c
|
||||
evry_plug_view_help_la_LIBADD = @e_libs@
|
||||
evry_plug_view_help_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_view_help_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_view_thumbdir = $(plugindir)
|
||||
evry_plug_view_thumb_LTLIBRARIES = evry_plug_view_thumb.la
|
||||
evry_plug_view_thumb_la_SOURCES = evry_plug_view_thumb.c
|
||||
evry_plug_view_thumb_la_LIBADD = @e_libs@
|
||||
evry_plug_view_thumb_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_view_thumb_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ _init(void)
|
|||
view->update = &_view_update;
|
||||
view->clear = &_view_clear;
|
||||
view->cb_key_down = &_cb_key_down;
|
||||
evry_view_register(view, 2);
|
||||
evry_view_register(view, 3);
|
||||
|
||||
view_types = eina_stringshare_add("FILE");
|
||||
|
|
@ -1,35 +1,25 @@
|
|||
#include "Evry.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
typedef struct _View View;
|
||||
typedef struct _List_Tab List_Tab;
|
||||
|
||||
struct _List_Tab
|
||||
{
|
||||
Evry_Plugin *plugin;
|
||||
Evas_Object *o_tab;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct _View
|
||||
{
|
||||
Evry_View view;
|
||||
Evas *evas;
|
||||
const Evas_Object *swallow;
|
||||
|
||||
const Evry_State *state;
|
||||
Tab_View *tabs;
|
||||
|
||||
Evas_Object *o_list;
|
||||
Evas_Object *o_tabs;
|
||||
|
||||
Eina_List *items;
|
||||
Eina_List *tabs;
|
||||
|
||||
Ecore_Idler *item_idler;
|
||||
|
||||
Ecore_Idle_Enterer *item_idler;
|
||||
|
||||
double scroll_align_to;
|
||||
double scroll_align;
|
||||
|
||||
|
||||
|
||||
/* int ev_last_is_mouse;
|
||||
* Evry_Item *item_mouseover; */
|
||||
/* Ecore_Timer *scroll_timer; */
|
||||
|
@ -47,7 +37,7 @@ _list_clear(View *v)
|
|||
|
||||
if (v->item_idler)
|
||||
{
|
||||
ecore_idler_del(v->item_idler);
|
||||
ecore_idle_enterer_del(v->item_idler);
|
||||
v->item_idler = NULL;
|
||||
}
|
||||
|
||||
|
@ -86,7 +76,6 @@ _list_clear(View *v)
|
|||
|
||||
e_box_thaw(v->o_list);
|
||||
evas_event_thaw(v->evas);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -154,6 +143,8 @@ _list_item_idler(void *data)
|
|||
}
|
||||
e_box_thaw(v->o_list);
|
||||
|
||||
e_util_wakeup();
|
||||
|
||||
if (cnt == 0) return 1;
|
||||
end:
|
||||
v->item_idler = NULL;
|
||||
|
@ -244,7 +235,7 @@ _list_update(View *v)
|
|||
|
||||
_list_scroll_to(v, v->state->sel_item);
|
||||
|
||||
v->item_idler = ecore_idler_add(_list_item_idler, v);
|
||||
v->item_idler = ecore_idle_enterer_add(_list_item_idler, v);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -332,219 +323,14 @@ _list_item_last(View *v)
|
|||
evry_item_select(v->state, it);
|
||||
}
|
||||
|
||||
static void
|
||||
_list_tab_scroll_to(View *v, Evry_Plugin *p)
|
||||
{
|
||||
int n, w, mw, i;
|
||||
double align;
|
||||
Eina_List *l;
|
||||
const Evry_State *s = v->state;
|
||||
|
||||
for(i = 0, l = s->cur_plugins; l; l = l->next, i++)
|
||||
if (l->data == p) break;
|
||||
|
||||
n = eina_list_count(s->cur_plugins);
|
||||
|
||||
e_box_min_size_get(v->o_tabs, &mw, NULL);
|
||||
evas_object_geometry_get(v->o_tabs, NULL, NULL, &w, NULL);
|
||||
|
||||
if (mw <= w + 5)
|
||||
{
|
||||
e_box_align_set(v->o_tabs, 0.0, 0.5);
|
||||
return;
|
||||
}
|
||||
|
||||
if (n > 1)
|
||||
{
|
||||
align = (double)i / (double)(n - 1);
|
||||
/* if (evry_conf->scroll_animate)
|
||||
* {
|
||||
* if (!scroll_timer)
|
||||
* scroll_timer = ecore_timer_add(0.01, _evry_list_scroll_timer, NULL);
|
||||
* if (!scroll_animator)
|
||||
* scroll_animator = ecore_animator_add(_evry_list_animator, NULL);
|
||||
* }
|
||||
* else */
|
||||
e_box_align_set(v->o_tabs, 1.0 - align, 0.5);
|
||||
}
|
||||
else
|
||||
e_box_align_set(v->o_tabs, 1.0, 0.5);
|
||||
}
|
||||
|
||||
static void
|
||||
_list_tabs_update(View *v)
|
||||
{
|
||||
|
||||
Eina_List *l, *ll;
|
||||
Evry_Plugin *p;
|
||||
const Evry_State *s = v->state;
|
||||
List_Tab *tab;
|
||||
Evas_Coord mw, cw, w;
|
||||
Evas_Object *o;
|
||||
|
||||
evas_object_geometry_get(v->o_tabs, NULL, NULL, &w, NULL);
|
||||
|
||||
/* remove tabs for not active plugins */
|
||||
e_box_freeze(v->o_tabs);
|
||||
|
||||
EINA_LIST_FOREACH(v->tabs, l, tab)
|
||||
{
|
||||
e_box_unpack(tab->o_tab);
|
||||
evas_object_hide(tab->o_tab);
|
||||
}
|
||||
|
||||
/* show/update tabs of active plugins */
|
||||
EINA_LIST_FOREACH(s->cur_plugins, l, p)
|
||||
{
|
||||
EINA_LIST_FOREACH(v->tabs, ll, tab)
|
||||
if (tab->plugin == p) break;
|
||||
|
||||
if (!tab && (strlen(p->name) > 0))
|
||||
{
|
||||
tab = E_NEW(List_Tab, 1);
|
||||
tab->plugin = p;
|
||||
|
||||
o = edje_object_add(v->evas);
|
||||
e_theme_edje_object_set(o, "base/theme/everything",
|
||||
"e/modules/everything/tab_item");
|
||||
edje_object_part_text_set(o, "e.text.label", p->name);
|
||||
|
||||
tab->o_tab = o;
|
||||
|
||||
v->tabs = eina_list_append(v->tabs, tab);
|
||||
}
|
||||
|
||||
if (!tab) continue;
|
||||
|
||||
o = tab->o_tab;
|
||||
evas_object_show(o);
|
||||
e_box_pack_end(v->o_tabs, o);
|
||||
|
||||
edje_object_size_min_calc(o, &cw, NULL);
|
||||
edje_object_size_min_get(o, &mw, NULL);
|
||||
|
||||
e_box_pack_options_set(o, 1, 1, 1, 0, 0.0, 0.5,
|
||||
(mw < cw ? cw : mw), 10,
|
||||
(w ? w/3 : 150), 9999);
|
||||
if (s->plugin == p)
|
||||
edje_object_signal_emit(o, "e,state,selected", "e");
|
||||
else
|
||||
edje_object_signal_emit(o, "e,state,unselected", "e");
|
||||
}
|
||||
|
||||
e_box_thaw(v->o_tabs);
|
||||
|
||||
if (s->plugin)
|
||||
_list_tab_scroll_to(v, s->plugin);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_list_tabs_clear(View *v)
|
||||
{
|
||||
Eina_List *l;
|
||||
List_Tab *tab;
|
||||
|
||||
e_box_freeze(v->o_tabs);
|
||||
EINA_LIST_FOREACH(v->tabs, l, tab)
|
||||
{
|
||||
e_box_unpack(tab->o_tab);
|
||||
evas_object_hide(tab->o_tab);
|
||||
}
|
||||
e_box_thaw(v->o_tabs);
|
||||
}
|
||||
|
||||
static void
|
||||
_list_plugin_select(View *v, Evry_Plugin *p)
|
||||
{
|
||||
evry_plugin_select(v->state, p);
|
||||
|
||||
_list_tabs_update(v);
|
||||
_list_tab_scroll_to(v, p);
|
||||
_list_update(v);
|
||||
}
|
||||
|
||||
static void
|
||||
_list_plugin_next(View *v)
|
||||
{
|
||||
Eina_List *l;
|
||||
Evry_Plugin *p = NULL;
|
||||
const Evry_State *s = v->state;
|
||||
|
||||
if (!s->plugin) return;
|
||||
|
||||
l = eina_list_data_find_list(s->cur_plugins, s->plugin);
|
||||
|
||||
if (l && l->next)
|
||||
p = l->next->data;
|
||||
else if (s->plugin != s->cur_plugins->data)
|
||||
p = s->cur_plugins->data;
|
||||
|
||||
if (p) _list_plugin_select(v, p);
|
||||
}
|
||||
|
||||
static void
|
||||
_list_plugin_next_by_name(View *v, const char *key)
|
||||
{
|
||||
Eina_List *l;
|
||||
Evry_Plugin *p, *first = NULL, *next = NULL;
|
||||
int found = 0;
|
||||
const Evry_State *s = v->state;
|
||||
|
||||
if (!s->plugin) return;
|
||||
|
||||
EINA_LIST_FOREACH(s->cur_plugins, l, p)
|
||||
{
|
||||
if (p->name && (!strncasecmp(p->name, key, 1)))
|
||||
{
|
||||
if (!first) first = p;
|
||||
|
||||
if (found && !next)
|
||||
next = p;
|
||||
}
|
||||
if (p == s->plugin) found = 1;
|
||||
}
|
||||
|
||||
if (next)
|
||||
p = next;
|
||||
else if (first != s->plugin)
|
||||
p = first;
|
||||
else
|
||||
p = NULL;
|
||||
|
||||
if (p) _list_plugin_select(v, p);
|
||||
}
|
||||
|
||||
static void
|
||||
_list_plugin_prev(View *v)
|
||||
{
|
||||
Eina_List *l;
|
||||
Evry_Plugin *p = NULL;
|
||||
const Evry_State *s = v->state;
|
||||
|
||||
if (!s->plugin) return;
|
||||
|
||||
l = eina_list_data_find_list(s->cur_plugins, s->plugin);
|
||||
|
||||
if (l && l->prev)
|
||||
p = l->prev->data;
|
||||
else
|
||||
{
|
||||
l = eina_list_last(s->cur_plugins);
|
||||
if (s->plugin != l->data)
|
||||
p = l->data;
|
||||
}
|
||||
|
||||
if (p) _list_plugin_select(v, p);
|
||||
}
|
||||
|
||||
static int
|
||||
_update(Evry_View *view)
|
||||
{
|
||||
VIEW(v, view);
|
||||
|
||||
v->tabs->update(v->tabs);
|
||||
_list_update(v);
|
||||
_list_tabs_update(v);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -553,11 +339,10 @@ _clear(Evry_View *view)
|
|||
{
|
||||
VIEW(v, view);
|
||||
|
||||
v->tabs->clear(v->tabs);
|
||||
_list_clear(v);
|
||||
_list_tabs_clear(v);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
_cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
|
||||
{
|
||||
|
@ -565,7 +350,12 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
|
|||
|
||||
const char *key = ev->key;
|
||||
|
||||
if (!strcmp(key, "Up"))
|
||||
if (v->tabs->key_down(v->tabs, ev))
|
||||
{
|
||||
_list_update(v);
|
||||
return 1;
|
||||
}
|
||||
else if (!strcmp(key, "Up"))
|
||||
_list_item_prev(v);
|
||||
else if (!strcmp(key, "Down"))
|
||||
_list_item_next(v);
|
||||
|
@ -573,29 +363,6 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
|
|||
_list_item_last(v);
|
||||
else if (!strcmp(key, "Home"))
|
||||
_list_item_first(v);
|
||||
else if (!strcmp(key, "Next"))
|
||||
_list_plugin_next(v);
|
||||
else if (!strcmp(key, "Prior"))
|
||||
_list_plugin_prev(v);
|
||||
else if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT)
|
||||
{
|
||||
if (!strcmp(key, "Left"))
|
||||
_list_plugin_prev(v);
|
||||
else if (!strcmp(key, "Right"))
|
||||
_list_plugin_next(v);
|
||||
else return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL)
|
||||
{
|
||||
if (!strcmp(key, "Left"))
|
||||
_list_plugin_prev(v);
|
||||
else if (!strcmp(key, "Right"))
|
||||
_list_plugin_next(v);
|
||||
else if (ev->compose)
|
||||
_list_plugin_next_by_name(v, key);
|
||||
}
|
||||
else return 0;
|
||||
|
||||
return 1;
|
||||
|
@ -610,7 +377,6 @@ _create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow)
|
|||
v = E_NEW(View, 1);
|
||||
v->view = *view;
|
||||
v->evas = evas_object_evas_get(swallow);
|
||||
v->swallow = swallow;
|
||||
v->state = s;
|
||||
|
||||
o = e_box_add(v->evas);
|
||||
|
@ -619,11 +385,8 @@ _create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow)
|
|||
v->view.o_list = o;
|
||||
v->o_list = o;
|
||||
|
||||
o = e_box_add(v->evas);
|
||||
e_box_orientation_set(o, 1);
|
||||
e_box_homogenous_set(o, 1);
|
||||
v->view.o_bar = o;
|
||||
v->o_tabs = o;
|
||||
v->tabs = evry_tab_view_new(s, v->evas);
|
||||
v->view.o_bar = v->tabs->o_tabs;
|
||||
|
||||
return EVRY_VIEW(v);
|
||||
}
|
||||
|
@ -632,18 +395,10 @@ static void
|
|||
_destroy(Evry_View *view)
|
||||
{
|
||||
VIEW(v, view);
|
||||
List_Tab *tab;
|
||||
|
||||
_clear(view);
|
||||
|
||||
EINA_LIST_FREE(v->tabs, tab)
|
||||
{
|
||||
evas_object_del(tab->o_tab);
|
||||
E_FREE(tab);
|
||||
}
|
||||
|
||||
evas_object_del(v->o_list);
|
||||
evas_object_del(v->o_tabs);
|
||||
evry_tab_view_free(v->tabs);
|
||||
|
||||
E_FREE(v);
|
||||
}
|
|
@ -0,0 +1,971 @@
|
|||
#include "e_mod_main.h"
|
||||
|
||||
typedef struct _View View;
|
||||
typedef struct _Smart_Data Smart_Data;
|
||||
typedef struct _Item Item;
|
||||
|
||||
struct _View
|
||||
{
|
||||
Evry_View view;
|
||||
Evas *evas;
|
||||
const Evry_State *state;
|
||||
Tab_View *tabs;
|
||||
|
||||
Evas_Object *bg, *sframe, *span;
|
||||
int iw, ih;
|
||||
};
|
||||
|
||||
struct _Smart_Data
|
||||
{
|
||||
View *view;
|
||||
Eina_List *items;
|
||||
Item *sel_item;
|
||||
Ecore_Idle_Enterer *idle_enter;
|
||||
Ecore_Animator *animator;
|
||||
Evas_Coord x, y, w, h;
|
||||
Evas_Coord cx, cy, cw, ch;
|
||||
Evas_Coord sx, sy;
|
||||
int id_num;
|
||||
int sort_num;
|
||||
double selmove;
|
||||
Eina_Bool selin : 1;
|
||||
Eina_Bool selout : 1;
|
||||
Eina_Bool jump2hi : 1;
|
||||
/* */
|
||||
Eina_Bool update : 1;
|
||||
|
||||
int zoom;
|
||||
|
||||
/* Ecore_Timer *seltimer; */
|
||||
/* double seltime; */
|
||||
};
|
||||
|
||||
struct _Item
|
||||
{
|
||||
Evry_Item *item;
|
||||
Evas_Object *obj;
|
||||
Evas_Coord x, y, w, h;
|
||||
Evas_Object *frame, *image, *thumb;
|
||||
Eina_Bool selected : 1;
|
||||
Eina_Bool have_thumb : 1;
|
||||
Eina_Bool do_thumb : 1;
|
||||
Eina_Bool get_thumb : 1;
|
||||
Eina_Bool showing : 1;
|
||||
Eina_Bool visible : 1;
|
||||
Eina_Bool changed : 1;
|
||||
int pos;
|
||||
};
|
||||
|
||||
static Evry_View *view = NULL;
|
||||
static const char *view_types = NULL;
|
||||
|
||||
static void
|
||||
_thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
Item *it = data;
|
||||
|
||||
if (!it->frame) return;
|
||||
|
||||
e_icon_size_get(it->thumb, &w, &h);
|
||||
edje_extern_object_aspect_set(it->thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
|
||||
edje_object_part_swallow(it->frame, "e.swallow.icon", it->thumb);
|
||||
evas_object_show(it->thumb);
|
||||
it->have_thumb = EINA_TRUE;
|
||||
it->do_thumb = EINA_FALSE;
|
||||
|
||||
if (it->image) evas_object_del(it->image);
|
||||
it->image = NULL;
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
_e_smart_reconfigure_do(void *data)
|
||||
{
|
||||
Evas_Object *obj = data;
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
Eina_List *l;
|
||||
Item *it;
|
||||
int iw, ih, redo = 0, changed = 0;
|
||||
static int recursion = 0;
|
||||
Evas_Coord x, y, xx, yy, ww, hh, mw, mh, ox, oy, dd;
|
||||
|
||||
if (!sd) return 0;
|
||||
if (sd->cx > (sd->cw - sd->w)) sd->cx = sd->cw - sd->w;
|
||||
if (sd->cy > (sd->ch - sd->h)) sd->cy = sd->ch - sd->h;
|
||||
if (sd->cx < 0) sd->cx = 0;
|
||||
if (sd->cy < 0) sd->cy = 0;
|
||||
e_scrollframe_child_viewport_size_get(sd->view->sframe,
|
||||
&sd->view->iw,
|
||||
&sd->view->ih);
|
||||
|
||||
if (sd->zoom == 0)
|
||||
{
|
||||
int cnt = eina_list_count(sd->items);
|
||||
|
||||
sd->view->iw *= 3;
|
||||
sd->view->iw /= 4;
|
||||
|
||||
if (cnt < 3)
|
||||
iw = (double)sd->w / 2.5;
|
||||
else if (cnt < 7)
|
||||
iw = sd->w / 3;
|
||||
else
|
||||
iw = sd->w / 4;
|
||||
}
|
||||
else if (sd->zoom == 1)
|
||||
{
|
||||
sd->view->iw *= 2;
|
||||
sd->view->iw /= 3;
|
||||
iw = sd->w / 3;
|
||||
}
|
||||
else if (sd->zoom == 2)
|
||||
{
|
||||
iw = sd->w;
|
||||
}
|
||||
|
||||
if (sd->view->iw <= 0) sd->view->iw = 1;
|
||||
if (sd->view->ih <= 0) sd->view->ih = 1;
|
||||
|
||||
x = 0;
|
||||
y = 0;
|
||||
ww = iw;
|
||||
hh = (sd->view->ih * iw) / (sd->view->iw);
|
||||
ih = hh;
|
||||
|
||||
mw = mh = 0;
|
||||
EINA_LIST_FOREACH(sd->items, l, it)
|
||||
{
|
||||
xx = sd->x - sd->cx + x;
|
||||
if (x > (sd->w - ww))
|
||||
{
|
||||
x = 0;
|
||||
y += hh;
|
||||
xx = sd->x - sd->cx + x;
|
||||
}
|
||||
yy = sd->y - sd->cy + y;
|
||||
it->x = x;
|
||||
it->y = y;
|
||||
it->w = ww;
|
||||
it->h = hh;
|
||||
if (it->selected)
|
||||
{
|
||||
sd->sx = it->x + (it->w / 2);
|
||||
sd->sy = it->y + (it->h / 2);
|
||||
}
|
||||
if ((x + ww) > mw)mw = x + ww;
|
||||
if ((y + hh) > mh) mh = y + hh;
|
||||
x += ww;
|
||||
}
|
||||
if ((mw != sd->cw) || (mh != sd->ch))
|
||||
{
|
||||
sd->cw = mw;
|
||||
sd->ch = mh;
|
||||
if (sd->cx > (sd->cw - sd->w))
|
||||
{
|
||||
sd->cx = sd->cw - sd->w;
|
||||
redo = 1;
|
||||
}
|
||||
if (sd->cy > (sd->ch - sd->h))
|
||||
{
|
||||
sd->cy = sd->ch - sd->h;
|
||||
redo = 1;
|
||||
}
|
||||
if (sd->cx < 0)
|
||||
{
|
||||
sd->cx = 0;
|
||||
redo = 1;
|
||||
}
|
||||
if (sd->cy < 0)
|
||||
{
|
||||
sd->cy = 0;
|
||||
redo = 1;
|
||||
}
|
||||
if (redo)
|
||||
{
|
||||
recursion = 1;
|
||||
_e_smart_reconfigure_do(obj);
|
||||
recursion = 0;
|
||||
}
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
ox = 0;
|
||||
if (sd->w > sd->cw) ox = (sd->w - sd->cw) / 2;
|
||||
oy = 0;
|
||||
if (sd->h > sd->ch) oy = (sd->h - sd->ch) / 2;
|
||||
|
||||
|
||||
if (sd->sel_item && !sd->update)
|
||||
{
|
||||
int y, h;
|
||||
it = sd->sel_item;
|
||||
|
||||
e_scrollframe_child_pos_get(sd->view->sframe, NULL, &y);
|
||||
e_scrollframe_child_viewport_size_get(sd->view->sframe, NULL, &h);
|
||||
|
||||
if ((it->y + it->h) - y >= h - it->h)
|
||||
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y - (2 - sd->zoom) * it->h);
|
||||
else if (it->y < y)
|
||||
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y);
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(sd->items, l, it)
|
||||
{
|
||||
Evas_Coord dx, dy, vw, vh;
|
||||
|
||||
dx = dy = 0;
|
||||
if ((sd->sx >= 0) &&
|
||||
(sd->selmove > 0.0))
|
||||
{
|
||||
double a, d; //, di;
|
||||
int sum = 0;
|
||||
/* char *p; */
|
||||
|
||||
// -----0X0+++++
|
||||
dx = (it->x + (it->w / 2)) - sd->sx;
|
||||
dy = (it->y + (it->h / 2)) - sd->sy;
|
||||
if (dx > 0)
|
||||
{
|
||||
/* |/
|
||||
* +-- */
|
||||
if (dy < 0)
|
||||
a = -atan(-(double)dy / (double)dx);
|
||||
/* +--
|
||||
* |\ */
|
||||
else
|
||||
a = atan((double)dy / (double)dx);
|
||||
}
|
||||
else if (dx == 0)
|
||||
{
|
||||
/* |
|
||||
* + */
|
||||
if (dy < 0) a = -M_PI / 2;
|
||||
/* +
|
||||
* | */
|
||||
else a = M_PI / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* \|
|
||||
* --+ */
|
||||
if (dy < 0)
|
||||
a = -M_PI + atan((double)dy / (double)dx);
|
||||
/* --+
|
||||
* /| */
|
||||
else
|
||||
a = M_PI - atan(-(double)dy / (double)dx);
|
||||
}
|
||||
d = sqrt((double)(dx * dx) + (double)(dy * dy));
|
||||
dx = dy = 0;
|
||||
|
||||
sum = 0;
|
||||
xx = sd->sx - sd->cx + ox;
|
||||
yy = sd->sy - sd->cy + oy;
|
||||
if (xx < (sd->w / 2)) dx = sd->w - xx;
|
||||
else dx = xx;
|
||||
if (yy < (sd->h / 2)) dy = sd->h - yy;
|
||||
else dy = yy;
|
||||
dd = dx - d;
|
||||
if (dy > dx) dd = dy - d;
|
||||
if (dd < 0) dd = 0;
|
||||
dy = sin(a) * sd->selmove * (dd * 0.9);
|
||||
dx = cos(a) * sd->selmove * (dd * 0.9);
|
||||
}
|
||||
xx = sd->x - sd->cx + it->x + ox;
|
||||
yy = sd->y - sd->cy + it->y + oy;
|
||||
|
||||
evas_object_geometry_get(sd->view->span, NULL, NULL, &vw, &vh);
|
||||
|
||||
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, - it->h*2, vw, vh + it->h*4))
|
||||
{
|
||||
if (!it->frame)
|
||||
{
|
||||
it->frame = edje_object_add(sd->view->evas);
|
||||
|
||||
e_theme_edje_object_set(it->frame, "base/theme/widgets",
|
||||
"e/modules/everything/thumbview/main/mini");
|
||||
|
||||
evas_object_smart_member_add(it->frame, obj);
|
||||
evas_object_clip_set(it->frame, evas_object_clip_get(obj));
|
||||
edje_object_part_text_set(it->frame, "e.text.label", it->item->label);
|
||||
|
||||
if (!it->image && !it->have_thumb &&
|
||||
it->item->plugin && it->item->plugin->icon_get)
|
||||
{
|
||||
it->image = it->item->plugin->icon_get
|
||||
(it->item->plugin, it->item, sd->view->evas);
|
||||
|
||||
edje_object_part_swallow(it->frame, "e.swallow.content", it->image);
|
||||
evas_object_show(it->image);
|
||||
}
|
||||
}
|
||||
|
||||
if (it->get_thumb && !it->have_thumb)
|
||||
{
|
||||
if (!it->thumb)
|
||||
{
|
||||
ITEM_FILE(file, it->item);
|
||||
|
||||
it->thumb = e_thumb_icon_add(sd->view->evas);
|
||||
evas_object_smart_callback_add(it->thumb, "e_thumb_gen", _thumb_gen, it);
|
||||
|
||||
e_thumb_icon_file_set(it->thumb, file->uri, NULL);
|
||||
e_thumb_icon_size_set(it->thumb, iw, ih);
|
||||
e_thumb_icon_begin(it->thumb);
|
||||
it->do_thumb = EINA_TRUE;
|
||||
}
|
||||
else if (!it->do_thumb)
|
||||
{
|
||||
e_thumb_icon_begin(it->thumb);
|
||||
it->do_thumb = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (it->selected && sd->zoom < 2)
|
||||
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
||||
|
||||
if (sd->update && !it->visible)
|
||||
edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e");
|
||||
else if (!it->visible)
|
||||
edje_object_signal_emit(it->frame, "e,action,thumb,show", "e");
|
||||
|
||||
evas_object_move(it->frame,
|
||||
xx + dx,
|
||||
yy + dy);
|
||||
|
||||
evas_object_resize(it->frame, it->w, it->h);
|
||||
evas_object_show(it->frame);
|
||||
it->visible = EINA_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (it->frame)
|
||||
{
|
||||
if (it->do_thumb) e_thumb_icon_end(it->thumb);
|
||||
if (it->thumb) evas_object_del(it->thumb);
|
||||
if (it->image) evas_object_del(it->image);
|
||||
|
||||
evas_object_del(it->frame);
|
||||
|
||||
it->thumb = NULL;
|
||||
it->image = NULL;
|
||||
it->frame = NULL;
|
||||
|
||||
it->have_thumb = EINA_FALSE;
|
||||
it->do_thumb = EINA_FALSE;
|
||||
it->visible = EINA_FALSE;
|
||||
it->changed = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changed)
|
||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||
|
||||
sd->update = EINA_FALSE;
|
||||
|
||||
if (recursion == 0)
|
||||
sd->idle_enter = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_reconfigure(Evas_Object *obj)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
|
||||
if (sd->idle_enter) return;
|
||||
sd->idle_enter = ecore_idle_enterer_before_add(_e_smart_reconfigure_do, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_add(Evas_Object *obj)
|
||||
{
|
||||
Smart_Data *sd = calloc(1, sizeof(Smart_Data));
|
||||
if (!sd) return;
|
||||
sd->x = sd->y = sd->w = sd->h = 0;
|
||||
sd->sx = sd->sy = -1;
|
||||
evas_object_smart_data_set(obj, sd);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_del(Evas_Object *obj)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
Item *it;
|
||||
/* if (sd->seltimer)
|
||||
* ecore_timer_del(sd->seltimer); */
|
||||
/* if (sd->animator)
|
||||
* ecore_animator_del(sd->animator); */
|
||||
if (sd->idle_enter)
|
||||
ecore_idle_enterer_del(sd->idle_enter);
|
||||
// sd->view is just referenced
|
||||
// sd->child_obj is unused
|
||||
EINA_LIST_FREE(sd->items, it)
|
||||
{
|
||||
if (it->do_thumb) e_thumb_icon_end(it->thumb);
|
||||
if (it->thumb) evas_object_del(it->thumb);
|
||||
if (it->frame) evas_object_del(it->frame);
|
||||
if (it->image) evas_object_del(it->image);
|
||||
evry_item_free(it->item);
|
||||
free(it);
|
||||
}
|
||||
free(sd);
|
||||
evas_object_smart_data_set(obj, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
sd->x = x;
|
||||
sd->y = y;
|
||||
_e_smart_reconfigure(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
sd->w = w;
|
||||
sd->h = h;
|
||||
_e_smart_reconfigure(obj);
|
||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_show(Evas_Object *obj)
|
||||
{
|
||||
/* Smart_Data *sd = evas_object_smart_data_get(obj); */
|
||||
// evas_object_show(sd->child_obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_hide(Evas_Object *obj)
|
||||
{
|
||||
/* Smart_Data *sd = evas_object_smart_data_get(obj); */
|
||||
// evas_object_hide(sd->child_obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
||||
{
|
||||
/* Smart_Data *sd = evas_object_smart_data_get(obj); */
|
||||
// evas_object_color_set(sd->child_obj, r, g, b, a);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_clip_set(Evas_Object *obj, Evas_Object * clip)
|
||||
{
|
||||
/* Smart_Data *sd = evas_object_smart_data_get(obj); */
|
||||
// evas_object_clip_set(sd->child_obj, clip);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_clip_unset(Evas_Object *obj)
|
||||
{
|
||||
/* Smart_Data *sd = evas_object_smart_data_get(obj); */
|
||||
// evas_object_clip_unset(sd->child_obj);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_pan_add(Evas *evas)
|
||||
{
|
||||
static Evas_Smart *smart = NULL;
|
||||
static const Evas_Smart_Class sc =
|
||||
{
|
||||
"wp_pan",
|
||||
EVAS_SMART_CLASS_VERSION,
|
||||
_e_smart_add,
|
||||
_e_smart_del,
|
||||
_e_smart_move,
|
||||
_e_smart_resize,
|
||||
_e_smart_show,
|
||||
_e_smart_hide,
|
||||
_e_smart_color_set,
|
||||
_e_smart_clip_set,
|
||||
_e_smart_clip_unset,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
smart = evas_smart_class_new(&sc);
|
||||
return evas_object_smart_add(evas, smart);
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
if (x > (sd->cw - sd->w)) x = sd->cw - sd->w;
|
||||
if (y > (sd->ch - sd->h)) y = sd->ch - sd->h;
|
||||
if (x < 0) x = 0;
|
||||
if (y < 0) y = 0;
|
||||
if ((sd->cx == x) && (sd->cy == y)) return;
|
||||
sd->cx = x;
|
||||
sd->cy = y;
|
||||
_e_smart_reconfigure(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
if (x) *x = sd->cx;
|
||||
if (y) *y = sd->cy;
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
if (x)
|
||||
{
|
||||
if (sd->w < sd->cw) *x = sd->cw - sd->w;
|
||||
else *x = 0;
|
||||
}
|
||||
if (y)
|
||||
{
|
||||
if (sd->h < sd->ch) *y = sd->ch - sd->h;
|
||||
else *y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
if (w) *w = sd->cw;
|
||||
if (h) *h = sd->ch;
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_view_set(Evas_Object *obj, View *view)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
sd->view = view;
|
||||
}
|
||||
|
||||
static int
|
||||
_check_item(const Evry_Item *it)
|
||||
{
|
||||
if (it->plugin->type_out != view_types) return 0;
|
||||
|
||||
ITEM_FILE(file, it);
|
||||
|
||||
if (!file->uri || !file->mime) return 0;
|
||||
|
||||
if (!strncmp(file->mime, "image/", 6))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Item *
|
||||
_pan_item_add(Evas_Object *obj, Evry_Item *item)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
Item *it;
|
||||
|
||||
it = E_NEW(Item, 1);
|
||||
if (!it) return NULL;
|
||||
|
||||
sd->items = eina_list_append(sd->items, it);
|
||||
it->obj = obj;
|
||||
it->item = item;
|
||||
|
||||
if (_check_item(item))
|
||||
it->get_thumb = EINA_TRUE;
|
||||
|
||||
|
||||
evry_item_ref(item);
|
||||
|
||||
_e_smart_reconfigure(obj);
|
||||
|
||||
return it;
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_item_remove(Evas_Object *obj, Item *it)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
|
||||
sd->items = eina_list_remove(sd->items, it);
|
||||
if (it->do_thumb) e_thumb_icon_end(it->thumb);
|
||||
if (it->thumb) evas_object_del(it->thumb);
|
||||
if (it->frame) evas_object_del(it->frame);
|
||||
if (it->image) evas_object_del(it->image);
|
||||
|
||||
evry_item_free(it->item);
|
||||
|
||||
E_FREE(it);
|
||||
|
||||
_e_smart_reconfigure(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_item_select(Evas_Object *obj, Item *it)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
|
||||
sd->sel_item->selected = EINA_FALSE;
|
||||
edje_object_signal_emit(sd->sel_item->frame, "e,state,unselected", "e");
|
||||
sd->sel_item = it;
|
||||
sd->sel_item->selected = EINA_TRUE;
|
||||
|
||||
if (sd->zoom < 2)
|
||||
edje_object_signal_emit(sd->sel_item->frame, "e,state,selected", "e");
|
||||
|
||||
sd->update = EINA_FALSE;
|
||||
|
||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_view_clear(Evry_View *view)
|
||||
{
|
||||
View *v = (View*) view;
|
||||
Smart_Data *sd = evas_object_smart_data_get(v->span);
|
||||
Item *it;
|
||||
|
||||
EINA_LIST_FREE(sd->items, it)
|
||||
{
|
||||
if (it->thumb) evas_object_del(it->thumb);
|
||||
if (it->frame) evas_object_del(it->frame);
|
||||
if (it->image) evas_object_del(it->image);
|
||||
evry_item_free(it->item);
|
||||
E_FREE(it);
|
||||
}
|
||||
|
||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
||||
|
||||
v->tabs->clear(v->tabs);
|
||||
}
|
||||
|
||||
static int
|
||||
_sort_cb(const void *data1, const void *data2)
|
||||
{
|
||||
const Item *it1 = data1;
|
||||
const Item *it2 = data2;
|
||||
|
||||
return it1->pos - it2->pos;
|
||||
}
|
||||
|
||||
static int
|
||||
_view_update(Evry_View *view)
|
||||
{
|
||||
VIEW(v, view);
|
||||
Smart_Data *sd = evas_object_smart_data_get(v->span);
|
||||
Item *v_it;
|
||||
Evry_Item *p_it;
|
||||
Eina_List *l, *ll, *p_items, *v_remove = NULL, *v_items = NULL;
|
||||
int pos, last_pos;
|
||||
|
||||
if (!v->state->plugin)
|
||||
{
|
||||
_view_clear(view);
|
||||
return 1;
|
||||
}
|
||||
|
||||
p_items = v->state->plugin->items;
|
||||
|
||||
EINA_LIST_FOREACH(sd->items, l, v_it)
|
||||
{
|
||||
last_pos = v_it->pos;
|
||||
v_it->pos = 0;
|
||||
pos = 1;
|
||||
EINA_LIST_FOREACH(p_items, ll, p_it)
|
||||
{
|
||||
if (v_it->item == p_it)
|
||||
{
|
||||
if (pos != last_pos)
|
||||
v_it->changed = EINA_TRUE;
|
||||
|
||||
v_it->pos = pos;
|
||||
|
||||
if (p_it == v->state->sel_item)
|
||||
{
|
||||
sd->sel_item = v_it;
|
||||
v_it->selected = EINA_TRUE;
|
||||
}
|
||||
else
|
||||
v_it->selected = EINA_FALSE;
|
||||
|
||||
break;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
|
||||
if(v_it->pos)
|
||||
{
|
||||
v_items = eina_list_append(v_items, v_it->item);
|
||||
if (_check_item(v_it->item))
|
||||
v_it->get_thumb = EINA_TRUE;
|
||||
}
|
||||
|
||||
else
|
||||
v_remove = eina_list_append(v_remove, v_it);
|
||||
}
|
||||
|
||||
if (v_remove)
|
||||
sd->update = EINA_TRUE;
|
||||
|
||||
EINA_LIST_FREE(v_remove, v_it)
|
||||
_pan_item_remove(v->span, v_it);
|
||||
|
||||
pos = 1;
|
||||
int added = 0;
|
||||
|
||||
EINA_LIST_FOREACH(p_items, l, p_it)
|
||||
{
|
||||
if (!eina_list_data_find_list(v_items, p_it))
|
||||
{
|
||||
added = 1;
|
||||
v_it = _pan_item_add(v->span, p_it);
|
||||
|
||||
if (v_it)
|
||||
{
|
||||
v_it->pos = pos;
|
||||
|
||||
if (p_it == v->state->sel_item)
|
||||
{
|
||||
sd->sel_item = v_it;
|
||||
v_it->selected = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
|
||||
sd->items = eina_list_sort(sd->items, pos - 1, _sort_cb);
|
||||
|
||||
if (added)
|
||||
sd->update = EINA_TRUE;
|
||||
|
||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
||||
|
||||
if (v_items) eina_list_free(v_items);
|
||||
|
||||
v->tabs->update(v->tabs);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
|
||||
{
|
||||
View *v = (View *) view;
|
||||
Smart_Data *sd = evas_object_smart_data_get(v->span);
|
||||
Eina_List *l = NULL, *ll;
|
||||
Item *it = NULL;
|
||||
|
||||
if (!v->state->plugin)
|
||||
return 0;
|
||||
|
||||
if (v->tabs->key_down(v->tabs, ev))
|
||||
{
|
||||
_view_update(view);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (sd->items)
|
||||
l = eina_list_data_find_list(sd->items, sd->sel_item);
|
||||
|
||||
if (!strcmp(ev->key, "Right"))
|
||||
{
|
||||
if (l && l->next)
|
||||
it = l->next->data;
|
||||
|
||||
if (it)
|
||||
{
|
||||
_pan_item_select(v->span, it);
|
||||
evry_item_select(v->state, it->item);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
else if (!strcmp(ev->key, "Left"))
|
||||
{
|
||||
if (!sd->items) return 1;
|
||||
|
||||
if (l && l->prev)
|
||||
it = l->prev->data;
|
||||
|
||||
if (it)
|
||||
{
|
||||
_pan_item_select(v->span, it);
|
||||
evry_item_select(v->state, it->item);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
else if (!strcmp(ev->key, "Down"))
|
||||
{
|
||||
if (!sd->items) return 1;
|
||||
|
||||
EINA_LIST_FOREACH(l, ll, it)
|
||||
{
|
||||
if (it->y > sd->sel_item->y &&
|
||||
it->x >= sd->sel_item->x)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!it && l && l->next)
|
||||
it = l->next->data;
|
||||
|
||||
if (it)
|
||||
{
|
||||
_pan_item_select(v->span, it);
|
||||
evry_item_select(v->state, it->item);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
else if (!strcmp(ev->key, "Up"))
|
||||
{
|
||||
if (!sd->items) return 1;
|
||||
|
||||
EINA_LIST_REVERSE_FOREACH(l, ll, it)
|
||||
{
|
||||
if (it->y < sd->sel_item->y &&
|
||||
it->x <= sd->sel_item->x)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!it && l && l->prev)
|
||||
it = l->prev->data;
|
||||
|
||||
if (it)
|
||||
{
|
||||
_pan_item_select(v->span, it);
|
||||
evry_item_select(v->state, it->item);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
else if (!strcmp(ev->key, "plus") ||
|
||||
((ev->modifiers & ECORE_EVENT_MODIFIER_ALT) &&
|
||||
(!strcmp(ev->key, "z"))))
|
||||
{
|
||||
sd->zoom++;
|
||||
if (sd->zoom > 2) sd->zoom = 0;
|
||||
|
||||
if (sd->zoom == 2)
|
||||
{
|
||||
EINA_LIST_FOREACH(sd->items, l, it)
|
||||
{
|
||||
if (it->have_thumb)
|
||||
{
|
||||
evas_object_del(it->thumb);
|
||||
it->thumb = NULL;
|
||||
it->have_thumb = EINA_FALSE;
|
||||
}
|
||||
else if (it->do_thumb)
|
||||
{
|
||||
e_thumb_icon_end(it->thumb);
|
||||
evas_object_del(it->thumb);
|
||||
it->thumb = NULL;
|
||||
it->do_thumb = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
||||
|
||||
goto end;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
end:
|
||||
return 1;
|
||||
}
|
||||
|
||||
static Evry_View *
|
||||
_view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow)
|
||||
{
|
||||
View *v;
|
||||
|
||||
if (!s->plugin)
|
||||
return NULL;
|
||||
|
||||
v = E_NEW(View, 1);
|
||||
v->view = *view;
|
||||
v->state = s;
|
||||
v->evas = evas_object_evas_get(swallow);
|
||||
|
||||
v->bg = edje_object_add(v->evas);
|
||||
e_theme_edje_object_set(v->bg, "base/theme/widgets",
|
||||
"e/modules/everything/thumbview/main/window");
|
||||
// scrolled thumbs
|
||||
v->span = _pan_add(v->evas);
|
||||
_pan_view_set(v->span, v);
|
||||
|
||||
// the scrollframe holding the scrolled thumbs
|
||||
v->sframe = e_scrollframe_add(v->evas);
|
||||
e_scrollframe_custom_theme_set(v->sframe, "base/theme/widgets",
|
||||
"e/modules/everything/thumbview/main/scrollframe");
|
||||
e_scrollframe_extern_pan_set(v->sframe, v->span,
|
||||
_pan_set, _pan_get, _pan_max_get,
|
||||
_pan_child_size_get);
|
||||
edje_object_part_swallow(v->bg, "e.swallow.list", v->sframe);
|
||||
evas_object_show(v->sframe);
|
||||
evas_object_show(v->span);
|
||||
|
||||
EVRY_VIEW(v)->o_list = v->bg;
|
||||
|
||||
v->tabs = evry_tab_view_new(s, v->evas);
|
||||
v->view.o_bar = v->tabs->o_tabs;
|
||||
|
||||
return EVRY_VIEW(v);
|
||||
}
|
||||
|
||||
static void
|
||||
_view_destroy(Evry_View *view)
|
||||
{
|
||||
VIEW(v, view);
|
||||
|
||||
/* _view_clear(view); */
|
||||
evas_object_del(v->bg);
|
||||
evas_object_del(v->sframe);
|
||||
evas_object_del(v->span);
|
||||
|
||||
evry_tab_view_free(v->tabs);
|
||||
|
||||
E_FREE(v);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
view = E_NEW(Evry_View, 1);
|
||||
view->id = view;
|
||||
view->name = "Icon View";
|
||||
view->create = &_view_create;
|
||||
view->destroy = &_view_destroy;
|
||||
view->update = &_view_update;
|
||||
view->clear = &_view_clear;
|
||||
view->cb_key_down = &_cb_key_down;
|
||||
evry_view_register(view, 2);
|
||||
|
||||
view_types = eina_stringshare_add("FILE");
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
eina_stringshare_del(view_types);
|
||||
evry_view_unregister(view);
|
||||
E_FREE(view);
|
||||
}
|
||||
|
||||
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
|
Loading…
Reference in New Issue