3
* Ted Gould <ted@gould.cx>
5
* Copyright (C) 2007 Authors
7
* Released under GNU GPL, read the file 'COPYING' for more information
10
#ifndef INKSCAPE_EXTENSION_EXECUTION_ENV_H__
11
#define INKSCAPE_EXTENSION_EXECUTION_ENV_H__
15
#include <glibmm/main.h>
16
#include <glibmm/ustring.h>
18
#include <gtkmm/dialog.h>
21
#include "extension-forward.h"
22
#include "extension.h"
30
INIT, //< The context has been initialized
31
COMPLETE, //< We've completed atleast once
32
RUNNING //< The effect is currently running
34
/** \brief What state the execution engine is in. */
37
/** \brief If there is a working dialog it'll be referenced
39
Gtk::Dialog * _visibleDialog;
40
/** \brief Signal that the run is complete. */
41
sigc::signal<void> _runComplete;
42
/** \brief In some cases we need a mainLoop, when we do, this is
44
Glib::RefPtr<Glib::MainLoop> _mainloop;
45
/** \brief The document that we're working on. */
46
Inkscape::UI::View::View * _doc;
47
/** \brief A list of the IDs of all the selected objects before
48
we started to work on this document. */
49
std::list<Glib::ustring> _selected;
50
/** \brief A document cache if we were passed one. */
51
Implementation::ImplementationDocumentCache * _docCache;
53
/** \brief The effect that we're executing in this context. */
56
/** \brief Show the working dialog when the effect is executing. */
58
/** \brief Display errors if they occur. */
62
/** \brief Create a new context for exection of an effect
63
\param effect The effect to execute
64
\param doc The document to execute the effect on
65
\param docCache The implementation cache of the document. May be
66
NULL in which case it'll be created by the execution
68
\prarm show_working Show a small dialog signaling the effect
69
is working. Allows for user canceling.
70
\param show_errors If the effect has an error, show it or not.
72
ExecutionEnv (Effect * effect,
73
Inkscape::UI::View::View * doc,
74
Implementation::ImplementationDocumentCache * docCache = NULL,
75
bool show_working = true,
76
bool show_errors = true);
77
virtual ~ExecutionEnv (void);
79
/** \brief Starts the execution of the effect
80
\return Returns whether the effect was executed to completion */
82
/** \brief Cancel the execution of the effect */
84
/** \brief Commit the changes to the document */
86
/** \brief Undoes what the effect completed. */
88
/** \brief Wait for the effect to complete if it hasn't. */
92
void runComplete (void);
93
void createPrefsDialog (Gtk::Widget * controls);
94
void createWorkingDialog (void);
95
void workingCanceled (const int resp);
96
void processingCancel (void);
97
void processingComplete(void);
98
void documentCancel (void);
99
void documentCommit (void);
100
void reselect (void);
101
void genDocCache (void);
102
void killDocCache (void);
105
} } /* namespace Inkscape, Extension */
106
#endif /* INKSCAPE_EXTENSION_EXECUTION_ENV_H__ */
111
c-file-style:"stroustrup"
112
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
117
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :