Commit 6f4f1981 authored by Cyril Deguet's avatar Cyril Deguet

* very beginning of drag and drop support in X11 skins

parent 5e0a04ba
......@@ -2,7 +2,7 @@
* x11_dragdrop.cpp: X11 implementation of the drag & drop
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_dragdrop.cpp,v 1.1 2003/04/28 14:32:57 asmax Exp $
* $Id: x11_dragdrop.cpp,v 1.2 2003/06/08 18:17:50 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -46,6 +46,25 @@ X11DropObject::~X11DropObject()
{
}
//---------------------------------------------------------------------------
void X11DropObject::DndEnter( ldata_t data )
{
fprintf(stderr,"dnd enter\n");
}
//---------------------------------------------------------------------------
void X11DropObject::DndPosition( ldata_t data )
{
fprintf(stderr,"dnd position\n");
}
//---------------------------------------------------------------------------
void X11DropObject::DndLeave( ldata_t data )
{
fprintf(stderr,"dnd leave\n");
}
//---------------------------------------------------------------------------
void X11DropObject::DndDrop( ldata_t data )
{
fprintf(stderr,"dnd drop\n");
}
#if 0
void X11DropObject::HandleDropStart( GdkDragContext *context )
{
......
......@@ -2,7 +2,7 @@
* x11_dragdrop.h: X11 implementation of the drag & drop
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_dragdrop.h,v 1.1 2003/04/28 14:32:57 asmax Exp $
* $Id: x11_dragdrop.h,v 1.2 2003/06/08 18:17:50 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -30,6 +30,9 @@
#include <X11/Xlib.h>
//---------------------------------------------------------------------------
typedef long ldata_t[5];
class X11DropObject
{
private:
......@@ -39,7 +42,10 @@ class X11DropObject
X11DropObject( intf_thread_t *_p_intf );
virtual ~X11DropObject();
// void HandleDropStart( GdkDragContext *context );
void DndEnter( ldata_t data );
void DndPosition( ldata_t data );
void DndLeave( ldata_t data );
void DndDrop( ldata_t data );
};
//---------------------------------------------------------------------------
#endif
......@@ -2,7 +2,7 @@
* x11_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_run.cpp,v 1.19 2003/06/08 11:33:14 asmax Exp $
* $Id: x11_run.cpp,v 1.20 2003/06/08 18:17:50 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -64,7 +64,8 @@ int ProcessEvent( intf_thread_t *p_intf, VlcProc *proc, XEvent *event )
// Create event to dispatch in windows
// Skin event
if( event->type == ClientMessage )
if( event->type == ClientMessage &&
((XClientMessageEvent*)event)->message_type == 0 )
{
msg = ( (XClientMessageEvent *)event )->data.l[0];
evt = (Event *)new OSEvent( p_intf,
......
......@@ -2,7 +2,7 @@
* x11_window.cpp: X11 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_window.cpp,v 1.15 2003/06/08 12:45:13 gbazin Exp $
* $Id: x11_window.cpp,v 1.16 2003/06/08 18:17:50 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -32,6 +32,7 @@
//--- X11 -------------------------------------------------------------------
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/extensions/shape.h>
//--- SKIN ------------------------------------------------------------------
......@@ -85,7 +86,13 @@ X11Window::X11Window( intf_thread_t *p_intf, Window wnd, int x, int y,
{
// register the listview as a drop target
DropObject = new X11DropObject( p_intf );
// gdk_window_register_dnd( gwnd );
Atom xdndAtom = XInternAtom( display, "XdndAware", False );
char xdndVersion = 4;
XLOCK;
XChangeProperty( display, wnd, xdndAtom, XA_ATOM, 32,
PropModeReplace, (unsigned char *)&xdndVersion, 1);
XUNLOCK;
}
// Create Tool Tip window
......@@ -332,10 +339,33 @@ bool X11Window::ProcessOSEvent( Event *evt )
OSAPI_PostMessage( this, WINDOW_LEAVE, 0, 0 );
return true;
/* case GDK_DROP_START:
DropObject->HandleDropStart( ( (GdkEventDND *)p2 )->context );
return true;
*/
case ClientMessage:
{
string type = XGetAtomName( display, ( (XClientMessageEvent*)
p2 )->message_type );
if( type == "XdndEnter" )
{
DropObject->DndEnter( ((XClientMessageEvent*)p2)->data.l );
return true;
}
else if( type == "XdndPosition" )
{
DropObject->DndPosition( ((XClientMessageEvent*)p2)->data.l );
return true;
}
else if( type == "XdndLeave" )
{
DropObject->DndLeave( ((XClientMessageEvent*)p2)->data.l );
return true;
}
else if( type == "XdndDrop" )
{
DropObject->DndDrop( ((XClientMessageEvent*)p2)->data.l );
return true;
}
}
return false;
default:
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment