1 /*
2 * Authors:
3 * Ted Gould <ted@gould.cx>
4 *
5 * Copyright (C) 2007 Authors
6 *
7 * Released under GNU GPL, read the file 'COPYING' for more information
8 */
10 #ifndef INKSCAPE_EXTENSION_EXECUTION_ENV_H__
11 #define INKSCAPE_EXTENSION_EXECUTION_ENV_H__
13 #include <config.h>
15 #include <glibmm/main.h>
16 #include <glibmm/ustring.h>
18 #include <gtkmm/dialog.h>
20 #include "forward.h"
21 #include "extension-forward.h"
22 #include "extension.h"
24 namespace Inkscape {
25 namespace Extension {
27 class ExecutionEnv {
28 private:
29 Gtk::Dialog * _visibleDialog;
30 bool _prefsVisible;
31 bool _finished;
32 bool _humanWait;
33 bool _canceled;
34 bool _prefsChanged;
35 bool _livePreview;
36 bool _shutdown;
37 bool _selfdelete;
38 sigc::signal<void> * _changeSignal;
39 Glib::RefPtr<Glib::MainLoop> _mainloop;
40 Inkscape::UI::View::View * _doc;
41 std::list<Glib::ustring> _selected;
42 sigc::connection _dialogsig;
43 sigc::connection _changesig;
44 sigc::connection _timersig;
45 Implementation::ImplementationDocumentCache * _docCache;
47 public:
48 Effect * _effect;
50 ExecutionEnv (Effect * effect,
51 Inkscape::UI::View::View * doc,
52 Gtk::Widget * controls = NULL,
53 sigc::signal<void> * changeSignal = NULL,
54 Gtk::Dialog * prefDialog = NULL,
55 Implementation::ImplementationDocumentCache * docCache = NULL);
56 virtual ~ExecutionEnv (void);
58 void run (void);
59 void livePreview (bool state = true);
60 void shutdown (bool del = false);
62 private:
63 void createPrefsDialog (Gtk::Widget * controls);
64 void createWorkingDialog (void);
65 void workingCanceled (const int resp);
66 void preferencesResponse (const int resp);
67 void preferencesChange (void);
68 bool preferencesTimer (void);
69 void processingCancel (void);
70 void processingComplete(void);
71 void documentCancel (void);
72 void documentCommit (void);
73 void reselect (void);
74 void genDocCache (void);
75 void killDocCache (void);
76 };
78 } } /* namespace Inkscape, Extension */
79 #endif /* INKSCAPE_EXTENSION_EXECUTION_ENV_H__ */
81 /*
82 Local Variables:
83 mode:c++
84 c-file-style:"stroustrup"
85 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
86 indent-tabs-mode:nil
87 fill-column:99
88 End:
89 */
90 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :