1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 19:05:08 +00:00

WindowServer: Start implementing a menu system.

I'm going with a global top-of-the-screen menu instead of per-window menus.
The basic idea is that menus will live in the WindowServer and clients can
create menus via WindowServer requests.
This commit is contained in:
Andreas Kling 2019-02-11 09:47:10 +01:00
parent 7abef6ba9e
commit 443b043b49
14 changed files with 487 additions and 6 deletions

View file

@ -39,6 +39,25 @@ GraphicsBitmap::GraphicsBitmap(Process& process, const Size& size)
m_data = (RGBA32*)m_server_region->laddr().as_ptr();
}
RetainPtr<GraphicsBitmap> GraphicsBitmap::create_kernel_only(const Size& size)
{
return adopt(*new GraphicsBitmap(size));
}
GraphicsBitmap::GraphicsBitmap(const Size& size)
: m_size(size)
, m_pitch(size.width() * sizeof(RGBA32))
{
InterruptDisabler disabler;
size_t size_in_bytes = size.width() * size.height() * sizeof(RGBA32);
auto vmo = VMObject::create_anonymous(size_in_bytes);
auto& server = WSMessageLoop::the().server_process();
m_server_region = server.allocate_region_with_vmo(LinearAddress(), size_in_bytes, move(vmo), 0, "GraphicsBitmap (server)", true, false);
m_server_region->set_shared(true);
m_server_region->set_is_bitmap(true);
m_data = (RGBA32*)m_server_region->laddr().as_ptr();
}
#endif
RetainPtr<GraphicsBitmap> GraphicsBitmap::create_wrapper(const Size& size, RGBA32* data)