~inkscape.dev/inkscape/trunk

« back to all changes in this revision

Viewing changes to src/ui/widget/dock.h

  • Committer: gustav_b
  • Date: 2007-08-29 21:27:07 UTC
  • Revision ID: gustav_b@users.sourceforge.net-20070829212707-xvg87a2oqejqioxv
Dockable dialogs patch applied 
(https://sourceforge.net/tracker/?func=detail&atid=604308&aid=1688508&group_id=93438)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \brief A desktop dock pane to dock dialogs, a custom wrapper around gdl-dock.
 
3
 *
 
4
 * Author:
 
5
 *   Gustav Broberg <broberg@kth.se>
 
6
 *
 
7
 * Copyright (C) 2007 Authors
 
8
 *
 
9
 * Released under GNU GPL.  Read the file 'COPYING' for more information.
 
10
 */
 
11
 
 
12
#ifndef INKSCAPE_UI_WIDGET_DOCK_H
 
13
#define INKSCAPE_UI_WIDGET_DOCK_H
 
14
 
 
15
#include <gtkmm/scrolledwindow.h>
 
16
#include <gtkmm/box.h>
 
17
#include <gtkmm/paned.h>
 
18
 
 
19
#include <list>
 
20
 
 
21
#include "ui/widget/dock-item.h"
 
22
 
 
23
#include "libgdl/libgdl.h"
 
24
 
 
25
namespace Inkscape {
 
26
namespace UI {
 
27
namespace Widget {
 
28
 
 
29
class Dock {
 
30
 
 
31
public:
 
32
 
 
33
    Dock(Gtk::Orientation orientation=Gtk::ORIENTATION_VERTICAL);
 
34
    ~Dock();
 
35
 
 
36
    void addItem(DockItem& item, DockItem::Placement placement);
 
37
 
 
38
    Gtk::Widget& getWidget();     //< return the top widget
 
39
    Gtk::Paned *getParentPaned();
 
40
 
 
41
    Gtk::Paned *getPaned();
 
42
 
 
43
    bool isEmpty() const;     //< true iff none of the dock's items are in state != UNATTACHED
 
44
    bool hasIconifiedItems() const;
 
45
 
 
46
    Glib::SignalProxy0<void> signal_layout_changed();
 
47
 
 
48
    void hide();
 
49
    void show();
 
50
 
 
51
    /** Toggle size of dock between the previous dimensions and the ones sent as parameters */
 
52
    void toggleDockable(int width=0, int height=0);
 
53
 
 
54
protected:
 
55
 
 
56
    std::list<const DockItem *> _dock_items;   //< added dock items
 
57
 
 
58
    /** Interface widgets, will be packed like 
 
59
     * _scrolled_window -> (_dock_box -> (_paned -> (_dock -> _filler) | _dock_bar))
 
60
     */
 
61
    Gtk::Box *_dock_box;
 
62
    Gtk::Paned* _paned;
 
63
    GdlDock *_gdl_dock;
 
64
    GdlDockBar *_gdl_dock_bar;
 
65
    Gtk::VBox _filler;
 
66
    Gtk::ScrolledWindow *_scrolled_window;
 
67
 
 
68
    /** Internal signal handlers */
 
69
    void _onLayoutChanged();
 
70
 
 
71
    void _onFoo();
 
72
 
 
73
    /** GdlDock signal proxy structures */
 
74
    static const Glib::SignalProxyInfo _signal_layout_changed_proxy;
 
75
 
 
76
    /** Standard widths */
 
77
    static const int _default_empty_width;
 
78
    static const int _default_dock_bar_width;
 
79
};
 
80
 
 
81
} // namespace Widget
 
82
} // namespace UI
 
83
} // namespace Inkscape
 
84
 
 
85
#endif //INKSCAPE_UI_DIALOG_BEHAVIOUR_H
 
86
 
 
87
/*
 
88
  Local Variables:
 
89
  mode:c++
 
90
  c-file-style:"stroustrup"
 
91
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
92
  indent-tabs-mode:nil
 
93
  fill-column:99
 
94
  End:
 
95
*/
 
96
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 
 
97