00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXMesaRenderWindow.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00041 #ifndef __vtkXMesaRenderWindow_h 00042 #define __vtkXMesaRenderWindow_h 00043 00044 #include "vtkMesaRenderWindow.h" 00045 #include <X11/Xlib.h> // Needed for X types used in the public interface 00046 #include <X11/Xutil.h> // Needed for X types used in the public interface 00047 00048 class vtkIdList; 00049 class vtkXMesaRenderWindowInternal; 00050 00051 class VTK_RENDERING_EXPORT vtkXMesaRenderWindow : public vtkMesaRenderWindow 00052 { 00053 public: 00054 static vtkXMesaRenderWindow *New(); 00055 vtkTypeRevisionMacro(vtkXMesaRenderWindow,vtkMesaRenderWindow); 00056 void PrintSelf(ostream& os, vtkIndent indent); 00057 00059 virtual void Start(void); 00060 00062 virtual void Frame(void); 00063 00065 virtual void WindowInitialize(void); 00066 00068 virtual void Initialize(void); 00069 00071 virtual void Finalize(void); 00072 00074 virtual void SetFullScreen(int); 00075 00077 virtual void WindowRemap(void); 00078 00080 virtual void PrefFullScreen(void); 00081 00083 00084 virtual void SetSize(int,int); 00085 virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);}; 00087 00089 00090 virtual Colormap GetDesiredColormap(); 00091 virtual Visual *GetDesiredVisual(); 00092 virtual XVisualInfo *GetDesiredVisualInfo(); 00093 virtual int GetDesiredDepth(); 00095 00100 virtual void SetStereoCapableWindow(int capable); 00101 00103 void MakeCurrent(); 00104 00108 void SetForceMakeCurrent(); 00109 00111 const char *ReportCapabilities(); 00112 00114 int SupportsOpenGL(); 00115 00117 int IsDirect(); 00118 00120 00121 virtual void *GetGenericDisplayId() {return (void *)this->GetDisplayId();}; 00122 virtual void *GetGenericWindowId(); 00123 virtual void *GetGenericParentId() {return (void *)this->ParentId;}; 00124 virtual void *GetGenericContext(); 00125 virtual void *GetGenericDrawable() {return (void *)this->WindowId;}; 00127 00129 virtual int *GetScreenSize(); 00130 00132 virtual int *GetPosition(); 00133 00135 Display *GetDisplayId(); 00136 00138 00140 void SetDisplayId(Display *); 00141 void SetDisplayId(void *); 00143 00145 Window GetParentId(); 00146 00148 00149 void SetParentId(Window); 00150 void SetParentId(void *); 00152 00154 Window GetWindowId(); 00155 00157 00158 void SetWindowId(Window); 00159 void SetWindowId(void *); 00161 00163 00164 void SetNextWindowId(Window); 00165 void SetNextWindowId(void *); 00166 void SetWindowName(const char *); 00168 00170 00171 void SetPosition(int,int); 00172 void SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);}; 00174 00176 00178 void HideCursor(); 00179 void ShowCursor(); 00181 00183 virtual void SetCurrentCursor(int); 00184 00187 virtual int GetEventPending(); 00188 00190 void SetWindowInfo(char *info); 00191 00192 void SetNextWindowInfo(char *); 00193 00195 void SetParentInfo(char *info); 00196 00199 void Render(); 00200 00202 void SetOffScreenRendering(int i); 00203 00204 protected: 00205 vtkXMesaRenderWindow(); 00206 ~vtkXMesaRenderWindow(); 00207 00208 vtkXMesaRenderWindowInternal *Internal; 00209 00210 Window ParentId; 00211 Window WindowId; 00212 Window NextWindowId; 00213 Display *DisplayId; 00214 Colormap ColorMap; 00215 int OwnWindow; 00216 int OwnDisplay; 00217 int ScreenSize[2]; 00218 int CursorHidden; 00219 int ForceMakeCurrent; 00220 int UsingHardware; 00221 char *Capabilities; 00222 00223 // we must keep track of the cursors we are using 00224 Cursor XCArrow; 00225 Cursor XCSizeAll; 00226 Cursor XCSizeNS; 00227 Cursor XCSizeWE; 00228 Cursor XCSizeNE; 00229 Cursor XCSizeNW; 00230 Cursor XCSizeSE; 00231 Cursor XCSizeSW; 00232 00233 private: 00234 vtkXMesaRenderWindow(const vtkXMesaRenderWindow&); // Not implemented. 00235 void operator=(const vtkXMesaRenderWindow&); // Not implemented. 00236 }; 00237 00238 00239 00240 #endif