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.44 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
14
class DockablePane : public Gtk::Box {
15
private:
16
Gtk::Label label;
17
Glib::ustring name;
18
Gtk::Image *icon;
19
DockStack *stack;
20
public:
21
DockablePane(Gtk::Widget &child, const Glib::ustring &name, const Glib::ustring &label, Gtk::Image *icon, DockStack *stack = nullptr, Gtk::Widget *custom_header = nullptr);
22
Glib::ustring get_identifier() const;
23
Gtk::Image *get_icon() const;
24
Gtk::Label *get_label();
25
void redock(DockStack *stack);
26
};
27
28
class LayoutManager : public Glib::ObjectBase {
29
private:
30
std::vector<std::shared_ptr<DockablePane>> panes;
31
public:
32
LayoutManager();
33
34
void add_pane(std::shared_ptr<DockablePane> pane);
35
};
36
37
class DockStack : public Gtk::Stack {
38
private:
39
std::shared_ptr<LayoutManager> layout;
40
public:
41
explicit DockStack(std::shared_ptr<LayoutManager> layout);
42
43
void add(Gtk::Widget &child, const Glib::ustring &name);
44
};
45
46
class DockStackSwitcher : public Gtk::ButtonBox {
47
private:
48
DockStack *stack;
49
public:
50
void update_buttons();
51
explicit DockStackSwitcher(DockStack *stack);
52
};
53
} // namespace gPanthera
54
55
#endif // GPANTHERA_LIBRARY_H