livepatheffect-editor.cpp revision ae22ad7adc4a7a418e71f5dbab8c1f0f7f464562
/**
* \brief LivePathEffect dialog
*
* Authors:
* Johan Engelen <j.b.c.engelen@utwente.nl>
* Steren Giannini <steren.giannini@gmail.com>
* Bastien Bouclet <bgkweb@gmail.com>
*
* Copyright (C) 2007 Author
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "livepatheffect-editor.h"
#include "verbs.h"
#include "selection.h"
#include "sp-shape.h"
#include "sp-item-group.h"
#include "sp-path.h"
#include "sp-rect.h"
#include "path-chemistry.h"
#include "live_effects/effect.h"
#include "live_effects/lpeobject.h"
#include <vector>
#include "inkscape.h"
#include "desktop-handles.h"
#include "desktop.h"
#include "document-private.h"
#include "xml/document.h"
namespace Inkscape {
class Application;
namespace UI {
namespace Dialog {
/*####################
* Callback functions
*/
{
}
/*#######################
* LivePathEffectEditor
*/
effectapplication_frame(_("Apply new effect")),
effectcontrol_frame(_("Current effect")),
{
// connect callback functions to buttons
}
{
if (effectwidget) {
delete effectwidget;
effectwidget = NULL;
}
if (current_desktop) {
}
}
void
{
if (effectwidget) {
delete effectwidget;
effectwidget = NULL;
}
if (effectwidget) {
}
// fixme: add resizing of dialog
}
void
{
if (effectwidget) {
delete effectwidget;
effectwidget = NULL;
}
// fixme: do resizing of dialog ?
}
void
{
}
void
{
if ( item ) {
if ( SP_IS_LPE_ITEM(item) ) {
set_sensitize_all(true);
if (lpeobj) {
} else {
showText(_("Unknown effect is applied"));
}
} else {
showText(_("No effect applied"));
button_remove.set_sensitive(false);
}
}
else
{
showText(_("Item is not compound by paths"));
set_sensitize_all(false);
}
} else {
showText(_("Only one item can be selected"));
set_sensitize_all(false);
}
} else {
showText(_("Empty selection"));
set_sensitize_all(false);
}
}
void
{
if ( desktop == current_desktop ) {
return;
}
if (current_desktop) {
}
if (desktop) {
} else {
}
}
/*########################################################################
# BUTTON CLICK HANDLERS (callbacks)
########################################################################*/
// TODO: factor out the effect applying code which can be called from anywhere. (selection-chemistry.cpp also needs it)
void
{
if (!data) return;
// If item is a SPRect, convert it to path first:
if ( SP_IS_RECT(item) ) {
sp_selected_path_to_curves(false);
}
// Path effect definition
SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc))->addChild(repr, NULL); // adds to <defs> and assigns the 'id' attribute
}
_("Create and apply path effect"));
}
}
}
void
{
showText(_("No effect applied"));
button_remove.set_sensitive(false);
_("Remove path effect") );
}
}
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape