From 133706d697b7e7441a7f4968b5a52dfc0323d34b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 12 Feb 2019 00:52:19 +0100 Subject: Add API's and plumbing for WindowServer clients to make menus. --- LibC/gui.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'LibC/gui.cpp') 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); +} -- cgit v1.2.3