mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
LibGfx+LibIPC: Add Gfx::ShareableBitmap, a bitmap for easy IPC usage
With this patch, it's now possible to pass a Gfx::ShareableBitmap in an IPC message. As long as the message itself is synchronous, the bitmap will be adopted by the receiving end, and disowned by the sender nicely without any accounting effort like we've had to do in the past. Use this in NotificationServer to allow sending arbitrary bitmaps as icons instead of paths-to-icons.
This commit is contained in:
parent
24a0354ce8
commit
7cfe712f4d
17 changed files with 115 additions and 17 deletions
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
@ -16,8 +17,8 @@ public:
|
|||
const String& title() const { return m_title; }
|
||||
void set_title(const String& title) { m_title = title; }
|
||||
|
||||
const String& icon_path() const { return m_icon_path; }
|
||||
void set_icon_path(const String& icon_path) { m_icon_path = icon_path; }
|
||||
const Gfx::Bitmap* icon() const { return m_icon; }
|
||||
void set_icon(const Gfx::Bitmap* icon) { m_icon = icon; }
|
||||
|
||||
void show();
|
||||
|
||||
|
@ -26,7 +27,7 @@ private:
|
|||
|
||||
String m_title;
|
||||
String m_text;
|
||||
String m_icon_path;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue