Back to index

plt-scheme  4.2.1
AppMain.h
Go to the documentation of this file.
00001 /*                                                      -*- C++ -*-
00002  *
00003  * Purpose: wxWindows application and main loop
00004  *
00005  * Authors: Markus Holzem and Julian Smart
00006  *
00007  * Copyright: (C) 2004-2009 PLT Scheme Inc.
00008  * Copyright: (C) 1995, AIAI, University of Edinburgh (Julian)
00009  * Copyright: (C) 1995, GNU (Markus)
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU 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  * This program 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 General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00024  * 02110-1301 USA.
00025  */
00026 
00027 #ifndef AppMain_h
00028 #define AppMain_h
00029 
00030 #ifdef __GNUG__
00031 #pragma interface
00032 #endif
00033 
00034 class wxFrame;
00035 
00036 class wxApp : public wxObject {
00037 public:
00038     // functions
00039     wxApp();
00040 
00041     virtual void    Dispatch(void);
00042             Bool    Initialized(void) { return initialized; };
00043     virtual int     MainLoop(void);
00044     virtual void    ExitMainLoop(void) { keep_going = False; }
00045     virtual wxFrame *OnInit(void) { return 0; };
00046     virtual int     OnExit(void) { return 0; };
00047     virtual Bool    Pending(void);
00048 
00049     char* GetAppName(void)     { return wxAPP_NAME; }
00050     void  SetAppName(char *name)   { wxAPP_NAME = name; }
00051     char* GetClassName(void)          { return wxAPP_CLASS; }
00052     void  SetClassName(char *name) { wxAPP_CLASS = name; }
00053     // data
00054     int    argc;
00055     char** argv;
00056 private:
00057     friend int wxEntry(int argc, char **argv);
00058 
00059     Bool  initialized;
00060 public:
00061     Bool  keep_going;
00062 };
00063 
00064 void wxInitNewToplevel(void);
00065 extern void wxDoNextEvent();
00066 extern int wxEventReady();
00067 extern void wxDoEvents();
00068 
00069 extern int wxEntry(int argc, char *argv[]);
00070 
00071 extern int wxGetPreference(const char *name, int *res);
00072 extern int wxGetBoolPreference(const char *name, int *res);
00073 
00074 #endif // AppMain_h