| 
									
										
										
										
											2020-01-18 09:38:21 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Redistribution and use in source and binary forms, with or without | 
					
						
							|  |  |  |  * modification, are permitted provided that the following conditions are met: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 1. Redistributions of source code must retain the above copyright notice, this | 
					
						
							|  |  |  |  *    list of conditions and the following disclaimer. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 2. Redistributions in binary form must reproduce the above copyright notice, | 
					
						
							|  |  |  |  *    this list of conditions and the following disclaimer in the documentation | 
					
						
							|  |  |  |  *    and/or other materials provided with the distribution. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 
					
						
							|  |  |  |  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 
					
						
							|  |  |  |  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 
					
						
							|  |  |  |  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | 
					
						
							|  |  |  |  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 
					
						
							|  |  |  |  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 
					
						
							|  |  |  |  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | 
					
						
							|  |  |  |  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 
					
						
							|  |  |  |  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
					
						
							|  |  |  |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-12 01:03:22 +02:00
										 |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-14 22:29:06 +01:00
										 |  |  | #include <AK/Function.h>
 | 
					
						
							| 
									
										
										
										
											2019-12-23 20:24:26 +01:00
										 |  |  | #include <AK/String.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>
 | 
					
						
							| 
									
										
										
										
											2020-02-14 22:29:06 +01:00
										 |  |  | #include <LibGUI/WindowType.h>
 | 
					
						
							| 
									
										
										
										
											2020-02-14 23:02:47 +01:00
										 |  |  | #include <LibGfx/Color.h>
 | 
					
						
							|  |  |  | #include <LibGfx/Forward.h>
 | 
					
						
							| 
									
										
										
										
											2020-02-06 12:04:00 +01:00
										 |  |  | #include <LibGfx/Rect.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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  | enum class StandardCursor { | 
					
						
							| 
									
										
										
										
											2019-03-31 23:52:02 +02:00
										 |  |  |     None = 0, | 
					
						
							|  |  |  |     Arrow, | 
					
						
							|  |  |  |     IBeam, | 
					
						
							| 
									
										
										
										
											2019-04-02 02:34:09 +02:00
										 |  |  |     ResizeHorizontal, | 
					
						
							|  |  |  |     ResizeVertical, | 
					
						
							| 
									
										
										
										
											2019-05-03 01:38:24 +02:00
										 |  |  |     ResizeDiagonalTLBR, | 
					
						
							|  |  |  |     ResizeDiagonalBLTR, | 
					
						
							| 
									
										
										
										
											2020-07-07 19:19:56 +01:00
										 |  |  |     ResizeColumn, | 
					
						
							|  |  |  |     ResizeRow, | 
					
						
							| 
									
										
										
										
											2019-10-10 21:35:12 +02:00
										 |  |  |     Hand, | 
					
						
							| 
									
										
										
										
											2020-07-07 20:01:29 +01:00
										 |  |  |     Help, | 
					
						
							| 
									
										
										
										
											2020-05-13 00:16:40 +02:00
										 |  |  |     Drag, | 
					
						
							|  |  |  |     Move, | 
					
						
							| 
									
										
										
										
											2020-07-07 20:23:40 +01:00
										 |  |  |     Wait, | 
					
						
							| 
									
										
										
										
											2019-03-31 23:52:02 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-19 00:01:02 +01:00
										 |  |  |     bool is_modal() const { return m_modal; } | 
					
						
							|  |  |  |     void set_modal(bool); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-18 13:31:29 +03:00
										 |  |  |     bool is_maximized() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-01 23:26:32 +02:00
										 |  |  |     bool is_frameless() const { return m_frameless; } | 
					
						
							|  |  |  |     void set_frameless(bool frameless) { m_frameless = frameless; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-20 21:24:02 +02:00
										 |  |  |     bool is_resizable() const { return m_resizable; } | 
					
						
							|  |  |  |     void set_resizable(bool resizable) { m_resizable = resizable; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-04 13:12:02 +02:00
										 |  |  |     bool is_minimizable() const { return m_minimizable; } | 
					
						
							|  |  |  |     void set_minimizable(bool minimizable) { m_minimizable = minimizable; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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); | 
					
						
							|  |  |  |     void set_opacity(float); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-14 14:21:51 +01:00
										 |  |  |     int window_id() const { return m_window_id; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-26 05:20:32 +01:00
										 |  |  |     String title() const; | 
					
						
							| 
									
										
										
										
											2019-06-02 14:58:02 +02:00
										 |  |  |     void set_title(const StringView&); | 
					
						
							| 
									
										
										
										
											2018-10-12 01:03:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-10 14:29:47 +02:00
										 |  |  |     Color background_color() const { return m_background_color; } | 
					
						
							|  |  |  |     void set_background_color(Color color) { m_background_color = color; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-27 20:35:37 +02:00
										 |  |  |     enum class CloseRequestDecision { | 
					
						
							|  |  |  |         StayOpen, | 
					
						
							|  |  |  |         Close, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Function<CloseRequestDecision()> on_close_request; | 
					
						
							| 
									
										
										
										
											2020-07-14 19:17:00 -06:00
										 |  |  |     Function<void(bool is_active_input)> on_active_input_change; | 
					
						
							| 
									
										
										
										
											2020-07-13 19:14:44 -04:00
										 |  |  |     Function<void(const bool is_active)> on_activity_change; | 
					
						
							| 
									
										
										
										
											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; | 
					
						
							| 
									
										
										
										
											2020-07-24 16:16:30 -04:00
										 |  |  |     Gfx::IntRect rect_in_menubar() const; | 
					
						
							| 
									
										
										
										
											2020-06-10 10:57:59 +02:00
										 |  |  |     Gfx::IntSize size() const { return rect().size(); } | 
					
						
							|  |  |  |     void set_rect(const Gfx::IntRect&); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-11 06:09:54 +01:00
										 |  |  |     void move_to(int x, int y) { move_to({ x, y }); } | 
					
						
							| 
									
										
										
										
											2020-06-10 10:57:59 +02:00
										 |  |  |     void move_to(const Gfx::IntPoint& 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 }); } | 
					
						
							| 
									
										
										
										
											2020-06-10 10:57:59 +02:00
										 |  |  |     void resize(const Gfx::IntSize& size) { set_rect({ position(), size }); } | 
					
						
							| 
									
										
										
										
											2019-04-26 17:33:20 +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; | 
					
						
							| 
									
										
										
										
											2019-01-26 21:58:43 +01:00
										 |  |  |     bool is_active() const { return m_is_active; } | 
					
						
							| 
									
										
										
										
											2020-07-14 19:17:00 -06:00
										 |  |  |     bool is_active_input() const { return m_is_active_input; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool is_accessory() const { return m_accessory; } | 
					
						
							|  |  |  |     void set_accessory(bool accessory) { m_accessory = accessory; } | 
					
						
							| 
									
										
										
										
											2018-10-14 01:23:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-03 01:38:24 +02:00
										 |  |  |     void start_wm_resize(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     Widget* main_widget() { return m_main_widget; } | 
					
						
							|  |  |  |     const Widget* main_widget() const { return m_main_widget; } | 
					
						
							|  |  |  |     void set_main_widget(Widget*); | 
					
						
							| 
									
										
										
										
											2019-01-26 11:24:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     Widget* focused_widget() { return m_focused_widget; } | 
					
						
							|  |  |  |     const Widget* 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(); | 
					
						
							| 
									
										
										
										
											2020-06-10 10:57:59 +02:00
										 |  |  |     void update(const Gfx::IntRect&); | 
					
						
							| 
									
										
										
										
											2019-01-20 05:48:43 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     void set_global_cursor_tracking_widget(Widget*); | 
					
						
							|  |  |  |     Widget* global_cursor_tracking_widget() { return m_global_cursor_tracking_widget.ptr(); } | 
					
						
							|  |  |  |     const Widget* global_cursor_tracking_widget() const { return m_global_cursor_tracking_widget.ptr(); } | 
					
						
							| 
									
										
										
										
											2019-01-27 08:48:34 +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(); } | 
					
						
							|  |  |  |     const Widget* 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(); } | 
					
						
							|  |  |  |     const Widget* hovered_widget() const { return m_hovered_widget.ptr(); } | 
					
						
							|  |  |  |     void set_hovered_widget(Widget*); | 
					
						
							| 
									
										
										
										
											2019-02-20 10:12:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-06 11:56:38 +01:00
										 |  |  |     Gfx::Bitmap* front_bitmap() { return m_front_bitmap.ptr(); } | 
					
						
							|  |  |  |     Gfx::Bitmap* back_bitmap() { return m_back_bitmap.ptr(); } | 
					
						
							| 
									
										
										
										
											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; } | 
					
						
							|  |  |  |     void set_size_increment(const Gfx::IntSize&); | 
					
						
							|  |  |  |     Gfx::IntSize base_size() const { return m_base_size; } | 
					
						
							|  |  |  |     void set_base_size(const Gfx::IntSize&); | 
					
						
							| 
									
										
										
										
											2019-02-21 00:21:23 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     void set_override_cursor(StandardCursor); | 
					
						
							| 
									
										
										
										
											2020-05-16 13:04:09 +12:00
										 |  |  |     void set_override_cursor(const Gfx::Bitmap&); | 
					
						
							| 
									
										
										
										
											2019-03-31 23:52:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-06 11:56:38 +01:00
										 |  |  |     void set_icon(const Gfx::Bitmap*); | 
					
						
							| 
									
										
										
										
											2019-08-02 14:02:56 -05:00
										 |  |  |     void apply_icon(); | 
					
						
							| 
									
										
										
										
											2020-02-06 11:56:38 +01:00
										 |  |  |     const Gfx::Bitmap* icon() const { return m_icon.ptr(); } | 
					
						
							| 
									
										
										
										
											2019-07-28 10:18:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     Vector<Widget*> focusable_widgets() const; | 
					
						
							| 
									
										
										
										
											2019-05-15 02:39:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-18 20:39:46 +02:00
										 |  |  |     virtual void save_to(AK::JsonObject&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-26 12:27:01 +02:00
										 |  |  |     void schedule_relayout(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-16 13:36:21 +02:00
										 |  |  |     static void for_each_window(Badge<WindowServerConnection>, Function<void(Window&)>); | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     static void update_all_windows(Badge<WindowServerConnection>); | 
					
						
							|  |  |  |     void notify_state_changed(Badge<WindowServerConnection>, bool minimized, bool occluded); | 
					
						
							| 
									
										
										
										
											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; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     Action* action_for_key_event(const KeyEvent&); | 
					
						
							| 
									
										
										
										
											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(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-30 22:08:26 +02:00
										 |  |  |     void set_progress(int); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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&); | 
					
						
							| 
									
										
										
										
											2019-04-03 21:03:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-20 22:31:21 +01:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2019-03-19 02:20:00 +01:00
										 |  |  |     virtual bool is_window() const override final { return true; } | 
					
						
							| 
									
										
										
										
											2019-02-10 14:28:39 +01: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&); | 
					
						
							|  |  |  |     void handle_drag_move_event(DragEvent&); | 
					
						
							|  |  |  |     void handle_left_event(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-01 23:53:05 +02:00
										 |  |  |     void server_did_destroy(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 10:57:59 +02:00
										 |  |  |     RefPtr<Gfx::Bitmap> create_backing_bitmap(const Gfx::IntSize&); | 
					
						
							|  |  |  |     RefPtr<Gfx::Bitmap> create_shared_bitmap(Gfx::BitmapFormat, const Gfx::IntSize&); | 
					
						
							| 
									
										
										
										
											2020-02-06 11:56:38 +01:00
										 |  |  |     void set_current_backing_bitmap(Gfx::Bitmap&, bool flush_immediately = false); | 
					
						
							| 
									
										
										
										
											2020-06-10 10:57:59 +02:00
										 |  |  |     void flip(const Vector<Gfx::IntRect, 32>& dirty_rects); | 
					
						
							| 
									
										
										
										
											2020-02-19 16:45:06 +01:00
										 |  |  |     void force_update(); | 
					
						
							| 
									
										
										
										
											2019-03-17 04:23:54 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-06 11:56:38 +01:00
										 |  |  |     RefPtr<Gfx::Bitmap> m_front_bitmap; | 
					
						
							|  |  |  |     RefPtr<Gfx::Bitmap> m_back_bitmap; | 
					
						
							|  |  |  |     RefPtr<Gfx::Bitmap> m_icon; | 
					
						
							| 
									
										
										
										
											2020-05-16 13:04:09 +12:00
										 |  |  |     RefPtr<Gfx::Bitmap> m_custom_cursor; | 
					
						
							| 
									
										
										
										
											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 }; | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     RefPtr<Widget> m_main_widget; | 
					
						
							|  |  |  |     WeakPtr<Widget> m_focused_widget; | 
					
						
							|  |  |  |     WeakPtr<Widget> m_global_cursor_tracking_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; | 
					
						
							| 
									
										
										
										
											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; | 
					
						
							| 
									
										
										
										
											2019-06-30 09:23:16 +02:00
										 |  |  |     Color m_background_color { Color::WarmGray }; | 
					
						
							| 
									
										
										
										
											2020-02-02 15:07:41 +01:00
										 |  |  |     WindowType m_window_type { WindowType::Normal }; | 
					
						
							| 
									
										
										
										
											2020-03-22 01:07:07 +01:00
										 |  |  |     StandardCursor m_override_cursor { StandardCursor::None }; | 
					
						
							| 
									
										
										
										
											2019-02-19 01:42:53 +01:00
										 |  |  |     bool m_is_active { false }; | 
					
						
							| 
									
										
										
										
											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:01:02 +01:00
										 |  |  |     bool m_modal { false }; | 
					
						
							| 
									
										
										
										
											2019-03-19 00:52:39 +01:00
										 |  |  |     bool m_resizable { true }; | 
					
						
							| 
									
										
										
										
											2020-01-04 13:12:02 +02:00
										 |  |  |     bool m_minimizable { true }; | 
					
						
							| 
									
										
										
										
											2019-05-17 21:33:44 +02:00
										 |  |  |     bool m_fullscreen { false }; | 
					
						
							| 
									
										
										
										
											2020-05-01 23:26:32 +02:00
										 |  |  |     bool m_frameless { 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-14 19:17:00 -06:00
										 |  |  |     bool m_accessory { false }; | 
					
						
							| 
									
										
										
										
											2020-07-30 19:52:45 -06:00
										 |  |  |     bool m_moved_by_client { 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
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-26 17:16:35 +02:00
										 |  |  | AK_BEGIN_TYPE_TRAITS(GUI::Window) | 
					
						
							|  |  |  | static bool is_type(const Core::Object& object) { return object.is_window(); } | 
					
						
							|  |  |  | AK_END_TYPE_TRAITS() |