livepatheffect-editor.cpp revision a95be1234ba4df33d6d074589edaa56f0d546069
/**
* \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 "sp-lpe-item.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.h"
#include "live_effects/lpeobject-reference.h"
namespace Inkscape {
class Application;
namespace UI {
namespace Dialog {
/*####################
* Callback functions
*/
{
}
static void lpeeditor_selection_modified (Inkscape::Selection * selection, guint /*flags*/, gpointer data)
{
}
/*#######################
* LivePathEffectEditor
*/
effectapplication_frame(_("Apply new effect")),
effectcontrol_frame(_("Current effect")),
effectlist_frame(_("Effect list")),
{
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
//Only show the scrollbars when they are necessary:
// effectlist_vbox.pack_end(button_hbox, Gtk::PACK_SHRINK);
// button_hbox.pack_start(button_up, true, true);
// button_hbox.pack_start(button_down, true, true);
// button_hbox.pack_end(button_remove, true, true);
// Add toolbar items to toolbar
// Add toolbar
//add_toolbar(toolbar);
//Create the Tree model:
// Handle tree selections
effectlist_selection->signal_changed().connect( sigc::mem_fun(*this, &LivePathEffectEditor::on_effect_selection_changed) );
effectlist_view.set_headers_visible(false);
//Add the TreeView's view columns:
// connect callback functions to buttons
//button_remove.hide();
}
{
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;
}
//button_remove.hide();
// fixme: do resizing of dialog ?
}
void
{
}
void
{
if ( item ) {
if ( SP_IS_LPE_ITEM(item) ) {
set_sensitize_all(true);
if ( sp_lpe_item_has_path_effect(lpeitem) ) {
if (lpe) {
} else {
showText(_("Unknown effect is applied"));
}
} else {
showText(_("No effect applied"));
button_remove.set_sensitive(false);
}
}
else
{
showText(_("Item is not a path or shape"));
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
{
{
}
}
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);
}
}
}
}
void
{
_("Remove path effect") );
}
}
}
void LivePathEffectEditor::onUp()
{
_("Move path effect up") );
}
}
}
void LivePathEffectEditor::onDown()
{
_("Move path effect down") );
}
}
}
{
if (sel->count_selected_rows () == 0)
return;
if (lperef && current_lpeitem) {
}
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
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:encoding=utf-8:textwidth=99 :