~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/ui/widget/dock.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
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
    Gtk::Paned *getPaned();
 
41
 
 
42
    GtkWidget* getGdlWidget();    //< return the top gdl widget
 
43
 
 
44
    bool isEmpty() const;         //< true iff none of the dock's items are in a docked state
 
45
    bool hasIconifiedItems() const;
 
46
 
 
47
    Glib::SignalProxy0<void> signal_layout_changed();
 
48
 
 
49
    void hide();
 
50
    void show();
 
51
 
 
52
    /** Toggle size of dock between the previous dimensions and the ones sent as parameters */
 
53
    void toggleDockable(int width=0, int height=0);
 
54
 
 
55
    /** Scrolls the scrolled window container to make the provided dock item visible, if needed */
 
56
    void scrollToItem(DockItem& item);
 
57
 
 
58
protected:
 
59
 
 
60
    std::list<const DockItem *> _dock_items;   //< added dock items
 
61
 
 
62
    /** Interface widgets, will be packed like 
 
63
     * _scrolled_window -> (_dock_box -> (_paned -> (_dock -> _filler) | _dock_bar))
 
64
     */
 
65
    Gtk::Box *_dock_box;
 
66
    Gtk::Paned* _paned;
 
67
    GdlDock *_gdl_dock;
 
68
    GdlDockBar *_gdl_dock_bar;
 
69
    Gtk::VBox _filler;
 
70
    Gtk::ScrolledWindow *_scrolled_window;
 
71
 
 
72
    /** Internal signal handlers */
 
73
    void _onLayoutChanged();
 
74
    void _onPanedButtonEvent(GdkEventButton *event);
 
75
 
 
76
    static gboolean _on_paned_button_event(GtkWidget *widget, GdkEventButton *event, 
 
77
                                           gpointer user_data);
 
78
 
 
79
    /** GdlDock signal proxy structures */
 
80
    static const Glib::SignalProxyInfo _signal_layout_changed_proxy;
 
81
 
 
82
    /** Standard widths */
 
83
    static const int _default_empty_width;
 
84
    static const int _default_dock_bar_width;
 
85
};
 
86
 
 
87
} // namespace Widget
 
88
} // namespace UI
 
89
} // namespace Inkscape
 
90
 
 
91
#endif //INKSCAPE_UI_DIALOG_BEHAVIOUR_H
 
92
 
 
93
/*
 
94
  Local Variables:
 
95
  mode:c++
 
96
  c-file-style:"stroustrup"
 
97
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
98
  indent-tabs-mode:nil
 
99
  fill-column:99
 
100
  End:
 
101
*/
 
102
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 
 
103