mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
44
Libraries/LibGUI/GDesktop.cpp
Normal file
44
Libraries/LibGUI/GDesktop.cpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
#include <LibGUI/GDesktop.h>
|
||||
#include <LibGUI/GEventLoop.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
GDesktop& GDesktop::the()
|
||||
{
|
||||
static GDesktop* the;
|
||||
if (!the)
|
||||
the = new GDesktop;
|
||||
return *the;
|
||||
}
|
||||
|
||||
GDesktop::GDesktop()
|
||||
{
|
||||
}
|
||||
|
||||
void GDesktop::did_receive_screen_rect(Badge<GEventLoop>, const Rect& rect)
|
||||
{
|
||||
if (m_rect == rect)
|
||||
return;
|
||||
m_rect = rect;
|
||||
if (on_rect_change)
|
||||
on_rect_change(rect);
|
||||
}
|
||||
|
||||
bool GDesktop::set_wallpaper(const StringView& path)
|
||||
{
|
||||
WSAPI_ClientMessage message;
|
||||
message.type = WSAPI_ClientMessage::Type::SetWallpaper;
|
||||
ASSERT(path.length() < (int)sizeof(message.text));
|
||||
strncpy(message.text, path.characters(), path.length());
|
||||
message.text_length = path.length();
|
||||
auto response = GEventLoop::current().sync_request(message, WSAPI_ServerMessage::Type::DidSetWallpaper);
|
||||
return response.value;
|
||||
}
|
||||
|
||||
String GDesktop::wallpaper() const
|
||||
{
|
||||
WSAPI_ClientMessage message;
|
||||
message.type = WSAPI_ClientMessage::Type::GetWallpaper;
|
||||
auto response = GEventLoop::current().sync_request(message, WSAPI_ServerMessage::Type::DidGetWallpaper);
|
||||
return String(response.text, response.text_length);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue