GTK docking interfaces and more

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 gpanthera.hh

View raw Download
text/x-c++ • 1.79 kiB
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
15
class DockablePane : public Gtk::Box {
16
private:
17
Gtk::Label label;
18
Glib::ustring name;
19
Gtk::Image *icon;
20
DockStack *stack;
21
DockWindow *window = nullptr;
22
Gtk::HeaderBar *header;
23
Gtk::Widget *child;
24
public:
25
DockablePane(Gtk::Widget &child, const Glib::ustring &name, const Glib::ustring &label, Gtk::Image *icon, DockStack *stack = nullptr, Gtk::Widget *custom_header = nullptr);
26
Glib::ustring get_identifier() const;
27
Gtk::Image *get_icon() const;
28
Gtk::Label *get_label();
29
void redock(DockStack *stack);
30
void pop_out();
31
Gtk::HeaderBar *get_header() const;
32
Gtk::Widget *get_child() const;
33
};
34
35
class DockWindow : public Gtk::Window {
36
private:
37
DockablePane *pane;
38
public:
39
explicit DockWindow(DockablePane *pane);
40
};
41
42
class LayoutManager : public Glib::ObjectBase {
43
private:
44
std::vector<DockablePane*> panes;
45
public:
46
LayoutManager();
47
48
void add_pane(DockablePane *pane);
49
};
50
51
class DockStack : public Gtk::Stack {
52
private:
53
std::shared_ptr<LayoutManager> layout;
54
public:
55
explicit DockStack(std::shared_ptr<LayoutManager> layout);
56
57
void add_pane(Gtk::Widget &child, const Glib::ustring &name);
58
};
59
60
class DockStackSwitcher : public Gtk::ButtonBox {
61
private:
62
DockStack *stack;
63
public:
64
void update_buttons();
65
explicit DockStackSwitcher(DockStack *stack);
66
};
67
} // namespace gPanthera
68
69
#endif // GPANTHERA_LIBRARY_H