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 &nodes_table(){return _nodesTable;}
62 Gtk::Tooltips &tooltips(){return _tooltips;}
64 std::list<SPItem *>::iterator find_master(std::list <SPItem *> &list, bool horizontal);
65 void setMode(bool nodeEdit);
67 NR::Rect randomize_bbox;
68 bool randomize_bbox_set;
71 protected:
73 void on_ref_change();
74 void addDistributeButton(const Glib::ustring &id, const Glib::ustring tiptext,
75 guint row, guint col, bool onInterSpace,
76 NR::Dim2 orientation, float kBegin, float kEnd);
77 void addAlignButton(const Glib::ustring &id, const Glib::ustring tiptext,
78 guint row, guint col);
79 void addNodeButton(const Glib::ustring &id, const Glib::ustring tiptext,
80 guint col, NR::Dim2 orientation, bool distribute);
81 void addRemoveOverlapsButton(const Glib::ustring &id,
82 const Glib::ustring tiptext,
83 guint row, guint col);
84 void addUnclumpButton(const Glib::ustring &id, const Glib::ustring tiptext,
85 guint row, guint col);
86 void addRandomizeButton(const Glib::ustring &id, const Glib::ustring tiptext,
87 guint row, guint col);
88 void addBaselineButton(const Glib::ustring &id, const Glib::ustring tiptext,
89 guint row, guint col, Gtk::Table &table, NR::Dim2 orientation, bool distribute);
91 std::list<Action *> _actionList;
92 Gtk::Frame _alignFrame, _distributeFrame, _removeOverlapFrame, _nodesFrame;
93 Gtk::Table _alignTable, _distributeTable, _removeOverlapTable, _nodesTable;
94 Gtk::HBox _anchorBox;
95 Gtk::VBox _alignBox;
96 Gtk::Label _anchorLabel;
97 Gtk::ComboBoxText _combo;
98 Gtk::Tooltips _tooltips;
100 private:
101 AlignAndDistribute(AlignAndDistribute const &d);
102 AlignAndDistribute& operator=(AlignAndDistribute const &d);
103 };
105 } // namespace Dialog
106 } // namespace UI
107 } // namespace Inkscape
109 #endif // INKSCAPE_UI_DIALOG_ALIGN_AND_DISTRIBUTE_H
111 /*
112 Local Variables:
113 mode:c++
114 c-file-style:"stroustrup"
115 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
116 indent-tabs-mode:nil
117 fill-column:99
118 End:
119 */
120 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :