-
Notifications
You must be signed in to change notification settings - Fork 2
/
HaikuXdgToplevel.h
63 lines (54 loc) · 2.01 KB
/
HaikuXdgToplevel.h
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
#pragma once
#include "XdgShell.h"
#include <Rect.h>
struct HaikuXdgSurface;
class WaylandWindow;
class BWindow;
class HaikuXdgToplevel: public XdgToplevel {
private:
friend class HaikuSurface;
friend class HaikuXdgSurface;
friend class WaylandWindow;
friend class XdgSurfaceHook;
HaikuXdgSurface *fXdgSurface{};
WaylandWindow *fWindow{};
bool fSizeLimitsDirty = false;
int32_t fMinWidth = 0, fMinHeight = 0;
int32_t fMaxWidth = 0, fMaxHeight = 0;
int32_t fWidth = 0;
int32_t fHeight = 0;
BRect fSavedPos;
union {
struct {
uint32_t maximized: 1;
uint32_t fullscreen: 1;
uint32_t resizing: 1;
uint32_t activated: 1;
};
uint32_t val;
} fState {};
uint32_t fResizeSerial = 0;
bool fSizeChanged = false;
public:
virtual ~HaikuXdgToplevel();
static HaikuXdgToplevel *Create(HaikuXdgSurface *xdg_surface, uint32_t id);
static HaikuXdgToplevel *FromResource(struct wl_resource *resource) {return (HaikuXdgToplevel*)WlResource::FromResource(resource);}
HaikuXdgSurface *XdgSurface() {return fXdgSurface;}
BWindow *Window() {return (BWindow*)fWindow;}
void MinSize(int32_t &width, int32_t &height) {width = fMinWidth; height = fMinHeight;}
void MaxSize(int32_t &width, int32_t &height) {width = fMaxWidth; height = fMaxHeight;}
void DoSendConfigure();
void HandleSetParent(struct wl_resource *parent) override;
void HandleSetTitle(const char *title) override;
void HandleSetAppId(const char *app_id) override;
void HandleShowWindowMenu(struct wl_resource *seat, uint32_t serial, int32_t x, int32_t y) override;
void HandleMove(struct wl_resource *seat, uint32_t serial) override;
void HandleResize(struct wl_resource *seat, uint32_t serial, uint32_t edges) override;
void HandleSetMaxSize(int32_t width, int32_t height) override;
void HandleSetMinSize(int32_t width, int32_t height) override;
void HandleSetMaximized() override;
void HandleUnsetMaximized() override;
void HandleSetFullscreen(struct wl_resource *output) override;
void HandleUnsetFullscreen() override;
void HandleSetMinimized() override;
};