mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
Kernel+ProcessManager: Let processes have an icon and show it in the table.
Processes can now have an icon assigned, which is essentially a 16x16 RGBA32 bitmap exposed as a shared buffer ID. You set the icon ID by calling set_process_icon(int) and the icon ID will be exposed through /proc/all. To make this work, I added a mechanism for making shared buffers globally accessible. For safety reasons, each app seals the icon buffer before making it global. Right now the first call to GWindow::set_icon() is what determines the process icon. We'll probably change this in the future. :^)
This commit is contained in:
parent
7356fd389f
commit
5ded77df39
14 changed files with 97 additions and 2 deletions
|
@ -36,14 +36,17 @@ public:
|
|||
bool is_shared_with(pid_t peer_pid);
|
||||
void* ref_for_process_and_get_address(Process& process);
|
||||
void share_with(pid_t peer_pid);
|
||||
void share_globally() { m_global = true; }
|
||||
void deref_for_process(Process& process);
|
||||
void disown(pid_t pid);
|
||||
size_t size() const { return m_vmo->size(); }
|
||||
void destroy_if_unused();
|
||||
void seal();
|
||||
int id() const { return m_shared_buffer_id; }
|
||||
|
||||
int m_shared_buffer_id { -1 };
|
||||
bool m_writable { true };
|
||||
bool m_global { false };
|
||||
NonnullRefPtr<VMObject> m_vmo;
|
||||
Vector<Reference, 2> m_refs;
|
||||
unsigned m_total_refs { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue