execution-env.cpp revision 6dcce791a11745b50ce3986cfd87192d8afcf37d
/*
* Authors:
* Ted Gould <ted@gould.cx>
* Abhishek Sharma
*
* Copyright (C) 2007-2008 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <config.h>
#include "gtkmm/messagedialog.h"
#include "execution-env.h"
#include "prefdialog.h"
#include "implementation/implementation.h"
#include "selection.h"
#include "effect.h"
#include "document.h"
#include "desktop.h"
#include "sp-namedview.h"
#include "desktop-handles.h"
#include "display/sp-canvas.h"
#include "util/glib-list-iterators.h"
namespace Inkscape {
namespace Extension {
/** \brief Create an execution environment that will allow the effect
to execute independently.
\param effect The effect that we should execute
\param doc The Document to execute on
\param docCache The cache created for that document
\param show_working Show the working dialog
\param show_error Show the error dialog (not working)
Grabs the selection of the current document so that it can get
restored. Will generate a document cache if one isn't provided.
*/
ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Implementation::ImplementationDocumentCache * docCache, bool show_working, bool show_errors) :
{
//std::cout << "Selected: " << selected_id << std::endl;
++selected;
}
}
genDocCache();
return;
}
/** \brief Destroy an execution environment
Destroys the dialog if created and the document cache.
*/
ExecutionEnv::~ExecutionEnv (void) {
if (_visibleDialog != NULL) {
_visibleDialog->hide();
delete _visibleDialog;
}
killDocCache();
return;
}
/** \brief Generate a document cache if needed
If there isn't one we create a new one from the implementation
from the effect's implementation.
*/
void
ExecutionEnv::genDocCache (void) {
// printf("Gen Doc Cache\n");
}
return;
}
/** \brief Destory a document cache
Just delete it.
*/
void
ExecutionEnv::killDocCache (void) {
// printf("Killed Doc Cache\n");
delete _docCache;
}
return;
}
/** \brief Create the working dialog
Builds the dialog with a message saying that the effect is working.
And make sure to connect to the cancel.
*/
void
ExecutionEnv::createWorkingDialog (void) {
if (_visibleDialog != NULL) {
_visibleDialog->hide();
delete _visibleDialog;
}
return;
false, // use markup
true); // modal
_visibleDialog->show();
}
return;
}
void
cancel();
undo();
return;
}
void
ExecutionEnv::cancel (void) {
return;
}
void
ExecutionEnv::undo (void) {
reselect();
return;
}
void
ExecutionEnv::commit (void) {
killDocCache();
return;
}
void
ExecutionEnv::reselect (void) {
}
}
return;
}
void
ExecutionEnv::run (void) {
if (_show_working) {
}
// _runComplete.signal();
return;
}
void
ExecutionEnv::runComplete (void) {
}
bool
ExecutionEnv::wait (void) {
if (_mainloop) {
}
conn.disconnect();
}
return true;
}
} } /* namespace Inkscape, Extension */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :