1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 20:35:06 +00:00
serenity/Servers/WindowServer/WSMenuApplet.cpp
Andreas Kling 44d5388e78 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. :^)
2019-12-05 19:36:01 +01:00

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);
}