Code

Warning cleanup
[inkscape.git] / src / ui / dialog / align-and-distribute.h
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(Behavior::BehaviorFactory behavior_factory);
50     virtual ~AlignAndDistribute();
52     static AlignAndDistribute *create(Behavior::BehaviorFactory behavior_factory) 
53     { return new AlignAndDistribute(behavior_factory); }
55     enum AlignTarget { LAST=0, FIRST, BIGGEST, SMALLEST, PAGE, DRAWING, SELECTION };
57     AlignTarget getAlignTarget() const;
59     Gtk::Table &align_table(){return _alignTable;}
60     Gtk::Table &distribute_table(){return _distributeTable;}
61     Gtk::Table &removeOverlap_table(){return _removeOverlapTable;}
62     Gtk::Table &graphLayout_table(){return _graphLayoutTable;}
63     Gtk::Table &nodes_table(){return _nodesTable;}
64     Gtk::Tooltips &tooltips(){return _tooltips;}
66     std::list<SPItem *>::iterator find_master(std::list <SPItem *> &list, bool horizontal);
67     void setMode(bool nodeEdit);
69     NR::Maybe<NR::Rect> randomize_bbox;
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 addGraphLayoutButton(const Glib::ustring &id,
85                         const Glib::ustring tiptext,
86                         guint row, guint col);
87     void addUnclumpButton(const Glib::ustring &id, const Glib::ustring tiptext, 
88                         guint row, guint col);
89     void addRandomizeButton(const Glib::ustring &id, const Glib::ustring tiptext, 
90                         guint row, guint col);
91     void addBaselineButton(const Glib::ustring &id, const Glib::ustring tiptext,
92                            guint row, guint col, Gtk::Table &table, NR::Dim2 orientation, bool distribute);
94     std::list<Action *> _actionList;
95     Gtk::Frame _alignFrame, _distributeFrame, _removeOverlapFrame, _graphLayoutFrame, _nodesFrame;
96     Gtk::Table _alignTable, _distributeTable, _removeOverlapTable, _graphLayoutTable, _nodesTable;
97     Gtk::HBox _anchorBox;
98     Gtk::VBox _alignBox;
99     Gtk::Label _anchorLabel;
100     Gtk::ComboBoxText _combo;
101     Gtk::Tooltips _tooltips;
103 private:
104     AlignAndDistribute(AlignAndDistribute const &d);
105     AlignAndDistribute& operator=(AlignAndDistribute const &d);
106 };
108 } // namespace Dialog
109 } // namespace UI
110 } // namespace Inkscape
112 #endif // INKSCAPE_UI_DIALOG_ALIGN_AND_DISTRIBUTE_H
114 /*
115   Local Variables:
116   mode:c++
117   c-file-style:"stroustrup"
118   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
119   indent-tabs-mode:nil
120   fill-column:99
121   End:
122 */
123 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :