Blender  V3.3
GHOST_DropTargetX11.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2012 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "GHOST_SystemX11.h"
11 #include "GHOST_WindowX11.h"
12 #include <GHOST_Types.h>
13 
14 #include "xdnd.h"
15 
17  public:
25 
30 
34  bool GHOST_HandleClientMessage(XEvent *event);
35 
44  void *getGhostData(Atom dropType, unsigned char *dropBuffer, int dropBufferSize);
45 
46  private:
47  /* Internal helper functions */
48 
52  void Initialize(void);
53 
57  void Uninitialize(void);
58 
65  void *getURIListGhostData(unsigned char *dropBuffer, int dropBufferSize);
66 
73  void UrlDecode(char *decodedOut, int bufferSize, const char *encodedIn);
74 
80  char *FileUrlDecode(char *fileUrl);
81 
82  /* The associated GHOST_WindowWin32. */
83  GHOST_WindowX11 *m_window;
84  /* The System. */
85  GHOST_SystemX11 *m_system;
86 
87  /* Data type of the dragged object */
88  GHOST_TDragnDropTypes m_draggedObjectType;
89 
90  /* Is drag-and-drop stuff initialized. */
91  static bool m_xdndInitialized;
92 
93  /* Class holding internal stiff of `xdnd` library. */
94  static DndClass m_dndClass;
95 
96  /* List of supported types to be dragged into. */
97  static Atom *m_dndTypes;
98 
99  /* List of supported drag-and-drop actions. */
100  static Atom *m_dndActions;
101 
102  /* List of supported MIME types to be dragged into. */
103  static const char *m_dndMimeTypes[];
104 
105  /* Counter of references to global #XDND structures. */
106  static int m_refCounter;
107 
108 #ifdef WITH_CXX_GUARDEDALLOC
109  MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_DropTargetX11")
110 #endif
111 };
GHOST_TDragnDropTypes
Definition: GHOST_Types.h:474
bool GHOST_HandleClientMessage(XEvent *event)
void * getGhostData(Atom dropType, unsigned char *dropBuffer, int dropBufferSize)
GHOST_DropTargetX11(GHOST_WindowX11 *window, GHOST_SystemX11 *system)