summaryrefslogtreecommitdiff
path: root/LibC/gui.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-12 00:52:19 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-12 00:52:19 +0100
commit133706d697b7e7441a7f4968b5a52dfc0323d34b (patch)
treee2af7b65b49ce66a9e003278a0508913f644c578 /LibC/gui.cpp
parentbb31d961b4b7041ec1b748ce65f256df64e113de (diff)
downloadserenity-133706d697b7e7441a7f4968b5a52dfc0323d34b.zip
Add API's and plumbing for WindowServer clients to make menus.
Diffstat (limited to 'LibC/gui.cpp')
-rw-r--r--LibC/gui.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/LibC/gui.cpp b/LibC/gui.cpp
index da1fecef05..0d9a07ed0a 100644
--- a/LibC/gui.cpp
+++ b/LibC/gui.cpp
@@ -68,3 +68,51 @@ int gui_set_global_cursor_tracking_enabled(int window_id, bool enabled)
int rc = syscall(SC_gui_set_global_cursor_tracking_enabled, window_id, enabled);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
+
+int gui_menubar_create()
+{
+ int rc = syscall(SC_gui_menubar_create);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
+int gui_menubar_destroy(int menubar_id)
+{
+ int rc = syscall(SC_gui_menubar_destroy, menubar_id);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
+int gui_menubar_add_menu(int menubar_id, int menu_id)
+{
+ int rc = syscall(SC_gui_menubar_add_menu, menubar_id, menu_id);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
+int gui_menu_create(const char* name)
+{
+ int rc = syscall(SC_gui_menu_create, name);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
+int gui_menu_destroy(int menu_id)
+{
+ int rc = syscall(SC_gui_menu_destroy, menu_id);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
+int gui_menu_add_separator(int menu_id)
+{
+ int rc = syscall(SC_gui_menu_add_separator, menu_id);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
+int gui_menu_add_item(int menu_id, unsigned identifier, const char* text)
+{
+ int rc = syscall(SC_gui_menu_add_item, menu_id, identifier, text);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
+int gui_app_set_menubar(int menubar_id)
+{
+ int rc = syscall(SC_gui_app_set_menubar, menubar_id);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}