mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +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
|
@ -3,6 +3,7 @@
|
|||
#include "WSMenu.h"
|
||||
#include <LibCore/CObject.h>
|
||||
#include <LibCore/CTimer.h>
|
||||
#include <WindowServer/WSMenuApplet.h>
|
||||
#include <WindowServer/WSCPUMonitor.h>
|
||||
#include <WindowServer/WSWindow.h>
|
||||
|
||||
|
@ -33,6 +34,10 @@ public:
|
|||
void close_everyone_not_in_lineage(WSMenu&);
|
||||
void close_menu_and_descendants(WSMenu&);
|
||||
|
||||
void add_applet(WSMenuApplet&);
|
||||
void remove_applet(WSMenuApplet&);
|
||||
void invalidate_applet(WSMenuApplet&, const Rect&);
|
||||
|
||||
private:
|
||||
void close_menus(const Vector<WSMenu*>&);
|
||||
|
||||
|
@ -42,6 +47,7 @@ private:
|
|||
void handle_menu_mouse_event(WSMenu&, const WSMouseEvent&);
|
||||
|
||||
void draw();
|
||||
void draw_applet(const WSMenuApplet&);
|
||||
void tick_clock();
|
||||
|
||||
RefPtr<WSWindow> m_window;
|
||||
|
@ -55,6 +61,8 @@ private:
|
|||
RefPtr<GraphicsBitmap> m_muted_bitmap;
|
||||
RefPtr<GraphicsBitmap> m_unmuted_bitmap;
|
||||
|
||||
Vector<WeakPtr<WSMenuApplet>> m_applets;
|
||||
|
||||
OwnPtr<AClientConnection> m_audio_client;
|
||||
|
||||
Rect m_audio_rect;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue