@ -12,8 +12,6 @@
/* local subsystem functions */
static void _e_drag_show ( E_Drag * drag ) ;
static void _e_drag_hide ( E_Drag * drag ) ;
static void _e_drag_move ( E_Drag * drag , int x , int y ) ;
static void _e_drag_coords_update ( const E_Drop_Handler * h , int * dx , int * dy ) ;
static Ecore_X_Window _e_drag_win_get ( const E_Drop_Handler * h , int xdnd ) ;
@ -21,12 +19,10 @@ static int _e_drag_win_matches(E_Drop_Handler *h, Ecore_X_Window win,
static void _e_drag_win_show ( E_Drop_Handler * h ) ;
static void _e_drag_win_hide ( E_Drop_Handler * h ) ;
static int _e_drag_update ( Ecore_X_Window root , int x , int y , Ecore_X_Atom action ) ;
static void _e_drag_end ( Ecore_X_Window root , int x , int y ) ;
static void _e_drag_end ( int x , int y ) ;
static void _e_drag_xdnd_end ( Ecore_X_Window root , int x , int y ) ;
static void _e_drag_free ( E_Drag * drag ) ;
static Eina_Bool _e_dnd_cb_window_shape ( void * data , int type , void * event ) ;
static Eina_Bool _e_dnd_cb_key_down ( void * data , int type , void * event ) ;
static Eina_Bool _e_dnd_cb_key_up ( void * data , int type , void * event ) ;
static Eina_Bool _e_dnd_cb_mouse_up ( void * data , int type , void * event ) ;
@ -89,7 +85,6 @@ e_dnd_init(void)
E_LIST_HANDLER_APPEND ( _event_handlers , ECORE_EVENT_MOUSE_BUTTON_UP , _e_dnd_cb_mouse_up , NULL ) ;
E_LIST_HANDLER_APPEND ( _event_handlers , ECORE_EVENT_MOUSE_MOVE , _e_dnd_cb_mouse_move , NULL ) ;
E_LIST_HANDLER_APPEND ( _event_handlers , ECORE_X_EVENT_WINDOW_SHAPE , _e_dnd_cb_window_shape , NULL ) ;
E_LIST_HANDLER_APPEND ( _event_handlers , ECORE_X_EVENT_XDND_ENTER , _e_dnd_cb_event_dnd_enter , NULL ) ;
E_LIST_HANDLER_APPEND ( _event_handlers , ECORE_X_EVENT_XDND_LEAVE , _e_dnd_cb_event_dnd_leave , NULL ) ;
E_LIST_HANDLER_APPEND ( _event_handlers , ECORE_X_EVENT_XDND_POSITION , _e_dnd_cb_event_dnd_position , NULL ) ;
@ -153,38 +148,16 @@ e_drag_new(E_Container *container, int x, int y,
drag - > layer = E_LAYER_DRAG ;
drag - > container = container ;
e_object_ref ( E_OBJECT ( drag - > container ) ) ;
drag - > ecore_evas = e_canvas_new ( drag - > container - > win ,
drag - > x , drag - > y , drag - > w , drag - > h , 1 , 1 ,
& ( drag - > evas_win ) ) ;
if ( ! e_config - > use_shaped_win )
ecore_evas_alpha_set ( drag - > ecore_evas , 1 ) ;
else
{
/* avoid excess exposes when shaped - set damage avoid to 1 */
ecore_evas_avoid_damage_set ( drag - > ecore_evas , 1 ) ;
ecore_evas_shaped_set ( drag - > ecore_evas , 1 ) ;
ecore_x_window_shape_events_select ( drag - > evas_win , 1 ) ;
}
e_canvas_add ( drag - > ecore_evas ) ;
drag - > shape = e_container_shape_add ( drag - > container ) ;
e_container_shape_move ( drag - > shape , drag - > x , drag - > y ) ;
e_container_shape_resize ( drag - > shape , drag - > w , drag - > h ) ;
drag - > evas = ecore_evas_get ( drag - > ecore_evas ) ;
e_container_window_raise ( drag - > container , drag - > evas_ win , drag - > layer ) ;
drag - > evas = e_comp_get ( drag ) - > evas ;
drag - > pop = e_popup_new ( e_zone_current_get ( container ) , x , y , drag - > w , drag - > h ) ;
ecore_evas_name_class _set ( drag - > ecore_evas , " E " , " _e_drag_window " ) ;
ecore_evas_title _set ( drag - > ecore_evas , " E Drag " ) ;
ecore_evas _ignore_events_set ( drag - > ecore_evas , 1 ) ;
e_popup_name_set ( drag - > pop , " E Drag " ) ;
e_popup_layer_set ( drag - > pop , E_COMP_CANVAS_LAYER_POPUP , 0 ) ;
e_popup_ignore_events_set ( drag - > pop , 1 ) ;
drag - > object = evas_object_rectangle_add ( drag - > evas ) ;
evas_object_color_set ( drag - > object , 255 , 0 , 0 , 255 ) ;
evas_object_show ( drag - > object ) ;
evas_object_move ( drag - > object , 0 , 0 ) ;
evas_object_resize ( drag - > object , drag - > w , drag - > h ) ;
ecore_evas_resize ( drag - > ecore_evas , drag - > w , drag - > h ) ;
drag - > type = E_DRAG_NONE ;
@ -219,7 +192,9 @@ e_drag_object_set(E_Drag *drag, Evas_Object *object)
{
if ( drag - > object ) evas_object_del ( drag - > object ) ;
drag - > object = object ;
evas_object_resize ( drag - > object , drag - > w , drag - > h ) ;
drag - > pop - > content = NULL ;
if ( _drag_current = = drag )
e_popup_content_set ( drag - > pop , object ) ;
}
EAPI void
@ -228,7 +203,8 @@ e_drag_move(E_Drag *drag, int x, int y)
if ( ( drag - > x = = x ) & & ( drag - > y = = y ) ) return ;
drag - > x = x ;
drag - > y = y ;
drag - > xy_update = 1 ;
if ( _drag_current = = drag )
e_popup_move ( drag - > pop , x , y ) ;
}
EAPI void
@ -237,9 +213,8 @@ e_drag_resize(E_Drag *drag, int w, int h)
if ( ( drag - > w = = w ) & & ( drag - > h = = h ) ) return ;
drag - > h = h ;
drag - > w = w ;
evas_object_resize ( drag - > object , drag - > w , drag - > h ) ;
ecore_evas_resize ( drag - > ecore_evas , drag - > w , drag - > h ) ;
e_container_shape_resize ( drag - > shape , drag - > w , drag - > h ) ;
if ( _drag_current = = drag )
e_popup_resize ( drag - > pop , w , h ) ;
}
EAPI int
@ -265,7 +240,9 @@ e_drag_start(E_Drag *drag, int x, int y)
ecore_x_window_free ( _drag_win ) ;
return 0 ;
}
e_popup_move_resize ( drag - > pop , drag - > x , drag - > y , drag - > w , drag - > h ) ;
e_popup_content_set ( drag - > pop , drag - > object ) ;
drag - > visible = 1 ;
drag - > type = E_DRAG_INTERNAL ;
drag - > dx = x - drag - > x ;
@ -320,7 +297,9 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
ecore_x_window_free ( _drag_win ) ;
return 0 ;
}
e_popup_move_resize ( drag - > pop , drag - > x , drag - > y , drag - > w , drag - > h ) ;
e_popup_content_set ( drag - > pop , drag - > object ) ;
drag - > visible = 1 ;
drag - > type = E_DRAG_XDND ;
drag - > dx = x - drag - > x ;
@ -489,74 +468,6 @@ e_drop_xdnd_register_set(Ecore_X_Window win, int reg)
return 1 ;
}
EAPI void
e_drag_idler_before ( void )
{
const Eina_List * l ;
E_Drag * drag ;
EINA_LIST_FOREACH ( _drag_list , l , drag )
{
if ( drag - > need_shape_export )
{
Ecore_X_Rectangle * rects , * orects ;
int num ;
rects = ecore_x_window_shape_rectangles_get ( drag - > evas_win , & num ) ;
if ( rects )
{
int changed ;
changed = 1 ;
if ( ( num = = drag - > shape_rects_num ) & & ( drag - > shape_rects ) )
{
int i ;
orects = drag - > shape_rects ;
for ( i = 0 ; i < num ; i + + )
{
if ( ( orects [ i ] . x ! = rects [ i ] . x ) | |
( orects [ i ] . y ! = rects [ i ] . y ) | |
( orects [ i ] . width ! = rects [ i ] . width ) | |
( orects [ i ] . height ! = rects [ i ] . height ) )
{
changed = 1 ;
break ;
}
}
// TODO: This is meaningless
changed = 0 ;
}
if ( changed )
{
E_FREE ( drag - > shape_rects ) ;
drag - > shape_rects = rects ;
drag - > shape_rects_num = num ;
e_container_shape_rects_set ( drag - > shape , rects , num ) ;
}
else
free ( rects ) ;
}
else
{
E_FREE ( drag - > shape_rects ) ;
drag - > shape_rects = NULL ;
drag - > shape_rects_num = 0 ;
e_container_shape_rects_set ( drag - > shape , NULL , 0 ) ;
}
drag - > need_shape_export = 0 ;
if ( drag - > visible )
e_container_shape_show ( drag - > shape ) ;
}
if ( drag - > xy_update )
{
ecore_evas_move ( drag - > ecore_evas , drag - > x , drag - > y ) ;
e_container_shape_move ( drag - > shape , drag - > x , drag - > y ) ;
drag - > xy_update = 0 ;
}
}
}
EAPI void
e_drop_handler_responsive_set ( E_Drop_Handler * handler )
{
@ -650,26 +561,6 @@ e_dnd_util_text_uri_list_convert(char *data, int size)
/* local subsystem functions */
static void
_e_drag_show ( E_Drag * drag )
{
if ( drag - > visible ) return ;
drag - > visible = 1 ;
evas_object_show ( drag - > object ) ;
ecore_evas_show ( drag - > ecore_evas ) ;
e_container_shape_show ( drag - > shape ) ;
}
static void
_e_drag_hide ( E_Drag * drag )
{
if ( ! drag - > visible ) return ;
drag - > visible = 0 ;
evas_object_hide ( drag - > object ) ;
ecore_evas_hide ( drag - > ecore_evas ) ;
e_container_shape_hide ( drag - > shape ) ;
}
static void
_e_drag_move ( E_Drag * drag , int x , int y )
{
@ -682,7 +573,7 @@ _e_drag_move(E_Drag *drag, int x, int y)
drag - > x = x - drag - > dx ;
drag - > y = y - drag - > dy ;
drag - > xy_update = 1 ;
e_popup_move ( drag - > pop , drag - > x , drag - > y ) ;
}
static void
@ -700,10 +591,9 @@ _e_drag_coords_update(const E_Drop_Handler *h, int *dx, int *dy)
case E_GADCON_TYPE :
gc = ( E_Gadcon * ) h - > obj ;
e_gadcon_canvas_zone_geometry_get ( gc , & px , & py , NULL , NULL ) ;
if ( ! gc - > toolbar ) break ;
px + = gc - > toolbar - > fwin - > x ;
py + = gc - > toolbar - > fwin - > y ;
if ( ! gc - > toolbar ) return ;
px = gc - > toolbar - > fwin - > x ;
py = gc - > toolbar - > fwin - > y ;
break ;
case E_GADCON_CLIENT_TYPE :
@ -754,14 +644,28 @@ _e_drag_win_get(const E_Drop_Handler *h, int xdnd)
{
switch ( h - > obj - > type )
{
E_Gadcon * gc ;
case E_GADCON_TYPE :
if ( xdnd ) hwin = e_gadcon_xdnd_window_get ( ( E_Gadcon * ) ( h - > obj ) ) ;
else hwin = e_gadcon_dnd_window_get ( ( E_Gadcon * ) ( h - > obj ) ) ;
gc = ( E_Gadcon * ) h - > obj ;
if ( gc - > toolbar ) hwin = gc - > toolbar - > fwin - > border - > win ; //double check for xdnd...
else
{
if ( xdnd ) hwin = e_gadcon_xdnd_window_get ( gc ) ;
else hwin = e_gadcon_dnd_window_get ( gc ) ;
}
break ;
case E_GADCON_CLIENT_TYPE :
if ( xdnd ) hwin = e_gadcon_xdnd_window_get ( ( ( E_Gadcon_Client * ) ( h - > obj ) ) - > gadcon ) ;
else hwin = e_gadcon_dnd_window_get ( ( ( E_Gadcon_Client * ) ( h - > obj ) ) - > gadcon ) ;
gc = ( ( E_Gadcon_Client * ) ( h - > obj ) ) - > gadcon ;
if ( gc - > toolbar ) hwin = gc - > toolbar - > fwin - > border - > win ; //double check for xdnd...
else
{
if ( xdnd ) hwin = e_gadcon_xdnd_window_get ( gc ) ;
else hwin = e_gadcon_dnd_window_get ( gc ) ;
}
break ;
case E_WIN_TYPE :
@ -847,13 +751,32 @@ _e_drag_win_hide(E_Drop_Handler *h)
}
}
static unsigned int
_e_dnd_object_layer_get ( E_Object * obj )
{
unsigned int adjust = 0 ;
if ( ! obj ) return 0 ;
switch ( obj - > type )
{
case E_GADCON_CLIENT_TYPE :
/* add 1 to ensure we're above a potential receiving gadcon */
adjust = 1 ;
default :
adjust + = e_comp_e_object_layer_get ( obj ) ;
}
return adjust ;
}
static int
_e_drag_update ( Ecore_X_Window root , int x , int y , Ecore_X_Atom action )
{
const Eina_List * l ;
Eina_List * entered = NULL ;
E_Event_Dnd_Enter enter_ev ;
E_Event_Dnd_Move move_ev ;
E_Event_Dnd_Leave leave_ev ;
E_Drop_Handler * h , * top = NULL ;
unsigned int top_layer = 0 ;
int dx , dy ;
Ecore_X_Window win ;
int responsive = 0 ;
@ -861,26 +784,64 @@ _e_drag_update(Ecore_X_Window root, int x, int y, Ecore_X_Atom action)
// double t1 = ecore_time_get(); ////
if ( _drag_current & & ! _xdnd )
{
win = ecore_evas_window_get ( _drag_current - > ecore_evas ) ;
win = e_comp_top_window_at_xy_get ( e_comp_get ( e_manager_find_by_root ( root ) ) , x , y , & win , 1 ) ;
Ecore_X_Window ignore [ 1 ] ;
ignore [ 0 ] = _drag_win ;
win = e_comp_top_window_at_xy_get ( e_comp_get ( _drag_current ) , x , y , ignore , 1 ) ;
}
else
win = root ;
if ( _drag_current )
{
_e_drag_show ( _drag_current ) ;
if ( _drag_current - > visible ) e_popup_show ( _drag_current - > pop ) ;
else e_popup_hide ( _drag_current - > pop ) ;
_e_drag_move ( _drag_current , x , y ) ;
}
EINA_LIST_FOREACH ( _drop_handlers , l , h )
{
if ( ! h - > active ) continue ;
_e_drag_coords_update ( h , & dx , & dy ) ;
enter_ev . x = x - dx ;
enter_ev . y = y - dy ;
enter_ev . data = NULL ;
enter_ev . action = action ;
move_ev . x = x - dx ;
move_ev . y = y - dy ;
move_ev . action = action ;
leave_ev . x = x - dx ;
leave_ev . y = y - dy ;
if ( E_INSIDE ( enter_ev . x , enter_ev . y , h - > x , h - > y , h - > w , h - > h ) & &
( ( ! _drag_current ) | | _e_drag_win_matches ( h , win , 0 ) ) )
entered = eina_list_append ( entered , h ) ;
else
{
if ( h - > entered )
{
if ( h - > cb . leave )
h - > cb . leave ( h - > cb . data , h - > active_type , & leave_ev ) ;
if ( _drag_current )
_e_drag_win_hide ( h ) ;
h - > entered = 0 ;
}
}
}
if ( ! entered ) return 0 ;
if ( _drag_current )
EINA_LIST_FREE ( entered , h )
{
E_Drop_Handler * h ;
unsigned int layer ;
E_Drop_Handler * h2 ;
EINA_LIST_FOREACH ( _drop_handlers , l , h )
_e_drag_coords_update ( h , & dx , & dy ) ;
leave_ev . x = x - dx ;
leave_ev . y = y - dy ;
layer = _e_dnd_object_layer_get ( h - > obj ) ;
if ( ! top )
{
if ( ! h - > active ) continue ;
_e_drag_coords_update ( h , & dx , & dy ) ;
top = h ;
top_layer = layer ;
enter_ev . x = x - dx ;
enter_ev . y = y - dy ;
enter_ev . data = NULL ;
@ -888,93 +849,58 @@ _e_drag_update(Ecore_X_Window root, int x, int y, Ecore_X_Atom action)
move_ev . x = x - dx ;
move_ev . y = y - dy ;
move_ev . action = action ;
leave_ev . x = x - dx ;
leave_ev . y = y - dy ;
if ( E_INSIDE ( enter_ev . x , enter_ev . y , h - > x , h - > y , h - > w , h - > h ) & &
_e_drag_win_matches ( h , win , 0 ) )
{
if ( e_drop_handler_responsive_get ( h ) ) responsive = 1 ;
if ( ! h - > entered )
{
_e_drag_win_show ( h ) ;
if ( h - > cb . enter )
{
if ( _drag_current - > cb . convert )
{
enter_ev . data = _drag_current - > cb . convert ( _drag_current ,
h - > active_type ) ;
}
else
enter_ev . data = _drag_current - > data ;
h - > cb . enter ( h - > cb . data , h - > active_type , & enter_ev ) ;
}
h - > entered = 1 ;
}
if ( h - > cb . move )
h - > cb . move ( h - > cb . data , h - > active_type , & move_ev ) ;
}
else
{
if ( h - > entered )
{
if ( h - > cb . leave )
h - > cb . leave ( h - > cb . data , h - > active_type , & leave_ev ) ;
_e_drag_win_hide ( h ) ;
h - > entered = 0 ;
}
}
continue ;
}
}
else if ( _xdnd )
{
E_Drop_Handler * h ;
EINA_LIST_FOREACH ( _drop_handlers , l , h )
if ( layer > top_layer )
{
if ( ! h - > active ) continue ;
_e_drag_coords_update ( h , & dx , & dy ) ;
h2 = top , top = h , h = h2 ;
enter_ev . x = x - dx ;
enter_ev . y = y - dy ;
enter_ev . data = NULL ;
enter_ev . action = action ;
move_ev . x = x - dx ;
move_ev . y = y - dy ;
move_ev . action = action ;
leave_ev . x = x - dx ;
leave_ev . y = y - dy ;
if ( E_INSIDE ( enter_ev . x , enter_ev . y , h - > x , h - > y , h - > w , h - > h ) & & _e_drag_win_matches ( h , win , 1 ) )
{
if ( e_drop_handler_responsive_get ( h ) ) responsive = 1 ;
if ( ! h - > entered )
{
if ( h - > cb . enter )
h - > cb . enter ( h - > cb . data , h - > active_type , & enter_ev ) ;
h - > entered = 1 ;
}
if ( h - > cb . move )
h - > cb . move ( h - > cb . data , h - > active_type , & move_ev ) ;
}
else
}
if ( h = = top ) continue ;
if ( h - > entered )
{
if ( h - > cb . leave )
h - > cb . leave ( h - > cb . data , h - > active_type , & leave_ev ) ;
if ( _drag_current )
_e_drag_win_hide ( h ) ;
h - > entered = 0 ;
}
}
responsive = ! ! e_drop_handler_responsive_get ( top ) ;
if ( ! top - > entered )
{
_e_drag_win_show ( top ) ;
if ( top - > cb . enter )
{
if ( _drag_current )
{
if ( h - > entered )
if ( _drag_current - > cb . convert )
{
if ( h - > cb . leave )
h - > cb . leave ( h - > cb . data , h - > active_type , & leave_ev ) ;
h - > entered = 0 ;
enter_ev . data = _drag_current - > cb . convert ( _drag_current ,
top - > active_type ) ;
}
else
enter_ev . data = _drag_current - > data ;
}
top - > cb . enter ( top - > cb . data , top - > active_type , & enter_ev ) ;
}
top - > entered = 1 ;
}
if ( top - > cb . move )
top - > cb . move ( top - > cb . data , top - > active_type , & move_ev ) ;
return responsive ;
// double t2 = ecore_time_get() - t1; ////
// printf("DND UPDATE %3.7f\n", t2); ////
}
static void
_e_drag_end ( Ecore_X_Window root , int x , int y )
_e_drag_end ( int x , int y )
{
E_Zone * zone ;
const Eina_List * l ;
@ -982,21 +908,22 @@ _e_drag_end(Ecore_X_Window root, int x, int y)
int dx , dy ;
Ecore_X_Window win ;
E_Drag * tmp ;
E_Drop_Handler * h ;
int dropped ;
Ecore_X_Window ignore [ 1 ] ;
if ( ! _drag_current ) return ;
win = ecore_evas_window_get ( _drag_current - > ecore_evas ) ;
win = e_comp_top_window_at_xy_get ( e_comp_get ( e_manager_find_by_root ( root ) ) , x , y , & w in, 1 ) ;
ignore [ 0 ] = _drag_win ;
win = e_comp_top_window_at_xy_get ( e_comp_get ( _drag_current ) , x , y , ig nore , 1 ) ;
zone = e_container_zone_at_point_get ( _drag_current - > container , x , y ) ;
/* Pass -1, -1, so that it is possible to drop at the edge. */
if ( zone ) e_zone_flip_coords_handle ( zone , - 1 , - 1 ) ;
_e_drag _hide( _drag_current ) ;
e_popup _hide( _drag_current - > pop ) ;
e_grabinput_release ( _drag_win , _drag_win ) ;
while ( _drag_current - > type = = E_DRAG_XDND )
{
int dropped ;
if ( ! ( dropped = ecore_x_dnd_drop ( ) ) )
{
if ( win = = e_comp_get ( NULL ) - > ee_win ) break ;
@ -1019,61 +946,12 @@ _e_drag_end(Ecore_X_Window root, int x, int y)
ecore_x_window_free ( _drag_win ) ;
_drag_win = 0 ;
dropped = 0 ;
if ( _drag_current - > data )
{
E_Drop_Handler * h ;
int dropped = 0 ;
EINA_LIST_FOREACH ( _drop_handlers , l , h )
{
if ( ! h - > active ) continue ;
_e_drag_coords_update ( h , & dx , & dy ) ;
ev . x = x - dx ;
ev . y = y - dy ;
if ( ( _e_drag_win_matches ( h , win , 0 ) ) & &
( ( h - > cb . drop ) & & ( E_INSIDE ( ev . x , ev . y , h - > x , h - > y , h - > w , h - > h ) ) ) )
{
Eina_Bool need_free = EINA_FALSE ;
if ( _drag_current - > cb . convert )
{
ev . data = _drag_current - > cb . convert ( _drag_current ,
h - > active_type ) ;
}
else
{
unsigned int i ;
for ( i = 0 ; i < _drag_current - > num_types ; i + + )
if ( _drag_current - > types [ i ] = = _type_text_uri_list )
{
ev . data = e_dnd_util_text_uri_list_convert ( _drag_current - > data , _drag_current - > data_size ) ;
need_free = EINA_TRUE ;
break ;
}
if ( ! need_free )
ev . data = _drag_current - > data ;
}
h - > cb . drop ( h - > cb . data , h - > active_type , & ev ) ;
if ( need_free ) E_FREE_LIST ( ev . data , free ) ;
dropped = 1 ;
}
h - > entered = 0 ;
if ( dropped ) break ;
}
if ( _drag_current - > cb . finished )
_drag_current - > cb . finished ( _drag_current , dropped ) ;
tmp = _drag_current ;
_drag_current = NULL ;
e_object_del ( E_OBJECT ( tmp ) ) ;
}
else
if ( ! _drag_current - > data )
{
/* Just leave */
E_Event_Dnd_Leave leave_ev ;
E_Drop_Handler * h ;
/* FIXME: We don't need x and y in leave */
leave_ev . x = 0 ;
@ -1091,6 +969,50 @@ _e_drag_end(Ecore_X_Window root, int x, int y)
}
}
}
EINA_LIST_FOREACH ( _drop_handlers , l , h )
{
if ( ! h - > active ) continue ;
_e_drag_coords_update ( h , & dx , & dy ) ;
ev . x = x - dx ;
ev . y = y - dy ;
if ( ( _e_drag_win_matches ( h , win , 0 ) ) & &
( ( h - > cb . drop ) & & ( E_INSIDE ( ev . x , ev . y , h - > x , h - > y , h - > w , h - > h ) ) ) )
{
Eina_Bool need_free = EINA_FALSE ;
if ( _drag_current - > cb . convert )
{
ev . data = _drag_current - > cb . convert ( _drag_current ,
h - > active_type ) ;
}
else
{
unsigned int i ;
for ( i = 0 ; i < _drag_current - > num_types ; i + + )
if ( _drag_current - > types [ i ] = = _type_text_uri_list )
{
ev . data = e_dnd_util_text_uri_list_convert ( _drag_current - > data , _drag_current - > data_size ) ;
need_free = EINA_TRUE ;
break ;
}
if ( ! need_free )
ev . data = _drag_current - > data ;
}
h - > cb . drop ( h - > cb . data , h - > active_type , & ev ) ;
if ( need_free ) E_FREE_LIST ( ev . data , free ) ;
dropped = 1 ;
}
h - > entered = 0 ;
if ( dropped ) break ;
}
if ( _drag_current - > cb . finished )
_drag_current - > cb . finished ( _drag_current , dropped ) ;
tmp = _drag_current ;
_drag_current = NULL ;
e_object_del ( E_OBJECT ( tmp ) ) ;
}
static void
@ -1180,35 +1102,14 @@ _e_drag_free(E_Drag *drag)
_drag_list = eina_list_remove ( _drag_list , drag ) ;
E_FREE ( drag - > shape_rects ) ;
drag - > shape_rects_num = 0 ;
e_object_unref ( E_OBJECT ( drag - > container ) ) ;
e_container_shape_hide ( drag - > shape ) ;
e_object_del ( E_OBJECT ( drag - > shape ) ) ;
evas_object_del ( drag - > object ) ;
e_canvas_del ( drag - > ecore_evas ) ;
ecore_evas_free ( drag - > ecore_evas ) ;
E_FREE_FUNC ( drag - > pop , e_object_del ) ;
for ( i = 0 ; i < drag - > num_types ; i + + )
eina_stringshare_del ( drag - > types [ i ] ) ;
free ( drag ) ;
ecore_x_window_shadow_tree_flush ( ) ;
}
static Eina_Bool
_e_dnd_cb_window_shape ( void * data __UNUSED__ , int ev_type __UNUSED__ , void * ev )
{
Ecore_X_Event_Window_Shape * e = ev ;
const Eina_List * l ;
E_Drag * drag ;
EINA_LIST_FOREACH ( _drag_list , l , drag )
{
if ( drag - > evas_win = = e - > win )
drag - > need_shape_export = 1 ;
}
return ECORE_CALLBACK_PASS_ON ;
}
static Eina_Bool
_e_dnd_cb_key_down ( void * data __UNUSED__ , int type __UNUSED__ , void * event )
{
@ -1249,7 +1150,7 @@ _e_dnd_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
ev = event ;
if ( ev - > window ! = _drag_win ) return ECORE_CALLBACK_PASS_ON ;
_e_drag_end ( _drag_win_root , ev - > x , ev - > y ) ;
_e_drag_end ( ev - > x , ev - > y ) ;
return ECORE_CALLBACK_PASS_ON ;
}