Skip to content

Commit ab6d331

Browse files
committed
nfc(wsi) refactor wayland support (WIP)
1 parent 478abae commit ab6d331

File tree

7 files changed

+1834
-1803
lines changed

7 files changed

+1834
-1803
lines changed

modules/stormkit/wsi.mpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ export {
163163
std::string name;
164164

165165
std::vector<math::Extent2<u32>> extents;
166-
167-
void* handle = nullptr;
166+
u32 scale_factor = 1;
168167

169168
[[nodiscard]]
170169
constexpr auto operator<=>(const Monitor& other) const noexcept -> std::strong_ordering;
@@ -205,7 +204,7 @@ export {
205204

206205
struct ResizedEventData {
207206
static constexpr auto TYPE = EventType::RESIZED;
208-
math::Extent2<u32> extent;
207+
math::Extent2<u32> extent;
209208
};
210209

211210
struct MinimizedEventData {
@@ -230,13 +229,13 @@ export {
230229

231230
struct MouseButtonPushedEventData {
232231
static constexpr auto TYPE = EventType::MOUSE_BUTTON_PUSHED;
233-
math::vec2i position;
232+
math::vec2i position;
234233
MouseButton button;
235234
};
236235

237236
struct MouseButtonReleasedEventData {
238237
static constexpr auto TYPE = EventType::MOUSE_BUTTON_RELEASED;
239-
math::vec2i position;
238+
math::vec2i position;
240239
MouseButton button;
241240
};
242241

@@ -250,7 +249,7 @@ export {
250249

251250
struct MouseMovedEventData {
252251
static constexpr auto TYPE = EventType::MOUSE_MOVED;
253-
math::vec2i position;
252+
math::vec2i position;
254253
};
255254

256255
struct LostFocusEventData {
@@ -290,8 +289,9 @@ export {
290289
Window(Window&&);
291290
auto operator=(Window&&) -> Window&;
292291

293-
auto create(std::string title, const math::Extent2<u32>& size, WindowStyle style) noexcept
294-
-> void;
292+
auto create(std::string title,
293+
const math::Extent2<u32>& size,
294+
WindowStyle style) noexcept -> void;
295295
auto close() noexcept -> void;
296296

297297
[[nodiscard]]
@@ -339,8 +339,7 @@ export {
339339
auto toggle_virtual_keyboard_visibility(bool visible) noexcept -> void;
340340

341341
auto set_mouse_position(const math::vec2i& position) noexcept -> void;
342-
static auto set_mouse_position_on_desktop(const math::vec2u& position) noexcept
343-
-> void;
342+
static auto set_mouse_position_on_desktop(const math::vec2u& position) noexcept -> void;
344343

345344
[[nodiscard]]
346345
static auto get_monitor_settings() -> std::vector<Monitor>;
@@ -398,10 +397,11 @@ export {
398397
////////////////////////////////////////////////////////////////////
399398

400399
ASCASTER_STRICT_DEFINE(std::string, stormkit::wsi::Monitor) {
401-
return std::format("[Monitor: flags = {}, name = {}, extents = {}]",
400+
return std::format("[Monitor: flags = {}, name = {}, extents = {}, scale = {}]",
402401
from.flags,
403402
from.name,
404-
from.extents);
403+
from.extents,
404+
from.scale_factor);
405405
}
406406

407407
namespace stormkit { namespace wsi {

src/wsi/linux/wayland/callbacks.mpp

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)