The OpenD Programming Language

cef_render_handler_t

Implement this structure to handle events when window rendering is disabled. The functions of this structure will be called on the UI thread.

version(cef && embedded_cef_bindings)
extern (C)
struct cef_render_handler_t {
extern (System)
cef_accessibility_handler_t* function(cef_render_handler_t* self) nothrow get_accessibility_handler;
}

Members

Variables

base
cef_base_ref_counted_t base;

Base structure.

get_root_screen_rect
int function(cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect) nothrow get_root_screen_rect;
get_screen_info
int function(cef_render_handler_t* self, cef_browser_t* browser, cef_screen_info_t* screen_info) nothrow get_screen_info;

Called to allow the client to fill in the CefScreenInfo object with appropriate values. Return true (1) if the |screen_info| structure has been modified.

get_screen_point
int function(cef_render_handler_t* self, cef_browser_t* browser, int viewX, int viewY, int* screenX, int* screenY) nothrow get_screen_point;

Called to retrieve the translation from view DIP coordinates to screen coordinates. Windows/Linux should provide screen device (pixel) coordinates and MacOS should provide screen DIP coordinates. Return true (1) if the requested coordinates were provided.

get_touch_handle_size
void function(cef_render_handler_t* self, cef_browser_t* browser, cef_horizontal_alignment_t orientation, cef_size_t* size) nothrow get_touch_handle_size;

Called to retrieve the size of the touch handle for the specified |orientation|.

get_view_rect
void function(cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect) nothrow get_view_rect;

Called to retrieve the view rectangle in screen DIP coordinates. This function must always provide a non-NULL rectangle.

on_accelerated_paint
void function(cef_render_handler_t* self, cef_browser_t* browser, cef_paint_element_type_t type, size_t dirtyRectsCount, const(cef_rect_t)* dirtyRects, const(cef_accelerated_paint_info_t)* info) nothrow on_accelerated_paint;

Called when an element has been rendered to the shared texture handle. |type| indicates whether the element is the view or the popup widget. |dirtyRects| contains the set of rectangles in pixel coordinates that need to be repainted. |info| contains the shared handle; on Windows it is a HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on macOS it is an IOSurface pointer that can be opened with Metal or OpenGL, and on Linux it contains several planes, each with an fd to the underlying system native buffer.

on_ime_composition_range_changed
void function(cef_render_handler_t* self, cef_browser_t* browser, const(cef_range_t)* selected_range, size_t character_boundsCount, const(cef_rect_t)* character_bounds) nothrow on_ime_composition_range_changed;

Called when the IME composition range has changed. |selected_range| is the range of characters that have been selected. |character_bounds| is the bounds of each character in view coordinates.

on_paint
void function(cef_render_handler_t* self, cef_browser_t* browser, cef_paint_element_type_t type, size_t dirtyRectsCount, const(cef_rect_t)* dirtyRects, const(void)* buffer, int width, int height) nothrow on_paint;

Called when an element should be painted. Pixel values passed to this function are scaled relative to view coordinates based on the value of CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type| indicates whether the element is the view or the popup widget. |buffer| contains the pixel data for the whole image. |dirtyRects| contains the set of rectangles in pixel coordinates that need to be repainted. |buffer| will be |width|*|height|*4 bytes in size and represents a BGRA image with an upper-left origin. This function is only called when

on_popup_show
void function(cef_render_handler_t* self, cef_browser_t* browser, int show) nothrow on_popup_show;

Called when the browser wants to show or hide the popup widget. The popup should be shown if |show| is true (1) and hidden if |show| is false (0).

on_popup_size
void function(cef_render_handler_t* self, cef_browser_t* browser, const(cef_rect_t)* rect) nothrow on_popup_size;

Called when the browser wants to move or resize the popup widget. |rect| contains the new location and size in view coordinates.

on_scroll_offset_changed
void function(cef_render_handler_t* self, cef_browser_t* browser, double x, double y) nothrow on_scroll_offset_changed;

Called when the scroll offset has changed.

on_text_selection_changed
void function(cef_render_handler_t* self, cef_browser_t* browser, const(cef_string_t)* selected_text, const(cef_range_t)* selected_range) nothrow on_text_selection_changed;

Called when text selection has changed for the specified |browser|. |selected_text| is the currently selected text and |selected_range| is the character range.

on_touch_handle_state_changed
void function(cef_render_handler_t* self, cef_browser_t* browser, const(cef_touch_handle_state_t)* state) nothrow on_touch_handle_state_changed;

Called when touch handle state is updated. The client is responsible for rendering the touch handles.

on_virtual_keyboard_requested
void function(cef_render_handler_t* self, cef_browser_t* browser, cef_text_input_mode_t input_mode) nothrow on_virtual_keyboard_requested;

Called when an on-screen keyboard should be shown or hidden for the specified |browser|. |input_mode| specifies what kind of keyboard should be opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing keyboard for this browser should be hidden.

start_dragging
int function(cef_render_handler_t* self, cef_browser_t* browser, cef_drag_data_t* drag_data, cef_drag_operations_mask_t allowed_ops, int x, int y) nothrow start_dragging;

Called when the user starts dragging content in the web view. Contextual information about the dragged content is supplied by |drag_data|. (|x|, |y|) is the drag start location in screen coordinates. OS APIs that run a system message loop may be used within the StartDragging call.

update_drag_cursor
void function(cef_render_handler_t* self, cef_browser_t* browser, cef_drag_operations_mask_t operation) nothrow update_drag_cursor;

Called when the web view wants to update the mouse cursor during a drag & drop operation. |operation| describes the allowed operation (none, move, copy, link).

Meta