Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phX11ImageWindow.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission : 
00003         Realtime Vision Processing System
00004     
00005     Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008     
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU Lesser General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU Lesser General Public License for more details.
00020 
00021     You should have received a copy of the GNU Lesser General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 #ifndef _PHX11IMAGEWINDOW_H
00027 #define _PHX11IMAGEWINDOW_H
00028 
00029 /* These 2 headers must be before phX11Util.h because phX11Util.h has
00030  * Xlib headers that define Status and conflict with a field in a windows
00031  * w32api header file */
00032 #include <phMutex.h>
00033 #include <phImage.h>
00034 #include <ImageGfx.h>
00035 #include <phImageWindow.h>
00036 #include <phX11Util.h>
00037 
00038 /* ------------------------------------------------------------------------- */
00044 PHAPI(class) phX11ImageWindow : public phImageWindow
00045 {
00046 private:
00047     /* Display and  Window stuff */
00048     phX11WindowInfo     m_x11window;
00049     phX11ImageInfo      m_imageBuffer;
00050 
00051     int32_t             m_wait     [phX11Window_USEREVENT_COUNT];
00052     phSemaphore         m_done_sems[phX11Window_USEREVENT_COUNT];
00053     phMutex             m_done_lock[phX11Window_USEREVENT_COUNT];
00054     phSemaphore         m_recv_sems[phX11Window_USEREVENT_COUNT];
00055     phMutex             m_recv_lock[phX11Window_USEREVENT_COUNT];
00056     phX11EventAtom      m_atoms    [phX11Window_USEREVENT_COUNT];
00057 
00058     /* Window Parameter Stuff */
00059     int m_border;
00060    
00061     int initWindow();
00062 
00075     int phX11CheckWaitDone( int   index );
00082     int phX11WaitRecv   ( int   index,
00083                           int   recv_wait = 1 );
00084 
00085     /* Overloading the pure virtual functions from phImageWindow */
00086     /* These functions merely send an event to be handled by the 
00087      * event thread. If the event thread isn't running, then these
00088      * will likely do nothing. */
00089     virtual int private_show();
00090     virtual int private_hide();
00091 
00092     virtual int private_redraw  ();
00093     virtual int private_update  ();
00094     virtual int private_resize  ( uint32_t w,    uint32_t h     );
00095     virtual int private_move    ( int32_t  x,    int32_t  y     );
00096     virtual int private_minsize ( uint32_t min_w,uint32_t min_h );
00097 
00098     /* These implement the actual phX11Util calls to perform
00099      * the events posted by the above private_* calls */
00100     /* This is an attempt to fix "unexpected async reply" errors
00101      * and is really just generally the right way to do it; common sense
00102      * says the window can only be doing one action at a time anyway */
00103     int gui_show();
00104     int gui_hide();
00105 
00106     int gui_redraw  ();
00107     int gui_update  ();
00108     int gui_resize  ( uint32_t w,     uint32_t h    );
00109     int gui_move    ( int32_t  x,     int32_t  y    );
00110     int gui_minsize ( uint32_t min_w, uint32_t min_h);
00111    
00112     /* phThread stuff & wakeups */
00113     int sendWakeup();
00114     virtual int wakeup  ();
00115     virtual int cleanup ();
00116     virtual int run     ();
00117  
00118 public:
00119     phX11ImageWindow( int32_t  x,   int32_t  y,
00120                       uint32_t w,   uint32_t h,
00121                       char    *title,
00122                       uint32_t flags = phNOFLAG );
00123     virtual ~phX11ImageWindow();
00124    
00125     virtual int isOpen();
00126 
00127     virtual int setTitle(const char *title);
00128 };
00129 
00130 #endif /* _PHX11IMAGEWINDOW_H */




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:03 2007 for phission by  doxygen 1.4.4