1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

WindowServer: Add basic menu applet concept

It's now possible to create a little applet window that sits inside the
system's menubar. This is done using the new CreateMenuApplet IPC call.

So far, it's possible to assign a backing store ID, and to invalidate
rects for repaint. There is no way to get the events from inside the
applet just yet.

This will allow us to move the CPU graph and audio thingy to separate
applet processes. :^)
This commit is contained in:
Andreas Kling 2019-12-05 19:36:01 +01:00
parent 2d18fc8052
commit 44d5388e78
8 changed files with 174 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#include <WindowServer/WSMenuApplet.h>
#include <WindowServer/WSMenuManager.h>
#include <WindowServer/WSWindowManager.h>
static i32 s_next_applet_id = 1;
WSMenuApplet::WSMenuApplet(const Size& size)
: m_applet_id(s_next_applet_id++)
, m_size(size)
{
}
WSMenuApplet::~WSMenuApplet()
{
}
void WSMenuApplet::set_bitmap(GraphicsBitmap* bitmap)
{
m_bitmap = bitmap;
}
void WSMenuApplet::invalidate(const Rect& rect)
{
WSWindowManager::the().menu_manager().invalidate_applet(*this, rect);
}