Blender  V2.93
GHOST_DropTargetX11.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2012 by the Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "GHOST_SystemX11.h"
27 #include "GHOST_WindowX11.h"
28 #include <GHOST_Types.h>
29 
30 #include "xdnd.h"
31 
33  public:
41 
46 
50  bool GHOST_HandleClientMessage(XEvent *event);
51 
60  void *getGhostData(Atom dropType, unsigned char *dropBuffer, int dropBufferSize);
61 
62  private:
63  /* Internal helper functions */
64 
68  void Initialize(void);
69 
73  void Uninitialize(void);
74 
81  void *getURIListGhostData(unsigned char *dropBuffer, int dropBufferSize);
82 
89  void UrlDecode(char *decodedOut, int bufferSize, const char *encodedIn);
90 
96  char *FileUrlDecode(char *fileUrl);
97 
98  /* The associated GHOST_WindowWin32. */
99  GHOST_WindowX11 *m_window;
100  /* The System. */
101  GHOST_SystemX11 *m_system;
102 
103  /* Data type of the dragged object */
104  GHOST_TDragnDropTypes m_draggedObjectType;
105 
106  /* Is drag-and-drop stuff initialized. */
107  static bool m_xdndInitialized;
108 
109  /* Class holding internal stiff of `xdnd` library. */
110  static DndClass m_dndClass;
111 
112  /* List of supported types to be dragged into. */
113  static Atom *m_dndTypes;
114 
115  /* List of supported drag-and-drop actions. */
116  static Atom *m_dndActions;
117 
118  /* List of supported MIME types to be dragged into. */
119  static const char *m_dndMimeTypes[];
120 
121  /* Counter of references to global #XDND structures. */
122  static int m_refCounter;
123 
124 #ifdef WITH_CXX_GUARDEDALLOC
125  MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_DropTargetX11")
126 #endif
127 };
GHOST_TDragnDropTypes
Definition: GHOST_Types.h:477
bool GHOST_HandleClientMessage(XEvent *event)
void * getGhostData(Atom dropType, unsigned char *dropBuffer, int dropBufferSize)
GHOST_DropTargetX11(GHOST_WindowX11 *window, GHOST_SystemX11 *system)