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