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 =========================================================================*/ 00027 #ifndef __vtkXMesaRenderWindow_h 00028 #define __vtkXMesaRenderWindow_h 00029 00030 #include "vtkMesaRenderWindow.h" 00031 #include <X11/Xlib.h> // Needed for X types used in the public interface 00032 #include <X11/Xutil.h> // Needed for X types used in the public interface 00033 00034 class vtkIdList; 00035 class vtkXMesaRenderWindowInternal; 00036 00037 class VTK_RENDERING_EXPORT vtkXMesaRenderWindow : public vtkMesaRenderWindow 00038 { 00039 public: 00040 static vtkXMesaRenderWindow *New(); 00041 vtkTypeRevisionMacro(vtkXMesaRenderWindow,vtkMesaRenderWindow); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00045 virtual void Start(void); 00046 00048 virtual void Frame(void); 00049 00051 virtual void WindowInitialize(void); 00052 00054 virtual void Initialize(void); 00055 00057 virtual void Finalize(void); 00058 00060 virtual void SetFullScreen(int); 00061 00063 virtual void WindowRemap(void); 00064 00066 virtual void PrefFullScreen(void); 00067 00069 00070 virtual void SetSize(int,int); 00071 virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);}; 00073 00075 00076 virtual Colormap GetDesiredColormap(); 00077 virtual Visual *GetDesiredVisual(); 00078 virtual XVisualInfo *GetDesiredVisualInfo(); 00079 virtual int GetDesiredDepth(); 00081 00086 virtual void SetStereoCapableWindow(int capable); 00087 00089 void MakeCurrent(); 00090 00094 void SetForceMakeCurrent(); 00095 00097 const char *ReportCapabilities(); 00098 00100 int SupportsOpenGL(); 00101 00103 int IsDirect(); 00104 00106 00107 virtual void *GetGenericDisplayId() {return (void *)this->GetDisplayId();}; 00108 virtual void *GetGenericWindowId(); 00109 virtual void *GetGenericParentId() {return (void *)this->ParentId;}; 00110 virtual void *GetGenericContext(); 00111 virtual void *GetGenericDrawable() {return (void *)this->WindowId;}; 00113 00115 virtual int *GetScreenSize(); 00116 00118 virtual int *GetPosition(); 00119 00121 Display *GetDisplayId(); 00122 00124 00126 void SetDisplayId(Display *); 00127 void SetDisplayId(void *); 00129 00131 Window GetParentId(); 00132 00134 00135 void SetParentId(Window); 00136 void SetParentId(void *); 00138 00140 Window GetWindowId(); 00141 00143 00144 void SetWindowId(Window); 00145 void SetWindowId(void *); 00147 00149 00150 void SetNextWindowId(Window); 00151 void SetNextWindowId(void *); 00152 void SetWindowName(const char *); 00154 00156 00157 void SetPosition(int,int); 00158 void SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);}; 00160 00162 00164 void HideCursor(); 00165 void ShowCursor(); 00167 00169 virtual void SetCurrentCursor(int); 00170 00173 virtual int GetEventPending(); 00174 00176 void SetWindowInfo(char *info); 00177 00178 void SetNextWindowInfo(char *); 00179 00181 void SetParentInfo(char *info); 00182 00185 void Render(); 00186 00188 void SetOffScreenRendering(int i); 00189 00190 protected: 00191 vtkXMesaRenderWindow(); 00192 ~vtkXMesaRenderWindow(); 00193 00194 vtkXMesaRenderWindowInternal *Internal; 00195 00196 Window ParentId; 00197 Window WindowId; 00198 Window NextWindowId; 00199 Display *DisplayId; 00200 Colormap ColorMap; 00201 int OwnWindow; 00202 int OwnDisplay; 00203 int ScreenSize[2]; 00204 int CursorHidden; 00205 int ForceMakeCurrent; 00206 int UsingHardware; 00207 char *Capabilities; 00208 00209 // we must keep track of the cursors we are using 00210 Cursor XCArrow; 00211 Cursor XCSizeAll; 00212 Cursor XCSizeNS; 00213 Cursor XCSizeWE; 00214 Cursor XCSizeNE; 00215 Cursor XCSizeNW; 00216 Cursor XCSizeSE; 00217 Cursor XCSizeSW; 00218 00219 00220 void CreateAWindow(); 00221 void DestroyWindow(); 00222 void CreateOffScreenWindow(int x, int y); 00223 void DestroyOffScreenWindow(); 00224 void ResizeOffScreenWindow(int x, int y); 00225 00226 private: 00227 vtkXMesaRenderWindow(const vtkXMesaRenderWindow&); // Not implemented. 00228 void operator=(const vtkXMesaRenderWindow&); // Not implemented. 00229 }; 00230 00231 00232 00233 #endif