34 #include "../../Core/Signals/signal.h"
35 #include "../display_target.h"
38 #if !defined(WIN32) && !defined(__ANDROID__) && !defined(__APPLE__)
41 typedef struct _XDisplay Display;
42 typedef unsigned long Window;
45 #if defined(__ANDROID__)
59 class DisplayWindowMode;
60 class DisplayWindowDescription;
61 struct DisplayWindowHandle;
65 class DisplayWindowProvider;
66 class DisplayWindow_Impl;
91 #elif defined(__ANDROID__)
93 #elif defined(__APPLE__)
122 bool start_fullscreen =
false,
123 bool allow_resize =
false,
124 int flipping_buffers = 2);
202 std::function<bool(HWND, UINT, WPARAM, LPARAM)> &func_window_message();
297 void set_size(
float width,
float height,
bool client_area);
315 void show(
bool activate =
true);
339 void flip(
int interval = -1);
353 void set_cursor_handle(HCURSOR cursor);
387 std::shared_ptr<DisplayWindow_Impl> impl;
Signal< void()> & sig_window_maximized()
Signal emitted when window is maximized.
DisplayWindow()
Constructs a null instance.
void set_maximum_size(float width, float height, bool client_area)
Maximum size a window can be resized to by the application user.
bool is_fullscreen() const
Returns true if window is currently running fullscreen.
StandardCursor
Standard Cursor.
Definition: display_window.h:70
Signal< void()> & sig_window_restored()
Signal emitted when window is restored.
void bring_to_front()
Raises the window on top of other windows.
Signal< void()> & sig_got_focus()
Signal emitted when window gain focus.
Signal< void()> & sig_window_moved()
Signal emitted after a window has been moved.
Pointf client_to_screen(const Pointf &client)
Convert from window client coordinates to screen coordinates.
Signal< void(float, float)> & sig_resize()
Signal emitted when window is resized.
Pixel data container.
Definition: pixel_buffer.h:68
void capture_mouse(bool capture)
Capture/Release the mouse.
Definition: display_window.h:87
Rectf get_geometry() const
Returns the position and size of the window frame.
Mouse cursor class.
Definition: cursor.h:47
bool is_maximized() const
Returns true if the window is maximized.
void maximize()
Maximizes the window.
Rectf get_viewport() const
Returns the drawable area of the window (excluding window frame).
Pointf screen_to_client(const Pointf &screen)
Convert from screen coordinates to client coordinates.
InputContext get_ic() const
Return the input context for the window.
void show_cursor()
Shows the mouse cursor.
void set_enabled(bool enable)
Set enabled.
Top level display class.
Definition: Sources/API/Display/display.h:49
void set_clipboard_image(const PixelBuffer &buf)
Stores an image in the clipboard.
void set_position(const Rectf &pos, bool client_area)
Set window position and size.
Signal< void()> & sig_window_destroy()
Signal emitted when window is destroyed.
void enable_alpha_channel(const Rectf &blur_rect)
Enable alpha channel for this window.
std::function< void(Rectf &)> & func_window_resize()
Callback called when a window is being resized.
void flip(int interval=-1)
Flip back buffer to front, making changes visible on screen.
DisplayWindowProvider * get_provider() const
Returns the display window provider.
void set_title(const std::string &title)
Change window title.
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:484
Signal< void()> & sig_window_minimized()
Signal emitted when window is minimized.
void set_cursor(const Cursor &cursor)
Sets the current cursor icon.
std::string get_title() const
Returns the window title.
::Display * display
Definition: display_window.h:95
bool is_null() const
Returns true if this object is invalid.
Definition: display_window.h:207
void set_large_icon(const PixelBuffer &image)
Sets the large icon used for this window.
Signal< void(const Rectf &)> & sig_paint()
Signal emitted when an area of the window is invalidated.
void hide()
Hides the window.
PixelBuffer get_clipboard_image() const
Returns an image stored in the clipboard.
Signal< void()> & sig_window_flip()
Signal emitted when window flip() was called.
void restore()
Restores the window.
void minimize()
Minimizes the window.
void set_size(float width, float height, bool client_area)
Resize window.
void extend_frame_into_client_area(float left, float top, float right, float bottom)
Exend the window frame into the client area.
Interface to drawing graphics.
Definition: graphic_context.h:257
InputContext.
Definition: input_context.h:44
bool is_clipboard_image_available() const
Returns true if an image is available in the clipboard.
void set_clipboard_text(const std::string &text)
Stores text in the clipboard.
Display window description class.
Definition: display_window_description.h:62
bool is_clipboard_text_available() const
Returns true if text is available in the clipboard.
Signal< void()> & sig_lost_focus()
Signal emitted when window lost focus.
GraphicContext & get_gc() const
Return the graphic context for the window.
Interface for implementing a DisplayWindow target.
Definition: display_window_provider.h:102
void set_minimum_size(float width, float height, bool client_area)
Minimum size a window can be resized to by the application user.
void set_small_icon(const PixelBuffer &image)
Sets the small icon used for this window.
Sizef get_maximum_size(bool client_area=false)
Returns the maximum size the window can be resized to by the application user.
Signal< void()> & sig_window_close()
Signal emitted when window is closed.
::Window window
Definition: display_window.h:96
DisplayWindowHandle get_handle() const
bool has_focus() const
Returns true if window has focus.
void hide_cursor()
Hides the mouse cursor.
2D (x,y) point structure - Float
Definition: point.h:72
std::function< bool()> & func_minimize_clicked()
Callback called when a window is asked to minimize itself.
bool is_minimized() const
Returns true if the window is minimized.
void set_visible(bool visible, bool activate)
Set visible.
void show(bool activate=true)
Displays the window in its current size and position.
void update(const Rectf &rect)
Copy the specified rectangle area from back buffer to front buffer.
bool is_visible() const
returns true if this display window is visible
Top-level window class.
Definition: display_window.h:101
void throw_if_null() const
Throw an exception if this object is invalid.
std::string get_clipboard_text() const
Returns the text stored in the clipboard.
Sizef get_minimum_size(bool client_area=false)
Returns the minimum size the window can be resized to by the application user.
2D (width,height) size structure - Float
Definition: size.h:169
void request_repaint(const Rectf &rect)
Invalidates a region of a screen, causing a repaint.