Home | History | Annotate | Download | only in LinuxX11
      1 /*!****************************************************************************
      2 
      3  @file         LinuxX11/PVRShellOS.h
      4  @ingroup      OS_LinuxX11
      5  @copyright    Copyright (c) Imagination Technologies Limited.
      6  @brief        Initialization for the shell for LinuxX11.
      7  @details      Makes programming for 3D APIs easier by wrapping surface
      8                initialization, Texture allocation and other functions for use by a demo.
      9 
     10 ******************************************************************************/
     11 #ifndef _PVRSHELLOS_
     12 #define _PVRSHELLOS_
     13 
     14 #include "X11/Xlib.h"
     15 #include "X11/Xutil.h"
     16 #ifdef BUILD_OGL
     17 #include "X11/extensions/xf86vmode.h"
     18 #endif
     19 
     20 #define PVRSHELL_DIR_SYM	'/'
     21 #define _stricmp strcasecmp
     22 
     23 /*!
     24  @addtogroup OS_LinuxX11
     25  @brief      LinuxX11 OS
     26  @details    The following table illustrates how key codes are mapped in LinuxX11:
     27              <table>
     28              <tr><th> Key code    </th><th> nLastKeyPressed (PVRShell) </th></tr>
     29              <tr><td> Esc	      </td><td> PVRShellKeyNameQUIT	       </td></tr>
     30              <tr><td> F11	      </td><td> PVRShellKeyNameScreenshot  </td></tr>
     31              <tr><td> Enter	      </td><td> PVRShellKeyNameSELECT 	   </td></tr>
     32              <tr><td> '1'	      </td><td> PVRShellKeyNameACTION1	   </td></tr>
     33              <tr><td> '2'	      </td><td> PVRShellKeyNameACTION2     </td></tr>
     34              <tr><td> Up arrow    </td><td> m_eKeyMapUP		           </td></tr>
     35              <tr><td> Down arrow  </td><td> m_eKeyMapDOWN 		       </td></tr>
     36              <tr><td> Left arrow  </td><td> m_eKeyMapLEFT 		       </td></tr>
     37              <tr><td> Right arrow </td><td> m_eKeyMapRIGHT		       </td></tr>
     38              </table>
     39  @{
     40 */
     41 
     42 /*!***************************************************************************
     43  @class PVRShellInitOS
     44  @brief Interface with specific Operative System.
     45 *****************************************************************************/
     46 class PVRShellInitOS
     47 {
     48 public:
     49 	Display*     m_X11Display;
     50 	long         m_X11Screen;
     51 	XVisualInfo* m_X11Visual;
     52 	Colormap     m_X11ColorMap;
     53 	Window       m_X11Window;
     54 	timeval 	 m_StartTime;
     55 #ifdef BUILD_OGL
     56     XF86VidModeModeLine m_OriginalMode;  // modeline that was active at the starting point of this aplication
     57     int         m_i32OriginalModeDotClock;
     58 #endif
     59 
     60 	// Pixmap support: variables for the pixmap
     61 	Pixmap		m_X11Pixmap;
     62 	GC			m_X11GC;
     63 
     64 	unsigned int m_u32ButtonState; // 1 = left, 2 = right, 4 = middle
     65 
     66 public:
     67 	int OpenX11Window(const PVRShell &shell);
     68 	void CloseX11Window();
     69 };
     70 
     71 /*! @} */
     72 
     73 #endif /* _PVRSHELLOS_ */
     74 /*****************************************************************************
     75  End of file (PVRShellOS.h)
     76 *****************************************************************************/
     77 
     78