-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtabs.h
More file actions
68 lines (54 loc) · 1.34 KB
/
Copy pathtabs.h
File metadata and controls
68 lines (54 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include "widget.h"
#include <GLFW/glfw3.h>
#include "application.h"
struct TabInfo {
int xloc;
icu::UnicodeString title;
int id;
};
struct tagloc {
int start;
int end;
int end_end;
};
struct hit {
bool body = true;
int indx = -1;
};
class Tabs : public Widget {
public:
Tabs(Widget* parent);
App::PosFunction POSITIONER = nullptr;
using TCC = std::function<void(TabInfo info)>;
using ATCC = std::function<void()>;
using ANT = std::function<void()>;
bool rounded = true;
std::vector<TabInfo> tabs_list;
double scrolled_to = 0;
int selected_id = 0;
int max_scroll = 0;
std::vector<tagloc> tab_screen_loc;
TCC tab_clicked_callback = nullptr;
ATCC all_tabs_closed_callback = nullptr;
ATCC add_new_tab_callback = nullptr;
TCC erasing_tab = nullptr;
hit hovering;
bool has_close_button = true;
bool can_add_new = true;
int screen_add_x = 0;
int screen_add_endx = 0;
void addTab(TabInfo info);
void removeTab(int id, int nexttake=-1);
hit hoveringTab();
bool hoveringNewTab();
void nextTab();
// bool on_key_event(int key, int scancode, int action, int mods);
bool on_mouse_button_event(int button, int action, int mods);
bool on_mouse_move_event();
bool on_scroll_event(double xchange, double ychange);
void updateTab(TabInfo info);
void position(int x, int y, int w, int h);
void render();
private:
};