e931e3b39c84aeb62be9a0088724966352810ebf
2 #ifndef SEEN_LAYERS_PANEL_H
3 #define SEEN_LAYERS_PANEL_H
4 /*
5 * A simple dialog for layer UI.
6 *
7 * Authors:
8 * Jon A. Cruz
9 *
10 * Copyright (C) 2006 Jon A. Cruz
11 *
12 * Released under GNU GPL, read the file 'COPYING' for more information
13 */
15 #include <gtkmm/treeview.h>
16 #include <gtkmm/treestore.h>
17 #include <gtkmm/tooltips.h>
19 #include "ui/widget/panel.h"
20 //#include "ui/previewholder.h"
22 class SPObject;
24 namespace Inkscape {
26 class LayerManager;
28 namespace UI {
29 namespace Dialogs {
32 /**
33 * A panel that displays layers.
34 */
35 class LayersPanel : public Inkscape::UI::Widget::Panel
36 {
37 public:
38 LayersPanel();
39 virtual ~LayersPanel();
41 static LayersPanel& getInstance();
42 //virtual void setOrientation( Gtk::AnchorType how );
44 void setDesktop( SPDesktop* desktop );
46 protected:
47 //virtual void _handleAction( int setId, int itemId );
49 private:
50 class ModelColumns;
52 LayersPanel(LayersPanel const &); // no copy
53 LayersPanel &operator=(LayersPanel const &); // no assign
55 static LayersPanel* instance;
57 void _styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned int code, char const* fallback );
58 void _fireAction( unsigned int code );
60 void _toggled( Glib::ustring const& str, int targetCol );
62 void _checkTreeSelection();
64 void _takeAction( int val );
66 void _selectLayer(SPObject *layer);
67 bool _checkForSelected(const Gtk::TreePath& path, const Gtk::TreeIter& iter, SPObject* layer);
69 void _layersChanged();
71 SPObject* _selectedLayer();
73 // Hooked to the desktop:
74 sigc::connection _layerChangedConnection;
76 // Hooked to the layer manager:
77 sigc::connection _changedConnection;
78 sigc::connection _addedConnection;
79 sigc::connection _removedConnection;
81 Inkscape::LayerManager* _mgr;
82 SPDesktop* _desktop;
83 ModelColumns* _model;
84 Glib::RefPtr<Gtk::TreeStore> _store;
85 std::vector<Gtk::Button*> _watching;
87 Gtk::Tooltips _tips;
88 Gtk::TreeView _tree;
89 Gtk::HBox _buttonsRow;
90 };
94 } //namespace Dialogs
95 } //namespace UI
96 } //namespace Inkscape
100 #endif // SEEN_LAYERS_PANEL_H
102 /*
103 Local Variables:
104 mode:c++
105 c-file-style:"stroustrup"
106 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
107 indent-tabs-mode:nil
108 fill-column:99
109 End:
110 */
111 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :