gpanthera.hh
C++ source, ASCII text
1
#ifndef GPANTHERA_LIBRARY_H
2
#define GPANTHERA_LIBRARY_H
3
4
#include <gtkmm.h>
5
#include <glibmm.h>
6
#include <glibmm/ustring.h>
7
#include <utility>
8
#include <vector>
9
#include <memory>
10
11
namespace gPanthera {
12
class DockStack;
13
class DockWindow;
14
class LayoutManager;
15
16
class DockablePane : public Gtk::Box {
17
private:
18
Gtk::Label label;
19
Glib::ustring name;
20
Gtk::Image *icon;
21
DockStack *stack;
22
DockWindow *window = nullptr;
23
std::unique_ptr<Gtk::HeaderBar> header;
24
Gtk::Widget *child;
25
std::shared_ptr<LayoutManager> layout;
26
public:
27
DockablePane(std::shared_ptr<LayoutManager> layout, Gtk::Widget &child, const Glib::ustring &name, const Glib::ustring &label, Gtk::Image *icon, DockStack *stack = nullptr, Gtk::Widget *custom_header = nullptr);
28
Glib::ustring get_identifier() const;
29
Gtk::Image *get_icon() const;
30
Gtk::Label *get_label();
31
void redock(DockStack *stack);
32
void pop_out();
33
Gtk::Widget *get_child() const;
34
};
35
36
class DockWindow : public Gtk::Window {
37
private:
38
DockablePane *pane;
39
public:
40
explicit DockWindow(DockablePane *pane);
41
};
42
43
class LayoutManager : public Glib::ObjectBase {
44
private:
45
std::vector<DockablePane*> panes;
46
public:
47
std::vector<DockStack*> stacks;
48
LayoutManager();
49
50
void add_pane(DockablePane *pane);
51
52
void add_stack(DockStack *stack);
53
};
54
55
class DockStack : public Gtk::Stack {
56
private:
57
std::shared_ptr<LayoutManager> layout;
58
public:
59
Glib::ustring name;
60
explicit DockStack(std::shared_ptr<LayoutManager> layout, const Glib::ustring &name);
61
62
void add_pane(DockablePane &child);
63
};
64
65
class DockStackSwitcher : public Gtk::ButtonBox {
66
private:
67
DockStack *stack;
68
public:
69
void update_buttons();
70
explicit DockStackSwitcher(DockStack *stack);
71
};
72
} // namespace gPanthera
73
74
#endif // GPANTHERA_LIBRARY_H