align-and-distribute.cpp revision 52cad88e59adf0342e9294b9249b96bffe8fbe9e
919N/A#ifdef HAVE_CONFIG_H
919N/A#include "align-and-distribute.h"
919N/A#include "ui/widget/spinbutton.h"
919N/A#include "desktop-handles.h"
919N/A#include "document.h"
919N/A#include "graphlayout.h"
919N/A#include "inkscape.h"
469N/A#include "preferences.h"
1068N/A#include "removeoverlap.h"
469N/A#include "selection.h"
469N/A#include "sp-flowtext.h"
469N/A#include "sp-item-transform.h"
469N/A#include "text-editing.h"
469N/A#include "tools-switch.h"
469N/A#include "ui/icon-names.h"
1233N/A#include "ui/tools/node-tool.h"
1233N/A#include "ui/tool/multi-path-manipulator.h"
1233N/A#include "util/glib-list-iterators.h"
469N/A#include "document-undo.h"
469N/A Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( _id, Inkscape::ICON_SIZE_LARGE_TOOLBAR) );
469N/A selected.insert<GSListConstIterator<SPItem *> >(selected.end(), selection->itemList(), NULL);
469N/A if (sel_as_group)
469N/A if (!sel_as_group)
469N/ABBoxSort::BBoxSort(SPItem *pItem, Geom::Rect const &bounds, Geom::Dim2 orientation, double kBegin, double kEnd) :
469N/A bool onInterSpace,
469N/A virtual void on_button_click() {
469N/A selected.insert<GSListConstIterator<SPItem *> >(selected.end(), selection->itemList(), NULL);
469N/A Geom::OptRect bbox = !prefs_bbox ? (*it)->desktopVisualBounds() : (*it)->desktopGeometricBounds();
469N/A int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED);
469N/A if (_onInterSpace)
469N/A bool _onInterSpace;
469N/A bool _distribute;
469N/A virtual void on_button_click() {
469N/A if (_distribute) {
469N/A removeOverlapXGap.set_tooltip_text(_("Minimum horizontal gap (in px units) between bounding boxes"));
469N/A removeOverlapYGap.set_tooltip_text(_("Minimum vertical gap (in px units) between bounding boxes"));
469N/A dialog.removeOverlap_table().attach(removeOverlapXGapLabel, column, column+1, row, row+1, Gtk::FILL, Gtk::FILL);
469N/A dialog.removeOverlap_table().attach(removeOverlapXGap, column+1, column+2, row, row+1, Gtk::FILL, Gtk::FILL);
469N/A dialog.removeOverlap_table().attach(removeOverlapYGapLabel, column+2, column+3, row, row+1, Gtk::FILL, Gtk::FILL);
469N/A dialog.removeOverlap_table().attach(removeOverlapYGap, column+3, column+4, row, row+1, Gtk::FILL, Gtk::FILL);
469N/A virtual void on_button_click()
469N/A int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED);
469N/A DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
469N/A virtual void on_button_click()
469N/A int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED);
469N/A DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
1233N/A return (a->isSiblingOf(b));
469N/A virtual void on_button_click()
1233N/A selected.insert<GSListConstIterator<SPItem *> >(selected.end(), selection->itemList(), NULL);
469N/A int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED);
469N/A DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
469N/A virtual void on_button_click()
469N/A int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED);
virtual void on_button_click()
if (!desktop) return;
if (!selection) return;
if (!sel_bbox) {
int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED);
++it)
Geom::OptRect item_box = !prefs_bbox ? (*it)->desktopVisualBounds() : (*it)->desktopGeometricBounds();
if (item_box) {
g_random_double_range (0, (*_dialog.randomize_bbox)[Geom::X].extent() - (*item_box)[Geom::X].extent());
g_random_double_range (0, (*_dialog.randomize_bbox)[Geom::Y].extent() - (*item_box)[Geom::Y].extent());
struct Baselines
#if WITH_GTKMM_3_0
bool _distribute;
virtual void on_button_click()
if (!desktop) return;
if (!selection) return;
++it)
if (pt) {
bool changed = false;
if (_distribute) {
changed = true;
if (changed) {
++it)
if (pt) {
changed = true;
if (changed) {
#if WITH_GTKMM_3_0
_alignTable(),
_nodesTable(),
0, Geom::X, false);
_toolChangeConn = INKSCAPE->signal_eventcontext_set.connect(sigc::hide<0>(sigc::bind(sigc::ptr_fun(&on_tool_changed), this)));
_selChangeConn = INKSCAPE->signal_selection_changed.connect(sigc::hide<0>(sigc::bind(sigc::ptr_fun(&on_selection_changed), this)));
_desktopChangeConn = _deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &AlignAndDistribute::setDesktop) );
delete *it;
on_tool_changed (this);
new ActionAlign(
new ActionDistribute(
new ActionNode(
void AlignAndDistribute::addRemoveOverlapsButton(const Glib::ustring &id, const Glib::ustring tiptext,
new ActionRemoveOverlaps(
new ActionGraphLayout(
void AlignAndDistribute::addExchangePositionsButton(const Glib::ustring &id, const Glib::ustring tiptext,
void AlignAndDistribute::addExchangePositionsByZOrderButton(const Glib::ustring &id, const Glib::ustring tiptext,
void AlignAndDistribute::addExchangePositionsClockwiseButton(const Glib::ustring &id, const Glib::ustring tiptext,
new ActionUnclump(
new ActionRandomize(
#if WITH_GTKMM_3_0
new ActionBaseline(