summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter/originalitem.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-02 20:18:59 +0000
committerJabiertxof <jtx@jtx>2017-01-02 20:18:59 +0000
commitea0de461574893c3b21e4653d0185cec501e0efe (patch)
tree14f010634714b3f26ca1b75245c237bafe9e8e85 /src/live_effects/parameter/originalitem.cpp
parentFixing paths (diff)
downloadinkscape-ea0de461574893c3b21e4653d0185cec501e0efe.tar.gz
inkscape-ea0de461574893c3b21e4653d0185cec501e0efe.zip
Remove clone original code
(bzr r15295.1.47)
Diffstat (limited to 'src/live_effects/parameter/originalitem.cpp')
-rw-r--r--src/live_effects/parameter/originalitem.cpp148
1 files changed, 0 insertions, 148 deletions
diff --git a/src/live_effects/parameter/originalitem.cpp b/src/live_effects/parameter/originalitem.cpp
deleted file mode 100644
index 07c8bd27c..000000000
--- a/src/live_effects/parameter/originalitem.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) Johan Engelen 2012 <j.b.c.engelen@alumnus.utwente.nl>
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <gtkmm/box.h>
-#include "live_effects/parameter/originalitem.h"
-
-#include "widgets/icon.h"
-#include <glibmm/i18n.h>
-#include <gtkmm/button.h>
-#include <gtkmm/label.h>
-
-#include "uri.h"
-#include "sp-shape.h"
-#include "sp-text.h"
-#include "display/curve.h"
-#include "live_effects/effect.h"
-
-#include "inkscape.h"
-#include "desktop.h"
-#include "selection.h"
-#include "ui/icon-names.h"
-
-namespace Inkscape {
-
-namespace LivePathEffect {
-
-OriginalItemParam::OriginalItemParam( const Glib::ustring& label, const Glib::ustring& tip,
- const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
- Effect* effect)
- : ItemParam(label, tip, key, wr, effect, "")
-{
-}
-
-OriginalItemParam::~OriginalItemParam()
-{
-
-}
-
-Gtk::Widget *
-OriginalItemParam::param_newWidget()
-{
- Gtk::HBox *_widget = Gtk::manage(new Gtk::HBox());
-
- { // Label
- Gtk::Label *pLabel = Gtk::manage(new Gtk::Label(param_label));
- static_cast<Gtk::HBox*>(_widget)->pack_start(*pLabel, true, true);
- pLabel->set_tooltip_text(param_tooltip);
- }
-
- { // Paste item to link button
- Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) );
- Gtk::Button *pButton = Gtk::manage(new Gtk::Button());
- pButton->set_relief(Gtk::RELIEF_NONE);
- pIcon->show();
- pButton->add(*pIcon);
- pButton->show();
- pButton->signal_clicked().connect(sigc::mem_fun(*this, &OriginalItemParam::on_link_button_click));
- static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
- pButton->set_tooltip_text(_("Link to item"));
- }
-
- { // Select original button
- Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon("edit-select-original", Inkscape::ICON_SIZE_BUTTON) );
- Gtk::Button *pButton = Gtk::manage(new Gtk::Button());
- pButton->set_relief(Gtk::RELIEF_NONE);
- pIcon->show();
- pButton->add(*pIcon);
- pButton->show();
- pButton->signal_clicked().connect(sigc::mem_fun(*this, &OriginalItemParam::on_select_original_button_click));
- static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
- pButton->set_tooltip_text(_("Select original"));
- }
-
- static_cast<Gtk::HBox*>(_widget)->show_all_children();
-
- return dynamic_cast<Gtk::Widget *> (_widget);
-}
-
-void
-OriginalItemParam::param_write(const gchar * iid)
-{
- Glib::ustring itemid(iid);
-
- if (itemid.empty()) {
- return;
- }
- // add '#' at start to make it an uri.
- itemid.insert(itemid.begin(), '#');
- if ( href && strcmp(itemid.c_str(), href) == 0 ) {
- // no change, do nothing
- return;
- } else {
- param_write_to_repr(itemid.c_str());
- }
-}
-
-void
-OriginalItemParam::linked_modified_callback(SPObject *linked_obj, guint /*flags*/)
-{
- if (!inverse) {
- emit_changed();
- LivePathEffectObject* lpeobj = param_effect->getLPEObj();
- SP_OBJECT(lpeobj)->requestModified(SP_OBJECT_MODIFIED_FLAG);
- }
-}
-
-void
-OriginalItemParam::linked_transformed_callback(Geom::Affine const * /*rel_transf*/, SPItem * /*moved_item*/)
-{
-/** \todo find good way to compensate for referenced item transform, like done for normal clones.
- * See sp-use.cpp: sp_use_move_compensate */
-}
-
-
-void
-OriginalItemParam::on_select_original_button_click()
-{
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- SPItem *original = ref.getObject();
- if (desktop == NULL || original == NULL) {
- return;
- }
- Inkscape::Selection *selection = desktop->getSelection();
- selection->clear();
- selection->set(original);
-}
-
-} /* namespace LivePathEffect */
-
-} /* 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 :