forked from enlightenment/enlightenment
Remove old drag code for indicator & illume2. Drag of top shelf is now
handled almost entirely by the top shelf itself. This removes the input_window also. SVN revision: 44528
This commit is contained in:
parent
8a8025c6d8
commit
13856e38f5
|
@ -7,6 +7,8 @@
|
|||
static void _il_ind_win_cb_free(Il_Ind_Win *iwin);
|
||||
static void _il_ind_win_cb_resize(E_Win *ewin);
|
||||
static void _il_ind_win_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
static void _il_ind_win_cb_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
static void _il_ind_win_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
static int _il_ind_win_gadcon_client_add(void *data, const E_Gadcon_Client_Class *cc);
|
||||
static void _il_ind_win_gadcon_client_del(void *data, E_Gadcon_Client *gcc);
|
||||
static void _il_ind_win_gadcon_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||
|
@ -71,6 +73,10 @@ e_mod_ind_win_new(void)
|
|||
evas_object_move(iwin->o_event, 0, 0);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_il_ind_win_cb_mouse_down, iwin);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_il_ind_win_cb_mouse_move, iwin);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_UP,
|
||||
_il_ind_win_cb_mouse_up, iwin);
|
||||
evas_object_show(iwin->o_event);
|
||||
|
||||
iwin->o_base = edje_object_add(evas);
|
||||
|
@ -178,6 +184,40 @@ _il_ind_win_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_il_ind_win_cb_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Move *ev;
|
||||
E_Border *bd;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
ev = event;
|
||||
bd = iwin->win->border;
|
||||
if (ecore_x_e_illume_drag_locked_get(bd->client.win)) return;
|
||||
if (!ecore_x_e_illume_drag_get(bd->client.win)) return;
|
||||
if ((bd->y + bd->h + ev->cur.output.y) >= (bd->zone->h)) return;
|
||||
if (bd->y != (bd->y + ev->cur.output.y))
|
||||
e_border_move(bd, bd->x, bd->y + ev->cur.output.y);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_ind_win_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Up *ev;
|
||||
E_Border *bd;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
ev = event;
|
||||
if (ev->button != 1) return;
|
||||
bd = iwin->win->border;
|
||||
if (ecore_x_e_illume_drag_locked_get(bd->client.win)) return;
|
||||
if (!ecore_x_e_illume_drag_get(bd->client.win)) return;
|
||||
ecore_x_e_illume_drag_set(bd->client.win, 0);
|
||||
ecore_x_e_illume_drag_end_send(bd->client.win);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_ind_win_cb_menu_post(void *data, E_Menu *m)
|
||||
{
|
||||
|
|
|
@ -59,9 +59,12 @@ Eina_List *illume_border_valid_borders_get(void);
|
|||
E_Border *illume_border_valid_border_get(void);
|
||||
int illume_border_valid_count_get(void);
|
||||
E_Border *illume_border_at_xy_get(int x, int y);
|
||||
E_Border *illume_border_keyboard_get(void);
|
||||
E_Border *illume_border_top_shelf_get(void);
|
||||
E_Border *illume_border_bottom_panel_get(void);
|
||||
|
||||
void illume_border_top_shelf_pos_get(int *x, int *y);
|
||||
void illume_border_top_shelf_size_get(int *w, int *h);
|
||||
void illume_border_top_shelf_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h);
|
||||
void illume_border_slide_to(E_Border *bd, int x, int y, Illume_Anim_Class aclass);
|
||||
void illume_border_min_get(E_Border *bd, int *mw, int *mh);
|
||||
|
||||
|
|
|
@ -27,9 +27,6 @@ static int _cb_mouse_move(void *data, int type, void *event);
|
|||
static int shelfsize = 0;
|
||||
static int kbdsize = 0;
|
||||
static int panelsize = 0;
|
||||
static Ecore_X_Window _drag_win = 0;
|
||||
static Eina_List *handlers = NULL;
|
||||
static E_Border *_drag_border = NULL;
|
||||
|
||||
const Illume_Layout_Mode laymode =
|
||||
{
|
||||
|
@ -46,25 +43,11 @@ void
|
|||
illume_layout_illume_init(void)
|
||||
{
|
||||
illume_layout_mode_register(&laymode);
|
||||
|
||||
handlers =
|
||||
eina_list_append(handlers,
|
||||
ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
|
||||
_cb_mouse_up, NULL));
|
||||
handlers =
|
||||
eina_list_append(handlers,
|
||||
ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
|
||||
_cb_mouse_move, NULL));
|
||||
}
|
||||
|
||||
void
|
||||
illume_layout_illume_shutdown(void)
|
||||
{
|
||||
Ecore_Event_Handler *handler;
|
||||
|
||||
EINA_LIST_FREE(handlers, handler)
|
||||
ecore_event_handler_del(handler);
|
||||
|
||||
illume_layout_mode_unregister(&laymode);
|
||||
}
|
||||
|
||||
|
@ -231,36 +214,15 @@ _border_activate(E_Border *bd)
|
|||
static void
|
||||
_drag_start(E_Border *bd)
|
||||
{
|
||||
E_Container *con;
|
||||
|
||||
/* HANDLE A BORDER DRAG BEING STARTED */
|
||||
|
||||
if (_drag_win) return;
|
||||
con = bd->zone->container;
|
||||
_drag_win =
|
||||
ecore_x_window_input_new(con->win, con->x, con->y, con->w, con->h);
|
||||
ecore_x_window_show(_drag_win);
|
||||
if (!e_grabinput_get(_drag_win, 1, _drag_win))
|
||||
{
|
||||
printf("Grab Input Failed\n");
|
||||
ecore_x_window_free(_drag_win);
|
||||
_drag_win = 0;
|
||||
return;
|
||||
}
|
||||
_drag_border = bd;
|
||||
ecore_x_e_illume_drag_set(bd->client.win, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
_drag_end(E_Border *bd)
|
||||
{
|
||||
/* HANDLE A BORDER DRAG BEING ENDED */
|
||||
|
||||
e_grabinput_release(_drag_win, _drag_win);
|
||||
ecore_x_window_free(_drag_win);
|
||||
_drag_win = 0;
|
||||
|
||||
ecore_x_e_illume_drag_set(bd->client.win, 0);
|
||||
_drag_border = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -306,16 +268,22 @@ _zone_layout(E_Zone *z)
|
|||
/* trap 'special' windows as they need special treatment */
|
||||
if (illume_border_is_top_shelf(bd))
|
||||
{
|
||||
_border_resize_fx(bd, z->x, z->y, z->w, shelfsize);
|
||||
e_border_stick(bd);
|
||||
if (bd->layer != 100) e_border_layer_set(bd, 100);
|
||||
if (!ecore_x_e_illume_drag_get(bd->client.win))
|
||||
{
|
||||
_border_resize_fx(bd, z->x, z->y, z->w, shelfsize);
|
||||
e_border_stick(bd);
|
||||
if (bd->layer != 100) e_border_layer_set(bd, 100);
|
||||
}
|
||||
}
|
||||
else if (illume_border_is_bottom_panel(bd))
|
||||
{
|
||||
_border_resize_fx(bd, z->x, (z->y + z->h - panelsize),
|
||||
z->w, panelsize);
|
||||
e_border_stick(bd);
|
||||
if (bd->layer != 100) e_border_layer_set(bd, 100);
|
||||
if (!ecore_x_e_illume_drag_get(bd->client.win))
|
||||
{
|
||||
_border_resize_fx(bd, z->x, (z->y + z->h - panelsize),
|
||||
z->w, panelsize);
|
||||
e_border_stick(bd);
|
||||
if (bd->layer != 100) e_border_layer_set(bd, 100);
|
||||
}
|
||||
}
|
||||
else if (illume_border_is_keyboard(bd))
|
||||
{
|
||||
|
@ -548,28 +516,3 @@ _zone_move_resize(E_Zone *z)
|
|||
/* the zone was moved or resized - re-configure all windows in this zone */
|
||||
_zone_layout(z);
|
||||
}
|
||||
|
||||
static int
|
||||
_cb_mouse_up(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev;
|
||||
|
||||
ev = event;
|
||||
if (ev->window != _drag_win) return 1;
|
||||
ecore_x_e_illume_drag_end_send(_drag_border->client.win);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_cb_mouse_move(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_Event_Mouse_Move *ev;
|
||||
|
||||
ev = event;
|
||||
if (ev->window != _drag_win) return 1;
|
||||
if ((ev->y + _drag_border->h) >= _drag_border->zone->h) return 1;
|
||||
if ((ev->y + _drag_border->h) >= (_drag_border->zone->h - panelsize)) return 1;
|
||||
if ((_drag_border->y != ev->y))
|
||||
e_border_move(_drag_border, _drag_border->x, ev->y);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue