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:
parent
2d18fc8052
commit
44d5388e78
8 changed files with 174 additions and 0 deletions
25
Servers/WindowServer/WSMenuApplet.cpp
Normal file
25
Servers/WindowServer/WSMenuApplet.cpp
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue