mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:57:35 +00:00
AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.
This commit is contained in:
parent
77b9fa89dd
commit
90b1354688
188 changed files with 562 additions and 562 deletions
|
@ -5,7 +5,7 @@
|
|||
#include <WindowServer/WSEvent.h>
|
||||
#include <WindowServer/WSWindowManager.h>
|
||||
|
||||
WSButton::WSButton(WSWindowFrame& frame, Retained<CharacterBitmap>&& bitmap, Function<void(WSButton&)>&& on_click_handler)
|
||||
WSButton::WSButton(WSWindowFrame& frame, NonnullRefPtr<CharacterBitmap>&& bitmap, Function<void(WSButton&)>&& on_click_handler)
|
||||
: on_click(move(on_click_handler))
|
||||
, m_frame(frame)
|
||||
, m_bitmap(move(bitmap))
|
||||
|
|
|
@ -12,7 +12,7 @@ class WSWindowFrame;
|
|||
|
||||
class WSButton : public Weakable<WSButton> {
|
||||
public:
|
||||
WSButton(WSWindowFrame&, Retained<CharacterBitmap>&&, Function<void(WSButton&)>&& on_click_handler);
|
||||
WSButton(WSWindowFrame&, NonnullRefPtr<CharacterBitmap>&&, Function<void(WSButton&)>&& on_click_handler);
|
||||
~WSButton();
|
||||
|
||||
Rect relative_rect() const { return m_relative_rect; }
|
||||
|
@ -34,7 +34,7 @@ public:
|
|||
private:
|
||||
WSWindowFrame& m_frame;
|
||||
Rect m_relative_rect;
|
||||
Retained<CharacterBitmap> m_bitmap;
|
||||
NonnullRefPtr<CharacterBitmap> m_bitmap;
|
||||
bool m_pressed { false };
|
||||
bool m_visible { true };
|
||||
bool m_hovered { false };
|
||||
|
|
|
@ -483,7 +483,7 @@ void WSClientConnection::handle_request(const WSAPIGetClipboardContentsRequest&)
|
|||
// FIXME: Optimize case where an app is copy/pasting within itself.
|
||||
// We can just reuse the SharedBuffer then, since it will have the same peer PID.
|
||||
// It would be even nicer if a SharedBuffer could have an arbitrary number of clients..
|
||||
RetainPtr<SharedBuffer> shared_buffer = SharedBuffer::create(m_pid, WSClipboard::the().size());
|
||||
RefPtr<SharedBuffer> shared_buffer = SharedBuffer::create(m_pid, WSClipboard::the().size());
|
||||
ASSERT(shared_buffer);
|
||||
memcpy(shared_buffer->data(), WSClipboard::the().data(), WSClipboard::the().size());
|
||||
shared_buffer->seal();
|
||||
|
|
|
@ -98,7 +98,7 @@ private:
|
|||
int m_next_menu_id { 20000 };
|
||||
int m_next_window_id { 1982 };
|
||||
|
||||
RetainPtr<SharedBuffer> m_last_sent_clipboard_content;
|
||||
RefPtr<SharedBuffer> m_last_sent_clipboard_content;
|
||||
};
|
||||
|
||||
template<typename Matching, typename Callback>
|
||||
|
|
|
@ -36,7 +36,7 @@ void WSClipboard::clear()
|
|||
m_contents_size = 0;
|
||||
}
|
||||
|
||||
void WSClipboard::set_data(Retained<SharedBuffer>&& data, int contents_size)
|
||||
void WSClipboard::set_data(NonnullRefPtr<SharedBuffer>&& data, int contents_size)
|
||||
{
|
||||
dbgprintf("WSClipboard::set_data <- %p (%u bytes)\n", data->data(), contents_size);
|
||||
m_shared_buffer = move(data);
|
||||
|
|
|
@ -17,11 +17,11 @@ public:
|
|||
int size() const;
|
||||
|
||||
void clear();
|
||||
void set_data(Retained<SharedBuffer>&&, int contents_size);
|
||||
void set_data(NonnullRefPtr<SharedBuffer>&&, int contents_size);
|
||||
|
||||
private:
|
||||
WSClipboard();
|
||||
|
||||
RetainPtr<SharedBuffer> m_shared_buffer;
|
||||
RefPtr<SharedBuffer> m_shared_buffer;
|
||||
int m_contents_size { 0 };
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ void WSCompositor::compose()
|
|||
return IterationDecision::Continue;
|
||||
PainterStateSaver saver(*m_back_painter);
|
||||
m_back_painter->add_clip_rect(window.frame().rect());
|
||||
RetainPtr<GraphicsBitmap> backing_store = window.backing_store();
|
||||
RefPtr<GraphicsBitmap> backing_store = window.backing_store();
|
||||
for (auto& dirty_rect : dirty_rects.rects()) {
|
||||
if (wm.any_opaque_window_above_this_one_contains_rect(window, dirty_rect))
|
||||
continue;
|
||||
|
@ -226,7 +226,7 @@ bool WSCompositor::set_wallpaper(const String& path, Function<void(bool)>&& call
|
|||
{
|
||||
struct Context {
|
||||
String path;
|
||||
RetainPtr<GraphicsBitmap> bitmap;
|
||||
RefPtr<GraphicsBitmap> bitmap;
|
||||
Function<void(bool)> callback;
|
||||
};
|
||||
auto context = make<Context>();
|
||||
|
@ -254,7 +254,7 @@ bool WSCompositor::set_wallpaper(const String& path, Function<void(bool)>&& call
|
|||
return true;
|
||||
}
|
||||
|
||||
void WSCompositor::finish_setting_wallpaper(const String& path, Retained<GraphicsBitmap>&& bitmap)
|
||||
void WSCompositor::finish_setting_wallpaper(const String& path, NonnullRefPtr<GraphicsBitmap>&& bitmap)
|
||||
{
|
||||
m_wallpaper_path = path;
|
||||
m_wallpaper = move(bitmap);
|
||||
|
|
|
@ -43,7 +43,7 @@ private:
|
|||
void draw_cursor();
|
||||
void draw_geometry_label();
|
||||
void draw_menubar();
|
||||
void finish_setting_wallpaper(const String& path, Retained<GraphicsBitmap>&&);
|
||||
void finish_setting_wallpaper(const String& path, NonnullRefPtr<GraphicsBitmap>&&);
|
||||
|
||||
unsigned m_compose_count { 0 };
|
||||
unsigned m_flush_count { 0 };
|
||||
|
@ -52,8 +52,8 @@ private:
|
|||
bool m_flash_flush { false };
|
||||
bool m_buffers_are_flipped { false };
|
||||
|
||||
RetainPtr<GraphicsBitmap> m_front_bitmap;
|
||||
RetainPtr<GraphicsBitmap> m_back_bitmap;
|
||||
RefPtr<GraphicsBitmap> m_front_bitmap;
|
||||
RefPtr<GraphicsBitmap> m_back_bitmap;
|
||||
OwnPtr<Painter> m_back_painter;
|
||||
OwnPtr<Painter> m_front_painter;
|
||||
|
||||
|
@ -64,5 +64,5 @@ private:
|
|||
|
||||
String m_wallpaper_path;
|
||||
WallpaperMode m_wallpaper_mode { WallpaperMode::Unchecked };
|
||||
RetainPtr<GraphicsBitmap> m_wallpaper;
|
||||
RefPtr<GraphicsBitmap> m_wallpaper;
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <WindowServer/WSCursor.h>
|
||||
#include <WindowServer/WSWindowManager.h>
|
||||
|
||||
WSCursor::WSCursor(Retained<GraphicsBitmap>&& bitmap, const Point& hotspot)
|
||||
WSCursor::WSCursor(NonnullRefPtr<GraphicsBitmap>&& bitmap, const Point& hotspot)
|
||||
: m_bitmap(move(bitmap))
|
||||
, m_hotspot(hotspot)
|
||||
{
|
||||
|
@ -11,17 +11,17 @@ WSCursor::~WSCursor()
|
|||
{
|
||||
}
|
||||
|
||||
Retained<WSCursor> WSCursor::create(Retained<GraphicsBitmap>&& bitmap)
|
||||
NonnullRefPtr<WSCursor> WSCursor::create(NonnullRefPtr<GraphicsBitmap>&& bitmap)
|
||||
{
|
||||
return adopt(*new WSCursor(move(bitmap), bitmap->rect().center()));
|
||||
}
|
||||
|
||||
Retained<WSCursor> WSCursor::create(Retained<GraphicsBitmap>&& bitmap, const Point& hotspot)
|
||||
NonnullRefPtr<WSCursor> WSCursor::create(NonnullRefPtr<GraphicsBitmap>&& bitmap, const Point& hotspot)
|
||||
{
|
||||
return adopt(*new WSCursor(move(bitmap), hotspot));
|
||||
}
|
||||
|
||||
RetainPtr<WSCursor> WSCursor::create(WSStandardCursor standard_cursor)
|
||||
RefPtr<WSCursor> WSCursor::create(WSStandardCursor standard_cursor)
|
||||
{
|
||||
switch (standard_cursor) {
|
||||
case WSStandardCursor::None:
|
||||
|
|
|
@ -14,9 +14,9 @@ enum class WSStandardCursor {
|
|||
|
||||
class WSCursor : public RefCounted<WSCursor> {
|
||||
public:
|
||||
static Retained<WSCursor> create(Retained<GraphicsBitmap>&&, const Point& hotspot);
|
||||
static Retained<WSCursor> create(Retained<GraphicsBitmap>&&);
|
||||
static RetainPtr<WSCursor> create(WSStandardCursor);
|
||||
static NonnullRefPtr<WSCursor> create(NonnullRefPtr<GraphicsBitmap>&&, const Point& hotspot);
|
||||
static NonnullRefPtr<WSCursor> create(NonnullRefPtr<GraphicsBitmap>&&);
|
||||
static RefPtr<WSCursor> create(WSStandardCursor);
|
||||
~WSCursor();
|
||||
|
||||
Point hotspot() const { return m_hotspot; }
|
||||
|
@ -26,8 +26,8 @@ public:
|
|||
Size size() const { return m_bitmap->size(); }
|
||||
|
||||
private:
|
||||
WSCursor(Retained<GraphicsBitmap>&&, const Point&);
|
||||
WSCursor(NonnullRefPtr<GraphicsBitmap>&&, const Point&);
|
||||
|
||||
RetainPtr<GraphicsBitmap> m_bitmap;
|
||||
RefPtr<GraphicsBitmap> m_bitmap;
|
||||
Point m_hotspot;
|
||||
};
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
virtual void event(CEvent&) override;
|
||||
|
||||
GraphicsBitmap* backing_store() { return m_backing_store.ptr(); }
|
||||
void set_backing_store(RetainPtr<GraphicsBitmap>&& backing_store)
|
||||
void set_backing_store(RefPtr<GraphicsBitmap>&& backing_store)
|
||||
{
|
||||
m_last_backing_store = move(m_backing_store);
|
||||
m_backing_store = move(backing_store);
|
||||
|
@ -129,7 +129,7 @@ public:
|
|||
|
||||
const GraphicsBitmap& icon() const { return *m_icon; }
|
||||
String icon_path() const { return m_icon_path; }
|
||||
void set_icon(const String& path, Retained<GraphicsBitmap>&& icon)
|
||||
void set_icon(const String& path, NonnullRefPtr<GraphicsBitmap>&& icon)
|
||||
{
|
||||
m_icon_path = path;
|
||||
m_icon = move(icon);
|
||||
|
@ -137,7 +137,7 @@ public:
|
|||
void set_default_icon();
|
||||
|
||||
const WSCursor* override_cursor() const { return m_override_cursor.ptr(); }
|
||||
void set_override_cursor(RetainPtr<WSCursor>&& cursor) { m_override_cursor = move(cursor); }
|
||||
void set_override_cursor(RefPtr<WSCursor>&& cursor) { m_override_cursor = move(cursor); }
|
||||
|
||||
void request_update(const Rect&);
|
||||
DisjointRectSet take_pending_paint_rects() { return move(m_pending_paint_rects); }
|
||||
|
@ -166,15 +166,15 @@ private:
|
|||
bool m_maximized { false };
|
||||
bool m_fullscreen { false };
|
||||
bool m_show_titlebar { true };
|
||||
RetainPtr<GraphicsBitmap> m_backing_store;
|
||||
RetainPtr<GraphicsBitmap> m_last_backing_store;
|
||||
RefPtr<GraphicsBitmap> m_backing_store;
|
||||
RefPtr<GraphicsBitmap> m_last_backing_store;
|
||||
int m_window_id { -1 };
|
||||
float m_opacity { 1 };
|
||||
Size m_size_increment;
|
||||
Size m_base_size;
|
||||
Retained<GraphicsBitmap> m_icon;
|
||||
NonnullRefPtr<GraphicsBitmap> m_icon;
|
||||
String m_icon_path;
|
||||
RetainPtr<WSCursor> m_override_cursor;
|
||||
RefPtr<WSCursor> m_override_cursor;
|
||||
WSWindowFrame m_frame;
|
||||
Color m_background_color { Color::LightGray };
|
||||
unsigned m_wm_event_mask { 0 };
|
||||
|
|
|
@ -109,7 +109,7 @@ WSWindowManager::~WSWindowManager()
|
|||
{
|
||||
}
|
||||
|
||||
Retained<WSCursor> WSWindowManager::get_cursor(const String& name, const Point& hotspot)
|
||||
NonnullRefPtr<WSCursor> WSWindowManager::get_cursor(const String& name, const Point& hotspot)
|
||||
{
|
||||
auto path = m_wm_config->read_entry("Cursor", name, "/res/cursors/arrow.png");
|
||||
auto gb = GraphicsBitmap::load_from_file(path);
|
||||
|
@ -118,7 +118,7 @@ Retained<WSCursor> WSWindowManager::get_cursor(const String& name, const Point&
|
|||
return WSCursor::create(*GraphicsBitmap::load_from_file("/res/cursors/arrow.png"));
|
||||
}
|
||||
|
||||
Retained<WSCursor> WSWindowManager::get_cursor(const String& name)
|
||||
NonnullRefPtr<WSCursor> WSWindowManager::get_cursor(const String& name)
|
||||
{
|
||||
auto path = m_wm_config->read_entry("Cursor", name, "/res/cursors/arrow.png");
|
||||
auto gb = GraphicsBitmap::load_from_file(path);
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
WSWindowManager();
|
||||
virtual ~WSWindowManager() override;
|
||||
|
||||
RetainPtr<CConfigFile> wm_config() const { return m_wm_config; }
|
||||
RefPtr<CConfigFile> wm_config() const { return m_wm_config; }
|
||||
void reload_config(bool);
|
||||
|
||||
void add_window(WSWindow&);
|
||||
|
@ -142,8 +142,8 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Retained<WSCursor> get_cursor(const String& name);
|
||||
Retained<WSCursor> get_cursor(const String& name, const Point& hotspot);
|
||||
NonnullRefPtr<WSCursor> get_cursor(const String& name);
|
||||
NonnullRefPtr<WSCursor> get_cursor(const String& name, const Point& hotspot);
|
||||
|
||||
void process_mouse_event(WSMouseEvent&, WSWindow*& hovered_window);
|
||||
void process_event_for_doubleclick(WSWindow& window, WSMouseEvent& event);
|
||||
|
@ -175,14 +175,14 @@ private:
|
|||
void tell_wm_listener_about_window_rect(WSWindow& listener, WSWindow&);
|
||||
void pick_new_active_window();
|
||||
|
||||
RetainPtr<WSCursor> m_arrow_cursor;
|
||||
RetainPtr<WSCursor> m_resize_horizontally_cursor;
|
||||
RetainPtr<WSCursor> m_resize_vertically_cursor;
|
||||
RetainPtr<WSCursor> m_resize_diagonally_tlbr_cursor;
|
||||
RetainPtr<WSCursor> m_resize_diagonally_bltr_cursor;
|
||||
RetainPtr<WSCursor> m_i_beam_cursor;
|
||||
RetainPtr<WSCursor> m_disallowed_cursor;
|
||||
RetainPtr<WSCursor> m_move_cursor;
|
||||
RefPtr<WSCursor> m_arrow_cursor;
|
||||
RefPtr<WSCursor> m_resize_horizontally_cursor;
|
||||
RefPtr<WSCursor> m_resize_vertically_cursor;
|
||||
RefPtr<WSCursor> m_resize_diagonally_tlbr_cursor;
|
||||
RefPtr<WSCursor> m_resize_diagonally_bltr_cursor;
|
||||
RefPtr<WSCursor> m_i_beam_cursor;
|
||||
RefPtr<WSCursor> m_disallowed_cursor;
|
||||
RefPtr<WSCursor> m_move_cursor;
|
||||
|
||||
Color m_background_color;
|
||||
Color m_active_window_border_color;
|
||||
|
@ -245,7 +245,7 @@ private:
|
|||
WeakPtr<WSButton> m_cursor_tracking_button;
|
||||
WeakPtr<WSButton> m_hovered_button;
|
||||
|
||||
RetainPtr<CConfigFile> m_wm_config;
|
||||
RefPtr<CConfigFile> m_wm_config;
|
||||
};
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue