effect.cpp revision 70ca1c6d6d56358edcb0762fabaf27943da42ab3
/*
* Authors:
* Ted Gould <ted@gould.cx>
*
* Copyright (C) 2002-2006 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "inkscape-private.h"
#include "document.h"
#include "prefdialog.h"
#include "implementation/implementation.h"
#include "effect.h"
#include "gtkmm/messagedialog.h"
/* Inkscape::Extension::Effect */
namespace Inkscape {
namespace Extension {
{
// This is a weird hack
return;
bool hidden = false;
no_doc = false;
no_doc = true;
}
for (Inkscape::XML::Node *effect_child = sp_repr_children(child); effect_child != NULL; effect_child = effect_child->next()) {
// printf("Found local effects menu in %s\n", this->get_name());
hidden = true;
}
}
// printf("Found local effects menu in %s\n", this->get_name());
}
// printf("Found local effects menu in %s\n", this->get_name());
}
} // children of "effect"
break; // there can only be one effect
} // find "effect"
} // children of "inkscape-extension"
} // if we have an XML file
}
if (_effects_list != NULL) {
if (!hidden)
}
return;
}
void
/* printf("Merge menu with '%s' '%s' '%s'\n",
base != NULL ? base->name() : "NULL",
patern != NULL ? patern->name() : "NULL",
mergee != NULL ? mergee->name() : "NULL"); */
// Merge the verb name
} else {
}
int position = -1;
continue;
}
if (compare_char == NULL)
}
/* This will cause us to skip tags we don't understand */
if (compare_char == NULL) {
continue;
}
break;
}
break;
}
} // for menu items
} // start != NULL
if (position != -1)
}
}
return;
}
{
if (get_last_effect() == this)
return;
}
bool
{
/** \todo Check to see if parent has this as its only child,
if so, delete it too */
if (_menu_node != NULL)
_menu_node = NULL;
return false;
}
return true;
}
class ExecutionEnv {
private:
bool _prefsVisible;
bool _finished;
bool _humanWait;
bool _canceled;
public:
void run (void);
_prefsVisible(false),
_finished(false),
_humanWait(false),
_canceled(false),
} else {
}
return;
}
~ExecutionEnv (void) {
if (_visibleDialog != NULL) {
delete _visibleDialog;
}
return;
}
void preferencesChange (void) {
if (_humanWait) {
_humanWait = false;
} else {
}
return;
}
private:
if (_visibleDialog != NULL) {
delete _visibleDialog;
}
_visibleDialog->show();
_prefsVisible = true;
return;
}
void createWorkingDialog (void) {
if (_visibleDialog != NULL) {
delete _visibleDialog;
}
gchar * dlgmessage = g_strdup_printf(_("The effect '%s' is working on your document. Please wait."), _effect->get_name());
false, // use markup
true); // modal
_visibleDialog->show();
_prefsVisible = false;
return;
}
void workingCanceled (const int resp) {
_finished = true;
return;
}
void preferencesResponse (const int resp) {
if (_humanWait) {
_finished = true;
} else {
}
} else {
if (_humanWait) {
} else {
}
_finished = true;
}
return;
}
void processingComplete(void) {
if (_prefsVisible) {
_humanWait = true;
} else {
_finished = true;
}
return;
}
void processingCancel (void) {
return;
}
void documentCancel (void) {
_canceled = true;
return;
}
void documentCommit (void) {
return;
}
};
void
ExecutionEnv::run (void) {
while (!_finished) {
_canceled = false;
if (_humanWait) {
} else {
}
if (_canceled) {
}
}
return;
}
bool
{
if (!loaded())
if (!loaded()) return false;
// std::cout << "No preferences for Effect" << std::endl;
return true;
}
//changeSignal.connect(sigc::mem_fun(executionEnv, &ExecutionEnv::preferencesChange));
executionEnv.run();
return true;
}
/**
\brief The function that 'does' the effect itself
\param doc The Inkscape::UI::View::View to do the effect on
This function first insures that the extension is loaded, and if not,
loads it. It then calls the implemention to do the actual work. It
also resets the last effect pointer to be this effect. Finally, it
executes a \c sp_document_done to commit the changes to the undo
stack.
*/
void
{
if (!loaded())
if (!loaded()) return;
executionEnv.run();
return;
}
/** \brief Sets which effect was called last
\param in_effect The effect that has been called
This function sets the static variable \c _last_effect and it
ensures that the last effect verb is sensitive.
If the \c in_effect variable is \c NULL then the last effect
verb is made insesitive.
*/
void
{
} else if (_last_effect == NULL) {
}
return;
}
#define EFFECTS_LIST "effects-list"
bool
{
if (menustruct == NULL) return false;
return true;
}
if (firstchild != NULL)
if (find_effects_list(firstchild))
return true;
}
return false;
}
Effect::get_info_widget(void)
{
return Extension::get_info_widget();
}
/** \brief Create an action for a \c EffectVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Decode the verb code and take appropriate action */
void
{
// SPDocument * current_document = current_view->doc;
if (current_view == NULL) return;
if (ev->_showPrefs) {
} else {
}
return;
}
/**
* Action vector to define functions called if a staticly defined file verb
* is called.
*/
} } /* 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 :