mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
Ladybird: Implement an AppKit chrome for macOS :^)
This adds an alternative Ladybird chrome for macOS using the AppKit framework. Just about everything needed for normal web browsing has been implemented. This includes: * Tabbed, scrollable navigation * History navigation (back, forward, reload) * Keyboard / mouse events * Favicons * Context menus * Cookies * Dialogs (alert, confirm, prompt) * WebDriver support This does not include debugging tools like the JavaScript console and inspector, nor theme support. The Qt chrome is still used by default. To use the AppKit chrome, set the ENABLE_QT CMake option to OFF.
This commit is contained in:
parent
66a89bd695
commit
5722d0025b
28 changed files with 3248 additions and 3 deletions
34
Ladybird/AppKit/UI/Event.h
Normal file
34
Ladybird/AppKit/UI/Event.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// FIXME: These should not be included outside of Serenity.
|
||||
#include <Kernel/API/KeyCode.h>
|
||||
#include <LibGUI/Event.h>
|
||||
|
||||
#import <System/Cocoa.h>
|
||||
|
||||
namespace Ladybird {
|
||||
|
||||
struct MouseEvent {
|
||||
Gfx::IntPoint position {};
|
||||
GUI::MouseButton button { GUI::MouseButton::Primary };
|
||||
KeyModifier modifiers { KeyModifier::Mod_None };
|
||||
};
|
||||
MouseEvent ns_event_to_mouse_event(NSEvent*, NSView*, GUI::MouseButton);
|
||||
|
||||
NSEvent* create_context_menu_mouse_event(NSView*, Gfx::IntPoint);
|
||||
NSEvent* create_context_menu_mouse_event(NSView*, NSPoint);
|
||||
|
||||
struct KeyEvent {
|
||||
KeyCode key_code { KeyCode::Key_Invalid };
|
||||
KeyModifier modifiers { KeyModifier::Mod_None };
|
||||
u32 code_point { 0 };
|
||||
};
|
||||
KeyEvent ns_event_to_key_event(NSEvent*);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue