Switch from Nz prefix to namespace Nz for linux
Former-commit-id: 64eeaf3c633254b04910ebd4576fd9e910002be0
This commit is contained in:
@@ -9,118 +9,127 @@
|
||||
#ifndef NAZARA_WINDOWIMPL_HPP
|
||||
#define NAZARA_WINDOWIMPL_HPP
|
||||
|
||||
#include <Nazara/Core/NonCopyable.hpp>
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Thread.hpp>
|
||||
#include <Nazara/Math/Vector2.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <Nazara/Utility/Keyboard.hpp>
|
||||
#include <Nazara/Utility/X11/Display.hpp>
|
||||
#include <xcb/randr.h>
|
||||
#include <xcb/xcb_icccm.h>
|
||||
#include <Nazara/Utility/X11/Display.hpp>
|
||||
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
class NzConditionVariable;
|
||||
class NzMutex;
|
||||
#endif
|
||||
class NzCursor;
|
||||
class NzIcon;
|
||||
class NzVideoMode;
|
||||
class NzWindow;
|
||||
|
||||
class NzWindowImpl : NzNonCopyable
|
||||
namespace Nz
|
||||
{
|
||||
public:
|
||||
NzWindowImpl(NzWindow* parent);
|
||||
~NzWindowImpl();
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
class ConditionVariable;
|
||||
class Mutex;
|
||||
#endif
|
||||
class Cursor;
|
||||
class Icon;
|
||||
class VideoMode;
|
||||
class Window;
|
||||
|
||||
bool Create(const NzVideoMode& mode, const NzString& title, nzUInt32 style);
|
||||
bool Create(NzWindowHandle handle);
|
||||
class WindowImpl
|
||||
{
|
||||
public:
|
||||
WindowImpl(Window* parent);
|
||||
WindowImpl(const WindowImpl&) = delete;
|
||||
WindowImpl(WindowImpl&&) = delete; ///TODO?
|
||||
~WindowImpl();
|
||||
|
||||
void Destroy();
|
||||
bool Create(const VideoMode& mode, const String& title, UInt32 style);
|
||||
bool Create(WindowHandle handle);
|
||||
|
||||
void EnableKeyRepeat(bool enable);
|
||||
void EnableSmoothScrolling(bool enable);
|
||||
void Destroy();
|
||||
|
||||
NzWindowHandle GetHandle() const;
|
||||
unsigned int GetHeight() const;
|
||||
NzVector2i GetPosition() const;
|
||||
NzVector2ui GetSize() const;
|
||||
nzUInt32 GetStyle() const;
|
||||
NzString GetTitle() const;
|
||||
unsigned int GetWidth() const;
|
||||
void EnableKeyRepeat(bool enable);
|
||||
void EnableSmoothScrolling(bool enable);
|
||||
|
||||
bool HasFocus() const;
|
||||
WindowHandle GetHandle() const;
|
||||
unsigned int GetHeight() const;
|
||||
Vector2i GetPosition() const;
|
||||
Vector2ui GetSize() const;
|
||||
UInt32 GetStyle() const;
|
||||
String GetTitle() const;
|
||||
unsigned int GetWidth() const;
|
||||
|
||||
void IgnoreNextMouseEvent(int mouseX, int mouseY);
|
||||
bool HasFocus() const;
|
||||
|
||||
bool IsMinimized() const;
|
||||
bool IsVisible() const;
|
||||
void IgnoreNextMouseEvent(int mouseX, int mouseY);
|
||||
|
||||
void ProcessEvents(bool block);
|
||||
bool IsMinimized() const;
|
||||
bool IsVisible() const;
|
||||
|
||||
void SetCursor(nzWindowCursor cursor);
|
||||
void SetCursor(const NzCursor& cursor);
|
||||
void SetEventListener(bool listener);
|
||||
void SetFocus();
|
||||
void SetIcon(const NzIcon& icon);
|
||||
void SetMaximumSize(int width, int height);
|
||||
void SetMinimumSize(int width, int height);
|
||||
void SetPosition(int x, int y);
|
||||
void SetSize(unsigned int width, unsigned int height);
|
||||
void SetStayOnTop(bool stayOnTop);
|
||||
void SetTitle(const NzString& title);
|
||||
void SetVisible(bool visible);
|
||||
void ProcessEvents(bool block);
|
||||
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
void SetCursor(WindowCursor cursor);
|
||||
void SetCursor(const Cursor& cursor);
|
||||
void SetEventListener(bool listener);
|
||||
void SetFocus();
|
||||
void SetIcon(const Icon& icon);
|
||||
void SetMaximumSize(int width, int height);
|
||||
void SetMinimumSize(int width, int height);
|
||||
void SetPosition(int x, int y);
|
||||
void SetSize(unsigned int width, unsigned int height);
|
||||
void SetStayOnTop(bool stayOnTop);
|
||||
void SetTitle(const String& title);
|
||||
void SetVisible(bool visible);
|
||||
|
||||
private:
|
||||
WindowImpl& operator=(const WindowImpl&) = delete;
|
||||
WindowImpl& operator=(WindowImpl&&) = delete; ///TODO?
|
||||
|
||||
void CleanUp();
|
||||
xcb_keysym_t ConvertKeyCodeToKeySym(xcb_keycode_t keycode, uint16_t state);
|
||||
NzKeyboard::Key ConvertVirtualKey(xcb_keysym_t symbol);
|
||||
const char* ConvertWindowCursorToXName(nzWindowCursor cursor);
|
||||
void CommonInitialize();
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
void ProcessEvent(xcb_generic_event_t* windowEvent);
|
||||
private:
|
||||
|
||||
void ResetVideoMode();
|
||||
void CleanUp();
|
||||
xcb_keysym_t ConvertKeyCodeToKeySym(xcb_keycode_t keycode, uint16_t state);
|
||||
Keyboard::Key ConvertVirtualKey(xcb_keysym_t symbol);
|
||||
const char* ConvertWindowCursorToXName(WindowCursor cursor);
|
||||
void CommonInitialize();
|
||||
|
||||
void SetCursor(xcb_cursor_t cursor);
|
||||
void SetMotifHints();
|
||||
void SetVideoMode(const NzVideoMode& mode);
|
||||
void SwitchToFullscreen();
|
||||
void ProcessEvent(xcb_generic_event_t* windowEvent);
|
||||
|
||||
bool UpdateNormalHints();
|
||||
void UpdateEventQueue(xcb_generic_event_t* event);
|
||||
void ResetVideoMode();
|
||||
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
static void WindowThread(NzWindowImpl* window, NzMutex* mutex, NzConditionVariable* condition);
|
||||
#endif
|
||||
void SetCursor(xcb_cursor_t cursor);
|
||||
void SetMotifHints();
|
||||
void SetVideoMode(const VideoMode& mode);
|
||||
void SwitchToFullscreen();
|
||||
|
||||
xcb_window_t m_window;
|
||||
xcb_screen_t* m_screen;
|
||||
xcb_randr_get_screen_info_reply_t m_oldVideoMode;
|
||||
xcb_size_hints_t m_size_hints;
|
||||
nzUInt32 m_style;
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
NzThread m_thread;
|
||||
#endif
|
||||
NzWindow* m_parent;
|
||||
bool m_eventListener;
|
||||
bool m_ownsWindow;
|
||||
bool m_smoothScrolling;
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
bool m_threadActive;
|
||||
#endif
|
||||
short m_scrolling;
|
||||
NzVector2i m_mousePos;
|
||||
bool m_keyRepeat;
|
||||
bool UpdateNormalHints();
|
||||
void UpdateEventQueue(xcb_generic_event_t* event);
|
||||
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
static void WindowThread(WindowImpl* window, Mutex* mutex, ConditionVariable* condition);
|
||||
#endif
|
||||
|
||||
xcb_window_t m_window;
|
||||
xcb_screen_t* m_screen;
|
||||
xcb_randr_get_screen_info_reply_t m_oldVideoMode;
|
||||
xcb_size_hints_t m_size_hints;
|
||||
UInt32 m_style;
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
Thread m_thread;
|
||||
#endif
|
||||
Window* m_parent;
|
||||
bool m_eventListener;
|
||||
bool m_ownsWindow;
|
||||
bool m_smoothScrolling;
|
||||
#if NAZARA_UTILITY_THREADED_WINDOW
|
||||
bool m_threadActive;
|
||||
#endif
|
||||
short m_scrolling;
|
||||
Vector2i m_mousePos;
|
||||
bool m_keyRepeat;
|
||||
|
||||
struct
|
||||
{
|
||||
xcb_generic_event_t* curr = nullptr;
|
||||
xcb_generic_event_t* next = nullptr;
|
||||
} m_eventQueue;
|
||||
};
|
||||
}
|
||||
|
||||
struct
|
||||
{
|
||||
xcb_generic_event_t* curr = nullptr;
|
||||
xcb_generic_event_t* next = nullptr;
|
||||
} m_eventQueue;
|
||||
};
|
||||
#endif // NAZARA_WINDOWIMPL_HPP
|
||||
|
||||
Reference in New Issue
Block a user