summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-29 07:26:01 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-29 07:26:01 +0200
commit5ded77df39e816f565b26761624893d085ca6eef (patch)
treeb840f17e0038d3e8e09f5e530a6b3af3c1d802ac /Kernel/Process.h
parent7356fd389f4e73f98f3c28b91830189fea109b5b (diff)
downloadserenity-5ded77df39e816f565b26761624893d085ca6eef.zip
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. :^)
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index 7f38cb5e71..e114bc0cbf 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -22,6 +22,7 @@ class PageDirectory;
class Region;
class VMObject;
class ProcessTracer;
+class SharedBuffer;
timeval kgettimeofday();
void kgettimeofday(timeval&);
@@ -208,12 +209,14 @@ public:
int sys$mknod(const char* pathname, mode_t, dev_t);
int sys$create_shared_buffer(int, void** buffer);
int sys$share_buffer_with(int, pid_t peer_pid);
+ int sys$share_buffer_globally(int);
void* sys$get_shared_buffer(int shared_buffer_id);
int sys$release_shared_buffer(int shared_buffer_id);
int sys$seal_shared_buffer(int shared_buffer_id);
int sys$get_shared_buffer_size(int shared_buffer_id);
int sys$halt();
int sys$reboot();
+ int sys$set_process_icon(int icon_id);
static void initialize();
@@ -281,6 +284,8 @@ public:
const ELFLoader* elf_loader() const { return m_elf_loader.ptr(); }
+ int icon_id() const { return m_icon_id; }
+
private:
friend class MemoryManager;
friend class Scheduler;
@@ -359,6 +364,8 @@ private:
Lock m_big_lock { "Process" };
u64 m_alarm_deadline { 0 };
+
+ int m_icon_id { -1 };
};
class ProcessInspectionHandle {