vdk 2.4.0
application.h
1 /*
2  * ===========================
3  * VDK Visual Develeopment Kit
4  * Version 0.4
5  * October 1998
6  * ===========================
7  *
8  * Copyright (C) 1998, Mario Motta
9  * Developed by Mario Motta <mmotta@guest.net>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  * 02111-1307, USA.
25  \latexonly
26  <image latex vdklogo.eps
27  \endlatexonly
28  */
113 #ifndef APPLICATION_H
114 #define APPLICATION_H
115 
116 #include <gtk/gtk.h>
117 #include <vdk/vdktypes.h>
118 #include <vdk/vdkstring.h>
119 
120 
121 class VDKForm;
131 {
132  int gcTag,idleTag;
133  VDKString rcfile;
134 protected:
135  /* !
136  \internal
137  garbage collection callback,
138  invoked from a gtk_timeout established by the user with
139  SetGarbageCollection()
140  */
141  static int GcCallback(gpointer app);
142 public:
156  VDKApplication(int* argc, char** argv, char* rcf = (char*) NULL,
157  bool have_locale = false);
161  virtual ~VDKApplication();
165  void Run(void);
171  void Terminate(void);
175  GtkWidget* MainWindow();
180  virtual void Setup() = 0;
206  gint VDKMessageBox(char* caption,
207  char* text,
208  int mode = VDK_OK,
209  char *oktext = (char*) NULL,
210  char *canceltext = (char*) NULL,
211  unsigned int wait = 0);
212 
213  //
214  gint VDKFileChooser(char* caption);
223  void SetIdleCallback(GtkFunction idlecb = NULL ,
224  gpointer data = (gpointer) NULL);
228  void SetGarbageCollection(unsigned int tick = 1000);
237  void SetResourceFile(char* rcf);
241  bool HasResources() { return ! rcfile.isNull(); }
242 };
243 
244 #endif
245 
246 
247 
248 
249 
250 
251 
Application object.
Definition: application.h:131
void SetGarbageCollection(unsigned int tick=1000)
Definition: application.cc:149
void RemoveGarbageCollection()
Definition: application.cc:156
virtual ~VDKApplication()
Definition: application.cc:97
void Run(void)
Definition: application.cc:116
void SetResourceFile(char *rcf)
Definition: application.cc:126
VDKForm * MainForm
Definition: application.h:147
virtual void Setup()=0
gint VDKMessageBox(char *caption, char *text, int mode=VDK_OK, char *oktext=(char *) NULL, char *canceltext=(char *) NULL, unsigned int wait=0)
Definition: msgdialog.cc:177
void SetIdleCallback(GtkFunction idlecb=NULL, gpointer data=(gpointer) NULL)
Definition: application.cc:133
void Terminate(void)
Definition: application.cc:165
GtkWidget * MainWindow()
Definition: application.cc:174
VDKApplication(int *argc, char **argv, char *rcf=(char *) NULL, bool have_locale=false)
Definition: application.cc:60
bool HasResources()
Definition: application.h:241
Provides a wrap for GtkFileChooser widget.
Definition: vdkfilechooser.h:67
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:69
Implements famous cont referenced string objects.
Definition: vdkstring.h:46
bool isNull() const
Definition: vdkstring.cc:231