33#include "../../Core/Signals/signal.h"
34#include "../display_target.h"
37#if !defined(WIN32) && !defined(__ANDROID__) && !defined(__APPLE__)
40typedef struct _XDisplay Display;
41typedef unsigned long Window;
44#if defined(__ANDROID__)
57 class DisplayWindowMode;
58 class DisplayWindowDescription;
59 struct DisplayWindowHandle;
63 class DisplayWindowProvider;
64 class DisplayWindow_Impl;
89#elif defined(__ANDROID__)
91#elif defined(__APPLE__)
116 const std::string &title,
119 bool start_fullscreen =
false,
120 bool allow_resize =
false,
121 int flipping_buffers = 2);
205 std::function<bool(HWND, UINT, WPARAM, LPARAM)> &func_window_message();
208 Signal<void(HWND, UINT, WPARAM, LPARAM)> &sig_window_message();
213 explicit operator bool()
const {
return bool(impl); }
299 void set_size(
float width,
float height,
bool client_area);
321 void show(
bool activate =
true);
355 void set_cursor_handle(HCURSOR cursor);
385 std::shared_ptr<DisplayWindow_Impl> impl;
Mouse cursor class.
Definition cursor.h:47
Display window description class.
Definition display_window_description.h:50
Interface for implementing a DisplayWindow target.
Definition display_window_provider.h:99
Top-level window class.
Definition display_window.h:101
void minimize()
Minimizes the window.
void set_clipboard_text(const std::string &text)
Stores text in the clipboard.
void hide()
Hides the window.
void set_position(const Rectf &pos, bool client_area)
Set window position and size.
DisplayWindow(const DisplayWindowDescription &description)
Constructs a window.
std::string get_clipboard_text() const
Returns the text stored in the clipboard.
bool has_focus() const
Returns true if window has focus.
void hide_cursor()
Hides the mouse cursor.
void set_title(const std::string &title)
Change window title.
Signal< void()> & sig_window_close()
Signal emitted when window is closed.
void set_visible(bool visible, bool activate)
Set visible.
Signal< void()> & sig_window_flip()
Signal emitted when window flip() was called.
void restore()
Restores the window.
Signal< void()> & sig_window_moved()
Signal emitted after a window has been moved.
void set_cursor(StandardCursor type)
Set cursor.
void set_clipboard_image(const PixelBuffer &buf)
Stores an image in the clipboard.
void set_maximum_size(float width, float height, bool client_area)
Maximum size a window can be resized to by the application user.
void set_size(float width, float height, bool client_area)
Resize window.
bool is_maximized() const
Returns true if the window is maximized.
Rectf get_geometry() const
Returns the position and size of the window frame.
bool is_fullscreen() const
Returns true if window is currently running fullscreen.
bool is_null() const
Returns true if this object is invalid.
Definition display_window.h:212
void show(bool activate=true)
Displays the window in its current size and position.
void capture_mouse(bool capture)
Capture/Release the mouse.
InputDevice & get_mouse()
Returns the mouse input device.
std::vector< InputDevice > & get_game_controllers()
Returns the game controller input device.
GraphicContext & get_gc() const
Return the graphic context for the window.
void set_large_icon(const PixelBuffer &image)
Sets the large icon used for this window.
PixelBuffer get_clipboard_image() const
Returns an image stored in the clipboard.
void bring_to_front()
Raises the window on top of other windows.
bool is_clipboard_text_available() const
Returns true if text is available in the clipboard.
InputDevice & get_input_device(const std::string &device_name)
Returns the input device with the given device name.
Signal< void(float, float)> & sig_resize()
Signal emitted when window is resized.
Signal< void()> & sig_window_maximized()
Signal emitted when window is maximized.
void set_minimum_size(float width, float height, bool client_area)
Minimum size a window can be resized to by the application user.
void request_repaint()
Invalidates the screen, causing a repaint.
Sizef get_minimum_size(bool client_area=false)
Returns the minimum size the window can be resized to by the application user.
void extend_frame_into_client_area(float left, float top, float right, float bottom)
Exend the window frame into the client area.
void enable_alpha_channel(const Rectf &blur_rect)
Enable alpha channel for this window.
DisplayWindowHandle get_handle() const
Signal< void()> & sig_paint()
Signal emitted when the window is invalidated.
std::function< bool()> & func_minimize_clicked()
Callback called when a window is asked to minimize itself.
DisplayWindow(DisplayWindowProvider *provider)
Constructs a window.
Signal< void()> & sig_window_minimized()
Signal emitted when window is minimized.
Signal< void()> & sig_got_focus()
Signal emitted when window gain focus.
bool is_visible() const
returns true if this display window is visible
void flip(int interval=-1)
Flip back buffer to front, making changes visible on screen.
std::function< void(Rectf &)> & func_window_resize()
Callback called when a window is being resized.
InputDevice & get_keyboard()
Returns the keyboard input device.
void set_small_icon(const PixelBuffer &image)
Sets the small icon used for this window.
bool is_minimized() const
Returns true if the window is minimized.
Sizef get_maximum_size(bool client_area=false)
Returns the maximum size the window can be resized to by the application user.
DisplayWindow()
Constructs a null instance.
Signal< void()> & sig_window_destroy()
Signal emitted when window is destroyed.
Signal< void()> & sig_window_restored()
Signal emitted when window is restored.
DisplayWindowProvider * get_provider() const
Returns the display window provider.
Rectf get_viewport() const
Returns the drawable area of the window (excluding window frame).
void set_cursor(const Cursor &cursor)
Sets the current cursor icon.
void maximize()
Maximizes the window.
Pointf screen_to_client(const Pointf &screen)
Convert from screen coordinates to client coordinates.
std::string get_title() const
Returns the window title.
bool is_clipboard_image_available() const
Returns true if an image is available in the clipboard.
Pointf client_to_screen(const Pointf &client)
Convert from window client coordinates to screen coordinates.
Signal< void()> & sig_lost_focus()
Signal emitted when window lost focus.
DisplayWindow(const std::string &title, float width, float height, bool start_fullscreen=false, bool allow_resize=false, int flipping_buffers=2)
Constructs a window.
void set_enabled(bool enable)
Set enabled.
void set_position(float x, float y)
Set window position.
void throw_if_null() const
Throw an exception if this object is invalid.
void show_cursor()
Shows the mouse cursor.
Interface to drawing graphics.
Definition graphic_context.h:257
Pixel data container.
Definition pixel_buffer.h:68
2D (x,y) point structure - Float
Definition point.h:72
2D (left,top,right,bottom) rectangle structure - Float
Definition rect.h:503
2D (width,height) size structure - Float
Definition size.h:184
StandardCursor
Standard Cursor.
Definition display_window.h:69
Definition display_window.h:86
::Display * display
Definition display_window.h:93
::Window window
Definition display_window.h:94
int screen
Definition display_window.h:95