19#define ROOTDND_PROTOCOL_VERSION 4
20#define XA_ATOM ((Atom_t) 4)
21#define XA_WINDOW ((Atom_t) 33)
73 TGFrame(p, 32, 32, options, back)
336 for (
n = 0;
a[
n];
n++) { }
345 return gVirtualX->IsDNDAware(win, typelist);
353 if (maxd <= 0)
return kNone;
371 unsigned char *data = 0;
384 &actual, &format, &count, &remaining, &data);
386 if ((actual ==
XA_WINDOW) && (format == 32) && (count > 0) && data) {
394 &actual, &format, &count, &remaining, &data);
399 if ((actual ==
XA_WINDOW) && (format == 32) && (count > 0) && data) {
407 if (data)
delete[] data;
433 skip.
fX = (
event->fUser[2] >> 16) & 0xFFFF;
434 skip.
fY = (
event->fUser[2] & 0xFFFF);
435 skip.
fWidth = (
event->fUser[3] >> 16) & 0xFFFF;
436 skip.
fHeight = (
event->fUser[3] & 0xFFFF);
439 (
int) (event->
fUser[1] & 0x1),
484 event.fWindow = target;
496 for (i = 0; i < 3; ++i)
507 event.fUser[2] = dataType;
508 event.fUser[3] =
kNone;
509 event.fUser[4] =
kNone;
523 event.fWindow = target;
546 event.fWindow = target;
553 event.fUser[2] = (
x << 16) |
y;
554 event.fUser[3] = timestamp;
555 event.fUser[4] = action;
568 event.fWindow = source;
573 event.fUser[1] = (action ==
kNone) ? 0
L : 1L;
577 event.fUser[4] = action;
590 event.fWindow = target;
611 event.fWindow = source;
637 unsigned char *data = 0;
641 &
type, &format, &count, &remaining, &data);
650 for (i = 0; i < count; i++)
655 if (data)
delete[] data;
706 wtarget, x_root, y_root,
x,
y, child);
707 w =
gClient->GetWindowById(wtarget);
780 8, (
unsigned char *) 0, 0);
816 data = dnddata ? (
char *) dnddata->
fData : (
char *)
"";
826 (
unsigned char *) data, len);
829 xevent.
fTime =
event->fTime;
830 xevent.
fUser[0] =
event->fUser[0];
831 xevent.
fUser[1] =
event->fUser[1];
832 xevent.
fUser[2] =
event->fUser[2];
833 xevent.
fUser[3] =
event->fUser[3];
851 unsigned char *data = 0;
856 &actual, &format, &count, &remaining, &data);
858 if ((actual !=
fDropType) || (format != 8) || (count == 0) || !data) {
859 if (data)
delete[] data;
891 int hot_x,
int hot_y)
998 if (newTarget ==
kNone) {
1000 if (t !=
kNone) newTarget = t;
1046 (
unsigned char *) &mainw, 1);
1048 (
unsigned char *) &mainw, 1);
const Mask_t kWAOverrideRedirect
const Mask_t kButtonMotionMask
const Mask_t kButtonPressMask
const Mask_t kWASaveUnder
const Mask_t kButtonReleaseMask
TGDNDManager * gDNDManager
#define ROOTDND_PROTOCOL_VERSION
static int ArrayLength(Atom_t *a)
static Atom_t fgDNDVersion
Bool_t HandleDNDEnter(Window_t src, long vers, Atom_t dataTypes[3])
Handle DND enter event.
virtual ~TGDNDManager()
TGDNDManager destructor.
static Atom_t fgDNDActionPrivate
static Atom_t fgDNDActionAsk
static Atom_t GetDNDDrop()
static Atom_t GetDNDActionAsk()
static Atom_t fgDNDActionMove
Bool_t HandleSelectionRequest(Event_t *event)
Handle selection request event.
static Atom_t fgDNDActionLink
Bool_t HandleClientMessage(Event_t *event)
Handle DND related client messages.
static Atom_t fgDNDActionDescrip
void SendDNDEnter(Window_t target)
Send DND enter message to target window.
static Atom_t fgDNDSelection
void InitAtoms()
Initialize drag and drop atoms.
static Atom_t fgDNDFinished
static Atom_t GetXCDNDData()
static Atom_t GetDNDVersion()
static Atom_t GetDNDActionLink()
Bool_t HandleTimer(TTimer *t)
Handle Drop timeout.
Bool_t HandleDNDDrop(Window_t src, Time_t timestamp)
Handle DND drop event.
static Atom_t GetDNDStatus()
static Atom_t fgXCDNDData
Bool_t HandleDNDFinished(Window_t target)
Handle DND finished event.
static Atom_t fgDNDPosition
Bool_t HandleSelection(Event_t *event)
Handle selection event.
static Atom_t GetDNDTypeList()
Window_t GetRootProxy()
Get root window proxy.
Bool_t HandleDNDStatus(Window_t from, int accepted, Rectangle_t skip, Atom_t action)
Handle DND status event.
static Atom_t fgDNDActionCopy
static Atom_t GetDNDProxy()
static Atom_t GetDNDActionDescrip()
Bool_t StartDrag(TGFrame *src, Int_t x_root, Int_t y_root, Window_t grabWin=kNone)
Start dragging.
void SendDNDStatus(Window_t target, Atom_t action)
Send DND status message to source window.
static Atom_t GetDNDAware()
Bool_t IsDNDAware(Window_t win, Atom_t *typelist=0)
Check if window win is DND aware.
void SetDragPixmap(Pixmap_t pic, Pixmap_t mask, Int_t hot_x, Int_t hot_y)
Set drag window pixmaps and hotpoint.
static Atom_t GetDNDFinished()
static Atom_t GetDNDSelection()
static Atom_t fgDNDActionList
static Atom_t GetDNDActionList()
Window_t FindWindow(Window_t root, Int_t x, Int_t y, Int_t maxd)
Search for DND aware window at position x,y.
static Atom_t fgDNDTypeList
Bool_t RemoveRootProxy()
Remove root window proxy.
static Atom_t GetDNDEnter()
Bool_t HandleDNDPosition(Window_t src, int x_root, int y_root, Atom_t action, Time_t timestamp)
Handle DND position event.
static Atom_t fgXAWMState
void SendDNDPosition(Window_t target, int x, int y, Atom_t action, Time_t timestamp)
Send DND position message to target window.
void SendDNDFinished(Window_t src)
Send DND finished message to source window.
Cursor_t fDNDNoDropCursor
Bool_t Drag(Int_t x_root, Int_t y_root, Atom_t action, Time_t timestamp)
Process drag event.
void SendDNDDrop(Window_t target)
Send DND drop message to target window.
static Atom_t GetDNDPosition()
static Atom_t GetDNDActionPrivate()
static Atom_t fgDNDStatus
TGDNDManager(const TGDNDManager &)
Bool_t HandleDNDLeave(Window_t src)
Handle DND leave event.
void SendDNDLeave(Window_t target)
Send DND leave message to target window.
Bool_t SetRootProxy()
Set root window proxy.
static Atom_t GetDNDActionCopy()
Bool_t EndDrag()
End dragging.
static Atom_t GetDNDActionMove()
static Atom_t GetDNDLeave()
virtual ~TGDragWindow()
TGDragWindow destructor.
virtual void DoRedraw()
Redraw TGDragWindow.
virtual void MapRaised()
Map and Raise TGDragWindow.
virtual void Layout()
Layout TGDragWindow.
virtual void RaiseWindow()
Raise TGDragWindow.
virtual void UnmapWindow()
Unmap TGDragWindow.
Bool_t HasWindow(Window_t w) const
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
TGDragWindow(const TGWindow *p, Pixmap_t pic, Pixmap_t mask, UInt_t options=kChildFrame, Pixel_t back=GetWhitePixel())
TGDragWindow constructor.
Window_t GetInputId() const
virtual void LowerWindow()
Lower TGDragWindow.
static Cursor_t fgDefaultCursor
virtual void MapWindow()
Map TGDragWindow.
virtual Atom_t HandleDNDEnter(Atom_t *)
virtual Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t, Int_t, Int_t)
virtual Bool_t HandleDNDDrop(TDNDData *)
virtual void MapRaised()
map raised
virtual Bool_t HandleDNDFinished()
virtual void DeleteWindow()
Delete window.
virtual Bool_t HandleDNDLeave()
virtual void Move(Int_t x, Int_t y)
Move frame.
virtual TDNDData * GetDNDData(Atom_t)
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MapWindow()
map window
virtual void MapSubwindows()
map sub windows
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void UnmapWindow()
unmap window
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual void LowerWindow()
lower window
virtual void RaiseWindow()
raise window
Handles synchronous and a-synchronous timer events.
int main(int argc, char **argv)
static constexpr double L