home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / code / wxwin140 / include / wx_main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-19  |  2.2 KB  |  85 lines

  1. /*
  2.  * File:     wx_main.h
  3.  * Purpose:  wxApp declaration and a few other functions.
  4.  *
  5.  *                       wxWindows 1.40
  6.  * Copyright (c) 1993 Artificial Intelligence Applications Institute,
  7.  *                   The University of Edinburgh
  8.  *
  9.  *                     Author: Julian Smart
  10.  *                       Date: 18-4-93
  11.  *
  12.  * Permission to use, copy, modify, and distribute this software and its
  13.  * documentation for any purpose is hereby granted without fee, provided
  14.  * that the above copyright notice, author statement and this permission
  15.  * notice appear in all copies of this software and related documentation.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
  18.  * IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
  19.  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  * IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
  22.  * UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
  23.  * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
  24.  * LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
  25.  * DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
  26.  * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  */
  28.  
  29. #ifndef wx_mainh
  30. #define wx_mainh
  31.  
  32. #include "common.h"
  33. #include "wx_obj.h"
  34.  
  35. #ifdef wx_motif
  36. #include <Xm/Xm.h>
  37. #endif
  38.  
  39. class wxFrame;
  40.  
  41. // Represents the application. Derive OnInit and declare
  42. // a new App object to start application
  43. class wxApp: public wxObject
  44. {
  45.  public:
  46.   wxFrame *wx_frame;
  47.   int argc;
  48.   char **argv;
  49.   Bool death_processed;
  50. #ifdef wx_motif
  51.   XtAppContext appContext;
  52.   Widget topLevel;
  53. #endif
  54. #ifdef wx_msw
  55.   HANDLE hInstance;
  56.   MSG current_msg;
  57. #endif
  58.  
  59.   wxApp(void);
  60.   ~wxApp(void);
  61.   virtual wxFrame *OnInit(void);
  62.   virtual int OnExit(void);
  63.   virtual int MainLoop(void);
  64.   Bool Initialized(void);
  65. #ifdef wx_msw
  66.   virtual BOOL DoMessage(void);
  67.   virtual BOOL ProcessMessage(MSG* pMsg);
  68.   virtual BOOL OnIdle(void);
  69. #endif
  70. };
  71.  
  72. extern wxApp *wxTheApp;
  73.  
  74. // Force an exit from main loop
  75. void wxExit(void);
  76.  
  77. // Yield to other apps/messages
  78. Bool wxYield(void);
  79.  
  80. #ifdef wx_msw
  81. extern HANDLE wxhInstance;
  82. #endif
  83.  
  84. #endif
  85.