alloy: Add touch handle and quick menu support for OSR (fixes issue #3268)

The client is responsible for rendering both as no default implementation
is currently available for OSR.
This commit is contained in:
JohnKarel
2022-05-27 12:03:31 +03:00
committed by Marshall Greenblatt
parent 771e5c7c0c
commit d9b764860a
41 changed files with 2166 additions and 52 deletions

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d007b3dc26f3f049bf67623da8fae59dc75a193b$
// $hash=d9498ae2e32ec124df3dd2c3017bcf415d4205f8$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
@@ -74,6 +74,29 @@ typedef struct _cef_run_context_menu_callback_t {
void(CEF_CALLBACK* cancel)(struct _cef_run_context_menu_callback_t* self);
} cef_run_context_menu_callback_t;
///
// Callback structure used for continuation of custom quick menu display.
///
typedef struct _cef_run_quick_menu_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Complete quick menu display by selecting the specified |command_id| and
// |event_flags|.
///
void(CEF_CALLBACK* cont)(struct _cef_run_quick_menu_callback_t* self,
int command_id,
cef_event_flags_t event_flags);
///
// Cancel quick menu display.
///
void(CEF_CALLBACK* cancel)(struct _cef_run_quick_menu_callback_t* self);
} cef_run_quick_menu_callback_t;
///
// Implement this structure to handle context menu events. The functions of this
// structure will be called on the UI thread.
@@ -133,16 +156,56 @@ typedef struct _cef_context_menu_handler_t {
///
// Called when the context menu is dismissed irregardless of whether the menu
// was NULL or a command was selected.
// was canceled or a command was selected.
///
void(CEF_CALLBACK* on_context_menu_dismissed)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame);
///
// Called to allow custom display of the quick menu for a windowless browser.
// |location| is the top left corner of the selected region. |size| is the
// size of the selected region. |edit_state_flags| is a combination of flags
// that represent the state of the quick menu. Return true (1) if the menu
// will be handled and execute |callback| either synchronously or
// asynchronously with the selected command ID. Return false (0) to cancel the
// menu.
///
int(CEF_CALLBACK* run_quick_menu)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_point_t* location,
const cef_size_t* size,
cef_quick_menu_edit_state_flags_t edit_state_flags,
struct _cef_run_quick_menu_callback_t* callback);
///
// Called to execute a command selected from the quick menu for a windowless
// browser. Return true (1) if the command was handled or false (0) for the
// default implementation. See cef_menu_id_t for command IDs that have default
// implementations.
///
int(CEF_CALLBACK* on_quick_menu_command)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
int command_id,
cef_event_flags_t event_flags);
///
// Called when the quick menu for a windowless browser is dismissed
// irregardless of whether the menu was canceled or a command was selected.
///
void(CEF_CALLBACK* on_quick_menu_dismissed)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame);
} cef_context_menu_handler_t;
///
// Provides information about the context menu state. The ethods of this
// Provides information about the context menu state. The functions of this
// structure can only be accessed on browser process the UI thread.
///
typedef struct _cef_context_menu_params_t {