summaryrefslogtreecommitdiff
path: root/libraries/VTK/vtk-includes.patch
blob: f906200c29472dc1b4fe66d0b58df73a2bf034ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff -up VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx.includes VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx
--- VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx.includes	2020-06-26 07:24:40.000000000 -0600
+++ VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx	2021-01-27 06:51:11.776958150 -0700
@@ -61,10 +61,23 @@ typedef ptrdiff_t GLsizeiptr;
 
 #include <sstream>
 
+#include <X11/Xatom.h>
+#include <X11/cursorfont.h>
+#if VTK_HAVE_XCURSOR
+#include <X11/Xcursor/Xcursor.h>
+#endif
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
-#include <X11/cursorfont.h>
 
+/*
+ * Work-around to get forward declarations of C typedef of anonymous
+ * structs working. We do not want to include XUtil.h in the header as
+ * it populates the global namespace.
+ */
+struct vtkXVisualInfo : public XVisualInfo
+{
+};
+ 
 #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
 #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
 typedef GLXContext (*glXCreateContextAttribsARBProc)(
@@ -224,7 +237,7 @@ int XEventTypeEquals(Display*, XEvent* e
   return event->type == EventType;
 }
 
-XVisualInfo* vtkXOpenGLRenderWindow::GetDesiredVisualInfo()
+vtkXVisualInfo* vtkXOpenGLRenderWindow::GetDesiredVisualInfo()
 {
   XVisualInfo* v = nullptr;
 
@@ -258,7 +271,7 @@ XVisualInfo* vtkXOpenGLRenderWindow::Get
       vtkErrorMacro(<< "Could not find a decent visual\n");
     }
   }
-  return (v);
+  return reinterpret_cast<vtkXVisualInfo*>(v);
 }
 
 vtkXOpenGLRenderWindow::vtkXOpenGLRenderWindow()
diff -up VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.h.includes VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.h
--- VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.h.includes	2020-06-26 07:24:40.000000000 -0600
+++ VTK-9.0.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.h	2021-01-27 06:49:09.420323338 -0700
@@ -28,11 +28,11 @@
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include <X11/Xlib.h>                  // Needed for X types used in the public interface
-#include <X11/Xutil.h>                 // Needed for X types used in the public interface
 #include <stack>                       // for ivar
 
 class vtkIdList;
 class vtkXOpenGLRenderWindowInternal;
+struct vtkXVisualInfo;
 
 class VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow
 {
@@ -112,7 +112,7 @@ public:
    */
   virtual Colormap GetDesiredColormap();
   virtual Visual* GetDesiredVisual();
-  virtual XVisualInfo* GetDesiredVisualInfo();
+  virtual vtkXVisualInfo* GetDesiredVisualInfo();
   virtual int GetDesiredDepth();
   //@}