mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
Move WindowServer into Servers.
This commit is contained in:
parent
9120b05a40
commit
d17a91f185
32 changed files with 14 additions and 14 deletions
48
Servers/WindowServer/WSClipboard.cpp
Normal file
48
Servers/WindowServer/WSClipboard.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#include <WindowServer/WSClipboard.h>
|
||||
|
||||
WSClipboard& WSClipboard::the()
|
||||
{
|
||||
static WSClipboard* s_the;
|
||||
if (!s_the)
|
||||
s_the = new WSClipboard;
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
WSClipboard::WSClipboard()
|
||||
{
|
||||
}
|
||||
|
||||
WSClipboard::~WSClipboard()
|
||||
{
|
||||
}
|
||||
|
||||
void WSClipboard::on_message(WSMessage&)
|
||||
{
|
||||
}
|
||||
|
||||
const byte* WSClipboard::data() const
|
||||
{
|
||||
if (!m_shared_buffer)
|
||||
return nullptr;
|
||||
return (const byte*)m_shared_buffer->data();
|
||||
}
|
||||
|
||||
int WSClipboard::size() const
|
||||
{
|
||||
if (!m_shared_buffer)
|
||||
return 0;
|
||||
return m_contents_size;
|
||||
}
|
||||
|
||||
void WSClipboard::clear()
|
||||
{
|
||||
m_shared_buffer = nullptr;
|
||||
m_contents_size = 0;
|
||||
}
|
||||
|
||||
void WSClipboard::set_data(Retained<SharedBuffer>&& data, int contents_size)
|
||||
{
|
||||
dbgprintf("WSClipboard::set_data <- %p (%u bytes)\n", data->data(), contents_size);
|
||||
m_shared_buffer = move(data);
|
||||
m_contents_size = contents_size;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue