forked from enlightenment/enlightenment
add next/prev app buttons, fix slipwin to expand all the way and have window
icons. remvoe junk code too. SVN revision: 37352
This commit is contained in:
parent
add3e0ba2c
commit
098b1c50bf
|
@ -57,8 +57,8 @@ collections {
|
|||
group { name: "e/modules/slipshelf/base/default";
|
||||
images {
|
||||
image: "base_bg.png" COMP;
|
||||
image: "big_arrow_down.png" COMP;
|
||||
image: "big_arrow_up.png" COMP;
|
||||
image: "icon_left_arrow.png" COMP;
|
||||
image: "icon_right_arrow.png" COMP;
|
||||
}
|
||||
// data.item: "shaped" "1";
|
||||
parts {
|
||||
|
@ -104,18 +104,20 @@ collections {
|
|||
}
|
||||
}
|
||||
}
|
||||
part { name: "s3";
|
||||
mouse_events: 0;
|
||||
type: RECT;
|
||||
part { name: "e.swallow.content";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
rel1 {
|
||||
to_y: "e.swallow.content";
|
||||
offset: 0 -4;
|
||||
fixed: 1 1;
|
||||
align: 1.0 1.0;
|
||||
rel1 {
|
||||
to_x: "next_app";
|
||||
relative: 0.0 1.0;
|
||||
offset: -1 -5;
|
||||
}
|
||||
rel2 {
|
||||
to_y: "e.swallow.content";
|
||||
offset: -1 3;
|
||||
to_x: "next_app";
|
||||
relative: 0.0 1.0;
|
||||
offset: -1 -5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,34 +131,122 @@ collections {
|
|||
offset: 4 4;
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
to_x: "kbd";
|
||||
relative: 0.0 0.0;
|
||||
offset: -5 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "kbd";
|
||||
// FIXME: make proper icon for kbd
|
||||
type: RECT;
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
aspect: 2.0 2.0;
|
||||
aspect_preference: VERTICAL;
|
||||
align: 1.0 0.5;
|
||||
color: 0 0 0 0;
|
||||
rel1 {
|
||||
to_y: "e.swallow.extra";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2 {
|
||||
to_y: "e.swallow.extra";
|
||||
relative: 1.0 1.0;
|
||||
offset: -1 -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "kbdtext";
|
||||
// FIXME: make proper icon for kbd
|
||||
type: TEXT;
|
||||
mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
rel1 {
|
||||
to: "kbd";
|
||||
}
|
||||
rel2 {
|
||||
to: "kbd";
|
||||
}
|
||||
color: 0 0 0 255;
|
||||
text {
|
||||
font: "Sans:style=Bold";
|
||||
text: "qwerty";
|
||||
size: 8;
|
||||
min: 1 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "s3";
|
||||
mouse_events: 0;
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
rel1 {
|
||||
to_y: "e.swallow.content";
|
||||
offset: 0 -4;
|
||||
}
|
||||
rel2 {
|
||||
to_y: "e.swallow.content";
|
||||
offset: -1 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.visible";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
rel1.to: "s3";
|
||||
rel2.to: "s3";
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content";
|
||||
type: SWALLOW;
|
||||
part { name: "prev_app";
|
||||
mouse_events: 1;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
align: 1.0 1.0;
|
||||
image.normal: "icon_left_arrow.png";
|
||||
max: 32 32;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: VERTICAL;
|
||||
align: 0.0 0.5;
|
||||
rel1 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -5 -5;
|
||||
to_y: "e.swallow.content";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 1.0;
|
||||
offset: -5 -5;
|
||||
to_y: "e.swallow.content";
|
||||
relative: 0.0 1.0;
|
||||
offset: 0 -1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 64;
|
||||
}
|
||||
}
|
||||
part { name: "next_app";
|
||||
mouse_events: 1;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "icon_right_arrow.png";
|
||||
max: 32 32;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: VERTICAL;
|
||||
align: 1.0 0.5;
|
||||
rel1 {
|
||||
to_y: "e.swallow.content";
|
||||
relative: 1.0 0.0;
|
||||
offset: -1 0;
|
||||
}
|
||||
rel2 {
|
||||
to_y: "e.swallow.content";
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 64;
|
||||
}
|
||||
}
|
||||
part { name: "e.text.label";
|
||||
type: TEXT;
|
||||
|
@ -165,13 +255,13 @@ collections {
|
|||
description { state: "default" 0.0;
|
||||
align: 0.0 0.5;
|
||||
rel1 {
|
||||
to_x: "kbd";
|
||||
to_x: "prev_app";
|
||||
to_y: "e.swallow.content";
|
||||
relative: 1.0 0.0;
|
||||
offset: 0 0;
|
||||
}
|
||||
rel2 {
|
||||
to_x: "inout";
|
||||
to_x: "e.swallow.content";
|
||||
to_y: "e.swallow.content";
|
||||
relative: 0.0 1.0;
|
||||
offset: -1 -1;
|
||||
|
@ -185,45 +275,15 @@ collections {
|
|||
}
|
||||
}
|
||||
}
|
||||
part { name: "inout";
|
||||
mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "big_arrow_down.png";
|
||||
max: 22 22;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: VERTICAL;
|
||||
rel1 {
|
||||
// to_x: "kbd";
|
||||
to_y: "e.swallow.content";
|
||||
relative: 0.0 0.0;
|
||||
offset: 0 0;
|
||||
}
|
||||
rel2 {
|
||||
to_y: "e.swallow.content";
|
||||
offset: 1 -1;
|
||||
}
|
||||
}
|
||||
description { state: "out1" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "big_arrow_up.png";
|
||||
}
|
||||
description { state: "out2" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "big_arrow_up.png";
|
||||
}
|
||||
description { state: "in1" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "big_arrow_down.png";
|
||||
}
|
||||
}
|
||||
part { name: "slider";
|
||||
type: RECT;
|
||||
repeat_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
rel1 {
|
||||
to_x: "prev_app";
|
||||
to_y: "e.swallow.content";
|
||||
relative: 1.0 0.0;
|
||||
offset: 0 0;
|
||||
}
|
||||
rel2 {
|
||||
|
@ -234,55 +294,6 @@ collections {
|
|||
}
|
||||
}
|
||||
}
|
||||
part { name: "kbd";
|
||||
type: RECT;
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
visible: 1;
|
||||
// visible: 0; // sean wants it gone. don't look at me.
|
||||
color: 0 0 0 0;
|
||||
rel1 {
|
||||
to_y: "e.swallow.content";
|
||||
to_x: "kbdtext";
|
||||
}
|
||||
rel2 {
|
||||
to_x: "kbdtext";
|
||||
to_y: "e.swallow.content";
|
||||
relative: 1.0 1.0;
|
||||
// relative: 0.0 1.0; // sean wants it gone. don't look at me.
|
||||
offset: -1 -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "kbdtext";
|
||||
type: TEXT;
|
||||
mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
visible: 1;
|
||||
// visible: 0; // sean wants it gone. don't look at me.
|
||||
align: 0.0 1.0;
|
||||
fixed: 1 1;
|
||||
rel1 {
|
||||
to_y: "e.swallow.content";
|
||||
offset: 1 0;
|
||||
}
|
||||
rel2 {
|
||||
to_y: "e.swallow.content";
|
||||
relative: 0.0 1.0;
|
||||
offset: 1 -1;
|
||||
}
|
||||
color: 0 0 0 255;
|
||||
text {
|
||||
font: "Sans:style=Bold";
|
||||
text: "qwerty";
|
||||
size: 8;
|
||||
min: 1 1;
|
||||
align: 0.0 1.0;
|
||||
text_class: "slipshelf_title";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.controls";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -294,42 +305,52 @@ collections {
|
|||
}
|
||||
programs {
|
||||
program { name: "kbd";
|
||||
signal: "mouse,up,1";
|
||||
signal: "mouse,down,1";
|
||||
source: "kbd";
|
||||
action: SIGNAL_EMIT "e,action,do,keyboard" "";
|
||||
}
|
||||
program { name: "slide";
|
||||
signal: "mouse,up,1";
|
||||
signal: "mouse,down,1";
|
||||
source: "slider";
|
||||
action: SIGNAL_EMIT "e,action,toggle" "";
|
||||
}
|
||||
program { name: "out1";
|
||||
signal: "e,state,out,begin";
|
||||
source: "e";
|
||||
action: STATE_SET "out1" 0.0;
|
||||
transition: LINEAR 0.25;
|
||||
target: "inout";
|
||||
program { name: "prev";
|
||||
signal: "mouse,down,1";
|
||||
source: "prev_app";
|
||||
action: SIGNAL_EMIT "e,action,do,app,prev" "";
|
||||
}
|
||||
program { name: "out2";
|
||||
signal: "e,state,out,end";
|
||||
source: "e";
|
||||
action: STATE_SET "out2" 0.0;
|
||||
transition: LINEAR 0.25;
|
||||
target: "inout";
|
||||
program { name: "next";
|
||||
signal: "mouse,down,1";
|
||||
source: "next_app";
|
||||
action: SIGNAL_EMIT "e,action,do,app,next" "";
|
||||
}
|
||||
program { name: "in1";
|
||||
signal: "e,state,in,begin";
|
||||
source: "e";
|
||||
action: STATE_SET "in1" 0.0;
|
||||
transition: LINEAR 0.25;
|
||||
target: "inout";
|
||||
}
|
||||
program { name: "in2";
|
||||
signal: "e,state,in,end";
|
||||
program { name: "next_enable";
|
||||
signal: "e,state,action,app,next,enabled";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.25;
|
||||
target: "inout";
|
||||
transition: LINEAR 0.5;
|
||||
target: "next_app";
|
||||
}
|
||||
program { name: "next_disable";
|
||||
signal: "e,state,action,app,next,disabled";
|
||||
source: "e";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
transition: LINEAR 0.5;
|
||||
target: "next_app";
|
||||
}
|
||||
program { name: "prev_enable";
|
||||
signal: "e,state,action,app,prev,enabled";
|
||||
source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.5;
|
||||
target: "prev_app";
|
||||
}
|
||||
program { name: "prev_disable";
|
||||
signal: "e,state,action,app,prev,disabled";
|
||||
source: "e";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
transition: LINEAR 0.5;
|
||||
target: "prev_app";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 1.2 KiB |
|
@ -438,7 +438,6 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
|
|||
}
|
||||
if (ev->button == 1)
|
||||
{
|
||||
printf("down @ %3.3f\n", ecore_time_get());
|
||||
sd->down.now = 1;
|
||||
sd->down.dragged = 0;
|
||||
sd->down.dir_x = 0;
|
||||
|
@ -499,7 +498,6 @@ _e_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
if (ev->button == 1)
|
||||
{
|
||||
printf("up @ %3.3f\n", ecore_time_get());
|
||||
x = ev->canvas.x - sd->down.x;
|
||||
y = ev->canvas.y - sd->down.y;
|
||||
if (sd->down.dragged)
|
||||
|
@ -829,8 +827,13 @@ _e_smart_scrollbar_bar_visibility_adjust(E_Smart_Data *sd)
|
|||
changed |= _e_smart_scrollbar_bar_v_visibility_adjust(sd);
|
||||
if (changed)
|
||||
{
|
||||
_e_smart_scrollbar_bar_h_visibility_adjust(sd);
|
||||
_e_smart_scrollbar_bar_v_visibility_adjust(sd);
|
||||
changed |= _e_smart_scrollbar_bar_h_visibility_adjust(sd);
|
||||
changed |= _e_smart_scrollbar_bar_v_visibility_adjust(sd);
|
||||
}
|
||||
if (changed)
|
||||
{
|
||||
changed |= _e_smart_scrollbar_bar_h_visibility_adjust(sd);
|
||||
changed |= _e_smart_scrollbar_bar_v_visibility_adjust(sd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -842,6 +845,7 @@ _e_smart_scrollbar_size_adjust(E_Smart_Data *sd)
|
|||
Evas_Coord x, y, w, h, mx = 0, my = 0, vw = 0, vh = 0;
|
||||
double vx, vy, size;
|
||||
|
||||
edje_object_calc_force(sd->edje_obj);
|
||||
edje_object_part_geometry_get(sd->edje_obj, "e.swallow.content", NULL, NULL, &vw, &vh);
|
||||
w = sd->child.w;
|
||||
if (w < 1) w = 1;
|
||||
|
|
|
@ -451,6 +451,22 @@ e_widget_ilist_range_select(Evas_Object *obj, int n)
|
|||
e_ilist_range_select(wd->o_ilist, n);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_widget_ilist_preferred_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
||||
{
|
||||
Evas_Coord ww, hh, mw, mh, vw, vh;
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
evas_object_geometry_get(wd->o_scrollframe, NULL, NULL, &ww, &hh);
|
||||
evas_object_resize(wd->o_scrollframe, 200, 200);
|
||||
e_scrollframe_child_viewport_size_get(wd->o_scrollframe, &vw, &vh);
|
||||
e_ilist_min_size_get(wd->o_ilist, &mw, &mh);
|
||||
evas_object_resize(wd->o_scrollframe, ww, hh);
|
||||
if (w) *w = 200 - vw + mw;
|
||||
if (h) *h = 200 - vh + mh;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_del_hook(Evas_Object *obj)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,6 @@ EAPI void e_widget_ilist_multi_select_set(Evas_Object *obj, int multi);
|
|||
EAPI int e_widget_ilist_multi_select_get(Evas_Object *obj);
|
||||
EAPI void e_widget_ilist_multi_select(Evas_Object *obj, int n);
|
||||
EAPI void e_widget_ilist_range_select(Evas_Object *obj, int n);
|
||||
|
||||
EAPI void e_widget_ilist_preferred_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -26,10 +26,10 @@ static void _cb_slipshelf_home(const void *data, E_Slipshelf *ess, E_Slipshelf_A
|
|||
static void _cb_slipshelf_close(const void *data, E_Slipshelf *ess, E_Slipshelf_Action action);
|
||||
static void _cb_slipshelf_apps(const void *data, E_Slipshelf *ess, E_Slipshelf_Action action);
|
||||
static void _cb_slipshelf_keyboard(const void *data, E_Slipshelf *ess, E_Slipshelf_Action action);
|
||||
static void _cb_slipshelf_app_next(const void *data, E_Slipshelf *ess, E_Slipshelf_Action action);
|
||||
static void _cb_slipshelf_app_prev(const void *data, E_Slipshelf *ess, E_Slipshelf_Action action);
|
||||
static void _cb_slipwin_select(const void *data, E_Slipwin *esw, E_Border *bd);
|
||||
static void _cb_slipshelf_select(const void *data, E_Slipshelf *ess, E_Border *bd);
|
||||
static void _cb_slipshelf_add(const void *data, E_Slipshelf *ess, E_Border *bd);
|
||||
static void _cb_slipshelf_del(const void *data, E_Slipshelf *ess, E_Border *bd);
|
||||
static void _cb_slipshelf_home2(const void *data, E_Slipshelf *ess, E_Border *bd);
|
||||
static void _cb_selected(void *data, Evas_Object *obj, void *event_info);
|
||||
static int _cb_efreet_desktop_list_change(void *data, int type, void *event);
|
||||
|
@ -78,7 +78,11 @@ _e_mod_win_init(E_Module *m)
|
|||
slipshelf = e_slipshelf_new(zone, e_module_dir_get(m));
|
||||
e_slipshelf_default_title_set(slipshelf, "ILLUME");
|
||||
if (!_have_borders())
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 0);
|
||||
{
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 0);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_NEXT, 0);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_PREV, 0);
|
||||
}
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_HOME,
|
||||
_cb_slipshelf_home, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_CLOSE,
|
||||
|
@ -87,9 +91,11 @@ _e_mod_win_init(E_Module *m)
|
|||
_cb_slipshelf_apps, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_KEYBOARD,
|
||||
_cb_slipshelf_keyboard, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_APP_NEXT,
|
||||
_cb_slipshelf_app_next, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_APP_PREV,
|
||||
_cb_slipshelf_app_prev, NULL);
|
||||
e_slipshelf_border_select_callback_set(slipshelf, _cb_slipshelf_select, NULL);
|
||||
e_slipshelf_border_add_callback_set(slipshelf, _cb_slipshelf_add, NULL);
|
||||
e_slipshelf_border_del_callback_set(slipshelf, _cb_slipshelf_del, NULL);
|
||||
e_slipshelf_border_home_callback_set(slipshelf, _cb_slipshelf_home2, NULL);
|
||||
|
||||
slipwin = e_slipwin_new(zone, e_module_dir_get(m));
|
||||
|
@ -261,7 +267,11 @@ _e_mod_win_slipshelf_cfg_update(void)
|
|||
slipshelf = e_slipshelf_new(zone, e_module_dir_get(mod));
|
||||
e_slipshelf_default_title_set(slipshelf, "ILLUME");
|
||||
if (!_have_borders())
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 0);
|
||||
{
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 0);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_NEXT, 0);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_PREV, 0);
|
||||
}
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_HOME,
|
||||
_cb_slipshelf_home, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_CLOSE,
|
||||
|
@ -270,9 +280,11 @@ _e_mod_win_slipshelf_cfg_update(void)
|
|||
_cb_slipshelf_apps, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_KEYBOARD,
|
||||
_cb_slipshelf_keyboard, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_APP_NEXT,
|
||||
_cb_slipshelf_app_next, NULL);
|
||||
e_slipshelf_action_callback_set(slipshelf, E_SLIPSHELF_ACTION_APP_PREV,
|
||||
_cb_slipshelf_app_prev, NULL);
|
||||
e_slipshelf_border_select_callback_set(slipshelf, _cb_slipshelf_select, NULL);
|
||||
e_slipshelf_border_add_callback_set(slipshelf, _cb_slipshelf_add, NULL);
|
||||
e_slipshelf_border_del_callback_set(slipshelf, _cb_slipshelf_del, NULL);
|
||||
e_slipshelf_border_home_callback_set(slipshelf, _cb_slipshelf_home2, NULL);
|
||||
|
||||
_cb_resize();
|
||||
|
@ -339,7 +351,9 @@ _desktop_run(Efreet_Desktop *desktop)
|
|||
E_Exec_Instance *eins;
|
||||
Instance *ins;
|
||||
char *exename, *p;
|
||||
|
||||
|
||||
if (!desktop) return;
|
||||
if (!desktop->exec) return;
|
||||
for (l = instances; l; l = l->next)
|
||||
{
|
||||
ins = l->data;
|
||||
|
@ -446,7 +460,11 @@ _cb_event_border_add(void *data, int type, void *event)
|
|||
|
||||
ev = event;
|
||||
if (_have_borders())
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 1);
|
||||
{
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 1);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_NEXT, 1);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_PREV, 1);
|
||||
}
|
||||
desktop = e_exec_startup_id_pid_find(ev->border->client.netwm.pid,
|
||||
ev->border->client.netwm.startup_id);
|
||||
for (l = instances; l; l = l->next)
|
||||
|
@ -483,7 +501,11 @@ _cb_event_border_remove(void *data, int type, void *event)
|
|||
|
||||
ev = event;
|
||||
if (!_have_borders())
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 0);
|
||||
{
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APPS, 0);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_NEXT, 0);
|
||||
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_PREV, 0);
|
||||
}
|
||||
for (l = instances; l; l = l->next)
|
||||
{
|
||||
ins = l->data;
|
||||
|
@ -629,6 +651,118 @@ _cb_slipshelf_keyboard(const void *data, E_Slipshelf *ess, E_Slipshelf_Action ac
|
|||
else e_kbd_show(vkbd);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_slipshelf_app_next(const void *data, E_Slipshelf *ess, E_Slipshelf_Action action)
|
||||
{
|
||||
E_Border *bd, *bd2 = NULL;
|
||||
Eina_List *l, *list, *tlist = NULL;
|
||||
|
||||
bd = e_border_focused_get();
|
||||
list = e_border_client_list();
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
bd2 = l->data;
|
||||
if (e_object_is_del(E_OBJECT(bd2))) continue;
|
||||
if ((!bd2->client.icccm.accepts_focus) &&
|
||||
(!bd2->client.icccm.take_focus)) continue;
|
||||
if (bd2->client.netwm.state.skip_taskbar) continue;
|
||||
if (bd2->user_skip_winlist) continue;
|
||||
tlist = evas_list_append(tlist, bd2);
|
||||
}
|
||||
if (!tlist) return;
|
||||
if (!bd) bd2 = tlist->data;
|
||||
else
|
||||
{
|
||||
for (l = tlist; l; l = l->next)
|
||||
{
|
||||
bd2 = l->data;
|
||||
if (bd2 == bd)
|
||||
{
|
||||
if (l->next) bd2 = l->next->data;
|
||||
else bd2 = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
evas_list_free(tlist);
|
||||
if (bd2 == bd) return;
|
||||
if (bd2) _e_mod_layout_border_show(bd2);
|
||||
else
|
||||
{
|
||||
Eina_List *l, *borders;
|
||||
|
||||
borders = e_border_client_list();
|
||||
for (l = borders; l; l = l->next)
|
||||
{
|
||||
E_Border *bd;
|
||||
|
||||
bd = l->data;
|
||||
if (e_object_is_del(E_OBJECT(bd))) continue;
|
||||
if ((!bd->client.icccm.accepts_focus) &&
|
||||
(!bd->client.icccm.take_focus)) continue;
|
||||
if (bd->client.netwm.state.skip_taskbar) continue;
|
||||
if (bd->user_skip_winlist) continue;
|
||||
_e_mod_layout_border_hide(bd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_slipshelf_app_prev(const void *data, E_Slipshelf *ess, E_Slipshelf_Action action)
|
||||
{
|
||||
E_Border *bd, *bd2 = NULL;
|
||||
Eina_List *l, *list, *tlist = NULL;
|
||||
|
||||
bd = e_border_focused_get();
|
||||
list = e_border_client_list();
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
bd2 = l->data;
|
||||
if (e_object_is_del(E_OBJECT(bd2))) continue;
|
||||
if ((!bd2->client.icccm.accepts_focus) &&
|
||||
(!bd2->client.icccm.take_focus)) continue;
|
||||
if (bd2->client.netwm.state.skip_taskbar) continue;
|
||||
if (bd2->user_skip_winlist) continue;
|
||||
tlist = evas_list_append(tlist, bd2);
|
||||
}
|
||||
if (!tlist) return;
|
||||
if (!bd) bd2 = evas_list_last(tlist)->data;
|
||||
else
|
||||
{
|
||||
for (l = tlist; l; l = l->next)
|
||||
{
|
||||
bd2 = l->data;
|
||||
if (bd2 == bd)
|
||||
{
|
||||
if (l->prev) bd2 = l->prev->data;
|
||||
else bd2 = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
evas_list_free(tlist);
|
||||
if (bd2 == bd) return;
|
||||
if (bd2) _e_mod_layout_border_show(bd2);
|
||||
else
|
||||
{
|
||||
Eina_List *l, *borders;
|
||||
|
||||
borders = e_border_client_list();
|
||||
for (l = borders; l; l = l->next)
|
||||
{
|
||||
E_Border *bd;
|
||||
|
||||
bd = l->data;
|
||||
if (e_object_is_del(E_OBJECT(bd))) continue;
|
||||
if ((!bd->client.icccm.accepts_focus) &&
|
||||
(!bd->client.icccm.take_focus)) continue;
|
||||
if (bd->client.netwm.state.skip_taskbar) continue;
|
||||
if (bd->user_skip_winlist) continue;
|
||||
_e_mod_layout_border_hide(bd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_slipwin_select(const void *data, E_Slipwin *esw, E_Border *bd)
|
||||
{
|
||||
|
@ -641,24 +775,6 @@ _cb_slipshelf_select(const void *data, E_Slipshelf *ess, E_Border *bd)
|
|||
if (bd) _e_mod_layout_border_show(bd);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_slipshelf_add(const void *data, E_Slipshelf *ess, E_Border *bd)
|
||||
{
|
||||
printf("FIXME: implement add\n");
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_slipshelf_del(const void *data, E_Slipshelf *ess, E_Border *bd)
|
||||
{
|
||||
if (!bd) return;
|
||||
if (e_object_is_del(E_OBJECT(bd))) return;
|
||||
if ((!bd->client.icccm.accepts_focus) &&
|
||||
(!bd->client.icccm.take_focus)) return;
|
||||
if (bd->client.netwm.state.skip_taskbar) return;
|
||||
if (bd->user_skip_winlist) return;
|
||||
_e_mod_layout_border_close(bd);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_slipshelf_home2(const void *data, E_Slipshelf *ess, E_Border *bd)
|
||||
{
|
||||
|
|
|
@ -15,9 +15,9 @@ static void _e_slipshelf_cb_toggle(void *data, Evas_Object *obj, const char *emi
|
|||
static void _e_slipshelf_cb_home(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_apps(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_applist_add(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_applist_del(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_keyboard(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_app_next(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_app_prev(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_slipshelf_cb_item_sel(void *data, void *data2);
|
||||
static int _e_slipshelf_cb_animate(void *data);
|
||||
static void _e_slipshelf_slide(E_Slipshelf *ess, int out, double len);
|
||||
|
@ -100,12 +100,8 @@ e_slipshelf_new(E_Zone *zone, const char *themedir)
|
|||
ess->control_obj = _theme_obj_new(ess->popup->evas,
|
||||
ess->themedir,
|
||||
"e/modules/slipshelf/controls/applist");
|
||||
edje_object_part_text_set(ess->control_obj, "e.add.label",
|
||||
"ADD");
|
||||
edje_object_part_text_set(ess->control_obj, "e.del.label",
|
||||
"REMOVE");
|
||||
edje_object_part_text_set(ess->base_obj, "e.add.label",
|
||||
"ADD");
|
||||
edje_object_part_text_set(ess->base_obj, "e.del.label",
|
||||
"REMOVE");
|
||||
}
|
||||
|
@ -199,18 +195,16 @@ e_slipshelf_new(E_Zone *zone, const char *themedir)
|
|||
edje_object_signal_callback_add(ess->base_obj, "e,action,do,home", "", _e_slipshelf_cb_home, ess);
|
||||
edje_object_signal_callback_add(ess->base_obj, "e,action,do,close", "", _e_slipshelf_cb_close, ess);
|
||||
edje_object_signal_callback_add(ess->base_obj, "e,action,do,apps", "", _e_slipshelf_cb_apps, ess);
|
||||
edje_object_signal_callback_add(ess->base_obj, "e,action,do,applist,add", "", _e_slipshelf_cb_applist_add, ess);
|
||||
edje_object_signal_callback_add(ess->base_obj, "e,action,do,applist,del", "", _e_slipshelf_cb_applist_del, ess);
|
||||
edje_object_signal_callback_add(ess->base_obj, "e,action,do,app,next", "", _e_slipshelf_cb_app_next, ess);
|
||||
edje_object_signal_callback_add(ess->base_obj, "e,action,do,app,prev", "", _e_slipshelf_cb_app_prev, ess);
|
||||
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,toggle", "", _e_slipshelf_cb_toggle, ess);
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,keyboard", "", _e_slipshelf_cb_keyboard, ess);
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,home", "", _e_slipshelf_cb_home, ess);
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,close", "", _e_slipshelf_cb_close, ess);
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,apps", "", _e_slipshelf_cb_apps, ess);
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,applist,add", "", _e_slipshelf_cb_applist_add, ess);
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,applist,del", "", _e_slipshelf_cb_applist_del, ess);
|
||||
|
||||
/* FIXME: add callbacks for app remove/add */
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,app,next", "", _e_slipshelf_cb_app_next, ess);
|
||||
edje_object_signal_callback_add(ess->control_obj, "e,action,do,app,prev", "", _e_slipshelf_cb_app_prev, ess);
|
||||
|
||||
e_popup_show(ess->popup);
|
||||
|
||||
|
@ -246,6 +240,8 @@ e_slipshelf_new(E_Zone *zone, const char *themedir)
|
|||
ess->action.close.enabled = 1;
|
||||
ess->action.apps.enabled = 1;
|
||||
ess->action.keyboard.enabled = 1;
|
||||
ess->action.app_next.enabled = 1;
|
||||
ess->action.app_prev.enabled = 1;
|
||||
|
||||
{
|
||||
E_Event_Slipshelf_Add *ev;
|
||||
|
@ -269,51 +265,65 @@ e_slipshelf_action_enabled_set(E_Slipshelf *ess, E_Slipshelf_Action action, Evas
|
|||
{
|
||||
E_OBJECT_CHECK(ess);
|
||||
E_OBJECT_TYPE_CHECK(ess, E_SLIPSHELF_TYPE);
|
||||
const char *sig = NULL;
|
||||
switch (action)
|
||||
{
|
||||
case E_SLIPSHELF_ACTION_HOME:
|
||||
if (ess->action.home.enabled != enabled)
|
||||
{
|
||||
ess->action.home.enabled = enabled;
|
||||
if (enabled)
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,home,enabled", "e");
|
||||
else
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,home,disabled", "e");
|
||||
if (enabled) sig = "e,state,action,home,enabled";
|
||||
else sig = "e,state,action,home,disabled";
|
||||
}
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_CLOSE:
|
||||
if (ess->action.close.enabled != enabled)
|
||||
{
|
||||
ess->action.close.enabled = enabled;
|
||||
if (enabled)
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,close,enabled", "e");
|
||||
else
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,close,disabled", "e");
|
||||
if (enabled) sig = "e,state,action,close,enabled";
|
||||
else sig = "e,state,action,close,disabled";
|
||||
}
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_APPS:
|
||||
if (ess->action.apps.enabled != enabled)
|
||||
{
|
||||
ess->action.apps.enabled = enabled;
|
||||
if (enabled)
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,apps,enabled", "e");
|
||||
else
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,apps,disabled", "e");
|
||||
if (enabled) sig = "e,state,action,apps,enabled";
|
||||
else sig = "e,state,action,apps,disabled";
|
||||
}
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_KEYBOARD:
|
||||
if (ess->action.keyboard.enabled != enabled)
|
||||
{
|
||||
ess->action.keyboard.enabled = enabled;
|
||||
if (enabled)
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,keyboard,enabled", "e");
|
||||
else
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,action,keyboard,disabled", "e");
|
||||
if (enabled) sig = "e,state,action,keyboard,enabled";
|
||||
else sig = "e,state,action,keyboard,disabled";
|
||||
}
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_APP_NEXT:
|
||||
if (ess->action.app_next.enabled != enabled)
|
||||
{
|
||||
ess->action.app_next.enabled = enabled;
|
||||
if (enabled) sig = "e,state,action,app,next,enabled";
|
||||
else sig = "e,state,action,app,next,disabled";
|
||||
}
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_APP_PREV:
|
||||
if (ess->action.app_prev.enabled != enabled)
|
||||
{
|
||||
ess->action.app_prev.enabled = enabled;
|
||||
if (enabled) sig = "e,state,action,app,prev,enabled";
|
||||
else sig = "e,state,action,app,prev,disabled";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (sig)
|
||||
{
|
||||
edje_object_signal_emit(ess->control_obj, sig, "e");
|
||||
edje_object_signal_emit(ess->base_obj, sig, "e");
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Evas_Bool
|
||||
|
@ -335,6 +345,12 @@ e_slipshelf_action_enabled_get(E_Slipshelf *ess, E_Slipshelf_Action action)
|
|||
case E_SLIPSHELF_ACTION_KEYBOARD:
|
||||
return ess->action.keyboard.enabled;
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_APP_NEXT:
|
||||
return ess->action.app_next.enabled;
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_APP_PREV:
|
||||
return ess->action.app_prev.enabled;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -364,6 +380,14 @@ e_slipshelf_action_callback_set(E_Slipshelf *ess, E_Slipshelf_Action action, voi
|
|||
ess->action.keyboard.func = func;
|
||||
ess->action.keyboard.data = data;
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_APP_NEXT:
|
||||
ess->action.app_next.func = func;
|
||||
ess->action.app_next.data = data;
|
||||
break;
|
||||
case E_SLIPSHELF_ACTION_APP_PREV:
|
||||
ess->action.app_prev.func = func;
|
||||
ess->action.app_prev.data = data;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -422,24 +446,6 @@ e_slipshelf_border_select_callback_set(E_Slipshelf *ess, void (*func) (void *dat
|
|||
ess->callback_border_select.data = data;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_slipshelf_border_add_callback_set(E_Slipshelf *ess, void (*func) (void *data, E_Slipshelf *ess, E_Border *bd), const void *data)
|
||||
{
|
||||
E_OBJECT_CHECK(ess);
|
||||
E_OBJECT_TYPE_CHECK(ess, E_SLIPSHELF_TYPE);
|
||||
ess->callback_border_add.func = func;
|
||||
ess->callback_border_add.data = data;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_slipshelf_border_del_callback_set(E_Slipshelf *ess, void (*func) (void *data, E_Slipshelf *ess, E_Border *bd), const void *data)
|
||||
{
|
||||
E_OBJECT_CHECK(ess);
|
||||
E_OBJECT_TYPE_CHECK(ess, E_SLIPSHELF_TYPE);
|
||||
ess->callback_border_del.func = func;
|
||||
ess->callback_border_del.data = data;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_slipshelf_border_home_callback_set(E_Slipshelf *ess, void (*func) (void *data, E_Slipshelf *ess, E_Border *bd), const void *data)
|
||||
{
|
||||
|
@ -522,42 +528,6 @@ _e_slipshelf_cb_apps(void *data, Evas_Object *obj, const char *emission, const c
|
|||
ess->action.apps.func(ess->action.apps.data, ess, E_SLIPSHELF_ACTION_APPS);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_slipshelf_cb_applist_add(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
E_Slipshelf *ess;
|
||||
|
||||
ess = data;
|
||||
if (ess->callback_border_add.func)
|
||||
{
|
||||
if (ess->bsel)
|
||||
ess->callback_border_add.func(ess->callback_border_add.data, ess, ess->bsel);
|
||||
else
|
||||
ess->callback_border_add.func(ess->callback_border_add.data, ess, e_border_focused_get());
|
||||
}
|
||||
if (ess->slide_down_timer) ecore_timer_del(ess->slide_down_timer);
|
||||
ess->slide_down_timer = NULL;
|
||||
_e_slipshelf_slide(ess, 0, (double)illume_cfg->sliding.slipshelf.duration / 1000.0);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_slipshelf_cb_applist_del(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
E_Slipshelf *ess;
|
||||
|
||||
ess = data;
|
||||
if (ess->callback_border_del.func)
|
||||
{
|
||||
if (ess->bsel)
|
||||
ess->callback_border_del.func(ess->callback_border_del.data, ess, ess->bsel);
|
||||
else
|
||||
ess->callback_border_del.func(ess->callback_border_del.data, ess, e_border_focused_get());
|
||||
}
|
||||
if (ess->slide_down_timer) ecore_timer_del(ess->slide_down_timer);
|
||||
ess->slide_down_timer = NULL;
|
||||
_e_slipshelf_slide(ess, 0, (double)illume_cfg->sliding.slipshelf.duration / 1000.0);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_slipshelf_cb_keyboard(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
|
@ -566,6 +536,35 @@ _e_slipshelf_cb_keyboard(void *data, Evas_Object *obj, const char *emission, con
|
|||
ess = data;
|
||||
if ((ess->action.keyboard.func) && (ess->action.keyboard.enabled))
|
||||
ess->action.keyboard.func(ess->action.keyboard.data, ess, E_SLIPSHELF_ACTION_KEYBOARD);
|
||||
if (ess->slide_down_timer) ecore_timer_del(ess->slide_down_timer);
|
||||
ess->slide_down_timer = NULL;
|
||||
_e_slipshelf_slide(ess, 0, (double)illume_cfg->sliding.slipshelf.duration / 1000.0);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_slipshelf_cb_app_next(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
E_Slipshelf *ess;
|
||||
|
||||
ess = data;
|
||||
if ((ess->action.app_next.func) && (ess->action.app_next.enabled))
|
||||
ess->action.app_next.func(ess->action.app_next.data, ess, E_SLIPSHELF_ACTION_APP_NEXT);
|
||||
if (ess->slide_down_timer) ecore_timer_del(ess->slide_down_timer);
|
||||
ess->slide_down_timer = NULL;
|
||||
_e_slipshelf_slide(ess, 0, (double)illume_cfg->sliding.slipshelf.duration / 1000.0);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_slipshelf_cb_app_prev(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
E_Slipshelf *ess;
|
||||
|
||||
ess = data;
|
||||
if ((ess->action.app_prev.func) && (ess->action.app_prev.enabled))
|
||||
ess->action.app_prev.func(ess->action.app_prev.data, ess, E_SLIPSHELF_ACTION_APP_PREV);
|
||||
if (ess->slide_down_timer) ecore_timer_del(ess->slide_down_timer);
|
||||
ess->slide_down_timer = NULL;
|
||||
_e_slipshelf_slide(ess, 0, (double)illume_cfg->sliding.slipshelf.duration / 1000.0);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -617,7 +616,6 @@ static void
|
|||
_e_slipshelf_applist_update(E_Slipshelf *ess)
|
||||
{
|
||||
Evas_Coord mw, mh, vx, vy, vw, vh, w, h, sfmw, sfmh, cmw, cmh, smw, smh;
|
||||
// Eina_List *borders, *l;
|
||||
int i, selnum, x, y;
|
||||
int pw, ph;
|
||||
|
||||
|
@ -625,62 +623,9 @@ _e_slipshelf_applist_update(E_Slipshelf *ess)
|
|||
|
||||
pw = ess->popup->w;
|
||||
ph = ess->popup->h;
|
||||
/*
|
||||
borders = e_border_client_list();
|
||||
e_ilist_freeze(ess->ilist_obj);
|
||||
for (l = borders; l; l = l->next)
|
||||
{
|
||||
E_Border *bd;
|
||||
const char *title;
|
||||
|
||||
bd = l->data;
|
||||
if (e_object_is_del(E_OBJECT(bd))) continue;
|
||||
if ((!bd->client.icccm.accepts_focus) &&
|
||||
(!bd->client.icccm.take_focus)) continue;
|
||||
if (bd->client.netwm.state.skip_taskbar) continue;
|
||||
if (bd->user_skip_winlist) continue;
|
||||
|
||||
e_object_ref(E_OBJECT(bd));
|
||||
title = "???";
|
||||
if (bd->client.netwm.name) title = bd->client.netwm.name;
|
||||
else if (bd->client.icccm.title) title = bd->client.icccm.title;
|
||||
e_ilist_append(ess->ilist_obj, NULL, title, 0,
|
||||
_e_slipshelf_cb_item_sel,
|
||||
NULL, ess, bd);
|
||||
ess->borders = eina_list_append(ess->borders, bd);
|
||||
if (bd == e_border_focused_get()) selnum = i;
|
||||
i++;
|
||||
}
|
||||
e_ilist_append(ess->ilist_obj, NULL, "Home", 0,
|
||||
_e_slipshelf_cb_item_sel,
|
||||
NULL, ess, NULL);
|
||||
// selnum = 0;
|
||||
i++;
|
||||
e_ilist_thaw(ess->ilist_obj);
|
||||
*/
|
||||
ess->bsel = e_border_focused_get();
|
||||
|
||||
// if (selnum >= 0) e_ilist_selected_set(ess->ilist_obj, selnum);
|
||||
|
||||
e_winilist_optimial_size_get(ess->scrollframe_obj, &sfmw, &sfmh);
|
||||
/*
|
||||
e_scrollframe_child_viewport_size_get(ess->scrollframe_obj, &vw, &vh);
|
||||
e_ilist_min_size_get(ess->ilist_obj, &mw, &mh);
|
||||
|
||||
evas_object_geometry_get(ess->scrollframe_obj, NULL, NULL, &w, &h);
|
||||
|
||||
if (mw > vw) mw = mw + (w - vw);
|
||||
else if (mw < vw) mw = vw;
|
||||
|
||||
evas_object_resize(ess->ilist_obj, mw, mh);
|
||||
evas_object_resize(ess->scrollframe_obj, mw, mh);
|
||||
printf("resize ilist + frame to %i %i\n", mw, mh);
|
||||
|
||||
evas_object_geometry_get(ess->scrollframe_obj, NULL, NULL, &w, &h);
|
||||
sfmw = mw + (mw - w);
|
||||
sfmh = mh + (mh - h);
|
||||
printf("adjust to %i %i\n", sfmw, sfmh);
|
||||
*/
|
||||
|
||||
sfmw = 0;
|
||||
|
||||
|
@ -705,13 +650,10 @@ _e_slipshelf_applist_update(E_Slipshelf *ess)
|
|||
smw = ess->zone->w;
|
||||
if (smh > ess->zone->h) smh = ess->zone->h;
|
||||
|
||||
// smh = 400;
|
||||
|
||||
evas_object_resize(ess->base_obj, smw, smh);
|
||||
edje_object_calc_force(ess->base_obj);
|
||||
edje_object_calc_force(ess->control_obj);
|
||||
edje_object_part_geometry_get(ess->base_obj, "e.swallow.controls", &vx, &vy, &vw, &vh);
|
||||
// evas_object_geometry_get(ess->control_obj, &vx, &vy, &vw, &vh);
|
||||
ess->control.w = vw;
|
||||
ess->control.h = vh;
|
||||
edje_extern_object_min_size_set(ess->control_obj, ess->control.w, ess->control.h);
|
||||
|
@ -720,7 +662,6 @@ _e_slipshelf_applist_update(E_Slipshelf *ess)
|
|||
edje_object_calc_force(ess->base_obj);
|
||||
edje_object_calc_force(ess->control_obj);
|
||||
edje_object_part_geometry_get(ess->base_obj, "e.swallow.visible", &vx, &vy, &vw, &vh);
|
||||
// evas_object_geometry_get(ess->vis_obj, &vx, &vy, &vw, &vh);
|
||||
|
||||
ess->hidden = vy;
|
||||
x = ess->zone->x;
|
||||
|
@ -729,34 +670,6 @@ _e_slipshelf_applist_update(E_Slipshelf *ess)
|
|||
evas_object_resize(ess->base_obj, ess->popup->w, ess->popup->h);
|
||||
}
|
||||
|
||||
/*
|
||||
static void
|
||||
_e_slipshelf_applist_clear(E_Slipshelf *ess)
|
||||
{
|
||||
Evas_Coord mw, mh, vw, vh, w, h;
|
||||
|
||||
e_ilist_freeze(ess->ilist_obj);
|
||||
e_ilist_clear(ess->ilist_obj);
|
||||
e_ilist_thaw(ess->ilist_obj);
|
||||
|
||||
ess->bsel = NULL;
|
||||
while (ess->borders)
|
||||
{
|
||||
e_object_unref(E_OBJECT(ess->borders->data));
|
||||
ess->borders = eina_list_remove_list(ess->borders, ess->borders);
|
||||
}
|
||||
|
||||
e_scrollframe_child_viewport_size_get(ess->scrollframe_obj, &vw, &vh);
|
||||
e_ilist_min_size_get(ess->ilist_obj, &mw, &mh);
|
||||
|
||||
evas_object_geometry_get(ess->scrollframe_obj, NULL, NULL, &w, &h);
|
||||
|
||||
if (mw > vw) mw = mw + (w - vw);
|
||||
else if (mw < vw) mw = vw;
|
||||
evas_object_resize(ess->ilist_obj, mw, mh);
|
||||
}
|
||||
*/
|
||||
|
||||
static int
|
||||
_e_slipshelf_cb_animate(void *data)
|
||||
{
|
||||
|
@ -779,7 +692,6 @@ _e_slipshelf_cb_animate(void *data)
|
|||
v = 1.0;
|
||||
}
|
||||
ess->adjust = (ess->adjust_target * v) + (ess->adjust_start * (1.0 - v));
|
||||
// printf("%i | %i\n", ess->hidden, ess->adjust);
|
||||
e_popup_move(ess->popup,
|
||||
ess->zone->x,
|
||||
ess->zone->y - ess->hidden + ess->adjust);
|
||||
|
@ -795,7 +707,6 @@ _e_slipshelf_cb_animate(void *data)
|
|||
{
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,in,end", "e");
|
||||
edje_object_signal_emit(ess->base_obj, "e,state,in,end", "e");
|
||||
// _e_slipshelf_applist_clear(ess);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -812,7 +723,6 @@ _e_slipshelf_slide(E_Slipshelf *ess, int out, double len)
|
|||
ess->adjust_start = ess->adjust;
|
||||
if (ess->out)
|
||||
{
|
||||
// _e_slipshelf_applist_clear(ess);
|
||||
_e_slipshelf_applist_update(ess);
|
||||
|
||||
edje_object_signal_emit(ess->control_obj, "e,state,out,begin", "e");
|
||||
|
@ -993,7 +903,6 @@ _e_slipshelf_cb_gadcon_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w,
|
|||
|
||||
evas_object_resize(ess->base_obj, mw, mh);
|
||||
edje_object_part_geometry_get(ess->base_obj, "e.swallow.visible", &vx, &vy, &vw, &vh);
|
||||
// evas_object_geometry_get(ess->vis_obj, &vx, &vy, &vw, &vh);
|
||||
ess->hidden = vy;
|
||||
x = ess->zone->x;
|
||||
y = ess->zone->y - ess->hidden;
|
||||
|
|
|
@ -13,7 +13,9 @@ typedef enum _E_Slipshelf_Action
|
|||
E_SLIPSHELF_ACTION_HOME,
|
||||
E_SLIPSHELF_ACTION_CLOSE,
|
||||
E_SLIPSHELF_ACTION_APPS,
|
||||
E_SLIPSHELF_ACTION_KEYBOARD
|
||||
E_SLIPSHELF_ACTION_KEYBOARD,
|
||||
E_SLIPSHELF_ACTION_APP_NEXT,
|
||||
E_SLIPSHELF_ACTION_APP_PREV
|
||||
} E_Slipshelf_Action;
|
||||
|
||||
struct _E_Slipshelf
|
||||
|
@ -41,7 +43,7 @@ struct _E_Slipshelf
|
|||
void (*func) (const void *data, E_Slipshelf *ess, E_Slipshelf_Action action);
|
||||
const void *data;
|
||||
unsigned char enabled : 1;
|
||||
} home, close, apps, keyboard;
|
||||
} home, close, apps, keyboard, app_next, app_prev;
|
||||
} action;
|
||||
int main_size;
|
||||
int extra_size;
|
||||
|
@ -56,7 +58,7 @@ struct _E_Slipshelf
|
|||
struct {
|
||||
void (*func) (void *data, E_Slipshelf *ess, E_Border *bd);
|
||||
const void *data;
|
||||
} callback_border_select, callback_border_add, callback_border_del, callback_border_home;
|
||||
} callback_border_select, callback_border_home;
|
||||
|
||||
double start;
|
||||
double len;
|
||||
|
@ -78,8 +80,6 @@ EAPI void e_slipshelf_safe_app_region_get(E_Zone *zone, int *x, int *y, int *w,
|
|||
EAPI void e_slipshelf_default_title_set(E_Slipshelf *ess, const char *title);
|
||||
|
||||
EAPI void e_slipshelf_border_select_callback_set(E_Slipshelf *ess, void (*func) (void *data, E_Slipshelf *ess, E_Border *bd), const void *data);
|
||||
EAPI void e_slipshelf_border_add_callback_set(E_Slipshelf *ess, void (*func) (void *data, E_Slipshelf *ess, E_Border *bd), const void *data);
|
||||
EAPI void e_slipshelf_border_del_callback_set(E_Slipshelf *ess, void (*func) (void *data, E_Slipshelf *ess, E_Border *bd), const void *data);
|
||||
EAPI void e_slipshelf_border_home_callback_set(E_Slipshelf *ess, void (*func) (void *data, E_Slipshelf *ess, E_Border *bd), const void *data);
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
#include "e.h"
|
||||
#include "e_slipwin.h"
|
||||
|
||||
typedef struct _Win_Entry Win_Entry;
|
||||
|
||||
struct _Win_Entry
|
||||
{
|
||||
E_Slipwin *slipwin;
|
||||
E_Border *border;
|
||||
Evas_Object *icon;
|
||||
};
|
||||
|
||||
EAPI int E_EVENT_SLIPWIN_DEL = 0;
|
||||
|
||||
/* internal calls */
|
||||
|
@ -14,7 +23,7 @@ static int _e_slipwin_cb_zone_move_resize(void *data, int type, void *event);
|
|||
static int _e_slipwin_cb_zone_del(void *data, int type, void *event);
|
||||
static void _e_slipwin_event_simple_free(void *data, void *ev);
|
||||
static void _e_slipwin_object_del_attach(void *o);
|
||||
static void _e_slipwin_cb_item_sel(void *data, void *data2);
|
||||
static void _e_slipwin_cb_item_sel(void *data);
|
||||
|
||||
static Evas_Object *_theme_obj_new(Evas *e, const char *custom_dir, const char *group);
|
||||
|
||||
|
@ -65,12 +74,13 @@ e_slipwin_new(E_Zone *zone, const char *themedir)
|
|||
|
||||
esw->focused_border = e_border_focused_get();
|
||||
|
||||
o = e_scrollframe_add(esw->popup->evas);
|
||||
edje_object_size_min_calc(esw->base_obj, &mw, &mh);
|
||||
|
||||
o = e_widget_ilist_add(esw->popup->evas, 32 * e_scale, 32 * e_scale, NULL);
|
||||
esw->ilist_obj = o;
|
||||
e_widget_ilist_selector_set(o, 1);
|
||||
edje_object_part_swallow(esw->base_obj, "e.swallow.content", o);
|
||||
evas_object_show(o);
|
||||
esw->scrollframe_obj = o;
|
||||
|
||||
edje_object_size_min_calc(esw->base_obj, &mw, &mh);
|
||||
|
||||
x = zone->x;
|
||||
y = zone->y + zone->h;
|
||||
|
@ -104,33 +114,31 @@ e_slipwin_show(E_Slipwin *esw)
|
|||
Evas_Object *o;
|
||||
Evas_Coord mw, mh, vw, vh, w, h;
|
||||
Eina_List *borders, *l;
|
||||
Win_Entry *ent;
|
||||
int i, selnum;
|
||||
|
||||
E_OBJECT_CHECK(esw);
|
||||
E_OBJECT_TYPE_CHECK(esw, E_SLIPWIN_TYPE);
|
||||
|
||||
/* FIXME: build window list and free old onw if needed */
|
||||
if (esw->ilist_obj)
|
||||
{
|
||||
evas_object_del(esw->ilist_obj);
|
||||
esw->ilist_obj = NULL;
|
||||
}
|
||||
while (esw->borders)
|
||||
{
|
||||
e_object_unref(E_OBJECT(esw->borders->data));
|
||||
ent = esw->borders->data;
|
||||
evas_object_del(ent->icon);
|
||||
e_object_unref(E_OBJECT(ent->border));
|
||||
esw->borders = eina_list_remove_list(esw->borders, esw->borders);
|
||||
free(ent);
|
||||
}
|
||||
|
||||
o = e_ilist_add(esw->popup->evas);
|
||||
e_ilist_selector_set(o, 1);
|
||||
e_ilist_freeze(o);
|
||||
e_widget_ilist_freeze(esw->ilist_obj);
|
||||
e_widget_ilist_clear(esw->ilist_obj);
|
||||
e_widget_ilist_thaw(esw->ilist_obj);
|
||||
|
||||
borders = e_border_client_list();
|
||||
i = 0;
|
||||
selnum = -1;
|
||||
for (l = borders; l; l = l->next)
|
||||
e_widget_ilist_freeze(esw->ilist_obj);
|
||||
for (i = 0, l = borders; l; l = l->next)
|
||||
{
|
||||
E_Border *bd;
|
||||
Evas_Object *ic;
|
||||
const char *title;
|
||||
|
||||
bd = l->data;
|
||||
|
@ -139,42 +147,37 @@ e_slipwin_show(E_Slipwin *esw)
|
|||
(!bd->client.icccm.take_focus)) continue;
|
||||
if (bd->client.netwm.state.skip_taskbar) continue;
|
||||
if (bd->user_skip_winlist) continue;
|
||||
|
||||
|
||||
e_object_ref(E_OBJECT(bd));
|
||||
title = "???";
|
||||
if (bd->client.netwm.name) title = bd->client.netwm.name;
|
||||
else if (bd->client.icccm.title) title = bd->client.icccm.title;
|
||||
e_ilist_append(o, NULL/*icon*/, title, 0, _e_slipwin_cb_item_sel,
|
||||
NULL, esw, bd);
|
||||
esw->borders = eina_list_append(esw->borders, bd);
|
||||
ic = e_border_icon_add(bd, esw->popup->evas);
|
||||
ent = calloc(1, sizeof(Win_Entry));
|
||||
ent->slipwin = esw;
|
||||
ent->border = bd;
|
||||
ent->icon = ic;
|
||||
esw->borders = evas_list_append(esw->borders, ent);
|
||||
e_widget_ilist_append(esw->ilist_obj, ic, title, _e_slipwin_cb_item_sel, ent, NULL);
|
||||
if (bd == e_border_focused_get()) selnum = i;
|
||||
i++;
|
||||
}
|
||||
e_ilist_thaw(o);
|
||||
e_widget_ilist_thaw(esw->ilist_obj);
|
||||
|
||||
e_ilist_min_size_get(o, &mw, &mh);
|
||||
|
||||
evas_object_resize(o, mw, mh);
|
||||
e_scrollframe_child_set(esw->scrollframe_obj, o);
|
||||
|
||||
e_scrollframe_child_viewport_size_get(esw->scrollframe_obj, &vw, &vh);
|
||||
edje_object_part_geometry_get(esw->scrollframe_obj, "e.swallow.content", NULL, NULL, &vw, &vh);
|
||||
// evas_object_geometry_get(esw->scrollframe_obj, NULL, NULL, &w, &h);
|
||||
if (mw > vw) mw = mw + (w - vw);
|
||||
else if (mw < vw) evas_object_resize(o, vw, mh);
|
||||
|
||||
if (selnum >= 0) e_ilist_selected_set(o, selnum);
|
||||
if (selnum >= 0) e_widget_ilist_selected_set(esw->ilist_obj, selnum);
|
||||
|
||||
e_widget_ilist_go(esw->ilist_obj);
|
||||
|
||||
e_widget_ilist_preferred_size_get(esw->ilist_obj, &mw, &mh);
|
||||
edje_extern_object_min_size_set(esw->ilist_obj, mw, mh);
|
||||
edje_object_part_swallow(esw->base_obj, "e.swallow.content", esw->ilist_obj);
|
||||
|
||||
evas_object_show(o);
|
||||
esw->ilist_obj = o;
|
||||
|
||||
edje_extern_object_min_size_set(esw->scrollframe_obj, mw, mh);
|
||||
printf("min size %ix%i\n", mw, mh);
|
||||
edje_object_part_swallow(esw->base_obj, "e.swallow.content", esw->scrollframe_obj);
|
||||
edje_object_size_min_calc(esw->base_obj, &mw, &mh);
|
||||
|
||||
edje_extern_object_min_size_set(esw->ilist_obj, 0, 0);
|
||||
|
||||
|
||||
edje_extern_object_min_size_set(esw->scrollframe_obj, 0, 0);
|
||||
edje_object_part_swallow(esw->base_obj, "e.swallow.content", esw->scrollframe_obj);
|
||||
edje_object_part_swallow(esw->base_obj, "e.swallow.content", esw->ilist_obj);
|
||||
|
||||
mw = esw->zone->w;
|
||||
if (mh > esw->zone->h) mh = esw->zone->h;
|
||||
|
@ -182,8 +185,6 @@ e_slipwin_show(E_Slipwin *esw)
|
|||
|
||||
evas_object_resize(esw->base_obj, esw->popup->w, esw->popup->h);
|
||||
|
||||
printf("sw: %ix%i\n", esw->popup->w, esw->popup->h);
|
||||
|
||||
_e_slipwin_slide(esw, 1, 1.0);
|
||||
}
|
||||
|
||||
|
@ -248,16 +249,19 @@ _e_slipwin_cb_animate(void *data)
|
|||
else
|
||||
{
|
||||
edje_object_signal_emit(esw->base_obj, "e,state,in,end", "e");
|
||||
if (esw->ilist_obj)
|
||||
{
|
||||
evas_object_del(esw->ilist_obj);
|
||||
esw->ilist_obj = NULL;
|
||||
}
|
||||
while (esw->borders)
|
||||
{
|
||||
e_object_unref(E_OBJECT(esw->borders->data));
|
||||
Win_Entry *ent;
|
||||
|
||||
ent = esw->borders->data;
|
||||
evas_object_del(ent->icon);
|
||||
e_object_unref(E_OBJECT(ent->border));
|
||||
esw->borders = eina_list_remove_list(esw->borders, esw->borders);
|
||||
free(ent);
|
||||
}
|
||||
e_widget_ilist_freeze(esw->ilist_obj);
|
||||
e_widget_ilist_clear(esw->ilist_obj);
|
||||
e_widget_ilist_thaw(esw->ilist_obj);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -359,6 +363,16 @@ _e_slipwin_object_del_attach(void *o)
|
|||
|
||||
if (e_object_is_del(E_OBJECT(o))) return;
|
||||
esw = o;
|
||||
while (esw->borders)
|
||||
{
|
||||
Win_Entry *ent;
|
||||
|
||||
ent = esw->borders->data;
|
||||
evas_object_del(ent->icon);
|
||||
e_object_unref(E_OBJECT(ent->border));
|
||||
esw->borders = eina_list_remove_list(esw->borders, esw->borders);
|
||||
free(ent);
|
||||
}
|
||||
ev = calloc(1, sizeof(E_Event_Slipwin_Del));
|
||||
ev->slipwin = esw;
|
||||
e_object_ref(E_OBJECT(esw));
|
||||
|
@ -367,13 +381,14 @@ _e_slipwin_object_del_attach(void *o)
|
|||
}
|
||||
|
||||
static void
|
||||
_e_slipwin_cb_item_sel(void *data, void *data2)
|
||||
_e_slipwin_cb_item_sel(void *data)
|
||||
{
|
||||
E_Slipwin *esw;
|
||||
|
||||
esw = data;
|
||||
if (esw->callback.func) esw->callback.func(esw->callback.data, esw, data2);
|
||||
e_slipwin_hide(esw);
|
||||
Win_Entry *ent;
|
||||
|
||||
ent = data;
|
||||
if (ent->slipwin->callback.func)
|
||||
ent->slipwin->callback.func(ent->slipwin->callback.data, ent->slipwin, ent->border);
|
||||
e_slipwin_hide(ent->slipwin);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ struct _E_Slipwin
|
|||
E_Popup *popup;
|
||||
Ecore_X_Window clickwin;
|
||||
Evas_Object *base_obj;
|
||||
Evas_Object *scrollframe_obj;
|
||||
Evas_Object *ilist_obj;
|
||||
Eina_List *handlers;
|
||||
E_Border *focused_border;
|
||||
|
|
Loading…
Reference in New Issue