1 /**
2 * \brief Align and Distribute dialog
3 *
4 * Authors:
5 * Bryce W. Harrington <bryce@bryceharrington.org>
6 * Aubanel MONNIER <aubi@libertysurf.fr>
7 * Frank Felfe <innerspace@iname.com>
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 1999-2004, 2005 Authors
11 *
12 * Released under GNU GPL. Read the file 'COPYING' for more information.
13 */
15 #ifndef INKSCAPE_UI_DIALOG_ALIGN_AND_DISTRIBUTE_H
16 #define INKSCAPE_UI_DIALOG_ALIGN_AND_DISTRIBUTE_H
18 #include <gtkmm/notebook.h>
19 #include <glibmm/i18n.h>
21 #include <list>
22 #include <gtkmm/frame.h>
23 #include <gtkmm/tooltips.h>
24 #include <gtkmm/comboboxtext.h>
25 #include <gtkmm/table.h>
26 #include <gtkmm/buttonbox.h>
27 #include <gtkmm/label.h>
28 #include "libnr/nr-dim2.h"
29 #include "libnr/nr-rect.h"
32 #include "dialog.h"
33 #include "ui/widget/notebook-page.h"
35 using namespace Inkscape::UI::Widget;
38 class SPItem;
40 namespace Inkscape {
41 namespace UI {
42 namespace Dialog {
44 class Action;
47 class AlignAndDistribute : public Dialog {
48 public:
49 AlignAndDistribute();
50 virtual ~AlignAndDistribute();
52 static AlignAndDistribute *create() { return new AlignAndDistribute(); }
54 enum AlignTarget { LAST=0, FIRST, BIGGEST, SMALLEST, PAGE, DRAWING, SELECTION };
56 AlignTarget getAlignTarget() const;
58 Gtk::Table &align_table(){return _alignTable;}
59 Gtk::Table &distribute_table(){return _distributeTable;}
60 Gtk::Table &removeOverlap_table(){return _removeOverlapTable;}
61 Gtk::Table &graphLayout_table(){return _graphLayoutTable;}
62 Gtk::Table &nodes_table(){return _nodesTable;}
63 Gtk::Tooltips &tooltips(){return _tooltips;}
65 std::list<SPItem *>::iterator find_master(std::list <SPItem *> &list, bool horizontal);
66 void setMode(bool nodeEdit);
68 NR::Rect randomize_bbox;
69 bool randomize_bbox_set;
72 protected:
74 void on_ref_change();
75 void addDistributeButton(const Glib::ustring &id, const Glib::ustring tiptext,
76 guint row, guint col, bool onInterSpace,
77 NR::Dim2 orientation, float kBegin, float kEnd);
78 void addAlignButton(const Glib::ustring &id, const Glib::ustring tiptext,
79 guint row, guint col);
80 void addNodeButton(const Glib::ustring &id, const Glib::ustring tiptext,
81 guint col, NR::Dim2 orientation, bool distribute);
82 void addRemoveOverlapsButton(const Glib::ustring &id,
83 const Glib::ustring tiptext,
84 guint row, guint col);
85 void addGraphLayoutButton(const Glib::ustring &id,
86 const Glib::ustring tiptext,
87 guint row, guint col);
88 void addUnclumpButton(const Glib::ustring &id, const Glib::ustring tiptext,
89 guint row, guint col);
90 void addRandomizeButton(const Glib::ustring &id, const Glib::ustring tiptext,
91 guint row, guint col);
92 void addBaselineButton(const Glib::ustring &id, const Glib::ustring tiptext,
93 guint row, guint col, Gtk::Table &table, NR::Dim2 orientation, bool distribute);
95 std::list<Action *> _actionList;
96 Gtk::Frame _alignFrame, _distributeFrame, _removeOverlapFrame, _graphLayoutFrame, _nodesFrame;
97 Gtk::Table _alignTable, _distributeTable, _removeOverlapTable, _graphLayoutTable, _nodesTable;
98 Gtk::HBox _anchorBox;
99 Gtk::VBox _alignBox;
100 Gtk::Label _anchorLabel;
101 Gtk::ComboBoxText _combo;
102 Gtk::Tooltips _tooltips;
104 private:
105 AlignAndDistribute(AlignAndDistribute const &d);
106 AlignAndDistribute& operator=(AlignAndDistribute const &d);
107 };
109 } // namespace Dialog
110 } // namespace UI
111 } // namespace Inkscape
113 #endif // INKSCAPE_UI_DIALOG_ALIGN_AND_DISTRIBUTE_H
115 /*
116 Local Variables:
117 mode:c++
118 c-file-style:"stroustrup"
119 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
120 indent-tabs-mode:nil
121 fill-column:99
122 End:
123 */
124 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :