mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
WindowServer+LibGUI: Remove old "icon path" way of doing things.
Now that we can set icons directly "by bitmap", there's no need for passing around the icon paths anymore, so get rid of all the IPC and API related to that. :^)
This commit is contained in:
parent
841b2e5d13
commit
d4892b3fdc
13 changed files with 3 additions and 158 deletions
|
@ -39,7 +39,6 @@ public:
|
|||
WM_WindowRemoved,
|
||||
WM_WindowStateChanged,
|
||||
WM_WindowRectChanged,
|
||||
WM_WindowIconChanged,
|
||||
WM_WindowIconBitmapChanged,
|
||||
__End_WM_Events,
|
||||
};
|
||||
|
@ -120,20 +119,6 @@ private:
|
|||
Rect m_rect;
|
||||
};
|
||||
|
||||
class GWMWindowIconChangedEvent : public GWMEvent {
|
||||
public:
|
||||
GWMWindowIconChangedEvent(int client_id, int window_id, const StringView& icon_path)
|
||||
: GWMEvent(GEvent::Type::WM_WindowIconChanged, client_id, window_id)
|
||||
, m_icon_path(icon_path)
|
||||
{
|
||||
}
|
||||
|
||||
String icon_path() const { return m_icon_path; }
|
||||
|
||||
private:
|
||||
String m_icon_path;
|
||||
};
|
||||
|
||||
class GWMWindowIconBitmapChangedEvent : public GWMEvent {
|
||||
public:
|
||||
GWMWindowIconBitmapChangedEvent(int client_id, int window_id, int icon_buffer_id, const Size& icon_size)
|
||||
|
|
|
@ -192,8 +192,6 @@ void GWindowServerConnection::handle_wm_event(const WSAPI_ServerMessage& event,
|
|||
CEventLoop::current().post_event(window, make<GWMWindowStateChangedEvent>(event.wm.client_id, event.wm.window_id, String(event.text, event.text_length), event.wm.rect, event.wm.is_active, (GWindowType)event.wm.window_type, event.wm.is_minimized));
|
||||
else if (event.type == WSAPI_ServerMessage::WM_WindowRectChanged)
|
||||
CEventLoop::current().post_event(window, make<GWMWindowRectChangedEvent>(event.wm.client_id, event.wm.window_id, event.wm.rect));
|
||||
else if (event.type == WSAPI_ServerMessage::WM_WindowIconChanged)
|
||||
CEventLoop::current().post_event(window, make<GWMWindowIconChangedEvent>(event.wm.client_id, event.wm.window_id, String(event.text, event.text_length)));
|
||||
else if (event.type == WSAPI_ServerMessage::WM_WindowIconBitmapChanged)
|
||||
CEventLoop::current().post_event(window, make<GWMWindowIconBitmapChangedEvent>(event.wm.client_id, event.wm.window_id, event.wm.icon_buffer_id, event.wm.icon_size));
|
||||
else if (event.type == WSAPI_ServerMessage::WM_WindowRemoved)
|
||||
|
|
|
@ -643,22 +643,6 @@ void GWindow::set_icon(const GraphicsBitmap* icon)
|
|||
GWindowServerConnection::the().post_message_to_server(message);
|
||||
}
|
||||
|
||||
void GWindow::set_icon_path(const StringView& path)
|
||||
{
|
||||
if (m_icon_path == path)
|
||||
return;
|
||||
m_icon_path = path;
|
||||
if (!m_window_id)
|
||||
return;
|
||||
WSAPI_ClientMessage message;
|
||||
message.type = WSAPI_ClientMessage::Type::SetWindowIcon;
|
||||
message.window_id = m_window_id;
|
||||
ASSERT(path.length() < (int)sizeof(message.text));
|
||||
strcpy(message.text, String(path).characters());
|
||||
message.text_length = path.length();
|
||||
GWindowServerConnection::the().post_message_to_server(message);
|
||||
}
|
||||
|
||||
void GWindow::start_wm_resize()
|
||||
{
|
||||
WSAPI_ClientMessage message;
|
||||
|
|
|
@ -119,9 +119,6 @@ public:
|
|||
|
||||
void set_override_cursor(GStandardCursor);
|
||||
|
||||
String icon_path() const { return m_icon_path; }
|
||||
void set_icon_path(const StringView&);
|
||||
|
||||
void set_icon(const GraphicsBitmap*);
|
||||
const GraphicsBitmap* icon() const { return m_icon.ptr(); }
|
||||
|
||||
|
@ -154,7 +151,6 @@ private:
|
|||
WeakPtr<GWidget> m_hovered_widget;
|
||||
Rect m_rect_when_windowless;
|
||||
String m_title_when_windowless;
|
||||
String m_icon_path;
|
||||
Vector<Rect, 32> m_pending_paint_event_rects;
|
||||
Size m_size_increment;
|
||||
Size m_base_size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue