00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXMesaRenderWindow.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00045 #ifndef __vtkXMesaRenderWindow_h 00046 #define __vtkXMesaRenderWindow_h 00047 00048 #include "vtkMesaRenderWindow.h" 00049 #include <X11/Xlib.h> // Needed for X types used in the public interface 00050 #include <X11/Xutil.h> // Needed for X types used in the public interface 00051 00052 class vtkIdList; 00053 class vtkXMesaRenderWindowInternal; 00054 00055 class VTK_RENDERING_EXPORT vtkXMesaRenderWindow : public vtkMesaRenderWindow 00056 { 00057 public: 00058 static vtkXMesaRenderWindow *New(); 00059 vtkTypeRevisionMacro(vtkXMesaRenderWindow,vtkMesaRenderWindow); 00060 void PrintSelf(ostream& os, vtkIndent indent); 00061 00063 virtual void Start(void); 00064 00066 virtual void Frame(void); 00067 00069 virtual void WindowInitialize(void); 00070 00072 virtual void Initialize(void); 00073 00075 virtual void SetFullScreen(int); 00076 00078 virtual void WindowRemap(void); 00079 00081 virtual void PrefFullScreen(void); 00082 00084 00085 virtual void SetSize(int,int); 00086 virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);}; 00088 00090 00091 virtual Colormap GetDesiredColormap(); 00092 virtual Visual *GetDesiredVisual(); 00093 virtual XVisualInfo *GetDesiredVisualInfo(); 00094 virtual int GetDesiredDepth(); 00096 00101 virtual void SetStereoCapableWindow(int capable); 00102 00104 void MakeCurrent(); 00105 00109 void SetForceMakeCurrent(); 00110 00112 const char *ReportCapabilities(); 00113 00115 int SupportsOpenGL(); 00116 00118 int IsDirect(); 00119 00121 00122 virtual void *GetGenericDisplayId() {return (void *)this->GetDisplayId();}; 00123 virtual void *GetGenericWindowId(); 00124 virtual void *GetGenericParentId() {return (void *)this->ParentId;}; 00125 virtual void *GetGenericContext(); 00126 virtual void *GetGenericDrawable() {return (void *)this->WindowId;}; 00128 00130 virtual int *GetScreenSize(); 00131 00133 virtual int *GetPosition(); 00134 00136 Display *GetDisplayId(); 00137 00139 00141 void SetDisplayId(Display *); 00142 void SetDisplayId(void *); 00144 00146 Window GetParentId(); 00147 00149 00150 void SetParentId(Window); 00151 void SetParentId(void *); 00153 00155 Window GetWindowId(); 00156 00158 00159 void SetWindowId(Window); 00160 void SetWindowId(void *); 00162 00164 00165 void SetNextWindowId(Window); 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 00193 void SetParentInfo(char *info); 00194 00197 void Render(); 00198 00200 void SetOffScreenRendering(int i); 00201 00202 protected: 00203 vtkXMesaRenderWindow(); 00204 ~vtkXMesaRenderWindow(); 00205 00206 vtkXMesaRenderWindowInternal *Internal; 00207 00208 Window ParentId; 00209 Window WindowId; 00210 Window NextWindowId; 00211 Display *DisplayId; 00212 Colormap ColorMap; 00213 int OwnWindow; 00214 int OwnDisplay; 00215 int ScreenSize[2]; 00216 int CursorHidden; 00217 int ForceMakeCurrent; 00218 int UsingHardware; 00219 char *Capabilities; 00220 00221 // we must keep track of the cursors we are using 00222 Cursor XCArrow; 00223 Cursor XCSizeAll; 00224 Cursor XCSizeNS; 00225 Cursor XCSizeWE; 00226 Cursor XCSizeNE; 00227 Cursor XCSizeNW; 00228 Cursor XCSizeSE; 00229 Cursor XCSizeSW; 00230 00231 private: 00232 vtkXMesaRenderWindow(const vtkXMesaRenderWindow&); // Not implemented. 00233 void operator=(const vtkXMesaRenderWindow&); // Not implemented. 00234 }; 00235 00236 00237 00238 #endif