ccutil/debugwin.h

Go to the documentation of this file.
00001 
00020 #ifndef           DEBUGWIN_H
00021 #define           DEBUGWIN_H
00022 
00023 #include          "host.h"
00024 #include          "varable.h"
00025 
00026 #ifdef __MAC__
00027 #include          <lwindow.h>
00028 #include          <lcommander.h>
00029 #endif
00030 
00031 //the following define the default position of a debug window
00032 //if not specified at construction
00033 #define DEBUG_WIN_XPOS    50     //default position
00034 #define DEBUG_WIN_YPOS    30     //default position
00035 #define DEBUG_WIN_XSIZE   700    //default size
00036 #define DEBUG_WIN_YSIZE   300    //default size
00037 
00038 
00041 //number of lines in the scrollable area of the window
00042 extern DLLSYM INT_VAR_H (debug_lines, 256, "Number of lines in debug window");
00070 class DLLSYM DEBUG_WIN
00071 {
00072   public:
00073     //the constructor creates the window, the destructor kills it
00074     DEBUG_WIN (                  //constructor
00075       const char *title,         //of window
00076       INT32 xpos = DEBUG_WIN_XPOS,//initial position
00077       INT32 ypos = DEBUG_WIN_YPOS,//in pixels
00078                                  //initial size
00079       INT32 xsize = DEBUG_WIN_XSIZE,
00080                                  //in pixels
00081       INT32 ysize = DEBUG_WIN_YSIZE,
00082                                  //default scroll size (textlines)
00083       INT32 buflines = debug_lines);
00084 
00085     ~DEBUG_WIN ();               //destructor
00086 
00087     void dprintf (               //printf to window
00088       const char *format, ...);  //message
00089 
00090     void await_destruction();  //wait for user to close
00091 
00092   #ifdef __MAC__
00093     static void SetCommander(LCommander *pCommander); 
00094   #endif
00095 
00096   private:
00097 
00098   #ifdef __MSW32__
00099     HWND handle;                 //handle to window
00100     char *shm_mem;               //shared memory
00101     char *msg_end;               //current string
00102     HANDLE shm_hand;             //handle to it
00103     HANDLE dbg_process;          //handle to it
00104     HANDLE dbg_thread;           //handle to it
00105   #endif
00106   #ifdef __UNIX__
00107     FILE *fp;                    /*return file */
00108   #endif
00109 
00110   #ifdef __MAC__
00111     LWindow *pWindow;
00112   #endif
00113 };
00114 #endif

Generated on Wed Feb 28 19:49:09 2007 for Tesseract by  doxygen 1.5.1