Skip to content

Commit

Permalink
[Platforms] Added .inl headers of function declarations for Window/Ca…
Browse files Browse the repository at this point in the history
…nvas interfaces.
  • Loading branch information
LukasBanana committed Aug 29, 2024
1 parent 42e7b90 commit e2f48fa
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 125 deletions.
27 changes: 27 additions & 0 deletions include/LLGL/Backend/Canvas.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Canvas.inl
*
* Copyright (c) 2015 Lukas Hermanns. All rights reserved.
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt).
*/

virtual bool GetNativeHandle(
void* nativeHandle,
std::size_t nativeHandleSize
) override final;

virtual LLGL::Extent2D GetContentSize(
void
) const override final;

virtual void SetTitle(
const LLGL::UTF8String& title
) override final;

virtual LLGL::UTF8String GetTitle(
void
) const override final;



// ================================================================================
58 changes: 58 additions & 0 deletions include/LLGL/Backend/Window.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Window.inl
*
* Copyright (c) 2015 Lukas Hermanns. All rights reserved.
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt).
*/

virtual bool GetNativeHandle(
void* nativeHandle,
std::size_t nativeHandleSize
) override final;

virtual LLGL::Extent2D GetContentSize(
void
) const override final;

virtual void SetPosition(
const LLGL::Offset2D& position
) override final;

virtual LLGL::Offset2D GetPosition() const override;

virtual void SetSize(
const LLGL::Extent2D& size,
bool useClientArea = true
) override final;

virtual LLGL::Extent2D GetSize(
bool useClientArea = true
) const override final;

virtual void SetTitle(
const LLGL::UTF8String& title
) override final;

virtual LLGL::UTF8String GetTitle(
void
) const override final;

virtual void Show(
bool show = true
) override final;

virtual bool IsShown(
void
) const override final;

virtual LLGL::WindowDescriptor GetDesc(
void
) const override final;

virtual void SetDesc(
const LLGL::WindowDescriptor& desc
) override final;



// ================================================================================
13 changes: 4 additions & 9 deletions sources/Platform/Android/AndroidCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@ class AndroidCanvas : public Canvas

public:

AndroidCanvas(const CanvasDescriptor& desc);
~AndroidCanvas();

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;

Extent2D GetContentSize() const override;

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;
#include <LLGL/Backend/Canvas.inl>

public:

AndroidCanvas(const CanvasDescriptor& desc);
~AndroidCanvas();

/*
Updates the pointer to ANativeWindow from the specified app state.
If the input is null, the window will be reset to null.
Expand Down
11 changes: 4 additions & 7 deletions sources/Platform/IOS/IOSCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ class IOSCanvas : public Canvas

public:

IOSCanvas(const CanvasDescriptor& desc);
~IOSCanvas();

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;
#include <LLGL/Backend/Canvas.inl>

Extent2D GetContentSize() const override;
public:

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;
IOSCanvas(const CanvasDescriptor& desc);
~IOSCanvas();

public:

Expand Down
23 changes: 4 additions & 19 deletions sources/Platform/Linux/LinuxWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,12 @@ class LinuxWindow : public Window

public:

LinuxWindow(const WindowDescriptor& desc);
~LinuxWindow();

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;

Extent2D GetContentSize() const override;

void SetPosition(const Offset2D& position) override;
Offset2D GetPosition() const override;
#include <LLGL/Backend/Window.inl>

void SetSize(const Extent2D& size, bool useClientArea = true) override;
Extent2D GetSize(bool useClientArea = true) const override;

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;

void Show(bool show = true) override;
bool IsShown() const override;
public:

void SetDesc(const WindowDescriptor& desc) override;
WindowDescriptor GetDesc() const override;
LinuxWindow(const WindowDescriptor& desc);
~LinuxWindow();

public:

Expand Down
25 changes: 4 additions & 21 deletions sources/Platform/MacOS/MacOSSubviewWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,13 @@ class MacOSSubviewWindow : public Window

public:

MacOSSubviewWindow(const WindowDescriptor& desc);
~MacOSSubviewWindow();

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;

Extent2D GetContentSize() const override;

void SetPosition(const Offset2D& position) override;
Offset2D GetPosition() const override;

void SetSize(const Extent2D& size, bool useClientArea = true) override;
Extent2D GetSize(bool useClientArea = true) const override;

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;

void Show(bool show = true) override;
bool IsShown() const override;

void SetDesc(const WindowDescriptor& desc) override;
WindowDescriptor GetDesc() const override;
#include <LLGL/Backend/Window.inl>

public:

MacOSSubviewWindow(const WindowDescriptor& desc);
~MacOSSubviewWindow();

// Returns the native NSView object.
inline NSView* GetNSView() const
{
Expand Down
25 changes: 4 additions & 21 deletions sources/Platform/MacOS/MacOSWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,19 @@ class MacOSWindow : public Window

public:

MacOSWindow(const WindowDescriptor& desc);
~MacOSWindow();

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;

Extent2D GetContentSize() const override;

void SetPosition(const Offset2D& position) override;
Offset2D GetPosition() const override;

void SetSize(const Extent2D& size, bool useClientArea = true) override;
Extent2D GetSize(bool useClientArea = true) const override;
#include <LLGL/Backend/Window.inl>

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;

void Show(bool show = true) override;
bool IsShown() const override;
public:

void SetDesc(const WindowDescriptor& desc) override;
WindowDescriptor GetDesc() const override;
MacOSWindow(const WindowDescriptor& desc);
~MacOSWindow();

// Returns the native NSWindow object.
inline NSWindow* GetNSWindow() const
{
return wnd_;
}

public:

void ProcessEvent(NSEvent* event);

private:
Expand Down
24 changes: 4 additions & 20 deletions sources/Platform/UWP/UWPWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,12 @@ class UWPWindow final : public Window

public:

UWPWindow(const WindowDescriptor& desc);
~UWPWindow();

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;

Extent2D GetContentSize() const override;

void SetPosition(const Offset2D& position) override;
Offset2D GetPosition() const override;

void SetSize(const Extent2D& size, bool useClientArea = true) override;
Extent2D GetSize(bool useClientArea = true) const override;
#include <LLGL/Backend/Window.inl>

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;

void Show(bool show = true) override;
bool IsShown() const override;

WindowDescriptor GetDesc() const override;
public:

void SetDesc(const WindowDescriptor& desc) override;
UWPWindow(const WindowDescriptor& desc);
~UWPWindow();

private:

Expand Down
9 changes: 3 additions & 6 deletions sources/Platform/Wasm/WasmCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ class WasmCanvas : public Canvas

public:

WasmCanvas(const CanvasDescriptor& desc);

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;
#include <LLGL/Backend/Canvas.inl>

Extent2D GetContentSize() const override;
public:

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;
WasmCanvas(const CanvasDescriptor& desc);

private:

Expand Down
26 changes: 4 additions & 22 deletions sources/Platform/Win32/Win32Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,13 @@ class Win32Window final : public Window

public:

Win32Window(const WindowDescriptor& desc);
~Win32Window();

bool GetNativeHandle(void* nativeHandle, std::size_t nativeHandleSize) override;

Extent2D GetContentSize() const override;

void SetPosition(const Offset2D& position) override;
Offset2D GetPosition() const override;

void SetSize(const Extent2D& size, bool useClientArea = true) override;
Extent2D GetSize(bool useClientArea = true) const override;

void SetTitle(const UTF8String& title) override;
UTF8String GetTitle() const override;

void Show(bool show = true) override;
bool IsShown() const override;

WindowDescriptor GetDesc() const override;

void SetDesc(const WindowDescriptor& desc) override;
#include <LLGL/Backend/Window.inl>

public:

Win32Window(const WindowDescriptor& desc);
~Win32Window();

// Returns true if the WM_ERASEBKGND must be skipped.
inline bool SkipMsgERASEBKGND() const
{
Expand Down

0 comments on commit e2f48fa

Please sign in to comment.