1 ////////////////////////////////////////////////////////////////////// 2 // 3 // Pixie 4 // 5 // Copyright � 1999 - 2003, Okan Arikan 6 // 7 // Contact: okan@cs.utexas.edu 8 // 9 // This library is free software; you can redistribute it and/or 10 // modify it under the terms of the GNU Lesser General Public 11 // License as published by the Free Software Foundation; either 12 // version 2.1 of the License, or (at your option) any later version. 13 // 14 // This library is distributed in the hope that it will be useful, 15 // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 // Lesser General Public License for more details. 18 // 19 // You should have received a copy of the GNU Lesser General Public 20 // License along with this library; if not, write to the Free Software 21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 // 23 /////////////////////////////////////////////////////////////////////// 24 /////////////////////////////////////////////////////////////////////// 25 // 26 // File : fbx.h 27 // Classes : CXDisplay 28 // Description : X Windows image displaying class 29 // 30 //////////////////////////////////////////////////////////////////////// 31 #ifndef FBX_H 32 #define FBX_H 33 34 #include <stdlib.h> 35 #include <stdio.h> 36 #include <string.h> 37 #include <unistd.h> 38 #include <X11/Xlib.h> 39 #include <X11/Xutil.h> 40 #include <X11/keysym.h> 41 #include <X11/Xatom.h> 42 #include <pthread.h> 43 #include "framebuffer.h" 44 45 /////////////////////////////////////////////////////////////////////// 46 // Class : CXDisplay 47 // Description : The windows display class 48 // Comments : 49 class CXDisplay : public CDisplay { 50 public: 51 CXDisplay(const char *,const char *,int,int,int); 52 ~CXDisplay(); 53 54 void main(); 55 int data(int,int,int,int,float *); 56 void finish(); 57 58 private: 59 typedef void (CXDisplay::*dataHandlerFn)(int,int,int,int,float*); 60 61 void handleData_rgb15(int,int,int,int,float*); 62 void handleData_rgb15_rev(int,int,int,int,float*); 63 void handleData_bgr15(int,int,int,int,float*); 64 void handleData_bgr15_rev(int,int,int,int,float*); 65 66 void handleData_rgb16(int,int,int,int,float*); 67 void handleData_rgb16_rev(int,int,int,int,float*); 68 void handleData_bgr16(int,int,int,int,float*); 69 void handleData_bgr16_rev(int,int,int,int,float*); 70 71 void handleData_rgba32(int,int,int,int,float*); 72 void handleData_argb32(int,int,int,int,float*); 73 void handleData_bgra32(int,int,int,int,float*); 74 void handleData_abgr32(int,int,int,int,float*); 75 76 dataHandlerFn dataHandler; 77 pthread_t thread; 78 void *imageData; 79 int imageDepth; 80 int scanWidth; 81 int windowUp; 82 int windowDown; 83 Window xcanvas; 84 Display *display; 85 int screen; 86 GC image_gc; 87 XImage *xim; 88 Atom WM_DELETE_WINDOW; 89 Atom WM_PROTOCOLS; 90 char *displayName; 91 }; 92 93 94 95 #endif 96 97