19#define ROOTDND_PROTOCOL_VERSION 4
20#define XA_ATOM ((Atom_t) 4)
21#define XA_WINDOW ((Atom_t) 33)
338 for (
n = 0;
a[
n];
n++) { }
355 if (maxd <= 0)
return kNone;
373 unsigned char *
data = 0;
436 skip.
fX = (
event->fUser[2] >> 16) & 0xFFFF;
437 skip.
fY = (
event->fUser[2] & 0xFFFF);
438 skip.
fWidth = (
event->fUser[3] >> 16) & 0xFFFF;
439 skip.
fHeight = (
event->fUser[3] & 0xFFFF);
442 (
int) (event->
fUser[1] & 0x1),
495 event.fUser[1] = ((
n > 3) ? 1L : 0L) | (
fUseVersion << 24);
499 for (i = 0; i < 3; ++i)
510 event.fUser[2] = dataType;
511 event.fUser[3] =
kNone;
512 event.fUser[4] =
kNone;
556 event.fUser[2] = (
x << 16) |
y;
557 event.fUser[3] = timestamp;
558 event.fUser[4] = action;
571 event.fWindow = source;
576 event.fUser[1] = (action ==
kNone) ? 0L : 1L;
580 event.fUser[4] = action;
614 event.fWindow = source;
640 unsigned char *
data = 0;
653 for (i = 0; i < count; i++)
709 wtarget, x_root, y_root,
x,
y,
child);
710 w =
gClient->GetWindowById(wtarget);
783 8, (
unsigned char *) 0, 0);
818 data = dnddata ? (
char *) dnddata->
fData : (
char *)
"";
832 xevent.
fTime =
event->fTime;
833 xevent.
fUser[0] =
event->fUser[0];
834 xevent.
fUser[1] =
event->fUser[1];
835 xevent.
fUser[2] =
event->fUser[2];
836 xevent.
fUser[3] =
event->fUser[3];
854 unsigned char *
data = 0;
894 int hot_x,
int hot_y)
1001 if (newTarget ==
kNone) {
1003 if (t !=
kNone) newTarget = t;
1049 (
unsigned char *) &mainw, 1);
1051 (
unsigned char *) &mainw, 1);
const Mask_t kWAOverrideRedirect
Handle_t Pixmap_t
Pixmap handle.
const Mask_t kButtonMotionMask
const Mask_t kButtonPressMask
Handle_t Window_t
Window handle.
const Mask_t kWASaveUnder
ULong_t Time_t
Event time.
Handle_t Cursor_t
Cursor handle.
const Mask_t kButtonReleaseMask
ULong_t Pixel_t
Pixel value.
TGDNDManager * gDNDManager
#define ROOTDND_PROTOCOL_VERSION
static int ArrayLength(Atom_t *a)
R__EXTERN TGDNDManager * gDNDManager
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t Atom_t typelist
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Drag and drop data container.
Atom_t fDataType
Data type description.
Int_t fDataLength
Length of data.
static Atom_t fgDNDVersion
Bool_t HandleDNDEnter(Window_t src, long vers, Atom_t dataTypes[3])
Handle DND enter event.
static Atom_t fgDNDActionPrivate
static Atom_t fgDNDActionAsk
static Atom_t GetDNDDrop()
static Atom_t GetDNDActionAsk()
TGFrame * fMain
pointer on TGMainFrame
static Atom_t fgDNDActionMove
Pixmap_t fMask
pixmap used for the drag window
Bool_t HandleSelectionRequest(Event_t *event)
Handle selection request event.
static Atom_t fgDNDActionLink
Int_t fHoty
hot point coordinates
Bool_t HandleClientMessage(Event_t *event)
Handle DND related client messages.
TTimer * fDropTimeout
drop timeout
static Atom_t fgDNDActionDescrip
void SendDNDEnter(Window_t target)
Send DND enter message to target window.
static Atom_t fgDNDSelection
Bool_t fTargetIsDNDAware
kTRUE if target is DND aware
Bool_t fStatusPending
kTRUE if status is pending
TGDNDManager(const TGDNDManager &)=delete
void InitAtoms()
Initialize drag and drop atoms.
static Atom_t fgDNDFinished
Atom_t fDropType
drop type
static Atom_t GetXCDNDData()
static Atom_t GetDNDVersion()
Bool_t fProxyOurs
kTRUE if root proxy is ours
static Atom_t GetDNDActionLink()
Bool_t HandleDNDDrop(Window_t src, Time_t timestamp)
Handle DND drop event.
static Atom_t GetDNDStatus()
Atom_t * fDraggerTypes
lists of DND types
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.
Atom_t fLocalAction
accepted and local actions
static Atom_t GetDNDTypeList()
~TGDNDManager() override
TGDNDManager destructor.
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.
Bool_t fUseVersion
kTRUE if DND version is used
void SendDNDStatus(Window_t target, Atom_t action)
Send DND status message to source window.
Bool_t IsDNDAware(Window_t win, Atom_t *typelist=nullptr)
Check if window win is DND aware.
Bool_t fDragging
kTRUE while dragging
static Atom_t GetDNDAware()
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
UInt_t fGrabEventMask
pointer grab event mask
Bool_t fDropAccepted
kTRUE if drop accepted
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
Atom_t fVersion
not really an Atom, but a long
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
no drop cursor type
Bool_t Drag(Int_t x_root, Int_t y_root, Atom_t action, Time_t timestamp)
Process drag event.
TGFrame * fLocalTarget
local source and target
void SendDNDDrop(Window_t target)
Send DND drop message to target window.
static Atom_t GetDNDPosition()
static Atom_t GetDNDActionPrivate()
static Atom_t fgDNDStatus
Window_t fTarget
source and target windows
Bool_t HandleDNDLeave(Window_t src)
Handle DND leave event.
void SendDNDLeave(Window_t target)
Send DND leave message to target window.
TGDragWindow * fDragWin
drag window
Bool_t SetRootProxy()
Set root window proxy.
static Atom_t GetDNDActionCopy()
Bool_t HandleTimer(TTimer *t) override
Handle Drop timeout.
Bool_t EndDrag()
End dragging.
static Atom_t GetDNDActionMove()
static Atom_t GetDNDLeave()
Window used as drag icon during drag and drop operations.
void MapWindow() override
Map TGDragWindow.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Bool_t HasWindow(Window_t w) const
void LowerWindow() override
Lower TGDragWindow.
TGDragWindow(const TGWindow *p, Pixmap_t pic, Pixmap_t mask, UInt_t options=kChildFrame, Pixel_t back=GetWhitePixel())
TGDragWindow constructor.
~TGDragWindow() override
TGDragWindow destructor.
void UnmapWindow() override
Unmap TGDragWindow.
void DoRedraw() override
Redraw TGDragWindow.
Window_t GetInputId() const
void RaiseWindow() override
Raise TGDragWindow.
void Layout() override
Layout TGDragWindow.
Window_t fInput
Input Window.
void MapRaised() override
Map and Raise TGDragWindow.
Pixmap_t fMask
Pixmaps used as Window shape.
UInt_t fPh
Hot point coordinates (x and y)
static Cursor_t fgDefaultCursor
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual Atom_t HandleDNDEnter(Atom_t *)
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
virtual Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t, Int_t, Int_t)
virtual Bool_t HandleDNDDrop(TDNDData *)
UInt_t fHeight
frame height
void MapWindow() override
map window
virtual Bool_t HandleDNDFinished()
void Move(Int_t x, Int_t y) override
Move frame.
virtual void DeleteWindow()
Delete window.
void UnmapWindow() override
unmap window
virtual Bool_t HandleDNDLeave()
virtual TDNDData * GetDNDData(Atom_t)
void MapSubwindows() override
map sub windows
static const TGGC & GetBckgndGC()
Get background color graphics context.
void MapRaised() override
map raised
Handle_t fId
X11/Win32 Window identifier.
ROOT GUI Window base class.
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.
EGEventType fType
of event (see EGEventType)
Handle_t fHandle
general resource handle (used for atoms or windows)
Time_t fTime
time event event occurred in ms
Longptr_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
Rectangle structure (maps to the X11 XRectangle structure)
Attributes that can be used when creating or changing a window.
Bool_t fOverrideRedirect
boolean value for override-redirect
Mask_t fMask
bit mask specifying which fields are valid
Bool_t fSaveUnder
should bits under be saved (popups)?