mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +00:00
WindowServer: Convert the remaining menu APIs into messages.
This commit is contained in:
parent
cf432b4c3d
commit
ef4e9860fd
11 changed files with 86 additions and 66 deletions
|
@ -74,6 +74,8 @@ struct GUI_ServerMessage {
|
|||
DidDestroyMenu,
|
||||
DidAddMenuToMenubar,
|
||||
DidSetApplicationMenubar,
|
||||
DidAddMenuItem,
|
||||
DidAddMenuSeparator,
|
||||
};
|
||||
Type type { Invalid };
|
||||
int window_id { -1 };
|
||||
|
@ -112,6 +114,8 @@ struct GUI_ClientMessage {
|
|||
DestroyMenu,
|
||||
AddMenuToMenubar,
|
||||
SetApplicationMenubar,
|
||||
AddMenuItem,
|
||||
AddMenuSeparator,
|
||||
};
|
||||
Type type { Invalid };
|
||||
int window_id { -1 };
|
||||
|
|
|
@ -230,12 +230,6 @@ public:
|
|||
int gui$get_window_rect(int window_id, GUI_Rect*);
|
||||
int gui$set_window_rect(int window_id, const GUI_Rect*);
|
||||
int gui$set_global_cursor_tracking_enabled(int window_id, bool enabled);
|
||||
int gui$menubar_add_menu(int menubar_id, int menu_id);
|
||||
int gui$menu_create(const char* name);
|
||||
int gui$menu_destroy(int menu_id);
|
||||
int gui$menu_add_separator(int menu_id);
|
||||
int gui$menu_add_item(int menu_id, unsigned identifier, const char* text);
|
||||
int gui$set_menubar(int menubar_id);
|
||||
|
||||
DisplayInfo set_video_resolution(int width, int height);
|
||||
|
||||
|
|
|
@ -291,15 +291,3 @@ DisplayInfo Process::set_video_resolution(int width, int height)
|
|||
BochsVGADevice::the().set_resolution(width, height);
|
||||
return info;
|
||||
}
|
||||
|
||||
int Process::gui$menu_add_separator(int menu_id)
|
||||
{
|
||||
return WSWindowManager::the().api$menu_add_separator(menu_id);
|
||||
}
|
||||
|
||||
int Process::gui$menu_add_item(int menu_id, unsigned identifier, const char* text)
|
||||
{
|
||||
if (!validate_read_str(text))
|
||||
return -EFAULT;
|
||||
return WSWindowManager::the().api$menu_add_item(menu_id, identifier, String(text));
|
||||
}
|
||||
|
|
|
@ -223,10 +223,6 @@ static dword handle(RegisterDump& regs, dword function, dword arg1, dword arg2,
|
|||
return current->sys$rmdir((const char*)arg1);
|
||||
case Syscall::SC_chmod:
|
||||
return current->sys$chmod((const char*)arg1, (mode_t)arg2);
|
||||
case Syscall::SC_gui_menu_add_separator:
|
||||
return current->gui$menu_add_separator((int)arg1);
|
||||
case Syscall::SC_gui_menu_add_item:
|
||||
return current->gui$menu_add_item((int)arg1, (unsigned)arg2, (const char*)arg3);
|
||||
default:
|
||||
kprintf("<%u> int0x80: Unknown function %u requested {%x, %x, %x}\n", current->pid(), function, arg1, arg2, arg3);
|
||||
break;
|
||||
|
|
|
@ -85,8 +85,6 @@
|
|||
__ENUMERATE_SYSCALL(rmdir) \
|
||||
__ENUMERATE_SYSCALL(chmod) \
|
||||
__ENUMERATE_SYSCALL(usleep) \
|
||||
__ENUMERATE_SYSCALL(gui_menu_add_separator) \
|
||||
__ENUMERATE_SYSCALL(gui_menu_add_item) \
|
||||
|
||||
|
||||
#ifdef SERENITY
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue