mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 20:35:06 +00:00

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. :^)
25 lines
506 B
C++
25 lines
506 B
C++
#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);
|
|
}
|