forked from enlightenment/enlightenment
parent
462f07aa92
commit
422e2844df
|
@ -78,6 +78,8 @@ static void _e_border_event_border_resize_free(void *data, void *ev);
|
|||
static void _e_border_event_border_move_free(void *data, void *ev);
|
||||
static void _e_border_event_border_show_free(void *data, void *ev);
|
||||
static void _e_border_event_border_hide_free(void *data, void *ev);
|
||||
static void _e_border_event_border_stick_free(void *data, void *ev);
|
||||
static void _e_border_event_border_unstick_free(void *data, void *ev);
|
||||
|
||||
static void _e_border_zone_update(E_Border *bd);
|
||||
|
||||
|
@ -102,6 +104,8 @@ int E_EVENT_BORDER_RESIZE = 0;
|
|||
int E_EVENT_BORDER_MOVE = 0;
|
||||
int E_EVENT_BORDER_SHOW = 0;
|
||||
int E_EVENT_BORDER_HIDE = 0;
|
||||
int E_EVENT_BORDER_STICK = 0;
|
||||
int E_EVENT_BORDER_UNSTICK = 0;
|
||||
|
||||
#define GRAV_SET(bd, grav) \
|
||||
printf("GRAV TO %i\n", grav); \
|
||||
|
@ -138,6 +142,8 @@ e_border_init(void)
|
|||
E_EVENT_BORDER_MOVE = ecore_event_type_new();
|
||||
E_EVENT_BORDER_SHOW = ecore_event_type_new();
|
||||
E_EVENT_BORDER_HIDE = ecore_event_type_new();
|
||||
E_EVENT_BORDER_STICK = ecore_event_type_new();
|
||||
E_EVENT_BORDER_UNSTICK = ecore_event_type_new();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -882,20 +888,34 @@ e_border_uniconify(E_Border *bd)
|
|||
void
|
||||
e_border_stick(E_Border *bd)
|
||||
{
|
||||
E_Event_Border_Stick *ev;
|
||||
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
bd->sticky = 1;
|
||||
e_hints_window_sticky_set(bd->client.win, 1);
|
||||
|
||||
ev = E_NEW(E_Event_Border_Stick, 1);
|
||||
ev->border = bd;
|
||||
e_object_ref(E_OBJECT(bd));
|
||||
ecore_event_add(E_EVENT_BORDER_STICK, ev, _e_border_event_border_stick_free, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
e_border_unstick(E_Border *bd)
|
||||
{
|
||||
E_Event_Border_Unstick *ev;
|
||||
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
bd->sticky = 0;
|
||||
e_hints_window_sticky_set(bd->client.win, 0);
|
||||
e_border_desk_set(bd, e_desk_current_get(bd->zone));
|
||||
|
||||
ev = E_NEW(E_Event_Border_Unstick, 1);
|
||||
ev->border = bd;
|
||||
e_object_ref(E_OBJECT(bd));
|
||||
ecore_event_add(E_EVENT_BORDER_UNSTICK, ev, _e_border_event_border_unstick_free, NULL);
|
||||
}
|
||||
|
||||
E_Border *
|
||||
|
@ -3118,6 +3138,26 @@ _e_border_event_border_hide_free(void *data, void *ev)
|
|||
free(e);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_event_border_stick_free(void *data, void *ev)
|
||||
{
|
||||
E_Event_Border_Stick *e;
|
||||
|
||||
e = ev;
|
||||
e_object_unref(E_OBJECT(e->border));
|
||||
free(e);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_event_border_unstick_free(void *data, void *ev)
|
||||
{
|
||||
E_Event_Border_Unstick *e;
|
||||
|
||||
e = ev;
|
||||
e_object_unref(E_OBJECT(e->border));
|
||||
free(e);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_event_border_desk_set_free(void *data, void *ev)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,8 @@ typedef struct _E_Event_Border_Add E_Event_Border_Add;
|
|||
typedef struct _E_Event_Border_Remove E_Event_Border_Remove;
|
||||
typedef struct _E_Event_Border_Show E_Event_Border_Show;
|
||||
typedef struct _E_Event_Border_Hide E_Event_Border_Hide;
|
||||
typedef struct _E_Event_Border_Stick E_Event_Border_Stick;
|
||||
typedef struct _E_Event_Border_Unstick E_Event_Border_Unstick;
|
||||
typedef struct _E_Event_Border_Desk_Set E_Event_Border_Desk_Set;
|
||||
|
||||
#else
|
||||
|
@ -236,6 +238,16 @@ struct _E_Event_Border_Hide
|
|||
E_Border *border;
|
||||
};
|
||||
|
||||
struct _E_Event_Border_Stick
|
||||
{
|
||||
E_Border *border;
|
||||
};
|
||||
|
||||
struct _E_Event_Border_Unstick
|
||||
{
|
||||
E_Border *border;
|
||||
};
|
||||
|
||||
struct _E_Event_Border_Desk_Set
|
||||
{
|
||||
E_Border *border;
|
||||
|
@ -282,6 +294,8 @@ extern EAPI int E_EVENT_BORDER_ADD;
|
|||
extern EAPI int E_EVENT_BORDER_SHOW;
|
||||
extern EAPI int E_EVENT_BORDER_HIDE;
|
||||
extern EAPI int E_EVENT_BORDER_REMOVE;
|
||||
extern EAPI int E_EVENT_BORDER_STICK;
|
||||
extern EAPI int E_EVENT_BORDER_UNSTICK;
|
||||
extern EAPI int E_EVENT_BORDER_DESK_SET;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,8 @@ static int _pager_face_cb_event_border_add(void *data, int type, void *e
|
|||
static int _pager_face_cb_event_border_remove(void *data, int type, void *event);
|
||||
static int _pager_face_cb_event_border_hide(void *data, int type, void *event);
|
||||
static int _pager_face_cb_event_border_show(void *data, int type, void *event);
|
||||
static int _pager_face_cb_event_border_stick(void *data, int type, void *event);
|
||||
static int _pager_face_cb_event_border_unstick(void *data, int type, void *event);
|
||||
static int _pager_face_cb_event_border_desk_set(void *data, int type, void *event);
|
||||
static int _pager_face_cb_event_zone_desk_count_set(void *data, int type, void *event);
|
||||
static void _pager_face_cb_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
|
@ -302,6 +304,12 @@ _pager_face_new(E_Zone *zone)
|
|||
face->ev_handler_border_show =
|
||||
ecore_event_handler_add(E_EVENT_BORDER_SHOW,
|
||||
_pager_face_cb_event_border_show, face);
|
||||
face->ev_handler_border_stick =
|
||||
ecore_event_handler_add(E_EVENT_BORDER_STICK,
|
||||
_pager_face_cb_event_border_stick, face);
|
||||
face->ev_handler_border_unstick =
|
||||
ecore_event_handler_add(E_EVENT_BORDER_UNSTICK,
|
||||
_pager_face_cb_event_border_unstick, face);
|
||||
face->ev_handler_border_desk_set =
|
||||
ecore_event_handler_add(E_EVENT_BORDER_DESK_SET,
|
||||
_pager_face_cb_event_border_desk_set, face);
|
||||
|
@ -346,6 +354,8 @@ _pager_face_free(Pager_Face *face)
|
|||
ecore_event_handler_del(face->ev_handler_border_remove);
|
||||
ecore_event_handler_del(face->ev_handler_border_hide);
|
||||
ecore_event_handler_del(face->ev_handler_border_show);
|
||||
ecore_event_handler_del(face->ev_handler_border_stick);
|
||||
ecore_event_handler_del(face->ev_handler_border_unstick);
|
||||
ecore_event_handler_del(face->ev_handler_border_desk_set);
|
||||
ecore_event_handler_del(face->ev_handler_zone_desk_count_set);
|
||||
|
||||
|
@ -794,7 +804,10 @@ _pager_window_find(Pager_Face *face, E_Border *border)
|
|||
while (wins)
|
||||
{
|
||||
win = wins->data;
|
||||
if (win->border == border)
|
||||
/* We have to check the desk, wouldn't want
|
||||
* a sticky copy */
|
||||
if ((win->border->desk == desk->desk)
|
||||
&& (win->border == border))
|
||||
return win;
|
||||
wins = wins->next;
|
||||
}
|
||||
|
@ -858,18 +871,25 @@ static int
|
|||
_pager_face_cb_event_border_resize(void *data, int type, void *event)
|
||||
{
|
||||
Pager_Face *face;
|
||||
Pager_Desk *desk;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Resize *ev;
|
||||
Evas_List *desks, *wins;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
if ((win = _pager_window_find(face, ev->border)))
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk = desks->data;
|
||||
for (wins = desk->wins; wins; wins = wins->next)
|
||||
{
|
||||
win = wins->data;
|
||||
if (win->border == ev->border)
|
||||
{
|
||||
_pager_window_move(face, win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("ERROR: event_border_resize %p:%p\n", event, ev->border);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -878,18 +898,25 @@ static int
|
|||
_pager_face_cb_event_border_move(void *data, int type, void *event)
|
||||
{
|
||||
Pager_Face *face;
|
||||
Pager_Desk *desk;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Resize *ev;
|
||||
E_Event_Border_Move *ev;
|
||||
Evas_List *desks, *wins;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
if((win = _pager_window_find(face, ev->border)))
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk = desks->data;
|
||||
for (wins = desk->wins; wins; wins = wins->next)
|
||||
{
|
||||
win = wins->data;
|
||||
if (win->border == ev->border)
|
||||
{
|
||||
_pager_window_move(face, win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("ERROR: event_border_move %p:%p\n", event, ev->border);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -901,15 +928,29 @@ _pager_face_cb_event_border_add(void *data, int type, void *event)
|
|||
Pager_Desk *desk;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Add *ev;
|
||||
Evas_List *desks;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
#if 0
|
||||
if (_pager_window_find(face, ev->border))
|
||||
{
|
||||
printf("event_border_add, window found :'(\n");
|
||||
return 1;
|
||||
}
|
||||
if ((desk = _pager_desk_find(face, ev->border->desk)))
|
||||
#endif
|
||||
if (ev->border->sticky)
|
||||
{
|
||||
/* Put on all desks */
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk = desks->data;
|
||||
win = _pager_window_new(desk, ev->border);
|
||||
if (win)
|
||||
desk->wins = evas_list_append(desk->wins, win);
|
||||
}
|
||||
}
|
||||
else if ((desk = _pager_desk_find(face, ev->border->desk)))
|
||||
{
|
||||
win = _pager_window_new(desk, ev->border);
|
||||
if (win)
|
||||
|
@ -927,18 +968,25 @@ _pager_face_cb_event_border_remove(void *data, int type, void *event)
|
|||
{
|
||||
Pager_Face *face;
|
||||
Pager_Desk *desk;
|
||||
Pager_Win *old;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Remove *ev;
|
||||
Evas_List *desks, *wins;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
|
||||
old = _pager_window_find(face, ev->border);
|
||||
desk = _pager_desk_find(face, ev->border->desk);
|
||||
if (old && desk)
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk->wins = evas_list_remove(desk->wins, old);
|
||||
_pager_window_free(old);
|
||||
desk = desks->data;
|
||||
for (wins = desk->wins; wins; wins = wins->next)
|
||||
{
|
||||
win = wins->data;
|
||||
if (win->border == ev->border)
|
||||
{
|
||||
desk->wins = evas_list_remove_list(desk->wins, wins);
|
||||
_pager_window_free(win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -947,16 +995,27 @@ static int
|
|||
_pager_face_cb_event_border_hide(void *data, int type, void *event)
|
||||
{
|
||||
Pager_Face *face;
|
||||
Pager_Desk *desk;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Hide *ev;
|
||||
Evas_List *desks, *wins;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
win = _pager_window_find(face, ev->border);
|
||||
if (win && ev->border->desk->visible)
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk = desks->data;
|
||||
for (wins = desk->wins; wins; wins = wins->next)
|
||||
{
|
||||
win = wins->data;
|
||||
if ((win->border == ev->border)
|
||||
&& (ev->border->desk->visible))
|
||||
{
|
||||
evas_object_hide(win->obj);
|
||||
evas_object_hide(win->icon);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -965,18 +1024,85 @@ static int
|
|||
_pager_face_cb_event_border_show(void *data, int type, void *event)
|
||||
{
|
||||
Pager_Face *face;
|
||||
Pager_Desk *desk;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Show *ev;
|
||||
Evas_List *desks, *wins;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
win = _pager_window_find(face, ev->border);
|
||||
if (win)
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk = desks->data;
|
||||
for (wins = desk->wins; wins; wins = wins->next)
|
||||
{
|
||||
win = wins->data;
|
||||
if ((win->border == ev->border)
|
||||
&& (ev->border->desk->visible))
|
||||
{
|
||||
evas_object_show(win->obj);
|
||||
evas_object_show(win->icon);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
evas_object_raise(face->screen);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_pager_face_cb_event_border_stick(void *data, int type, void *event)
|
||||
{
|
||||
Pager_Face *face;
|
||||
Pager_Desk *desk;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Stick *ev;
|
||||
Evas_List *desks;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk = desks->data;
|
||||
/* On this desk there should already be a border */
|
||||
if (ev->border->desk == desk->desk)
|
||||
continue;
|
||||
|
||||
win = _pager_window_new(desk, ev->border);
|
||||
desk->wins = evas_list_append(desk->wins, win);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_pager_face_cb_event_border_unstick(void *data, int type, void *event)
|
||||
{
|
||||
Pager_Face *face;
|
||||
Pager_Desk *desk;
|
||||
Pager_Win *win;
|
||||
E_Event_Border_Unstick *ev;
|
||||
Evas_List *desks, *wins;
|
||||
|
||||
face = data;
|
||||
ev = event;
|
||||
|
||||
for (desks = face->desks; desks; desks = desks->next)
|
||||
{
|
||||
desk = desks->data;
|
||||
/* On this desk there should be a border */
|
||||
if (desk->desk == ev->border->desk)
|
||||
continue;
|
||||
|
||||
for (wins = desk->wins; wins; wins = wins->next)
|
||||
{
|
||||
win = wins->data;
|
||||
if (win->border == ev->border)
|
||||
{
|
||||
desk->wins = evas_list_remove_list(desk->wins, wins);
|
||||
_pager_window_free(win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -991,6 +1117,9 @@ _pager_face_cb_event_border_desk_set(void *data, int type, void *event)
|
|||
|
||||
face = data;
|
||||
ev = event;
|
||||
if (ev->border->sticky)
|
||||
return 1;
|
||||
|
||||
win = _pager_window_find(face, ev->border);
|
||||
desk = _pager_desk_find(face, ev->border->desk);
|
||||
if (win && desk)
|
||||
|
|
|
@ -63,6 +63,8 @@ struct _Pager_Face
|
|||
Ecore_Event_Handler *ev_handler_border_remove;
|
||||
Ecore_Event_Handler *ev_handler_border_hide;
|
||||
Ecore_Event_Handler *ev_handler_border_show;
|
||||
Ecore_Event_Handler *ev_handler_border_stick;
|
||||
Ecore_Event_Handler *ev_handler_border_unstick;
|
||||
Ecore_Event_Handler *ev_handler_border_desk_set;
|
||||
Ecore_Event_Handler *ev_handler_zone_desk_count_set;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue