KWWidgets
debian/tmp/usr/include/KWWidgets/vtkKWApplication.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Module: $RCSfile: vtkKWApplication.h,v $
4 
5  Copyright (c) Kitware, Inc.
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 // .NAME vtkKWApplication - an application class
15 // .SECTION Description
16 // vtkKWApplication is the overall class that represents the entire
17 // application. It is also responsible for managing the vtkKWWindowBase(s)
18 // associated to the application.
19 
20 #ifndef __vtkKWApplication_h
21 #define __vtkKWApplication_h
22 
23 #include "vtkKWObject.h"
24 
25 #include "vtkTcl.h" // Needed for Tcl_Interp
26 #include "vtkTk.h" // Needed for Tk_Window
27 
28 class vtkKWApplicationInternals;
31 class vtkKWLabel;
32 class vtkKWLogDialog;
33 class vtkKWMessageDialog;
36 class vtkKWSplashScreen;
37 class vtkKWTclInteractor;
39 class vtkKWTheme;
40 class vtkKWTopLevel;
41 class vtkKWWidget;
42 class vtkKWWindowBase;
43 
45 {
46 public:
47  static vtkKWApplication* New();
48  vtkTypeRevisionMacro(vtkKWApplication,vtkKWObject);
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
51  // Description:
52  // Override vtkKWObject's method. A vtkKWObject is associated to a
53  // vtkKWApplication. Even if vtkKWApplication is a subclass of
54  // vtkKWObject, an application's application is actually 'itself',
55  // and it can not be reset.
56  virtual vtkKWApplication *GetApplication() { return this; }
57  virtual void SetApplication (vtkKWApplication*);
58 
59  // Description:
60  // Start running the application, with or without arguments, and enter the
61  // event loop. The application will exit the event loop once every
62  // windows has been closed.
63  // As a convenience, if one (or more) window has been added to the
64  // application (using AddWindow()), and none of them has been mapped
65  // on the screen yet, the application will automatically display the first
66  // window by calling its Display() method.
67  virtual void Start();
68  virtual void Start(int argc, char *argv[]);
69 
70  // Description:
71  // This method is invoked when the user exits the app
72  // Return 1 if the app exited successfully, 0 otherwise (for example,
73  // if some dialogs are still up, or the user did not confirm, etc).
74  virtual int Exit();
75 
76  // Description:
77  // Set/Get if a confirmation dialog should be displayed before the
78  // application exits.
79  vtkSetMacro(PromptBeforeExit, int);
80  vtkGetMacro(PromptBeforeExit, int);
81  vtkBooleanMacro(PromptBeforeExit, int);
82 
83  // Description:
84  // Set/Get the value returned by the application at exit.
85  // This can be used from scripts to set an error status
86  vtkSetMacro(ExitStatus, int);
87  vtkGetMacro(ExitStatus, int);
88 
89  // Description:
90  // Get when application is exiting (set to 1 as soon as Exit() is called).
91  vtkGetMacro(InExit, int);
92 
93  // Description:
94  // Set/Get if the error log should be sent.emailed before application exits.
95  vtkSetMacro(SendErrorLogBeforeExit, int);
96  vtkGetMacro(SendErrorLogBeforeExit, int);
97  vtkBooleanMacro(SendErrorLogBeforeExit, int);
98 
99  // Description:
100  // Add, remove (i.e. close), or retrieve a window to/from this application.
101  // Note that AddWindow() will increase the reference count of the window
102  // that is added, RemoveWindow() will decrease it. Once the last window is
103  // closed, Exit() is called.
104  // Return 1 if successful, 0 otherwise
105  virtual int AddWindow(vtkKWWindowBase *w);
106  virtual int RemoveWindow(vtkKWWindowBase *);
107  virtual vtkKWWindowBase* GetNthWindow(int rank);
108 
109  // Description:
110  // Get the number of windows, the number of windows mapped on screen.
111  virtual int GetNumberOfWindows();
112  virtual int GetNumberOfWindowsMapped();
113 
114  // Description:
115  // Set/Get the application name.
116  // Also check the LimitedEditionModeName variable if you plan on running
117  // the application in limited edition mode.
118  vtkSetStringMacro(Name);
119  vtkGetStringMacro(Name);
120 
121  // Description:
122  // Get the major and minor application version.
123  vtkSetMacro(MajorVersion, int);
124  vtkGetMacro(MajorVersion, int);
125  vtkSetMacro(MinorVersion, int);
126  vtkGetMacro(MinorVersion, int);
127 
128  // Description:
129  // Set/Get the application version name - this usually is the application
130  // name postfixed with the version number (major/minor).
131  // If it has not been set, it will use the value of Name and append
132  // the major/minor version.
133  vtkSetStringMacro(VersionName);
134  virtual const char* GetVersionName();
135 
136  // Description:
137  // Set/Get the application release name - this is the release of the
138  // application version (if any), typically: beta1, beta2, final, patch1, etc.
139  vtkSetStringMacro(ReleaseName);
140  vtkGetStringMacro(ReleaseName);
141 
142  // Description:
143  // Get the "pretty" name of the application.
144  // This is typically used for windows or dialogs title, About boxes, etc.
145  // It combines the application name, its version, and other relevant
146  // informations (like its limited edition mode).
147  virtual const char* GetPrettyName();
148 
149  // Description:
150  // Get the most recent version this application was ever launched, if known.
151  // Each time this application is closed, its version is automatically saved
152  // to the registry (provided that this version is the most recent).
153  // Use this method to retrieve which most recent version was ever launched
154  // by your user. This can be used by newer application to detect if some
155  // migration is needed to upgrade from an older version.
156  // Returns 0 if no most recent version was ever recorded, or if it can not
157  // be parsed.
158  virtual int GetMostRecentVersionLaunched(int *major, int *minor);
159 
160  // Descrition:
161  // Set/Get if the application is running in limited edition mode.
162  // This can be used throughout the whole UI to enable or disable
163  // features on the fly. Make sure it is *not* wrapped !
164  //BTX
165  virtual void SetLimitedEditionMode(int arg);
166  vtkBooleanMacro(LimitedEditionMode, int);
167  vtkGetMacro(LimitedEditionMode, int);
168  //ETX
169 
170  // Descrition:
171  // Return the limited edition mode and optionally warn the user ;
172  // if the limited edition mode is true, display a popup warning stating
173  // that 'feature' is not available in this mode.
174  virtual int GetLimitedEditionModeAndWarn(const char *feature);
175 
176  // Descrition:
177  // Set/Get the name of the application when it runs in limited edition mode.
178  // This is used by GetPrettyName() for example, instead of the Name variable.
179  // If it has not been set, it will use the value of Name and append
180  // the "Limited Edition" to it.
181  vtkSetStringMacro(LimitedEditionModeName);
182  virtual const char *GetLimitedEditionModeName();
183 
184  // Descrition:
185  // Set/Get if the application is running in release/production mode.
186  // This should be set as soon as possible, before creating any UI.
187  // The release mode (as opposed to debug/development mode) can be used
188  // to prevent the output window from showing up, to disable the support of
189  // specific file formats that should only be used during development, to
190  // remove the Tcl Command Prompt, etc.
191  //BTX
192  virtual void SetReleaseMode(int);
193  vtkBooleanMacro(ReleaseMode, int);
194  vtkGetMacro(ReleaseMode, int);
195  //ETX
196 
197  // Description:
198  // Set/Get the directory in which the application is supposed
199  // to be installed.
200  virtual const char *GetInstallationDirectory();
201  vtkSetStringMacro(InstallationDirectory);
202 
203  // Description:
204  // Set/Get the directory in which the application can store
205  // user data.
206  // On Windows, this is usually:
207  // C:\Documents and Settings<username>\My Documents\NameOfTheApplication
208  // On Unix/MacOSX, this is usually:
209  // $HOME/.NameOfTheApplication (ex: /users/barre/.VolView)
210  virtual const char* GetUserDataDirectory();
211  vtkSetStringMacro(UserDataDirectory);
212 
213  // Description:
214  // Load and evaluate a Tcl script from a file.
215  // Return 1 if successful, 0 otherwise
216  virtual int LoadScript(const char* filename);
217 
218  // Description:
219  // Run an AppleScript provided as a string (don't forget to escape the
220  // quotes). Only on Apple platforms.
221  // Return 1 if successful, 0 otherwise
222 #ifdef __APPLE__
223  //BTX
224  static int RunAppleScript(const char *text);
225  //ETX
226 #endif
227 
228  // Description:
229  // Set/Get the "exit after load script" flag. If this flag is set, then
230  // the application will automatically Exit() after a call to LoadScript().
231  // This is mainly used for testing purposes. Even though a Tcl script
232  // can end with an explicit call to Exit on the application Tcl object,
233  // this call may never be reached it the script contains an error. Setting
234  // this variable will make sure the application will exit anyway.
235  vtkSetClampMacro(ExitAfterLoadScript, int, 0, 1);
236  vtkBooleanMacro(ExitAfterLoadScript, int);
237  vtkGetMacro(ExitAfterLoadScript, int);
238 
239  // Description:
240  // Set/Get the print quality.
241  vtkGetMacro(PrintTargetDPI, double);
242  vtkSetMacro(PrintTargetDPI, double);
243 
244  // Description:
245  // Get the Registry object.
246  //BTX
247  vtkKWRegistryHelper *GetRegistryHelper();
248  //ETX
249 
250  // Description:
251  // Set/Get the registry application version name - this usually is the
252  // application name postfixed with the *major* version number. The minor
253  // version is not used so that application settings are maintained
254  // between minor version changes.
255  // It is typically used as the master key to store registry settings
256  // (ex: VolView 3, ParaView1, etc.)
257  vtkSetStringMacro(RegistryVersionName);
258  virtual const char* GetRegistryVersionName();
259 
260  // Description:
261  // Set/Get the current registry level.
262  // When setting/retrieving a value in/from the registry a 'level' has
263  // to be provided as part of the parameters. If this level is greater
264  // than the current registry level, the operation will be ignored.
265  // Set the registry level to -1 means to ignore all the registry operations.
266  vtkSetClampMacro(RegistryLevel, int, -1, 10);
267  vtkGetMacro(RegistryLevel, int);
268 
269  // Description:
270  // Set/Get/Delete/Query a registry value for the application.
271  // When storing multiple arguments, separate them with spaces.
272  // Note that if the 'level' is greater than the current registry level,
273  // the operation will be ignored.
274  //BTX
275  virtual int SetRegistryValue(
276  int level, const char* subkey, const char* key,
277  const char* format, ...);
278  //ETX
279  virtual int GetRegistryValue(
280  int level, const char* subkey, const char* key, char* value);
281  virtual int DeleteRegistryValue(
282  int level, const char* subkey, const char* key);
283  virtual int HasRegistryValue(
284  int level, const char* subkey, const char* key);
285 
286  // Description:
287  // Retrieve a value from the registry and convert it to a type
288  // (boolean, float, int).
289  // Return 0 if the value was not found.
290  // For GetBooleanRegistryValue(), perform a boolean check of the value in
291  // the registry. If the value at the key is equal to 'trueval', then return
292  // true, otherwise return false.
293  virtual float GetFloatRegistryValue(
294  int level, const char* subkey, const char* key);
295  virtual int GetIntRegistryValue(
296  int level, const char* subkey, const char* key);
297  virtual int GetBooleanRegistryValue(
298  int level, const char* subkey, const char* key, const char* trueval);
299 
300  // Description:
301  // Save/retrieve color to/from the registry.
302  // If the color does not exist, it will retrieve -1, -1 ,-1 and return 0
303  // (1 if success).
304  // Note that the subkey used here is "Colors".
305  virtual void SaveColorRegistryValue(
306  int level, const char *key, double rgb[3]);
307  virtual int RetrieveColorRegistryValue(
308  int level, const char *key, double rgb[3]);
309 
310  // Descrition:
311  // Save/Retrieve the application settings to/from registry.
312  // Do not call that method before the application name is known and the
313  // proper registry level set (if any).
314  virtual void RestoreApplicationSettingsFromRegistry();
315  virtual void SaveApplicationSettingsToRegistry();
316 
317  // Description:
318  // Get the database option object.
319  //BTX
320  vtkKWOptionDataBase *GetOptionDataBase();
321  //ETX
322 
323  // Description:
324  // Set/Get if this application supports a splash screen
325  vtkSetMacro(SupportSplashScreen, int);
326  vtkGetMacro(SupportSplashScreen, int);
327  vtkBooleanMacro(SupportSplashScreen, int);
328 
329  // Description:
330  // Set/Get if this application should show the splash screen at startup
331  vtkGetMacro(SplashScreenVisibility, int);
332  vtkSetMacro(SplashScreenVisibility, int);
333  vtkBooleanMacro(SplashScreenVisibility, int);
334 
335  // Description:
336  // Retrieve the splash screen object
337  // This will also create the splash screen widget itself.
338  virtual vtkKWSplashScreen* GetSplashScreen();
339 
340  // Description:
341  // Set/Get if the user interface geometry should be saved (to the registry,
342  // for example).
343  // This is more like a hint that many widgets can query to check if
344  // they should save their own geometry (and restore it on startup).
345  vtkGetMacro(SaveUserInterfaceGeometry, int);
346  vtkSetMacro(SaveUserInterfaceGeometry, int);
347  vtkBooleanMacro(SaveUserInterfaceGeometry, int);
348 
349  // Description:
350  // Get/Set the internal character encoding of the application.
351  virtual void SetCharacterEncoding(int val);
352  vtkGetMacro(CharacterEncoding, int);
353 
354  // Description:
355  // Get if we have some logic to check for application update online and
356  // perform that check.
357  virtual int HasCheckForUpdates();
358  virtual void CheckForUpdates();
359 
360  // Description:
361  // Get/Set the current theme. This will install the theme automatically.
362  virtual void SetTheme(vtkKWTheme *theme);
363  vtkGetObjectMacro(Theme, vtkKWTheme);
364 
365  // Description:
366  // Get if we have some logic to report feedback by email and
367  // email that feedback.
368  // Set/Get the email address to send that feedback to.
369  virtual int CanEmailFeedback();
370  virtual void EmailFeedback();
371  vtkSetStringMacro(EmailFeedbackAddress);
372  vtkGetStringMacro(EmailFeedbackAddress);
373 
374  // Description:
375  // Send email (win32 only for the moment, use MAPI).
376  virtual int SendEmail(
377  const char *to,
378  const char *subject,
379  const char *message,
380  const char *attachment_filename,
381  const char *extra_error_msg = NULL);
382 
383  // Description:
384  // Add email feedback body and subject to output stream.
385  // Override this function in subclasses (and/or call the superclass) to
386  // add more information.
387  virtual void AddEmailFeedbackBody(ostream &);
388  virtual void AddEmailFeedbackSubject(ostream &);
389 
390  // Description:
391  // Display the on-line help for this application.
392  // Optionally provide a master window this dialog should be the slave of.
393  virtual void DisplayHelpDialog(vtkKWTopLevel *master);
394 
395  // Description:
396  // Set/Get the help starting page.
397  // If set to a CHM/HTML page, it will be opened automatically on Windows.
398  vtkGetStringMacro(HelpDialogStartingPage);
399  vtkSetStringMacro(HelpDialogStartingPage);
400 
401  // Description:
402  // Display the on-line tutorial for this application.
403  // Optionally provide a master window this dialog should be the slave of.
404  virtual void DisplayTutorial(vtkKWTopLevel *master);
405 
406  // Description:
407  // Set/Get the tutorial starting page.
408  // If set to a CHM/HTML page, it will be opened automatically on Windows.
409  vtkGetStringMacro(TutorialStartingPage);
410  vtkSetStringMacro(TutorialStartingPage);
411 
412  // Description:
413  // Display the about dialog for this application.
414  // Optionally provide a master window this dialog should be the slave of.
415  virtual void DisplayAboutDialog(vtkKWTopLevel *master);
416 
417  // Description:
418  // Return the Balloon Help helper object.
419  virtual vtkKWBalloonHelpManager *GetBalloonHelpManager();
420 
421  // Description:
422  // Return the appplication-wide color picker dialog. Redefine this method
423  // in your application sub-class to provide a customized color picker.
424  virtual vtkKWColorPickerDialog *GetColorPickerDialog();
425 
426  // Description:
427  // Evaluate Tcl script/code and perform argument substitutions.
428  //BTX
429  virtual const char* Script(const char* format, ...);
430  int EvaluateBooleanExpression(const char* format, ...);
431  //ETX
432 
433  // Description:
434  // Get the interpreter being used by this application
435  static Tcl_Interp *GetMainInterp();
436 
437  // Description:
438  // Initialize Tcl/Tk
439  // Return NULL on error (eventually provides an ostream where detailed
440  // error messages will be stored).
441  // One method takes argc/argv and will create an internal Tcl interpreter
442  // on the fly, the other takes a Tcl interpreter and uses it afterward
443  // (this is mainly intended for initialization as a Tcl package)
444  //BTX
445  static Tcl_Interp *InitializeTcl(int argc, char *argv[], ostream *err = 0);
446  static Tcl_Interp *InitializeTcl(Tcl_Interp *interp, ostream *err = 0);
447  //ETX
448 
449  // Description:
450  // Call RegisterDialogUp to notify the application that a modal dialog is up,
451  // and UnRegisterDialogUp when it is not anymore. IsDialogUp will return
452  // if any dialog is up.
453  // The parameter to pass is a pointer to the dialog/toplevel/widget that is
454  // being registered/unregistered. If there is no such widget (say, if you
455  // are calling a builtin Tk function that creates and pops-up a dialog), pass
456  // the adress of the class that is invoking that call.
457  // This is used to help preventing a window or an
458  // application to exit while a dialog is still up. This is usually not
459  // a problem on Win32, since a modal dialog will prevent the user from
460  // interacting with the window and exit it, but this is not the case for
461  // other operating system where the window manager is independent from the
462  // window contents itself. In any case, inheriting from a vtkKWTopLevel
463  // or vtkKWDialog should take care of calling this function for you.
464  virtual void RegisterDialogUp(vtkKWWidget *ptr);
465  virtual void UnRegisterDialogUp(vtkKWWidget *ptr);
466  virtual int IsDialogUp();
467 
468  // Description:
469  // Open a link (media).
470  // On Win32, use ShellExecute to trigger the default viewers.
471  int OpenLink(const char *link);
472 
473  // Description:
474  // Explore link.
475  // On Win32, this will launch the Explorer, open it in the directory
476  // of the link, and eventually select that link itself in the directory.
477  int ExploreLink(const char *link);
478 
479  // Description:
480  // Process/update pending events. This method brings the
481  // application "up to date" by entering the event loop repeatedly until
482  // all pending events (including idle callbacks) have been processed.
483  virtual void ProcessPendingEvents();
484 
485  // Description:
486  // Process/update idle tasks. This causes operations that are normally
487  // deferred, such as display updates and window layout calculations, to be
488  // performed immediately.
489  virtual void ProcessIdleTasks();
490 
491  // Description:
492  // Install the Tcl background error callback. Individual applications
493  // can define a background error command if they wish to handle background
494  // errors. A background error is one that occurs in an event handler or
495  // some other command that didn't originate with the application. For
496  // example, if an error occurs while executing a command specified with
497  // asynchronously. The default implementation is to feed the Tcl error
498  // message to a vtkErrorMacro.
499  virtual void InstallTclBgErrorCallback();
500 
501  // Description:
502  // Popup a warning/error/information/debug message.
503  virtual void WarningMessage(const char* message);
504  virtual void ErrorMessage(const char* message);
505  virtual void DebugMessage(const char* message);
506  virtual void InformationMessage(const char* message);
507 
508  // Description:
509  // Display the warning/error/information/debug message log dialog.
510  // Optionally provide a master window this dialog should be the slave of.
511  virtual void DisplayLogDialog(vtkKWTopLevel *master);
512  virtual vtkKWLogDialog* GetLogDialog();
513 
514  // Description:
515  // Get/display the tcl interactor.
516  // Optionally provide a master window this dialog should be the slave of.
517  virtual void DisplayTclInteractor(vtkKWTopLevel *master);
518  virtual vtkKWTclInteractor* GetTclInteractor();
519 
520  // Description:
521  // Add system information to a stream.
522  // Will be used to report system info in the About dialog, or the Feedback
523  // email...
524  virtual void AddSystemInformation(ostream &);
525 
526  // Description:
527  // Some constants
528  //BTX
529  static const char *ExitDialogName;
530  static const char *SendErrorLogDialogName;
531  static const char *BalloonHelpVisibilityRegKey;
533  static const char *SplashScreenVisibilityRegKey;
534  static const char *PrintTargetDPIRegKey;
536  //ETX
537 
538  // Description:
539  // Callbacks. Internal, do not use.
540  virtual void TclBgErrorCallback(const char* message);
541 
542  // Description:
543  // Put a string into the environment of the form var=value
544  static int PutEnv(const char* value);
545 
546 protected:
548  ~vtkKWApplication();
549 
550  // Description:
551  // Do one tcl event and enter the event loop, allowing the application
552  // interface to actually run.
553  virtual void DoOneTclEvent();
554 
555  // Description:
556  // User data directory
558 
560 
561  // Description:
562  // Create email message dialog (in case of error).
563  virtual void CreateEmailMessageDialog(
564  vtkKWMessageDialog *dlg,
565  const char *to,
566  const char *subject,
567  const char *message,
568  const char *attachment_filename);
569 
570  // Description:
571  // Help starting page
573 
574  // Description:
575  // Tutorial starting page
577 
578  // Description:
579  // Display an on-line help page.
580  // Used by DisplayHelpDialog() and DisplayTutorial()
581  // Optionally provide a master window this dialog should be the slave of.
582  virtual void DisplayHelpPage(const char *page, vtkKWTopLevel *master);
583 
584  // Description:
585  // Display the exit dialog.
586  // Optionally provide a master window this dialog should be the slave of.
587  // Return 1 if the user wants to exit, 0 otherwise
588  virtual int DisplayExitDialog(vtkKWTopLevel *master);
589 
590  // Description:
591  // Value that is set after exit (status), flag stating that
592  // Exit was called, flag stating if application should exit after load script
594  int InExit;
598 
599  // Description:
600  // Send the error log (prompt first).
601  virtual int SendErrorLog();
602 
603  // Description:
604  // Number of dialog that are up. See Un/RegisterDialogUp().
605  int DialogUp;
606 
607  // Description:
608  // Registry level. If a call to Set/GetRegistryValue uses a level above
609  // this ivar, the operation is ignored.
611 
612  // Description:
613  // Flag stating if application supports splash screen, and shows it
616  virtual void CreateSplashScreen() {};
617 
618  // Description:
619  // Flag stating if the UI geometry should be saved before exiting
620  int SaveUserInterfaceGeometry;
621 
622  // Description:
623  // About dialog, add text and copyrights to the about dialog.
624  // Override this function in subclasses (and/or call the superclass) to
625  // add more information.
626  virtual void ConfigureAboutDialog();
627  virtual void AddAboutText(ostream &);
628  virtual void AddAboutCopyrights(ostream &);
632 
633  // Description:
634  // Character encoding (is passed to Tcl)
636 
637  // Description:
638  // Print DPI
640 
641  // Description:
642  // Current theme
644 
645  // Description:
646  // Give a change to the application to parse the command-line arguments
647  // and set some variables accordingly. Subclasses that do not intend
648  // to call their super's Start(argc, argv) should make sure they
649  // call their super's ParseCommandLineArguments.
650  virtual void ParseCommandLineArguments(int argc, char *argv[]);
651 
652  // Description:
653  // Check for an argument (example: --foo, /C, -bar, etc).
654  // Return VTK_OK if found and set 'index' to the position of the
655  // argument in argv[].
656  // Return VTK_ERROR if not found.
657  static int CheckForArgument(
658  int argc, char* argv[], const char *arg, int &index);
659 
660  // Description:
661  // Check for a valued argument (example: --foo=bar, /C=bar, -bar=foo, etc).
662  // Return VTK_OK if found and set 'index' to the position of the
663  // argument in argv[], 'value_pos' to the position right after the '='
664  // in that argument.
665  // Return VTK_ERROR if not found.
666  static int CheckForValuedArgument(
667  int argc, char* argv[], const char *arg, int &index, int &value_pos);
668 
669  // Description:
670  // Try to find the path to the online updater (for example, WiseUpdt.exe)
671  // and output that path to the ostream passed as parameter.
672  virtual int GetCheckForUpdatesPath(ostream &path);
673 
674  // Description:
675  // Deallocate/delete/reparent some internal objects in order to solve
676  // reference loops that would prevent this instance from being deleted.
677  virtual void PrepareForDelete();
678 
679  // PIMPL Encapsulation for STL containers
680 
681  vtkKWApplicationInternals *Internals;
682 
683  // Description:
684  // Initialize VTK's Tcl packages
685  // Return NULL on error (eventually provides an ostream where detailed
686  // error messages will be stored).
687  //BTX
688  static Tcl_Interp *InitializeVTK(Tcl_Interp *interp, ostream *err = 0);
689  //ETX
690 
691  // Description:
692  // Log dialog
694  virtual int CreateLogDialog();
695 
696  // Description:
697  // Install/restore output window
698  virtual void InstallOutputWindow();
699  virtual void RestoreOutputWindow();
700 
701  // Description:
702  // Tcl interactor.
704 
705  // Description:
706  // Color picker dialog
708 
709 private:
710 
711  vtkKWRegistryHelper *RegistryHelper;
712  vtkKWOptionDataBase *OptionDataBase;
713  vtkKWSplashScreen *SplashScreen;
714  vtkKWBalloonHelpManager *BalloonHelpManager;
715 
716  // Description:
717  // Application name and version
718  char *Name;
719  char *VersionName;
720  char *ReleaseName;
721  int MajorVersion;
722  int MinorVersion;
723  char *PrettyName;
724  vtkSetStringMacro(PrettyName);
725  char *RegistryVersionName;
726 
727  // Description:
728  // Limited edition mode, name of the application when in limited edition mode
729  int LimitedEditionMode;
730  char *LimitedEditionModeName;
731 
732  // Description:
733  // Release mode
734  int ReleaseMode;
735 
736  // Description:
737  // Application installation directory
738  char *InstallationDirectory;
739  virtual void FindInstallationDirectory();
740 
741  vtkKWApplication(const vtkKWApplication&); // Not implemented.
742  void operator=(const vtkKWApplication&); // Not implemented.
743 };
744 
745 #endif