livepatheffect-editor.cpp revision baa9faf854a038d179471dbf1bbc53b90beca2e1
/**
* \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 "ui/widget/imagetoggler.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
*/
lpe_list_locked(false),
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:
effectlist_view.set_headers_visible(false);
// Handle tree selections
effectlist_selection->signal_changed().connect( sigc::mem_fun(*this, &LivePathEffectEditor::on_effect_selection_changed) );
//Add the visibility icon column:
Inkscape::UI::Widget::ImageToggler *eyeRenderer = manage( new Inkscape::UI::Widget::ImageToggler("visible", "hidden") );
eyeRenderer->signal_toggled().connect( sigc::mem_fun(*this, &LivePathEffectEditor::on_visibility_toggled) );
eyeRenderer->property_activatable() = true;
if ( col ) {
}
//Add the effect name column:
// 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
{
}
}
void
{
if (effectwidget) {
delete effectwidget;
effectwidget = NULL;
}
//button_remove.hide();
// fixme: do resizing of dialog ?
}
void
{
}
void
{
if (lpe_list_locked) {
// this was triggered by selecting a row in the list, so skip reloading
lpe_list_locked = false;
return;
}
if ( item ) {
if ( SP_IS_LPE_ITEM(item) ) {
set_sensitize_all(true);
if ( sp_lpe_item_has_path_effect(lpeitem) ) {
if (lpe) {
lpe_list_locked = true;
} 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);
}
}
/*
* First clears the effectlist_store, then appends all effects from the effectlist.
*/
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) ) {
}
_("Create and apply path effect"));
}
}
}
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) {
lpe_list_locked = true; // prevent reload of the list which would lose selection
}
}
{
if ( lpeobjref ) {
/* FIXME: this explicit writing to SVG is wrong. The lpe_item should have a method to disable/enable an effect within its stack.
* So one can call: lpe_item->setActive(lpeobjref->lpeobject); */
}
}
} // 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 :