~3v1n0/nux/check-dnd_area-trusty

220.3.1 by Jay Taoko
*Fixes
1
/*
307.1.2 by Jay Taoko
* Added LGPL v2.1 License to source code files.
2
 * Copyright 2010 Inalogic® Inc.
220.3.1 by Jay Taoko
*Fixes
3
 *
4
 * This program is free software: you can redistribute it and/or modify it
307.1.2 by Jay Taoko
* Added LGPL v2.1 License to source code files.
5
 * under the terms of the GNU Lesser General Public License, as
6
 * published by the  Free Software Foundation; either version 2.1 or 3.0
7
 * of the License.
220.3.1 by Jay Taoko
*Fixes
8
 *
9
 * This program is distributed in the hope that it will be useful, but
10
 * WITHOUT ANY WARRANTY; without even the implied warranties of
11
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
13
 * License for more details.
14
 *
15
 * You should have received a copy of both the GNU Lesser General Public
307.1.2 by Jay Taoko
* Added LGPL v2.1 License to source code files.
16
 * License along with this program. If not, see <http://www.gnu.org/licenses/>
220.3.1 by Jay Taoko
*Fixes
17
 *
18
 * Authored by: Jay Taoko <jaytaoko@inalogic.com>
19
 *
20
 */
21
22
281.1.1 by Jay Taoko
* Fix global clipping rectangle
23
#ifndef GRAPHICSDISPLAYX11_H
24
#define GRAPHICSDISPLAYX11_H
220.3.1 by Jay Taoko
*Fixes
25
26
#include "Gfx_Interface.h"
27
#include "GLTimer.h"
28
#include "GLDeviceObjects.h"
29
#include "GLRenderStates.h"
30
31
/* Xlib.h is the default header that is included and has the core functionallity */
32
#include <X11/Xlib.h>
33
/* Xatom.h includes functionallity for creating new protocol messages */
34
#include <X11/Xatom.h>
35
/* keysym.h contains keysymbols which we use to resolv what keys that are being pressed */
36
#include <X11/keysym.h>
37
38
#include <X11/extensions/xf86vmode.h>
477.2.1 by Sam Spilsbury
Determine strut positioning relative to monitor position. Fixes LP #861341
39
#include <X11/extensions/Xinerama.h>
220.3.1 by Jay Taoko
*Fixes
40
41
namespace nux
42
{
43
44
  class Event;
45
  class MainFBO;
46
  class GpuDevice;
47
  class GraphicsEngine;
48
  class IOpenGLFrameBufferObject;
49
50
  enum WindowStyle
51
  {
52
    WINDOWSTYLE_NORMAL,
53
    WINDOWSTYLE_PANEL,
54
    WINDOWSTYLE_DIALOG,
55
    WINDOWSTYLE_TOOL,
56
    WINDOWSTYLE_NOBORDER,
57
  };
651.1.1 by Brandon Schaefer
* Removed trailing white space
58
220.3.1 by Jay Taoko
*Fixes
59
  enum DndAction
60
  {
61
    DNDACTION_COPY,
62
    DNDACTION_MOVE,
220.5.4 by Jason Smith
more work on DND
63
    DNDACTION_LINK,
64
    DNDACTION_ASK,
220.3.1 by Jay Taoko
*Fixes
65
    DNDACTION_PRIVATE,
651.1.1 by Brandon Schaefer
* Removed trailing white space
66
220.3.1 by Jay Taoko
*Fixes
67
    DNDACTION_NONE,
68
  };
651.1.1 by Brandon Schaefer
* Removed trailing white space
69
220.3.1 by Jay Taoko
*Fixes
70
#define NUX_THREADMSG                           (WM_APP+0)
71
#define NUX_THREADMSG_START_RENDERING           (WM_APP+1)  // Connection established // start at WM_APP
72
#define NUX_THREADMSG_CHILD_WINDOW_TERMINATED   (WM_APP+2)  // General failure - Wait Connection failed
73
#define NUX_THREADMSG_THREAD_TERMINATED         (WM_APP+3)  // Set wParam = Thread ID, lParam = 0
74
75
#define _xdnd_max_type 100
76
#define xdnd_version 5
77
78
// This will become GLWindow
79
  class GraphicsDisplay : public GraphicSystem
80
  {
81
  private:
82
    Display     *m_X11Display;
83
    int         m_X11Screen;
84
    Window      m_X11Window;
85
    XVisualInfo *m_X11VisualInfo;
637.5.15 by Brandon Schaefer
* Moved xim stuff into a class. Also each XInputWindow now makes its own XIMClient as it needs to set that up for it to work.
86
831.2.1 by Brandon Schaefer
* Current XIM Work. Plan on moving the bulk of the work to WindowThread.
87
    XIC m_current_xic;
220.3.1 by Jay Taoko
*Fixes
88
637.4.5 by Jay Taoko
* Fixes
89
    int         parent_window_;
344.11.41 by Travis Watkins
cleanup changes for upstream
90
#ifndef NUX_OPENGLES_20
91
    GLXContext  m_GLCtx;
92
    GLXFBConfig _fb_config;
518.1.1 by Jay Taoko
* Added requirement for XTest
93
    GLXWindow   glx_window_;
344.11.41 by Travis Watkins
cleanup changes for upstream
94
#else
344.11.7 by Travis Watkins
more porting work, still doesn't compile
95
    EGLContext  m_GLCtx;
96
    EGLSurface  m_GLSurface;
97
    EGLConfig   _fb_config;
98
#endif
544.3.1 by Jason Smith
Add X event shim into nux
99
220.3.1 by Jay Taoko
*Fixes
100
    XSetWindowAttributes m_X11Attr;
101
102
    int m_NumVideoModes;
103
    XF86VidModeModeInfo **m_X11VideoModes;
104
    /* original desktop mode which we save so we can restore it later */
105
    XF86VidModeModeInfo m_X11OriginalVideoMode;
106
107
    Atom            m_WMDeleteWindow;
108
    Colormap        m_X11Colormap;
109
    int             m_BorderPixel;
110
111
    int _x11_major;
112
    int _x11_minor;
113
    int _glx_major;
114
    int _glx_minor;
115
    bool _has_glx_13;
116
117
    XEvent m_X11LastEvent;
118
    Bool m_X11RepeatKey;
119
502 by Jay Taoko
* Fixed code formatting
120
    char m_WindowClassName[256];
220.3.1 by Jay Taoko
*Fixes
121
    GLuint      m_PixelFormat;      // Holds The Results After Searching For A Match
637.4.5 by Jay Taoko
* Fixes
122
    std::string window_title_;
220.3.1 by Jay Taoko
*Fixes
123
124
    // size, position
637.4.5 by Jay Taoko
* Fixes
125
    Size viewport_size_;
126
    Size window_size_;
220.3.1 by Jay Taoko
*Fixes
127
    Point m_WindowPosition;
128
637.4.5 by Jay Taoko
* Fixes
129
    //! Full screen mode.
130
    bool fullscreen_;
131
    //! Screen bit depth
132
    unsigned int screen_bit_depth_;
220.3.1 by Jay Taoko
*Fixes
133
637.4.5 by Jay Taoko
* Fixes
134
    //! State of the graphics interface.
135
    bool gfx_interface_created_;
220.3.1 by Jay Taoko
*Fixes
136
137
    // Device information
138
    void GetDisplayInfo();
139
328.1.3 by Loïc Molinari
Fixed ABI break
140
    bool m_CreatedFromForeignWindow;
520.3.1 by Jay Taoko
* Added automated tests from mouse events
141
    Time last_click_time_;
520.3.2 by Jay Taoko
* Fixes
142
    /*!
143
        Maximum time allowed between the end of the last click (mouse up) and the next mouse down
144
        to be considered as a double click event.
145
    */
651.1.1 by Brandon Schaefer
* Removed trailing white space
146
    static int double_click_time_delay;
520.3.1 by Jay Taoko
* Added automated tests from mouse events
147
    int double_click_counter_;
220.3.1 by Jay Taoko
*Fixes
148
149
  public:
502 by Jay Taoko
* Fixed code formatting
150
    typedef void(*GrabReleaseCallback) (bool replaced, void *user_data);
651.1.1 by Brandon Schaefer
* Removed trailing white space
151
220.5.4 by Jason Smith
more work on DND
152
    typedef struct _DndSourceFuncs
153
    {
154
      nux::NBitmapData *       (*get_drag_image)    (void * data);
155
      std::list<const char *>  (*get_drag_types)    (void * data);
156
      const char *             (*get_data_for_type) (const char * type, int *size, int *format, void * data);
157
      void                     (*drag_finished)     (DndAction result, void * data);
158
    } DndSourceFuncs;
651.1.1 by Brandon Schaefer
* Removed trailing white space
159
220.3.1 by Jay Taoko
*Fixes
160
    bool HasXPendingEvent() const;
161
    Display *GetX11Display()
162
    {
163
      return m_X11Display;
164
    }
165
166
    // Event object
504 by Jay Taoko
* Removed IEvent typedef to Event
167
    Event *m_pEvent;
220.3.1 by Jay Taoko
*Fixes
168
169
    bool IsGfxInterfaceCreated();
170
171
    //! Create a window with and OpenGL context.
172
    /*!
173
        @param WindowTitle      The window title.
174
        @param WindowWidth      Initial window width.
175
        @param WindowHeight     Initial window height.
176
        @param Style            The window style.
177
        @param ParentWindow     The parent window.
637.4.5 by Jay Taoko
* Fixes
178
        @param fullscreen_flag  Full screen flag.
220.3.1 by Jay Taoko
*Fixes
179
    */
502 by Jay Taoko
* Fixed code formatting
180
    bool CreateOpenGLWindow(
181
      const char *WindowTitle,
220.3.1 by Jay Taoko
*Fixes
182
      unsigned int WindowWidth,
183
      unsigned int WindowHeight,
184
      WindowStyle Style,
185
      const GraphicsDisplay *Parent,
637.4.5 by Jay Taoko
* Fixes
186
      bool fullscreen_flag = false,
220.3.1 by Jay Taoko
*Fixes
187
      bool create_rendering_data = true);
188
189
    //! Create a GLWindow from a display and window created externally.
190
    /*!
191
        @param X11Display   Provided display.
192
        @param X11Window    Provided window.
193
    */
344.11.46 by Travis Watkins
remove debug code, remove API changes when compiling for desktop GL
194
#ifdef NUX_OPENGLES_20
502 by Jay Taoko
* Fixed code formatting
195
    bool CreateFromOpenGLWindow(Display *X11Display, Window X11Window, EGLContext OpenGLContext);
344.11.46 by Travis Watkins
remove debug code, remove API changes when compiling for desktop GL
196
#else
502 by Jay Taoko
* Fixed code formatting
197
    bool CreateFromOpenGLWindow(Display *X11Display, Window X11Window, GLXContext OpenGLContext);
344.11.46 by Travis Watkins
remove debug code, remove API changes when compiling for desktop GL
198
#endif
220.3.1 by Jay Taoko
*Fixes
199
200
    void DestroyOpenGLWindow();
201
502 by Jay Taoko
* Fixed code formatting
202
    void SetWindowTitle(const char *Title);
260.2.2 by Jay Taoko
* Fixed window resolution change
203
204
    //! Set the window size.
205
    /*!
206
        Actively set the window size to the provided parameters.
207
        \sa ResetWindowSize
208
    */
502 by Jay Taoko
* Fixed code formatting
209
    void SetWindowSize(int width, int height);
260.2.2 by Jay Taoko
* Fixed window resolution change
210
211
    //! Set the window position.
502 by Jay Taoko
* Fixed code formatting
212
    void SetWindowPosition(int width, int height);
651.1.1 by Brandon Schaefer
* Removed trailing white space
213
260.2.2 by Jay Taoko
* Fixed window resolution change
214
    //! Set the OpenGL Viewport.
502 by Jay Taoko
* Fixed code formatting
215
    void SetViewPort(int x, int y, int width, int height);
260.2.2 by Jay Taoko
* Fixed window resolution change
216
220.3.1 by Jay Taoko
*Fixes
217
    Point GetMouseScreenCoord();
218
    Point GetMouseWindowCoord();
219
    Point GetWindowCoord();
220
    Rect GetWindowGeometry();
221
    Rect GetNCWindowGeometry();
222
    void MakeGLContextCurrent();
502 by Jay Taoko
* Fixed code formatting
223
    void SwapBuffer(bool glswap = true);
220.3.1 by Jay Taoko
*Fixes
224
225
    // Event methods
637.2.2 by Daniel d'Andrada
Make GraphicsDisplay::GetSystemEvent return some info on whether there was an event
226
    /*!
227
      Returns true if there was a pending event to be fetched and false otherwise
228
     */
229
    bool GetSystemEvent(Event *evt);
220.3.1 by Jay Taoko
*Fixes
230
231
    // Os specific
502 by Jay Taoko
* Fixed code formatting
232
    int GetGlXMajor() const;
233
    int GetGlXMinor() const;
220.3.1 by Jay Taoko
*Fixes
234
502 by Jay Taoko
* Fixed code formatting
235
#if defined(NUX_OS_LINUX)
504 by Jay Taoko
* Removed IEvent typedef to Event
236
    void InjectXEvent(Event *evt, XEvent xevent);
544.3.1 by Jason Smith
Add X event shim into nux
237
238
    typedef struct _EventFilterArg
239
    {
240
      bool   (*filter)    (XEvent event, void * data);
241
      void * data;
242
    } EventFilterArg;
243
244
    void AddEventFilter (EventFilterArg arg);
245
    void RemoveEventFilter (void *owner);
246
247
    std::list<EventFilterArg> _event_filters;
220.3.1 by Jay Taoko
*Fixes
248
#endif
651.1.1 by Brandon Schaefer
* Removed trailing white space
249
504 by Jay Taoko
* Removed IEvent typedef to Event
250
    Event &GetCurrentEvent();
220.3.1 by Jay Taoko
*Fixes
251
328.1.3 by Loïc Molinari
Fixed ABI break
252
    // That method is deprecated, it always returns false and still here in
253
    // order to maintain API compatibility.
220.3.1 by Jay Taoko
*Fixes
254
    bool isWindowMinimized() const
255
    {
328.1.3 by Loïc Molinari
Fixed ABI break
256
      return false;
220.3.1 by Jay Taoko
*Fixes
257
    }
258
259
    void ShowWindow();
260
    void HideWindow();
502 by Jay Taoko
* Fixed code formatting
261
    bool IsWindowVisible();
220.3.1 by Jay Taoko
*Fixes
262
263
    void EnterMaximizeWindow();
264
    void ExitMaximizeWindow();
265
266
    Window GetWindowHandle() const
267
    {
268
      return m_X11Window;
269
    }
270
    bool IsChildWindow() const
271
    {
637.4.5 by Jay Taoko
* Fixes
272
      return parent_window_ != 0;
220.3.1 by Jay Taoko
*Fixes
273
    }
274
275
    // Return true if VSync swap control is available
276
    bool HasVSyncSwapControl() const;
277
    void EnableVSyncSwapControl();
278
    void DisableVSyncSwapControl();
279
280
    // m_FrameRate
281
    float GetFrameTime() const;
282
    void ResetFrameTime();
283
345.5.2 by Jay Taoko
* Object::Dispose() now does the same thing as Object::UnReference()
284
    GraphicsEngine* GetGraphicsEngine() const;
285
502 by Jay Taoko
* Fixed code formatting
286
    GpuDevice* GetGpuDevice() const;
345.5.2 by Jay Taoko
* Object::Dispose() now does the same thing as Object::UnReference()
287
831.2.1 by Brandon Schaefer
* Current XIM Work. Plan on moving the bulk of the work to WindowThread.
288
    void SetCurrentXIC(XIC xic);
637.5.20 by Brandon Schaefer
* Reworks the XIM stuff around. Though there are problems still with closing/opening new IMs....
289
220.3.1 by Jay Taoko
*Fixes
290
    // Dialog
291
    /*bool StartOpenFileDialog(FileDialogOption& fdo);
292
    bool StartSaveFileDialog(FileDialogOption& fdo);
293
    bool StartColorDialog(ColorDialogOption& cdo);*/
294
295
502 by Jay Taoko
* Fixed code formatting
296
    void GetDesktopSize(int &w, int &h);
297
    void GetWindowSize(int &w, int &h);
298
    int GetWindowWidth();
299
    int GetWindowHeight();
260.2.2 by Jay Taoko
* Fixed window resolution change
300
301
    //! Get the window size and reset the GraphicsEngine and GpuDevice accordingly.
302
    /*!
651.1.1 by Brandon Schaefer
* Removed trailing white space
303
        This is a passive way to set the window size through out the NuxGraphics system. This call gets the
260.2.2 by Jay Taoko
* Fixed window resolution change
304
        current window size and sets its accordingly to all sub-system.
305
        \sa SetWindowSize
306
    */
502 by Jay Taoko
* Fixed code formatting
307
    void ResetWindowSize();
220.3.1 by Jay Taoko
*Fixes
308
309
    bool HasFrameBufferSupport();
310
    /*void SetWindowCursor(HCURSOR cursor);
311
    HCURSOR GetWindowCursor() const;*/
312
313
314
    //! Pause graphics rendering.
315
    /*!
316
        Pause graphics rendering.
317
        This function also sets the current openGL context to 0 for this window.
318
        This is useful while a child window is being created and is sharing openGL objects with this context.
319
        For wglShareLists to work, both OpenGL context must be set to 0 in their respective thread.
502 by Jay Taoko
* Fixed code formatting
320
        Send NUX_THREADMSG_START_RENDERING(PostThreadMessage) to this window to reactivate rendering.
220.3.1 by Jay Taoko
*Fixes
321
322
        Never call this function while doing rendering. Call it only when processing events.
323
    */
324
    void PauseThreadGraphicsRendering();
325
    bool IsPauseThreadGraphicsRendering() const;
326
504 by Jay Taoko
* Removed IEvent typedef to Event
327
    void ProcessForeignX11Event(XEvent *xevent, Event *nux_event);
502 by Jay Taoko
* Fixed code formatting
328
    void ProcessXEvent(XEvent xevent, bool foreign);
329
    void RecalcXYPosition(Window TheMainWindow, XEvent xevent, int &x, int &y);
330
    void RecalcXYPosition(int x_root, int y_root, int &x_recalc, int &y_recalc);
651.1.1 by Brandon Schaefer
* Removed trailing white space
331
220.3.1 by Jay Taoko
*Fixes
332
    void              SendDndStatus   (bool accept, DndAction action, Rect region);
502 by Jay Taoko
* Fixed code formatting
333
    void              SendDndFinished(bool accepted, DndAction performed_action);
334
    std::list<char *> GetDndMimeTypes();
220.3.1 by Jay Taoko
*Fixes
335
    char *            GetDndData      (char *property);
220.5.1 by Jason Smith
a very ugly start to DND as source
336
502 by Jay Taoko
* Fixed code formatting
337
    void StartDndDrag(const DndSourceFuncs &funcs, void *user_data);
651.1.1 by Brandon Schaefer
* Removed trailing white space
338
250.1.2 by Jason Smith
switch to a global grab infrastructure
339
    bool GrabPointer   (GrabReleaseCallback callback, void *data, bool replace_existing);
502 by Jay Taoko
* Fixed code formatting
340
    bool UngrabPointer(void *data);
341
    bool PointerIsGrabbed();
651.1.1 by Brandon Schaefer
* Removed trailing white space
342
250.1.2 by Jason Smith
switch to a global grab infrastructure
343
    bool GrabKeyboard   (GrabReleaseCallback callback, void *data, bool replace_existing);
502 by Jay Taoko
* Fixed code formatting
344
    bool UngrabKeyboard(void *data);
345
    bool KeyboardIsGrabbed();
651.1.1 by Brandon Schaefer
* Removed trailing white space
346
502 by Jay Taoko
* Fixed code formatting
347
    void * KeyboardGrabData() { return _global_keyboard_grab_data; }
348
    void * PointerGrabData() { return _global_pointer_grab_data; }
477.2.1 by Sam Spilsbury
Determine strut positioning relative to monitor position. Fixes LP #861341
349
220.3.1 by Jay Taoko
*Fixes
350
  private:
502 by Jay Taoko
* Fixed code formatting
351
    void InitGlobalGrabWindow();
651.1.1 by Brandon Schaefer
* Removed trailing white space
352
502 by Jay Taoko
* Fixed code formatting
353
    void HandleXDndPosition(XEvent event, Event* nux_event);
220.3.1 by Jay Taoko
*Fixes
354
    void HandleXDndEnter    (XEvent event);
355
    void HandleXDndStatus   (XEvent event);
356
    void HandleXDndLeave    (XEvent event);
357
    void HandleXDndDrop     (XEvent event, Event* nux_event);
502 by Jay Taoko
* Fixed code formatting
358
    void HandleXDndFinished(XEvent event);
651.1.1 by Brandon Schaefer
* Removed trailing white space
359
502 by Jay Taoko
* Fixed code formatting
360
    void SendXDndStatus(Display *display, Window source, Window target, bool accept, Atom action, Rect box);
361
    bool GetXDndSelectionEvent(Display *display, Window target, Atom property, long time, XEvent *result, int attempts);
362
    void SendXDndFinished(Display *display, Window source, Window target, bool result, Atom action);
363
    char * GetXDndData(Display *display, Window requestor, Atom property, long time);
220.5.1 by Jason Smith
a very ugly start to DND as source
364
502 by Jay Taoko
* Fixed code formatting
365
    void EndDndDrag(DndAction action);
366
    bool GrabDndSelection(Display *display, Window window, Time time);
367
    void HandleDndDragSourceEvent(XEvent event);
368
    void HandleDndSelectionRequest(XEvent event);
369
    Window GetDndTargetWindowForPos(int x, int y);
651.1.1 by Brandon Schaefer
* Removed trailing white space
370
502 by Jay Taoko
* Fixed code formatting
371
    void DrawDndSourceWindow();
651.1.1 by Brandon Schaefer
* Removed trailing white space
372
502 by Jay Taoko
* Fixed code formatting
373
    void SendDndSourcePosition(Window target, int x, int y, Time time);
374
    void SendDndSourceEnter(Window target);
375
    void SendDndSourceLeave(Window target);
376
    void SendDndSourceDrop(Window target, Time time);
377
    void SetDndSourceTargetWindow(Window target);
651.1.1 by Brandon Schaefer
* Removed trailing white space
378
502 by Jay Taoko
* Fixed code formatting
379
    static gboolean OnDragEndTimeout(gpointer data);
651.1.1 by Brandon Schaefer
* Removed trailing white space
380
220.3.1 by Jay Taoko
*Fixes
381
    Point _last_dnd_position;
382
383
    bool m_PauseGraphicsRendering;
384
    GLTimer m_Timer;
385
    float m_FrameTime;
386
    GpuDevice *m_DeviceFactory;
387
    GraphicsEngine *m_GraphicsContext;
388
    WindowStyle m_Style;
389
390
    Atom _xdnd_types[_xdnd_max_type + 1];
391
    Display *_drag_display;
392
    Window _drag_window;
393
    Window _drag_source;
394
    long _drag_drop_timestamp;
544.3.1 by Jason Smith
Add X event shim into nux
395
220.5.1 by Jason Smith
a very ugly start to DND as source
396
    void * _dnd_source_data;
397
    DndSourceFuncs _dnd_source_funcs;
220.5.4 by Jason Smith
more work on DND
398
220.5.1 by Jason Smith
a very ugly start to DND as source
399
    Window _dnd_source_window;
220.5.2 by Jason Smith
lots of work to start making XDND outbound possible
400
    Window _dnd_source_target_window;
651.1.1 by Brandon Schaefer
* Removed trailing white space
401
250.1.2 by Jason Smith
switch to a global grab infrastructure
402
    Window              _global_grab_window;
651.1.1 by Brandon Schaefer
* Removed trailing white space
403
250.1.2 by Jason Smith
switch to a global grab infrastructure
404
    void               *_global_pointer_grab_data;
405
    bool                _global_pointer_grab_active;
406
    GrabReleaseCallback _global_pointer_grab_callback;
407
408
    void               *_global_keyboard_grab_data;
409
    bool                _global_keyboard_grab_active;
410
    GrabReleaseCallback _global_keyboard_grab_callback;
220.5.4 by Jason Smith
more work on DND
411
412
    bool _dnd_is_drag_source;
220.5.2 by Jason Smith
lots of work to start making XDND outbound possible
413
    bool _dnd_source_target_accepts_drop;
220.5.4 by Jason Smith
more work on DND
414
    bool _dnd_source_grab_active;
250 by Jason Smith
follow dnd spec a little more closely
415
    bool _dnd_source_drop_sent;
220.3.1 by Jay Taoko
*Fixes
416
  public:
417
    ~GraphicsDisplay();
344.11.7 by Travis Watkins
more porting work, still doesn't compile
418
#ifndef NUX_OPENGLES_20
220.3.1 by Jay Taoko
*Fixes
419
    GLEWContext *GetGLEWContext()
420
    {
421
      return &m_GLEWContext;
422
    }
423
    GLXEWContext *GetGLXEWContext()
424
    {
425
      return &m_GLXEWContext;
426
    }
344.11.7 by Travis Watkins
more porting work, still doesn't compile
427
#endif
220.3.1 by Jay Taoko
*Fixes
428
660.2.1 by Michi Henning
Removed NString and replaced it with std::string.
429
    std::string FindResourceLocation(const char *ResourceFileName, bool ErrorOnFail = false);
430
    std::string FindUITextureLocation(const char *ResourceFileName, bool ErrorOnFail = false);
431
    std::string FindShaderLocation(const char *ResourceFileName, bool ErrorOnFail = false);
432
    std::string FindFontLocation(const char *ResourceFileName, bool ErrorOnFail = false);
220.3.1 by Jay Taoko
*Fixes
433
660.2.1 by Michi Henning
Removed NString and replaced it with std::string.
434
    const std::vector<std::string>& GetFontSearchPath() const
220.3.1 by Jay Taoko
*Fixes
435
    {
436
      return m_FontSearchPath;
437
    }
660.2.1 by Michi Henning
Removed NString and replaced it with std::string.
438
    const std::vector<std::string>& GetShaderSearchPath() const
220.3.1 by Jay Taoko
*Fixes
439
    {
440
      return m_ShaderSearchPath;
441
    }
660.2.1 by Michi Henning
Removed NString and replaced it with std::string.
442
    const std::vector<std::string>& GetUITextureSearchPath() const
220.3.1 by Jay Taoko
*Fixes
443
    {
444
      return m_UITextureSearchPath;
445
    }
446
447
  private:
660.2.1 by Michi Henning
Removed NString and replaced it with std::string.
448
    std::vector<std::string> m_FontSearchPath;
449
    std::vector<std::string> m_ShaderSearchPath;
450
    std::vector<std::string> m_UITextureSearchPath;
220.3.1 by Jay Taoko
*Fixes
451
    FilePath m_ResourcePathLocation;
452
453
    GraphicsDisplay();
502 by Jay Taoko
* Fixed code formatting
454
    GraphicsDisplay(const GraphicsDisplay &);
220.3.1 by Jay Taoko
*Fixes
455
    // Does not make sense for a singleton. This is a self assignment.
456
    GraphicsDisplay &operator= (const GraphicsDisplay &);
457
344.11.7 by Travis Watkins
more porting work, still doesn't compile
458
#ifndef NUX_OPENGLES_20
220.3.1 by Jay Taoko
*Fixes
459
    GLEWContext m_GLEWContext;
460
    GLXEWContext m_GLXEWContext;
344.11.7 by Travis Watkins
more porting work, still doesn't compile
461
#endif
518.1.1 by Jay Taoko
* Added requirement for XTest
462
520.3.1 by Jay Taoko
* Added automated tests from mouse events
463
    int MouseMove(XEvent xevent, Event *event);
464
    int MousePress(XEvent xevent, Event *event);
465
    int MouseRelease(XEvent xevent, Event *event);
466
220.3.1 by Jay Taoko
*Fixes
467
    friend class DisplayAccessController;
518.1.3 by Jay Taoko
* Testing framework
468
    friend class GraphicsEngine;
220.3.1 by Jay Taoko
*Fixes
469
  };
470
471
}
472
281.1.1 by Jay Taoko
* Fix global clipping rectangle
473
#endif //GRAPHICSDISPLAYX11_H