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"
23 namespace Inkscape {
24 namespace Extension {
26 class ExecutionEnv {
27 private:
28 Gtk::Dialog * _visibleDialog;
29 bool _prefsVisible;
30 bool _finished;
31 bool _humanWait;
32 bool _canceled;
33 bool _prefsChanged;
34 bool _livePreview;
35 bool _shutdown;
36 bool _selfdelete;
37 sigc::signal<void> * _changeSignal;
38 Glib::RefPtr<Glib::MainLoop> _mainloop;
39 Inkscape::UI::View::View * _doc;
40 std::list<Glib::ustring> _selected;
41 sigc::connection _dialogsig;
42 sigc::connection _changesig;
43 sigc::connection _timersig;
45 public:
46 Effect * _effect;
48 ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls = NULL, sigc::signal<void> * changeSignal = NULL, Gtk::Dialog * prefDialog = NULL);
49 ~ExecutionEnv (void);
51 void run (void);
52 void livePreview (bool state = true);
53 void shutdown (bool del = false);
55 private:
56 void createPrefsDialog (Gtk::Widget * controls);
57 void createWorkingDialog (void);
58 void workingCanceled (const int resp);
59 void preferencesResponse (const int resp);
60 void preferencesChange (void);
61 bool preferencesTimer (void);
62 void processingCancel (void);
63 void processingComplete(void);
64 void documentCancel (void);
65 void documentCommit (void);
66 void reselect (void);
67 };
69 } } /* namespace Inkscape, Extension */
70 #endif /* INKSCAPE_EXTENSION_EXECUTION_ENV_H__ */
72 /*
73 Local Variables:
74 mode:c++
75 c-file-style:"stroustrup"
76 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
77 indent-tabs-mode:nil
78 fill-column:99
79 End:
80 */
81 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :