2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2021-05-01 18:22:29 +02:00
|
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2018-10-12 01:03:22 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-02-14 22:29:06 +01:00
|
|
|
#include <AK/Function.h>
|
2021-05-19 14:35:34 +02:00
|
|
|
#include <AK/OwnPtr.h>
|
2019-12-23 20:24:26 +01:00
|
|
|
#include <AK/String.h>
|
2021-10-15 22:24:41 +02:00
|
|
|
#include <AK/Variant.h>
|
2019-05-28 11:53:16 +02:00
|
|
|
#include <AK/WeakPtr.h>
|
2020-02-06 15:04:03 +01:00
|
|
|
#include <LibCore/Object.h>
|
2020-08-14 19:56:40 +02:00
|
|
|
#include <LibGUI/FocusSource.h>
|
2020-02-16 09:17:49 +01:00
|
|
|
#include <LibGUI/Forward.h>
|
2022-08-18 11:00:08 -04:00
|
|
|
#include <LibGUI/WindowMode.h>
|
2020-02-14 22:29:06 +01:00
|
|
|
#include <LibGUI/WindowType.h>
|
2020-02-14 23:02:47 +01:00
|
|
|
#include <LibGfx/Forward.h>
|
2020-02-06 12:04:00 +01:00
|
|
|
#include <LibGfx/Rect.h>
|
2020-09-10 19:25:13 +02:00
|
|
|
#include <LibGfx/StandardCursor.h>
|
2018-10-12 01:03:22 +02:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
namespace GUI {
|
2019-01-20 05:48:43 +01:00
|
|
|
|
2021-01-15 09:38:12 +01:00
|
|
|
class WindowBackingStore;
|
|
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
class Window : public Core::Object {
|
|
|
|
|
C_OBJECT(Window)
|
2018-10-12 01:03:22 +02:00
|
|
|
public:
|
2020-02-02 15:07:41 +01:00
|
|
|
virtual ~Window() override;
|
2018-10-12 01:03:22 +02:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
static Window* from_window_id(int);
|
2019-01-20 05:48:43 +01:00
|
|
|
|
2021-05-01 18:22:29 +02:00
|
|
|
bool is_modified() const;
|
|
|
|
|
void set_modified(bool);
|
|
|
|
|
|
2022-08-18 11:00:08 -04:00
|
|
|
bool is_modal() const { return m_window_mode != WindowMode::Modeless; }
|
|
|
|
|
bool is_blocking() const { return m_window_mode == WindowMode::Blocking; }
|
2022-09-05 21:17:45 +02:00
|
|
|
bool is_capturing_input() const { return m_window_mode == WindowMode::CaptureInput; }
|
2019-03-19 00:01:02 +01:00
|
|
|
|
2019-05-17 21:33:44 +02:00
|
|
|
bool is_fullscreen() const { return m_fullscreen; }
|
2019-09-16 18:38:42 +02:00
|
|
|
void set_fullscreen(bool);
|
2019-05-17 21:33:44 +02:00
|
|
|
|
2022-04-05 17:40:53 +02:00
|
|
|
bool is_maximized() const { return m_maximized; }
|
2021-06-06 21:50:06 +02:00
|
|
|
void set_maximized(bool);
|
2020-06-18 13:31:29 +03:00
|
|
|
|
2020-05-01 23:26:32 +02:00
|
|
|
bool is_frameless() const { return m_frameless; }
|
2021-02-20 23:10:21 -07:00
|
|
|
void set_frameless(bool);
|
2020-05-01 23:26:32 +02:00
|
|
|
|
2021-07-04 23:10:53 +02:00
|
|
|
void set_forced_shadow(bool);
|
|
|
|
|
|
2019-04-20 21:24:02 +02:00
|
|
|
bool is_resizable() const { return m_resizable; }
|
|
|
|
|
void set_resizable(bool resizable) { m_resizable = resizable; }
|
|
|
|
|
|
2022-06-29 03:14:55 +02:00
|
|
|
bool is_obeying_widget_min_size() { return m_obey_widget_min_size; }
|
|
|
|
|
void set_obey_widget_min_size(bool);
|
|
|
|
|
|
2020-01-04 13:12:02 +02:00
|
|
|
bool is_minimizable() const { return m_minimizable; }
|
|
|
|
|
void set_minimizable(bool minimizable) { m_minimizable = minimizable; }
|
|
|
|
|
|
2021-10-21 09:09:58 -04:00
|
|
|
bool is_closeable() const { return m_closeable; }
|
|
|
|
|
void set_closeable(bool closeable) { m_closeable = closeable; }
|
|
|
|
|
|
2019-03-17 04:23:54 +01:00
|
|
|
void set_double_buffering_enabled(bool);
|
2019-02-19 01:42:53 +01:00
|
|
|
void set_has_alpha_channel(bool);
|
2021-02-11 17:32:03 -07:00
|
|
|
bool has_alpha_channel() const { return m_has_alpha_channel; }
|
2019-02-19 01:42:53 +01:00
|
|
|
void set_opacity(float);
|
2021-02-11 17:32:03 -07:00
|
|
|
float opacity() const { return m_opacity_when_windowless; }
|
2020-08-13 21:11:41 +02:00
|
|
|
|
2021-02-14 16:42:37 -07:00
|
|
|
void set_alpha_hit_threshold(float);
|
|
|
|
|
float alpha_hit_threshold() const { return m_alpha_hit_threshold; }
|
|
|
|
|
|
2020-08-13 21:11:41 +02:00
|
|
|
WindowType window_type() const { return m_window_type; }
|
2020-02-02 15:07:41 +01:00
|
|
|
void set_window_type(WindowType);
|
2019-02-19 01:42:53 +01:00
|
|
|
|
2022-08-18 11:00:08 -04:00
|
|
|
WindowMode window_mode() const { return m_window_mode; }
|
|
|
|
|
void set_window_mode(WindowMode);
|
|
|
|
|
|
2019-01-14 14:21:51 +01:00
|
|
|
int window_id() const { return m_window_id; }
|
|
|
|
|
|
2021-04-14 21:38:53 +00:00
|
|
|
void make_window_manager(unsigned event_mask);
|
|
|
|
|
|
2019-01-26 05:20:32 +01:00
|
|
|
String title() const;
|
2021-04-16 20:06:43 +02:00
|
|
|
void set_title(String);
|
2018-10-12 01:03:22 +02:00
|
|
|
|
2019-08-27 20:35:37 +02:00
|
|
|
enum class CloseRequestDecision {
|
|
|
|
|
StayOpen,
|
|
|
|
|
Close,
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-02 00:32:26 +01:00
|
|
|
Function<void()> on_close;
|
2019-08-27 20:35:37 +02:00
|
|
|
Function<CloseRequestDecision()> on_close_request;
|
2020-07-14 19:17:00 -06:00
|
|
|
Function<void(bool is_active_input)> on_active_input_change;
|
2021-08-05 00:21:39 +02:00
|
|
|
Function<void(bool is_active_window)> on_active_window_change;
|
2022-09-07 07:49:00 -04:00
|
|
|
Function<void(InputPreemptor)> on_input_preemption;
|
2019-08-27 20:35:37 +02:00
|
|
|
|
2019-01-24 23:40:12 +01:00
|
|
|
int x() const { return rect().x(); }
|
|
|
|
|
int y() const { return rect().y(); }
|
|
|
|
|
int width() const { return rect().width(); }
|
|
|
|
|
int height() const { return rect().height(); }
|
2018-10-12 01:03:22 +02:00
|
|
|
|
2020-06-10 10:57:59 +02:00
|
|
|
Gfx::IntRect rect() const;
|
2021-03-30 23:30:50 +02:00
|
|
|
Gfx::IntRect applet_rect_on_screen() const;
|
2020-06-10 10:57:59 +02:00
|
|
|
Gfx::IntSize size() const { return rect().size(); }
|
2022-04-01 20:58:27 +03:00
|
|
|
void set_rect(Gfx::IntRect const&);
|
2019-02-08 00:14:37 +01:00
|
|
|
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
|
2018-10-12 01:03:22 +02:00
|
|
|
|
2020-06-10 10:57:59 +02:00
|
|
|
Gfx::IntPoint position() const { return rect().location(); }
|
2018-10-12 02:24:05 +02:00
|
|
|
|
2021-02-16 00:59:43 +11:00
|
|
|
Gfx::IntSize minimum_size() const;
|
2022-04-01 20:58:27 +03:00
|
|
|
void set_minimum_size(Gfx::IntSize const&);
|
2021-02-16 00:59:43 +11:00
|
|
|
void set_minimum_size(int width, int height) { set_minimum_size({ width, height }); }
|
|
|
|
|
|
2019-02-11 06:09:54 +01:00
|
|
|
void move_to(int x, int y) { move_to({ x, y }); }
|
2022-04-01 20:58:27 +03:00
|
|
|
void move_to(Gfx::IntPoint const& point) { set_rect({ point, size() }); }
|
2019-02-11 06:09:54 +01:00
|
|
|
|
2019-04-26 17:33:20 +02:00
|
|
|
void resize(int width, int height) { resize({ width, height }); }
|
2022-04-01 20:58:27 +03:00
|
|
|
void resize(Gfx::IntSize const& size) { set_rect({ position(), size }); }
|
2019-04-26 17:33:20 +02:00
|
|
|
|
2020-08-15 16:32:11 +02:00
|
|
|
void center_on_screen();
|
2022-04-01 20:58:27 +03:00
|
|
|
void center_within(Window const&);
|
2020-08-15 16:32:11 +02:00
|
|
|
|
2020-02-02 12:34:39 +01:00
|
|
|
virtual void event(Core::Event&) override;
|
2018-10-12 01:26:20 +02:00
|
|
|
|
2019-01-16 13:49:44 +01:00
|
|
|
bool is_visible() const;
|
2021-01-05 15:43:59 +01:00
|
|
|
bool is_active() const;
|
2020-07-14 19:17:00 -06:00
|
|
|
bool is_active_input() const { return m_is_active_input; }
|
|
|
|
|
|
2019-01-30 20:03:52 +01:00
|
|
|
void show();
|
|
|
|
|
void hide();
|
2019-07-26 16:13:59 +02:00
|
|
|
virtual void close();
|
2019-06-01 20:10:37 +02:00
|
|
|
void move_to_front();
|
2018-10-14 00:21:42 +02:00
|
|
|
|
2021-02-01 11:23:54 +01:00
|
|
|
void start_interactive_resize();
|
2019-05-03 01:38:24 +02:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
Widget* main_widget() { return m_main_widget; }
|
2022-04-01 20:58:27 +03:00
|
|
|
Widget const* main_widget() const { return m_main_widget; }
|
2020-02-02 15:07:41 +01:00
|
|
|
void set_main_widget(Widget*);
|
2019-01-26 11:24:16 +01:00
|
|
|
|
2021-11-24 13:12:39 +01:00
|
|
|
template<class T, class... Args>
|
|
|
|
|
inline ErrorOr<NonnullRefPtr<T>> try_set_main_widget(Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
auto widget = TRY(T::try_create(forward<Args>(args)...));
|
|
|
|
|
set_main_widget(widget.ptr());
|
|
|
|
|
return widget;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 21:42:48 +01:00
|
|
|
template<class T, class... Args>
|
|
|
|
|
inline T& set_main_widget(Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
auto widget = T::construct(forward<Args>(args)...);
|
|
|
|
|
set_main_widget(widget.ptr());
|
|
|
|
|
return *widget;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-24 14:14:34 -05:00
|
|
|
Widget* default_return_key_widget() { return m_default_return_key_widget; }
|
|
|
|
|
Widget const* default_return_key_widget() const { return m_default_return_key_widget; }
|
|
|
|
|
void set_default_return_key_widget(Widget*);
|
|
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
Widget* focused_widget() { return m_focused_widget; }
|
2022-04-01 20:58:27 +03:00
|
|
|
Widget const* focused_widget() const { return m_focused_widget; }
|
2020-08-14 19:56:40 +02:00
|
|
|
void set_focused_widget(Widget*, FocusSource = FocusSource::Programmatic);
|
2019-01-20 05:48:43 +01:00
|
|
|
|
2019-12-27 11:34:40 +01:00
|
|
|
void update();
|
2022-04-01 20:58:27 +03:00
|
|
|
void update(Gfx::IntRect const&);
|
2019-01-20 05:48:43 +01:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
void set_automatic_cursor_tracking_widget(Widget*);
|
|
|
|
|
Widget* automatic_cursor_tracking_widget() { return m_automatic_cursor_tracking_widget.ptr(); }
|
2022-04-01 20:58:27 +03:00
|
|
|
Widget const* automatic_cursor_tracking_widget() const { return m_automatic_cursor_tracking_widget.ptr(); }
|
2019-03-24 15:01:56 +01:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
Widget* hovered_widget() { return m_hovered_widget.ptr(); }
|
2022-04-01 20:58:27 +03:00
|
|
|
Widget const* hovered_widget() const { return m_hovered_widget.ptr(); }
|
2020-02-02 15:07:41 +01:00
|
|
|
void set_hovered_widget(Widget*);
|
2019-02-20 10:12:19 +01:00
|
|
|
|
2021-01-15 09:38:12 +01:00
|
|
|
Gfx::Bitmap* back_bitmap();
|
2019-02-20 21:59:13 +01:00
|
|
|
|
2020-06-10 10:57:59 +02:00
|
|
|
Gfx::IntSize size_increment() const { return m_size_increment; }
|
2022-04-01 20:58:27 +03:00
|
|
|
void set_size_increment(Gfx::IntSize const&);
|
2020-06-10 10:57:59 +02:00
|
|
|
Gfx::IntSize base_size() const { return m_base_size; }
|
2022-04-01 20:58:27 +03:00
|
|
|
void set_base_size(Gfx::IntSize const&);
|
|
|
|
|
Optional<Gfx::IntSize> const& resize_aspect_ratio() const { return m_resize_aspect_ratio; }
|
2020-08-21 14:19:10 -06:00
|
|
|
void set_resize_aspect_ratio(int width, int height) { set_resize_aspect_ratio(Gfx::IntSize(width, height)); }
|
|
|
|
|
void set_no_resize_aspect_ratio() { set_resize_aspect_ratio({}); }
|
2022-04-01 20:58:27 +03:00
|
|
|
void set_resize_aspect_ratio(Optional<Gfx::IntSize> const& ratio);
|
2019-02-21 00:21:23 +01:00
|
|
|
|
2020-09-10 20:55:39 +02:00
|
|
|
void set_cursor(Gfx::StandardCursor);
|
2021-10-15 22:24:41 +02:00
|
|
|
void set_cursor(NonnullRefPtr<Gfx::Bitmap>);
|
2019-03-31 23:52:02 +02:00
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
void set_icon(Gfx::Bitmap const*);
|
2019-08-02 14:02:56 -05:00
|
|
|
void apply_icon();
|
2022-04-01 20:58:27 +03:00
|
|
|
Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
|
2019-07-28 10:18:49 +02:00
|
|
|
|
2021-06-08 19:36:27 +04:30
|
|
|
Vector<Widget&> focusable_widgets(FocusSource) const;
|
2019-05-15 02:39:58 +02:00
|
|
|
|
2019-10-26 12:27:01 +02:00
|
|
|
void schedule_relayout();
|
|
|
|
|
|
2021-01-16 15:56:41 +11:00
|
|
|
void refresh_system_theme();
|
|
|
|
|
|
2022-02-25 12:39:33 +02:00
|
|
|
static void for_each_window(Badge<ConnectionToWindowServer>, Function<void(Window&)>);
|
|
|
|
|
static void update_all_windows(Badge<ConnectionToWindowServer>);
|
2022-04-05 17:40:53 +02:00
|
|
|
void notify_state_changed(Badge<ConnectionToWindowServer>, bool minimized, bool maximized, bool occluded);
|
2022-09-07 07:49:00 -04:00
|
|
|
void notify_input_preempted(Badge<ConnectionToWindowServer>, InputPreemptor);
|
2019-12-23 20:24:26 +01:00
|
|
|
|
2019-12-29 15:58:07 +01:00
|
|
|
virtual bool is_visible_for_timer_purposes() const override { return m_visible_for_timer_purposes; }
|
|
|
|
|
|
2022-02-05 18:39:34 +11:00
|
|
|
Action* action_for_shortcut(Shortcut const&);
|
2020-02-02 01:57:57 +01:00
|
|
|
|
2020-05-21 17:26:09 +02:00
|
|
|
void did_add_widget(Badge<Widget>, Widget&);
|
|
|
|
|
void did_remove_widget(Badge<Widget>, Widget&);
|
2020-03-05 15:30:11 +01:00
|
|
|
|
2020-05-01 22:59:38 +02:00
|
|
|
Window* find_parent_window();
|
|
|
|
|
|
2021-05-02 10:42:25 +02:00
|
|
|
void set_progress(Optional<int>);
|
2020-05-30 22:08:26 +02:00
|
|
|
|
2020-09-11 14:17:35 +02:00
|
|
|
void update_cursor(Badge<Widget>) { update_cursor(); }
|
|
|
|
|
|
2020-12-28 00:33:46 +01:00
|
|
|
void did_disable_focused_widget(Badge<Widget>);
|
|
|
|
|
|
2021-07-21 21:21:03 +02:00
|
|
|
Menu& add_menu(String name);
|
2021-11-24 13:12:09 +01:00
|
|
|
ErrorOr<NonnullRefPtr<Menu>> try_add_menu(String name);
|
2022-04-01 20:58:27 +03:00
|
|
|
void flash_menubar_menu_for(MenuItem const&);
|
2021-03-25 21:01:19 +01:00
|
|
|
|
2021-10-23 17:53:11 +02:00
|
|
|
void flush_pending_paints_immediately();
|
|
|
|
|
|
2022-01-30 13:43:50 +01:00
|
|
|
Menubar& menubar() { return *m_menubar; }
|
|
|
|
|
Menubar const& menubar() const { return *m_menubar; }
|
|
|
|
|
|
2022-09-09 07:21:31 -04:00
|
|
|
void set_blocks_command_palette(bool b) { m_blocks_command_palette = b; }
|
|
|
|
|
bool blocks_command_palette() const { return m_blocks_command_palette; }
|
|
|
|
|
|
|
|
|
|
void set_blocks_emoji_input(bool b) { m_blocks_emoji_input = b; }
|
|
|
|
|
bool blocks_emoji_input() const { return m_blocks_emoji_input; }
|
|
|
|
|
|
2019-04-03 21:03:12 +02:00
|
|
|
protected:
|
2020-02-02 15:07:41 +01:00
|
|
|
Window(Core::Object* parent = nullptr);
|
|
|
|
|
virtual void wm_event(WMEvent&);
|
2021-06-13 06:16:06 -06:00
|
|
|
virtual void screen_rects_change_event(ScreenRectsChangeEvent&);
|
2021-08-24 13:01:01 +01:00
|
|
|
virtual void applet_area_rect_change_event(AppletAreaRectChangeEvent&);
|
2019-04-03 21:03:12 +02:00
|
|
|
|
2021-07-25 21:07:55 +00:00
|
|
|
virtual void enter_event(Core::Event&);
|
|
|
|
|
virtual void leave_event(Core::Event&);
|
|
|
|
|
|
2019-03-20 22:31:21 +01:00
|
|
|
private:
|
2022-07-04 05:34:09 +02:00
|
|
|
void update_min_size();
|
|
|
|
|
|
2020-09-11 14:17:35 +02:00
|
|
|
void update_cursor();
|
2020-10-30 16:57:51 +01:00
|
|
|
void focus_a_widget_if_possible(FocusSource);
|
2020-09-11 14:17:35 +02:00
|
|
|
|
2020-07-24 01:03:24 +02:00
|
|
|
void handle_drop_event(DropEvent&);
|
|
|
|
|
void handle_mouse_event(MouseEvent&);
|
|
|
|
|
void handle_multi_paint_event(MultiPaintEvent&);
|
|
|
|
|
void handle_key_event(KeyEvent&);
|
|
|
|
|
void handle_resize_event(ResizeEvent&);
|
|
|
|
|
void handle_input_entered_or_left_event(Core::Event&);
|
|
|
|
|
void handle_became_active_or_inactive_event(Core::Event&);
|
|
|
|
|
void handle_close_request();
|
|
|
|
|
void handle_theme_change_event(ThemeChangeEvent&);
|
2021-07-12 09:57:34 +02:00
|
|
|
void handle_fonts_change_event(FontsChangeEvent&);
|
2021-06-13 06:16:06 -06:00
|
|
|
void handle_screen_rects_change_event(ScreenRectsChangeEvent&);
|
2021-08-24 13:01:01 +01:00
|
|
|
void handle_applet_area_rect_change_event(AppletAreaRectChangeEvent&);
|
2020-07-24 01:03:24 +02:00
|
|
|
void handle_drag_move_event(DragEvent&);
|
2021-07-25 21:07:55 +00:00
|
|
|
void handle_entered_event(Core::Event&);
|
|
|
|
|
void handle_left_event(Core::Event&);
|
2020-07-24 01:03:24 +02:00
|
|
|
|
2020-05-01 23:53:05 +02:00
|
|
|
void server_did_destroy();
|
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
OwnPtr<WindowBackingStore> create_backing_store(Gfx::IntSize const&);
|
2021-01-15 09:38:12 +01:00
|
|
|
void set_current_backing_store(WindowBackingStore&, bool flush_immediately = false);
|
2022-04-01 20:58:27 +03:00
|
|
|
void flip(Vector<Gfx::IntRect, 32> const& dirty_rects);
|
2020-02-19 16:45:06 +01:00
|
|
|
void force_update();
|
2019-03-17 04:23:54 +01:00
|
|
|
|
2021-10-15 22:24:41 +02:00
|
|
|
bool are_cursors_the_same(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> const&, AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> const&) const;
|
|
|
|
|
|
2021-06-01 22:08:47 -06:00
|
|
|
WeakPtr<Widget> m_previously_focused_widget;
|
|
|
|
|
|
2021-01-15 09:38:12 +01:00
|
|
|
OwnPtr<WindowBackingStore> m_front_store;
|
|
|
|
|
OwnPtr<WindowBackingStore> m_back_store;
|
|
|
|
|
|
2021-07-29 10:14:12 +00:00
|
|
|
NonnullRefPtr<Menubar> m_menubar;
|
2021-03-25 21:01:19 +01:00
|
|
|
|
2020-02-06 11:56:38 +01:00
|
|
|
RefPtr<Gfx::Bitmap> m_icon;
|
2019-01-30 20:03:52 +01:00
|
|
|
int m_window_id { 0 };
|
2019-02-19 01:42:53 +01:00
|
|
|
float m_opacity_when_windowless { 1.0f };
|
2021-02-14 16:42:37 -07:00
|
|
|
float m_alpha_hit_threshold { 0.0f };
|
2020-02-02 15:07:41 +01:00
|
|
|
RefPtr<Widget> m_main_widget;
|
2022-01-24 14:14:34 -05:00
|
|
|
WeakPtr<Widget> m_default_return_key_widget;
|
2020-02-02 15:07:41 +01:00
|
|
|
WeakPtr<Widget> m_focused_widget;
|
|
|
|
|
WeakPtr<Widget> m_automatic_cursor_tracking_widget;
|
|
|
|
|
WeakPtr<Widget> m_hovered_widget;
|
2020-06-10 10:57:59 +02:00
|
|
|
Gfx::IntRect m_rect_when_windowless;
|
2022-08-17 19:08:18 -04:00
|
|
|
Gfx::IntSize m_minimum_size_when_windowless { 0, 0 };
|
2019-01-30 20:03:52 +01:00
|
|
|
String m_title_when_windowless;
|
2020-06-10 10:57:59 +02:00
|
|
|
Vector<Gfx::IntRect, 32> m_pending_paint_event_rects;
|
|
|
|
|
Gfx::IntSize m_size_increment;
|
|
|
|
|
Gfx::IntSize m_base_size;
|
2020-02-02 15:07:41 +01:00
|
|
|
WindowType m_window_type { WindowType::Normal };
|
2022-08-18 11:00:08 -04:00
|
|
|
WindowMode m_window_mode { WindowMode::Modeless };
|
2021-10-15 22:24:41 +02:00
|
|
|
AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> m_cursor { Gfx::StandardCursor::None };
|
|
|
|
|
AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> m_effective_cursor { Gfx::StandardCursor::None };
|
2020-07-14 19:17:00 -06:00
|
|
|
bool m_is_active_input { false };
|
2019-02-19 01:42:53 +01:00
|
|
|
bool m_has_alpha_channel { false };
|
2019-03-17 04:23:54 +01:00
|
|
|
bool m_double_buffering_enabled { true };
|
2019-03-19 00:52:39 +01:00
|
|
|
bool m_resizable { true };
|
2022-06-29 03:14:55 +02:00
|
|
|
bool m_obey_widget_min_size { true };
|
2020-08-21 14:19:10 -06:00
|
|
|
Optional<Gfx::IntSize> m_resize_aspect_ratio {};
|
2020-01-04 13:12:02 +02:00
|
|
|
bool m_minimizable { true };
|
2021-10-21 09:09:58 -04:00
|
|
|
bool m_closeable { true };
|
2022-04-05 17:40:53 +02:00
|
|
|
bool m_maximized { false };
|
2019-05-17 21:33:44 +02:00
|
|
|
bool m_fullscreen { false };
|
2020-05-01 23:26:32 +02:00
|
|
|
bool m_frameless { false };
|
2021-07-04 23:10:53 +02:00
|
|
|
bool m_forced_shadow { false };
|
2019-10-26 12:27:01 +02:00
|
|
|
bool m_layout_pending { false };
|
2019-12-29 15:58:07 +01:00
|
|
|
bool m_visible_for_timer_purposes { true };
|
2020-03-12 11:32:28 +00:00
|
|
|
bool m_visible { false };
|
2020-07-30 19:52:45 -06:00
|
|
|
bool m_moved_by_client { false };
|
2022-09-09 07:21:31 -04:00
|
|
|
bool m_blocks_command_palette { false };
|
|
|
|
|
bool m_blocks_emoji_input { false };
|
2018-10-12 01:03:22 +02:00
|
|
|
};
|
2020-02-02 01:57:57 +01:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
}
|
2021-01-16 15:51:56 +01:00
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
struct AK::Formatter<GUI::Window> : Formatter<Core::Object> {
|
|
|
|
|
};
|