summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibAudio/Buffer.h2
-rw-r--r--Libraries/LibAudio/ClientConnection.cpp4
-rw-r--r--Libraries/LibC/unistd.cpp28
-rw-r--r--Libraries/LibC/unistd.h14
-rw-r--r--Libraries/LibGUI/Clipboard.cpp6
-rw-r--r--Libraries/LibGUI/DragOperation.cpp2
-rw-r--r--Libraries/LibGUI/Menu.cpp4
-rw-r--r--Libraries/LibGUI/Window.cpp10
-rw-r--r--Libraries/LibGUI/WindowServerConnection.cpp8
-rw-r--r--Libraries/LibGfx/Bitmap.cpp4
-rw-r--r--Libraries/LibGfx/Bitmap.h2
-rw-r--r--Libraries/LibGfx/SystemTheme.cpp2
-rw-r--r--Libraries/LibProtocol/Client.cpp4
-rw-r--r--Libraries/LibProtocol/Download.cpp6
-rw-r--r--Libraries/LibProtocol/Download.h2
15 files changed, 49 insertions, 49 deletions
diff --git a/Libraries/LibAudio/Buffer.h b/Libraries/LibAudio/Buffer.h
index ba5ab76531..230099b850 100644
--- a/Libraries/LibAudio/Buffer.h
+++ b/Libraries/LibAudio/Buffer.h
@@ -121,7 +121,7 @@ public:
int sample_count() const { return m_sample_count; }
const void* data() const { return m_buffer->data(); }
int size_in_bytes() const { return m_sample_count * (int)sizeof(Sample); }
- int shared_buffer_id() const { return m_buffer->shared_buffer_id(); }
+ int shbuf_id() const { return m_buffer->shbuf_id(); }
SharedBuffer& shared_buffer() { return *m_buffer; }
private:
diff --git a/Libraries/LibAudio/ClientConnection.cpp b/Libraries/LibAudio/ClientConnection.cpp
index 063e6ea5a2..7accf955e6 100644
--- a/Libraries/LibAudio/ClientConnection.cpp
+++ b/Libraries/LibAudio/ClientConnection.cpp
@@ -45,7 +45,7 @@ void ClientConnection::enqueue(const Buffer& buffer)
{
for (;;) {
const_cast<Buffer&>(buffer).shared_buffer().share_with(server_pid());
- auto response = send_sync<Messages::AudioServer::EnqueueBuffer>(buffer.shared_buffer_id(), buffer.sample_count());
+ auto response = send_sync<Messages::AudioServer::EnqueueBuffer>(buffer.shbuf_id(), buffer.sample_count());
if (response->success())
break;
sleep(1);
@@ -55,7 +55,7 @@ void ClientConnection::enqueue(const Buffer& buffer)
bool ClientConnection::try_enqueue(const Buffer& buffer)
{
const_cast<Buffer&>(buffer).shared_buffer().share_with(server_pid());
- auto response = send_sync<Messages::AudioServer::EnqueueBuffer>(buffer.shared_buffer_id(), buffer.sample_count());
+ auto response = send_sync<Messages::AudioServer::EnqueueBuffer>(buffer.shbuf_id(), buffer.sample_count());
return response->success();
}
diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp
index 1f76d4494f..037bbebdd5 100644
--- a/Libraries/LibC/unistd.cpp
+++ b/Libraries/LibC/unistd.cpp
@@ -529,21 +529,21 @@ void sync()
syscall(SC_sync);
}
-int create_shared_buffer(int size, void** buffer)
+int shbuf_create(int size, void** buffer)
{
- int rc = syscall(SC_create_shared_buffer, size, buffer);
+ int rc = syscall(SC_shbuf_create, size, buffer);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int share_buffer_with(int shared_buffer_id, pid_t peer_pid)
+int shbuf_allow_pid(int shbuf_id, pid_t peer_pid)
{
- int rc = syscall(SC_share_buffer_with, shared_buffer_id, peer_pid);
+ int rc = syscall(SC_shbuf_allow_pid, shbuf_id, peer_pid);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int share_buffer_globally(int shared_buffer_id)
+int shbuf_allow_all(int shbuf_id)
{
- int rc = syscall(SC_share_buffer_globally, shared_buffer_id);
+ int rc = syscall(SC_shbuf_allow_all, shbuf_id);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
@@ -553,9 +553,9 @@ int set_process_icon(int icon_id)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-void* get_shared_buffer(int shared_buffer_id)
+void* shbuf_get(int shbuf_id)
{
- int rc = syscall(SC_get_shared_buffer, shared_buffer_id);
+ int rc = syscall(SC_shbuf_get, shbuf_id);
if (rc < 0 && -rc < EMAXERRNO) {
errno = -rc;
return (void*)-1;
@@ -563,21 +563,21 @@ void* get_shared_buffer(int shared_buffer_id)
return (void*)rc;
}
-int release_shared_buffer(int shared_buffer_id)
+int shbuf_release(int shbuf_id)
{
- int rc = syscall(SC_release_shared_buffer, shared_buffer_id);
+ int rc = syscall(SC_shbuf_release, shbuf_id);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int get_shared_buffer_size(int shared_buffer_id)
+int shbuf_get_size(int shbuf_id)
{
- int rc = syscall(SC_get_shared_buffer_size, shared_buffer_id);
+ int rc = syscall(SC_shbuf_get_size, shbuf_id);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int seal_shared_buffer(int shared_buffer_id)
+int shbuf_seal(int shbuf_id)
{
- int rc = syscall(SC_seal_shared_buffer, shared_buffer_id);
+ int rc = syscall(SC_shbuf_seal, shbuf_id);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
diff --git a/Libraries/LibC/unistd.h b/Libraries/LibC/unistd.h
index cb3cde7965..aae05e101b 100644
--- a/Libraries/LibC/unistd.h
+++ b/Libraries/LibC/unistd.h
@@ -61,13 +61,13 @@ void sysbeep();
int systrace(pid_t);
int gettid();
int donate(int tid);
-int create_shared_buffer(int, void** buffer);
-int share_buffer_with(int, pid_t peer_pid);
-int share_buffer_globally(int);
-void* get_shared_buffer(int shared_buffer_id);
-int release_shared_buffer(int shared_buffer_id);
-int seal_shared_buffer(int shared_buffer_id);
-int get_shared_buffer_size(int shared_buffer_id);
+int shbuf_create(int, void** buffer);
+int shbuf_allow_pid(int, pid_t peer_pid);
+int shbuf_allow_all(int);
+void* shbuf_get(int shbuf_id);
+int shbuf_release(int shbuf_id);
+int shbuf_seal(int shbuf_id);
+int shbuf_get_size(int shbuf_id);
int set_process_icon(int icon_id);
inline int getpagesize() { return 4096; }
pid_t fork();
diff --git a/Libraries/LibGUI/Clipboard.cpp b/Libraries/LibGUI/Clipboard.cpp
index 4266fa022c..8663f6a365 100644
--- a/Libraries/LibGUI/Clipboard.cpp
+++ b/Libraries/LibGUI/Clipboard.cpp
@@ -46,9 +46,9 @@ Clipboard::Clipboard()
Clipboard::DataAndType Clipboard::data_and_type() const
{
auto response = WindowServerConnection::the().send_sync<Messages::WindowServer::GetClipboardContents>();
- if (response->shared_buffer_id() < 0)
+ if (response->shbuf_id() < 0)
return {};
- auto shared_buffer = SharedBuffer::create_from_shared_buffer_id(response->shared_buffer_id());
+ auto shared_buffer = SharedBuffer::create_from_shbuf_id(response->shbuf_id());
if (!shared_buffer) {
dbgprintf("GUI::Clipboard::data() failed to attach to the shared buffer\n");
return {};
@@ -76,7 +76,7 @@ void Clipboard::set_data(const StringView& data, const String& type)
shared_buffer->seal();
shared_buffer->share_with(WindowServerConnection::the().server_pid());
- WindowServerConnection::the().send_sync<Messages::WindowServer::SetClipboardContents>(shared_buffer->shared_buffer_id(), data.length(), type);
+ WindowServerConnection::the().send_sync<Messages::WindowServer::SetClipboardContents>(shared_buffer->shbuf_id(), data.length(), type);
}
void Clipboard::did_receive_clipboard_contents_changed(Badge<WindowServerConnection>, const String& data_type)
diff --git a/Libraries/LibGUI/DragOperation.cpp b/Libraries/LibGUI/DragOperation.cpp
index d67d1abd84..2f0cb55e2f 100644
--- a/Libraries/LibGUI/DragOperation.cpp
+++ b/Libraries/LibGUI/DragOperation.cpp
@@ -55,7 +55,7 @@ DragOperation::Outcome DragOperation::exec()
if (m_bitmap) {
shared_bitmap = m_bitmap->to_shareable_bitmap();
shared_bitmap->shared_buffer()->share_with(WindowServerConnection::the().server_pid());
- bitmap_id = shared_bitmap->shared_buffer_id();
+ bitmap_id = shared_bitmap->shbuf_id();
bitmap_size = shared_bitmap->size();
}
diff --git a/Libraries/LibGUI/Menu.cpp b/Libraries/LibGUI/Menu.cpp
index ce35524aed..c06fa631b2 100644
--- a/Libraries/LibGUI/Menu.cpp
+++ b/Libraries/LibGUI/Menu.cpp
@@ -128,7 +128,7 @@ int Menu::realize_menu()
if (action.icon()) {
ASSERT(action.icon()->format() == Gfx::BitmapFormat::RGBA32);
ASSERT(action.icon()->size() == Gfx::Size(16, 16));
- if (action.icon()->shared_buffer_id() == -1) {
+ if (action.icon()->shbuf_id() == -1) {
auto shared_buffer = SharedBuffer::create_with_size(action.icon()->size_in_bytes());
ASSERT(shared_buffer);
auto shared_icon = Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, *shared_buffer, action.icon()->size());
@@ -137,7 +137,7 @@ int Menu::realize_menu()
shared_buffer->share_with(WindowServerConnection::the().server_pid());
action.set_icon(shared_icon);
}
- icon_buffer_id = action.icon()->shared_buffer_id();
+ icon_buffer_id = action.icon()->shbuf_id();
}
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : String();
bool exclusive = action.group() && action.group()->is_exclusive() && action.is_checkable();
diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp
index 2a8fad3568..8c41277838 100644
--- a/Libraries/LibGUI/Window.cpp
+++ b/Libraries/LibGUI/Window.cpp
@@ -477,7 +477,7 @@ void Window::set_hovered_widget(Widget* widget)
void Window::set_current_backing_bitmap(Gfx::Bitmap& bitmap, bool flush_immediately)
{
- WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowBackingStore>(m_window_id, 32, bitmap.pitch(), bitmap.shared_buffer_id(), bitmap.has_alpha_channel(), bitmap.size(), flush_immediately);
+ WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowBackingStore>(m_window_id, 32, bitmap.pitch(), bitmap.shbuf_id(), bitmap.has_alpha_channel(), bitmap.size(), flush_immediately);
}
void Window::flip(const Vector<Gfx::Rect, 32>& dirty_rects)
@@ -551,17 +551,17 @@ void Window::apply_icon()
if (!m_window_id)
return;
- int rc = seal_shared_buffer(m_icon->shared_buffer_id());
+ int rc = shbuf_seal(m_icon->shbuf_id());
ASSERT(rc == 0);
- rc = share_buffer_globally(m_icon->shared_buffer_id());
+ rc = shbuf_allow_all(m_icon->shbuf_id());
ASSERT(rc == 0);
static bool has_set_process_icon;
if (!has_set_process_icon)
- set_process_icon(m_icon->shared_buffer_id());
+ set_process_icon(m_icon->shbuf_id());
- WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowIconBitmap>(m_window_id, m_icon->shared_buffer_id(), m_icon->size());
+ WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowIconBitmap>(m_window_id, m_icon->shbuf_id(), m_icon->size());
}
void Window::start_wm_resize()
diff --git a/Libraries/LibGUI/WindowServerConnection.cpp b/Libraries/LibGUI/WindowServerConnection.cpp
index 5b756cbd7d..35c9c154e6 100644
--- a/Libraries/LibGUI/WindowServerConnection.cpp
+++ b/Libraries/LibGUI/WindowServerConnection.cpp
@@ -53,9 +53,9 @@ WindowServerConnection& WindowServerConnection::the()
return *s_connection;
}
-static void set_system_theme_from_shared_buffer_id(int id)
+static void set_system_theme_from_shbuf_id(int id)
{
- auto system_theme = SharedBuffer::create_from_shared_buffer_id(id);
+ auto system_theme = SharedBuffer::create_from_shbuf_id(id);
ASSERT(system_theme);
Gfx::set_system_theme(*system_theme);
Application::the().set_system_palette(*system_theme);
@@ -65,13 +65,13 @@ void WindowServerConnection::handshake()
{
auto response = send_sync<Messages::WindowServer::Greet>();
set_my_client_id(response->client_id());
- set_system_theme_from_shared_buffer_id(response->system_theme_buffer_id());
+ set_system_theme_from_shbuf_id(response->system_theme_buffer_id());
Desktop::the().did_receive_screen_rect({}, response->screen_rect());
}
void WindowServerConnection::handle(const Messages::WindowClient::UpdateSystemTheme& message)
{
- set_system_theme_from_shared_buffer_id(message.system_theme_buffer_id());
+ set_system_theme_from_shbuf_id(message.system_theme_buffer_id());
Window::update_all_windows({});
}
diff --git a/Libraries/LibGfx/Bitmap.cpp b/Libraries/LibGfx/Bitmap.cpp
index 6d6a35dd7e..fa1db07ad7 100644
--- a/Libraries/LibGfx/Bitmap.cpp
+++ b/Libraries/LibGfx/Bitmap.cpp
@@ -158,9 +158,9 @@ void Bitmap::set_volatile()
return rc == 0;
}
-int Bitmap::shared_buffer_id() const
+int Bitmap::shbuf_id() const
{
- return m_shared_buffer ? m_shared_buffer->shared_buffer_id() : -1;
+ return m_shared_buffer ? m_shared_buffer->shbuf_id() : -1;
}
}
diff --git a/Libraries/LibGfx/Bitmap.h b/Libraries/LibGfx/Bitmap.h
index fba0b6e719..be05d08cdb 100644
--- a/Libraries/LibGfx/Bitmap.h
+++ b/Libraries/LibGfx/Bitmap.h
@@ -64,7 +64,7 @@ public:
int width() const { return m_size.width(); }
int height() const { return m_size.height(); }
size_t pitch() const { return m_pitch; }
- int shared_buffer_id() const;
+ int shbuf_id() const;
SharedBuffer* shared_buffer() { return m_shared_buffer.ptr(); }
const SharedBuffer* shared_buffer() const { return m_shared_buffer.ptr(); }
diff --git a/Libraries/LibGfx/SystemTheme.cpp b/Libraries/LibGfx/SystemTheme.cpp
index 0f608f2777..c41acb27b0 100644
--- a/Libraries/LibGfx/SystemTheme.cpp
+++ b/Libraries/LibGfx/SystemTheme.cpp
@@ -43,7 +43,7 @@ const SystemTheme& current_system_theme()
int current_system_theme_buffer_id()
{
ASSERT(theme_buffer);
- return theme_buffer->shared_buffer_id();
+ return theme_buffer->shbuf_id();
}
void set_system_theme(SharedBuffer& buffer)
diff --git a/Libraries/LibProtocol/Client.cpp b/Libraries/LibProtocol/Client.cpp
index 55c8754c07..2c1973291e 100644
--- a/Libraries/LibProtocol/Client.cpp
+++ b/Libraries/LibProtocol/Client.cpp
@@ -66,9 +66,9 @@ void Client::handle(const Messages::ProtocolClient::DownloadFinished& message)
{
RefPtr<Download> download;
if ((download = m_downloads.get(message.download_id()).value_or(nullptr))) {
- download->did_finish({}, message.success(), message.total_size(), message.shared_buffer_id());
+ download->did_finish({}, message.success(), message.total_size(), message.shbuf_id());
}
- send_sync<Messages::ProtocolServer::DisownSharedBuffer>(message.shared_buffer_id());
+ send_sync<Messages::ProtocolServer::DisownSharedBuffer>(message.shbuf_id());
m_downloads.remove(message.download_id());
}
diff --git a/Libraries/LibProtocol/Download.cpp b/Libraries/LibProtocol/Download.cpp
index 58ce5e050b..1feefba3f2 100644
--- a/Libraries/LibProtocol/Download.cpp
+++ b/Libraries/LibProtocol/Download.cpp
@@ -41,15 +41,15 @@ bool Download::stop()
return m_client->stop_download({}, *this);
}
-void Download::did_finish(Badge<Client>, bool success, u32 total_size, i32 shared_buffer_id)
+void Download::did_finish(Badge<Client>, bool success, u32 total_size, i32 shbuf_id)
{
if (!on_finish)
return;
ByteBuffer payload;
RefPtr<SharedBuffer> shared_buffer;
- if (success && shared_buffer_id != -1) {
- shared_buffer = SharedBuffer::create_from_shared_buffer_id(shared_buffer_id);
+ if (success && shbuf_id != -1) {
+ shared_buffer = SharedBuffer::create_from_shbuf_id(shbuf_id);
payload = ByteBuffer::wrap(shared_buffer->data(), total_size);
}
on_finish(success, payload, move(shared_buffer));
diff --git a/Libraries/LibProtocol/Download.h b/Libraries/LibProtocol/Download.h
index 13b4e27562..b5577800ed 100644
--- a/Libraries/LibProtocol/Download.h
+++ b/Libraries/LibProtocol/Download.h
@@ -49,7 +49,7 @@ public:
Function<void(bool success, const ByteBuffer& payload, RefPtr<SharedBuffer> payload_storage)> on_finish;
Function<void(u32 total_size, u32 downloaded_size)> on_progress;
- void did_finish(Badge<Client>, bool success, u32 total_size, i32 shared_buffer_id);
+ void did_finish(Badge<Client>, bool success, u32 total_size, i32 shbuf_id);
void did_progress(Badge<Client>, u32 total_size, u32 downloaded_size);
private: