output_x11.h

00001 /* -- 2007-05-07 -- 
00002  *  ardev - an augmented reality library for robot developers
00003  *  Copyright 2005-2007 - Toby Collett (ardev _at_ plan9.net.nz)
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  *  Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public
00016  *  License along with this library; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
00018  *
00019  */
00020 #ifndef OUTPUT_X11_H
00021 #define OUTPUT_X11_H
00022 
00023 /***************************************************************************
00024  *            capture_file.h
00025  *
00026  *  Tue Apr 27 15:34:26 2004
00027  *  Copyright  2004  Toby Collett
00028  *  Email
00029  ****************************************************************************/
00030 
00031 #include <ardev/ardev.h>
00032 #include <X11/Xlib.h>
00033 #include <GL/glx.h>
00034 #include <pthread.h>
00035 #include <X11/extensions/Xinerama.h>
00036 #include <SDL/SDL.h>
00037  
00040 class OutputX11 : public OutputObject
00041 {
00042         public:
00044                 OutputX11(CaptureObject* cap, CameraObject * cam, PositionObject * cam_pos, int x=300,int y=300, const char * DisplayName=NULL, bool FullScreen=false);
00045                 ~OutputX11() {delete DisplayName;}; 
00046                 int Initialise(bool); 
00047                 void Terminate(); 
00048                 void ShowFrame(); 
00049                 //void handleKeyPress( SDL_keysym *keysym ); ///<Handle sdl key events
00050         private:
00051                 void ToggleFullScreen();
00052                 void InitGL();
00053 
00054 
00055                 char * DisplayName;
00056                 Display *dpy; 
00057                 Screen * scr; 
00058                 Window win; 
00059                 GLXContext ctx; 
00060                 bool Fullscreen; 
00061                 SDL_Surface *surface; 
00062 
00063         int videoFlags;
00064         int videoFlagsFull;
00065         int OldWidth, OldHeight;
00066         
00067         void set_mwm_border(unsigned long flags);
00068 };
00069 
00070 
00071 /* bit definitions for MwmHints.flags */
00072 #define MWM_HINTS_FUNCTIONS (1L << 0)
00073 #define MWM_HINTS_DECORATIONS (1L << 1)
00074 #define MWM_HINTS_INPUT_MODE (1L << 2)
00075 #define MWM_HINTS_STATUS (1L << 3)
00076 
00077 /* bit definitions for MwmHints.decorations */
00078 #define MWM_DECOR_ALL  (1L << 0)
00079 #define MWM_DECOR_BORDER (1L << 1)
00080 #define MWM_DECOR_RESIZEH (1L << 2)
00081 #define MWM_DECOR_TITLE  (1L << 3)
00082 #define MWM_DECOR_MENU  (1L << 4)
00083 #define MWM_DECOR_MINIMIZE (1L << 5)
00084 #define MWM_DECOR_MAXIMIZE (1L << 6)
00085 
00086 typedef struct
00087 {
00088     unsigned long flags;
00089     unsigned long functions;
00090     unsigned long decorations;
00091     long          inputMode;
00092     unsigned long status;
00093 
00094 } PropMotifWmHints;
00095 
00096 #define PROP_MOTIF_WM_HINTS_ELEMENTS 5 
00097 
00098 #endif

SourceForge.net Logo Generated on Sat May 12 15:25:43 2007 for ardev by doxygen 1.5.1