diff options
Diffstat (limited to 'src/helper/action-context.h')
| -rw-r--r-- | src/helper/action-context.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/helper/action-context.h b/src/helper/action-context.h index de09f94f4..3a7a19112 100644 --- a/src/helper/action-context.h +++ b/src/helper/action-context.h @@ -12,6 +12,7 @@ #ifndef SEEN_INKSCAPE_ACTION_CONTEXT_H #define SEEN_INKSCAPE_ACTION_CONTEXT_H +class SPDesktop; class SPDocument; namespace Inkscape { @@ -30,6 +31,12 @@ class View; Inkscape::UI::View::View. Actions that do require GUI objects should check to see if the relevant pointers are NULL before attempting to use them. + + TODO: we store a UI::View::View* because that's what the actions and verbs + used to take as parameters in their methods. Why is this? They almost + always seemed to cast straight to an SPDesktop* - so shouldn't we actually + be storing an SPDesktop*? Is there a case where a non-SPDesktop + UI::View::View is used by the actions? ActionContext is designed to be copyable, so it may be used with stack storage if required. */ @@ -60,6 +67,10 @@ public: /** Get the view for the action context. May be NULL. Guaranteed to be NULL if running in console mode. */ UI::View::View *getView() const; + + /** Get the desktop for the action context. May be NULL. Guaranteed to be + NULL if running in console mode. */ + SPDesktop *getDesktop() const; }; } // namespace Inkscape |
