Unix: Rename X11Display to X11Window and make it work again with Spectre/Window/Window
This commit is contained in:
parent
96f6725428
commit
45d3bff620
9 changed files with 60 additions and 62 deletions
86
source/Platform/Unix/X11Window.h
Normal file
86
source/Platform/Unix/X11Window.h
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
#ifndef PLATFORM_UNIX_X11WINDOW_H
|
||||
#define PLATFORM_UNIX_X11WINDOW_H
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xos.h>
|
||||
#include <cstdint>
|
||||
#include <Platform/PlatformWindow.h>
|
||||
#include "Xrandr.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class X11Window : public PlatformWindow
|
||||
{
|
||||
public :
|
||||
|
||||
static X11Window* getFocused();
|
||||
|
||||
X11Window();
|
||||
|
||||
virtual bool create(WindowDescription description);
|
||||
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool isValid();
|
||||
|
||||
virtual void* getHandle() const;
|
||||
|
||||
virtual void setSize(unsigned int width, unsigned int height);
|
||||
|
||||
virtual Vector2u getSize() const;
|
||||
|
||||
virtual void setPosition(unsigned int x, unsigned int y);
|
||||
|
||||
virtual Vector2u getPosition() const;
|
||||
|
||||
virtual void setVisible(bool visible);
|
||||
|
||||
virtual void setDecoration(unsigned decoration);
|
||||
|
||||
virtual void minimize();
|
||||
|
||||
virtual void maximize();
|
||||
|
||||
virtual void enterFullscreen(DisplayMode mode);
|
||||
|
||||
virtual void exitFullscreen();
|
||||
|
||||
virtual void setCaption(const std::string& caption);
|
||||
|
||||
virtual void setIcon(unsigned int width, unsigned int height, const uint8_t *pixels);
|
||||
|
||||
virtual void showCursor(bool value);
|
||||
|
||||
virtual void grabCursor(bool value);
|
||||
|
||||
void processEvent(const ::XEvent& event);
|
||||
|
||||
protected :
|
||||
|
||||
void createHiddenCursor();
|
||||
|
||||
void toggleFullscreen(bool enabled);
|
||||
|
||||
void wm_fullscreen(bool enabled);
|
||||
|
||||
protected :
|
||||
|
||||
::Window m_win;
|
||||
|
||||
int m_screen;
|
||||
|
||||
::Cursor m_cur_hidden;
|
||||
::Cursor m_cur_last;
|
||||
|
||||
Vector2u m_size;
|
||||
|
||||
XRandR::VideoMode m_fullscreen_mode;
|
||||
|
||||
XRandR::VideoMode m_desktop_mode;
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* PLATFORM_UNIX_X11WINDOW_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue