-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathEngineWindow.h
More file actions
59 lines (49 loc) · 1.48 KB
/
EngineWindow.h
File metadata and controls
59 lines (49 loc) · 1.48 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
#pragma once
#include "EngineThread.h"
#include "utils.h"
struct AlbumInfo;
class ContainerWindow;
class StyleManager;
class GLFWContext {
public:
GLFWContext();
NO_MOVE_NO_COPY(GLFWContext);
~GLFWContext();
private:
static int count;
};
class EngineWindow {
public:
EngineWindow(ContainerWindow& container, StyleManager& styleManager,
ui_element_instance_callback_ptr defaultUiCallback);
void setWindowSize(int width, int height);
void makeContextCurrent();
void swapBuffers();
void onDamage();
void setSelection(metadb_handle_list selection);
private:
void createWindow();
LRESULT messageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam);
bool onChar(WPARAM wParam);
void onMouseClick(UINT uMsg, WPARAM wParam, LPARAM lParam);
void doDragStart(const AlbumInfo& album);
void onClickOnAlbum(const AlbumInfo& album, UINT uMsg);
bool onKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam);
void onWindowSize(int width, int height);
void onScroll(double xoffset, double yoffset);
void onContextMenu(int x, int y);
public:
ContainerWindow& container;
private:
double scrollAggregator = 0;
ui_element_instance_callback_ptr defaultUiCallback;
metadb_handle_list selection;
ui_selection_holder::ptr selectionHolder;
GLFWContext glfwContext;
unique_ptr<GLFWwindow,
std::integral_constant<decltype(&glfwDestroyWindow), glfwDestroyWindow>>
glfwWindow;
public:
HWND hWnd = nullptr;
std::optional<EngineThread> engineThread;
};