#![allow(
dead_code,
improper_ctypes_definitions,
non_camel_case_types,
unused_variables,
clippy::not_unsafe_ptr_arg_deref,
clippy::too_many_arguments,
clippy::let_unit_value
)]
use crate::rc::{ConvertParam, ConvertReturnValue, Rc, RcImpl, RefGuard, WrapParamRef};
use cef_dll_sys::*;
/// Perform the conversion between CEF and Rust types in field initializers.
fn init_array_field<T, U, const N: usize>(mut value: [U; N]) -> [T; N]
where
T: Sized,
U: Sized + Into<T>,
{
std::array::from_fn(move |i| {
let mut elem = unsafe { std::mem::zeroed() };
std::mem::swap(&mut value[i], &mut elem);
elem.into()
})
}
/// See [`cef_string_wide_t`] for more documentation.
pub use crate::string::CefStringUserfreeWide;
/// See [`cef_string_utf8_t`] for more documentation.
pub use crate::string::CefStringUserfreeUtf8;
/// See [`cef_string_utf16_t`] for more documentation.
pub use crate::string::CefStringUserfreeUtf16;
/// See [`char16_t`] for more documentation.
pub type Char = char16_t;
/// See [`cef_string_userfree_utf16_t`] for more documentation.
pub type CefStringUserfree = CefStringUserfreeUtf16;
/// See [`cef_string_utf16_t`] for more documentation.
pub type CefString = CefStringUtf16;
/// See [`HCURSOR`] for more documentation.
pub type CursorHandle = HCURSOR;
/// See [`MSG`] for more documentation.
pub type EventHandle = *mut MSG;
/// See [`HWND`] for more documentation.
pub type WindowHandle = HWND;
/// See [`HANDLE`] for more documentation.
pub type SharedTextureHandle = HANDLE;
/// See [`u32`] for more documentation.
pub type Color = u32;
/// See [`DWORD`] for more documentation.
pub type PlatformThreadId = DWORD;
/// See [`DWORD`] for more documentation.
pub type PlatformThreadHandle = DWORD;
/// See [`_cef_string_wide_t`] for more documentation.
pub use crate::string::CefStringWide;
/// See [`_cef_string_utf8_t`] for more documentation.
pub use crate::string::CefStringUtf8;
/// See [`_cef_string_utf16_t`] for more documentation.
pub use crate::string::CefStringUtf16;
/// See [`_cef_string_list_t`] for more documentation.
pub use crate::string::CefStringList;
/// See [`_cef_string_map_t`] for more documentation.
pub use crate::string::CefStringMap;
/// See [`_cef_string_multimap_t`] for more documentation.
pub use crate::string::CefStringMultimap;
/// See [`_cef_basetime_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Basetime {
pub val: i64,
}
impl Basetime {
fn get_raw(&self) -> _cef_basetime_t {
self.clone().into()
}
}
impl From<_cef_basetime_t> for Basetime {
fn from(value: _cef_basetime_t) -> Self {
Self { val: value.val }
}
}
impl From<Basetime> for _cef_basetime_t {
fn from(value: Basetime) -> Self {
Self { val: value.val }
}
}
impl Default for Basetime {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_time_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Time {
pub year: ::std::os::raw::c_int,
pub month: ::std::os::raw::c_int,
pub day_of_week: ::std::os::raw::c_int,
pub day_of_month: ::std::os::raw::c_int,
pub hour: ::std::os::raw::c_int,
pub minute: ::std::os::raw::c_int,
pub second: ::std::os::raw::c_int,
pub millisecond: ::std::os::raw::c_int,
}
impl Time {
fn get_raw(&self) -> _cef_time_t {
self.clone().into()
}
}
impl From<_cef_time_t> for Time {
fn from(value: _cef_time_t) -> Self {
Self {
year: value.year,
month: value.month,
day_of_week: value.day_of_week,
day_of_month: value.day_of_month,
hour: value.hour,
minute: value.minute,
second: value.second,
millisecond: value.millisecond,
}
}
}
impl From<Time> for _cef_time_t {
fn from(value: Time) -> Self {
Self {
year: value.year,
month: value.month,
day_of_week: value.day_of_week,
day_of_month: value.day_of_month,
hour: value.hour,
minute: value.minute,
second: value.second,
millisecond: value.millisecond,
}
}
}
impl Default for Time {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_point_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Point {
pub x: ::std::os::raw::c_int,
pub y: ::std::os::raw::c_int,
}
impl Point {
fn get_raw(&self) -> _cef_point_t {
self.clone().into()
}
}
impl From<_cef_point_t> for Point {
fn from(value: _cef_point_t) -> Self {
Self {
x: value.x,
y: value.y,
}
}
}
impl From<Point> for _cef_point_t {
fn from(value: Point) -> Self {
Self {
x: value.x,
y: value.y,
}
}
}
impl Default for Point {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_rect_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Rect {
pub x: ::std::os::raw::c_int,
pub y: ::std::os::raw::c_int,
pub width: ::std::os::raw::c_int,
pub height: ::std::os::raw::c_int,
}
impl Rect {
fn get_raw(&self) -> _cef_rect_t {
self.clone().into()
}
}
impl From<_cef_rect_t> for Rect {
fn from(value: _cef_rect_t) -> Self {
Self {
x: value.x,
y: value.y,
width: value.width,
height: value.height,
}
}
}
impl From<Rect> for _cef_rect_t {
fn from(value: Rect) -> Self {
Self {
x: value.x,
y: value.y,
width: value.width,
height: value.height,
}
}
}
impl Default for Rect {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_size_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Size {
pub width: ::std::os::raw::c_int,
pub height: ::std::os::raw::c_int,
}
impl Size {
fn get_raw(&self) -> _cef_size_t {
self.clone().into()
}
}
impl From<_cef_size_t> for Size {
fn from(value: _cef_size_t) -> Self {
Self {
width: value.width,
height: value.height,
}
}
}
impl From<Size> for _cef_size_t {
fn from(value: Size) -> Self {
Self {
width: value.width,
height: value.height,
}
}
}
impl Default for Size {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_insets_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Insets {
pub top: ::std::os::raw::c_int,
pub left: ::std::os::raw::c_int,
pub bottom: ::std::os::raw::c_int,
pub right: ::std::os::raw::c_int,
}
impl Insets {
fn get_raw(&self) -> _cef_insets_t {
self.clone().into()
}
}
impl From<_cef_insets_t> for Insets {
fn from(value: _cef_insets_t) -> Self {
Self {
top: value.top,
left: value.left,
bottom: value.bottom,
right: value.right,
}
}
}
impl From<Insets> for _cef_insets_t {
fn from(value: Insets) -> Self {
Self {
top: value.top,
left: value.left,
bottom: value.bottom,
right: value.right,
}
}
}
impl Default for Insets {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_accelerated_paint_info_common_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct AcceleratedPaintInfoCommon {
pub size: usize,
pub timestamp: u64,
pub coded_size: Size,
pub visible_rect: Rect,
pub content_rect: Rect,
pub source_size: Size,
pub capture_update_rect: Rect,
pub region_capture_rect: Rect,
pub capture_counter: u64,
pub has_capture_update_rect: u8,
pub has_region_capture_rect: u8,
pub has_source_size: u8,
pub has_capture_counter: u8,
}
impl AcceleratedPaintInfoCommon {
fn get_raw(&self) -> _cef_accelerated_paint_info_common_t {
self.clone().into()
}
}
impl From<_cef_accelerated_paint_info_common_t> for AcceleratedPaintInfoCommon {
fn from(value: _cef_accelerated_paint_info_common_t) -> Self {
Self {
size: value.size,
timestamp: value.timestamp,
coded_size: value.coded_size.into(),
visible_rect: value.visible_rect.into(),
content_rect: value.content_rect.into(),
source_size: value.source_size.into(),
capture_update_rect: value.capture_update_rect.into(),
region_capture_rect: value.region_capture_rect.into(),
capture_counter: value.capture_counter,
has_capture_update_rect: value.has_capture_update_rect,
has_region_capture_rect: value.has_region_capture_rect,
has_source_size: value.has_source_size,
has_capture_counter: value.has_capture_counter,
}
}
}
impl From<AcceleratedPaintInfoCommon> for _cef_accelerated_paint_info_common_t {
fn from(value: AcceleratedPaintInfoCommon) -> Self {
Self {
size: value.size,
timestamp: value.timestamp,
coded_size: value.coded_size.into(),
visible_rect: value.visible_rect.into(),
content_rect: value.content_rect.into(),
source_size: value.source_size.into(),
capture_update_rect: value.capture_update_rect.into(),
region_capture_rect: value.region_capture_rect.into(),
capture_counter: value.capture_counter,
has_capture_update_rect: value.has_capture_update_rect,
has_region_capture_rect: value.has_region_capture_rect,
has_source_size: value.has_source_size,
has_capture_counter: value.has_capture_counter,
}
}
}
impl Default for AcceleratedPaintInfoCommon {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_accelerated_paint_info_common_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_main_args_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct MainArgs {
pub instance: HINSTANCE,
}
impl MainArgs {
fn get_raw(&self) -> _cef_main_args_t {
self.clone().into()
}
}
impl From<_cef_main_args_t> for MainArgs {
fn from(value: _cef_main_args_t) -> Self {
Self {
instance: value.instance,
}
}
}
impl From<MainArgs> for _cef_main_args_t {
fn from(value: MainArgs) -> Self {
Self {
instance: value.instance,
}
}
}
impl Default for MainArgs {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_window_info_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct WindowInfo {
pub size: usize,
pub ex_style: DWORD,
pub window_name: CefString,
pub style: DWORD,
pub bounds: Rect,
pub parent_window: HWND,
pub menu: HMENU,
pub windowless_rendering_enabled: ::std::os::raw::c_int,
pub shared_texture_enabled: ::std::os::raw::c_int,
pub external_begin_frame_enabled: ::std::os::raw::c_int,
pub window: HWND,
pub runtime_style: RuntimeStyle,
}
impl WindowInfo {
fn get_raw(&self) -> _cef_window_info_t {
self.clone().into()
}
}
impl From<_cef_window_info_t> for WindowInfo {
fn from(value: _cef_window_info_t) -> Self {
Self {
size: value.size,
ex_style: value.ex_style,
window_name: value.window_name.into(),
style: value.style,
bounds: value.bounds.into(),
parent_window: value.parent_window,
menu: value.menu,
windowless_rendering_enabled: value.windowless_rendering_enabled,
shared_texture_enabled: value.shared_texture_enabled,
external_begin_frame_enabled: value.external_begin_frame_enabled,
window: value.window,
runtime_style: value.runtime_style.into(),
}
}
}
impl From<WindowInfo> for _cef_window_info_t {
fn from(value: WindowInfo) -> Self {
Self {
size: value.size,
ex_style: value.ex_style,
window_name: value.window_name.into(),
style: value.style,
bounds: value.bounds.into(),
parent_window: value.parent_window,
menu: value.menu,
windowless_rendering_enabled: value.windowless_rendering_enabled,
shared_texture_enabled: value.shared_texture_enabled,
external_begin_frame_enabled: value.external_begin_frame_enabled,
window: value.window,
runtime_style: value.runtime_style.into(),
}
}
}
impl Default for WindowInfo {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_window_info_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_accelerated_paint_info_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct AcceleratedPaintInfo {
pub size: usize,
pub shared_texture_handle: HANDLE,
pub format: ColorType,
pub extra: AcceleratedPaintInfoCommon,
}
impl AcceleratedPaintInfo {
fn get_raw(&self) -> _cef_accelerated_paint_info_t {
self.clone().into()
}
}
impl From<_cef_accelerated_paint_info_t> for AcceleratedPaintInfo {
fn from(value: _cef_accelerated_paint_info_t) -> Self {
Self {
size: value.size,
shared_texture_handle: value.shared_texture_handle,
format: value.format.into(),
extra: value.extra.into(),
}
}
}
impl From<AcceleratedPaintInfo> for _cef_accelerated_paint_info_t {
fn from(value: AcceleratedPaintInfo) -> Self {
Self {
size: value.size,
shared_texture_handle: value.shared_texture_handle,
format: value.format.into(),
extra: value.extra.into(),
}
}
}
impl Default for AcceleratedPaintInfo {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_accelerated_paint_info_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_settings_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Settings {
pub size: usize,
pub no_sandbox: ::std::os::raw::c_int,
pub browser_subprocess_path: CefString,
pub framework_dir_path: CefString,
pub main_bundle_path: CefString,
pub multi_threaded_message_loop: ::std::os::raw::c_int,
pub external_message_pump: ::std::os::raw::c_int,
pub windowless_rendering_enabled: ::std::os::raw::c_int,
pub command_line_args_disabled: ::std::os::raw::c_int,
pub cache_path: CefString,
pub root_cache_path: CefString,
pub persist_session_cookies: ::std::os::raw::c_int,
pub user_agent: CefString,
pub user_agent_product: CefString,
pub locale: CefString,
pub log_file: CefString,
pub log_severity: LogSeverity,
pub log_items: LogItems,
pub javascript_flags: CefString,
pub resources_dir_path: CefString,
pub locales_dir_path: CefString,
pub remote_debugging_port: ::std::os::raw::c_int,
pub uncaught_exception_stack_size: ::std::os::raw::c_int,
pub background_color: u32,
pub accept_language_list: CefString,
pub cookieable_schemes_list: CefString,
pub cookieable_schemes_exclude_defaults: ::std::os::raw::c_int,
pub chrome_policy_id: CefString,
pub chrome_app_icon_id: ::std::os::raw::c_int,
pub disable_signal_handlers: ::std::os::raw::c_int,
pub use_views_default_popup: ::std::os::raw::c_int,
}
impl Settings {
fn get_raw(&self) -> _cef_settings_t {
self.clone().into()
}
}
impl From<_cef_settings_t> for Settings {
fn from(value: _cef_settings_t) -> Self {
Self {
size: value.size,
no_sandbox: value.no_sandbox,
browser_subprocess_path: value.browser_subprocess_path.into(),
framework_dir_path: value.framework_dir_path.into(),
main_bundle_path: value.main_bundle_path.into(),
multi_threaded_message_loop: value.multi_threaded_message_loop,
external_message_pump: value.external_message_pump,
windowless_rendering_enabled: value.windowless_rendering_enabled,
command_line_args_disabled: value.command_line_args_disabled,
cache_path: value.cache_path.into(),
root_cache_path: value.root_cache_path.into(),
persist_session_cookies: value.persist_session_cookies,
user_agent: value.user_agent.into(),
user_agent_product: value.user_agent_product.into(),
locale: value.locale.into(),
log_file: value.log_file.into(),
log_severity: value.log_severity.into(),
log_items: value.log_items.into(),
javascript_flags: value.javascript_flags.into(),
resources_dir_path: value.resources_dir_path.into(),
locales_dir_path: value.locales_dir_path.into(),
remote_debugging_port: value.remote_debugging_port,
uncaught_exception_stack_size: value.uncaught_exception_stack_size,
background_color: value.background_color,
accept_language_list: value.accept_language_list.into(),
cookieable_schemes_list: value.cookieable_schemes_list.into(),
cookieable_schemes_exclude_defaults: value.cookieable_schemes_exclude_defaults,
chrome_policy_id: value.chrome_policy_id.into(),
chrome_app_icon_id: value.chrome_app_icon_id,
disable_signal_handlers: value.disable_signal_handlers,
use_views_default_popup: value.use_views_default_popup,
}
}
}
impl From<Settings> for _cef_settings_t {
fn from(value: Settings) -> Self {
Self {
size: value.size,
no_sandbox: value.no_sandbox,
browser_subprocess_path: value.browser_subprocess_path.into(),
framework_dir_path: value.framework_dir_path.into(),
main_bundle_path: value.main_bundle_path.into(),
multi_threaded_message_loop: value.multi_threaded_message_loop,
external_message_pump: value.external_message_pump,
windowless_rendering_enabled: value.windowless_rendering_enabled,
command_line_args_disabled: value.command_line_args_disabled,
cache_path: value.cache_path.into(),
root_cache_path: value.root_cache_path.into(),
persist_session_cookies: value.persist_session_cookies,
user_agent: value.user_agent.into(),
user_agent_product: value.user_agent_product.into(),
locale: value.locale.into(),
log_file: value.log_file.into(),
log_severity: value.log_severity.into(),
log_items: value.log_items.into(),
javascript_flags: value.javascript_flags.into(),
resources_dir_path: value.resources_dir_path.into(),
locales_dir_path: value.locales_dir_path.into(),
remote_debugging_port: value.remote_debugging_port,
uncaught_exception_stack_size: value.uncaught_exception_stack_size,
background_color: value.background_color,
accept_language_list: value.accept_language_list.into(),
cookieable_schemes_list: value.cookieable_schemes_list.into(),
cookieable_schemes_exclude_defaults: value.cookieable_schemes_exclude_defaults,
chrome_policy_id: value.chrome_policy_id.into(),
chrome_app_icon_id: value.chrome_app_icon_id,
disable_signal_handlers: value.disable_signal_handlers,
use_views_default_popup: value.use_views_default_popup,
}
}
}
impl Default for Settings {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_settings_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_request_context_settings_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct RequestContextSettings {
pub size: usize,
pub cache_path: CefString,
pub persist_session_cookies: ::std::os::raw::c_int,
pub accept_language_list: CefString,
pub cookieable_schemes_list: CefString,
pub cookieable_schemes_exclude_defaults: ::std::os::raw::c_int,
}
impl RequestContextSettings {
fn get_raw(&self) -> _cef_request_context_settings_t {
self.clone().into()
}
}
impl From<_cef_request_context_settings_t> for RequestContextSettings {
fn from(value: _cef_request_context_settings_t) -> Self {
Self {
size: value.size,
cache_path: value.cache_path.into(),
persist_session_cookies: value.persist_session_cookies,
accept_language_list: value.accept_language_list.into(),
cookieable_schemes_list: value.cookieable_schemes_list.into(),
cookieable_schemes_exclude_defaults: value.cookieable_schemes_exclude_defaults,
}
}
}
impl From<RequestContextSettings> for _cef_request_context_settings_t {
fn from(value: RequestContextSettings) -> Self {
Self {
size: value.size,
cache_path: value.cache_path.into(),
persist_session_cookies: value.persist_session_cookies,
accept_language_list: value.accept_language_list.into(),
cookieable_schemes_list: value.cookieable_schemes_list.into(),
cookieable_schemes_exclude_defaults: value.cookieable_schemes_exclude_defaults,
}
}
}
impl Default for RequestContextSettings {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_request_context_settings_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_browser_settings_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct BrowserSettings {
pub size: usize,
pub windowless_frame_rate: ::std::os::raw::c_int,
pub standard_font_family: CefString,
pub fixed_font_family: CefString,
pub serif_font_family: CefString,
pub sans_serif_font_family: CefString,
pub cursive_font_family: CefString,
pub fantasy_font_family: CefString,
pub default_font_size: ::std::os::raw::c_int,
pub default_fixed_font_size: ::std::os::raw::c_int,
pub minimum_font_size: ::std::os::raw::c_int,
pub minimum_logical_font_size: ::std::os::raw::c_int,
pub default_encoding: CefString,
pub remote_fonts: State,
pub javascript: State,
pub javascript_close_windows: State,
pub javascript_access_clipboard: State,
pub javascript_dom_paste: State,
pub image_loading: State,
pub image_shrink_standalone_to_fit: State,
pub text_area_resize: State,
pub tab_to_links: State,
pub local_storage: State,
pub databases_deprecated: State,
pub webgl: State,
pub background_color: u32,
pub chrome_status_bubble: State,
pub chrome_zoom_bubble: State,
pub ax_viewport_collapse: State,
}
impl BrowserSettings {
fn get_raw(&self) -> _cef_browser_settings_t {
self.clone().into()
}
}
impl From<_cef_browser_settings_t> for BrowserSettings {
fn from(value: _cef_browser_settings_t) -> Self {
Self {
size: value.size,
windowless_frame_rate: value.windowless_frame_rate,
standard_font_family: value.standard_font_family.into(),
fixed_font_family: value.fixed_font_family.into(),
serif_font_family: value.serif_font_family.into(),
sans_serif_font_family: value.sans_serif_font_family.into(),
cursive_font_family: value.cursive_font_family.into(),
fantasy_font_family: value.fantasy_font_family.into(),
default_font_size: value.default_font_size,
default_fixed_font_size: value.default_fixed_font_size,
minimum_font_size: value.minimum_font_size,
minimum_logical_font_size: value.minimum_logical_font_size,
default_encoding: value.default_encoding.into(),
remote_fonts: value.remote_fonts.into(),
javascript: value.javascript.into(),
javascript_close_windows: value.javascript_close_windows.into(),
javascript_access_clipboard: value.javascript_access_clipboard.into(),
javascript_dom_paste: value.javascript_dom_paste.into(),
image_loading: value.image_loading.into(),
image_shrink_standalone_to_fit: value.image_shrink_standalone_to_fit.into(),
text_area_resize: value.text_area_resize.into(),
tab_to_links: value.tab_to_links.into(),
local_storage: value.local_storage.into(),
databases_deprecated: value.databases_deprecated.into(),
webgl: value.webgl.into(),
background_color: value.background_color,
chrome_status_bubble: value.chrome_status_bubble.into(),
chrome_zoom_bubble: value.chrome_zoom_bubble.into(),
ax_viewport_collapse: value.ax_viewport_collapse.into(),
}
}
}
impl From<BrowserSettings> for _cef_browser_settings_t {
fn from(value: BrowserSettings) -> Self {
Self {
size: value.size,
windowless_frame_rate: value.windowless_frame_rate,
standard_font_family: value.standard_font_family.into(),
fixed_font_family: value.fixed_font_family.into(),
serif_font_family: value.serif_font_family.into(),
sans_serif_font_family: value.sans_serif_font_family.into(),
cursive_font_family: value.cursive_font_family.into(),
fantasy_font_family: value.fantasy_font_family.into(),
default_font_size: value.default_font_size,
default_fixed_font_size: value.default_fixed_font_size,
minimum_font_size: value.minimum_font_size,
minimum_logical_font_size: value.minimum_logical_font_size,
default_encoding: value.default_encoding.into(),
remote_fonts: value.remote_fonts.into(),
javascript: value.javascript.into(),
javascript_close_windows: value.javascript_close_windows.into(),
javascript_access_clipboard: value.javascript_access_clipboard.into(),
javascript_dom_paste: value.javascript_dom_paste.into(),
image_loading: value.image_loading.into(),
image_shrink_standalone_to_fit: value.image_shrink_standalone_to_fit.into(),
text_area_resize: value.text_area_resize.into(),
tab_to_links: value.tab_to_links.into(),
local_storage: value.local_storage.into(),
databases_deprecated: value.databases_deprecated.into(),
webgl: value.webgl.into(),
background_color: value.background_color,
chrome_status_bubble: value.chrome_status_bubble.into(),
chrome_zoom_bubble: value.chrome_zoom_bubble.into(),
ax_viewport_collapse: value.ax_viewport_collapse.into(),
}
}
}
impl Default for BrowserSettings {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_browser_settings_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_urlparts_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Urlparts {
pub size: usize,
pub spec: CefString,
pub scheme: CefString,
pub username: CefString,
pub password: CefString,
pub host: CefString,
pub port: CefString,
pub origin: CefString,
pub path: CefString,
pub query: CefString,
pub fragment: CefString,
}
impl Urlparts {
fn get_raw(&self) -> _cef_urlparts_t {
self.clone().into()
}
}
impl From<_cef_urlparts_t> for Urlparts {
fn from(value: _cef_urlparts_t) -> Self {
Self {
size: value.size,
spec: value.spec.into(),
scheme: value.scheme.into(),
username: value.username.into(),
password: value.password.into(),
host: value.host.into(),
port: value.port.into(),
origin: value.origin.into(),
path: value.path.into(),
query: value.query.into(),
fragment: value.fragment.into(),
}
}
}
impl From<Urlparts> for _cef_urlparts_t {
fn from(value: Urlparts) -> Self {
Self {
size: value.size,
spec: value.spec.into(),
scheme: value.scheme.into(),
username: value.username.into(),
password: value.password.into(),
host: value.host.into(),
port: value.port.into(),
origin: value.origin.into(),
path: value.path.into(),
query: value.query.into(),
fragment: value.fragment.into(),
}
}
}
impl Default for Urlparts {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_urlparts_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_cookie_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Cookie {
pub size: usize,
pub name: CefString,
pub value: CefString,
pub domain: CefString,
pub path: CefString,
pub secure: ::std::os::raw::c_int,
pub httponly: ::std::os::raw::c_int,
pub creation: Basetime,
pub last_access: Basetime,
pub has_expires: ::std::os::raw::c_int,
pub expires: Basetime,
pub same_site: CookieSameSite,
pub priority: CookiePriority,
}
impl Cookie {
fn get_raw(&self) -> _cef_cookie_t {
self.clone().into()
}
}
impl From<_cef_cookie_t> for Cookie {
fn from(value: _cef_cookie_t) -> Self {
Self {
size: value.size,
name: value.name.into(),
value: value.value.into(),
domain: value.domain.into(),
path: value.path.into(),
secure: value.secure,
httponly: value.httponly,
creation: value.creation.into(),
last_access: value.last_access.into(),
has_expires: value.has_expires,
expires: value.expires.into(),
same_site: value.same_site.into(),
priority: value.priority.into(),
}
}
}
impl From<Cookie> for _cef_cookie_t {
fn from(value: Cookie) -> Self {
Self {
size: value.size,
name: value.name.into(),
value: value.value.into(),
domain: value.domain.into(),
path: value.path.into(),
secure: value.secure,
httponly: value.httponly,
creation: value.creation.into(),
last_access: value.last_access.into(),
has_expires: value.has_expires,
expires: value.expires.into(),
same_site: value.same_site.into(),
priority: value.priority.into(),
}
}
}
impl Default for Cookie {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_cookie_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_draggable_region_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct DraggableRegion {
pub bounds: Rect,
pub draggable: ::std::os::raw::c_int,
}
impl DraggableRegion {
fn get_raw(&self) -> _cef_draggable_region_t {
self.clone().into()
}
}
impl From<_cef_draggable_region_t> for DraggableRegion {
fn from(value: _cef_draggable_region_t) -> Self {
Self {
bounds: value.bounds.into(),
draggable: value.draggable,
}
}
}
impl From<DraggableRegion> for _cef_draggable_region_t {
fn from(value: DraggableRegion) -> Self {
Self {
bounds: value.bounds.into(),
draggable: value.draggable,
}
}
}
impl Default for DraggableRegion {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_screen_info_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct ScreenInfo {
pub size: usize,
pub device_scale_factor: f32,
pub depth: ::std::os::raw::c_int,
pub depth_per_component: ::std::os::raw::c_int,
pub is_monochrome: ::std::os::raw::c_int,
pub rect: Rect,
pub available_rect: Rect,
}
impl ScreenInfo {
fn get_raw(&self) -> _cef_screen_info_t {
self.clone().into()
}
}
impl From<_cef_screen_info_t> for ScreenInfo {
fn from(value: _cef_screen_info_t) -> Self {
Self {
size: value.size,
device_scale_factor: value.device_scale_factor,
depth: value.depth,
depth_per_component: value.depth_per_component,
is_monochrome: value.is_monochrome,
rect: value.rect.into(),
available_rect: value.available_rect.into(),
}
}
}
impl From<ScreenInfo> for _cef_screen_info_t {
fn from(value: ScreenInfo) -> Self {
Self {
size: value.size,
device_scale_factor: value.device_scale_factor,
depth: value.depth,
depth_per_component: value.depth_per_component,
is_monochrome: value.is_monochrome,
rect: value.rect.into(),
available_rect: value.available_rect.into(),
}
}
}
impl Default for ScreenInfo {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_screen_info_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_linux_window_properties_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct LinuxWindowProperties {
pub size: usize,
pub wayland_app_id: CefString,
pub wm_class_class: CefString,
pub wm_class_name: CefString,
pub wm_role_name: CefString,
}
impl LinuxWindowProperties {
fn get_raw(&self) -> _cef_linux_window_properties_t {
self.clone().into()
}
}
impl From<_cef_linux_window_properties_t> for LinuxWindowProperties {
fn from(value: _cef_linux_window_properties_t) -> Self {
Self {
size: value.size,
wayland_app_id: value.wayland_app_id.into(),
wm_class_class: value.wm_class_class.into(),
wm_class_name: value.wm_class_name.into(),
wm_role_name: value.wm_role_name.into(),
}
}
}
impl From<LinuxWindowProperties> for _cef_linux_window_properties_t {
fn from(value: LinuxWindowProperties) -> Self {
Self {
size: value.size,
wayland_app_id: value.wayland_app_id.into(),
wm_class_class: value.wm_class_class.into(),
wm_class_name: value.wm_class_name.into(),
wm_role_name: value.wm_role_name.into(),
}
}
}
impl Default for LinuxWindowProperties {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_linux_window_properties_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_mouse_event_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct MouseEvent {
pub x: ::std::os::raw::c_int,
pub y: ::std::os::raw::c_int,
pub modifiers: u32,
}
impl MouseEvent {
fn get_raw(&self) -> _cef_mouse_event_t {
self.clone().into()
}
}
impl From<_cef_mouse_event_t> for MouseEvent {
fn from(value: _cef_mouse_event_t) -> Self {
Self {
x: value.x,
y: value.y,
modifiers: value.modifiers,
}
}
}
impl From<MouseEvent> for _cef_mouse_event_t {
fn from(value: MouseEvent) -> Self {
Self {
x: value.x,
y: value.y,
modifiers: value.modifiers,
}
}
}
impl Default for MouseEvent {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_touch_event_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct TouchEvent {
pub id: ::std::os::raw::c_int,
pub x: f32,
pub y: f32,
pub radius_x: f32,
pub radius_y: f32,
pub rotation_angle: f32,
pub pressure: f32,
pub type_: TouchEventType,
pub modifiers: u32,
pub pointer_type: PointerType,
}
impl TouchEvent {
fn get_raw(&self) -> _cef_touch_event_t {
self.clone().into()
}
}
impl From<_cef_touch_event_t> for TouchEvent {
fn from(value: _cef_touch_event_t) -> Self {
Self {
id: value.id,
x: value.x,
y: value.y,
radius_x: value.radius_x,
radius_y: value.radius_y,
rotation_angle: value.rotation_angle,
pressure: value.pressure,
type_: value.type_.into(),
modifiers: value.modifiers,
pointer_type: value.pointer_type.into(),
}
}
}
impl From<TouchEvent> for _cef_touch_event_t {
fn from(value: TouchEvent) -> Self {
Self {
id: value.id,
x: value.x,
y: value.y,
radius_x: value.radius_x,
radius_y: value.radius_y,
rotation_angle: value.rotation_angle,
pressure: value.pressure,
type_: value.type_.into(),
modifiers: value.modifiers,
pointer_type: value.pointer_type.into(),
}
}
}
impl Default for TouchEvent {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_key_event_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct KeyEvent {
pub size: usize,
pub type_: KeyEventType,
pub modifiers: u32,
pub windows_key_code: ::std::os::raw::c_int,
pub native_key_code: ::std::os::raw::c_int,
pub is_system_key: ::std::os::raw::c_int,
pub character: char16_t,
pub unmodified_character: char16_t,
pub focus_on_editable_field: ::std::os::raw::c_int,
}
impl KeyEvent {
fn get_raw(&self) -> _cef_key_event_t {
self.clone().into()
}
}
impl From<_cef_key_event_t> for KeyEvent {
fn from(value: _cef_key_event_t) -> Self {
Self {
size: value.size,
type_: value.type_.into(),
modifiers: value.modifiers,
windows_key_code: value.windows_key_code,
native_key_code: value.native_key_code,
is_system_key: value.is_system_key,
character: value.character,
unmodified_character: value.unmodified_character,
focus_on_editable_field: value.focus_on_editable_field,
}
}
}
impl From<KeyEvent> for _cef_key_event_t {
fn from(value: KeyEvent) -> Self {
Self {
size: value.size,
type_: value.type_.into(),
modifiers: value.modifiers,
windows_key_code: value.windows_key_code,
native_key_code: value.native_key_code,
is_system_key: value.is_system_key,
character: value.character,
unmodified_character: value.unmodified_character,
focus_on_editable_field: value.focus_on_editable_field,
}
}
}
impl Default for KeyEvent {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_key_event_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_popup_features_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct PopupFeatures {
pub size: usize,
pub x: ::std::os::raw::c_int,
pub x_set: ::std::os::raw::c_int,
pub y: ::std::os::raw::c_int,
pub y_set: ::std::os::raw::c_int,
pub width: ::std::os::raw::c_int,
pub width_set: ::std::os::raw::c_int,
pub height: ::std::os::raw::c_int,
pub height_set: ::std::os::raw::c_int,
pub is_popup: ::std::os::raw::c_int,
}
impl PopupFeatures {
fn get_raw(&self) -> _cef_popup_features_t {
self.clone().into()
}
}
impl From<_cef_popup_features_t> for PopupFeatures {
fn from(value: _cef_popup_features_t) -> Self {
Self {
size: value.size,
x: value.x,
x_set: value.xSet,
y: value.y,
y_set: value.ySet,
width: value.width,
width_set: value.widthSet,
height: value.height,
height_set: value.heightSet,
is_popup: value.isPopup,
}
}
}
impl From<PopupFeatures> for _cef_popup_features_t {
fn from(value: PopupFeatures) -> Self {
Self {
size: value.size,
x: value.x,
xSet: value.x_set,
y: value.y,
ySet: value.y_set,
width: value.width,
widthSet: value.width_set,
height: value.height,
heightSet: value.height_set,
isPopup: value.is_popup,
}
}
}
impl Default for PopupFeatures {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_popup_features_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_cursor_info_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct CursorInfo {
pub hotspot: Point,
pub image_scale_factor: f32,
pub buffer: *mut ::std::os::raw::c_void,
pub size: Size,
}
impl CursorInfo {
fn get_raw(&self) -> _cef_cursor_info_t {
self.clone().into()
}
}
impl From<_cef_cursor_info_t> for CursorInfo {
fn from(value: _cef_cursor_info_t) -> Self {
Self {
hotspot: value.hotspot.into(),
image_scale_factor: value.image_scale_factor,
buffer: value.buffer,
size: value.size.into(),
}
}
}
impl From<CursorInfo> for _cef_cursor_info_t {
fn from(value: CursorInfo) -> Self {
Self {
hotspot: value.hotspot.into(),
image_scale_factor: value.image_scale_factor,
buffer: value.buffer,
size: value.size.into(),
}
}
}
impl Default for CursorInfo {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_pdf_print_settings_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct PdfPrintSettings {
pub size: usize,
pub landscape: ::std::os::raw::c_int,
pub print_background: ::std::os::raw::c_int,
pub scale: f64,
pub paper_width: f64,
pub paper_height: f64,
pub prefer_css_page_size: ::std::os::raw::c_int,
pub margin_type: PdfPrintMarginType,
pub margin_top: f64,
pub margin_right: f64,
pub margin_bottom: f64,
pub margin_left: f64,
pub page_ranges: CefString,
pub display_header_footer: ::std::os::raw::c_int,
pub header_template: CefString,
pub footer_template: CefString,
pub generate_tagged_pdf: ::std::os::raw::c_int,
pub generate_document_outline: ::std::os::raw::c_int,
}
impl PdfPrintSettings {
fn get_raw(&self) -> _cef_pdf_print_settings_t {
self.clone().into()
}
}
impl From<_cef_pdf_print_settings_t> for PdfPrintSettings {
fn from(value: _cef_pdf_print_settings_t) -> Self {
Self {
size: value.size,
landscape: value.landscape,
print_background: value.print_background,
scale: value.scale,
paper_width: value.paper_width,
paper_height: value.paper_height,
prefer_css_page_size: value.prefer_css_page_size,
margin_type: value.margin_type.into(),
margin_top: value.margin_top,
margin_right: value.margin_right,
margin_bottom: value.margin_bottom,
margin_left: value.margin_left,
page_ranges: value.page_ranges.into(),
display_header_footer: value.display_header_footer,
header_template: value.header_template.into(),
footer_template: value.footer_template.into(),
generate_tagged_pdf: value.generate_tagged_pdf,
generate_document_outline: value.generate_document_outline,
}
}
}
impl From<PdfPrintSettings> for _cef_pdf_print_settings_t {
fn from(value: PdfPrintSettings) -> Self {
Self {
size: value.size,
landscape: value.landscape,
print_background: value.print_background,
scale: value.scale,
paper_width: value.paper_width,
paper_height: value.paper_height,
prefer_css_page_size: value.prefer_css_page_size,
margin_type: value.margin_type.into(),
margin_top: value.margin_top,
margin_right: value.margin_right,
margin_bottom: value.margin_bottom,
margin_left: value.margin_left,
page_ranges: value.page_ranges.into(),
display_header_footer: value.display_header_footer,
header_template: value.header_template.into(),
footer_template: value.footer_template.into(),
generate_tagged_pdf: value.generate_tagged_pdf,
generate_document_outline: value.generate_document_outline,
}
}
}
impl Default for PdfPrintSettings {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_pdf_print_settings_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_box_layout_settings_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct BoxLayoutSettings {
pub size: usize,
pub horizontal: ::std::os::raw::c_int,
pub inside_border_horizontal_spacing: ::std::os::raw::c_int,
pub inside_border_vertical_spacing: ::std::os::raw::c_int,
pub inside_border_insets: Insets,
pub between_child_spacing: ::std::os::raw::c_int,
pub main_axis_alignment: AxisAlignment,
pub cross_axis_alignment: AxisAlignment,
pub minimum_cross_axis_size: ::std::os::raw::c_int,
pub default_flex: ::std::os::raw::c_int,
}
impl BoxLayoutSettings {
fn get_raw(&self) -> _cef_box_layout_settings_t {
self.clone().into()
}
}
impl From<_cef_box_layout_settings_t> for BoxLayoutSettings {
fn from(value: _cef_box_layout_settings_t) -> Self {
Self {
size: value.size,
horizontal: value.horizontal,
inside_border_horizontal_spacing: value.inside_border_horizontal_spacing,
inside_border_vertical_spacing: value.inside_border_vertical_spacing,
inside_border_insets: value.inside_border_insets.into(),
between_child_spacing: value.between_child_spacing,
main_axis_alignment: value.main_axis_alignment.into(),
cross_axis_alignment: value.cross_axis_alignment.into(),
minimum_cross_axis_size: value.minimum_cross_axis_size,
default_flex: value.default_flex,
}
}
}
impl From<BoxLayoutSettings> for _cef_box_layout_settings_t {
fn from(value: BoxLayoutSettings) -> Self {
Self {
size: value.size,
horizontal: value.horizontal,
inside_border_horizontal_spacing: value.inside_border_horizontal_spacing,
inside_border_vertical_spacing: value.inside_border_vertical_spacing,
inside_border_insets: value.inside_border_insets.into(),
between_child_spacing: value.between_child_spacing,
main_axis_alignment: value.main_axis_alignment.into(),
cross_axis_alignment: value.cross_axis_alignment.into(),
minimum_cross_axis_size: value.minimum_cross_axis_size,
default_flex: value.default_flex,
}
}
}
impl Default for BoxLayoutSettings {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_box_layout_settings_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_range_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct Range {
pub from: u32,
pub to: u32,
}
impl Range {
fn get_raw(&self) -> _cef_range_t {
self.clone().into()
}
}
impl From<_cef_range_t> for Range {
fn from(value: _cef_range_t) -> Self {
Self {
from: value.from,
to: value.to,
}
}
}
impl From<Range> for _cef_range_t {
fn from(value: Range) -> Self {
Self {
from: value.from,
to: value.to,
}
}
}
impl Default for Range {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`_cef_composition_underline_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct CompositionUnderline {
pub size: usize,
pub range: Range,
pub color: u32,
pub background_color: u32,
pub thick: ::std::os::raw::c_int,
pub style: CompositionUnderlineStyle,
}
impl CompositionUnderline {
fn get_raw(&self) -> _cef_composition_underline_t {
self.clone().into()
}
}
impl From<_cef_composition_underline_t> for CompositionUnderline {
fn from(value: _cef_composition_underline_t) -> Self {
Self {
size: value.size,
range: value.range.into(),
color: value.color,
background_color: value.background_color,
thick: value.thick,
style: value.style.into(),
}
}
}
impl From<CompositionUnderline> for _cef_composition_underline_t {
fn from(value: CompositionUnderline) -> Self {
Self {
size: value.size,
range: value.range.into(),
color: value.color,
background_color: value.background_color,
thick: value.thick,
style: value.style.into(),
}
}
}
impl Default for CompositionUnderline {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_composition_underline_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_audio_parameters_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct AudioParameters {
pub size: usize,
pub channel_layout: ChannelLayout,
pub sample_rate: ::std::os::raw::c_int,
pub frames_per_buffer: ::std::os::raw::c_int,
}
impl AudioParameters {
fn get_raw(&self) -> _cef_audio_parameters_t {
self.clone().into()
}
}
impl From<_cef_audio_parameters_t> for AudioParameters {
fn from(value: _cef_audio_parameters_t) -> Self {
Self {
size: value.size,
channel_layout: value.channel_layout.into(),
sample_rate: value.sample_rate,
frames_per_buffer: value.frames_per_buffer,
}
}
}
impl From<AudioParameters> for _cef_audio_parameters_t {
fn from(value: AudioParameters) -> Self {
Self {
size: value.size,
channel_layout: value.channel_layout.into(),
sample_rate: value.sample_rate,
frames_per_buffer: value.frames_per_buffer,
}
}
}
impl Default for AudioParameters {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_audio_parameters_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_media_sink_device_info_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct MediaSinkDeviceInfo {
pub size: usize,
pub ip_address: CefString,
pub port: ::std::os::raw::c_int,
pub model_name: CefString,
}
impl MediaSinkDeviceInfo {
fn get_raw(&self) -> _cef_media_sink_device_info_t {
self.clone().into()
}
}
impl From<_cef_media_sink_device_info_t> for MediaSinkDeviceInfo {
fn from(value: _cef_media_sink_device_info_t) -> Self {
Self {
size: value.size,
ip_address: value.ip_address.into(),
port: value.port,
model_name: value.model_name.into(),
}
}
}
impl From<MediaSinkDeviceInfo> for _cef_media_sink_device_info_t {
fn from(value: MediaSinkDeviceInfo) -> Self {
Self {
size: value.size,
ip_address: value.ip_address.into(),
port: value.port,
model_name: value.model_name.into(),
}
}
}
impl Default for MediaSinkDeviceInfo {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_media_sink_device_info_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_touch_handle_state_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct TouchHandleState {
pub size: usize,
pub touch_handle_id: ::std::os::raw::c_int,
pub flags: u32,
pub enabled: ::std::os::raw::c_int,
pub orientation: HorizontalAlignment,
pub mirror_vertical: ::std::os::raw::c_int,
pub mirror_horizontal: ::std::os::raw::c_int,
pub origin: Point,
pub alpha: f32,
}
impl TouchHandleState {
fn get_raw(&self) -> _cef_touch_handle_state_t {
self.clone().into()
}
}
impl From<_cef_touch_handle_state_t> for TouchHandleState {
fn from(value: _cef_touch_handle_state_t) -> Self {
Self {
size: value.size,
touch_handle_id: value.touch_handle_id,
flags: value.flags,
enabled: value.enabled,
orientation: value.orientation.into(),
mirror_vertical: value.mirror_vertical,
mirror_horizontal: value.mirror_horizontal,
origin: value.origin.into(),
alpha: value.alpha,
}
}
}
impl From<TouchHandleState> for _cef_touch_handle_state_t {
fn from(value: TouchHandleState) -> Self {
Self {
size: value.size,
touch_handle_id: value.touch_handle_id,
flags: value.flags,
enabled: value.enabled,
orientation: value.orientation.into(),
mirror_vertical: value.mirror_vertical,
mirror_horizontal: value.mirror_horizontal,
origin: value.origin.into(),
alpha: value.alpha,
}
}
}
impl Default for TouchHandleState {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_touch_handle_state_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_task_info_t`] for more documentation.
#[derive(Clone, Debug)]
pub struct TaskInfo {
pub size: usize,
pub id: i64,
pub type_: TaskType,
pub is_killable: ::std::os::raw::c_int,
pub title: CefString,
pub cpu_usage: f64,
pub number_of_processors: ::std::os::raw::c_int,
pub memory: i64,
pub gpu_memory: i64,
pub is_gpu_memory_inflated: ::std::os::raw::c_int,
}
impl TaskInfo {
fn get_raw(&self) -> _cef_task_info_t {
self.clone().into()
}
}
impl From<_cef_task_info_t> for TaskInfo {
fn from(value: _cef_task_info_t) -> Self {
Self {
size: value.size,
id: value.id,
type_: value.type_.into(),
is_killable: value.is_killable,
title: value.title.into(),
cpu_usage: value.cpu_usage,
number_of_processors: value.number_of_processors,
memory: value.memory,
gpu_memory: value.gpu_memory,
is_gpu_memory_inflated: value.is_gpu_memory_inflated,
}
}
}
impl From<TaskInfo> for _cef_task_info_t {
fn from(value: TaskInfo) -> Self {
Self {
size: value.size,
id: value.id,
type_: value.type_.into(),
is_killable: value.is_killable,
title: value.title.into(),
cpu_usage: value.cpu_usage,
number_of_processors: value.number_of_processors,
memory: value.memory,
gpu_memory: value.gpu_memory,
is_gpu_memory_inflated: value.is_gpu_memory_inflated,
}
}
}
impl Default for TaskInfo {
fn default() -> Self {
Self {
size: std::mem::size_of::<_cef_task_info_t>(),
..unsafe { std::mem::zeroed() }
}
}
}
/// See [`_cef_base_ref_counted_t`] for more documentation.
#[derive(Clone)]
pub struct BaseRefCounted(RefGuard<_cef_base_ref_counted_t>);
impl BaseRefCounted {
fn get_raw(&self) -> *mut _cef_base_ref_counted_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for BaseRefCounted {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_base_ref_counted_t> for &BaseRefCounted {
fn into_raw(self) -> *mut _cef_base_ref_counted_t {
self.get_raw()
}
}
impl ConvertParam<*mut _cef_base_ref_counted_t> for &mut BaseRefCounted {
fn into_raw(self) -> *mut _cef_base_ref_counted_t {
self.get_raw()
}
}
impl ConvertReturnValue<BaseRefCounted> for *mut _cef_base_ref_counted_t {
fn wrap_result(self) -> BaseRefCounted {
BaseRefCounted(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BaseRefCounted> for *mut _cef_base_ref_counted_t {
fn from(value: BaseRefCounted) -> Self {
let object = value.get_raw();
std::mem::forget(value);
object
}
}
/// See [`_cef_base_scoped_t`] for more documentation.
#[derive(Clone, Copy)]
pub struct BaseScoped(*mut _cef_base_scoped_t);
impl BaseScoped {
fn get_raw(&self) -> *mut _cef_base_scoped_t {
self.0
}
}
impl ConvertParam<*mut _cef_base_scoped_t> for &BaseScoped {
fn into_raw(self) -> *mut _cef_base_scoped_t {
self.get_raw()
}
}
impl ConvertParam<*mut _cef_base_scoped_t> for &mut BaseScoped {
fn into_raw(self) -> *mut _cef_base_scoped_t {
self.get_raw()
}
}
impl ConvertReturnValue<BaseScoped> for *mut _cef_base_scoped_t {
fn wrap_result(self) -> BaseScoped {
BaseScoped(self)
}
}
impl From<BaseScoped> for *mut _cef_base_scoped_t {
fn from(value: BaseScoped) -> Self {
value.get_raw()
}
}
/// See [`_cef_value_t`] for more documentation.
#[derive(Clone)]
pub struct Value(RefGuard<_cef_value_t>);
pub trait ImplValue: Clone + Sized + Rc {
#[doc = "See [`_cef_value_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::is_owned`] for more documentation."]
fn is_owned(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut Value>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::is_equal`] for more documentation."]
fn is_equal(&self, that: Option<&mut Value>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::copy`] for more documentation."]
fn copy(&self) -> Option<Value>;
#[doc = "See [`_cef_value_t::get_type`] for more documentation."]
fn get_type(&self) -> ValueType;
#[doc = "See [`_cef_value_t::get_bool`] for more documentation."]
fn bool(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::get_int`] for more documentation."]
fn int(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::get_double`] for more documentation."]
fn double(&self) -> f64;
#[doc = "See [`_cef_value_t::get_string`] for more documentation."]
fn string(&self) -> CefStringUserfree;
#[doc = "See [`_cef_value_t::get_binary`] for more documentation."]
fn binary(&self) -> Option<BinaryValue>;
#[doc = "See [`_cef_value_t::get_dictionary`] for more documentation."]
fn dictionary(&self) -> Option<DictionaryValue>;
#[doc = "See [`_cef_value_t::get_list`] for more documentation."]
fn list(&self) -> Option<ListValue>;
#[doc = "See [`_cef_value_t::set_null`] for more documentation."]
fn set_null(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::set_bool`] for more documentation."]
fn set_bool(&self, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::set_int`] for more documentation."]
fn set_int(&self, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::set_double`] for more documentation."]
fn set_double(&self, value: f64) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::set_string`] for more documentation."]
fn set_string(&self, value: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::set_binary`] for more documentation."]
fn set_binary(&self, value: Option<&mut BinaryValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::set_dictionary`] for more documentation."]
fn set_dictionary(&self, value: Option<&mut DictionaryValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_value_t::set_list`] for more documentation."]
fn set_list(&self, value: Option<&mut ListValue>) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_value_t;
}
impl ImplValue for Value {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_owned(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_owned
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut Value>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_equal(&self, that: Option<&mut Value>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_equal
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn copy(&self) -> Option<Value> {
unsafe {
self.0
.copy
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_type(&self) -> ValueType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn bool(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_bool
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn int(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_int
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn double(&self) -> f64 {
unsafe {
self.0
.get_double
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn string(&self) -> CefStringUserfree {
unsafe {
self.0
.get_string
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn binary(&self) -> Option<BinaryValue> {
unsafe {
self.0
.get_binary
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn dictionary(&self) -> Option<DictionaryValue> {
unsafe {
self.0
.get_dictionary
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn list(&self) -> Option<ListValue> {
unsafe {
self.0
.get_list
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_null(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_null
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_bool(&self, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_bool
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_int(&self, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_int
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_double(&self, value: f64) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_double
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_string(&self, value: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_string
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_binary(&self, value: Option<&mut BinaryValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_binary
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplBinaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_dictionary(&self, value: Option<&mut DictionaryValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_dictionary
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_list(&self, value: Option<&mut ListValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_list
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplListValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_value_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_value_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Value {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_value_t> for &Value {
fn into_raw(self) -> *mut _cef_value_t {
ImplValue::get_raw(self)
}
}
impl ConvertParam<*mut _cef_value_t> for &mut Value {
fn into_raw(self) -> *mut _cef_value_t {
ImplValue::get_raw(self)
}
}
impl ConvertReturnValue<Value> for *mut _cef_value_t {
fn wrap_result(self) -> Value {
Value(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Value> for *mut _cef_value_t {
fn from(value: Value) -> Self {
let object = ImplValue::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_binary_value_t`] for more documentation.
#[derive(Clone)]
pub struct BinaryValue(RefGuard<_cef_binary_value_t>);
pub trait ImplBinaryValue: Clone + Sized + Rc {
#[doc = "See [`_cef_binary_value_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_binary_value_t::is_owned`] for more documentation."]
fn is_owned(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_binary_value_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut BinaryValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_binary_value_t::is_equal`] for more documentation."]
fn is_equal(&self, that: Option<&mut BinaryValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_binary_value_t::copy`] for more documentation."]
fn copy(&self) -> Option<BinaryValue>;
#[doc = "See [`_cef_binary_value_t::get_raw_data`] for more documentation."]
fn raw_data(&self) -> *const ::std::os::raw::c_void;
#[doc = "See [`_cef_binary_value_t::get_size`] for more documentation."]
fn size(&self) -> usize;
#[doc = "See [`_cef_binary_value_t::get_data`] for more documentation."]
fn data(&self, buffer: Option<&mut Vec<u8>>, data_offset: usize) -> usize;
fn get_raw(&self) -> *mut _cef_binary_value_t;
}
impl ImplBinaryValue for BinaryValue {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_owned(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_owned
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut BinaryValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplBinaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_equal(&self, that: Option<&mut BinaryValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_equal
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplBinaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn copy(&self) -> Option<BinaryValue> {
unsafe {
self.0
.copy
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn raw_data(&self) -> *const ::std::os::raw::c_void {
unsafe {
self.0
.get_raw_data
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_else(|| std::mem::zeroed())
}
}
fn size(&self) -> usize {
unsafe {
self.0
.get_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn data(&self, buffer: Option<&mut Vec<u8>>, data_offset: usize) -> usize {
unsafe {
self.0
.get_data
.map(|f| {
let (arg_buffer, arg_data_offset) = (buffer, data_offset);
let arg_self_ = self.into_raw();
let arg_buffer_size =
arg_buffer.as_ref().map(|arg| arg.len()).unwrap_or_default();
let mut out_buffer = arg_buffer;
let arg_buffer = out_buffer
.as_mut()
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_mut_ptr().cast())
}
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_buffer, arg_buffer_size, arg_data_offset);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_binary_value_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_binary_value_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for BinaryValue {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_binary_value_t> for &BinaryValue {
fn into_raw(self) -> *mut _cef_binary_value_t {
ImplBinaryValue::get_raw(self)
}
}
impl ConvertParam<*mut _cef_binary_value_t> for &mut BinaryValue {
fn into_raw(self) -> *mut _cef_binary_value_t {
ImplBinaryValue::get_raw(self)
}
}
impl ConvertReturnValue<BinaryValue> for *mut _cef_binary_value_t {
fn wrap_result(self) -> BinaryValue {
BinaryValue(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BinaryValue> for *mut _cef_binary_value_t {
fn from(value: BinaryValue) -> Self {
let object = ImplBinaryValue::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_dictionary_value_t`] for more documentation.
#[derive(Clone)]
pub struct DictionaryValue(RefGuard<_cef_dictionary_value_t>);
pub trait ImplDictionaryValue: Clone + Sized + Rc {
#[doc = "See [`_cef_dictionary_value_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::is_owned`] for more documentation."]
fn is_owned(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut DictionaryValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::is_equal`] for more documentation."]
fn is_equal(&self, that: Option<&mut DictionaryValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::copy`] for more documentation."]
fn copy(&self, exclude_empty_children: ::std::os::raw::c_int) -> Option<DictionaryValue>;
#[doc = "See [`_cef_dictionary_value_t::get_size`] for more documentation."]
fn size(&self) -> usize;
#[doc = "See [`_cef_dictionary_value_t::clear`] for more documentation."]
fn clear(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::has_key`] for more documentation."]
fn has_key(&self, key: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::get_keys`] for more documentation."]
fn keys(&self, keys: Option<&mut CefStringList>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::remove`] for more documentation."]
fn remove(&self, key: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::get_type`] for more documentation."]
fn get_type(&self, key: Option<&CefString>) -> ValueType;
#[doc = "See [`_cef_dictionary_value_t::get_value`] for more documentation."]
fn value(&self, key: Option<&CefString>) -> Option<Value>;
#[doc = "See [`_cef_dictionary_value_t::get_bool`] for more documentation."]
fn bool(&self, key: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::get_int`] for more documentation."]
fn int(&self, key: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::get_double`] for more documentation."]
fn double(&self, key: Option<&CefString>) -> f64;
#[doc = "See [`_cef_dictionary_value_t::get_string`] for more documentation."]
fn string(&self, key: Option<&CefString>) -> CefStringUserfree;
#[doc = "See [`_cef_dictionary_value_t::get_binary`] for more documentation."]
fn binary(&self, key: Option<&CefString>) -> Option<BinaryValue>;
#[doc = "See [`_cef_dictionary_value_t::get_dictionary`] for more documentation."]
fn dictionary(&self, key: Option<&CefString>) -> Option<DictionaryValue>;
#[doc = "See [`_cef_dictionary_value_t::get_list`] for more documentation."]
fn list(&self, key: Option<&CefString>) -> Option<ListValue>;
#[doc = "See [`_cef_dictionary_value_t::set_value`] for more documentation."]
fn set_value(
&self,
key: Option<&CefString>,
value: Option<&mut Value>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_null`] for more documentation."]
fn set_null(&self, key: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_bool`] for more documentation."]
fn set_bool(
&self,
key: Option<&CefString>,
value: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_int`] for more documentation."]
fn set_int(
&self,
key: Option<&CefString>,
value: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_double`] for more documentation."]
fn set_double(&self, key: Option<&CefString>, value: f64) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_string`] for more documentation."]
fn set_string(
&self,
key: Option<&CefString>,
value: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_binary`] for more documentation."]
fn set_binary(
&self,
key: Option<&CefString>,
value: Option<&mut BinaryValue>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_dictionary`] for more documentation."]
fn set_dictionary(
&self,
key: Option<&CefString>,
value: Option<&mut DictionaryValue>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_dictionary_value_t::set_list`] for more documentation."]
fn set_list(
&self,
key: Option<&CefString>,
value: Option<&mut ListValue>,
) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_dictionary_value_t;
}
impl ImplDictionaryValue for DictionaryValue {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_owned(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_owned
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut DictionaryValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_equal(&self, that: Option<&mut DictionaryValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_equal
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn copy(&self, exclude_empty_children: ::std::os::raw::c_int) -> Option<DictionaryValue> {
unsafe {
self.0
.copy
.map(|f| {
let arg_exclude_empty_children = exclude_empty_children;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_exclude_empty_children);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn size(&self) -> usize {
unsafe {
self.0
.get_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn clear(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.clear
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_key(&self, key: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_key
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn keys(&self, keys: Option<&mut CefStringList>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_keys
.map(|f| {
let arg_keys = keys;
let arg_self_ = self.into_raw();
let arg_keys = arg_keys
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_keys);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn remove(&self, key: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_type(&self, key: Option<&CefString>) -> ValueType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn value(&self, key: Option<&CefString>) -> Option<Value> {
unsafe {
self.0
.get_value
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn bool(&self, key: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_bool
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn int(&self, key: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_int
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn double(&self, key: Option<&CefString>) -> f64 {
unsafe {
self.0
.get_double
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn string(&self, key: Option<&CefString>) -> CefStringUserfree {
unsafe {
self.0
.get_string
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn binary(&self, key: Option<&CefString>) -> Option<BinaryValue> {
unsafe {
self.0
.get_binary
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn dictionary(&self, key: Option<&CefString>) -> Option<DictionaryValue> {
unsafe {
self.0
.get_dictionary
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn list(&self, key: Option<&CefString>) -> Option<ListValue> {
unsafe {
self.0
.get_list
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_value(
&self,
key: Option<&CefString>,
value: Option<&mut Value>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_value
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_null(&self, key: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_null
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_bool(
&self,
key: Option<&CefString>,
value: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_bool
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_int(
&self,
key: Option<&CefString>,
value: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_int
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_double(&self, key: Option<&CefString>, value: f64) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_double
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_string(
&self,
key: Option<&CefString>,
value: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_string
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_binary(
&self,
key: Option<&CefString>,
value: Option<&mut BinaryValue>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_binary
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplBinaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_dictionary(
&self,
key: Option<&CefString>,
value: Option<&mut DictionaryValue>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_dictionary
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_list(
&self,
key: Option<&CefString>,
value: Option<&mut ListValue>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_list
.map(|f| {
let (arg_key, arg_value) = (key, value);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplListValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_key, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_dictionary_value_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_dictionary_value_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DictionaryValue {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_dictionary_value_t> for &DictionaryValue {
fn into_raw(self) -> *mut _cef_dictionary_value_t {
ImplDictionaryValue::get_raw(self)
}
}
impl ConvertParam<*mut _cef_dictionary_value_t> for &mut DictionaryValue {
fn into_raw(self) -> *mut _cef_dictionary_value_t {
ImplDictionaryValue::get_raw(self)
}
}
impl ConvertReturnValue<DictionaryValue> for *mut _cef_dictionary_value_t {
fn wrap_result(self) -> DictionaryValue {
DictionaryValue(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DictionaryValue> for *mut _cef_dictionary_value_t {
fn from(value: DictionaryValue) -> Self {
let object = ImplDictionaryValue::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_list_value_t`] for more documentation.
#[derive(Clone)]
pub struct ListValue(RefGuard<_cef_list_value_t>);
pub trait ImplListValue: Clone + Sized + Rc {
#[doc = "See [`_cef_list_value_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::is_owned`] for more documentation."]
fn is_owned(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut ListValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::is_equal`] for more documentation."]
fn is_equal(&self, that: Option<&mut ListValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::copy`] for more documentation."]
fn copy(&self) -> Option<ListValue>;
#[doc = "See [`_cef_list_value_t::set_size`] for more documentation."]
fn set_size(&self, size: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::get_size`] for more documentation."]
fn size(&self) -> usize;
#[doc = "See [`_cef_list_value_t::clear`] for more documentation."]
fn clear(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::remove`] for more documentation."]
fn remove(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::get_type`] for more documentation."]
fn get_type(&self, index: usize) -> ValueType;
#[doc = "See [`_cef_list_value_t::get_value`] for more documentation."]
fn value(&self, index: usize) -> Option<Value>;
#[doc = "See [`_cef_list_value_t::get_bool`] for more documentation."]
fn bool(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::get_int`] for more documentation."]
fn int(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::get_double`] for more documentation."]
fn double(&self, index: usize) -> f64;
#[doc = "See [`_cef_list_value_t::get_string`] for more documentation."]
fn string(&self, index: usize) -> CefStringUserfree;
#[doc = "See [`_cef_list_value_t::get_binary`] for more documentation."]
fn binary(&self, index: usize) -> Option<BinaryValue>;
#[doc = "See [`_cef_list_value_t::get_dictionary`] for more documentation."]
fn dictionary(&self, index: usize) -> Option<DictionaryValue>;
#[doc = "See [`_cef_list_value_t::get_list`] for more documentation."]
fn list(&self, index: usize) -> Option<ListValue>;
#[doc = "See [`_cef_list_value_t::set_value`] for more documentation."]
fn set_value(&self, index: usize, value: Option<&mut Value>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_null`] for more documentation."]
fn set_null(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_bool`] for more documentation."]
fn set_bool(&self, index: usize, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_int`] for more documentation."]
fn set_int(&self, index: usize, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_double`] for more documentation."]
fn set_double(&self, index: usize, value: f64) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_string`] for more documentation."]
fn set_string(&self, index: usize, value: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_binary`] for more documentation."]
fn set_binary(&self, index: usize, value: Option<&mut BinaryValue>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_dictionary`] for more documentation."]
fn set_dictionary(
&self,
index: usize,
value: Option<&mut DictionaryValue>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_list_value_t::set_list`] for more documentation."]
fn set_list(&self, index: usize, value: Option<&mut ListValue>) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_list_value_t;
}
impl ImplListValue for ListValue {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_owned(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_owned
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut ListValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplListValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_equal(&self, that: Option<&mut ListValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_equal
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplListValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn copy(&self) -> Option<ListValue> {
unsafe {
self.0
.copy
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_size(&self, size: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_size
.map(|f| {
let arg_size = size;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_size);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn size(&self) -> usize {
unsafe {
self.0
.get_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn clear(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.clear
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn remove(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_type(&self, index: usize) -> ValueType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn value(&self, index: usize) -> Option<Value> {
unsafe {
self.0
.get_value
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn bool(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_bool
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn int(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_int
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn double(&self, index: usize) -> f64 {
unsafe {
self.0
.get_double
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn string(&self, index: usize) -> CefStringUserfree {
unsafe {
self.0
.get_string
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn binary(&self, index: usize) -> Option<BinaryValue> {
unsafe {
self.0
.get_binary
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn dictionary(&self, index: usize) -> Option<DictionaryValue> {
unsafe {
self.0
.get_dictionary
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn list(&self, index: usize) -> Option<ListValue> {
unsafe {
self.0
.get_list
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_value(&self, index: usize, value: Option<&mut Value>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_value
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_null(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_null
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_bool(&self, index: usize, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_bool
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_int(&self, index: usize, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_int
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_double(&self, index: usize, value: f64) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_double
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_string(&self, index: usize, value: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_string
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_binary(&self, index: usize, value: Option<&mut BinaryValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_binary
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplBinaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_dictionary(
&self,
index: usize,
value: Option<&mut DictionaryValue>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_dictionary
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_list(&self, index: usize, value: Option<&mut ListValue>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_list
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplListValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_list_value_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_list_value_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ListValue {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_list_value_t> for &ListValue {
fn into_raw(self) -> *mut _cef_list_value_t {
ImplListValue::get_raw(self)
}
}
impl ConvertParam<*mut _cef_list_value_t> for &mut ListValue {
fn into_raw(self) -> *mut _cef_list_value_t {
ImplListValue::get_raw(self)
}
}
impl ConvertReturnValue<ListValue> for *mut _cef_list_value_t {
fn wrap_result(self) -> ListValue {
ListValue(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ListValue> for *mut _cef_list_value_t {
fn from(value: ListValue) -> Self {
let object = ImplListValue::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_accessibility_handler_t`] for more documentation.
#[derive(Clone)]
pub struct AccessibilityHandler(RefGuard<_cef_accessibility_handler_t>);
impl AccessibilityHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapAccessibilityHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplAccessibilityHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapAccessibilityHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_accessibility_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapAccessibilityHandler: ImplAccessibilityHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_accessibility_handler_t, Self>);
}
pub trait ImplAccessibilityHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_accessibility_handler_t::on_accessibility_tree_change`] for more documentation."]
fn on_accessibility_tree_change(&self, value: Option<&mut Value>) {}
#[doc = "See [`_cef_accessibility_handler_t::on_accessibility_location_change`] for more documentation."]
fn on_accessibility_location_change(&self, value: Option<&mut Value>) {}
fn init_methods(object: &mut _cef_accessibility_handler_t) {
impl_cef_accessibility_handler_t::init_methods::<Self, _cef_accessibility_handler_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_accessibility_handler_t;
}
#[doc = "Implement the [`WrapAccessibilityHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl AccessibilityHandler` block you can override default\nmethods implemented by the [`ImplAccessibilityHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_accessibility_handler! {\n struct MyAccessibilityHandler {\n payload: String,\n }\n\n impl AccessibilityHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> AccessibilityHandler {\n MyAccessibilityHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_accessibility_handler { ($ vis : vis struct $ name : ident ; impl AccessibilityHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_accessibility_handler ! { $ vis struct $ name { } impl AccessibilityHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl AccessibilityHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_accessibility_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> AccessibilityHandler { AccessibilityHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapAccessibilityHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_accessibility_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplAccessibilityHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_accessibility_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_accessibility_handler_t {
use super::*;
pub fn init_methods<I: ImplAccessibilityHandler, R: Rc>(
object: &mut _cef_accessibility_handler_t,
) {
object.on_accessibility_tree_change = Some(on_accessibility_tree_change::<I, R>);
object.on_accessibility_location_change = Some(on_accessibility_location_change::<I, R>);
}
extern "C" fn on_accessibility_tree_change<I: ImplAccessibilityHandler, R: Rc>(
self_: *mut _cef_accessibility_handler_t,
value: *mut _cef_value_t,
) {
let (arg_self_, arg_value) = (self_, value);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_value =
unsafe { arg_value.as_mut() }.map(|arg| Value(unsafe { RefGuard::from_raw(arg) }));
let arg_value = arg_value.as_mut();
ImplAccessibilityHandler::on_accessibility_tree_change(&arg_self_.interface, arg_value)
}
extern "C" fn on_accessibility_location_change<I: ImplAccessibilityHandler, R: Rc>(
self_: *mut _cef_accessibility_handler_t,
value: *mut _cef_value_t,
) {
let (arg_self_, arg_value) = (self_, value);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_value =
unsafe { arg_value.as_mut() }.map(|arg| Value(unsafe { RefGuard::from_raw(arg) }));
let arg_value = arg_value.as_mut();
ImplAccessibilityHandler::on_accessibility_location_change(&arg_self_.interface, arg_value)
}
}
impl ImplAccessibilityHandler for AccessibilityHandler {
fn on_accessibility_tree_change(&self, value: Option<&mut Value>) {
unsafe {
if let Some(f) = self.0.on_accessibility_tree_change {
let arg_value = value;
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_value);
}
}
}
fn on_accessibility_location_change(&self, value: Option<&mut Value>) {
unsafe {
if let Some(f) = self.0.on_accessibility_location_change {
let arg_value = value;
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_value);
}
}
}
fn get_raw(&self) -> *mut _cef_accessibility_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_accessibility_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for AccessibilityHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_accessibility_handler_t> for &AccessibilityHandler {
fn into_raw(self) -> *mut _cef_accessibility_handler_t {
ImplAccessibilityHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_accessibility_handler_t> for &mut AccessibilityHandler {
fn into_raw(self) -> *mut _cef_accessibility_handler_t {
ImplAccessibilityHandler::get_raw(self)
}
}
impl ConvertReturnValue<AccessibilityHandler> for *mut _cef_accessibility_handler_t {
fn wrap_result(self) -> AccessibilityHandler {
AccessibilityHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<AccessibilityHandler> for *mut _cef_accessibility_handler_t {
fn from(value: AccessibilityHandler) -> Self {
let object = ImplAccessibilityHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_dev_tools_message_observer_t`] for more documentation.
#[derive(Clone)]
pub struct DevToolsMessageObserver(RefGuard<_cef_dev_tools_message_observer_t>);
impl DevToolsMessageObserver {
pub fn new<T>(interface: T) -> Self
where
T: WrapDevToolsMessageObserver,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDevToolsMessageObserver>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDevToolsMessageObserver>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_dev_tools_message_observer_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDevToolsMessageObserver: ImplDevToolsMessageObserver {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_dev_tools_message_observer_t, Self>);
}
pub trait ImplDevToolsMessageObserver: Clone + Sized + Rc {
#[doc = "See [`_cef_dev_tools_message_observer_t::on_dev_tools_message`] for more documentation."]
fn on_dev_tools_message(
&self,
browser: Option<&mut Browser>,
message: Option<&[u8]>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_dev_tools_message_observer_t::on_dev_tools_method_result`] for more documentation."]
fn on_dev_tools_method_result(
&self,
browser: Option<&mut Browser>,
message_id: ::std::os::raw::c_int,
success: ::std::os::raw::c_int,
result: Option<&[u8]>,
) {
}
#[doc = "See [`_cef_dev_tools_message_observer_t::on_dev_tools_event`] for more documentation."]
fn on_dev_tools_event(
&self,
browser: Option<&mut Browser>,
method: Option<&CefString>,
params: Option<&[u8]>,
) {
}
#[doc = "See [`_cef_dev_tools_message_observer_t::on_dev_tools_agent_attached`] for more documentation."]
fn on_dev_tools_agent_attached(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_dev_tools_message_observer_t::on_dev_tools_agent_detached`] for more documentation."]
fn on_dev_tools_agent_detached(&self, browser: Option<&mut Browser>) {}
fn init_methods(object: &mut _cef_dev_tools_message_observer_t) {
impl_cef_dev_tools_message_observer_t::init_methods::<
Self,
_cef_dev_tools_message_observer_t,
>(object);
}
fn get_raw(&self) -> *mut _cef_dev_tools_message_observer_t;
}
#[doc = "Implement the [`WrapDevToolsMessageObserver`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl DevToolsMessageObserver` block you can override default\nmethods implemented by the [`ImplDevToolsMessageObserver`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_dev_tools_message_observer! {\n struct MyDevToolsMessageObserver {\n payload: String,\n }\n\n impl DevToolsMessageObserver {\n // ...\n }\n}\n\nfn make_my_struct() -> DevToolsMessageObserver {\n MyDevToolsMessageObserver::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_dev_tools_message_observer { ($ vis : vis struct $ name : ident ; impl DevToolsMessageObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_dev_tools_message_observer ! { $ vis struct $ name { } impl DevToolsMessageObserver { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl DevToolsMessageObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_dev_tools_message_observer_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> DevToolsMessageObserver { DevToolsMessageObserver :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDevToolsMessageObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_dev_tools_message_observer_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDevToolsMessageObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_dev_tools_message_observer_t { self . cef_object . cast () } } } ; }
mod impl_cef_dev_tools_message_observer_t {
use super::*;
pub fn init_methods<I: ImplDevToolsMessageObserver, R: Rc>(
object: &mut _cef_dev_tools_message_observer_t,
) {
object.on_dev_tools_message = Some(on_dev_tools_message::<I, R>);
object.on_dev_tools_method_result = Some(on_dev_tools_method_result::<I, R>);
object.on_dev_tools_event = Some(on_dev_tools_event::<I, R>);
object.on_dev_tools_agent_attached = Some(on_dev_tools_agent_attached::<I, R>);
object.on_dev_tools_agent_detached = Some(on_dev_tools_agent_detached::<I, R>);
}
extern "C" fn on_dev_tools_message<I: ImplDevToolsMessageObserver, R: Rc>(
self_: *mut _cef_dev_tools_message_observer_t,
browser: *mut _cef_browser_t,
message: *const ::std::os::raw::c_void,
message_size: usize,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_message, arg_message_size) =
(self_, browser, message, message_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_message = (!arg_message.is_null() && arg_message_size > 0)
.then(|| unsafe { std::slice::from_raw_parts(arg_message.cast(), arg_message_size) });
ImplDevToolsMessageObserver::on_dev_tools_message(
&arg_self_.interface,
arg_browser,
arg_message,
)
}
extern "C" fn on_dev_tools_method_result<I: ImplDevToolsMessageObserver, R: Rc>(
self_: *mut _cef_dev_tools_message_observer_t,
browser: *mut _cef_browser_t,
message_id: ::std::os::raw::c_int,
success: ::std::os::raw::c_int,
result: *const ::std::os::raw::c_void,
result_size: usize,
) {
let (arg_self_, arg_browser, arg_message_id, arg_success, arg_result, arg_result_size) =
(self_, browser, message_id, success, result, result_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_message_id = arg_message_id.into_raw();
let arg_success = arg_success.into_raw();
let arg_result = (!arg_result.is_null() && arg_result_size > 0)
.then(|| unsafe { std::slice::from_raw_parts(arg_result.cast(), arg_result_size) });
ImplDevToolsMessageObserver::on_dev_tools_method_result(
&arg_self_.interface,
arg_browser,
arg_message_id,
arg_success,
arg_result,
)
}
extern "C" fn on_dev_tools_event<I: ImplDevToolsMessageObserver, R: Rc>(
self_: *mut _cef_dev_tools_message_observer_t,
browser: *mut _cef_browser_t,
method: *const cef_string_t,
params: *const ::std::os::raw::c_void,
params_size: usize,
) {
let (arg_self_, arg_browser, arg_method, arg_params, arg_params_size) =
(self_, browser, method, params, params_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_method = if arg_method.is_null() {
None
} else {
Some(arg_method.into())
};
let arg_method = arg_method.as_ref();
let arg_params = (!arg_params.is_null() && arg_params_size > 0)
.then(|| unsafe { std::slice::from_raw_parts(arg_params.cast(), arg_params_size) });
ImplDevToolsMessageObserver::on_dev_tools_event(
&arg_self_.interface,
arg_browser,
arg_method,
arg_params,
)
}
extern "C" fn on_dev_tools_agent_attached<I: ImplDevToolsMessageObserver, R: Rc>(
self_: *mut _cef_dev_tools_message_observer_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplDevToolsMessageObserver::on_dev_tools_agent_attached(&arg_self_.interface, arg_browser)
}
extern "C" fn on_dev_tools_agent_detached<I: ImplDevToolsMessageObserver, R: Rc>(
self_: *mut _cef_dev_tools_message_observer_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplDevToolsMessageObserver::on_dev_tools_agent_detached(&arg_self_.interface, arg_browser)
}
}
impl ImplDevToolsMessageObserver for DevToolsMessageObserver {
fn on_dev_tools_message(
&self,
browser: Option<&mut Browser>,
message: Option<&[u8]>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_dev_tools_message
.map(|f| {
let (arg_browser, arg_message) = (browser, message);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_message_size = arg_message
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_message = arg_message
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_browser, arg_message, arg_message_size);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_dev_tools_method_result(
&self,
browser: Option<&mut Browser>,
message_id: ::std::os::raw::c_int,
success: ::std::os::raw::c_int,
result: Option<&[u8]>,
) {
unsafe {
if let Some(f) = self.0.on_dev_tools_method_result {
let (arg_browser, arg_message_id, arg_success, arg_result) =
(browser, message_id, success, result);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_result_size = arg_result.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_result = arg_result
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_browser,
arg_message_id,
arg_success,
arg_result,
arg_result_size,
);
}
}
}
fn on_dev_tools_event(
&self,
browser: Option<&mut Browser>,
method: Option<&CefString>,
params: Option<&[u8]>,
) {
unsafe {
if let Some(f) = self.0.on_dev_tools_event {
let (arg_browser, arg_method, arg_params) = (browser, method, params);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_method = arg_method
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_params_size = arg_params.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_params = arg_params
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_browser,
arg_method,
arg_params,
arg_params_size,
);
}
}
}
fn on_dev_tools_agent_attached(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_dev_tools_agent_attached {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn on_dev_tools_agent_detached(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_dev_tools_agent_detached {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn get_raw(&self) -> *mut _cef_dev_tools_message_observer_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_dev_tools_message_observer_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DevToolsMessageObserver {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_dev_tools_message_observer_t> for &DevToolsMessageObserver {
fn into_raw(self) -> *mut _cef_dev_tools_message_observer_t {
ImplDevToolsMessageObserver::get_raw(self)
}
}
impl ConvertParam<*mut _cef_dev_tools_message_observer_t> for &mut DevToolsMessageObserver {
fn into_raw(self) -> *mut _cef_dev_tools_message_observer_t {
ImplDevToolsMessageObserver::get_raw(self)
}
}
impl ConvertReturnValue<DevToolsMessageObserver> for *mut _cef_dev_tools_message_observer_t {
fn wrap_result(self) -> DevToolsMessageObserver {
DevToolsMessageObserver(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DevToolsMessageObserver> for *mut _cef_dev_tools_message_observer_t {
fn from(value: DevToolsMessageObserver) -> Self {
let object = ImplDevToolsMessageObserver::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_image_t`] for more documentation.
#[derive(Clone)]
pub struct Image(RefGuard<_cef_image_t>);
pub trait ImplImage: Clone + Sized + Rc {
#[doc = "See [`_cef_image_t::is_empty`] for more documentation."]
fn is_empty(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut Image>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::add_bitmap`] for more documentation."]
fn add_bitmap(
&self,
scale_factor: f32,
pixel_width: ::std::os::raw::c_int,
pixel_height: ::std::os::raw::c_int,
color_type: ColorType,
alpha_type: AlphaType,
pixel_data: Option<&[u8]>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::add_png`] for more documentation."]
fn add_png(&self, scale_factor: f32, png_data: Option<&[u8]>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::add_jpeg`] for more documentation."]
fn add_jpeg(&self, scale_factor: f32, jpeg_data: Option<&[u8]>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::get_width`] for more documentation."]
fn width(&self) -> usize;
#[doc = "See [`_cef_image_t::get_height`] for more documentation."]
fn height(&self) -> usize;
#[doc = "See [`_cef_image_t::has_representation`] for more documentation."]
fn has_representation(&self, scale_factor: f32) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::remove_representation`] for more documentation."]
fn remove_representation(&self, scale_factor: f32) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::get_representation_info`] for more documentation."]
fn representation_info(
&self,
scale_factor: f32,
actual_scale_factor: Option<&mut f32>,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_image_t::get_as_bitmap`] for more documentation."]
fn as_bitmap(
&self,
scale_factor: f32,
color_type: ColorType,
alpha_type: AlphaType,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> Option<BinaryValue>;
#[doc = "See [`_cef_image_t::get_as_png`] for more documentation."]
fn as_png(
&self,
scale_factor: f32,
with_transparency: ::std::os::raw::c_int,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> Option<BinaryValue>;
#[doc = "See [`_cef_image_t::get_as_jpeg`] for more documentation."]
fn as_jpeg(
&self,
scale_factor: f32,
quality: ::std::os::raw::c_int,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> Option<BinaryValue>;
fn get_raw(&self) -> *mut _cef_image_t;
}
impl ImplImage for Image {
fn is_empty(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_empty
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut Image>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplImage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_bitmap(
&self,
scale_factor: f32,
pixel_width: ::std::os::raw::c_int,
pixel_height: ::std::os::raw::c_int,
color_type: ColorType,
alpha_type: AlphaType,
pixel_data: Option<&[u8]>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_bitmap
.map(|f| {
let (
arg_scale_factor,
arg_pixel_width,
arg_pixel_height,
arg_color_type,
arg_alpha_type,
arg_pixel_data,
) = (
scale_factor,
pixel_width,
pixel_height,
color_type,
alpha_type,
pixel_data,
);
let arg_self_ = self.into_raw();
let arg_color_type = arg_color_type.into_raw();
let arg_alpha_type = arg_alpha_type.into_raw();
let arg_pixel_data_size = arg_pixel_data
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_pixel_data = arg_pixel_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let result = f(
arg_self_,
arg_scale_factor,
arg_pixel_width,
arg_pixel_height,
arg_color_type,
arg_alpha_type,
arg_pixel_data,
arg_pixel_data_size,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_png(&self, scale_factor: f32, png_data: Option<&[u8]>) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_png
.map(|f| {
let (arg_scale_factor, arg_png_data) = (scale_factor, png_data);
let arg_self_ = self.into_raw();
let arg_png_data_size = arg_png_data
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_png_data = arg_png_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_scale_factor, arg_png_data, arg_png_data_size);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_jpeg(&self, scale_factor: f32, jpeg_data: Option<&[u8]>) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_jpeg
.map(|f| {
let (arg_scale_factor, arg_jpeg_data) = (scale_factor, jpeg_data);
let arg_self_ = self.into_raw();
let arg_jpeg_data_size = arg_jpeg_data
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_jpeg_data = arg_jpeg_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let result = f(
arg_self_,
arg_scale_factor,
arg_jpeg_data,
arg_jpeg_data_size,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn width(&self) -> usize {
unsafe {
self.0
.get_width
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn height(&self) -> usize {
unsafe {
self.0
.get_height
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_representation(&self, scale_factor: f32) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_representation
.map(|f| {
let arg_scale_factor = scale_factor;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_scale_factor);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn remove_representation(&self, scale_factor: f32) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove_representation
.map(|f| {
let arg_scale_factor = scale_factor;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_scale_factor);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn representation_info(
&self,
scale_factor: f32,
actual_scale_factor: Option<&mut f32>,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_representation_info
.map(|f| {
let (
arg_scale_factor,
arg_actual_scale_factor,
arg_pixel_width,
arg_pixel_height,
) = (scale_factor, actual_scale_factor, pixel_width, pixel_height);
let arg_self_ = self.into_raw();
let arg_actual_scale_factor = arg_actual_scale_factor
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_pixel_width = arg_pixel_width
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_pixel_height = arg_pixel_height
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_scale_factor,
arg_actual_scale_factor,
arg_pixel_width,
arg_pixel_height,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn as_bitmap(
&self,
scale_factor: f32,
color_type: ColorType,
alpha_type: AlphaType,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> Option<BinaryValue> {
unsafe {
self.0
.get_as_bitmap
.map(|f| {
let (
arg_scale_factor,
arg_color_type,
arg_alpha_type,
arg_pixel_width,
arg_pixel_height,
) = (
scale_factor,
color_type,
alpha_type,
pixel_width,
pixel_height,
);
let arg_self_ = self.into_raw();
let arg_color_type = arg_color_type.into_raw();
let arg_alpha_type = arg_alpha_type.into_raw();
let arg_pixel_width = arg_pixel_width
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_pixel_height = arg_pixel_height
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_scale_factor,
arg_color_type,
arg_alpha_type,
arg_pixel_width,
arg_pixel_height,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn as_png(
&self,
scale_factor: f32,
with_transparency: ::std::os::raw::c_int,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> Option<BinaryValue> {
unsafe {
self.0
.get_as_png
.map(|f| {
let (
arg_scale_factor,
arg_with_transparency,
arg_pixel_width,
arg_pixel_height,
) = (scale_factor, with_transparency, pixel_width, pixel_height);
let arg_self_ = self.into_raw();
let arg_pixel_width = arg_pixel_width
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_pixel_height = arg_pixel_height
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_scale_factor,
arg_with_transparency,
arg_pixel_width,
arg_pixel_height,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn as_jpeg(
&self,
scale_factor: f32,
quality: ::std::os::raw::c_int,
pixel_width: Option<&mut ::std::os::raw::c_int>,
pixel_height: Option<&mut ::std::os::raw::c_int>,
) -> Option<BinaryValue> {
unsafe {
self.0
.get_as_jpeg
.map(|f| {
let (arg_scale_factor, arg_quality, arg_pixel_width, arg_pixel_height) =
(scale_factor, quality, pixel_width, pixel_height);
let arg_self_ = self.into_raw();
let arg_pixel_width = arg_pixel_width
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_pixel_height = arg_pixel_height
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_scale_factor,
arg_quality,
arg_pixel_width,
arg_pixel_height,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_image_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_image_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Image {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_image_t> for &Image {
fn into_raw(self) -> *mut _cef_image_t {
ImplImage::get_raw(self)
}
}
impl ConvertParam<*mut _cef_image_t> for &mut Image {
fn into_raw(self) -> *mut _cef_image_t {
ImplImage::get_raw(self)
}
}
impl ConvertReturnValue<Image> for *mut _cef_image_t {
fn wrap_result(self) -> Image {
Image(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Image> for *mut _cef_image_t {
fn from(value: Image) -> Self {
let object = ImplImage::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_read_handler_t`] for more documentation.
#[derive(Clone)]
pub struct ReadHandler(RefGuard<_cef_read_handler_t>);
impl ReadHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapReadHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplReadHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapReadHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_read_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapReadHandler: ImplReadHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_read_handler_t, Self>);
}
pub trait ImplReadHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_read_handler_t::read`] for more documentation."]
fn read(&self, ptr: *mut u8, size: usize, n: usize) -> usize {
Default::default()
}
#[doc = "See [`_cef_read_handler_t::seek`] for more documentation."]
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_read_handler_t::tell`] for more documentation."]
fn tell(&self) -> i64 {
Default::default()
}
#[doc = "See [`_cef_read_handler_t::eof`] for more documentation."]
fn eof(&self) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_read_handler_t::may_block`] for more documentation."]
fn may_block(&self) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_read_handler_t) {
impl_cef_read_handler_t::init_methods::<Self, _cef_read_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_read_handler_t;
}
#[doc = "Implement the [`WrapReadHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ReadHandler` block you can override default\nmethods implemented by the [`ImplReadHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_read_handler! {\n struct MyReadHandler {\n payload: String,\n }\n\n impl ReadHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> ReadHandler {\n MyReadHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_read_handler { ($ vis : vis struct $ name : ident ; impl ReadHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_read_handler ! { $ vis struct $ name { } impl ReadHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ReadHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_read_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ReadHandler { ReadHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapReadHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_read_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplReadHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_read_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_read_handler_t {
use super::*;
pub fn init_methods<I: ImplReadHandler, R: Rc>(object: &mut _cef_read_handler_t) {
object.read = Some(read::<I, R>);
object.seek = Some(seek::<I, R>);
object.tell = Some(tell::<I, R>);
object.eof = Some(eof::<I, R>);
object.may_block = Some(may_block::<I, R>);
}
extern "C" fn read<I: ImplReadHandler, R: Rc>(
self_: *mut _cef_read_handler_t,
ptr: *mut ::std::os::raw::c_void,
size: usize,
n: usize,
) -> usize {
let (arg_self_, arg_ptr, arg_size, arg_n) = (self_, ptr, size, n);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_ptr = arg_ptr.cast();
let arg_size = arg_size.into_raw();
let arg_n = arg_n.into_raw();
ImplReadHandler::read(&arg_self_.interface, arg_ptr, arg_size, arg_n)
}
extern "C" fn seek<I: ImplReadHandler, R: Rc>(
self_: *mut _cef_read_handler_t,
offset: i64,
whence: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_offset, arg_whence) = (self_, offset, whence);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_offset = arg_offset.into_raw();
let arg_whence = arg_whence.into_raw();
ImplReadHandler::seek(&arg_self_.interface, arg_offset, arg_whence)
}
extern "C" fn tell<I: ImplReadHandler, R: Rc>(self_: *mut _cef_read_handler_t) -> i64 {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplReadHandler::tell(&arg_self_.interface)
}
extern "C" fn eof<I: ImplReadHandler, R: Rc>(
self_: *mut _cef_read_handler_t,
) -> ::std::os::raw::c_int {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplReadHandler::eof(&arg_self_.interface)
}
extern "C" fn may_block<I: ImplReadHandler, R: Rc>(
self_: *mut _cef_read_handler_t,
) -> ::std::os::raw::c_int {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplReadHandler::may_block(&arg_self_.interface)
}
}
impl ImplReadHandler for ReadHandler {
fn read(&self, ptr: *mut u8, size: usize, n: usize) -> usize {
unsafe {
self.0
.read
.map(|f| {
let (arg_ptr, arg_size, arg_n) = (ptr, size, n);
let arg_self_ = self.into_raw();
let arg_ptr = arg_ptr.cast();
let result = f(arg_self_, arg_ptr, arg_size, arg_n);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.seek
.map(|f| {
let (arg_offset, arg_whence) = (offset, whence);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_offset, arg_whence);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn tell(&self) -> i64 {
unsafe {
self.0
.tell
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn eof(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.eof
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn may_block(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.may_block
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_read_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_read_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ReadHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_read_handler_t> for &ReadHandler {
fn into_raw(self) -> *mut _cef_read_handler_t {
ImplReadHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_read_handler_t> for &mut ReadHandler {
fn into_raw(self) -> *mut _cef_read_handler_t {
ImplReadHandler::get_raw(self)
}
}
impl ConvertReturnValue<ReadHandler> for *mut _cef_read_handler_t {
fn wrap_result(self) -> ReadHandler {
ReadHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ReadHandler> for *mut _cef_read_handler_t {
fn from(value: ReadHandler) -> Self {
let object = ImplReadHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_stream_reader_t`] for more documentation.
#[derive(Clone)]
pub struct StreamReader(RefGuard<_cef_stream_reader_t>);
pub trait ImplStreamReader: Clone + Sized + Rc {
#[doc = "See [`_cef_stream_reader_t::read`] for more documentation."]
fn read(&self, ptr: *mut u8, size: usize, n: usize) -> usize;
#[doc = "See [`_cef_stream_reader_t::seek`] for more documentation."]
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_stream_reader_t::tell`] for more documentation."]
fn tell(&self) -> i64;
#[doc = "See [`_cef_stream_reader_t::eof`] for more documentation."]
fn eof(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_stream_reader_t::may_block`] for more documentation."]
fn may_block(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_stream_reader_t;
}
impl ImplStreamReader for StreamReader {
fn read(&self, ptr: *mut u8, size: usize, n: usize) -> usize {
unsafe {
self.0
.read
.map(|f| {
let (arg_ptr, arg_size, arg_n) = (ptr, size, n);
let arg_self_ = self.into_raw();
let arg_ptr = arg_ptr.cast();
let result = f(arg_self_, arg_ptr, arg_size, arg_n);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.seek
.map(|f| {
let (arg_offset, arg_whence) = (offset, whence);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_offset, arg_whence);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn tell(&self) -> i64 {
unsafe {
self.0
.tell
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn eof(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.eof
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn may_block(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.may_block
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_stream_reader_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_stream_reader_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for StreamReader {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_stream_reader_t> for &StreamReader {
fn into_raw(self) -> *mut _cef_stream_reader_t {
ImplStreamReader::get_raw(self)
}
}
impl ConvertParam<*mut _cef_stream_reader_t> for &mut StreamReader {
fn into_raw(self) -> *mut _cef_stream_reader_t {
ImplStreamReader::get_raw(self)
}
}
impl ConvertReturnValue<StreamReader> for *mut _cef_stream_reader_t {
fn wrap_result(self) -> StreamReader {
StreamReader(unsafe { RefGuard::from_raw(self) })
}
}
impl From<StreamReader> for *mut _cef_stream_reader_t {
fn from(value: StreamReader) -> Self {
let object = ImplStreamReader::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_write_handler_t`] for more documentation.
#[derive(Clone)]
pub struct WriteHandler(RefGuard<_cef_write_handler_t>);
impl WriteHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapWriteHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplWriteHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapWriteHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_write_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapWriteHandler: ImplWriteHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_write_handler_t, Self>);
}
pub trait ImplWriteHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_write_handler_t::write`] for more documentation."]
fn write(&self, ptr: *const u8, size: usize, n: usize) -> usize {
Default::default()
}
#[doc = "See [`_cef_write_handler_t::seek`] for more documentation."]
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_write_handler_t::tell`] for more documentation."]
fn tell(&self) -> i64 {
Default::default()
}
#[doc = "See [`_cef_write_handler_t::flush`] for more documentation."]
fn flush(&self) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_write_handler_t::may_block`] for more documentation."]
fn may_block(&self) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_write_handler_t) {
impl_cef_write_handler_t::init_methods::<Self, _cef_write_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_write_handler_t;
}
#[doc = "Implement the [`WrapWriteHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl WriteHandler` block you can override default\nmethods implemented by the [`ImplWriteHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_write_handler! {\n struct MyWriteHandler {\n payload: String,\n }\n\n impl WriteHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> WriteHandler {\n MyWriteHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_write_handler { ($ vis : vis struct $ name : ident ; impl WriteHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_write_handler ! { $ vis struct $ name { } impl WriteHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl WriteHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_write_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> WriteHandler { WriteHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapWriteHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_write_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplWriteHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_write_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_write_handler_t {
use super::*;
pub fn init_methods<I: ImplWriteHandler, R: Rc>(object: &mut _cef_write_handler_t) {
object.write = Some(write::<I, R>);
object.seek = Some(seek::<I, R>);
object.tell = Some(tell::<I, R>);
object.flush = Some(flush::<I, R>);
object.may_block = Some(may_block::<I, R>);
}
extern "C" fn write<I: ImplWriteHandler, R: Rc>(
self_: *mut _cef_write_handler_t,
ptr: *const ::std::os::raw::c_void,
size: usize,
n: usize,
) -> usize {
let (arg_self_, arg_ptr, arg_size, arg_n) = (self_, ptr, size, n);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_ptr = arg_ptr.cast();
let arg_size = arg_size.into_raw();
let arg_n = arg_n.into_raw();
ImplWriteHandler::write(&arg_self_.interface, arg_ptr, arg_size, arg_n)
}
extern "C" fn seek<I: ImplWriteHandler, R: Rc>(
self_: *mut _cef_write_handler_t,
offset: i64,
whence: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_offset, arg_whence) = (self_, offset, whence);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_offset = arg_offset.into_raw();
let arg_whence = arg_whence.into_raw();
ImplWriteHandler::seek(&arg_self_.interface, arg_offset, arg_whence)
}
extern "C" fn tell<I: ImplWriteHandler, R: Rc>(self_: *mut _cef_write_handler_t) -> i64 {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplWriteHandler::tell(&arg_self_.interface)
}
extern "C" fn flush<I: ImplWriteHandler, R: Rc>(
self_: *mut _cef_write_handler_t,
) -> ::std::os::raw::c_int {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplWriteHandler::flush(&arg_self_.interface)
}
extern "C" fn may_block<I: ImplWriteHandler, R: Rc>(
self_: *mut _cef_write_handler_t,
) -> ::std::os::raw::c_int {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplWriteHandler::may_block(&arg_self_.interface)
}
}
impl ImplWriteHandler for WriteHandler {
fn write(&self, ptr: *const u8, size: usize, n: usize) -> usize {
unsafe {
self.0
.write
.map(|f| {
let (arg_ptr, arg_size, arg_n) = (ptr, size, n);
let arg_self_ = self.into_raw();
let arg_ptr = arg_ptr.cast();
let result = f(arg_self_, arg_ptr, arg_size, arg_n);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.seek
.map(|f| {
let (arg_offset, arg_whence) = (offset, whence);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_offset, arg_whence);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn tell(&self) -> i64 {
unsafe {
self.0
.tell
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn flush(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.flush
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn may_block(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.may_block
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_write_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_write_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for WriteHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_write_handler_t> for &WriteHandler {
fn into_raw(self) -> *mut _cef_write_handler_t {
ImplWriteHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_write_handler_t> for &mut WriteHandler {
fn into_raw(self) -> *mut _cef_write_handler_t {
ImplWriteHandler::get_raw(self)
}
}
impl ConvertReturnValue<WriteHandler> for *mut _cef_write_handler_t {
fn wrap_result(self) -> WriteHandler {
WriteHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<WriteHandler> for *mut _cef_write_handler_t {
fn from(value: WriteHandler) -> Self {
let object = ImplWriteHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_stream_writer_t`] for more documentation.
#[derive(Clone)]
pub struct StreamWriter(RefGuard<_cef_stream_writer_t>);
pub trait ImplStreamWriter: Clone + Sized + Rc {
#[doc = "See [`_cef_stream_writer_t::write`] for more documentation."]
fn write(&self, ptr: *const u8, size: usize, n: usize) -> usize;
#[doc = "See [`_cef_stream_writer_t::seek`] for more documentation."]
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_stream_writer_t::tell`] for more documentation."]
fn tell(&self) -> i64;
#[doc = "See [`_cef_stream_writer_t::flush`] for more documentation."]
fn flush(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_stream_writer_t::may_block`] for more documentation."]
fn may_block(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_stream_writer_t;
}
impl ImplStreamWriter for StreamWriter {
fn write(&self, ptr: *const u8, size: usize, n: usize) -> usize {
unsafe {
self.0
.write
.map(|f| {
let (arg_ptr, arg_size, arg_n) = (ptr, size, n);
let arg_self_ = self.into_raw();
let arg_ptr = arg_ptr.cast();
let result = f(arg_self_, arg_ptr, arg_size, arg_n);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn seek(&self, offset: i64, whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.seek
.map(|f| {
let (arg_offset, arg_whence) = (offset, whence);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_offset, arg_whence);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn tell(&self) -> i64 {
unsafe {
self.0
.tell
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn flush(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.flush
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn may_block(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.may_block
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_stream_writer_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_stream_writer_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for StreamWriter {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_stream_writer_t> for &StreamWriter {
fn into_raw(self) -> *mut _cef_stream_writer_t {
ImplStreamWriter::get_raw(self)
}
}
impl ConvertParam<*mut _cef_stream_writer_t> for &mut StreamWriter {
fn into_raw(self) -> *mut _cef_stream_writer_t {
ImplStreamWriter::get_raw(self)
}
}
impl ConvertReturnValue<StreamWriter> for *mut _cef_stream_writer_t {
fn wrap_result(self) -> StreamWriter {
StreamWriter(unsafe { RefGuard::from_raw(self) })
}
}
impl From<StreamWriter> for *mut _cef_stream_writer_t {
fn from(value: StreamWriter) -> Self {
let object = ImplStreamWriter::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_drag_data_t`] for more documentation.
#[derive(Clone)]
pub struct DragData(RefGuard<_cef_drag_data_t>);
pub trait ImplDragData: Clone + Sized + Rc {
#[doc = "See [`_cef_drag_data_t::clone`] for more documentation."]
fn clone(&self) -> Option<DragData>;
#[doc = "See [`_cef_drag_data_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_drag_data_t::is_link`] for more documentation."]
fn is_link(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_drag_data_t::is_fragment`] for more documentation."]
fn is_fragment(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_drag_data_t::is_file`] for more documentation."]
fn is_file(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_drag_data_t::get_link_url`] for more documentation."]
fn link_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_drag_data_t::get_link_title`] for more documentation."]
fn link_title(&self) -> CefStringUserfree;
#[doc = "See [`_cef_drag_data_t::get_link_metadata`] for more documentation."]
fn link_metadata(&self) -> CefStringUserfree;
#[doc = "See [`_cef_drag_data_t::get_fragment_text`] for more documentation."]
fn fragment_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_drag_data_t::get_fragment_html`] for more documentation."]
fn fragment_html(&self) -> CefStringUserfree;
#[doc = "See [`_cef_drag_data_t::get_fragment_base_url`] for more documentation."]
fn fragment_base_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_drag_data_t::get_file_name`] for more documentation."]
fn file_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_drag_data_t::get_file_contents`] for more documentation."]
fn file_contents(&self, writer: Option<&mut StreamWriter>) -> usize;
#[doc = "See [`_cef_drag_data_t::get_file_names`] for more documentation."]
fn file_names(&self, names: Option<&mut CefStringList>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_drag_data_t::get_file_paths`] for more documentation."]
fn file_paths(&self, paths: Option<&mut CefStringList>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_drag_data_t::set_link_url`] for more documentation."]
fn set_link_url(&self, url: Option<&CefString>);
#[doc = "See [`_cef_drag_data_t::set_link_title`] for more documentation."]
fn set_link_title(&self, title: Option<&CefString>);
#[doc = "See [`_cef_drag_data_t::set_link_metadata`] for more documentation."]
fn set_link_metadata(&self, data: Option<&CefString>);
#[doc = "See [`_cef_drag_data_t::set_fragment_text`] for more documentation."]
fn set_fragment_text(&self, text: Option<&CefString>);
#[doc = "See [`_cef_drag_data_t::set_fragment_html`] for more documentation."]
fn set_fragment_html(&self, html: Option<&CefString>);
#[doc = "See [`_cef_drag_data_t::set_fragment_base_url`] for more documentation."]
fn set_fragment_base_url(&self, base_url: Option<&CefString>);
#[doc = "See [`_cef_drag_data_t::reset_file_contents`] for more documentation."]
fn reset_file_contents(&self);
#[doc = "See [`_cef_drag_data_t::add_file`] for more documentation."]
fn add_file(&self, path: Option<&CefString>, display_name: Option<&CefString>);
#[doc = "See [`_cef_drag_data_t::clear_filenames`] for more documentation."]
fn clear_filenames(&self);
#[doc = "See [`_cef_drag_data_t::get_image`] for more documentation."]
fn image(&self) -> Option<Image>;
#[doc = "See [`_cef_drag_data_t::get_image_hotspot`] for more documentation."]
fn image_hotspot(&self) -> Point;
#[doc = "See [`_cef_drag_data_t::has_image`] for more documentation."]
fn has_image(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_drag_data_t;
}
impl ImplDragData for DragData {
fn clone(&self) -> Option<DragData> {
unsafe {
self.0
.clone
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_link(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_link
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_fragment(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_fragment
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_file(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_file
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn link_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_link_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn link_title(&self) -> CefStringUserfree {
unsafe {
self.0
.get_link_title
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn link_metadata(&self) -> CefStringUserfree {
unsafe {
self.0
.get_link_metadata
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn fragment_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_fragment_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn fragment_html(&self) -> CefStringUserfree {
unsafe {
self.0
.get_fragment_html
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn fragment_base_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_fragment_base_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_file_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file_contents(&self, writer: Option<&mut StreamWriter>) -> usize {
unsafe {
self.0
.get_file_contents
.map(|f| {
let arg_writer = writer;
let arg_self_ = self.into_raw();
let arg_writer = arg_writer
.map(|arg| {
arg.add_ref();
ImplStreamWriter::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_writer);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file_names(&self, names: Option<&mut CefStringList>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_file_names
.map(|f| {
let arg_names = names;
let arg_self_ = self.into_raw();
let arg_names = arg_names
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_names);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file_paths(&self, paths: Option<&mut CefStringList>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_file_paths
.map(|f| {
let arg_paths = paths;
let arg_self_ = self.into_raw();
let arg_paths = arg_paths
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_paths);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_link_url(&self, url: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_link_url {
let arg_url = url;
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_url);
}
}
}
fn set_link_title(&self, title: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_link_title {
let arg_title = title;
let arg_self_ = self.into_raw();
let arg_title = arg_title
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_title);
}
}
}
fn set_link_metadata(&self, data: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_link_metadata {
let arg_data = data;
let arg_self_ = self.into_raw();
let arg_data = arg_data
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_data);
}
}
}
fn set_fragment_text(&self, text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_fragment_text {
let arg_text = text;
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_text);
}
}
}
fn set_fragment_html(&self, html: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_fragment_html {
let arg_html = html;
let arg_self_ = self.into_raw();
let arg_html = arg_html
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_html);
}
}
}
fn set_fragment_base_url(&self, base_url: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_fragment_base_url {
let arg_base_url = base_url;
let arg_self_ = self.into_raw();
let arg_base_url = arg_base_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_base_url);
}
}
}
fn reset_file_contents(&self) {
unsafe {
if let Some(f) = self.0.reset_file_contents {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn add_file(&self, path: Option<&CefString>, display_name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.add_file {
let (arg_path, arg_display_name) = (path, display_name);
let arg_self_ = self.into_raw();
let arg_path = arg_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_display_name = arg_display_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_path, arg_display_name);
}
}
}
fn clear_filenames(&self) {
unsafe {
if let Some(f) = self.0.clear_filenames {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn image(&self) -> Option<Image> {
unsafe {
self.0
.get_image
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn image_hotspot(&self) -> Point {
unsafe {
self.0
.get_image_hotspot
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_image(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_image
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_drag_data_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_drag_data_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DragData {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_drag_data_t> for &DragData {
fn into_raw(self) -> *mut _cef_drag_data_t {
ImplDragData::get_raw(self)
}
}
impl ConvertParam<*mut _cef_drag_data_t> for &mut DragData {
fn into_raw(self) -> *mut _cef_drag_data_t {
ImplDragData::get_raw(self)
}
}
impl ConvertReturnValue<DragData> for *mut _cef_drag_data_t {
fn wrap_result(self) -> DragData {
DragData(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DragData> for *mut _cef_drag_data_t {
fn from(value: DragData) -> Self {
let object = ImplDragData::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_domvisitor_t`] for more documentation.
#[derive(Clone)]
pub struct Domvisitor(RefGuard<_cef_domvisitor_t>);
impl Domvisitor {
pub fn new<T>(interface: T) -> Self
where
T: WrapDomvisitor,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDomvisitor>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDomvisitor>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_domvisitor_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDomvisitor: ImplDomvisitor {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_domvisitor_t, Self>);
}
pub trait ImplDomvisitor: Clone + Sized + Rc {
#[doc = "See [`_cef_domvisitor_t::visit`] for more documentation."]
fn visit(&self, document: Option<&mut Domdocument>) {}
fn init_methods(object: &mut _cef_domvisitor_t) {
impl_cef_domvisitor_t::init_methods::<Self, _cef_domvisitor_t>(object);
}
fn get_raw(&self) -> *mut _cef_domvisitor_t;
}
#[doc = "Implement the [`WrapDomvisitor`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl Domvisitor` block you can override default\nmethods implemented by the [`ImplDomvisitor`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_domvisitor! {\n struct MyDomvisitor {\n payload: String,\n }\n\n impl Domvisitor {\n // ...\n }\n}\n\nfn make_my_struct() -> Domvisitor {\n MyDomvisitor::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_domvisitor { ($ vis : vis struct $ name : ident ; impl Domvisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_domvisitor ! { $ vis struct $ name { } impl Domvisitor { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl Domvisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_domvisitor_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> Domvisitor { Domvisitor :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDomvisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_domvisitor_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDomvisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_domvisitor_t { self . cef_object . cast () } } } ; }
mod impl_cef_domvisitor_t {
use super::*;
pub fn init_methods<I: ImplDomvisitor, R: Rc>(object: &mut _cef_domvisitor_t) {
object.visit = Some(visit::<I, R>);
}
extern "C" fn visit<I: ImplDomvisitor, R: Rc>(
self_: *mut _cef_domvisitor_t,
document: *mut _cef_domdocument_t,
) {
let (arg_self_, arg_document) = (self_, document);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_document = unsafe { arg_document.as_mut() }
.map(|arg| Domdocument(unsafe { RefGuard::from_raw(arg) }));
let arg_document = arg_document.as_mut();
ImplDomvisitor::visit(&arg_self_.interface, arg_document)
}
}
impl ImplDomvisitor for Domvisitor {
fn visit(&self, document: Option<&mut Domdocument>) {
unsafe {
if let Some(f) = self.0.visit {
let arg_document = document;
let arg_self_ = self.into_raw();
let arg_document = arg_document
.map(|arg| {
arg.add_ref();
ImplDomdocument::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_document);
}
}
}
fn get_raw(&self) -> *mut _cef_domvisitor_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_domvisitor_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Domvisitor {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_domvisitor_t> for &Domvisitor {
fn into_raw(self) -> *mut _cef_domvisitor_t {
ImplDomvisitor::get_raw(self)
}
}
impl ConvertParam<*mut _cef_domvisitor_t> for &mut Domvisitor {
fn into_raw(self) -> *mut _cef_domvisitor_t {
ImplDomvisitor::get_raw(self)
}
}
impl ConvertReturnValue<Domvisitor> for *mut _cef_domvisitor_t {
fn wrap_result(self) -> Domvisitor {
Domvisitor(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Domvisitor> for *mut _cef_domvisitor_t {
fn from(value: Domvisitor) -> Self {
let object = ImplDomvisitor::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_domdocument_t`] for more documentation.
#[derive(Clone)]
pub struct Domdocument(RefGuard<_cef_domdocument_t>);
pub trait ImplDomdocument: Clone + Sized + Rc {
#[doc = "See [`_cef_domdocument_t::get_type`] for more documentation."]
fn get_type(&self) -> DomDocumentType;
#[doc = "See [`_cef_domdocument_t::get_document`] for more documentation."]
fn document(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domdocument_t::get_body`] for more documentation."]
fn body(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domdocument_t::get_head`] for more documentation."]
fn head(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domdocument_t::get_title`] for more documentation."]
fn title(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domdocument_t::get_element_by_id`] for more documentation."]
fn element_by_id(&self, id: Option<&CefString>) -> Option<Domnode>;
#[doc = "See [`_cef_domdocument_t::get_focused_node`] for more documentation."]
fn focused_node(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domdocument_t::has_selection`] for more documentation."]
fn has_selection(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domdocument_t::get_selection_start_offset`] for more documentation."]
fn selection_start_offset(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domdocument_t::get_selection_end_offset`] for more documentation."]
fn selection_end_offset(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domdocument_t::get_selection_as_markup`] for more documentation."]
fn selection_as_markup(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domdocument_t::get_selection_as_text`] for more documentation."]
fn selection_as_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domdocument_t::get_base_url`] for more documentation."]
fn base_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domdocument_t::get_complete_url`] for more documentation."]
fn complete_url(&self, partial_url: Option<&CefString>) -> CefStringUserfree;
fn get_raw(&self) -> *mut _cef_domdocument_t;
}
impl ImplDomdocument for Domdocument {
fn get_type(&self) -> DomDocumentType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn document(&self) -> Option<Domnode> {
unsafe {
self.0
.get_document
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn body(&self) -> Option<Domnode> {
unsafe {
self.0
.get_body
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn head(&self) -> Option<Domnode> {
unsafe {
self.0
.get_head
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn title(&self) -> CefStringUserfree {
unsafe {
self.0
.get_title
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn element_by_id(&self, id: Option<&CefString>) -> Option<Domnode> {
unsafe {
self.0
.get_element_by_id
.map(|f| {
let arg_id = id;
let arg_self_ = self.into_raw();
let arg_id = arg_id.map(|arg| arg.into_raw()).unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_id);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn focused_node(&self) -> Option<Domnode> {
unsafe {
self.0
.get_focused_node
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn has_selection(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_selection
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn selection_start_offset(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_selection_start_offset
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn selection_end_offset(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_selection_end_offset
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn selection_as_markup(&self) -> CefStringUserfree {
unsafe {
self.0
.get_selection_as_markup
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn selection_as_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_selection_as_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn base_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_base_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn complete_url(&self, partial_url: Option<&CefString>) -> CefStringUserfree {
unsafe {
self.0
.get_complete_url
.map(|f| {
let arg_partial_url = partial_url;
let arg_self_ = self.into_raw();
let arg_partial_url = arg_partial_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_partial_url);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_domdocument_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_domdocument_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Domdocument {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_domdocument_t> for &Domdocument {
fn into_raw(self) -> *mut _cef_domdocument_t {
ImplDomdocument::get_raw(self)
}
}
impl ConvertParam<*mut _cef_domdocument_t> for &mut Domdocument {
fn into_raw(self) -> *mut _cef_domdocument_t {
ImplDomdocument::get_raw(self)
}
}
impl ConvertReturnValue<Domdocument> for *mut _cef_domdocument_t {
fn wrap_result(self) -> Domdocument {
Domdocument(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Domdocument> for *mut _cef_domdocument_t {
fn from(value: Domdocument) -> Self {
let object = ImplDomdocument::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_domnode_t`] for more documentation.
#[derive(Clone)]
pub struct Domnode(RefGuard<_cef_domnode_t>);
pub trait ImplDomnode: Clone + Sized + Rc {
#[doc = "See [`_cef_domnode_t::get_type`] for more documentation."]
fn get_type(&self) -> DomNodeType;
#[doc = "See [`_cef_domnode_t::is_text`] for more documentation."]
fn is_text(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::is_element`] for more documentation."]
fn is_element(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::is_editable`] for more documentation."]
fn is_editable(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::is_form_control_element`] for more documentation."]
fn is_form_control_element(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::get_form_control_element_type`] for more documentation."]
fn form_control_element_type(&self) -> DomFormControlType;
#[doc = "See [`_cef_domnode_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut Domnode>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::get_name`] for more documentation."]
fn name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domnode_t::get_value`] for more documentation."]
fn value(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domnode_t::set_value`] for more documentation."]
fn set_value(&self, value: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::get_as_markup`] for more documentation."]
fn as_markup(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domnode_t::get_document`] for more documentation."]
fn document(&self) -> Option<Domdocument>;
#[doc = "See [`_cef_domnode_t::get_parent`] for more documentation."]
fn parent(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domnode_t::get_previous_sibling`] for more documentation."]
fn previous_sibling(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domnode_t::get_next_sibling`] for more documentation."]
fn next_sibling(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domnode_t::has_children`] for more documentation."]
fn has_children(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::get_first_child`] for more documentation."]
fn first_child(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domnode_t::get_last_child`] for more documentation."]
fn last_child(&self) -> Option<Domnode>;
#[doc = "See [`_cef_domnode_t::get_element_tag_name`] for more documentation."]
fn element_tag_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domnode_t::has_element_attributes`] for more documentation."]
fn has_element_attributes(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::has_element_attribute`] for more documentation."]
fn has_element_attribute(&self, attr_name: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::get_element_attribute`] for more documentation."]
fn element_attribute(&self, attr_name: Option<&CefString>) -> CefStringUserfree;
#[doc = "See [`_cef_domnode_t::get_element_attributes`] for more documentation."]
fn element_attributes(&self, attr_map: Option<&mut CefStringMap>);
#[doc = "See [`_cef_domnode_t::set_element_attribute`] for more documentation."]
fn set_element_attribute(
&self,
attr_name: Option<&CefString>,
value: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_domnode_t::get_element_inner_text`] for more documentation."]
fn element_inner_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_domnode_t::get_element_bounds`] for more documentation."]
fn element_bounds(&self) -> Rect;
fn get_raw(&self) -> *mut _cef_domnode_t;
}
impl ImplDomnode for Domnode {
fn get_type(&self) -> DomNodeType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_text(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_element(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_element
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_editable(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_editable
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_form_control_element(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_form_control_element
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn form_control_element_type(&self) -> DomFormControlType {
unsafe {
self.0
.get_form_control_element_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut Domnode>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplDomnode::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn value(&self) -> CefStringUserfree {
unsafe {
self.0
.get_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_value(&self, value: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_value
.map(|f| {
let arg_value = value;
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn as_markup(&self) -> CefStringUserfree {
unsafe {
self.0
.get_as_markup
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn document(&self) -> Option<Domdocument> {
unsafe {
self.0
.get_document
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn parent(&self) -> Option<Domnode> {
unsafe {
self.0
.get_parent
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn previous_sibling(&self) -> Option<Domnode> {
unsafe {
self.0
.get_previous_sibling
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn next_sibling(&self) -> Option<Domnode> {
unsafe {
self.0
.get_next_sibling
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn has_children(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_children
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn first_child(&self) -> Option<Domnode> {
unsafe {
self.0
.get_first_child
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn last_child(&self) -> Option<Domnode> {
unsafe {
self.0
.get_last_child
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn element_tag_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_element_tag_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_element_attributes(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_element_attributes
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_element_attribute(&self, attr_name: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_element_attribute
.map(|f| {
let arg_attr_name = attr_name;
let arg_self_ = self.into_raw();
let arg_attr_name = arg_attr_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_attr_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn element_attribute(&self, attr_name: Option<&CefString>) -> CefStringUserfree {
unsafe {
self.0
.get_element_attribute
.map(|f| {
let arg_attr_name = attr_name;
let arg_self_ = self.into_raw();
let arg_attr_name = arg_attr_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_attr_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn element_attributes(&self, attr_map: Option<&mut CefStringMap>) {
unsafe {
if let Some(f) = self.0.get_element_attributes {
let arg_attr_map = attr_map;
let arg_self_ = self.into_raw();
let arg_attr_map = arg_attr_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_attr_map);
}
}
}
fn set_element_attribute(
&self,
attr_name: Option<&CefString>,
value: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_element_attribute
.map(|f| {
let (arg_attr_name, arg_value) = (attr_name, value);
let arg_self_ = self.into_raw();
let arg_attr_name = arg_attr_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_attr_name, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn element_inner_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_element_inner_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn element_bounds(&self) -> Rect {
unsafe {
self.0
.get_element_bounds
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_domnode_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_domnode_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Domnode {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_domnode_t> for &Domnode {
fn into_raw(self) -> *mut _cef_domnode_t {
ImplDomnode::get_raw(self)
}
}
impl ConvertParam<*mut _cef_domnode_t> for &mut Domnode {
fn into_raw(self) -> *mut _cef_domnode_t {
ImplDomnode::get_raw(self)
}
}
impl ConvertReturnValue<Domnode> for *mut _cef_domnode_t {
fn wrap_result(self) -> Domnode {
Domnode(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Domnode> for *mut _cef_domnode_t {
fn from(value: Domnode) -> Self {
let object = ImplDomnode::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_shared_memory_region_t`] for more documentation.
#[derive(Clone)]
pub struct SharedMemoryRegion(RefGuard<_cef_shared_memory_region_t>);
pub trait ImplSharedMemoryRegion: Clone + Sized + Rc {
#[doc = "See [`_cef_shared_memory_region_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_shared_memory_region_t::size`] for more documentation."]
fn size(&self) -> usize;
#[doc = "See [`_cef_shared_memory_region_t::memory`] for more documentation."]
fn memory(&self) -> *mut ::std::os::raw::c_void;
fn get_raw(&self) -> *mut _cef_shared_memory_region_t;
}
impl ImplSharedMemoryRegion for SharedMemoryRegion {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn size(&self) -> usize {
unsafe {
self.0
.size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn memory(&self) -> *mut ::std::os::raw::c_void {
unsafe {
self.0
.memory
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_else(|| std::mem::zeroed())
}
}
fn get_raw(&self) -> *mut _cef_shared_memory_region_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_shared_memory_region_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for SharedMemoryRegion {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_shared_memory_region_t> for &SharedMemoryRegion {
fn into_raw(self) -> *mut _cef_shared_memory_region_t {
ImplSharedMemoryRegion::get_raw(self)
}
}
impl ConvertParam<*mut _cef_shared_memory_region_t> for &mut SharedMemoryRegion {
fn into_raw(self) -> *mut _cef_shared_memory_region_t {
ImplSharedMemoryRegion::get_raw(self)
}
}
impl ConvertReturnValue<SharedMemoryRegion> for *mut _cef_shared_memory_region_t {
fn wrap_result(self) -> SharedMemoryRegion {
SharedMemoryRegion(unsafe { RefGuard::from_raw(self) })
}
}
impl From<SharedMemoryRegion> for *mut _cef_shared_memory_region_t {
fn from(value: SharedMemoryRegion) -> Self {
let object = ImplSharedMemoryRegion::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_process_message_t`] for more documentation.
#[derive(Clone)]
pub struct ProcessMessage(RefGuard<_cef_process_message_t>);
pub trait ImplProcessMessage: Clone + Sized + Rc {
#[doc = "See [`_cef_process_message_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_process_message_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_process_message_t::copy`] for more documentation."]
fn copy(&self) -> Option<ProcessMessage>;
#[doc = "See [`_cef_process_message_t::get_name`] for more documentation."]
fn name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_process_message_t::get_argument_list`] for more documentation."]
fn argument_list(&self) -> Option<ListValue>;
#[doc = "See [`_cef_process_message_t::get_shared_memory_region`] for more documentation."]
fn shared_memory_region(&self) -> Option<SharedMemoryRegion>;
fn get_raw(&self) -> *mut _cef_process_message_t;
}
impl ImplProcessMessage for ProcessMessage {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn copy(&self) -> Option<ProcessMessage> {
unsafe {
self.0
.copy
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn argument_list(&self) -> Option<ListValue> {
unsafe {
self.0
.get_argument_list
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn shared_memory_region(&self) -> Option<SharedMemoryRegion> {
unsafe {
self.0
.get_shared_memory_region
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_process_message_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_process_message_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ProcessMessage {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_process_message_t> for &ProcessMessage {
fn into_raw(self) -> *mut _cef_process_message_t {
ImplProcessMessage::get_raw(self)
}
}
impl ConvertParam<*mut _cef_process_message_t> for &mut ProcessMessage {
fn into_raw(self) -> *mut _cef_process_message_t {
ImplProcessMessage::get_raw(self)
}
}
impl ConvertReturnValue<ProcessMessage> for *mut _cef_process_message_t {
fn wrap_result(self) -> ProcessMessage {
ProcessMessage(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ProcessMessage> for *mut _cef_process_message_t {
fn from(value: ProcessMessage) -> Self {
let object = ImplProcessMessage::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_request_t`] for more documentation.
#[derive(Clone)]
pub struct Request(RefGuard<_cef_request_t>);
pub trait ImplRequest: Clone + Sized + Rc {
#[doc = "See [`_cef_request_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_request_t::get_url`] for more documentation."]
fn url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_request_t::set_url`] for more documentation."]
fn set_url(&self, url: Option<&CefString>);
#[doc = "See [`_cef_request_t::get_method`] for more documentation."]
fn method(&self) -> CefStringUserfree;
#[doc = "See [`_cef_request_t::set_method`] for more documentation."]
fn set_method(&self, method: Option<&CefString>);
#[doc = "See [`_cef_request_t::set_referrer`] for more documentation."]
fn set_referrer(&self, referrer_url: Option<&CefString>, policy: ReferrerPolicy);
#[doc = "See [`_cef_request_t::get_referrer_url`] for more documentation."]
fn referrer_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_request_t::get_referrer_policy`] for more documentation."]
fn referrer_policy(&self) -> ReferrerPolicy;
#[doc = "See [`_cef_request_t::get_post_data`] for more documentation."]
fn post_data(&self) -> Option<PostData>;
#[doc = "See [`_cef_request_t::set_post_data`] for more documentation."]
fn set_post_data(&self, post_data: Option<&mut PostData>);
#[doc = "See [`_cef_request_t::get_header_map`] for more documentation."]
fn header_map(&self, header_map: Option<&mut CefStringMultimap>);
#[doc = "See [`_cef_request_t::set_header_map`] for more documentation."]
fn set_header_map(&self, header_map: Option<&mut CefStringMultimap>);
#[doc = "See [`_cef_request_t::get_header_by_name`] for more documentation."]
fn header_by_name(&self, name: Option<&CefString>) -> CefStringUserfree;
#[doc = "See [`_cef_request_t::set_header_by_name`] for more documentation."]
fn set_header_by_name(
&self,
name: Option<&CefString>,
value: Option<&CefString>,
overwrite: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_request_t::set`] for more documentation."]
fn set(
&self,
url: Option<&CefString>,
method: Option<&CefString>,
post_data: Option<&mut PostData>,
header_map: Option<&mut CefStringMultimap>,
);
#[doc = "See [`_cef_request_t::get_flags`] for more documentation."]
fn flags(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_request_t::set_flags`] for more documentation."]
fn set_flags(&self, flags: ::std::os::raw::c_int);
#[doc = "See [`_cef_request_t::get_first_party_for_cookies`] for more documentation."]
fn first_party_for_cookies(&self) -> CefStringUserfree;
#[doc = "See [`_cef_request_t::set_first_party_for_cookies`] for more documentation."]
fn set_first_party_for_cookies(&self, url: Option<&CefString>);
#[doc = "See [`_cef_request_t::get_resource_type`] for more documentation."]
fn resource_type(&self) -> ResourceType;
#[doc = "See [`_cef_request_t::get_transition_type`] for more documentation."]
fn transition_type(&self) -> TransitionType;
#[doc = "See [`_cef_request_t::get_identifier`] for more documentation."]
fn identifier(&self) -> u64;
fn get_raw(&self) -> *mut _cef_request_t;
}
impl ImplRequest for Request {
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_url(&self, url: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_url {
let arg_url = url;
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_url);
}
}
}
fn method(&self) -> CefStringUserfree {
unsafe {
self.0
.get_method
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_method(&self, method: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_method {
let arg_method = method;
let arg_self_ = self.into_raw();
let arg_method = arg_method
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_method);
}
}
}
fn set_referrer(&self, referrer_url: Option<&CefString>, policy: ReferrerPolicy) {
unsafe {
if let Some(f) = self.0.set_referrer {
let (arg_referrer_url, arg_policy) = (referrer_url, policy);
let arg_self_ = self.into_raw();
let arg_referrer_url = arg_referrer_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_policy = arg_policy.into_raw();
f(arg_self_, arg_referrer_url, arg_policy);
}
}
}
fn referrer_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_referrer_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn referrer_policy(&self) -> ReferrerPolicy {
unsafe {
self.0
.get_referrer_policy
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn post_data(&self) -> Option<PostData> {
unsafe {
self.0
.get_post_data
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_post_data(&self, post_data: Option<&mut PostData>) {
unsafe {
if let Some(f) = self.0.set_post_data {
let arg_post_data = post_data;
let arg_self_ = self.into_raw();
let arg_post_data = arg_post_data
.map(|arg| {
arg.add_ref();
ImplPostData::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_post_data);
}
}
}
fn header_map(&self, header_map: Option<&mut CefStringMultimap>) {
unsafe {
if let Some(f) = self.0.get_header_map {
let arg_header_map = header_map;
let arg_self_ = self.into_raw();
let arg_header_map = arg_header_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_header_map);
}
}
}
fn set_header_map(&self, header_map: Option<&mut CefStringMultimap>) {
unsafe {
if let Some(f) = self.0.set_header_map {
let arg_header_map = header_map;
let arg_self_ = self.into_raw();
let arg_header_map = arg_header_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_header_map);
}
}
}
fn header_by_name(&self, name: Option<&CefString>) -> CefStringUserfree {
unsafe {
self.0
.get_header_by_name
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_header_by_name(
&self,
name: Option<&CefString>,
value: Option<&CefString>,
overwrite: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.set_header_by_name {
let (arg_name, arg_value, arg_overwrite) = (name, value, overwrite);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name, arg_value, arg_overwrite);
}
}
}
fn set(
&self,
url: Option<&CefString>,
method: Option<&CefString>,
post_data: Option<&mut PostData>,
header_map: Option<&mut CefStringMultimap>,
) {
unsafe {
if let Some(f) = self.0.set {
let (arg_url, arg_method, arg_post_data, arg_header_map) =
(url, method, post_data, header_map);
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_method = arg_method
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_post_data = arg_post_data
.map(|arg| {
arg.add_ref();
ImplPostData::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_header_map = arg_header_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_url,
arg_method,
arg_post_data,
arg_header_map,
);
}
}
}
fn flags(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_flags
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_flags(&self, flags: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_flags {
let arg_flags = flags;
let arg_self_ = self.into_raw();
f(arg_self_, arg_flags);
}
}
}
fn first_party_for_cookies(&self) -> CefStringUserfree {
unsafe {
self.0
.get_first_party_for_cookies
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_first_party_for_cookies(&self, url: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_first_party_for_cookies {
let arg_url = url;
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_url);
}
}
}
fn resource_type(&self) -> ResourceType {
unsafe {
self.0
.get_resource_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn transition_type(&self) -> TransitionType {
unsafe {
self.0
.get_transition_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn identifier(&self) -> u64 {
unsafe {
self.0
.get_identifier
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_request_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_request_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Request {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_request_t> for &Request {
fn into_raw(self) -> *mut _cef_request_t {
ImplRequest::get_raw(self)
}
}
impl ConvertParam<*mut _cef_request_t> for &mut Request {
fn into_raw(self) -> *mut _cef_request_t {
ImplRequest::get_raw(self)
}
}
impl ConvertReturnValue<Request> for *mut _cef_request_t {
fn wrap_result(self) -> Request {
Request(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Request> for *mut _cef_request_t {
fn from(value: Request) -> Self {
let object = ImplRequest::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_post_data_t`] for more documentation.
#[derive(Clone)]
pub struct PostData(RefGuard<_cef_post_data_t>);
pub trait ImplPostData: Clone + Sized + Rc {
#[doc = "See [`_cef_post_data_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_post_data_t::has_excluded_elements`] for more documentation."]
fn has_excluded_elements(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_post_data_t::get_element_count`] for more documentation."]
fn element_count(&self) -> usize;
#[doc = "See [`_cef_post_data_t::get_elements`] for more documentation."]
fn elements(&self, elements: Option<&mut Vec<Option<PostDataElement>>>);
#[doc = "See [`_cef_post_data_t::remove_element`] for more documentation."]
fn remove_element(&self, element: Option<&mut PostDataElement>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_post_data_t::add_element`] for more documentation."]
fn add_element(&self, element: Option<&mut PostDataElement>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_post_data_t::remove_elements`] for more documentation."]
fn remove_elements(&self);
fn get_raw(&self) -> *mut _cef_post_data_t;
}
impl ImplPostData for PostData {
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_excluded_elements(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_excluded_elements
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn element_count(&self) -> usize {
unsafe {
self.0
.get_element_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn elements(&self, elements: Option<&mut Vec<Option<PostDataElement>>>) {
unsafe {
if let Some(f) = self.0.get_elements {
let arg_elements = elements;
let arg_self_ = self.into_raw();
let mut out_elements_count = arg_elements
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_elements_count = &mut out_elements_count;
let out_elements = arg_elements;
let mut vec_elements = out_elements
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_elements = if vec_elements.is_empty() {
std::ptr::null_mut()
} else {
vec_elements.as_mut_ptr()
};
f(arg_self_, arg_elements_count, arg_elements);
if let Some(out_elements) = out_elements {
*out_elements = vec_elements
.into_iter()
.take(out_elements_count)
.map(|elem| {
if elem.is_null() {
None
} else {
Some(elem.wrap_result())
}
})
.collect();
}
}
}
}
fn remove_element(&self, element: Option<&mut PostDataElement>) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove_element
.map(|f| {
let arg_element = element;
let arg_self_ = self.into_raw();
let arg_element = arg_element
.map(|arg| {
arg.add_ref();
ImplPostDataElement::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_element);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_element(&self, element: Option<&mut PostDataElement>) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_element
.map(|f| {
let arg_element = element;
let arg_self_ = self.into_raw();
let arg_element = arg_element
.map(|arg| {
arg.add_ref();
ImplPostDataElement::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_element);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn remove_elements(&self) {
unsafe {
if let Some(f) = self.0.remove_elements {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_post_data_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_post_data_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PostData {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_post_data_t> for &PostData {
fn into_raw(self) -> *mut _cef_post_data_t {
ImplPostData::get_raw(self)
}
}
impl ConvertParam<*mut _cef_post_data_t> for &mut PostData {
fn into_raw(self) -> *mut _cef_post_data_t {
ImplPostData::get_raw(self)
}
}
impl ConvertReturnValue<PostData> for *mut _cef_post_data_t {
fn wrap_result(self) -> PostData {
PostData(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PostData> for *mut _cef_post_data_t {
fn from(value: PostData) -> Self {
let object = ImplPostData::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_post_data_element_t`] for more documentation.
#[derive(Clone)]
pub struct PostDataElement(RefGuard<_cef_post_data_element_t>);
pub trait ImplPostDataElement: Clone + Sized + Rc {
#[doc = "See [`_cef_post_data_element_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_post_data_element_t::set_to_empty`] for more documentation."]
fn set_to_empty(&self);
#[doc = "See [`_cef_post_data_element_t::set_to_file`] for more documentation."]
fn set_to_file(&self, file_name: Option<&CefString>);
#[doc = "See [`_cef_post_data_element_t::set_to_bytes`] for more documentation."]
fn set_to_bytes(&self, size: usize, bytes: *const u8);
#[doc = "See [`_cef_post_data_element_t::get_type`] for more documentation."]
fn get_type(&self) -> PostdataelementType;
#[doc = "See [`_cef_post_data_element_t::get_file`] for more documentation."]
fn file(&self) -> CefStringUserfree;
#[doc = "See [`_cef_post_data_element_t::get_bytes_count`] for more documentation."]
fn bytes_count(&self) -> usize;
#[doc = "See [`_cef_post_data_element_t::get_bytes`] for more documentation."]
fn bytes(&self, size: usize, bytes: *mut u8) -> usize;
fn get_raw(&self) -> *mut _cef_post_data_element_t;
}
impl ImplPostDataElement for PostDataElement {
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_to_empty(&self) {
unsafe {
if let Some(f) = self.0.set_to_empty {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_to_file(&self, file_name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_to_file {
let arg_file_name = file_name;
let arg_self_ = self.into_raw();
let arg_file_name = arg_file_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_file_name);
}
}
}
fn set_to_bytes(&self, size: usize, bytes: *const u8) {
unsafe {
if let Some(f) = self.0.set_to_bytes {
let (arg_size, arg_bytes) = (size, bytes);
let arg_self_ = self.into_raw();
let arg_bytes = arg_bytes.cast();
f(arg_self_, arg_size, arg_bytes);
}
}
}
fn get_type(&self) -> PostdataelementType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file(&self) -> CefStringUserfree {
unsafe {
self.0
.get_file
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn bytes_count(&self) -> usize {
unsafe {
self.0
.get_bytes_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn bytes(&self, size: usize, bytes: *mut u8) -> usize {
unsafe {
self.0
.get_bytes
.map(|f| {
let (arg_size, arg_bytes) = (size, bytes);
let arg_self_ = self.into_raw();
let arg_bytes = arg_bytes.cast();
let result = f(arg_self_, arg_size, arg_bytes);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_post_data_element_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_post_data_element_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PostDataElement {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_post_data_element_t> for &PostDataElement {
fn into_raw(self) -> *mut _cef_post_data_element_t {
ImplPostDataElement::get_raw(self)
}
}
impl ConvertParam<*mut _cef_post_data_element_t> for &mut PostDataElement {
fn into_raw(self) -> *mut _cef_post_data_element_t {
ImplPostDataElement::get_raw(self)
}
}
impl ConvertReturnValue<PostDataElement> for *mut _cef_post_data_element_t {
fn wrap_result(self) -> PostDataElement {
PostDataElement(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PostDataElement> for *mut _cef_post_data_element_t {
fn from(value: PostDataElement) -> Self {
let object = ImplPostDataElement::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_string_visitor_t`] for more documentation.
#[derive(Clone)]
pub struct CefStringVisitor(RefGuard<_cef_string_visitor_t>);
impl CefStringVisitor {
pub fn new<T>(interface: T) -> Self
where
T: WrapCefStringVisitor,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplCefStringVisitor>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapCefStringVisitor>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_string_visitor_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapCefStringVisitor: ImplCefStringVisitor {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_string_visitor_t, Self>);
}
pub trait ImplCefStringVisitor: Clone + Sized + Rc {
#[doc = "See [`_cef_string_visitor_t::visit`] for more documentation."]
fn visit(&self, string: Option<&CefString>) {}
fn init_methods(object: &mut _cef_string_visitor_t) {
impl_cef_string_visitor_t::init_methods::<Self, _cef_string_visitor_t>(object);
}
fn get_raw(&self) -> *mut _cef_string_visitor_t;
}
#[doc = "Implement the [`WrapCefStringVisitor`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl CefStringVisitor` block you can override default\nmethods implemented by the [`ImplCefStringVisitor`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_string_visitor! {\n struct MyCefStringVisitor {\n payload: String,\n }\n\n impl CefStringVisitor {\n // ...\n }\n}\n\nfn make_my_struct() -> CefStringVisitor {\n MyCefStringVisitor::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_string_visitor { ($ vis : vis struct $ name : ident ; impl CefStringVisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_string_visitor ! { $ vis struct $ name { } impl CefStringVisitor { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl CefStringVisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_string_visitor_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> CefStringVisitor { CefStringVisitor :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapCefStringVisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_string_visitor_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplCefStringVisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_string_visitor_t { self . cef_object . cast () } } } ; }
mod impl_cef_string_visitor_t {
use super::*;
pub fn init_methods<I: ImplCefStringVisitor, R: Rc>(object: &mut _cef_string_visitor_t) {
object.visit = Some(visit::<I, R>);
}
extern "C" fn visit<I: ImplCefStringVisitor, R: Rc>(
self_: *mut _cef_string_visitor_t,
string: *const cef_string_t,
) {
let (arg_self_, arg_string) = (self_, string);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_string = if arg_string.is_null() {
None
} else {
Some(arg_string.into())
};
let arg_string = arg_string.as_ref();
ImplCefStringVisitor::visit(&arg_self_.interface, arg_string)
}
}
impl ImplCefStringVisitor for CefStringVisitor {
fn visit(&self, string: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.visit {
let arg_string = string;
let arg_self_ = self.into_raw();
let arg_string = arg_string
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_string);
}
}
}
fn get_raw(&self) -> *mut _cef_string_visitor_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_string_visitor_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for CefStringVisitor {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_string_visitor_t> for &CefStringVisitor {
fn into_raw(self) -> *mut _cef_string_visitor_t {
ImplCefStringVisitor::get_raw(self)
}
}
impl ConvertParam<*mut _cef_string_visitor_t> for &mut CefStringVisitor {
fn into_raw(self) -> *mut _cef_string_visitor_t {
ImplCefStringVisitor::get_raw(self)
}
}
impl ConvertReturnValue<CefStringVisitor> for *mut _cef_string_visitor_t {
fn wrap_result(self) -> CefStringVisitor {
CefStringVisitor(unsafe { RefGuard::from_raw(self) })
}
}
impl From<CefStringVisitor> for *mut _cef_string_visitor_t {
fn from(value: CefStringVisitor) -> Self {
let object = ImplCefStringVisitor::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_frame_t`] for more documentation.
#[derive(Clone)]
pub struct Frame(RefGuard<_cef_frame_t>);
pub trait ImplFrame: Clone + Sized + Rc {
#[doc = "See [`_cef_frame_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_frame_t::undo`] for more documentation."]
fn undo(&self);
#[doc = "See [`_cef_frame_t::redo`] for more documentation."]
fn redo(&self);
#[doc = "See [`_cef_frame_t::cut`] for more documentation."]
fn cut(&self);
#[doc = "See [`_cef_frame_t::copy`] for more documentation."]
fn copy(&self);
#[doc = "See [`_cef_frame_t::paste`] for more documentation."]
fn paste(&self);
#[doc = "See [`_cef_frame_t::paste_and_match_style`] for more documentation."]
fn paste_and_match_style(&self);
#[doc = "See [`_cef_frame_t::del`] for more documentation."]
fn del(&self);
#[doc = "See [`_cef_frame_t::select_all`] for more documentation."]
fn select_all(&self);
#[doc = "See [`_cef_frame_t::view_source`] for more documentation."]
fn view_source(&self);
#[doc = "See [`_cef_frame_t::get_source`] for more documentation."]
fn source(&self, visitor: Option<&mut CefStringVisitor>);
#[doc = "See [`_cef_frame_t::get_text`] for more documentation."]
fn text(&self, visitor: Option<&mut CefStringVisitor>);
#[doc = "See [`_cef_frame_t::load_request`] for more documentation."]
fn load_request(&self, request: Option<&mut Request>);
#[doc = "See [`_cef_frame_t::load_url`] for more documentation."]
fn load_url(&self, url: Option<&CefString>);
#[doc = "See [`_cef_frame_t::execute_java_script`] for more documentation."]
fn execute_java_script(
&self,
code: Option<&CefString>,
script_url: Option<&CefString>,
start_line: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_frame_t::is_main`] for more documentation."]
fn is_main(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_frame_t::is_focused`] for more documentation."]
fn is_focused(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_frame_t::get_name`] for more documentation."]
fn name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_frame_t::get_identifier`] for more documentation."]
fn identifier(&self) -> CefStringUserfree;
#[doc = "See [`_cef_frame_t::get_parent`] for more documentation."]
fn parent(&self) -> Option<Frame>;
#[doc = "See [`_cef_frame_t::get_url`] for more documentation."]
fn url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_frame_t::get_browser`] for more documentation."]
fn browser(&self) -> Option<Browser>;
#[doc = "See [`_cef_frame_t::get_v8_context`] for more documentation."]
fn v8_context(&self) -> Option<V8Context>;
#[doc = "See [`_cef_frame_t::visit_dom`] for more documentation."]
fn visit_dom(&self, visitor: Option<&mut Domvisitor>);
#[doc = "See [`_cef_frame_t::create_urlrequest`] for more documentation."]
fn create_urlrequest(
&self,
request: Option<&mut Request>,
client: Option<&mut UrlrequestClient>,
) -> Option<Urlrequest>;
#[doc = "See [`_cef_frame_t::send_process_message`] for more documentation."]
fn send_process_message(&self, target_process: ProcessId, message: Option<&mut ProcessMessage>);
fn get_raw(&self) -> *mut _cef_frame_t;
}
impl ImplFrame for Frame {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn undo(&self) {
unsafe {
if let Some(f) = self.0.undo {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn redo(&self) {
unsafe {
if let Some(f) = self.0.redo {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn cut(&self) {
unsafe {
if let Some(f) = self.0.cut {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn copy(&self) {
unsafe {
if let Some(f) = self.0.copy {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn paste(&self) {
unsafe {
if let Some(f) = self.0.paste {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn paste_and_match_style(&self) {
unsafe {
if let Some(f) = self.0.paste_and_match_style {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn del(&self) {
unsafe {
if let Some(f) = self.0.del {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn select_all(&self) {
unsafe {
if let Some(f) = self.0.select_all {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn view_source(&self) {
unsafe {
if let Some(f) = self.0.view_source {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn source(&self, visitor: Option<&mut CefStringVisitor>) {
unsafe {
if let Some(f) = self.0.get_source {
let arg_visitor = visitor;
let arg_self_ = self.into_raw();
let arg_visitor = arg_visitor
.map(|arg| {
arg.add_ref();
ImplCefStringVisitor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_visitor);
}
}
}
fn text(&self, visitor: Option<&mut CefStringVisitor>) {
unsafe {
if let Some(f) = self.0.get_text {
let arg_visitor = visitor;
let arg_self_ = self.into_raw();
let arg_visitor = arg_visitor
.map(|arg| {
arg.add_ref();
ImplCefStringVisitor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_visitor);
}
}
}
fn load_request(&self, request: Option<&mut Request>) {
unsafe {
if let Some(f) = self.0.load_request {
let arg_request = request;
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_request);
}
}
}
fn load_url(&self, url: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.load_url {
let arg_url = url;
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_url);
}
}
}
fn execute_java_script(
&self,
code: Option<&CefString>,
script_url: Option<&CefString>,
start_line: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.execute_java_script {
let (arg_code, arg_script_url, arg_start_line) = (code, script_url, start_line);
let arg_self_ = self.into_raw();
let arg_code = arg_code
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_script_url = arg_script_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_code, arg_script_url, arg_start_line);
}
}
}
fn is_main(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_main
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_focused(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_focused
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn identifier(&self) -> CefStringUserfree {
unsafe {
self.0
.get_identifier
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn parent(&self) -> Option<Frame> {
unsafe {
self.0
.get_parent
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn browser(&self) -> Option<Browser> {
unsafe {
self.0
.get_browser
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn v8_context(&self) -> Option<V8Context> {
unsafe {
self.0
.get_v8_context
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn visit_dom(&self, visitor: Option<&mut Domvisitor>) {
unsafe {
if let Some(f) = self.0.visit_dom {
let arg_visitor = visitor;
let arg_self_ = self.into_raw();
let arg_visitor = arg_visitor
.map(|arg| {
arg.add_ref();
ImplDomvisitor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_visitor);
}
}
}
fn create_urlrequest(
&self,
request: Option<&mut Request>,
client: Option<&mut UrlrequestClient>,
) -> Option<Urlrequest> {
unsafe {
self.0
.create_urlrequest
.map(|f| {
let (arg_request, arg_client) = (request, client);
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_client = arg_client
.map(|arg| {
arg.add_ref();
ImplUrlrequestClient::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_request, arg_client);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn send_process_message(
&self,
target_process: ProcessId,
message: Option<&mut ProcessMessage>,
) {
unsafe {
if let Some(f) = self.0.send_process_message {
let (arg_target_process, arg_message) = (target_process, message);
let arg_self_ = self.into_raw();
let arg_target_process = arg_target_process.into_raw();
let arg_message = arg_message
.map(|arg| {
arg.add_ref();
ImplProcessMessage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_target_process, arg_message);
}
}
}
fn get_raw(&self) -> *mut _cef_frame_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_frame_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Frame {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_frame_t> for &Frame {
fn into_raw(self) -> *mut _cef_frame_t {
ImplFrame::get_raw(self)
}
}
impl ConvertParam<*mut _cef_frame_t> for &mut Frame {
fn into_raw(self) -> *mut _cef_frame_t {
ImplFrame::get_raw(self)
}
}
impl ConvertReturnValue<Frame> for *mut _cef_frame_t {
fn wrap_result(self) -> Frame {
Frame(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Frame> for *mut _cef_frame_t {
fn from(value: Frame) -> Self {
let object = ImplFrame::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_x509_cert_principal_t`] for more documentation.
#[derive(Clone)]
pub struct X509CertPrincipal(RefGuard<_cef_x509_cert_principal_t>);
pub trait ImplX509CertPrincipal: Clone + Sized + Rc {
#[doc = "See [`_cef_x509_cert_principal_t::get_display_name`] for more documentation."]
fn display_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_x509_cert_principal_t::get_common_name`] for more documentation."]
fn common_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_x509_cert_principal_t::get_locality_name`] for more documentation."]
fn locality_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_x509_cert_principal_t::get_state_or_province_name`] for more documentation."]
fn state_or_province_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_x509_cert_principal_t::get_country_name`] for more documentation."]
fn country_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_x509_cert_principal_t::get_organization_names`] for more documentation."]
fn organization_names(&self, names: Option<&mut CefStringList>);
#[doc = "See [`_cef_x509_cert_principal_t::get_organization_unit_names`] for more documentation."]
fn organization_unit_names(&self, names: Option<&mut CefStringList>);
fn get_raw(&self) -> *mut _cef_x509_cert_principal_t;
}
impl ImplX509CertPrincipal for X509CertPrincipal {
fn display_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_display_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn common_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_common_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn locality_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_locality_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn state_or_province_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_state_or_province_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn country_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_country_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn organization_names(&self, names: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.get_organization_names {
let arg_names = names;
let arg_self_ = self.into_raw();
let arg_names = arg_names
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_names);
}
}
}
fn organization_unit_names(&self, names: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.get_organization_unit_names {
let arg_names = names;
let arg_self_ = self.into_raw();
let arg_names = arg_names
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_names);
}
}
}
fn get_raw(&self) -> *mut _cef_x509_cert_principal_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_x509_cert_principal_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for X509CertPrincipal {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_x509_cert_principal_t> for &X509CertPrincipal {
fn into_raw(self) -> *mut _cef_x509_cert_principal_t {
ImplX509CertPrincipal::get_raw(self)
}
}
impl ConvertParam<*mut _cef_x509_cert_principal_t> for &mut X509CertPrincipal {
fn into_raw(self) -> *mut _cef_x509_cert_principal_t {
ImplX509CertPrincipal::get_raw(self)
}
}
impl ConvertReturnValue<X509CertPrincipal> for *mut _cef_x509_cert_principal_t {
fn wrap_result(self) -> X509CertPrincipal {
X509CertPrincipal(unsafe { RefGuard::from_raw(self) })
}
}
impl From<X509CertPrincipal> for *mut _cef_x509_cert_principal_t {
fn from(value: X509CertPrincipal) -> Self {
let object = ImplX509CertPrincipal::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_x509_certificate_t`] for more documentation.
#[derive(Clone)]
pub struct X509Certificate(RefGuard<_cef_x509_certificate_t>);
pub trait ImplX509Certificate: Clone + Sized + Rc {
#[doc = "See [`_cef_x509_certificate_t::get_subject`] for more documentation."]
fn subject(&self) -> Option<X509CertPrincipal>;
#[doc = "See [`_cef_x509_certificate_t::get_issuer`] for more documentation."]
fn issuer(&self) -> Option<X509CertPrincipal>;
#[doc = "See [`_cef_x509_certificate_t::get_serial_number`] for more documentation."]
fn serial_number(&self) -> Option<BinaryValue>;
#[doc = "See [`_cef_x509_certificate_t::get_valid_start`] for more documentation."]
fn valid_start(&self) -> Basetime;
#[doc = "See [`_cef_x509_certificate_t::get_valid_expiry`] for more documentation."]
fn valid_expiry(&self) -> Basetime;
#[doc = "See [`_cef_x509_certificate_t::get_derencoded`] for more documentation."]
fn derencoded(&self) -> Option<BinaryValue>;
#[doc = "See [`_cef_x509_certificate_t::get_pemencoded`] for more documentation."]
fn pemencoded(&self) -> Option<BinaryValue>;
#[doc = "See [`_cef_x509_certificate_t::get_issuer_chain_size`] for more documentation."]
fn issuer_chain_size(&self) -> usize;
#[doc = "See [`_cef_x509_certificate_t::get_derencoded_issuer_chain`] for more documentation."]
fn derencoded_issuer_chain(&self, chain: Option<&mut Vec<Option<BinaryValue>>>);
#[doc = "See [`_cef_x509_certificate_t::get_pemencoded_issuer_chain`] for more documentation."]
fn pemencoded_issuer_chain(&self, chain: Option<&mut Vec<Option<BinaryValue>>>);
fn get_raw(&self) -> *mut _cef_x509_certificate_t;
}
impl ImplX509Certificate for X509Certificate {
fn subject(&self) -> Option<X509CertPrincipal> {
unsafe {
self.0
.get_subject
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn issuer(&self) -> Option<X509CertPrincipal> {
unsafe {
self.0
.get_issuer
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn serial_number(&self) -> Option<BinaryValue> {
unsafe {
self.0
.get_serial_number
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn valid_start(&self) -> Basetime {
unsafe {
self.0
.get_valid_start
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn valid_expiry(&self) -> Basetime {
unsafe {
self.0
.get_valid_expiry
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn derencoded(&self) -> Option<BinaryValue> {
unsafe {
self.0
.get_derencoded
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn pemencoded(&self) -> Option<BinaryValue> {
unsafe {
self.0
.get_pemencoded
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn issuer_chain_size(&self) -> usize {
unsafe {
self.0
.get_issuer_chain_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn derencoded_issuer_chain(&self, chain: Option<&mut Vec<Option<BinaryValue>>>) {
unsafe {
if let Some(f) = self.0.get_derencoded_issuer_chain {
let arg_chain = chain;
let arg_self_ = self.into_raw();
let mut out_chain_count =
arg_chain.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_chain_count = &mut out_chain_count;
let out_chain = arg_chain;
let mut vec_chain = out_chain
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_chain = if vec_chain.is_empty() {
std::ptr::null_mut()
} else {
vec_chain.as_mut_ptr()
};
f(arg_self_, arg_chain_count, arg_chain);
if let Some(out_chain) = out_chain {
*out_chain = vec_chain
.into_iter()
.take(out_chain_count)
.map(|elem| {
if elem.is_null() {
None
} else {
Some(elem.wrap_result())
}
})
.collect();
}
}
}
}
fn pemencoded_issuer_chain(&self, chain: Option<&mut Vec<Option<BinaryValue>>>) {
unsafe {
if let Some(f) = self.0.get_pemencoded_issuer_chain {
let arg_chain = chain;
let arg_self_ = self.into_raw();
let mut out_chain_count =
arg_chain.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_chain_count = &mut out_chain_count;
let out_chain = arg_chain;
let mut vec_chain = out_chain
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_chain = if vec_chain.is_empty() {
std::ptr::null_mut()
} else {
vec_chain.as_mut_ptr()
};
f(arg_self_, arg_chain_count, arg_chain);
if let Some(out_chain) = out_chain {
*out_chain = vec_chain
.into_iter()
.take(out_chain_count)
.map(|elem| {
if elem.is_null() {
None
} else {
Some(elem.wrap_result())
}
})
.collect();
}
}
}
}
fn get_raw(&self) -> *mut _cef_x509_certificate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_x509_certificate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for X509Certificate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_x509_certificate_t> for &X509Certificate {
fn into_raw(self) -> *mut _cef_x509_certificate_t {
ImplX509Certificate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_x509_certificate_t> for &mut X509Certificate {
fn into_raw(self) -> *mut _cef_x509_certificate_t {
ImplX509Certificate::get_raw(self)
}
}
impl ConvertReturnValue<X509Certificate> for *mut _cef_x509_certificate_t {
fn wrap_result(self) -> X509Certificate {
X509Certificate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<X509Certificate> for *mut _cef_x509_certificate_t {
fn from(value: X509Certificate) -> Self {
let object = ImplX509Certificate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_sslstatus_t`] for more documentation.
#[derive(Clone)]
pub struct Sslstatus(RefGuard<_cef_sslstatus_t>);
pub trait ImplSslstatus: Clone + Sized + Rc {
#[doc = "See [`_cef_sslstatus_t::is_secure_connection`] for more documentation."]
fn is_secure_connection(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_sslstatus_t::get_cert_status`] for more documentation."]
fn cert_status(&self) -> CertStatus;
#[doc = "See [`_cef_sslstatus_t::get_sslversion`] for more documentation."]
fn sslversion(&self) -> SslVersion;
#[doc = "See [`_cef_sslstatus_t::get_content_status`] for more documentation."]
fn content_status(&self) -> SslContentStatus;
#[doc = "See [`_cef_sslstatus_t::get_x509_certificate`] for more documentation."]
fn x509_certificate(&self) -> Option<X509Certificate>;
fn get_raw(&self) -> *mut _cef_sslstatus_t;
}
impl ImplSslstatus for Sslstatus {
fn is_secure_connection(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_secure_connection
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn cert_status(&self) -> CertStatus {
unsafe {
self.0
.get_cert_status
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn sslversion(&self) -> SslVersion {
unsafe {
self.0
.get_sslversion
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn content_status(&self) -> SslContentStatus {
unsafe {
self.0
.get_content_status
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn x509_certificate(&self) -> Option<X509Certificate> {
unsafe {
self.0
.get_x509_certificate
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_sslstatus_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_sslstatus_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Sslstatus {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_sslstatus_t> for &Sslstatus {
fn into_raw(self) -> *mut _cef_sslstatus_t {
ImplSslstatus::get_raw(self)
}
}
impl ConvertParam<*mut _cef_sslstatus_t> for &mut Sslstatus {
fn into_raw(self) -> *mut _cef_sslstatus_t {
ImplSslstatus::get_raw(self)
}
}
impl ConvertReturnValue<Sslstatus> for *mut _cef_sslstatus_t {
fn wrap_result(self) -> Sslstatus {
Sslstatus(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Sslstatus> for *mut _cef_sslstatus_t {
fn from(value: Sslstatus) -> Self {
let object = ImplSslstatus::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_navigation_entry_t`] for more documentation.
#[derive(Clone)]
pub struct NavigationEntry(RefGuard<_cef_navigation_entry_t>);
pub trait ImplNavigationEntry: Clone + Sized + Rc {
#[doc = "See [`_cef_navigation_entry_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_navigation_entry_t::get_url`] for more documentation."]
fn url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_navigation_entry_t::get_display_url`] for more documentation."]
fn display_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_navigation_entry_t::get_original_url`] for more documentation."]
fn original_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_navigation_entry_t::get_title`] for more documentation."]
fn title(&self) -> CefStringUserfree;
#[doc = "See [`_cef_navigation_entry_t::get_transition_type`] for more documentation."]
fn transition_type(&self) -> TransitionType;
#[doc = "See [`_cef_navigation_entry_t::has_post_data`] for more documentation."]
fn has_post_data(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_navigation_entry_t::get_completion_time`] for more documentation."]
fn completion_time(&self) -> Basetime;
#[doc = "See [`_cef_navigation_entry_t::get_http_status_code`] for more documentation."]
fn http_status_code(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_navigation_entry_t::get_sslstatus`] for more documentation."]
fn sslstatus(&self) -> Option<Sslstatus>;
fn get_raw(&self) -> *mut _cef_navigation_entry_t;
}
impl ImplNavigationEntry for NavigationEntry {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn display_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_display_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn original_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_original_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn title(&self) -> CefStringUserfree {
unsafe {
self.0
.get_title
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn transition_type(&self) -> TransitionType {
unsafe {
self.0
.get_transition_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_post_data(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_post_data
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn completion_time(&self) -> Basetime {
unsafe {
self.0
.get_completion_time
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn http_status_code(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_http_status_code
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn sslstatus(&self) -> Option<Sslstatus> {
unsafe {
self.0
.get_sslstatus
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_navigation_entry_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_navigation_entry_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for NavigationEntry {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_navigation_entry_t> for &NavigationEntry {
fn into_raw(self) -> *mut _cef_navigation_entry_t {
ImplNavigationEntry::get_raw(self)
}
}
impl ConvertParam<*mut _cef_navigation_entry_t> for &mut NavigationEntry {
fn into_raw(self) -> *mut _cef_navigation_entry_t {
ImplNavigationEntry::get_raw(self)
}
}
impl ConvertReturnValue<NavigationEntry> for *mut _cef_navigation_entry_t {
fn wrap_result(self) -> NavigationEntry {
NavigationEntry(unsafe { RefGuard::from_raw(self) })
}
}
impl From<NavigationEntry> for *mut _cef_navigation_entry_t {
fn from(value: NavigationEntry) -> Self {
let object = ImplNavigationEntry::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_registration_t`] for more documentation.
#[derive(Clone)]
pub struct Registration(RefGuard<_cef_registration_t>);
pub trait ImplRegistration: Clone + Sized + Rc {
fn get_raw(&self) -> *mut _cef_registration_t;
}
impl ImplRegistration for Registration {
fn get_raw(&self) -> *mut _cef_registration_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_registration_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Registration {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_registration_t> for &Registration {
fn into_raw(self) -> *mut _cef_registration_t {
ImplRegistration::get_raw(self)
}
}
impl ConvertParam<*mut _cef_registration_t> for &mut Registration {
fn into_raw(self) -> *mut _cef_registration_t {
ImplRegistration::get_raw(self)
}
}
impl ConvertReturnValue<Registration> for *mut _cef_registration_t {
fn wrap_result(self) -> Registration {
Registration(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Registration> for *mut _cef_registration_t {
fn from(value: Registration) -> Self {
let object = ImplRegistration::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_callback_t`] for more documentation.
#[derive(Clone)]
pub struct Callback(RefGuard<_cef_callback_t>);
pub trait ImplCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_callback_t::cont`] for more documentation."]
fn cont(&self);
#[doc = "See [`_cef_callback_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_callback_t;
}
impl ImplCallback for Callback {
fn cont(&self) {
unsafe {
if let Some(f) = self.0.cont {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Callback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_callback_t> for &Callback {
fn into_raw(self) -> *mut _cef_callback_t {
ImplCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_callback_t> for &mut Callback {
fn into_raw(self) -> *mut _cef_callback_t {
ImplCallback::get_raw(self)
}
}
impl ConvertReturnValue<Callback> for *mut _cef_callback_t {
fn wrap_result(self) -> Callback {
Callback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Callback> for *mut _cef_callback_t {
fn from(value: Callback) -> Self {
let object = ImplCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_completion_callback_t`] for more documentation.
#[derive(Clone)]
pub struct CompletionCallback(RefGuard<_cef_completion_callback_t>);
impl CompletionCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapCompletionCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplCompletionCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapCompletionCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_completion_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapCompletionCallback: ImplCompletionCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_completion_callback_t, Self>);
}
pub trait ImplCompletionCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_completion_callback_t::on_complete`] for more documentation."]
fn on_complete(&self) {}
fn init_methods(object: &mut _cef_completion_callback_t) {
impl_cef_completion_callback_t::init_methods::<Self, _cef_completion_callback_t>(object);
}
fn get_raw(&self) -> *mut _cef_completion_callback_t;
}
#[doc = "Implement the [`WrapCompletionCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl CompletionCallback` block you can override default\nmethods implemented by the [`ImplCompletionCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_completion_callback! {\n struct MyCompletionCallback {\n payload: String,\n }\n\n impl CompletionCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> CompletionCallback {\n MyCompletionCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_completion_callback { ($ vis : vis struct $ name : ident ; impl CompletionCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_completion_callback ! { $ vis struct $ name { } impl CompletionCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl CompletionCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_completion_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> CompletionCallback { CompletionCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapCompletionCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_completion_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplCompletionCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_completion_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_completion_callback_t {
use super::*;
pub fn init_methods<I: ImplCompletionCallback, R: Rc>(object: &mut _cef_completion_callback_t) {
object.on_complete = Some(on_complete::<I, R>);
}
extern "C" fn on_complete<I: ImplCompletionCallback, R: Rc>(
self_: *mut _cef_completion_callback_t,
) {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplCompletionCallback::on_complete(&arg_self_.interface)
}
}
impl ImplCompletionCallback for CompletionCallback {
fn on_complete(&self) {
unsafe {
if let Some(f) = self.0.on_complete {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_completion_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_completion_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for CompletionCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_completion_callback_t> for &CompletionCallback {
fn into_raw(self) -> *mut _cef_completion_callback_t {
ImplCompletionCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_completion_callback_t> for &mut CompletionCallback {
fn into_raw(self) -> *mut _cef_completion_callback_t {
ImplCompletionCallback::get_raw(self)
}
}
impl ConvertReturnValue<CompletionCallback> for *mut _cef_completion_callback_t {
fn wrap_result(self) -> CompletionCallback {
CompletionCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<CompletionCallback> for *mut _cef_completion_callback_t {
fn from(value: CompletionCallback) -> Self {
let object = ImplCompletionCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_cookie_manager_t`] for more documentation.
#[derive(Clone)]
pub struct CookieManager(RefGuard<_cef_cookie_manager_t>);
pub trait ImplCookieManager: Clone + Sized + Rc {
#[doc = "See [`_cef_cookie_manager_t::visit_all_cookies`] for more documentation."]
fn visit_all_cookies(&self, visitor: Option<&mut CookieVisitor>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_cookie_manager_t::visit_url_cookies`] for more documentation."]
fn visit_url_cookies(
&self,
url: Option<&CefString>,
include_http_only: ::std::os::raw::c_int,
visitor: Option<&mut CookieVisitor>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_cookie_manager_t::set_cookie`] for more documentation."]
fn set_cookie(
&self,
url: Option<&CefString>,
cookie: Option<&Cookie>,
callback: Option<&mut SetCookieCallback>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_cookie_manager_t::delete_cookies`] for more documentation."]
fn delete_cookies(
&self,
url: Option<&CefString>,
cookie_name: Option<&CefString>,
callback: Option<&mut DeleteCookiesCallback>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_cookie_manager_t::flush_store`] for more documentation."]
fn flush_store(&self, callback: Option<&mut CompletionCallback>) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_cookie_manager_t;
}
impl ImplCookieManager for CookieManager {
fn visit_all_cookies(&self, visitor: Option<&mut CookieVisitor>) -> ::std::os::raw::c_int {
unsafe {
self.0
.visit_all_cookies
.map(|f| {
let arg_visitor = visitor;
let arg_self_ = self.into_raw();
let arg_visitor = arg_visitor
.map(|arg| {
arg.add_ref();
ImplCookieVisitor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_visitor);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn visit_url_cookies(
&self,
url: Option<&CefString>,
include_http_only: ::std::os::raw::c_int,
visitor: Option<&mut CookieVisitor>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.visit_url_cookies
.map(|f| {
let (arg_url, arg_include_http_only, arg_visitor) =
(url, include_http_only, visitor);
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_visitor = arg_visitor
.map(|arg| {
arg.add_ref();
ImplCookieVisitor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_url, arg_include_http_only, arg_visitor);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_cookie(
&self,
url: Option<&CefString>,
cookie: Option<&Cookie>,
callback: Option<&mut SetCookieCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_cookie
.map(|f| {
let (arg_url, arg_cookie, arg_callback) = (url, cookie, callback);
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_cookie = arg_cookie.cloned().map(|arg| arg.into());
let arg_cookie = arg_cookie
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplSetCookieCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_url, arg_cookie, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn delete_cookies(
&self,
url: Option<&CefString>,
cookie_name: Option<&CefString>,
callback: Option<&mut DeleteCookiesCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.delete_cookies
.map(|f| {
let (arg_url, arg_cookie_name, arg_callback) = (url, cookie_name, callback);
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_cookie_name = arg_cookie_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplDeleteCookiesCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_url, arg_cookie_name, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn flush_store(&self, callback: Option<&mut CompletionCallback>) -> ::std::os::raw::c_int {
unsafe {
self.0
.flush_store
.map(|f| {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_cookie_manager_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_cookie_manager_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for CookieManager {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_cookie_manager_t> for &CookieManager {
fn into_raw(self) -> *mut _cef_cookie_manager_t {
ImplCookieManager::get_raw(self)
}
}
impl ConvertParam<*mut _cef_cookie_manager_t> for &mut CookieManager {
fn into_raw(self) -> *mut _cef_cookie_manager_t {
ImplCookieManager::get_raw(self)
}
}
impl ConvertReturnValue<CookieManager> for *mut _cef_cookie_manager_t {
fn wrap_result(self) -> CookieManager {
CookieManager(unsafe { RefGuard::from_raw(self) })
}
}
impl From<CookieManager> for *mut _cef_cookie_manager_t {
fn from(value: CookieManager) -> Self {
let object = ImplCookieManager::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_cookie_visitor_t`] for more documentation.
#[derive(Clone)]
pub struct CookieVisitor(RefGuard<_cef_cookie_visitor_t>);
impl CookieVisitor {
pub fn new<T>(interface: T) -> Self
where
T: WrapCookieVisitor,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplCookieVisitor>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapCookieVisitor>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_cookie_visitor_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapCookieVisitor: ImplCookieVisitor {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_cookie_visitor_t, Self>);
}
pub trait ImplCookieVisitor: Clone + Sized + Rc {
#[doc = "See [`_cef_cookie_visitor_t::visit`] for more documentation."]
fn visit(
&self,
cookie: Option<&Cookie>,
count: ::std::os::raw::c_int,
total: ::std::os::raw::c_int,
delete_cookie: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_cookie_visitor_t) {
impl_cef_cookie_visitor_t::init_methods::<Self, _cef_cookie_visitor_t>(object);
}
fn get_raw(&self) -> *mut _cef_cookie_visitor_t;
}
#[doc = "Implement the [`WrapCookieVisitor`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl CookieVisitor` block you can override default\nmethods implemented by the [`ImplCookieVisitor`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_cookie_visitor! {\n struct MyCookieVisitor {\n payload: String,\n }\n\n impl CookieVisitor {\n // ...\n }\n}\n\nfn make_my_struct() -> CookieVisitor {\n MyCookieVisitor::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_cookie_visitor { ($ vis : vis struct $ name : ident ; impl CookieVisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_cookie_visitor ! { $ vis struct $ name { } impl CookieVisitor { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl CookieVisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_cookie_visitor_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> CookieVisitor { CookieVisitor :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapCookieVisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_cookie_visitor_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplCookieVisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_cookie_visitor_t { self . cef_object . cast () } } } ; }
mod impl_cef_cookie_visitor_t {
use super::*;
pub fn init_methods<I: ImplCookieVisitor, R: Rc>(object: &mut _cef_cookie_visitor_t) {
object.visit = Some(visit::<I, R>);
}
extern "C" fn visit<I: ImplCookieVisitor, R: Rc>(
self_: *mut _cef_cookie_visitor_t,
cookie: *const _cef_cookie_t,
count: ::std::os::raw::c_int,
total: ::std::os::raw::c_int,
delete_cookie: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_cookie, arg_count, arg_total, arg_delete_cookie) =
(self_, cookie, count, total, delete_cookie);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_cookie = if arg_cookie.is_null() {
None
} else {
Some(WrapParamRef::<Cookie, _>::from(arg_cookie))
};
let arg_cookie = arg_cookie.as_ref().map(|arg| arg.as_ref());
let arg_count = arg_count.into_raw();
let arg_total = arg_total.into_raw();
let mut arg_delete_cookie = if arg_delete_cookie.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_delete_cookie,
))
};
let arg_delete_cookie = arg_delete_cookie.as_mut().map(|arg| arg.as_mut());
ImplCookieVisitor::visit(
&arg_self_.interface,
arg_cookie,
arg_count,
arg_total,
arg_delete_cookie,
)
}
}
impl ImplCookieVisitor for CookieVisitor {
fn visit(
&self,
cookie: Option<&Cookie>,
count: ::std::os::raw::c_int,
total: ::std::os::raw::c_int,
delete_cookie: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.visit
.map(|f| {
let (arg_cookie, arg_count, arg_total, arg_delete_cookie) =
(cookie, count, total, delete_cookie);
let arg_self_ = self.into_raw();
let arg_cookie = arg_cookie.cloned().map(|arg| arg.into());
let arg_cookie = arg_cookie
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_delete_cookie = arg_delete_cookie
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_cookie,
arg_count,
arg_total,
arg_delete_cookie,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_cookie_visitor_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_cookie_visitor_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for CookieVisitor {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_cookie_visitor_t> for &CookieVisitor {
fn into_raw(self) -> *mut _cef_cookie_visitor_t {
ImplCookieVisitor::get_raw(self)
}
}
impl ConvertParam<*mut _cef_cookie_visitor_t> for &mut CookieVisitor {
fn into_raw(self) -> *mut _cef_cookie_visitor_t {
ImplCookieVisitor::get_raw(self)
}
}
impl ConvertReturnValue<CookieVisitor> for *mut _cef_cookie_visitor_t {
fn wrap_result(self) -> CookieVisitor {
CookieVisitor(unsafe { RefGuard::from_raw(self) })
}
}
impl From<CookieVisitor> for *mut _cef_cookie_visitor_t {
fn from(value: CookieVisitor) -> Self {
let object = ImplCookieVisitor::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_set_cookie_callback_t`] for more documentation.
#[derive(Clone)]
pub struct SetCookieCallback(RefGuard<_cef_set_cookie_callback_t>);
impl SetCookieCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapSetCookieCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplSetCookieCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapSetCookieCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_set_cookie_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapSetCookieCallback: ImplSetCookieCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_set_cookie_callback_t, Self>);
}
pub trait ImplSetCookieCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_set_cookie_callback_t::on_complete`] for more documentation."]
fn on_complete(&self, success: ::std::os::raw::c_int) {}
fn init_methods(object: &mut _cef_set_cookie_callback_t) {
impl_cef_set_cookie_callback_t::init_methods::<Self, _cef_set_cookie_callback_t>(object);
}
fn get_raw(&self) -> *mut _cef_set_cookie_callback_t;
}
#[doc = "Implement the [`WrapSetCookieCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl SetCookieCallback` block you can override default\nmethods implemented by the [`ImplSetCookieCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_set_cookie_callback! {\n struct MySetCookieCallback {\n payload: String,\n }\n\n impl SetCookieCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> SetCookieCallback {\n MySetCookieCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_set_cookie_callback { ($ vis : vis struct $ name : ident ; impl SetCookieCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_set_cookie_callback ! { $ vis struct $ name { } impl SetCookieCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl SetCookieCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_set_cookie_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> SetCookieCallback { SetCookieCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapSetCookieCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_set_cookie_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplSetCookieCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_set_cookie_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_set_cookie_callback_t {
use super::*;
pub fn init_methods<I: ImplSetCookieCallback, R: Rc>(object: &mut _cef_set_cookie_callback_t) {
object.on_complete = Some(on_complete::<I, R>);
}
extern "C" fn on_complete<I: ImplSetCookieCallback, R: Rc>(
self_: *mut _cef_set_cookie_callback_t,
success: ::std::os::raw::c_int,
) {
let (arg_self_, arg_success) = (self_, success);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_success = arg_success.into_raw();
ImplSetCookieCallback::on_complete(&arg_self_.interface, arg_success)
}
}
impl ImplSetCookieCallback for SetCookieCallback {
fn on_complete(&self, success: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.on_complete {
let arg_success = success;
let arg_self_ = self.into_raw();
f(arg_self_, arg_success);
}
}
}
fn get_raw(&self) -> *mut _cef_set_cookie_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_set_cookie_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for SetCookieCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_set_cookie_callback_t> for &SetCookieCallback {
fn into_raw(self) -> *mut _cef_set_cookie_callback_t {
ImplSetCookieCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_set_cookie_callback_t> for &mut SetCookieCallback {
fn into_raw(self) -> *mut _cef_set_cookie_callback_t {
ImplSetCookieCallback::get_raw(self)
}
}
impl ConvertReturnValue<SetCookieCallback> for *mut _cef_set_cookie_callback_t {
fn wrap_result(self) -> SetCookieCallback {
SetCookieCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<SetCookieCallback> for *mut _cef_set_cookie_callback_t {
fn from(value: SetCookieCallback) -> Self {
let object = ImplSetCookieCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_delete_cookies_callback_t`] for more documentation.
#[derive(Clone)]
pub struct DeleteCookiesCallback(RefGuard<_cef_delete_cookies_callback_t>);
impl DeleteCookiesCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapDeleteCookiesCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDeleteCookiesCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDeleteCookiesCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_delete_cookies_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDeleteCookiesCallback: ImplDeleteCookiesCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_delete_cookies_callback_t, Self>);
}
pub trait ImplDeleteCookiesCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_delete_cookies_callback_t::on_complete`] for more documentation."]
fn on_complete(&self, num_deleted: ::std::os::raw::c_int) {}
fn init_methods(object: &mut _cef_delete_cookies_callback_t) {
impl_cef_delete_cookies_callback_t::init_methods::<Self, _cef_delete_cookies_callback_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_delete_cookies_callback_t;
}
#[doc = "Implement the [`WrapDeleteCookiesCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl DeleteCookiesCallback` block you can override default\nmethods implemented by the [`ImplDeleteCookiesCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_delete_cookies_callback! {\n struct MyDeleteCookiesCallback {\n payload: String,\n }\n\n impl DeleteCookiesCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> DeleteCookiesCallback {\n MyDeleteCookiesCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_delete_cookies_callback { ($ vis : vis struct $ name : ident ; impl DeleteCookiesCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_delete_cookies_callback ! { $ vis struct $ name { } impl DeleteCookiesCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl DeleteCookiesCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_delete_cookies_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> DeleteCookiesCallback { DeleteCookiesCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDeleteCookiesCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_delete_cookies_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDeleteCookiesCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_delete_cookies_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_delete_cookies_callback_t {
use super::*;
pub fn init_methods<I: ImplDeleteCookiesCallback, R: Rc>(
object: &mut _cef_delete_cookies_callback_t,
) {
object.on_complete = Some(on_complete::<I, R>);
}
extern "C" fn on_complete<I: ImplDeleteCookiesCallback, R: Rc>(
self_: *mut _cef_delete_cookies_callback_t,
num_deleted: ::std::os::raw::c_int,
) {
let (arg_self_, arg_num_deleted) = (self_, num_deleted);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_num_deleted = arg_num_deleted.into_raw();
ImplDeleteCookiesCallback::on_complete(&arg_self_.interface, arg_num_deleted)
}
}
impl ImplDeleteCookiesCallback for DeleteCookiesCallback {
fn on_complete(&self, num_deleted: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.on_complete {
let arg_num_deleted = num_deleted;
let arg_self_ = self.into_raw();
f(arg_self_, arg_num_deleted);
}
}
}
fn get_raw(&self) -> *mut _cef_delete_cookies_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_delete_cookies_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DeleteCookiesCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_delete_cookies_callback_t> for &DeleteCookiesCallback {
fn into_raw(self) -> *mut _cef_delete_cookies_callback_t {
ImplDeleteCookiesCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_delete_cookies_callback_t> for &mut DeleteCookiesCallback {
fn into_raw(self) -> *mut _cef_delete_cookies_callback_t {
ImplDeleteCookiesCallback::get_raw(self)
}
}
impl ConvertReturnValue<DeleteCookiesCallback> for *mut _cef_delete_cookies_callback_t {
fn wrap_result(self) -> DeleteCookiesCallback {
DeleteCookiesCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DeleteCookiesCallback> for *mut _cef_delete_cookies_callback_t {
fn from(value: DeleteCookiesCallback) -> Self {
let object = ImplDeleteCookiesCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_router_t`] for more documentation.
#[derive(Clone)]
pub struct MediaRouter(RefGuard<_cef_media_router_t>);
pub trait ImplMediaRouter: Clone + Sized + Rc {
#[doc = "See [`_cef_media_router_t::add_observer`] for more documentation."]
fn add_observer(&self, observer: Option<&mut MediaObserver>) -> Option<Registration>;
#[doc = "See [`_cef_media_router_t::get_source`] for more documentation."]
fn source(&self, urn: Option<&CefString>) -> Option<MediaSource>;
#[doc = "See [`_cef_media_router_t::notify_current_sinks`] for more documentation."]
fn notify_current_sinks(&self);
#[doc = "See [`_cef_media_router_t::create_route`] for more documentation."]
fn create_route(
&self,
source: Option<&mut MediaSource>,
sink: Option<&mut MediaSink>,
callback: Option<&mut MediaRouteCreateCallback>,
);
#[doc = "See [`_cef_media_router_t::notify_current_routes`] for more documentation."]
fn notify_current_routes(&self);
fn get_raw(&self) -> *mut _cef_media_router_t;
}
impl ImplMediaRouter for MediaRouter {
fn add_observer(&self, observer: Option<&mut MediaObserver>) -> Option<Registration> {
unsafe {
self.0
.add_observer
.map(|f| {
let arg_observer = observer;
let arg_self_ = self.into_raw();
let arg_observer = arg_observer
.map(|arg| {
arg.add_ref();
ImplMediaObserver::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_observer);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn source(&self, urn: Option<&CefString>) -> Option<MediaSource> {
unsafe {
self.0
.get_source
.map(|f| {
let arg_urn = urn;
let arg_self_ = self.into_raw();
let arg_urn = arg_urn
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_urn);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn notify_current_sinks(&self) {
unsafe {
if let Some(f) = self.0.notify_current_sinks {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn create_route(
&self,
source: Option<&mut MediaSource>,
sink: Option<&mut MediaSink>,
callback: Option<&mut MediaRouteCreateCallback>,
) {
unsafe {
if let Some(f) = self.0.create_route {
let (arg_source, arg_sink, arg_callback) = (source, sink, callback);
let arg_self_ = self.into_raw();
let arg_source = arg_source
.map(|arg| {
arg.add_ref();
ImplMediaSource::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_sink = arg_sink
.map(|arg| {
arg.add_ref();
ImplMediaSink::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplMediaRouteCreateCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_source, arg_sink, arg_callback);
}
}
}
fn notify_current_routes(&self) {
unsafe {
if let Some(f) = self.0.notify_current_routes {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_media_router_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_router_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaRouter {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_router_t> for &MediaRouter {
fn into_raw(self) -> *mut _cef_media_router_t {
ImplMediaRouter::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_router_t> for &mut MediaRouter {
fn into_raw(self) -> *mut _cef_media_router_t {
ImplMediaRouter::get_raw(self)
}
}
impl ConvertReturnValue<MediaRouter> for *mut _cef_media_router_t {
fn wrap_result(self) -> MediaRouter {
MediaRouter(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaRouter> for *mut _cef_media_router_t {
fn from(value: MediaRouter) -> Self {
let object = ImplMediaRouter::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_observer_t`] for more documentation.
#[derive(Clone)]
pub struct MediaObserver(RefGuard<_cef_media_observer_t>);
impl MediaObserver {
pub fn new<T>(interface: T) -> Self
where
T: WrapMediaObserver,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplMediaObserver>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapMediaObserver>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_media_observer_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapMediaObserver: ImplMediaObserver {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_media_observer_t, Self>);
}
pub trait ImplMediaObserver: Clone + Sized + Rc {
#[doc = "See [`_cef_media_observer_t::on_sinks`] for more documentation."]
fn on_sinks(&self, sinks: Option<&[Option<MediaSink>]>) {}
#[doc = "See [`_cef_media_observer_t::on_routes`] for more documentation."]
fn on_routes(&self, routes: Option<&[Option<MediaRoute>]>) {}
#[doc = "See [`_cef_media_observer_t::on_route_state_changed`] for more documentation."]
fn on_route_state_changed(
&self,
route: Option<&mut MediaRoute>,
state: MediaRouteConnectionState,
) {
}
#[doc = "See [`_cef_media_observer_t::on_route_message_received`] for more documentation."]
fn on_route_message_received(&self, route: Option<&mut MediaRoute>, message: Option<&[u8]>) {}
fn init_methods(object: &mut _cef_media_observer_t) {
impl_cef_media_observer_t::init_methods::<Self, _cef_media_observer_t>(object);
}
fn get_raw(&self) -> *mut _cef_media_observer_t;
}
#[doc = "Implement the [`WrapMediaObserver`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl MediaObserver` block you can override default\nmethods implemented by the [`ImplMediaObserver`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_media_observer! {\n struct MyMediaObserver {\n payload: String,\n }\n\n impl MediaObserver {\n // ...\n }\n}\n\nfn make_my_struct() -> MediaObserver {\n MyMediaObserver::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_media_observer { ($ vis : vis struct $ name : ident ; impl MediaObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_media_observer ! { $ vis struct $ name { } impl MediaObserver { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl MediaObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_media_observer_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> MediaObserver { MediaObserver :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapMediaObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_media_observer_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplMediaObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_media_observer_t { self . cef_object . cast () } } } ; }
mod impl_cef_media_observer_t {
use super::*;
pub fn init_methods<I: ImplMediaObserver, R: Rc>(object: &mut _cef_media_observer_t) {
object.on_sinks = Some(on_sinks::<I, R>);
object.on_routes = Some(on_routes::<I, R>);
object.on_route_state_changed = Some(on_route_state_changed::<I, R>);
object.on_route_message_received = Some(on_route_message_received::<I, R>);
}
extern "C" fn on_sinks<I: ImplMediaObserver, R: Rc>(
self_: *mut _cef_media_observer_t,
sinks_count: usize,
sinks: *const *mut _cef_media_sink_t,
) {
let (arg_self_, arg_sinks_count, arg_sinks) = (self_, sinks_count, sinks);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let vec_sinks = unsafe { arg_sinks.as_ref() }.map(|arg| {
let arg =
unsafe { std::slice::from_raw_parts(std::ptr::from_ref(arg), arg_sinks_count) };
arg.iter()
.map(|arg| {
if arg.is_null() {
None
} else {
Some(MediaSink(unsafe { RefGuard::from_raw(*arg) }))
}
})
.collect::<Vec<_>>()
});
let arg_sinks = vec_sinks.as_deref();
ImplMediaObserver::on_sinks(&arg_self_.interface, arg_sinks)
}
extern "C" fn on_routes<I: ImplMediaObserver, R: Rc>(
self_: *mut _cef_media_observer_t,
routes_count: usize,
routes: *const *mut _cef_media_route_t,
) {
let (arg_self_, arg_routes_count, arg_routes) = (self_, routes_count, routes);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let vec_routes = unsafe { arg_routes.as_ref() }.map(|arg| {
let arg =
unsafe { std::slice::from_raw_parts(std::ptr::from_ref(arg), arg_routes_count) };
arg.iter()
.map(|arg| {
if arg.is_null() {
None
} else {
Some(MediaRoute(unsafe { RefGuard::from_raw(*arg) }))
}
})
.collect::<Vec<_>>()
});
let arg_routes = vec_routes.as_deref();
ImplMediaObserver::on_routes(&arg_self_.interface, arg_routes)
}
extern "C" fn on_route_state_changed<I: ImplMediaObserver, R: Rc>(
self_: *mut _cef_media_observer_t,
route: *mut _cef_media_route_t,
state: cef_media_route_connection_state_t,
) {
let (arg_self_, arg_route, arg_state) = (self_, route, state);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_route =
unsafe { arg_route.as_mut() }.map(|arg| MediaRoute(unsafe { RefGuard::from_raw(arg) }));
let arg_route = arg_route.as_mut();
let arg_state = arg_state.into_raw();
ImplMediaObserver::on_route_state_changed(&arg_self_.interface, arg_route, arg_state)
}
extern "C" fn on_route_message_received<I: ImplMediaObserver, R: Rc>(
self_: *mut _cef_media_observer_t,
route: *mut _cef_media_route_t,
message: *const ::std::os::raw::c_void,
message_size: usize,
) {
let (arg_self_, arg_route, arg_message, arg_message_size) =
(self_, route, message, message_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_route =
unsafe { arg_route.as_mut() }.map(|arg| MediaRoute(unsafe { RefGuard::from_raw(arg) }));
let arg_route = arg_route.as_mut();
let arg_message = (!arg_message.is_null() && arg_message_size > 0)
.then(|| unsafe { std::slice::from_raw_parts(arg_message.cast(), arg_message_size) });
ImplMediaObserver::on_route_message_received(&arg_self_.interface, arg_route, arg_message)
}
}
impl ImplMediaObserver for MediaObserver {
fn on_sinks(&self, sinks: Option<&[Option<MediaSink>]>) {
unsafe {
if let Some(f) = self.0.on_sinks {
let arg_sinks = sinks;
let arg_self_ = self.into_raw();
let arg_sinks_count = arg_sinks.as_ref().map(|arg| arg.len()).unwrap_or_default();
let vec_sinks = arg_sinks
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_sinks = if vec_sinks.is_empty() {
std::ptr::null()
} else {
vec_sinks.as_ptr()
};
f(arg_self_, arg_sinks_count, arg_sinks);
}
}
}
fn on_routes(&self, routes: Option<&[Option<MediaRoute>]>) {
unsafe {
if let Some(f) = self.0.on_routes {
let arg_routes = routes;
let arg_self_ = self.into_raw();
let arg_routes_count = arg_routes.as_ref().map(|arg| arg.len()).unwrap_or_default();
let vec_routes = arg_routes
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_routes = if vec_routes.is_empty() {
std::ptr::null()
} else {
vec_routes.as_ptr()
};
f(arg_self_, arg_routes_count, arg_routes);
}
}
}
fn on_route_state_changed(
&self,
route: Option<&mut MediaRoute>,
state: MediaRouteConnectionState,
) {
unsafe {
if let Some(f) = self.0.on_route_state_changed {
let (arg_route, arg_state) = (route, state);
let arg_self_ = self.into_raw();
let arg_route = arg_route
.map(|arg| {
arg.add_ref();
ImplMediaRoute::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_state = arg_state.into_raw();
f(arg_self_, arg_route, arg_state);
}
}
}
fn on_route_message_received(&self, route: Option<&mut MediaRoute>, message: Option<&[u8]>) {
unsafe {
if let Some(f) = self.0.on_route_message_received {
let (arg_route, arg_message) = (route, message);
let arg_self_ = self.into_raw();
let arg_route = arg_route
.map(|arg| {
arg.add_ref();
ImplMediaRoute::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_message_size = arg_message
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_message = arg_message
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(arg_self_, arg_route, arg_message, arg_message_size);
}
}
}
fn get_raw(&self) -> *mut _cef_media_observer_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_observer_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaObserver {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_observer_t> for &MediaObserver {
fn into_raw(self) -> *mut _cef_media_observer_t {
ImplMediaObserver::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_observer_t> for &mut MediaObserver {
fn into_raw(self) -> *mut _cef_media_observer_t {
ImplMediaObserver::get_raw(self)
}
}
impl ConvertReturnValue<MediaObserver> for *mut _cef_media_observer_t {
fn wrap_result(self) -> MediaObserver {
MediaObserver(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaObserver> for *mut _cef_media_observer_t {
fn from(value: MediaObserver) -> Self {
let object = ImplMediaObserver::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_route_t`] for more documentation.
#[derive(Clone)]
pub struct MediaRoute(RefGuard<_cef_media_route_t>);
pub trait ImplMediaRoute: Clone + Sized + Rc {
#[doc = "See [`_cef_media_route_t::get_id`] for more documentation."]
fn id(&self) -> CefStringUserfree;
#[doc = "See [`_cef_media_route_t::get_source`] for more documentation."]
fn source(&self) -> Option<MediaSource>;
#[doc = "See [`_cef_media_route_t::get_sink`] for more documentation."]
fn sink(&self) -> Option<MediaSink>;
#[doc = "See [`_cef_media_route_t::send_route_message`] for more documentation."]
fn send_route_message(&self, message: Option<&[u8]>);
#[doc = "See [`_cef_media_route_t::terminate`] for more documentation."]
fn terminate(&self);
fn get_raw(&self) -> *mut _cef_media_route_t;
}
impl ImplMediaRoute for MediaRoute {
fn id(&self) -> CefStringUserfree {
unsafe {
self.0
.get_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn source(&self) -> Option<MediaSource> {
unsafe {
self.0
.get_source
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn sink(&self) -> Option<MediaSink> {
unsafe {
self.0
.get_sink
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn send_route_message(&self, message: Option<&[u8]>) {
unsafe {
if let Some(f) = self.0.send_route_message {
let arg_message = message;
let arg_self_ = self.into_raw();
let arg_message_size = arg_message
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_message = arg_message
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(arg_self_, arg_message, arg_message_size);
}
}
}
fn terminate(&self) {
unsafe {
if let Some(f) = self.0.terminate {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_media_route_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_route_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaRoute {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_route_t> for &MediaRoute {
fn into_raw(self) -> *mut _cef_media_route_t {
ImplMediaRoute::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_route_t> for &mut MediaRoute {
fn into_raw(self) -> *mut _cef_media_route_t {
ImplMediaRoute::get_raw(self)
}
}
impl ConvertReturnValue<MediaRoute> for *mut _cef_media_route_t {
fn wrap_result(self) -> MediaRoute {
MediaRoute(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaRoute> for *mut _cef_media_route_t {
fn from(value: MediaRoute) -> Self {
let object = ImplMediaRoute::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_route_create_callback_t`] for more documentation.
#[derive(Clone)]
pub struct MediaRouteCreateCallback(RefGuard<_cef_media_route_create_callback_t>);
impl MediaRouteCreateCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapMediaRouteCreateCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplMediaRouteCreateCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapMediaRouteCreateCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_media_route_create_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapMediaRouteCreateCallback: ImplMediaRouteCreateCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_media_route_create_callback_t, Self>);
}
pub trait ImplMediaRouteCreateCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_media_route_create_callback_t::on_media_route_create_finished`] for more documentation."]
fn on_media_route_create_finished(
&self,
result: MediaRouteCreateResult,
error: Option<&CefString>,
route: Option<&mut MediaRoute>,
) {
}
fn init_methods(object: &mut _cef_media_route_create_callback_t) {
impl_cef_media_route_create_callback_t::init_methods::<
Self,
_cef_media_route_create_callback_t,
>(object);
}
fn get_raw(&self) -> *mut _cef_media_route_create_callback_t;
}
#[doc = "Implement the [`WrapMediaRouteCreateCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl MediaRouteCreateCallback` block you can override default\nmethods implemented by the [`ImplMediaRouteCreateCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_media_route_create_callback! {\n struct MyMediaRouteCreateCallback {\n payload: String,\n }\n\n impl MediaRouteCreateCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> MediaRouteCreateCallback {\n MyMediaRouteCreateCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_media_route_create_callback { ($ vis : vis struct $ name : ident ; impl MediaRouteCreateCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_media_route_create_callback ! { $ vis struct $ name { } impl MediaRouteCreateCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl MediaRouteCreateCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_media_route_create_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> MediaRouteCreateCallback { MediaRouteCreateCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapMediaRouteCreateCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_media_route_create_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplMediaRouteCreateCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_media_route_create_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_media_route_create_callback_t {
use super::*;
pub fn init_methods<I: ImplMediaRouteCreateCallback, R: Rc>(
object: &mut _cef_media_route_create_callback_t,
) {
object.on_media_route_create_finished = Some(on_media_route_create_finished::<I, R>);
}
extern "C" fn on_media_route_create_finished<I: ImplMediaRouteCreateCallback, R: Rc>(
self_: *mut _cef_media_route_create_callback_t,
result: cef_media_route_create_result_t,
error: *const cef_string_t,
route: *mut _cef_media_route_t,
) {
let (arg_self_, arg_result, arg_error, arg_route) = (self_, result, error, route);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_result = arg_result.into_raw();
let arg_error = if arg_error.is_null() {
None
} else {
Some(arg_error.into())
};
let arg_error = arg_error.as_ref();
let mut arg_route =
unsafe { arg_route.as_mut() }.map(|arg| MediaRoute(unsafe { RefGuard::from_raw(arg) }));
let arg_route = arg_route.as_mut();
ImplMediaRouteCreateCallback::on_media_route_create_finished(
&arg_self_.interface,
arg_result,
arg_error,
arg_route,
)
}
}
impl ImplMediaRouteCreateCallback for MediaRouteCreateCallback {
fn on_media_route_create_finished(
&self,
result: MediaRouteCreateResult,
error: Option<&CefString>,
route: Option<&mut MediaRoute>,
) {
unsafe {
if let Some(f) = self.0.on_media_route_create_finished {
let (arg_result, arg_error, arg_route) = (result, error, route);
let arg_self_ = self.into_raw();
let arg_result = arg_result.into_raw();
let arg_error = arg_error
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_route = arg_route
.map(|arg| {
arg.add_ref();
ImplMediaRoute::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_result, arg_error, arg_route);
}
}
}
fn get_raw(&self) -> *mut _cef_media_route_create_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_route_create_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaRouteCreateCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_route_create_callback_t> for &MediaRouteCreateCallback {
fn into_raw(self) -> *mut _cef_media_route_create_callback_t {
ImplMediaRouteCreateCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_route_create_callback_t> for &mut MediaRouteCreateCallback {
fn into_raw(self) -> *mut _cef_media_route_create_callback_t {
ImplMediaRouteCreateCallback::get_raw(self)
}
}
impl ConvertReturnValue<MediaRouteCreateCallback> for *mut _cef_media_route_create_callback_t {
fn wrap_result(self) -> MediaRouteCreateCallback {
MediaRouteCreateCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaRouteCreateCallback> for *mut _cef_media_route_create_callback_t {
fn from(value: MediaRouteCreateCallback) -> Self {
let object = ImplMediaRouteCreateCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_sink_t`] for more documentation.
#[derive(Clone)]
pub struct MediaSink(RefGuard<_cef_media_sink_t>);
pub trait ImplMediaSink: Clone + Sized + Rc {
#[doc = "See [`_cef_media_sink_t::get_id`] for more documentation."]
fn id(&self) -> CefStringUserfree;
#[doc = "See [`_cef_media_sink_t::get_name`] for more documentation."]
fn name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_media_sink_t::get_icon_type`] for more documentation."]
fn icon_type(&self) -> MediaSinkIconType;
#[doc = "See [`_cef_media_sink_t::get_device_info`] for more documentation."]
fn device_info(&self, callback: Option<&mut MediaSinkDeviceInfoCallback>);
#[doc = "See [`_cef_media_sink_t::is_cast_sink`] for more documentation."]
fn is_cast_sink(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_media_sink_t::is_dial_sink`] for more documentation."]
fn is_dial_sink(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_media_sink_t::is_compatible_with`] for more documentation."]
fn is_compatible_with(&self, source: Option<&mut MediaSource>) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_media_sink_t;
}
impl ImplMediaSink for MediaSink {
fn id(&self) -> CefStringUserfree {
unsafe {
self.0
.get_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn icon_type(&self) -> MediaSinkIconType {
unsafe {
self.0
.get_icon_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn device_info(&self, callback: Option<&mut MediaSinkDeviceInfoCallback>) {
unsafe {
if let Some(f) = self.0.get_device_info {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplMediaSinkDeviceInfoCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_callback);
}
}
}
fn is_cast_sink(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_cast_sink
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_dial_sink(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_dial_sink
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_compatible_with(&self, source: Option<&mut MediaSource>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_compatible_with
.map(|f| {
let arg_source = source;
let arg_self_ = self.into_raw();
let arg_source = arg_source
.map(|arg| {
arg.add_ref();
ImplMediaSource::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_source);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_media_sink_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_sink_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaSink {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_sink_t> for &MediaSink {
fn into_raw(self) -> *mut _cef_media_sink_t {
ImplMediaSink::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_sink_t> for &mut MediaSink {
fn into_raw(self) -> *mut _cef_media_sink_t {
ImplMediaSink::get_raw(self)
}
}
impl ConvertReturnValue<MediaSink> for *mut _cef_media_sink_t {
fn wrap_result(self) -> MediaSink {
MediaSink(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaSink> for *mut _cef_media_sink_t {
fn from(value: MediaSink) -> Self {
let object = ImplMediaSink::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_sink_device_info_callback_t`] for more documentation.
#[derive(Clone)]
pub struct MediaSinkDeviceInfoCallback(RefGuard<_cef_media_sink_device_info_callback_t>);
impl MediaSinkDeviceInfoCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapMediaSinkDeviceInfoCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplMediaSinkDeviceInfoCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapMediaSinkDeviceInfoCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_media_sink_device_info_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapMediaSinkDeviceInfoCallback: ImplMediaSinkDeviceInfoCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_media_sink_device_info_callback_t, Self>);
}
pub trait ImplMediaSinkDeviceInfoCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_media_sink_device_info_callback_t::on_media_sink_device_info`] for more documentation."]
fn on_media_sink_device_info(&self, device_info: Option<&MediaSinkDeviceInfo>) {}
fn init_methods(object: &mut _cef_media_sink_device_info_callback_t) {
impl_cef_media_sink_device_info_callback_t::init_methods::<
Self,
_cef_media_sink_device_info_callback_t,
>(object);
}
fn get_raw(&self) -> *mut _cef_media_sink_device_info_callback_t;
}
#[doc = "Implement the [`WrapMediaSinkDeviceInfoCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl MediaSinkDeviceInfoCallback` block you can override default\nmethods implemented by the [`ImplMediaSinkDeviceInfoCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_media_sink_device_info_callback! {\n struct MyMediaSinkDeviceInfoCallback {\n payload: String,\n }\n\n impl MediaSinkDeviceInfoCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> MediaSinkDeviceInfoCallback {\n MyMediaSinkDeviceInfoCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_media_sink_device_info_callback { ($ vis : vis struct $ name : ident ; impl MediaSinkDeviceInfoCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_media_sink_device_info_callback ! { $ vis struct $ name { } impl MediaSinkDeviceInfoCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl MediaSinkDeviceInfoCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_media_sink_device_info_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> MediaSinkDeviceInfoCallback { MediaSinkDeviceInfoCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapMediaSinkDeviceInfoCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_media_sink_device_info_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplMediaSinkDeviceInfoCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_media_sink_device_info_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_media_sink_device_info_callback_t {
use super::*;
pub fn init_methods<I: ImplMediaSinkDeviceInfoCallback, R: Rc>(
object: &mut _cef_media_sink_device_info_callback_t,
) {
object.on_media_sink_device_info = Some(on_media_sink_device_info::<I, R>);
}
extern "C" fn on_media_sink_device_info<I: ImplMediaSinkDeviceInfoCallback, R: Rc>(
self_: *mut _cef_media_sink_device_info_callback_t,
device_info: *const _cef_media_sink_device_info_t,
) {
let (arg_self_, arg_device_info) = (self_, device_info);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_device_info = if arg_device_info.is_null() {
None
} else {
Some(WrapParamRef::<MediaSinkDeviceInfo, _>::from(
arg_device_info,
))
};
let arg_device_info = arg_device_info.as_ref().map(|arg| arg.as_ref());
ImplMediaSinkDeviceInfoCallback::on_media_sink_device_info(
&arg_self_.interface,
arg_device_info,
)
}
}
impl ImplMediaSinkDeviceInfoCallback for MediaSinkDeviceInfoCallback {
fn on_media_sink_device_info(&self, device_info: Option<&MediaSinkDeviceInfo>) {
unsafe {
if let Some(f) = self.0.on_media_sink_device_info {
let arg_device_info = device_info;
let arg_self_ = self.into_raw();
let arg_device_info = arg_device_info.cloned().map(|arg| arg.into());
let arg_device_info = arg_device_info
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_device_info);
}
}
}
fn get_raw(&self) -> *mut _cef_media_sink_device_info_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_sink_device_info_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaSinkDeviceInfoCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_sink_device_info_callback_t> for &MediaSinkDeviceInfoCallback {
fn into_raw(self) -> *mut _cef_media_sink_device_info_callback_t {
ImplMediaSinkDeviceInfoCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_sink_device_info_callback_t>
for &mut MediaSinkDeviceInfoCallback
{
fn into_raw(self) -> *mut _cef_media_sink_device_info_callback_t {
ImplMediaSinkDeviceInfoCallback::get_raw(self)
}
}
impl ConvertReturnValue<MediaSinkDeviceInfoCallback>
for *mut _cef_media_sink_device_info_callback_t
{
fn wrap_result(self) -> MediaSinkDeviceInfoCallback {
MediaSinkDeviceInfoCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaSinkDeviceInfoCallback> for *mut _cef_media_sink_device_info_callback_t {
fn from(value: MediaSinkDeviceInfoCallback) -> Self {
let object = ImplMediaSinkDeviceInfoCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_source_t`] for more documentation.
#[derive(Clone)]
pub struct MediaSource(RefGuard<_cef_media_source_t>);
pub trait ImplMediaSource: Clone + Sized + Rc {
#[doc = "See [`_cef_media_source_t::get_id`] for more documentation."]
fn id(&self) -> CefStringUserfree;
#[doc = "See [`_cef_media_source_t::is_cast_source`] for more documentation."]
fn is_cast_source(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_media_source_t::is_dial_source`] for more documentation."]
fn is_dial_source(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_media_source_t;
}
impl ImplMediaSource for MediaSource {
fn id(&self) -> CefStringUserfree {
unsafe {
self.0
.get_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_cast_source(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_cast_source
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_dial_source(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_dial_source
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_media_source_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_source_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaSource {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_source_t> for &MediaSource {
fn into_raw(self) -> *mut _cef_media_source_t {
ImplMediaSource::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_source_t> for &mut MediaSource {
fn into_raw(self) -> *mut _cef_media_source_t {
ImplMediaSource::get_raw(self)
}
}
impl ConvertReturnValue<MediaSource> for *mut _cef_media_source_t {
fn wrap_result(self) -> MediaSource {
MediaSource(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaSource> for *mut _cef_media_source_t {
fn from(value: MediaSource) -> Self {
let object = ImplMediaSource::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_preference_registrar_t`] for more documentation.
#[derive(Clone, Copy)]
pub struct PreferenceRegistrar(*mut _cef_preference_registrar_t);
pub trait ImplPreferenceRegistrar: Sized {
#[doc = "See [`_cef_preference_registrar_t::add_preference`] for more documentation."]
fn add_preference(
&self,
name: Option<&CefString>,
default_value: Option<&mut Value>,
) -> ::std::os::raw::c_int;
fn init_methods<R: Rc>(object: &mut _cef_preference_registrar_t) {
impl_cef_preference_registrar_t::init_methods::<Self, R>(object);
}
fn get_raw(&self) -> *mut _cef_preference_registrar_t;
}
mod impl_cef_preference_registrar_t {
use super::*;
pub fn init_methods<I: ImplPreferenceRegistrar, R: Rc>(
object: &mut _cef_preference_registrar_t,
) {
object.add_preference = Some(add_preference::<I, R>);
}
extern "C" fn add_preference<I: ImplPreferenceRegistrar, R: Rc>(
self_: *mut _cef_preference_registrar_t,
name: *const cef_string_t,
default_value: *mut _cef_value_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_name, arg_default_value) = (self_, name, default_value);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_name = if arg_name.is_null() {
None
} else {
Some(arg_name.into())
};
let arg_name = arg_name.as_ref();
let mut arg_default_value = unsafe { arg_default_value.as_mut() }
.map(|arg| Value(unsafe { RefGuard::from_raw(arg) }));
let arg_default_value = arg_default_value.as_mut();
ImplPreferenceRegistrar::add_preference(&arg_self_.interface, arg_name, arg_default_value)
}
}
impl ImplPreferenceRegistrar for PreferenceRegistrar {
fn add_preference(
&self,
name: Option<&CefString>,
default_value: Option<&mut Value>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.as_ref()
.and_then(|this| this.add_preference)
.map(|f| {
let (arg_name, arg_default_value) = (name, default_value);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_default_value = arg_default_value
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_name, arg_default_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_preference_registrar_t {
self.0
}
}
impl ConvertParam<*mut _cef_preference_registrar_t> for &PreferenceRegistrar {
fn into_raw(self) -> *mut _cef_preference_registrar_t {
ImplPreferenceRegistrar::get_raw(self)
}
}
impl ConvertParam<*mut _cef_preference_registrar_t> for &mut PreferenceRegistrar {
fn into_raw(self) -> *mut _cef_preference_registrar_t {
ImplPreferenceRegistrar::get_raw(self)
}
}
impl ConvertReturnValue<PreferenceRegistrar> for *mut _cef_preference_registrar_t {
fn wrap_result(self) -> PreferenceRegistrar {
PreferenceRegistrar(self)
}
}
impl From<PreferenceRegistrar> for *mut _cef_preference_registrar_t {
fn from(value: PreferenceRegistrar) -> Self {
ImplPreferenceRegistrar::get_raw(&value)
}
}
/// See [`_cef_preference_observer_t`] for more documentation.
#[derive(Clone)]
pub struct PreferenceObserver(RefGuard<_cef_preference_observer_t>);
impl PreferenceObserver {
pub fn new<T>(interface: T) -> Self
where
T: WrapPreferenceObserver,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplPreferenceObserver>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapPreferenceObserver>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_preference_observer_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapPreferenceObserver: ImplPreferenceObserver {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_preference_observer_t, Self>);
}
pub trait ImplPreferenceObserver: Clone + Sized + Rc {
#[doc = "See [`_cef_preference_observer_t::on_preference_changed`] for more documentation."]
fn on_preference_changed(&self, name: Option<&CefString>) {}
fn init_methods(object: &mut _cef_preference_observer_t) {
impl_cef_preference_observer_t::init_methods::<Self, _cef_preference_observer_t>(object);
}
fn get_raw(&self) -> *mut _cef_preference_observer_t;
}
#[doc = "Implement the [`WrapPreferenceObserver`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl PreferenceObserver` block you can override default\nmethods implemented by the [`ImplPreferenceObserver`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_preference_observer! {\n struct MyPreferenceObserver {\n payload: String,\n }\n\n impl PreferenceObserver {\n // ...\n }\n}\n\nfn make_my_struct() -> PreferenceObserver {\n MyPreferenceObserver::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_preference_observer { ($ vis : vis struct $ name : ident ; impl PreferenceObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_preference_observer ! { $ vis struct $ name { } impl PreferenceObserver { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl PreferenceObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_preference_observer_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> PreferenceObserver { PreferenceObserver :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapPreferenceObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_preference_observer_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplPreferenceObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_preference_observer_t { self . cef_object . cast () } } } ; }
mod impl_cef_preference_observer_t {
use super::*;
pub fn init_methods<I: ImplPreferenceObserver, R: Rc>(object: &mut _cef_preference_observer_t) {
object.on_preference_changed = Some(on_preference_changed::<I, R>);
}
extern "C" fn on_preference_changed<I: ImplPreferenceObserver, R: Rc>(
self_: *mut _cef_preference_observer_t,
name: *const cef_string_t,
) {
let (arg_self_, arg_name) = (self_, name);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_name = if arg_name.is_null() {
None
} else {
Some(arg_name.into())
};
let arg_name = arg_name.as_ref();
ImplPreferenceObserver::on_preference_changed(&arg_self_.interface, arg_name)
}
}
impl ImplPreferenceObserver for PreferenceObserver {
fn on_preference_changed(&self, name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.on_preference_changed {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name);
}
}
}
fn get_raw(&self) -> *mut _cef_preference_observer_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_preference_observer_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PreferenceObserver {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_preference_observer_t> for &PreferenceObserver {
fn into_raw(self) -> *mut _cef_preference_observer_t {
ImplPreferenceObserver::get_raw(self)
}
}
impl ConvertParam<*mut _cef_preference_observer_t> for &mut PreferenceObserver {
fn into_raw(self) -> *mut _cef_preference_observer_t {
ImplPreferenceObserver::get_raw(self)
}
}
impl ConvertReturnValue<PreferenceObserver> for *mut _cef_preference_observer_t {
fn wrap_result(self) -> PreferenceObserver {
PreferenceObserver(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PreferenceObserver> for *mut _cef_preference_observer_t {
fn from(value: PreferenceObserver) -> Self {
let object = ImplPreferenceObserver::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_preference_manager_t`] for more documentation.
#[derive(Clone)]
pub struct PreferenceManager(RefGuard<_cef_preference_manager_t>);
pub trait ImplPreferenceManager: Clone + Sized + Rc {
#[doc = "See [`_cef_preference_manager_t::has_preference`] for more documentation."]
fn has_preference(&self, name: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_preference_manager_t::get_preference`] for more documentation."]
fn preference(&self, name: Option<&CefString>) -> Option<Value>;
#[doc = "See [`_cef_preference_manager_t::get_all_preferences`] for more documentation."]
fn all_preferences(&self, include_defaults: ::std::os::raw::c_int) -> Option<DictionaryValue>;
#[doc = "See [`_cef_preference_manager_t::can_set_preference`] for more documentation."]
fn can_set_preference(&self, name: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_preference_manager_t::set_preference`] for more documentation."]
fn set_preference(
&self,
name: Option<&CefString>,
value: Option<&mut Value>,
error: Option<&mut CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_preference_manager_t::add_preference_observer`] for more documentation."]
fn add_preference_observer(
&self,
name: Option<&CefString>,
observer: Option<&mut PreferenceObserver>,
) -> Option<Registration>;
fn get_raw(&self) -> *mut _cef_preference_manager_t;
}
impl ImplPreferenceManager for PreferenceManager {
fn has_preference(&self, name: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_preference
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn preference(&self, name: Option<&CefString>) -> Option<Value> {
unsafe {
self.0
.get_preference
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn all_preferences(&self, include_defaults: ::std::os::raw::c_int) -> Option<DictionaryValue> {
unsafe {
self.0
.get_all_preferences
.map(|f| {
let arg_include_defaults = include_defaults;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_include_defaults);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn can_set_preference(&self, name: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_set_preference
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_preference(
&self,
name: Option<&CefString>,
value: Option<&mut Value>,
error: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_preference
.map(|f| {
let (arg_name, arg_value, arg_error) = (name, value, error);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_error = arg_error
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_name, arg_value, arg_error);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_preference_observer(
&self,
name: Option<&CefString>,
observer: Option<&mut PreferenceObserver>,
) -> Option<Registration> {
unsafe {
self.0
.add_preference_observer
.map(|f| {
let (arg_name, arg_observer) = (name, observer);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_observer = arg_observer
.map(|arg| {
arg.add_ref();
ImplPreferenceObserver::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_name, arg_observer);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_preference_manager_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_preference_manager_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PreferenceManager {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_preference_manager_t> for &PreferenceManager {
fn into_raw(self) -> *mut _cef_preference_manager_t {
ImplPreferenceManager::get_raw(self)
}
}
impl ConvertParam<*mut _cef_preference_manager_t> for &mut PreferenceManager {
fn into_raw(self) -> *mut _cef_preference_manager_t {
ImplPreferenceManager::get_raw(self)
}
}
impl ConvertReturnValue<PreferenceManager> for *mut _cef_preference_manager_t {
fn wrap_result(self) -> PreferenceManager {
PreferenceManager(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PreferenceManager> for *mut _cef_preference_manager_t {
fn from(value: PreferenceManager) -> Self {
let object = ImplPreferenceManager::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_resolve_callback_t`] for more documentation.
#[derive(Clone)]
pub struct ResolveCallback(RefGuard<_cef_resolve_callback_t>);
impl ResolveCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapResolveCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplResolveCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapResolveCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_resolve_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapResolveCallback: ImplResolveCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_resolve_callback_t, Self>);
}
pub trait ImplResolveCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_resolve_callback_t::on_resolve_completed`] for more documentation."]
fn on_resolve_completed(&self, result: Errorcode, resolved_ips: Option<&mut CefStringList>) {}
fn init_methods(object: &mut _cef_resolve_callback_t) {
impl_cef_resolve_callback_t::init_methods::<Self, _cef_resolve_callback_t>(object);
}
fn get_raw(&self) -> *mut _cef_resolve_callback_t;
}
#[doc = "Implement the [`WrapResolveCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ResolveCallback` block you can override default\nmethods implemented by the [`ImplResolveCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_resolve_callback! {\n struct MyResolveCallback {\n payload: String,\n }\n\n impl ResolveCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> ResolveCallback {\n MyResolveCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_resolve_callback { ($ vis : vis struct $ name : ident ; impl ResolveCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_resolve_callback ! { $ vis struct $ name { } impl ResolveCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ResolveCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resolve_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ResolveCallback { ResolveCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapResolveCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resolve_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplResolveCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_resolve_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_resolve_callback_t {
use super::*;
pub fn init_methods<I: ImplResolveCallback, R: Rc>(object: &mut _cef_resolve_callback_t) {
object.on_resolve_completed = Some(on_resolve_completed::<I, R>);
}
extern "C" fn on_resolve_completed<I: ImplResolveCallback, R: Rc>(
self_: *mut _cef_resolve_callback_t,
result: cef_errorcode_t,
resolved_ips: *mut _cef_string_list_t,
) {
let (arg_self_, arg_result, arg_resolved_ips) = (self_, result, resolved_ips);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_result = arg_result.into_raw();
let mut arg_resolved_ips = if arg_resolved_ips.is_null() {
None
} else {
Some(arg_resolved_ips.into())
};
let arg_resolved_ips = arg_resolved_ips.as_mut();
ImplResolveCallback::on_resolve_completed(
&arg_self_.interface,
arg_result,
arg_resolved_ips,
)
}
}
impl ImplResolveCallback for ResolveCallback {
fn on_resolve_completed(&self, result: Errorcode, resolved_ips: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.on_resolve_completed {
let (arg_result, arg_resolved_ips) = (result, resolved_ips);
let arg_self_ = self.into_raw();
let arg_result = arg_result.into_raw();
let arg_resolved_ips = arg_resolved_ips
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_result, arg_resolved_ips);
}
}
}
fn get_raw(&self) -> *mut _cef_resolve_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_resolve_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResolveCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_resolve_callback_t> for &ResolveCallback {
fn into_raw(self) -> *mut _cef_resolve_callback_t {
ImplResolveCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_resolve_callback_t> for &mut ResolveCallback {
fn into_raw(self) -> *mut _cef_resolve_callback_t {
ImplResolveCallback::get_raw(self)
}
}
impl ConvertReturnValue<ResolveCallback> for *mut _cef_resolve_callback_t {
fn wrap_result(self) -> ResolveCallback {
ResolveCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResolveCallback> for *mut _cef_resolve_callback_t {
fn from(value: ResolveCallback) -> Self {
let object = ImplResolveCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_setting_observer_t`] for more documentation.
#[derive(Clone)]
pub struct SettingObserver(RefGuard<_cef_setting_observer_t>);
impl SettingObserver {
pub fn new<T>(interface: T) -> Self
where
T: WrapSettingObserver,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplSettingObserver>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapSettingObserver>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_setting_observer_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapSettingObserver: ImplSettingObserver {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_setting_observer_t, Self>);
}
pub trait ImplSettingObserver: Clone + Sized + Rc {
#[doc = "See [`_cef_setting_observer_t::on_setting_changed`] for more documentation."]
fn on_setting_changed(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
) {
}
fn init_methods(object: &mut _cef_setting_observer_t) {
impl_cef_setting_observer_t::init_methods::<Self, _cef_setting_observer_t>(object);
}
fn get_raw(&self) -> *mut _cef_setting_observer_t;
}
#[doc = "Implement the [`WrapSettingObserver`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl SettingObserver` block you can override default\nmethods implemented by the [`ImplSettingObserver`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_setting_observer! {\n struct MySettingObserver {\n payload: String,\n }\n\n impl SettingObserver {\n // ...\n }\n}\n\nfn make_my_struct() -> SettingObserver {\n MySettingObserver::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_setting_observer { ($ vis : vis struct $ name : ident ; impl SettingObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_setting_observer ! { $ vis struct $ name { } impl SettingObserver { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl SettingObserver { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_setting_observer_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> SettingObserver { SettingObserver :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapSettingObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_setting_observer_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplSettingObserver for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_setting_observer_t { self . cef_object . cast () } } } ; }
mod impl_cef_setting_observer_t {
use super::*;
pub fn init_methods<I: ImplSettingObserver, R: Rc>(object: &mut _cef_setting_observer_t) {
object.on_setting_changed = Some(on_setting_changed::<I, R>);
}
extern "C" fn on_setting_changed<I: ImplSettingObserver, R: Rc>(
self_: *mut _cef_setting_observer_t,
requesting_url: *const cef_string_t,
top_level_url: *const cef_string_t,
content_type: cef_content_setting_types_t,
) {
let (arg_self_, arg_requesting_url, arg_top_level_url, arg_content_type) =
(self_, requesting_url, top_level_url, content_type);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_requesting_url = if arg_requesting_url.is_null() {
None
} else {
Some(arg_requesting_url.into())
};
let arg_requesting_url = arg_requesting_url.as_ref();
let arg_top_level_url = if arg_top_level_url.is_null() {
None
} else {
Some(arg_top_level_url.into())
};
let arg_top_level_url = arg_top_level_url.as_ref();
let arg_content_type = arg_content_type.into_raw();
ImplSettingObserver::on_setting_changed(
&arg_self_.interface,
arg_requesting_url,
arg_top_level_url,
arg_content_type,
)
}
}
impl ImplSettingObserver for SettingObserver {
fn on_setting_changed(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
) {
unsafe {
if let Some(f) = self.0.on_setting_changed {
let (arg_requesting_url, arg_top_level_url, arg_content_type) =
(requesting_url, top_level_url, content_type);
let arg_self_ = self.into_raw();
let arg_requesting_url = arg_requesting_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_top_level_url = arg_top_level_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_content_type = arg_content_type.into_raw();
f(
arg_self_,
arg_requesting_url,
arg_top_level_url,
arg_content_type,
);
}
}
}
fn get_raw(&self) -> *mut _cef_setting_observer_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_setting_observer_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for SettingObserver {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_setting_observer_t> for &SettingObserver {
fn into_raw(self) -> *mut _cef_setting_observer_t {
ImplSettingObserver::get_raw(self)
}
}
impl ConvertParam<*mut _cef_setting_observer_t> for &mut SettingObserver {
fn into_raw(self) -> *mut _cef_setting_observer_t {
ImplSettingObserver::get_raw(self)
}
}
impl ConvertReturnValue<SettingObserver> for *mut _cef_setting_observer_t {
fn wrap_result(self) -> SettingObserver {
SettingObserver(unsafe { RefGuard::from_raw(self) })
}
}
impl From<SettingObserver> for *mut _cef_setting_observer_t {
fn from(value: SettingObserver) -> Self {
let object = ImplSettingObserver::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_request_context_t`] for more documentation.
#[derive(Clone)]
pub struct RequestContext(RefGuard<_cef_request_context_t>);
pub trait ImplRequestContext: ImplPreferenceManager {
#[doc = "See [`_cef_request_context_t::is_same`] for more documentation."]
fn is_same(&self, other: Option<&mut RequestContext>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_request_context_t::is_sharing_with`] for more documentation."]
fn is_sharing_with(&self, other: Option<&mut RequestContext>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_request_context_t::is_global`] for more documentation."]
fn is_global(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_request_context_t::get_handler`] for more documentation."]
fn handler(&self) -> Option<RequestContextHandler>;
#[doc = "See [`_cef_request_context_t::get_cache_path`] for more documentation."]
fn cache_path(&self) -> CefStringUserfree;
#[doc = "See [`_cef_request_context_t::get_cookie_manager`] for more documentation."]
fn cookie_manager(&self, callback: Option<&mut CompletionCallback>) -> Option<CookieManager>;
#[doc = "See [`_cef_request_context_t::register_scheme_handler_factory`] for more documentation."]
fn register_scheme_handler_factory(
&self,
scheme_name: Option<&CefString>,
domain_name: Option<&CefString>,
factory: Option<&mut SchemeHandlerFactory>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_request_context_t::clear_scheme_handler_factories`] for more documentation."]
fn clear_scheme_handler_factories(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_request_context_t::clear_certificate_exceptions`] for more documentation."]
fn clear_certificate_exceptions(&self, callback: Option<&mut CompletionCallback>);
#[doc = "See [`_cef_request_context_t::clear_http_auth_credentials`] for more documentation."]
fn clear_http_auth_credentials(&self, callback: Option<&mut CompletionCallback>);
#[doc = "See [`_cef_request_context_t::close_all_connections`] for more documentation."]
fn close_all_connections(&self, callback: Option<&mut CompletionCallback>);
#[doc = "See [`_cef_request_context_t::resolve_host`] for more documentation."]
fn resolve_host(&self, origin: Option<&CefString>, callback: Option<&mut ResolveCallback>);
#[doc = "See [`_cef_request_context_t::get_media_router`] for more documentation."]
fn media_router(&self, callback: Option<&mut CompletionCallback>) -> Option<MediaRouter>;
#[doc = "See [`_cef_request_context_t::get_website_setting`] for more documentation."]
fn website_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
) -> Option<Value>;
#[doc = "See [`_cef_request_context_t::set_website_setting`] for more documentation."]
fn set_website_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
value: Option<&mut Value>,
);
#[doc = "See [`_cef_request_context_t::get_content_setting`] for more documentation."]
fn content_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
) -> ContentSettingValues;
#[doc = "See [`_cef_request_context_t::set_content_setting`] for more documentation."]
fn set_content_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
value: ContentSettingValues,
);
#[doc = "See [`_cef_request_context_t::set_chrome_color_scheme`] for more documentation."]
fn set_chrome_color_scheme(&self, variant: ColorVariant, user_color: u32);
#[doc = "See [`_cef_request_context_t::get_chrome_color_scheme_mode`] for more documentation."]
fn chrome_color_scheme_mode(&self) -> ColorVariant;
#[doc = "See [`_cef_request_context_t::get_chrome_color_scheme_color`] for more documentation."]
fn chrome_color_scheme_color(&self) -> cef_color_t;
#[doc = "See [`_cef_request_context_t::get_chrome_color_scheme_variant`] for more documentation."]
fn chrome_color_scheme_variant(&self) -> ColorVariant;
#[doc = "See [`_cef_request_context_t::add_setting_observer`] for more documentation."]
fn add_setting_observer(&self, observer: Option<&mut SettingObserver>) -> Option<Registration>;
#[doc = "See [`_cef_request_context_t::clear_http_cache`] for more documentation."]
fn clear_http_cache(&self, callback: Option<&mut CompletionCallback>);
fn get_raw(&self) -> *mut _cef_request_context_t {
<Self as ImplPreferenceManager>::get_raw(self).cast()
}
}
impl ImplPreferenceManager for RequestContext {
fn has_preference(&self, name: Option<&CefString>) -> ::std::os::raw::c_int {
PreferenceManager::from(self).has_preference(name)
}
fn preference(&self, name: Option<&CefString>) -> Option<Value> {
PreferenceManager::from(self).preference(name)
}
fn all_preferences(&self, include_defaults: ::std::os::raw::c_int) -> Option<DictionaryValue> {
PreferenceManager::from(self).all_preferences(include_defaults)
}
fn can_set_preference(&self, name: Option<&CefString>) -> ::std::os::raw::c_int {
PreferenceManager::from(self).can_set_preference(name)
}
fn set_preference(
&self,
name: Option<&CefString>,
value: Option<&mut Value>,
error: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
PreferenceManager::from(self).set_preference(name, value, error)
}
fn add_preference_observer(
&self,
name: Option<&CefString>,
observer: Option<&mut PreferenceObserver>,
) -> Option<Registration> {
PreferenceManager::from(self).add_preference_observer(name, observer)
}
fn get_raw(&self) -> *mut _cef_preference_manager_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&RequestContext> for PreferenceManager {
fn from(from: &RequestContext) -> Self {
PreferenceManager(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplRequestContext for RequestContext {
fn is_same(&self, other: Option<&mut RequestContext>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_other = other;
let arg_self_ = self.into_raw();
let arg_other = arg_other
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_other);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_sharing_with(&self, other: Option<&mut RequestContext>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_sharing_with
.map(|f| {
let arg_other = other;
let arg_self_ = self.into_raw();
let arg_other = arg_other
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_other);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_global(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_global
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn handler(&self) -> Option<RequestContextHandler> {
unsafe {
self.0
.get_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn cache_path(&self) -> CefStringUserfree {
unsafe {
self.0
.get_cache_path
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn cookie_manager(&self, callback: Option<&mut CompletionCallback>) -> Option<CookieManager> {
unsafe {
self.0
.get_cookie_manager
.map(|f| {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_callback);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn register_scheme_handler_factory(
&self,
scheme_name: Option<&CefString>,
domain_name: Option<&CefString>,
factory: Option<&mut SchemeHandlerFactory>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.register_scheme_handler_factory
.map(|f| {
let (arg_scheme_name, arg_domain_name, arg_factory) =
(scheme_name, domain_name, factory);
let arg_self_ = self.into_raw();
let arg_scheme_name = arg_scheme_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_domain_name = arg_domain_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_factory = arg_factory
.map(|arg| {
arg.add_ref();
ImplSchemeHandlerFactory::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_scheme_name, arg_domain_name, arg_factory);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn clear_scheme_handler_factories(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.clear_scheme_handler_factories
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn clear_certificate_exceptions(&self, callback: Option<&mut CompletionCallback>) {
unsafe {
if let Some(f) = self.0.clear_certificate_exceptions {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_callback);
}
}
}
fn clear_http_auth_credentials(&self, callback: Option<&mut CompletionCallback>) {
unsafe {
if let Some(f) = self.0.clear_http_auth_credentials {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_callback);
}
}
}
fn close_all_connections(&self, callback: Option<&mut CompletionCallback>) {
unsafe {
if let Some(f) = self.0.close_all_connections {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_callback);
}
}
}
fn resolve_host(&self, origin: Option<&CefString>, callback: Option<&mut ResolveCallback>) {
unsafe {
if let Some(f) = self.0.resolve_host {
let (arg_origin, arg_callback) = (origin, callback);
let arg_self_ = self.into_raw();
let arg_origin = arg_origin
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplResolveCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_origin, arg_callback);
}
}
}
fn media_router(&self, callback: Option<&mut CompletionCallback>) -> Option<MediaRouter> {
unsafe {
self.0
.get_media_router
.map(|f| {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_callback);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn website_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
) -> Option<Value> {
unsafe {
self.0
.get_website_setting
.map(|f| {
let (arg_requesting_url, arg_top_level_url, arg_content_type) =
(requesting_url, top_level_url, content_type);
let arg_self_ = self.into_raw();
let arg_requesting_url = arg_requesting_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_top_level_url = arg_top_level_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_content_type = arg_content_type.into_raw();
let result = f(
arg_self_,
arg_requesting_url,
arg_top_level_url,
arg_content_type,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_website_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
value: Option<&mut Value>,
) {
unsafe {
if let Some(f) = self.0.set_website_setting {
let (arg_requesting_url, arg_top_level_url, arg_content_type, arg_value) =
(requesting_url, top_level_url, content_type, value);
let arg_self_ = self.into_raw();
let arg_requesting_url = arg_requesting_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_top_level_url = arg_top_level_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_content_type = arg_content_type.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_requesting_url,
arg_top_level_url,
arg_content_type,
arg_value,
);
}
}
}
fn content_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
) -> ContentSettingValues {
unsafe {
self.0
.get_content_setting
.map(|f| {
let (arg_requesting_url, arg_top_level_url, arg_content_type) =
(requesting_url, top_level_url, content_type);
let arg_self_ = self.into_raw();
let arg_requesting_url = arg_requesting_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_top_level_url = arg_top_level_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_content_type = arg_content_type.into_raw();
let result = f(
arg_self_,
arg_requesting_url,
arg_top_level_url,
arg_content_type,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_content_setting(
&self,
requesting_url: Option<&CefString>,
top_level_url: Option<&CefString>,
content_type: ContentSettingTypes,
value: ContentSettingValues,
) {
unsafe {
if let Some(f) = self.0.set_content_setting {
let (arg_requesting_url, arg_top_level_url, arg_content_type, arg_value) =
(requesting_url, top_level_url, content_type, value);
let arg_self_ = self.into_raw();
let arg_requesting_url = arg_requesting_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_top_level_url = arg_top_level_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_content_type = arg_content_type.into_raw();
let arg_value = arg_value.into_raw();
f(
arg_self_,
arg_requesting_url,
arg_top_level_url,
arg_content_type,
arg_value,
);
}
}
}
fn set_chrome_color_scheme(&self, variant: ColorVariant, user_color: u32) {
unsafe {
if let Some(f) = self.0.set_chrome_color_scheme {
let (arg_variant, arg_user_color) = (variant, user_color);
let arg_self_ = self.into_raw();
let arg_variant = arg_variant.into_raw();
f(arg_self_, arg_variant, arg_user_color);
}
}
}
fn chrome_color_scheme_mode(&self) -> ColorVariant {
unsafe {
self.0
.get_chrome_color_scheme_mode
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn chrome_color_scheme_color(&self) -> cef_color_t {
unsafe {
self.0
.get_chrome_color_scheme_color
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn chrome_color_scheme_variant(&self) -> ColorVariant {
unsafe {
self.0
.get_chrome_color_scheme_variant
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_setting_observer(&self, observer: Option<&mut SettingObserver>) -> Option<Registration> {
unsafe {
self.0
.add_setting_observer
.map(|f| {
let arg_observer = observer;
let arg_self_ = self.into_raw();
let arg_observer = arg_observer
.map(|arg| {
arg.add_ref();
ImplSettingObserver::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_observer);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn clear_http_cache(&self, callback: Option<&mut CompletionCallback>) {
unsafe {
if let Some(f) = self.0.clear_http_cache {
let arg_callback = callback;
let arg_self_ = self.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_callback);
}
}
}
fn get_raw(&self) -> *mut _cef_request_context_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_request_context_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RequestContext {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_request_context_t> for &RequestContext {
fn into_raw(self) -> *mut _cef_request_context_t {
ImplRequestContext::get_raw(self)
}
}
impl ConvertParam<*mut _cef_request_context_t> for &mut RequestContext {
fn into_raw(self) -> *mut _cef_request_context_t {
ImplRequestContext::get_raw(self)
}
}
impl ConvertReturnValue<RequestContext> for *mut _cef_request_context_t {
fn wrap_result(self) -> RequestContext {
RequestContext(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RequestContext> for *mut _cef_request_context_t {
fn from(value: RequestContext) -> Self {
let object = ImplRequestContext::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_browser_t`] for more documentation.
#[derive(Clone)]
pub struct Browser(RefGuard<_cef_browser_t>);
pub trait ImplBrowser: Clone + Sized + Rc {
#[doc = "See [`_cef_browser_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::get_host`] for more documentation."]
fn host(&self) -> Option<BrowserHost>;
#[doc = "See [`_cef_browser_t::can_go_back`] for more documentation."]
fn can_go_back(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::go_back`] for more documentation."]
fn go_back(&self);
#[doc = "See [`_cef_browser_t::can_go_forward`] for more documentation."]
fn can_go_forward(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::go_forward`] for more documentation."]
fn go_forward(&self);
#[doc = "See [`_cef_browser_t::is_loading`] for more documentation."]
fn is_loading(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::reload`] for more documentation."]
fn reload(&self);
#[doc = "See [`_cef_browser_t::reload_ignore_cache`] for more documentation."]
fn reload_ignore_cache(&self);
#[doc = "See [`_cef_browser_t::stop_load`] for more documentation."]
fn stop_load(&self);
#[doc = "See [`_cef_browser_t::get_identifier`] for more documentation."]
fn identifier(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut Browser>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::is_popup`] for more documentation."]
fn is_popup(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::has_document`] for more documentation."]
fn has_document(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_t::get_main_frame`] for more documentation."]
fn main_frame(&self) -> Option<Frame>;
#[doc = "See [`_cef_browser_t::get_focused_frame`] for more documentation."]
fn focused_frame(&self) -> Option<Frame>;
#[doc = "See [`_cef_browser_t::get_frame_by_identifier`] for more documentation."]
fn frame_by_identifier(&self, identifier: Option<&CefString>) -> Option<Frame>;
#[doc = "See [`_cef_browser_t::get_frame_by_name`] for more documentation."]
fn frame_by_name(&self, name: Option<&CefString>) -> Option<Frame>;
#[doc = "See [`_cef_browser_t::get_frame_count`] for more documentation."]
fn frame_count(&self) -> usize;
#[doc = "See [`_cef_browser_t::get_frame_identifiers`] for more documentation."]
fn frame_identifiers(&self, identifiers: Option<&mut CefStringList>);
#[doc = "See [`_cef_browser_t::get_frame_names`] for more documentation."]
fn frame_names(&self, names: Option<&mut CefStringList>);
fn get_raw(&self) -> *mut _cef_browser_t;
}
impl ImplBrowser for Browser {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn host(&self) -> Option<BrowserHost> {
unsafe {
self.0
.get_host
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn can_go_back(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_go_back
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn go_back(&self) {
unsafe {
if let Some(f) = self.0.go_back {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn can_go_forward(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_go_forward
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn go_forward(&self) {
unsafe {
if let Some(f) = self.0.go_forward {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn is_loading(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_loading
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn reload(&self) {
unsafe {
if let Some(f) = self.0.reload {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn reload_ignore_cache(&self) {
unsafe {
if let Some(f) = self.0.reload_ignore_cache {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn stop_load(&self) {
unsafe {
if let Some(f) = self.0.stop_load {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn identifier(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_identifier
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut Browser>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_popup(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_popup
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_document(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_document
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn main_frame(&self) -> Option<Frame> {
unsafe {
self.0
.get_main_frame
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn focused_frame(&self) -> Option<Frame> {
unsafe {
self.0
.get_focused_frame
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn frame_by_identifier(&self, identifier: Option<&CefString>) -> Option<Frame> {
unsafe {
self.0
.get_frame_by_identifier
.map(|f| {
let arg_identifier = identifier;
let arg_self_ = self.into_raw();
let arg_identifier = arg_identifier
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_identifier);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn frame_by_name(&self, name: Option<&CefString>) -> Option<Frame> {
unsafe {
self.0
.get_frame_by_name
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn frame_count(&self) -> usize {
unsafe {
self.0
.get_frame_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn frame_identifiers(&self, identifiers: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.get_frame_identifiers {
let arg_identifiers = identifiers;
let arg_self_ = self.into_raw();
let arg_identifiers = arg_identifiers
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_identifiers);
}
}
}
fn frame_names(&self, names: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.get_frame_names {
let arg_names = names;
let arg_self_ = self.into_raw();
let arg_names = arg_names
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_names);
}
}
}
fn get_raw(&self) -> *mut _cef_browser_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_browser_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Browser {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_browser_t> for &Browser {
fn into_raw(self) -> *mut _cef_browser_t {
ImplBrowser::get_raw(self)
}
}
impl ConvertParam<*mut _cef_browser_t> for &mut Browser {
fn into_raw(self) -> *mut _cef_browser_t {
ImplBrowser::get_raw(self)
}
}
impl ConvertReturnValue<Browser> for *mut _cef_browser_t {
fn wrap_result(self) -> Browser {
Browser(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Browser> for *mut _cef_browser_t {
fn from(value: Browser) -> Self {
let object = ImplBrowser::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_run_file_dialog_callback_t`] for more documentation.
#[derive(Clone)]
pub struct RunFileDialogCallback(RefGuard<_cef_run_file_dialog_callback_t>);
impl RunFileDialogCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapRunFileDialogCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplRunFileDialogCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapRunFileDialogCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_run_file_dialog_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapRunFileDialogCallback: ImplRunFileDialogCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_run_file_dialog_callback_t, Self>);
}
pub trait ImplRunFileDialogCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_run_file_dialog_callback_t::on_file_dialog_dismissed`] for more documentation."]
fn on_file_dialog_dismissed(&self, file_paths: Option<&mut CefStringList>) {}
fn init_methods(object: &mut _cef_run_file_dialog_callback_t) {
impl_cef_run_file_dialog_callback_t::init_methods::<Self, _cef_run_file_dialog_callback_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_run_file_dialog_callback_t;
}
#[doc = "Implement the [`WrapRunFileDialogCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl RunFileDialogCallback` block you can override default\nmethods implemented by the [`ImplRunFileDialogCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_run_file_dialog_callback! {\n struct MyRunFileDialogCallback {\n payload: String,\n }\n\n impl RunFileDialogCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> RunFileDialogCallback {\n MyRunFileDialogCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_run_file_dialog_callback { ($ vis : vis struct $ name : ident ; impl RunFileDialogCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_run_file_dialog_callback ! { $ vis struct $ name { } impl RunFileDialogCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl RunFileDialogCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_run_file_dialog_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> RunFileDialogCallback { RunFileDialogCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapRunFileDialogCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_run_file_dialog_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplRunFileDialogCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_run_file_dialog_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_run_file_dialog_callback_t {
use super::*;
pub fn init_methods<I: ImplRunFileDialogCallback, R: Rc>(
object: &mut _cef_run_file_dialog_callback_t,
) {
object.on_file_dialog_dismissed = Some(on_file_dialog_dismissed::<I, R>);
}
extern "C" fn on_file_dialog_dismissed<I: ImplRunFileDialogCallback, R: Rc>(
self_: *mut _cef_run_file_dialog_callback_t,
file_paths: *mut _cef_string_list_t,
) {
let (arg_self_, arg_file_paths) = (self_, file_paths);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_file_paths = if arg_file_paths.is_null() {
None
} else {
Some(arg_file_paths.into())
};
let arg_file_paths = arg_file_paths.as_mut();
ImplRunFileDialogCallback::on_file_dialog_dismissed(&arg_self_.interface, arg_file_paths)
}
}
impl ImplRunFileDialogCallback for RunFileDialogCallback {
fn on_file_dialog_dismissed(&self, file_paths: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.on_file_dialog_dismissed {
let arg_file_paths = file_paths;
let arg_self_ = self.into_raw();
let arg_file_paths = arg_file_paths
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_file_paths);
}
}
}
fn get_raw(&self) -> *mut _cef_run_file_dialog_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_run_file_dialog_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RunFileDialogCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_run_file_dialog_callback_t> for &RunFileDialogCallback {
fn into_raw(self) -> *mut _cef_run_file_dialog_callback_t {
ImplRunFileDialogCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_run_file_dialog_callback_t> for &mut RunFileDialogCallback {
fn into_raw(self) -> *mut _cef_run_file_dialog_callback_t {
ImplRunFileDialogCallback::get_raw(self)
}
}
impl ConvertReturnValue<RunFileDialogCallback> for *mut _cef_run_file_dialog_callback_t {
fn wrap_result(self) -> RunFileDialogCallback {
RunFileDialogCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RunFileDialogCallback> for *mut _cef_run_file_dialog_callback_t {
fn from(value: RunFileDialogCallback) -> Self {
let object = ImplRunFileDialogCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_navigation_entry_visitor_t`] for more documentation.
#[derive(Clone)]
pub struct NavigationEntryVisitor(RefGuard<_cef_navigation_entry_visitor_t>);
impl NavigationEntryVisitor {
pub fn new<T>(interface: T) -> Self
where
T: WrapNavigationEntryVisitor,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplNavigationEntryVisitor>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapNavigationEntryVisitor>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_navigation_entry_visitor_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapNavigationEntryVisitor: ImplNavigationEntryVisitor {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_navigation_entry_visitor_t, Self>);
}
pub trait ImplNavigationEntryVisitor: Clone + Sized + Rc {
#[doc = "See [`_cef_navigation_entry_visitor_t::visit`] for more documentation."]
fn visit(
&self,
entry: Option<&mut NavigationEntry>,
current: ::std::os::raw::c_int,
index: ::std::os::raw::c_int,
total: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_navigation_entry_visitor_t) {
impl_cef_navigation_entry_visitor_t::init_methods::<Self, _cef_navigation_entry_visitor_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_navigation_entry_visitor_t;
}
#[doc = "Implement the [`WrapNavigationEntryVisitor`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl NavigationEntryVisitor` block you can override default\nmethods implemented by the [`ImplNavigationEntryVisitor`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_navigation_entry_visitor! {\n struct MyNavigationEntryVisitor {\n payload: String,\n }\n\n impl NavigationEntryVisitor {\n // ...\n }\n}\n\nfn make_my_struct() -> NavigationEntryVisitor {\n MyNavigationEntryVisitor::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_navigation_entry_visitor { ($ vis : vis struct $ name : ident ; impl NavigationEntryVisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_navigation_entry_visitor ! { $ vis struct $ name { } impl NavigationEntryVisitor { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl NavigationEntryVisitor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_navigation_entry_visitor_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> NavigationEntryVisitor { NavigationEntryVisitor :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapNavigationEntryVisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_navigation_entry_visitor_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplNavigationEntryVisitor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_navigation_entry_visitor_t { self . cef_object . cast () } } } ; }
mod impl_cef_navigation_entry_visitor_t {
use super::*;
pub fn init_methods<I: ImplNavigationEntryVisitor, R: Rc>(
object: &mut _cef_navigation_entry_visitor_t,
) {
object.visit = Some(visit::<I, R>);
}
extern "C" fn visit<I: ImplNavigationEntryVisitor, R: Rc>(
self_: *mut _cef_navigation_entry_visitor_t,
entry: *mut _cef_navigation_entry_t,
current: ::std::os::raw::c_int,
index: ::std::os::raw::c_int,
total: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_entry, arg_current, arg_index, arg_total) =
(self_, entry, current, index, total);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_entry = unsafe { arg_entry.as_mut() }
.map(|arg| NavigationEntry(unsafe { RefGuard::from_raw(arg) }));
let arg_entry = arg_entry.as_mut();
let arg_current = arg_current.into_raw();
let arg_index = arg_index.into_raw();
let arg_total = arg_total.into_raw();
ImplNavigationEntryVisitor::visit(
&arg_self_.interface,
arg_entry,
arg_current,
arg_index,
arg_total,
)
}
}
impl ImplNavigationEntryVisitor for NavigationEntryVisitor {
fn visit(
&self,
entry: Option<&mut NavigationEntry>,
current: ::std::os::raw::c_int,
index: ::std::os::raw::c_int,
total: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.visit
.map(|f| {
let (arg_entry, arg_current, arg_index, arg_total) =
(entry, current, index, total);
let arg_self_ = self.into_raw();
let arg_entry = arg_entry
.map(|arg| {
arg.add_ref();
ImplNavigationEntry::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_entry, arg_current, arg_index, arg_total);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_navigation_entry_visitor_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_navigation_entry_visitor_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for NavigationEntryVisitor {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_navigation_entry_visitor_t> for &NavigationEntryVisitor {
fn into_raw(self) -> *mut _cef_navigation_entry_visitor_t {
ImplNavigationEntryVisitor::get_raw(self)
}
}
impl ConvertParam<*mut _cef_navigation_entry_visitor_t> for &mut NavigationEntryVisitor {
fn into_raw(self) -> *mut _cef_navigation_entry_visitor_t {
ImplNavigationEntryVisitor::get_raw(self)
}
}
impl ConvertReturnValue<NavigationEntryVisitor> for *mut _cef_navigation_entry_visitor_t {
fn wrap_result(self) -> NavigationEntryVisitor {
NavigationEntryVisitor(unsafe { RefGuard::from_raw(self) })
}
}
impl From<NavigationEntryVisitor> for *mut _cef_navigation_entry_visitor_t {
fn from(value: NavigationEntryVisitor) -> Self {
let object = ImplNavigationEntryVisitor::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_pdf_print_callback_t`] for more documentation.
#[derive(Clone)]
pub struct PdfPrintCallback(RefGuard<_cef_pdf_print_callback_t>);
impl PdfPrintCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapPdfPrintCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplPdfPrintCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapPdfPrintCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_pdf_print_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapPdfPrintCallback: ImplPdfPrintCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_pdf_print_callback_t, Self>);
}
pub trait ImplPdfPrintCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_pdf_print_callback_t::on_pdf_print_finished`] for more documentation."]
fn on_pdf_print_finished(&self, path: Option<&CefString>, ok: ::std::os::raw::c_int) {}
fn init_methods(object: &mut _cef_pdf_print_callback_t) {
impl_cef_pdf_print_callback_t::init_methods::<Self, _cef_pdf_print_callback_t>(object);
}
fn get_raw(&self) -> *mut _cef_pdf_print_callback_t;
}
#[doc = "Implement the [`WrapPdfPrintCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl PdfPrintCallback` block you can override default\nmethods implemented by the [`ImplPdfPrintCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_pdf_print_callback! {\n struct MyPdfPrintCallback {\n payload: String,\n }\n\n impl PdfPrintCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> PdfPrintCallback {\n MyPdfPrintCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_pdf_print_callback { ($ vis : vis struct $ name : ident ; impl PdfPrintCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_pdf_print_callback ! { $ vis struct $ name { } impl PdfPrintCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl PdfPrintCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_pdf_print_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> PdfPrintCallback { PdfPrintCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapPdfPrintCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_pdf_print_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplPdfPrintCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_pdf_print_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_pdf_print_callback_t {
use super::*;
pub fn init_methods<I: ImplPdfPrintCallback, R: Rc>(object: &mut _cef_pdf_print_callback_t) {
object.on_pdf_print_finished = Some(on_pdf_print_finished::<I, R>);
}
extern "C" fn on_pdf_print_finished<I: ImplPdfPrintCallback, R: Rc>(
self_: *mut _cef_pdf_print_callback_t,
path: *const cef_string_t,
ok: ::std::os::raw::c_int,
) {
let (arg_self_, arg_path, arg_ok) = (self_, path, ok);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_path = if arg_path.is_null() {
None
} else {
Some(arg_path.into())
};
let arg_path = arg_path.as_ref();
let arg_ok = arg_ok.into_raw();
ImplPdfPrintCallback::on_pdf_print_finished(&arg_self_.interface, arg_path, arg_ok)
}
}
impl ImplPdfPrintCallback for PdfPrintCallback {
fn on_pdf_print_finished(&self, path: Option<&CefString>, ok: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.on_pdf_print_finished {
let (arg_path, arg_ok) = (path, ok);
let arg_self_ = self.into_raw();
let arg_path = arg_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_path, arg_ok);
}
}
}
fn get_raw(&self) -> *mut _cef_pdf_print_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_pdf_print_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PdfPrintCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_pdf_print_callback_t> for &PdfPrintCallback {
fn into_raw(self) -> *mut _cef_pdf_print_callback_t {
ImplPdfPrintCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_pdf_print_callback_t> for &mut PdfPrintCallback {
fn into_raw(self) -> *mut _cef_pdf_print_callback_t {
ImplPdfPrintCallback::get_raw(self)
}
}
impl ConvertReturnValue<PdfPrintCallback> for *mut _cef_pdf_print_callback_t {
fn wrap_result(self) -> PdfPrintCallback {
PdfPrintCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PdfPrintCallback> for *mut _cef_pdf_print_callback_t {
fn from(value: PdfPrintCallback) -> Self {
let object = ImplPdfPrintCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_download_image_callback_t`] for more documentation.
#[derive(Clone)]
pub struct DownloadImageCallback(RefGuard<_cef_download_image_callback_t>);
impl DownloadImageCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapDownloadImageCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDownloadImageCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDownloadImageCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_download_image_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDownloadImageCallback: ImplDownloadImageCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_download_image_callback_t, Self>);
}
pub trait ImplDownloadImageCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_download_image_callback_t::on_download_image_finished`] for more documentation."]
fn on_download_image_finished(
&self,
image_url: Option<&CefString>,
http_status_code: ::std::os::raw::c_int,
image: Option<&mut Image>,
) {
}
fn init_methods(object: &mut _cef_download_image_callback_t) {
impl_cef_download_image_callback_t::init_methods::<Self, _cef_download_image_callback_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_download_image_callback_t;
}
#[doc = "Implement the [`WrapDownloadImageCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl DownloadImageCallback` block you can override default\nmethods implemented by the [`ImplDownloadImageCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_download_image_callback! {\n struct MyDownloadImageCallback {\n payload: String,\n }\n\n impl DownloadImageCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> DownloadImageCallback {\n MyDownloadImageCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_download_image_callback { ($ vis : vis struct $ name : ident ; impl DownloadImageCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_download_image_callback ! { $ vis struct $ name { } impl DownloadImageCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl DownloadImageCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_download_image_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> DownloadImageCallback { DownloadImageCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDownloadImageCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_download_image_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDownloadImageCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_download_image_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_download_image_callback_t {
use super::*;
pub fn init_methods<I: ImplDownloadImageCallback, R: Rc>(
object: &mut _cef_download_image_callback_t,
) {
object.on_download_image_finished = Some(on_download_image_finished::<I, R>);
}
extern "C" fn on_download_image_finished<I: ImplDownloadImageCallback, R: Rc>(
self_: *mut _cef_download_image_callback_t,
image_url: *const cef_string_t,
http_status_code: ::std::os::raw::c_int,
image: *mut _cef_image_t,
) {
let (arg_self_, arg_image_url, arg_http_status_code, arg_image) =
(self_, image_url, http_status_code, image);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_image_url = if arg_image_url.is_null() {
None
} else {
Some(arg_image_url.into())
};
let arg_image_url = arg_image_url.as_ref();
let arg_http_status_code = arg_http_status_code.into_raw();
let mut arg_image =
unsafe { arg_image.as_mut() }.map(|arg| Image(unsafe { RefGuard::from_raw(arg) }));
let arg_image = arg_image.as_mut();
ImplDownloadImageCallback::on_download_image_finished(
&arg_self_.interface,
arg_image_url,
arg_http_status_code,
arg_image,
)
}
}
impl ImplDownloadImageCallback for DownloadImageCallback {
fn on_download_image_finished(
&self,
image_url: Option<&CefString>,
http_status_code: ::std::os::raw::c_int,
image: Option<&mut Image>,
) {
unsafe {
if let Some(f) = self.0.on_download_image_finished {
let (arg_image_url, arg_http_status_code, arg_image) =
(image_url, http_status_code, image);
let arg_self_ = self.into_raw();
let arg_image_url = arg_image_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_image = arg_image
.map(|arg| {
arg.add_ref();
ImplImage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_image_url, arg_http_status_code, arg_image);
}
}
}
fn get_raw(&self) -> *mut _cef_download_image_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_download_image_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DownloadImageCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_download_image_callback_t> for &DownloadImageCallback {
fn into_raw(self) -> *mut _cef_download_image_callback_t {
ImplDownloadImageCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_download_image_callback_t> for &mut DownloadImageCallback {
fn into_raw(self) -> *mut _cef_download_image_callback_t {
ImplDownloadImageCallback::get_raw(self)
}
}
impl ConvertReturnValue<DownloadImageCallback> for *mut _cef_download_image_callback_t {
fn wrap_result(self) -> DownloadImageCallback {
DownloadImageCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DownloadImageCallback> for *mut _cef_download_image_callback_t {
fn from(value: DownloadImageCallback) -> Self {
let object = ImplDownloadImageCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_browser_host_t`] for more documentation.
#[derive(Clone)]
pub struct BrowserHost(RefGuard<_cef_browser_host_t>);
pub trait ImplBrowserHost: Clone + Sized + Rc {
#[doc = "See [`_cef_browser_host_t::get_browser`] for more documentation."]
fn browser(&self) -> Option<Browser>;
#[doc = "See [`_cef_browser_host_t::close_browser`] for more documentation."]
fn close_browser(&self, force_close: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::try_close_browser`] for more documentation."]
fn try_close_browser(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::is_ready_to_be_closed`] for more documentation."]
fn is_ready_to_be_closed(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::set_focus`] for more documentation."]
fn set_focus(&self, focus: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::get_window_handle`] for more documentation."]
fn window_handle(&self) -> cef_window_handle_t;
#[doc = "See [`_cef_browser_host_t::get_opener_window_handle`] for more documentation."]
fn opener_window_handle(&self) -> cef_window_handle_t;
#[doc = "See [`_cef_browser_host_t::get_opener_identifier`] for more documentation."]
fn opener_identifier(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::has_view`] for more documentation."]
fn has_view(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::get_client`] for more documentation."]
fn client(&self) -> Option<Client>;
#[doc = "See [`_cef_browser_host_t::get_request_context`] for more documentation."]
fn request_context(&self) -> Option<RequestContext>;
#[doc = "See [`_cef_browser_host_t::can_zoom`] for more documentation."]
fn can_zoom(&self, command: ZoomCommand) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::zoom`] for more documentation."]
fn zoom(&self, command: ZoomCommand);
#[doc = "See [`_cef_browser_host_t::get_default_zoom_level`] for more documentation."]
fn default_zoom_level(&self) -> f64;
#[doc = "See [`_cef_browser_host_t::get_zoom_level`] for more documentation."]
fn zoom_level(&self) -> f64;
#[doc = "See [`_cef_browser_host_t::set_zoom_level`] for more documentation."]
fn set_zoom_level(&self, zoom_level: f64);
#[doc = "See [`_cef_browser_host_t::run_file_dialog`] for more documentation."]
fn run_file_dialog(
&self,
mode: FileDialogMode,
title: Option<&CefString>,
default_file_path: Option<&CefString>,
accept_filters: Option<&mut CefStringList>,
callback: Option<&mut RunFileDialogCallback>,
);
#[doc = "See [`_cef_browser_host_t::start_download`] for more documentation."]
fn start_download(&self, url: Option<&CefString>);
#[doc = "See [`_cef_browser_host_t::download_image`] for more documentation."]
fn download_image(
&self,
image_url: Option<&CefString>,
is_favicon: ::std::os::raw::c_int,
max_image_size: u32,
bypass_cache: ::std::os::raw::c_int,
callback: Option<&mut DownloadImageCallback>,
);
#[doc = "See [`_cef_browser_host_t::print`] for more documentation."]
fn print(&self);
#[doc = "See [`_cef_browser_host_t::print_to_pdf`] for more documentation."]
fn print_to_pdf(
&self,
path: Option<&CefString>,
settings: Option<&PdfPrintSettings>,
callback: Option<&mut PdfPrintCallback>,
);
#[doc = "See [`_cef_browser_host_t::find`] for more documentation."]
fn find(
&self,
search_text: Option<&CefString>,
forward: ::std::os::raw::c_int,
match_case: ::std::os::raw::c_int,
find_next: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_browser_host_t::stop_finding`] for more documentation."]
fn stop_finding(&self, clear_selection: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::show_dev_tools`] for more documentation."]
fn show_dev_tools(
&self,
window_info: Option<&WindowInfo>,
client: Option<&mut Client>,
settings: Option<&BrowserSettings>,
inspect_element_at: Option<&Point>,
);
#[doc = "See [`_cef_browser_host_t::close_dev_tools`] for more documentation."]
fn close_dev_tools(&self);
#[doc = "See [`_cef_browser_host_t::has_dev_tools`] for more documentation."]
fn has_dev_tools(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::send_dev_tools_message`] for more documentation."]
fn send_dev_tools_message(&self, message: Option<&[u8]>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::execute_dev_tools_method`] for more documentation."]
fn execute_dev_tools_method(
&self,
message_id: ::std::os::raw::c_int,
method: Option<&CefString>,
params: Option<&mut DictionaryValue>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::add_dev_tools_message_observer`] for more documentation."]
fn add_dev_tools_message_observer(
&self,
observer: Option<&mut DevToolsMessageObserver>,
) -> Option<Registration>;
#[doc = "See [`_cef_browser_host_t::get_navigation_entries`] for more documentation."]
fn navigation_entries(
&self,
visitor: Option<&mut NavigationEntryVisitor>,
current_only: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_browser_host_t::replace_misspelling`] for more documentation."]
fn replace_misspelling(&self, word: Option<&CefString>);
#[doc = "See [`_cef_browser_host_t::add_word_to_dictionary`] for more documentation."]
fn add_word_to_dictionary(&self, word: Option<&CefString>);
#[doc = "See [`_cef_browser_host_t::is_window_rendering_disabled`] for more documentation."]
fn is_window_rendering_disabled(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::was_resized`] for more documentation."]
fn was_resized(&self);
#[doc = "See [`_cef_browser_host_t::was_hidden`] for more documentation."]
fn was_hidden(&self, hidden: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::notify_screen_info_changed`] for more documentation."]
fn notify_screen_info_changed(&self);
#[doc = "See [`_cef_browser_host_t::invalidate`] for more documentation."]
fn invalidate(&self, type_: PaintElementType);
#[doc = "See [`_cef_browser_host_t::send_external_begin_frame`] for more documentation."]
fn send_external_begin_frame(&self);
#[doc = "See [`_cef_browser_host_t::send_key_event`] for more documentation."]
fn send_key_event(&self, event: Option<&KeyEvent>);
#[doc = "See [`_cef_browser_host_t::send_mouse_click_event`] for more documentation."]
fn send_mouse_click_event(
&self,
event: Option<&MouseEvent>,
type_: MouseButtonType,
mouse_up: ::std::os::raw::c_int,
click_count: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_browser_host_t::send_mouse_move_event`] for more documentation."]
fn send_mouse_move_event(&self, event: Option<&MouseEvent>, mouse_leave: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::send_mouse_wheel_event`] for more documentation."]
fn send_mouse_wheel_event(
&self,
event: Option<&MouseEvent>,
delta_x: ::std::os::raw::c_int,
delta_y: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_browser_host_t::send_touch_event`] for more documentation."]
fn send_touch_event(&self, event: Option<&TouchEvent>);
#[doc = "See [`_cef_browser_host_t::send_capture_lost_event`] for more documentation."]
fn send_capture_lost_event(&self);
#[doc = "See [`_cef_browser_host_t::notify_move_or_resize_started`] for more documentation."]
fn notify_move_or_resize_started(&self);
#[doc = "See [`_cef_browser_host_t::get_windowless_frame_rate`] for more documentation."]
fn windowless_frame_rate(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::set_windowless_frame_rate`] for more documentation."]
fn set_windowless_frame_rate(&self, frame_rate: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::ime_set_composition`] for more documentation."]
fn ime_set_composition(
&self,
text: Option<&CefString>,
underlines: Option<&[CompositionUnderline]>,
replacement_range: Option<&Range>,
selection_range: Option<&Range>,
);
#[doc = "See [`_cef_browser_host_t::ime_commit_text`] for more documentation."]
fn ime_commit_text(
&self,
text: Option<&CefString>,
replacement_range: Option<&Range>,
relative_cursor_pos: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_browser_host_t::ime_finish_composing_text`] for more documentation."]
fn ime_finish_composing_text(&self, keep_selection: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::ime_cancel_composition`] for more documentation."]
fn ime_cancel_composition(&self);
#[doc = "See [`_cef_browser_host_t::drag_target_drag_enter`] for more documentation."]
fn drag_target_drag_enter(
&self,
drag_data: Option<&mut DragData>,
event: Option<&MouseEvent>,
allowed_ops: DragOperationsMask,
);
#[doc = "See [`_cef_browser_host_t::drag_target_drag_over`] for more documentation."]
fn drag_target_drag_over(&self, event: Option<&MouseEvent>, allowed_ops: DragOperationsMask);
#[doc = "See [`_cef_browser_host_t::drag_target_drag_leave`] for more documentation."]
fn drag_target_drag_leave(&self);
#[doc = "See [`_cef_browser_host_t::drag_target_drop`] for more documentation."]
fn drag_target_drop(&self, event: Option<&MouseEvent>);
#[doc = "See [`_cef_browser_host_t::drag_source_ended_at`] for more documentation."]
fn drag_source_ended_at(
&self,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
op: DragOperationsMask,
);
#[doc = "See [`_cef_browser_host_t::drag_source_system_drag_ended`] for more documentation."]
fn drag_source_system_drag_ended(&self);
#[doc = "See [`_cef_browser_host_t::get_visible_navigation_entry`] for more documentation."]
fn visible_navigation_entry(&self) -> Option<NavigationEntry>;
#[doc = "See [`_cef_browser_host_t::set_accessibility_state`] for more documentation."]
fn set_accessibility_state(&self, accessibility_state: State);
#[doc = "See [`_cef_browser_host_t::set_auto_resize_enabled`] for more documentation."]
fn set_auto_resize_enabled(
&self,
enabled: ::std::os::raw::c_int,
min_size: Option<&Size>,
max_size: Option<&Size>,
);
#[doc = "See [`_cef_browser_host_t::set_audio_muted`] for more documentation."]
fn set_audio_muted(&self, mute: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::is_audio_muted`] for more documentation."]
fn is_audio_muted(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::is_fullscreen`] for more documentation."]
fn is_fullscreen(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::exit_fullscreen`] for more documentation."]
fn exit_fullscreen(&self, will_cause_resize: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_host_t::can_execute_chrome_command`] for more documentation."]
fn can_execute_chrome_command(
&self,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::execute_chrome_command`] for more documentation."]
fn execute_chrome_command(
&self,
command_id: ::std::os::raw::c_int,
disposition: WindowOpenDisposition,
);
#[doc = "See [`_cef_browser_host_t::is_render_process_unresponsive`] for more documentation."]
fn is_render_process_unresponsive(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_browser_host_t::get_runtime_style`] for more documentation."]
fn runtime_style(&self) -> RuntimeStyle;
#[doc = "See [`_cef_browser_host_t::set_ax_viewport_collapse`] for more documentation."]
fn set_ax_viewport_collapse(&self, enabled: ::std::os::raw::c_int);
fn get_raw(&self) -> *mut _cef_browser_host_t;
}
impl ImplBrowserHost for BrowserHost {
fn browser(&self) -> Option<Browser> {
unsafe {
self.0
.get_browser
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn close_browser(&self, force_close: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.close_browser {
let arg_force_close = force_close;
let arg_self_ = self.into_raw();
f(arg_self_, arg_force_close);
}
}
}
fn try_close_browser(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.try_close_browser
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_ready_to_be_closed(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_ready_to_be_closed
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_focus(&self, focus: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_focus {
let arg_focus = focus;
let arg_self_ = self.into_raw();
f(arg_self_, arg_focus);
}
}
}
fn window_handle(&self) -> cef_window_handle_t {
unsafe {
self.0
.get_window_handle
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn opener_window_handle(&self) -> cef_window_handle_t {
unsafe {
self.0
.get_opener_window_handle
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn opener_identifier(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_opener_identifier
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_view(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_view
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn client(&self) -> Option<Client> {
unsafe {
self.0
.get_client
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn request_context(&self) -> Option<RequestContext> {
unsafe {
self.0
.get_request_context
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn can_zoom(&self, command: ZoomCommand) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_zoom
.map(|f| {
let arg_command = command;
let arg_self_ = self.into_raw();
let arg_command = arg_command.into_raw();
let result = f(arg_self_, arg_command);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn zoom(&self, command: ZoomCommand) {
unsafe {
if let Some(f) = self.0.zoom {
let arg_command = command;
let arg_self_ = self.into_raw();
let arg_command = arg_command.into_raw();
f(arg_self_, arg_command);
}
}
}
fn default_zoom_level(&self) -> f64 {
unsafe {
self.0
.get_default_zoom_level
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn zoom_level(&self) -> f64 {
unsafe {
self.0
.get_zoom_level
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_zoom_level(&self, zoom_level: f64) {
unsafe {
if let Some(f) = self.0.set_zoom_level {
let arg_zoom_level = zoom_level;
let arg_self_ = self.into_raw();
f(arg_self_, arg_zoom_level);
}
}
}
fn run_file_dialog(
&self,
mode: FileDialogMode,
title: Option<&CefString>,
default_file_path: Option<&CefString>,
accept_filters: Option<&mut CefStringList>,
callback: Option<&mut RunFileDialogCallback>,
) {
unsafe {
if let Some(f) = self.0.run_file_dialog {
let (arg_mode, arg_title, arg_default_file_path, arg_accept_filters, arg_callback) =
(mode, title, default_file_path, accept_filters, callback);
let arg_self_ = self.into_raw();
let arg_mode = arg_mode.into_raw();
let arg_title = arg_title
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_default_file_path = arg_default_file_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_accept_filters = arg_accept_filters
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplRunFileDialogCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_mode,
arg_title,
arg_default_file_path,
arg_accept_filters,
arg_callback,
);
}
}
}
fn start_download(&self, url: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.start_download {
let arg_url = url;
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_url);
}
}
}
fn download_image(
&self,
image_url: Option<&CefString>,
is_favicon: ::std::os::raw::c_int,
max_image_size: u32,
bypass_cache: ::std::os::raw::c_int,
callback: Option<&mut DownloadImageCallback>,
) {
unsafe {
if let Some(f) = self.0.download_image {
let (
arg_image_url,
arg_is_favicon,
arg_max_image_size,
arg_bypass_cache,
arg_callback,
) = (
image_url,
is_favicon,
max_image_size,
bypass_cache,
callback,
);
let arg_self_ = self.into_raw();
let arg_image_url = arg_image_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplDownloadImageCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_image_url,
arg_is_favicon,
arg_max_image_size,
arg_bypass_cache,
arg_callback,
);
}
}
}
fn print(&self) {
unsafe {
if let Some(f) = self.0.print {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn print_to_pdf(
&self,
path: Option<&CefString>,
settings: Option<&PdfPrintSettings>,
callback: Option<&mut PdfPrintCallback>,
) {
unsafe {
if let Some(f) = self.0.print_to_pdf {
let (arg_path, arg_settings, arg_callback) = (path, settings, callback);
let arg_self_ = self.into_raw();
let arg_path = arg_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplPdfPrintCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_path, arg_settings, arg_callback);
}
}
}
fn find(
&self,
search_text: Option<&CefString>,
forward: ::std::os::raw::c_int,
match_case: ::std::os::raw::c_int,
find_next: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.find {
let (arg_search_text, arg_forward, arg_match_case, arg_find_next) =
(search_text, forward, match_case, find_next);
let arg_self_ = self.into_raw();
let arg_search_text = arg_search_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_search_text,
arg_forward,
arg_match_case,
arg_find_next,
);
}
}
}
fn stop_finding(&self, clear_selection: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.stop_finding {
let arg_clear_selection = clear_selection;
let arg_self_ = self.into_raw();
f(arg_self_, arg_clear_selection);
}
}
}
fn show_dev_tools(
&self,
window_info: Option<&WindowInfo>,
client: Option<&mut Client>,
settings: Option<&BrowserSettings>,
inspect_element_at: Option<&Point>,
) {
unsafe {
if let Some(f) = self.0.show_dev_tools {
let (arg_window_info, arg_client, arg_settings, arg_inspect_element_at) =
(window_info, client, settings, inspect_element_at);
let arg_self_ = self.into_raw();
let arg_window_info = arg_window_info.cloned().map(|arg| arg.into());
let arg_window_info = arg_window_info
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_client = arg_client
.map(|arg| {
arg.add_ref();
ImplClient::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_inspect_element_at = arg_inspect_element_at.cloned().map(|arg| arg.into());
let arg_inspect_element_at = arg_inspect_element_at
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_window_info,
arg_client,
arg_settings,
arg_inspect_element_at,
);
}
}
}
fn close_dev_tools(&self) {
unsafe {
if let Some(f) = self.0.close_dev_tools {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn has_dev_tools(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_dev_tools
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn send_dev_tools_message(&self, message: Option<&[u8]>) -> ::std::os::raw::c_int {
unsafe {
self.0
.send_dev_tools_message
.map(|f| {
let arg_message = message;
let arg_self_ = self.into_raw();
let arg_message_size = arg_message
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_message = arg_message
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_message, arg_message_size);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn execute_dev_tools_method(
&self,
message_id: ::std::os::raw::c_int,
method: Option<&CefString>,
params: Option<&mut DictionaryValue>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.execute_dev_tools_method
.map(|f| {
let (arg_message_id, arg_method, arg_params) = (message_id, method, params);
let arg_self_ = self.into_raw();
let arg_method = arg_method
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_params = arg_params
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_message_id, arg_method, arg_params);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_dev_tools_message_observer(
&self,
observer: Option<&mut DevToolsMessageObserver>,
) -> Option<Registration> {
unsafe {
self.0
.add_dev_tools_message_observer
.map(|f| {
let arg_observer = observer;
let arg_self_ = self.into_raw();
let arg_observer = arg_observer
.map(|arg| {
arg.add_ref();
ImplDevToolsMessageObserver::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_observer);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn navigation_entries(
&self,
visitor: Option<&mut NavigationEntryVisitor>,
current_only: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.get_navigation_entries {
let (arg_visitor, arg_current_only) = (visitor, current_only);
let arg_self_ = self.into_raw();
let arg_visitor = arg_visitor
.map(|arg| {
arg.add_ref();
ImplNavigationEntryVisitor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_visitor, arg_current_only);
}
}
}
fn replace_misspelling(&self, word: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.replace_misspelling {
let arg_word = word;
let arg_self_ = self.into_raw();
let arg_word = arg_word
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_word);
}
}
}
fn add_word_to_dictionary(&self, word: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.add_word_to_dictionary {
let arg_word = word;
let arg_self_ = self.into_raw();
let arg_word = arg_word
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_word);
}
}
}
fn is_window_rendering_disabled(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_window_rendering_disabled
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn was_resized(&self) {
unsafe {
if let Some(f) = self.0.was_resized {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn was_hidden(&self, hidden: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.was_hidden {
let arg_hidden = hidden;
let arg_self_ = self.into_raw();
f(arg_self_, arg_hidden);
}
}
}
fn notify_screen_info_changed(&self) {
unsafe {
if let Some(f) = self.0.notify_screen_info_changed {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn invalidate(&self, type_: PaintElementType) {
unsafe {
if let Some(f) = self.0.invalidate {
let arg_type_ = type_;
let arg_self_ = self.into_raw();
let arg_type_ = arg_type_.into_raw();
f(arg_self_, arg_type_);
}
}
}
fn send_external_begin_frame(&self) {
unsafe {
if let Some(f) = self.0.send_external_begin_frame {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn send_key_event(&self, event: Option<&KeyEvent>) {
unsafe {
if let Some(f) = self.0.send_key_event {
let arg_event = event;
let arg_self_ = self.into_raw();
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_event);
}
}
}
fn send_mouse_click_event(
&self,
event: Option<&MouseEvent>,
type_: MouseButtonType,
mouse_up: ::std::os::raw::c_int,
click_count: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.send_mouse_click_event {
let (arg_event, arg_type_, arg_mouse_up, arg_click_count) =
(event, type_, mouse_up, click_count);
let arg_self_ = self.into_raw();
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_type_ = arg_type_.into_raw();
f(
arg_self_,
arg_event,
arg_type_,
arg_mouse_up,
arg_click_count,
);
}
}
}
fn send_mouse_move_event(
&self,
event: Option<&MouseEvent>,
mouse_leave: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.send_mouse_move_event {
let (arg_event, arg_mouse_leave) = (event, mouse_leave);
let arg_self_ = self.into_raw();
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_event, arg_mouse_leave);
}
}
}
fn send_mouse_wheel_event(
&self,
event: Option<&MouseEvent>,
delta_x: ::std::os::raw::c_int,
delta_y: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.send_mouse_wheel_event {
let (arg_event, arg_delta_x, arg_delta_y) = (event, delta_x, delta_y);
let arg_self_ = self.into_raw();
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_event, arg_delta_x, arg_delta_y);
}
}
}
fn send_touch_event(&self, event: Option<&TouchEvent>) {
unsafe {
if let Some(f) = self.0.send_touch_event {
let arg_event = event;
let arg_self_ = self.into_raw();
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_event);
}
}
}
fn send_capture_lost_event(&self) {
unsafe {
if let Some(f) = self.0.send_capture_lost_event {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn notify_move_or_resize_started(&self) {
unsafe {
if let Some(f) = self.0.notify_move_or_resize_started {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn windowless_frame_rate(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_windowless_frame_rate
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_windowless_frame_rate(&self, frame_rate: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_windowless_frame_rate {
let arg_frame_rate = frame_rate;
let arg_self_ = self.into_raw();
f(arg_self_, arg_frame_rate);
}
}
}
fn ime_set_composition(
&self,
text: Option<&CefString>,
underlines: Option<&[CompositionUnderline]>,
replacement_range: Option<&Range>,
selection_range: Option<&Range>,
) {
unsafe {
if let Some(f) = self.0.ime_set_composition {
let (arg_text, arg_underlines, arg_replacement_range, arg_selection_range) =
(text, underlines, replacement_range, selection_range);
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_underlines_count = arg_underlines
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_underlines = arg_underlines
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_underlines = if vec_underlines.is_empty() {
std::ptr::null()
} else {
vec_underlines.as_ptr()
};
let arg_replacement_range = arg_replacement_range.cloned().map(|arg| arg.into());
let arg_replacement_range = arg_replacement_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_selection_range = arg_selection_range.cloned().map(|arg| arg.into());
let arg_selection_range = arg_selection_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_text,
arg_underlines_count,
arg_underlines,
arg_replacement_range,
arg_selection_range,
);
}
}
}
fn ime_commit_text(
&self,
text: Option<&CefString>,
replacement_range: Option<&Range>,
relative_cursor_pos: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.ime_commit_text {
let (arg_text, arg_replacement_range, arg_relative_cursor_pos) =
(text, replacement_range, relative_cursor_pos);
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_replacement_range = arg_replacement_range.cloned().map(|arg| arg.into());
let arg_replacement_range = arg_replacement_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_text,
arg_replacement_range,
arg_relative_cursor_pos,
);
}
}
}
fn ime_finish_composing_text(&self, keep_selection: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.ime_finish_composing_text {
let arg_keep_selection = keep_selection;
let arg_self_ = self.into_raw();
f(arg_self_, arg_keep_selection);
}
}
}
fn ime_cancel_composition(&self) {
unsafe {
if let Some(f) = self.0.ime_cancel_composition {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn drag_target_drag_enter(
&self,
drag_data: Option<&mut DragData>,
event: Option<&MouseEvent>,
allowed_ops: DragOperationsMask,
) {
unsafe {
if let Some(f) = self.0.drag_target_drag_enter {
let (arg_drag_data, arg_event, arg_allowed_ops) = (drag_data, event, allowed_ops);
let arg_self_ = self.into_raw();
let arg_drag_data = arg_drag_data
.map(|arg| {
arg.add_ref();
ImplDragData::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_allowed_ops = arg_allowed_ops.into_raw();
f(arg_self_, arg_drag_data, arg_event, arg_allowed_ops);
}
}
}
fn drag_target_drag_over(&self, event: Option<&MouseEvent>, allowed_ops: DragOperationsMask) {
unsafe {
if let Some(f) = self.0.drag_target_drag_over {
let (arg_event, arg_allowed_ops) = (event, allowed_ops);
let arg_self_ = self.into_raw();
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_allowed_ops = arg_allowed_ops.into_raw();
f(arg_self_, arg_event, arg_allowed_ops);
}
}
}
fn drag_target_drag_leave(&self) {
unsafe {
if let Some(f) = self.0.drag_target_drag_leave {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn drag_target_drop(&self, event: Option<&MouseEvent>) {
unsafe {
if let Some(f) = self.0.drag_target_drop {
let arg_event = event;
let arg_self_ = self.into_raw();
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_event);
}
}
}
fn drag_source_ended_at(
&self,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
op: DragOperationsMask,
) {
unsafe {
if let Some(f) = self.0.drag_source_ended_at {
let (arg_x, arg_y, arg_op) = (x, y, op);
let arg_self_ = self.into_raw();
let arg_op = arg_op.into_raw();
f(arg_self_, arg_x, arg_y, arg_op);
}
}
}
fn drag_source_system_drag_ended(&self) {
unsafe {
if let Some(f) = self.0.drag_source_system_drag_ended {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn visible_navigation_entry(&self) -> Option<NavigationEntry> {
unsafe {
self.0
.get_visible_navigation_entry
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_accessibility_state(&self, accessibility_state: State) {
unsafe {
if let Some(f) = self.0.set_accessibility_state {
let arg_accessibility_state = accessibility_state;
let arg_self_ = self.into_raw();
let arg_accessibility_state = arg_accessibility_state.into_raw();
f(arg_self_, arg_accessibility_state);
}
}
}
fn set_auto_resize_enabled(
&self,
enabled: ::std::os::raw::c_int,
min_size: Option<&Size>,
max_size: Option<&Size>,
) {
unsafe {
if let Some(f) = self.0.set_auto_resize_enabled {
let (arg_enabled, arg_min_size, arg_max_size) = (enabled, min_size, max_size);
let arg_self_ = self.into_raw();
let arg_min_size = arg_min_size.cloned().map(|arg| arg.into());
let arg_min_size = arg_min_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_max_size = arg_max_size.cloned().map(|arg| arg.into());
let arg_max_size = arg_max_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_enabled, arg_min_size, arg_max_size);
}
}
}
fn set_audio_muted(&self, mute: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_audio_muted {
let arg_mute = mute;
let arg_self_ = self.into_raw();
f(arg_self_, arg_mute);
}
}
}
fn is_audio_muted(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_audio_muted
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_fullscreen(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_fullscreen
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn exit_fullscreen(&self, will_cause_resize: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.exit_fullscreen {
let arg_will_cause_resize = will_cause_resize;
let arg_self_ = self.into_raw();
f(arg_self_, arg_will_cause_resize);
}
}
}
fn can_execute_chrome_command(
&self,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_execute_chrome_command
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn execute_chrome_command(
&self,
command_id: ::std::os::raw::c_int,
disposition: WindowOpenDisposition,
) {
unsafe {
if let Some(f) = self.0.execute_chrome_command {
let (arg_command_id, arg_disposition) = (command_id, disposition);
let arg_self_ = self.into_raw();
let arg_disposition = arg_disposition.into_raw();
f(arg_self_, arg_command_id, arg_disposition);
}
}
}
fn is_render_process_unresponsive(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_render_process_unresponsive
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn runtime_style(&self) -> RuntimeStyle {
unsafe {
self.0
.get_runtime_style
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_ax_viewport_collapse(&self, enabled: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_ax_viewport_collapse {
let arg_enabled = enabled;
let arg_self_ = self.into_raw();
f(arg_self_, arg_enabled);
}
}
}
fn get_raw(&self) -> *mut _cef_browser_host_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_browser_host_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for BrowserHost {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_browser_host_t> for &BrowserHost {
fn into_raw(self) -> *mut _cef_browser_host_t {
ImplBrowserHost::get_raw(self)
}
}
impl ConvertParam<*mut _cef_browser_host_t> for &mut BrowserHost {
fn into_raw(self) -> *mut _cef_browser_host_t {
ImplBrowserHost::get_raw(self)
}
}
impl ConvertReturnValue<BrowserHost> for *mut _cef_browser_host_t {
fn wrap_result(self) -> BrowserHost {
BrowserHost(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BrowserHost> for *mut _cef_browser_host_t {
fn from(value: BrowserHost) -> Self {
let object = ImplBrowserHost::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_audio_handler_t`] for more documentation.
#[derive(Clone)]
pub struct AudioHandler(RefGuard<_cef_audio_handler_t>);
impl AudioHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapAudioHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplAudioHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapAudioHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_audio_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapAudioHandler: ImplAudioHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_audio_handler_t, Self>);
}
pub trait ImplAudioHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_audio_handler_t::get_audio_parameters`] for more documentation."]
fn audio_parameters(
&self,
browser: Option<&mut Browser>,
params: Option<&mut AudioParameters>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_audio_handler_t::on_audio_stream_started`] for more documentation."]
fn on_audio_stream_started(
&self,
browser: Option<&mut Browser>,
params: Option<&AudioParameters>,
channels: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_audio_handler_t::on_audio_stream_packet`] for more documentation."]
fn on_audio_stream_packet(
&self,
browser: Option<&mut Browser>,
data: *mut *const f32,
frames: ::std::os::raw::c_int,
pts: i64,
) {
}
#[doc = "See [`_cef_audio_handler_t::on_audio_stream_stopped`] for more documentation."]
fn on_audio_stream_stopped(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_audio_handler_t::on_audio_stream_error`] for more documentation."]
fn on_audio_stream_error(&self, browser: Option<&mut Browser>, message: Option<&CefString>) {}
fn init_methods(object: &mut _cef_audio_handler_t) {
impl_cef_audio_handler_t::init_methods::<Self, _cef_audio_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_audio_handler_t;
}
#[doc = "Implement the [`WrapAudioHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl AudioHandler` block you can override default\nmethods implemented by the [`ImplAudioHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_audio_handler! {\n struct MyAudioHandler {\n payload: String,\n }\n\n impl AudioHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> AudioHandler {\n MyAudioHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_audio_handler { ($ vis : vis struct $ name : ident ; impl AudioHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_audio_handler ! { $ vis struct $ name { } impl AudioHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl AudioHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_audio_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> AudioHandler { AudioHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapAudioHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_audio_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplAudioHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_audio_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_audio_handler_t {
use super::*;
pub fn init_methods<I: ImplAudioHandler, R: Rc>(object: &mut _cef_audio_handler_t) {
object.get_audio_parameters = Some(get_audio_parameters::<I, R>);
object.on_audio_stream_started = Some(on_audio_stream_started::<I, R>);
object.on_audio_stream_packet = Some(on_audio_stream_packet::<I, R>);
object.on_audio_stream_stopped = Some(on_audio_stream_stopped::<I, R>);
object.on_audio_stream_error = Some(on_audio_stream_error::<I, R>);
}
extern "C" fn get_audio_parameters<I: ImplAudioHandler, R: Rc>(
self_: *mut _cef_audio_handler_t,
browser: *mut _cef_browser_t,
params: *mut _cef_audio_parameters_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_params) = (self_, browser, params);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_params = if arg_params.is_null() {
None
} else {
Some(WrapParamRef::<AudioParameters, _>::from(arg_params))
};
let arg_params = arg_params.as_mut().map(|arg| arg.as_mut());
ImplAudioHandler::audio_parameters(&arg_self_.interface, arg_browser, arg_params)
}
extern "C" fn on_audio_stream_started<I: ImplAudioHandler, R: Rc>(
self_: *mut _cef_audio_handler_t,
browser: *mut _cef_browser_t,
params: *const _cef_audio_parameters_t,
channels: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_params, arg_channels) = (self_, browser, params, channels);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_params = if arg_params.is_null() {
None
} else {
Some(WrapParamRef::<AudioParameters, _>::from(arg_params))
};
let arg_params = arg_params.as_ref().map(|arg| arg.as_ref());
let arg_channels = arg_channels.into_raw();
ImplAudioHandler::on_audio_stream_started(
&arg_self_.interface,
arg_browser,
arg_params,
arg_channels,
)
}
extern "C" fn on_audio_stream_packet<I: ImplAudioHandler, R: Rc>(
self_: *mut _cef_audio_handler_t,
browser: *mut _cef_browser_t,
data: *mut *const f32,
frames: ::std::os::raw::c_int,
pts: i64,
) {
let (arg_self_, arg_browser, arg_data, arg_frames, arg_pts) =
(self_, browser, data, frames, pts);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_data = arg_data.into_raw();
let arg_frames = arg_frames.into_raw();
let arg_pts = arg_pts.into_raw();
ImplAudioHandler::on_audio_stream_packet(
&arg_self_.interface,
arg_browser,
arg_data,
arg_frames,
arg_pts,
)
}
extern "C" fn on_audio_stream_stopped<I: ImplAudioHandler, R: Rc>(
self_: *mut _cef_audio_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplAudioHandler::on_audio_stream_stopped(&arg_self_.interface, arg_browser)
}
extern "C" fn on_audio_stream_error<I: ImplAudioHandler, R: Rc>(
self_: *mut _cef_audio_handler_t,
browser: *mut _cef_browser_t,
message: *const cef_string_t,
) {
let (arg_self_, arg_browser, arg_message) = (self_, browser, message);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_message = if arg_message.is_null() {
None
} else {
Some(arg_message.into())
};
let arg_message = arg_message.as_ref();
ImplAudioHandler::on_audio_stream_error(&arg_self_.interface, arg_browser, arg_message)
}
}
impl ImplAudioHandler for AudioHandler {
fn audio_parameters(
&self,
browser: Option<&mut Browser>,
params: Option<&mut AudioParameters>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_audio_parameters
.map(|f| {
let (arg_browser, arg_params) = (browser, params);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_params = arg_params.cloned().map(|arg| arg.into());
let arg_params = arg_params
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_params);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_audio_stream_started(
&self,
browser: Option<&mut Browser>,
params: Option<&AudioParameters>,
channels: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_audio_stream_started {
let (arg_browser, arg_params, arg_channels) = (browser, params, channels);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_params = arg_params.cloned().map(|arg| arg.into());
let arg_params = arg_params
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_browser, arg_params, arg_channels);
}
}
}
fn on_audio_stream_packet(
&self,
browser: Option<&mut Browser>,
data: *mut *const f32,
frames: ::std::os::raw::c_int,
pts: i64,
) {
unsafe {
if let Some(f) = self.0.on_audio_stream_packet {
let (arg_browser, arg_data, arg_frames, arg_pts) = (browser, data, frames, pts);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_data = arg_data.cast();
f(arg_self_, arg_browser, arg_data, arg_frames, arg_pts);
}
}
}
fn on_audio_stream_stopped(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_audio_stream_stopped {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn on_audio_stream_error(&self, browser: Option<&mut Browser>, message: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.on_audio_stream_error {
let (arg_browser, arg_message) = (browser, message);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_message = arg_message
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_browser, arg_message);
}
}
}
fn get_raw(&self) -> *mut _cef_audio_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_audio_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for AudioHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_audio_handler_t> for &AudioHandler {
fn into_raw(self) -> *mut _cef_audio_handler_t {
ImplAudioHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_audio_handler_t> for &mut AudioHandler {
fn into_raw(self) -> *mut _cef_audio_handler_t {
ImplAudioHandler::get_raw(self)
}
}
impl ConvertReturnValue<AudioHandler> for *mut _cef_audio_handler_t {
fn wrap_result(self) -> AudioHandler {
AudioHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<AudioHandler> for *mut _cef_audio_handler_t {
fn from(value: AudioHandler) -> Self {
let object = ImplAudioHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_command_handler_t`] for more documentation.
#[derive(Clone)]
pub struct CommandHandler(RefGuard<_cef_command_handler_t>);
impl CommandHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapCommandHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplCommandHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapCommandHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_command_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapCommandHandler: ImplCommandHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_command_handler_t, Self>);
}
pub trait ImplCommandHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_command_handler_t::on_chrome_command`] for more documentation."]
fn on_chrome_command(
&self,
browser: Option<&mut Browser>,
command_id: ::std::os::raw::c_int,
disposition: WindowOpenDisposition,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_command_handler_t::is_chrome_app_menu_item_visible`] for more documentation."]
fn is_chrome_app_menu_item_visible(
&self,
browser: Option<&mut Browser>,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_command_handler_t::is_chrome_app_menu_item_enabled`] for more documentation."]
fn is_chrome_app_menu_item_enabled(
&self,
browser: Option<&mut Browser>,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_command_handler_t::is_chrome_page_action_icon_visible`] for more documentation."]
fn is_chrome_page_action_icon_visible(
&self,
icon_type: ChromePageActionIconType,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_command_handler_t::is_chrome_toolbar_button_visible`] for more documentation."]
fn is_chrome_toolbar_button_visible(
&self,
button_type: ChromeToolbarButtonType,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_command_handler_t) {
impl_cef_command_handler_t::init_methods::<Self, _cef_command_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_command_handler_t;
}
#[doc = "Implement the [`WrapCommandHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl CommandHandler` block you can override default\nmethods implemented by the [`ImplCommandHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_command_handler! {\n struct MyCommandHandler {\n payload: String,\n }\n\n impl CommandHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> CommandHandler {\n MyCommandHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_command_handler { ($ vis : vis struct $ name : ident ; impl CommandHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_command_handler ! { $ vis struct $ name { } impl CommandHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl CommandHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_command_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> CommandHandler { CommandHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapCommandHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_command_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplCommandHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_command_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_command_handler_t {
use super::*;
pub fn init_methods<I: ImplCommandHandler, R: Rc>(object: &mut _cef_command_handler_t) {
object.on_chrome_command = Some(on_chrome_command::<I, R>);
object.is_chrome_app_menu_item_visible = Some(is_chrome_app_menu_item_visible::<I, R>);
object.is_chrome_app_menu_item_enabled = Some(is_chrome_app_menu_item_enabled::<I, R>);
object.is_chrome_page_action_icon_visible =
Some(is_chrome_page_action_icon_visible::<I, R>);
object.is_chrome_toolbar_button_visible = Some(is_chrome_toolbar_button_visible::<I, R>);
}
extern "C" fn on_chrome_command<I: ImplCommandHandler, R: Rc>(
self_: *mut _cef_command_handler_t,
browser: *mut _cef_browser_t,
command_id: ::std::os::raw::c_int,
disposition: cef_window_open_disposition_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_command_id, arg_disposition) =
(self_, browser, command_id, disposition);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_command_id = arg_command_id.into_raw();
let arg_disposition = arg_disposition.into_raw();
ImplCommandHandler::on_chrome_command(
&arg_self_.interface,
arg_browser,
arg_command_id,
arg_disposition,
)
}
extern "C" fn is_chrome_app_menu_item_visible<I: ImplCommandHandler, R: Rc>(
self_: *mut _cef_command_handler_t,
browser: *mut _cef_browser_t,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_command_id) = (self_, browser, command_id);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_command_id = arg_command_id.into_raw();
ImplCommandHandler::is_chrome_app_menu_item_visible(
&arg_self_.interface,
arg_browser,
arg_command_id,
)
}
extern "C" fn is_chrome_app_menu_item_enabled<I: ImplCommandHandler, R: Rc>(
self_: *mut _cef_command_handler_t,
browser: *mut _cef_browser_t,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_command_id) = (self_, browser, command_id);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_command_id = arg_command_id.into_raw();
ImplCommandHandler::is_chrome_app_menu_item_enabled(
&arg_self_.interface,
arg_browser,
arg_command_id,
)
}
extern "C" fn is_chrome_page_action_icon_visible<I: ImplCommandHandler, R: Rc>(
self_: *mut _cef_command_handler_t,
icon_type: cef_chrome_page_action_icon_type_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_icon_type) = (self_, icon_type);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_icon_type = arg_icon_type.into_raw();
ImplCommandHandler::is_chrome_page_action_icon_visible(&arg_self_.interface, arg_icon_type)
}
extern "C" fn is_chrome_toolbar_button_visible<I: ImplCommandHandler, R: Rc>(
self_: *mut _cef_command_handler_t,
button_type: cef_chrome_toolbar_button_type_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_button_type) = (self_, button_type);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_button_type = arg_button_type.into_raw();
ImplCommandHandler::is_chrome_toolbar_button_visible(&arg_self_.interface, arg_button_type)
}
}
impl ImplCommandHandler for CommandHandler {
fn on_chrome_command(
&self,
browser: Option<&mut Browser>,
command_id: ::std::os::raw::c_int,
disposition: WindowOpenDisposition,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_chrome_command
.map(|f| {
let (arg_browser, arg_command_id, arg_disposition) =
(browser, command_id, disposition);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_disposition = arg_disposition.into_raw();
let result = f(arg_self_, arg_browser, arg_command_id, arg_disposition);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_chrome_app_menu_item_visible(
&self,
browser: Option<&mut Browser>,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_chrome_app_menu_item_visible
.map(|f| {
let (arg_browser, arg_command_id) = (browser, command_id);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_chrome_app_menu_item_enabled(
&self,
browser: Option<&mut Browser>,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_chrome_app_menu_item_enabled
.map(|f| {
let (arg_browser, arg_command_id) = (browser, command_id);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_chrome_page_action_icon_visible(
&self,
icon_type: ChromePageActionIconType,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_chrome_page_action_icon_visible
.map(|f| {
let arg_icon_type = icon_type;
let arg_self_ = self.into_raw();
let arg_icon_type = arg_icon_type.into_raw();
let result = f(arg_self_, arg_icon_type);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_chrome_toolbar_button_visible(
&self,
button_type: ChromeToolbarButtonType,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_chrome_toolbar_button_visible
.map(|f| {
let arg_button_type = button_type;
let arg_self_ = self.into_raw();
let arg_button_type = arg_button_type.into_raw();
let result = f(arg_self_, arg_button_type);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_command_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_command_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for CommandHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_command_handler_t> for &CommandHandler {
fn into_raw(self) -> *mut _cef_command_handler_t {
ImplCommandHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_command_handler_t> for &mut CommandHandler {
fn into_raw(self) -> *mut _cef_command_handler_t {
ImplCommandHandler::get_raw(self)
}
}
impl ConvertReturnValue<CommandHandler> for *mut _cef_command_handler_t {
fn wrap_result(self) -> CommandHandler {
CommandHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<CommandHandler> for *mut _cef_command_handler_t {
fn from(value: CommandHandler) -> Self {
let object = ImplCommandHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_menu_model_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct MenuModelDelegate(RefGuard<_cef_menu_model_delegate_t>);
impl MenuModelDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapMenuModelDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplMenuModelDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapMenuModelDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_menu_model_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapMenuModelDelegate: ImplMenuModelDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_menu_model_delegate_t, Self>);
}
pub trait ImplMenuModelDelegate: Clone + Sized + Rc {
#[doc = "See [`_cef_menu_model_delegate_t::execute_command`] for more documentation."]
fn execute_command(
&self,
menu_model: Option<&mut MenuModel>,
command_id: ::std::os::raw::c_int,
event_flags: EventFlags,
) {
}
#[doc = "See [`_cef_menu_model_delegate_t::mouse_outside_menu`] for more documentation."]
fn mouse_outside_menu(&self, menu_model: Option<&mut MenuModel>, screen_point: Option<&Point>) {
}
#[doc = "See [`_cef_menu_model_delegate_t::unhandled_open_submenu`] for more documentation."]
fn unhandled_open_submenu(
&self,
menu_model: Option<&mut MenuModel>,
is_rtl: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_menu_model_delegate_t::unhandled_close_submenu`] for more documentation."]
fn unhandled_close_submenu(
&self,
menu_model: Option<&mut MenuModel>,
is_rtl: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_menu_model_delegate_t::menu_will_show`] for more documentation."]
fn menu_will_show(&self, menu_model: Option<&mut MenuModel>) {}
#[doc = "See [`_cef_menu_model_delegate_t::menu_closed`] for more documentation."]
fn menu_closed(&self, menu_model: Option<&mut MenuModel>) {}
#[doc = "See [`_cef_menu_model_delegate_t::format_label`] for more documentation."]
fn format_label(
&self,
menu_model: Option<&mut MenuModel>,
label: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_menu_model_delegate_t) {
impl_cef_menu_model_delegate_t::init_methods::<Self, _cef_menu_model_delegate_t>(object);
}
fn get_raw(&self) -> *mut _cef_menu_model_delegate_t;
}
#[doc = "Implement the [`WrapMenuModelDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl MenuModelDelegate` block you can override default\nmethods implemented by the [`ImplMenuModelDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_menu_model_delegate! {\n struct MyMenuModelDelegate {\n payload: String,\n }\n\n impl MenuModelDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> MenuModelDelegate {\n MyMenuModelDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_menu_model_delegate { ($ vis : vis struct $ name : ident ; impl MenuModelDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_menu_model_delegate ! { $ vis struct $ name { } impl MenuModelDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl MenuModelDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_menu_model_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> MenuModelDelegate { MenuModelDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapMenuModelDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_menu_model_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplMenuModelDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_menu_model_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_menu_model_delegate_t {
use super::*;
pub fn init_methods<I: ImplMenuModelDelegate, R: Rc>(object: &mut _cef_menu_model_delegate_t) {
object.execute_command = Some(execute_command::<I, R>);
object.mouse_outside_menu = Some(mouse_outside_menu::<I, R>);
object.unhandled_open_submenu = Some(unhandled_open_submenu::<I, R>);
object.unhandled_close_submenu = Some(unhandled_close_submenu::<I, R>);
object.menu_will_show = Some(menu_will_show::<I, R>);
object.menu_closed = Some(menu_closed::<I, R>);
object.format_label = Some(format_label::<I, R>);
}
extern "C" fn execute_command<I: ImplMenuModelDelegate, R: Rc>(
self_: *mut _cef_menu_model_delegate_t,
menu_model: *mut _cef_menu_model_t,
command_id: ::std::os::raw::c_int,
event_flags: cef_event_flags_t,
) {
let (arg_self_, arg_menu_model, arg_command_id, arg_event_flags) =
(self_, menu_model, command_id, event_flags);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_model = unsafe { arg_menu_model.as_mut() }
.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_model = arg_menu_model.as_mut();
let arg_command_id = arg_command_id.into_raw();
let arg_event_flags = arg_event_flags.into_raw();
ImplMenuModelDelegate::execute_command(
&arg_self_.interface,
arg_menu_model,
arg_command_id,
arg_event_flags,
)
}
extern "C" fn mouse_outside_menu<I: ImplMenuModelDelegate, R: Rc>(
self_: *mut _cef_menu_model_delegate_t,
menu_model: *mut _cef_menu_model_t,
screen_point: *const _cef_point_t,
) {
let (arg_self_, arg_menu_model, arg_screen_point) = (self_, menu_model, screen_point);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_model = unsafe { arg_menu_model.as_mut() }
.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_model = arg_menu_model.as_mut();
let arg_screen_point = if arg_screen_point.is_null() {
None
} else {
Some(WrapParamRef::<Point, _>::from(arg_screen_point))
};
let arg_screen_point = arg_screen_point.as_ref().map(|arg| arg.as_ref());
ImplMenuModelDelegate::mouse_outside_menu(
&arg_self_.interface,
arg_menu_model,
arg_screen_point,
)
}
extern "C" fn unhandled_open_submenu<I: ImplMenuModelDelegate, R: Rc>(
self_: *mut _cef_menu_model_delegate_t,
menu_model: *mut _cef_menu_model_t,
is_rtl: ::std::os::raw::c_int,
) {
let (arg_self_, arg_menu_model, arg_is_rtl) = (self_, menu_model, is_rtl);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_model = unsafe { arg_menu_model.as_mut() }
.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_model = arg_menu_model.as_mut();
let arg_is_rtl = arg_is_rtl.into_raw();
ImplMenuModelDelegate::unhandled_open_submenu(
&arg_self_.interface,
arg_menu_model,
arg_is_rtl,
)
}
extern "C" fn unhandled_close_submenu<I: ImplMenuModelDelegate, R: Rc>(
self_: *mut _cef_menu_model_delegate_t,
menu_model: *mut _cef_menu_model_t,
is_rtl: ::std::os::raw::c_int,
) {
let (arg_self_, arg_menu_model, arg_is_rtl) = (self_, menu_model, is_rtl);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_model = unsafe { arg_menu_model.as_mut() }
.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_model = arg_menu_model.as_mut();
let arg_is_rtl = arg_is_rtl.into_raw();
ImplMenuModelDelegate::unhandled_close_submenu(
&arg_self_.interface,
arg_menu_model,
arg_is_rtl,
)
}
extern "C" fn menu_will_show<I: ImplMenuModelDelegate, R: Rc>(
self_: *mut _cef_menu_model_delegate_t,
menu_model: *mut _cef_menu_model_t,
) {
let (arg_self_, arg_menu_model) = (self_, menu_model);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_model = unsafe { arg_menu_model.as_mut() }
.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_model = arg_menu_model.as_mut();
ImplMenuModelDelegate::menu_will_show(&arg_self_.interface, arg_menu_model)
}
extern "C" fn menu_closed<I: ImplMenuModelDelegate, R: Rc>(
self_: *mut _cef_menu_model_delegate_t,
menu_model: *mut _cef_menu_model_t,
) {
let (arg_self_, arg_menu_model) = (self_, menu_model);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_model = unsafe { arg_menu_model.as_mut() }
.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_model = arg_menu_model.as_mut();
ImplMenuModelDelegate::menu_closed(&arg_self_.interface, arg_menu_model)
}
extern "C" fn format_label<I: ImplMenuModelDelegate, R: Rc>(
self_: *mut _cef_menu_model_delegate_t,
menu_model: *mut _cef_menu_model_t,
label: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_menu_model, arg_label) = (self_, menu_model, label);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_model = unsafe { arg_menu_model.as_mut() }
.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_model = arg_menu_model.as_mut();
let mut arg_label = if arg_label.is_null() {
None
} else {
Some(arg_label.into())
};
let arg_label = arg_label.as_mut();
ImplMenuModelDelegate::format_label(&arg_self_.interface, arg_menu_model, arg_label)
}
}
impl ImplMenuModelDelegate for MenuModelDelegate {
fn execute_command(
&self,
menu_model: Option<&mut MenuModel>,
command_id: ::std::os::raw::c_int,
event_flags: EventFlags,
) {
unsafe {
if let Some(f) = self.0.execute_command {
let (arg_menu_model, arg_command_id, arg_event_flags) =
(menu_model, command_id, event_flags);
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event_flags = arg_event_flags.into_raw();
f(arg_self_, arg_menu_model, arg_command_id, arg_event_flags);
}
}
}
fn mouse_outside_menu(&self, menu_model: Option<&mut MenuModel>, screen_point: Option<&Point>) {
unsafe {
if let Some(f) = self.0.mouse_outside_menu {
let (arg_menu_model, arg_screen_point) = (menu_model, screen_point);
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_screen_point = arg_screen_point.cloned().map(|arg| arg.into());
let arg_screen_point = arg_screen_point
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_menu_model, arg_screen_point);
}
}
}
fn unhandled_open_submenu(
&self,
menu_model: Option<&mut MenuModel>,
is_rtl: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.unhandled_open_submenu {
let (arg_menu_model, arg_is_rtl) = (menu_model, is_rtl);
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_menu_model, arg_is_rtl);
}
}
}
fn unhandled_close_submenu(
&self,
menu_model: Option<&mut MenuModel>,
is_rtl: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.unhandled_close_submenu {
let (arg_menu_model, arg_is_rtl) = (menu_model, is_rtl);
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_menu_model, arg_is_rtl);
}
}
}
fn menu_will_show(&self, menu_model: Option<&mut MenuModel>) {
unsafe {
if let Some(f) = self.0.menu_will_show {
let arg_menu_model = menu_model;
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_menu_model);
}
}
}
fn menu_closed(&self, menu_model: Option<&mut MenuModel>) {
unsafe {
if let Some(f) = self.0.menu_closed {
let arg_menu_model = menu_model;
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_menu_model);
}
}
}
fn format_label(
&self,
menu_model: Option<&mut MenuModel>,
label: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.format_label
.map(|f| {
let (arg_menu_model, arg_label) = (menu_model, label);
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_menu_model, arg_label);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_menu_model_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_menu_model_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MenuModelDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_menu_model_delegate_t> for &MenuModelDelegate {
fn into_raw(self) -> *mut _cef_menu_model_delegate_t {
ImplMenuModelDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_menu_model_delegate_t> for &mut MenuModelDelegate {
fn into_raw(self) -> *mut _cef_menu_model_delegate_t {
ImplMenuModelDelegate::get_raw(self)
}
}
impl ConvertReturnValue<MenuModelDelegate> for *mut _cef_menu_model_delegate_t {
fn wrap_result(self) -> MenuModelDelegate {
MenuModelDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MenuModelDelegate> for *mut _cef_menu_model_delegate_t {
fn from(value: MenuModelDelegate) -> Self {
let object = ImplMenuModelDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_menu_model_t`] for more documentation.
#[derive(Clone)]
pub struct MenuModel(RefGuard<_cef_menu_model_t>);
pub trait ImplMenuModel: Clone + Sized + Rc {
#[doc = "See [`_cef_menu_model_t::is_sub_menu`] for more documentation."]
fn is_sub_menu(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::clear`] for more documentation."]
fn clear(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_count`] for more documentation."]
fn count(&self) -> usize;
#[doc = "See [`_cef_menu_model_t::add_separator`] for more documentation."]
fn add_separator(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::add_item`] for more documentation."]
fn add_item(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::add_check_item`] for more documentation."]
fn add_check_item(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::add_radio_item`] for more documentation."]
fn add_radio_item(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::add_sub_menu`] for more documentation."]
fn add_sub_menu(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> Option<MenuModel>;
#[doc = "See [`_cef_menu_model_t::insert_separator_at`] for more documentation."]
fn insert_separator_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::insert_item_at`] for more documentation."]
fn insert_item_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::insert_check_item_at`] for more documentation."]
fn insert_check_item_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::insert_radio_item_at`] for more documentation."]
fn insert_radio_item_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::insert_sub_menu_at`] for more documentation."]
fn insert_sub_menu_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> Option<MenuModel>;
#[doc = "See [`_cef_menu_model_t::remove`] for more documentation."]
fn remove(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::remove_at`] for more documentation."]
fn remove_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_index_of`] for more documentation."]
fn index_of(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_command_id_at`] for more documentation."]
fn command_id_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_command_id_at`] for more documentation."]
fn set_command_id_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_label`] for more documentation."]
fn label(&self, command_id: ::std::os::raw::c_int) -> CefStringUserfree;
#[doc = "See [`_cef_menu_model_t::get_label_at`] for more documentation."]
fn label_at(&self, index: usize) -> CefStringUserfree;
#[doc = "See [`_cef_menu_model_t::set_label`] for more documentation."]
fn set_label(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_label_at`] for more documentation."]
fn set_label_at(&self, index: usize, label: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_type`] for more documentation."]
fn get_type(&self, command_id: ::std::os::raw::c_int) -> MenuItemType;
#[doc = "See [`_cef_menu_model_t::get_type_at`] for more documentation."]
fn type_at(&self, index: usize) -> MenuItemType;
#[doc = "See [`_cef_menu_model_t::get_group_id`] for more documentation."]
fn group_id(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_group_id_at`] for more documentation."]
fn group_id_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_group_id`] for more documentation."]
fn set_group_id(
&self,
command_id: ::std::os::raw::c_int,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_group_id_at`] for more documentation."]
fn set_group_id_at(
&self,
index: usize,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_sub_menu`] for more documentation."]
fn sub_menu(&self, command_id: ::std::os::raw::c_int) -> Option<MenuModel>;
#[doc = "See [`_cef_menu_model_t::get_sub_menu_at`] for more documentation."]
fn sub_menu_at(&self, index: usize) -> Option<MenuModel>;
#[doc = "See [`_cef_menu_model_t::is_visible`] for more documentation."]
fn is_visible(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::is_visible_at`] for more documentation."]
fn is_visible_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_visible`] for more documentation."]
fn set_visible(
&self,
command_id: ::std::os::raw::c_int,
visible: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_visible_at`] for more documentation."]
fn set_visible_at(&self, index: usize, visible: ::std::os::raw::c_int)
-> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::is_enabled`] for more documentation."]
fn is_enabled(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::is_enabled_at`] for more documentation."]
fn is_enabled_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_enabled`] for more documentation."]
fn set_enabled(
&self,
command_id: ::std::os::raw::c_int,
enabled: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_enabled_at`] for more documentation."]
fn set_enabled_at(&self, index: usize, enabled: ::std::os::raw::c_int)
-> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::is_checked`] for more documentation."]
fn is_checked(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::is_checked_at`] for more documentation."]
fn is_checked_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_checked`] for more documentation."]
fn set_checked(
&self,
command_id: ::std::os::raw::c_int,
checked: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_checked_at`] for more documentation."]
fn set_checked_at(&self, index: usize, checked: ::std::os::raw::c_int)
-> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::has_accelerator`] for more documentation."]
fn has_accelerator(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::has_accelerator_at`] for more documentation."]
fn has_accelerator_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_accelerator`] for more documentation."]
fn set_accelerator(
&self,
command_id: ::std::os::raw::c_int,
key_code: ::std::os::raw::c_int,
shift_pressed: ::std::os::raw::c_int,
ctrl_pressed: ::std::os::raw::c_int,
alt_pressed: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_accelerator_at`] for more documentation."]
fn set_accelerator_at(
&self,
index: usize,
key_code: ::std::os::raw::c_int,
shift_pressed: ::std::os::raw::c_int,
ctrl_pressed: ::std::os::raw::c_int,
alt_pressed: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::remove_accelerator`] for more documentation."]
fn remove_accelerator(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::remove_accelerator_at`] for more documentation."]
fn remove_accelerator_at(&self, index: usize) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_accelerator`] for more documentation."]
fn accelerator(
&self,
command_id: ::std::os::raw::c_int,
key_code: Option<&mut ::std::os::raw::c_int>,
shift_pressed: Option<&mut ::std::os::raw::c_int>,
ctrl_pressed: Option<&mut ::std::os::raw::c_int>,
alt_pressed: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_accelerator_at`] for more documentation."]
fn accelerator_at(
&self,
index: usize,
key_code: Option<&mut ::std::os::raw::c_int>,
shift_pressed: Option<&mut ::std::os::raw::c_int>,
ctrl_pressed: Option<&mut ::std::os::raw::c_int>,
alt_pressed: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_color`] for more documentation."]
fn set_color(
&self,
command_id: ::std::os::raw::c_int,
color_type: MenuColorType,
color: u32,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_color_at`] for more documentation."]
fn set_color_at(
&self,
index: ::std::os::raw::c_int,
color_type: MenuColorType,
color: u32,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_color`] for more documentation."]
fn color(
&self,
command_id: ::std::os::raw::c_int,
color_type: MenuColorType,
color: Option<&mut u32>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::get_color_at`] for more documentation."]
fn color_at(
&self,
index: ::std::os::raw::c_int,
color_type: MenuColorType,
color: Option<&mut u32>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_font_list`] for more documentation."]
fn set_font_list(
&self,
command_id: ::std::os::raw::c_int,
font_list: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_menu_model_t::set_font_list_at`] for more documentation."]
fn set_font_list_at(
&self,
index: ::std::os::raw::c_int,
font_list: Option<&CefString>,
) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_menu_model_t;
}
impl ImplMenuModel for MenuModel {
fn is_sub_menu(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_sub_menu
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn clear(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.clear
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn count(&self) -> usize {
unsafe {
self.0
.get_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_separator(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_separator
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_item(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_item
.map(|f| {
let (arg_command_id, arg_label) = (command_id, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_command_id, arg_label);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_check_item(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_check_item
.map(|f| {
let (arg_command_id, arg_label) = (command_id, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_command_id, arg_label);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_radio_item(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.add_radio_item
.map(|f| {
let (arg_command_id, arg_label, arg_group_id) = (command_id, label, group_id);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_command_id, arg_label, arg_group_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn add_sub_menu(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> Option<MenuModel> {
unsafe {
self.0
.add_sub_menu
.map(|f| {
let (arg_command_id, arg_label) = (command_id, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_command_id, arg_label);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn insert_separator_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.insert_separator_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn insert_item_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.insert_item_at
.map(|f| {
let (arg_index, arg_command_id, arg_label) = (index, command_id, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_index, arg_command_id, arg_label);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn insert_check_item_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.insert_check_item_at
.map(|f| {
let (arg_index, arg_command_id, arg_label) = (index, command_id, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_index, arg_command_id, arg_label);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn insert_radio_item_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.insert_radio_item_at
.map(|f| {
let (arg_index, arg_command_id, arg_label, arg_group_id) =
(index, command_id, label, group_id);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(
arg_self_,
arg_index,
arg_command_id,
arg_label,
arg_group_id,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn insert_sub_menu_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> Option<MenuModel> {
unsafe {
self.0
.insert_sub_menu_at
.map(|f| {
let (arg_index, arg_command_id, arg_label) = (index, command_id, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_index, arg_command_id, arg_label);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn remove(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn remove_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn index_of(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_index_of
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn command_id_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_command_id_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_command_id_at(
&self,
index: usize,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_command_id_at
.map(|f| {
let (arg_index, arg_command_id) = (index, command_id);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn label(&self, command_id: ::std::os::raw::c_int) -> CefStringUserfree {
unsafe {
self.0
.get_label
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn label_at(&self, index: usize) -> CefStringUserfree {
unsafe {
self.0
.get_label_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_label(
&self,
command_id: ::std::os::raw::c_int,
label: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_label
.map(|f| {
let (arg_command_id, arg_label) = (command_id, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_command_id, arg_label);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_label_at(&self, index: usize, label: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_label_at
.map(|f| {
let (arg_index, arg_label) = (index, label);
let arg_self_ = self.into_raw();
let arg_label = arg_label
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_index, arg_label);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_type(&self, command_id: ::std::os::raw::c_int) -> MenuItemType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn type_at(&self, index: usize) -> MenuItemType {
unsafe {
self.0
.get_type_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn group_id(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_group_id
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn group_id_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_group_id_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_group_id(
&self,
command_id: ::std::os::raw::c_int,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_group_id
.map(|f| {
let (arg_command_id, arg_group_id) = (command_id, group_id);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id, arg_group_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_group_id_at(
&self,
index: usize,
group_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_group_id_at
.map(|f| {
let (arg_index, arg_group_id) = (index, group_id);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_group_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn sub_menu(&self, command_id: ::std::os::raw::c_int) -> Option<MenuModel> {
unsafe {
self.0
.get_sub_menu
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn sub_menu_at(&self, index: usize) -> Option<MenuModel> {
unsafe {
self.0
.get_sub_menu_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn is_visible(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_visible
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_visible_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_visible_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_visible(
&self,
command_id: ::std::os::raw::c_int,
visible: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_visible
.map(|f| {
let (arg_command_id, arg_visible) = (command_id, visible);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id, arg_visible);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_visible_at(
&self,
index: usize,
visible: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_visible_at
.map(|f| {
let (arg_index, arg_visible) = (index, visible);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_visible);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_enabled(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_enabled
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_enabled_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_enabled_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_enabled(
&self,
command_id: ::std::os::raw::c_int,
enabled: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_enabled
.map(|f| {
let (arg_command_id, arg_enabled) = (command_id, enabled);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id, arg_enabled);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_enabled_at(
&self,
index: usize,
enabled: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_enabled_at
.map(|f| {
let (arg_index, arg_enabled) = (index, enabled);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_enabled);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_checked(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_checked
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_checked_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_checked_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_checked(
&self,
command_id: ::std::os::raw::c_int,
checked: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_checked
.map(|f| {
let (arg_command_id, arg_checked) = (command_id, checked);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id, arg_checked);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_checked_at(
&self,
index: usize,
checked: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_checked_at
.map(|f| {
let (arg_index, arg_checked) = (index, checked);
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index, arg_checked);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_accelerator(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_accelerator
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_accelerator_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_accelerator_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_accelerator(
&self,
command_id: ::std::os::raw::c_int,
key_code: ::std::os::raw::c_int,
shift_pressed: ::std::os::raw::c_int,
ctrl_pressed: ::std::os::raw::c_int,
alt_pressed: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_accelerator
.map(|f| {
let (
arg_command_id,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
) = (
command_id,
key_code,
shift_pressed,
ctrl_pressed,
alt_pressed,
);
let arg_self_ = self.into_raw();
let result = f(
arg_self_,
arg_command_id,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_accelerator_at(
&self,
index: usize,
key_code: ::std::os::raw::c_int,
shift_pressed: ::std::os::raw::c_int,
ctrl_pressed: ::std::os::raw::c_int,
alt_pressed: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_accelerator_at
.map(|f| {
let (
arg_index,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
) = (index, key_code, shift_pressed, ctrl_pressed, alt_pressed);
let arg_self_ = self.into_raw();
let result = f(
arg_self_,
arg_index,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn remove_accelerator(&self, command_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove_accelerator
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn remove_accelerator_at(&self, index: usize) -> ::std::os::raw::c_int {
unsafe {
self.0
.remove_accelerator_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn accelerator(
&self,
command_id: ::std::os::raw::c_int,
key_code: Option<&mut ::std::os::raw::c_int>,
shift_pressed: Option<&mut ::std::os::raw::c_int>,
ctrl_pressed: Option<&mut ::std::os::raw::c_int>,
alt_pressed: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_accelerator
.map(|f| {
let (
arg_command_id,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
) = (
command_id,
key_code,
shift_pressed,
ctrl_pressed,
alt_pressed,
);
let arg_self_ = self.into_raw();
let arg_key_code = arg_key_code
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_shift_pressed = arg_shift_pressed
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_ctrl_pressed = arg_ctrl_pressed
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_alt_pressed = arg_alt_pressed
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_command_id,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn accelerator_at(
&self,
index: usize,
key_code: Option<&mut ::std::os::raw::c_int>,
shift_pressed: Option<&mut ::std::os::raw::c_int>,
ctrl_pressed: Option<&mut ::std::os::raw::c_int>,
alt_pressed: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_accelerator_at
.map(|f| {
let (
arg_index,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
) = (index, key_code, shift_pressed, ctrl_pressed, alt_pressed);
let arg_self_ = self.into_raw();
let arg_key_code = arg_key_code
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_shift_pressed = arg_shift_pressed
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_ctrl_pressed = arg_ctrl_pressed
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_alt_pressed = arg_alt_pressed
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_index,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_color(
&self,
command_id: ::std::os::raw::c_int,
color_type: MenuColorType,
color: u32,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_color
.map(|f| {
let (arg_command_id, arg_color_type, arg_color) =
(command_id, color_type, color);
let arg_self_ = self.into_raw();
let arg_color_type = arg_color_type.into_raw();
let result = f(arg_self_, arg_command_id, arg_color_type, arg_color);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_color_at(
&self,
index: ::std::os::raw::c_int,
color_type: MenuColorType,
color: u32,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_color_at
.map(|f| {
let (arg_index, arg_color_type, arg_color) = (index, color_type, color);
let arg_self_ = self.into_raw();
let arg_color_type = arg_color_type.into_raw();
let result = f(arg_self_, arg_index, arg_color_type, arg_color);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn color(
&self,
command_id: ::std::os::raw::c_int,
color_type: MenuColorType,
color: Option<&mut u32>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_color
.map(|f| {
let (arg_command_id, arg_color_type, arg_color) =
(command_id, color_type, color);
let arg_self_ = self.into_raw();
let arg_color_type = arg_color_type.into_raw();
let arg_color = arg_color
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_command_id, arg_color_type, arg_color);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn color_at(
&self,
index: ::std::os::raw::c_int,
color_type: MenuColorType,
color: Option<&mut u32>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_color_at
.map(|f| {
let (arg_index, arg_color_type, arg_color) = (index, color_type, color);
let arg_self_ = self.into_raw();
let arg_color_type = arg_color_type.into_raw();
let arg_color = arg_color
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_color_type, arg_color);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_font_list(
&self,
command_id: ::std::os::raw::c_int,
font_list: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_font_list
.map(|f| {
let (arg_command_id, arg_font_list) = (command_id, font_list);
let arg_self_ = self.into_raw();
let arg_font_list = arg_font_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_command_id, arg_font_list);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_font_list_at(
&self,
index: ::std::os::raw::c_int,
font_list: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_font_list_at
.map(|f| {
let (arg_index, arg_font_list) = (index, font_list);
let arg_self_ = self.into_raw();
let arg_font_list = arg_font_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_index, arg_font_list);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_menu_model_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_menu_model_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MenuModel {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_menu_model_t> for &MenuModel {
fn into_raw(self) -> *mut _cef_menu_model_t {
ImplMenuModel::get_raw(self)
}
}
impl ConvertParam<*mut _cef_menu_model_t> for &mut MenuModel {
fn into_raw(self) -> *mut _cef_menu_model_t {
ImplMenuModel::get_raw(self)
}
}
impl ConvertReturnValue<MenuModel> for *mut _cef_menu_model_t {
fn wrap_result(self) -> MenuModel {
MenuModel(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MenuModel> for *mut _cef_menu_model_t {
fn from(value: MenuModel) -> Self {
let object = ImplMenuModel::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_run_context_menu_callback_t`] for more documentation.
#[derive(Clone)]
pub struct RunContextMenuCallback(RefGuard<_cef_run_context_menu_callback_t>);
pub trait ImplRunContextMenuCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_run_context_menu_callback_t::cont`] for more documentation."]
fn cont(&self, command_id: ::std::os::raw::c_int, event_flags: EventFlags);
#[doc = "See [`_cef_run_context_menu_callback_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_run_context_menu_callback_t;
}
impl ImplRunContextMenuCallback for RunContextMenuCallback {
fn cont(&self, command_id: ::std::os::raw::c_int, event_flags: EventFlags) {
unsafe {
if let Some(f) = self.0.cont {
let (arg_command_id, arg_event_flags) = (command_id, event_flags);
let arg_self_ = self.into_raw();
let arg_event_flags = arg_event_flags.into_raw();
f(arg_self_, arg_command_id, arg_event_flags);
}
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_run_context_menu_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_run_context_menu_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RunContextMenuCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_run_context_menu_callback_t> for &RunContextMenuCallback {
fn into_raw(self) -> *mut _cef_run_context_menu_callback_t {
ImplRunContextMenuCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_run_context_menu_callback_t> for &mut RunContextMenuCallback {
fn into_raw(self) -> *mut _cef_run_context_menu_callback_t {
ImplRunContextMenuCallback::get_raw(self)
}
}
impl ConvertReturnValue<RunContextMenuCallback> for *mut _cef_run_context_menu_callback_t {
fn wrap_result(self) -> RunContextMenuCallback {
RunContextMenuCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RunContextMenuCallback> for *mut _cef_run_context_menu_callback_t {
fn from(value: RunContextMenuCallback) -> Self {
let object = ImplRunContextMenuCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_run_quick_menu_callback_t`] for more documentation.
#[derive(Clone)]
pub struct RunQuickMenuCallback(RefGuard<_cef_run_quick_menu_callback_t>);
pub trait ImplRunQuickMenuCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_run_quick_menu_callback_t::cont`] for more documentation."]
fn cont(&self, command_id: ::std::os::raw::c_int, event_flags: EventFlags);
#[doc = "See [`_cef_run_quick_menu_callback_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_run_quick_menu_callback_t;
}
impl ImplRunQuickMenuCallback for RunQuickMenuCallback {
fn cont(&self, command_id: ::std::os::raw::c_int, event_flags: EventFlags) {
unsafe {
if let Some(f) = self.0.cont {
let (arg_command_id, arg_event_flags) = (command_id, event_flags);
let arg_self_ = self.into_raw();
let arg_event_flags = arg_event_flags.into_raw();
f(arg_self_, arg_command_id, arg_event_flags);
}
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_run_quick_menu_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_run_quick_menu_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RunQuickMenuCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_run_quick_menu_callback_t> for &RunQuickMenuCallback {
fn into_raw(self) -> *mut _cef_run_quick_menu_callback_t {
ImplRunQuickMenuCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_run_quick_menu_callback_t> for &mut RunQuickMenuCallback {
fn into_raw(self) -> *mut _cef_run_quick_menu_callback_t {
ImplRunQuickMenuCallback::get_raw(self)
}
}
impl ConvertReturnValue<RunQuickMenuCallback> for *mut _cef_run_quick_menu_callback_t {
fn wrap_result(self) -> RunQuickMenuCallback {
RunQuickMenuCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RunQuickMenuCallback> for *mut _cef_run_quick_menu_callback_t {
fn from(value: RunQuickMenuCallback) -> Self {
let object = ImplRunQuickMenuCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_context_menu_handler_t`] for more documentation.
#[derive(Clone)]
pub struct ContextMenuHandler(RefGuard<_cef_context_menu_handler_t>);
impl ContextMenuHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapContextMenuHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplContextMenuHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapContextMenuHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_context_menu_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapContextMenuHandler: ImplContextMenuHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_context_menu_handler_t, Self>);
}
pub trait ImplContextMenuHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_context_menu_handler_t::on_before_context_menu`] for more documentation."]
fn on_before_context_menu(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
params: Option<&mut ContextMenuParams>,
model: Option<&mut MenuModel>,
) {
}
#[doc = "See [`_cef_context_menu_handler_t::run_context_menu`] for more documentation."]
fn run_context_menu(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
params: Option<&mut ContextMenuParams>,
model: Option<&mut MenuModel>,
callback: Option<&mut RunContextMenuCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_context_menu_handler_t::on_context_menu_command`] for more documentation."]
fn on_context_menu_command(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
params: Option<&mut ContextMenuParams>,
command_id: ::std::os::raw::c_int,
event_flags: EventFlags,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_context_menu_handler_t::on_context_menu_dismissed`] for more documentation."]
fn on_context_menu_dismissed(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {}
#[doc = "See [`_cef_context_menu_handler_t::run_quick_menu`] for more documentation."]
fn run_quick_menu(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
location: Option<&Point>,
size: Option<&Size>,
edit_state_flags: QuickMenuEditStateFlags,
callback: Option<&mut RunQuickMenuCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_context_menu_handler_t::on_quick_menu_command`] for more documentation."]
fn on_quick_menu_command(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
command_id: ::std::os::raw::c_int,
event_flags: EventFlags,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_context_menu_handler_t::on_quick_menu_dismissed`] for more documentation."]
fn on_quick_menu_dismissed(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {}
fn init_methods(object: &mut _cef_context_menu_handler_t) {
impl_cef_context_menu_handler_t::init_methods::<Self, _cef_context_menu_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_context_menu_handler_t;
}
#[doc = "Implement the [`WrapContextMenuHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ContextMenuHandler` block you can override default\nmethods implemented by the [`ImplContextMenuHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_context_menu_handler! {\n struct MyContextMenuHandler {\n payload: String,\n }\n\n impl ContextMenuHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> ContextMenuHandler {\n MyContextMenuHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_context_menu_handler { ($ vis : vis struct $ name : ident ; impl ContextMenuHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_context_menu_handler ! { $ vis struct $ name { } impl ContextMenuHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ContextMenuHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_context_menu_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ContextMenuHandler { ContextMenuHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapContextMenuHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_context_menu_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplContextMenuHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_context_menu_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_context_menu_handler_t {
use super::*;
pub fn init_methods<I: ImplContextMenuHandler, R: Rc>(
object: &mut _cef_context_menu_handler_t,
) {
object.on_before_context_menu = Some(on_before_context_menu::<I, R>);
object.run_context_menu = Some(run_context_menu::<I, R>);
object.on_context_menu_command = Some(on_context_menu_command::<I, R>);
object.on_context_menu_dismissed = Some(on_context_menu_dismissed::<I, R>);
object.run_quick_menu = Some(run_quick_menu::<I, R>);
object.on_quick_menu_command = Some(on_quick_menu_command::<I, R>);
object.on_quick_menu_dismissed = Some(on_quick_menu_dismissed::<I, R>);
}
extern "C" fn on_before_context_menu<I: ImplContextMenuHandler, R: Rc>(
self_: *mut _cef_context_menu_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
params: *mut _cef_context_menu_params_t,
model: *mut _cef_menu_model_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_params, arg_model) =
(self_, browser, frame, params, model);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_params = unsafe { arg_params.as_mut() }
.map(|arg| ContextMenuParams(unsafe { RefGuard::from_raw(arg) }));
let arg_params = arg_params.as_mut();
let mut arg_model =
unsafe { arg_model.as_mut() }.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_model = arg_model.as_mut();
ImplContextMenuHandler::on_before_context_menu(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_params,
arg_model,
)
}
extern "C" fn run_context_menu<I: ImplContextMenuHandler, R: Rc>(
self_: *mut _cef_context_menu_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
params: *mut _cef_context_menu_params_t,
model: *mut _cef_menu_model_t,
callback: *mut _cef_run_context_menu_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_params, arg_model, arg_callback) =
(self_, browser, frame, params, model, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_params = unsafe { arg_params.as_mut() }
.map(|arg| ContextMenuParams(unsafe { RefGuard::from_raw(arg) }));
let arg_params = arg_params.as_mut();
let mut arg_model =
unsafe { arg_model.as_mut() }.map(|arg| MenuModel(unsafe { RefGuard::from_raw(arg) }));
let arg_model = arg_model.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| RunContextMenuCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplContextMenuHandler::run_context_menu(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_params,
arg_model,
arg_callback,
)
}
extern "C" fn on_context_menu_command<I: ImplContextMenuHandler, R: Rc>(
self_: *mut _cef_context_menu_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
params: *mut _cef_context_menu_params_t,
command_id: ::std::os::raw::c_int,
event_flags: cef_event_flags_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_params, arg_command_id, arg_event_flags) =
(self_, browser, frame, params, command_id, event_flags);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_params = unsafe { arg_params.as_mut() }
.map(|arg| ContextMenuParams(unsafe { RefGuard::from_raw(arg) }));
let arg_params = arg_params.as_mut();
let arg_command_id = arg_command_id.into_raw();
let arg_event_flags = arg_event_flags.into_raw();
ImplContextMenuHandler::on_context_menu_command(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_params,
arg_command_id,
arg_event_flags,
)
}
extern "C" fn on_context_menu_dismissed<I: ImplContextMenuHandler, R: Rc>(
self_: *mut _cef_context_menu_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
) {
let (arg_self_, arg_browser, arg_frame) = (self_, browser, frame);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
ImplContextMenuHandler::on_context_menu_dismissed(
&arg_self_.interface,
arg_browser,
arg_frame,
)
}
extern "C" fn run_quick_menu<I: ImplContextMenuHandler, R: Rc>(
self_: *mut _cef_context_menu_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
location: *const _cef_point_t,
size: *const _cef_size_t,
edit_state_flags: cef_quick_menu_edit_state_flags_t,
callback: *mut _cef_run_quick_menu_callback_t,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_frame,
arg_location,
arg_size,
arg_edit_state_flags,
arg_callback,
) = (
self_,
browser,
frame,
location,
size,
edit_state_flags,
callback,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_location = if arg_location.is_null() {
None
} else {
Some(WrapParamRef::<Point, _>::from(arg_location))
};
let arg_location = arg_location.as_ref().map(|arg| arg.as_ref());
let arg_size = if arg_size.is_null() {
None
} else {
Some(WrapParamRef::<Size, _>::from(arg_size))
};
let arg_size = arg_size.as_ref().map(|arg| arg.as_ref());
let arg_edit_state_flags = arg_edit_state_flags.into_raw();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| RunQuickMenuCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplContextMenuHandler::run_quick_menu(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_location,
arg_size,
arg_edit_state_flags,
arg_callback,
)
}
extern "C" fn on_quick_menu_command<I: ImplContextMenuHandler, R: Rc>(
self_: *mut _cef_context_menu_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
command_id: ::std::os::raw::c_int,
event_flags: cef_event_flags_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_command_id, arg_event_flags) =
(self_, browser, frame, command_id, event_flags);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_command_id = arg_command_id.into_raw();
let arg_event_flags = arg_event_flags.into_raw();
ImplContextMenuHandler::on_quick_menu_command(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_command_id,
arg_event_flags,
)
}
extern "C" fn on_quick_menu_dismissed<I: ImplContextMenuHandler, R: Rc>(
self_: *mut _cef_context_menu_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
) {
let (arg_self_, arg_browser, arg_frame) = (self_, browser, frame);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
ImplContextMenuHandler::on_quick_menu_dismissed(
&arg_self_.interface,
arg_browser,
arg_frame,
)
}
}
impl ImplContextMenuHandler for ContextMenuHandler {
fn on_before_context_menu(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
params: Option<&mut ContextMenuParams>,
model: Option<&mut MenuModel>,
) {
unsafe {
if let Some(f) = self.0.on_before_context_menu {
let (arg_browser, arg_frame, arg_params, arg_model) =
(browser, frame, params, model);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_params = arg_params
.map(|arg| {
arg.add_ref();
ImplContextMenuParams::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_model = arg_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame, arg_params, arg_model);
}
}
}
fn run_context_menu(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
params: Option<&mut ContextMenuParams>,
model: Option<&mut MenuModel>,
callback: Option<&mut RunContextMenuCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.run_context_menu
.map(|f| {
let (arg_browser, arg_frame, arg_params, arg_model, arg_callback) =
(browser, frame, params, model, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_params = arg_params
.map(|arg| {
arg.add_ref();
ImplContextMenuParams::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_model = arg_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplRunContextMenuCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_params,
arg_model,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_context_menu_command(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
params: Option<&mut ContextMenuParams>,
command_id: ::std::os::raw::c_int,
event_flags: EventFlags,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_context_menu_command
.map(|f| {
let (arg_browser, arg_frame, arg_params, arg_command_id, arg_event_flags) =
(browser, frame, params, command_id, event_flags);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_params = arg_params
.map(|arg| {
arg.add_ref();
ImplContextMenuParams::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event_flags = arg_event_flags.into_raw();
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_params,
arg_command_id,
arg_event_flags,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_context_menu_dismissed(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {
unsafe {
if let Some(f) = self.0.on_context_menu_dismissed {
let (arg_browser, arg_frame) = (browser, frame);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame);
}
}
}
fn run_quick_menu(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
location: Option<&Point>,
size: Option<&Size>,
edit_state_flags: QuickMenuEditStateFlags,
callback: Option<&mut RunQuickMenuCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.run_quick_menu
.map(|f| {
let (
arg_browser,
arg_frame,
arg_location,
arg_size,
arg_edit_state_flags,
arg_callback,
) = (browser, frame, location, size, edit_state_flags, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_location = arg_location.cloned().map(|arg| arg.into());
let arg_location = arg_location
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_size = arg_size.cloned().map(|arg| arg.into());
let arg_size = arg_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_edit_state_flags = arg_edit_state_flags.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplRunQuickMenuCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_location,
arg_size,
arg_edit_state_flags,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_quick_menu_command(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
command_id: ::std::os::raw::c_int,
event_flags: EventFlags,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_quick_menu_command
.map(|f| {
let (arg_browser, arg_frame, arg_command_id, arg_event_flags) =
(browser, frame, command_id, event_flags);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event_flags = arg_event_flags.into_raw();
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_command_id,
arg_event_flags,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_quick_menu_dismissed(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {
unsafe {
if let Some(f) = self.0.on_quick_menu_dismissed {
let (arg_browser, arg_frame) = (browser, frame);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame);
}
}
}
fn get_raw(&self) -> *mut _cef_context_menu_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_context_menu_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ContextMenuHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_context_menu_handler_t> for &ContextMenuHandler {
fn into_raw(self) -> *mut _cef_context_menu_handler_t {
ImplContextMenuHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_context_menu_handler_t> for &mut ContextMenuHandler {
fn into_raw(self) -> *mut _cef_context_menu_handler_t {
ImplContextMenuHandler::get_raw(self)
}
}
impl ConvertReturnValue<ContextMenuHandler> for *mut _cef_context_menu_handler_t {
fn wrap_result(self) -> ContextMenuHandler {
ContextMenuHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ContextMenuHandler> for *mut _cef_context_menu_handler_t {
fn from(value: ContextMenuHandler) -> Self {
let object = ImplContextMenuHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_context_menu_params_t`] for more documentation.
#[derive(Clone)]
pub struct ContextMenuParams(RefGuard<_cef_context_menu_params_t>);
pub trait ImplContextMenuParams: Clone + Sized + Rc {
#[doc = "See [`_cef_context_menu_params_t::get_xcoord`] for more documentation."]
fn xcoord(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_context_menu_params_t::get_ycoord`] for more documentation."]
fn ycoord(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_context_menu_params_t::get_type_flags`] for more documentation."]
fn type_flags(&self) -> ContextMenuTypeFlags;
#[doc = "See [`_cef_context_menu_params_t::get_link_url`] for more documentation."]
fn link_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_unfiltered_link_url`] for more documentation."]
fn unfiltered_link_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_source_url`] for more documentation."]
fn source_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::has_image_contents`] for more documentation."]
fn has_image_contents(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_context_menu_params_t::get_title_text`] for more documentation."]
fn title_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_page_url`] for more documentation."]
fn page_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_frame_url`] for more documentation."]
fn frame_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_frame_charset`] for more documentation."]
fn frame_charset(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_media_type`] for more documentation."]
fn media_type(&self) -> ContextMenuMediaType;
#[doc = "See [`_cef_context_menu_params_t::get_media_state_flags`] for more documentation."]
fn media_state_flags(&self) -> ContextMenuMediaStateFlags;
#[doc = "See [`_cef_context_menu_params_t::get_selection_text`] for more documentation."]
fn selection_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_misspelled_word`] for more documentation."]
fn misspelled_word(&self) -> CefStringUserfree;
#[doc = "See [`_cef_context_menu_params_t::get_dictionary_suggestions`] for more documentation."]
fn dictionary_suggestions(
&self,
suggestions: Option<&mut CefStringList>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_context_menu_params_t::is_editable`] for more documentation."]
fn is_editable(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_context_menu_params_t::is_spell_check_enabled`] for more documentation."]
fn is_spell_check_enabled(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_context_menu_params_t::get_edit_state_flags`] for more documentation."]
fn edit_state_flags(&self) -> ContextMenuEditStateFlags;
#[doc = "See [`_cef_context_menu_params_t::is_custom_menu`] for more documentation."]
fn is_custom_menu(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_context_menu_params_t;
}
impl ImplContextMenuParams for ContextMenuParams {
fn xcoord(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_xcoord
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn ycoord(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_ycoord
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn type_flags(&self) -> ContextMenuTypeFlags {
unsafe {
self.0
.get_type_flags
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn link_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_link_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn unfiltered_link_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_unfiltered_link_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn source_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_source_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_image_contents(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_image_contents
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn title_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_title_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn page_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_page_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn frame_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_frame_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn frame_charset(&self) -> CefStringUserfree {
unsafe {
self.0
.get_frame_charset
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn media_type(&self) -> ContextMenuMediaType {
unsafe {
self.0
.get_media_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn media_state_flags(&self) -> ContextMenuMediaStateFlags {
unsafe {
self.0
.get_media_state_flags
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn selection_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_selection_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn misspelled_word(&self) -> CefStringUserfree {
unsafe {
self.0
.get_misspelled_word
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn dictionary_suggestions(
&self,
suggestions: Option<&mut CefStringList>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_dictionary_suggestions
.map(|f| {
let arg_suggestions = suggestions;
let arg_self_ = self.into_raw();
let arg_suggestions = arg_suggestions
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_suggestions);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_editable(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_editable
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_spell_check_enabled(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_spell_check_enabled
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn edit_state_flags(&self) -> ContextMenuEditStateFlags {
unsafe {
self.0
.get_edit_state_flags
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_custom_menu(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_custom_menu
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_context_menu_params_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_context_menu_params_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ContextMenuParams {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_context_menu_params_t> for &ContextMenuParams {
fn into_raw(self) -> *mut _cef_context_menu_params_t {
ImplContextMenuParams::get_raw(self)
}
}
impl ConvertParam<*mut _cef_context_menu_params_t> for &mut ContextMenuParams {
fn into_raw(self) -> *mut _cef_context_menu_params_t {
ImplContextMenuParams::get_raw(self)
}
}
impl ConvertReturnValue<ContextMenuParams> for *mut _cef_context_menu_params_t {
fn wrap_result(self) -> ContextMenuParams {
ContextMenuParams(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ContextMenuParams> for *mut _cef_context_menu_params_t {
fn from(value: ContextMenuParams) -> Self {
let object = ImplContextMenuParams::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_file_dialog_callback_t`] for more documentation.
#[derive(Clone)]
pub struct FileDialogCallback(RefGuard<_cef_file_dialog_callback_t>);
pub trait ImplFileDialogCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_file_dialog_callback_t::cont`] for more documentation."]
fn cont(&self, file_paths: Option<&mut CefStringList>);
#[doc = "See [`_cef_file_dialog_callback_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_file_dialog_callback_t;
}
impl ImplFileDialogCallback for FileDialogCallback {
fn cont(&self, file_paths: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.cont {
let arg_file_paths = file_paths;
let arg_self_ = self.into_raw();
let arg_file_paths = arg_file_paths
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_file_paths);
}
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_file_dialog_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_file_dialog_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for FileDialogCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_file_dialog_callback_t> for &FileDialogCallback {
fn into_raw(self) -> *mut _cef_file_dialog_callback_t {
ImplFileDialogCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_file_dialog_callback_t> for &mut FileDialogCallback {
fn into_raw(self) -> *mut _cef_file_dialog_callback_t {
ImplFileDialogCallback::get_raw(self)
}
}
impl ConvertReturnValue<FileDialogCallback> for *mut _cef_file_dialog_callback_t {
fn wrap_result(self) -> FileDialogCallback {
FileDialogCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<FileDialogCallback> for *mut _cef_file_dialog_callback_t {
fn from(value: FileDialogCallback) -> Self {
let object = ImplFileDialogCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_dialog_handler_t`] for more documentation.
#[derive(Clone)]
pub struct DialogHandler(RefGuard<_cef_dialog_handler_t>);
impl DialogHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapDialogHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDialogHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDialogHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_dialog_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDialogHandler: ImplDialogHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_dialog_handler_t, Self>);
}
pub trait ImplDialogHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_dialog_handler_t::on_file_dialog`] for more documentation."]
fn on_file_dialog(
&self,
browser: Option<&mut Browser>,
mode: FileDialogMode,
title: Option<&CefString>,
default_file_path: Option<&CefString>,
accept_filters: Option<&mut CefStringList>,
accept_extensions: Option<&mut CefStringList>,
accept_descriptions: Option<&mut CefStringList>,
callback: Option<&mut FileDialogCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_dialog_handler_t) {
impl_cef_dialog_handler_t::init_methods::<Self, _cef_dialog_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_dialog_handler_t;
}
#[doc = "Implement the [`WrapDialogHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl DialogHandler` block you can override default\nmethods implemented by the [`ImplDialogHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_dialog_handler! {\n struct MyDialogHandler {\n payload: String,\n }\n\n impl DialogHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> DialogHandler {\n MyDialogHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_dialog_handler { ($ vis : vis struct $ name : ident ; impl DialogHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_dialog_handler ! { $ vis struct $ name { } impl DialogHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl DialogHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_dialog_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> DialogHandler { DialogHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDialogHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_dialog_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDialogHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_dialog_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_dialog_handler_t {
use super::*;
pub fn init_methods<I: ImplDialogHandler, R: Rc>(object: &mut _cef_dialog_handler_t) {
object.on_file_dialog = Some(on_file_dialog::<I, R>);
}
extern "C" fn on_file_dialog<I: ImplDialogHandler, R: Rc>(
self_: *mut _cef_dialog_handler_t,
browser: *mut _cef_browser_t,
mode: cef_file_dialog_mode_t,
title: *const cef_string_t,
default_file_path: *const cef_string_t,
accept_filters: *mut _cef_string_list_t,
accept_extensions: *mut _cef_string_list_t,
accept_descriptions: *mut _cef_string_list_t,
callback: *mut _cef_file_dialog_callback_t,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_mode,
arg_title,
arg_default_file_path,
arg_accept_filters,
arg_accept_extensions,
arg_accept_descriptions,
arg_callback,
) = (
self_,
browser,
mode,
title,
default_file_path,
accept_filters,
accept_extensions,
accept_descriptions,
callback,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_mode = arg_mode.into_raw();
let arg_title = if arg_title.is_null() {
None
} else {
Some(arg_title.into())
};
let arg_title = arg_title.as_ref();
let arg_default_file_path = if arg_default_file_path.is_null() {
None
} else {
Some(arg_default_file_path.into())
};
let arg_default_file_path = arg_default_file_path.as_ref();
let mut arg_accept_filters = if arg_accept_filters.is_null() {
None
} else {
Some(arg_accept_filters.into())
};
let arg_accept_filters = arg_accept_filters.as_mut();
let mut arg_accept_extensions = if arg_accept_extensions.is_null() {
None
} else {
Some(arg_accept_extensions.into())
};
let arg_accept_extensions = arg_accept_extensions.as_mut();
let mut arg_accept_descriptions = if arg_accept_descriptions.is_null() {
None
} else {
Some(arg_accept_descriptions.into())
};
let arg_accept_descriptions = arg_accept_descriptions.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| FileDialogCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplDialogHandler::on_file_dialog(
&arg_self_.interface,
arg_browser,
arg_mode,
arg_title,
arg_default_file_path,
arg_accept_filters,
arg_accept_extensions,
arg_accept_descriptions,
arg_callback,
)
}
}
impl ImplDialogHandler for DialogHandler {
fn on_file_dialog(
&self,
browser: Option<&mut Browser>,
mode: FileDialogMode,
title: Option<&CefString>,
default_file_path: Option<&CefString>,
accept_filters: Option<&mut CefStringList>,
accept_extensions: Option<&mut CefStringList>,
accept_descriptions: Option<&mut CefStringList>,
callback: Option<&mut FileDialogCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_file_dialog
.map(|f| {
let (
arg_browser,
arg_mode,
arg_title,
arg_default_file_path,
arg_accept_filters,
arg_accept_extensions,
arg_accept_descriptions,
arg_callback,
) = (
browser,
mode,
title,
default_file_path,
accept_filters,
accept_extensions,
accept_descriptions,
callback,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_mode = arg_mode.into_raw();
let arg_title = arg_title
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_default_file_path = arg_default_file_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_accept_filters = arg_accept_filters
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_accept_extensions = arg_accept_extensions
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_accept_descriptions = arg_accept_descriptions
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplFileDialogCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_mode,
arg_title,
arg_default_file_path,
arg_accept_filters,
arg_accept_extensions,
arg_accept_descriptions,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_dialog_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_dialog_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DialogHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_dialog_handler_t> for &DialogHandler {
fn into_raw(self) -> *mut _cef_dialog_handler_t {
ImplDialogHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_dialog_handler_t> for &mut DialogHandler {
fn into_raw(self) -> *mut _cef_dialog_handler_t {
ImplDialogHandler::get_raw(self)
}
}
impl ConvertReturnValue<DialogHandler> for *mut _cef_dialog_handler_t {
fn wrap_result(self) -> DialogHandler {
DialogHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DialogHandler> for *mut _cef_dialog_handler_t {
fn from(value: DialogHandler) -> Self {
let object = ImplDialogHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_display_handler_t`] for more documentation.
#[derive(Clone)]
pub struct DisplayHandler(RefGuard<_cef_display_handler_t>);
impl DisplayHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapDisplayHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDisplayHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDisplayHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_display_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDisplayHandler: ImplDisplayHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_display_handler_t, Self>);
}
pub trait ImplDisplayHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_display_handler_t::on_address_change`] for more documentation."]
fn on_address_change(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
url: Option<&CefString>,
) {
}
#[doc = "See [`_cef_display_handler_t::on_title_change`] for more documentation."]
fn on_title_change(&self, browser: Option<&mut Browser>, title: Option<&CefString>) {}
#[doc = "See [`_cef_display_handler_t::on_favicon_urlchange`] for more documentation."]
fn on_favicon_urlchange(
&self,
browser: Option<&mut Browser>,
icon_urls: Option<&mut CefStringList>,
) {
}
#[doc = "See [`_cef_display_handler_t::on_fullscreen_mode_change`] for more documentation."]
fn on_fullscreen_mode_change(
&self,
browser: Option<&mut Browser>,
fullscreen: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_display_handler_t::on_tooltip`] for more documentation."]
fn on_tooltip(
&self,
browser: Option<&mut Browser>,
text: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_display_handler_t::on_status_message`] for more documentation."]
fn on_status_message(&self, browser: Option<&mut Browser>, value: Option<&CefString>) {}
#[doc = "See [`_cef_display_handler_t::on_console_message`] for more documentation."]
fn on_console_message(
&self,
browser: Option<&mut Browser>,
level: LogSeverity,
message: Option<&CefString>,
source: Option<&CefString>,
line: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_display_handler_t::on_auto_resize`] for more documentation."]
fn on_auto_resize(
&self,
browser: Option<&mut Browser>,
new_size: Option<&Size>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_display_handler_t::on_loading_progress_change`] for more documentation."]
fn on_loading_progress_change(&self, browser: Option<&mut Browser>, progress: f64) {}
#[doc = "See [`_cef_display_handler_t::on_cursor_change`] for more documentation."]
fn on_cursor_change(
&self,
browser: Option<&mut Browser>,
cursor: HCURSOR,
type_: CursorType,
custom_cursor_info: Option<&CursorInfo>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_display_handler_t::on_media_access_change`] for more documentation."]
fn on_media_access_change(
&self,
browser: Option<&mut Browser>,
has_video_access: ::std::os::raw::c_int,
has_audio_access: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_display_handler_t::on_contents_bounds_change`] for more documentation."]
fn on_contents_bounds_change(
&self,
browser: Option<&mut Browser>,
new_bounds: Option<&Rect>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_display_handler_t::get_root_window_screen_rect`] for more documentation."]
fn root_window_screen_rect(
&self,
browser: Option<&mut Browser>,
rect: Option<&mut Rect>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_display_handler_t) {
impl_cef_display_handler_t::init_methods::<Self, _cef_display_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_display_handler_t;
}
#[doc = "Implement the [`WrapDisplayHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl DisplayHandler` block you can override default\nmethods implemented by the [`ImplDisplayHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_display_handler! {\n struct MyDisplayHandler {\n payload: String,\n }\n\n impl DisplayHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> DisplayHandler {\n MyDisplayHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_display_handler { ($ vis : vis struct $ name : ident ; impl DisplayHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_display_handler ! { $ vis struct $ name { } impl DisplayHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl DisplayHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_display_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> DisplayHandler { DisplayHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDisplayHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_display_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDisplayHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_display_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_display_handler_t {
use super::*;
pub fn init_methods<I: ImplDisplayHandler, R: Rc>(object: &mut _cef_display_handler_t) {
object.on_address_change = Some(on_address_change::<I, R>);
object.on_title_change = Some(on_title_change::<I, R>);
object.on_favicon_urlchange = Some(on_favicon_urlchange::<I, R>);
object.on_fullscreen_mode_change = Some(on_fullscreen_mode_change::<I, R>);
object.on_tooltip = Some(on_tooltip::<I, R>);
object.on_status_message = Some(on_status_message::<I, R>);
object.on_console_message = Some(on_console_message::<I, R>);
object.on_auto_resize = Some(on_auto_resize::<I, R>);
object.on_loading_progress_change = Some(on_loading_progress_change::<I, R>);
object.on_cursor_change = Some(on_cursor_change::<I, R>);
object.on_media_access_change = Some(on_media_access_change::<I, R>);
object.on_contents_bounds_change = Some(on_contents_bounds_change::<I, R>);
object.get_root_window_screen_rect = Some(get_root_window_screen_rect::<I, R>);
}
extern "C" fn on_address_change<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
url: *const cef_string_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_url) = (self_, browser, frame, url);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_url = if arg_url.is_null() {
None
} else {
Some(arg_url.into())
};
let arg_url = arg_url.as_ref();
ImplDisplayHandler::on_address_change(&arg_self_.interface, arg_browser, arg_frame, arg_url)
}
extern "C" fn on_title_change<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
title: *const cef_string_t,
) {
let (arg_self_, arg_browser, arg_title) = (self_, browser, title);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_title = if arg_title.is_null() {
None
} else {
Some(arg_title.into())
};
let arg_title = arg_title.as_ref();
ImplDisplayHandler::on_title_change(&arg_self_.interface, arg_browser, arg_title)
}
extern "C" fn on_favicon_urlchange<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
icon_urls: *mut _cef_string_list_t,
) {
let (arg_self_, arg_browser, arg_icon_urls) = (self_, browser, icon_urls);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_icon_urls = if arg_icon_urls.is_null() {
None
} else {
Some(arg_icon_urls.into())
};
let arg_icon_urls = arg_icon_urls.as_mut();
ImplDisplayHandler::on_favicon_urlchange(&arg_self_.interface, arg_browser, arg_icon_urls)
}
extern "C" fn on_fullscreen_mode_change<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
fullscreen: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_fullscreen) = (self_, browser, fullscreen);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_fullscreen = arg_fullscreen.into_raw();
ImplDisplayHandler::on_fullscreen_mode_change(
&arg_self_.interface,
arg_browser,
arg_fullscreen,
)
}
extern "C" fn on_tooltip<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
text: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_text) = (self_, browser, text);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_text = if arg_text.is_null() {
None
} else {
Some(arg_text.into())
};
let arg_text = arg_text.as_mut();
ImplDisplayHandler::on_tooltip(&arg_self_.interface, arg_browser, arg_text)
}
extern "C" fn on_status_message<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
value: *const cef_string_t,
) {
let (arg_self_, arg_browser, arg_value) = (self_, browser, value);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_value = if arg_value.is_null() {
None
} else {
Some(arg_value.into())
};
let arg_value = arg_value.as_ref();
ImplDisplayHandler::on_status_message(&arg_self_.interface, arg_browser, arg_value)
}
extern "C" fn on_console_message<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
level: cef_log_severity_t,
message: *const cef_string_t,
source: *const cef_string_t,
line: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_level, arg_message, arg_source, arg_line) =
(self_, browser, level, message, source, line);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_level = arg_level.into_raw();
let arg_message = if arg_message.is_null() {
None
} else {
Some(arg_message.into())
};
let arg_message = arg_message.as_ref();
let arg_source = if arg_source.is_null() {
None
} else {
Some(arg_source.into())
};
let arg_source = arg_source.as_ref();
let arg_line = arg_line.into_raw();
ImplDisplayHandler::on_console_message(
&arg_self_.interface,
arg_browser,
arg_level,
arg_message,
arg_source,
arg_line,
)
}
extern "C" fn on_auto_resize<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
new_size: *const _cef_size_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_new_size) = (self_, browser, new_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_new_size = if arg_new_size.is_null() {
None
} else {
Some(WrapParamRef::<Size, _>::from(arg_new_size))
};
let arg_new_size = arg_new_size.as_ref().map(|arg| arg.as_ref());
ImplDisplayHandler::on_auto_resize(&arg_self_.interface, arg_browser, arg_new_size)
}
extern "C" fn on_loading_progress_change<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
progress: f64,
) {
let (arg_self_, arg_browser, arg_progress) = (self_, browser, progress);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_progress = arg_progress.into_raw();
ImplDisplayHandler::on_loading_progress_change(
&arg_self_.interface,
arg_browser,
arg_progress,
)
}
extern "C" fn on_cursor_change<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
cursor: HCURSOR,
type_: cef_cursor_type_t,
custom_cursor_info: *const _cef_cursor_info_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_cursor, arg_type_, arg_custom_cursor_info) =
(self_, browser, cursor, type_, custom_cursor_info);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_cursor = arg_cursor.into_raw();
let arg_type_ = arg_type_.into_raw();
let arg_custom_cursor_info = if arg_custom_cursor_info.is_null() {
None
} else {
Some(WrapParamRef::<CursorInfo, _>::from(arg_custom_cursor_info))
};
let arg_custom_cursor_info = arg_custom_cursor_info.as_ref().map(|arg| arg.as_ref());
ImplDisplayHandler::on_cursor_change(
&arg_self_.interface,
arg_browser,
arg_cursor,
arg_type_,
arg_custom_cursor_info,
)
}
extern "C" fn on_media_access_change<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
has_video_access: ::std::os::raw::c_int,
has_audio_access: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_has_video_access, arg_has_audio_access) =
(self_, browser, has_video_access, has_audio_access);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_has_video_access = arg_has_video_access.into_raw();
let arg_has_audio_access = arg_has_audio_access.into_raw();
ImplDisplayHandler::on_media_access_change(
&arg_self_.interface,
arg_browser,
arg_has_video_access,
arg_has_audio_access,
)
}
extern "C" fn on_contents_bounds_change<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
new_bounds: *const _cef_rect_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_new_bounds) = (self_, browser, new_bounds);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_new_bounds = if arg_new_bounds.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_new_bounds))
};
let arg_new_bounds = arg_new_bounds.as_ref().map(|arg| arg.as_ref());
ImplDisplayHandler::on_contents_bounds_change(
&arg_self_.interface,
arg_browser,
arg_new_bounds,
)
}
extern "C" fn get_root_window_screen_rect<I: ImplDisplayHandler, R: Rc>(
self_: *mut _cef_display_handler_t,
browser: *mut _cef_browser_t,
rect: *mut _cef_rect_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_rect) = (self_, browser, rect);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_rect = if arg_rect.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_rect))
};
let arg_rect = arg_rect.as_mut().map(|arg| arg.as_mut());
ImplDisplayHandler::root_window_screen_rect(&arg_self_.interface, arg_browser, arg_rect)
}
}
impl ImplDisplayHandler for DisplayHandler {
fn on_address_change(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
url: Option<&CefString>,
) {
unsafe {
if let Some(f) = self.0.on_address_change {
let (arg_browser, arg_frame, arg_url) = (browser, frame, url);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_browser, arg_frame, arg_url);
}
}
}
fn on_title_change(&self, browser: Option<&mut Browser>, title: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.on_title_change {
let (arg_browser, arg_title) = (browser, title);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_title = arg_title
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_browser, arg_title);
}
}
}
fn on_favicon_urlchange(
&self,
browser: Option<&mut Browser>,
icon_urls: Option<&mut CefStringList>,
) {
unsafe {
if let Some(f) = self.0.on_favicon_urlchange {
let (arg_browser, arg_icon_urls) = (browser, icon_urls);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_icon_urls = arg_icon_urls
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_icon_urls);
}
}
}
fn on_fullscreen_mode_change(
&self,
browser: Option<&mut Browser>,
fullscreen: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_fullscreen_mode_change {
let (arg_browser, arg_fullscreen) = (browser, fullscreen);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_fullscreen);
}
}
}
fn on_tooltip(
&self,
browser: Option<&mut Browser>,
text: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_tooltip
.map(|f| {
let (arg_browser, arg_text) = (browser, text);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_text);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_status_message(&self, browser: Option<&mut Browser>, value: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.on_status_message {
let (arg_browser, arg_value) = (browser, value);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_browser, arg_value);
}
}
}
fn on_console_message(
&self,
browser: Option<&mut Browser>,
level: LogSeverity,
message: Option<&CefString>,
source: Option<&CefString>,
line: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_console_message
.map(|f| {
let (arg_browser, arg_level, arg_message, arg_source, arg_line) =
(browser, level, message, source, line);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_level = arg_level.into_raw();
let arg_message = arg_message
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_source = arg_source
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(
arg_self_,
arg_browser,
arg_level,
arg_message,
arg_source,
arg_line,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_auto_resize(
&self,
browser: Option<&mut Browser>,
new_size: Option<&Size>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_auto_resize
.map(|f| {
let (arg_browser, arg_new_size) = (browser, new_size);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_new_size = arg_new_size.cloned().map(|arg| arg.into());
let arg_new_size = arg_new_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_browser, arg_new_size);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_loading_progress_change(&self, browser: Option<&mut Browser>, progress: f64) {
unsafe {
if let Some(f) = self.0.on_loading_progress_change {
let (arg_browser, arg_progress) = (browser, progress);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_progress);
}
}
}
fn on_cursor_change(
&self,
browser: Option<&mut Browser>,
cursor: HCURSOR,
type_: CursorType,
custom_cursor_info: Option<&CursorInfo>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_cursor_change
.map(|f| {
let (arg_browser, arg_cursor, arg_type_, arg_custom_cursor_info) =
(browser, cursor, type_, custom_cursor_info);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_type_ = arg_type_.into_raw();
let arg_custom_cursor_info =
arg_custom_cursor_info.cloned().map(|arg| arg.into());
let arg_custom_cursor_info = arg_custom_cursor_info
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(
arg_self_,
arg_browser,
arg_cursor,
arg_type_,
arg_custom_cursor_info,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_media_access_change(
&self,
browser: Option<&mut Browser>,
has_video_access: ::std::os::raw::c_int,
has_audio_access: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_media_access_change {
let (arg_browser, arg_has_video_access, arg_has_audio_access) =
(browser, has_video_access, has_audio_access);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_browser,
arg_has_video_access,
arg_has_audio_access,
);
}
}
}
fn on_contents_bounds_change(
&self,
browser: Option<&mut Browser>,
new_bounds: Option<&Rect>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_contents_bounds_change
.map(|f| {
let (arg_browser, arg_new_bounds) = (browser, new_bounds);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_new_bounds = arg_new_bounds.cloned().map(|arg| arg.into());
let arg_new_bounds = arg_new_bounds
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_browser, arg_new_bounds);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn root_window_screen_rect(
&self,
browser: Option<&mut Browser>,
rect: Option<&mut Rect>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_root_window_screen_rect
.map(|f| {
let (arg_browser, arg_rect) = (browser, rect);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_rect = arg_rect.cloned().map(|arg| arg.into());
let arg_rect = arg_rect
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_rect);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_display_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_display_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DisplayHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_display_handler_t> for &DisplayHandler {
fn into_raw(self) -> *mut _cef_display_handler_t {
ImplDisplayHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_display_handler_t> for &mut DisplayHandler {
fn into_raw(self) -> *mut _cef_display_handler_t {
ImplDisplayHandler::get_raw(self)
}
}
impl ConvertReturnValue<DisplayHandler> for *mut _cef_display_handler_t {
fn wrap_result(self) -> DisplayHandler {
DisplayHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DisplayHandler> for *mut _cef_display_handler_t {
fn from(value: DisplayHandler) -> Self {
let object = ImplDisplayHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_download_item_t`] for more documentation.
#[derive(Clone)]
pub struct DownloadItem(RefGuard<_cef_download_item_t>);
pub trait ImplDownloadItem: Clone + Sized + Rc {
#[doc = "See [`_cef_download_item_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_download_item_t::is_in_progress`] for more documentation."]
fn is_in_progress(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_download_item_t::is_complete`] for more documentation."]
fn is_complete(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_download_item_t::is_canceled`] for more documentation."]
fn is_canceled(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_download_item_t::is_interrupted`] for more documentation."]
fn is_interrupted(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_download_item_t::get_interrupt_reason`] for more documentation."]
fn interrupt_reason(&self) -> DownloadInterruptReason;
#[doc = "See [`_cef_download_item_t::get_current_speed`] for more documentation."]
fn current_speed(&self) -> i64;
#[doc = "See [`_cef_download_item_t::get_percent_complete`] for more documentation."]
fn percent_complete(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_download_item_t::get_total_bytes`] for more documentation."]
fn total_bytes(&self) -> i64;
#[doc = "See [`_cef_download_item_t::get_received_bytes`] for more documentation."]
fn received_bytes(&self) -> i64;
#[doc = "See [`_cef_download_item_t::get_start_time`] for more documentation."]
fn start_time(&self) -> Basetime;
#[doc = "See [`_cef_download_item_t::get_end_time`] for more documentation."]
fn end_time(&self) -> Basetime;
#[doc = "See [`_cef_download_item_t::get_full_path`] for more documentation."]
fn full_path(&self) -> CefStringUserfree;
#[doc = "See [`_cef_download_item_t::get_id`] for more documentation."]
fn id(&self) -> u32;
#[doc = "See [`_cef_download_item_t::get_url`] for more documentation."]
fn url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_download_item_t::get_original_url`] for more documentation."]
fn original_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_download_item_t::get_suggested_file_name`] for more documentation."]
fn suggested_file_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_download_item_t::get_content_disposition`] for more documentation."]
fn content_disposition(&self) -> CefStringUserfree;
#[doc = "See [`_cef_download_item_t::get_mime_type`] for more documentation."]
fn mime_type(&self) -> CefStringUserfree;
#[doc = "See [`_cef_download_item_t::is_paused`] for more documentation."]
fn is_paused(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_download_item_t;
}
impl ImplDownloadItem for DownloadItem {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_in_progress(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_in_progress
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_complete(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_complete
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_canceled(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_canceled
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_interrupted(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_interrupted
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn interrupt_reason(&self) -> DownloadInterruptReason {
unsafe {
self.0
.get_interrupt_reason
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn current_speed(&self) -> i64 {
unsafe {
self.0
.get_current_speed
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn percent_complete(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_percent_complete
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn total_bytes(&self) -> i64 {
unsafe {
self.0
.get_total_bytes
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn received_bytes(&self) -> i64 {
unsafe {
self.0
.get_received_bytes
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn start_time(&self) -> Basetime {
unsafe {
self.0
.get_start_time
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn end_time(&self) -> Basetime {
unsafe {
self.0
.get_end_time
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn full_path(&self) -> CefStringUserfree {
unsafe {
self.0
.get_full_path
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn id(&self) -> u32 {
unsafe {
self.0
.get_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn original_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_original_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn suggested_file_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_suggested_file_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn content_disposition(&self) -> CefStringUserfree {
unsafe {
self.0
.get_content_disposition
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn mime_type(&self) -> CefStringUserfree {
unsafe {
self.0
.get_mime_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_paused(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_paused
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_download_item_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_download_item_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DownloadItem {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_download_item_t> for &DownloadItem {
fn into_raw(self) -> *mut _cef_download_item_t {
ImplDownloadItem::get_raw(self)
}
}
impl ConvertParam<*mut _cef_download_item_t> for &mut DownloadItem {
fn into_raw(self) -> *mut _cef_download_item_t {
ImplDownloadItem::get_raw(self)
}
}
impl ConvertReturnValue<DownloadItem> for *mut _cef_download_item_t {
fn wrap_result(self) -> DownloadItem {
DownloadItem(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DownloadItem> for *mut _cef_download_item_t {
fn from(value: DownloadItem) -> Self {
let object = ImplDownloadItem::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_before_download_callback_t`] for more documentation.
#[derive(Clone)]
pub struct BeforeDownloadCallback(RefGuard<_cef_before_download_callback_t>);
pub trait ImplBeforeDownloadCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_before_download_callback_t::cont`] for more documentation."]
fn cont(&self, download_path: Option<&CefString>, show_dialog: ::std::os::raw::c_int);
fn get_raw(&self) -> *mut _cef_before_download_callback_t;
}
impl ImplBeforeDownloadCallback for BeforeDownloadCallback {
fn cont(&self, download_path: Option<&CefString>, show_dialog: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.cont {
let (arg_download_path, arg_show_dialog) = (download_path, show_dialog);
let arg_self_ = self.into_raw();
let arg_download_path = arg_download_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_download_path, arg_show_dialog);
}
}
}
fn get_raw(&self) -> *mut _cef_before_download_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_before_download_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for BeforeDownloadCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_before_download_callback_t> for &BeforeDownloadCallback {
fn into_raw(self) -> *mut _cef_before_download_callback_t {
ImplBeforeDownloadCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_before_download_callback_t> for &mut BeforeDownloadCallback {
fn into_raw(self) -> *mut _cef_before_download_callback_t {
ImplBeforeDownloadCallback::get_raw(self)
}
}
impl ConvertReturnValue<BeforeDownloadCallback> for *mut _cef_before_download_callback_t {
fn wrap_result(self) -> BeforeDownloadCallback {
BeforeDownloadCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BeforeDownloadCallback> for *mut _cef_before_download_callback_t {
fn from(value: BeforeDownloadCallback) -> Self {
let object = ImplBeforeDownloadCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_download_item_callback_t`] for more documentation.
#[derive(Clone)]
pub struct DownloadItemCallback(RefGuard<_cef_download_item_callback_t>);
pub trait ImplDownloadItemCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_download_item_callback_t::cancel`] for more documentation."]
fn cancel(&self);
#[doc = "See [`_cef_download_item_callback_t::pause`] for more documentation."]
fn pause(&self);
#[doc = "See [`_cef_download_item_callback_t::resume`] for more documentation."]
fn resume(&self);
fn get_raw(&self) -> *mut _cef_download_item_callback_t;
}
impl ImplDownloadItemCallback for DownloadItemCallback {
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn pause(&self) {
unsafe {
if let Some(f) = self.0.pause {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn resume(&self) {
unsafe {
if let Some(f) = self.0.resume {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_download_item_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_download_item_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DownloadItemCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_download_item_callback_t> for &DownloadItemCallback {
fn into_raw(self) -> *mut _cef_download_item_callback_t {
ImplDownloadItemCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_download_item_callback_t> for &mut DownloadItemCallback {
fn into_raw(self) -> *mut _cef_download_item_callback_t {
ImplDownloadItemCallback::get_raw(self)
}
}
impl ConvertReturnValue<DownloadItemCallback> for *mut _cef_download_item_callback_t {
fn wrap_result(self) -> DownloadItemCallback {
DownloadItemCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DownloadItemCallback> for *mut _cef_download_item_callback_t {
fn from(value: DownloadItemCallback) -> Self {
let object = ImplDownloadItemCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_download_handler_t`] for more documentation.
#[derive(Clone)]
pub struct DownloadHandler(RefGuard<_cef_download_handler_t>);
impl DownloadHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapDownloadHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDownloadHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDownloadHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_download_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDownloadHandler: ImplDownloadHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_download_handler_t, Self>);
}
pub trait ImplDownloadHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_download_handler_t::can_download`] for more documentation."]
fn can_download(
&self,
browser: Option<&mut Browser>,
url: Option<&CefString>,
request_method: Option<&CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_download_handler_t::on_before_download`] for more documentation."]
fn on_before_download(
&self,
browser: Option<&mut Browser>,
download_item: Option<&mut DownloadItem>,
suggested_name: Option<&CefString>,
callback: Option<&mut BeforeDownloadCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_download_handler_t::on_download_updated`] for more documentation."]
fn on_download_updated(
&self,
browser: Option<&mut Browser>,
download_item: Option<&mut DownloadItem>,
callback: Option<&mut DownloadItemCallback>,
) {
}
fn init_methods(object: &mut _cef_download_handler_t) {
impl_cef_download_handler_t::init_methods::<Self, _cef_download_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_download_handler_t;
}
#[doc = "Implement the [`WrapDownloadHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl DownloadHandler` block you can override default\nmethods implemented by the [`ImplDownloadHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_download_handler! {\n struct MyDownloadHandler {\n payload: String,\n }\n\n impl DownloadHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> DownloadHandler {\n MyDownloadHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_download_handler { ($ vis : vis struct $ name : ident ; impl DownloadHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_download_handler ! { $ vis struct $ name { } impl DownloadHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl DownloadHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_download_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> DownloadHandler { DownloadHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDownloadHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_download_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDownloadHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_download_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_download_handler_t {
use super::*;
pub fn init_methods<I: ImplDownloadHandler, R: Rc>(object: &mut _cef_download_handler_t) {
object.can_download = Some(can_download::<I, R>);
object.on_before_download = Some(on_before_download::<I, R>);
object.on_download_updated = Some(on_download_updated::<I, R>);
}
extern "C" fn can_download<I: ImplDownloadHandler, R: Rc>(
self_: *mut _cef_download_handler_t,
browser: *mut _cef_browser_t,
url: *const cef_string_t,
request_method: *const cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_url, arg_request_method) =
(self_, browser, url, request_method);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_url = if arg_url.is_null() {
None
} else {
Some(arg_url.into())
};
let arg_url = arg_url.as_ref();
let arg_request_method = if arg_request_method.is_null() {
None
} else {
Some(arg_request_method.into())
};
let arg_request_method = arg_request_method.as_ref();
ImplDownloadHandler::can_download(
&arg_self_.interface,
arg_browser,
arg_url,
arg_request_method,
)
}
extern "C" fn on_before_download<I: ImplDownloadHandler, R: Rc>(
self_: *mut _cef_download_handler_t,
browser: *mut _cef_browser_t,
download_item: *mut _cef_download_item_t,
suggested_name: *const cef_string_t,
callback: *mut _cef_before_download_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_download_item, arg_suggested_name, arg_callback) =
(self_, browser, download_item, suggested_name, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_download_item = unsafe { arg_download_item.as_mut() }
.map(|arg| DownloadItem(unsafe { RefGuard::from_raw(arg) }));
let arg_download_item = arg_download_item.as_mut();
let arg_suggested_name = if arg_suggested_name.is_null() {
None
} else {
Some(arg_suggested_name.into())
};
let arg_suggested_name = arg_suggested_name.as_ref();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| BeforeDownloadCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplDownloadHandler::on_before_download(
&arg_self_.interface,
arg_browser,
arg_download_item,
arg_suggested_name,
arg_callback,
)
}
extern "C" fn on_download_updated<I: ImplDownloadHandler, R: Rc>(
self_: *mut _cef_download_handler_t,
browser: *mut _cef_browser_t,
download_item: *mut _cef_download_item_t,
callback: *mut _cef_download_item_callback_t,
) {
let (arg_self_, arg_browser, arg_download_item, arg_callback) =
(self_, browser, download_item, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_download_item = unsafe { arg_download_item.as_mut() }
.map(|arg| DownloadItem(unsafe { RefGuard::from_raw(arg) }));
let arg_download_item = arg_download_item.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| DownloadItemCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplDownloadHandler::on_download_updated(
&arg_self_.interface,
arg_browser,
arg_download_item,
arg_callback,
)
}
}
impl ImplDownloadHandler for DownloadHandler {
fn can_download(
&self,
browser: Option<&mut Browser>,
url: Option<&CefString>,
request_method: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_download
.map(|f| {
let (arg_browser, arg_url, arg_request_method) = (browser, url, request_method);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_request_method = arg_request_method
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_browser, arg_url, arg_request_method);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_before_download(
&self,
browser: Option<&mut Browser>,
download_item: Option<&mut DownloadItem>,
suggested_name: Option<&CefString>,
callback: Option<&mut BeforeDownloadCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_before_download
.map(|f| {
let (arg_browser, arg_download_item, arg_suggested_name, arg_callback) =
(browser, download_item, suggested_name, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_download_item = arg_download_item
.map(|arg| {
arg.add_ref();
ImplDownloadItem::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_suggested_name = arg_suggested_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplBeforeDownloadCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_download_item,
arg_suggested_name,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_download_updated(
&self,
browser: Option<&mut Browser>,
download_item: Option<&mut DownloadItem>,
callback: Option<&mut DownloadItemCallback>,
) {
unsafe {
if let Some(f) = self.0.on_download_updated {
let (arg_browser, arg_download_item, arg_callback) =
(browser, download_item, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_download_item = arg_download_item
.map(|arg| {
arg.add_ref();
ImplDownloadItem::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplDownloadItemCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_download_item, arg_callback);
}
}
}
fn get_raw(&self) -> *mut _cef_download_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_download_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DownloadHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_download_handler_t> for &DownloadHandler {
fn into_raw(self) -> *mut _cef_download_handler_t {
ImplDownloadHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_download_handler_t> for &mut DownloadHandler {
fn into_raw(self) -> *mut _cef_download_handler_t {
ImplDownloadHandler::get_raw(self)
}
}
impl ConvertReturnValue<DownloadHandler> for *mut _cef_download_handler_t {
fn wrap_result(self) -> DownloadHandler {
DownloadHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DownloadHandler> for *mut _cef_download_handler_t {
fn from(value: DownloadHandler) -> Self {
let object = ImplDownloadHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_drag_handler_t`] for more documentation.
#[derive(Clone)]
pub struct DragHandler(RefGuard<_cef_drag_handler_t>);
impl DragHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapDragHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplDragHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapDragHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_drag_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapDragHandler: ImplDragHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_drag_handler_t, Self>);
}
pub trait ImplDragHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_drag_handler_t::on_drag_enter`] for more documentation."]
fn on_drag_enter(
&self,
browser: Option<&mut Browser>,
drag_data: Option<&mut DragData>,
mask: DragOperationsMask,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_drag_handler_t::on_draggable_regions_changed`] for more documentation."]
fn on_draggable_regions_changed(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
regions: Option<&[DraggableRegion]>,
) {
}
fn init_methods(object: &mut _cef_drag_handler_t) {
impl_cef_drag_handler_t::init_methods::<Self, _cef_drag_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_drag_handler_t;
}
#[doc = "Implement the [`WrapDragHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl DragHandler` block you can override default\nmethods implemented by the [`ImplDragHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_drag_handler! {\n struct MyDragHandler {\n payload: String,\n }\n\n impl DragHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> DragHandler {\n MyDragHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_drag_handler { ($ vis : vis struct $ name : ident ; impl DragHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_drag_handler ! { $ vis struct $ name { } impl DragHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl DragHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_drag_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> DragHandler { DragHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapDragHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_drag_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplDragHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_drag_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_drag_handler_t {
use super::*;
pub fn init_methods<I: ImplDragHandler, R: Rc>(object: &mut _cef_drag_handler_t) {
object.on_drag_enter = Some(on_drag_enter::<I, R>);
object.on_draggable_regions_changed = Some(on_draggable_regions_changed::<I, R>);
}
extern "C" fn on_drag_enter<I: ImplDragHandler, R: Rc>(
self_: *mut _cef_drag_handler_t,
browser: *mut _cef_browser_t,
drag_data: *mut _cef_drag_data_t,
mask: cef_drag_operations_mask_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_drag_data, arg_mask) = (self_, browser, drag_data, mask);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_drag_data = unsafe { arg_drag_data.as_mut() }
.map(|arg| DragData(unsafe { RefGuard::from_raw(arg) }));
let arg_drag_data = arg_drag_data.as_mut();
let arg_mask = arg_mask.into_raw();
ImplDragHandler::on_drag_enter(&arg_self_.interface, arg_browser, arg_drag_data, arg_mask)
}
extern "C" fn on_draggable_regions_changed<I: ImplDragHandler, R: Rc>(
self_: *mut _cef_drag_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
regions_count: usize,
regions: *const _cef_draggable_region_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_regions_count, arg_regions) =
(self_, browser, frame, regions_count, regions);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_regions = if arg_regions.is_null() {
None
} else {
let arg_regions = unsafe { std::slice::from_raw_parts(arg_regions, arg_regions_count) };
let arg_regions: Vec<_> = arg_regions.iter().map(|elem| (*elem).into()).collect();
Some(arg_regions)
};
let arg_regions = arg_regions.as_deref();
ImplDragHandler::on_draggable_regions_changed(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_regions,
)
}
}
impl ImplDragHandler for DragHandler {
fn on_drag_enter(
&self,
browser: Option<&mut Browser>,
drag_data: Option<&mut DragData>,
mask: DragOperationsMask,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_drag_enter
.map(|f| {
let (arg_browser, arg_drag_data, arg_mask) = (browser, drag_data, mask);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_drag_data = arg_drag_data
.map(|arg| {
arg.add_ref();
ImplDragData::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_mask = arg_mask.into_raw();
let result = f(arg_self_, arg_browser, arg_drag_data, arg_mask);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_draggable_regions_changed(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
regions: Option<&[DraggableRegion]>,
) {
unsafe {
if let Some(f) = self.0.on_draggable_regions_changed {
let (arg_browser, arg_frame, arg_regions) = (browser, frame, regions);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_regions_count = arg_regions
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_regions = arg_regions
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_regions = if vec_regions.is_empty() {
std::ptr::null()
} else {
vec_regions.as_ptr()
};
f(
arg_self_,
arg_browser,
arg_frame,
arg_regions_count,
arg_regions,
);
}
}
}
fn get_raw(&self) -> *mut _cef_drag_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_drag_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for DragHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_drag_handler_t> for &DragHandler {
fn into_raw(self) -> *mut _cef_drag_handler_t {
ImplDragHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_drag_handler_t> for &mut DragHandler {
fn into_raw(self) -> *mut _cef_drag_handler_t {
ImplDragHandler::get_raw(self)
}
}
impl ConvertReturnValue<DragHandler> for *mut _cef_drag_handler_t {
fn wrap_result(self) -> DragHandler {
DragHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<DragHandler> for *mut _cef_drag_handler_t {
fn from(value: DragHandler) -> Self {
let object = ImplDragHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_find_handler_t`] for more documentation.
#[derive(Clone)]
pub struct FindHandler(RefGuard<_cef_find_handler_t>);
impl FindHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapFindHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplFindHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapFindHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_find_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapFindHandler: ImplFindHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_find_handler_t, Self>);
}
pub trait ImplFindHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_find_handler_t::on_find_result`] for more documentation."]
fn on_find_result(
&self,
browser: Option<&mut Browser>,
identifier: ::std::os::raw::c_int,
count: ::std::os::raw::c_int,
selection_rect: Option<&Rect>,
active_match_ordinal: ::std::os::raw::c_int,
final_update: ::std::os::raw::c_int,
) {
}
fn init_methods(object: &mut _cef_find_handler_t) {
impl_cef_find_handler_t::init_methods::<Self, _cef_find_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_find_handler_t;
}
#[doc = "Implement the [`WrapFindHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl FindHandler` block you can override default\nmethods implemented by the [`ImplFindHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_find_handler! {\n struct MyFindHandler {\n payload: String,\n }\n\n impl FindHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> FindHandler {\n MyFindHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_find_handler { ($ vis : vis struct $ name : ident ; impl FindHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_find_handler ! { $ vis struct $ name { } impl FindHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl FindHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_find_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> FindHandler { FindHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapFindHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_find_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplFindHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_find_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_find_handler_t {
use super::*;
pub fn init_methods<I: ImplFindHandler, R: Rc>(object: &mut _cef_find_handler_t) {
object.on_find_result = Some(on_find_result::<I, R>);
}
extern "C" fn on_find_result<I: ImplFindHandler, R: Rc>(
self_: *mut _cef_find_handler_t,
browser: *mut _cef_browser_t,
identifier: ::std::os::raw::c_int,
count: ::std::os::raw::c_int,
selection_rect: *const _cef_rect_t,
active_match_ordinal: ::std::os::raw::c_int,
final_update: ::std::os::raw::c_int,
) {
let (
arg_self_,
arg_browser,
arg_identifier,
arg_count,
arg_selection_rect,
arg_active_match_ordinal,
arg_final_update,
) = (
self_,
browser,
identifier,
count,
selection_rect,
active_match_ordinal,
final_update,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_identifier = arg_identifier.into_raw();
let arg_count = arg_count.into_raw();
let arg_selection_rect = if arg_selection_rect.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_selection_rect))
};
let arg_selection_rect = arg_selection_rect.as_ref().map(|arg| arg.as_ref());
let arg_active_match_ordinal = arg_active_match_ordinal.into_raw();
let arg_final_update = arg_final_update.into_raw();
ImplFindHandler::on_find_result(
&arg_self_.interface,
arg_browser,
arg_identifier,
arg_count,
arg_selection_rect,
arg_active_match_ordinal,
arg_final_update,
)
}
}
impl ImplFindHandler for FindHandler {
fn on_find_result(
&self,
browser: Option<&mut Browser>,
identifier: ::std::os::raw::c_int,
count: ::std::os::raw::c_int,
selection_rect: Option<&Rect>,
active_match_ordinal: ::std::os::raw::c_int,
final_update: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_find_result {
let (
arg_browser,
arg_identifier,
arg_count,
arg_selection_rect,
arg_active_match_ordinal,
arg_final_update,
) = (
browser,
identifier,
count,
selection_rect,
active_match_ordinal,
final_update,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_selection_rect = arg_selection_rect.cloned().map(|arg| arg.into());
let arg_selection_rect = arg_selection_rect
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_browser,
arg_identifier,
arg_count,
arg_selection_rect,
arg_active_match_ordinal,
arg_final_update,
);
}
}
}
fn get_raw(&self) -> *mut _cef_find_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_find_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for FindHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_find_handler_t> for &FindHandler {
fn into_raw(self) -> *mut _cef_find_handler_t {
ImplFindHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_find_handler_t> for &mut FindHandler {
fn into_raw(self) -> *mut _cef_find_handler_t {
ImplFindHandler::get_raw(self)
}
}
impl ConvertReturnValue<FindHandler> for *mut _cef_find_handler_t {
fn wrap_result(self) -> FindHandler {
FindHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<FindHandler> for *mut _cef_find_handler_t {
fn from(value: FindHandler) -> Self {
let object = ImplFindHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_focus_handler_t`] for more documentation.
#[derive(Clone)]
pub struct FocusHandler(RefGuard<_cef_focus_handler_t>);
impl FocusHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapFocusHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplFocusHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapFocusHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_focus_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapFocusHandler: ImplFocusHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_focus_handler_t, Self>);
}
pub trait ImplFocusHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_focus_handler_t::on_take_focus`] for more documentation."]
fn on_take_focus(&self, browser: Option<&mut Browser>, next: ::std::os::raw::c_int) {}
#[doc = "See [`_cef_focus_handler_t::on_set_focus`] for more documentation."]
fn on_set_focus(
&self,
browser: Option<&mut Browser>,
source: FocusSource,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_focus_handler_t::on_got_focus`] for more documentation."]
fn on_got_focus(&self, browser: Option<&mut Browser>) {}
fn init_methods(object: &mut _cef_focus_handler_t) {
impl_cef_focus_handler_t::init_methods::<Self, _cef_focus_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_focus_handler_t;
}
#[doc = "Implement the [`WrapFocusHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl FocusHandler` block you can override default\nmethods implemented by the [`ImplFocusHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_focus_handler! {\n struct MyFocusHandler {\n payload: String,\n }\n\n impl FocusHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> FocusHandler {\n MyFocusHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_focus_handler { ($ vis : vis struct $ name : ident ; impl FocusHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_focus_handler ! { $ vis struct $ name { } impl FocusHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl FocusHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_focus_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> FocusHandler { FocusHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapFocusHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_focus_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplFocusHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_focus_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_focus_handler_t {
use super::*;
pub fn init_methods<I: ImplFocusHandler, R: Rc>(object: &mut _cef_focus_handler_t) {
object.on_take_focus = Some(on_take_focus::<I, R>);
object.on_set_focus = Some(on_set_focus::<I, R>);
object.on_got_focus = Some(on_got_focus::<I, R>);
}
extern "C" fn on_take_focus<I: ImplFocusHandler, R: Rc>(
self_: *mut _cef_focus_handler_t,
browser: *mut _cef_browser_t,
next: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_next) = (self_, browser, next);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_next = arg_next.into_raw();
ImplFocusHandler::on_take_focus(&arg_self_.interface, arg_browser, arg_next)
}
extern "C" fn on_set_focus<I: ImplFocusHandler, R: Rc>(
self_: *mut _cef_focus_handler_t,
browser: *mut _cef_browser_t,
source: cef_focus_source_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_source) = (self_, browser, source);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_source = arg_source.into_raw();
ImplFocusHandler::on_set_focus(&arg_self_.interface, arg_browser, arg_source)
}
extern "C" fn on_got_focus<I: ImplFocusHandler, R: Rc>(
self_: *mut _cef_focus_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplFocusHandler::on_got_focus(&arg_self_.interface, arg_browser)
}
}
impl ImplFocusHandler for FocusHandler {
fn on_take_focus(&self, browser: Option<&mut Browser>, next: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.on_take_focus {
let (arg_browser, arg_next) = (browser, next);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_next);
}
}
}
fn on_set_focus(
&self,
browser: Option<&mut Browser>,
source: FocusSource,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_set_focus
.map(|f| {
let (arg_browser, arg_source) = (browser, source);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_source = arg_source.into_raw();
let result = f(arg_self_, arg_browser, arg_source);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_got_focus(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_got_focus {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn get_raw(&self) -> *mut _cef_focus_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_focus_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for FocusHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_focus_handler_t> for &FocusHandler {
fn into_raw(self) -> *mut _cef_focus_handler_t {
ImplFocusHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_focus_handler_t> for &mut FocusHandler {
fn into_raw(self) -> *mut _cef_focus_handler_t {
ImplFocusHandler::get_raw(self)
}
}
impl ConvertReturnValue<FocusHandler> for *mut _cef_focus_handler_t {
fn wrap_result(self) -> FocusHandler {
FocusHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<FocusHandler> for *mut _cef_focus_handler_t {
fn from(value: FocusHandler) -> Self {
let object = ImplFocusHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_frame_handler_t`] for more documentation.
#[derive(Clone)]
pub struct FrameHandler(RefGuard<_cef_frame_handler_t>);
impl FrameHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapFrameHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplFrameHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapFrameHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_frame_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapFrameHandler: ImplFrameHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_frame_handler_t, Self>);
}
pub trait ImplFrameHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_frame_handler_t::on_frame_created`] for more documentation."]
fn on_frame_created(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {}
#[doc = "See [`_cef_frame_handler_t::on_frame_destroyed`] for more documentation."]
fn on_frame_destroyed(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {}
#[doc = "See [`_cef_frame_handler_t::on_frame_attached`] for more documentation."]
fn on_frame_attached(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
reattached: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_frame_handler_t::on_frame_detached`] for more documentation."]
fn on_frame_detached(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {}
#[doc = "See [`_cef_frame_handler_t::on_main_frame_changed`] for more documentation."]
fn on_main_frame_changed(
&self,
browser: Option<&mut Browser>,
old_frame: Option<&mut Frame>,
new_frame: Option<&mut Frame>,
) {
}
fn init_methods(object: &mut _cef_frame_handler_t) {
impl_cef_frame_handler_t::init_methods::<Self, _cef_frame_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_frame_handler_t;
}
#[doc = "Implement the [`WrapFrameHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl FrameHandler` block you can override default\nmethods implemented by the [`ImplFrameHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_frame_handler! {\n struct MyFrameHandler {\n payload: String,\n }\n\n impl FrameHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> FrameHandler {\n MyFrameHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_frame_handler { ($ vis : vis struct $ name : ident ; impl FrameHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_frame_handler ! { $ vis struct $ name { } impl FrameHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl FrameHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_frame_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> FrameHandler { FrameHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapFrameHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_frame_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplFrameHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_frame_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_frame_handler_t {
use super::*;
pub fn init_methods<I: ImplFrameHandler, R: Rc>(object: &mut _cef_frame_handler_t) {
object.on_frame_created = Some(on_frame_created::<I, R>);
object.on_frame_destroyed = Some(on_frame_destroyed::<I, R>);
object.on_frame_attached = Some(on_frame_attached::<I, R>);
object.on_frame_detached = Some(on_frame_detached::<I, R>);
object.on_main_frame_changed = Some(on_main_frame_changed::<I, R>);
}
extern "C" fn on_frame_created<I: ImplFrameHandler, R: Rc>(
self_: *mut _cef_frame_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
) {
let (arg_self_, arg_browser, arg_frame) = (self_, browser, frame);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
ImplFrameHandler::on_frame_created(&arg_self_.interface, arg_browser, arg_frame)
}
extern "C" fn on_frame_destroyed<I: ImplFrameHandler, R: Rc>(
self_: *mut _cef_frame_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
) {
let (arg_self_, arg_browser, arg_frame) = (self_, browser, frame);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
ImplFrameHandler::on_frame_destroyed(&arg_self_.interface, arg_browser, arg_frame)
}
extern "C" fn on_frame_attached<I: ImplFrameHandler, R: Rc>(
self_: *mut _cef_frame_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
reattached: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_frame, arg_reattached) =
(self_, browser, frame, reattached);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_reattached = arg_reattached.into_raw();
ImplFrameHandler::on_frame_attached(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_reattached,
)
}
extern "C" fn on_frame_detached<I: ImplFrameHandler, R: Rc>(
self_: *mut _cef_frame_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
) {
let (arg_self_, arg_browser, arg_frame) = (self_, browser, frame);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
ImplFrameHandler::on_frame_detached(&arg_self_.interface, arg_browser, arg_frame)
}
extern "C" fn on_main_frame_changed<I: ImplFrameHandler, R: Rc>(
self_: *mut _cef_frame_handler_t,
browser: *mut _cef_browser_t,
old_frame: *mut _cef_frame_t,
new_frame: *mut _cef_frame_t,
) {
let (arg_self_, arg_browser, arg_old_frame, arg_new_frame) =
(self_, browser, old_frame, new_frame);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_old_frame =
unsafe { arg_old_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_old_frame = arg_old_frame.as_mut();
let mut arg_new_frame =
unsafe { arg_new_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_new_frame = arg_new_frame.as_mut();
ImplFrameHandler::on_main_frame_changed(
&arg_self_.interface,
arg_browser,
arg_old_frame,
arg_new_frame,
)
}
}
impl ImplFrameHandler for FrameHandler {
fn on_frame_created(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {
unsafe {
if let Some(f) = self.0.on_frame_created {
let (arg_browser, arg_frame) = (browser, frame);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame);
}
}
}
fn on_frame_destroyed(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {
unsafe {
if let Some(f) = self.0.on_frame_destroyed {
let (arg_browser, arg_frame) = (browser, frame);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame);
}
}
}
fn on_frame_attached(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
reattached: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_frame_attached {
let (arg_browser, arg_frame, arg_reattached) = (browser, frame, reattached);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame, arg_reattached);
}
}
}
fn on_frame_detached(&self, browser: Option<&mut Browser>, frame: Option<&mut Frame>) {
unsafe {
if let Some(f) = self.0.on_frame_detached {
let (arg_browser, arg_frame) = (browser, frame);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame);
}
}
}
fn on_main_frame_changed(
&self,
browser: Option<&mut Browser>,
old_frame: Option<&mut Frame>,
new_frame: Option<&mut Frame>,
) {
unsafe {
if let Some(f) = self.0.on_main_frame_changed {
let (arg_browser, arg_old_frame, arg_new_frame) = (browser, old_frame, new_frame);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_old_frame = arg_old_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_new_frame = arg_new_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_old_frame, arg_new_frame);
}
}
}
fn get_raw(&self) -> *mut _cef_frame_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_frame_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for FrameHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_frame_handler_t> for &FrameHandler {
fn into_raw(self) -> *mut _cef_frame_handler_t {
ImplFrameHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_frame_handler_t> for &mut FrameHandler {
fn into_raw(self) -> *mut _cef_frame_handler_t {
ImplFrameHandler::get_raw(self)
}
}
impl ConvertReturnValue<FrameHandler> for *mut _cef_frame_handler_t {
fn wrap_result(self) -> FrameHandler {
FrameHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<FrameHandler> for *mut _cef_frame_handler_t {
fn from(value: FrameHandler) -> Self {
let object = ImplFrameHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_jsdialog_callback_t`] for more documentation.
#[derive(Clone)]
pub struct JsdialogCallback(RefGuard<_cef_jsdialog_callback_t>);
pub trait ImplJsdialogCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_jsdialog_callback_t::cont`] for more documentation."]
fn cont(&self, success: ::std::os::raw::c_int, user_input: Option<&CefString>);
fn get_raw(&self) -> *mut _cef_jsdialog_callback_t;
}
impl ImplJsdialogCallback for JsdialogCallback {
fn cont(&self, success: ::std::os::raw::c_int, user_input: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.cont {
let (arg_success, arg_user_input) = (success, user_input);
let arg_self_ = self.into_raw();
let arg_user_input = arg_user_input
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_success, arg_user_input);
}
}
}
fn get_raw(&self) -> *mut _cef_jsdialog_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_jsdialog_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for JsdialogCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_jsdialog_callback_t> for &JsdialogCallback {
fn into_raw(self) -> *mut _cef_jsdialog_callback_t {
ImplJsdialogCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_jsdialog_callback_t> for &mut JsdialogCallback {
fn into_raw(self) -> *mut _cef_jsdialog_callback_t {
ImplJsdialogCallback::get_raw(self)
}
}
impl ConvertReturnValue<JsdialogCallback> for *mut _cef_jsdialog_callback_t {
fn wrap_result(self) -> JsdialogCallback {
JsdialogCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<JsdialogCallback> for *mut _cef_jsdialog_callback_t {
fn from(value: JsdialogCallback) -> Self {
let object = ImplJsdialogCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_jsdialog_handler_t`] for more documentation.
#[derive(Clone)]
pub struct JsdialogHandler(RefGuard<_cef_jsdialog_handler_t>);
impl JsdialogHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapJsdialogHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplJsdialogHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapJsdialogHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_jsdialog_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapJsdialogHandler: ImplJsdialogHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_jsdialog_handler_t, Self>);
}
pub trait ImplJsdialogHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_jsdialog_handler_t::on_jsdialog`] for more documentation."]
fn on_jsdialog(
&self,
browser: Option<&mut Browser>,
origin_url: Option<&CefString>,
dialog_type: JsdialogType,
message_text: Option<&CefString>,
default_prompt_text: Option<&CefString>,
callback: Option<&mut JsdialogCallback>,
suppress_message: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_jsdialog_handler_t::on_before_unload_dialog`] for more documentation."]
fn on_before_unload_dialog(
&self,
browser: Option<&mut Browser>,
message_text: Option<&CefString>,
is_reload: ::std::os::raw::c_int,
callback: Option<&mut JsdialogCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_jsdialog_handler_t::on_reset_dialog_state`] for more documentation."]
fn on_reset_dialog_state(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_jsdialog_handler_t::on_dialog_closed`] for more documentation."]
fn on_dialog_closed(&self, browser: Option<&mut Browser>) {}
fn init_methods(object: &mut _cef_jsdialog_handler_t) {
impl_cef_jsdialog_handler_t::init_methods::<Self, _cef_jsdialog_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_jsdialog_handler_t;
}
#[doc = "Implement the [`WrapJsdialogHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl JsdialogHandler` block you can override default\nmethods implemented by the [`ImplJsdialogHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_jsdialog_handler! {\n struct MyJsdialogHandler {\n payload: String,\n }\n\n impl JsdialogHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> JsdialogHandler {\n MyJsdialogHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_jsdialog_handler { ($ vis : vis struct $ name : ident ; impl JsdialogHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_jsdialog_handler ! { $ vis struct $ name { } impl JsdialogHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl JsdialogHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_jsdialog_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> JsdialogHandler { JsdialogHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapJsdialogHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_jsdialog_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplJsdialogHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_jsdialog_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_jsdialog_handler_t {
use super::*;
pub fn init_methods<I: ImplJsdialogHandler, R: Rc>(object: &mut _cef_jsdialog_handler_t) {
object.on_jsdialog = Some(on_jsdialog::<I, R>);
object.on_before_unload_dialog = Some(on_before_unload_dialog::<I, R>);
object.on_reset_dialog_state = Some(on_reset_dialog_state::<I, R>);
object.on_dialog_closed = Some(on_dialog_closed::<I, R>);
}
extern "C" fn on_jsdialog<I: ImplJsdialogHandler, R: Rc>(
self_: *mut _cef_jsdialog_handler_t,
browser: *mut _cef_browser_t,
origin_url: *const cef_string_t,
dialog_type: cef_jsdialog_type_t,
message_text: *const cef_string_t,
default_prompt_text: *const cef_string_t,
callback: *mut _cef_jsdialog_callback_t,
suppress_message: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_origin_url,
arg_dialog_type,
arg_message_text,
arg_default_prompt_text,
arg_callback,
arg_suppress_message,
) = (
self_,
browser,
origin_url,
dialog_type,
message_text,
default_prompt_text,
callback,
suppress_message,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_origin_url = if arg_origin_url.is_null() {
None
} else {
Some(arg_origin_url.into())
};
let arg_origin_url = arg_origin_url.as_ref();
let arg_dialog_type = arg_dialog_type.into_raw();
let arg_message_text = if arg_message_text.is_null() {
None
} else {
Some(arg_message_text.into())
};
let arg_message_text = arg_message_text.as_ref();
let arg_default_prompt_text = if arg_default_prompt_text.is_null() {
None
} else {
Some(arg_default_prompt_text.into())
};
let arg_default_prompt_text = arg_default_prompt_text.as_ref();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| JsdialogCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
let mut arg_suppress_message = if arg_suppress_message.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_suppress_message,
))
};
let arg_suppress_message = arg_suppress_message.as_mut().map(|arg| arg.as_mut());
ImplJsdialogHandler::on_jsdialog(
&arg_self_.interface,
arg_browser,
arg_origin_url,
arg_dialog_type,
arg_message_text,
arg_default_prompt_text,
arg_callback,
arg_suppress_message,
)
}
extern "C" fn on_before_unload_dialog<I: ImplJsdialogHandler, R: Rc>(
self_: *mut _cef_jsdialog_handler_t,
browser: *mut _cef_browser_t,
message_text: *const cef_string_t,
is_reload: ::std::os::raw::c_int,
callback: *mut _cef_jsdialog_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_message_text, arg_is_reload, arg_callback) =
(self_, browser, message_text, is_reload, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_message_text = if arg_message_text.is_null() {
None
} else {
Some(arg_message_text.into())
};
let arg_message_text = arg_message_text.as_ref();
let arg_is_reload = arg_is_reload.into_raw();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| JsdialogCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplJsdialogHandler::on_before_unload_dialog(
&arg_self_.interface,
arg_browser,
arg_message_text,
arg_is_reload,
arg_callback,
)
}
extern "C" fn on_reset_dialog_state<I: ImplJsdialogHandler, R: Rc>(
self_: *mut _cef_jsdialog_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplJsdialogHandler::on_reset_dialog_state(&arg_self_.interface, arg_browser)
}
extern "C" fn on_dialog_closed<I: ImplJsdialogHandler, R: Rc>(
self_: *mut _cef_jsdialog_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplJsdialogHandler::on_dialog_closed(&arg_self_.interface, arg_browser)
}
}
impl ImplJsdialogHandler for JsdialogHandler {
fn on_jsdialog(
&self,
browser: Option<&mut Browser>,
origin_url: Option<&CefString>,
dialog_type: JsdialogType,
message_text: Option<&CefString>,
default_prompt_text: Option<&CefString>,
callback: Option<&mut JsdialogCallback>,
suppress_message: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_jsdialog
.map(|f| {
let (
arg_browser,
arg_origin_url,
arg_dialog_type,
arg_message_text,
arg_default_prompt_text,
arg_callback,
arg_suppress_message,
) = (
browser,
origin_url,
dialog_type,
message_text,
default_prompt_text,
callback,
suppress_message,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_origin_url = arg_origin_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_dialog_type = arg_dialog_type.into_raw();
let arg_message_text = arg_message_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_default_prompt_text = arg_default_prompt_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplJsdialogCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_suppress_message = arg_suppress_message
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_origin_url,
arg_dialog_type,
arg_message_text,
arg_default_prompt_text,
arg_callback,
arg_suppress_message,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_before_unload_dialog(
&self,
browser: Option<&mut Browser>,
message_text: Option<&CefString>,
is_reload: ::std::os::raw::c_int,
callback: Option<&mut JsdialogCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_before_unload_dialog
.map(|f| {
let (arg_browser, arg_message_text, arg_is_reload, arg_callback) =
(browser, message_text, is_reload, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_message_text = arg_message_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplJsdialogCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_message_text,
arg_is_reload,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_reset_dialog_state(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_reset_dialog_state {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn on_dialog_closed(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_dialog_closed {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn get_raw(&self) -> *mut _cef_jsdialog_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_jsdialog_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for JsdialogHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_jsdialog_handler_t> for &JsdialogHandler {
fn into_raw(self) -> *mut _cef_jsdialog_handler_t {
ImplJsdialogHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_jsdialog_handler_t> for &mut JsdialogHandler {
fn into_raw(self) -> *mut _cef_jsdialog_handler_t {
ImplJsdialogHandler::get_raw(self)
}
}
impl ConvertReturnValue<JsdialogHandler> for *mut _cef_jsdialog_handler_t {
fn wrap_result(self) -> JsdialogHandler {
JsdialogHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<JsdialogHandler> for *mut _cef_jsdialog_handler_t {
fn from(value: JsdialogHandler) -> Self {
let object = ImplJsdialogHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_keyboard_handler_t`] for more documentation.
#[derive(Clone)]
pub struct KeyboardHandler(RefGuard<_cef_keyboard_handler_t>);
impl KeyboardHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapKeyboardHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplKeyboardHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapKeyboardHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_keyboard_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapKeyboardHandler: ImplKeyboardHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_keyboard_handler_t, Self>);
}
pub trait ImplKeyboardHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_keyboard_handler_t::on_pre_key_event`] for more documentation."]
fn on_pre_key_event(
&self,
browser: Option<&mut Browser>,
event: Option<&KeyEvent>,
os_event: Option<&mut MSG>,
is_keyboard_shortcut: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_keyboard_handler_t::on_key_event`] for more documentation."]
fn on_key_event(
&self,
browser: Option<&mut Browser>,
event: Option<&KeyEvent>,
os_event: Option<&mut MSG>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_keyboard_handler_t) {
impl_cef_keyboard_handler_t::init_methods::<Self, _cef_keyboard_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_keyboard_handler_t;
}
#[doc = "Implement the [`WrapKeyboardHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl KeyboardHandler` block you can override default\nmethods implemented by the [`ImplKeyboardHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_keyboard_handler! {\n struct MyKeyboardHandler {\n payload: String,\n }\n\n impl KeyboardHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> KeyboardHandler {\n MyKeyboardHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_keyboard_handler { ($ vis : vis struct $ name : ident ; impl KeyboardHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_keyboard_handler ! { $ vis struct $ name { } impl KeyboardHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl KeyboardHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_keyboard_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> KeyboardHandler { KeyboardHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapKeyboardHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_keyboard_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplKeyboardHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_keyboard_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_keyboard_handler_t {
use super::*;
pub fn init_methods<I: ImplKeyboardHandler, R: Rc>(object: &mut _cef_keyboard_handler_t) {
object.on_pre_key_event = Some(on_pre_key_event::<I, R>);
object.on_key_event = Some(on_key_event::<I, R>);
}
extern "C" fn on_pre_key_event<I: ImplKeyboardHandler, R: Rc>(
self_: *mut _cef_keyboard_handler_t,
browser: *mut _cef_browser_t,
event: *const _cef_key_event_t,
os_event: *mut MSG,
is_keyboard_shortcut: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_event, arg_os_event, arg_is_keyboard_shortcut) =
(self_, browser, event, os_event, is_keyboard_shortcut);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_event = if arg_event.is_null() {
None
} else {
Some(WrapParamRef::<KeyEvent, _>::from(arg_event))
};
let arg_event = arg_event.as_ref().map(|arg| arg.as_ref());
let mut arg_os_event = if arg_os_event.is_null() {
None
} else {
Some(WrapParamRef::<MSG, _>::from(arg_os_event))
};
let arg_os_event = arg_os_event.as_mut().map(|arg| arg.as_mut());
let mut arg_is_keyboard_shortcut = if arg_is_keyboard_shortcut.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_is_keyboard_shortcut,
))
};
let arg_is_keyboard_shortcut = arg_is_keyboard_shortcut.as_mut().map(|arg| arg.as_mut());
ImplKeyboardHandler::on_pre_key_event(
&arg_self_.interface,
arg_browser,
arg_event,
arg_os_event,
arg_is_keyboard_shortcut,
)
}
extern "C" fn on_key_event<I: ImplKeyboardHandler, R: Rc>(
self_: *mut _cef_keyboard_handler_t,
browser: *mut _cef_browser_t,
event: *const _cef_key_event_t,
os_event: *mut MSG,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_event, arg_os_event) = (self_, browser, event, os_event);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_event = if arg_event.is_null() {
None
} else {
Some(WrapParamRef::<KeyEvent, _>::from(arg_event))
};
let arg_event = arg_event.as_ref().map(|arg| arg.as_ref());
let mut arg_os_event = if arg_os_event.is_null() {
None
} else {
Some(WrapParamRef::<MSG, _>::from(arg_os_event))
};
let arg_os_event = arg_os_event.as_mut().map(|arg| arg.as_mut());
ImplKeyboardHandler::on_key_event(
&arg_self_.interface,
arg_browser,
arg_event,
arg_os_event,
)
}
}
impl ImplKeyboardHandler for KeyboardHandler {
fn on_pre_key_event(
&self,
browser: Option<&mut Browser>,
event: Option<&KeyEvent>,
os_event: Option<&mut MSG>,
is_keyboard_shortcut: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_pre_key_event
.map(|f| {
let (arg_browser, arg_event, arg_os_event, arg_is_keyboard_shortcut) =
(browser, event, os_event, is_keyboard_shortcut);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_os_event = arg_os_event
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_is_keyboard_shortcut = arg_is_keyboard_shortcut
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_event,
arg_os_event,
arg_is_keyboard_shortcut,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_key_event(
&self,
browser: Option<&mut Browser>,
event: Option<&KeyEvent>,
os_event: Option<&mut MSG>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_key_event
.map(|f| {
let (arg_browser, arg_event, arg_os_event) = (browser, event, os_event);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_os_event = arg_os_event
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_event, arg_os_event);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_keyboard_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_keyboard_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for KeyboardHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_keyboard_handler_t> for &KeyboardHandler {
fn into_raw(self) -> *mut _cef_keyboard_handler_t {
ImplKeyboardHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_keyboard_handler_t> for &mut KeyboardHandler {
fn into_raw(self) -> *mut _cef_keyboard_handler_t {
ImplKeyboardHandler::get_raw(self)
}
}
impl ConvertReturnValue<KeyboardHandler> for *mut _cef_keyboard_handler_t {
fn wrap_result(self) -> KeyboardHandler {
KeyboardHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<KeyboardHandler> for *mut _cef_keyboard_handler_t {
fn from(value: KeyboardHandler) -> Self {
let object = ImplKeyboardHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_life_span_handler_t`] for more documentation.
#[derive(Clone)]
pub struct LifeSpanHandler(RefGuard<_cef_life_span_handler_t>);
impl LifeSpanHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapLifeSpanHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplLifeSpanHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapLifeSpanHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_life_span_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapLifeSpanHandler: ImplLifeSpanHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_life_span_handler_t, Self>);
}
pub trait ImplLifeSpanHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_life_span_handler_t::on_before_popup`] for more documentation."]
fn on_before_popup(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
popup_id: ::std::os::raw::c_int,
target_url: Option<&CefString>,
target_frame_name: Option<&CefString>,
target_disposition: WindowOpenDisposition,
user_gesture: ::std::os::raw::c_int,
popup_features: Option<&PopupFeatures>,
window_info: Option<&mut WindowInfo>,
client: Option<&mut Option<Client>>,
settings: Option<&mut BrowserSettings>,
extra_info: Option<&mut Option<DictionaryValue>>,
no_javascript_access: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_life_span_handler_t::on_before_popup_aborted`] for more documentation."]
fn on_before_popup_aborted(
&self,
browser: Option<&mut Browser>,
popup_id: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_life_span_handler_t::on_before_dev_tools_popup`] for more documentation."]
fn on_before_dev_tools_popup(
&self,
browser: Option<&mut Browser>,
window_info: Option<&mut WindowInfo>,
client: Option<&mut Option<Client>>,
settings: Option<&mut BrowserSettings>,
extra_info: Option<&mut Option<DictionaryValue>>,
use_default_window: Option<&mut ::std::os::raw::c_int>,
) {
}
#[doc = "See [`_cef_life_span_handler_t::on_after_created`] for more documentation."]
fn on_after_created(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_life_span_handler_t::do_close`] for more documentation."]
fn do_close(&self, browser: Option<&mut Browser>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_life_span_handler_t::on_before_close`] for more documentation."]
fn on_before_close(&self, browser: Option<&mut Browser>) {}
fn init_methods(object: &mut _cef_life_span_handler_t) {
impl_cef_life_span_handler_t::init_methods::<Self, _cef_life_span_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_life_span_handler_t;
}
#[doc = "Implement the [`WrapLifeSpanHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl LifeSpanHandler` block you can override default\nmethods implemented by the [`ImplLifeSpanHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_life_span_handler! {\n struct MyLifeSpanHandler {\n payload: String,\n }\n\n impl LifeSpanHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> LifeSpanHandler {\n MyLifeSpanHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_life_span_handler { ($ vis : vis struct $ name : ident ; impl LifeSpanHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_life_span_handler ! { $ vis struct $ name { } impl LifeSpanHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl LifeSpanHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_life_span_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> LifeSpanHandler { LifeSpanHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapLifeSpanHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_life_span_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplLifeSpanHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_life_span_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_life_span_handler_t {
use super::*;
pub fn init_methods<I: ImplLifeSpanHandler, R: Rc>(object: &mut _cef_life_span_handler_t) {
object.on_before_popup = Some(on_before_popup::<I, R>);
object.on_before_popup_aborted = Some(on_before_popup_aborted::<I, R>);
object.on_before_dev_tools_popup = Some(on_before_dev_tools_popup::<I, R>);
object.on_after_created = Some(on_after_created::<I, R>);
object.do_close = Some(do_close::<I, R>);
object.on_before_close = Some(on_before_close::<I, R>);
}
extern "C" fn on_before_popup<I: ImplLifeSpanHandler, R: Rc>(
self_: *mut _cef_life_span_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
popup_id: ::std::os::raw::c_int,
target_url: *const cef_string_t,
target_frame_name: *const cef_string_t,
target_disposition: cef_window_open_disposition_t,
user_gesture: ::std::os::raw::c_int,
popup_features: *const _cef_popup_features_t,
window_info: *mut _cef_window_info_t,
client: *mut *mut _cef_client_t,
settings: *mut _cef_browser_settings_t,
extra_info: *mut *mut _cef_dictionary_value_t,
no_javascript_access: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_frame,
arg_popup_id,
arg_target_url,
arg_target_frame_name,
arg_target_disposition,
arg_user_gesture,
arg_popup_features,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_no_javascript_access,
) = (
self_,
browser,
frame,
popup_id,
target_url,
target_frame_name,
target_disposition,
user_gesture,
popup_features,
window_info,
client,
settings,
extra_info,
no_javascript_access,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_popup_id = arg_popup_id.into_raw();
let arg_target_url = if arg_target_url.is_null() {
None
} else {
Some(arg_target_url.into())
};
let arg_target_url = arg_target_url.as_ref();
let arg_target_frame_name = if arg_target_frame_name.is_null() {
None
} else {
Some(arg_target_frame_name.into())
};
let arg_target_frame_name = arg_target_frame_name.as_ref();
let arg_target_disposition = arg_target_disposition.into_raw();
let arg_user_gesture = arg_user_gesture.into_raw();
let arg_popup_features = if arg_popup_features.is_null() {
None
} else {
Some(WrapParamRef::<PopupFeatures, _>::from(arg_popup_features))
};
let arg_popup_features = arg_popup_features.as_ref().map(|arg| arg.as_ref());
let mut arg_window_info = if arg_window_info.is_null() {
None
} else {
Some(WrapParamRef::<WindowInfo, _>::from(arg_window_info))
};
let arg_window_info = arg_window_info.as_mut().map(|arg| arg.as_mut());
let out_client = arg_client;
let mut wrap_client = unsafe { arg_client.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(Client(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_client = Some(&mut wrap_client);
let mut arg_settings = if arg_settings.is_null() {
None
} else {
Some(WrapParamRef::<BrowserSettings, _>::from(arg_settings))
};
let arg_settings = arg_settings.as_mut().map(|arg| arg.as_mut());
let out_extra_info = arg_extra_info;
let mut wrap_extra_info = unsafe { arg_extra_info.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(DictionaryValue(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_extra_info = Some(&mut wrap_extra_info);
let mut arg_no_javascript_access = if arg_no_javascript_access.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_no_javascript_access,
))
};
let arg_no_javascript_access = arg_no_javascript_access.as_mut().map(|arg| arg.as_mut());
let result = ImplLifeSpanHandler::on_before_popup(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_popup_id,
arg_target_url,
arg_target_frame_name,
arg_target_disposition,
arg_user_gesture,
arg_popup_features,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_no_javascript_access,
);
if let (Some(out_client), Some(wrap_client)) = (unsafe { out_client.as_mut() }, wrap_client)
{
*out_client = wrap_client.wrap_result();
}
if let (Some(out_extra_info), Some(wrap_extra_info)) =
(unsafe { out_extra_info.as_mut() }, wrap_extra_info)
{
*out_extra_info = wrap_extra_info.wrap_result();
}
result
}
extern "C" fn on_before_popup_aborted<I: ImplLifeSpanHandler, R: Rc>(
self_: *mut _cef_life_span_handler_t,
browser: *mut _cef_browser_t,
popup_id: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_popup_id) = (self_, browser, popup_id);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_popup_id = arg_popup_id.into_raw();
ImplLifeSpanHandler::on_before_popup_aborted(
&arg_self_.interface,
arg_browser,
arg_popup_id,
)
}
extern "C" fn on_before_dev_tools_popup<I: ImplLifeSpanHandler, R: Rc>(
self_: *mut _cef_life_span_handler_t,
browser: *mut _cef_browser_t,
window_info: *mut _cef_window_info_t,
client: *mut *mut _cef_client_t,
settings: *mut _cef_browser_settings_t,
extra_info: *mut *mut _cef_dictionary_value_t,
use_default_window: *mut ::std::os::raw::c_int,
) {
let (
arg_self_,
arg_browser,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_use_default_window,
) = (
self_,
browser,
window_info,
client,
settings,
extra_info,
use_default_window,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_window_info = if arg_window_info.is_null() {
None
} else {
Some(WrapParamRef::<WindowInfo, _>::from(arg_window_info))
};
let arg_window_info = arg_window_info.as_mut().map(|arg| arg.as_mut());
let out_client = arg_client;
let mut wrap_client = unsafe { arg_client.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(Client(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_client = Some(&mut wrap_client);
let mut arg_settings = if arg_settings.is_null() {
None
} else {
Some(WrapParamRef::<BrowserSettings, _>::from(arg_settings))
};
let arg_settings = arg_settings.as_mut().map(|arg| arg.as_mut());
let out_extra_info = arg_extra_info;
let mut wrap_extra_info = unsafe { arg_extra_info.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(DictionaryValue(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_extra_info = Some(&mut wrap_extra_info);
let mut arg_use_default_window = if arg_use_default_window.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_use_default_window,
))
};
let arg_use_default_window = arg_use_default_window.as_mut().map(|arg| arg.as_mut());
let result = ImplLifeSpanHandler::on_before_dev_tools_popup(
&arg_self_.interface,
arg_browser,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_use_default_window,
);
if let (Some(out_client), Some(wrap_client)) = (unsafe { out_client.as_mut() }, wrap_client)
{
*out_client = wrap_client.wrap_result();
}
if let (Some(out_extra_info), Some(wrap_extra_info)) =
(unsafe { out_extra_info.as_mut() }, wrap_extra_info)
{
*out_extra_info = wrap_extra_info.wrap_result();
}
}
extern "C" fn on_after_created<I: ImplLifeSpanHandler, R: Rc>(
self_: *mut _cef_life_span_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplLifeSpanHandler::on_after_created(&arg_self_.interface, arg_browser)
}
extern "C" fn do_close<I: ImplLifeSpanHandler, R: Rc>(
self_: *mut _cef_life_span_handler_t,
browser: *mut _cef_browser_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplLifeSpanHandler::do_close(&arg_self_.interface, arg_browser)
}
extern "C" fn on_before_close<I: ImplLifeSpanHandler, R: Rc>(
self_: *mut _cef_life_span_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplLifeSpanHandler::on_before_close(&arg_self_.interface, arg_browser)
}
}
impl ImplLifeSpanHandler for LifeSpanHandler {
fn on_before_popup(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
popup_id: ::std::os::raw::c_int,
target_url: Option<&CefString>,
target_frame_name: Option<&CefString>,
target_disposition: WindowOpenDisposition,
user_gesture: ::std::os::raw::c_int,
popup_features: Option<&PopupFeatures>,
window_info: Option<&mut WindowInfo>,
client: Option<&mut Option<Client>>,
settings: Option<&mut BrowserSettings>,
extra_info: Option<&mut Option<DictionaryValue>>,
no_javascript_access: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_before_popup
.map(|f| {
let (
arg_browser,
arg_frame,
arg_popup_id,
arg_target_url,
arg_target_frame_name,
arg_target_disposition,
arg_user_gesture,
arg_popup_features,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_no_javascript_access,
) = (
browser,
frame,
popup_id,
target_url,
target_frame_name,
target_disposition,
user_gesture,
popup_features,
window_info,
client,
settings,
extra_info,
no_javascript_access,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_target_url = arg_target_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_target_frame_name = arg_target_frame_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_target_disposition = arg_target_disposition.into_raw();
let arg_popup_features = arg_popup_features.cloned().map(|arg| arg.into());
let arg_popup_features = arg_popup_features
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let mut arg_window_info = arg_window_info.cloned().map(|arg| arg.into());
let arg_window_info = arg_window_info
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let out_client = arg_client;
let mut ptr = std::ptr::null_mut();
let (out_client, arg_client) = out_client
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let mut arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let out_extra_info = arg_extra_info;
let mut ptr = std::ptr::null_mut();
let (out_extra_info, arg_extra_info) = out_extra_info
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let arg_no_javascript_access = arg_no_javascript_access
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_popup_id,
arg_target_url,
arg_target_frame_name,
arg_target_disposition,
arg_user_gesture,
arg_popup_features,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_no_javascript_access,
);
if let (Some(out_client), Some(arg_client)) = (out_client, arg_client.as_ref())
{
*out_client = arg_client
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
if let (Some(out_extra_info), Some(arg_extra_info)) =
(out_extra_info, arg_extra_info.as_ref())
{
*out_extra_info = arg_extra_info
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_before_popup_aborted(
&self,
browser: Option<&mut Browser>,
popup_id: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_before_popup_aborted {
let (arg_browser, arg_popup_id) = (browser, popup_id);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_popup_id);
}
}
}
fn on_before_dev_tools_popup(
&self,
browser: Option<&mut Browser>,
window_info: Option<&mut WindowInfo>,
client: Option<&mut Option<Client>>,
settings: Option<&mut BrowserSettings>,
extra_info: Option<&mut Option<DictionaryValue>>,
use_default_window: Option<&mut ::std::os::raw::c_int>,
) {
unsafe {
if let Some(f) = self.0.on_before_dev_tools_popup {
let (
arg_browser,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_use_default_window,
) = (
browser,
window_info,
client,
settings,
extra_info,
use_default_window,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_window_info = arg_window_info.cloned().map(|arg| arg.into());
let arg_window_info = arg_window_info
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let out_client = arg_client;
let mut ptr = std::ptr::null_mut();
let (out_client, arg_client) = out_client
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let mut arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let out_extra_info = arg_extra_info;
let mut ptr = std::ptr::null_mut();
let (out_extra_info, arg_extra_info) = out_extra_info
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let arg_use_default_window = arg_use_default_window
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_browser,
arg_window_info,
arg_client,
arg_settings,
arg_extra_info,
arg_use_default_window,
);
if let (Some(out_client), Some(arg_client)) = (out_client, arg_client.as_ref()) {
*out_client = arg_client
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
if let (Some(out_extra_info), Some(arg_extra_info)) =
(out_extra_info, arg_extra_info.as_ref())
{
*out_extra_info = arg_extra_info
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
}
}
}
fn on_after_created(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_after_created {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn do_close(&self, browser: Option<&mut Browser>) -> ::std::os::raw::c_int {
unsafe {
self.0
.do_close
.map(|f| {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_before_close(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_before_close {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn get_raw(&self) -> *mut _cef_life_span_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_life_span_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for LifeSpanHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_life_span_handler_t> for &LifeSpanHandler {
fn into_raw(self) -> *mut _cef_life_span_handler_t {
ImplLifeSpanHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_life_span_handler_t> for &mut LifeSpanHandler {
fn into_raw(self) -> *mut _cef_life_span_handler_t {
ImplLifeSpanHandler::get_raw(self)
}
}
impl ConvertReturnValue<LifeSpanHandler> for *mut _cef_life_span_handler_t {
fn wrap_result(self) -> LifeSpanHandler {
LifeSpanHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<LifeSpanHandler> for *mut _cef_life_span_handler_t {
fn from(value: LifeSpanHandler) -> Self {
let object = ImplLifeSpanHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_load_handler_t`] for more documentation.
#[derive(Clone)]
pub struct LoadHandler(RefGuard<_cef_load_handler_t>);
impl LoadHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapLoadHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplLoadHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapLoadHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_load_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapLoadHandler: ImplLoadHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_load_handler_t, Self>);
}
pub trait ImplLoadHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_load_handler_t::on_loading_state_change`] for more documentation."]
fn on_loading_state_change(
&self,
browser: Option<&mut Browser>,
is_loading: ::std::os::raw::c_int,
can_go_back: ::std::os::raw::c_int,
can_go_forward: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_load_handler_t::on_load_start`] for more documentation."]
fn on_load_start(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
transition_type: TransitionType,
) {
}
#[doc = "See [`_cef_load_handler_t::on_load_end`] for more documentation."]
fn on_load_end(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
http_status_code: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_load_handler_t::on_load_error`] for more documentation."]
fn on_load_error(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
error_code: Errorcode,
error_text: Option<&CefString>,
failed_url: Option<&CefString>,
) {
}
fn init_methods(object: &mut _cef_load_handler_t) {
impl_cef_load_handler_t::init_methods::<Self, _cef_load_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_load_handler_t;
}
#[doc = "Implement the [`WrapLoadHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl LoadHandler` block you can override default\nmethods implemented by the [`ImplLoadHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_load_handler! {\n struct MyLoadHandler {\n payload: String,\n }\n\n impl LoadHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> LoadHandler {\n MyLoadHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_load_handler { ($ vis : vis struct $ name : ident ; impl LoadHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_load_handler ! { $ vis struct $ name { } impl LoadHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl LoadHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_load_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> LoadHandler { LoadHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapLoadHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_load_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplLoadHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_load_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_load_handler_t {
use super::*;
pub fn init_methods<I: ImplLoadHandler, R: Rc>(object: &mut _cef_load_handler_t) {
object.on_loading_state_change = Some(on_loading_state_change::<I, R>);
object.on_load_start = Some(on_load_start::<I, R>);
object.on_load_end = Some(on_load_end::<I, R>);
object.on_load_error = Some(on_load_error::<I, R>);
}
extern "C" fn on_loading_state_change<I: ImplLoadHandler, R: Rc>(
self_: *mut _cef_load_handler_t,
browser: *mut _cef_browser_t,
is_loading: ::std::os::raw::c_int,
can_go_back: ::std::os::raw::c_int,
can_go_forward: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_is_loading, arg_can_go_back, arg_can_go_forward) =
(self_, browser, is_loading, can_go_back, can_go_forward);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_is_loading = arg_is_loading.into_raw();
let arg_can_go_back = arg_can_go_back.into_raw();
let arg_can_go_forward = arg_can_go_forward.into_raw();
ImplLoadHandler::on_loading_state_change(
&arg_self_.interface,
arg_browser,
arg_is_loading,
arg_can_go_back,
arg_can_go_forward,
)
}
extern "C" fn on_load_start<I: ImplLoadHandler, R: Rc>(
self_: *mut _cef_load_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
transition_type: cef_transition_type_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_transition_type) =
(self_, browser, frame, transition_type);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_transition_type = arg_transition_type.into_raw();
ImplLoadHandler::on_load_start(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_transition_type,
)
}
extern "C" fn on_load_end<I: ImplLoadHandler, R: Rc>(
self_: *mut _cef_load_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
http_status_code: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_frame, arg_http_status_code) =
(self_, browser, frame, http_status_code);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_http_status_code = arg_http_status_code.into_raw();
ImplLoadHandler::on_load_end(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_http_status_code,
)
}
extern "C" fn on_load_error<I: ImplLoadHandler, R: Rc>(
self_: *mut _cef_load_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
error_code: cef_errorcode_t,
error_text: *const cef_string_t,
failed_url: *const cef_string_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_error_code, arg_error_text, arg_failed_url) =
(self_, browser, frame, error_code, error_text, failed_url);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_error_code = arg_error_code.into_raw();
let arg_error_text = if arg_error_text.is_null() {
None
} else {
Some(arg_error_text.into())
};
let arg_error_text = arg_error_text.as_ref();
let arg_failed_url = if arg_failed_url.is_null() {
None
} else {
Some(arg_failed_url.into())
};
let arg_failed_url = arg_failed_url.as_ref();
ImplLoadHandler::on_load_error(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_error_code,
arg_error_text,
arg_failed_url,
)
}
}
impl ImplLoadHandler for LoadHandler {
fn on_loading_state_change(
&self,
browser: Option<&mut Browser>,
is_loading: ::std::os::raw::c_int,
can_go_back: ::std::os::raw::c_int,
can_go_forward: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_loading_state_change {
let (arg_browser, arg_is_loading, arg_can_go_back, arg_can_go_forward) =
(browser, is_loading, can_go_back, can_go_forward);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_browser,
arg_is_loading,
arg_can_go_back,
arg_can_go_forward,
);
}
}
}
fn on_load_start(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
transition_type: TransitionType,
) {
unsafe {
if let Some(f) = self.0.on_load_start {
let (arg_browser, arg_frame, arg_transition_type) =
(browser, frame, transition_type);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_transition_type = arg_transition_type.into_raw();
f(arg_self_, arg_browser, arg_frame, arg_transition_type);
}
}
}
fn on_load_end(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
http_status_code: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_load_end {
let (arg_browser, arg_frame, arg_http_status_code) =
(browser, frame, http_status_code);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame, arg_http_status_code);
}
}
}
fn on_load_error(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
error_code: Errorcode,
error_text: Option<&CefString>,
failed_url: Option<&CefString>,
) {
unsafe {
if let Some(f) = self.0.on_load_error {
let (arg_browser, arg_frame, arg_error_code, arg_error_text, arg_failed_url) =
(browser, frame, error_code, error_text, failed_url);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_error_code = arg_error_code.into_raw();
let arg_error_text = arg_error_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_failed_url = arg_failed_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_browser,
arg_frame,
arg_error_code,
arg_error_text,
arg_failed_url,
);
}
}
}
fn get_raw(&self) -> *mut _cef_load_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_load_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for LoadHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_load_handler_t> for &LoadHandler {
fn into_raw(self) -> *mut _cef_load_handler_t {
ImplLoadHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_load_handler_t> for &mut LoadHandler {
fn into_raw(self) -> *mut _cef_load_handler_t {
ImplLoadHandler::get_raw(self)
}
}
impl ConvertReturnValue<LoadHandler> for *mut _cef_load_handler_t {
fn wrap_result(self) -> LoadHandler {
LoadHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<LoadHandler> for *mut _cef_load_handler_t {
fn from(value: LoadHandler) -> Self {
let object = ImplLoadHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_media_access_callback_t`] for more documentation.
#[derive(Clone)]
pub struct MediaAccessCallback(RefGuard<_cef_media_access_callback_t>);
pub trait ImplMediaAccessCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_media_access_callback_t::cont`] for more documentation."]
fn cont(&self, allowed_permissions: u32);
#[doc = "See [`_cef_media_access_callback_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_media_access_callback_t;
}
impl ImplMediaAccessCallback for MediaAccessCallback {
fn cont(&self, allowed_permissions: u32) {
unsafe {
if let Some(f) = self.0.cont {
let arg_allowed_permissions = allowed_permissions;
let arg_self_ = self.into_raw();
f(arg_self_, arg_allowed_permissions);
}
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_media_access_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_media_access_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MediaAccessCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_media_access_callback_t> for &MediaAccessCallback {
fn into_raw(self) -> *mut _cef_media_access_callback_t {
ImplMediaAccessCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_media_access_callback_t> for &mut MediaAccessCallback {
fn into_raw(self) -> *mut _cef_media_access_callback_t {
ImplMediaAccessCallback::get_raw(self)
}
}
impl ConvertReturnValue<MediaAccessCallback> for *mut _cef_media_access_callback_t {
fn wrap_result(self) -> MediaAccessCallback {
MediaAccessCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MediaAccessCallback> for *mut _cef_media_access_callback_t {
fn from(value: MediaAccessCallback) -> Self {
let object = ImplMediaAccessCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_permission_prompt_callback_t`] for more documentation.
#[derive(Clone)]
pub struct PermissionPromptCallback(RefGuard<_cef_permission_prompt_callback_t>);
pub trait ImplPermissionPromptCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_permission_prompt_callback_t::cont`] for more documentation."]
fn cont(&self, result: PermissionRequestResult);
fn get_raw(&self) -> *mut _cef_permission_prompt_callback_t;
}
impl ImplPermissionPromptCallback for PermissionPromptCallback {
fn cont(&self, result: PermissionRequestResult) {
unsafe {
if let Some(f) = self.0.cont {
let arg_result = result;
let arg_self_ = self.into_raw();
let arg_result = arg_result.into_raw();
f(arg_self_, arg_result);
}
}
}
fn get_raw(&self) -> *mut _cef_permission_prompt_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_permission_prompt_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PermissionPromptCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_permission_prompt_callback_t> for &PermissionPromptCallback {
fn into_raw(self) -> *mut _cef_permission_prompt_callback_t {
ImplPermissionPromptCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_permission_prompt_callback_t> for &mut PermissionPromptCallback {
fn into_raw(self) -> *mut _cef_permission_prompt_callback_t {
ImplPermissionPromptCallback::get_raw(self)
}
}
impl ConvertReturnValue<PermissionPromptCallback> for *mut _cef_permission_prompt_callback_t {
fn wrap_result(self) -> PermissionPromptCallback {
PermissionPromptCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PermissionPromptCallback> for *mut _cef_permission_prompt_callback_t {
fn from(value: PermissionPromptCallback) -> Self {
let object = ImplPermissionPromptCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_permission_handler_t`] for more documentation.
#[derive(Clone)]
pub struct PermissionHandler(RefGuard<_cef_permission_handler_t>);
impl PermissionHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapPermissionHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplPermissionHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapPermissionHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_permission_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapPermissionHandler: ImplPermissionHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_permission_handler_t, Self>);
}
pub trait ImplPermissionHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_permission_handler_t::on_request_media_access_permission`] for more documentation."]
fn on_request_media_access_permission(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
requesting_origin: Option<&CefString>,
requested_permissions: u32,
callback: Option<&mut MediaAccessCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_permission_handler_t::on_show_permission_prompt`] for more documentation."]
fn on_show_permission_prompt(
&self,
browser: Option<&mut Browser>,
prompt_id: u64,
requesting_origin: Option<&CefString>,
requested_permissions: u32,
callback: Option<&mut PermissionPromptCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_permission_handler_t::on_dismiss_permission_prompt`] for more documentation."]
fn on_dismiss_permission_prompt(
&self,
browser: Option<&mut Browser>,
prompt_id: u64,
result: PermissionRequestResult,
) {
}
fn init_methods(object: &mut _cef_permission_handler_t) {
impl_cef_permission_handler_t::init_methods::<Self, _cef_permission_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_permission_handler_t;
}
#[doc = "Implement the [`WrapPermissionHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl PermissionHandler` block you can override default\nmethods implemented by the [`ImplPermissionHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_permission_handler! {\n struct MyPermissionHandler {\n payload: String,\n }\n\n impl PermissionHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> PermissionHandler {\n MyPermissionHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_permission_handler { ($ vis : vis struct $ name : ident ; impl PermissionHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_permission_handler ! { $ vis struct $ name { } impl PermissionHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl PermissionHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_permission_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> PermissionHandler { PermissionHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapPermissionHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_permission_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplPermissionHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_permission_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_permission_handler_t {
use super::*;
pub fn init_methods<I: ImplPermissionHandler, R: Rc>(object: &mut _cef_permission_handler_t) {
object.on_request_media_access_permission =
Some(on_request_media_access_permission::<I, R>);
object.on_show_permission_prompt = Some(on_show_permission_prompt::<I, R>);
object.on_dismiss_permission_prompt = Some(on_dismiss_permission_prompt::<I, R>);
}
extern "C" fn on_request_media_access_permission<I: ImplPermissionHandler, R: Rc>(
self_: *mut _cef_permission_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
requesting_origin: *const cef_string_t,
requested_permissions: u32,
callback: *mut _cef_media_access_callback_t,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_frame,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
) = (
self_,
browser,
frame,
requesting_origin,
requested_permissions,
callback,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_requesting_origin = if arg_requesting_origin.is_null() {
None
} else {
Some(arg_requesting_origin.into())
};
let arg_requesting_origin = arg_requesting_origin.as_ref();
let arg_requested_permissions = arg_requested_permissions.into_raw();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| MediaAccessCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplPermissionHandler::on_request_media_access_permission(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
)
}
extern "C" fn on_show_permission_prompt<I: ImplPermissionHandler, R: Rc>(
self_: *mut _cef_permission_handler_t,
browser: *mut _cef_browser_t,
prompt_id: u64,
requesting_origin: *const cef_string_t,
requested_permissions: u32,
callback: *mut _cef_permission_prompt_callback_t,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_prompt_id,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
) = (
self_,
browser,
prompt_id,
requesting_origin,
requested_permissions,
callback,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_prompt_id = arg_prompt_id.into_raw();
let arg_requesting_origin = if arg_requesting_origin.is_null() {
None
} else {
Some(arg_requesting_origin.into())
};
let arg_requesting_origin = arg_requesting_origin.as_ref();
let arg_requested_permissions = arg_requested_permissions.into_raw();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| PermissionPromptCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplPermissionHandler::on_show_permission_prompt(
&arg_self_.interface,
arg_browser,
arg_prompt_id,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
)
}
extern "C" fn on_dismiss_permission_prompt<I: ImplPermissionHandler, R: Rc>(
self_: *mut _cef_permission_handler_t,
browser: *mut _cef_browser_t,
prompt_id: u64,
result: cef_permission_request_result_t,
) {
let (arg_self_, arg_browser, arg_prompt_id, arg_result) =
(self_, browser, prompt_id, result);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_prompt_id = arg_prompt_id.into_raw();
let arg_result = arg_result.into_raw();
ImplPermissionHandler::on_dismiss_permission_prompt(
&arg_self_.interface,
arg_browser,
arg_prompt_id,
arg_result,
)
}
}
impl ImplPermissionHandler for PermissionHandler {
fn on_request_media_access_permission(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
requesting_origin: Option<&CefString>,
requested_permissions: u32,
callback: Option<&mut MediaAccessCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_request_media_access_permission
.map(|f| {
let (
arg_browser,
arg_frame,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
) = (
browser,
frame,
requesting_origin,
requested_permissions,
callback,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_requesting_origin = arg_requesting_origin
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplMediaAccessCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_show_permission_prompt(
&self,
browser: Option<&mut Browser>,
prompt_id: u64,
requesting_origin: Option<&CefString>,
requested_permissions: u32,
callback: Option<&mut PermissionPromptCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_show_permission_prompt
.map(|f| {
let (
arg_browser,
arg_prompt_id,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
) = (
browser,
prompt_id,
requesting_origin,
requested_permissions,
callback,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_requesting_origin = arg_requesting_origin
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplPermissionPromptCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_prompt_id,
arg_requesting_origin,
arg_requested_permissions,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_dismiss_permission_prompt(
&self,
browser: Option<&mut Browser>,
prompt_id: u64,
result: PermissionRequestResult,
) {
unsafe {
if let Some(f) = self.0.on_dismiss_permission_prompt {
let (arg_browser, arg_prompt_id, arg_result) = (browser, prompt_id, result);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_result = arg_result.into_raw();
f(arg_self_, arg_browser, arg_prompt_id, arg_result);
}
}
}
fn get_raw(&self) -> *mut _cef_permission_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_permission_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PermissionHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_permission_handler_t> for &PermissionHandler {
fn into_raw(self) -> *mut _cef_permission_handler_t {
ImplPermissionHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_permission_handler_t> for &mut PermissionHandler {
fn into_raw(self) -> *mut _cef_permission_handler_t {
ImplPermissionHandler::get_raw(self)
}
}
impl ConvertReturnValue<PermissionHandler> for *mut _cef_permission_handler_t {
fn wrap_result(self) -> PermissionHandler {
PermissionHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PermissionHandler> for *mut _cef_permission_handler_t {
fn from(value: PermissionHandler) -> Self {
let object = ImplPermissionHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_print_settings_t`] for more documentation.
#[derive(Clone)]
pub struct PrintSettings(RefGuard<_cef_print_settings_t>);
pub trait ImplPrintSettings: Clone + Sized + Rc {
#[doc = "See [`_cef_print_settings_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_print_settings_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_print_settings_t::set_orientation`] for more documentation."]
fn set_orientation(&self, landscape: ::std::os::raw::c_int);
#[doc = "See [`_cef_print_settings_t::is_landscape`] for more documentation."]
fn is_landscape(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_print_settings_t::set_printer_printable_area`] for more documentation."]
fn set_printer_printable_area(
&self,
physical_size_device_units: Option<&Size>,
printable_area_device_units: Option<&Rect>,
landscape_needs_flip: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_print_settings_t::set_device_name`] for more documentation."]
fn set_device_name(&self, name: Option<&CefString>);
#[doc = "See [`_cef_print_settings_t::get_device_name`] for more documentation."]
fn device_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_print_settings_t::set_dpi`] for more documentation."]
fn set_dpi(&self, dpi: ::std::os::raw::c_int);
#[doc = "See [`_cef_print_settings_t::get_dpi`] for more documentation."]
fn dpi(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_print_settings_t::set_page_ranges`] for more documentation."]
fn set_page_ranges(&self, ranges: Option<&[Range]>);
#[doc = "See [`_cef_print_settings_t::get_page_ranges_count`] for more documentation."]
fn page_ranges_count(&self) -> usize;
#[doc = "See [`_cef_print_settings_t::get_page_ranges`] for more documentation."]
fn page_ranges(&self, ranges: Option<&mut Vec<Range>>);
#[doc = "See [`_cef_print_settings_t::set_selection_only`] for more documentation."]
fn set_selection_only(&self, selection_only: ::std::os::raw::c_int);
#[doc = "See [`_cef_print_settings_t::is_selection_only`] for more documentation."]
fn is_selection_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_print_settings_t::set_collate`] for more documentation."]
fn set_collate(&self, collate: ::std::os::raw::c_int);
#[doc = "See [`_cef_print_settings_t::will_collate`] for more documentation."]
fn will_collate(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_print_settings_t::set_color_model`] for more documentation."]
fn set_color_model(&self, model: ColorModel);
#[doc = "See [`_cef_print_settings_t::get_color_model`] for more documentation."]
fn color_model(&self) -> ColorModel;
#[doc = "See [`_cef_print_settings_t::set_copies`] for more documentation."]
fn set_copies(&self, copies: ::std::os::raw::c_int);
#[doc = "See [`_cef_print_settings_t::get_copies`] for more documentation."]
fn copies(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_print_settings_t::set_duplex_mode`] for more documentation."]
fn set_duplex_mode(&self, mode: DuplexMode);
#[doc = "See [`_cef_print_settings_t::get_duplex_mode`] for more documentation."]
fn duplex_mode(&self) -> DuplexMode;
fn get_raw(&self) -> *mut _cef_print_settings_t;
}
impl ImplPrintSettings for PrintSettings {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_orientation(&self, landscape: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_orientation {
let arg_landscape = landscape;
let arg_self_ = self.into_raw();
f(arg_self_, arg_landscape);
}
}
}
fn is_landscape(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_landscape
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_printer_printable_area(
&self,
physical_size_device_units: Option<&Size>,
printable_area_device_units: Option<&Rect>,
landscape_needs_flip: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.set_printer_printable_area {
let (
arg_physical_size_device_units,
arg_printable_area_device_units,
arg_landscape_needs_flip,
) = (
physical_size_device_units,
printable_area_device_units,
landscape_needs_flip,
);
let arg_self_ = self.into_raw();
let arg_physical_size_device_units = arg_physical_size_device_units
.cloned()
.map(|arg| arg.into());
let arg_physical_size_device_units = arg_physical_size_device_units
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_printable_area_device_units = arg_printable_area_device_units
.cloned()
.map(|arg| arg.into());
let arg_printable_area_device_units = arg_printable_area_device_units
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_physical_size_device_units,
arg_printable_area_device_units,
arg_landscape_needs_flip,
);
}
}
}
fn set_device_name(&self, name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_device_name {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name);
}
}
}
fn device_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_device_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_dpi(&self, dpi: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_dpi {
let arg_dpi = dpi;
let arg_self_ = self.into_raw();
f(arg_self_, arg_dpi);
}
}
}
fn dpi(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_dpi
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_page_ranges(&self, ranges: Option<&[Range]>) {
unsafe {
if let Some(f) = self.0.set_page_ranges {
let arg_ranges = ranges;
let arg_self_ = self.into_raw();
let arg_ranges_count = arg_ranges.as_ref().map(|arg| arg.len()).unwrap_or_default();
let vec_ranges = arg_ranges
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_ranges = if vec_ranges.is_empty() {
std::ptr::null()
} else {
vec_ranges.as_ptr()
};
f(arg_self_, arg_ranges_count, arg_ranges);
}
}
}
fn page_ranges_count(&self) -> usize {
unsafe {
self.0
.get_page_ranges_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn page_ranges(&self, ranges: Option<&mut Vec<Range>>) {
unsafe {
if let Some(f) = self.0.get_page_ranges {
let arg_ranges = ranges;
let arg_self_ = self.into_raw();
let mut out_ranges_count =
arg_ranges.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_ranges_count = &mut out_ranges_count;
let out_ranges = arg_ranges;
let mut vec_ranges = out_ranges
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_ranges = if vec_ranges.is_empty() {
std::ptr::null_mut()
} else {
vec_ranges.as_mut_ptr()
};
f(arg_self_, arg_ranges_count, arg_ranges);
if let Some(out_ranges) = out_ranges {
*out_ranges = vec_ranges
.into_iter()
.take(out_ranges_count)
.map(|elem| elem.wrap_result())
.collect();
}
}
}
}
fn set_selection_only(&self, selection_only: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_selection_only {
let arg_selection_only = selection_only;
let arg_self_ = self.into_raw();
f(arg_self_, arg_selection_only);
}
}
}
fn is_selection_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_selection_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_collate(&self, collate: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_collate {
let arg_collate = collate;
let arg_self_ = self.into_raw();
f(arg_self_, arg_collate);
}
}
}
fn will_collate(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.will_collate
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_color_model(&self, model: ColorModel) {
unsafe {
if let Some(f) = self.0.set_color_model {
let arg_model = model;
let arg_self_ = self.into_raw();
let arg_model = arg_model.into_raw();
f(arg_self_, arg_model);
}
}
}
fn color_model(&self) -> ColorModel {
unsafe {
self.0
.get_color_model
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_copies(&self, copies: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_copies {
let arg_copies = copies;
let arg_self_ = self.into_raw();
f(arg_self_, arg_copies);
}
}
}
fn copies(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_copies
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_duplex_mode(&self, mode: DuplexMode) {
unsafe {
if let Some(f) = self.0.set_duplex_mode {
let arg_mode = mode;
let arg_self_ = self.into_raw();
let arg_mode = arg_mode.into_raw();
f(arg_self_, arg_mode);
}
}
}
fn duplex_mode(&self) -> DuplexMode {
unsafe {
self.0
.get_duplex_mode
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_print_settings_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_print_settings_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PrintSettings {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_print_settings_t> for &PrintSettings {
fn into_raw(self) -> *mut _cef_print_settings_t {
ImplPrintSettings::get_raw(self)
}
}
impl ConvertParam<*mut _cef_print_settings_t> for &mut PrintSettings {
fn into_raw(self) -> *mut _cef_print_settings_t {
ImplPrintSettings::get_raw(self)
}
}
impl ConvertReturnValue<PrintSettings> for *mut _cef_print_settings_t {
fn wrap_result(self) -> PrintSettings {
PrintSettings(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PrintSettings> for *mut _cef_print_settings_t {
fn from(value: PrintSettings) -> Self {
let object = ImplPrintSettings::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_print_dialog_callback_t`] for more documentation.
#[derive(Clone)]
pub struct PrintDialogCallback(RefGuard<_cef_print_dialog_callback_t>);
pub trait ImplPrintDialogCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_print_dialog_callback_t::cont`] for more documentation."]
fn cont(&self, settings: Option<&mut PrintSettings>);
#[doc = "See [`_cef_print_dialog_callback_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_print_dialog_callback_t;
}
impl ImplPrintDialogCallback for PrintDialogCallback {
fn cont(&self, settings: Option<&mut PrintSettings>) {
unsafe {
if let Some(f) = self.0.cont {
let arg_settings = settings;
let arg_self_ = self.into_raw();
let arg_settings = arg_settings
.map(|arg| {
arg.add_ref();
ImplPrintSettings::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_settings);
}
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_print_dialog_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_print_dialog_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PrintDialogCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_print_dialog_callback_t> for &PrintDialogCallback {
fn into_raw(self) -> *mut _cef_print_dialog_callback_t {
ImplPrintDialogCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_print_dialog_callback_t> for &mut PrintDialogCallback {
fn into_raw(self) -> *mut _cef_print_dialog_callback_t {
ImplPrintDialogCallback::get_raw(self)
}
}
impl ConvertReturnValue<PrintDialogCallback> for *mut _cef_print_dialog_callback_t {
fn wrap_result(self) -> PrintDialogCallback {
PrintDialogCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PrintDialogCallback> for *mut _cef_print_dialog_callback_t {
fn from(value: PrintDialogCallback) -> Self {
let object = ImplPrintDialogCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_print_job_callback_t`] for more documentation.
#[derive(Clone)]
pub struct PrintJobCallback(RefGuard<_cef_print_job_callback_t>);
pub trait ImplPrintJobCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_print_job_callback_t::cont`] for more documentation."]
fn cont(&self);
fn get_raw(&self) -> *mut _cef_print_job_callback_t;
}
impl ImplPrintJobCallback for PrintJobCallback {
fn cont(&self) {
unsafe {
if let Some(f) = self.0.cont {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_print_job_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_print_job_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PrintJobCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_print_job_callback_t> for &PrintJobCallback {
fn into_raw(self) -> *mut _cef_print_job_callback_t {
ImplPrintJobCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_print_job_callback_t> for &mut PrintJobCallback {
fn into_raw(self) -> *mut _cef_print_job_callback_t {
ImplPrintJobCallback::get_raw(self)
}
}
impl ConvertReturnValue<PrintJobCallback> for *mut _cef_print_job_callback_t {
fn wrap_result(self) -> PrintJobCallback {
PrintJobCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PrintJobCallback> for *mut _cef_print_job_callback_t {
fn from(value: PrintJobCallback) -> Self {
let object = ImplPrintJobCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_print_handler_t`] for more documentation.
#[derive(Clone)]
pub struct PrintHandler(RefGuard<_cef_print_handler_t>);
impl PrintHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapPrintHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplPrintHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapPrintHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_print_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapPrintHandler: ImplPrintHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_print_handler_t, Self>);
}
pub trait ImplPrintHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_print_handler_t::on_print_start`] for more documentation."]
fn on_print_start(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_print_handler_t::on_print_settings`] for more documentation."]
fn on_print_settings(
&self,
browser: Option<&mut Browser>,
settings: Option<&mut PrintSettings>,
get_defaults: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_print_handler_t::on_print_dialog`] for more documentation."]
fn on_print_dialog(
&self,
browser: Option<&mut Browser>,
has_selection: ::std::os::raw::c_int,
callback: Option<&mut PrintDialogCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_print_handler_t::on_print_job`] for more documentation."]
fn on_print_job(
&self,
browser: Option<&mut Browser>,
document_name: Option<&CefString>,
pdf_file_path: Option<&CefString>,
callback: Option<&mut PrintJobCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_print_handler_t::on_print_reset`] for more documentation."]
fn on_print_reset(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_print_handler_t::get_pdf_paper_size`] for more documentation."]
fn pdf_paper_size(
&self,
browser: Option<&mut Browser>,
device_units_per_inch: ::std::os::raw::c_int,
) -> Size {
Default::default()
}
fn init_methods(object: &mut _cef_print_handler_t) {
impl_cef_print_handler_t::init_methods::<Self, _cef_print_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_print_handler_t;
}
#[doc = "Implement the [`WrapPrintHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl PrintHandler` block you can override default\nmethods implemented by the [`ImplPrintHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_print_handler! {\n struct MyPrintHandler {\n payload: String,\n }\n\n impl PrintHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> PrintHandler {\n MyPrintHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_print_handler { ($ vis : vis struct $ name : ident ; impl PrintHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_print_handler ! { $ vis struct $ name { } impl PrintHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl PrintHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_print_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> PrintHandler { PrintHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapPrintHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_print_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplPrintHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_print_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_print_handler_t {
use super::*;
pub fn init_methods<I: ImplPrintHandler, R: Rc>(object: &mut _cef_print_handler_t) {
object.on_print_start = Some(on_print_start::<I, R>);
object.on_print_settings = Some(on_print_settings::<I, R>);
object.on_print_dialog = Some(on_print_dialog::<I, R>);
object.on_print_job = Some(on_print_job::<I, R>);
object.on_print_reset = Some(on_print_reset::<I, R>);
object.get_pdf_paper_size = Some(get_pdf_paper_size::<I, R>);
}
extern "C" fn on_print_start<I: ImplPrintHandler, R: Rc>(
self_: *mut _cef_print_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplPrintHandler::on_print_start(&arg_self_.interface, arg_browser)
}
extern "C" fn on_print_settings<I: ImplPrintHandler, R: Rc>(
self_: *mut _cef_print_handler_t,
browser: *mut _cef_browser_t,
settings: *mut _cef_print_settings_t,
get_defaults: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_settings, arg_get_defaults) =
(self_, browser, settings, get_defaults);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_settings = unsafe { arg_settings.as_mut() }
.map(|arg| PrintSettings(unsafe { RefGuard::from_raw(arg) }));
let arg_settings = arg_settings.as_mut();
let arg_get_defaults = arg_get_defaults.into_raw();
ImplPrintHandler::on_print_settings(
&arg_self_.interface,
arg_browser,
arg_settings,
arg_get_defaults,
)
}
extern "C" fn on_print_dialog<I: ImplPrintHandler, R: Rc>(
self_: *mut _cef_print_handler_t,
browser: *mut _cef_browser_t,
has_selection: ::std::os::raw::c_int,
callback: *mut _cef_print_dialog_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_has_selection, arg_callback) =
(self_, browser, has_selection, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_has_selection = arg_has_selection.into_raw();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| PrintDialogCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplPrintHandler::on_print_dialog(
&arg_self_.interface,
arg_browser,
arg_has_selection,
arg_callback,
)
}
extern "C" fn on_print_job<I: ImplPrintHandler, R: Rc>(
self_: *mut _cef_print_handler_t,
browser: *mut _cef_browser_t,
document_name: *const cef_string_t,
pdf_file_path: *const cef_string_t,
callback: *mut _cef_print_job_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_document_name, arg_pdf_file_path, arg_callback) =
(self_, browser, document_name, pdf_file_path, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_document_name = if arg_document_name.is_null() {
None
} else {
Some(arg_document_name.into())
};
let arg_document_name = arg_document_name.as_ref();
let arg_pdf_file_path = if arg_pdf_file_path.is_null() {
None
} else {
Some(arg_pdf_file_path.into())
};
let arg_pdf_file_path = arg_pdf_file_path.as_ref();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| PrintJobCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplPrintHandler::on_print_job(
&arg_self_.interface,
arg_browser,
arg_document_name,
arg_pdf_file_path,
arg_callback,
)
}
extern "C" fn on_print_reset<I: ImplPrintHandler, R: Rc>(
self_: *mut _cef_print_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplPrintHandler::on_print_reset(&arg_self_.interface, arg_browser)
}
extern "C" fn get_pdf_paper_size<I: ImplPrintHandler, R: Rc>(
self_: *mut _cef_print_handler_t,
browser: *mut _cef_browser_t,
device_units_per_inch: ::std::os::raw::c_int,
) -> _cef_size_t {
let (arg_self_, arg_browser, arg_device_units_per_inch) =
(self_, browser, device_units_per_inch);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_device_units_per_inch = arg_device_units_per_inch.into_raw();
let result = ImplPrintHandler::pdf_paper_size(
&arg_self_.interface,
arg_browser,
arg_device_units_per_inch,
);
result.into()
}
}
impl ImplPrintHandler for PrintHandler {
fn on_print_start(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_print_start {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn on_print_settings(
&self,
browser: Option<&mut Browser>,
settings: Option<&mut PrintSettings>,
get_defaults: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_print_settings {
let (arg_browser, arg_settings, arg_get_defaults) =
(browser, settings, get_defaults);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_settings = arg_settings
.map(|arg| {
arg.add_ref();
ImplPrintSettings::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_settings, arg_get_defaults);
}
}
}
fn on_print_dialog(
&self,
browser: Option<&mut Browser>,
has_selection: ::std::os::raw::c_int,
callback: Option<&mut PrintDialogCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_print_dialog
.map(|f| {
let (arg_browser, arg_has_selection, arg_callback) =
(browser, has_selection, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplPrintDialogCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_has_selection, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_print_job(
&self,
browser: Option<&mut Browser>,
document_name: Option<&CefString>,
pdf_file_path: Option<&CefString>,
callback: Option<&mut PrintJobCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_print_job
.map(|f| {
let (arg_browser, arg_document_name, arg_pdf_file_path, arg_callback) =
(browser, document_name, pdf_file_path, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_document_name = arg_document_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_pdf_file_path = arg_pdf_file_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplPrintJobCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_document_name,
arg_pdf_file_path,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_print_reset(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_print_reset {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn pdf_paper_size(
&self,
browser: Option<&mut Browser>,
device_units_per_inch: ::std::os::raw::c_int,
) -> Size {
unsafe {
self.0
.get_pdf_paper_size
.map(|f| {
let (arg_browser, arg_device_units_per_inch) = (browser, device_units_per_inch);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_device_units_per_inch);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_print_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_print_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PrintHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_print_handler_t> for &PrintHandler {
fn into_raw(self) -> *mut _cef_print_handler_t {
ImplPrintHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_print_handler_t> for &mut PrintHandler {
fn into_raw(self) -> *mut _cef_print_handler_t {
ImplPrintHandler::get_raw(self)
}
}
impl ConvertReturnValue<PrintHandler> for *mut _cef_print_handler_t {
fn wrap_result(self) -> PrintHandler {
PrintHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PrintHandler> for *mut _cef_print_handler_t {
fn from(value: PrintHandler) -> Self {
let object = ImplPrintHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_render_handler_t`] for more documentation.
#[derive(Clone)]
pub struct RenderHandler(RefGuard<_cef_render_handler_t>);
impl RenderHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapRenderHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplRenderHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapRenderHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_render_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapRenderHandler: ImplRenderHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_render_handler_t, Self>);
}
pub trait ImplRenderHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_render_handler_t::get_accessibility_handler`] for more documentation."]
fn accessibility_handler(&self) -> Option<AccessibilityHandler> {
Default::default()
}
#[doc = "See [`_cef_render_handler_t::get_root_screen_rect`] for more documentation."]
fn root_screen_rect(
&self,
browser: Option<&mut Browser>,
rect: Option<&mut Rect>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_render_handler_t::get_view_rect`] for more documentation."]
fn view_rect(&self, browser: Option<&mut Browser>, rect: Option<&mut Rect>) {}
#[doc = "See [`_cef_render_handler_t::get_screen_point`] for more documentation."]
fn screen_point(
&self,
browser: Option<&mut Browser>,
view_x: ::std::os::raw::c_int,
view_y: ::std::os::raw::c_int,
screen_x: Option<&mut ::std::os::raw::c_int>,
screen_y: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_render_handler_t::get_screen_info`] for more documentation."]
fn screen_info(
&self,
browser: Option<&mut Browser>,
screen_info: Option<&mut ScreenInfo>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_render_handler_t::on_popup_show`] for more documentation."]
fn on_popup_show(&self, browser: Option<&mut Browser>, show: ::std::os::raw::c_int) {}
#[doc = "See [`_cef_render_handler_t::on_popup_size`] for more documentation."]
fn on_popup_size(&self, browser: Option<&mut Browser>, rect: Option<&Rect>) {}
#[doc = "See [`_cef_render_handler_t::on_paint`] for more documentation."]
fn on_paint(
&self,
browser: Option<&mut Browser>,
type_: PaintElementType,
dirty_rects: Option<&[Rect]>,
buffer: *const u8,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_render_handler_t::on_accelerated_paint`] for more documentation."]
fn on_accelerated_paint(
&self,
browser: Option<&mut Browser>,
type_: PaintElementType,
dirty_rects: Option<&[Rect]>,
info: Option<&AcceleratedPaintInfo>,
) {
}
#[doc = "See [`_cef_render_handler_t::get_touch_handle_size`] for more documentation."]
fn touch_handle_size(
&self,
browser: Option<&mut Browser>,
orientation: HorizontalAlignment,
size: Option<&mut Size>,
) {
}
#[doc = "See [`_cef_render_handler_t::on_touch_handle_state_changed`] for more documentation."]
fn on_touch_handle_state_changed(
&self,
browser: Option<&mut Browser>,
state: Option<&TouchHandleState>,
) {
}
#[doc = "See [`_cef_render_handler_t::start_dragging`] for more documentation."]
fn start_dragging(
&self,
browser: Option<&mut Browser>,
drag_data: Option<&mut DragData>,
allowed_ops: DragOperationsMask,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_render_handler_t::update_drag_cursor`] for more documentation."]
fn update_drag_cursor(&self, browser: Option<&mut Browser>, operation: DragOperationsMask) {}
#[doc = "See [`_cef_render_handler_t::on_scroll_offset_changed`] for more documentation."]
fn on_scroll_offset_changed(&self, browser: Option<&mut Browser>, x: f64, y: f64) {}
#[doc = "See [`_cef_render_handler_t::on_ime_composition_range_changed`] for more documentation."]
fn on_ime_composition_range_changed(
&self,
browser: Option<&mut Browser>,
selected_range: Option<&Range>,
character_bounds: Option<&[Rect]>,
) {
}
#[doc = "See [`_cef_render_handler_t::on_text_selection_changed`] for more documentation."]
fn on_text_selection_changed(
&self,
browser: Option<&mut Browser>,
selected_text: Option<&CefString>,
selected_range: Option<&Range>,
) {
}
#[doc = "See [`_cef_render_handler_t::on_virtual_keyboard_requested`] for more documentation."]
fn on_virtual_keyboard_requested(
&self,
browser: Option<&mut Browser>,
input_mode: TextInputMode,
) {
}
fn init_methods(object: &mut _cef_render_handler_t) {
impl_cef_render_handler_t::init_methods::<Self, _cef_render_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_render_handler_t;
}
#[doc = "Implement the [`WrapRenderHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl RenderHandler` block you can override default\nmethods implemented by the [`ImplRenderHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_render_handler! {\n struct MyRenderHandler {\n payload: String,\n }\n\n impl RenderHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> RenderHandler {\n MyRenderHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_render_handler { ($ vis : vis struct $ name : ident ; impl RenderHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_render_handler ! { $ vis struct $ name { } impl RenderHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl RenderHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_render_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> RenderHandler { RenderHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapRenderHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_render_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplRenderHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_render_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_render_handler_t {
use super::*;
pub fn init_methods<I: ImplRenderHandler, R: Rc>(object: &mut _cef_render_handler_t) {
object.get_accessibility_handler = Some(get_accessibility_handler::<I, R>);
object.get_root_screen_rect = Some(get_root_screen_rect::<I, R>);
object.get_view_rect = Some(get_view_rect::<I, R>);
object.get_screen_point = Some(get_screen_point::<I, R>);
object.get_screen_info = Some(get_screen_info::<I, R>);
object.on_popup_show = Some(on_popup_show::<I, R>);
object.on_popup_size = Some(on_popup_size::<I, R>);
object.on_paint = Some(on_paint::<I, R>);
object.on_accelerated_paint = Some(on_accelerated_paint::<I, R>);
object.get_touch_handle_size = Some(get_touch_handle_size::<I, R>);
object.on_touch_handle_state_changed = Some(on_touch_handle_state_changed::<I, R>);
object.start_dragging = Some(start_dragging::<I, R>);
object.update_drag_cursor = Some(update_drag_cursor::<I, R>);
object.on_scroll_offset_changed = Some(on_scroll_offset_changed::<I, R>);
object.on_ime_composition_range_changed = Some(on_ime_composition_range_changed::<I, R>);
object.on_text_selection_changed = Some(on_text_selection_changed::<I, R>);
object.on_virtual_keyboard_requested = Some(on_virtual_keyboard_requested::<I, R>);
}
extern "C" fn get_accessibility_handler<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
) -> *mut _cef_accessibility_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplRenderHandler::accessibility_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_root_screen_rect<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
rect: *mut _cef_rect_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_rect) = (self_, browser, rect);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_rect = if arg_rect.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_rect))
};
let arg_rect = arg_rect.as_mut().map(|arg| arg.as_mut());
ImplRenderHandler::root_screen_rect(&arg_self_.interface, arg_browser, arg_rect)
}
extern "C" fn get_view_rect<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
rect: *mut _cef_rect_t,
) {
let (arg_self_, arg_browser, arg_rect) = (self_, browser, rect);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_rect = if arg_rect.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_rect))
};
let arg_rect = arg_rect.as_mut().map(|arg| arg.as_mut());
ImplRenderHandler::view_rect(&arg_self_.interface, arg_browser, arg_rect)
}
extern "C" fn get_screen_point<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
view_x: ::std::os::raw::c_int,
view_y: ::std::os::raw::c_int,
screen_x: *mut ::std::os::raw::c_int,
screen_y: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_view_x, arg_view_y, arg_screen_x, arg_screen_y) =
(self_, browser, view_x, view_y, screen_x, screen_y);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_view_x = arg_view_x.into_raw();
let arg_view_y = arg_view_y.into_raw();
let mut arg_screen_x = if arg_screen_x.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(arg_screen_x))
};
let arg_screen_x = arg_screen_x.as_mut().map(|arg| arg.as_mut());
let mut arg_screen_y = if arg_screen_y.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(arg_screen_y))
};
let arg_screen_y = arg_screen_y.as_mut().map(|arg| arg.as_mut());
ImplRenderHandler::screen_point(
&arg_self_.interface,
arg_browser,
arg_view_x,
arg_view_y,
arg_screen_x,
arg_screen_y,
)
}
extern "C" fn get_screen_info<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
screen_info: *mut _cef_screen_info_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_screen_info) = (self_, browser, screen_info);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_screen_info = if arg_screen_info.is_null() {
None
} else {
Some(WrapParamRef::<ScreenInfo, _>::from(arg_screen_info))
};
let arg_screen_info = arg_screen_info.as_mut().map(|arg| arg.as_mut());
ImplRenderHandler::screen_info(&arg_self_.interface, arg_browser, arg_screen_info)
}
extern "C" fn on_popup_show<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
show: ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_show) = (self_, browser, show);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_show = arg_show.into_raw();
ImplRenderHandler::on_popup_show(&arg_self_.interface, arg_browser, arg_show)
}
extern "C" fn on_popup_size<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
rect: *const _cef_rect_t,
) {
let (arg_self_, arg_browser, arg_rect) = (self_, browser, rect);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_rect = if arg_rect.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_rect))
};
let arg_rect = arg_rect.as_ref().map(|arg| arg.as_ref());
ImplRenderHandler::on_popup_size(&arg_self_.interface, arg_browser, arg_rect)
}
extern "C" fn on_paint<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
type_: cef_paint_element_type_t,
dirty_rects_count: usize,
dirty_rects: *const _cef_rect_t,
buffer: *const ::std::os::raw::c_void,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
) {
let (
arg_self_,
arg_browser,
arg_type_,
arg_dirty_rects_count,
arg_dirty_rects,
arg_buffer,
arg_width,
arg_height,
) = (
self_,
browser,
type_,
dirty_rects_count,
dirty_rects,
buffer,
width,
height,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_type_ = arg_type_.into_raw();
let arg_dirty_rects = if arg_dirty_rects.is_null() {
None
} else {
let arg_dirty_rects =
unsafe { std::slice::from_raw_parts(arg_dirty_rects, arg_dirty_rects_count) };
let arg_dirty_rects: Vec<_> =
arg_dirty_rects.iter().map(|elem| (*elem).into()).collect();
Some(arg_dirty_rects)
};
let arg_dirty_rects = arg_dirty_rects.as_deref();
let arg_buffer = arg_buffer.cast();
let arg_width = arg_width.into_raw();
let arg_height = arg_height.into_raw();
ImplRenderHandler::on_paint(
&arg_self_.interface,
arg_browser,
arg_type_,
arg_dirty_rects,
arg_buffer,
arg_width,
arg_height,
)
}
extern "C" fn on_accelerated_paint<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
type_: cef_paint_element_type_t,
dirty_rects_count: usize,
dirty_rects: *const _cef_rect_t,
info: *const _cef_accelerated_paint_info_t,
) {
let (arg_self_, arg_browser, arg_type_, arg_dirty_rects_count, arg_dirty_rects, arg_info) =
(self_, browser, type_, dirty_rects_count, dirty_rects, info);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_type_ = arg_type_.into_raw();
let arg_dirty_rects = if arg_dirty_rects.is_null() {
None
} else {
let arg_dirty_rects =
unsafe { std::slice::from_raw_parts(arg_dirty_rects, arg_dirty_rects_count) };
let arg_dirty_rects: Vec<_> =
arg_dirty_rects.iter().map(|elem| (*elem).into()).collect();
Some(arg_dirty_rects)
};
let arg_dirty_rects = arg_dirty_rects.as_deref();
let arg_info = if arg_info.is_null() {
None
} else {
Some(WrapParamRef::<AcceleratedPaintInfo, _>::from(arg_info))
};
let arg_info = arg_info.as_ref().map(|arg| arg.as_ref());
ImplRenderHandler::on_accelerated_paint(
&arg_self_.interface,
arg_browser,
arg_type_,
arg_dirty_rects,
arg_info,
)
}
extern "C" fn get_touch_handle_size<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
orientation: cef_horizontal_alignment_t,
size: *mut _cef_size_t,
) {
let (arg_self_, arg_browser, arg_orientation, arg_size) =
(self_, browser, orientation, size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_orientation = arg_orientation.into_raw();
let mut arg_size = if arg_size.is_null() {
None
} else {
Some(WrapParamRef::<Size, _>::from(arg_size))
};
let arg_size = arg_size.as_mut().map(|arg| arg.as_mut());
ImplRenderHandler::touch_handle_size(
&arg_self_.interface,
arg_browser,
arg_orientation,
arg_size,
)
}
extern "C" fn on_touch_handle_state_changed<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
state: *const _cef_touch_handle_state_t,
) {
let (arg_self_, arg_browser, arg_state) = (self_, browser, state);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_state = if arg_state.is_null() {
None
} else {
Some(WrapParamRef::<TouchHandleState, _>::from(arg_state))
};
let arg_state = arg_state.as_ref().map(|arg| arg.as_ref());
ImplRenderHandler::on_touch_handle_state_changed(
&arg_self_.interface,
arg_browser,
arg_state,
)
}
extern "C" fn start_dragging<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
drag_data: *mut _cef_drag_data_t,
allowed_ops: cef_drag_operations_mask_t,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_drag_data, arg_allowed_ops, arg_x, arg_y) =
(self_, browser, drag_data, allowed_ops, x, y);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_drag_data = unsafe { arg_drag_data.as_mut() }
.map(|arg| DragData(unsafe { RefGuard::from_raw(arg) }));
let arg_drag_data = arg_drag_data.as_mut();
let arg_allowed_ops = arg_allowed_ops.into_raw();
let arg_x = arg_x.into_raw();
let arg_y = arg_y.into_raw();
ImplRenderHandler::start_dragging(
&arg_self_.interface,
arg_browser,
arg_drag_data,
arg_allowed_ops,
arg_x,
arg_y,
)
}
extern "C" fn update_drag_cursor<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
operation: cef_drag_operations_mask_t,
) {
let (arg_self_, arg_browser, arg_operation) = (self_, browser, operation);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_operation = arg_operation.into_raw();
ImplRenderHandler::update_drag_cursor(&arg_self_.interface, arg_browser, arg_operation)
}
extern "C" fn on_scroll_offset_changed<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
x: f64,
y: f64,
) {
let (arg_self_, arg_browser, arg_x, arg_y) = (self_, browser, x, y);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_x = arg_x.into_raw();
let arg_y = arg_y.into_raw();
ImplRenderHandler::on_scroll_offset_changed(&arg_self_.interface, arg_browser, arg_x, arg_y)
}
extern "C" fn on_ime_composition_range_changed<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
selected_range: *const _cef_range_t,
character_bounds_count: usize,
character_bounds: *const _cef_rect_t,
) {
let (
arg_self_,
arg_browser,
arg_selected_range,
arg_character_bounds_count,
arg_character_bounds,
) = (
self_,
browser,
selected_range,
character_bounds_count,
character_bounds,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_selected_range = if arg_selected_range.is_null() {
None
} else {
Some(WrapParamRef::<Range, _>::from(arg_selected_range))
};
let arg_selected_range = arg_selected_range.as_ref().map(|arg| arg.as_ref());
let arg_character_bounds = if arg_character_bounds.is_null() {
None
} else {
let arg_character_bounds = unsafe {
std::slice::from_raw_parts(arg_character_bounds, arg_character_bounds_count)
};
let arg_character_bounds: Vec<_> = arg_character_bounds
.iter()
.map(|elem| (*elem).into())
.collect();
Some(arg_character_bounds)
};
let arg_character_bounds = arg_character_bounds.as_deref();
ImplRenderHandler::on_ime_composition_range_changed(
&arg_self_.interface,
arg_browser,
arg_selected_range,
arg_character_bounds,
)
}
extern "C" fn on_text_selection_changed<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
selected_text: *const cef_string_t,
selected_range: *const _cef_range_t,
) {
let (arg_self_, arg_browser, arg_selected_text, arg_selected_range) =
(self_, browser, selected_text, selected_range);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_selected_text = if arg_selected_text.is_null() {
None
} else {
Some(arg_selected_text.into())
};
let arg_selected_text = arg_selected_text.as_ref();
let arg_selected_range = if arg_selected_range.is_null() {
None
} else {
Some(WrapParamRef::<Range, _>::from(arg_selected_range))
};
let arg_selected_range = arg_selected_range.as_ref().map(|arg| arg.as_ref());
ImplRenderHandler::on_text_selection_changed(
&arg_self_.interface,
arg_browser,
arg_selected_text,
arg_selected_range,
)
}
extern "C" fn on_virtual_keyboard_requested<I: ImplRenderHandler, R: Rc>(
self_: *mut _cef_render_handler_t,
browser: *mut _cef_browser_t,
input_mode: cef_text_input_mode_t,
) {
let (arg_self_, arg_browser, arg_input_mode) = (self_, browser, input_mode);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_input_mode = arg_input_mode.into_raw();
ImplRenderHandler::on_virtual_keyboard_requested(
&arg_self_.interface,
arg_browser,
arg_input_mode,
)
}
}
impl ImplRenderHandler for RenderHandler {
fn accessibility_handler(&self) -> Option<AccessibilityHandler> {
unsafe {
self.0
.get_accessibility_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn root_screen_rect(
&self,
browser: Option<&mut Browser>,
rect: Option<&mut Rect>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_root_screen_rect
.map(|f| {
let (arg_browser, arg_rect) = (browser, rect);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_rect = arg_rect.cloned().map(|arg| arg.into());
let arg_rect = arg_rect
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_rect);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn view_rect(&self, browser: Option<&mut Browser>, rect: Option<&mut Rect>) {
unsafe {
if let Some(f) = self.0.get_view_rect {
let (arg_browser, arg_rect) = (browser, rect);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_rect = arg_rect.cloned().map(|arg| arg.into());
let arg_rect = arg_rect
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_rect);
}
}
}
fn screen_point(
&self,
browser: Option<&mut Browser>,
view_x: ::std::os::raw::c_int,
view_y: ::std::os::raw::c_int,
screen_x: Option<&mut ::std::os::raw::c_int>,
screen_y: Option<&mut ::std::os::raw::c_int>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_screen_point
.map(|f| {
let (arg_browser, arg_view_x, arg_view_y, arg_screen_x, arg_screen_y) =
(browser, view_x, view_y, screen_x, screen_y);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_screen_x = arg_screen_x
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_screen_y = arg_screen_y
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_view_x,
arg_view_y,
arg_screen_x,
arg_screen_y,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn screen_info(
&self,
browser: Option<&mut Browser>,
screen_info: Option<&mut ScreenInfo>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_screen_info
.map(|f| {
let (arg_browser, arg_screen_info) = (browser, screen_info);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_screen_info = arg_screen_info.cloned().map(|arg| arg.into());
let arg_screen_info = arg_screen_info
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_screen_info);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_popup_show(&self, browser: Option<&mut Browser>, show: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.on_popup_show {
let (arg_browser, arg_show) = (browser, show);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_show);
}
}
}
fn on_popup_size(&self, browser: Option<&mut Browser>, rect: Option<&Rect>) {
unsafe {
if let Some(f) = self.0.on_popup_size {
let (arg_browser, arg_rect) = (browser, rect);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_rect = arg_rect.cloned().map(|arg| arg.into());
let arg_rect = arg_rect
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_browser, arg_rect);
}
}
}
fn on_paint(
&self,
browser: Option<&mut Browser>,
type_: PaintElementType,
dirty_rects: Option<&[Rect]>,
buffer: *const u8,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_paint {
let (arg_browser, arg_type_, arg_dirty_rects, arg_buffer, arg_width, arg_height) =
(browser, type_, dirty_rects, buffer, width, height);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_type_ = arg_type_.into_raw();
let arg_dirty_rects_count = arg_dirty_rects
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_dirty_rects = arg_dirty_rects
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_dirty_rects = if vec_dirty_rects.is_empty() {
std::ptr::null()
} else {
vec_dirty_rects.as_ptr()
};
let arg_buffer = arg_buffer.cast();
f(
arg_self_,
arg_browser,
arg_type_,
arg_dirty_rects_count,
arg_dirty_rects,
arg_buffer,
arg_width,
arg_height,
);
}
}
}
fn on_accelerated_paint(
&self,
browser: Option<&mut Browser>,
type_: PaintElementType,
dirty_rects: Option<&[Rect]>,
info: Option<&AcceleratedPaintInfo>,
) {
unsafe {
if let Some(f) = self.0.on_accelerated_paint {
let (arg_browser, arg_type_, arg_dirty_rects, arg_info) =
(browser, type_, dirty_rects, info);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_type_ = arg_type_.into_raw();
let arg_dirty_rects_count = arg_dirty_rects
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_dirty_rects = arg_dirty_rects
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_dirty_rects = if vec_dirty_rects.is_empty() {
std::ptr::null()
} else {
vec_dirty_rects.as_ptr()
};
let arg_info = arg_info.cloned().map(|arg| arg.into());
let arg_info = arg_info
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_browser,
arg_type_,
arg_dirty_rects_count,
arg_dirty_rects,
arg_info,
);
}
}
}
fn touch_handle_size(
&self,
browser: Option<&mut Browser>,
orientation: HorizontalAlignment,
size: Option<&mut Size>,
) {
unsafe {
if let Some(f) = self.0.get_touch_handle_size {
let (arg_browser, arg_orientation, arg_size) = (browser, orientation, size);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_orientation = arg_orientation.into_raw();
let mut arg_size = arg_size.cloned().map(|arg| arg.into());
let arg_size = arg_size
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_orientation, arg_size);
}
}
}
fn on_touch_handle_state_changed(
&self,
browser: Option<&mut Browser>,
state: Option<&TouchHandleState>,
) {
unsafe {
if let Some(f) = self.0.on_touch_handle_state_changed {
let (arg_browser, arg_state) = (browser, state);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_state = arg_state.cloned().map(|arg| arg.into());
let arg_state = arg_state
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_browser, arg_state);
}
}
}
fn start_dragging(
&self,
browser: Option<&mut Browser>,
drag_data: Option<&mut DragData>,
allowed_ops: DragOperationsMask,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.start_dragging
.map(|f| {
let (arg_browser, arg_drag_data, arg_allowed_ops, arg_x, arg_y) =
(browser, drag_data, allowed_ops, x, y);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_drag_data = arg_drag_data
.map(|arg| {
arg.add_ref();
ImplDragData::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_allowed_ops = arg_allowed_ops.into_raw();
let result = f(
arg_self_,
arg_browser,
arg_drag_data,
arg_allowed_ops,
arg_x,
arg_y,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn update_drag_cursor(&self, browser: Option<&mut Browser>, operation: DragOperationsMask) {
unsafe {
if let Some(f) = self.0.update_drag_cursor {
let (arg_browser, arg_operation) = (browser, operation);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_operation = arg_operation.into_raw();
f(arg_self_, arg_browser, arg_operation);
}
}
}
fn on_scroll_offset_changed(&self, browser: Option<&mut Browser>, x: f64, y: f64) {
unsafe {
if let Some(f) = self.0.on_scroll_offset_changed {
let (arg_browser, arg_x, arg_y) = (browser, x, y);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_x, arg_y);
}
}
}
fn on_ime_composition_range_changed(
&self,
browser: Option<&mut Browser>,
selected_range: Option<&Range>,
character_bounds: Option<&[Rect]>,
) {
unsafe {
if let Some(f) = self.0.on_ime_composition_range_changed {
let (arg_browser, arg_selected_range, arg_character_bounds) =
(browser, selected_range, character_bounds);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_selected_range = arg_selected_range.cloned().map(|arg| arg.into());
let arg_selected_range = arg_selected_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_character_bounds_count = arg_character_bounds
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_character_bounds = arg_character_bounds
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_character_bounds = if vec_character_bounds.is_empty() {
std::ptr::null()
} else {
vec_character_bounds.as_ptr()
};
f(
arg_self_,
arg_browser,
arg_selected_range,
arg_character_bounds_count,
arg_character_bounds,
);
}
}
}
fn on_text_selection_changed(
&self,
browser: Option<&mut Browser>,
selected_text: Option<&CefString>,
selected_range: Option<&Range>,
) {
unsafe {
if let Some(f) = self.0.on_text_selection_changed {
let (arg_browser, arg_selected_text, arg_selected_range) =
(browser, selected_text, selected_range);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_selected_text = arg_selected_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_selected_range = arg_selected_range.cloned().map(|arg| arg.into());
let arg_selected_range = arg_selected_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_browser,
arg_selected_text,
arg_selected_range,
);
}
}
}
fn on_virtual_keyboard_requested(
&self,
browser: Option<&mut Browser>,
input_mode: TextInputMode,
) {
unsafe {
if let Some(f) = self.0.on_virtual_keyboard_requested {
let (arg_browser, arg_input_mode) = (browser, input_mode);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_input_mode = arg_input_mode.into_raw();
f(arg_self_, arg_browser, arg_input_mode);
}
}
}
fn get_raw(&self) -> *mut _cef_render_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_render_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RenderHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_render_handler_t> for &RenderHandler {
fn into_raw(self) -> *mut _cef_render_handler_t {
ImplRenderHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_render_handler_t> for &mut RenderHandler {
fn into_raw(self) -> *mut _cef_render_handler_t {
ImplRenderHandler::get_raw(self)
}
}
impl ConvertReturnValue<RenderHandler> for *mut _cef_render_handler_t {
fn wrap_result(self) -> RenderHandler {
RenderHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RenderHandler> for *mut _cef_render_handler_t {
fn from(value: RenderHandler) -> Self {
let object = ImplRenderHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_auth_callback_t`] for more documentation.
#[derive(Clone)]
pub struct AuthCallback(RefGuard<_cef_auth_callback_t>);
pub trait ImplAuthCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_auth_callback_t::cont`] for more documentation."]
fn cont(&self, username: Option<&CefString>, password: Option<&CefString>);
#[doc = "See [`_cef_auth_callback_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_auth_callback_t;
}
impl ImplAuthCallback for AuthCallback {
fn cont(&self, username: Option<&CefString>, password: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.cont {
let (arg_username, arg_password) = (username, password);
let arg_self_ = self.into_raw();
let arg_username = arg_username
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_password = arg_password
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_username, arg_password);
}
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_auth_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_auth_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for AuthCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_auth_callback_t> for &AuthCallback {
fn into_raw(self) -> *mut _cef_auth_callback_t {
ImplAuthCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_auth_callback_t> for &mut AuthCallback {
fn into_raw(self) -> *mut _cef_auth_callback_t {
ImplAuthCallback::get_raw(self)
}
}
impl ConvertReturnValue<AuthCallback> for *mut _cef_auth_callback_t {
fn wrap_result(self) -> AuthCallback {
AuthCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<AuthCallback> for *mut _cef_auth_callback_t {
fn from(value: AuthCallback) -> Self {
let object = ImplAuthCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_response_t`] for more documentation.
#[derive(Clone)]
pub struct Response(RefGuard<_cef_response_t>);
pub trait ImplResponse: Clone + Sized + Rc {
#[doc = "See [`_cef_response_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_response_t::get_error`] for more documentation."]
fn error(&self) -> Errorcode;
#[doc = "See [`_cef_response_t::set_error`] for more documentation."]
fn set_error(&self, error: Errorcode);
#[doc = "See [`_cef_response_t::get_status`] for more documentation."]
fn status(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_response_t::set_status`] for more documentation."]
fn set_status(&self, status: ::std::os::raw::c_int);
#[doc = "See [`_cef_response_t::get_status_text`] for more documentation."]
fn status_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_response_t::set_status_text`] for more documentation."]
fn set_status_text(&self, status_text: Option<&CefString>);
#[doc = "See [`_cef_response_t::get_mime_type`] for more documentation."]
fn mime_type(&self) -> CefStringUserfree;
#[doc = "See [`_cef_response_t::set_mime_type`] for more documentation."]
fn set_mime_type(&self, mime_type: Option<&CefString>);
#[doc = "See [`_cef_response_t::get_charset`] for more documentation."]
fn charset(&self) -> CefStringUserfree;
#[doc = "See [`_cef_response_t::set_charset`] for more documentation."]
fn set_charset(&self, charset: Option<&CefString>);
#[doc = "See [`_cef_response_t::get_header_by_name`] for more documentation."]
fn header_by_name(&self, name: Option<&CefString>) -> CefStringUserfree;
#[doc = "See [`_cef_response_t::set_header_by_name`] for more documentation."]
fn set_header_by_name(
&self,
name: Option<&CefString>,
value: Option<&CefString>,
overwrite: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_response_t::get_header_map`] for more documentation."]
fn header_map(&self, header_map: Option<&mut CefStringMultimap>);
#[doc = "See [`_cef_response_t::set_header_map`] for more documentation."]
fn set_header_map(&self, header_map: Option<&mut CefStringMultimap>);
#[doc = "See [`_cef_response_t::get_url`] for more documentation."]
fn url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_response_t::set_url`] for more documentation."]
fn set_url(&self, url: Option<&CefString>);
fn get_raw(&self) -> *mut _cef_response_t;
}
impl ImplResponse for Response {
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn error(&self) -> Errorcode {
unsafe {
self.0
.get_error
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_error(&self, error: Errorcode) {
unsafe {
if let Some(f) = self.0.set_error {
let arg_error = error;
let arg_self_ = self.into_raw();
let arg_error = arg_error.into_raw();
f(arg_self_, arg_error);
}
}
}
fn status(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_status
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_status(&self, status: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_status {
let arg_status = status;
let arg_self_ = self.into_raw();
f(arg_self_, arg_status);
}
}
}
fn status_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_status_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_status_text(&self, status_text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_status_text {
let arg_status_text = status_text;
let arg_self_ = self.into_raw();
let arg_status_text = arg_status_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_status_text);
}
}
}
fn mime_type(&self) -> CefStringUserfree {
unsafe {
self.0
.get_mime_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_mime_type(&self, mime_type: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_mime_type {
let arg_mime_type = mime_type;
let arg_self_ = self.into_raw();
let arg_mime_type = arg_mime_type
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_mime_type);
}
}
}
fn charset(&self) -> CefStringUserfree {
unsafe {
self.0
.get_charset
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_charset(&self, charset: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_charset {
let arg_charset = charset;
let arg_self_ = self.into_raw();
let arg_charset = arg_charset
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_charset);
}
}
}
fn header_by_name(&self, name: Option<&CefString>) -> CefStringUserfree {
unsafe {
self.0
.get_header_by_name
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_header_by_name(
&self,
name: Option<&CefString>,
value: Option<&CefString>,
overwrite: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.set_header_by_name {
let (arg_name, arg_value, arg_overwrite) = (name, value, overwrite);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name, arg_value, arg_overwrite);
}
}
}
fn header_map(&self, header_map: Option<&mut CefStringMultimap>) {
unsafe {
if let Some(f) = self.0.get_header_map {
let arg_header_map = header_map;
let arg_self_ = self.into_raw();
let arg_header_map = arg_header_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_header_map);
}
}
}
fn set_header_map(&self, header_map: Option<&mut CefStringMultimap>) {
unsafe {
if let Some(f) = self.0.set_header_map {
let arg_header_map = header_map;
let arg_self_ = self.into_raw();
let arg_header_map = arg_header_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_header_map);
}
}
}
fn url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_url(&self, url: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_url {
let arg_url = url;
let arg_self_ = self.into_raw();
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_url);
}
}
}
fn get_raw(&self) -> *mut _cef_response_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_response_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Response {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_response_t> for &Response {
fn into_raw(self) -> *mut _cef_response_t {
ImplResponse::get_raw(self)
}
}
impl ConvertParam<*mut _cef_response_t> for &mut Response {
fn into_raw(self) -> *mut _cef_response_t {
ImplResponse::get_raw(self)
}
}
impl ConvertReturnValue<Response> for *mut _cef_response_t {
fn wrap_result(self) -> Response {
Response(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Response> for *mut _cef_response_t {
fn from(value: Response) -> Self {
let object = ImplResponse::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_resource_skip_callback_t`] for more documentation.
#[derive(Clone)]
pub struct ResourceSkipCallback(RefGuard<_cef_resource_skip_callback_t>);
pub trait ImplResourceSkipCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_resource_skip_callback_t::cont`] for more documentation."]
fn cont(&self, bytes_skipped: i64);
fn get_raw(&self) -> *mut _cef_resource_skip_callback_t;
}
impl ImplResourceSkipCallback for ResourceSkipCallback {
fn cont(&self, bytes_skipped: i64) {
unsafe {
if let Some(f) = self.0.cont {
let arg_bytes_skipped = bytes_skipped;
let arg_self_ = self.into_raw();
f(arg_self_, arg_bytes_skipped);
}
}
}
fn get_raw(&self) -> *mut _cef_resource_skip_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_resource_skip_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResourceSkipCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_resource_skip_callback_t> for &ResourceSkipCallback {
fn into_raw(self) -> *mut _cef_resource_skip_callback_t {
ImplResourceSkipCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_resource_skip_callback_t> for &mut ResourceSkipCallback {
fn into_raw(self) -> *mut _cef_resource_skip_callback_t {
ImplResourceSkipCallback::get_raw(self)
}
}
impl ConvertReturnValue<ResourceSkipCallback> for *mut _cef_resource_skip_callback_t {
fn wrap_result(self) -> ResourceSkipCallback {
ResourceSkipCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResourceSkipCallback> for *mut _cef_resource_skip_callback_t {
fn from(value: ResourceSkipCallback) -> Self {
let object = ImplResourceSkipCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_resource_read_callback_t`] for more documentation.
#[derive(Clone)]
pub struct ResourceReadCallback(RefGuard<_cef_resource_read_callback_t>);
pub trait ImplResourceReadCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_resource_read_callback_t::cont`] for more documentation."]
fn cont(&self, bytes_read: ::std::os::raw::c_int);
fn get_raw(&self) -> *mut _cef_resource_read_callback_t;
}
impl ImplResourceReadCallback for ResourceReadCallback {
fn cont(&self, bytes_read: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.cont {
let arg_bytes_read = bytes_read;
let arg_self_ = self.into_raw();
f(arg_self_, arg_bytes_read);
}
}
}
fn get_raw(&self) -> *mut _cef_resource_read_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_resource_read_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResourceReadCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_resource_read_callback_t> for &ResourceReadCallback {
fn into_raw(self) -> *mut _cef_resource_read_callback_t {
ImplResourceReadCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_resource_read_callback_t> for &mut ResourceReadCallback {
fn into_raw(self) -> *mut _cef_resource_read_callback_t {
ImplResourceReadCallback::get_raw(self)
}
}
impl ConvertReturnValue<ResourceReadCallback> for *mut _cef_resource_read_callback_t {
fn wrap_result(self) -> ResourceReadCallback {
ResourceReadCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResourceReadCallback> for *mut _cef_resource_read_callback_t {
fn from(value: ResourceReadCallback) -> Self {
let object = ImplResourceReadCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_resource_handler_t`] for more documentation.
#[derive(Clone)]
pub struct ResourceHandler(RefGuard<_cef_resource_handler_t>);
impl ResourceHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapResourceHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplResourceHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapResourceHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_resource_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapResourceHandler: ImplResourceHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_resource_handler_t, Self>);
}
pub trait ImplResourceHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_resource_handler_t::open`] for more documentation."]
fn open(
&self,
request: Option<&mut Request>,
handle_request: Option<&mut ::std::os::raw::c_int>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_handler_t::process_request`] for more documentation."]
fn process_request(
&self,
request: Option<&mut Request>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_handler_t::get_response_headers`] for more documentation."]
fn response_headers(
&self,
response: Option<&mut Response>,
response_length: Option<&mut i64>,
redirect_url: Option<&mut CefString>,
) {
}
#[doc = "See [`_cef_resource_handler_t::skip`] for more documentation."]
fn skip(
&self,
bytes_to_skip: i64,
bytes_skipped: Option<&mut i64>,
callback: Option<&mut ResourceSkipCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_handler_t::read`] for more documentation."]
fn read(
&self,
data_out: *mut u8,
bytes_to_read: ::std::os::raw::c_int,
bytes_read: Option<&mut ::std::os::raw::c_int>,
callback: Option<&mut ResourceReadCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_handler_t::read_response`] for more documentation."]
fn read_response(
&self,
data_out: *mut u8,
bytes_to_read: ::std::os::raw::c_int,
bytes_read: Option<&mut ::std::os::raw::c_int>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_handler_t::cancel`] for more documentation."]
fn cancel(&self) {}
fn init_methods(object: &mut _cef_resource_handler_t) {
impl_cef_resource_handler_t::init_methods::<Self, _cef_resource_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_resource_handler_t;
}
#[doc = "Implement the [`WrapResourceHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ResourceHandler` block you can override default\nmethods implemented by the [`ImplResourceHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_resource_handler! {\n struct MyResourceHandler {\n payload: String,\n }\n\n impl ResourceHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> ResourceHandler {\n MyResourceHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_resource_handler { ($ vis : vis struct $ name : ident ; impl ResourceHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_resource_handler ! { $ vis struct $ name { } impl ResourceHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ResourceHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resource_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ResourceHandler { ResourceHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapResourceHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resource_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplResourceHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_resource_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_resource_handler_t {
use super::*;
pub fn init_methods<I: ImplResourceHandler, R: Rc>(object: &mut _cef_resource_handler_t) {
object.open = Some(open::<I, R>);
object.process_request = Some(process_request::<I, R>);
object.get_response_headers = Some(get_response_headers::<I, R>);
object.skip = Some(skip::<I, R>);
object.read = Some(read::<I, R>);
object.read_response = Some(read_response::<I, R>);
object.cancel = Some(cancel::<I, R>);
}
extern "C" fn open<I: ImplResourceHandler, R: Rc>(
self_: *mut _cef_resource_handler_t,
request: *mut _cef_request_t,
handle_request: *mut ::std::os::raw::c_int,
callback: *mut _cef_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_request, arg_handle_request, arg_callback) =
(self_, request, handle_request, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_handle_request = if arg_handle_request.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_handle_request,
))
};
let arg_handle_request = arg_handle_request.as_mut().map(|arg| arg.as_mut());
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| Callback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplResourceHandler::open(
&arg_self_.interface,
arg_request,
arg_handle_request,
arg_callback,
)
}
extern "C" fn process_request<I: ImplResourceHandler, R: Rc>(
self_: *mut _cef_resource_handler_t,
request: *mut _cef_request_t,
callback: *mut _cef_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_request, arg_callback) = (self_, request, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| Callback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplResourceHandler::process_request(&arg_self_.interface, arg_request, arg_callback)
}
extern "C" fn get_response_headers<I: ImplResourceHandler, R: Rc>(
self_: *mut _cef_resource_handler_t,
response: *mut _cef_response_t,
response_length: *mut i64,
redirect_url: *mut cef_string_t,
) {
let (arg_self_, arg_response, arg_response_length, arg_redirect_url) =
(self_, response, response_length, redirect_url);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_response = unsafe { arg_response.as_mut() }
.map(|arg| Response(unsafe { RefGuard::from_raw(arg) }));
let arg_response = arg_response.as_mut();
let mut arg_response_length = if arg_response_length.is_null() {
None
} else {
Some(WrapParamRef::<i64, _>::from(arg_response_length))
};
let arg_response_length = arg_response_length.as_mut().map(|arg| arg.as_mut());
let mut arg_redirect_url = if arg_redirect_url.is_null() {
None
} else {
Some(arg_redirect_url.into())
};
let arg_redirect_url = arg_redirect_url.as_mut();
ImplResourceHandler::response_headers(
&arg_self_.interface,
arg_response,
arg_response_length,
arg_redirect_url,
)
}
extern "C" fn skip<I: ImplResourceHandler, R: Rc>(
self_: *mut _cef_resource_handler_t,
bytes_to_skip: i64,
bytes_skipped: *mut i64,
callback: *mut _cef_resource_skip_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_bytes_to_skip, arg_bytes_skipped, arg_callback) =
(self_, bytes_to_skip, bytes_skipped, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_bytes_to_skip = arg_bytes_to_skip.into_raw();
let mut arg_bytes_skipped = if arg_bytes_skipped.is_null() {
None
} else {
Some(WrapParamRef::<i64, _>::from(arg_bytes_skipped))
};
let arg_bytes_skipped = arg_bytes_skipped.as_mut().map(|arg| arg.as_mut());
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| ResourceSkipCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplResourceHandler::skip(
&arg_self_.interface,
arg_bytes_to_skip,
arg_bytes_skipped,
arg_callback,
)
}
extern "C" fn read<I: ImplResourceHandler, R: Rc>(
self_: *mut _cef_resource_handler_t,
data_out: *mut ::std::os::raw::c_void,
bytes_to_read: ::std::os::raw::c_int,
bytes_read: *mut ::std::os::raw::c_int,
callback: *mut _cef_resource_read_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_data_out, arg_bytes_to_read, arg_bytes_read, arg_callback) =
(self_, data_out, bytes_to_read, bytes_read, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_data_out = arg_data_out.cast();
let arg_bytes_to_read = arg_bytes_to_read.into_raw();
let mut arg_bytes_read = if arg_bytes_read.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_bytes_read,
))
};
let arg_bytes_read = arg_bytes_read.as_mut().map(|arg| arg.as_mut());
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| ResourceReadCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplResourceHandler::read(
&arg_self_.interface,
arg_data_out,
arg_bytes_to_read,
arg_bytes_read,
arg_callback,
)
}
extern "C" fn read_response<I: ImplResourceHandler, R: Rc>(
self_: *mut _cef_resource_handler_t,
data_out: *mut ::std::os::raw::c_void,
bytes_to_read: ::std::os::raw::c_int,
bytes_read: *mut ::std::os::raw::c_int,
callback: *mut _cef_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_data_out, arg_bytes_to_read, arg_bytes_read, arg_callback) =
(self_, data_out, bytes_to_read, bytes_read, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_data_out = arg_data_out.cast();
let arg_bytes_to_read = arg_bytes_to_read.into_raw();
let mut arg_bytes_read = if arg_bytes_read.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_bytes_read,
))
};
let arg_bytes_read = arg_bytes_read.as_mut().map(|arg| arg.as_mut());
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| Callback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplResourceHandler::read_response(
&arg_self_.interface,
arg_data_out,
arg_bytes_to_read,
arg_bytes_read,
arg_callback,
)
}
extern "C" fn cancel<I: ImplResourceHandler, R: Rc>(self_: *mut _cef_resource_handler_t) {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplResourceHandler::cancel(&arg_self_.interface)
}
}
impl ImplResourceHandler for ResourceHandler {
fn open(
&self,
request: Option<&mut Request>,
handle_request: Option<&mut ::std::os::raw::c_int>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.open
.map(|f| {
let (arg_request, arg_handle_request, arg_callback) =
(request, handle_request, callback);
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_handle_request = arg_handle_request
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_request, arg_handle_request, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn process_request(
&self,
request: Option<&mut Request>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.process_request
.map(|f| {
let (arg_request, arg_callback) = (request, callback);
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_request, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn response_headers(
&self,
response: Option<&mut Response>,
response_length: Option<&mut i64>,
redirect_url: Option<&mut CefString>,
) {
unsafe {
if let Some(f) = self.0.get_response_headers {
let (arg_response, arg_response_length, arg_redirect_url) =
(response, response_length, redirect_url);
let arg_self_ = self.into_raw();
let arg_response = arg_response
.map(|arg| {
arg.add_ref();
ImplResponse::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_response_length = arg_response_length
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_redirect_url = arg_redirect_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_response,
arg_response_length,
arg_redirect_url,
);
}
}
}
fn skip(
&self,
bytes_to_skip: i64,
bytes_skipped: Option<&mut i64>,
callback: Option<&mut ResourceSkipCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.skip
.map(|f| {
let (arg_bytes_to_skip, arg_bytes_skipped, arg_callback) =
(bytes_to_skip, bytes_skipped, callback);
let arg_self_ = self.into_raw();
let arg_bytes_skipped = arg_bytes_skipped
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplResourceSkipCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_bytes_to_skip,
arg_bytes_skipped,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn read(
&self,
data_out: *mut u8,
bytes_to_read: ::std::os::raw::c_int,
bytes_read: Option<&mut ::std::os::raw::c_int>,
callback: Option<&mut ResourceReadCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.read
.map(|f| {
let (arg_data_out, arg_bytes_to_read, arg_bytes_read, arg_callback) =
(data_out, bytes_to_read, bytes_read, callback);
let arg_self_ = self.into_raw();
let arg_data_out = arg_data_out.cast();
let arg_bytes_read = arg_bytes_read
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplResourceReadCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_data_out,
arg_bytes_to_read,
arg_bytes_read,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn read_response(
&self,
data_out: *mut u8,
bytes_to_read: ::std::os::raw::c_int,
bytes_read: Option<&mut ::std::os::raw::c_int>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.read_response
.map(|f| {
let (arg_data_out, arg_bytes_to_read, arg_bytes_read, arg_callback) =
(data_out, bytes_to_read, bytes_read, callback);
let arg_self_ = self.into_raw();
let arg_data_out = arg_data_out.cast();
let arg_bytes_read = arg_bytes_read
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_data_out,
arg_bytes_to_read,
arg_bytes_read,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_resource_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_resource_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResourceHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_resource_handler_t> for &ResourceHandler {
fn into_raw(self) -> *mut _cef_resource_handler_t {
ImplResourceHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_resource_handler_t> for &mut ResourceHandler {
fn into_raw(self) -> *mut _cef_resource_handler_t {
ImplResourceHandler::get_raw(self)
}
}
impl ConvertReturnValue<ResourceHandler> for *mut _cef_resource_handler_t {
fn wrap_result(self) -> ResourceHandler {
ResourceHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResourceHandler> for *mut _cef_resource_handler_t {
fn from(value: ResourceHandler) -> Self {
let object = ImplResourceHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_response_filter_t`] for more documentation.
#[derive(Clone)]
pub struct ResponseFilter(RefGuard<_cef_response_filter_t>);
impl ResponseFilter {
pub fn new<T>(interface: T) -> Self
where
T: WrapResponseFilter,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplResponseFilter>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapResponseFilter>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_response_filter_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapResponseFilter: ImplResponseFilter {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_response_filter_t, Self>);
}
pub trait ImplResponseFilter: Clone + Sized + Rc {
#[doc = "See [`_cef_response_filter_t::init_filter`] for more documentation."]
fn init_filter(&self) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_response_filter_t::filter`] for more documentation."]
fn filter(
&self,
data_in: Option<&mut Vec<u8>>,
data_in_read: Option<&mut usize>,
data_out: Option<&mut Vec<u8>>,
data_out_written: Option<&mut usize>,
) -> ResponseFilterStatus {
Default::default()
}
fn init_methods(object: &mut _cef_response_filter_t) {
impl_cef_response_filter_t::init_methods::<Self, _cef_response_filter_t>(object);
}
fn get_raw(&self) -> *mut _cef_response_filter_t;
}
#[doc = "Implement the [`WrapResponseFilter`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ResponseFilter` block you can override default\nmethods implemented by the [`ImplResponseFilter`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_response_filter! {\n struct MyResponseFilter {\n payload: String,\n }\n\n impl ResponseFilter {\n // ...\n }\n}\n\nfn make_my_struct() -> ResponseFilter {\n MyResponseFilter::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_response_filter { ($ vis : vis struct $ name : ident ; impl ResponseFilter { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_response_filter ! { $ vis struct $ name { } impl ResponseFilter { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ResponseFilter { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_response_filter_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ResponseFilter { ResponseFilter :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapResponseFilter for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_response_filter_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplResponseFilter for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_response_filter_t { self . cef_object . cast () } } } ; }
mod impl_cef_response_filter_t {
use super::*;
pub fn init_methods<I: ImplResponseFilter, R: Rc>(object: &mut _cef_response_filter_t) {
object.init_filter = Some(init_filter::<I, R>);
object.filter = Some(filter::<I, R>);
}
extern "C" fn init_filter<I: ImplResponseFilter, R: Rc>(
self_: *mut _cef_response_filter_t,
) -> ::std::os::raw::c_int {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplResponseFilter::init_filter(&arg_self_.interface)
}
extern "C" fn filter<I: ImplResponseFilter, R: Rc>(
self_: *mut _cef_response_filter_t,
data_in: *mut ::std::os::raw::c_void,
data_in_size: usize,
data_in_read: *mut usize,
data_out: *mut ::std::os::raw::c_void,
data_out_size: usize,
data_out_written: *mut usize,
) -> cef_response_filter_status_t {
let (
arg_self_,
arg_data_in,
arg_data_in_size,
arg_data_in_read,
arg_data_out,
arg_data_out_size,
arg_data_out_written,
) = (
self_,
data_in,
data_in_size,
data_in_read,
data_out,
data_out_size,
data_out_written,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let out_data_in = (!arg_data_in.is_null() && arg_data_in_size > 0).then(|| unsafe {
std::slice::from_raw_parts_mut(arg_data_in.cast(), arg_data_in_size)
});
let mut vec_data_in = out_data_in.as_ref().map(|arg| arg.to_vec());
let arg_data_in = vec_data_in.as_mut();
let mut arg_data_in_read = if arg_data_in_read.is_null() {
None
} else {
Some(WrapParamRef::<usize, _>::from(arg_data_in_read))
};
let arg_data_in_read = arg_data_in_read.as_mut().map(|arg| arg.as_mut());
let out_data_out = (!arg_data_out.is_null() && arg_data_out_size > 0).then(|| unsafe {
std::slice::from_raw_parts_mut(arg_data_out.cast(), arg_data_out_size)
});
let mut vec_data_out = out_data_out.as_ref().map(|arg| arg.to_vec());
let arg_data_out = vec_data_out.as_mut();
let mut arg_data_out_written = if arg_data_out_written.is_null() {
None
} else {
Some(WrapParamRef::<usize, _>::from(arg_data_out_written))
};
let arg_data_out_written = arg_data_out_written.as_mut().map(|arg| arg.as_mut());
let result = ImplResponseFilter::filter(
&arg_self_.interface,
arg_data_in,
arg_data_in_read,
arg_data_out,
arg_data_out_written,
);
if let (Some(out_data_in), Some(vec_data_in)) = (out_data_in, vec_data_in.as_mut()) {
let size = vec_data_in.len().min(out_data_in.len());
out_data_in[..size].copy_from_slice(&vec_data_in[..size]);
}
if let (Some(out_data_out), Some(vec_data_out)) = (out_data_out, vec_data_out.as_mut()) {
let size = vec_data_out.len().min(out_data_out.len());
out_data_out[..size].copy_from_slice(&vec_data_out[..size]);
}
result.into()
}
}
impl ImplResponseFilter for ResponseFilter {
fn init_filter(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.init_filter
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn filter(
&self,
data_in: Option<&mut Vec<u8>>,
data_in_read: Option<&mut usize>,
data_out: Option<&mut Vec<u8>>,
data_out_written: Option<&mut usize>,
) -> ResponseFilterStatus {
unsafe {
self.0
.filter
.map(|f| {
let (arg_data_in, arg_data_in_read, arg_data_out, arg_data_out_written) =
(data_in, data_in_read, data_out, data_out_written);
let arg_self_ = self.into_raw();
let arg_data_in_size = arg_data_in
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let mut out_data_in = arg_data_in;
let arg_data_in = out_data_in
.as_mut()
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_mut_ptr().cast())
}
})
.unwrap_or(std::ptr::null_mut());
let arg_data_in_read = arg_data_in_read
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_data_out_size = arg_data_out
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let mut out_data_out = arg_data_out;
let arg_data_out = out_data_out
.as_mut()
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_mut_ptr().cast())
}
})
.unwrap_or(std::ptr::null_mut());
let arg_data_out_written = arg_data_out_written
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_data_in,
arg_data_in_size,
arg_data_in_read,
arg_data_out,
arg_data_out_size,
arg_data_out_written,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_response_filter_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_response_filter_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResponseFilter {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_response_filter_t> for &ResponseFilter {
fn into_raw(self) -> *mut _cef_response_filter_t {
ImplResponseFilter::get_raw(self)
}
}
impl ConvertParam<*mut _cef_response_filter_t> for &mut ResponseFilter {
fn into_raw(self) -> *mut _cef_response_filter_t {
ImplResponseFilter::get_raw(self)
}
}
impl ConvertReturnValue<ResponseFilter> for *mut _cef_response_filter_t {
fn wrap_result(self) -> ResponseFilter {
ResponseFilter(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResponseFilter> for *mut _cef_response_filter_t {
fn from(value: ResponseFilter) -> Self {
let object = ImplResponseFilter::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_resource_request_handler_t`] for more documentation.
#[derive(Clone)]
pub struct ResourceRequestHandler(RefGuard<_cef_resource_request_handler_t>);
impl ResourceRequestHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapResourceRequestHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplResourceRequestHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapResourceRequestHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_resource_request_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapResourceRequestHandler: ImplResourceRequestHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_resource_request_handler_t, Self>);
}
pub trait ImplResourceRequestHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_resource_request_handler_t::get_cookie_access_filter`] for more documentation."]
fn cookie_access_filter(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
) -> Option<CookieAccessFilter> {
Default::default()
}
#[doc = "See [`_cef_resource_request_handler_t::on_before_resource_load`] for more documentation."]
fn on_before_resource_load(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
callback: Option<&mut Callback>,
) -> ReturnValue {
Default::default()
}
#[doc = "See [`_cef_resource_request_handler_t::get_resource_handler`] for more documentation."]
fn resource_handler(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
) -> Option<ResourceHandler> {
Default::default()
}
#[doc = "See [`_cef_resource_request_handler_t::on_resource_redirect`] for more documentation."]
fn on_resource_redirect(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
new_url: Option<&mut CefString>,
) {
}
#[doc = "See [`_cef_resource_request_handler_t::on_resource_response`] for more documentation."]
fn on_resource_response(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_request_handler_t::get_resource_response_filter`] for more documentation."]
fn resource_response_filter(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
) -> Option<ResponseFilter> {
Default::default()
}
#[doc = "See [`_cef_resource_request_handler_t::on_resource_load_complete`] for more documentation."]
fn on_resource_load_complete(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
status: UrlrequestStatus,
received_content_length: i64,
) {
}
#[doc = "See [`_cef_resource_request_handler_t::on_protocol_execution`] for more documentation."]
fn on_protocol_execution(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
allow_os_execution: Option<&mut ::std::os::raw::c_int>,
) {
}
fn init_methods(object: &mut _cef_resource_request_handler_t) {
impl_cef_resource_request_handler_t::init_methods::<Self, _cef_resource_request_handler_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_resource_request_handler_t;
}
#[doc = "Implement the [`WrapResourceRequestHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ResourceRequestHandler` block you can override default\nmethods implemented by the [`ImplResourceRequestHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_resource_request_handler! {\n struct MyResourceRequestHandler {\n payload: String,\n }\n\n impl ResourceRequestHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> ResourceRequestHandler {\n MyResourceRequestHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_resource_request_handler { ($ vis : vis struct $ name : ident ; impl ResourceRequestHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_resource_request_handler ! { $ vis struct $ name { } impl ResourceRequestHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ResourceRequestHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resource_request_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ResourceRequestHandler { ResourceRequestHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapResourceRequestHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resource_request_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplResourceRequestHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_resource_request_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_resource_request_handler_t {
use super::*;
pub fn init_methods<I: ImplResourceRequestHandler, R: Rc>(
object: &mut _cef_resource_request_handler_t,
) {
object.get_cookie_access_filter = Some(get_cookie_access_filter::<I, R>);
object.on_before_resource_load = Some(on_before_resource_load::<I, R>);
object.get_resource_handler = Some(get_resource_handler::<I, R>);
object.on_resource_redirect = Some(on_resource_redirect::<I, R>);
object.on_resource_response = Some(on_resource_response::<I, R>);
object.get_resource_response_filter = Some(get_resource_response_filter::<I, R>);
object.on_resource_load_complete = Some(on_resource_load_complete::<I, R>);
object.on_protocol_execution = Some(on_protocol_execution::<I, R>);
}
extern "C" fn get_cookie_access_filter<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
) -> *mut _cef_cookie_access_filter_t {
let (arg_self_, arg_browser, arg_frame, arg_request) = (self_, browser, frame, request);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let result = ImplResourceRequestHandler::cookie_access_filter(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn on_before_resource_load<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
callback: *mut _cef_callback_t,
) -> cef_return_value_t {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_callback) =
(self_, browser, frame, request, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| Callback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
let result = ImplResourceRequestHandler::on_before_resource_load(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_callback,
);
result.into()
}
extern "C" fn get_resource_handler<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
) -> *mut _cef_resource_handler_t {
let (arg_self_, arg_browser, arg_frame, arg_request) = (self_, browser, frame, request);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let result = ImplResourceRequestHandler::resource_handler(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn on_resource_redirect<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
response: *mut _cef_response_t,
new_url: *mut cef_string_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_response, arg_new_url) =
(self_, browser, frame, request, response, new_url);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_response = unsafe { arg_response.as_mut() }
.map(|arg| Response(unsafe { RefGuard::from_raw(arg) }));
let arg_response = arg_response.as_mut();
let mut arg_new_url = if arg_new_url.is_null() {
None
} else {
Some(arg_new_url.into())
};
let arg_new_url = arg_new_url.as_mut();
ImplResourceRequestHandler::on_resource_redirect(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_new_url,
)
}
extern "C" fn on_resource_response<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
response: *mut _cef_response_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_response) =
(self_, browser, frame, request, response);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_response = unsafe { arg_response.as_mut() }
.map(|arg| Response(unsafe { RefGuard::from_raw(arg) }));
let arg_response = arg_response.as_mut();
ImplResourceRequestHandler::on_resource_response(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_response,
)
}
extern "C" fn get_resource_response_filter<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
response: *mut _cef_response_t,
) -> *mut _cef_response_filter_t {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_response) =
(self_, browser, frame, request, response);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_response = unsafe { arg_response.as_mut() }
.map(|arg| Response(unsafe { RefGuard::from_raw(arg) }));
let arg_response = arg_response.as_mut();
let result = ImplResourceRequestHandler::resource_response_filter(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_response,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn on_resource_load_complete<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
response: *mut _cef_response_t,
status: cef_urlrequest_status_t,
received_content_length: i64,
) {
let (
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_status,
arg_received_content_length,
) = (
self_,
browser,
frame,
request,
response,
status,
received_content_length,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_response = unsafe { arg_response.as_mut() }
.map(|arg| Response(unsafe { RefGuard::from_raw(arg) }));
let arg_response = arg_response.as_mut();
let arg_status = arg_status.into_raw();
let arg_received_content_length = arg_received_content_length.into_raw();
ImplResourceRequestHandler::on_resource_load_complete(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_status,
arg_received_content_length,
)
}
extern "C" fn on_protocol_execution<I: ImplResourceRequestHandler, R: Rc>(
self_: *mut _cef_resource_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
allow_os_execution: *mut ::std::os::raw::c_int,
) {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_allow_os_execution) =
(self_, browser, frame, request, allow_os_execution);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_allow_os_execution = if arg_allow_os_execution.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_allow_os_execution,
))
};
let arg_allow_os_execution = arg_allow_os_execution.as_mut().map(|arg| arg.as_mut());
ImplResourceRequestHandler::on_protocol_execution(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_allow_os_execution,
)
}
}
impl ImplResourceRequestHandler for ResourceRequestHandler {
fn cookie_access_filter(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
) -> Option<CookieAccessFilter> {
unsafe {
self.0
.get_cookie_access_filter
.map(|f| {
let (arg_browser, arg_frame, arg_request) = (browser, frame, request);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_frame, arg_request);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn on_before_resource_load(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
callback: Option<&mut Callback>,
) -> ReturnValue {
unsafe {
self.0
.on_before_resource_load
.map(|f| {
let (arg_browser, arg_frame, arg_request, arg_callback) =
(browser, frame, request, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_frame, arg_request, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn resource_handler(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
) -> Option<ResourceHandler> {
unsafe {
self.0
.get_resource_handler
.map(|f| {
let (arg_browser, arg_frame, arg_request) = (browser, frame, request);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_frame, arg_request);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn on_resource_redirect(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
new_url: Option<&mut CefString>,
) {
unsafe {
if let Some(f) = self.0.on_resource_redirect {
let (arg_browser, arg_frame, arg_request, arg_response, arg_new_url) =
(browser, frame, request, response, new_url);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_response = arg_response
.map(|arg| {
arg.add_ref();
ImplResponse::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_new_url = arg_new_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_new_url,
);
}
}
}
fn on_resource_response(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_resource_response
.map(|f| {
let (arg_browser, arg_frame, arg_request, arg_response) =
(browser, frame, request, response);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_response = arg_response
.map(|arg| {
arg.add_ref();
ImplResponse::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_frame, arg_request, arg_response);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn resource_response_filter(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
) -> Option<ResponseFilter> {
unsafe {
self.0
.get_resource_response_filter
.map(|f| {
let (arg_browser, arg_frame, arg_request, arg_response) =
(browser, frame, request, response);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_response = arg_response
.map(|arg| {
arg.add_ref();
ImplResponse::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_frame, arg_request, arg_response);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn on_resource_load_complete(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
status: UrlrequestStatus,
received_content_length: i64,
) {
unsafe {
if let Some(f) = self.0.on_resource_load_complete {
let (
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_status,
arg_received_content_length,
) = (
browser,
frame,
request,
response,
status,
received_content_length,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_response = arg_response
.map(|arg| {
arg.add_ref();
ImplResponse::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_status = arg_status.into_raw();
f(
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_status,
arg_received_content_length,
);
}
}
}
fn on_protocol_execution(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
allow_os_execution: Option<&mut ::std::os::raw::c_int>,
) {
unsafe {
if let Some(f) = self.0.on_protocol_execution {
let (arg_browser, arg_frame, arg_request, arg_allow_os_execution) =
(browser, frame, request, allow_os_execution);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_allow_os_execution = arg_allow_os_execution
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_allow_os_execution,
);
}
}
}
fn get_raw(&self) -> *mut _cef_resource_request_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_resource_request_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResourceRequestHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_resource_request_handler_t> for &ResourceRequestHandler {
fn into_raw(self) -> *mut _cef_resource_request_handler_t {
ImplResourceRequestHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_resource_request_handler_t> for &mut ResourceRequestHandler {
fn into_raw(self) -> *mut _cef_resource_request_handler_t {
ImplResourceRequestHandler::get_raw(self)
}
}
impl ConvertReturnValue<ResourceRequestHandler> for *mut _cef_resource_request_handler_t {
fn wrap_result(self) -> ResourceRequestHandler {
ResourceRequestHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResourceRequestHandler> for *mut _cef_resource_request_handler_t {
fn from(value: ResourceRequestHandler) -> Self {
let object = ImplResourceRequestHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_cookie_access_filter_t`] for more documentation.
#[derive(Clone)]
pub struct CookieAccessFilter(RefGuard<_cef_cookie_access_filter_t>);
impl CookieAccessFilter {
pub fn new<T>(interface: T) -> Self
where
T: WrapCookieAccessFilter,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplCookieAccessFilter>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapCookieAccessFilter>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_cookie_access_filter_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapCookieAccessFilter: ImplCookieAccessFilter {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_cookie_access_filter_t, Self>);
}
pub trait ImplCookieAccessFilter: Clone + Sized + Rc {
#[doc = "See [`_cef_cookie_access_filter_t::can_send_cookie`] for more documentation."]
fn can_send_cookie(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
cookie: Option<&Cookie>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_cookie_access_filter_t::can_save_cookie`] for more documentation."]
fn can_save_cookie(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
cookie: Option<&Cookie>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_cookie_access_filter_t) {
impl_cef_cookie_access_filter_t::init_methods::<Self, _cef_cookie_access_filter_t>(object);
}
fn get_raw(&self) -> *mut _cef_cookie_access_filter_t;
}
#[doc = "Implement the [`WrapCookieAccessFilter`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl CookieAccessFilter` block you can override default\nmethods implemented by the [`ImplCookieAccessFilter`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_cookie_access_filter! {\n struct MyCookieAccessFilter {\n payload: String,\n }\n\n impl CookieAccessFilter {\n // ...\n }\n}\n\nfn make_my_struct() -> CookieAccessFilter {\n MyCookieAccessFilter::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_cookie_access_filter { ($ vis : vis struct $ name : ident ; impl CookieAccessFilter { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_cookie_access_filter ! { $ vis struct $ name { } impl CookieAccessFilter { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl CookieAccessFilter { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_cookie_access_filter_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> CookieAccessFilter { CookieAccessFilter :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapCookieAccessFilter for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_cookie_access_filter_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplCookieAccessFilter for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_cookie_access_filter_t { self . cef_object . cast () } } } ; }
mod impl_cef_cookie_access_filter_t {
use super::*;
pub fn init_methods<I: ImplCookieAccessFilter, R: Rc>(
object: &mut _cef_cookie_access_filter_t,
) {
object.can_send_cookie = Some(can_send_cookie::<I, R>);
object.can_save_cookie = Some(can_save_cookie::<I, R>);
}
extern "C" fn can_send_cookie<I: ImplCookieAccessFilter, R: Rc>(
self_: *mut _cef_cookie_access_filter_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
cookie: *const _cef_cookie_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_cookie) =
(self_, browser, frame, request, cookie);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let arg_cookie = if arg_cookie.is_null() {
None
} else {
Some(WrapParamRef::<Cookie, _>::from(arg_cookie))
};
let arg_cookie = arg_cookie.as_ref().map(|arg| arg.as_ref());
ImplCookieAccessFilter::can_send_cookie(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_cookie,
)
}
extern "C" fn can_save_cookie<I: ImplCookieAccessFilter, R: Rc>(
self_: *mut _cef_cookie_access_filter_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
response: *mut _cef_response_t,
cookie: *const _cef_cookie_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_response, arg_cookie) =
(self_, browser, frame, request, response, cookie);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_response = unsafe { arg_response.as_mut() }
.map(|arg| Response(unsafe { RefGuard::from_raw(arg) }));
let arg_response = arg_response.as_mut();
let arg_cookie = if arg_cookie.is_null() {
None
} else {
Some(WrapParamRef::<Cookie, _>::from(arg_cookie))
};
let arg_cookie = arg_cookie.as_ref().map(|arg| arg.as_ref());
ImplCookieAccessFilter::can_save_cookie(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_cookie,
)
}
}
impl ImplCookieAccessFilter for CookieAccessFilter {
fn can_send_cookie(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
cookie: Option<&Cookie>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_send_cookie
.map(|f| {
let (arg_browser, arg_frame, arg_request, arg_cookie) =
(browser, frame, request, cookie);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_cookie = arg_cookie.cloned().map(|arg| arg.into());
let arg_cookie = arg_cookie
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_browser, arg_frame, arg_request, arg_cookie);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn can_save_cookie(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
response: Option<&mut Response>,
cookie: Option<&Cookie>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_save_cookie
.map(|f| {
let (arg_browser, arg_frame, arg_request, arg_response, arg_cookie) =
(browser, frame, request, response, cookie);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_response = arg_response
.map(|arg| {
arg.add_ref();
ImplResponse::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_cookie = arg_cookie.cloned().map(|arg| arg.into());
let arg_cookie = arg_cookie
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_response,
arg_cookie,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_cookie_access_filter_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_cookie_access_filter_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for CookieAccessFilter {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_cookie_access_filter_t> for &CookieAccessFilter {
fn into_raw(self) -> *mut _cef_cookie_access_filter_t {
ImplCookieAccessFilter::get_raw(self)
}
}
impl ConvertParam<*mut _cef_cookie_access_filter_t> for &mut CookieAccessFilter {
fn into_raw(self) -> *mut _cef_cookie_access_filter_t {
ImplCookieAccessFilter::get_raw(self)
}
}
impl ConvertReturnValue<CookieAccessFilter> for *mut _cef_cookie_access_filter_t {
fn wrap_result(self) -> CookieAccessFilter {
CookieAccessFilter(unsafe { RefGuard::from_raw(self) })
}
}
impl From<CookieAccessFilter> for *mut _cef_cookie_access_filter_t {
fn from(value: CookieAccessFilter) -> Self {
let object = ImplCookieAccessFilter::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_sslinfo_t`] for more documentation.
#[derive(Clone)]
pub struct Sslinfo(RefGuard<_cef_sslinfo_t>);
pub trait ImplSslinfo: Clone + Sized + Rc {
#[doc = "See [`_cef_sslinfo_t::get_cert_status`] for more documentation."]
fn cert_status(&self) -> CertStatus;
#[doc = "See [`_cef_sslinfo_t::get_x509_certificate`] for more documentation."]
fn x509_certificate(&self) -> Option<X509Certificate>;
fn get_raw(&self) -> *mut _cef_sslinfo_t;
}
impl ImplSslinfo for Sslinfo {
fn cert_status(&self) -> CertStatus {
unsafe {
self.0
.get_cert_status
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn x509_certificate(&self) -> Option<X509Certificate> {
unsafe {
self.0
.get_x509_certificate
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_sslinfo_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_sslinfo_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Sslinfo {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_sslinfo_t> for &Sslinfo {
fn into_raw(self) -> *mut _cef_sslinfo_t {
ImplSslinfo::get_raw(self)
}
}
impl ConvertParam<*mut _cef_sslinfo_t> for &mut Sslinfo {
fn into_raw(self) -> *mut _cef_sslinfo_t {
ImplSslinfo::get_raw(self)
}
}
impl ConvertReturnValue<Sslinfo> for *mut _cef_sslinfo_t {
fn wrap_result(self) -> Sslinfo {
Sslinfo(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Sslinfo> for *mut _cef_sslinfo_t {
fn from(value: Sslinfo) -> Self {
let object = ImplSslinfo::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_unresponsive_process_callback_t`] for more documentation.
#[derive(Clone)]
pub struct UnresponsiveProcessCallback(RefGuard<_cef_unresponsive_process_callback_t>);
pub trait ImplUnresponsiveProcessCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_unresponsive_process_callback_t::wait`] for more documentation."]
fn wait(&self);
#[doc = "See [`_cef_unresponsive_process_callback_t::terminate`] for more documentation."]
fn terminate(&self);
fn get_raw(&self) -> *mut _cef_unresponsive_process_callback_t;
}
impl ImplUnresponsiveProcessCallback for UnresponsiveProcessCallback {
fn wait(&self) {
unsafe {
if let Some(f) = self.0.wait {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn terminate(&self) {
unsafe {
if let Some(f) = self.0.terminate {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_unresponsive_process_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_unresponsive_process_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for UnresponsiveProcessCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_unresponsive_process_callback_t> for &UnresponsiveProcessCallback {
fn into_raw(self) -> *mut _cef_unresponsive_process_callback_t {
ImplUnresponsiveProcessCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_unresponsive_process_callback_t> for &mut UnresponsiveProcessCallback {
fn into_raw(self) -> *mut _cef_unresponsive_process_callback_t {
ImplUnresponsiveProcessCallback::get_raw(self)
}
}
impl ConvertReturnValue<UnresponsiveProcessCallback> for *mut _cef_unresponsive_process_callback_t {
fn wrap_result(self) -> UnresponsiveProcessCallback {
UnresponsiveProcessCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<UnresponsiveProcessCallback> for *mut _cef_unresponsive_process_callback_t {
fn from(value: UnresponsiveProcessCallback) -> Self {
let object = ImplUnresponsiveProcessCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_select_client_certificate_callback_t`] for more documentation.
#[derive(Clone)]
pub struct SelectClientCertificateCallback(RefGuard<_cef_select_client_certificate_callback_t>);
pub trait ImplSelectClientCertificateCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_select_client_certificate_callback_t::select`] for more documentation."]
fn select(&self, cert: Option<&mut X509Certificate>);
fn get_raw(&self) -> *mut _cef_select_client_certificate_callback_t;
}
impl ImplSelectClientCertificateCallback for SelectClientCertificateCallback {
fn select(&self, cert: Option<&mut X509Certificate>) {
unsafe {
if let Some(f) = self.0.select {
let arg_cert = cert;
let arg_self_ = self.into_raw();
let arg_cert = arg_cert
.map(|arg| {
arg.add_ref();
ImplX509Certificate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_cert);
}
}
}
fn get_raw(&self) -> *mut _cef_select_client_certificate_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_select_client_certificate_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for SelectClientCertificateCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_select_client_certificate_callback_t>
for &SelectClientCertificateCallback
{
fn into_raw(self) -> *mut _cef_select_client_certificate_callback_t {
ImplSelectClientCertificateCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_select_client_certificate_callback_t>
for &mut SelectClientCertificateCallback
{
fn into_raw(self) -> *mut _cef_select_client_certificate_callback_t {
ImplSelectClientCertificateCallback::get_raw(self)
}
}
impl ConvertReturnValue<SelectClientCertificateCallback>
for *mut _cef_select_client_certificate_callback_t
{
fn wrap_result(self) -> SelectClientCertificateCallback {
SelectClientCertificateCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<SelectClientCertificateCallback> for *mut _cef_select_client_certificate_callback_t {
fn from(value: SelectClientCertificateCallback) -> Self {
let object = ImplSelectClientCertificateCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_request_handler_t`] for more documentation.
#[derive(Clone)]
pub struct RequestHandler(RefGuard<_cef_request_handler_t>);
impl RequestHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapRequestHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplRequestHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapRequestHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_request_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapRequestHandler: ImplRequestHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_request_handler_t, Self>);
}
pub trait ImplRequestHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_request_handler_t::on_before_browse`] for more documentation."]
fn on_before_browse(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
user_gesture: ::std::os::raw::c_int,
is_redirect: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_request_handler_t::on_open_urlfrom_tab`] for more documentation."]
fn on_open_urlfrom_tab(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
target_url: Option<&CefString>,
target_disposition: WindowOpenDisposition,
user_gesture: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_request_handler_t::get_resource_request_handler`] for more documentation."]
fn resource_request_handler(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
is_navigation: ::std::os::raw::c_int,
is_download: ::std::os::raw::c_int,
request_initiator: Option<&CefString>,
disable_default_handling: Option<&mut ::std::os::raw::c_int>,
) -> Option<ResourceRequestHandler> {
Default::default()
}
#[doc = "See [`_cef_request_handler_t::get_auth_credentials`] for more documentation."]
fn auth_credentials(
&self,
browser: Option<&mut Browser>,
origin_url: Option<&CefString>,
is_proxy: ::std::os::raw::c_int,
host: Option<&CefString>,
port: ::std::os::raw::c_int,
realm: Option<&CefString>,
scheme: Option<&CefString>,
callback: Option<&mut AuthCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_request_handler_t::on_certificate_error`] for more documentation."]
fn on_certificate_error(
&self,
browser: Option<&mut Browser>,
cert_error: Errorcode,
request_url: Option<&CefString>,
ssl_info: Option<&mut Sslinfo>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_request_handler_t::on_select_client_certificate`] for more documentation."]
fn on_select_client_certificate(
&self,
browser: Option<&mut Browser>,
is_proxy: ::std::os::raw::c_int,
host: Option<&CefString>,
port: ::std::os::raw::c_int,
certificates: Option<&[Option<X509Certificate>]>,
callback: Option<&mut SelectClientCertificateCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_request_handler_t::on_render_view_ready`] for more documentation."]
fn on_render_view_ready(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_request_handler_t::on_render_process_unresponsive`] for more documentation."]
fn on_render_process_unresponsive(
&self,
browser: Option<&mut Browser>,
callback: Option<&mut UnresponsiveProcessCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_request_handler_t::on_render_process_responsive`] for more documentation."]
fn on_render_process_responsive(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_request_handler_t::on_render_process_terminated`] for more documentation."]
fn on_render_process_terminated(
&self,
browser: Option<&mut Browser>,
status: TerminationStatus,
error_code: ::std::os::raw::c_int,
error_string: Option<&CefString>,
) {
}
#[doc = "See [`_cef_request_handler_t::on_document_available_in_main_frame`] for more documentation."]
fn on_document_available_in_main_frame(&self, browser: Option<&mut Browser>) {}
fn init_methods(object: &mut _cef_request_handler_t) {
impl_cef_request_handler_t::init_methods::<Self, _cef_request_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_request_handler_t;
}
#[doc = "Implement the [`WrapRequestHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl RequestHandler` block you can override default\nmethods implemented by the [`ImplRequestHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_request_handler! {\n struct MyRequestHandler {\n payload: String,\n }\n\n impl RequestHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> RequestHandler {\n MyRequestHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_request_handler { ($ vis : vis struct $ name : ident ; impl RequestHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_request_handler ! { $ vis struct $ name { } impl RequestHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl RequestHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_request_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> RequestHandler { RequestHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapRequestHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_request_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplRequestHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_request_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_request_handler_t {
use super::*;
pub fn init_methods<I: ImplRequestHandler, R: Rc>(object: &mut _cef_request_handler_t) {
object.on_before_browse = Some(on_before_browse::<I, R>);
object.on_open_urlfrom_tab = Some(on_open_urlfrom_tab::<I, R>);
object.get_resource_request_handler = Some(get_resource_request_handler::<I, R>);
object.get_auth_credentials = Some(get_auth_credentials::<I, R>);
object.on_certificate_error = Some(on_certificate_error::<I, R>);
object.on_select_client_certificate = Some(on_select_client_certificate::<I, R>);
object.on_render_view_ready = Some(on_render_view_ready::<I, R>);
object.on_render_process_unresponsive = Some(on_render_process_unresponsive::<I, R>);
object.on_render_process_responsive = Some(on_render_process_responsive::<I, R>);
object.on_render_process_terminated = Some(on_render_process_terminated::<I, R>);
object.on_document_available_in_main_frame =
Some(on_document_available_in_main_frame::<I, R>);
}
extern "C" fn on_before_browse<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
user_gesture: ::std::os::raw::c_int,
is_redirect: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_request, arg_user_gesture, arg_is_redirect) =
(self_, browser, frame, request, user_gesture, is_redirect);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let arg_user_gesture = arg_user_gesture.into_raw();
let arg_is_redirect = arg_is_redirect.into_raw();
ImplRequestHandler::on_before_browse(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_user_gesture,
arg_is_redirect,
)
}
extern "C" fn on_open_urlfrom_tab<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
target_url: *const cef_string_t,
target_disposition: cef_window_open_disposition_t,
user_gesture: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_frame,
arg_target_url,
arg_target_disposition,
arg_user_gesture,
) = (
self_,
browser,
frame,
target_url,
target_disposition,
user_gesture,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_target_url = if arg_target_url.is_null() {
None
} else {
Some(arg_target_url.into())
};
let arg_target_url = arg_target_url.as_ref();
let arg_target_disposition = arg_target_disposition.into_raw();
let arg_user_gesture = arg_user_gesture.into_raw();
ImplRequestHandler::on_open_urlfrom_tab(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_target_url,
arg_target_disposition,
arg_user_gesture,
)
}
extern "C" fn get_resource_request_handler<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
is_navigation: ::std::os::raw::c_int,
is_download: ::std::os::raw::c_int,
request_initiator: *const cef_string_t,
disable_default_handling: *mut ::std::os::raw::c_int,
) -> *mut _cef_resource_request_handler_t {
let (
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
) = (
self_,
browser,
frame,
request,
is_navigation,
is_download,
request_initiator,
disable_default_handling,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let arg_is_navigation = arg_is_navigation.into_raw();
let arg_is_download = arg_is_download.into_raw();
let arg_request_initiator = if arg_request_initiator.is_null() {
None
} else {
Some(arg_request_initiator.into())
};
let arg_request_initiator = arg_request_initiator.as_ref();
let mut arg_disable_default_handling = if arg_disable_default_handling.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_disable_default_handling,
))
};
let arg_disable_default_handling = arg_disable_default_handling
.as_mut()
.map(|arg| arg.as_mut());
let result = ImplRequestHandler::resource_request_handler(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_auth_credentials<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
origin_url: *const cef_string_t,
is_proxy: ::std::os::raw::c_int,
host: *const cef_string_t,
port: ::std::os::raw::c_int,
realm: *const cef_string_t,
scheme: *const cef_string_t,
callback: *mut _cef_auth_callback_t,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_origin_url,
arg_is_proxy,
arg_host,
arg_port,
arg_realm,
arg_scheme,
arg_callback,
) = (
self_, browser, origin_url, is_proxy, host, port, realm, scheme, callback,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_origin_url = if arg_origin_url.is_null() {
None
} else {
Some(arg_origin_url.into())
};
let arg_origin_url = arg_origin_url.as_ref();
let arg_is_proxy = arg_is_proxy.into_raw();
let arg_host = if arg_host.is_null() {
None
} else {
Some(arg_host.into())
};
let arg_host = arg_host.as_ref();
let arg_port = arg_port.into_raw();
let arg_realm = if arg_realm.is_null() {
None
} else {
Some(arg_realm.into())
};
let arg_realm = arg_realm.as_ref();
let arg_scheme = if arg_scheme.is_null() {
None
} else {
Some(arg_scheme.into())
};
let arg_scheme = arg_scheme.as_ref();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| AuthCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplRequestHandler::auth_credentials(
&arg_self_.interface,
arg_browser,
arg_origin_url,
arg_is_proxy,
arg_host,
arg_port,
arg_realm,
arg_scheme,
arg_callback,
)
}
extern "C" fn on_certificate_error<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
cert_error: cef_errorcode_t,
request_url: *const cef_string_t,
ssl_info: *mut _cef_sslinfo_t,
callback: *mut _cef_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_cert_error, arg_request_url, arg_ssl_info, arg_callback) =
(self_, browser, cert_error, request_url, ssl_info, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_cert_error = arg_cert_error.into_raw();
let arg_request_url = if arg_request_url.is_null() {
None
} else {
Some(arg_request_url.into())
};
let arg_request_url = arg_request_url.as_ref();
let mut arg_ssl_info =
unsafe { arg_ssl_info.as_mut() }.map(|arg| Sslinfo(unsafe { RefGuard::from_raw(arg) }));
let arg_ssl_info = arg_ssl_info.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| Callback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplRequestHandler::on_certificate_error(
&arg_self_.interface,
arg_browser,
arg_cert_error,
arg_request_url,
arg_ssl_info,
arg_callback,
)
}
extern "C" fn on_select_client_certificate<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
is_proxy: ::std::os::raw::c_int,
host: *const cef_string_t,
port: ::std::os::raw::c_int,
certificates_count: usize,
certificates: *const *mut _cef_x509_certificate_t,
callback: *mut _cef_select_client_certificate_callback_t,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_browser,
arg_is_proxy,
arg_host,
arg_port,
arg_certificates_count,
arg_certificates,
arg_callback,
) = (
self_,
browser,
is_proxy,
host,
port,
certificates_count,
certificates,
callback,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_is_proxy = arg_is_proxy.into_raw();
let arg_host = if arg_host.is_null() {
None
} else {
Some(arg_host.into())
};
let arg_host = arg_host.as_ref();
let arg_port = arg_port.into_raw();
let vec_certificates = unsafe { arg_certificates.as_ref() }.map(|arg| {
let arg = unsafe {
std::slice::from_raw_parts(std::ptr::from_ref(arg), arg_certificates_count)
};
arg.iter()
.map(|arg| {
if arg.is_null() {
None
} else {
Some(X509Certificate(unsafe { RefGuard::from_raw(*arg) }))
}
})
.collect::<Vec<_>>()
});
let arg_certificates = vec_certificates.as_deref();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| SelectClientCertificateCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplRequestHandler::on_select_client_certificate(
&arg_self_.interface,
arg_browser,
arg_is_proxy,
arg_host,
arg_port,
arg_certificates,
arg_callback,
)
}
extern "C" fn on_render_view_ready<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplRequestHandler::on_render_view_ready(&arg_self_.interface, arg_browser)
}
extern "C" fn on_render_process_unresponsive<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
callback: *mut _cef_unresponsive_process_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_callback) = (self_, browser, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| UnresponsiveProcessCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplRequestHandler::on_render_process_unresponsive(
&arg_self_.interface,
arg_browser,
arg_callback,
)
}
extern "C" fn on_render_process_responsive<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplRequestHandler::on_render_process_responsive(&arg_self_.interface, arg_browser)
}
extern "C" fn on_render_process_terminated<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
status: cef_termination_status_t,
error_code: ::std::os::raw::c_int,
error_string: *const cef_string_t,
) {
let (arg_self_, arg_browser, arg_status, arg_error_code, arg_error_string) =
(self_, browser, status, error_code, error_string);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let arg_status = arg_status.into_raw();
let arg_error_code = arg_error_code.into_raw();
let arg_error_string = if arg_error_string.is_null() {
None
} else {
Some(arg_error_string.into())
};
let arg_error_string = arg_error_string.as_ref();
ImplRequestHandler::on_render_process_terminated(
&arg_self_.interface,
arg_browser,
arg_status,
arg_error_code,
arg_error_string,
)
}
extern "C" fn on_document_available_in_main_frame<I: ImplRequestHandler, R: Rc>(
self_: *mut _cef_request_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplRequestHandler::on_document_available_in_main_frame(&arg_self_.interface, arg_browser)
}
}
impl ImplRequestHandler for RequestHandler {
fn on_before_browse(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
user_gesture: ::std::os::raw::c_int,
is_redirect: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_before_browse
.map(|f| {
let (arg_browser, arg_frame, arg_request, arg_user_gesture, arg_is_redirect) =
(browser, frame, request, user_gesture, is_redirect);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_user_gesture,
arg_is_redirect,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_open_urlfrom_tab(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
target_url: Option<&CefString>,
target_disposition: WindowOpenDisposition,
user_gesture: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_open_urlfrom_tab
.map(|f| {
let (
arg_browser,
arg_frame,
arg_target_url,
arg_target_disposition,
arg_user_gesture,
) = (browser, frame, target_url, target_disposition, user_gesture);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_target_url = arg_target_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_target_disposition = arg_target_disposition.into_raw();
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_target_url,
arg_target_disposition,
arg_user_gesture,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn resource_request_handler(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
is_navigation: ::std::os::raw::c_int,
is_download: ::std::os::raw::c_int,
request_initiator: Option<&CefString>,
disable_default_handling: Option<&mut ::std::os::raw::c_int>,
) -> Option<ResourceRequestHandler> {
unsafe {
self.0
.get_resource_request_handler
.map(|f| {
let (
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
) = (
browser,
frame,
request,
is_navigation,
is_download,
request_initiator,
disable_default_handling,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request_initiator = arg_request_initiator
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_disable_default_handling = arg_disable_default_handling
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn auth_credentials(
&self,
browser: Option<&mut Browser>,
origin_url: Option<&CefString>,
is_proxy: ::std::os::raw::c_int,
host: Option<&CefString>,
port: ::std::os::raw::c_int,
realm: Option<&CefString>,
scheme: Option<&CefString>,
callback: Option<&mut AuthCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_auth_credentials
.map(|f| {
let (
arg_browser,
arg_origin_url,
arg_is_proxy,
arg_host,
arg_port,
arg_realm,
arg_scheme,
arg_callback,
) = (
browser, origin_url, is_proxy, host, port, realm, scheme, callback,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_origin_url = arg_origin_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_host = arg_host
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_realm = arg_realm
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_scheme = arg_scheme
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplAuthCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_origin_url,
arg_is_proxy,
arg_host,
arg_port,
arg_realm,
arg_scheme,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_certificate_error(
&self,
browser: Option<&mut Browser>,
cert_error: Errorcode,
request_url: Option<&CefString>,
ssl_info: Option<&mut Sslinfo>,
callback: Option<&mut Callback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_certificate_error
.map(|f| {
let (arg_browser, arg_cert_error, arg_request_url, arg_ssl_info, arg_callback) =
(browser, cert_error, request_url, ssl_info, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_cert_error = arg_cert_error.into_raw();
let arg_request_url = arg_request_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_ssl_info = arg_ssl_info
.map(|arg| {
arg.add_ref();
ImplSslinfo::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_cert_error,
arg_request_url,
arg_ssl_info,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_select_client_certificate(
&self,
browser: Option<&mut Browser>,
is_proxy: ::std::os::raw::c_int,
host: Option<&CefString>,
port: ::std::os::raw::c_int,
certificates: Option<&[Option<X509Certificate>]>,
callback: Option<&mut SelectClientCertificateCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_select_client_certificate
.map(|f| {
let (
arg_browser,
arg_is_proxy,
arg_host,
arg_port,
arg_certificates,
arg_callback,
) = (browser, is_proxy, host, port, certificates, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_host = arg_host
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_certificates_count = arg_certificates
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_certificates = arg_certificates
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_certificates = if vec_certificates.is_empty() {
std::ptr::null()
} else {
vec_certificates.as_ptr()
};
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplSelectClientCertificateCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_is_proxy,
arg_host,
arg_port,
arg_certificates_count,
arg_certificates,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_render_view_ready(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_render_view_ready {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn on_render_process_unresponsive(
&self,
browser: Option<&mut Browser>,
callback: Option<&mut UnresponsiveProcessCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_render_process_unresponsive
.map(|f| {
let (arg_browser, arg_callback) = (browser, callback);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplUnresponsiveProcessCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser, arg_callback);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_render_process_responsive(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_render_process_responsive {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn on_render_process_terminated(
&self,
browser: Option<&mut Browser>,
status: TerminationStatus,
error_code: ::std::os::raw::c_int,
error_string: Option<&CefString>,
) {
unsafe {
if let Some(f) = self.0.on_render_process_terminated {
let (arg_browser, arg_status, arg_error_code, arg_error_string) =
(browser, status, error_code, error_string);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_status = arg_status.into_raw();
let arg_error_string = arg_error_string
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_browser,
arg_status,
arg_error_code,
arg_error_string,
);
}
}
}
fn on_document_available_in_main_frame(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_document_available_in_main_frame {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn get_raw(&self) -> *mut _cef_request_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_request_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RequestHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_request_handler_t> for &RequestHandler {
fn into_raw(self) -> *mut _cef_request_handler_t {
ImplRequestHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_request_handler_t> for &mut RequestHandler {
fn into_raw(self) -> *mut _cef_request_handler_t {
ImplRequestHandler::get_raw(self)
}
}
impl ConvertReturnValue<RequestHandler> for *mut _cef_request_handler_t {
fn wrap_result(self) -> RequestHandler {
RequestHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RequestHandler> for *mut _cef_request_handler_t {
fn from(value: RequestHandler) -> Self {
let object = ImplRequestHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_client_t`] for more documentation.
#[derive(Clone)]
pub struct Client(RefGuard<_cef_client_t>);
impl Client {
pub fn new<T>(interface: T) -> Self
where
T: WrapClient,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplClient>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapClient>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_client_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapClient: ImplClient {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_client_t, Self>);
}
pub trait ImplClient: Clone + Sized + Rc {
#[doc = "See [`_cef_client_t::get_audio_handler`] for more documentation."]
fn audio_handler(&self) -> Option<AudioHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_command_handler`] for more documentation."]
fn command_handler(&self) -> Option<CommandHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_context_menu_handler`] for more documentation."]
fn context_menu_handler(&self) -> Option<ContextMenuHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_dialog_handler`] for more documentation."]
fn dialog_handler(&self) -> Option<DialogHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_display_handler`] for more documentation."]
fn display_handler(&self) -> Option<DisplayHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_download_handler`] for more documentation."]
fn download_handler(&self) -> Option<DownloadHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_drag_handler`] for more documentation."]
fn drag_handler(&self) -> Option<DragHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_find_handler`] for more documentation."]
fn find_handler(&self) -> Option<FindHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_focus_handler`] for more documentation."]
fn focus_handler(&self) -> Option<FocusHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_frame_handler`] for more documentation."]
fn frame_handler(&self) -> Option<FrameHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_permission_handler`] for more documentation."]
fn permission_handler(&self) -> Option<PermissionHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_jsdialog_handler`] for more documentation."]
fn jsdialog_handler(&self) -> Option<JsdialogHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_keyboard_handler`] for more documentation."]
fn keyboard_handler(&self) -> Option<KeyboardHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_life_span_handler`] for more documentation."]
fn life_span_handler(&self) -> Option<LifeSpanHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_load_handler`] for more documentation."]
fn load_handler(&self) -> Option<LoadHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_print_handler`] for more documentation."]
fn print_handler(&self) -> Option<PrintHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_render_handler`] for more documentation."]
fn render_handler(&self) -> Option<RenderHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::get_request_handler`] for more documentation."]
fn request_handler(&self) -> Option<RequestHandler> {
Default::default()
}
#[doc = "See [`_cef_client_t::on_process_message_received`] for more documentation."]
fn on_process_message_received(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
source_process: ProcessId,
message: Option<&mut ProcessMessage>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_client_t) {
impl_cef_client_t::init_methods::<Self, _cef_client_t>(object);
}
fn get_raw(&self) -> *mut _cef_client_t;
}
#[doc = "Implement the [`WrapClient`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl Client` block you can override default\nmethods implemented by the [`ImplClient`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_client! {\n struct MyClient {\n payload: String,\n }\n\n impl Client {\n // ...\n }\n}\n\nfn make_my_struct() -> Client {\n MyClient::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_client { ($ vis : vis struct $ name : ident ; impl Client { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_client ! { $ vis struct $ name { } impl Client { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl Client { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_client_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> Client { Client :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapClient for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_client_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplClient for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_client_t { self . cef_object . cast () } } } ; }
mod impl_cef_client_t {
use super::*;
pub fn init_methods<I: ImplClient, R: Rc>(object: &mut _cef_client_t) {
object.get_audio_handler = Some(get_audio_handler::<I, R>);
object.get_command_handler = Some(get_command_handler::<I, R>);
object.get_context_menu_handler = Some(get_context_menu_handler::<I, R>);
object.get_dialog_handler = Some(get_dialog_handler::<I, R>);
object.get_display_handler = Some(get_display_handler::<I, R>);
object.get_download_handler = Some(get_download_handler::<I, R>);
object.get_drag_handler = Some(get_drag_handler::<I, R>);
object.get_find_handler = Some(get_find_handler::<I, R>);
object.get_focus_handler = Some(get_focus_handler::<I, R>);
object.get_frame_handler = Some(get_frame_handler::<I, R>);
object.get_permission_handler = Some(get_permission_handler::<I, R>);
object.get_jsdialog_handler = Some(get_jsdialog_handler::<I, R>);
object.get_keyboard_handler = Some(get_keyboard_handler::<I, R>);
object.get_life_span_handler = Some(get_life_span_handler::<I, R>);
object.get_load_handler = Some(get_load_handler::<I, R>);
object.get_print_handler = Some(get_print_handler::<I, R>);
object.get_render_handler = Some(get_render_handler::<I, R>);
object.get_request_handler = Some(get_request_handler::<I, R>);
object.on_process_message_received = Some(on_process_message_received::<I, R>);
}
extern "C" fn get_audio_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_audio_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::audio_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_command_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_command_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::command_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_context_menu_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_context_menu_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::context_menu_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_dialog_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_dialog_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::dialog_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_display_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_display_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::display_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_download_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_download_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::download_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_drag_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_drag_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::drag_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_find_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_find_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::find_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_focus_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_focus_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::focus_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_frame_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_frame_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::frame_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_permission_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_permission_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::permission_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_jsdialog_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_jsdialog_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::jsdialog_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_keyboard_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_keyboard_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::keyboard_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_life_span_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_life_span_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::life_span_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_load_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_load_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::load_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_print_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_print_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::print_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_render_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_render_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::render_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_request_handler<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
) -> *mut _cef_request_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplClient::request_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn on_process_message_received<I: ImplClient, R: Rc>(
self_: *mut _cef_client_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
source_process: cef_process_id_t,
message: *mut _cef_process_message_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_source_process, arg_message) =
(self_, browser, frame, source_process, message);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_source_process = arg_source_process.into_raw();
let mut arg_message = unsafe { arg_message.as_mut() }
.map(|arg| ProcessMessage(unsafe { RefGuard::from_raw(arg) }));
let arg_message = arg_message.as_mut();
ImplClient::on_process_message_received(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_source_process,
arg_message,
)
}
}
impl ImplClient for Client {
fn audio_handler(&self) -> Option<AudioHandler> {
unsafe {
self.0
.get_audio_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn command_handler(&self) -> Option<CommandHandler> {
unsafe {
self.0
.get_command_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn context_menu_handler(&self) -> Option<ContextMenuHandler> {
unsafe {
self.0
.get_context_menu_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn dialog_handler(&self) -> Option<DialogHandler> {
unsafe {
self.0
.get_dialog_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn display_handler(&self) -> Option<DisplayHandler> {
unsafe {
self.0
.get_display_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn download_handler(&self) -> Option<DownloadHandler> {
unsafe {
self.0
.get_download_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn drag_handler(&self) -> Option<DragHandler> {
unsafe {
self.0
.get_drag_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn find_handler(&self) -> Option<FindHandler> {
unsafe {
self.0
.get_find_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn focus_handler(&self) -> Option<FocusHandler> {
unsafe {
self.0
.get_focus_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn frame_handler(&self) -> Option<FrameHandler> {
unsafe {
self.0
.get_frame_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn permission_handler(&self) -> Option<PermissionHandler> {
unsafe {
self.0
.get_permission_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn jsdialog_handler(&self) -> Option<JsdialogHandler> {
unsafe {
self.0
.get_jsdialog_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn keyboard_handler(&self) -> Option<KeyboardHandler> {
unsafe {
self.0
.get_keyboard_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn life_span_handler(&self) -> Option<LifeSpanHandler> {
unsafe {
self.0
.get_life_span_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn load_handler(&self) -> Option<LoadHandler> {
unsafe {
self.0
.get_load_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn print_handler(&self) -> Option<PrintHandler> {
unsafe {
self.0
.get_print_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn render_handler(&self) -> Option<RenderHandler> {
unsafe {
self.0
.get_render_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn request_handler(&self) -> Option<RequestHandler> {
unsafe {
self.0
.get_request_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn on_process_message_received(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
source_process: ProcessId,
message: Option<&mut ProcessMessage>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_process_message_received
.map(|f| {
let (arg_browser, arg_frame, arg_source_process, arg_message) =
(browser, frame, source_process, message);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_source_process = arg_source_process.into_raw();
let arg_message = arg_message
.map(|arg| {
arg.add_ref();
ImplProcessMessage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_source_process,
arg_message,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_client_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_client_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Client {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_client_t> for &Client {
fn into_raw(self) -> *mut _cef_client_t {
ImplClient::get_raw(self)
}
}
impl ConvertParam<*mut _cef_client_t> for &mut Client {
fn into_raw(self) -> *mut _cef_client_t {
ImplClient::get_raw(self)
}
}
impl ConvertReturnValue<Client> for *mut _cef_client_t {
fn wrap_result(self) -> Client {
Client(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Client> for *mut _cef_client_t {
fn from(value: Client) -> Self {
let object = ImplClient::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_command_line_t`] for more documentation.
#[derive(Clone)]
pub struct CommandLine(RefGuard<_cef_command_line_t>);
pub trait ImplCommandLine: Clone + Sized + Rc {
#[doc = "See [`_cef_command_line_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_command_line_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_command_line_t::copy`] for more documentation."]
fn copy(&self) -> Option<CommandLine>;
#[doc = "See [`_cef_command_line_t::init_from_argv`] for more documentation."]
fn init_from_argv(
&self,
argc: ::std::os::raw::c_int,
argv: *const *const ::std::os::raw::c_char,
);
#[doc = "See [`_cef_command_line_t::init_from_string`] for more documentation."]
fn init_from_string(&self, command_line: Option<&CefString>);
#[doc = "See [`_cef_command_line_t::reset`] for more documentation."]
fn reset(&self);
#[doc = "See [`_cef_command_line_t::get_argv`] for more documentation."]
fn argv(&self, argv: Option<&mut CefStringList>);
#[doc = "See [`_cef_command_line_t::get_command_line_string`] for more documentation."]
fn command_line_string(&self) -> CefStringUserfree;
#[doc = "See [`_cef_command_line_t::get_program`] for more documentation."]
fn program(&self) -> CefStringUserfree;
#[doc = "See [`_cef_command_line_t::set_program`] for more documentation."]
fn set_program(&self, program: Option<&CefString>);
#[doc = "See [`_cef_command_line_t::has_switches`] for more documentation."]
fn has_switches(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_command_line_t::has_switch`] for more documentation."]
fn has_switch(&self, name: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_command_line_t::get_switch_value`] for more documentation."]
fn switch_value(&self, name: Option<&CefString>) -> CefStringUserfree;
#[doc = "See [`_cef_command_line_t::get_switches`] for more documentation."]
fn switches(&self, switches: Option<&mut CefStringMap>);
#[doc = "See [`_cef_command_line_t::append_switch`] for more documentation."]
fn append_switch(&self, name: Option<&CefString>);
#[doc = "See [`_cef_command_line_t::append_switch_with_value`] for more documentation."]
fn append_switch_with_value(&self, name: Option<&CefString>, value: Option<&CefString>);
#[doc = "See [`_cef_command_line_t::has_arguments`] for more documentation."]
fn has_arguments(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_command_line_t::get_arguments`] for more documentation."]
fn arguments(&self, arguments: Option<&mut CefStringList>);
#[doc = "See [`_cef_command_line_t::append_argument`] for more documentation."]
fn append_argument(&self, argument: Option<&CefString>);
#[doc = "See [`_cef_command_line_t::prepend_wrapper`] for more documentation."]
fn prepend_wrapper(&self, wrapper: Option<&CefString>);
#[doc = "See [`_cef_command_line_t::remove_switch`] for more documentation."]
fn remove_switch(&self, name: Option<&CefString>);
fn get_raw(&self) -> *mut _cef_command_line_t;
}
impl ImplCommandLine for CommandLine {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn copy(&self) -> Option<CommandLine> {
unsafe {
self.0
.copy
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn init_from_argv(
&self,
argc: ::std::os::raw::c_int,
argv: *const *const ::std::os::raw::c_char,
) {
unsafe {
if let Some(f) = self.0.init_from_argv {
let (arg_argc, arg_argv) = (argc, argv);
let arg_self_ = self.into_raw();
let arg_argv = arg_argv.cast();
f(arg_self_, arg_argc, arg_argv);
}
}
}
fn init_from_string(&self, command_line: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.init_from_string {
let arg_command_line = command_line;
let arg_self_ = self.into_raw();
let arg_command_line = arg_command_line
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_command_line);
}
}
}
fn reset(&self) {
unsafe {
if let Some(f) = self.0.reset {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn argv(&self, argv: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.get_argv {
let arg_argv = argv;
let arg_self_ = self.into_raw();
let arg_argv = arg_argv
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_argv);
}
}
}
fn command_line_string(&self) -> CefStringUserfree {
unsafe {
self.0
.get_command_line_string
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn program(&self) -> CefStringUserfree {
unsafe {
self.0
.get_program
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_program(&self, program: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_program {
let arg_program = program;
let arg_self_ = self.into_raw();
let arg_program = arg_program
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_program);
}
}
}
fn has_switches(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_switches
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_switch(&self, name: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_switch
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn switch_value(&self, name: Option<&CefString>) -> CefStringUserfree {
unsafe {
self.0
.get_switch_value
.map(|f| {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn switches(&self, switches: Option<&mut CefStringMap>) {
unsafe {
if let Some(f) = self.0.get_switches {
let arg_switches = switches;
let arg_self_ = self.into_raw();
let arg_switches = arg_switches
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_switches);
}
}
}
fn append_switch(&self, name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.append_switch {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name);
}
}
}
fn append_switch_with_value(&self, name: Option<&CefString>, value: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.append_switch_with_value {
let (arg_name, arg_value) = (name, value);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name, arg_value);
}
}
}
fn has_arguments(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_arguments
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn arguments(&self, arguments: Option<&mut CefStringList>) {
unsafe {
if let Some(f) = self.0.get_arguments {
let arg_arguments = arguments;
let arg_self_ = self.into_raw();
let arg_arguments = arg_arguments
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_arguments);
}
}
}
fn append_argument(&self, argument: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.append_argument {
let arg_argument = argument;
let arg_self_ = self.into_raw();
let arg_argument = arg_argument
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_argument);
}
}
}
fn prepend_wrapper(&self, wrapper: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.prepend_wrapper {
let arg_wrapper = wrapper;
let arg_self_ = self.into_raw();
let arg_wrapper = arg_wrapper
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_wrapper);
}
}
}
fn remove_switch(&self, name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.remove_switch {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name);
}
}
}
fn get_raw(&self) -> *mut _cef_command_line_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_command_line_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for CommandLine {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_command_line_t> for &CommandLine {
fn into_raw(self) -> *mut _cef_command_line_t {
ImplCommandLine::get_raw(self)
}
}
impl ConvertParam<*mut _cef_command_line_t> for &mut CommandLine {
fn into_raw(self) -> *mut _cef_command_line_t {
ImplCommandLine::get_raw(self)
}
}
impl ConvertReturnValue<CommandLine> for *mut _cef_command_line_t {
fn wrap_result(self) -> CommandLine {
CommandLine(unsafe { RefGuard::from_raw(self) })
}
}
impl From<CommandLine> for *mut _cef_command_line_t {
fn from(value: CommandLine) -> Self {
let object = ImplCommandLine::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_request_context_handler_t`] for more documentation.
#[derive(Clone)]
pub struct RequestContextHandler(RefGuard<_cef_request_context_handler_t>);
impl RequestContextHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapRequestContextHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplRequestContextHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapRequestContextHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_request_context_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapRequestContextHandler: ImplRequestContextHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_request_context_handler_t, Self>);
}
pub trait ImplRequestContextHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_request_context_handler_t::on_request_context_initialized`] for more documentation."]
fn on_request_context_initialized(&self, request_context: Option<&mut RequestContext>) {}
#[doc = "See [`_cef_request_context_handler_t::get_resource_request_handler`] for more documentation."]
fn resource_request_handler(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
is_navigation: ::std::os::raw::c_int,
is_download: ::std::os::raw::c_int,
request_initiator: Option<&CefString>,
disable_default_handling: Option<&mut ::std::os::raw::c_int>,
) -> Option<ResourceRequestHandler> {
Default::default()
}
fn init_methods(object: &mut _cef_request_context_handler_t) {
impl_cef_request_context_handler_t::init_methods::<Self, _cef_request_context_handler_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_request_context_handler_t;
}
#[doc = "Implement the [`WrapRequestContextHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl RequestContextHandler` block you can override default\nmethods implemented by the [`ImplRequestContextHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_request_context_handler! {\n struct MyRequestContextHandler {\n payload: String,\n }\n\n impl RequestContextHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> RequestContextHandler {\n MyRequestContextHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_request_context_handler { ($ vis : vis struct $ name : ident ; impl RequestContextHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_request_context_handler ! { $ vis struct $ name { } impl RequestContextHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl RequestContextHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_request_context_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> RequestContextHandler { RequestContextHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapRequestContextHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_request_context_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplRequestContextHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_request_context_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_request_context_handler_t {
use super::*;
pub fn init_methods<I: ImplRequestContextHandler, R: Rc>(
object: &mut _cef_request_context_handler_t,
) {
object.on_request_context_initialized = Some(on_request_context_initialized::<I, R>);
object.get_resource_request_handler = Some(get_resource_request_handler::<I, R>);
}
extern "C" fn on_request_context_initialized<I: ImplRequestContextHandler, R: Rc>(
self_: *mut _cef_request_context_handler_t,
request_context: *mut _cef_request_context_t,
) {
let (arg_self_, arg_request_context) = (self_, request_context);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_request_context = unsafe { arg_request_context.as_mut() }
.map(|arg| RequestContext(unsafe { RefGuard::from_raw(arg) }));
let arg_request_context = arg_request_context.as_mut();
ImplRequestContextHandler::on_request_context_initialized(
&arg_self_.interface,
arg_request_context,
)
}
extern "C" fn get_resource_request_handler<I: ImplRequestContextHandler, R: Rc>(
self_: *mut _cef_request_context_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
request: *mut _cef_request_t,
is_navigation: ::std::os::raw::c_int,
is_download: ::std::os::raw::c_int,
request_initiator: *const cef_string_t,
disable_default_handling: *mut ::std::os::raw::c_int,
) -> *mut _cef_resource_request_handler_t {
let (
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
) = (
self_,
browser,
frame,
request,
is_navigation,
is_download,
request_initiator,
disable_default_handling,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let arg_is_navigation = arg_is_navigation.into_raw();
let arg_is_download = arg_is_download.into_raw();
let arg_request_initiator = if arg_request_initiator.is_null() {
None
} else {
Some(arg_request_initiator.into())
};
let arg_request_initiator = arg_request_initiator.as_ref();
let mut arg_disable_default_handling = if arg_disable_default_handling.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_disable_default_handling,
))
};
let arg_disable_default_handling = arg_disable_default_handling
.as_mut()
.map(|arg| arg.as_mut());
let result = ImplRequestContextHandler::resource_request_handler(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
}
impl ImplRequestContextHandler for RequestContextHandler {
fn on_request_context_initialized(&self, request_context: Option<&mut RequestContext>) {
unsafe {
if let Some(f) = self.0.on_request_context_initialized {
let arg_request_context = request_context;
let arg_self_ = self.into_raw();
let arg_request_context = arg_request_context
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_request_context);
}
}
}
fn resource_request_handler(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
request: Option<&mut Request>,
is_navigation: ::std::os::raw::c_int,
is_download: ::std::os::raw::c_int,
request_initiator: Option<&CefString>,
disable_default_handling: Option<&mut ::std::os::raw::c_int>,
) -> Option<ResourceRequestHandler> {
unsafe {
self.0
.get_resource_request_handler
.map(|f| {
let (
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
) = (
browser,
frame,
request,
is_navigation,
is_download,
request_initiator,
disable_default_handling,
);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request_initiator = arg_request_initiator
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_disable_default_handling = arg_disable_default_handling
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_request,
arg_is_navigation,
arg_is_download,
arg_request_initiator,
arg_disable_default_handling,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_request_context_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_request_context_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RequestContextHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_request_context_handler_t> for &RequestContextHandler {
fn into_raw(self) -> *mut _cef_request_context_handler_t {
ImplRequestContextHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_request_context_handler_t> for &mut RequestContextHandler {
fn into_raw(self) -> *mut _cef_request_context_handler_t {
ImplRequestContextHandler::get_raw(self)
}
}
impl ConvertReturnValue<RequestContextHandler> for *mut _cef_request_context_handler_t {
fn wrap_result(self) -> RequestContextHandler {
RequestContextHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RequestContextHandler> for *mut _cef_request_context_handler_t {
fn from(value: RequestContextHandler) -> Self {
let object = ImplRequestContextHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_browser_process_handler_t`] for more documentation.
#[derive(Clone)]
pub struct BrowserProcessHandler(RefGuard<_cef_browser_process_handler_t>);
impl BrowserProcessHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapBrowserProcessHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplBrowserProcessHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapBrowserProcessHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_browser_process_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapBrowserProcessHandler: ImplBrowserProcessHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_browser_process_handler_t, Self>);
}
pub trait ImplBrowserProcessHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_browser_process_handler_t::on_register_custom_preferences`] for more documentation."]
fn on_register_custom_preferences(
&self,
type_: PreferencesType,
registrar: Option<&mut PreferenceRegistrar>,
) {
}
#[doc = "See [`_cef_browser_process_handler_t::on_context_initialized`] for more documentation."]
fn on_context_initialized(&self) {}
#[doc = "See [`_cef_browser_process_handler_t::on_before_child_process_launch`] for more documentation."]
fn on_before_child_process_launch(&self, command_line: Option<&mut CommandLine>) {}
#[doc = "See [`_cef_browser_process_handler_t::on_already_running_app_relaunch`] for more documentation."]
fn on_already_running_app_relaunch(
&self,
command_line: Option<&mut CommandLine>,
current_directory: Option<&CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_browser_process_handler_t::on_schedule_message_pump_work`] for more documentation."]
fn on_schedule_message_pump_work(&self, delay_ms: i64) {}
#[doc = "See [`_cef_browser_process_handler_t::get_default_client`] for more documentation."]
fn default_client(&self) -> Option<Client> {
Default::default()
}
#[doc = "See [`_cef_browser_process_handler_t::get_default_request_context_handler`] for more documentation."]
fn default_request_context_handler(&self) -> Option<RequestContextHandler> {
Default::default()
}
fn init_methods(object: &mut _cef_browser_process_handler_t) {
impl_cef_browser_process_handler_t::init_methods::<Self, _cef_browser_process_handler_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_browser_process_handler_t;
}
#[doc = "Implement the [`WrapBrowserProcessHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl BrowserProcessHandler` block you can override default\nmethods implemented by the [`ImplBrowserProcessHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_browser_process_handler! {\n struct MyBrowserProcessHandler {\n payload: String,\n }\n\n impl BrowserProcessHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> BrowserProcessHandler {\n MyBrowserProcessHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_browser_process_handler { ($ vis : vis struct $ name : ident ; impl BrowserProcessHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_browser_process_handler ! { $ vis struct $ name { } impl BrowserProcessHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl BrowserProcessHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_browser_process_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> BrowserProcessHandler { BrowserProcessHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapBrowserProcessHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_browser_process_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplBrowserProcessHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_browser_process_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_browser_process_handler_t {
use super::*;
pub fn init_methods<I: ImplBrowserProcessHandler, R: Rc>(
object: &mut _cef_browser_process_handler_t,
) {
object.on_register_custom_preferences = Some(on_register_custom_preferences::<I, R>);
object.on_context_initialized = Some(on_context_initialized::<I, R>);
object.on_before_child_process_launch = Some(on_before_child_process_launch::<I, R>);
object.on_already_running_app_relaunch = Some(on_already_running_app_relaunch::<I, R>);
object.on_schedule_message_pump_work = Some(on_schedule_message_pump_work::<I, R>);
object.get_default_client = Some(get_default_client::<I, R>);
object.get_default_request_context_handler =
Some(get_default_request_context_handler::<I, R>);
}
extern "C" fn on_register_custom_preferences<I: ImplBrowserProcessHandler, R: Rc>(
self_: *mut _cef_browser_process_handler_t,
type_: cef_preferences_type_t,
registrar: *mut _cef_preference_registrar_t,
) {
let (arg_self_, arg_type_, arg_registrar) = (self_, type_, registrar);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_type_ = arg_type_.into_raw();
let mut arg_registrar = if arg_registrar.is_null() {
None
} else {
Some(PreferenceRegistrar(arg_registrar))
};
let arg_registrar = arg_registrar.as_mut();
ImplBrowserProcessHandler::on_register_custom_preferences(
&arg_self_.interface,
arg_type_,
arg_registrar,
)
}
extern "C" fn on_context_initialized<I: ImplBrowserProcessHandler, R: Rc>(
self_: *mut _cef_browser_process_handler_t,
) {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplBrowserProcessHandler::on_context_initialized(&arg_self_.interface)
}
extern "C" fn on_before_child_process_launch<I: ImplBrowserProcessHandler, R: Rc>(
self_: *mut _cef_browser_process_handler_t,
command_line: *mut _cef_command_line_t,
) {
let (arg_self_, arg_command_line) = (self_, command_line);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_command_line = unsafe { arg_command_line.as_mut() }
.map(|arg| CommandLine(unsafe { RefGuard::from_raw(arg) }));
let arg_command_line = arg_command_line.as_mut();
ImplBrowserProcessHandler::on_before_child_process_launch(
&arg_self_.interface,
arg_command_line,
)
}
extern "C" fn on_already_running_app_relaunch<I: ImplBrowserProcessHandler, R: Rc>(
self_: *mut _cef_browser_process_handler_t,
command_line: *mut _cef_command_line_t,
current_directory: *const cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_command_line, arg_current_directory) =
(self_, command_line, current_directory);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_command_line = unsafe { arg_command_line.as_mut() }
.map(|arg| CommandLine(unsafe { RefGuard::from_raw(arg) }));
let arg_command_line = arg_command_line.as_mut();
let arg_current_directory = if arg_current_directory.is_null() {
None
} else {
Some(arg_current_directory.into())
};
let arg_current_directory = arg_current_directory.as_ref();
ImplBrowserProcessHandler::on_already_running_app_relaunch(
&arg_self_.interface,
arg_command_line,
arg_current_directory,
)
}
extern "C" fn on_schedule_message_pump_work<I: ImplBrowserProcessHandler, R: Rc>(
self_: *mut _cef_browser_process_handler_t,
delay_ms: i64,
) {
let (arg_self_, arg_delay_ms) = (self_, delay_ms);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_delay_ms = arg_delay_ms.into_raw();
ImplBrowserProcessHandler::on_schedule_message_pump_work(&arg_self_.interface, arg_delay_ms)
}
extern "C" fn get_default_client<I: ImplBrowserProcessHandler, R: Rc>(
self_: *mut _cef_browser_process_handler_t,
) -> *mut _cef_client_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplBrowserProcessHandler::default_client(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_default_request_context_handler<I: ImplBrowserProcessHandler, R: Rc>(
self_: *mut _cef_browser_process_handler_t,
) -> *mut _cef_request_context_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result =
ImplBrowserProcessHandler::default_request_context_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
}
impl ImplBrowserProcessHandler for BrowserProcessHandler {
fn on_register_custom_preferences(
&self,
type_: PreferencesType,
registrar: Option<&mut PreferenceRegistrar>,
) {
unsafe {
if let Some(f) = self.0.on_register_custom_preferences {
let (arg_type_, arg_registrar) = (type_, registrar);
let arg_self_ = self.into_raw();
let arg_type_ = arg_type_.into_raw();
let arg_registrar = arg_registrar
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_type_, arg_registrar);
}
}
}
fn on_context_initialized(&self) {
unsafe {
if let Some(f) = self.0.on_context_initialized {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn on_before_child_process_launch(&self, command_line: Option<&mut CommandLine>) {
unsafe {
if let Some(f) = self.0.on_before_child_process_launch {
let arg_command_line = command_line;
let arg_self_ = self.into_raw();
let arg_command_line = arg_command_line
.map(|arg| {
arg.add_ref();
ImplCommandLine::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_command_line);
}
}
}
fn on_already_running_app_relaunch(
&self,
command_line: Option<&mut CommandLine>,
current_directory: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_already_running_app_relaunch
.map(|f| {
let (arg_command_line, arg_current_directory) =
(command_line, current_directory);
let arg_self_ = self.into_raw();
let arg_command_line = arg_command_line
.map(|arg| {
arg.add_ref();
ImplCommandLine::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_current_directory = arg_current_directory
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_command_line, arg_current_directory);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_schedule_message_pump_work(&self, delay_ms: i64) {
unsafe {
if let Some(f) = self.0.on_schedule_message_pump_work {
let arg_delay_ms = delay_ms;
let arg_self_ = self.into_raw();
f(arg_self_, arg_delay_ms);
}
}
}
fn default_client(&self) -> Option<Client> {
unsafe {
self.0
.get_default_client
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn default_request_context_handler(&self) -> Option<RequestContextHandler> {
unsafe {
self.0
.get_default_request_context_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_browser_process_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_browser_process_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for BrowserProcessHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_browser_process_handler_t> for &BrowserProcessHandler {
fn into_raw(self) -> *mut _cef_browser_process_handler_t {
ImplBrowserProcessHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_browser_process_handler_t> for &mut BrowserProcessHandler {
fn into_raw(self) -> *mut _cef_browser_process_handler_t {
ImplBrowserProcessHandler::get_raw(self)
}
}
impl ConvertReturnValue<BrowserProcessHandler> for *mut _cef_browser_process_handler_t {
fn wrap_result(self) -> BrowserProcessHandler {
BrowserProcessHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BrowserProcessHandler> for *mut _cef_browser_process_handler_t {
fn from(value: BrowserProcessHandler) -> Self {
let object = ImplBrowserProcessHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_task_t`] for more documentation.
#[derive(Clone)]
pub struct Task(RefGuard<_cef_task_t>);
impl Task {
pub fn new<T>(interface: T) -> Self
where
T: WrapTask,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplTask>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapTask>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_task_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapTask: ImplTask {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_task_t, Self>);
}
pub trait ImplTask: Clone + Sized + Rc {
#[doc = "See [`_cef_task_t::execute`] for more documentation."]
fn execute(&self) {}
fn init_methods(object: &mut _cef_task_t) {
impl_cef_task_t::init_methods::<Self, _cef_task_t>(object);
}
fn get_raw(&self) -> *mut _cef_task_t;
}
#[doc = "Implement the [`WrapTask`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl Task` block you can override default\nmethods implemented by the [`ImplTask`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_task! {\n struct MyTask {\n payload: String,\n }\n\n impl Task {\n // ...\n }\n}\n\nfn make_my_struct() -> Task {\n MyTask::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_task { ($ vis : vis struct $ name : ident ; impl Task { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_task ! { $ vis struct $ name { } impl Task { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl Task { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_task_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> Task { Task :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapTask for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_task_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplTask for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_task_t { self . cef_object . cast () } } } ; }
mod impl_cef_task_t {
use super::*;
pub fn init_methods<I: ImplTask, R: Rc>(object: &mut _cef_task_t) {
object.execute = Some(execute::<I, R>);
}
extern "C" fn execute<I: ImplTask, R: Rc>(self_: *mut _cef_task_t) {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplTask::execute(&arg_self_.interface)
}
}
impl ImplTask for Task {
fn execute(&self) {
unsafe {
if let Some(f) = self.0.execute {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_task_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_task_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Task {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_task_t> for &Task {
fn into_raw(self) -> *mut _cef_task_t {
ImplTask::get_raw(self)
}
}
impl ConvertParam<*mut _cef_task_t> for &mut Task {
fn into_raw(self) -> *mut _cef_task_t {
ImplTask::get_raw(self)
}
}
impl ConvertReturnValue<Task> for *mut _cef_task_t {
fn wrap_result(self) -> Task {
Task(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Task> for *mut _cef_task_t {
fn from(value: Task) -> Self {
let object = ImplTask::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_task_runner_t`] for more documentation.
#[derive(Clone)]
pub struct TaskRunner(RefGuard<_cef_task_runner_t>);
pub trait ImplTaskRunner: Clone + Sized + Rc {
#[doc = "See [`_cef_task_runner_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut TaskRunner>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_task_runner_t::belongs_to_current_thread`] for more documentation."]
fn belongs_to_current_thread(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_task_runner_t::belongs_to_thread`] for more documentation."]
fn belongs_to_thread(&self, thread_id: ThreadId) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_task_runner_t::post_task`] for more documentation."]
fn post_task(&self, task: Option<&mut Task>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_task_runner_t::post_delayed_task`] for more documentation."]
fn post_delayed_task(&self, task: Option<&mut Task>, delay_ms: i64) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_task_runner_t;
}
impl ImplTaskRunner for TaskRunner {
fn is_same(&self, that: Option<&mut TaskRunner>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplTaskRunner::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn belongs_to_current_thread(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.belongs_to_current_thread
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn belongs_to_thread(&self, thread_id: ThreadId) -> ::std::os::raw::c_int {
unsafe {
self.0
.belongs_to_thread
.map(|f| {
let arg_thread_id = thread_id;
let arg_self_ = self.into_raw();
let arg_thread_id = arg_thread_id.into_raw();
let result = f(arg_self_, arg_thread_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn post_task(&self, task: Option<&mut Task>) -> ::std::os::raw::c_int {
unsafe {
self.0
.post_task
.map(|f| {
let arg_task = task;
let arg_self_ = self.into_raw();
let arg_task = arg_task
.map(|arg| {
arg.add_ref();
ImplTask::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_task);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn post_delayed_task(&self, task: Option<&mut Task>, delay_ms: i64) -> ::std::os::raw::c_int {
unsafe {
self.0
.post_delayed_task
.map(|f| {
let (arg_task, arg_delay_ms) = (task, delay_ms);
let arg_self_ = self.into_raw();
let arg_task = arg_task
.map(|arg| {
arg.add_ref();
ImplTask::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_task, arg_delay_ms);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_task_runner_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_task_runner_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for TaskRunner {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_task_runner_t> for &TaskRunner {
fn into_raw(self) -> *mut _cef_task_runner_t {
ImplTaskRunner::get_raw(self)
}
}
impl ConvertParam<*mut _cef_task_runner_t> for &mut TaskRunner {
fn into_raw(self) -> *mut _cef_task_runner_t {
ImplTaskRunner::get_raw(self)
}
}
impl ConvertReturnValue<TaskRunner> for *mut _cef_task_runner_t {
fn wrap_result(self) -> TaskRunner {
TaskRunner(unsafe { RefGuard::from_raw(self) })
}
}
impl From<TaskRunner> for *mut _cef_task_runner_t {
fn from(value: TaskRunner) -> Self {
let object = ImplTaskRunner::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_context_t`] for more documentation.
#[derive(Clone)]
pub struct V8Context(RefGuard<_cef_v8_context_t>);
pub trait ImplV8Context: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_context_t::get_task_runner`] for more documentation."]
fn task_runner(&self) -> Option<TaskRunner>;
#[doc = "See [`_cef_v8_context_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_context_t::get_browser`] for more documentation."]
fn browser(&self) -> Option<Browser>;
#[doc = "See [`_cef_v8_context_t::get_frame`] for more documentation."]
fn frame(&self) -> Option<Frame>;
#[doc = "See [`_cef_v8_context_t::get_global`] for more documentation."]
fn global(&self) -> Option<V8Value>;
#[doc = "See [`_cef_v8_context_t::enter`] for more documentation."]
fn enter(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_context_t::exit`] for more documentation."]
fn exit(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_context_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut V8Context>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_context_t::eval`] for more documentation."]
fn eval(
&self,
code: Option<&CefString>,
script_url: Option<&CefString>,
start_line: ::std::os::raw::c_int,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut Option<V8Exception>>,
) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_v8_context_t;
}
impl ImplV8Context for V8Context {
fn task_runner(&self) -> Option<TaskRunner> {
unsafe {
self.0
.get_task_runner
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn browser(&self) -> Option<Browser> {
unsafe {
self.0
.get_browser
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn frame(&self) -> Option<Frame> {
unsafe {
self.0
.get_frame
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn global(&self) -> Option<V8Value> {
unsafe {
self.0
.get_global
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn enter(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.enter
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn exit(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.exit
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut V8Context>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplV8Context::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn eval(
&self,
code: Option<&CefString>,
script_url: Option<&CefString>,
start_line: ::std::os::raw::c_int,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut Option<V8Exception>>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.eval
.map(|f| {
let (arg_code, arg_script_url, arg_start_line, arg_retval, arg_exception) =
(code, script_url, start_line, retval, exception);
let arg_self_ = self.into_raw();
let arg_code = arg_code
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_script_url = arg_script_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let out_retval = arg_retval;
let mut ptr = std::ptr::null_mut();
let (out_retval, arg_retval) = out_retval
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let out_exception = arg_exception;
let mut ptr = std::ptr::null_mut();
let (out_exception, arg_exception) = out_exception
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let result = f(
arg_self_,
arg_code,
arg_script_url,
arg_start_line,
arg_retval,
arg_exception,
);
if let (Some(out_retval), Some(arg_retval)) = (out_retval, arg_retval.as_ref())
{
*out_retval = arg_retval
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
if let (Some(out_exception), Some(arg_exception)) =
(out_exception, arg_exception.as_ref())
{
*out_exception = arg_exception
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_context_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_context_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8Context {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_context_t> for &V8Context {
fn into_raw(self) -> *mut _cef_v8_context_t {
ImplV8Context::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_context_t> for &mut V8Context {
fn into_raw(self) -> *mut _cef_v8_context_t {
ImplV8Context::get_raw(self)
}
}
impl ConvertReturnValue<V8Context> for *mut _cef_v8_context_t {
fn wrap_result(self) -> V8Context {
V8Context(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8Context> for *mut _cef_v8_context_t {
fn from(value: V8Context) -> Self {
let object = ImplV8Context::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_handler_t`] for more documentation.
#[derive(Clone)]
pub struct V8Handler(RefGuard<_cef_v8_handler_t>);
impl V8Handler {
pub fn new<T>(interface: T) -> Self
where
T: WrapV8Handler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplV8Handler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapV8Handler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_v8_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapV8Handler: ImplV8Handler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_v8_handler_t, Self>);
}
pub trait ImplV8Handler: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_handler_t::execute`] for more documentation."]
fn execute(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
arguments: Option<&[Option<V8Value>]>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_v8_handler_t) {
impl_cef_v8_handler_t::init_methods::<Self, _cef_v8_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_v8_handler_t;
}
#[doc = "Implement the [`WrapV8Handler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl V8Handler` block you can override default\nmethods implemented by the [`ImplV8Handler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_v8_handler! {\n struct MyV8Handler {\n payload: String,\n }\n\n impl V8Handler {\n // ...\n }\n}\n\nfn make_my_struct() -> V8Handler {\n MyV8Handler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_v8_handler { ($ vis : vis struct $ name : ident ; impl V8Handler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_v8_handler ! { $ vis struct $ name { } impl V8Handler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl V8Handler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> V8Handler { V8Handler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapV8Handler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplV8Handler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_v8_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_v8_handler_t {
use super::*;
pub fn init_methods<I: ImplV8Handler, R: Rc>(object: &mut _cef_v8_handler_t) {
object.execute = Some(execute::<I, R>);
}
extern "C" fn execute<I: ImplV8Handler, R: Rc>(
self_: *mut _cef_v8_handler_t,
name: *const cef_string_t,
object: *mut _cef_v8_value_t,
arguments_count: usize,
arguments: *const *mut _cef_v8_value_t,
retval: *mut *mut _cef_v8_value_t,
exception: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (
arg_self_,
arg_name,
arg_object,
arg_arguments_count,
arg_arguments,
arg_retval,
arg_exception,
) = (
self_,
name,
object,
arguments_count,
arguments,
retval,
exception,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_name = if arg_name.is_null() {
None
} else {
Some(arg_name.into())
};
let arg_name = arg_name.as_ref();
let mut arg_object =
unsafe { arg_object.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_object = arg_object.as_mut();
let vec_arguments = unsafe { arg_arguments.as_ref() }.map(|arg| {
let arg =
unsafe { std::slice::from_raw_parts(std::ptr::from_ref(arg), arg_arguments_count) };
arg.iter()
.map(|arg| {
if arg.is_null() {
None
} else {
Some(V8Value(unsafe { RefGuard::from_raw(*arg) }))
}
})
.collect::<Vec<_>>()
});
let arg_arguments = vec_arguments.as_deref();
let out_retval = arg_retval;
let mut wrap_retval = unsafe { arg_retval.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(V8Value(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_retval = Some(&mut wrap_retval);
let mut arg_exception = if arg_exception.is_null() {
None
} else {
Some(arg_exception.into())
};
let arg_exception = arg_exception.as_mut();
let result = ImplV8Handler::execute(
&arg_self_.interface,
arg_name,
arg_object,
arg_arguments,
arg_retval,
arg_exception,
);
if let (Some(out_retval), Some(wrap_retval)) = (unsafe { out_retval.as_mut() }, wrap_retval)
{
*out_retval = wrap_retval.wrap_result();
}
result
}
}
impl ImplV8Handler for V8Handler {
fn execute(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
arguments: Option<&[Option<V8Value>]>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.execute
.map(|f| {
let (arg_name, arg_object, arg_arguments, arg_retval, arg_exception) =
(name, object, arguments, retval, exception);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_arguments_count = arg_arguments
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_arguments = arg_arguments
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_arguments = if vec_arguments.is_empty() {
std::ptr::null()
} else {
vec_arguments.as_ptr()
};
let out_retval = arg_retval;
let mut ptr = std::ptr::null_mut();
let (out_retval, arg_retval) = out_retval
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let arg_exception = arg_exception
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_name,
arg_object,
arg_arguments_count,
arg_arguments,
arg_retval,
arg_exception,
);
if let (Some(out_retval), Some(arg_retval)) = (out_retval, arg_retval.as_ref())
{
*out_retval = arg_retval
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8Handler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_handler_t> for &V8Handler {
fn into_raw(self) -> *mut _cef_v8_handler_t {
ImplV8Handler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_handler_t> for &mut V8Handler {
fn into_raw(self) -> *mut _cef_v8_handler_t {
ImplV8Handler::get_raw(self)
}
}
impl ConvertReturnValue<V8Handler> for *mut _cef_v8_handler_t {
fn wrap_result(self) -> V8Handler {
V8Handler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8Handler> for *mut _cef_v8_handler_t {
fn from(value: V8Handler) -> Self {
let object = ImplV8Handler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_accessor_t`] for more documentation.
#[derive(Clone)]
pub struct V8Accessor(RefGuard<_cef_v8_accessor_t>);
impl V8Accessor {
pub fn new<T>(interface: T) -> Self
where
T: WrapV8Accessor,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplV8Accessor>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapV8Accessor>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_v8_accessor_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapV8Accessor: ImplV8Accessor {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_v8_accessor_t, Self>);
}
pub trait ImplV8Accessor: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_accessor_t::get`] for more documentation."]
fn get(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_v8_accessor_t::set`] for more documentation."]
fn set(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
value: Option<&mut V8Value>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_v8_accessor_t) {
impl_cef_v8_accessor_t::init_methods::<Self, _cef_v8_accessor_t>(object);
}
fn get_raw(&self) -> *mut _cef_v8_accessor_t;
}
#[doc = "Implement the [`WrapV8Accessor`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl V8Accessor` block you can override default\nmethods implemented by the [`ImplV8Accessor`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_v8_accessor! {\n struct MyV8Accessor {\n payload: String,\n }\n\n impl V8Accessor {\n // ...\n }\n}\n\nfn make_my_struct() -> V8Accessor {\n MyV8Accessor::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_v8_accessor { ($ vis : vis struct $ name : ident ; impl V8Accessor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_v8_accessor ! { $ vis struct $ name { } impl V8Accessor { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl V8Accessor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_accessor_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> V8Accessor { V8Accessor :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapV8Accessor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_accessor_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplV8Accessor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_v8_accessor_t { self . cef_object . cast () } } } ; }
mod impl_cef_v8_accessor_t {
use super::*;
pub fn init_methods<I: ImplV8Accessor, R: Rc>(object: &mut _cef_v8_accessor_t) {
object.get = Some(get::<I, R>);
object.set = Some(set::<I, R>);
}
extern "C" fn get<I: ImplV8Accessor, R: Rc>(
self_: *mut _cef_v8_accessor_t,
name: *const cef_string_t,
object: *mut _cef_v8_value_t,
retval: *mut *mut _cef_v8_value_t,
exception: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_name, arg_object, arg_retval, arg_exception) =
(self_, name, object, retval, exception);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_name = if arg_name.is_null() {
None
} else {
Some(arg_name.into())
};
let arg_name = arg_name.as_ref();
let mut arg_object =
unsafe { arg_object.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_object = arg_object.as_mut();
let out_retval = arg_retval;
let mut wrap_retval = unsafe { arg_retval.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(V8Value(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_retval = Some(&mut wrap_retval);
let mut arg_exception = if arg_exception.is_null() {
None
} else {
Some(arg_exception.into())
};
let arg_exception = arg_exception.as_mut();
let result = ImplV8Accessor::get(
&arg_self_.interface,
arg_name,
arg_object,
arg_retval,
arg_exception,
);
if let (Some(out_retval), Some(wrap_retval)) = (unsafe { out_retval.as_mut() }, wrap_retval)
{
*out_retval = wrap_retval.wrap_result();
}
result
}
extern "C" fn set<I: ImplV8Accessor, R: Rc>(
self_: *mut _cef_v8_accessor_t,
name: *const cef_string_t,
object: *mut _cef_v8_value_t,
value: *mut _cef_v8_value_t,
exception: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_name, arg_object, arg_value, arg_exception) =
(self_, name, object, value, exception);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_name = if arg_name.is_null() {
None
} else {
Some(arg_name.into())
};
let arg_name = arg_name.as_ref();
let mut arg_object =
unsafe { arg_object.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_object = arg_object.as_mut();
let mut arg_value =
unsafe { arg_value.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_value = arg_value.as_mut();
let mut arg_exception = if arg_exception.is_null() {
None
} else {
Some(arg_exception.into())
};
let arg_exception = arg_exception.as_mut();
ImplV8Accessor::set(
&arg_self_.interface,
arg_name,
arg_object,
arg_value,
arg_exception,
)
}
}
impl ImplV8Accessor for V8Accessor {
fn get(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get
.map(|f| {
let (arg_name, arg_object, arg_retval, arg_exception) =
(name, object, retval, exception);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let out_retval = arg_retval;
let mut ptr = std::ptr::null_mut();
let (out_retval, arg_retval) = out_retval
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let arg_exception = arg_exception
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_name, arg_object, arg_retval, arg_exception);
if let (Some(out_retval), Some(arg_retval)) = (out_retval, arg_retval.as_ref())
{
*out_retval = arg_retval
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
value: Option<&mut V8Value>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set
.map(|f| {
let (arg_name, arg_object, arg_value, arg_exception) =
(name, object, value, exception);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_exception = arg_exception
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_name, arg_object, arg_value, arg_exception);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_accessor_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_accessor_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8Accessor {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_accessor_t> for &V8Accessor {
fn into_raw(self) -> *mut _cef_v8_accessor_t {
ImplV8Accessor::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_accessor_t> for &mut V8Accessor {
fn into_raw(self) -> *mut _cef_v8_accessor_t {
ImplV8Accessor::get_raw(self)
}
}
impl ConvertReturnValue<V8Accessor> for *mut _cef_v8_accessor_t {
fn wrap_result(self) -> V8Accessor {
V8Accessor(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8Accessor> for *mut _cef_v8_accessor_t {
fn from(value: V8Accessor) -> Self {
let object = ImplV8Accessor::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_interceptor_t`] for more documentation.
#[derive(Clone)]
pub struct V8Interceptor(RefGuard<_cef_v8_interceptor_t>);
impl V8Interceptor {
pub fn new<T>(interface: T) -> Self
where
T: WrapV8Interceptor,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplV8Interceptor>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapV8Interceptor>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_v8_interceptor_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapV8Interceptor: ImplV8Interceptor {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_v8_interceptor_t, Self>);
}
pub trait ImplV8Interceptor: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_interceptor_t::get_byname`] for more documentation."]
fn byname(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_v8_interceptor_t::get_byindex`] for more documentation."]
fn byindex(
&self,
index: ::std::os::raw::c_int,
object: Option<&mut V8Value>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_v8_interceptor_t::set_byname`] for more documentation."]
fn set_byname(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
value: Option<&mut V8Value>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_v8_interceptor_t::set_byindex`] for more documentation."]
fn set_byindex(
&self,
index: ::std::os::raw::c_int,
object: Option<&mut V8Value>,
value: Option<&mut V8Value>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_v8_interceptor_t) {
impl_cef_v8_interceptor_t::init_methods::<Self, _cef_v8_interceptor_t>(object);
}
fn get_raw(&self) -> *mut _cef_v8_interceptor_t;
}
#[doc = "Implement the [`WrapV8Interceptor`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl V8Interceptor` block you can override default\nmethods implemented by the [`ImplV8Interceptor`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_v8_interceptor! {\n struct MyV8Interceptor {\n payload: String,\n }\n\n impl V8Interceptor {\n // ...\n }\n}\n\nfn make_my_struct() -> V8Interceptor {\n MyV8Interceptor::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_v8_interceptor { ($ vis : vis struct $ name : ident ; impl V8Interceptor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_v8_interceptor ! { $ vis struct $ name { } impl V8Interceptor { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl V8Interceptor { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_interceptor_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> V8Interceptor { V8Interceptor :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapV8Interceptor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_interceptor_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplV8Interceptor for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_v8_interceptor_t { self . cef_object . cast () } } } ; }
mod impl_cef_v8_interceptor_t {
use super::*;
pub fn init_methods<I: ImplV8Interceptor, R: Rc>(object: &mut _cef_v8_interceptor_t) {
object.get_byname = Some(get_byname::<I, R>);
object.get_byindex = Some(get_byindex::<I, R>);
object.set_byname = Some(set_byname::<I, R>);
object.set_byindex = Some(set_byindex::<I, R>);
}
extern "C" fn get_byname<I: ImplV8Interceptor, R: Rc>(
self_: *mut _cef_v8_interceptor_t,
name: *const cef_string_t,
object: *mut _cef_v8_value_t,
retval: *mut *mut _cef_v8_value_t,
exception: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_name, arg_object, arg_retval, arg_exception) =
(self_, name, object, retval, exception);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_name = if arg_name.is_null() {
None
} else {
Some(arg_name.into())
};
let arg_name = arg_name.as_ref();
let mut arg_object =
unsafe { arg_object.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_object = arg_object.as_mut();
let out_retval = arg_retval;
let mut wrap_retval = unsafe { arg_retval.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(V8Value(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_retval = Some(&mut wrap_retval);
let mut arg_exception = if arg_exception.is_null() {
None
} else {
Some(arg_exception.into())
};
let arg_exception = arg_exception.as_mut();
let result = ImplV8Interceptor::byname(
&arg_self_.interface,
arg_name,
arg_object,
arg_retval,
arg_exception,
);
if let (Some(out_retval), Some(wrap_retval)) = (unsafe { out_retval.as_mut() }, wrap_retval)
{
*out_retval = wrap_retval.wrap_result();
}
result
}
extern "C" fn get_byindex<I: ImplV8Interceptor, R: Rc>(
self_: *mut _cef_v8_interceptor_t,
index: ::std::os::raw::c_int,
object: *mut _cef_v8_value_t,
retval: *mut *mut _cef_v8_value_t,
exception: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_index, arg_object, arg_retval, arg_exception) =
(self_, index, object, retval, exception);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_index = arg_index.into_raw();
let mut arg_object =
unsafe { arg_object.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_object = arg_object.as_mut();
let out_retval = arg_retval;
let mut wrap_retval = unsafe { arg_retval.as_mut() }.and_then(|ptr| {
if ptr.is_null() {
None
} else {
Some(V8Value(unsafe { RefGuard::from_raw(*ptr) }))
}
});
let arg_retval = Some(&mut wrap_retval);
let mut arg_exception = if arg_exception.is_null() {
None
} else {
Some(arg_exception.into())
};
let arg_exception = arg_exception.as_mut();
let result = ImplV8Interceptor::byindex(
&arg_self_.interface,
arg_index,
arg_object,
arg_retval,
arg_exception,
);
if let (Some(out_retval), Some(wrap_retval)) = (unsafe { out_retval.as_mut() }, wrap_retval)
{
*out_retval = wrap_retval.wrap_result();
}
result
}
extern "C" fn set_byname<I: ImplV8Interceptor, R: Rc>(
self_: *mut _cef_v8_interceptor_t,
name: *const cef_string_t,
object: *mut _cef_v8_value_t,
value: *mut _cef_v8_value_t,
exception: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_name, arg_object, arg_value, arg_exception) =
(self_, name, object, value, exception);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_name = if arg_name.is_null() {
None
} else {
Some(arg_name.into())
};
let arg_name = arg_name.as_ref();
let mut arg_object =
unsafe { arg_object.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_object = arg_object.as_mut();
let mut arg_value =
unsafe { arg_value.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_value = arg_value.as_mut();
let mut arg_exception = if arg_exception.is_null() {
None
} else {
Some(arg_exception.into())
};
let arg_exception = arg_exception.as_mut();
ImplV8Interceptor::set_byname(
&arg_self_.interface,
arg_name,
arg_object,
arg_value,
arg_exception,
)
}
extern "C" fn set_byindex<I: ImplV8Interceptor, R: Rc>(
self_: *mut _cef_v8_interceptor_t,
index: ::std::os::raw::c_int,
object: *mut _cef_v8_value_t,
value: *mut _cef_v8_value_t,
exception: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_index, arg_object, arg_value, arg_exception) =
(self_, index, object, value, exception);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_index = arg_index.into_raw();
let mut arg_object =
unsafe { arg_object.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_object = arg_object.as_mut();
let mut arg_value =
unsafe { arg_value.as_mut() }.map(|arg| V8Value(unsafe { RefGuard::from_raw(arg) }));
let arg_value = arg_value.as_mut();
let mut arg_exception = if arg_exception.is_null() {
None
} else {
Some(arg_exception.into())
};
let arg_exception = arg_exception.as_mut();
ImplV8Interceptor::set_byindex(
&arg_self_.interface,
arg_index,
arg_object,
arg_value,
arg_exception,
)
}
}
impl ImplV8Interceptor for V8Interceptor {
fn byname(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_byname
.map(|f| {
let (arg_name, arg_object, arg_retval, arg_exception) =
(name, object, retval, exception);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let out_retval = arg_retval;
let mut ptr = std::ptr::null_mut();
let (out_retval, arg_retval) = out_retval
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let arg_exception = arg_exception
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_name, arg_object, arg_retval, arg_exception);
if let (Some(out_retval), Some(arg_retval)) = (out_retval, arg_retval.as_ref())
{
*out_retval = arg_retval
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn byindex(
&self,
index: ::std::os::raw::c_int,
object: Option<&mut V8Value>,
retval: Option<&mut Option<V8Value>>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_byindex
.map(|f| {
let (arg_index, arg_object, arg_retval, arg_exception) =
(index, object, retval, exception);
let arg_self_ = self.into_raw();
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let out_retval = arg_retval;
let mut ptr = std::ptr::null_mut();
let (out_retval, arg_retval) = out_retval
.map(|arg| {
if let Some(arg) = arg.as_mut() {
arg.add_ref();
ptr = arg.get_raw();
}
(Some(arg), std::ptr::from_mut(&mut ptr))
})
.unwrap_or((None, std::ptr::null_mut()));
let arg_exception = arg_exception
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_object, arg_retval, arg_exception);
if let (Some(out_retval), Some(arg_retval)) = (out_retval, arg_retval.as_ref())
{
*out_retval = arg_retval
.as_mut()
.map(|arg| std::ptr::from_mut(arg).wrap_result());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_byname(
&self,
name: Option<&CefString>,
object: Option<&mut V8Value>,
value: Option<&mut V8Value>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_byname
.map(|f| {
let (arg_name, arg_object, arg_value, arg_exception) =
(name, object, value, exception);
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_exception = arg_exception
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_name, arg_object, arg_value, arg_exception);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_byindex(
&self,
index: ::std::os::raw::c_int,
object: Option<&mut V8Value>,
value: Option<&mut V8Value>,
exception: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_byindex
.map(|f| {
let (arg_index, arg_object, arg_value, arg_exception) =
(index, object, value, exception);
let arg_self_ = self.into_raw();
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_exception = arg_exception
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_object, arg_value, arg_exception);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_interceptor_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_interceptor_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8Interceptor {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_interceptor_t> for &V8Interceptor {
fn into_raw(self) -> *mut _cef_v8_interceptor_t {
ImplV8Interceptor::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_interceptor_t> for &mut V8Interceptor {
fn into_raw(self) -> *mut _cef_v8_interceptor_t {
ImplV8Interceptor::get_raw(self)
}
}
impl ConvertReturnValue<V8Interceptor> for *mut _cef_v8_interceptor_t {
fn wrap_result(self) -> V8Interceptor {
V8Interceptor(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8Interceptor> for *mut _cef_v8_interceptor_t {
fn from(value: V8Interceptor) -> Self {
let object = ImplV8Interceptor::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_exception_t`] for more documentation.
#[derive(Clone)]
pub struct V8Exception(RefGuard<_cef_v8_exception_t>);
pub trait ImplV8Exception: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_exception_t::get_message`] for more documentation."]
fn message(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_exception_t::get_source_line`] for more documentation."]
fn source_line(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_exception_t::get_script_resource_name`] for more documentation."]
fn script_resource_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_exception_t::get_line_number`] for more documentation."]
fn line_number(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_exception_t::get_start_position`] for more documentation."]
fn start_position(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_exception_t::get_end_position`] for more documentation."]
fn end_position(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_exception_t::get_start_column`] for more documentation."]
fn start_column(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_exception_t::get_end_column`] for more documentation."]
fn end_column(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_v8_exception_t;
}
impl ImplV8Exception for V8Exception {
fn message(&self) -> CefStringUserfree {
unsafe {
self.0
.get_message
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn source_line(&self) -> CefStringUserfree {
unsafe {
self.0
.get_source_line
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn script_resource_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_script_resource_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn line_number(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_line_number
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn start_position(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_start_position
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn end_position(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_end_position
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn start_column(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_start_column
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn end_column(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_end_column
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_exception_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_exception_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8Exception {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_exception_t> for &V8Exception {
fn into_raw(self) -> *mut _cef_v8_exception_t {
ImplV8Exception::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_exception_t> for &mut V8Exception {
fn into_raw(self) -> *mut _cef_v8_exception_t {
ImplV8Exception::get_raw(self)
}
}
impl ConvertReturnValue<V8Exception> for *mut _cef_v8_exception_t {
fn wrap_result(self) -> V8Exception {
V8Exception(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8Exception> for *mut _cef_v8_exception_t {
fn from(value: V8Exception) -> Self {
let object = ImplV8Exception::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_array_buffer_release_callback_t`] for more documentation.
#[derive(Clone)]
pub struct V8ArrayBufferReleaseCallback(RefGuard<_cef_v8_array_buffer_release_callback_t>);
impl V8ArrayBufferReleaseCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapV8ArrayBufferReleaseCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplV8ArrayBufferReleaseCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapV8ArrayBufferReleaseCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_v8_array_buffer_release_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapV8ArrayBufferReleaseCallback: ImplV8ArrayBufferReleaseCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_v8_array_buffer_release_callback_t, Self>);
}
pub trait ImplV8ArrayBufferReleaseCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_array_buffer_release_callback_t::release_buffer`] for more documentation."]
fn release_buffer(&self, buffer: *mut u8) {}
fn init_methods(object: &mut _cef_v8_array_buffer_release_callback_t) {
impl_cef_v8_array_buffer_release_callback_t::init_methods::<
Self,
_cef_v8_array_buffer_release_callback_t,
>(object);
}
fn get_raw(&self) -> *mut _cef_v8_array_buffer_release_callback_t;
}
#[doc = "Implement the [`WrapV8ArrayBufferReleaseCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl V8ArrayBufferReleaseCallback` block you can override default\nmethods implemented by the [`ImplV8ArrayBufferReleaseCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_v8_array_buffer_release_callback! {\n struct MyV8ArrayBufferReleaseCallback {\n payload: String,\n }\n\n impl V8ArrayBufferReleaseCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> V8ArrayBufferReleaseCallback {\n MyV8ArrayBufferReleaseCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_v8_array_buffer_release_callback { ($ vis : vis struct $ name : ident ; impl V8ArrayBufferReleaseCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_v8_array_buffer_release_callback ! { $ vis struct $ name { } impl V8ArrayBufferReleaseCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl V8ArrayBufferReleaseCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_array_buffer_release_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> V8ArrayBufferReleaseCallback { V8ArrayBufferReleaseCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapV8ArrayBufferReleaseCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_v8_array_buffer_release_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplV8ArrayBufferReleaseCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_v8_array_buffer_release_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_v8_array_buffer_release_callback_t {
use super::*;
pub fn init_methods<I: ImplV8ArrayBufferReleaseCallback, R: Rc>(
object: &mut _cef_v8_array_buffer_release_callback_t,
) {
object.release_buffer = Some(release_buffer::<I, R>);
}
extern "C" fn release_buffer<I: ImplV8ArrayBufferReleaseCallback, R: Rc>(
self_: *mut _cef_v8_array_buffer_release_callback_t,
buffer: *mut ::std::os::raw::c_void,
) {
let (arg_self_, arg_buffer) = (self_, buffer);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_buffer = arg_buffer.cast();
ImplV8ArrayBufferReleaseCallback::release_buffer(&arg_self_.interface, arg_buffer)
}
}
impl ImplV8ArrayBufferReleaseCallback for V8ArrayBufferReleaseCallback {
fn release_buffer(&self, buffer: *mut u8) {
unsafe {
if let Some(f) = self.0.release_buffer {
let arg_buffer = buffer;
let arg_self_ = self.into_raw();
let arg_buffer = arg_buffer.cast();
f(arg_self_, arg_buffer);
}
}
}
fn get_raw(&self) -> *mut _cef_v8_array_buffer_release_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_array_buffer_release_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8ArrayBufferReleaseCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_array_buffer_release_callback_t> for &V8ArrayBufferReleaseCallback {
fn into_raw(self) -> *mut _cef_v8_array_buffer_release_callback_t {
ImplV8ArrayBufferReleaseCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_array_buffer_release_callback_t>
for &mut V8ArrayBufferReleaseCallback
{
fn into_raw(self) -> *mut _cef_v8_array_buffer_release_callback_t {
ImplV8ArrayBufferReleaseCallback::get_raw(self)
}
}
impl ConvertReturnValue<V8ArrayBufferReleaseCallback>
for *mut _cef_v8_array_buffer_release_callback_t
{
fn wrap_result(self) -> V8ArrayBufferReleaseCallback {
V8ArrayBufferReleaseCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8ArrayBufferReleaseCallback> for *mut _cef_v8_array_buffer_release_callback_t {
fn from(value: V8ArrayBufferReleaseCallback) -> Self {
let object = ImplV8ArrayBufferReleaseCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_backing_store_t`] for more documentation.
#[derive(Clone)]
pub struct V8BackingStore(RefGuard<_cef_v8_backing_store_t>);
pub trait ImplV8BackingStore: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_backing_store_t::data`] for more documentation."]
fn data(&self) -> *mut ::std::os::raw::c_void;
#[doc = "See [`_cef_v8_backing_store_t::byte_length`] for more documentation."]
fn byte_length(&self) -> usize;
#[doc = "See [`_cef_v8_backing_store_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_v8_backing_store_t;
}
impl ImplV8BackingStore for V8BackingStore {
fn data(&self) -> *mut ::std::os::raw::c_void {
unsafe {
self.0
.data
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_else(|| std::mem::zeroed())
}
}
fn byte_length(&self) -> usize {
unsafe {
self.0
.byte_length
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_backing_store_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_backing_store_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8BackingStore {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_backing_store_t> for &V8BackingStore {
fn into_raw(self) -> *mut _cef_v8_backing_store_t {
ImplV8BackingStore::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_backing_store_t> for &mut V8BackingStore {
fn into_raw(self) -> *mut _cef_v8_backing_store_t {
ImplV8BackingStore::get_raw(self)
}
}
impl ConvertReturnValue<V8BackingStore> for *mut _cef_v8_backing_store_t {
fn wrap_result(self) -> V8BackingStore {
V8BackingStore(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8BackingStore> for *mut _cef_v8_backing_store_t {
fn from(value: V8BackingStore) -> Self {
let object = ImplV8BackingStore::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_value_t`] for more documentation.
#[derive(Clone)]
pub struct V8Value(RefGuard<_cef_v8_value_t>);
pub trait ImplV8Value: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_value_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_undefined`] for more documentation."]
fn is_undefined(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_null`] for more documentation."]
fn is_null(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_bool`] for more documentation."]
fn is_bool(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_int`] for more documentation."]
fn is_int(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_uint`] for more documentation."]
fn is_uint(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_double`] for more documentation."]
fn is_double(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_date`] for more documentation."]
fn is_date(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_string`] for more documentation."]
fn is_string(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_object`] for more documentation."]
fn is_object(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_array`] for more documentation."]
fn is_array(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_array_buffer`] for more documentation."]
fn is_array_buffer(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_function`] for more documentation."]
fn is_function(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_promise`] for more documentation."]
fn is_promise(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut V8Value>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_bool_value`] for more documentation."]
fn bool_value(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_int_value`] for more documentation."]
fn int_value(&self) -> i32;
#[doc = "See [`_cef_v8_value_t::get_uint_value`] for more documentation."]
fn uint_value(&self) -> u32;
#[doc = "See [`_cef_v8_value_t::get_double_value`] for more documentation."]
fn double_value(&self) -> f64;
#[doc = "See [`_cef_v8_value_t::get_date_value`] for more documentation."]
fn date_value(&self) -> Basetime;
#[doc = "See [`_cef_v8_value_t::get_string_value`] for more documentation."]
fn string_value(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_value_t::is_user_created`] for more documentation."]
fn is_user_created(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::has_exception`] for more documentation."]
fn has_exception(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_exception`] for more documentation."]
fn exception(&self) -> Option<V8Exception>;
#[doc = "See [`_cef_v8_value_t::clear_exception`] for more documentation."]
fn clear_exception(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::will_rethrow_exceptions`] for more documentation."]
fn will_rethrow_exceptions(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::set_rethrow_exceptions`] for more documentation."]
fn set_rethrow_exceptions(&self, rethrow: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::has_value_bykey`] for more documentation."]
fn has_value_bykey(&self, key: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::has_value_byindex`] for more documentation."]
fn has_value_byindex(&self, index: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::delete_value_bykey`] for more documentation."]
fn delete_value_bykey(&self, key: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::delete_value_byindex`] for more documentation."]
fn delete_value_byindex(&self, index: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_value_bykey`] for more documentation."]
fn value_bykey(&self, key: Option<&CefString>) -> Option<V8Value>;
#[doc = "See [`_cef_v8_value_t::get_value_byindex`] for more documentation."]
fn value_byindex(&self, index: ::std::os::raw::c_int) -> Option<V8Value>;
#[doc = "See [`_cef_v8_value_t::set_value_bykey`] for more documentation."]
fn set_value_bykey(
&self,
key: Option<&CefString>,
value: Option<&mut V8Value>,
attribute: V8Propertyattribute,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::set_value_byindex`] for more documentation."]
fn set_value_byindex(
&self,
index: ::std::os::raw::c_int,
value: Option<&mut V8Value>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::set_value_byaccessor`] for more documentation."]
fn set_value_byaccessor(
&self,
key: Option<&CefString>,
attribute: V8Propertyattribute,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_keys`] for more documentation."]
fn keys(&self, keys: Option<&mut CefStringList>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::set_user_data`] for more documentation."]
fn set_user_data(&self, user_data: Option<&mut BaseRefCounted>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_user_data`] for more documentation."]
fn user_data(&self) -> Option<BaseRefCounted>;
#[doc = "See [`_cef_v8_value_t::get_externally_allocated_memory`] for more documentation."]
fn externally_allocated_memory(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::adjust_externally_allocated_memory`] for more documentation."]
fn adjust_externally_allocated_memory(
&self,
change_in_bytes: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_array_length`] for more documentation."]
fn array_length(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_array_buffer_release_callback`] for more documentation."]
fn array_buffer_release_callback(&self) -> Option<V8ArrayBufferReleaseCallback>;
#[doc = "See [`_cef_v8_value_t::neuter_array_buffer`] for more documentation."]
fn neuter_array_buffer(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::get_array_buffer_byte_length`] for more documentation."]
fn array_buffer_byte_length(&self) -> usize;
#[doc = "See [`_cef_v8_value_t::get_array_buffer_data`] for more documentation."]
fn array_buffer_data(&self) -> *mut ::std::os::raw::c_void;
#[doc = "See [`_cef_v8_value_t::get_function_name`] for more documentation."]
fn function_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_value_t::get_function_handler`] for more documentation."]
fn function_handler(&self) -> Option<V8Handler>;
#[doc = "See [`_cef_v8_value_t::execute_function`] for more documentation."]
fn execute_function(
&self,
object: Option<&mut V8Value>,
arguments: Option<&[Option<V8Value>]>,
) -> Option<V8Value>;
#[doc = "See [`_cef_v8_value_t::execute_function_with_context`] for more documentation."]
fn execute_function_with_context(
&self,
context: Option<&mut V8Context>,
object: Option<&mut V8Value>,
arguments: Option<&[Option<V8Value>]>,
) -> Option<V8Value>;
#[doc = "See [`_cef_v8_value_t::resolve_promise`] for more documentation."]
fn resolve_promise(&self, arg: Option<&mut V8Value>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_value_t::reject_promise`] for more documentation."]
fn reject_promise(&self, error_msg: Option<&CefString>) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_v8_value_t;
}
impl ImplV8Value for V8Value {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_undefined(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_undefined
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_null(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_null
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_bool(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_bool
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_int(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_int
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_uint(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_uint
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_double(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_double
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_date(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_date
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_string(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_string
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_object(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_object
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_array(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_array
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_array_buffer(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_array_buffer
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_function(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_function
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_promise(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_promise
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut V8Value>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn bool_value(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_bool_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn int_value(&self) -> i32 {
unsafe {
self.0
.get_int_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn uint_value(&self) -> u32 {
unsafe {
self.0
.get_uint_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn double_value(&self) -> f64 {
unsafe {
self.0
.get_double_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn date_value(&self) -> Basetime {
unsafe {
self.0
.get_date_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn string_value(&self) -> CefStringUserfree {
unsafe {
self.0
.get_string_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_user_created(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_user_created
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_exception(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_exception
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn exception(&self) -> Option<V8Exception> {
unsafe {
self.0
.get_exception
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn clear_exception(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.clear_exception
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn will_rethrow_exceptions(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.will_rethrow_exceptions
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_rethrow_exceptions(&self, rethrow: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_rethrow_exceptions
.map(|f| {
let arg_rethrow = rethrow;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_rethrow);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_value_bykey(&self, key: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_value_bykey
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_value_byindex(&self, index: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_value_byindex
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn delete_value_bykey(&self, key: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.delete_value_bykey
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn delete_value_byindex(&self, index: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.delete_value_byindex
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn value_bykey(&self, key: Option<&CefString>) -> Option<V8Value> {
unsafe {
self.0
.get_value_bykey
.map(|f| {
let arg_key = key;
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_key);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn value_byindex(&self, index: ::std::os::raw::c_int) -> Option<V8Value> {
unsafe {
self.0
.get_value_byindex
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_value_bykey(
&self,
key: Option<&CefString>,
value: Option<&mut V8Value>,
attribute: V8Propertyattribute,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_value_bykey
.map(|f| {
let (arg_key, arg_value, arg_attribute) = (key, value, attribute);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_attribute = arg_attribute.into_raw();
let result = f(arg_self_, arg_key, arg_value, arg_attribute);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_value_byindex(
&self,
index: ::std::os::raw::c_int,
value: Option<&mut V8Value>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_value_byindex
.map(|f| {
let (arg_index, arg_value) = (index, value);
let arg_self_ = self.into_raw();
let arg_value = arg_value
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_index, arg_value);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_value_byaccessor(
&self,
key: Option<&CefString>,
attribute: V8Propertyattribute,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_value_byaccessor
.map(|f| {
let (arg_key, arg_attribute) = (key, attribute);
let arg_self_ = self.into_raw();
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_attribute = arg_attribute.into_raw();
let result = f(arg_self_, arg_key, arg_attribute);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn keys(&self, keys: Option<&mut CefStringList>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_keys
.map(|f| {
let arg_keys = keys;
let arg_self_ = self.into_raw();
let arg_keys = arg_keys
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_keys);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_user_data(&self, user_data: Option<&mut BaseRefCounted>) -> ::std::os::raw::c_int {
unsafe {
self.0
.set_user_data
.map(|f| {
let arg_user_data = user_data;
let arg_self_ = self.into_raw();
let out_user_data = arg_user_data;
let arg_user_data = out_user_data
.map(|arg| {
arg.add_ref();
arg.into_raw()
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_user_data);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn user_data(&self) -> Option<BaseRefCounted> {
unsafe {
self.0
.get_user_data
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn externally_allocated_memory(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_externally_allocated_memory
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn adjust_externally_allocated_memory(
&self,
change_in_bytes: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.adjust_externally_allocated_memory
.map(|f| {
let arg_change_in_bytes = change_in_bytes;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_change_in_bytes);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn array_length(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_array_length
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn array_buffer_release_callback(&self) -> Option<V8ArrayBufferReleaseCallback> {
unsafe {
self.0
.get_array_buffer_release_callback
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn neuter_array_buffer(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.neuter_array_buffer
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn array_buffer_byte_length(&self) -> usize {
unsafe {
self.0
.get_array_buffer_byte_length
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn array_buffer_data(&self) -> *mut ::std::os::raw::c_void {
unsafe {
self.0
.get_array_buffer_data
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_else(|| std::mem::zeroed())
}
}
fn function_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_function_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn function_handler(&self) -> Option<V8Handler> {
unsafe {
self.0
.get_function_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn execute_function(
&self,
object: Option<&mut V8Value>,
arguments: Option<&[Option<V8Value>]>,
) -> Option<V8Value> {
unsafe {
self.0
.execute_function
.map(|f| {
let (arg_object, arg_arguments) = (object, arguments);
let arg_self_ = self.into_raw();
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_arguments_count = arg_arguments
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_arguments = arg_arguments
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_arguments = if vec_arguments.is_empty() {
std::ptr::null()
} else {
vec_arguments.as_ptr()
};
let result = f(arg_self_, arg_object, arg_arguments_count, arg_arguments);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn execute_function_with_context(
&self,
context: Option<&mut V8Context>,
object: Option<&mut V8Value>,
arguments: Option<&[Option<V8Value>]>,
) -> Option<V8Value> {
unsafe {
self.0
.execute_function_with_context
.map(|f| {
let (arg_context, arg_object, arg_arguments) = (context, object, arguments);
let arg_self_ = self.into_raw();
let arg_context = arg_context
.map(|arg| {
arg.add_ref();
ImplV8Context::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_object = arg_object
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_arguments_count = arg_arguments
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_arguments = arg_arguments
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_arguments = if vec_arguments.is_empty() {
std::ptr::null()
} else {
vec_arguments.as_ptr()
};
let result = f(
arg_self_,
arg_context,
arg_object,
arg_arguments_count,
arg_arguments,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn resolve_promise(&self, arg: Option<&mut V8Value>) -> ::std::os::raw::c_int {
unsafe {
self.0
.resolve_promise
.map(|f| {
let arg_arg = arg;
let arg_self_ = self.into_raw();
let arg_arg = arg_arg
.map(|arg| {
arg.add_ref();
ImplV8Value::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_arg);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn reject_promise(&self, error_msg: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.reject_promise
.map(|f| {
let arg_error_msg = error_msg;
let arg_self_ = self.into_raw();
let arg_error_msg = arg_error_msg
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_error_msg);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_value_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_value_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8Value {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_value_t> for &V8Value {
fn into_raw(self) -> *mut _cef_v8_value_t {
ImplV8Value::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_value_t> for &mut V8Value {
fn into_raw(self) -> *mut _cef_v8_value_t {
ImplV8Value::get_raw(self)
}
}
impl ConvertReturnValue<V8Value> for *mut _cef_v8_value_t {
fn wrap_result(self) -> V8Value {
V8Value(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8Value> for *mut _cef_v8_value_t {
fn from(value: V8Value) -> Self {
let object = ImplV8Value::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_stack_trace_t`] for more documentation.
#[derive(Clone)]
pub struct V8StackTrace(RefGuard<_cef_v8_stack_trace_t>);
pub trait ImplV8StackTrace: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_stack_trace_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_stack_trace_t::get_frame_count`] for more documentation."]
fn frame_count(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_stack_trace_t::get_frame`] for more documentation."]
fn frame(&self, index: ::std::os::raw::c_int) -> Option<V8StackFrame>;
fn get_raw(&self) -> *mut _cef_v8_stack_trace_t;
}
impl ImplV8StackTrace for V8StackTrace {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn frame_count(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_frame_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn frame(&self, index: ::std::os::raw::c_int) -> Option<V8StackFrame> {
unsafe {
self.0
.get_frame
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_stack_trace_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_stack_trace_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8StackTrace {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_stack_trace_t> for &V8StackTrace {
fn into_raw(self) -> *mut _cef_v8_stack_trace_t {
ImplV8StackTrace::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_stack_trace_t> for &mut V8StackTrace {
fn into_raw(self) -> *mut _cef_v8_stack_trace_t {
ImplV8StackTrace::get_raw(self)
}
}
impl ConvertReturnValue<V8StackTrace> for *mut _cef_v8_stack_trace_t {
fn wrap_result(self) -> V8StackTrace {
V8StackTrace(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8StackTrace> for *mut _cef_v8_stack_trace_t {
fn from(value: V8StackTrace) -> Self {
let object = ImplV8StackTrace::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_v8_stack_frame_t`] for more documentation.
#[derive(Clone)]
pub struct V8StackFrame(RefGuard<_cef_v8_stack_frame_t>);
pub trait ImplV8StackFrame: Clone + Sized + Rc {
#[doc = "See [`_cef_v8_stack_frame_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_stack_frame_t::get_script_name`] for more documentation."]
fn script_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_stack_frame_t::get_script_name_or_source_url`] for more documentation."]
fn script_name_or_source_url(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_stack_frame_t::get_function_name`] for more documentation."]
fn function_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_v8_stack_frame_t::get_line_number`] for more documentation."]
fn line_number(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_stack_frame_t::get_column`] for more documentation."]
fn column(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_stack_frame_t::is_eval`] for more documentation."]
fn is_eval(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_v8_stack_frame_t::is_constructor`] for more documentation."]
fn is_constructor(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_v8_stack_frame_t;
}
impl ImplV8StackFrame for V8StackFrame {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn script_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_script_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn script_name_or_source_url(&self) -> CefStringUserfree {
unsafe {
self.0
.get_script_name_or_source_url
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn function_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_function_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn line_number(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_line_number
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn column(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_column
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_eval(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_eval
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_constructor(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_constructor
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_v8_stack_frame_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_v8_stack_frame_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for V8StackFrame {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_v8_stack_frame_t> for &V8StackFrame {
fn into_raw(self) -> *mut _cef_v8_stack_frame_t {
ImplV8StackFrame::get_raw(self)
}
}
impl ConvertParam<*mut _cef_v8_stack_frame_t> for &mut V8StackFrame {
fn into_raw(self) -> *mut _cef_v8_stack_frame_t {
ImplV8StackFrame::get_raw(self)
}
}
impl ConvertReturnValue<V8StackFrame> for *mut _cef_v8_stack_frame_t {
fn wrap_result(self) -> V8StackFrame {
V8StackFrame(unsafe { RefGuard::from_raw(self) })
}
}
impl From<V8StackFrame> for *mut _cef_v8_stack_frame_t {
fn from(value: V8StackFrame) -> Self {
let object = ImplV8StackFrame::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_render_process_handler_t`] for more documentation.
#[derive(Clone)]
pub struct RenderProcessHandler(RefGuard<_cef_render_process_handler_t>);
impl RenderProcessHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapRenderProcessHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplRenderProcessHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapRenderProcessHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_render_process_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapRenderProcessHandler: ImplRenderProcessHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_render_process_handler_t, Self>);
}
pub trait ImplRenderProcessHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_render_process_handler_t::on_web_kit_initialized`] for more documentation."]
fn on_web_kit_initialized(&self) {}
#[doc = "See [`_cef_render_process_handler_t::on_browser_created`] for more documentation."]
fn on_browser_created(
&self,
browser: Option<&mut Browser>,
extra_info: Option<&mut DictionaryValue>,
) {
}
#[doc = "See [`_cef_render_process_handler_t::on_browser_destroyed`] for more documentation."]
fn on_browser_destroyed(&self, browser: Option<&mut Browser>) {}
#[doc = "See [`_cef_render_process_handler_t::get_load_handler`] for more documentation."]
fn load_handler(&self) -> Option<LoadHandler> {
Default::default()
}
#[doc = "See [`_cef_render_process_handler_t::on_context_created`] for more documentation."]
fn on_context_created(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
context: Option<&mut V8Context>,
) {
}
#[doc = "See [`_cef_render_process_handler_t::on_context_released`] for more documentation."]
fn on_context_released(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
context: Option<&mut V8Context>,
) {
}
#[doc = "See [`_cef_render_process_handler_t::on_uncaught_exception`] for more documentation."]
fn on_uncaught_exception(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
context: Option<&mut V8Context>,
exception: Option<&mut V8Exception>,
stack_trace: Option<&mut V8StackTrace>,
) {
}
#[doc = "See [`_cef_render_process_handler_t::on_focused_node_changed`] for more documentation."]
fn on_focused_node_changed(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
node: Option<&mut Domnode>,
) {
}
#[doc = "See [`_cef_render_process_handler_t::on_process_message_received`] for more documentation."]
fn on_process_message_received(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
source_process: ProcessId,
message: Option<&mut ProcessMessage>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_render_process_handler_t) {
impl_cef_render_process_handler_t::init_methods::<Self, _cef_render_process_handler_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_render_process_handler_t;
}
#[doc = "Implement the [`WrapRenderProcessHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl RenderProcessHandler` block you can override default\nmethods implemented by the [`ImplRenderProcessHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_render_process_handler! {\n struct MyRenderProcessHandler {\n payload: String,\n }\n\n impl RenderProcessHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> RenderProcessHandler {\n MyRenderProcessHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_render_process_handler { ($ vis : vis struct $ name : ident ; impl RenderProcessHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_render_process_handler ! { $ vis struct $ name { } impl RenderProcessHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl RenderProcessHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_render_process_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> RenderProcessHandler { RenderProcessHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapRenderProcessHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_render_process_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplRenderProcessHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_render_process_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_render_process_handler_t {
use super::*;
pub fn init_methods<I: ImplRenderProcessHandler, R: Rc>(
object: &mut _cef_render_process_handler_t,
) {
object.on_web_kit_initialized = Some(on_web_kit_initialized::<I, R>);
object.on_browser_created = Some(on_browser_created::<I, R>);
object.on_browser_destroyed = Some(on_browser_destroyed::<I, R>);
object.get_load_handler = Some(get_load_handler::<I, R>);
object.on_context_created = Some(on_context_created::<I, R>);
object.on_context_released = Some(on_context_released::<I, R>);
object.on_uncaught_exception = Some(on_uncaught_exception::<I, R>);
object.on_focused_node_changed = Some(on_focused_node_changed::<I, R>);
object.on_process_message_received = Some(on_process_message_received::<I, R>);
}
extern "C" fn on_web_kit_initialized<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
) {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
ImplRenderProcessHandler::on_web_kit_initialized(&arg_self_.interface)
}
extern "C" fn on_browser_created<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
browser: *mut _cef_browser_t,
extra_info: *mut _cef_dictionary_value_t,
) {
let (arg_self_, arg_browser, arg_extra_info) = (self_, browser, extra_info);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_extra_info = unsafe { arg_extra_info.as_mut() }
.map(|arg| DictionaryValue(unsafe { RefGuard::from_raw(arg) }));
let arg_extra_info = arg_extra_info.as_mut();
ImplRenderProcessHandler::on_browser_created(
&arg_self_.interface,
arg_browser,
arg_extra_info,
)
}
extern "C" fn on_browser_destroyed<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser) = (self_, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplRenderProcessHandler::on_browser_destroyed(&arg_self_.interface, arg_browser)
}
extern "C" fn get_load_handler<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
) -> *mut _cef_load_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplRenderProcessHandler::load_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn on_context_created<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
context: *mut _cef_v8_context_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_context) = (self_, browser, frame, context);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_context = unsafe { arg_context.as_mut() }
.map(|arg| V8Context(unsafe { RefGuard::from_raw(arg) }));
let arg_context = arg_context.as_mut();
ImplRenderProcessHandler::on_context_created(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_context,
)
}
extern "C" fn on_context_released<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
context: *mut _cef_v8_context_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_context) = (self_, browser, frame, context);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_context = unsafe { arg_context.as_mut() }
.map(|arg| V8Context(unsafe { RefGuard::from_raw(arg) }));
let arg_context = arg_context.as_mut();
ImplRenderProcessHandler::on_context_released(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_context,
)
}
extern "C" fn on_uncaught_exception<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
context: *mut _cef_v8_context_t,
exception: *mut _cef_v8_exception_t,
stack_trace: *mut _cef_v8_stack_trace_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_context, arg_exception, arg_stack_trace) =
(self_, browser, frame, context, exception, stack_trace);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_context = unsafe { arg_context.as_mut() }
.map(|arg| V8Context(unsafe { RefGuard::from_raw(arg) }));
let arg_context = arg_context.as_mut();
let mut arg_exception = unsafe { arg_exception.as_mut() }
.map(|arg| V8Exception(unsafe { RefGuard::from_raw(arg) }));
let arg_exception = arg_exception.as_mut();
let mut arg_stack_trace = unsafe { arg_stack_trace.as_mut() }
.map(|arg| V8StackTrace(unsafe { RefGuard::from_raw(arg) }));
let arg_stack_trace = arg_stack_trace.as_mut();
ImplRenderProcessHandler::on_uncaught_exception(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_context,
arg_exception,
arg_stack_trace,
)
}
extern "C" fn on_focused_node_changed<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
node: *mut _cef_domnode_t,
) {
let (arg_self_, arg_browser, arg_frame, arg_node) = (self_, browser, frame, node);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let mut arg_node =
unsafe { arg_node.as_mut() }.map(|arg| Domnode(unsafe { RefGuard::from_raw(arg) }));
let arg_node = arg_node.as_mut();
ImplRenderProcessHandler::on_focused_node_changed(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_node,
)
}
extern "C" fn on_process_message_received<I: ImplRenderProcessHandler, R: Rc>(
self_: *mut _cef_render_process_handler_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
source_process: cef_process_id_t,
message: *mut _cef_process_message_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser, arg_frame, arg_source_process, arg_message) =
(self_, browser, frame, source_process, message);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_source_process = arg_source_process.into_raw();
let mut arg_message = unsafe { arg_message.as_mut() }
.map(|arg| ProcessMessage(unsafe { RefGuard::from_raw(arg) }));
let arg_message = arg_message.as_mut();
ImplRenderProcessHandler::on_process_message_received(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_source_process,
arg_message,
)
}
}
impl ImplRenderProcessHandler for RenderProcessHandler {
fn on_web_kit_initialized(&self) {
unsafe {
if let Some(f) = self.0.on_web_kit_initialized {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn on_browser_created(
&self,
browser: Option<&mut Browser>,
extra_info: Option<&mut DictionaryValue>,
) {
unsafe {
if let Some(f) = self.0.on_browser_created {
let (arg_browser, arg_extra_info) = (browser, extra_info);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_extra_info = arg_extra_info
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_extra_info);
}
}
}
fn on_browser_destroyed(&self, browser: Option<&mut Browser>) {
unsafe {
if let Some(f) = self.0.on_browser_destroyed {
let arg_browser = browser;
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser);
}
}
}
fn load_handler(&self) -> Option<LoadHandler> {
unsafe {
self.0
.get_load_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn on_context_created(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
context: Option<&mut V8Context>,
) {
unsafe {
if let Some(f) = self.0.on_context_created {
let (arg_browser, arg_frame, arg_context) = (browser, frame, context);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_context = arg_context
.map(|arg| {
arg.add_ref();
ImplV8Context::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame, arg_context);
}
}
}
fn on_context_released(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
context: Option<&mut V8Context>,
) {
unsafe {
if let Some(f) = self.0.on_context_released {
let (arg_browser, arg_frame, arg_context) = (browser, frame, context);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_context = arg_context
.map(|arg| {
arg.add_ref();
ImplV8Context::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame, arg_context);
}
}
}
fn on_uncaught_exception(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
context: Option<&mut V8Context>,
exception: Option<&mut V8Exception>,
stack_trace: Option<&mut V8StackTrace>,
) {
unsafe {
if let Some(f) = self.0.on_uncaught_exception {
let (arg_browser, arg_frame, arg_context, arg_exception, arg_stack_trace) =
(browser, frame, context, exception, stack_trace);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_context = arg_context
.map(|arg| {
arg.add_ref();
ImplV8Context::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_exception = arg_exception
.map(|arg| {
arg.add_ref();
ImplV8Exception::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_stack_trace = arg_stack_trace
.map(|arg| {
arg.add_ref();
ImplV8StackTrace::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_browser,
arg_frame,
arg_context,
arg_exception,
arg_stack_trace,
);
}
}
}
fn on_focused_node_changed(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
node: Option<&mut Domnode>,
) {
unsafe {
if let Some(f) = self.0.on_focused_node_changed {
let (arg_browser, arg_frame, arg_node) = (browser, frame, node);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_node = arg_node
.map(|arg| {
arg.add_ref();
ImplDomnode::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser, arg_frame, arg_node);
}
}
}
fn on_process_message_received(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
source_process: ProcessId,
message: Option<&mut ProcessMessage>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_process_message_received
.map(|f| {
let (arg_browser, arg_frame, arg_source_process, arg_message) =
(browser, frame, source_process, message);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_source_process = arg_source_process.into_raw();
let arg_message = arg_message
.map(|arg| {
arg.add_ref();
ImplProcessMessage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_source_process,
arg_message,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_render_process_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_render_process_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for RenderProcessHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_render_process_handler_t> for &RenderProcessHandler {
fn into_raw(self) -> *mut _cef_render_process_handler_t {
ImplRenderProcessHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_render_process_handler_t> for &mut RenderProcessHandler {
fn into_raw(self) -> *mut _cef_render_process_handler_t {
ImplRenderProcessHandler::get_raw(self)
}
}
impl ConvertReturnValue<RenderProcessHandler> for *mut _cef_render_process_handler_t {
fn wrap_result(self) -> RenderProcessHandler {
RenderProcessHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<RenderProcessHandler> for *mut _cef_render_process_handler_t {
fn from(value: RenderProcessHandler) -> Self {
let object = ImplRenderProcessHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_resource_bundle_handler_t`] for more documentation.
#[derive(Clone)]
pub struct ResourceBundleHandler(RefGuard<_cef_resource_bundle_handler_t>);
impl ResourceBundleHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapResourceBundleHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplResourceBundleHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapResourceBundleHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_resource_bundle_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapResourceBundleHandler: ImplResourceBundleHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_resource_bundle_handler_t, Self>);
}
pub trait ImplResourceBundleHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_resource_bundle_handler_t::get_localized_string`] for more documentation."]
fn localized_string(
&self,
string_id: ::std::os::raw::c_int,
string: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_bundle_handler_t::get_data_resource`] for more documentation."]
fn data_resource(
&self,
resource_id: ::std::os::raw::c_int,
data: Option<&mut Vec<u8>>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_resource_bundle_handler_t::get_data_resource_for_scale`] for more documentation."]
fn data_resource_for_scale(
&self,
resource_id: ::std::os::raw::c_int,
scale_factor: ScaleFactor,
data: Option<&mut Vec<u8>>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_resource_bundle_handler_t) {
impl_cef_resource_bundle_handler_t::init_methods::<Self, _cef_resource_bundle_handler_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_resource_bundle_handler_t;
}
#[doc = "Implement the [`WrapResourceBundleHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ResourceBundleHandler` block you can override default\nmethods implemented by the [`ImplResourceBundleHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_resource_bundle_handler! {\n struct MyResourceBundleHandler {\n payload: String,\n }\n\n impl ResourceBundleHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> ResourceBundleHandler {\n MyResourceBundleHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_resource_bundle_handler { ($ vis : vis struct $ name : ident ; impl ResourceBundleHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_resource_bundle_handler ! { $ vis struct $ name { } impl ResourceBundleHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ResourceBundleHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resource_bundle_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ResourceBundleHandler { ResourceBundleHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapResourceBundleHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_resource_bundle_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplResourceBundleHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_resource_bundle_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_resource_bundle_handler_t {
use super::*;
pub fn init_methods<I: ImplResourceBundleHandler, R: Rc>(
object: &mut _cef_resource_bundle_handler_t,
) {
object.get_localized_string = Some(get_localized_string::<I, R>);
object.get_data_resource = Some(get_data_resource::<I, R>);
object.get_data_resource_for_scale = Some(get_data_resource_for_scale::<I, R>);
}
extern "C" fn get_localized_string<I: ImplResourceBundleHandler, R: Rc>(
self_: *mut _cef_resource_bundle_handler_t,
string_id: ::std::os::raw::c_int,
string: *mut cef_string_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_string_id, arg_string) = (self_, string_id, string);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_string_id = arg_string_id.into_raw();
let mut arg_string = if arg_string.is_null() {
None
} else {
Some(arg_string.into())
};
let arg_string = arg_string.as_mut();
ImplResourceBundleHandler::localized_string(&arg_self_.interface, arg_string_id, arg_string)
}
extern "C" fn get_data_resource<I: ImplResourceBundleHandler, R: Rc>(
self_: *mut _cef_resource_bundle_handler_t,
resource_id: ::std::os::raw::c_int,
data: *mut *mut ::std::os::raw::c_void,
data_size: *mut usize,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_resource_id, arg_data, arg_data_size) =
(self_, resource_id, data, data_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_resource_id = arg_resource_id.into_raw();
let out_data_size = unsafe { arg_data_size.as_mut() };
let arg_data_size = out_data_size
.as_ref()
.map(|size| **size)
.unwrap_or_default();
let out_data = (!arg_data.is_null() && arg_data_size > 0)
.then(|| unsafe { std::slice::from_raw_parts_mut(arg_data.cast(), arg_data_size) });
let mut vec_data = out_data.as_ref().map(|arg| arg.to_vec());
let arg_data = vec_data.as_mut();
let result = ImplResourceBundleHandler::data_resource(
&arg_self_.interface,
arg_resource_id,
arg_data,
);
if let (Some(out_data_size), Some(out_data), Some(vec_data)) =
(out_data_size, out_data, vec_data.as_mut())
{
*out_data_size = vec_data.len().min(*out_data_size);
out_data[..(*out_data_size)].copy_from_slice(&vec_data[..(*out_data_size)]);
}
result
}
extern "C" fn get_data_resource_for_scale<I: ImplResourceBundleHandler, R: Rc>(
self_: *mut _cef_resource_bundle_handler_t,
resource_id: ::std::os::raw::c_int,
scale_factor: cef_scale_factor_t,
data: *mut *mut ::std::os::raw::c_void,
data_size: *mut usize,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_resource_id, arg_scale_factor, arg_data, arg_data_size) =
(self_, resource_id, scale_factor, data, data_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_resource_id = arg_resource_id.into_raw();
let arg_scale_factor = arg_scale_factor.into_raw();
let out_data_size = unsafe { arg_data_size.as_mut() };
let arg_data_size = out_data_size
.as_ref()
.map(|size| **size)
.unwrap_or_default();
let out_data = (!arg_data.is_null() && arg_data_size > 0)
.then(|| unsafe { std::slice::from_raw_parts_mut(arg_data.cast(), arg_data_size) });
let mut vec_data = out_data.as_ref().map(|arg| arg.to_vec());
let arg_data = vec_data.as_mut();
let result = ImplResourceBundleHandler::data_resource_for_scale(
&arg_self_.interface,
arg_resource_id,
arg_scale_factor,
arg_data,
);
if let (Some(out_data_size), Some(out_data), Some(vec_data)) =
(out_data_size, out_data, vec_data.as_mut())
{
*out_data_size = vec_data.len().min(*out_data_size);
out_data[..(*out_data_size)].copy_from_slice(&vec_data[..(*out_data_size)]);
}
result
}
}
impl ImplResourceBundleHandler for ResourceBundleHandler {
fn localized_string(
&self,
string_id: ::std::os::raw::c_int,
string: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_localized_string
.map(|f| {
let (arg_string_id, arg_string) = (string_id, string);
let arg_self_ = self.into_raw();
let arg_string = arg_string
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_string_id, arg_string);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn data_resource(
&self,
resource_id: ::std::os::raw::c_int,
data: Option<&mut Vec<u8>>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_data_resource
.map(|f| {
let (arg_resource_id, arg_data) = (resource_id, data);
let arg_self_ = self.into_raw();
let mut out_data_size =
arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data_size = &mut out_data_size;
let mut out_data = arg_data;
let arg_data = out_data
.as_mut()
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_mut_ptr().cast())
}
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_resource_id, arg_data, arg_data_size);
if let Some(out_data) = out_data {
out_data.resize(out_data_size, Default::default());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn data_resource_for_scale(
&self,
resource_id: ::std::os::raw::c_int,
scale_factor: ScaleFactor,
data: Option<&mut Vec<u8>>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_data_resource_for_scale
.map(|f| {
let (arg_resource_id, arg_scale_factor, arg_data) =
(resource_id, scale_factor, data);
let arg_self_ = self.into_raw();
let arg_scale_factor = arg_scale_factor.into_raw();
let mut out_data_size =
arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data_size = &mut out_data_size;
let mut out_data = arg_data;
let arg_data = out_data
.as_mut()
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_mut_ptr().cast())
}
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_resource_id,
arg_scale_factor,
arg_data,
arg_data_size,
);
if let Some(out_data) = out_data {
out_data.resize(out_data_size, Default::default());
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_resource_bundle_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_resource_bundle_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResourceBundleHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_resource_bundle_handler_t> for &ResourceBundleHandler {
fn into_raw(self) -> *mut _cef_resource_bundle_handler_t {
ImplResourceBundleHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_resource_bundle_handler_t> for &mut ResourceBundleHandler {
fn into_raw(self) -> *mut _cef_resource_bundle_handler_t {
ImplResourceBundleHandler::get_raw(self)
}
}
impl ConvertReturnValue<ResourceBundleHandler> for *mut _cef_resource_bundle_handler_t {
fn wrap_result(self) -> ResourceBundleHandler {
ResourceBundleHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResourceBundleHandler> for *mut _cef_resource_bundle_handler_t {
fn from(value: ResourceBundleHandler) -> Self {
let object = ImplResourceBundleHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_scheme_registrar_t`] for more documentation.
#[derive(Clone, Copy)]
pub struct SchemeRegistrar(*mut _cef_scheme_registrar_t);
pub trait ImplSchemeRegistrar: Sized {
#[doc = "See [`_cef_scheme_registrar_t::add_custom_scheme`] for more documentation."]
fn add_custom_scheme(
&self,
scheme_name: Option<&CefString>,
options: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
fn init_methods<R: Rc>(object: &mut _cef_scheme_registrar_t) {
impl_cef_scheme_registrar_t::init_methods::<Self, R>(object);
}
fn get_raw(&self) -> *mut _cef_scheme_registrar_t;
}
mod impl_cef_scheme_registrar_t {
use super::*;
pub fn init_methods<I: ImplSchemeRegistrar, R: Rc>(object: &mut _cef_scheme_registrar_t) {
object.add_custom_scheme = Some(add_custom_scheme::<I, R>);
}
extern "C" fn add_custom_scheme<I: ImplSchemeRegistrar, R: Rc>(
self_: *mut _cef_scheme_registrar_t,
scheme_name: *const cef_string_t,
options: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_scheme_name, arg_options) = (self_, scheme_name, options);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_scheme_name = if arg_scheme_name.is_null() {
None
} else {
Some(arg_scheme_name.into())
};
let arg_scheme_name = arg_scheme_name.as_ref();
let arg_options = arg_options.into_raw();
ImplSchemeRegistrar::add_custom_scheme(&arg_self_.interface, arg_scheme_name, arg_options)
}
}
impl ImplSchemeRegistrar for SchemeRegistrar {
fn add_custom_scheme(
&self,
scheme_name: Option<&CefString>,
options: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.as_ref()
.and_then(|this| this.add_custom_scheme)
.map(|f| {
let (arg_scheme_name, arg_options) = (scheme_name, options);
let arg_self_ = self.into_raw();
let arg_scheme_name = arg_scheme_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_scheme_name, arg_options);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_scheme_registrar_t {
self.0
}
}
impl ConvertParam<*mut _cef_scheme_registrar_t> for &SchemeRegistrar {
fn into_raw(self) -> *mut _cef_scheme_registrar_t {
ImplSchemeRegistrar::get_raw(self)
}
}
impl ConvertParam<*mut _cef_scheme_registrar_t> for &mut SchemeRegistrar {
fn into_raw(self) -> *mut _cef_scheme_registrar_t {
ImplSchemeRegistrar::get_raw(self)
}
}
impl ConvertReturnValue<SchemeRegistrar> for *mut _cef_scheme_registrar_t {
fn wrap_result(self) -> SchemeRegistrar {
SchemeRegistrar(self)
}
}
impl From<SchemeRegistrar> for *mut _cef_scheme_registrar_t {
fn from(value: SchemeRegistrar) -> Self {
ImplSchemeRegistrar::get_raw(&value)
}
}
/// See [`_cef_scheme_handler_factory_t`] for more documentation.
#[derive(Clone)]
pub struct SchemeHandlerFactory(RefGuard<_cef_scheme_handler_factory_t>);
impl SchemeHandlerFactory {
pub fn new<T>(interface: T) -> Self
where
T: WrapSchemeHandlerFactory,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplSchemeHandlerFactory>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapSchemeHandlerFactory>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_scheme_handler_factory_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapSchemeHandlerFactory: ImplSchemeHandlerFactory {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_scheme_handler_factory_t, Self>);
}
pub trait ImplSchemeHandlerFactory: Clone + Sized + Rc {
#[doc = "See [`_cef_scheme_handler_factory_t::create`] for more documentation."]
fn create(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
scheme_name: Option<&CefString>,
request: Option<&mut Request>,
) -> Option<ResourceHandler> {
Default::default()
}
fn init_methods(object: &mut _cef_scheme_handler_factory_t) {
impl_cef_scheme_handler_factory_t::init_methods::<Self, _cef_scheme_handler_factory_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_scheme_handler_factory_t;
}
#[doc = "Implement the [`WrapSchemeHandlerFactory`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl SchemeHandlerFactory` block you can override default\nmethods implemented by the [`ImplSchemeHandlerFactory`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_scheme_handler_factory! {\n struct MySchemeHandlerFactory {\n payload: String,\n }\n\n impl SchemeHandlerFactory {\n // ...\n }\n}\n\nfn make_my_struct() -> SchemeHandlerFactory {\n MySchemeHandlerFactory::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_scheme_handler_factory { ($ vis : vis struct $ name : ident ; impl SchemeHandlerFactory { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_scheme_handler_factory ! { $ vis struct $ name { } impl SchemeHandlerFactory { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl SchemeHandlerFactory { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_scheme_handler_factory_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> SchemeHandlerFactory { SchemeHandlerFactory :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapSchemeHandlerFactory for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_scheme_handler_factory_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplSchemeHandlerFactory for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_scheme_handler_factory_t { self . cef_object . cast () } } } ; }
mod impl_cef_scheme_handler_factory_t {
use super::*;
pub fn init_methods<I: ImplSchemeHandlerFactory, R: Rc>(
object: &mut _cef_scheme_handler_factory_t,
) {
object.create = Some(create::<I, R>);
}
extern "C" fn create<I: ImplSchemeHandlerFactory, R: Rc>(
self_: *mut _cef_scheme_handler_factory_t,
browser: *mut _cef_browser_t,
frame: *mut _cef_frame_t,
scheme_name: *const cef_string_t,
request: *mut _cef_request_t,
) -> *mut _cef_resource_handler_t {
let (arg_self_, arg_browser, arg_frame, arg_scheme_name, arg_request) =
(self_, browser, frame, scheme_name, request);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
let mut arg_frame =
unsafe { arg_frame.as_mut() }.map(|arg| Frame(unsafe { RefGuard::from_raw(arg) }));
let arg_frame = arg_frame.as_mut();
let arg_scheme_name = if arg_scheme_name.is_null() {
None
} else {
Some(arg_scheme_name.into())
};
let arg_scheme_name = arg_scheme_name.as_ref();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let result = ImplSchemeHandlerFactory::create(
&arg_self_.interface,
arg_browser,
arg_frame,
arg_scheme_name,
arg_request,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
}
impl ImplSchemeHandlerFactory for SchemeHandlerFactory {
fn create(
&self,
browser: Option<&mut Browser>,
frame: Option<&mut Frame>,
scheme_name: Option<&CefString>,
request: Option<&mut Request>,
) -> Option<ResourceHandler> {
unsafe {
self.0
.create
.map(|f| {
let (arg_browser, arg_frame, arg_scheme_name, arg_request) =
(browser, frame, scheme_name, request);
let arg_self_ = self.into_raw();
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_frame = arg_frame
.map(|arg| {
arg.add_ref();
ImplFrame::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_scheme_name = arg_scheme_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser,
arg_frame,
arg_scheme_name,
arg_request,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_scheme_handler_factory_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_scheme_handler_factory_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for SchemeHandlerFactory {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_scheme_handler_factory_t> for &SchemeHandlerFactory {
fn into_raw(self) -> *mut _cef_scheme_handler_factory_t {
ImplSchemeHandlerFactory::get_raw(self)
}
}
impl ConvertParam<*mut _cef_scheme_handler_factory_t> for &mut SchemeHandlerFactory {
fn into_raw(self) -> *mut _cef_scheme_handler_factory_t {
ImplSchemeHandlerFactory::get_raw(self)
}
}
impl ConvertReturnValue<SchemeHandlerFactory> for *mut _cef_scheme_handler_factory_t {
fn wrap_result(self) -> SchemeHandlerFactory {
SchemeHandlerFactory(unsafe { RefGuard::from_raw(self) })
}
}
impl From<SchemeHandlerFactory> for *mut _cef_scheme_handler_factory_t {
fn from(value: SchemeHandlerFactory) -> Self {
let object = ImplSchemeHandlerFactory::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_app_t`] for more documentation.
#[derive(Clone)]
pub struct App(RefGuard<_cef_app_t>);
impl App {
pub fn new<T>(interface: T) -> Self
where
T: WrapApp,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplApp>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapApp>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_app_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapApp: ImplApp {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_app_t, Self>);
}
pub trait ImplApp: Clone + Sized + Rc {
#[doc = "See [`_cef_app_t::on_before_command_line_processing`] for more documentation."]
fn on_before_command_line_processing(
&self,
process_type: Option<&CefString>,
command_line: Option<&mut CommandLine>,
) {
}
#[doc = "See [`_cef_app_t::on_register_custom_schemes`] for more documentation."]
fn on_register_custom_schemes(&self, registrar: Option<&mut SchemeRegistrar>) {}
#[doc = "See [`_cef_app_t::get_resource_bundle_handler`] for more documentation."]
fn resource_bundle_handler(&self) -> Option<ResourceBundleHandler> {
Default::default()
}
#[doc = "See [`_cef_app_t::get_browser_process_handler`] for more documentation."]
fn browser_process_handler(&self) -> Option<BrowserProcessHandler> {
Default::default()
}
#[doc = "See [`_cef_app_t::get_render_process_handler`] for more documentation."]
fn render_process_handler(&self) -> Option<RenderProcessHandler> {
Default::default()
}
fn init_methods(object: &mut _cef_app_t) {
impl_cef_app_t::init_methods::<Self, _cef_app_t>(object);
}
fn get_raw(&self) -> *mut _cef_app_t;
}
#[doc = "Implement the [`WrapApp`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl App` block you can override default\nmethods implemented by the [`ImplApp`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_app! {\n struct MyApp {\n payload: String,\n }\n\n impl App {\n // ...\n }\n}\n\nfn make_my_struct() -> App {\n MyApp::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_app { ($ vis : vis struct $ name : ident ; impl App { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_app ! { $ vis struct $ name { } impl App { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl App { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_app_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> App { App :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapApp for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_app_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplApp for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_app_t { self . cef_object . cast () } } } ; }
mod impl_cef_app_t {
use super::*;
pub fn init_methods<I: ImplApp, R: Rc>(object: &mut _cef_app_t) {
object.on_before_command_line_processing = Some(on_before_command_line_processing::<I, R>);
object.on_register_custom_schemes = Some(on_register_custom_schemes::<I, R>);
object.get_resource_bundle_handler = Some(get_resource_bundle_handler::<I, R>);
object.get_browser_process_handler = Some(get_browser_process_handler::<I, R>);
object.get_render_process_handler = Some(get_render_process_handler::<I, R>);
}
extern "C" fn on_before_command_line_processing<I: ImplApp, R: Rc>(
self_: *mut _cef_app_t,
process_type: *const cef_string_t,
command_line: *mut _cef_command_line_t,
) {
let (arg_self_, arg_process_type, arg_command_line) = (self_, process_type, command_line);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_process_type = if arg_process_type.is_null() {
None
} else {
Some(arg_process_type.into())
};
let arg_process_type = arg_process_type.as_ref();
let mut arg_command_line = unsafe { arg_command_line.as_mut() }
.map(|arg| CommandLine(unsafe { RefGuard::from_raw(arg) }));
let arg_command_line = arg_command_line.as_mut();
ImplApp::on_before_command_line_processing(
&arg_self_.interface,
arg_process_type,
arg_command_line,
)
}
extern "C" fn on_register_custom_schemes<I: ImplApp, R: Rc>(
self_: *mut _cef_app_t,
registrar: *mut _cef_scheme_registrar_t,
) {
let (arg_self_, arg_registrar) = (self_, registrar);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_registrar = if arg_registrar.is_null() {
None
} else {
Some(SchemeRegistrar(arg_registrar))
};
let arg_registrar = arg_registrar.as_mut();
ImplApp::on_register_custom_schemes(&arg_self_.interface, arg_registrar)
}
extern "C" fn get_resource_bundle_handler<I: ImplApp, R: Rc>(
self_: *mut _cef_app_t,
) -> *mut _cef_resource_bundle_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplApp::resource_bundle_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_browser_process_handler<I: ImplApp, R: Rc>(
self_: *mut _cef_app_t,
) -> *mut _cef_browser_process_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplApp::browser_process_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn get_render_process_handler<I: ImplApp, R: Rc>(
self_: *mut _cef_app_t,
) -> *mut _cef_render_process_handler_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplApp::render_process_handler(&arg_self_.interface);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
}
impl ImplApp for App {
fn on_before_command_line_processing(
&self,
process_type: Option<&CefString>,
command_line: Option<&mut CommandLine>,
) {
unsafe {
if let Some(f) = self.0.on_before_command_line_processing {
let (arg_process_type, arg_command_line) = (process_type, command_line);
let arg_self_ = self.into_raw();
let arg_process_type = arg_process_type
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_command_line = arg_command_line
.map(|arg| {
arg.add_ref();
ImplCommandLine::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_process_type, arg_command_line);
}
}
}
fn on_register_custom_schemes(&self, registrar: Option<&mut SchemeRegistrar>) {
unsafe {
if let Some(f) = self.0.on_register_custom_schemes {
let arg_registrar = registrar;
let arg_self_ = self.into_raw();
let arg_registrar = arg_registrar
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_registrar);
}
}
}
fn resource_bundle_handler(&self) -> Option<ResourceBundleHandler> {
unsafe {
self.0
.get_resource_bundle_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn browser_process_handler(&self) -> Option<BrowserProcessHandler> {
unsafe {
self.0
.get_browser_process_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn render_process_handler(&self) -> Option<RenderProcessHandler> {
unsafe {
self.0
.get_render_process_handler
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_app_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_app_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for App {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_app_t> for &App {
fn into_raw(self) -> *mut _cef_app_t {
ImplApp::get_raw(self)
}
}
impl ConvertParam<*mut _cef_app_t> for &mut App {
fn into_raw(self) -> *mut _cef_app_t {
ImplApp::get_raw(self)
}
}
impl ConvertReturnValue<App> for *mut _cef_app_t {
fn wrap_result(self) -> App {
App(unsafe { RefGuard::from_raw(self) })
}
}
impl From<App> for *mut _cef_app_t {
fn from(value: App) -> Self {
let object = ImplApp::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_component_update_callback_t`] for more documentation.
#[derive(Clone)]
pub struct ComponentUpdateCallback(RefGuard<_cef_component_update_callback_t>);
impl ComponentUpdateCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapComponentUpdateCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplComponentUpdateCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapComponentUpdateCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_component_update_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapComponentUpdateCallback: ImplComponentUpdateCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_component_update_callback_t, Self>);
}
pub trait ImplComponentUpdateCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_component_update_callback_t::on_complete`] for more documentation."]
fn on_complete(&self, component_id: Option<&CefString>, error: ComponentUpdateError) {}
fn init_methods(object: &mut _cef_component_update_callback_t) {
impl_cef_component_update_callback_t::init_methods::<Self, _cef_component_update_callback_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_component_update_callback_t;
}
#[doc = "Implement the [`WrapComponentUpdateCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ComponentUpdateCallback` block you can override default\nmethods implemented by the [`ImplComponentUpdateCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_component_update_callback! {\n struct MyComponentUpdateCallback {\n payload: String,\n }\n\n impl ComponentUpdateCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> ComponentUpdateCallback {\n MyComponentUpdateCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_component_update_callback { ($ vis : vis struct $ name : ident ; impl ComponentUpdateCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_component_update_callback ! { $ vis struct $ name { } impl ComponentUpdateCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ComponentUpdateCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_component_update_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ComponentUpdateCallback { ComponentUpdateCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapComponentUpdateCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_component_update_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplComponentUpdateCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_component_update_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_component_update_callback_t {
use super::*;
pub fn init_methods<I: ImplComponentUpdateCallback, R: Rc>(
object: &mut _cef_component_update_callback_t,
) {
object.on_complete = Some(on_complete::<I, R>);
}
extern "C" fn on_complete<I: ImplComponentUpdateCallback, R: Rc>(
self_: *mut _cef_component_update_callback_t,
component_id: *const cef_string_t,
error: cef_component_update_error_t,
) {
let (arg_self_, arg_component_id, arg_error) = (self_, component_id, error);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_component_id = if arg_component_id.is_null() {
None
} else {
Some(arg_component_id.into())
};
let arg_component_id = arg_component_id.as_ref();
let arg_error = arg_error.into_raw();
ImplComponentUpdateCallback::on_complete(&arg_self_.interface, arg_component_id, arg_error)
}
}
impl ImplComponentUpdateCallback for ComponentUpdateCallback {
fn on_complete(&self, component_id: Option<&CefString>, error: ComponentUpdateError) {
unsafe {
if let Some(f) = self.0.on_complete {
let (arg_component_id, arg_error) = (component_id, error);
let arg_self_ = self.into_raw();
let arg_component_id = arg_component_id
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_error = arg_error.into_raw();
f(arg_self_, arg_component_id, arg_error);
}
}
}
fn get_raw(&self) -> *mut _cef_component_update_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_component_update_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ComponentUpdateCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_component_update_callback_t> for &ComponentUpdateCallback {
fn into_raw(self) -> *mut _cef_component_update_callback_t {
ImplComponentUpdateCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_component_update_callback_t> for &mut ComponentUpdateCallback {
fn into_raw(self) -> *mut _cef_component_update_callback_t {
ImplComponentUpdateCallback::get_raw(self)
}
}
impl ConvertReturnValue<ComponentUpdateCallback> for *mut _cef_component_update_callback_t {
fn wrap_result(self) -> ComponentUpdateCallback {
ComponentUpdateCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ComponentUpdateCallback> for *mut _cef_component_update_callback_t {
fn from(value: ComponentUpdateCallback) -> Self {
let object = ImplComponentUpdateCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_component_t`] for more documentation.
#[derive(Clone)]
pub struct Component(RefGuard<_cef_component_t>);
pub trait ImplComponent: Clone + Sized + Rc {
#[doc = "See [`_cef_component_t::get_id`] for more documentation."]
fn id(&self) -> CefStringUserfree;
#[doc = "See [`_cef_component_t::get_name`] for more documentation."]
fn name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_component_t::get_version`] for more documentation."]
fn version(&self) -> CefStringUserfree;
#[doc = "See [`_cef_component_t::get_state`] for more documentation."]
fn state(&self) -> ComponentState;
fn get_raw(&self) -> *mut _cef_component_t;
}
impl ImplComponent for Component {
fn id(&self) -> CefStringUserfree {
unsafe {
self.0
.get_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn version(&self) -> CefStringUserfree {
unsafe {
self.0
.get_version
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn state(&self) -> ComponentState {
unsafe {
self.0
.get_state
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_component_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_component_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Component {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_component_t> for &Component {
fn into_raw(self) -> *mut _cef_component_t {
ImplComponent::get_raw(self)
}
}
impl ConvertParam<*mut _cef_component_t> for &mut Component {
fn into_raw(self) -> *mut _cef_component_t {
ImplComponent::get_raw(self)
}
}
impl ConvertReturnValue<Component> for *mut _cef_component_t {
fn wrap_result(self) -> Component {
Component(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Component> for *mut _cef_component_t {
fn from(value: Component) -> Self {
let object = ImplComponent::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_component_updater_t`] for more documentation.
#[derive(Clone)]
pub struct ComponentUpdater(RefGuard<_cef_component_updater_t>);
pub trait ImplComponentUpdater: Clone + Sized + Rc {
#[doc = "See [`_cef_component_updater_t::get_component_count`] for more documentation."]
fn component_count(&self) -> usize;
#[doc = "See [`_cef_component_updater_t::get_components`] for more documentation."]
fn components(&self, components: Option<&mut Vec<Option<Component>>>);
#[doc = "See [`_cef_component_updater_t::get_component_by_id`] for more documentation."]
fn component_by_id(&self, component_id: Option<&CefString>) -> Option<Component>;
#[doc = "See [`_cef_component_updater_t::update`] for more documentation."]
fn update(
&self,
component_id: Option<&CefString>,
priority: ComponentUpdatePriority,
callback: Option<&mut ComponentUpdateCallback>,
);
fn get_raw(&self) -> *mut _cef_component_updater_t;
}
impl ImplComponentUpdater for ComponentUpdater {
fn component_count(&self) -> usize {
unsafe {
self.0
.get_component_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn components(&self, components: Option<&mut Vec<Option<Component>>>) {
unsafe {
if let Some(f) = self.0.get_components {
let arg_components = components;
let arg_self_ = self.into_raw();
let mut out_components_count = arg_components
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_components_count = &mut out_components_count;
let out_components = arg_components;
let mut vec_components = out_components
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_components = if vec_components.is_empty() {
std::ptr::null_mut()
} else {
vec_components.as_mut_ptr()
};
f(arg_self_, arg_components_count, arg_components);
if let Some(out_components) = out_components {
*out_components = vec_components
.into_iter()
.take(out_components_count)
.map(|elem| {
if elem.is_null() {
None
} else {
Some(elem.wrap_result())
}
})
.collect();
}
}
}
}
fn component_by_id(&self, component_id: Option<&CefString>) -> Option<Component> {
unsafe {
self.0
.get_component_by_id
.map(|f| {
let arg_component_id = component_id;
let arg_self_ = self.into_raw();
let arg_component_id = arg_component_id
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_component_id);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn update(
&self,
component_id: Option<&CefString>,
priority: ComponentUpdatePriority,
callback: Option<&mut ComponentUpdateCallback>,
) {
unsafe {
if let Some(f) = self.0.update {
let (arg_component_id, arg_priority, arg_callback) =
(component_id, priority, callback);
let arg_self_ = self.into_raw();
let arg_component_id = arg_component_id
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_priority = arg_priority.into_raw();
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplComponentUpdateCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_component_id, arg_priority, arg_callback);
}
}
}
fn get_raw(&self) -> *mut _cef_component_updater_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_component_updater_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ComponentUpdater {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_component_updater_t> for &ComponentUpdater {
fn into_raw(self) -> *mut _cef_component_updater_t {
ImplComponentUpdater::get_raw(self)
}
}
impl ConvertParam<*mut _cef_component_updater_t> for &mut ComponentUpdater {
fn into_raw(self) -> *mut _cef_component_updater_t {
ImplComponentUpdater::get_raw(self)
}
}
impl ConvertReturnValue<ComponentUpdater> for *mut _cef_component_updater_t {
fn wrap_result(self) -> ComponentUpdater {
ComponentUpdater(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ComponentUpdater> for *mut _cef_component_updater_t {
fn from(value: ComponentUpdater) -> Self {
let object = ImplComponentUpdater::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_resource_bundle_t`] for more documentation.
#[derive(Clone)]
pub struct ResourceBundle(RefGuard<_cef_resource_bundle_t>);
pub trait ImplResourceBundle: Clone + Sized + Rc {
#[doc = "See [`_cef_resource_bundle_t::get_localized_string`] for more documentation."]
fn localized_string(&self, string_id: ::std::os::raw::c_int) -> CefStringUserfree;
#[doc = "See [`_cef_resource_bundle_t::get_data_resource`] for more documentation."]
fn data_resource(&self, resource_id: ::std::os::raw::c_int) -> Option<BinaryValue>;
#[doc = "See [`_cef_resource_bundle_t::get_data_resource_for_scale`] for more documentation."]
fn data_resource_for_scale(
&self,
resource_id: ::std::os::raw::c_int,
scale_factor: ScaleFactor,
) -> Option<BinaryValue>;
fn get_raw(&self) -> *mut _cef_resource_bundle_t;
}
impl ImplResourceBundle for ResourceBundle {
fn localized_string(&self, string_id: ::std::os::raw::c_int) -> CefStringUserfree {
unsafe {
self.0
.get_localized_string
.map(|f| {
let arg_string_id = string_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_string_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn data_resource(&self, resource_id: ::std::os::raw::c_int) -> Option<BinaryValue> {
unsafe {
self.0
.get_data_resource
.map(|f| {
let arg_resource_id = resource_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_resource_id);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn data_resource_for_scale(
&self,
resource_id: ::std::os::raw::c_int,
scale_factor: ScaleFactor,
) -> Option<BinaryValue> {
unsafe {
self.0
.get_data_resource_for_scale
.map(|f| {
let (arg_resource_id, arg_scale_factor) = (resource_id, scale_factor);
let arg_self_ = self.into_raw();
let arg_scale_factor = arg_scale_factor.into_raw();
let result = f(arg_self_, arg_resource_id, arg_scale_factor);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_resource_bundle_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_resource_bundle_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ResourceBundle {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_resource_bundle_t> for &ResourceBundle {
fn into_raw(self) -> *mut _cef_resource_bundle_t {
ImplResourceBundle::get_raw(self)
}
}
impl ConvertParam<*mut _cef_resource_bundle_t> for &mut ResourceBundle {
fn into_raw(self) -> *mut _cef_resource_bundle_t {
ImplResourceBundle::get_raw(self)
}
}
impl ConvertReturnValue<ResourceBundle> for *mut _cef_resource_bundle_t {
fn wrap_result(self) -> ResourceBundle {
ResourceBundle(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ResourceBundle> for *mut _cef_resource_bundle_t {
fn from(value: ResourceBundle) -> Self {
let object = ImplResourceBundle::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_server_t`] for more documentation.
#[derive(Clone)]
pub struct Server(RefGuard<_cef_server_t>);
pub trait ImplServer: Clone + Sized + Rc {
#[doc = "See [`_cef_server_t::get_task_runner`] for more documentation."]
fn task_runner(&self) -> Option<TaskRunner>;
#[doc = "See [`_cef_server_t::shutdown`] for more documentation."]
fn shutdown(&self);
#[doc = "See [`_cef_server_t::is_running`] for more documentation."]
fn is_running(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_server_t::get_address`] for more documentation."]
fn address(&self) -> CefStringUserfree;
#[doc = "See [`_cef_server_t::has_connection`] for more documentation."]
fn has_connection(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_server_t::is_valid_connection`] for more documentation."]
fn is_valid_connection(&self, connection_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_server_t::send_http200_response`] for more documentation."]
fn send_http200_response(
&self,
connection_id: ::std::os::raw::c_int,
content_type: Option<&CefString>,
data: Option<&[u8]>,
);
#[doc = "See [`_cef_server_t::send_http404_response`] for more documentation."]
fn send_http404_response(&self, connection_id: ::std::os::raw::c_int);
#[doc = "See [`_cef_server_t::send_http500_response`] for more documentation."]
fn send_http500_response(
&self,
connection_id: ::std::os::raw::c_int,
error_message: Option<&CefString>,
);
#[doc = "See [`_cef_server_t::send_http_response`] for more documentation."]
fn send_http_response(
&self,
connection_id: ::std::os::raw::c_int,
response_code: ::std::os::raw::c_int,
content_type: Option<&CefString>,
content_length: i64,
extra_headers: Option<&mut CefStringMultimap>,
);
#[doc = "See [`_cef_server_t::send_raw_data`] for more documentation."]
fn send_raw_data(&self, connection_id: ::std::os::raw::c_int, data: Option<&[u8]>);
#[doc = "See [`_cef_server_t::close_connection`] for more documentation."]
fn close_connection(&self, connection_id: ::std::os::raw::c_int);
#[doc = "See [`_cef_server_t::send_web_socket_message`] for more documentation."]
fn send_web_socket_message(&self, connection_id: ::std::os::raw::c_int, data: Option<&[u8]>);
fn get_raw(&self) -> *mut _cef_server_t;
}
impl ImplServer for Server {
fn task_runner(&self) -> Option<TaskRunner> {
unsafe {
self.0
.get_task_runner
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn shutdown(&self) {
unsafe {
if let Some(f) = self.0.shutdown {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn is_running(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_running
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn address(&self) -> CefStringUserfree {
unsafe {
self.0
.get_address
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_connection(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_connection
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_valid_connection(&self, connection_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid_connection
.map(|f| {
let arg_connection_id = connection_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_connection_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn send_http200_response(
&self,
connection_id: ::std::os::raw::c_int,
content_type: Option<&CefString>,
data: Option<&[u8]>,
) {
unsafe {
if let Some(f) = self.0.send_http200_response {
let (arg_connection_id, arg_content_type, arg_data) =
(connection_id, content_type, data);
let arg_self_ = self.into_raw();
let arg_content_type = arg_content_type
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_data_size = arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data = arg_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_connection_id,
arg_content_type,
arg_data,
arg_data_size,
);
}
}
}
fn send_http404_response(&self, connection_id: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.send_http404_response {
let arg_connection_id = connection_id;
let arg_self_ = self.into_raw();
f(arg_self_, arg_connection_id);
}
}
}
fn send_http500_response(
&self,
connection_id: ::std::os::raw::c_int,
error_message: Option<&CefString>,
) {
unsafe {
if let Some(f) = self.0.send_http500_response {
let (arg_connection_id, arg_error_message) = (connection_id, error_message);
let arg_self_ = self.into_raw();
let arg_error_message = arg_error_message
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_connection_id, arg_error_message);
}
}
}
fn send_http_response(
&self,
connection_id: ::std::os::raw::c_int,
response_code: ::std::os::raw::c_int,
content_type: Option<&CefString>,
content_length: i64,
extra_headers: Option<&mut CefStringMultimap>,
) {
unsafe {
if let Some(f) = self.0.send_http_response {
let (
arg_connection_id,
arg_response_code,
arg_content_type,
arg_content_length,
arg_extra_headers,
) = (
connection_id,
response_code,
content_type,
content_length,
extra_headers,
);
let arg_self_ = self.into_raw();
let arg_content_type = arg_content_type
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_extra_headers = arg_extra_headers
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_connection_id,
arg_response_code,
arg_content_type,
arg_content_length,
arg_extra_headers,
);
}
}
}
fn send_raw_data(&self, connection_id: ::std::os::raw::c_int, data: Option<&[u8]>) {
unsafe {
if let Some(f) = self.0.send_raw_data {
let (arg_connection_id, arg_data) = (connection_id, data);
let arg_self_ = self.into_raw();
let arg_data_size = arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data = arg_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(arg_self_, arg_connection_id, arg_data, arg_data_size);
}
}
}
fn close_connection(&self, connection_id: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.close_connection {
let arg_connection_id = connection_id;
let arg_self_ = self.into_raw();
f(arg_self_, arg_connection_id);
}
}
}
fn send_web_socket_message(&self, connection_id: ::std::os::raw::c_int, data: Option<&[u8]>) {
unsafe {
if let Some(f) = self.0.send_web_socket_message {
let (arg_connection_id, arg_data) = (connection_id, data);
let arg_self_ = self.into_raw();
let arg_data_size = arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data = arg_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(arg_self_, arg_connection_id, arg_data, arg_data_size);
}
}
}
fn get_raw(&self) -> *mut _cef_server_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_server_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Server {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_server_t> for &Server {
fn into_raw(self) -> *mut _cef_server_t {
ImplServer::get_raw(self)
}
}
impl ConvertParam<*mut _cef_server_t> for &mut Server {
fn into_raw(self) -> *mut _cef_server_t {
ImplServer::get_raw(self)
}
}
impl ConvertReturnValue<Server> for *mut _cef_server_t {
fn wrap_result(self) -> Server {
Server(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Server> for *mut _cef_server_t {
fn from(value: Server) -> Self {
let object = ImplServer::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_server_handler_t`] for more documentation.
#[derive(Clone)]
pub struct ServerHandler(RefGuard<_cef_server_handler_t>);
impl ServerHandler {
pub fn new<T>(interface: T) -> Self
where
T: WrapServerHandler,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplServerHandler>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapServerHandler>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_server_handler_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapServerHandler: ImplServerHandler {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_server_handler_t, Self>);
}
pub trait ImplServerHandler: Clone + Sized + Rc {
#[doc = "See [`_cef_server_handler_t::on_server_created`] for more documentation."]
fn on_server_created(&self, server: Option<&mut Server>) {}
#[doc = "See [`_cef_server_handler_t::on_server_destroyed`] for more documentation."]
fn on_server_destroyed(&self, server: Option<&mut Server>) {}
#[doc = "See [`_cef_server_handler_t::on_client_connected`] for more documentation."]
fn on_client_connected(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_server_handler_t::on_client_disconnected`] for more documentation."]
fn on_client_disconnected(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_server_handler_t::on_http_request`] for more documentation."]
fn on_http_request(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
client_address: Option<&CefString>,
request: Option<&mut Request>,
) {
}
#[doc = "See [`_cef_server_handler_t::on_web_socket_request`] for more documentation."]
fn on_web_socket_request(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
client_address: Option<&CefString>,
request: Option<&mut Request>,
callback: Option<&mut Callback>,
) {
}
#[doc = "See [`_cef_server_handler_t::on_web_socket_connected`] for more documentation."]
fn on_web_socket_connected(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_server_handler_t::on_web_socket_message`] for more documentation."]
fn on_web_socket_message(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
data: Option<&[u8]>,
) {
}
fn init_methods(object: &mut _cef_server_handler_t) {
impl_cef_server_handler_t::init_methods::<Self, _cef_server_handler_t>(object);
}
fn get_raw(&self) -> *mut _cef_server_handler_t;
}
#[doc = "Implement the [`WrapServerHandler`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ServerHandler` block you can override default\nmethods implemented by the [`ImplServerHandler`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_server_handler! {\n struct MyServerHandler {\n payload: String,\n }\n\n impl ServerHandler {\n // ...\n }\n}\n\nfn make_my_struct() -> ServerHandler {\n MyServerHandler::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_server_handler { ($ vis : vis struct $ name : ident ; impl ServerHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_server_handler ! { $ vis struct $ name { } impl ServerHandler { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ServerHandler { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_server_handler_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ServerHandler { ServerHandler :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapServerHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_server_handler_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplServerHandler for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_server_handler_t { self . cef_object . cast () } } } ; }
mod impl_cef_server_handler_t {
use super::*;
pub fn init_methods<I: ImplServerHandler, R: Rc>(object: &mut _cef_server_handler_t) {
object.on_server_created = Some(on_server_created::<I, R>);
object.on_server_destroyed = Some(on_server_destroyed::<I, R>);
object.on_client_connected = Some(on_client_connected::<I, R>);
object.on_client_disconnected = Some(on_client_disconnected::<I, R>);
object.on_http_request = Some(on_http_request::<I, R>);
object.on_web_socket_request = Some(on_web_socket_request::<I, R>);
object.on_web_socket_connected = Some(on_web_socket_connected::<I, R>);
object.on_web_socket_message = Some(on_web_socket_message::<I, R>);
}
extern "C" fn on_server_created<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
) {
let (arg_self_, arg_server) = (self_, server);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
ImplServerHandler::on_server_created(&arg_self_.interface, arg_server)
}
extern "C" fn on_server_destroyed<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
) {
let (arg_self_, arg_server) = (self_, server);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
ImplServerHandler::on_server_destroyed(&arg_self_.interface, arg_server)
}
extern "C" fn on_client_connected<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
connection_id: ::std::os::raw::c_int,
) {
let (arg_self_, arg_server, arg_connection_id) = (self_, server, connection_id);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
let arg_connection_id = arg_connection_id.into_raw();
ImplServerHandler::on_client_connected(&arg_self_.interface, arg_server, arg_connection_id)
}
extern "C" fn on_client_disconnected<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
connection_id: ::std::os::raw::c_int,
) {
let (arg_self_, arg_server, arg_connection_id) = (self_, server, connection_id);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
let arg_connection_id = arg_connection_id.into_raw();
ImplServerHandler::on_client_disconnected(
&arg_self_.interface,
arg_server,
arg_connection_id,
)
}
extern "C" fn on_http_request<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
connection_id: ::std::os::raw::c_int,
client_address: *const cef_string_t,
request: *mut _cef_request_t,
) {
let (arg_self_, arg_server, arg_connection_id, arg_client_address, arg_request) =
(self_, server, connection_id, client_address, request);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
let arg_connection_id = arg_connection_id.into_raw();
let arg_client_address = if arg_client_address.is_null() {
None
} else {
Some(arg_client_address.into())
};
let arg_client_address = arg_client_address.as_ref();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
ImplServerHandler::on_http_request(
&arg_self_.interface,
arg_server,
arg_connection_id,
arg_client_address,
arg_request,
)
}
extern "C" fn on_web_socket_request<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
connection_id: ::std::os::raw::c_int,
client_address: *const cef_string_t,
request: *mut _cef_request_t,
callback: *mut _cef_callback_t,
) {
let (
arg_self_,
arg_server,
arg_connection_id,
arg_client_address,
arg_request,
arg_callback,
) = (
self_,
server,
connection_id,
client_address,
request,
callback,
);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
let arg_connection_id = arg_connection_id.into_raw();
let arg_client_address = if arg_client_address.is_null() {
None
} else {
Some(arg_client_address.into())
};
let arg_client_address = arg_client_address.as_ref();
let mut arg_request =
unsafe { arg_request.as_mut() }.map(|arg| Request(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| Callback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplServerHandler::on_web_socket_request(
&arg_self_.interface,
arg_server,
arg_connection_id,
arg_client_address,
arg_request,
arg_callback,
)
}
extern "C" fn on_web_socket_connected<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
connection_id: ::std::os::raw::c_int,
) {
let (arg_self_, arg_server, arg_connection_id) = (self_, server, connection_id);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
let arg_connection_id = arg_connection_id.into_raw();
ImplServerHandler::on_web_socket_connected(
&arg_self_.interface,
arg_server,
arg_connection_id,
)
}
extern "C" fn on_web_socket_message<I: ImplServerHandler, R: Rc>(
self_: *mut _cef_server_handler_t,
server: *mut _cef_server_t,
connection_id: ::std::os::raw::c_int,
data: *const ::std::os::raw::c_void,
data_size: usize,
) {
let (arg_self_, arg_server, arg_connection_id, arg_data, arg_data_size) =
(self_, server, connection_id, data, data_size);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_server =
unsafe { arg_server.as_mut() }.map(|arg| Server(unsafe { RefGuard::from_raw(arg) }));
let arg_server = arg_server.as_mut();
let arg_connection_id = arg_connection_id.into_raw();
let arg_data = (!arg_data.is_null() && arg_data_size > 0)
.then(|| unsafe { std::slice::from_raw_parts(arg_data.cast(), arg_data_size) });
ImplServerHandler::on_web_socket_message(
&arg_self_.interface,
arg_server,
arg_connection_id,
arg_data,
)
}
}
impl ImplServerHandler for ServerHandler {
fn on_server_created(&self, server: Option<&mut Server>) {
unsafe {
if let Some(f) = self.0.on_server_created {
let arg_server = server;
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_server);
}
}
}
fn on_server_destroyed(&self, server: Option<&mut Server>) {
unsafe {
if let Some(f) = self.0.on_server_destroyed {
let arg_server = server;
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_server);
}
}
}
fn on_client_connected(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_client_connected {
let (arg_server, arg_connection_id) = (server, connection_id);
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_server, arg_connection_id);
}
}
}
fn on_client_disconnected(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_client_disconnected {
let (arg_server, arg_connection_id) = (server, connection_id);
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_server, arg_connection_id);
}
}
}
fn on_http_request(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
client_address: Option<&CefString>,
request: Option<&mut Request>,
) {
unsafe {
if let Some(f) = self.0.on_http_request {
let (arg_server, arg_connection_id, arg_client_address, arg_request) =
(server, connection_id, client_address, request);
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_client_address = arg_client_address
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_server,
arg_connection_id,
arg_client_address,
arg_request,
);
}
}
}
fn on_web_socket_request(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
client_address: Option<&CefString>,
request: Option<&mut Request>,
callback: Option<&mut Callback>,
) {
unsafe {
if let Some(f) = self.0.on_web_socket_request {
let (arg_server, arg_connection_id, arg_client_address, arg_request, arg_callback) =
(server, connection_id, client_address, request, callback);
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_client_address = arg_client_address
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_server,
arg_connection_id,
arg_client_address,
arg_request,
arg_callback,
);
}
}
}
fn on_web_socket_connected(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_web_socket_connected {
let (arg_server, arg_connection_id) = (server, connection_id);
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_server, arg_connection_id);
}
}
}
fn on_web_socket_message(
&self,
server: Option<&mut Server>,
connection_id: ::std::os::raw::c_int,
data: Option<&[u8]>,
) {
unsafe {
if let Some(f) = self.0.on_web_socket_message {
let (arg_server, arg_connection_id, arg_data) = (server, connection_id, data);
let arg_self_ = self.into_raw();
let arg_server = arg_server
.map(|arg| {
arg.add_ref();
ImplServer::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_data_size = arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data = arg_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
f(
arg_self_,
arg_server,
arg_connection_id,
arg_data,
arg_data_size,
);
}
}
}
fn get_raw(&self) -> *mut _cef_server_handler_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_server_handler_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ServerHandler {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_server_handler_t> for &ServerHandler {
fn into_raw(self) -> *mut _cef_server_handler_t {
ImplServerHandler::get_raw(self)
}
}
impl ConvertParam<*mut _cef_server_handler_t> for &mut ServerHandler {
fn into_raw(self) -> *mut _cef_server_handler_t {
ImplServerHandler::get_raw(self)
}
}
impl ConvertReturnValue<ServerHandler> for *mut _cef_server_handler_t {
fn wrap_result(self) -> ServerHandler {
ServerHandler(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ServerHandler> for *mut _cef_server_handler_t {
fn from(value: ServerHandler) -> Self {
let object = ImplServerHandler::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_shared_process_message_builder_t`] for more documentation.
#[derive(Clone)]
pub struct SharedProcessMessageBuilder(RefGuard<_cef_shared_process_message_builder_t>);
pub trait ImplSharedProcessMessageBuilder: Clone + Sized + Rc {
#[doc = "See [`_cef_shared_process_message_builder_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_shared_process_message_builder_t::size`] for more documentation."]
fn size(&self) -> usize;
#[doc = "See [`_cef_shared_process_message_builder_t::memory`] for more documentation."]
fn memory(&self) -> *mut ::std::os::raw::c_void;
#[doc = "See [`_cef_shared_process_message_builder_t::build`] for more documentation."]
fn build(&self) -> Option<ProcessMessage>;
fn get_raw(&self) -> *mut _cef_shared_process_message_builder_t;
}
impl ImplSharedProcessMessageBuilder for SharedProcessMessageBuilder {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn size(&self) -> usize {
unsafe {
self.0
.size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn memory(&self) -> *mut ::std::os::raw::c_void {
unsafe {
self.0
.memory
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_else(|| std::mem::zeroed())
}
}
fn build(&self) -> Option<ProcessMessage> {
unsafe {
self.0
.build
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_shared_process_message_builder_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_shared_process_message_builder_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for SharedProcessMessageBuilder {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_shared_process_message_builder_t> for &SharedProcessMessageBuilder {
fn into_raw(self) -> *mut _cef_shared_process_message_builder_t {
ImplSharedProcessMessageBuilder::get_raw(self)
}
}
impl ConvertParam<*mut _cef_shared_process_message_builder_t> for &mut SharedProcessMessageBuilder {
fn into_raw(self) -> *mut _cef_shared_process_message_builder_t {
ImplSharedProcessMessageBuilder::get_raw(self)
}
}
impl ConvertReturnValue<SharedProcessMessageBuilder>
for *mut _cef_shared_process_message_builder_t
{
fn wrap_result(self) -> SharedProcessMessageBuilder {
SharedProcessMessageBuilder(unsafe { RefGuard::from_raw(self) })
}
}
impl From<SharedProcessMessageBuilder> for *mut _cef_shared_process_message_builder_t {
fn from(value: SharedProcessMessageBuilder) -> Self {
let object = ImplSharedProcessMessageBuilder::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_task_manager_t`] for more documentation.
#[derive(Clone)]
pub struct TaskManager(RefGuard<_cef_task_manager_t>);
pub trait ImplTaskManager: Clone + Sized + Rc {
#[doc = "See [`_cef_task_manager_t::get_tasks_count`] for more documentation."]
fn tasks_count(&self) -> usize;
#[doc = "See [`_cef_task_manager_t::get_task_ids_list`] for more documentation."]
fn task_ids_list(&self, task_ids: Option<&mut Vec<i64>>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_task_manager_t::get_task_info`] for more documentation."]
fn task_info(&self, task_id: i64, info: Option<&mut TaskInfo>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_task_manager_t::kill_task`] for more documentation."]
fn kill_task(&self, task_id: i64) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_task_manager_t::get_task_id_for_browser_id`] for more documentation."]
fn task_id_for_browser_id(&self, browser_id: ::std::os::raw::c_int) -> i64;
fn get_raw(&self) -> *mut _cef_task_manager_t;
}
impl ImplTaskManager for TaskManager {
fn tasks_count(&self) -> usize {
unsafe {
self.0
.get_tasks_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn task_ids_list(&self, task_ids: Option<&mut Vec<i64>>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_task_ids_list
.map(|f| {
let arg_task_ids = task_ids;
let arg_self_ = self.into_raw();
let mut out_task_ids_count = arg_task_ids
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_task_ids_count = &mut out_task_ids_count;
let out_task_ids = arg_task_ids;
let mut vec_task_ids = out_task_ids
.as_ref()
.map(|arg| arg.to_vec())
.unwrap_or_default();
let arg_task_ids = if vec_task_ids.is_empty() {
std::ptr::null_mut()
} else {
vec_task_ids.as_mut_ptr()
};
let result = f(arg_self_, arg_task_ids_count, arg_task_ids);
if let Some(out_task_ids) = out_task_ids {
*out_task_ids = vec_task_ids
.into_iter()
.take(out_task_ids_count)
.map(|elem| elem.wrap_result())
.collect();
}
result.wrap_result()
})
.unwrap_or_default()
}
}
fn task_info(&self, task_id: i64, info: Option<&mut TaskInfo>) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_task_info
.map(|f| {
let (arg_task_id, arg_info) = (task_id, info);
let arg_self_ = self.into_raw();
let mut arg_info = arg_info.cloned().map(|arg| arg.into());
let arg_info = arg_info
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_task_id, arg_info);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn kill_task(&self, task_id: i64) -> ::std::os::raw::c_int {
unsafe {
self.0
.kill_task
.map(|f| {
let arg_task_id = task_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_task_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn task_id_for_browser_id(&self, browser_id: ::std::os::raw::c_int) -> i64 {
unsafe {
self.0
.get_task_id_for_browser_id
.map(|f| {
let arg_browser_id = browser_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_browser_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_task_manager_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_task_manager_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for TaskManager {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_task_manager_t> for &TaskManager {
fn into_raw(self) -> *mut _cef_task_manager_t {
ImplTaskManager::get_raw(self)
}
}
impl ConvertParam<*mut _cef_task_manager_t> for &mut TaskManager {
fn into_raw(self) -> *mut _cef_task_manager_t {
ImplTaskManager::get_raw(self)
}
}
impl ConvertReturnValue<TaskManager> for *mut _cef_task_manager_t {
fn wrap_result(self) -> TaskManager {
TaskManager(unsafe { RefGuard::from_raw(self) })
}
}
impl From<TaskManager> for *mut _cef_task_manager_t {
fn from(value: TaskManager) -> Self {
let object = ImplTaskManager::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_thread_t`] for more documentation.
#[derive(Clone)]
pub struct Thread(RefGuard<_cef_thread_t>);
pub trait ImplThread: Clone + Sized + Rc {
#[doc = "See [`_cef_thread_t::get_task_runner`] for more documentation."]
fn task_runner(&self) -> Option<TaskRunner>;
#[doc = "See [`_cef_thread_t::get_platform_thread_id`] for more documentation."]
fn platform_thread_id(&self) -> cef_platform_thread_id_t;
#[doc = "See [`_cef_thread_t::stop`] for more documentation."]
fn stop(&self);
#[doc = "See [`_cef_thread_t::is_running`] for more documentation."]
fn is_running(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_thread_t;
}
impl ImplThread for Thread {
fn task_runner(&self) -> Option<TaskRunner> {
unsafe {
self.0
.get_task_runner
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn platform_thread_id(&self) -> cef_platform_thread_id_t {
unsafe {
self.0
.get_platform_thread_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn stop(&self) {
unsafe {
if let Some(f) = self.0.stop {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn is_running(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_running
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_thread_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_thread_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Thread {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_thread_t> for &Thread {
fn into_raw(self) -> *mut _cef_thread_t {
ImplThread::get_raw(self)
}
}
impl ConvertParam<*mut _cef_thread_t> for &mut Thread {
fn into_raw(self) -> *mut _cef_thread_t {
ImplThread::get_raw(self)
}
}
impl ConvertReturnValue<Thread> for *mut _cef_thread_t {
fn wrap_result(self) -> Thread {
Thread(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Thread> for *mut _cef_thread_t {
fn from(value: Thread) -> Self {
let object = ImplThread::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_end_tracing_callback_t`] for more documentation.
#[derive(Clone)]
pub struct EndTracingCallback(RefGuard<_cef_end_tracing_callback_t>);
impl EndTracingCallback {
pub fn new<T>(interface: T) -> Self
where
T: WrapEndTracingCallback,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplEndTracingCallback>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapEndTracingCallback>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_end_tracing_callback_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapEndTracingCallback: ImplEndTracingCallback {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_end_tracing_callback_t, Self>);
}
pub trait ImplEndTracingCallback: Clone + Sized + Rc {
#[doc = "See [`_cef_end_tracing_callback_t::on_end_tracing_complete`] for more documentation."]
fn on_end_tracing_complete(&self, tracing_file: Option<&CefString>) {}
fn init_methods(object: &mut _cef_end_tracing_callback_t) {
impl_cef_end_tracing_callback_t::init_methods::<Self, _cef_end_tracing_callback_t>(object);
}
fn get_raw(&self) -> *mut _cef_end_tracing_callback_t;
}
#[doc = "Implement the [`WrapEndTracingCallback`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl EndTracingCallback` block you can override default\nmethods implemented by the [`ImplEndTracingCallback`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_end_tracing_callback! {\n struct MyEndTracingCallback {\n payload: String,\n }\n\n impl EndTracingCallback {\n // ...\n }\n}\n\nfn make_my_struct() -> EndTracingCallback {\n MyEndTracingCallback::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_end_tracing_callback { ($ vis : vis struct $ name : ident ; impl EndTracingCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_end_tracing_callback ! { $ vis struct $ name { } impl EndTracingCallback { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl EndTracingCallback { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_end_tracing_callback_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> EndTracingCallback { EndTracingCallback :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapEndTracingCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_end_tracing_callback_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplEndTracingCallback for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_end_tracing_callback_t { self . cef_object . cast () } } } ; }
mod impl_cef_end_tracing_callback_t {
use super::*;
pub fn init_methods<I: ImplEndTracingCallback, R: Rc>(
object: &mut _cef_end_tracing_callback_t,
) {
object.on_end_tracing_complete = Some(on_end_tracing_complete::<I, R>);
}
extern "C" fn on_end_tracing_complete<I: ImplEndTracingCallback, R: Rc>(
self_: *mut _cef_end_tracing_callback_t,
tracing_file: *const cef_string_t,
) {
let (arg_self_, arg_tracing_file) = (self_, tracing_file);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_tracing_file = if arg_tracing_file.is_null() {
None
} else {
Some(arg_tracing_file.into())
};
let arg_tracing_file = arg_tracing_file.as_ref();
ImplEndTracingCallback::on_end_tracing_complete(&arg_self_.interface, arg_tracing_file)
}
}
impl ImplEndTracingCallback for EndTracingCallback {
fn on_end_tracing_complete(&self, tracing_file: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.on_end_tracing_complete {
let arg_tracing_file = tracing_file;
let arg_self_ = self.into_raw();
let arg_tracing_file = arg_tracing_file
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_tracing_file);
}
}
}
fn get_raw(&self) -> *mut _cef_end_tracing_callback_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_end_tracing_callback_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for EndTracingCallback {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_end_tracing_callback_t> for &EndTracingCallback {
fn into_raw(self) -> *mut _cef_end_tracing_callback_t {
ImplEndTracingCallback::get_raw(self)
}
}
impl ConvertParam<*mut _cef_end_tracing_callback_t> for &mut EndTracingCallback {
fn into_raw(self) -> *mut _cef_end_tracing_callback_t {
ImplEndTracingCallback::get_raw(self)
}
}
impl ConvertReturnValue<EndTracingCallback> for *mut _cef_end_tracing_callback_t {
fn wrap_result(self) -> EndTracingCallback {
EndTracingCallback(unsafe { RefGuard::from_raw(self) })
}
}
impl From<EndTracingCallback> for *mut _cef_end_tracing_callback_t {
fn from(value: EndTracingCallback) -> Self {
let object = ImplEndTracingCallback::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_urlrequest_t`] for more documentation.
#[derive(Clone)]
pub struct Urlrequest(RefGuard<_cef_urlrequest_t>);
pub trait ImplUrlrequest: Clone + Sized + Rc {
#[doc = "See [`_cef_urlrequest_t::get_request`] for more documentation."]
fn request(&self) -> Option<Request>;
#[doc = "See [`_cef_urlrequest_t::get_client`] for more documentation."]
fn client(&self) -> Option<UrlrequestClient>;
#[doc = "See [`_cef_urlrequest_t::get_request_status`] for more documentation."]
fn request_status(&self) -> UrlrequestStatus;
#[doc = "See [`_cef_urlrequest_t::get_request_error`] for more documentation."]
fn request_error(&self) -> Errorcode;
#[doc = "See [`_cef_urlrequest_t::get_response`] for more documentation."]
fn response(&self) -> Option<Response>;
#[doc = "See [`_cef_urlrequest_t::response_was_cached`] for more documentation."]
fn response_was_cached(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_urlrequest_t::cancel`] for more documentation."]
fn cancel(&self);
fn get_raw(&self) -> *mut _cef_urlrequest_t;
}
impl ImplUrlrequest for Urlrequest {
fn request(&self) -> Option<Request> {
unsafe {
self.0
.get_request
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn client(&self) -> Option<UrlrequestClient> {
unsafe {
self.0
.get_client
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn request_status(&self) -> UrlrequestStatus {
unsafe {
self.0
.get_request_status
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn request_error(&self) -> Errorcode {
unsafe {
self.0
.get_request_error
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn response(&self) -> Option<Response> {
unsafe {
self.0
.get_response
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn response_was_cached(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.response_was_cached
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn cancel(&self) {
unsafe {
if let Some(f) = self.0.cancel {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_urlrequest_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_urlrequest_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Urlrequest {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_urlrequest_t> for &Urlrequest {
fn into_raw(self) -> *mut _cef_urlrequest_t {
ImplUrlrequest::get_raw(self)
}
}
impl ConvertParam<*mut _cef_urlrequest_t> for &mut Urlrequest {
fn into_raw(self) -> *mut _cef_urlrequest_t {
ImplUrlrequest::get_raw(self)
}
}
impl ConvertReturnValue<Urlrequest> for *mut _cef_urlrequest_t {
fn wrap_result(self) -> Urlrequest {
Urlrequest(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Urlrequest> for *mut _cef_urlrequest_t {
fn from(value: Urlrequest) -> Self {
let object = ImplUrlrequest::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_urlrequest_client_t`] for more documentation.
#[derive(Clone)]
pub struct UrlrequestClient(RefGuard<_cef_urlrequest_client_t>);
impl UrlrequestClient {
pub fn new<T>(interface: T) -> Self
where
T: WrapUrlrequestClient,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplUrlrequestClient>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapUrlrequestClient>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_urlrequest_client_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapUrlrequestClient: ImplUrlrequestClient {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_urlrequest_client_t, Self>);
}
pub trait ImplUrlrequestClient: Clone + Sized + Rc {
#[doc = "See [`_cef_urlrequest_client_t::on_request_complete`] for more documentation."]
fn on_request_complete(&self, request: Option<&mut Urlrequest>) {}
#[doc = "See [`_cef_urlrequest_client_t::on_upload_progress`] for more documentation."]
fn on_upload_progress(&self, request: Option<&mut Urlrequest>, current: i64, total: i64) {}
#[doc = "See [`_cef_urlrequest_client_t::on_download_progress`] for more documentation."]
fn on_download_progress(&self, request: Option<&mut Urlrequest>, current: i64, total: i64) {}
#[doc = "See [`_cef_urlrequest_client_t::on_download_data`] for more documentation."]
fn on_download_data(
&self,
request: Option<&mut Urlrequest>,
data: *const u8,
data_length: usize,
) {
}
#[doc = "See [`_cef_urlrequest_client_t::get_auth_credentials`] for more documentation."]
fn auth_credentials(
&self,
is_proxy: ::std::os::raw::c_int,
host: Option<&CefString>,
port: ::std::os::raw::c_int,
realm: Option<&CefString>,
scheme: Option<&CefString>,
callback: Option<&mut AuthCallback>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_urlrequest_client_t) {
impl_cef_urlrequest_client_t::init_methods::<Self, _cef_urlrequest_client_t>(object);
}
fn get_raw(&self) -> *mut _cef_urlrequest_client_t;
}
#[doc = "Implement the [`WrapUrlrequestClient`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl UrlrequestClient` block you can override default\nmethods implemented by the [`ImplUrlrequestClient`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_urlrequest_client! {\n struct MyUrlrequestClient {\n payload: String,\n }\n\n impl UrlrequestClient {\n // ...\n }\n}\n\nfn make_my_struct() -> UrlrequestClient {\n MyUrlrequestClient::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_urlrequest_client { ($ vis : vis struct $ name : ident ; impl UrlrequestClient { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_urlrequest_client ! { $ vis struct $ name { } impl UrlrequestClient { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl UrlrequestClient { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_urlrequest_client_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> UrlrequestClient { UrlrequestClient :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapUrlrequestClient for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_urlrequest_client_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplUrlrequestClient for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_urlrequest_client_t { self . cef_object . cast () } } } ; }
mod impl_cef_urlrequest_client_t {
use super::*;
pub fn init_methods<I: ImplUrlrequestClient, R: Rc>(object: &mut _cef_urlrequest_client_t) {
object.on_request_complete = Some(on_request_complete::<I, R>);
object.on_upload_progress = Some(on_upload_progress::<I, R>);
object.on_download_progress = Some(on_download_progress::<I, R>);
object.on_download_data = Some(on_download_data::<I, R>);
object.get_auth_credentials = Some(get_auth_credentials::<I, R>);
}
extern "C" fn on_request_complete<I: ImplUrlrequestClient, R: Rc>(
self_: *mut _cef_urlrequest_client_t,
request: *mut _cef_urlrequest_t,
) {
let (arg_self_, arg_request) = (self_, request);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_request = unsafe { arg_request.as_mut() }
.map(|arg| Urlrequest(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
ImplUrlrequestClient::on_request_complete(&arg_self_.interface, arg_request)
}
extern "C" fn on_upload_progress<I: ImplUrlrequestClient, R: Rc>(
self_: *mut _cef_urlrequest_client_t,
request: *mut _cef_urlrequest_t,
current: i64,
total: i64,
) {
let (arg_self_, arg_request, arg_current, arg_total) = (self_, request, current, total);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_request = unsafe { arg_request.as_mut() }
.map(|arg| Urlrequest(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let arg_current = arg_current.into_raw();
let arg_total = arg_total.into_raw();
ImplUrlrequestClient::on_upload_progress(
&arg_self_.interface,
arg_request,
arg_current,
arg_total,
)
}
extern "C" fn on_download_progress<I: ImplUrlrequestClient, R: Rc>(
self_: *mut _cef_urlrequest_client_t,
request: *mut _cef_urlrequest_t,
current: i64,
total: i64,
) {
let (arg_self_, arg_request, arg_current, arg_total) = (self_, request, current, total);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_request = unsafe { arg_request.as_mut() }
.map(|arg| Urlrequest(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let arg_current = arg_current.into_raw();
let arg_total = arg_total.into_raw();
ImplUrlrequestClient::on_download_progress(
&arg_self_.interface,
arg_request,
arg_current,
arg_total,
)
}
extern "C" fn on_download_data<I: ImplUrlrequestClient, R: Rc>(
self_: *mut _cef_urlrequest_client_t,
request: *mut _cef_urlrequest_t,
data: *const ::std::os::raw::c_void,
data_length: usize,
) {
let (arg_self_, arg_request, arg_data, arg_data_length) =
(self_, request, data, data_length);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_request = unsafe { arg_request.as_mut() }
.map(|arg| Urlrequest(unsafe { RefGuard::from_raw(arg) }));
let arg_request = arg_request.as_mut();
let arg_data = arg_data.cast();
let arg_data_length = arg_data_length.into_raw();
ImplUrlrequestClient::on_download_data(
&arg_self_.interface,
arg_request,
arg_data,
arg_data_length,
)
}
extern "C" fn get_auth_credentials<I: ImplUrlrequestClient, R: Rc>(
self_: *mut _cef_urlrequest_client_t,
is_proxy: ::std::os::raw::c_int,
host: *const cef_string_t,
port: ::std::os::raw::c_int,
realm: *const cef_string_t,
scheme: *const cef_string_t,
callback: *mut _cef_auth_callback_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_is_proxy, arg_host, arg_port, arg_realm, arg_scheme, arg_callback) =
(self_, is_proxy, host, port, realm, scheme, callback);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let arg_is_proxy = arg_is_proxy.into_raw();
let arg_host = if arg_host.is_null() {
None
} else {
Some(arg_host.into())
};
let arg_host = arg_host.as_ref();
let arg_port = arg_port.into_raw();
let arg_realm = if arg_realm.is_null() {
None
} else {
Some(arg_realm.into())
};
let arg_realm = arg_realm.as_ref();
let arg_scheme = if arg_scheme.is_null() {
None
} else {
Some(arg_scheme.into())
};
let arg_scheme = arg_scheme.as_ref();
let mut arg_callback = unsafe { arg_callback.as_mut() }
.map(|arg| AuthCallback(unsafe { RefGuard::from_raw(arg) }));
let arg_callback = arg_callback.as_mut();
ImplUrlrequestClient::auth_credentials(
&arg_self_.interface,
arg_is_proxy,
arg_host,
arg_port,
arg_realm,
arg_scheme,
arg_callback,
)
}
}
impl ImplUrlrequestClient for UrlrequestClient {
fn on_request_complete(&self, request: Option<&mut Urlrequest>) {
unsafe {
if let Some(f) = self.0.on_request_complete {
let arg_request = request;
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplUrlrequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_request);
}
}
}
fn on_upload_progress(&self, request: Option<&mut Urlrequest>, current: i64, total: i64) {
unsafe {
if let Some(f) = self.0.on_upload_progress {
let (arg_request, arg_current, arg_total) = (request, current, total);
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplUrlrequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_request, arg_current, arg_total);
}
}
}
fn on_download_progress(&self, request: Option<&mut Urlrequest>, current: i64, total: i64) {
unsafe {
if let Some(f) = self.0.on_download_progress {
let (arg_request, arg_current, arg_total) = (request, current, total);
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplUrlrequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_request, arg_current, arg_total);
}
}
}
fn on_download_data(
&self,
request: Option<&mut Urlrequest>,
data: *const u8,
data_length: usize,
) {
unsafe {
if let Some(f) = self.0.on_download_data {
let (arg_request, arg_data, arg_data_length) = (request, data, data_length);
let arg_self_ = self.into_raw();
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplUrlrequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_data = arg_data.cast();
f(arg_self_, arg_request, arg_data, arg_data_length);
}
}
}
fn auth_credentials(
&self,
is_proxy: ::std::os::raw::c_int,
host: Option<&CefString>,
port: ::std::os::raw::c_int,
realm: Option<&CefString>,
scheme: Option<&CefString>,
callback: Option<&mut AuthCallback>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_auth_credentials
.map(|f| {
let (arg_is_proxy, arg_host, arg_port, arg_realm, arg_scheme, arg_callback) =
(is_proxy, host, port, realm, scheme, callback);
let arg_self_ = self.into_raw();
let arg_host = arg_host
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_realm = arg_realm
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_scheme = arg_scheme
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplAuthCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_is_proxy,
arg_host,
arg_port,
arg_realm,
arg_scheme,
arg_callback,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_urlrequest_client_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_urlrequest_client_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for UrlrequestClient {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_urlrequest_client_t> for &UrlrequestClient {
fn into_raw(self) -> *mut _cef_urlrequest_client_t {
ImplUrlrequestClient::get_raw(self)
}
}
impl ConvertParam<*mut _cef_urlrequest_client_t> for &mut UrlrequestClient {
fn into_raw(self) -> *mut _cef_urlrequest_client_t {
ImplUrlrequestClient::get_raw(self)
}
}
impl ConvertReturnValue<UrlrequestClient> for *mut _cef_urlrequest_client_t {
fn wrap_result(self) -> UrlrequestClient {
UrlrequestClient(unsafe { RefGuard::from_raw(self) })
}
}
impl From<UrlrequestClient> for *mut _cef_urlrequest_client_t {
fn from(value: UrlrequestClient) -> Self {
let object = ImplUrlrequestClient::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_waitable_event_t`] for more documentation.
#[derive(Clone)]
pub struct WaitableEvent(RefGuard<_cef_waitable_event_t>);
pub trait ImplWaitableEvent: Clone + Sized + Rc {
#[doc = "See [`_cef_waitable_event_t::reset`] for more documentation."]
fn reset(&self);
#[doc = "See [`_cef_waitable_event_t::signal`] for more documentation."]
fn signal(&self);
#[doc = "See [`_cef_waitable_event_t::is_signaled`] for more documentation."]
fn is_signaled(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_waitable_event_t::wait`] for more documentation."]
fn wait(&self);
#[doc = "See [`_cef_waitable_event_t::timed_wait`] for more documentation."]
fn timed_wait(&self, max_ms: i64) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_waitable_event_t;
}
impl ImplWaitableEvent for WaitableEvent {
fn reset(&self) {
unsafe {
if let Some(f) = self.0.reset {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn signal(&self) {
unsafe {
if let Some(f) = self.0.signal {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn is_signaled(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_signaled
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn wait(&self) {
unsafe {
if let Some(f) = self.0.wait {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn timed_wait(&self, max_ms: i64) -> ::std::os::raw::c_int {
unsafe {
self.0
.timed_wait
.map(|f| {
let arg_max_ms = max_ms;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_max_ms);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_waitable_event_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_waitable_event_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for WaitableEvent {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_waitable_event_t> for &WaitableEvent {
fn into_raw(self) -> *mut _cef_waitable_event_t {
ImplWaitableEvent::get_raw(self)
}
}
impl ConvertParam<*mut _cef_waitable_event_t> for &mut WaitableEvent {
fn into_raw(self) -> *mut _cef_waitable_event_t {
ImplWaitableEvent::get_raw(self)
}
}
impl ConvertReturnValue<WaitableEvent> for *mut _cef_waitable_event_t {
fn wrap_result(self) -> WaitableEvent {
WaitableEvent(unsafe { RefGuard::from_raw(self) })
}
}
impl From<WaitableEvent> for *mut _cef_waitable_event_t {
fn from(value: WaitableEvent) -> Self {
let object = ImplWaitableEvent::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_xml_reader_t`] for more documentation.
#[derive(Clone)]
pub struct XmlReader(RefGuard<_cef_xml_reader_t>);
pub trait ImplXmlReader: Clone + Sized + Rc {
#[doc = "See [`_cef_xml_reader_t::move_to_next_node`] for more documentation."]
fn move_to_next_node(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::close`] for more documentation."]
fn close(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::has_error`] for more documentation."]
fn has_error(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::get_error`] for more documentation."]
fn error(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_type`] for more documentation."]
fn get_type(&self) -> XmlNodeType;
#[doc = "See [`_cef_xml_reader_t::get_depth`] for more documentation."]
fn depth(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::get_local_name`] for more documentation."]
fn local_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_prefix`] for more documentation."]
fn prefix(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_qualified_name`] for more documentation."]
fn qualified_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_namespace_uri`] for more documentation."]
fn namespace_uri(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_base_uri`] for more documentation."]
fn base_uri(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_xml_lang`] for more documentation."]
fn xml_lang(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::is_empty_element`] for more documentation."]
fn is_empty_element(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::has_value`] for more documentation."]
fn has_value(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::get_value`] for more documentation."]
fn value(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::has_attributes`] for more documentation."]
fn has_attributes(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::get_attribute_count`] for more documentation."]
fn attribute_count(&self) -> usize;
#[doc = "See [`_cef_xml_reader_t::get_attribute_byindex`] for more documentation."]
fn attribute_byindex(&self, index: ::std::os::raw::c_int) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_attribute_byqname`] for more documentation."]
fn attribute_byqname(&self, qualified_name: Option<&CefString>) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_attribute_bylname`] for more documentation."]
fn attribute_bylname(
&self,
local_name: Option<&CefString>,
namespace_uri: Option<&CefString>,
) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_inner_xml`] for more documentation."]
fn inner_xml(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_outer_xml`] for more documentation."]
fn outer_xml(&self) -> CefStringUserfree;
#[doc = "See [`_cef_xml_reader_t::get_line_number`] for more documentation."]
fn line_number(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::move_to_attribute_byindex`] for more documentation."]
fn move_to_attribute_byindex(&self, index: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::move_to_attribute_byqname`] for more documentation."]
fn move_to_attribute_byqname(
&self,
qualified_name: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::move_to_attribute_bylname`] for more documentation."]
fn move_to_attribute_bylname(
&self,
local_name: Option<&CefString>,
namespace_uri: Option<&CefString>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::move_to_first_attribute`] for more documentation."]
fn move_to_first_attribute(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::move_to_next_attribute`] for more documentation."]
fn move_to_next_attribute(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_xml_reader_t::move_to_carrying_element`] for more documentation."]
fn move_to_carrying_element(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_xml_reader_t;
}
impl ImplXmlReader for XmlReader {
fn move_to_next_node(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_next_node
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn close(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.close
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_error(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_error
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn error(&self) -> CefStringUserfree {
unsafe {
self.0
.get_error
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_type(&self) -> XmlNodeType {
unsafe {
self.0
.get_type
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn depth(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_depth
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn local_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_local_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn prefix(&self) -> CefStringUserfree {
unsafe {
self.0
.get_prefix
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn qualified_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_qualified_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn namespace_uri(&self) -> CefStringUserfree {
unsafe {
self.0
.get_namespace_uri
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn base_uri(&self) -> CefStringUserfree {
unsafe {
self.0
.get_base_uri
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn xml_lang(&self) -> CefStringUserfree {
unsafe {
self.0
.get_xml_lang
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_empty_element(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_empty_element
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_value(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn value(&self) -> CefStringUserfree {
unsafe {
self.0
.get_value
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_attributes(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_attributes
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn attribute_count(&self) -> usize {
unsafe {
self.0
.get_attribute_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn attribute_byindex(&self, index: ::std::os::raw::c_int) -> CefStringUserfree {
unsafe {
self.0
.get_attribute_byindex
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn attribute_byqname(&self, qualified_name: Option<&CefString>) -> CefStringUserfree {
unsafe {
self.0
.get_attribute_byqname
.map(|f| {
let arg_qualified_name = qualified_name;
let arg_self_ = self.into_raw();
let arg_qualified_name = arg_qualified_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_qualified_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn attribute_bylname(
&self,
local_name: Option<&CefString>,
namespace_uri: Option<&CefString>,
) -> CefStringUserfree {
unsafe {
self.0
.get_attribute_bylname
.map(|f| {
let (arg_local_name, arg_namespace_uri) = (local_name, namespace_uri);
let arg_self_ = self.into_raw();
let arg_local_name = arg_local_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_namespace_uri = arg_namespace_uri
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_local_name, arg_namespace_uri);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn inner_xml(&self) -> CefStringUserfree {
unsafe {
self.0
.get_inner_xml
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn outer_xml(&self) -> CefStringUserfree {
unsafe {
self.0
.get_outer_xml
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn line_number(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_line_number
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_attribute_byindex(&self, index: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_attribute_byindex
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_attribute_byqname(
&self,
qualified_name: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_attribute_byqname
.map(|f| {
let arg_qualified_name = qualified_name;
let arg_self_ = self.into_raw();
let arg_qualified_name = arg_qualified_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_qualified_name);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_attribute_bylname(
&self,
local_name: Option<&CefString>,
namespace_uri: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_attribute_bylname
.map(|f| {
let (arg_local_name, arg_namespace_uri) = (local_name, namespace_uri);
let arg_self_ = self.into_raw();
let arg_local_name = arg_local_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_namespace_uri = arg_namespace_uri
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_local_name, arg_namespace_uri);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_first_attribute(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_first_attribute
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_next_attribute(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_next_attribute
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_carrying_element(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_carrying_element
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_xml_reader_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_xml_reader_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for XmlReader {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_xml_reader_t> for &XmlReader {
fn into_raw(self) -> *mut _cef_xml_reader_t {
ImplXmlReader::get_raw(self)
}
}
impl ConvertParam<*mut _cef_xml_reader_t> for &mut XmlReader {
fn into_raw(self) -> *mut _cef_xml_reader_t {
ImplXmlReader::get_raw(self)
}
}
impl ConvertReturnValue<XmlReader> for *mut _cef_xml_reader_t {
fn wrap_result(self) -> XmlReader {
XmlReader(unsafe { RefGuard::from_raw(self) })
}
}
impl From<XmlReader> for *mut _cef_xml_reader_t {
fn from(value: XmlReader) -> Self {
let object = ImplXmlReader::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_zip_reader_t`] for more documentation.
#[derive(Clone)]
pub struct ZipReader(RefGuard<_cef_zip_reader_t>);
pub trait ImplZipReader: Clone + Sized + Rc {
#[doc = "See [`_cef_zip_reader_t::move_to_first_file`] for more documentation."]
fn move_to_first_file(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_zip_reader_t::move_to_next_file`] for more documentation."]
fn move_to_next_file(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_zip_reader_t::move_to_file`] for more documentation."]
fn move_to_file(
&self,
file_name: Option<&CefString>,
case_sensitive: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_zip_reader_t::close`] for more documentation."]
fn close(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_zip_reader_t::get_file_name`] for more documentation."]
fn file_name(&self) -> CefStringUserfree;
#[doc = "See [`_cef_zip_reader_t::get_file_size`] for more documentation."]
fn file_size(&self) -> i64;
#[doc = "See [`_cef_zip_reader_t::get_file_last_modified`] for more documentation."]
fn file_last_modified(&self) -> Basetime;
#[doc = "See [`_cef_zip_reader_t::open_file`] for more documentation."]
fn open_file(&self, password: Option<&CefString>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_zip_reader_t::close_file`] for more documentation."]
fn close_file(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_zip_reader_t::read_file`] for more documentation."]
fn read_file(&self, buffer: Option<&mut Vec<u8>>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_zip_reader_t::tell`] for more documentation."]
fn tell(&self) -> i64;
#[doc = "See [`_cef_zip_reader_t::eof`] for more documentation."]
fn eof(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_zip_reader_t;
}
impl ImplZipReader for ZipReader {
fn move_to_first_file(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_first_file
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_next_file(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_next_file
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn move_to_file(
&self,
file_name: Option<&CefString>,
case_sensitive: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.move_to_file
.map(|f| {
let (arg_file_name, arg_case_sensitive) = (file_name, case_sensitive);
let arg_self_ = self.into_raw();
let arg_file_name = arg_file_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_file_name, arg_case_sensitive);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn close(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.close
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file_name(&self) -> CefStringUserfree {
unsafe {
self.0
.get_file_name
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file_size(&self) -> i64 {
unsafe {
self.0
.get_file_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn file_last_modified(&self) -> Basetime {
unsafe {
self.0
.get_file_last_modified
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn open_file(&self, password: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
self.0
.open_file
.map(|f| {
let arg_password = password;
let arg_self_ = self.into_raw();
let arg_password = arg_password
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_password);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn close_file(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.close_file
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn read_file(&self, buffer: Option<&mut Vec<u8>>) -> ::std::os::raw::c_int {
unsafe {
self.0
.read_file
.map(|f| {
let arg_buffer = buffer;
let arg_self_ = self.into_raw();
let arg_buffer_size =
arg_buffer.as_ref().map(|arg| arg.len()).unwrap_or_default();
let mut out_buffer = arg_buffer;
let arg_buffer = out_buffer
.as_mut()
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_mut_ptr().cast())
}
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_buffer, arg_buffer_size);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn tell(&self) -> i64 {
unsafe {
self.0
.tell
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn eof(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.eof
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_zip_reader_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_zip_reader_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ZipReader {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_zip_reader_t> for &ZipReader {
fn into_raw(self) -> *mut _cef_zip_reader_t {
ImplZipReader::get_raw(self)
}
}
impl ConvertParam<*mut _cef_zip_reader_t> for &mut ZipReader {
fn into_raw(self) -> *mut _cef_zip_reader_t {
ImplZipReader::get_raw(self)
}
}
impl ConvertReturnValue<ZipReader> for *mut _cef_zip_reader_t {
fn wrap_result(self) -> ZipReader {
ZipReader(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ZipReader> for *mut _cef_zip_reader_t {
fn from(value: ZipReader) -> Self {
let object = ImplZipReader::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_layout_t`] for more documentation.
#[derive(Clone)]
pub struct Layout(RefGuard<_cef_layout_t>);
pub trait ImplLayout: Clone + Sized + Rc {
#[doc = "See [`_cef_layout_t::as_box_layout`] for more documentation."]
fn as_box_layout(&self) -> Option<BoxLayout>;
#[doc = "See [`_cef_layout_t::as_fill_layout`] for more documentation."]
fn as_fill_layout(&self) -> Option<FillLayout>;
#[doc = "See [`_cef_layout_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_layout_t;
}
impl ImplLayout for Layout {
fn as_box_layout(&self) -> Option<BoxLayout> {
unsafe {
self.0
.as_box_layout
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn as_fill_layout(&self) -> Option<FillLayout> {
unsafe {
self.0
.as_fill_layout
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_layout_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_layout_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Layout {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_layout_t> for &Layout {
fn into_raw(self) -> *mut _cef_layout_t {
ImplLayout::get_raw(self)
}
}
impl ConvertParam<*mut _cef_layout_t> for &mut Layout {
fn into_raw(self) -> *mut _cef_layout_t {
ImplLayout::get_raw(self)
}
}
impl ConvertReturnValue<Layout> for *mut _cef_layout_t {
fn wrap_result(self) -> Layout {
Layout(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Layout> for *mut _cef_layout_t {
fn from(value: Layout) -> Self {
let object = ImplLayout::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_box_layout_t`] for more documentation.
#[derive(Clone)]
pub struct BoxLayout(RefGuard<_cef_box_layout_t>);
pub trait ImplBoxLayout: ImplLayout {
#[doc = "See [`_cef_box_layout_t::set_flex_for_view`] for more documentation."]
fn set_flex_for_view(&self, view: Option<&mut View>, flex: ::std::os::raw::c_int);
#[doc = "See [`_cef_box_layout_t::clear_flex_for_view`] for more documentation."]
fn clear_flex_for_view(&self, view: Option<&mut View>);
fn get_raw(&self) -> *mut _cef_box_layout_t {
<Self as ImplLayout>::get_raw(self).cast()
}
}
impl ImplLayout for BoxLayout {
fn as_box_layout(&self) -> Option<BoxLayout> {
Layout::from(self).as_box_layout()
}
fn as_fill_layout(&self) -> Option<FillLayout> {
Layout::from(self).as_fill_layout()
}
fn is_valid(&self) -> ::std::os::raw::c_int {
Layout::from(self).is_valid()
}
fn get_raw(&self) -> *mut _cef_layout_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&BoxLayout> for Layout {
fn from(from: &BoxLayout) -> Self {
Layout(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplBoxLayout for BoxLayout {
fn set_flex_for_view(&self, view: Option<&mut View>, flex: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_flex_for_view {
let (arg_view, arg_flex) = (view, flex);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view, arg_flex);
}
}
}
fn clear_flex_for_view(&self, view: Option<&mut View>) {
unsafe {
if let Some(f) = self.0.clear_flex_for_view {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view);
}
}
}
fn get_raw(&self) -> *mut _cef_box_layout_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_box_layout_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for BoxLayout {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_box_layout_t> for &BoxLayout {
fn into_raw(self) -> *mut _cef_box_layout_t {
ImplBoxLayout::get_raw(self)
}
}
impl ConvertParam<*mut _cef_box_layout_t> for &mut BoxLayout {
fn into_raw(self) -> *mut _cef_box_layout_t {
ImplBoxLayout::get_raw(self)
}
}
impl ConvertReturnValue<BoxLayout> for *mut _cef_box_layout_t {
fn wrap_result(self) -> BoxLayout {
BoxLayout(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BoxLayout> for *mut _cef_box_layout_t {
fn from(value: BoxLayout) -> Self {
let object = ImplBoxLayout::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_view_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct ViewDelegate(RefGuard<_cef_view_delegate_t>);
impl ViewDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapViewDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplViewDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapViewDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_view_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapViewDelegate: ImplViewDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_view_delegate_t, Self>);
}
pub trait ImplViewDelegate: Clone + Sized + Rc {
#[doc = "See [`_cef_view_delegate_t::get_preferred_size`] for more documentation."]
fn preferred_size(&self, view: Option<&mut View>) -> Size {
Default::default()
}
#[doc = "See [`_cef_view_delegate_t::get_minimum_size`] for more documentation."]
fn minimum_size(&self, view: Option<&mut View>) -> Size {
Default::default()
}
#[doc = "See [`_cef_view_delegate_t::get_maximum_size`] for more documentation."]
fn maximum_size(&self, view: Option<&mut View>) -> Size {
Default::default()
}
#[doc = "See [`_cef_view_delegate_t::get_height_for_width`] for more documentation."]
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_view_delegate_t::on_parent_view_changed`] for more documentation."]
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
}
#[doc = "See [`_cef_view_delegate_t::on_child_view_changed`] for more documentation."]
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
}
#[doc = "See [`_cef_view_delegate_t::on_window_changed`] for more documentation."]
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {}
#[doc = "See [`_cef_view_delegate_t::on_layout_changed`] for more documentation."]
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {}
#[doc = "See [`_cef_view_delegate_t::on_focus`] for more documentation."]
fn on_focus(&self, view: Option<&mut View>) {}
#[doc = "See [`_cef_view_delegate_t::on_blur`] for more documentation."]
fn on_blur(&self, view: Option<&mut View>) {}
#[doc = "See [`_cef_view_delegate_t::on_theme_changed`] for more documentation."]
fn on_theme_changed(&self, view: Option<&mut View>) {}
fn init_methods(object: &mut _cef_view_delegate_t) {
impl_cef_view_delegate_t::init_methods::<Self, _cef_view_delegate_t>(object);
}
fn get_raw(&self) -> *mut _cef_view_delegate_t;
}
#[doc = "Implement the [`WrapViewDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ViewDelegate` block you can override default\nmethods implemented by the [`ImplViewDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_view_delegate! {\n struct MyViewDelegate {\n payload: String,\n }\n\n impl ViewDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> ViewDelegate {\n MyViewDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_view_delegate { ($ vis : vis struct $ name : ident ; impl ViewDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_view_delegate ! { $ vis struct $ name { } impl ViewDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ViewDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_view_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ViewDelegate { ViewDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_view_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_view_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_view_delegate_t {
use super::*;
pub fn init_methods<I: ImplViewDelegate, R: Rc>(object: &mut _cef_view_delegate_t) {
object.get_preferred_size = Some(get_preferred_size::<I, R>);
object.get_minimum_size = Some(get_minimum_size::<I, R>);
object.get_maximum_size = Some(get_maximum_size::<I, R>);
object.get_height_for_width = Some(get_height_for_width::<I, R>);
object.on_parent_view_changed = Some(on_parent_view_changed::<I, R>);
object.on_child_view_changed = Some(on_child_view_changed::<I, R>);
object.on_window_changed = Some(on_window_changed::<I, R>);
object.on_layout_changed = Some(on_layout_changed::<I, R>);
object.on_focus = Some(on_focus::<I, R>);
object.on_blur = Some(on_blur::<I, R>);
object.on_theme_changed = Some(on_theme_changed::<I, R>);
}
extern "C" fn get_preferred_size<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
) -> _cef_size_t {
let (arg_self_, arg_view) = (self_, view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let result = ImplViewDelegate::preferred_size(&arg_self_.interface, arg_view);
result.into()
}
extern "C" fn get_minimum_size<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
) -> _cef_size_t {
let (arg_self_, arg_view) = (self_, view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let result = ImplViewDelegate::minimum_size(&arg_self_.interface, arg_view);
result.into()
}
extern "C" fn get_maximum_size<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
) -> _cef_size_t {
let (arg_self_, arg_view) = (self_, view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let result = ImplViewDelegate::maximum_size(&arg_self_.interface, arg_view);
result.into()
}
extern "C" fn get_height_for_width<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_view, arg_width) = (self_, view, width);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let arg_width = arg_width.into_raw();
ImplViewDelegate::height_for_width(&arg_self_.interface, arg_view, arg_width)
}
extern "C" fn on_parent_view_changed<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
added: ::std::os::raw::c_int,
parent: *mut _cef_view_t,
) {
let (arg_self_, arg_view, arg_added, arg_parent) = (self_, view, added, parent);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let arg_added = arg_added.into_raw();
let mut arg_parent =
unsafe { arg_parent.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_parent = arg_parent.as_mut();
ImplViewDelegate::on_parent_view_changed(
&arg_self_.interface,
arg_view,
arg_added,
arg_parent,
)
}
extern "C" fn on_child_view_changed<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
added: ::std::os::raw::c_int,
child: *mut _cef_view_t,
) {
let (arg_self_, arg_view, arg_added, arg_child) = (self_, view, added, child);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let arg_added = arg_added.into_raw();
let mut arg_child =
unsafe { arg_child.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_child = arg_child.as_mut();
ImplViewDelegate::on_child_view_changed(
&arg_self_.interface,
arg_view,
arg_added,
arg_child,
)
}
extern "C" fn on_window_changed<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
added: ::std::os::raw::c_int,
) {
let (arg_self_, arg_view, arg_added) = (self_, view, added);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let arg_added = arg_added.into_raw();
ImplViewDelegate::on_window_changed(&arg_self_.interface, arg_view, arg_added)
}
extern "C" fn on_layout_changed<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
new_bounds: *const _cef_rect_t,
) {
let (arg_self_, arg_view, arg_new_bounds) = (self_, view, new_bounds);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
let arg_new_bounds = if arg_new_bounds.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_new_bounds))
};
let arg_new_bounds = arg_new_bounds.as_ref().map(|arg| arg.as_ref());
ImplViewDelegate::on_layout_changed(&arg_self_.interface, arg_view, arg_new_bounds)
}
extern "C" fn on_focus<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
) {
let (arg_self_, arg_view) = (self_, view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
ImplViewDelegate::on_focus(&arg_self_.interface, arg_view)
}
extern "C" fn on_blur<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
) {
let (arg_self_, arg_view) = (self_, view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
ImplViewDelegate::on_blur(&arg_self_.interface, arg_view)
}
extern "C" fn on_theme_changed<I: ImplViewDelegate, R: Rc>(
self_: *mut _cef_view_delegate_t,
view: *mut _cef_view_t,
) {
let (arg_self_, arg_view) = (self_, view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_view =
unsafe { arg_view.as_mut() }.map(|arg| View(unsafe { RefGuard::from_raw(arg) }));
let arg_view = arg_view.as_mut();
ImplViewDelegate::on_theme_changed(&arg_self_.interface, arg_view)
}
}
impl ImplViewDelegate for ViewDelegate {
fn preferred_size(&self, view: Option<&mut View>) -> Size {
unsafe {
self.0
.get_preferred_size
.map(|f| {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_view);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn minimum_size(&self, view: Option<&mut View>) -> Size {
unsafe {
self.0
.get_minimum_size
.map(|f| {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_view);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn maximum_size(&self, view: Option<&mut View>) -> Size {
unsafe {
self.0
.get_maximum_size
.map(|f| {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_view);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_height_for_width
.map(|f| {
let (arg_view, arg_width) = (view, width);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_view, arg_width);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
unsafe {
if let Some(f) = self.0.on_parent_view_changed {
let (arg_view, arg_added, arg_parent) = (view, added, parent);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_parent = arg_parent
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view, arg_added, arg_parent);
}
}
}
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
unsafe {
if let Some(f) = self.0.on_child_view_changed {
let (arg_view, arg_added, arg_child) = (view, added, child);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_child = arg_child
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view, arg_added, arg_child);
}
}
}
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.on_window_changed {
let (arg_view, arg_added) = (view, added);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view, arg_added);
}
}
}
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {
unsafe {
if let Some(f) = self.0.on_layout_changed {
let (arg_view, arg_new_bounds) = (view, new_bounds);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_new_bounds = arg_new_bounds.cloned().map(|arg| arg.into());
let arg_new_bounds = arg_new_bounds
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_view, arg_new_bounds);
}
}
}
fn on_focus(&self, view: Option<&mut View>) {
unsafe {
if let Some(f) = self.0.on_focus {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view);
}
}
}
fn on_blur(&self, view: Option<&mut View>) {
unsafe {
if let Some(f) = self.0.on_blur {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view);
}
}
}
fn on_theme_changed(&self, view: Option<&mut View>) {
unsafe {
if let Some(f) = self.0.on_theme_changed {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view);
}
}
}
fn get_raw(&self) -> *mut _cef_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_view_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ViewDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_view_delegate_t> for &ViewDelegate {
fn into_raw(self) -> *mut _cef_view_delegate_t {
ImplViewDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_view_delegate_t> for &mut ViewDelegate {
fn into_raw(self) -> *mut _cef_view_delegate_t {
ImplViewDelegate::get_raw(self)
}
}
impl ConvertReturnValue<ViewDelegate> for *mut _cef_view_delegate_t {
fn wrap_result(self) -> ViewDelegate {
ViewDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ViewDelegate> for *mut _cef_view_delegate_t {
fn from(value: ViewDelegate) -> Self {
let object = ImplViewDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_browser_view_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct BrowserViewDelegate(RefGuard<_cef_browser_view_delegate_t>);
impl BrowserViewDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapBrowserViewDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplBrowserViewDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapBrowserViewDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_browser_view_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapBrowserViewDelegate: ImplBrowserViewDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_browser_view_delegate_t, Self>);
}
pub trait ImplBrowserViewDelegate: ImplViewDelegate {
#[doc = "See [`_cef_browser_view_delegate_t::on_browser_created`] for more documentation."]
fn on_browser_created(
&self,
browser_view: Option<&mut BrowserView>,
browser: Option<&mut Browser>,
) {
}
#[doc = "See [`_cef_browser_view_delegate_t::on_browser_destroyed`] for more documentation."]
fn on_browser_destroyed(
&self,
browser_view: Option<&mut BrowserView>,
browser: Option<&mut Browser>,
) {
}
#[doc = "See [`_cef_browser_view_delegate_t::get_delegate_for_popup_browser_view`] for more documentation."]
fn delegate_for_popup_browser_view(
&self,
browser_view: Option<&mut BrowserView>,
settings: Option<&BrowserSettings>,
client: Option<&mut Client>,
is_devtools: ::std::os::raw::c_int,
) -> Option<BrowserViewDelegate> {
Default::default()
}
#[doc = "See [`_cef_browser_view_delegate_t::on_popup_browser_view_created`] for more documentation."]
fn on_popup_browser_view_created(
&self,
browser_view: Option<&mut BrowserView>,
popup_browser_view: Option<&mut BrowserView>,
is_devtools: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_browser_view_delegate_t::get_chrome_toolbar_type`] for more documentation."]
fn chrome_toolbar_type(&self, browser_view: Option<&mut BrowserView>) -> ChromeToolbarType {
Default::default()
}
#[doc = "See [`_cef_browser_view_delegate_t::use_frameless_window_for_picture_in_picture`] for more documentation."]
fn use_frameless_window_for_picture_in_picture(
&self,
browser_view: Option<&mut BrowserView>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_browser_view_delegate_t::on_gesture_command`] for more documentation."]
fn on_gesture_command(
&self,
browser_view: Option<&mut BrowserView>,
gesture_command: GestureCommand,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_browser_view_delegate_t::get_browser_runtime_style`] for more documentation."]
fn browser_runtime_style(&self) -> RuntimeStyle {
Default::default()
}
#[doc = "See [`_cef_browser_view_delegate_t::allow_move_for_picture_in_picture`] for more documentation."]
fn allow_move_for_picture_in_picture(
&self,
browser_view: Option<&mut BrowserView>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_browser_view_delegate_t::allow_picture_in_picture_without_user_activation`] for more documentation."]
fn allow_picture_in_picture_without_user_activation(
&self,
browser_view: Option<&mut BrowserView>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_browser_view_delegate_t) {
impl_cef_view_delegate_t::init_methods::<Self, _cef_browser_view_delegate_t>(
&mut object.base,
);
impl_cef_browser_view_delegate_t::init_methods::<Self, _cef_browser_view_delegate_t>(
object,
);
}
fn get_raw(&self) -> *mut _cef_browser_view_delegate_t {
<Self as ImplViewDelegate>::get_raw(self).cast()
}
}
#[doc = "Implement the [`WrapBrowserViewDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl BrowserViewDelegate` block you can override default\nmethods implemented by the [`ImplBrowserViewDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_browser_view_delegate! {\n struct MyBrowserViewDelegate {\n payload: String,\n }\n\n impl ViewDelegate {\n // ...\n }\n\n impl BrowserViewDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> BrowserViewDelegate {\n MyBrowserViewDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_browser_view_delegate { ($ vis : vis struct $ name : ident ; impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl BrowserViewDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_browser_view_delegate ! { $ vis struct $ name { } impl BrowserViewDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl BrowserViewDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_browser_view_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> BrowserViewDelegate { BrowserViewDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapBrowserViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_browser_view_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_view_delegate_attrs_name]) * fn $ wrap_view_delegate_method_name (& $ wrap_view_delegate_self $ (, $ wrap_view_delegate_arg_name : $ wrap_view_delegate_arg_type) *) $ (-> $ wrap_view_delegate_return_type) ? { $ ($ wrap_view_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_view_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplBrowserViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_browser_view_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_browser_view_delegate_t {
use super::*;
pub fn init_methods<I: ImplBrowserViewDelegate, R: Rc>(
object: &mut _cef_browser_view_delegate_t,
) {
object.on_browser_created = Some(on_browser_created::<I, R>);
object.on_browser_destroyed = Some(on_browser_destroyed::<I, R>);
object.get_delegate_for_popup_browser_view =
Some(get_delegate_for_popup_browser_view::<I, R>);
object.on_popup_browser_view_created = Some(on_popup_browser_view_created::<I, R>);
object.get_chrome_toolbar_type = Some(get_chrome_toolbar_type::<I, R>);
object.use_frameless_window_for_picture_in_picture =
Some(use_frameless_window_for_picture_in_picture::<I, R>);
object.on_gesture_command = Some(on_gesture_command::<I, R>);
object.get_browser_runtime_style = Some(get_browser_runtime_style::<I, R>);
object.allow_move_for_picture_in_picture = Some(allow_move_for_picture_in_picture::<I, R>);
object.allow_picture_in_picture_without_user_activation =
Some(allow_picture_in_picture_without_user_activation::<I, R>);
}
extern "C" fn on_browser_created<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser_view, arg_browser) = (self_, browser_view, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplBrowserViewDelegate::on_browser_created(
&arg_self_.interface,
arg_browser_view,
arg_browser,
)
}
extern "C" fn on_browser_destroyed<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
browser: *mut _cef_browser_t,
) {
let (arg_self_, arg_browser_view, arg_browser) = (self_, browser_view, browser);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
let mut arg_browser =
unsafe { arg_browser.as_mut() }.map(|arg| Browser(unsafe { RefGuard::from_raw(arg) }));
let arg_browser = arg_browser.as_mut();
ImplBrowserViewDelegate::on_browser_destroyed(
&arg_self_.interface,
arg_browser_view,
arg_browser,
)
}
extern "C" fn get_delegate_for_popup_browser_view<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
settings: *const _cef_browser_settings_t,
client: *mut _cef_client_t,
is_devtools: ::std::os::raw::c_int,
) -> *mut _cef_browser_view_delegate_t {
let (arg_self_, arg_browser_view, arg_settings, arg_client, arg_is_devtools) =
(self_, browser_view, settings, client, is_devtools);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
let arg_settings = if arg_settings.is_null() {
None
} else {
Some(WrapParamRef::<BrowserSettings, _>::from(arg_settings))
};
let arg_settings = arg_settings.as_ref().map(|arg| arg.as_ref());
let mut arg_client =
unsafe { arg_client.as_mut() }.map(|arg| Client(unsafe { RefGuard::from_raw(arg) }));
let arg_client = arg_client.as_mut();
let arg_is_devtools = arg_is_devtools.into_raw();
let result = ImplBrowserViewDelegate::delegate_for_popup_browser_view(
&arg_self_.interface,
arg_browser_view,
arg_settings,
arg_client,
arg_is_devtools,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn on_popup_browser_view_created<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
popup_browser_view: *mut _cef_browser_view_t,
is_devtools: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser_view, arg_popup_browser_view, arg_is_devtools) =
(self_, browser_view, popup_browser_view, is_devtools);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
let mut arg_popup_browser_view = unsafe { arg_popup_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_popup_browser_view = arg_popup_browser_view.as_mut();
let arg_is_devtools = arg_is_devtools.into_raw();
ImplBrowserViewDelegate::on_popup_browser_view_created(
&arg_self_.interface,
arg_browser_view,
arg_popup_browser_view,
arg_is_devtools,
)
}
extern "C" fn get_chrome_toolbar_type<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
) -> cef_chrome_toolbar_type_t {
let (arg_self_, arg_browser_view) = (self_, browser_view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
let result =
ImplBrowserViewDelegate::chrome_toolbar_type(&arg_self_.interface, arg_browser_view);
result.into()
}
extern "C" fn use_frameless_window_for_picture_in_picture<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser_view) = (self_, browser_view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
ImplBrowserViewDelegate::use_frameless_window_for_picture_in_picture(
&arg_self_.interface,
arg_browser_view,
)
}
extern "C" fn on_gesture_command<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
gesture_command: cef_gesture_command_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser_view, arg_gesture_command) =
(self_, browser_view, gesture_command);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
let arg_gesture_command = arg_gesture_command.into_raw();
ImplBrowserViewDelegate::on_gesture_command(
&arg_self_.interface,
arg_browser_view,
arg_gesture_command,
)
}
extern "C" fn get_browser_runtime_style<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
) -> cef_runtime_style_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplBrowserViewDelegate::browser_runtime_style(&arg_self_.interface);
result.into()
}
extern "C" fn allow_move_for_picture_in_picture<I: ImplBrowserViewDelegate, R: Rc>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser_view) = (self_, browser_view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
ImplBrowserViewDelegate::allow_move_for_picture_in_picture(
&arg_self_.interface,
arg_browser_view,
)
}
extern "C" fn allow_picture_in_picture_without_user_activation<
I: ImplBrowserViewDelegate,
R: Rc,
>(
self_: *mut _cef_browser_view_delegate_t,
browser_view: *mut _cef_browser_view_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_browser_view) = (self_, browser_view);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_browser_view = unsafe { arg_browser_view.as_mut() }
.map(|arg| BrowserView(unsafe { RefGuard::from_raw(arg) }));
let arg_browser_view = arg_browser_view.as_mut();
ImplBrowserViewDelegate::allow_picture_in_picture_without_user_activation(
&arg_self_.interface,
arg_browser_view,
)
}
}
impl ImplViewDelegate for BrowserViewDelegate {
fn preferred_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.preferred_size(view)
}
fn minimum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.minimum_size(view)
}
fn maximum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.maximum_size(view)
}
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.height_for_width(view, width)
}
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_parent_view_changed(view, added, parent)
}
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_child_view_changed(view, added, child)
}
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_window_changed(view, added)
}
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_layout_changed(view, new_bounds)
}
fn on_focus(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_focus(view)
}
fn on_blur(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_blur(view)
}
fn on_theme_changed(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_theme_changed(view)
}
fn get_raw(&self) -> *mut _cef_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplBrowserViewDelegate for BrowserViewDelegate {
fn on_browser_created(
&self,
browser_view: Option<&mut BrowserView>,
browser: Option<&mut Browser>,
) {
unsafe {
if let Some(f) = self.0.on_browser_created {
let (arg_browser_view, arg_browser) = (browser_view, browser);
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser_view, arg_browser);
}
}
}
fn on_browser_destroyed(
&self,
browser_view: Option<&mut BrowserView>,
browser: Option<&mut Browser>,
) {
unsafe {
if let Some(f) = self.0.on_browser_destroyed {
let (arg_browser_view, arg_browser) = (browser_view, browser);
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser_view, arg_browser);
}
}
}
fn delegate_for_popup_browser_view(
&self,
browser_view: Option<&mut BrowserView>,
settings: Option<&BrowserSettings>,
client: Option<&mut Client>,
is_devtools: ::std::os::raw::c_int,
) -> Option<BrowserViewDelegate> {
unsafe {
self.0
.get_delegate_for_popup_browser_view
.map(|f| {
let (arg_browser_view, arg_settings, arg_client, arg_is_devtools) =
(browser_view, settings, client, is_devtools);
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_client = arg_client
.map(|arg| {
arg.add_ref();
ImplClient::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser_view,
arg_settings,
arg_client,
arg_is_devtools,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn on_popup_browser_view_created(
&self,
browser_view: Option<&mut BrowserView>,
popup_browser_view: Option<&mut BrowserView>,
is_devtools: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_popup_browser_view_created
.map(|f| {
let (arg_browser_view, arg_popup_browser_view, arg_is_devtools) =
(browser_view, popup_browser_view, is_devtools);
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_popup_browser_view = arg_popup_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(
arg_self_,
arg_browser_view,
arg_popup_browser_view,
arg_is_devtools,
);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn chrome_toolbar_type(&self, browser_view: Option<&mut BrowserView>) -> ChromeToolbarType {
unsafe {
self.0
.get_chrome_toolbar_type
.map(|f| {
let arg_browser_view = browser_view;
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser_view);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn use_frameless_window_for_picture_in_picture(
&self,
browser_view: Option<&mut BrowserView>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.use_frameless_window_for_picture_in_picture
.map(|f| {
let arg_browser_view = browser_view;
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser_view);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_gesture_command(
&self,
browser_view: Option<&mut BrowserView>,
gesture_command: GestureCommand,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_gesture_command
.map(|f| {
let (arg_browser_view, arg_gesture_command) = (browser_view, gesture_command);
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_gesture_command = arg_gesture_command.into_raw();
let result = f(arg_self_, arg_browser_view, arg_gesture_command);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn browser_runtime_style(&self) -> RuntimeStyle {
unsafe {
self.0
.get_browser_runtime_style
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn allow_move_for_picture_in_picture(
&self,
browser_view: Option<&mut BrowserView>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.allow_move_for_picture_in_picture
.map(|f| {
let arg_browser_view = browser_view;
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser_view);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn allow_picture_in_picture_without_user_activation(
&self,
browser_view: Option<&mut BrowserView>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.allow_picture_in_picture_without_user_activation
.map(|f| {
let arg_browser_view = browser_view;
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_browser_view);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_browser_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_browser_view_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for BrowserViewDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_browser_view_delegate_t> for &BrowserViewDelegate {
fn into_raw(self) -> *mut _cef_browser_view_delegate_t {
ImplBrowserViewDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_browser_view_delegate_t> for &mut BrowserViewDelegate {
fn into_raw(self) -> *mut _cef_browser_view_delegate_t {
ImplBrowserViewDelegate::get_raw(self)
}
}
impl ConvertReturnValue<BrowserViewDelegate> for *mut _cef_browser_view_delegate_t {
fn wrap_result(self) -> BrowserViewDelegate {
BrowserViewDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BrowserViewDelegate> for *mut _cef_browser_view_delegate_t {
fn from(value: BrowserViewDelegate) -> Self {
let object = ImplBrowserViewDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_view_t`] for more documentation.
#[derive(Clone)]
pub struct View(RefGuard<_cef_view_t>);
pub trait ImplView: Clone + Sized + Rc {
#[doc = "See [`_cef_view_t::as_browser_view`] for more documentation."]
fn as_browser_view(&self) -> Option<BrowserView>;
#[doc = "See [`_cef_view_t::as_button`] for more documentation."]
fn as_button(&self) -> Option<Button>;
#[doc = "See [`_cef_view_t::as_panel`] for more documentation."]
fn as_panel(&self) -> Option<Panel>;
#[doc = "See [`_cef_view_t::as_scroll_view`] for more documentation."]
fn as_scroll_view(&self) -> Option<ScrollView>;
#[doc = "See [`_cef_view_t::as_textfield`] for more documentation."]
fn as_textfield(&self) -> Option<Textfield>;
#[doc = "See [`_cef_view_t::get_type_string`] for more documentation."]
fn type_string(&self) -> CefStringUserfree;
#[doc = "See [`_cef_view_t::to_string`] for more documentation."]
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree;
#[doc = "See [`_cef_view_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::is_attached`] for more documentation."]
fn is_attached(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::get_delegate`] for more documentation."]
fn delegate(&self) -> Option<ViewDelegate>;
#[doc = "See [`_cef_view_t::get_window`] for more documentation."]
fn window(&self) -> Option<Window>;
#[doc = "See [`_cef_view_t::get_id`] for more documentation."]
fn id(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::set_id`] for more documentation."]
fn set_id(&self, id: ::std::os::raw::c_int);
#[doc = "See [`_cef_view_t::get_group_id`] for more documentation."]
fn group_id(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::set_group_id`] for more documentation."]
fn set_group_id(&self, group_id: ::std::os::raw::c_int);
#[doc = "See [`_cef_view_t::get_parent_view`] for more documentation."]
fn parent_view(&self) -> Option<View>;
#[doc = "See [`_cef_view_t::get_view_for_id`] for more documentation."]
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View>;
#[doc = "See [`_cef_view_t::set_bounds`] for more documentation."]
fn set_bounds(&self, bounds: Option<&Rect>);
#[doc = "See [`_cef_view_t::get_bounds`] for more documentation."]
fn bounds(&self) -> Rect;
#[doc = "See [`_cef_view_t::get_bounds_in_screen`] for more documentation."]
fn bounds_in_screen(&self) -> Rect;
#[doc = "See [`_cef_view_t::set_size`] for more documentation."]
fn set_size(&self, size: Option<&Size>);
#[doc = "See [`_cef_view_t::get_size`] for more documentation."]
fn size(&self) -> Size;
#[doc = "See [`_cef_view_t::set_position`] for more documentation."]
fn set_position(&self, position: Option<&Point>);
#[doc = "See [`_cef_view_t::get_position`] for more documentation."]
fn position(&self) -> Point;
#[doc = "See [`_cef_view_t::set_insets`] for more documentation."]
fn set_insets(&self, insets: Option<&Insets>);
#[doc = "See [`_cef_view_t::get_insets`] for more documentation."]
fn insets(&self) -> Insets;
#[doc = "See [`_cef_view_t::get_preferred_size`] for more documentation."]
fn preferred_size(&self) -> Size;
#[doc = "See [`_cef_view_t::size_to_preferred_size`] for more documentation."]
fn size_to_preferred_size(&self);
#[doc = "See [`_cef_view_t::get_minimum_size`] for more documentation."]
fn minimum_size(&self) -> Size;
#[doc = "See [`_cef_view_t::get_maximum_size`] for more documentation."]
fn maximum_size(&self) -> Size;
#[doc = "See [`_cef_view_t::get_height_for_width`] for more documentation."]
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::invalidate_layout`] for more documentation."]
fn invalidate_layout(&self);
#[doc = "See [`_cef_view_t::set_visible`] for more documentation."]
fn set_visible(&self, visible: ::std::os::raw::c_int);
#[doc = "See [`_cef_view_t::is_visible`] for more documentation."]
fn is_visible(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::is_drawn`] for more documentation."]
fn is_drawn(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::set_enabled`] for more documentation."]
fn set_enabled(&self, enabled: ::std::os::raw::c_int);
#[doc = "See [`_cef_view_t::is_enabled`] for more documentation."]
fn is_enabled(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::set_focusable`] for more documentation."]
fn set_focusable(&self, focusable: ::std::os::raw::c_int);
#[doc = "See [`_cef_view_t::is_focusable`] for more documentation."]
fn is_focusable(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::is_accessibility_focusable`] for more documentation."]
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::has_focus`] for more documentation."]
fn has_focus(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::request_focus`] for more documentation."]
fn request_focus(&self);
#[doc = "See [`_cef_view_t::set_background_color`] for more documentation."]
fn set_background_color(&self, color: u32);
#[doc = "See [`_cef_view_t::get_background_color`] for more documentation."]
fn background_color(&self) -> cef_color_t;
#[doc = "See [`_cef_view_t::get_theme_color`] for more documentation."]
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t;
#[doc = "See [`_cef_view_t::convert_point_to_screen`] for more documentation."]
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::convert_point_from_screen`] for more documentation."]
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::convert_point_to_window`] for more documentation."]
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::convert_point_from_window`] for more documentation."]
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::convert_point_to_view`] for more documentation."]
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_view_t::convert_point_from_view`] for more documentation."]
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_view_t;
}
impl ImplView for View {
fn as_browser_view(&self) -> Option<BrowserView> {
unsafe {
self.0
.as_browser_view
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn as_button(&self) -> Option<Button> {
unsafe {
self.0
.as_button
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn as_panel(&self) -> Option<Panel> {
unsafe {
self.0
.as_panel
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn as_scroll_view(&self) -> Option<ScrollView> {
unsafe {
self.0
.as_scroll_view
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn as_textfield(&self) -> Option<Textfield> {
unsafe {
self.0
.as_textfield
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn type_string(&self) -> CefStringUserfree {
unsafe {
self.0
.get_type_string
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
unsafe {
self.0
.to_string
.map(|f| {
let arg_include_children = include_children;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_include_children);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_attached(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_attached
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn delegate(&self) -> Option<ViewDelegate> {
unsafe {
self.0
.get_delegate
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn window(&self) -> Option<Window> {
unsafe {
self.0
.get_window
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn id(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_id(&self, id: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_id {
let arg_id = id;
let arg_self_ = self.into_raw();
f(arg_self_, arg_id);
}
}
}
fn group_id(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_group_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_group_id {
let arg_group_id = group_id;
let arg_self_ = self.into_raw();
f(arg_self_, arg_group_id);
}
}
}
fn parent_view(&self) -> Option<View> {
unsafe {
self.0
.get_parent_view
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
unsafe {
self.0
.get_view_for_id
.map(|f| {
let arg_id = id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_id);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_bounds(&self, bounds: Option<&Rect>) {
unsafe {
if let Some(f) = self.0.set_bounds {
let arg_bounds = bounds;
let arg_self_ = self.into_raw();
let arg_bounds = arg_bounds.cloned().map(|arg| arg.into());
let arg_bounds = arg_bounds
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_bounds);
}
}
}
fn bounds(&self) -> Rect {
unsafe {
self.0
.get_bounds
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn bounds_in_screen(&self) -> Rect {
unsafe {
self.0
.get_bounds_in_screen
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_size(&self, size: Option<&Size>) {
unsafe {
if let Some(f) = self.0.set_size {
let arg_size = size;
let arg_self_ = self.into_raw();
let arg_size = arg_size.cloned().map(|arg| arg.into());
let arg_size = arg_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_size);
}
}
}
fn size(&self) -> Size {
unsafe {
self.0
.get_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_position(&self, position: Option<&Point>) {
unsafe {
if let Some(f) = self.0.set_position {
let arg_position = position;
let arg_self_ = self.into_raw();
let arg_position = arg_position.cloned().map(|arg| arg.into());
let arg_position = arg_position
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_position);
}
}
}
fn position(&self) -> Point {
unsafe {
self.0
.get_position
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_insets(&self, insets: Option<&Insets>) {
unsafe {
if let Some(f) = self.0.set_insets {
let arg_insets = insets;
let arg_self_ = self.into_raw();
let arg_insets = arg_insets.cloned().map(|arg| arg.into());
let arg_insets = arg_insets
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_insets);
}
}
}
fn insets(&self) -> Insets {
unsafe {
self.0
.get_insets
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn preferred_size(&self) -> Size {
unsafe {
self.0
.get_preferred_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn size_to_preferred_size(&self) {
unsafe {
if let Some(f) = self.0.size_to_preferred_size {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn minimum_size(&self) -> Size {
unsafe {
self.0
.get_minimum_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn maximum_size(&self) -> Size {
unsafe {
self.0
.get_maximum_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_height_for_width
.map(|f| {
let arg_width = width;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_width);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn invalidate_layout(&self) {
unsafe {
if let Some(f) = self.0.invalidate_layout {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_visible {
let arg_visible = visible;
let arg_self_ = self.into_raw();
f(arg_self_, arg_visible);
}
}
}
fn is_visible(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_visible
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_drawn
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_enabled {
let arg_enabled = enabled;
let arg_self_ = self.into_raw();
f(arg_self_, arg_enabled);
}
}
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_enabled
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_focusable {
let arg_focusable = focusable;
let arg_self_ = self.into_raw();
f(arg_self_, arg_focusable);
}
}
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_focusable
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_accessibility_focusable
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_focus(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_focus
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn request_focus(&self) {
unsafe {
if let Some(f) = self.0.request_focus {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_background_color(&self, color: u32) {
unsafe {
if let Some(f) = self.0.set_background_color {
let arg_color = color;
let arg_self_ = self.into_raw();
f(arg_self_, arg_color);
}
}
}
fn background_color(&self) -> cef_color_t {
unsafe {
self.0
.get_background_color
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
unsafe {
self.0
.get_theme_color
.map(|f| {
let arg_color_id = color_id;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_color_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
unsafe {
self.0
.convert_point_to_screen
.map(|f| {
let arg_point = point;
let arg_self_ = self.into_raw();
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_point);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
unsafe {
self.0
.convert_point_from_screen
.map(|f| {
let arg_point = point;
let arg_self_ = self.into_raw();
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_point);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
unsafe {
self.0
.convert_point_to_window
.map(|f| {
let arg_point = point;
let arg_self_ = self.into_raw();
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_point);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
unsafe {
self.0
.convert_point_from_window
.map(|f| {
let arg_point = point;
let arg_self_ = self.into_raw();
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_point);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.convert_point_to_view
.map(|f| {
let (arg_view, arg_point) = (view, point);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_view, arg_point);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.convert_point_from_view
.map(|f| {
let (arg_view, arg_point) = (view, point);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_view, arg_point);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_view_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for View {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_view_t> for &View {
fn into_raw(self) -> *mut _cef_view_t {
ImplView::get_raw(self)
}
}
impl ConvertParam<*mut _cef_view_t> for &mut View {
fn into_raw(self) -> *mut _cef_view_t {
ImplView::get_raw(self)
}
}
impl ConvertReturnValue<View> for *mut _cef_view_t {
fn wrap_result(self) -> View {
View(unsafe { RefGuard::from_raw(self) })
}
}
impl From<View> for *mut _cef_view_t {
fn from(value: View) -> Self {
let object = ImplView::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_browser_view_t`] for more documentation.
#[derive(Clone)]
pub struct BrowserView(RefGuard<_cef_browser_view_t>);
pub trait ImplBrowserView: ImplView {
#[doc = "See [`_cef_browser_view_t::get_browser`] for more documentation."]
fn browser(&self) -> Option<Browser>;
#[doc = "See [`_cef_browser_view_t::get_chrome_toolbar`] for more documentation."]
fn chrome_toolbar(&self) -> Option<View>;
#[doc = "See [`_cef_browser_view_t::set_prefer_accelerators`] for more documentation."]
fn set_prefer_accelerators(&self, prefer_accelerators: ::std::os::raw::c_int);
#[doc = "See [`_cef_browser_view_t::get_runtime_style`] for more documentation."]
fn runtime_style(&self) -> RuntimeStyle;
fn get_raw(&self) -> *mut _cef_browser_view_t {
<Self as ImplView>::get_raw(self).cast()
}
}
impl ImplView for BrowserView {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&BrowserView> for View {
fn from(from: &BrowserView) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplBrowserView for BrowserView {
fn browser(&self) -> Option<Browser> {
unsafe {
self.0
.get_browser
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn chrome_toolbar(&self) -> Option<View> {
unsafe {
self.0
.get_chrome_toolbar
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_prefer_accelerators(&self, prefer_accelerators: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_prefer_accelerators {
let arg_prefer_accelerators = prefer_accelerators;
let arg_self_ = self.into_raw();
f(arg_self_, arg_prefer_accelerators);
}
}
}
fn runtime_style(&self) -> RuntimeStyle {
unsafe {
self.0
.get_runtime_style
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_browser_view_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_browser_view_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for BrowserView {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_browser_view_t> for &BrowserView {
fn into_raw(self) -> *mut _cef_browser_view_t {
ImplBrowserView::get_raw(self)
}
}
impl ConvertParam<*mut _cef_browser_view_t> for &mut BrowserView {
fn into_raw(self) -> *mut _cef_browser_view_t {
ImplBrowserView::get_raw(self)
}
}
impl ConvertReturnValue<BrowserView> for *mut _cef_browser_view_t {
fn wrap_result(self) -> BrowserView {
BrowserView(unsafe { RefGuard::from_raw(self) })
}
}
impl From<BrowserView> for *mut _cef_browser_view_t {
fn from(value: BrowserView) -> Self {
let object = ImplBrowserView::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_button_t`] for more documentation.
#[derive(Clone)]
pub struct Button(RefGuard<_cef_button_t>);
pub trait ImplButton: ImplView {
#[doc = "See [`_cef_button_t::as_label_button`] for more documentation."]
fn as_label_button(&self) -> Option<LabelButton>;
#[doc = "See [`_cef_button_t::set_state`] for more documentation."]
fn set_state(&self, state: ButtonState);
#[doc = "See [`_cef_button_t::get_state`] for more documentation."]
fn state(&self) -> ButtonState;
#[doc = "See [`_cef_button_t::set_ink_drop_enabled`] for more documentation."]
fn set_ink_drop_enabled(&self, enabled: ::std::os::raw::c_int);
#[doc = "See [`_cef_button_t::set_tooltip_text`] for more documentation."]
fn set_tooltip_text(&self, tooltip_text: Option<&CefString>);
#[doc = "See [`_cef_button_t::set_accessible_name`] for more documentation."]
fn set_accessible_name(&self, name: Option<&CefString>);
fn get_raw(&self) -> *mut _cef_button_t {
<Self as ImplView>::get_raw(self).cast()
}
}
impl ImplView for Button {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&Button> for View {
fn from(from: &Button) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplButton for Button {
fn as_label_button(&self) -> Option<LabelButton> {
unsafe {
self.0
.as_label_button
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_state(&self, state: ButtonState) {
unsafe {
if let Some(f) = self.0.set_state {
let arg_state = state;
let arg_self_ = self.into_raw();
let arg_state = arg_state.into_raw();
f(arg_self_, arg_state);
}
}
}
fn state(&self) -> ButtonState {
unsafe {
self.0
.get_state
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_ink_drop_enabled(&self, enabled: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_ink_drop_enabled {
let arg_enabled = enabled;
let arg_self_ = self.into_raw();
f(arg_self_, arg_enabled);
}
}
}
fn set_tooltip_text(&self, tooltip_text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_tooltip_text {
let arg_tooltip_text = tooltip_text;
let arg_self_ = self.into_raw();
let arg_tooltip_text = arg_tooltip_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_tooltip_text);
}
}
}
fn set_accessible_name(&self, name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_accessible_name {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name);
}
}
}
fn get_raw(&self) -> *mut _cef_button_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_button_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Button {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_button_t> for &Button {
fn into_raw(self) -> *mut _cef_button_t {
ImplButton::get_raw(self)
}
}
impl ConvertParam<*mut _cef_button_t> for &mut Button {
fn into_raw(self) -> *mut _cef_button_t {
ImplButton::get_raw(self)
}
}
impl ConvertReturnValue<Button> for *mut _cef_button_t {
fn wrap_result(self) -> Button {
Button(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Button> for *mut _cef_button_t {
fn from(value: Button) -> Self {
let object = ImplButton::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_button_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct ButtonDelegate(RefGuard<_cef_button_delegate_t>);
impl ButtonDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapButtonDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplButtonDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapButtonDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_button_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapButtonDelegate: ImplButtonDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_button_delegate_t, Self>);
}
pub trait ImplButtonDelegate: ImplViewDelegate {
#[doc = "See [`_cef_button_delegate_t::on_button_pressed`] for more documentation."]
fn on_button_pressed(&self, button: Option<&mut Button>) {}
#[doc = "See [`_cef_button_delegate_t::on_button_state_changed`] for more documentation."]
fn on_button_state_changed(&self, button: Option<&mut Button>) {}
fn init_methods(object: &mut _cef_button_delegate_t) {
impl_cef_view_delegate_t::init_methods::<Self, _cef_button_delegate_t>(&mut object.base);
impl_cef_button_delegate_t::init_methods::<Self, _cef_button_delegate_t>(object);
}
fn get_raw(&self) -> *mut _cef_button_delegate_t {
<Self as ImplViewDelegate>::get_raw(self).cast()
}
}
#[doc = "Implement the [`WrapButtonDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl ButtonDelegate` block you can override default\nmethods implemented by the [`ImplButtonDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_button_delegate! {\n struct MyButtonDelegate {\n payload: String,\n }\n\n impl ViewDelegate {\n // ...\n }\n\n impl ButtonDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> ButtonDelegate {\n MyButtonDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_button_delegate { ($ vis : vis struct $ name : ident ; impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl ButtonDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_button_delegate ! { $ vis struct $ name { } impl ButtonDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl ButtonDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_button_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> ButtonDelegate { ButtonDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapButtonDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_button_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_view_delegate_attrs_name]) * fn $ wrap_view_delegate_method_name (& $ wrap_view_delegate_self $ (, $ wrap_view_delegate_arg_name : $ wrap_view_delegate_arg_type) *) $ (-> $ wrap_view_delegate_return_type) ? { $ ($ wrap_view_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_view_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplButtonDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_button_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_button_delegate_t {
use super::*;
pub fn init_methods<I: ImplButtonDelegate, R: Rc>(object: &mut _cef_button_delegate_t) {
object.on_button_pressed = Some(on_button_pressed::<I, R>);
object.on_button_state_changed = Some(on_button_state_changed::<I, R>);
}
extern "C" fn on_button_pressed<I: ImplButtonDelegate, R: Rc>(
self_: *mut _cef_button_delegate_t,
button: *mut _cef_button_t,
) {
let (arg_self_, arg_button) = (self_, button);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_button =
unsafe { arg_button.as_mut() }.map(|arg| Button(unsafe { RefGuard::from_raw(arg) }));
let arg_button = arg_button.as_mut();
ImplButtonDelegate::on_button_pressed(&arg_self_.interface, arg_button)
}
extern "C" fn on_button_state_changed<I: ImplButtonDelegate, R: Rc>(
self_: *mut _cef_button_delegate_t,
button: *mut _cef_button_t,
) {
let (arg_self_, arg_button) = (self_, button);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_button =
unsafe { arg_button.as_mut() }.map(|arg| Button(unsafe { RefGuard::from_raw(arg) }));
let arg_button = arg_button.as_mut();
ImplButtonDelegate::on_button_state_changed(&arg_self_.interface, arg_button)
}
}
impl ImplViewDelegate for ButtonDelegate {
fn preferred_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.preferred_size(view)
}
fn minimum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.minimum_size(view)
}
fn maximum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.maximum_size(view)
}
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.height_for_width(view, width)
}
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_parent_view_changed(view, added, parent)
}
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_child_view_changed(view, added, child)
}
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_window_changed(view, added)
}
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_layout_changed(view, new_bounds)
}
fn on_focus(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_focus(view)
}
fn on_blur(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_blur(view)
}
fn on_theme_changed(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_theme_changed(view)
}
fn get_raw(&self) -> *mut _cef_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplButtonDelegate for ButtonDelegate {
fn on_button_pressed(&self, button: Option<&mut Button>) {
unsafe {
if let Some(f) = self.0.on_button_pressed {
let arg_button = button;
let arg_self_ = self.into_raw();
let arg_button = arg_button
.map(|arg| {
arg.add_ref();
ImplButton::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_button);
}
}
}
fn on_button_state_changed(&self, button: Option<&mut Button>) {
unsafe {
if let Some(f) = self.0.on_button_state_changed {
let arg_button = button;
let arg_self_ = self.into_raw();
let arg_button = arg_button
.map(|arg| {
arg.add_ref();
ImplButton::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_button);
}
}
}
fn get_raw(&self) -> *mut _cef_button_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_button_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ButtonDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_button_delegate_t> for &ButtonDelegate {
fn into_raw(self) -> *mut _cef_button_delegate_t {
ImplButtonDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_button_delegate_t> for &mut ButtonDelegate {
fn into_raw(self) -> *mut _cef_button_delegate_t {
ImplButtonDelegate::get_raw(self)
}
}
impl ConvertReturnValue<ButtonDelegate> for *mut _cef_button_delegate_t {
fn wrap_result(self) -> ButtonDelegate {
ButtonDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ButtonDelegate> for *mut _cef_button_delegate_t {
fn from(value: ButtonDelegate) -> Self {
let object = ImplButtonDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_display_t`] for more documentation.
#[derive(Clone)]
pub struct Display(RefGuard<_cef_display_t>);
pub trait ImplDisplay: Clone + Sized + Rc {
#[doc = "See [`_cef_display_t::get_id`] for more documentation."]
fn id(&self) -> i64;
#[doc = "See [`_cef_display_t::get_device_scale_factor`] for more documentation."]
fn device_scale_factor(&self) -> f32;
#[doc = "See [`_cef_display_t::convert_point_to_pixels`] for more documentation."]
fn convert_point_to_pixels(&self, point: Option<&mut Point>);
#[doc = "See [`_cef_display_t::convert_point_from_pixels`] for more documentation."]
fn convert_point_from_pixels(&self, point: Option<&mut Point>);
#[doc = "See [`_cef_display_t::get_bounds`] for more documentation."]
fn bounds(&self) -> Rect;
#[doc = "See [`_cef_display_t::get_work_area`] for more documentation."]
fn work_area(&self) -> Rect;
#[doc = "See [`_cef_display_t::get_rotation`] for more documentation."]
fn rotation(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_display_t;
}
impl ImplDisplay for Display {
fn id(&self) -> i64 {
unsafe {
self.0
.get_id
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn device_scale_factor(&self) -> f32 {
unsafe {
self.0
.get_device_scale_factor
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn convert_point_to_pixels(&self, point: Option<&mut Point>) {
unsafe {
if let Some(f) = self.0.convert_point_to_pixels {
let arg_point = point;
let arg_self_ = self.into_raw();
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_point);
}
}
}
fn convert_point_from_pixels(&self, point: Option<&mut Point>) {
unsafe {
if let Some(f) = self.0.convert_point_from_pixels {
let arg_point = point;
let arg_self_ = self.into_raw();
let mut arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_point);
}
}
}
fn bounds(&self) -> Rect {
unsafe {
self.0
.get_bounds
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn work_area(&self) -> Rect {
unsafe {
self.0
.get_work_area
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn rotation(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_rotation
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_display_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_display_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Display {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_display_t> for &Display {
fn into_raw(self) -> *mut _cef_display_t {
ImplDisplay::get_raw(self)
}
}
impl ConvertParam<*mut _cef_display_t> for &mut Display {
fn into_raw(self) -> *mut _cef_display_t {
ImplDisplay::get_raw(self)
}
}
impl ConvertReturnValue<Display> for *mut _cef_display_t {
fn wrap_result(self) -> Display {
Display(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Display> for *mut _cef_display_t {
fn from(value: Display) -> Self {
let object = ImplDisplay::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_fill_layout_t`] for more documentation.
#[derive(Clone)]
pub struct FillLayout(RefGuard<_cef_fill_layout_t>);
pub trait ImplFillLayout: ImplLayout {
fn get_raw(&self) -> *mut _cef_fill_layout_t {
<Self as ImplLayout>::get_raw(self).cast()
}
}
impl ImplLayout for FillLayout {
fn as_box_layout(&self) -> Option<BoxLayout> {
Layout::from(self).as_box_layout()
}
fn as_fill_layout(&self) -> Option<FillLayout> {
Layout::from(self).as_fill_layout()
}
fn is_valid(&self) -> ::std::os::raw::c_int {
Layout::from(self).is_valid()
}
fn get_raw(&self) -> *mut _cef_layout_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&FillLayout> for Layout {
fn from(from: &FillLayout) -> Self {
Layout(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplFillLayout for FillLayout {
fn get_raw(&self) -> *mut _cef_fill_layout_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_fill_layout_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for FillLayout {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_fill_layout_t> for &FillLayout {
fn into_raw(self) -> *mut _cef_fill_layout_t {
ImplFillLayout::get_raw(self)
}
}
impl ConvertParam<*mut _cef_fill_layout_t> for &mut FillLayout {
fn into_raw(self) -> *mut _cef_fill_layout_t {
ImplFillLayout::get_raw(self)
}
}
impl ConvertReturnValue<FillLayout> for *mut _cef_fill_layout_t {
fn wrap_result(self) -> FillLayout {
FillLayout(unsafe { RefGuard::from_raw(self) })
}
}
impl From<FillLayout> for *mut _cef_fill_layout_t {
fn from(value: FillLayout) -> Self {
let object = ImplFillLayout::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_label_button_t`] for more documentation.
#[derive(Clone)]
pub struct LabelButton(RefGuard<_cef_label_button_t>);
pub trait ImplLabelButton: ImplButton {
#[doc = "See [`_cef_label_button_t::as_menu_button`] for more documentation."]
fn as_menu_button(&self) -> Option<MenuButton>;
#[doc = "See [`_cef_label_button_t::set_text`] for more documentation."]
fn set_text(&self, text: Option<&CefString>);
#[doc = "See [`_cef_label_button_t::get_text`] for more documentation."]
fn text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_label_button_t::set_image`] for more documentation."]
fn set_image(&self, button_state: ButtonState, image: Option<&mut Image>);
#[doc = "See [`_cef_label_button_t::get_image`] for more documentation."]
fn image(&self, button_state: ButtonState) -> Option<Image>;
#[doc = "See [`_cef_label_button_t::set_text_color`] for more documentation."]
fn set_text_color(&self, for_state: ButtonState, color: u32);
#[doc = "See [`_cef_label_button_t::set_enabled_text_colors`] for more documentation."]
fn set_enabled_text_colors(&self, color: u32);
#[doc = "See [`_cef_label_button_t::set_font_list`] for more documentation."]
fn set_font_list(&self, font_list: Option<&CefString>);
#[doc = "See [`_cef_label_button_t::set_horizontal_alignment`] for more documentation."]
fn set_horizontal_alignment(&self, alignment: HorizontalAlignment);
#[doc = "See [`_cef_label_button_t::set_minimum_size`] for more documentation."]
fn set_minimum_size(&self, size: Option<&Size>);
#[doc = "See [`_cef_label_button_t::set_maximum_size`] for more documentation."]
fn set_maximum_size(&self, size: Option<&Size>);
fn get_raw(&self) -> *mut _cef_label_button_t {
<Self as ImplButton>::get_raw(self).cast()
}
}
impl ImplView for LabelButton {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&LabelButton> for View {
fn from(from: &LabelButton) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplButton for LabelButton {
fn as_label_button(&self) -> Option<LabelButton> {
Button::from(self).as_label_button()
}
fn set_state(&self, state: ButtonState) {
Button::from(self).set_state(state)
}
fn state(&self) -> ButtonState {
Button::from(self).state()
}
fn set_ink_drop_enabled(&self, enabled: ::std::os::raw::c_int) {
Button::from(self).set_ink_drop_enabled(enabled)
}
fn set_tooltip_text(&self, tooltip_text: Option<&CefString>) {
Button::from(self).set_tooltip_text(tooltip_text)
}
fn set_accessible_name(&self, name: Option<&CefString>) {
Button::from(self).set_accessible_name(name)
}
fn get_raw(&self) -> *mut _cef_button_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&LabelButton> for Button {
fn from(from: &LabelButton) -> Self {
Button(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplLabelButton for LabelButton {
fn as_menu_button(&self) -> Option<MenuButton> {
unsafe {
self.0
.as_menu_button
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_text(&self, text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_text {
let arg_text = text;
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_text);
}
}
}
fn text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_image(&self, button_state: ButtonState, image: Option<&mut Image>) {
unsafe {
if let Some(f) = self.0.set_image {
let (arg_button_state, arg_image) = (button_state, image);
let arg_self_ = self.into_raw();
let arg_button_state = arg_button_state.into_raw();
let arg_image = arg_image
.map(|arg| {
arg.add_ref();
ImplImage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_button_state, arg_image);
}
}
}
fn image(&self, button_state: ButtonState) -> Option<Image> {
unsafe {
self.0
.get_image
.map(|f| {
let arg_button_state = button_state;
let arg_self_ = self.into_raw();
let arg_button_state = arg_button_state.into_raw();
let result = f(arg_self_, arg_button_state);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_text_color(&self, for_state: ButtonState, color: u32) {
unsafe {
if let Some(f) = self.0.set_text_color {
let (arg_for_state, arg_color) = (for_state, color);
let arg_self_ = self.into_raw();
let arg_for_state = arg_for_state.into_raw();
f(arg_self_, arg_for_state, arg_color);
}
}
}
fn set_enabled_text_colors(&self, color: u32) {
unsafe {
if let Some(f) = self.0.set_enabled_text_colors {
let arg_color = color;
let arg_self_ = self.into_raw();
f(arg_self_, arg_color);
}
}
}
fn set_font_list(&self, font_list: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_font_list {
let arg_font_list = font_list;
let arg_self_ = self.into_raw();
let arg_font_list = arg_font_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_font_list);
}
}
}
fn set_horizontal_alignment(&self, alignment: HorizontalAlignment) {
unsafe {
if let Some(f) = self.0.set_horizontal_alignment {
let arg_alignment = alignment;
let arg_self_ = self.into_raw();
let arg_alignment = arg_alignment.into_raw();
f(arg_self_, arg_alignment);
}
}
}
fn set_minimum_size(&self, size: Option<&Size>) {
unsafe {
if let Some(f) = self.0.set_minimum_size {
let arg_size = size;
let arg_self_ = self.into_raw();
let arg_size = arg_size.cloned().map(|arg| arg.into());
let arg_size = arg_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_size);
}
}
}
fn set_maximum_size(&self, size: Option<&Size>) {
unsafe {
if let Some(f) = self.0.set_maximum_size {
let arg_size = size;
let arg_self_ = self.into_raw();
let arg_size = arg_size.cloned().map(|arg| arg.into());
let arg_size = arg_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_size);
}
}
}
fn get_raw(&self) -> *mut _cef_label_button_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_label_button_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for LabelButton {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_label_button_t> for &LabelButton {
fn into_raw(self) -> *mut _cef_label_button_t {
ImplLabelButton::get_raw(self)
}
}
impl ConvertParam<*mut _cef_label_button_t> for &mut LabelButton {
fn into_raw(self) -> *mut _cef_label_button_t {
ImplLabelButton::get_raw(self)
}
}
impl ConvertReturnValue<LabelButton> for *mut _cef_label_button_t {
fn wrap_result(self) -> LabelButton {
LabelButton(unsafe { RefGuard::from_raw(self) })
}
}
impl From<LabelButton> for *mut _cef_label_button_t {
fn from(value: LabelButton) -> Self {
let object = ImplLabelButton::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_menu_button_pressed_lock_t`] for more documentation.
#[derive(Clone)]
pub struct MenuButtonPressedLock(RefGuard<_cef_menu_button_pressed_lock_t>);
pub trait ImplMenuButtonPressedLock: Clone + Sized + Rc {
fn get_raw(&self) -> *mut _cef_menu_button_pressed_lock_t;
}
impl ImplMenuButtonPressedLock for MenuButtonPressedLock {
fn get_raw(&self) -> *mut _cef_menu_button_pressed_lock_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_menu_button_pressed_lock_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MenuButtonPressedLock {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_menu_button_pressed_lock_t> for &MenuButtonPressedLock {
fn into_raw(self) -> *mut _cef_menu_button_pressed_lock_t {
ImplMenuButtonPressedLock::get_raw(self)
}
}
impl ConvertParam<*mut _cef_menu_button_pressed_lock_t> for &mut MenuButtonPressedLock {
fn into_raw(self) -> *mut _cef_menu_button_pressed_lock_t {
ImplMenuButtonPressedLock::get_raw(self)
}
}
impl ConvertReturnValue<MenuButtonPressedLock> for *mut _cef_menu_button_pressed_lock_t {
fn wrap_result(self) -> MenuButtonPressedLock {
MenuButtonPressedLock(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MenuButtonPressedLock> for *mut _cef_menu_button_pressed_lock_t {
fn from(value: MenuButtonPressedLock) -> Self {
let object = ImplMenuButtonPressedLock::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_menu_button_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct MenuButtonDelegate(RefGuard<_cef_menu_button_delegate_t>);
impl MenuButtonDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapMenuButtonDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplMenuButtonDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapMenuButtonDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_menu_button_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapMenuButtonDelegate: ImplMenuButtonDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_menu_button_delegate_t, Self>);
}
pub trait ImplMenuButtonDelegate: ImplButtonDelegate {
#[doc = "See [`_cef_menu_button_delegate_t::on_menu_button_pressed`] for more documentation."]
fn on_menu_button_pressed(
&self,
menu_button: Option<&mut MenuButton>,
screen_point: Option<&Point>,
button_pressed_lock: Option<&mut MenuButtonPressedLock>,
) {
}
fn init_methods(object: &mut _cef_menu_button_delegate_t) {
impl_cef_view_delegate_t::init_methods::<Self, _cef_menu_button_delegate_t>(
&mut object.base.base,
);
impl_cef_button_delegate_t::init_methods::<Self, _cef_menu_button_delegate_t>(
&mut object.base,
);
impl_cef_menu_button_delegate_t::init_methods::<Self, _cef_menu_button_delegate_t>(object);
}
fn get_raw(&self) -> *mut _cef_menu_button_delegate_t {
<Self as ImplButtonDelegate>::get_raw(self).cast()
}
}
#[doc = "Implement the [`WrapMenuButtonDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl MenuButtonDelegate` block you can override default\nmethods implemented by the [`ImplMenuButtonDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_menu_button_delegate! {\n struct MyMenuButtonDelegate {\n payload: String,\n }\n\n impl ViewDelegate {\n // ...\n }\n\n impl ButtonDelegate {\n // ...\n }\n\n impl MenuButtonDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> MenuButtonDelegate {\n MyMenuButtonDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_menu_button_delegate { ($ vis : vis struct $ name : ident ; impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl ButtonDelegate { $ ($ (# [$ wrap_button_delegate_attrs_name : meta]) * fn $ wrap_button_delegate_method_name : ident (& $ wrap_button_delegate_self : ident $ (, $ wrap_button_delegate_arg_name : ident : $ wrap_button_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_button_delegate_return_type : ty) ? { $ ($ wrap_button_delegate_body : tt) * }) * } impl MenuButtonDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_menu_button_delegate ! { $ vis struct $ name { } impl MenuButtonDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl ButtonDelegate { $ ($ (# [$ wrap_button_delegate_attrs_name : meta]) * fn $ wrap_button_delegate_method_name : ident (& $ wrap_button_delegate_self : ident $ (, $ wrap_button_delegate_arg_name : ident : $ wrap_button_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_button_delegate_return_type : ty) ? { $ ($ wrap_button_delegate_body : tt) * }) * } impl MenuButtonDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_menu_button_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> MenuButtonDelegate { MenuButtonDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapMenuButtonDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_menu_button_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_view_delegate_attrs_name]) * fn $ wrap_view_delegate_method_name (& $ wrap_view_delegate_self $ (, $ wrap_view_delegate_arg_name : $ wrap_view_delegate_arg_type) *) $ (-> $ wrap_view_delegate_return_type) ? { $ ($ wrap_view_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_view_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplButtonDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_button_delegate_attrs_name]) * fn $ wrap_button_delegate_method_name (& $ wrap_button_delegate_self $ (, $ wrap_button_delegate_arg_name : $ wrap_button_delegate_arg_type) *) $ (-> $ wrap_button_delegate_return_type) ? { $ ($ wrap_button_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_button_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplMenuButtonDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_menu_button_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_menu_button_delegate_t {
use super::*;
pub fn init_methods<I: ImplMenuButtonDelegate, R: Rc>(
object: &mut _cef_menu_button_delegate_t,
) {
object.on_menu_button_pressed = Some(on_menu_button_pressed::<I, R>);
}
extern "C" fn on_menu_button_pressed<I: ImplMenuButtonDelegate, R: Rc>(
self_: *mut _cef_menu_button_delegate_t,
menu_button: *mut _cef_menu_button_t,
screen_point: *const _cef_point_t,
button_pressed_lock: *mut _cef_menu_button_pressed_lock_t,
) {
let (arg_self_, arg_menu_button, arg_screen_point, arg_button_pressed_lock) =
(self_, menu_button, screen_point, button_pressed_lock);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_menu_button = unsafe { arg_menu_button.as_mut() }
.map(|arg| MenuButton(unsafe { RefGuard::from_raw(arg) }));
let arg_menu_button = arg_menu_button.as_mut();
let arg_screen_point = if arg_screen_point.is_null() {
None
} else {
Some(WrapParamRef::<Point, _>::from(arg_screen_point))
};
let arg_screen_point = arg_screen_point.as_ref().map(|arg| arg.as_ref());
let mut arg_button_pressed_lock = unsafe { arg_button_pressed_lock.as_mut() }
.map(|arg| MenuButtonPressedLock(unsafe { RefGuard::from_raw(arg) }));
let arg_button_pressed_lock = arg_button_pressed_lock.as_mut();
ImplMenuButtonDelegate::on_menu_button_pressed(
&arg_self_.interface,
arg_menu_button,
arg_screen_point,
arg_button_pressed_lock,
)
}
}
impl ImplViewDelegate for MenuButtonDelegate {
fn preferred_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.preferred_size(view)
}
fn minimum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.minimum_size(view)
}
fn maximum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.maximum_size(view)
}
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.height_for_width(view, width)
}
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_parent_view_changed(view, added, parent)
}
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_child_view_changed(view, added, child)
}
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_window_changed(view, added)
}
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_layout_changed(view, new_bounds)
}
fn on_focus(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_focus(view)
}
fn on_blur(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_blur(view)
}
fn on_theme_changed(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_theme_changed(view)
}
fn get_raw(&self) -> *mut _cef_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplButtonDelegate for MenuButtonDelegate {
fn on_button_pressed(&self, button: Option<&mut Button>) {
ButtonDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_button_pressed(button)
}
fn on_button_state_changed(&self, button: Option<&mut Button>) {
ButtonDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_button_state_changed(button)
}
fn get_raw(&self) -> *mut _cef_button_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplMenuButtonDelegate for MenuButtonDelegate {
fn on_menu_button_pressed(
&self,
menu_button: Option<&mut MenuButton>,
screen_point: Option<&Point>,
button_pressed_lock: Option<&mut MenuButtonPressedLock>,
) {
unsafe {
if let Some(f) = self.0.on_menu_button_pressed {
let (arg_menu_button, arg_screen_point, arg_button_pressed_lock) =
(menu_button, screen_point, button_pressed_lock);
let arg_self_ = self.into_raw();
let arg_menu_button = arg_menu_button
.map(|arg| {
arg.add_ref();
ImplMenuButton::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_screen_point = arg_screen_point.cloned().map(|arg| arg.into());
let arg_screen_point = arg_screen_point
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_button_pressed_lock = arg_button_pressed_lock
.map(|arg| {
arg.add_ref();
ImplMenuButtonPressedLock::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(
arg_self_,
arg_menu_button,
arg_screen_point,
arg_button_pressed_lock,
);
}
}
}
fn get_raw(&self) -> *mut _cef_menu_button_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_menu_button_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MenuButtonDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_menu_button_delegate_t> for &MenuButtonDelegate {
fn into_raw(self) -> *mut _cef_menu_button_delegate_t {
ImplMenuButtonDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_menu_button_delegate_t> for &mut MenuButtonDelegate {
fn into_raw(self) -> *mut _cef_menu_button_delegate_t {
ImplMenuButtonDelegate::get_raw(self)
}
}
impl ConvertReturnValue<MenuButtonDelegate> for *mut _cef_menu_button_delegate_t {
fn wrap_result(self) -> MenuButtonDelegate {
MenuButtonDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MenuButtonDelegate> for *mut _cef_menu_button_delegate_t {
fn from(value: MenuButtonDelegate) -> Self {
let object = ImplMenuButtonDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_menu_button_t`] for more documentation.
#[derive(Clone)]
pub struct MenuButton(RefGuard<_cef_menu_button_t>);
pub trait ImplMenuButton: ImplLabelButton {
#[doc = "See [`_cef_menu_button_t::show_menu`] for more documentation."]
fn show_menu(
&self,
menu_model: Option<&mut MenuModel>,
screen_point: Option<&Point>,
anchor_position: MenuAnchorPosition,
);
#[doc = "See [`_cef_menu_button_t::trigger_menu`] for more documentation."]
fn trigger_menu(&self);
fn get_raw(&self) -> *mut _cef_menu_button_t {
<Self as ImplLabelButton>::get_raw(self).cast()
}
}
impl ImplView for MenuButton {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&MenuButton> for View {
fn from(from: &MenuButton) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplButton for MenuButton {
fn as_label_button(&self) -> Option<LabelButton> {
Button::from(self).as_label_button()
}
fn set_state(&self, state: ButtonState) {
Button::from(self).set_state(state)
}
fn state(&self) -> ButtonState {
Button::from(self).state()
}
fn set_ink_drop_enabled(&self, enabled: ::std::os::raw::c_int) {
Button::from(self).set_ink_drop_enabled(enabled)
}
fn set_tooltip_text(&self, tooltip_text: Option<&CefString>) {
Button::from(self).set_tooltip_text(tooltip_text)
}
fn set_accessible_name(&self, name: Option<&CefString>) {
Button::from(self).set_accessible_name(name)
}
fn get_raw(&self) -> *mut _cef_button_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&MenuButton> for Button {
fn from(from: &MenuButton) -> Self {
Button(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplLabelButton for MenuButton {
fn as_menu_button(&self) -> Option<MenuButton> {
LabelButton::from(self).as_menu_button()
}
fn set_text(&self, text: Option<&CefString>) {
LabelButton::from(self).set_text(text)
}
fn text(&self) -> CefStringUserfree {
LabelButton::from(self).text()
}
fn set_image(&self, button_state: ButtonState, image: Option<&mut Image>) {
LabelButton::from(self).set_image(button_state, image)
}
fn image(&self, button_state: ButtonState) -> Option<Image> {
LabelButton::from(self).image(button_state)
}
fn set_text_color(&self, for_state: ButtonState, color: u32) {
LabelButton::from(self).set_text_color(for_state, color)
}
fn set_enabled_text_colors(&self, color: u32) {
LabelButton::from(self).set_enabled_text_colors(color)
}
fn set_font_list(&self, font_list: Option<&CefString>) {
LabelButton::from(self).set_font_list(font_list)
}
fn set_horizontal_alignment(&self, alignment: HorizontalAlignment) {
LabelButton::from(self).set_horizontal_alignment(alignment)
}
fn set_minimum_size(&self, size: Option<&Size>) {
LabelButton::from(self).set_minimum_size(size)
}
fn set_maximum_size(&self, size: Option<&Size>) {
LabelButton::from(self).set_maximum_size(size)
}
fn get_raw(&self) -> *mut _cef_label_button_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&MenuButton> for LabelButton {
fn from(from: &MenuButton) -> Self {
LabelButton(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplMenuButton for MenuButton {
fn show_menu(
&self,
menu_model: Option<&mut MenuModel>,
screen_point: Option<&Point>,
anchor_position: MenuAnchorPosition,
) {
unsafe {
if let Some(f) = self.0.show_menu {
let (arg_menu_model, arg_screen_point, arg_anchor_position) =
(menu_model, screen_point, anchor_position);
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_screen_point = arg_screen_point.cloned().map(|arg| arg.into());
let arg_screen_point = arg_screen_point
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_anchor_position = arg_anchor_position.into_raw();
f(
arg_self_,
arg_menu_model,
arg_screen_point,
arg_anchor_position,
);
}
}
}
fn trigger_menu(&self) {
unsafe {
if let Some(f) = self.0.trigger_menu {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn get_raw(&self) -> *mut _cef_menu_button_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_menu_button_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for MenuButton {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_menu_button_t> for &MenuButton {
fn into_raw(self) -> *mut _cef_menu_button_t {
ImplMenuButton::get_raw(self)
}
}
impl ConvertParam<*mut _cef_menu_button_t> for &mut MenuButton {
fn into_raw(self) -> *mut _cef_menu_button_t {
ImplMenuButton::get_raw(self)
}
}
impl ConvertReturnValue<MenuButton> for *mut _cef_menu_button_t {
fn wrap_result(self) -> MenuButton {
MenuButton(unsafe { RefGuard::from_raw(self) })
}
}
impl From<MenuButton> for *mut _cef_menu_button_t {
fn from(value: MenuButton) -> Self {
let object = ImplMenuButton::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_overlay_controller_t`] for more documentation.
#[derive(Clone)]
pub struct OverlayController(RefGuard<_cef_overlay_controller_t>);
pub trait ImplOverlayController: Clone + Sized + Rc {
#[doc = "See [`_cef_overlay_controller_t::is_valid`] for more documentation."]
fn is_valid(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_overlay_controller_t::is_same`] for more documentation."]
fn is_same(&self, that: Option<&mut OverlayController>) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_overlay_controller_t::get_contents_view`] for more documentation."]
fn contents_view(&self) -> Option<View>;
#[doc = "See [`_cef_overlay_controller_t::get_window`] for more documentation."]
fn window(&self) -> Option<Window>;
#[doc = "See [`_cef_overlay_controller_t::get_docking_mode`] for more documentation."]
fn docking_mode(&self) -> DockingMode;
#[doc = "See [`_cef_overlay_controller_t::destroy`] for more documentation."]
fn destroy(&self);
#[doc = "See [`_cef_overlay_controller_t::set_bounds`] for more documentation."]
fn set_bounds(&self, bounds: Option<&Rect>);
#[doc = "See [`_cef_overlay_controller_t::get_bounds`] for more documentation."]
fn bounds(&self) -> Rect;
#[doc = "See [`_cef_overlay_controller_t::get_bounds_in_screen`] for more documentation."]
fn bounds_in_screen(&self) -> Rect;
#[doc = "See [`_cef_overlay_controller_t::set_size`] for more documentation."]
fn set_size(&self, size: Option<&Size>);
#[doc = "See [`_cef_overlay_controller_t::get_size`] for more documentation."]
fn size(&self) -> Size;
#[doc = "See [`_cef_overlay_controller_t::set_position`] for more documentation."]
fn set_position(&self, position: Option<&Point>);
#[doc = "See [`_cef_overlay_controller_t::get_position`] for more documentation."]
fn position(&self) -> Point;
#[doc = "See [`_cef_overlay_controller_t::set_insets`] for more documentation."]
fn set_insets(&self, insets: Option<&Insets>);
#[doc = "See [`_cef_overlay_controller_t::get_insets`] for more documentation."]
fn insets(&self) -> Insets;
#[doc = "See [`_cef_overlay_controller_t::size_to_preferred_size`] for more documentation."]
fn size_to_preferred_size(&self);
#[doc = "See [`_cef_overlay_controller_t::set_visible`] for more documentation."]
fn set_visible(&self, visible: ::std::os::raw::c_int);
#[doc = "See [`_cef_overlay_controller_t::is_visible`] for more documentation."]
fn is_visible(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_overlay_controller_t::is_drawn`] for more documentation."]
fn is_drawn(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_overlay_controller_t;
}
impl ImplOverlayController for OverlayController {
fn is_valid(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_valid
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_same(&self, that: Option<&mut OverlayController>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_same
.map(|f| {
let arg_that = that;
let arg_self_ = self.into_raw();
let arg_that = arg_that
.map(|arg| {
arg.add_ref();
ImplOverlayController::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_that);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn contents_view(&self) -> Option<View> {
unsafe {
self.0
.get_contents_view
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn window(&self) -> Option<Window> {
unsafe {
self.0
.get_window
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn docking_mode(&self) -> DockingMode {
unsafe {
self.0
.get_docking_mode
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn destroy(&self) {
unsafe {
if let Some(f) = self.0.destroy {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_bounds(&self, bounds: Option<&Rect>) {
unsafe {
if let Some(f) = self.0.set_bounds {
let arg_bounds = bounds;
let arg_self_ = self.into_raw();
let arg_bounds = arg_bounds.cloned().map(|arg| arg.into());
let arg_bounds = arg_bounds
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_bounds);
}
}
}
fn bounds(&self) -> Rect {
unsafe {
self.0
.get_bounds
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn bounds_in_screen(&self) -> Rect {
unsafe {
self.0
.get_bounds_in_screen
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_size(&self, size: Option<&Size>) {
unsafe {
if let Some(f) = self.0.set_size {
let arg_size = size;
let arg_self_ = self.into_raw();
let arg_size = arg_size.cloned().map(|arg| arg.into());
let arg_size = arg_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_size);
}
}
}
fn size(&self) -> Size {
unsafe {
self.0
.get_size
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_position(&self, position: Option<&Point>) {
unsafe {
if let Some(f) = self.0.set_position {
let arg_position = position;
let arg_self_ = self.into_raw();
let arg_position = arg_position.cloned().map(|arg| arg.into());
let arg_position = arg_position
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_position);
}
}
}
fn position(&self) -> Point {
unsafe {
self.0
.get_position
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_insets(&self, insets: Option<&Insets>) {
unsafe {
if let Some(f) = self.0.set_insets {
let arg_insets = insets;
let arg_self_ = self.into_raw();
let arg_insets = arg_insets.cloned().map(|arg| arg.into());
let arg_insets = arg_insets
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_insets);
}
}
}
fn insets(&self) -> Insets {
unsafe {
self.0
.get_insets
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn size_to_preferred_size(&self) {
unsafe {
if let Some(f) = self.0.size_to_preferred_size {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_visible {
let arg_visible = visible;
let arg_self_ = self.into_raw();
f(arg_self_, arg_visible);
}
}
}
fn is_visible(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_visible
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_drawn
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_overlay_controller_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_overlay_controller_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for OverlayController {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_overlay_controller_t> for &OverlayController {
fn into_raw(self) -> *mut _cef_overlay_controller_t {
ImplOverlayController::get_raw(self)
}
}
impl ConvertParam<*mut _cef_overlay_controller_t> for &mut OverlayController {
fn into_raw(self) -> *mut _cef_overlay_controller_t {
ImplOverlayController::get_raw(self)
}
}
impl ConvertReturnValue<OverlayController> for *mut _cef_overlay_controller_t {
fn wrap_result(self) -> OverlayController {
OverlayController(unsafe { RefGuard::from_raw(self) })
}
}
impl From<OverlayController> for *mut _cef_overlay_controller_t {
fn from(value: OverlayController) -> Self {
let object = ImplOverlayController::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_panel_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct PanelDelegate(RefGuard<_cef_panel_delegate_t>);
impl PanelDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapPanelDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplPanelDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapPanelDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_panel_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapPanelDelegate: ImplPanelDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_panel_delegate_t, Self>);
}
pub trait ImplPanelDelegate: ImplViewDelegate {
fn init_methods(object: &mut _cef_panel_delegate_t) {
impl_cef_view_delegate_t::init_methods::<Self, _cef_panel_delegate_t>(&mut object.base);
impl_cef_panel_delegate_t::init_methods::<Self, _cef_panel_delegate_t>(object);
}
fn get_raw(&self) -> *mut _cef_panel_delegate_t {
<Self as ImplViewDelegate>::get_raw(self).cast()
}
}
#[doc = "Implement the [`WrapPanelDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl PanelDelegate` block you can override default\nmethods implemented by the [`ImplPanelDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_panel_delegate! {\n struct MyPanelDelegate {\n payload: String,\n }\n\n impl ViewDelegate {\n // ...\n }\n\n impl PanelDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> PanelDelegate {\n MyPanelDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_panel_delegate { ($ vis : vis struct $ name : ident ; impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl PanelDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_panel_delegate ! { $ vis struct $ name { } impl PanelDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl PanelDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_panel_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> PanelDelegate { PanelDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapPanelDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_panel_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_view_delegate_attrs_name]) * fn $ wrap_view_delegate_method_name (& $ wrap_view_delegate_self $ (, $ wrap_view_delegate_arg_name : $ wrap_view_delegate_arg_type) *) $ (-> $ wrap_view_delegate_return_type) ? { $ ($ wrap_view_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_view_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplPanelDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_panel_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_panel_delegate_t {
use super::*;
pub fn init_methods<I: ImplPanelDelegate, R: Rc>(object: &mut _cef_panel_delegate_t) {}
}
impl ImplViewDelegate for PanelDelegate {
fn preferred_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.preferred_size(view)
}
fn minimum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.minimum_size(view)
}
fn maximum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.maximum_size(view)
}
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.height_for_width(view, width)
}
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_parent_view_changed(view, added, parent)
}
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_child_view_changed(view, added, child)
}
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_window_changed(view, added)
}
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_layout_changed(view, new_bounds)
}
fn on_focus(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_focus(view)
}
fn on_blur(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_blur(view)
}
fn on_theme_changed(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_theme_changed(view)
}
fn get_raw(&self) -> *mut _cef_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplPanelDelegate for PanelDelegate {
fn get_raw(&self) -> *mut _cef_panel_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_panel_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for PanelDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_panel_delegate_t> for &PanelDelegate {
fn into_raw(self) -> *mut _cef_panel_delegate_t {
ImplPanelDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_panel_delegate_t> for &mut PanelDelegate {
fn into_raw(self) -> *mut _cef_panel_delegate_t {
ImplPanelDelegate::get_raw(self)
}
}
impl ConvertReturnValue<PanelDelegate> for *mut _cef_panel_delegate_t {
fn wrap_result(self) -> PanelDelegate {
PanelDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<PanelDelegate> for *mut _cef_panel_delegate_t {
fn from(value: PanelDelegate) -> Self {
let object = ImplPanelDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_panel_t`] for more documentation.
#[derive(Clone)]
pub struct Panel(RefGuard<_cef_panel_t>);
pub trait ImplPanel: ImplView {
#[doc = "See [`_cef_panel_t::as_window`] for more documentation."]
fn as_window(&self) -> Option<Window>;
#[doc = "See [`_cef_panel_t::set_to_fill_layout`] for more documentation."]
fn set_to_fill_layout(&self) -> Option<FillLayout>;
#[doc = "See [`_cef_panel_t::set_to_box_layout`] for more documentation."]
fn set_to_box_layout(&self, settings: Option<&BoxLayoutSettings>) -> Option<BoxLayout>;
#[doc = "See [`_cef_panel_t::get_layout`] for more documentation."]
fn get_layout(&self) -> Option<Layout>;
#[doc = "See [`_cef_panel_t::layout`] for more documentation."]
fn layout(&self);
#[doc = "See [`_cef_panel_t::add_child_view`] for more documentation."]
fn add_child_view(&self, view: Option<&mut View>);
#[doc = "See [`_cef_panel_t::add_child_view_at`] for more documentation."]
fn add_child_view_at(&self, view: Option<&mut View>, index: ::std::os::raw::c_int);
#[doc = "See [`_cef_panel_t::reorder_child_view`] for more documentation."]
fn reorder_child_view(&self, view: Option<&mut View>, index: ::std::os::raw::c_int);
#[doc = "See [`_cef_panel_t::remove_child_view`] for more documentation."]
fn remove_child_view(&self, view: Option<&mut View>);
#[doc = "See [`_cef_panel_t::remove_all_child_views`] for more documentation."]
fn remove_all_child_views(&self);
#[doc = "See [`_cef_panel_t::get_child_view_count`] for more documentation."]
fn child_view_count(&self) -> usize;
#[doc = "See [`_cef_panel_t::get_child_view_at`] for more documentation."]
fn child_view_at(&self, index: ::std::os::raw::c_int) -> Option<View>;
fn get_raw(&self) -> *mut _cef_panel_t {
<Self as ImplView>::get_raw(self).cast()
}
}
impl ImplView for Panel {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&Panel> for View {
fn from(from: &Panel) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplPanel for Panel {
fn as_window(&self) -> Option<Window> {
unsafe {
self.0
.as_window
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_to_fill_layout(&self) -> Option<FillLayout> {
unsafe {
self.0
.set_to_fill_layout
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_to_box_layout(&self, settings: Option<&BoxLayoutSettings>) -> Option<BoxLayout> {
unsafe {
self.0
.set_to_box_layout
.map(|f| {
let arg_settings = settings;
let arg_self_ = self.into_raw();
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_settings);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_layout(&self) -> Option<Layout> {
unsafe {
self.0
.get_layout
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn layout(&self) {
unsafe {
if let Some(f) = self.0.layout {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn add_child_view(&self, view: Option<&mut View>) {
unsafe {
if let Some(f) = self.0.add_child_view {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view);
}
}
}
fn add_child_view_at(&self, view: Option<&mut View>, index: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.add_child_view_at {
let (arg_view, arg_index) = (view, index);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view, arg_index);
}
}
}
fn reorder_child_view(&self, view: Option<&mut View>, index: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.reorder_child_view {
let (arg_view, arg_index) = (view, index);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view, arg_index);
}
}
}
fn remove_child_view(&self, view: Option<&mut View>) {
unsafe {
if let Some(f) = self.0.remove_child_view {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view);
}
}
}
fn remove_all_child_views(&self) {
unsafe {
if let Some(f) = self.0.remove_all_child_views {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn child_view_count(&self) -> usize {
unsafe {
self.0
.get_child_view_count
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn child_view_at(&self, index: ::std::os::raw::c_int) -> Option<View> {
unsafe {
self.0
.get_child_view_at
.map(|f| {
let arg_index = index;
let arg_self_ = self.into_raw();
let result = f(arg_self_, arg_index);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_panel_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_panel_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Panel {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_panel_t> for &Panel {
fn into_raw(self) -> *mut _cef_panel_t {
ImplPanel::get_raw(self)
}
}
impl ConvertParam<*mut _cef_panel_t> for &mut Panel {
fn into_raw(self) -> *mut _cef_panel_t {
ImplPanel::get_raw(self)
}
}
impl ConvertReturnValue<Panel> for *mut _cef_panel_t {
fn wrap_result(self) -> Panel {
Panel(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Panel> for *mut _cef_panel_t {
fn from(value: Panel) -> Self {
let object = ImplPanel::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_scroll_view_t`] for more documentation.
#[derive(Clone)]
pub struct ScrollView(RefGuard<_cef_scroll_view_t>);
pub trait ImplScrollView: ImplView {
#[doc = "See [`_cef_scroll_view_t::set_content_view`] for more documentation."]
fn set_content_view(&self, view: Option<&mut View>);
#[doc = "See [`_cef_scroll_view_t::get_content_view`] for more documentation."]
fn content_view(&self) -> Option<View>;
#[doc = "See [`_cef_scroll_view_t::get_visible_content_rect`] for more documentation."]
fn visible_content_rect(&self) -> Rect;
#[doc = "See [`_cef_scroll_view_t::has_horizontal_scrollbar`] for more documentation."]
fn has_horizontal_scrollbar(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_scroll_view_t::get_horizontal_scrollbar_height`] for more documentation."]
fn horizontal_scrollbar_height(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_scroll_view_t::has_vertical_scrollbar`] for more documentation."]
fn has_vertical_scrollbar(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_scroll_view_t::get_vertical_scrollbar_width`] for more documentation."]
fn vertical_scrollbar_width(&self) -> ::std::os::raw::c_int;
fn get_raw(&self) -> *mut _cef_scroll_view_t {
<Self as ImplView>::get_raw(self).cast()
}
}
impl ImplView for ScrollView {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&ScrollView> for View {
fn from(from: &ScrollView) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplScrollView for ScrollView {
fn set_content_view(&self, view: Option<&mut View>) {
unsafe {
if let Some(f) = self.0.set_content_view {
let arg_view = view;
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_view);
}
}
}
fn content_view(&self) -> Option<View> {
unsafe {
self.0
.get_content_view
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn visible_content_rect(&self) -> Rect {
unsafe {
self.0
.get_visible_content_rect
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_horizontal_scrollbar(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_horizontal_scrollbar
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn horizontal_scrollbar_height(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_horizontal_scrollbar_height
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn has_vertical_scrollbar(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_vertical_scrollbar
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn vertical_scrollbar_width(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_vertical_scrollbar_width
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_scroll_view_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_scroll_view_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for ScrollView {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_scroll_view_t> for &ScrollView {
fn into_raw(self) -> *mut _cef_scroll_view_t {
ImplScrollView::get_raw(self)
}
}
impl ConvertParam<*mut _cef_scroll_view_t> for &mut ScrollView {
fn into_raw(self) -> *mut _cef_scroll_view_t {
ImplScrollView::get_raw(self)
}
}
impl ConvertReturnValue<ScrollView> for *mut _cef_scroll_view_t {
fn wrap_result(self) -> ScrollView {
ScrollView(unsafe { RefGuard::from_raw(self) })
}
}
impl From<ScrollView> for *mut _cef_scroll_view_t {
fn from(value: ScrollView) -> Self {
let object = ImplScrollView::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_textfield_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct TextfieldDelegate(RefGuard<_cef_textfield_delegate_t>);
impl TextfieldDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapTextfieldDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplTextfieldDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapTextfieldDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_textfield_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapTextfieldDelegate: ImplTextfieldDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_textfield_delegate_t, Self>);
}
pub trait ImplTextfieldDelegate: ImplViewDelegate {
#[doc = "See [`_cef_textfield_delegate_t::on_key_event`] for more documentation."]
fn on_key_event(
&self,
textfield: Option<&mut Textfield>,
event: Option<&KeyEvent>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_textfield_delegate_t::on_after_user_action`] for more documentation."]
fn on_after_user_action(&self, textfield: Option<&mut Textfield>) {}
fn init_methods(object: &mut _cef_textfield_delegate_t) {
impl_cef_view_delegate_t::init_methods::<Self, _cef_textfield_delegate_t>(&mut object.base);
impl_cef_textfield_delegate_t::init_methods::<Self, _cef_textfield_delegate_t>(object);
}
fn get_raw(&self) -> *mut _cef_textfield_delegate_t {
<Self as ImplViewDelegate>::get_raw(self).cast()
}
}
#[doc = "Implement the [`WrapTextfieldDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl TextfieldDelegate` block you can override default\nmethods implemented by the [`ImplTextfieldDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_textfield_delegate! {\n struct MyTextfieldDelegate {\n payload: String,\n }\n\n impl ViewDelegate {\n // ...\n }\n\n impl TextfieldDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> TextfieldDelegate {\n MyTextfieldDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_textfield_delegate { ($ vis : vis struct $ name : ident ; impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl TextfieldDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_textfield_delegate ! { $ vis struct $ name { } impl TextfieldDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl TextfieldDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_textfield_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> TextfieldDelegate { TextfieldDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapTextfieldDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_textfield_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_view_delegate_attrs_name]) * fn $ wrap_view_delegate_method_name (& $ wrap_view_delegate_self $ (, $ wrap_view_delegate_arg_name : $ wrap_view_delegate_arg_type) *) $ (-> $ wrap_view_delegate_return_type) ? { $ ($ wrap_view_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_view_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplTextfieldDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_textfield_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_textfield_delegate_t {
use super::*;
pub fn init_methods<I: ImplTextfieldDelegate, R: Rc>(object: &mut _cef_textfield_delegate_t) {
object.on_key_event = Some(on_key_event::<I, R>);
object.on_after_user_action = Some(on_after_user_action::<I, R>);
}
extern "C" fn on_key_event<I: ImplTextfieldDelegate, R: Rc>(
self_: *mut _cef_textfield_delegate_t,
textfield: *mut _cef_textfield_t,
event: *const _cef_key_event_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_textfield, arg_event) = (self_, textfield, event);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_textfield = unsafe { arg_textfield.as_mut() }
.map(|arg| Textfield(unsafe { RefGuard::from_raw(arg) }));
let arg_textfield = arg_textfield.as_mut();
let arg_event = if arg_event.is_null() {
None
} else {
Some(WrapParamRef::<KeyEvent, _>::from(arg_event))
};
let arg_event = arg_event.as_ref().map(|arg| arg.as_ref());
ImplTextfieldDelegate::on_key_event(&arg_self_.interface, arg_textfield, arg_event)
}
extern "C" fn on_after_user_action<I: ImplTextfieldDelegate, R: Rc>(
self_: *mut _cef_textfield_delegate_t,
textfield: *mut _cef_textfield_t,
) {
let (arg_self_, arg_textfield) = (self_, textfield);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_textfield = unsafe { arg_textfield.as_mut() }
.map(|arg| Textfield(unsafe { RefGuard::from_raw(arg) }));
let arg_textfield = arg_textfield.as_mut();
ImplTextfieldDelegate::on_after_user_action(&arg_self_.interface, arg_textfield)
}
}
impl ImplViewDelegate for TextfieldDelegate {
fn preferred_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.preferred_size(view)
}
fn minimum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.minimum_size(view)
}
fn maximum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.maximum_size(view)
}
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.height_for_width(view, width)
}
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_parent_view_changed(view, added, parent)
}
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_child_view_changed(view, added, child)
}
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_window_changed(view, added)
}
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_layout_changed(view, new_bounds)
}
fn on_focus(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_focus(view)
}
fn on_blur(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_blur(view)
}
fn on_theme_changed(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_theme_changed(view)
}
fn get_raw(&self) -> *mut _cef_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplTextfieldDelegate for TextfieldDelegate {
fn on_key_event(
&self,
textfield: Option<&mut Textfield>,
event: Option<&KeyEvent>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_key_event
.map(|f| {
let (arg_textfield, arg_event) = (textfield, event);
let arg_self_ = self.into_raw();
let arg_textfield = arg_textfield
.map(|arg| {
arg.add_ref();
ImplTextfield::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_textfield, arg_event);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_after_user_action(&self, textfield: Option<&mut Textfield>) {
unsafe {
if let Some(f) = self.0.on_after_user_action {
let arg_textfield = textfield;
let arg_self_ = self.into_raw();
let arg_textfield = arg_textfield
.map(|arg| {
arg.add_ref();
ImplTextfield::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_textfield);
}
}
}
fn get_raw(&self) -> *mut _cef_textfield_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_textfield_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for TextfieldDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_textfield_delegate_t> for &TextfieldDelegate {
fn into_raw(self) -> *mut _cef_textfield_delegate_t {
ImplTextfieldDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_textfield_delegate_t> for &mut TextfieldDelegate {
fn into_raw(self) -> *mut _cef_textfield_delegate_t {
ImplTextfieldDelegate::get_raw(self)
}
}
impl ConvertReturnValue<TextfieldDelegate> for *mut _cef_textfield_delegate_t {
fn wrap_result(self) -> TextfieldDelegate {
TextfieldDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<TextfieldDelegate> for *mut _cef_textfield_delegate_t {
fn from(value: TextfieldDelegate) -> Self {
let object = ImplTextfieldDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_textfield_t`] for more documentation.
#[derive(Clone)]
pub struct Textfield(RefGuard<_cef_textfield_t>);
pub trait ImplTextfield: ImplView {
#[doc = "See [`_cef_textfield_t::set_password_input`] for more documentation."]
fn set_password_input(&self, password_input: ::std::os::raw::c_int);
#[doc = "See [`_cef_textfield_t::is_password_input`] for more documentation."]
fn is_password_input(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_textfield_t::set_read_only`] for more documentation."]
fn set_read_only(&self, read_only: ::std::os::raw::c_int);
#[doc = "See [`_cef_textfield_t::is_read_only`] for more documentation."]
fn is_read_only(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_textfield_t::get_text`] for more documentation."]
fn text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_textfield_t::set_text`] for more documentation."]
fn set_text(&self, text: Option<&CefString>);
#[doc = "See [`_cef_textfield_t::append_text`] for more documentation."]
fn append_text(&self, text: Option<&CefString>);
#[doc = "See [`_cef_textfield_t::insert_or_replace_text`] for more documentation."]
fn insert_or_replace_text(&self, text: Option<&CefString>);
#[doc = "See [`_cef_textfield_t::has_selection`] for more documentation."]
fn has_selection(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_textfield_t::get_selected_text`] for more documentation."]
fn selected_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_textfield_t::select_all`] for more documentation."]
fn select_all(&self, reversed: ::std::os::raw::c_int);
#[doc = "See [`_cef_textfield_t::clear_selection`] for more documentation."]
fn clear_selection(&self);
#[doc = "See [`_cef_textfield_t::get_selected_range`] for more documentation."]
fn selected_range(&self) -> Range;
#[doc = "See [`_cef_textfield_t::select_range`] for more documentation."]
fn select_range(&self, range: Option<&Range>);
#[doc = "See [`_cef_textfield_t::get_cursor_position`] for more documentation."]
fn cursor_position(&self) -> usize;
#[doc = "See [`_cef_textfield_t::set_text_color`] for more documentation."]
fn set_text_color(&self, color: u32);
#[doc = "See [`_cef_textfield_t::get_text_color`] for more documentation."]
fn text_color(&self) -> cef_color_t;
#[doc = "See [`_cef_textfield_t::set_selection_text_color`] for more documentation."]
fn set_selection_text_color(&self, color: u32);
#[doc = "See [`_cef_textfield_t::get_selection_text_color`] for more documentation."]
fn selection_text_color(&self) -> cef_color_t;
#[doc = "See [`_cef_textfield_t::set_selection_background_color`] for more documentation."]
fn set_selection_background_color(&self, color: u32);
#[doc = "See [`_cef_textfield_t::get_selection_background_color`] for more documentation."]
fn selection_background_color(&self) -> cef_color_t;
#[doc = "See [`_cef_textfield_t::set_font_list`] for more documentation."]
fn set_font_list(&self, font_list: Option<&CefString>);
#[doc = "See [`_cef_textfield_t::apply_text_color`] for more documentation."]
fn apply_text_color(&self, color: u32, range: Option<&Range>);
#[doc = "See [`_cef_textfield_t::apply_text_style`] for more documentation."]
fn apply_text_style(&self, style: TextStyle, add: ::std::os::raw::c_int, range: Option<&Range>);
#[doc = "See [`_cef_textfield_t::is_command_enabled`] for more documentation."]
fn is_command_enabled(&self, command_id: TextFieldCommands) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_textfield_t::execute_command`] for more documentation."]
fn execute_command(&self, command_id: TextFieldCommands);
#[doc = "See [`_cef_textfield_t::clear_edit_history`] for more documentation."]
fn clear_edit_history(&self);
#[doc = "See [`_cef_textfield_t::set_placeholder_text`] for more documentation."]
fn set_placeholder_text(&self, text: Option<&CefString>);
#[doc = "See [`_cef_textfield_t::get_placeholder_text`] for more documentation."]
fn placeholder_text(&self) -> CefStringUserfree;
#[doc = "See [`_cef_textfield_t::set_placeholder_text_color`] for more documentation."]
fn set_placeholder_text_color(&self, color: u32);
#[doc = "See [`_cef_textfield_t::set_accessible_name`] for more documentation."]
fn set_accessible_name(&self, name: Option<&CefString>);
fn get_raw(&self) -> *mut _cef_textfield_t {
<Self as ImplView>::get_raw(self).cast()
}
}
impl ImplView for Textfield {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&Textfield> for View {
fn from(from: &Textfield) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplTextfield for Textfield {
fn set_password_input(&self, password_input: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_password_input {
let arg_password_input = password_input;
let arg_self_ = self.into_raw();
f(arg_self_, arg_password_input);
}
}
}
fn is_password_input(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_password_input
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_read_only(&self, read_only: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_read_only {
let arg_read_only = read_only;
let arg_self_ = self.into_raw();
f(arg_self_, arg_read_only);
}
}
}
fn is_read_only(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_read_only
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_text(&self, text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_text {
let arg_text = text;
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_text);
}
}
}
fn append_text(&self, text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.append_text {
let arg_text = text;
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_text);
}
}
}
fn insert_or_replace_text(&self, text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.insert_or_replace_text {
let arg_text = text;
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_text);
}
}
}
fn has_selection(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.has_selection
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn selected_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_selected_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn select_all(&self, reversed: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.select_all {
let arg_reversed = reversed;
let arg_self_ = self.into_raw();
f(arg_self_, arg_reversed);
}
}
}
fn clear_selection(&self) {
unsafe {
if let Some(f) = self.0.clear_selection {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn selected_range(&self) -> Range {
unsafe {
self.0
.get_selected_range
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn select_range(&self, range: Option<&Range>) {
unsafe {
if let Some(f) = self.0.select_range {
let arg_range = range;
let arg_self_ = self.into_raw();
let arg_range = arg_range.cloned().map(|arg| arg.into());
let arg_range = arg_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_range);
}
}
}
fn cursor_position(&self) -> usize {
unsafe {
self.0
.get_cursor_position
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_text_color(&self, color: u32) {
unsafe {
if let Some(f) = self.0.set_text_color {
let arg_color = color;
let arg_self_ = self.into_raw();
f(arg_self_, arg_color);
}
}
}
fn text_color(&self) -> cef_color_t {
unsafe {
self.0
.get_text_color
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_selection_text_color(&self, color: u32) {
unsafe {
if let Some(f) = self.0.set_selection_text_color {
let arg_color = color;
let arg_self_ = self.into_raw();
f(arg_self_, arg_color);
}
}
}
fn selection_text_color(&self) -> cef_color_t {
unsafe {
self.0
.get_selection_text_color
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_selection_background_color(&self, color: u32) {
unsafe {
if let Some(f) = self.0.set_selection_background_color {
let arg_color = color;
let arg_self_ = self.into_raw();
f(arg_self_, arg_color);
}
}
}
fn selection_background_color(&self) -> cef_color_t {
unsafe {
self.0
.get_selection_background_color
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_font_list(&self, font_list: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_font_list {
let arg_font_list = font_list;
let arg_self_ = self.into_raw();
let arg_font_list = arg_font_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_font_list);
}
}
}
fn apply_text_color(&self, color: u32, range: Option<&Range>) {
unsafe {
if let Some(f) = self.0.apply_text_color {
let (arg_color, arg_range) = (color, range);
let arg_self_ = self.into_raw();
let arg_range = arg_range.cloned().map(|arg| arg.into());
let arg_range = arg_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_color, arg_range);
}
}
}
fn apply_text_style(
&self,
style: TextStyle,
add: ::std::os::raw::c_int,
range: Option<&Range>,
) {
unsafe {
if let Some(f) = self.0.apply_text_style {
let (arg_style, arg_add, arg_range) = (style, add, range);
let arg_self_ = self.into_raw();
let arg_style = arg_style.into_raw();
let arg_range = arg_range.cloned().map(|arg| arg.into());
let arg_range = arg_range
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_style, arg_add, arg_range);
}
}
}
fn is_command_enabled(&self, command_id: TextFieldCommands) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_command_enabled
.map(|f| {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let arg_command_id = arg_command_id.into_raw();
let result = f(arg_self_, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn execute_command(&self, command_id: TextFieldCommands) {
unsafe {
if let Some(f) = self.0.execute_command {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
let arg_command_id = arg_command_id.into_raw();
f(arg_self_, arg_command_id);
}
}
}
fn clear_edit_history(&self) {
unsafe {
if let Some(f) = self.0.clear_edit_history {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_placeholder_text(&self, text: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_placeholder_text {
let arg_text = text;
let arg_self_ = self.into_raw();
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_text);
}
}
}
fn placeholder_text(&self) -> CefStringUserfree {
unsafe {
self.0
.get_placeholder_text
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_placeholder_text_color(&self, color: u32) {
unsafe {
if let Some(f) = self.0.set_placeholder_text_color {
let arg_color = color;
let arg_self_ = self.into_raw();
f(arg_self_, arg_color);
}
}
}
fn set_accessible_name(&self, name: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_accessible_name {
let arg_name = name;
let arg_self_ = self.into_raw();
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_name);
}
}
}
fn get_raw(&self) -> *mut _cef_textfield_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_textfield_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Textfield {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_textfield_t> for &Textfield {
fn into_raw(self) -> *mut _cef_textfield_t {
ImplTextfield::get_raw(self)
}
}
impl ConvertParam<*mut _cef_textfield_t> for &mut Textfield {
fn into_raw(self) -> *mut _cef_textfield_t {
ImplTextfield::get_raw(self)
}
}
impl ConvertReturnValue<Textfield> for *mut _cef_textfield_t {
fn wrap_result(self) -> Textfield {
Textfield(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Textfield> for *mut _cef_textfield_t {
fn from(value: Textfield) -> Self {
let object = ImplTextfield::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_window_delegate_t`] for more documentation.
#[derive(Clone)]
pub struct WindowDelegate(RefGuard<_cef_window_delegate_t>);
impl WindowDelegate {
pub fn new<T>(interface: T) -> Self
where
T: WrapWindowDelegate,
{
unsafe {
let mut cef_object = std::mem::zeroed();
<T as ImplWindowDelegate>::init_methods(&mut cef_object);
let object = RcImpl::new(cef_object, interface);
<T as WrapWindowDelegate>::wrap_rc(&mut (*object).interface, object);
let object: *mut _cef_window_delegate_t = object.cast();
object.wrap_result()
}
}
}
pub trait WrapWindowDelegate: ImplWindowDelegate {
fn wrap_rc(&mut self, object: *mut RcImpl<_cef_window_delegate_t, Self>);
}
pub trait ImplWindowDelegate: ImplPanelDelegate {
#[doc = "See [`_cef_window_delegate_t::on_window_created`] for more documentation."]
fn on_window_created(&self, window: Option<&mut Window>) {}
#[doc = "See [`_cef_window_delegate_t::on_window_closing`] for more documentation."]
fn on_window_closing(&self, window: Option<&mut Window>) {}
#[doc = "See [`_cef_window_delegate_t::on_window_destroyed`] for more documentation."]
fn on_window_destroyed(&self, window: Option<&mut Window>) {}
#[doc = "See [`_cef_window_delegate_t::on_window_activation_changed`] for more documentation."]
fn on_window_activation_changed(
&self,
window: Option<&mut Window>,
active: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_window_delegate_t::on_window_bounds_changed`] for more documentation."]
fn on_window_bounds_changed(&self, window: Option<&mut Window>, new_bounds: Option<&Rect>) {}
#[doc = "See [`_cef_window_delegate_t::on_window_fullscreen_transition`] for more documentation."]
fn on_window_fullscreen_transition(
&self,
window: Option<&mut Window>,
is_completed: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_window_delegate_t::get_parent_window`] for more documentation."]
fn parent_window(
&self,
window: Option<&mut Window>,
is_menu: Option<&mut ::std::os::raw::c_int>,
can_activate_menu: Option<&mut ::std::os::raw::c_int>,
) -> Option<Window> {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::is_window_modal_dialog`] for more documentation."]
fn is_window_modal_dialog(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::get_initial_bounds`] for more documentation."]
fn initial_bounds(&self, window: Option<&mut Window>) -> Rect {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::get_initial_show_state`] for more documentation."]
fn initial_show_state(&self, window: Option<&mut Window>) -> ShowState {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::is_frameless`] for more documentation."]
fn is_frameless(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::with_standard_window_buttons`] for more documentation."]
fn with_standard_window_buttons(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::get_titlebar_height`] for more documentation."]
fn titlebar_height(
&self,
window: Option<&mut Window>,
titlebar_height: Option<&mut f32>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::accepts_first_mouse`] for more documentation."]
fn accepts_first_mouse(&self, window: Option<&mut Window>) -> State {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::can_resize`] for more documentation."]
fn can_resize(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::can_maximize`] for more documentation."]
fn can_maximize(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::can_minimize`] for more documentation."]
fn can_minimize(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::can_close`] for more documentation."]
fn can_close(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::on_accelerator`] for more documentation."]
fn on_accelerator(
&self,
window: Option<&mut Window>,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::on_key_event`] for more documentation."]
fn on_key_event(
&self,
window: Option<&mut Window>,
event: Option<&KeyEvent>,
) -> ::std::os::raw::c_int {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::on_theme_colors_changed`] for more documentation."]
fn on_theme_colors_changed(
&self,
window: Option<&mut Window>,
chrome_theme: ::std::os::raw::c_int,
) {
}
#[doc = "See [`_cef_window_delegate_t::get_window_runtime_style`] for more documentation."]
fn window_runtime_style(&self) -> RuntimeStyle {
Default::default()
}
#[doc = "See [`_cef_window_delegate_t::get_linux_window_properties`] for more documentation."]
fn linux_window_properties(
&self,
window: Option<&mut Window>,
properties: Option<&mut LinuxWindowProperties>,
) -> ::std::os::raw::c_int {
Default::default()
}
fn init_methods(object: &mut _cef_window_delegate_t) {
impl_cef_view_delegate_t::init_methods::<Self, _cef_window_delegate_t>(
&mut object.base.base,
);
impl_cef_panel_delegate_t::init_methods::<Self, _cef_window_delegate_t>(&mut object.base);
impl_cef_window_delegate_t::init_methods::<Self, _cef_window_delegate_t>(object);
}
fn get_raw(&self) -> *mut _cef_window_delegate_t {
<Self as ImplPanelDelegate>::get_raw(self).cast()
}
}
#[doc = "Implement the [`WrapWindowDelegate`] trait for the specified struct. You can declare more\nmembers for your struct, and in the `impl WindowDelegate` block you can override default\nmethods implemented by the [`ImplWindowDelegate`] trait.\n\n# Example\n```rust\n# use cef::{*, rc::*};\n\nwrap_window_delegate! {\n struct MyWindowDelegate {\n payload: String,\n }\n\n impl ViewDelegate {\n // ...\n }\n\n impl PanelDelegate {\n // ...\n }\n\n impl WindowDelegate {\n // ...\n }\n}\n\nfn make_my_struct() -> WindowDelegate {\n MyWindowDelegate::new(\"payload\".to_string())\n}\n```"]
#[macro_export]
macro_rules ! wrap_window_delegate { ($ vis : vis struct $ name : ident ; impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl PanelDelegate { $ ($ (# [$ wrap_panel_delegate_attrs_name : meta]) * fn $ wrap_panel_delegate_method_name : ident (& $ wrap_panel_delegate_self : ident $ (, $ wrap_panel_delegate_arg_name : ident : $ wrap_panel_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_panel_delegate_return_type : ty) ? { $ ($ wrap_panel_delegate_body : tt) * }) * } impl WindowDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { wrap_window_delegate ! { $ vis struct $ name { } impl WindowDelegate { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * } } } ; ($ vis : vis struct $ name : ident $ (< $ ($ generic_type : ident : $ first_generic_type_bound : tt $ (+ $ generic_type_bound : tt) *) , + $ (,) ? >) ? { $ ($ field_vis : vis $ field_name : ident : $ field_type : ty) , * $ (,) ? } impl ViewDelegate { $ ($ (# [$ wrap_view_delegate_attrs_name : meta]) * fn $ wrap_view_delegate_method_name : ident (& $ wrap_view_delegate_self : ident $ (, $ wrap_view_delegate_arg_name : ident : $ wrap_view_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_view_delegate_return_type : ty) ? { $ ($ wrap_view_delegate_body : tt) * }) * } impl PanelDelegate { $ ($ (# [$ wrap_panel_delegate_attrs_name : meta]) * fn $ wrap_panel_delegate_method_name : ident (& $ wrap_panel_delegate_self : ident $ (, $ wrap_panel_delegate_arg_name : ident : $ wrap_panel_delegate_arg_type : ty) * $ (,) ?) $ (-> $ wrap_panel_delegate_return_type : ty) ? { $ ($ wrap_panel_delegate_body : tt) * }) * } impl WindowDelegate { $ ($ (# [$ attrs_name : meta]) * fn $ method_name : ident (& $ self : ident $ (, $ arg_name : ident : $ arg_type : ty) * $ (,) ?) $ (-> $ return_type : ty) ? { $ ($ body : tt) * }) * }) => { $ vis struct $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ field_vis $ field_name : $ field_type ,) * cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_window_delegate_t , Self > } impl $ (< $ ($ generic_type ,) + >) ? $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { # [allow (clippy :: new_ret_no_self)] pub fn new ($ ($ field_name : $ field_type) , *) -> WindowDelegate { WindowDelegate :: new (Self { $ ($ field_name ,) * cef_object : std :: ptr :: null_mut () , }) } } impl $ (< $ ($ generic_type ,) + >) ? WrapWindowDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn wrap_rc (& mut self , cef_object : * mut $ crate :: rc :: RcImpl < $ crate :: sys :: _cef_window_delegate_t , Self >) { self . cef_object = cef_object ; } } impl $ (< $ ($ generic_type ,) + >) ? Clone for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn clone (& self) -> Self { unsafe { let rc_impl = & mut * self . cef_object ; rc_impl . interface . add_ref () ; } Self { $ ($ field_name : self . $ field_name . clone () ,) * cef_object : self . cef_object , } } } impl $ (< $ ($ generic_type ,) + >) ? $ crate :: rc :: Rc for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { fn as_base (& self) -> & $ crate :: sys :: cef_base_ref_counted_t { unsafe { let base = & * self . cef_object ; std :: mem :: transmute (& base . cef_object) } } } impl $ (< $ ($ generic_type ,) + >) ? ImplViewDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_view_delegate_attrs_name]) * fn $ wrap_view_delegate_method_name (& $ wrap_view_delegate_self $ (, $ wrap_view_delegate_arg_name : $ wrap_view_delegate_arg_type) *) $ (-> $ wrap_view_delegate_return_type) ? { $ ($ wrap_view_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_view_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplPanelDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ wrap_panel_delegate_attrs_name]) * fn $ wrap_panel_delegate_method_name (& $ wrap_panel_delegate_self $ (, $ wrap_panel_delegate_arg_name : $ wrap_panel_delegate_arg_type) *) $ (-> $ wrap_panel_delegate_return_type) ? { $ ($ wrap_panel_delegate_body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_panel_delegate_t { self . cef_object . cast () } } impl $ (< $ ($ generic_type ,) + >) ? ImplWindowDelegate for $ name $ (< $ ($ generic_type ,) + >) ? $ (where $ ($ generic_type : $ first_generic_type_bound $ (+ $ generic_type_bound) * ,) +) ? { $ ($ (# [$ attrs_name]) * fn $ method_name (& $ self $ (, $ arg_name : $ arg_type) *) $ (-> $ return_type) ? { $ ($ body) * }) * fn get_raw (& self) -> * mut $ crate :: sys :: _cef_window_delegate_t { self . cef_object . cast () } } } ; }
mod impl_cef_window_delegate_t {
use super::*;
pub fn init_methods<I: ImplWindowDelegate, R: Rc>(object: &mut _cef_window_delegate_t) {
object.on_window_created = Some(on_window_created::<I, R>);
object.on_window_closing = Some(on_window_closing::<I, R>);
object.on_window_destroyed = Some(on_window_destroyed::<I, R>);
object.on_window_activation_changed = Some(on_window_activation_changed::<I, R>);
object.on_window_bounds_changed = Some(on_window_bounds_changed::<I, R>);
object.on_window_fullscreen_transition = Some(on_window_fullscreen_transition::<I, R>);
object.get_parent_window = Some(get_parent_window::<I, R>);
object.is_window_modal_dialog = Some(is_window_modal_dialog::<I, R>);
object.get_initial_bounds = Some(get_initial_bounds::<I, R>);
object.get_initial_show_state = Some(get_initial_show_state::<I, R>);
object.is_frameless = Some(is_frameless::<I, R>);
object.with_standard_window_buttons = Some(with_standard_window_buttons::<I, R>);
object.get_titlebar_height = Some(get_titlebar_height::<I, R>);
object.accepts_first_mouse = Some(accepts_first_mouse::<I, R>);
object.can_resize = Some(can_resize::<I, R>);
object.can_maximize = Some(can_maximize::<I, R>);
object.can_minimize = Some(can_minimize::<I, R>);
object.can_close = Some(can_close::<I, R>);
object.on_accelerator = Some(on_accelerator::<I, R>);
object.on_key_event = Some(on_key_event::<I, R>);
object.on_theme_colors_changed = Some(on_theme_colors_changed::<I, R>);
object.get_window_runtime_style = Some(get_window_runtime_style::<I, R>);
object.get_linux_window_properties = Some(get_linux_window_properties::<I, R>);
}
extern "C" fn on_window_created<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::on_window_created(&arg_self_.interface, arg_window)
}
extern "C" fn on_window_closing<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::on_window_closing(&arg_self_.interface, arg_window)
}
extern "C" fn on_window_destroyed<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::on_window_destroyed(&arg_self_.interface, arg_window)
}
extern "C" fn on_window_activation_changed<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
active: ::std::os::raw::c_int,
) {
let (arg_self_, arg_window, arg_active) = (self_, window, active);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let arg_active = arg_active.into_raw();
ImplWindowDelegate::on_window_activation_changed(
&arg_self_.interface,
arg_window,
arg_active,
)
}
extern "C" fn on_window_bounds_changed<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
new_bounds: *const _cef_rect_t,
) {
let (arg_self_, arg_window, arg_new_bounds) = (self_, window, new_bounds);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let arg_new_bounds = if arg_new_bounds.is_null() {
None
} else {
Some(WrapParamRef::<Rect, _>::from(arg_new_bounds))
};
let arg_new_bounds = arg_new_bounds.as_ref().map(|arg| arg.as_ref());
ImplWindowDelegate::on_window_bounds_changed(
&arg_self_.interface,
arg_window,
arg_new_bounds,
)
}
extern "C" fn on_window_fullscreen_transition<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
is_completed: ::std::os::raw::c_int,
) {
let (arg_self_, arg_window, arg_is_completed) = (self_, window, is_completed);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let arg_is_completed = arg_is_completed.into_raw();
ImplWindowDelegate::on_window_fullscreen_transition(
&arg_self_.interface,
arg_window,
arg_is_completed,
)
}
extern "C" fn get_parent_window<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
is_menu: *mut ::std::os::raw::c_int,
can_activate_menu: *mut ::std::os::raw::c_int,
) -> *mut _cef_window_t {
let (arg_self_, arg_window, arg_is_menu, arg_can_activate_menu) =
(self_, window, is_menu, can_activate_menu);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let mut arg_is_menu = if arg_is_menu.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(arg_is_menu))
};
let arg_is_menu = arg_is_menu.as_mut().map(|arg| arg.as_mut());
let mut arg_can_activate_menu = if arg_can_activate_menu.is_null() {
None
} else {
Some(WrapParamRef::<::std::os::raw::c_int, _>::from(
arg_can_activate_menu,
))
};
let arg_can_activate_menu = arg_can_activate_menu.as_mut().map(|arg| arg.as_mut());
let result = ImplWindowDelegate::parent_window(
&arg_self_.interface,
arg_window,
arg_is_menu,
arg_can_activate_menu,
);
result
.map(|result| result.into())
.unwrap_or(std::ptr::null_mut())
}
extern "C" fn is_window_modal_dialog<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::is_window_modal_dialog(&arg_self_.interface, arg_window)
}
extern "C" fn get_initial_bounds<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> _cef_rect_t {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let result = ImplWindowDelegate::initial_bounds(&arg_self_.interface, arg_window);
result.into()
}
extern "C" fn get_initial_show_state<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> cef_show_state_t {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let result = ImplWindowDelegate::initial_show_state(&arg_self_.interface, arg_window);
result.into()
}
extern "C" fn is_frameless<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::is_frameless(&arg_self_.interface, arg_window)
}
extern "C" fn with_standard_window_buttons<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::with_standard_window_buttons(&arg_self_.interface, arg_window)
}
extern "C" fn get_titlebar_height<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
titlebar_height: *mut f32,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window, arg_titlebar_height) = (self_, window, titlebar_height);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let mut arg_titlebar_height = if arg_titlebar_height.is_null() {
None
} else {
Some(WrapParamRef::<f32, _>::from(arg_titlebar_height))
};
let arg_titlebar_height = arg_titlebar_height.as_mut().map(|arg| arg.as_mut());
ImplWindowDelegate::titlebar_height(&arg_self_.interface, arg_window, arg_titlebar_height)
}
extern "C" fn accepts_first_mouse<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> cef_state_t {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let result = ImplWindowDelegate::accepts_first_mouse(&arg_self_.interface, arg_window);
result.into()
}
extern "C" fn can_resize<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::can_resize(&arg_self_.interface, arg_window)
}
extern "C" fn can_maximize<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::can_maximize(&arg_self_.interface, arg_window)
}
extern "C" fn can_minimize<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::can_minimize(&arg_self_.interface, arg_window)
}
extern "C" fn can_close<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window) = (self_, window);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
ImplWindowDelegate::can_close(&arg_self_.interface, arg_window)
}
extern "C" fn on_accelerator<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window, arg_command_id) = (self_, window, command_id);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let arg_command_id = arg_command_id.into_raw();
ImplWindowDelegate::on_accelerator(&arg_self_.interface, arg_window, arg_command_id)
}
extern "C" fn on_key_event<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
event: *const _cef_key_event_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window, arg_event) = (self_, window, event);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let arg_event = if arg_event.is_null() {
None
} else {
Some(WrapParamRef::<KeyEvent, _>::from(arg_event))
};
let arg_event = arg_event.as_ref().map(|arg| arg.as_ref());
ImplWindowDelegate::on_key_event(&arg_self_.interface, arg_window, arg_event)
}
extern "C" fn on_theme_colors_changed<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
chrome_theme: ::std::os::raw::c_int,
) {
let (arg_self_, arg_window, arg_chrome_theme) = (self_, window, chrome_theme);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let arg_chrome_theme = arg_chrome_theme.into_raw();
ImplWindowDelegate::on_theme_colors_changed(
&arg_self_.interface,
arg_window,
arg_chrome_theme,
)
}
extern "C" fn get_window_runtime_style<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
) -> cef_runtime_style_t {
let arg_self_ = self_;
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let result = ImplWindowDelegate::window_runtime_style(&arg_self_.interface);
result.into()
}
extern "C" fn get_linux_window_properties<I: ImplWindowDelegate, R: Rc>(
self_: *mut _cef_window_delegate_t,
window: *mut _cef_window_t,
properties: *mut _cef_linux_window_properties_t,
) -> ::std::os::raw::c_int {
let (arg_self_, arg_window, arg_properties) = (self_, window, properties);
let arg_self_: &RcImpl<R, I> = RcImpl::get(arg_self_.cast());
let mut arg_window =
unsafe { arg_window.as_mut() }.map(|arg| Window(unsafe { RefGuard::from_raw(arg) }));
let arg_window = arg_window.as_mut();
let mut arg_properties = if arg_properties.is_null() {
None
} else {
Some(WrapParamRef::<LinuxWindowProperties, _>::from(
arg_properties,
))
};
let arg_properties = arg_properties.as_mut().map(|arg| arg.as_mut());
ImplWindowDelegate::linux_window_properties(
&arg_self_.interface,
arg_window,
arg_properties,
)
}
}
impl ImplViewDelegate for WindowDelegate {
fn preferred_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.preferred_size(view)
}
fn minimum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.minimum_size(view)
}
fn maximum_size(&self, view: Option<&mut View>) -> Size {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.maximum_size(view)
}
fn height_for_width(
&self,
view: Option<&mut View>,
width: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.height_for_width(view, width)
}
fn on_parent_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
parent: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_parent_view_changed(view, added, parent)
}
fn on_child_view_changed(
&self,
view: Option<&mut View>,
added: ::std::os::raw::c_int,
child: Option<&mut View>,
) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_child_view_changed(view, added, child)
}
fn on_window_changed(&self, view: Option<&mut View>, added: ::std::os::raw::c_int) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_window_changed(view, added)
}
fn on_layout_changed(&self, view: Option<&mut View>, new_bounds: Option<&Rect>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_layout_changed(view, new_bounds)
}
fn on_focus(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_focus(view)
}
fn on_blur(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_blur(view)
}
fn on_theme_changed(&self, view: Option<&mut View>) {
ViewDelegate(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&self.0).cast()) })
.on_theme_changed(view)
}
fn get_raw(&self) -> *mut _cef_view_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplPanelDelegate for WindowDelegate {
fn get_raw(&self) -> *mut _cef_panel_delegate_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl ImplWindowDelegate for WindowDelegate {
fn on_window_created(&self, window: Option<&mut Window>) {
unsafe {
if let Some(f) = self.0.on_window_created {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_window);
}
}
}
fn on_window_closing(&self, window: Option<&mut Window>) {
unsafe {
if let Some(f) = self.0.on_window_closing {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_window);
}
}
}
fn on_window_destroyed(&self, window: Option<&mut Window>) {
unsafe {
if let Some(f) = self.0.on_window_destroyed {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_window);
}
}
}
fn on_window_activation_changed(
&self,
window: Option<&mut Window>,
active: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_window_activation_changed {
let (arg_window, arg_active) = (window, active);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_window, arg_active);
}
}
}
fn on_window_bounds_changed(&self, window: Option<&mut Window>, new_bounds: Option<&Rect>) {
unsafe {
if let Some(f) = self.0.on_window_bounds_changed {
let (arg_window, arg_new_bounds) = (window, new_bounds);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_new_bounds = arg_new_bounds.cloned().map(|arg| arg.into());
let arg_new_bounds = arg_new_bounds
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_window, arg_new_bounds);
}
}
}
fn on_window_fullscreen_transition(
&self,
window: Option<&mut Window>,
is_completed: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_window_fullscreen_transition {
let (arg_window, arg_is_completed) = (window, is_completed);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_window, arg_is_completed);
}
}
}
fn parent_window(
&self,
window: Option<&mut Window>,
is_menu: Option<&mut ::std::os::raw::c_int>,
can_activate_menu: Option<&mut ::std::os::raw::c_int>,
) -> Option<Window> {
unsafe {
self.0
.get_parent_window
.map(|f| {
let (arg_window, arg_is_menu, arg_can_activate_menu) =
(window, is_menu, can_activate_menu);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_is_menu = arg_is_menu
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let arg_can_activate_menu = arg_can_activate_menu
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window, arg_is_menu, arg_can_activate_menu);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn is_window_modal_dialog(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_window_modal_dialog
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn initial_bounds(&self, window: Option<&mut Window>) -> Rect {
unsafe {
self.0
.get_initial_bounds
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn initial_show_state(&self, window: Option<&mut Window>) -> ShowState {
unsafe {
self.0
.get_initial_show_state
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_frameless(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_frameless
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn with_standard_window_buttons(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
unsafe {
self.0
.with_standard_window_buttons
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn titlebar_height(
&self,
window: Option<&mut Window>,
titlebar_height: Option<&mut f32>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_titlebar_height
.map(|f| {
let (arg_window, arg_titlebar_height) = (window, titlebar_height);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_titlebar_height = arg_titlebar_height
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window, arg_titlebar_height);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn accepts_first_mouse(&self, window: Option<&mut Window>) -> State {
unsafe {
self.0
.accepts_first_mouse
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn can_resize(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_resize
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn can_maximize(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_maximize
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn can_minimize(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_minimize
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn can_close(&self, window: Option<&mut Window>) -> ::std::os::raw::c_int {
unsafe {
self.0
.can_close
.map(|f| {
let arg_window = window;
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_accelerator(
&self,
window: Option<&mut Window>,
command_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_accelerator
.map(|f| {
let (arg_window, arg_command_id) = (window, command_id);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window, arg_command_id);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_key_event(
&self,
window: Option<&mut Window>,
event: Option<&KeyEvent>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.on_key_event
.map(|f| {
let (arg_window, arg_event) = (window, event);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_event = arg_event.cloned().map(|arg| arg.into());
let arg_event = arg_event
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = f(arg_self_, arg_window, arg_event);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn on_theme_colors_changed(
&self,
window: Option<&mut Window>,
chrome_theme: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.on_theme_colors_changed {
let (arg_window, arg_chrome_theme) = (window, chrome_theme);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_window, arg_chrome_theme);
}
}
}
fn window_runtime_style(&self) -> RuntimeStyle {
unsafe {
self.0
.get_window_runtime_style
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn linux_window_properties(
&self,
window: Option<&mut Window>,
properties: Option<&mut LinuxWindowProperties>,
) -> ::std::os::raw::c_int {
unsafe {
self.0
.get_linux_window_properties
.map(|f| {
let (arg_window, arg_properties) = (window, properties);
let arg_self_ = self.into_raw();
let arg_window = arg_window
.map(|arg| {
arg.add_ref();
ImplWindow::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let mut arg_properties = arg_properties.cloned().map(|arg| arg.into());
let arg_properties = arg_properties
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = f(arg_self_, arg_window, arg_properties);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_window_delegate_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_window_delegate_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for WindowDelegate {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_window_delegate_t> for &WindowDelegate {
fn into_raw(self) -> *mut _cef_window_delegate_t {
ImplWindowDelegate::get_raw(self)
}
}
impl ConvertParam<*mut _cef_window_delegate_t> for &mut WindowDelegate {
fn into_raw(self) -> *mut _cef_window_delegate_t {
ImplWindowDelegate::get_raw(self)
}
}
impl ConvertReturnValue<WindowDelegate> for *mut _cef_window_delegate_t {
fn wrap_result(self) -> WindowDelegate {
WindowDelegate(unsafe { RefGuard::from_raw(self) })
}
}
impl From<WindowDelegate> for *mut _cef_window_delegate_t {
fn from(value: WindowDelegate) -> Self {
let object = ImplWindowDelegate::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`_cef_window_t`] for more documentation.
#[derive(Clone)]
pub struct Window(RefGuard<_cef_window_t>);
pub trait ImplWindow: ImplPanel {
#[doc = "See [`_cef_window_t::show`] for more documentation."]
fn show(&self);
#[doc = "See [`_cef_window_t::show_as_browser_modal_dialog`] for more documentation."]
fn show_as_browser_modal_dialog(&self, browser_view: Option<&mut BrowserView>);
#[doc = "See [`_cef_window_t::hide`] for more documentation."]
fn hide(&self);
#[doc = "See [`_cef_window_t::center_window`] for more documentation."]
fn center_window(&self, size: Option<&Size>);
#[doc = "See [`_cef_window_t::close`] for more documentation."]
fn close(&self);
#[doc = "See [`_cef_window_t::is_closed`] for more documentation."]
fn is_closed(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_window_t::activate`] for more documentation."]
fn activate(&self);
#[doc = "See [`_cef_window_t::deactivate`] for more documentation."]
fn deactivate(&self);
#[doc = "See [`_cef_window_t::is_active`] for more documentation."]
fn is_active(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_window_t::bring_to_top`] for more documentation."]
fn bring_to_top(&self);
#[doc = "See [`_cef_window_t::set_always_on_top`] for more documentation."]
fn set_always_on_top(&self, on_top: ::std::os::raw::c_int);
#[doc = "See [`_cef_window_t::is_always_on_top`] for more documentation."]
fn is_always_on_top(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_window_t::maximize`] for more documentation."]
fn maximize(&self);
#[doc = "See [`_cef_window_t::minimize`] for more documentation."]
fn minimize(&self);
#[doc = "See [`_cef_window_t::restore`] for more documentation."]
fn restore(&self);
#[doc = "See [`_cef_window_t::set_fullscreen`] for more documentation."]
fn set_fullscreen(&self, fullscreen: ::std::os::raw::c_int);
#[doc = "See [`_cef_window_t::is_maximized`] for more documentation."]
fn is_maximized(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_window_t::is_minimized`] for more documentation."]
fn is_minimized(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_window_t::is_fullscreen`] for more documentation."]
fn is_fullscreen(&self) -> ::std::os::raw::c_int;
#[doc = "See [`_cef_window_t::get_focused_view`] for more documentation."]
fn focused_view(&self) -> Option<View>;
#[doc = "See [`_cef_window_t::set_title`] for more documentation."]
fn set_title(&self, title: Option<&CefString>);
#[doc = "See [`_cef_window_t::get_title`] for more documentation."]
fn title(&self) -> CefStringUserfree;
#[doc = "See [`_cef_window_t::set_window_icon`] for more documentation."]
fn set_window_icon(&self, image: Option<&mut Image>);
#[doc = "See [`_cef_window_t::get_window_icon`] for more documentation."]
fn window_icon(&self) -> Option<Image>;
#[doc = "See [`_cef_window_t::set_window_app_icon`] for more documentation."]
fn set_window_app_icon(&self, image: Option<&mut Image>);
#[doc = "See [`_cef_window_t::get_window_app_icon`] for more documentation."]
fn window_app_icon(&self) -> Option<Image>;
#[doc = "See [`_cef_window_t::add_overlay_view`] for more documentation."]
fn add_overlay_view(
&self,
view: Option<&mut View>,
docking_mode: DockingMode,
can_activate: ::std::os::raw::c_int,
) -> Option<OverlayController>;
#[doc = "See [`_cef_window_t::show_menu`] for more documentation."]
fn show_menu(
&self,
menu_model: Option<&mut MenuModel>,
screen_point: Option<&Point>,
anchor_position: MenuAnchorPosition,
);
#[doc = "See [`_cef_window_t::cancel_menu`] for more documentation."]
fn cancel_menu(&self);
#[doc = "See [`_cef_window_t::get_display`] for more documentation."]
fn display(&self) -> Option<Display>;
#[doc = "See [`_cef_window_t::get_client_area_bounds_in_screen`] for more documentation."]
fn client_area_bounds_in_screen(&self) -> Rect;
#[doc = "See [`_cef_window_t::set_draggable_regions`] for more documentation."]
fn set_draggable_regions(&self, regions: Option<&[DraggableRegion]>);
#[doc = "See [`_cef_window_t::get_window_handle`] for more documentation."]
fn window_handle(&self) -> cef_window_handle_t;
#[doc = "See [`_cef_window_t::send_key_press`] for more documentation."]
fn send_key_press(&self, key_code: ::std::os::raw::c_int, event_flags: u32);
#[doc = "See [`_cef_window_t::send_mouse_move`] for more documentation."]
fn send_mouse_move(&self, screen_x: ::std::os::raw::c_int, screen_y: ::std::os::raw::c_int);
#[doc = "See [`_cef_window_t::send_mouse_events`] for more documentation."]
fn send_mouse_events(
&self,
button: MouseButtonType,
mouse_down: ::std::os::raw::c_int,
mouse_up: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_window_t::set_accelerator`] for more documentation."]
fn set_accelerator(
&self,
command_id: ::std::os::raw::c_int,
key_code: ::std::os::raw::c_int,
shift_pressed: ::std::os::raw::c_int,
ctrl_pressed: ::std::os::raw::c_int,
alt_pressed: ::std::os::raw::c_int,
high_priority: ::std::os::raw::c_int,
);
#[doc = "See [`_cef_window_t::remove_accelerator`] for more documentation."]
fn remove_accelerator(&self, command_id: ::std::os::raw::c_int);
#[doc = "See [`_cef_window_t::remove_all_accelerators`] for more documentation."]
fn remove_all_accelerators(&self);
#[doc = "See [`_cef_window_t::set_theme_color`] for more documentation."]
fn set_theme_color(&self, color_id: ::std::os::raw::c_int, color: u32);
#[doc = "See [`_cef_window_t::theme_changed`] for more documentation."]
fn theme_changed(&self);
#[doc = "See [`_cef_window_t::get_runtime_style`] for more documentation."]
fn runtime_style(&self) -> RuntimeStyle;
fn get_raw(&self) -> *mut _cef_window_t {
<Self as ImplPanel>::get_raw(self).cast()
}
}
impl ImplView for Window {
fn as_browser_view(&self) -> Option<BrowserView> {
View::from(self).as_browser_view()
}
fn as_button(&self) -> Option<Button> {
View::from(self).as_button()
}
fn as_panel(&self) -> Option<Panel> {
View::from(self).as_panel()
}
fn as_scroll_view(&self) -> Option<ScrollView> {
View::from(self).as_scroll_view()
}
fn as_textfield(&self) -> Option<Textfield> {
View::from(self).as_textfield()
}
fn type_string(&self) -> CefStringUserfree {
View::from(self).type_string()
}
fn to_string(&self, include_children: ::std::os::raw::c_int) -> CefStringUserfree {
View::from(self).to_string(include_children)
}
fn is_valid(&self) -> ::std::os::raw::c_int {
View::from(self).is_valid()
}
fn is_attached(&self) -> ::std::os::raw::c_int {
View::from(self).is_attached()
}
fn is_same(&self, that: Option<&mut View>) -> ::std::os::raw::c_int {
View::from(self).is_same(that)
}
fn delegate(&self) -> Option<ViewDelegate> {
View::from(self).delegate()
}
fn window(&self) -> Option<Window> {
View::from(self).window()
}
fn id(&self) -> ::std::os::raw::c_int {
View::from(self).id()
}
fn set_id(&self, id: ::std::os::raw::c_int) {
View::from(self).set_id(id)
}
fn group_id(&self) -> ::std::os::raw::c_int {
View::from(self).group_id()
}
fn set_group_id(&self, group_id: ::std::os::raw::c_int) {
View::from(self).set_group_id(group_id)
}
fn parent_view(&self) -> Option<View> {
View::from(self).parent_view()
}
fn view_for_id(&self, id: ::std::os::raw::c_int) -> Option<View> {
View::from(self).view_for_id(id)
}
fn set_bounds(&self, bounds: Option<&Rect>) {
View::from(self).set_bounds(bounds)
}
fn bounds(&self) -> Rect {
View::from(self).bounds()
}
fn bounds_in_screen(&self) -> Rect {
View::from(self).bounds_in_screen()
}
fn set_size(&self, size: Option<&Size>) {
View::from(self).set_size(size)
}
fn size(&self) -> Size {
View::from(self).size()
}
fn set_position(&self, position: Option<&Point>) {
View::from(self).set_position(position)
}
fn position(&self) -> Point {
View::from(self).position()
}
fn set_insets(&self, insets: Option<&Insets>) {
View::from(self).set_insets(insets)
}
fn insets(&self) -> Insets {
View::from(self).insets()
}
fn preferred_size(&self) -> Size {
View::from(self).preferred_size()
}
fn size_to_preferred_size(&self) {
View::from(self).size_to_preferred_size()
}
fn minimum_size(&self) -> Size {
View::from(self).minimum_size()
}
fn maximum_size(&self) -> Size {
View::from(self).maximum_size()
}
fn height_for_width(&self, width: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
View::from(self).height_for_width(width)
}
fn invalidate_layout(&self) {
View::from(self).invalidate_layout()
}
fn set_visible(&self, visible: ::std::os::raw::c_int) {
View::from(self).set_visible(visible)
}
fn is_visible(&self) -> ::std::os::raw::c_int {
View::from(self).is_visible()
}
fn is_drawn(&self) -> ::std::os::raw::c_int {
View::from(self).is_drawn()
}
fn set_enabled(&self, enabled: ::std::os::raw::c_int) {
View::from(self).set_enabled(enabled)
}
fn is_enabled(&self) -> ::std::os::raw::c_int {
View::from(self).is_enabled()
}
fn set_focusable(&self, focusable: ::std::os::raw::c_int) {
View::from(self).set_focusable(focusable)
}
fn is_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_focusable()
}
fn is_accessibility_focusable(&self) -> ::std::os::raw::c_int {
View::from(self).is_accessibility_focusable()
}
fn has_focus(&self) -> ::std::os::raw::c_int {
View::from(self).has_focus()
}
fn request_focus(&self) {
View::from(self).request_focus()
}
fn set_background_color(&self, color: u32) {
View::from(self).set_background_color(color)
}
fn background_color(&self) -> cef_color_t {
View::from(self).background_color()
}
fn theme_color(&self, color_id: ::std::os::raw::c_int) -> cef_color_t {
View::from(self).theme_color(color_id)
}
fn convert_point_to_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_screen(point)
}
fn convert_point_from_screen(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_screen(point)
}
fn convert_point_to_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_window(point)
}
fn convert_point_from_window(&self, point: Option<&mut Point>) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_window(point)
}
fn convert_point_to_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_to_view(view, point)
}
fn convert_point_from_view(
&self,
view: Option<&mut View>,
point: Option<&mut Point>,
) -> ::std::os::raw::c_int {
View::from(self).convert_point_from_view(view, point)
}
fn get_raw(&self) -> *mut _cef_view_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&Window> for View {
fn from(from: &Window) -> Self {
View(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplPanel for Window {
fn as_window(&self) -> Option<Window> {
Panel::from(self).as_window()
}
fn set_to_fill_layout(&self) -> Option<FillLayout> {
Panel::from(self).set_to_fill_layout()
}
fn set_to_box_layout(&self, settings: Option<&BoxLayoutSettings>) -> Option<BoxLayout> {
Panel::from(self).set_to_box_layout(settings)
}
fn get_layout(&self) -> Option<Layout> {
Panel::from(self).get_layout()
}
fn layout(&self) {
Panel::from(self).layout()
}
fn add_child_view(&self, view: Option<&mut View>) {
Panel::from(self).add_child_view(view)
}
fn add_child_view_at(&self, view: Option<&mut View>, index: ::std::os::raw::c_int) {
Panel::from(self).add_child_view_at(view, index)
}
fn reorder_child_view(&self, view: Option<&mut View>, index: ::std::os::raw::c_int) {
Panel::from(self).reorder_child_view(view, index)
}
fn remove_child_view(&self, view: Option<&mut View>) {
Panel::from(self).remove_child_view(view)
}
fn remove_all_child_views(&self) {
Panel::from(self).remove_all_child_views()
}
fn child_view_count(&self) -> usize {
Panel::from(self).child_view_count()
}
fn child_view_at(&self, index: ::std::os::raw::c_int) -> Option<View> {
Panel::from(self).child_view_at(index)
}
fn get_raw(&self) -> *mut _cef_panel_t {
unsafe { RefGuard::into_raw(&self.0).cast() }
}
}
impl std::convert::From<&Window> for Panel {
fn from(from: &Window) -> Self {
Panel(unsafe { RefGuard::from_raw_add_ref(RefGuard::into_raw(&from.0).cast()) })
}
}
impl ImplWindow for Window {
fn show(&self) {
unsafe {
if let Some(f) = self.0.show {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn show_as_browser_modal_dialog(&self, browser_view: Option<&mut BrowserView>) {
unsafe {
if let Some(f) = self.0.show_as_browser_modal_dialog {
let arg_browser_view = browser_view;
let arg_self_ = self.into_raw();
let arg_browser_view = arg_browser_view
.map(|arg| {
arg.add_ref();
ImplBrowserView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_browser_view);
}
}
}
fn hide(&self) {
unsafe {
if let Some(f) = self.0.hide {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn center_window(&self, size: Option<&Size>) {
unsafe {
if let Some(f) = self.0.center_window {
let arg_size = size;
let arg_self_ = self.into_raw();
let arg_size = arg_size.cloned().map(|arg| arg.into());
let arg_size = arg_size
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
f(arg_self_, arg_size);
}
}
}
fn close(&self) {
unsafe {
if let Some(f) = self.0.close {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn is_closed(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_closed
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn activate(&self) {
unsafe {
if let Some(f) = self.0.activate {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn deactivate(&self) {
unsafe {
if let Some(f) = self.0.deactivate {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn is_active(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_active
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn bring_to_top(&self) {
unsafe {
if let Some(f) = self.0.bring_to_top {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_always_on_top(&self, on_top: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_always_on_top {
let arg_on_top = on_top;
let arg_self_ = self.into_raw();
f(arg_self_, arg_on_top);
}
}
}
fn is_always_on_top(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_always_on_top
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn maximize(&self) {
unsafe {
if let Some(f) = self.0.maximize {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn minimize(&self) {
unsafe {
if let Some(f) = self.0.minimize {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn restore(&self) {
unsafe {
if let Some(f) = self.0.restore {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_fullscreen(&self, fullscreen: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.set_fullscreen {
let arg_fullscreen = fullscreen;
let arg_self_ = self.into_raw();
f(arg_self_, arg_fullscreen);
}
}
}
fn is_maximized(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_maximized
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_minimized(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_minimized
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn is_fullscreen(&self) -> ::std::os::raw::c_int {
unsafe {
self.0
.is_fullscreen
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn focused_view(&self) -> Option<View> {
unsafe {
self.0
.get_focused_view
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_title(&self, title: Option<&CefString>) {
unsafe {
if let Some(f) = self.0.set_title {
let arg_title = title;
let arg_self_ = self.into_raw();
let arg_title = arg_title
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
f(arg_self_, arg_title);
}
}
}
fn title(&self) -> CefStringUserfree {
unsafe {
self.0
.get_title
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_window_icon(&self, image: Option<&mut Image>) {
unsafe {
if let Some(f) = self.0.set_window_icon {
let arg_image = image;
let arg_self_ = self.into_raw();
let arg_image = arg_image
.map(|arg| {
arg.add_ref();
ImplImage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_image);
}
}
}
fn window_icon(&self) -> Option<Image> {
unsafe {
self.0
.get_window_icon
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn set_window_app_icon(&self, image: Option<&mut Image>) {
unsafe {
if let Some(f) = self.0.set_window_app_icon {
let arg_image = image;
let arg_self_ = self.into_raw();
let arg_image = arg_image
.map(|arg| {
arg.add_ref();
ImplImage::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
f(arg_self_, arg_image);
}
}
}
fn window_app_icon(&self) -> Option<Image> {
unsafe {
self.0
.get_window_app_icon
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn add_overlay_view(
&self,
view: Option<&mut View>,
docking_mode: DockingMode,
can_activate: ::std::os::raw::c_int,
) -> Option<OverlayController> {
unsafe {
self.0
.add_overlay_view
.map(|f| {
let (arg_view, arg_docking_mode, arg_can_activate) =
(view, docking_mode, can_activate);
let arg_self_ = self.into_raw();
let arg_view = arg_view
.map(|arg| {
arg.add_ref();
ImplView::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_docking_mode = arg_docking_mode.into_raw();
let result = f(arg_self_, arg_view, arg_docking_mode, arg_can_activate);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn show_menu(
&self,
menu_model: Option<&mut MenuModel>,
screen_point: Option<&Point>,
anchor_position: MenuAnchorPosition,
) {
unsafe {
if let Some(f) = self.0.show_menu {
let (arg_menu_model, arg_screen_point, arg_anchor_position) =
(menu_model, screen_point, anchor_position);
let arg_self_ = self.into_raw();
let arg_menu_model = arg_menu_model
.map(|arg| {
arg.add_ref();
ImplMenuModel::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_screen_point = arg_screen_point.cloned().map(|arg| arg.into());
let arg_screen_point = arg_screen_point
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_anchor_position = arg_anchor_position.into_raw();
f(
arg_self_,
arg_menu_model,
arg_screen_point,
arg_anchor_position,
);
}
}
}
fn cancel_menu(&self) {
unsafe {
if let Some(f) = self.0.cancel_menu {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn display(&self) -> Option<Display> {
unsafe {
self.0
.get_display
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
})
.unwrap_or_default()
}
}
fn client_area_bounds_in_screen(&self) -> Rect {
unsafe {
self.0
.get_client_area_bounds_in_screen
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn set_draggable_regions(&self, regions: Option<&[DraggableRegion]>) {
unsafe {
if let Some(f) = self.0.set_draggable_regions {
let arg_regions = regions;
let arg_self_ = self.into_raw();
let arg_regions_count = arg_regions
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let vec_regions = arg_regions
.as_ref()
.map(|arg| arg.iter().map(|elem| elem.get_raw()).collect::<Vec<_>>())
.unwrap_or_default();
let arg_regions = if vec_regions.is_empty() {
std::ptr::null()
} else {
vec_regions.as_ptr()
};
f(arg_self_, arg_regions_count, arg_regions);
}
}
}
fn window_handle(&self) -> cef_window_handle_t {
unsafe {
self.0
.get_window_handle
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn send_key_press(&self, key_code: ::std::os::raw::c_int, event_flags: u32) {
unsafe {
if let Some(f) = self.0.send_key_press {
let (arg_key_code, arg_event_flags) = (key_code, event_flags);
let arg_self_ = self.into_raw();
f(arg_self_, arg_key_code, arg_event_flags);
}
}
}
fn send_mouse_move(&self, screen_x: ::std::os::raw::c_int, screen_y: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.send_mouse_move {
let (arg_screen_x, arg_screen_y) = (screen_x, screen_y);
let arg_self_ = self.into_raw();
f(arg_self_, arg_screen_x, arg_screen_y);
}
}
}
fn send_mouse_events(
&self,
button: MouseButtonType,
mouse_down: ::std::os::raw::c_int,
mouse_up: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.send_mouse_events {
let (arg_button, arg_mouse_down, arg_mouse_up) = (button, mouse_down, mouse_up);
let arg_self_ = self.into_raw();
let arg_button = arg_button.into_raw();
f(arg_self_, arg_button, arg_mouse_down, arg_mouse_up);
}
}
}
fn set_accelerator(
&self,
command_id: ::std::os::raw::c_int,
key_code: ::std::os::raw::c_int,
shift_pressed: ::std::os::raw::c_int,
ctrl_pressed: ::std::os::raw::c_int,
alt_pressed: ::std::os::raw::c_int,
high_priority: ::std::os::raw::c_int,
) {
unsafe {
if let Some(f) = self.0.set_accelerator {
let (
arg_command_id,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
arg_high_priority,
) = (
command_id,
key_code,
shift_pressed,
ctrl_pressed,
alt_pressed,
high_priority,
);
let arg_self_ = self.into_raw();
f(
arg_self_,
arg_command_id,
arg_key_code,
arg_shift_pressed,
arg_ctrl_pressed,
arg_alt_pressed,
arg_high_priority,
);
}
}
}
fn remove_accelerator(&self, command_id: ::std::os::raw::c_int) {
unsafe {
if let Some(f) = self.0.remove_accelerator {
let arg_command_id = command_id;
let arg_self_ = self.into_raw();
f(arg_self_, arg_command_id);
}
}
}
fn remove_all_accelerators(&self) {
unsafe {
if let Some(f) = self.0.remove_all_accelerators {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn set_theme_color(&self, color_id: ::std::os::raw::c_int, color: u32) {
unsafe {
if let Some(f) = self.0.set_theme_color {
let (arg_color_id, arg_color) = (color_id, color);
let arg_self_ = self.into_raw();
f(arg_self_, arg_color_id, arg_color);
}
}
}
fn theme_changed(&self) {
unsafe {
if let Some(f) = self.0.theme_changed {
let arg_self_ = self.into_raw();
f(arg_self_);
}
}
}
fn runtime_style(&self) -> RuntimeStyle {
unsafe {
self.0
.get_runtime_style
.map(|f| {
let arg_self_ = self.into_raw();
let result = f(arg_self_);
result.wrap_result()
})
.unwrap_or_default()
}
}
fn get_raw(&self) -> *mut _cef_window_t {
unsafe { RefGuard::into_raw(&self.0) }
}
}
impl Rc for _cef_window_t {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.base.as_base()
}
}
impl Rc for Window {
fn as_base(&self) -> &_cef_base_ref_counted_t {
self.0.as_base()
}
}
impl ConvertParam<*mut _cef_window_t> for &Window {
fn into_raw(self) -> *mut _cef_window_t {
ImplWindow::get_raw(self)
}
}
impl ConvertParam<*mut _cef_window_t> for &mut Window {
fn into_raw(self) -> *mut _cef_window_t {
ImplWindow::get_raw(self)
}
}
impl ConvertReturnValue<Window> for *mut _cef_window_t {
fn wrap_result(self) -> Window {
Window(unsafe { RefGuard::from_raw(self) })
}
}
impl From<Window> for *mut _cef_window_t {
fn from(value: Window) -> Self {
let object = ImplWindow::get_raw(&value);
std::mem::forget(value);
object
}
}
/// See [`cef_content_setting_types_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ContentSettingTypes(cef_content_setting_types_t);
impl AsRef<cef_content_setting_types_t> for ContentSettingTypes {
fn as_ref(&self) -> &cef_content_setting_types_t {
&self.0
}
}
impl AsMut<cef_content_setting_types_t> for ContentSettingTypes {
fn as_mut(&mut self) -> &mut cef_content_setting_types_t {
&mut self.0
}
}
impl From<cef_content_setting_types_t> for ContentSettingTypes {
fn from(value: cef_content_setting_types_t) -> Self {
Self(value)
}
}
impl From<ContentSettingTypes> for cef_content_setting_types_t {
fn from(value: ContentSettingTypes) -> Self {
value.0
}
}
impl ContentSettingTypes {
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_COOKIES`] for more documentation."]
pub const COOKIES: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_COOKIES);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_IMAGES`] for more documentation."]
pub const IMAGES: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_IMAGES);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_JAVASCRIPT`] for more documentation."]
pub const JAVASCRIPT: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_JAVASCRIPT);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_POPUPS`] for more documentation."]
pub const POPUPS: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_POPUPS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_GEOLOCATION`] for more documentation."]
pub const GEOLOCATION: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_GEOLOCATION);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NOTIFICATIONS`] for more documentation."]
pub const NOTIFICATIONS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NOTIFICATIONS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTO_SELECT_CERTIFICATE`] for more documentation."]
pub const AUTO_SELECT_CERTIFICATE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTO_SELECT_CERTIFICATE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MIXEDSCRIPT`] for more documentation."]
pub const MIXEDSCRIPT: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MIXEDSCRIPT);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_MIC`] for more documentation."]
pub const MEDIASTREAM_MIC: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_MIC);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_CAMERA`] for more documentation."]
pub const MEDIASTREAM_CAMERA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_CAMERA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PROTOCOL_HANDLERS`] for more documentation."]
pub const PROTOCOL_HANDLERS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PROTOCOL_HANDLERS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DEPRECATED_PPAPI_BROKER`] for more documentation."]
pub const DEPRECATED_PPAPI_BROKER: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DEPRECATED_PPAPI_BROKER);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTOMATIC_DOWNLOADS`] for more documentation."]
pub const AUTOMATIC_DOWNLOADS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTOMATIC_DOWNLOADS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MIDI_SYSEX`] for more documentation."]
pub const MIDI_SYSEX: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MIDI_SYSEX);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SSL_CERT_DECISIONS`] for more documentation."]
pub const SSL_CERT_DECISIONS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SSL_CERT_DECISIONS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PROTECTED_MEDIA_IDENTIFIER`] for more documentation."]
pub const PROTECTED_MEDIA_IDENTIFIER: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PROTECTED_MEDIA_IDENTIFIER);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_APP_BANNER`] for more documentation."]
pub const APP_BANNER: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_APP_BANNER);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SITE_ENGAGEMENT`] for more documentation."]
pub const SITE_ENGAGEMENT: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SITE_ENGAGEMENT);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERSISTENT_STORAGE`] for more documentation."]
pub const PERSISTENT_STORAGE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERSISTENT_STORAGE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_USB_CHOOSER_DATA`] for more documentation."]
pub const USB_CHOOSER_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_USB_CHOOSER_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BLUETOOTH_GUARD`] for more documentation."]
pub const BLUETOOTH_GUARD: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BLUETOOTH_GUARD);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BACKGROUND_SYNC`] for more documentation."]
pub const BACKGROUND_SYNC: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BACKGROUND_SYNC);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTOPLAY`] for more documentation."]
pub const AUTOPLAY: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTOPLAY);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_IMPORTANT_SITE_INFO`] for more documentation."]
pub const IMPORTANT_SITE_INFO: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_IMPORTANT_SITE_INFO);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOBLOCKER_DATA`] for more documentation."]
pub const PERMISSION_AUTOBLOCKER_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOBLOCKER_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ADS`] for more documentation."]
pub const ADS: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ADS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ADS_DATA`] for more documentation."]
pub const ADS_DATA: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ADS_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MIDI`] for more documentation."]
pub const MIDI: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MIDI);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PASSWORD_PROTECTION`] for more documentation."]
pub const PASSWORD_PROTECTION: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PASSWORD_PROTECTION);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MEDIA_ENGAGEMENT`] for more documentation."]
pub const MEDIA_ENGAGEMENT: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_MEDIA_ENGAGEMENT);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SOUND`] for more documentation."]
pub const SOUND: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SOUND);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CLIENT_HINTS`] for more documentation."]
pub const CLIENT_HINTS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CLIENT_HINTS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SENSORS`] for more documentation."]
pub const SENSORS: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SENSORS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DEPRECATED_ACCESSIBILITY_EVENTS`] for more documentation."]
pub const DEPRECATED_ACCESSIBILITY_EVENTS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DEPRECATED_ACCESSIBILITY_EVENTS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PAYMENT_HANDLER`] for more documentation."]
pub const PAYMENT_HANDLER: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PAYMENT_HANDLER);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_USB_GUARD`] for more documentation."]
pub const USB_GUARD: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_USB_GUARD);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BACKGROUND_FETCH`] for more documentation."]
pub const BACKGROUND_FETCH: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BACKGROUND_FETCH);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_INTENT_PICKER_DISPLAY`] for more documentation."]
pub const INTENT_PICKER_DISPLAY: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_INTENT_PICKER_DISPLAY);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_IDLE_DETECTION`] for more documentation."]
pub const IDLE_DETECTION: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_IDLE_DETECTION);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SERIAL_GUARD`] for more documentation."]
pub const SERIAL_GUARD: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SERIAL_GUARD);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SERIAL_CHOOSER_DATA`] for more documentation."]
pub const SERIAL_CHOOSER_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SERIAL_CHOOSER_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERIODIC_BACKGROUND_SYNC`] for more documentation."]
pub const PERIODIC_BACKGROUND_SYNC: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERIODIC_BACKGROUND_SYNC);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BLUETOOTH_SCANNING`] for more documentation."]
pub const BLUETOOTH_SCANNING: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BLUETOOTH_SCANNING);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HID_GUARD`] for more documentation."]
pub const HID_GUARD: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HID_GUARD);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HID_CHOOSER_DATA`] for more documentation."]
pub const HID_CHOOSER_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HID_CHOOSER_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SCREEN`] for more documentation."]
pub const WAKE_LOCK_SCREEN: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SCREEN);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SYSTEM`] for more documentation."]
pub const WAKE_LOCK_SYSTEM: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SYSTEM);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_ACCESS`] for more documentation."]
pub const LEGACY_COOKIE_ACCESS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_ACCESS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_WRITE_GUARD`] for more documentation."]
pub const FILE_SYSTEM_WRITE_GUARD: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_WRITE_GUARD);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NFC`] for more documentation."]
pub const NFC: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NFC);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BLUETOOTH_CHOOSER_DATA`] for more documentation."]
pub const BLUETOOTH_CHOOSER_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_BLUETOOTH_CHOOSER_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CLIPBOARD_READ_WRITE`] for more documentation."]
pub const CLIPBOARD_READ_WRITE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CLIPBOARD_READ_WRITE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CLIPBOARD_SANITIZED_WRITE`] for more documentation."]
pub const CLIPBOARD_SANITIZED_WRITE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CLIPBOARD_SANITIZED_WRITE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SAFE_BROWSING_URL_CHECK_DATA`] for more documentation."]
pub const SAFE_BROWSING_URL_CHECK_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SAFE_BROWSING_URL_CHECK_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_VR`] for more documentation."]
pub const VR: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_VR);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AR`] for more documentation."]
pub const AR: Self = Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AR);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_READ_GUARD`] for more documentation."]
pub const FILE_SYSTEM_READ_GUARD: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_READ_GUARD);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS`] for more documentation."]
pub const STORAGE_ACCESS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CAMERA_PAN_TILT_ZOOM`] for more documentation."]
pub const CAMERA_PAN_TILT_ZOOM: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CAMERA_PAN_TILT_ZOOM);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WINDOW_MANAGEMENT`] for more documentation."]
pub const WINDOW_MANAGEMENT: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WINDOW_MANAGEMENT);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK_DEPRECATED`] for more documentation."]
pub const INSECURE_PRIVATE_NETWORK_DEPRECATED: Self = Self(
cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK_DEPRECATED,
);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOCAL_FONTS`] for more documentation."]
pub const LOCAL_FONTS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOCAL_FONTS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOREVOCATION_DATA`] for more documentation."]
pub const PERMISSION_AUTOREVOCATION_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOREVOCATION_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY`] for more documentation."]
pub const FILE_SYSTEM_LAST_PICKED_DIRECTORY: Self = Self(
cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY,
);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE`] for more documentation."]
pub const DISPLAY_CAPTURE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_CHOOSER_DATA`] for more documentation."]
pub const FILE_SYSTEM_ACCESS_CHOOSER_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_CHOOSER_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_SHARING`] for more documentation."]
pub const FEDERATED_IDENTITY_SHARING: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_SHARING);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_JIT`] for more documentation."]
pub const JAVASCRIPT_JIT: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_JIT);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HTTP_ALLOWED`] for more documentation."]
pub const HTTP_ALLOWED: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HTTP_ALLOWED);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA`] for more documentation."]
pub const FORMFILL_METADATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION`] for more documentation."]
pub const DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTO_DARK_WEB_CONTENT`] for more documentation."]
pub const AUTO_DARK_WEB_CONTENT: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTO_DARK_WEB_CONTENT);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REQUEST_DESKTOP_SITE`] for more documentation."]
pub const REQUEST_DESKTOP_SITE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REQUEST_DESKTOP_SITE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_API`] for more documentation."]
pub const FEDERATED_IDENTITY_API: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_API);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NOTIFICATION_INTERACTIONS`] for more documentation."]
pub const NOTIFICATION_INTERACTIONS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NOTIFICATION_INTERACTIONS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REDUCED_ACCEPT_LANGUAGE`] for more documentation."]
pub const REDUCED_ACCEPT_LANGUAGE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REDUCED_ACCEPT_LANGUAGE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NOTIFICATION_PERMISSION_REVIEW`] for more documentation."]
pub const NOTIFICATION_PERMISSION_REVIEW: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NOTIFICATION_PERMISSION_REVIEW);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_GUARD_DEPRECATED`] for more documentation."]
pub const PRIVATE_NETWORK_GUARD_DEPRECATED: Self = Self(
cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_GUARD_DEPRECATED,
);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_CHOOSER_DATA_DEPRECATED`] for more documentation."]
pub const PRIVATE_NETWORK_CHOOSER_DATA_DEPRECATED : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_CHOOSER_DATA_DEPRECATED) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS`] for more documentation."]
pub const FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REVOKED_UNUSED_SITE_PERMISSIONS`] for more documentation."]
pub const REVOKED_UNUSED_SITE_PERMISSIONS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REVOKED_UNUSED_SITE_PERMISSIONS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_STORAGE_ACCESS`] for more documentation."]
pub const TOP_LEVEL_STORAGE_ACCESS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_STORAGE_ACCESS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION`] for more documentation."]
pub const FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION`] for more documentation."]
pub const FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ANTI_ABUSE`] for more documentation."]
pub const ANTI_ABUSE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ANTI_ABUSE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_THIRD_PARTY_STORAGE_PARTITIONING_DEPRECATED`] for more documentation."]
pub const THIRD_PARTY_STORAGE_PARTITIONING_DEPRECATED : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_THIRD_PARTY_STORAGE_PARTITIONING_DEPRECATED) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HTTPS_ENFORCED`] for more documentation."]
pub const HTTPS_ENFORCED: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HTTPS_ENFORCED);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ALL_SCREEN_CAPTURE`] for more documentation."]
pub const ALL_SCREEN_CAPTURE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ALL_SCREEN_CAPTURE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA`] for more documentation."]
pub const COOKIE_CONTROLS_METADATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS`] for more documentation."]
pub const TPCD_HEURISTICS_GRANTS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS`] for more documentation."]
pub const TPCD_METADATA_GRANTS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL_DEPRECATED`] for more documentation."]
pub const TPCD_TRIAL_DEPRECATED: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL_DEPRECATED);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL_DEPRECATED`] for more documentation."]
pub const TOP_LEVEL_TPCD_TRIAL_DEPRECATED: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL_DEPRECATED);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_ORIGIN_TRIAL_DEPRECATED`] for more documentation."]
pub const TOP_LEVEL_TPCD_ORIGIN_TRIAL_DEPRECATED : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_ORIGIN_TRIAL_DEPRECATED) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE`] for more documentation."]
pub const AUTO_PICTURE_IN_PICTURE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION`] for more documentation."]
pub const FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION`] for more documentation."]
pub const FILE_SYSTEM_ACCESS_RESTORE_PERMISSION: Self = Self(
cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION,
);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL`] for more documentation."]
pub const CAPTURED_SURFACE_CONTROL: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD`] for more documentation."]
pub const SMART_CARD_GUARD: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA`] for more documentation."]
pub const SMART_CARD_DATA: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WEB_PRINTING`] for more documentation."]
pub const WEB_PRINTING: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WEB_PRINTING);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTOMATIC_FULLSCREEN`] for more documentation."]
pub const AUTOMATIC_FULLSCREEN: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_AUTOMATIC_FULLSCREEN);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SUB_APP_INSTALLATION_PROMPTS`] for more documentation."]
pub const SUB_APP_INSTALLATION_PROMPTS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SUB_APP_INSTALLATION_PROMPTS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION`] for more documentation."]
pub const SPEAKER_SELECTION: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS`] for more documentation."]
pub const DIRECT_SOCKETS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK`] for more documentation."]
pub const KEYBOARD_LOCK: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_POINTER_LOCK`] for more documentation."]
pub const POINTER_LOCK: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_POINTER_LOCK);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS`] for more documentation."]
pub const REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TRACKING_PROTECTION_DEPRECATED`] for more documentation."]
pub const TRACKING_PROTECTION_DEPRECATED: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_TRACKING_PROTECTION_DEPRECATED);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DISPLAY_MEDIA_SYSTEM_AUDIO`] for more documentation."]
pub const DISPLAY_MEDIA_SYSTEM_AUDIO: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DISPLAY_MEDIA_SYSTEM_AUDIO);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_OPTIMIZER`] for more documentation."]
pub const JAVASCRIPT_OPTIMIZER: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_OPTIMIZER);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS_HEADER_ORIGIN_TRIAL`] for more documentation."]
pub const STORAGE_ACCESS_HEADER_ORIGIN_TRIAL: Self = Self(
cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS_HEADER_ORIGIN_TRIAL,
);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HAND_TRACKING`] for more documentation."]
pub const HAND_TRACKING: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_HAND_TRACKING);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WEB_APP_INSTALLATION`] for more documentation."]
pub const WEB_APP_INSTALLATION: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_WEB_APP_INSTALLATION);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS_PRIVATE_NETWORK_ACCESS`] for more documentation."]
pub const DIRECT_SOCKETS_PRIVATE_NETWORK_ACCESS: Self = Self(
cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS_PRIVATE_NETWORK_ACCESS,
);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_SCOPE`] for more documentation."]
pub const LEGACY_COOKIE_SCOPE: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_SCOPE);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ARE_SUSPICIOUS_NOTIFICATIONS_ALLOWLISTED_BY_USER`] for more documentation."]
pub const ARE_SUSPICIOUS_NOTIFICATIONS_ALLOWLISTED_BY_USER : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_ARE_SUSPICIOUS_NOTIFICATIONS_ALLOWLISTED_BY_USER) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CONTROLLED_FRAME`] for more documentation."]
pub const CONTROLLED_FRAME: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_CONTROLLED_FRAME);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_REVOKED_DISRUPTIVE_NOTIFICATION_PERMISSIONS`] for more documentation."]
pub const REVOKED_DISRUPTIVE_NOTIFICATION_PERMISSIONS : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_REVOKED_DISRUPTIVE_NOTIFICATION_PERMISSIONS) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOCAL_NETWORK_ACCESS`] for more documentation."]
pub const LOCAL_NETWORK_ACCESS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOCAL_NETWORK_ACCESS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_ON_DEVICE_SPEECH_RECOGNITION_LANGUAGES_DOWNLOADED`] for more documentation."]
pub const ON_DEVICE_SPEECH_RECOGNITION_LANGUAGES_DOWNLOADED : Self = Self (cef_content_setting_types_t :: CEF_CONTENT_SETTING_TYPE_ON_DEVICE_SPEECH_RECOGNITION_LANGUAGES_DOWNLOADED) ;
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_INITIALIZED_TRANSLATIONS`] for more documentation."]
pub const INITIALIZED_TRANSLATIONS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_INITIALIZED_TRANSLATIONS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SUSPICIOUS_NOTIFICATION_IDS`] for more documentation."]
pub const SUSPICIOUS_NOTIFICATION_IDS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SUSPICIOUS_NOTIFICATION_IDS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_GEOLOCATION_WITH_OPTIONS`] for more documentation."]
pub const GEOLOCATION_WITH_OPTIONS: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_GEOLOCATION_WITH_OPTIONS);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DEVICE_ATTRIBUTES`] for more documentation."]
pub const DEVICE_ATTRIBUTES: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_DEVICE_ATTRIBUTES);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERMISSION_ACTIONS_HISTORY`] for more documentation."]
pub const PERMISSION_ACTIONS_HISTORY: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_PERMISSION_ACTIONS_HISTORY);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SUSPICIOUS_NOTIFICATION_SHOW_ORIGINAL`] for more documentation."]
pub const SUSPICIOUS_NOTIFICATION_SHOW_ORIGINAL: Self = Self(
cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_SUSPICIOUS_NOTIFICATION_SHOW_ORIGINAL,
);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOCAL_NETWORK`] for more documentation."]
pub const LOCAL_NETWORK: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOCAL_NETWORK);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOOPBACK_NETWORK`] for more documentation."]
pub const LOOPBACK_NETWORK: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_LOOPBACK_NETWORK);
#[doc = "See [`cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self =
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_NUM_VALUES);
}
impl ContentSettingTypes {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ContentSettingTypes {
fn default() -> Self {
Self(cef_content_setting_types_t::CEF_CONTENT_SETTING_TYPE_COOKIES)
}
}
/// See [`cef_content_setting_values_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ContentSettingValues(cef_content_setting_values_t);
impl AsRef<cef_content_setting_values_t> for ContentSettingValues {
fn as_ref(&self) -> &cef_content_setting_values_t {
&self.0
}
}
impl AsMut<cef_content_setting_values_t> for ContentSettingValues {
fn as_mut(&mut self) -> &mut cef_content_setting_values_t {
&mut self.0
}
}
impl From<cef_content_setting_values_t> for ContentSettingValues {
fn from(value: cef_content_setting_values_t) -> Self {
Self(value)
}
}
impl From<ContentSettingValues> for cef_content_setting_values_t {
fn from(value: ContentSettingValues) -> Self {
value.0
}
}
impl ContentSettingValues {
#[doc = "See [`cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_DEFAULT);
#[doc = "See [`cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_ALLOW`] for more documentation."]
pub const ALLOW: Self = Self(cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_ALLOW);
#[doc = "See [`cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_BLOCK`] for more documentation."]
pub const BLOCK: Self = Self(cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_BLOCK);
#[doc = "See [`cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_ASK`] for more documentation."]
pub const ASK: Self = Self(cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_ASK);
#[doc = "See [`cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_SESSION_ONLY`] for more documentation."]
pub const SESSION_ONLY: Self =
Self(cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_SESSION_ONLY);
#[doc = "See [`cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_DETECT_IMPORTANT_CONTENT_DEPRECATED`] for more documentation."]
pub const DETECT_IMPORTANT_CONTENT_DEPRECATED: Self = Self(
cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_DETECT_IMPORTANT_CONTENT_DEPRECATED,
);
#[doc = "See [`cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self =
Self(cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_NUM_VALUES);
}
impl ContentSettingValues {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ContentSettingValues {
fn default() -> Self {
Self(cef_content_setting_values_t::CEF_CONTENT_SETTING_VALUE_DEFAULT)
}
}
/// See [`cef_color_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ColorType(cef_color_type_t);
impl AsRef<cef_color_type_t> for ColorType {
fn as_ref(&self) -> &cef_color_type_t {
&self.0
}
}
impl AsMut<cef_color_type_t> for ColorType {
fn as_mut(&mut self) -> &mut cef_color_type_t {
&mut self.0
}
}
impl From<cef_color_type_t> for ColorType {
fn from(value: cef_color_type_t) -> Self {
Self(value)
}
}
impl From<ColorType> for cef_color_type_t {
fn from(value: ColorType) -> Self {
value.0
}
}
impl ColorType {
#[doc = "See [`cef_color_type_t::CEF_COLOR_TYPE_RGBA_8888`] for more documentation."]
pub const RGBA_8888: Self = Self(cef_color_type_t::CEF_COLOR_TYPE_RGBA_8888);
#[doc = "See [`cef_color_type_t::CEF_COLOR_TYPE_BGRA_8888`] for more documentation."]
pub const BGRA_8888: Self = Self(cef_color_type_t::CEF_COLOR_TYPE_BGRA_8888);
#[doc = "See [`cef_color_type_t::CEF_COLOR_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_color_type_t::CEF_COLOR_TYPE_NUM_VALUES);
}
impl ColorType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ColorType {
fn default() -> Self {
Self(cef_color_type_t::CEF_COLOR_TYPE_RGBA_8888)
}
}
/// See [`cef_runtime_style_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct RuntimeStyle(cef_runtime_style_t);
impl AsRef<cef_runtime_style_t> for RuntimeStyle {
fn as_ref(&self) -> &cef_runtime_style_t {
&self.0
}
}
impl AsMut<cef_runtime_style_t> for RuntimeStyle {
fn as_mut(&mut self) -> &mut cef_runtime_style_t {
&mut self.0
}
}
impl From<cef_runtime_style_t> for RuntimeStyle {
fn from(value: cef_runtime_style_t) -> Self {
Self(value)
}
}
impl From<RuntimeStyle> for cef_runtime_style_t {
fn from(value: RuntimeStyle) -> Self {
value.0
}
}
impl RuntimeStyle {
#[doc = "See [`cef_runtime_style_t::CEF_RUNTIME_STYLE_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_runtime_style_t::CEF_RUNTIME_STYLE_DEFAULT);
#[doc = "See [`cef_runtime_style_t::CEF_RUNTIME_STYLE_CHROME`] for more documentation."]
pub const CHROME: Self = Self(cef_runtime_style_t::CEF_RUNTIME_STYLE_CHROME);
#[doc = "See [`cef_runtime_style_t::CEF_RUNTIME_STYLE_ALLOY`] for more documentation."]
pub const ALLOY: Self = Self(cef_runtime_style_t::CEF_RUNTIME_STYLE_ALLOY);
}
impl RuntimeStyle {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for RuntimeStyle {
fn default() -> Self {
Self(cef_runtime_style_t::CEF_RUNTIME_STYLE_DEFAULT)
}
}
/// See [`cef_log_severity_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct LogSeverity(cef_log_severity_t);
impl AsRef<cef_log_severity_t> for LogSeverity {
fn as_ref(&self) -> &cef_log_severity_t {
&self.0
}
}
impl AsMut<cef_log_severity_t> for LogSeverity {
fn as_mut(&mut self) -> &mut cef_log_severity_t {
&mut self.0
}
}
impl From<cef_log_severity_t> for LogSeverity {
fn from(value: cef_log_severity_t) -> Self {
Self(value)
}
}
impl From<LogSeverity> for cef_log_severity_t {
fn from(value: LogSeverity) -> Self {
value.0
}
}
impl LogSeverity {
#[doc = "See [`cef_log_severity_t::LOGSEVERITY_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_log_severity_t::LOGSEVERITY_DEFAULT);
#[doc = "See [`cef_log_severity_t::LOGSEVERITY_VERBOSE`] for more documentation."]
pub const VERBOSE: Self = Self(cef_log_severity_t::LOGSEVERITY_VERBOSE);
#[doc = "See [`cef_log_severity_t::LOGSEVERITY_INFO`] for more documentation."]
pub const INFO: Self = Self(cef_log_severity_t::LOGSEVERITY_INFO);
#[doc = "See [`cef_log_severity_t::LOGSEVERITY_WARNING`] for more documentation."]
pub const WARNING: Self = Self(cef_log_severity_t::LOGSEVERITY_WARNING);
#[doc = "See [`cef_log_severity_t::LOGSEVERITY_ERROR`] for more documentation."]
pub const ERROR: Self = Self(cef_log_severity_t::LOGSEVERITY_ERROR);
#[doc = "See [`cef_log_severity_t::LOGSEVERITY_FATAL`] for more documentation."]
pub const FATAL: Self = Self(cef_log_severity_t::LOGSEVERITY_FATAL);
#[doc = "See [`cef_log_severity_t::LOGSEVERITY_DISABLE`] for more documentation."]
pub const DISABLE: Self = Self(cef_log_severity_t::LOGSEVERITY_DISABLE);
}
impl LogSeverity {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for LogSeverity {
fn default() -> Self {
Self(cef_log_severity_t::LOGSEVERITY_DEFAULT)
}
}
/// See [`cef_log_items_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct LogItems(cef_log_items_t);
impl AsRef<cef_log_items_t> for LogItems {
fn as_ref(&self) -> &cef_log_items_t {
&self.0
}
}
impl AsMut<cef_log_items_t> for LogItems {
fn as_mut(&mut self) -> &mut cef_log_items_t {
&mut self.0
}
}
impl From<cef_log_items_t> for LogItems {
fn from(value: cef_log_items_t) -> Self {
Self(value)
}
}
impl From<LogItems> for cef_log_items_t {
fn from(value: LogItems) -> Self {
value.0
}
}
impl LogItems {
#[doc = "See [`cef_log_items_t::LOG_ITEMS_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_log_items_t::LOG_ITEMS_DEFAULT);
#[doc = "See [`cef_log_items_t::LOG_ITEMS_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_log_items_t::LOG_ITEMS_NONE);
#[doc = "See [`cef_log_items_t::LOG_ITEMS_FLAG_PROCESS_ID`] for more documentation."]
pub const FLAG_PROCESS_ID: Self = Self(cef_log_items_t::LOG_ITEMS_FLAG_PROCESS_ID);
#[doc = "See [`cef_log_items_t::LOG_ITEMS_FLAG_THREAD_ID`] for more documentation."]
pub const FLAG_THREAD_ID: Self = Self(cef_log_items_t::LOG_ITEMS_FLAG_THREAD_ID);
#[doc = "See [`cef_log_items_t::LOG_ITEMS_FLAG_TIME_STAMP`] for more documentation."]
pub const FLAG_TIME_STAMP: Self = Self(cef_log_items_t::LOG_ITEMS_FLAG_TIME_STAMP);
#[doc = "See [`cef_log_items_t::LOG_ITEMS_FLAG_TICK_COUNT`] for more documentation."]
pub const FLAG_TICK_COUNT: Self = Self(cef_log_items_t::LOG_ITEMS_FLAG_TICK_COUNT);
}
impl LogItems {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for LogItems {
fn default() -> Self {
Self(cef_log_items_t::LOG_ITEMS_DEFAULT)
}
}
/// See [`cef_state_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct State(cef_state_t);
impl AsRef<cef_state_t> for State {
fn as_ref(&self) -> &cef_state_t {
&self.0
}
}
impl AsMut<cef_state_t> for State {
fn as_mut(&mut self) -> &mut cef_state_t {
&mut self.0
}
}
impl From<cef_state_t> for State {
fn from(value: cef_state_t) -> Self {
Self(value)
}
}
impl From<State> for cef_state_t {
fn from(value: State) -> Self {
value.0
}
}
impl State {
#[doc = "See [`cef_state_t::STATE_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_state_t::STATE_DEFAULT);
#[doc = "See [`cef_state_t::STATE_ENABLED`] for more documentation."]
pub const ENABLED: Self = Self(cef_state_t::STATE_ENABLED);
#[doc = "See [`cef_state_t::STATE_DISABLED`] for more documentation."]
pub const DISABLED: Self = Self(cef_state_t::STATE_DISABLED);
}
impl State {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for State {
fn default() -> Self {
Self(cef_state_t::STATE_DEFAULT)
}
}
/// See [`cef_return_value_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ReturnValue(cef_return_value_t);
impl AsRef<cef_return_value_t> for ReturnValue {
fn as_ref(&self) -> &cef_return_value_t {
&self.0
}
}
impl AsMut<cef_return_value_t> for ReturnValue {
fn as_mut(&mut self) -> &mut cef_return_value_t {
&mut self.0
}
}
impl From<cef_return_value_t> for ReturnValue {
fn from(value: cef_return_value_t) -> Self {
Self(value)
}
}
impl From<ReturnValue> for cef_return_value_t {
fn from(value: ReturnValue) -> Self {
value.0
}
}
impl ReturnValue {
#[doc = "See [`cef_return_value_t::RV_CANCEL`] for more documentation."]
pub const CANCEL: Self = Self(cef_return_value_t::RV_CANCEL);
#[doc = "See [`cef_return_value_t::RV_CONTINUE`] for more documentation."]
pub const CONTINUE: Self = Self(cef_return_value_t::RV_CONTINUE);
#[doc = "See [`cef_return_value_t::RV_CONTINUE_ASYNC`] for more documentation."]
pub const CONTINUE_ASYNC: Self = Self(cef_return_value_t::RV_CONTINUE_ASYNC);
}
impl ReturnValue {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ReturnValue {
fn default() -> Self {
Self(cef_return_value_t::RV_CANCEL)
}
}
/// See [`cef_cookie_priority_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct CookiePriority(cef_cookie_priority_t);
impl AsRef<cef_cookie_priority_t> for CookiePriority {
fn as_ref(&self) -> &cef_cookie_priority_t {
&self.0
}
}
impl AsMut<cef_cookie_priority_t> for CookiePriority {
fn as_mut(&mut self) -> &mut cef_cookie_priority_t {
&mut self.0
}
}
impl From<cef_cookie_priority_t> for CookiePriority {
fn from(value: cef_cookie_priority_t) -> Self {
Self(value)
}
}
impl From<CookiePriority> for cef_cookie_priority_t {
fn from(value: CookiePriority) -> Self {
value.0
}
}
impl CookiePriority {
#[doc = "See [`cef_cookie_priority_t::CEF_COOKIE_PRIORITY_LOW`] for more documentation."]
pub const LOW: Self = Self(cef_cookie_priority_t::CEF_COOKIE_PRIORITY_LOW);
#[doc = "See [`cef_cookie_priority_t::CEF_COOKIE_PRIORITY_MEDIUM`] for more documentation."]
pub const MEDIUM: Self = Self(cef_cookie_priority_t::CEF_COOKIE_PRIORITY_MEDIUM);
#[doc = "See [`cef_cookie_priority_t::CEF_COOKIE_PRIORITY_HIGH`] for more documentation."]
pub const HIGH: Self = Self(cef_cookie_priority_t::CEF_COOKIE_PRIORITY_HIGH);
}
impl CookiePriority {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for CookiePriority {
fn default() -> Self {
Self(cef_cookie_priority_t::CEF_COOKIE_PRIORITY_LOW)
}
}
/// See [`cef_cookie_same_site_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct CookieSameSite(cef_cookie_same_site_t);
impl AsRef<cef_cookie_same_site_t> for CookieSameSite {
fn as_ref(&self) -> &cef_cookie_same_site_t {
&self.0
}
}
impl AsMut<cef_cookie_same_site_t> for CookieSameSite {
fn as_mut(&mut self) -> &mut cef_cookie_same_site_t {
&mut self.0
}
}
impl From<cef_cookie_same_site_t> for CookieSameSite {
fn from(value: cef_cookie_same_site_t) -> Self {
Self(value)
}
}
impl From<CookieSameSite> for cef_cookie_same_site_t {
fn from(value: CookieSameSite) -> Self {
value.0
}
}
impl CookieSameSite {
#[doc = "See [`cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_UNSPECIFIED`] for more documentation."]
pub const UNSPECIFIED: Self = Self(cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_UNSPECIFIED);
#[doc = "See [`cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_NO_RESTRICTION`] for more documentation."]
pub const NO_RESTRICTION: Self =
Self(cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_NO_RESTRICTION);
#[doc = "See [`cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_LAX_MODE`] for more documentation."]
pub const LAX_MODE: Self = Self(cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_LAX_MODE);
#[doc = "See [`cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_STRICT_MODE`] for more documentation."]
pub const STRICT_MODE: Self = Self(cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_STRICT_MODE);
#[doc = "See [`cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_NUM_VALUES);
}
impl CookieSameSite {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for CookieSameSite {
fn default() -> Self {
Self(cef_cookie_same_site_t::CEF_COOKIE_SAME_SITE_UNSPECIFIED)
}
}
/// See [`cef_termination_status_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TerminationStatus(cef_termination_status_t);
impl AsRef<cef_termination_status_t> for TerminationStatus {
fn as_ref(&self) -> &cef_termination_status_t {
&self.0
}
}
impl AsMut<cef_termination_status_t> for TerminationStatus {
fn as_mut(&mut self) -> &mut cef_termination_status_t {
&mut self.0
}
}
impl From<cef_termination_status_t> for TerminationStatus {
fn from(value: cef_termination_status_t) -> Self {
Self(value)
}
}
impl From<TerminationStatus> for cef_termination_status_t {
fn from(value: TerminationStatus) -> Self {
value.0
}
}
impl TerminationStatus {
#[doc = "See [`cef_termination_status_t::TS_ABNORMAL_TERMINATION`] for more documentation."]
pub const ABNORMAL_TERMINATION: Self = Self(cef_termination_status_t::TS_ABNORMAL_TERMINATION);
#[doc = "See [`cef_termination_status_t::TS_PROCESS_WAS_KILLED`] for more documentation."]
pub const PROCESS_WAS_KILLED: Self = Self(cef_termination_status_t::TS_PROCESS_WAS_KILLED);
#[doc = "See [`cef_termination_status_t::TS_PROCESS_CRASHED`] for more documentation."]
pub const PROCESS_CRASHED: Self = Self(cef_termination_status_t::TS_PROCESS_CRASHED);
#[doc = "See [`cef_termination_status_t::TS_PROCESS_OOM`] for more documentation."]
pub const PROCESS_OOM: Self = Self(cef_termination_status_t::TS_PROCESS_OOM);
#[doc = "See [`cef_termination_status_t::TS_LAUNCH_FAILED`] for more documentation."]
pub const LAUNCH_FAILED: Self = Self(cef_termination_status_t::TS_LAUNCH_FAILED);
#[doc = "See [`cef_termination_status_t::TS_INTEGRITY_FAILURE`] for more documentation."]
pub const INTEGRITY_FAILURE: Self = Self(cef_termination_status_t::TS_INTEGRITY_FAILURE);
#[doc = "See [`cef_termination_status_t::TS_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_termination_status_t::TS_NUM_VALUES);
}
impl TerminationStatus {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TerminationStatus {
fn default() -> Self {
Self(cef_termination_status_t::TS_ABNORMAL_TERMINATION)
}
}
/// See [`cef_path_key_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PathKey(cef_path_key_t);
impl AsRef<cef_path_key_t> for PathKey {
fn as_ref(&self) -> &cef_path_key_t {
&self.0
}
}
impl AsMut<cef_path_key_t> for PathKey {
fn as_mut(&mut self) -> &mut cef_path_key_t {
&mut self.0
}
}
impl From<cef_path_key_t> for PathKey {
fn from(value: cef_path_key_t) -> Self {
Self(value)
}
}
impl From<PathKey> for cef_path_key_t {
fn from(value: PathKey) -> Self {
value.0
}
}
impl PathKey {
#[doc = "See [`cef_path_key_t::PK_DIR_CURRENT`] for more documentation."]
pub const DIR_CURRENT: Self = Self(cef_path_key_t::PK_DIR_CURRENT);
#[doc = "See [`cef_path_key_t::PK_DIR_EXE`] for more documentation."]
pub const DIR_EXE: Self = Self(cef_path_key_t::PK_DIR_EXE);
#[doc = "See [`cef_path_key_t::PK_DIR_MODULE`] for more documentation."]
pub const DIR_MODULE: Self = Self(cef_path_key_t::PK_DIR_MODULE);
#[doc = "See [`cef_path_key_t::PK_DIR_TEMP`] for more documentation."]
pub const DIR_TEMP: Self = Self(cef_path_key_t::PK_DIR_TEMP);
#[doc = "See [`cef_path_key_t::PK_FILE_EXE`] for more documentation."]
pub const FILE_EXE: Self = Self(cef_path_key_t::PK_FILE_EXE);
#[doc = "See [`cef_path_key_t::PK_FILE_MODULE`] for more documentation."]
pub const FILE_MODULE: Self = Self(cef_path_key_t::PK_FILE_MODULE);
#[doc = "See [`cef_path_key_t::PK_LOCAL_APP_DATA`] for more documentation."]
pub const LOCAL_APP_DATA: Self = Self(cef_path_key_t::PK_LOCAL_APP_DATA);
#[doc = "See [`cef_path_key_t::PK_USER_DATA`] for more documentation."]
pub const USER_DATA: Self = Self(cef_path_key_t::PK_USER_DATA);
#[doc = "See [`cef_path_key_t::PK_DIR_RESOURCES`] for more documentation."]
pub const DIR_RESOURCES: Self = Self(cef_path_key_t::PK_DIR_RESOURCES);
#[doc = "See [`cef_path_key_t::PK_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_path_key_t::PK_NUM_VALUES);
}
impl PathKey {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PathKey {
fn default() -> Self {
Self(cef_path_key_t::PK_DIR_CURRENT)
}
}
/// See [`cef_storage_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct StorageType(cef_storage_type_t);
impl AsRef<cef_storage_type_t> for StorageType {
fn as_ref(&self) -> &cef_storage_type_t {
&self.0
}
}
impl AsMut<cef_storage_type_t> for StorageType {
fn as_mut(&mut self) -> &mut cef_storage_type_t {
&mut self.0
}
}
impl From<cef_storage_type_t> for StorageType {
fn from(value: cef_storage_type_t) -> Self {
Self(value)
}
}
impl From<StorageType> for cef_storage_type_t {
fn from(value: StorageType) -> Self {
value.0
}
}
impl StorageType {
#[doc = "See [`cef_storage_type_t::ST_LOCALSTORAGE`] for more documentation."]
pub const LOCALSTORAGE: Self = Self(cef_storage_type_t::ST_LOCALSTORAGE);
#[doc = "See [`cef_storage_type_t::ST_SESSIONSTORAGE`] for more documentation."]
pub const SESSIONSTORAGE: Self = Self(cef_storage_type_t::ST_SESSIONSTORAGE);
}
impl StorageType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for StorageType {
fn default() -> Self {
Self(cef_storage_type_t::ST_LOCALSTORAGE)
}
}
/// See [`cef_errorcode_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Errorcode(cef_errorcode_t);
impl AsRef<cef_errorcode_t> for Errorcode {
fn as_ref(&self) -> &cef_errorcode_t {
&self.0
}
}
impl AsMut<cef_errorcode_t> for Errorcode {
fn as_mut(&mut self) -> &mut cef_errorcode_t {
&mut self.0
}
}
impl From<cef_errorcode_t> for Errorcode {
fn from(value: cef_errorcode_t) -> Self {
Self(value)
}
}
impl From<Errorcode> for cef_errorcode_t {
fn from(value: Errorcode) -> Self {
value.0
}
}
impl Errorcode {
#[doc = "See [`cef_errorcode_t::ERR_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_errorcode_t::ERR_NONE);
#[doc = "See [`cef_errorcode_t::ERR_IO_PENDING`] for more documentation."]
pub const IO_PENDING: Self = Self(cef_errorcode_t::ERR_IO_PENDING);
#[doc = "See [`cef_errorcode_t::ERR_FAILED`] for more documentation."]
pub const FAILED: Self = Self(cef_errorcode_t::ERR_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_ABORTED`] for more documentation."]
pub const ABORTED: Self = Self(cef_errorcode_t::ERR_ABORTED);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_ARGUMENT`] for more documentation."]
pub const INVALID_ARGUMENT: Self = Self(cef_errorcode_t::ERR_INVALID_ARGUMENT);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_HANDLE`] for more documentation."]
pub const INVALID_HANDLE: Self = Self(cef_errorcode_t::ERR_INVALID_HANDLE);
#[doc = "See [`cef_errorcode_t::ERR_FILE_NOT_FOUND`] for more documentation."]
pub const FILE_NOT_FOUND: Self = Self(cef_errorcode_t::ERR_FILE_NOT_FOUND);
#[doc = "See [`cef_errorcode_t::ERR_TIMED_OUT`] for more documentation."]
pub const TIMED_OUT: Self = Self(cef_errorcode_t::ERR_TIMED_OUT);
#[doc = "See [`cef_errorcode_t::ERR_FILE_TOO_BIG`] for more documentation."]
pub const FILE_TOO_BIG: Self = Self(cef_errorcode_t::ERR_FILE_TOO_BIG);
#[doc = "See [`cef_errorcode_t::ERR_UNEXPECTED`] for more documentation."]
pub const UNEXPECTED: Self = Self(cef_errorcode_t::ERR_UNEXPECTED);
#[doc = "See [`cef_errorcode_t::ERR_ACCESS_DENIED`] for more documentation."]
pub const ACCESS_DENIED: Self = Self(cef_errorcode_t::ERR_ACCESS_DENIED);
#[doc = "See [`cef_errorcode_t::ERR_NOT_IMPLEMENTED`] for more documentation."]
pub const NOT_IMPLEMENTED: Self = Self(cef_errorcode_t::ERR_NOT_IMPLEMENTED);
#[doc = "See [`cef_errorcode_t::ERR_INSUFFICIENT_RESOURCES`] for more documentation."]
pub const INSUFFICIENT_RESOURCES: Self = Self(cef_errorcode_t::ERR_INSUFFICIENT_RESOURCES);
#[doc = "See [`cef_errorcode_t::ERR_OUT_OF_MEMORY`] for more documentation."]
pub const OUT_OF_MEMORY: Self = Self(cef_errorcode_t::ERR_OUT_OF_MEMORY);
#[doc = "See [`cef_errorcode_t::ERR_UPLOAD_FILE_CHANGED`] for more documentation."]
pub const UPLOAD_FILE_CHANGED: Self = Self(cef_errorcode_t::ERR_UPLOAD_FILE_CHANGED);
#[doc = "See [`cef_errorcode_t::ERR_SOCKET_NOT_CONNECTED`] for more documentation."]
pub const SOCKET_NOT_CONNECTED: Self = Self(cef_errorcode_t::ERR_SOCKET_NOT_CONNECTED);
#[doc = "See [`cef_errorcode_t::ERR_FILE_EXISTS`] for more documentation."]
pub const FILE_EXISTS: Self = Self(cef_errorcode_t::ERR_FILE_EXISTS);
#[doc = "See [`cef_errorcode_t::ERR_FILE_PATH_TOO_LONG`] for more documentation."]
pub const FILE_PATH_TOO_LONG: Self = Self(cef_errorcode_t::ERR_FILE_PATH_TOO_LONG);
#[doc = "See [`cef_errorcode_t::ERR_FILE_NO_SPACE`] for more documentation."]
pub const FILE_NO_SPACE: Self = Self(cef_errorcode_t::ERR_FILE_NO_SPACE);
#[doc = "See [`cef_errorcode_t::ERR_FILE_VIRUS_INFECTED`] for more documentation."]
pub const FILE_VIRUS_INFECTED: Self = Self(cef_errorcode_t::ERR_FILE_VIRUS_INFECTED);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_BY_CLIENT`] for more documentation."]
pub const BLOCKED_BY_CLIENT: Self = Self(cef_errorcode_t::ERR_BLOCKED_BY_CLIENT);
#[doc = "See [`cef_errorcode_t::ERR_NETWORK_CHANGED`] for more documentation."]
pub const NETWORK_CHANGED: Self = Self(cef_errorcode_t::ERR_NETWORK_CHANGED);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_BY_ADMINISTRATOR`] for more documentation."]
pub const BLOCKED_BY_ADMINISTRATOR: Self = Self(cef_errorcode_t::ERR_BLOCKED_BY_ADMINISTRATOR);
#[doc = "See [`cef_errorcode_t::ERR_SOCKET_IS_CONNECTED`] for more documentation."]
pub const SOCKET_IS_CONNECTED: Self = Self(cef_errorcode_t::ERR_SOCKET_IS_CONNECTED);
#[doc = "See [`cef_errorcode_t::ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED`] for more documentation."]
pub const UPLOAD_STREAM_REWIND_NOT_SUPPORTED: Self =
Self(cef_errorcode_t::ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED);
#[doc = "See [`cef_errorcode_t::ERR_CONTEXT_SHUT_DOWN`] for more documentation."]
pub const CONTEXT_SHUT_DOWN: Self = Self(cef_errorcode_t::ERR_CONTEXT_SHUT_DOWN);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_BY_RESPONSE`] for more documentation."]
pub const BLOCKED_BY_RESPONSE: Self = Self(cef_errorcode_t::ERR_BLOCKED_BY_RESPONSE);
#[doc = "See [`cef_errorcode_t::ERR_CLEARTEXT_NOT_PERMITTED`] for more documentation."]
pub const CLEARTEXT_NOT_PERMITTED: Self = Self(cef_errorcode_t::ERR_CLEARTEXT_NOT_PERMITTED);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_BY_CSP`] for more documentation."]
pub const BLOCKED_BY_CSP: Self = Self(cef_errorcode_t::ERR_BLOCKED_BY_CSP);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_BY_ORB`] for more documentation."]
pub const BLOCKED_BY_ORB: Self = Self(cef_errorcode_t::ERR_BLOCKED_BY_ORB);
#[doc = "See [`cef_errorcode_t::ERR_NETWORK_ACCESS_REVOKED`] for more documentation."]
pub const NETWORK_ACCESS_REVOKED: Self = Self(cef_errorcode_t::ERR_NETWORK_ACCESS_REVOKED);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_BY_FINGERPRINTING_PROTECTION`] for more documentation."]
pub const BLOCKED_BY_FINGERPRINTING_PROTECTION: Self =
Self(cef_errorcode_t::ERR_BLOCKED_BY_FINGERPRINTING_PROTECTION);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_IN_INCOGNITO_BY_ADMINISTRATOR`] for more documentation."]
pub const BLOCKED_IN_INCOGNITO_BY_ADMINISTRATOR: Self =
Self(cef_errorcode_t::ERR_BLOCKED_IN_INCOGNITO_BY_ADMINISTRATOR);
#[doc = "See [`cef_errorcode_t::ERR_LOCAL_NETWORK_PERMISSION_MISSING`] for more documentation."]
pub const LOCAL_NETWORK_PERMISSION_MISSING: Self =
Self(cef_errorcode_t::ERR_LOCAL_NETWORK_PERMISSION_MISSING);
#[doc = "See [`cef_errorcode_t::ERR_CONNECTION_CLOSED`] for more documentation."]
pub const CONNECTION_CLOSED: Self = Self(cef_errorcode_t::ERR_CONNECTION_CLOSED);
#[doc = "See [`cef_errorcode_t::ERR_CONNECTION_RESET`] for more documentation."]
pub const CONNECTION_RESET: Self = Self(cef_errorcode_t::ERR_CONNECTION_RESET);
#[doc = "See [`cef_errorcode_t::ERR_CONNECTION_REFUSED`] for more documentation."]
pub const CONNECTION_REFUSED: Self = Self(cef_errorcode_t::ERR_CONNECTION_REFUSED);
#[doc = "See [`cef_errorcode_t::ERR_CONNECTION_ABORTED`] for more documentation."]
pub const CONNECTION_ABORTED: Self = Self(cef_errorcode_t::ERR_CONNECTION_ABORTED);
#[doc = "See [`cef_errorcode_t::ERR_CONNECTION_FAILED`] for more documentation."]
pub const CONNECTION_FAILED: Self = Self(cef_errorcode_t::ERR_CONNECTION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_NAME_NOT_RESOLVED`] for more documentation."]
pub const NAME_NOT_RESOLVED: Self = Self(cef_errorcode_t::ERR_NAME_NOT_RESOLVED);
#[doc = "See [`cef_errorcode_t::ERR_INTERNET_DISCONNECTED`] for more documentation."]
pub const INTERNET_DISCONNECTED: Self = Self(cef_errorcode_t::ERR_INTERNET_DISCONNECTED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_PROTOCOL_ERROR`] for more documentation."]
pub const SSL_PROTOCOL_ERROR: Self = Self(cef_errorcode_t::ERR_SSL_PROTOCOL_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_ADDRESS_INVALID`] for more documentation."]
pub const ADDRESS_INVALID: Self = Self(cef_errorcode_t::ERR_ADDRESS_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_ADDRESS_UNREACHABLE`] for more documentation."]
pub const ADDRESS_UNREACHABLE: Self = Self(cef_errorcode_t::ERR_ADDRESS_UNREACHABLE);
#[doc = "See [`cef_errorcode_t::ERR_SSL_CLIENT_AUTH_CERT_NEEDED`] for more documentation."]
pub const SSL_CLIENT_AUTH_CERT_NEEDED: Self =
Self(cef_errorcode_t::ERR_SSL_CLIENT_AUTH_CERT_NEEDED);
#[doc = "See [`cef_errorcode_t::ERR_TUNNEL_CONNECTION_FAILED`] for more documentation."]
pub const TUNNEL_CONNECTION_FAILED: Self = Self(cef_errorcode_t::ERR_TUNNEL_CONNECTION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_VERSION_OR_CIPHER_MISMATCH`] for more documentation."]
pub const SSL_VERSION_OR_CIPHER_MISMATCH: Self =
Self(cef_errorcode_t::ERR_SSL_VERSION_OR_CIPHER_MISMATCH);
#[doc = "See [`cef_errorcode_t::ERR_SSL_RENEGOTIATION_REQUESTED`] for more documentation."]
pub const SSL_RENEGOTIATION_REQUESTED: Self =
Self(cef_errorcode_t::ERR_SSL_RENEGOTIATION_REQUESTED);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_AUTH_UNSUPPORTED`] for more documentation."]
pub const PROXY_AUTH_UNSUPPORTED: Self = Self(cef_errorcode_t::ERR_PROXY_AUTH_UNSUPPORTED);
#[doc = "See [`cef_errorcode_t::ERR_BAD_SSL_CLIENT_AUTH_CERT`] for more documentation."]
pub const BAD_SSL_CLIENT_AUTH_CERT: Self = Self(cef_errorcode_t::ERR_BAD_SSL_CLIENT_AUTH_CERT);
#[doc = "See [`cef_errorcode_t::ERR_CONNECTION_TIMED_OUT`] for more documentation."]
pub const CONNECTION_TIMED_OUT: Self = Self(cef_errorcode_t::ERR_CONNECTION_TIMED_OUT);
#[doc = "See [`cef_errorcode_t::ERR_HOST_RESOLVER_QUEUE_TOO_LARGE`] for more documentation."]
pub const HOST_RESOLVER_QUEUE_TOO_LARGE: Self =
Self(cef_errorcode_t::ERR_HOST_RESOLVER_QUEUE_TOO_LARGE);
#[doc = "See [`cef_errorcode_t::ERR_SOCKS_CONNECTION_FAILED`] for more documentation."]
pub const SOCKS_CONNECTION_FAILED: Self = Self(cef_errorcode_t::ERR_SOCKS_CONNECTION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_SOCKS_CONNECTION_HOST_UNREACHABLE`] for more documentation."]
pub const SOCKS_CONNECTION_HOST_UNREACHABLE: Self =
Self(cef_errorcode_t::ERR_SOCKS_CONNECTION_HOST_UNREACHABLE);
#[doc = "See [`cef_errorcode_t::ERR_ALPN_NEGOTIATION_FAILED`] for more documentation."]
pub const ALPN_NEGOTIATION_FAILED: Self = Self(cef_errorcode_t::ERR_ALPN_NEGOTIATION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_NO_RENEGOTIATION`] for more documentation."]
pub const SSL_NO_RENEGOTIATION: Self = Self(cef_errorcode_t::ERR_SSL_NO_RENEGOTIATION);
#[doc = "See [`cef_errorcode_t::ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES`] for more documentation."]
pub const WINSOCK_UNEXPECTED_WRITTEN_BYTES: Self =
Self(cef_errorcode_t::ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES);
#[doc = "See [`cef_errorcode_t::ERR_SSL_DECOMPRESSION_FAILURE_ALERT`] for more documentation."]
pub const SSL_DECOMPRESSION_FAILURE_ALERT: Self =
Self(cef_errorcode_t::ERR_SSL_DECOMPRESSION_FAILURE_ALERT);
#[doc = "See [`cef_errorcode_t::ERR_SSL_BAD_RECORD_MAC_ALERT`] for more documentation."]
pub const SSL_BAD_RECORD_MAC_ALERT: Self = Self(cef_errorcode_t::ERR_SSL_BAD_RECORD_MAC_ALERT);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_AUTH_REQUESTED`] for more documentation."]
pub const PROXY_AUTH_REQUESTED: Self = Self(cef_errorcode_t::ERR_PROXY_AUTH_REQUESTED);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_CONNECTION_FAILED`] for more documentation."]
pub const PROXY_CONNECTION_FAILED: Self = Self(cef_errorcode_t::ERR_PROXY_CONNECTION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_MANDATORY_PROXY_CONFIGURATION_FAILED`] for more documentation."]
pub const MANDATORY_PROXY_CONFIGURATION_FAILED: Self =
Self(cef_errorcode_t::ERR_MANDATORY_PROXY_CONFIGURATION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_PRECONNECT_MAX_SOCKET_LIMIT`] for more documentation."]
pub const PRECONNECT_MAX_SOCKET_LIMIT: Self =
Self(cef_errorcode_t::ERR_PRECONNECT_MAX_SOCKET_LIMIT);
#[doc = "See [`cef_errorcode_t::ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED`] for more documentation."]
pub const SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED: Self =
Self(cef_errorcode_t::ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY`] for more documentation."]
pub const SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY: Self =
Self(cef_errorcode_t::ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_CERTIFICATE_INVALID`] for more documentation."]
pub const PROXY_CERTIFICATE_INVALID: Self =
Self(cef_errorcode_t::ERR_PROXY_CERTIFICATE_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_NAME_RESOLUTION_FAILED`] for more documentation."]
pub const NAME_RESOLUTION_FAILED: Self = Self(cef_errorcode_t::ERR_NAME_RESOLUTION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_NETWORK_ACCESS_DENIED`] for more documentation."]
pub const NETWORK_ACCESS_DENIED: Self = Self(cef_errorcode_t::ERR_NETWORK_ACCESS_DENIED);
#[doc = "See [`cef_errorcode_t::ERR_TEMPORARILY_THROTTLED`] for more documentation."]
pub const TEMPORARILY_THROTTLED: Self = Self(cef_errorcode_t::ERR_TEMPORARILY_THROTTLED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED`] for more documentation."]
pub const SSL_CLIENT_AUTH_SIGNATURE_FAILED: Self =
Self(cef_errorcode_t::ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_MSG_TOO_BIG`] for more documentation."]
pub const MSG_TOO_BIG: Self = Self(cef_errorcode_t::ERR_MSG_TOO_BIG);
#[doc = "See [`cef_errorcode_t::ERR_WS_PROTOCOL_ERROR`] for more documentation."]
pub const WS_PROTOCOL_ERROR: Self = Self(cef_errorcode_t::ERR_WS_PROTOCOL_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_ADDRESS_IN_USE`] for more documentation."]
pub const ADDRESS_IN_USE: Self = Self(cef_errorcode_t::ERR_ADDRESS_IN_USE);
#[doc = "See [`cef_errorcode_t::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN`] for more documentation."]
pub const SSL_PINNED_KEY_NOT_IN_CERT_CHAIN: Self =
Self(cef_errorcode_t::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN);
#[doc = "See [`cef_errorcode_t::ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED`] for more documentation."]
pub const CLIENT_AUTH_CERT_TYPE_UNSUPPORTED: Self =
Self(cef_errorcode_t::ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_DECRYPT_ERROR_ALERT`] for more documentation."]
pub const SSL_DECRYPT_ERROR_ALERT: Self = Self(cef_errorcode_t::ERR_SSL_DECRYPT_ERROR_ALERT);
#[doc = "See [`cef_errorcode_t::ERR_WS_THROTTLE_QUEUE_TOO_LARGE`] for more documentation."]
pub const WS_THROTTLE_QUEUE_TOO_LARGE: Self =
Self(cef_errorcode_t::ERR_WS_THROTTLE_QUEUE_TOO_LARGE);
#[doc = "See [`cef_errorcode_t::ERR_SSL_SERVER_CERT_CHANGED`] for more documentation."]
pub const SSL_SERVER_CERT_CHANGED: Self = Self(cef_errorcode_t::ERR_SSL_SERVER_CERT_CHANGED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_UNRECOGNIZED_NAME_ALERT`] for more documentation."]
pub const SSL_UNRECOGNIZED_NAME_ALERT: Self =
Self(cef_errorcode_t::ERR_SSL_UNRECOGNIZED_NAME_ALERT);
#[doc = "See [`cef_errorcode_t::ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR`] for more documentation."]
pub const SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR: Self =
Self(cef_errorcode_t::ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR`] for more documentation."]
pub const SOCKET_SET_SEND_BUFFER_SIZE_ERROR: Self =
Self(cef_errorcode_t::ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE`] for more documentation."]
pub const SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE: Self =
Self(cef_errorcode_t::ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE);
#[doc = "See [`cef_errorcode_t::ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE`] for more documentation."]
pub const SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE: Self =
Self(cef_errorcode_t::ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE);
#[doc = "See [`cef_errorcode_t::ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT`] for more documentation."]
pub const SSL_CLIENT_AUTH_CERT_BAD_FORMAT: Self =
Self(cef_errorcode_t::ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT);
#[doc = "See [`cef_errorcode_t::ERR_ICANN_NAME_COLLISION`] for more documentation."]
pub const ICANN_NAME_COLLISION: Self = Self(cef_errorcode_t::ERR_ICANN_NAME_COLLISION);
#[doc = "See [`cef_errorcode_t::ERR_SSL_SERVER_CERT_BAD_FORMAT`] for more documentation."]
pub const SSL_SERVER_CERT_BAD_FORMAT: Self =
Self(cef_errorcode_t::ERR_SSL_SERVER_CERT_BAD_FORMAT);
#[doc = "See [`cef_errorcode_t::ERR_CT_STH_PARSING_FAILED`] for more documentation."]
pub const CT_STH_PARSING_FAILED: Self = Self(cef_errorcode_t::ERR_CT_STH_PARSING_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_CT_STH_INCOMPLETE`] for more documentation."]
pub const CT_STH_INCOMPLETE: Self = Self(cef_errorcode_t::ERR_CT_STH_INCOMPLETE);
#[doc = "See [`cef_errorcode_t::ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH`] for more documentation."]
pub const UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH: Self =
Self(cef_errorcode_t::ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH);
#[doc = "See [`cef_errorcode_t::ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED`] for more documentation."]
pub const CT_CONSISTENCY_PROOF_PARSING_FAILED: Self =
Self(cef_errorcode_t::ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_OBSOLETE_CIPHER`] for more documentation."]
pub const SSL_OBSOLETE_CIPHER: Self = Self(cef_errorcode_t::ERR_SSL_OBSOLETE_CIPHER);
#[doc = "See [`cef_errorcode_t::ERR_WS_UPGRADE`] for more documentation."]
pub const WS_UPGRADE: Self = Self(cef_errorcode_t::ERR_WS_UPGRADE);
#[doc = "See [`cef_errorcode_t::ERR_READ_IF_READY_NOT_IMPLEMENTED`] for more documentation."]
pub const READ_IF_READY_NOT_IMPLEMENTED: Self =
Self(cef_errorcode_t::ERR_READ_IF_READY_NOT_IMPLEMENTED);
#[doc = "See [`cef_errorcode_t::ERR_NO_BUFFER_SPACE`] for more documentation."]
pub const NO_BUFFER_SPACE: Self = Self(cef_errorcode_t::ERR_NO_BUFFER_SPACE);
#[doc = "See [`cef_errorcode_t::ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS`] for more documentation."]
pub const SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS: Self =
Self(cef_errorcode_t::ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS);
#[doc = "See [`cef_errorcode_t::ERR_EARLY_DATA_REJECTED`] for more documentation."]
pub const EARLY_DATA_REJECTED: Self = Self(cef_errorcode_t::ERR_EARLY_DATA_REJECTED);
#[doc = "See [`cef_errorcode_t::ERR_WRONG_VERSION_ON_EARLY_DATA`] for more documentation."]
pub const WRONG_VERSION_ON_EARLY_DATA: Self =
Self(cef_errorcode_t::ERR_WRONG_VERSION_ON_EARLY_DATA);
#[doc = "See [`cef_errorcode_t::ERR_TLS13_DOWNGRADE_DETECTED`] for more documentation."]
pub const TLS13_DOWNGRADE_DETECTED: Self = Self(cef_errorcode_t::ERR_TLS13_DOWNGRADE_DETECTED);
#[doc = "See [`cef_errorcode_t::ERR_SSL_KEY_USAGE_INCOMPATIBLE`] for more documentation."]
pub const SSL_KEY_USAGE_INCOMPATIBLE: Self =
Self(cef_errorcode_t::ERR_SSL_KEY_USAGE_INCOMPATIBLE);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_ECH_CONFIG_LIST`] for more documentation."]
pub const INVALID_ECH_CONFIG_LIST: Self = Self(cef_errorcode_t::ERR_INVALID_ECH_CONFIG_LIST);
#[doc = "See [`cef_errorcode_t::ERR_ECH_NOT_NEGOTIATED`] for more documentation."]
pub const ECH_NOT_NEGOTIATED: Self = Self(cef_errorcode_t::ERR_ECH_NOT_NEGOTIATED);
#[doc = "See [`cef_errorcode_t::ERR_ECH_FALLBACK_CERTIFICATE_INVALID`] for more documentation."]
pub const ECH_FALLBACK_CERTIFICATE_INVALID: Self =
Self(cef_errorcode_t::ERR_ECH_FALLBACK_CERTIFICATE_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_UNABLE_TO_CONNECT_TO_DESTINATION`] for more documentation."]
pub const PROXY_UNABLE_TO_CONNECT_TO_DESTINATION: Self =
Self(cef_errorcode_t::ERR_PROXY_UNABLE_TO_CONNECT_TO_DESTINATION);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_DELEGATE_CANCELED_CONNECT_REQUEST`] for more documentation."]
pub const PROXY_DELEGATE_CANCELED_CONNECT_REQUEST: Self =
Self(cef_errorcode_t::ERR_PROXY_DELEGATE_CANCELED_CONNECT_REQUEST);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_DELEGATE_CANCELED_CONNECT_RESPONSE`] for more documentation."]
pub const PROXY_DELEGATE_CANCELED_CONNECT_RESPONSE: Self =
Self(cef_errorcode_t::ERR_PROXY_DELEGATE_CANCELED_CONNECT_RESPONSE);
#[doc = "See [`cef_errorcode_t::ERR_CERT_COMMON_NAME_INVALID`] for more documentation."]
pub const CERT_COMMON_NAME_INVALID: Self = Self(cef_errorcode_t::ERR_CERT_COMMON_NAME_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_CERT_DATE_INVALID`] for more documentation."]
pub const CERT_DATE_INVALID: Self = Self(cef_errorcode_t::ERR_CERT_DATE_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_CERT_AUTHORITY_INVALID`] for more documentation."]
pub const CERT_AUTHORITY_INVALID: Self = Self(cef_errorcode_t::ERR_CERT_AUTHORITY_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_CERT_CONTAINS_ERRORS`] for more documentation."]
pub const CERT_CONTAINS_ERRORS: Self = Self(cef_errorcode_t::ERR_CERT_CONTAINS_ERRORS);
#[doc = "See [`cef_errorcode_t::ERR_CERT_NO_REVOCATION_MECHANISM`] for more documentation."]
pub const CERT_NO_REVOCATION_MECHANISM: Self =
Self(cef_errorcode_t::ERR_CERT_NO_REVOCATION_MECHANISM);
#[doc = "See [`cef_errorcode_t::ERR_CERT_UNABLE_TO_CHECK_REVOCATION`] for more documentation."]
pub const CERT_UNABLE_TO_CHECK_REVOCATION: Self =
Self(cef_errorcode_t::ERR_CERT_UNABLE_TO_CHECK_REVOCATION);
#[doc = "See [`cef_errorcode_t::ERR_CERT_REVOKED`] for more documentation."]
pub const CERT_REVOKED: Self = Self(cef_errorcode_t::ERR_CERT_REVOKED);
#[doc = "See [`cef_errorcode_t::ERR_CERT_INVALID`] for more documentation."]
pub const CERT_INVALID: Self = Self(cef_errorcode_t::ERR_CERT_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_CERT_WEAK_SIGNATURE_ALGORITHM`] for more documentation."]
pub const CERT_WEAK_SIGNATURE_ALGORITHM: Self =
Self(cef_errorcode_t::ERR_CERT_WEAK_SIGNATURE_ALGORITHM);
#[doc = "See [`cef_errorcode_t::ERR_CERT_NON_UNIQUE_NAME`] for more documentation."]
pub const CERT_NON_UNIQUE_NAME: Self = Self(cef_errorcode_t::ERR_CERT_NON_UNIQUE_NAME);
#[doc = "See [`cef_errorcode_t::ERR_CERT_WEAK_KEY`] for more documentation."]
pub const CERT_WEAK_KEY: Self = Self(cef_errorcode_t::ERR_CERT_WEAK_KEY);
#[doc = "See [`cef_errorcode_t::ERR_CERT_NAME_CONSTRAINT_VIOLATION`] for more documentation."]
pub const CERT_NAME_CONSTRAINT_VIOLATION: Self =
Self(cef_errorcode_t::ERR_CERT_NAME_CONSTRAINT_VIOLATION);
#[doc = "See [`cef_errorcode_t::ERR_CERT_VALIDITY_TOO_LONG`] for more documentation."]
pub const CERT_VALIDITY_TOO_LONG: Self = Self(cef_errorcode_t::ERR_CERT_VALIDITY_TOO_LONG);
#[doc = "See [`cef_errorcode_t::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED`] for more documentation."]
pub const CERTIFICATE_TRANSPARENCY_REQUIRED: Self =
Self(cef_errorcode_t::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED);
#[doc = "See [`cef_errorcode_t::ERR_CERT_KNOWN_INTERCEPTION_BLOCKED`] for more documentation."]
pub const CERT_KNOWN_INTERCEPTION_BLOCKED: Self =
Self(cef_errorcode_t::ERR_CERT_KNOWN_INTERCEPTION_BLOCKED);
#[doc = "See [`cef_errorcode_t::ERR_CERT_SELF_SIGNED_LOCAL_NETWORK`] for more documentation."]
pub const CERT_SELF_SIGNED_LOCAL_NETWORK: Self =
Self(cef_errorcode_t::ERR_CERT_SELF_SIGNED_LOCAL_NETWORK);
#[doc = "See [`cef_errorcode_t::ERR_CERT_END`] for more documentation."]
pub const CERT_END: Self = Self(cef_errorcode_t::ERR_CERT_END);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_URL`] for more documentation."]
pub const INVALID_URL: Self = Self(cef_errorcode_t::ERR_INVALID_URL);
#[doc = "See [`cef_errorcode_t::ERR_DISALLOWED_URL_SCHEME`] for more documentation."]
pub const DISALLOWED_URL_SCHEME: Self = Self(cef_errorcode_t::ERR_DISALLOWED_URL_SCHEME);
#[doc = "See [`cef_errorcode_t::ERR_UNKNOWN_URL_SCHEME`] for more documentation."]
pub const UNKNOWN_URL_SCHEME: Self = Self(cef_errorcode_t::ERR_UNKNOWN_URL_SCHEME);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_REDIRECT`] for more documentation."]
pub const INVALID_REDIRECT: Self = Self(cef_errorcode_t::ERR_INVALID_REDIRECT);
#[doc = "See [`cef_errorcode_t::ERR_TOO_MANY_REDIRECTS`] for more documentation."]
pub const TOO_MANY_REDIRECTS: Self = Self(cef_errorcode_t::ERR_TOO_MANY_REDIRECTS);
#[doc = "See [`cef_errorcode_t::ERR_UNSAFE_REDIRECT`] for more documentation."]
pub const UNSAFE_REDIRECT: Self = Self(cef_errorcode_t::ERR_UNSAFE_REDIRECT);
#[doc = "See [`cef_errorcode_t::ERR_UNSAFE_PORT`] for more documentation."]
pub const UNSAFE_PORT: Self = Self(cef_errorcode_t::ERR_UNSAFE_PORT);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_RESPONSE`] for more documentation."]
pub const INVALID_RESPONSE: Self = Self(cef_errorcode_t::ERR_INVALID_RESPONSE);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_CHUNKED_ENCODING`] for more documentation."]
pub const INVALID_CHUNKED_ENCODING: Self = Self(cef_errorcode_t::ERR_INVALID_CHUNKED_ENCODING);
#[doc = "See [`cef_errorcode_t::ERR_METHOD_NOT_SUPPORTED`] for more documentation."]
pub const METHOD_NOT_SUPPORTED: Self = Self(cef_errorcode_t::ERR_METHOD_NOT_SUPPORTED);
#[doc = "See [`cef_errorcode_t::ERR_UNEXPECTED_PROXY_AUTH`] for more documentation."]
pub const UNEXPECTED_PROXY_AUTH: Self = Self(cef_errorcode_t::ERR_UNEXPECTED_PROXY_AUTH);
#[doc = "See [`cef_errorcode_t::ERR_EMPTY_RESPONSE`] for more documentation."]
pub const EMPTY_RESPONSE: Self = Self(cef_errorcode_t::ERR_EMPTY_RESPONSE);
#[doc = "See [`cef_errorcode_t::ERR_RESPONSE_HEADERS_TOO_BIG`] for more documentation."]
pub const RESPONSE_HEADERS_TOO_BIG: Self = Self(cef_errorcode_t::ERR_RESPONSE_HEADERS_TOO_BIG);
#[doc = "See [`cef_errorcode_t::ERR_PAC_SCRIPT_FAILED`] for more documentation."]
pub const PAC_SCRIPT_FAILED: Self = Self(cef_errorcode_t::ERR_PAC_SCRIPT_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_REQUEST_RANGE_NOT_SATISFIABLE`] for more documentation."]
pub const REQUEST_RANGE_NOT_SATISFIABLE: Self =
Self(cef_errorcode_t::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
#[doc = "See [`cef_errorcode_t::ERR_MALFORMED_IDENTITY`] for more documentation."]
pub const MALFORMED_IDENTITY: Self = Self(cef_errorcode_t::ERR_MALFORMED_IDENTITY);
#[doc = "See [`cef_errorcode_t::ERR_CONTENT_DECODING_FAILED`] for more documentation."]
pub const CONTENT_DECODING_FAILED: Self = Self(cef_errorcode_t::ERR_CONTENT_DECODING_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_NETWORK_IO_SUSPENDED`] for more documentation."]
pub const NETWORK_IO_SUSPENDED: Self = Self(cef_errorcode_t::ERR_NETWORK_IO_SUSPENDED);
#[doc = "See [`cef_errorcode_t::ERR_NO_SUPPORTED_PROXIES`] for more documentation."]
pub const NO_SUPPORTED_PROXIES: Self = Self(cef_errorcode_t::ERR_NO_SUPPORTED_PROXIES);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_PROTOCOL_ERROR`] for more documentation."]
pub const HTTP2_PROTOCOL_ERROR: Self = Self(cef_errorcode_t::ERR_HTTP2_PROTOCOL_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_AUTH_CREDENTIALS`] for more documentation."]
pub const INVALID_AUTH_CREDENTIALS: Self = Self(cef_errorcode_t::ERR_INVALID_AUTH_CREDENTIALS);
#[doc = "See [`cef_errorcode_t::ERR_UNSUPPORTED_AUTH_SCHEME`] for more documentation."]
pub const UNSUPPORTED_AUTH_SCHEME: Self = Self(cef_errorcode_t::ERR_UNSUPPORTED_AUTH_SCHEME);
#[doc = "See [`cef_errorcode_t::ERR_ENCODING_DETECTION_FAILED`] for more documentation."]
pub const ENCODING_DETECTION_FAILED: Self =
Self(cef_errorcode_t::ERR_ENCODING_DETECTION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_MISSING_AUTH_CREDENTIALS`] for more documentation."]
pub const MISSING_AUTH_CREDENTIALS: Self = Self(cef_errorcode_t::ERR_MISSING_AUTH_CREDENTIALS);
#[doc = "See [`cef_errorcode_t::ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS`] for more documentation."]
pub const UNEXPECTED_SECURITY_LIBRARY_STATUS: Self =
Self(cef_errorcode_t::ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS);
#[doc = "See [`cef_errorcode_t::ERR_MISCONFIGURED_AUTH_ENVIRONMENT`] for more documentation."]
pub const MISCONFIGURED_AUTH_ENVIRONMENT: Self =
Self(cef_errorcode_t::ERR_MISCONFIGURED_AUTH_ENVIRONMENT);
#[doc = "See [`cef_errorcode_t::ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS`] for more documentation."]
pub const UNDOCUMENTED_SECURITY_LIBRARY_STATUS: Self =
Self(cef_errorcode_t::ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS);
#[doc = "See [`cef_errorcode_t::ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN`] for more documentation."]
pub const RESPONSE_BODY_TOO_BIG_TO_DRAIN: Self =
Self(cef_errorcode_t::ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN);
#[doc = "See [`cef_errorcode_t::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH`] for more documentation."]
pub const RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH: Self =
Self(cef_errorcode_t::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH);
#[doc = "See [`cef_errorcode_t::ERR_INCOMPLETE_HTTP2_HEADERS`] for more documentation."]
pub const INCOMPLETE_HTTP2_HEADERS: Self = Self(cef_errorcode_t::ERR_INCOMPLETE_HTTP2_HEADERS);
#[doc = "See [`cef_errorcode_t::ERR_PAC_NOT_IN_DHCP`] for more documentation."]
pub const PAC_NOT_IN_DHCP: Self = Self(cef_errorcode_t::ERR_PAC_NOT_IN_DHCP);
#[doc = "See [`cef_errorcode_t::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION`] for more documentation."]
pub const RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION: Self =
Self(cef_errorcode_t::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION);
#[doc = "See [`cef_errorcode_t::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION`] for more documentation."]
pub const RESPONSE_HEADERS_MULTIPLE_LOCATION: Self =
Self(cef_errorcode_t::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_SERVER_REFUSED_STREAM`] for more documentation."]
pub const HTTP2_SERVER_REFUSED_STREAM: Self =
Self(cef_errorcode_t::ERR_HTTP2_SERVER_REFUSED_STREAM);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_PING_FAILED`] for more documentation."]
pub const HTTP2_PING_FAILED: Self = Self(cef_errorcode_t::ERR_HTTP2_PING_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_CONTENT_LENGTH_MISMATCH`] for more documentation."]
pub const CONTENT_LENGTH_MISMATCH: Self = Self(cef_errorcode_t::ERR_CONTENT_LENGTH_MISMATCH);
#[doc = "See [`cef_errorcode_t::ERR_INCOMPLETE_CHUNKED_ENCODING`] for more documentation."]
pub const INCOMPLETE_CHUNKED_ENCODING: Self =
Self(cef_errorcode_t::ERR_INCOMPLETE_CHUNKED_ENCODING);
#[doc = "See [`cef_errorcode_t::ERR_QUIC_PROTOCOL_ERROR`] for more documentation."]
pub const QUIC_PROTOCOL_ERROR: Self = Self(cef_errorcode_t::ERR_QUIC_PROTOCOL_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_RESPONSE_HEADERS_TRUNCATED`] for more documentation."]
pub const RESPONSE_HEADERS_TRUNCATED: Self =
Self(cef_errorcode_t::ERR_RESPONSE_HEADERS_TRUNCATED);
#[doc = "See [`cef_errorcode_t::ERR_QUIC_HANDSHAKE_FAILED`] for more documentation."]
pub const QUIC_HANDSHAKE_FAILED: Self = Self(cef_errorcode_t::ERR_QUIC_HANDSHAKE_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY`] for more documentation."]
pub const HTTP2_INADEQUATE_TRANSPORT_SECURITY: Self =
Self(cef_errorcode_t::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_FLOW_CONTROL_ERROR`] for more documentation."]
pub const HTTP2_FLOW_CONTROL_ERROR: Self = Self(cef_errorcode_t::ERR_HTTP2_FLOW_CONTROL_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_FRAME_SIZE_ERROR`] for more documentation."]
pub const HTTP2_FRAME_SIZE_ERROR: Self = Self(cef_errorcode_t::ERR_HTTP2_FRAME_SIZE_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_COMPRESSION_ERROR`] for more documentation."]
pub const HTTP2_COMPRESSION_ERROR: Self = Self(cef_errorcode_t::ERR_HTTP2_COMPRESSION_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION`] for more documentation."]
pub const PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION: Self =
Self(cef_errorcode_t::ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION);
#[doc = "See [`cef_errorcode_t::ERR_HTTP_1_1_REQUIRED`] for more documentation."]
pub const HTTP_1_1_REQUIRED: Self = Self(cef_errorcode_t::ERR_HTTP_1_1_REQUIRED);
#[doc = "See [`cef_errorcode_t::ERR_PROXY_HTTP_1_1_REQUIRED`] for more documentation."]
pub const PROXY_HTTP_1_1_REQUIRED: Self = Self(cef_errorcode_t::ERR_PROXY_HTTP_1_1_REQUIRED);
#[doc = "See [`cef_errorcode_t::ERR_PAC_SCRIPT_TERMINATED`] for more documentation."]
pub const PAC_SCRIPT_TERMINATED: Self = Self(cef_errorcode_t::ERR_PAC_SCRIPT_TERMINATED);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_HTTP_RESPONSE`] for more documentation."]
pub const INVALID_HTTP_RESPONSE: Self = Self(cef_errorcode_t::ERR_INVALID_HTTP_RESPONSE);
#[doc = "See [`cef_errorcode_t::ERR_CONTENT_DECODING_INIT_FAILED`] for more documentation."]
pub const CONTENT_DECODING_INIT_FAILED: Self =
Self(cef_errorcode_t::ERR_CONTENT_DECODING_INIT_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED`] for more documentation."]
pub const HTTP2_RST_STREAM_NO_ERROR_RECEIVED: Self =
Self(cef_errorcode_t::ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED);
#[doc = "See [`cef_errorcode_t::ERR_TOO_MANY_RETRIES`] for more documentation."]
pub const TOO_MANY_RETRIES: Self = Self(cef_errorcode_t::ERR_TOO_MANY_RETRIES);
#[doc = "See [`cef_errorcode_t::ERR_HTTP2_STREAM_CLOSED`] for more documentation."]
pub const HTTP2_STREAM_CLOSED: Self = Self(cef_errorcode_t::ERR_HTTP2_STREAM_CLOSED);
#[doc = "See [`cef_errorcode_t::ERR_HTTP_RESPONSE_CODE_FAILURE`] for more documentation."]
pub const HTTP_RESPONSE_CODE_FAILURE: Self =
Self(cef_errorcode_t::ERR_HTTP_RESPONSE_CODE_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_QUIC_CERT_ROOT_NOT_KNOWN`] for more documentation."]
pub const QUIC_CERT_ROOT_NOT_KNOWN: Self = Self(cef_errorcode_t::ERR_QUIC_CERT_ROOT_NOT_KNOWN);
#[doc = "See [`cef_errorcode_t::ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED`] for more documentation."]
pub const QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED: Self =
Self(cef_errorcode_t::ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED);
#[doc = "See [`cef_errorcode_t::ERR_TOO_MANY_ACCEPT_CH_RESTARTS`] for more documentation."]
pub const TOO_MANY_ACCEPT_CH_RESTARTS: Self =
Self(cef_errorcode_t::ERR_TOO_MANY_ACCEPT_CH_RESTARTS);
#[doc = "See [`cef_errorcode_t::ERR_INCONSISTENT_IP_ADDRESS_SPACE`] for more documentation."]
pub const INCONSISTENT_IP_ADDRESS_SPACE: Self =
Self(cef_errorcode_t::ERR_INCONSISTENT_IP_ADDRESS_SPACE);
#[doc = "See [`cef_errorcode_t::ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY`] for more documentation."]
pub const CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY: Self =
Self(cef_errorcode_t::ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY);
#[doc = "See [`cef_errorcode_t::ERR_BLOCKED_BY_LOCAL_NETWORK_ACCESS_CHECKS`] for more documentation."]
pub const BLOCKED_BY_LOCAL_NETWORK_ACCESS_CHECKS: Self =
Self(cef_errorcode_t::ERR_BLOCKED_BY_LOCAL_NETWORK_ACCESS_CHECKS);
#[doc = "See [`cef_errorcode_t::ERR_ZSTD_WINDOW_SIZE_TOO_BIG`] for more documentation."]
pub const ZSTD_WINDOW_SIZE_TOO_BIG: Self = Self(cef_errorcode_t::ERR_ZSTD_WINDOW_SIZE_TOO_BIG);
#[doc = "See [`cef_errorcode_t::ERR_DICTIONARY_LOAD_FAILED`] for more documentation."]
pub const DICTIONARY_LOAD_FAILED: Self = Self(cef_errorcode_t::ERR_DICTIONARY_LOAD_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_UNEXPECTED_CONTENT_DICTIONARY_HEADER`] for more documentation."]
pub const UNEXPECTED_CONTENT_DICTIONARY_HEADER: Self =
Self(cef_errorcode_t::ERR_UNEXPECTED_CONTENT_DICTIONARY_HEADER);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_MISS`] for more documentation."]
pub const CACHE_MISS: Self = Self(cef_errorcode_t::ERR_CACHE_MISS);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_READ_FAILURE`] for more documentation."]
pub const CACHE_READ_FAILURE: Self = Self(cef_errorcode_t::ERR_CACHE_READ_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_WRITE_FAILURE`] for more documentation."]
pub const CACHE_WRITE_FAILURE: Self = Self(cef_errorcode_t::ERR_CACHE_WRITE_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_OPERATION_NOT_SUPPORTED`] for more documentation."]
pub const CACHE_OPERATION_NOT_SUPPORTED: Self =
Self(cef_errorcode_t::ERR_CACHE_OPERATION_NOT_SUPPORTED);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_OPEN_FAILURE`] for more documentation."]
pub const CACHE_OPEN_FAILURE: Self = Self(cef_errorcode_t::ERR_CACHE_OPEN_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_CREATE_FAILURE`] for more documentation."]
pub const CACHE_CREATE_FAILURE: Self = Self(cef_errorcode_t::ERR_CACHE_CREATE_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_RACE`] for more documentation."]
pub const CACHE_RACE: Self = Self(cef_errorcode_t::ERR_CACHE_RACE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_CHECKSUM_READ_FAILURE`] for more documentation."]
pub const CACHE_CHECKSUM_READ_FAILURE: Self =
Self(cef_errorcode_t::ERR_CACHE_CHECKSUM_READ_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_CHECKSUM_MISMATCH`] for more documentation."]
pub const CACHE_CHECKSUM_MISMATCH: Self = Self(cef_errorcode_t::ERR_CACHE_CHECKSUM_MISMATCH);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_LOCK_TIMEOUT`] for more documentation."]
pub const CACHE_LOCK_TIMEOUT: Self = Self(cef_errorcode_t::ERR_CACHE_LOCK_TIMEOUT);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_AUTH_FAILURE_AFTER_READ`] for more documentation."]
pub const CACHE_AUTH_FAILURE_AFTER_READ: Self =
Self(cef_errorcode_t::ERR_CACHE_AUTH_FAILURE_AFTER_READ);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_ENTRY_NOT_SUITABLE`] for more documentation."]
pub const CACHE_ENTRY_NOT_SUITABLE: Self = Self(cef_errorcode_t::ERR_CACHE_ENTRY_NOT_SUITABLE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_DOOM_FAILURE`] for more documentation."]
pub const CACHE_DOOM_FAILURE: Self = Self(cef_errorcode_t::ERR_CACHE_DOOM_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_CACHE_OPEN_OR_CREATE_FAILURE`] for more documentation."]
pub const CACHE_OPEN_OR_CREATE_FAILURE: Self =
Self(cef_errorcode_t::ERR_CACHE_OPEN_OR_CREATE_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_INSECURE_RESPONSE`] for more documentation."]
pub const INSECURE_RESPONSE: Self = Self(cef_errorcode_t::ERR_INSECURE_RESPONSE);
#[doc = "See [`cef_errorcode_t::ERR_NO_PRIVATE_KEY_FOR_CERT`] for more documentation."]
pub const NO_PRIVATE_KEY_FOR_CERT: Self = Self(cef_errorcode_t::ERR_NO_PRIVATE_KEY_FOR_CERT);
#[doc = "See [`cef_errorcode_t::ERR_ADD_USER_CERT_FAILED`] for more documentation."]
pub const ADD_USER_CERT_FAILED: Self = Self(cef_errorcode_t::ERR_ADD_USER_CERT_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_SIGNED_EXCHANGE`] for more documentation."]
pub const INVALID_SIGNED_EXCHANGE: Self = Self(cef_errorcode_t::ERR_INVALID_SIGNED_EXCHANGE);
#[doc = "See [`cef_errorcode_t::ERR_INVALID_WEB_BUNDLE`] for more documentation."]
pub const INVALID_WEB_BUNDLE: Self = Self(cef_errorcode_t::ERR_INVALID_WEB_BUNDLE);
#[doc = "See [`cef_errorcode_t::ERR_TRUST_TOKEN_OPERATION_FAILED`] for more documentation."]
pub const TRUST_TOKEN_OPERATION_FAILED: Self =
Self(cef_errorcode_t::ERR_TRUST_TOKEN_OPERATION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST`] for more documentation."]
pub const TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST: Self =
Self(cef_errorcode_t::ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST);
#[doc = "See [`cef_errorcode_t::ERR_HTTPENGINE_PROVIDER_IN_USE`] for more documentation."]
pub const HTTPENGINE_PROVIDER_IN_USE: Self =
Self(cef_errorcode_t::ERR_HTTPENGINE_PROVIDER_IN_USE);
#[doc = "See [`cef_errorcode_t::ERR_PKCS12_IMPORT_BAD_PASSWORD`] for more documentation."]
pub const PKCS12_IMPORT_BAD_PASSWORD: Self =
Self(cef_errorcode_t::ERR_PKCS12_IMPORT_BAD_PASSWORD);
#[doc = "See [`cef_errorcode_t::ERR_PKCS12_IMPORT_FAILED`] for more documentation."]
pub const PKCS12_IMPORT_FAILED: Self = Self(cef_errorcode_t::ERR_PKCS12_IMPORT_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_IMPORT_CA_CERT_NOT_CA`] for more documentation."]
pub const IMPORT_CA_CERT_NOT_CA: Self = Self(cef_errorcode_t::ERR_IMPORT_CA_CERT_NOT_CA);
#[doc = "See [`cef_errorcode_t::ERR_IMPORT_CERT_ALREADY_EXISTS`] for more documentation."]
pub const IMPORT_CERT_ALREADY_EXISTS: Self =
Self(cef_errorcode_t::ERR_IMPORT_CERT_ALREADY_EXISTS);
#[doc = "See [`cef_errorcode_t::ERR_IMPORT_CA_CERT_FAILED`] for more documentation."]
pub const IMPORT_CA_CERT_FAILED: Self = Self(cef_errorcode_t::ERR_IMPORT_CA_CERT_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_IMPORT_SERVER_CERT_FAILED`] for more documentation."]
pub const IMPORT_SERVER_CERT_FAILED: Self =
Self(cef_errorcode_t::ERR_IMPORT_SERVER_CERT_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_PKCS12_IMPORT_INVALID_MAC`] for more documentation."]
pub const PKCS12_IMPORT_INVALID_MAC: Self =
Self(cef_errorcode_t::ERR_PKCS12_IMPORT_INVALID_MAC);
#[doc = "See [`cef_errorcode_t::ERR_PKCS12_IMPORT_INVALID_FILE`] for more documentation."]
pub const PKCS12_IMPORT_INVALID_FILE: Self =
Self(cef_errorcode_t::ERR_PKCS12_IMPORT_INVALID_FILE);
#[doc = "See [`cef_errorcode_t::ERR_PKCS12_IMPORT_UNSUPPORTED`] for more documentation."]
pub const PKCS12_IMPORT_UNSUPPORTED: Self =
Self(cef_errorcode_t::ERR_PKCS12_IMPORT_UNSUPPORTED);
#[doc = "See [`cef_errorcode_t::ERR_KEY_GENERATION_FAILED`] for more documentation."]
pub const KEY_GENERATION_FAILED: Self = Self(cef_errorcode_t::ERR_KEY_GENERATION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_PRIVATE_KEY_EXPORT_FAILED`] for more documentation."]
pub const PRIVATE_KEY_EXPORT_FAILED: Self =
Self(cef_errorcode_t::ERR_PRIVATE_KEY_EXPORT_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_SELF_SIGNED_CERT_GENERATION_FAILED`] for more documentation."]
pub const SELF_SIGNED_CERT_GENERATION_FAILED: Self =
Self(cef_errorcode_t::ERR_SELF_SIGNED_CERT_GENERATION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_CERT_DATABASE_CHANGED`] for more documentation."]
pub const CERT_DATABASE_CHANGED: Self = Self(cef_errorcode_t::ERR_CERT_DATABASE_CHANGED);
#[doc = "See [`cef_errorcode_t::ERR_CERT_VERIFIER_CHANGED`] for more documentation."]
pub const CERT_VERIFIER_CHANGED: Self = Self(cef_errorcode_t::ERR_CERT_VERIFIER_CHANGED);
#[doc = "See [`cef_errorcode_t::ERR_DNS_MALFORMED_RESPONSE`] for more documentation."]
pub const DNS_MALFORMED_RESPONSE: Self = Self(cef_errorcode_t::ERR_DNS_MALFORMED_RESPONSE);
#[doc = "See [`cef_errorcode_t::ERR_DNS_SERVER_REQUIRES_TCP`] for more documentation."]
pub const DNS_SERVER_REQUIRES_TCP: Self = Self(cef_errorcode_t::ERR_DNS_SERVER_REQUIRES_TCP);
#[doc = "See [`cef_errorcode_t::ERR_DNS_TIMED_OUT`] for more documentation."]
pub const DNS_TIMED_OUT: Self = Self(cef_errorcode_t::ERR_DNS_TIMED_OUT);
#[doc = "See [`cef_errorcode_t::ERR_DNS_CACHE_MISS`] for more documentation."]
pub const DNS_CACHE_MISS: Self = Self(cef_errorcode_t::ERR_DNS_CACHE_MISS);
#[doc = "See [`cef_errorcode_t::ERR_DNS_SEARCH_EMPTY`] for more documentation."]
pub const DNS_SEARCH_EMPTY: Self = Self(cef_errorcode_t::ERR_DNS_SEARCH_EMPTY);
#[doc = "See [`cef_errorcode_t::ERR_DNS_SORT_ERROR`] for more documentation."]
pub const DNS_SORT_ERROR: Self = Self(cef_errorcode_t::ERR_DNS_SORT_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED`] for more documentation."]
pub const DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED: Self =
Self(cef_errorcode_t::ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_DNS_NAME_HTTPS_ONLY`] for more documentation."]
pub const DNS_NAME_HTTPS_ONLY: Self = Self(cef_errorcode_t::ERR_DNS_NAME_HTTPS_ONLY);
#[doc = "See [`cef_errorcode_t::ERR_DNS_REQUEST_CANCELLED`] for more documentation."]
pub const DNS_REQUEST_CANCELLED: Self = Self(cef_errorcode_t::ERR_DNS_REQUEST_CANCELLED);
#[doc = "See [`cef_errorcode_t::ERR_DNS_NO_MATCHING_SUPPORTED_ALPN`] for more documentation."]
pub const DNS_NO_MATCHING_SUPPORTED_ALPN: Self =
Self(cef_errorcode_t::ERR_DNS_NO_MATCHING_SUPPORTED_ALPN);
#[doc = "See [`cef_errorcode_t::ERR_DNS_SECURE_PROBE_RECORD_INVALID`] for more documentation."]
pub const DNS_SECURE_PROBE_RECORD_INVALID: Self =
Self(cef_errorcode_t::ERR_DNS_SECURE_PROBE_RECORD_INVALID);
#[doc = "See [`cef_errorcode_t::ERR_DNS_CACHE_INVALIDATION_IN_PROGRESS`] for more documentation."]
pub const DNS_CACHE_INVALIDATION_IN_PROGRESS: Self =
Self(cef_errorcode_t::ERR_DNS_CACHE_INVALIDATION_IN_PROGRESS);
#[doc = "See [`cef_errorcode_t::ERR_DNS_FORMAT_ERROR`] for more documentation."]
pub const DNS_FORMAT_ERROR: Self = Self(cef_errorcode_t::ERR_DNS_FORMAT_ERROR);
#[doc = "See [`cef_errorcode_t::ERR_DNS_SERVER_FAILURE`] for more documentation."]
pub const DNS_SERVER_FAILURE: Self = Self(cef_errorcode_t::ERR_DNS_SERVER_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_DNS_NOT_IMPLEMENTED`] for more documentation."]
pub const DNS_NOT_IMPLEMENTED: Self = Self(cef_errorcode_t::ERR_DNS_NOT_IMPLEMENTED);
#[doc = "See [`cef_errorcode_t::ERR_DNS_REFUSED`] for more documentation."]
pub const DNS_REFUSED: Self = Self(cef_errorcode_t::ERR_DNS_REFUSED);
#[doc = "See [`cef_errorcode_t::ERR_DNS_OTHER_FAILURE`] for more documentation."]
pub const DNS_OTHER_FAILURE: Self = Self(cef_errorcode_t::ERR_DNS_OTHER_FAILURE);
#[doc = "See [`cef_errorcode_t::ERR_BLOB_INVALID_CONSTRUCTION_ARGUMENTS`] for more documentation."]
pub const BLOB_INVALID_CONSTRUCTION_ARGUMENTS: Self =
Self(cef_errorcode_t::ERR_BLOB_INVALID_CONSTRUCTION_ARGUMENTS);
#[doc = "See [`cef_errorcode_t::ERR_BLOB_OUT_OF_MEMORY`] for more documentation."]
pub const BLOB_OUT_OF_MEMORY: Self = Self(cef_errorcode_t::ERR_BLOB_OUT_OF_MEMORY);
#[doc = "See [`cef_errorcode_t::ERR_BLOB_FILE_WRITE_FAILED`] for more documentation."]
pub const BLOB_FILE_WRITE_FAILED: Self = Self(cef_errorcode_t::ERR_BLOB_FILE_WRITE_FAILED);
#[doc = "See [`cef_errorcode_t::ERR_BLOB_SOURCE_DIED_IN_TRANSIT`] for more documentation."]
pub const BLOB_SOURCE_DIED_IN_TRANSIT: Self =
Self(cef_errorcode_t::ERR_BLOB_SOURCE_DIED_IN_TRANSIT);
#[doc = "See [`cef_errorcode_t::ERR_BLOB_DEREFERENCED_WHILE_BUILDING`] for more documentation."]
pub const BLOB_DEREFERENCED_WHILE_BUILDING: Self =
Self(cef_errorcode_t::ERR_BLOB_DEREFERENCED_WHILE_BUILDING);
#[doc = "See [`cef_errorcode_t::ERR_BLOB_REFERENCED_BLOB_BROKEN`] for more documentation."]
pub const BLOB_REFERENCED_BLOB_BROKEN: Self =
Self(cef_errorcode_t::ERR_BLOB_REFERENCED_BLOB_BROKEN);
#[doc = "See [`cef_errorcode_t::ERR_BLOB_REFERENCED_FILE_UNAVAILABLE`] for more documentation."]
pub const BLOB_REFERENCED_FILE_UNAVAILABLE: Self =
Self(cef_errorcode_t::ERR_BLOB_REFERENCED_FILE_UNAVAILABLE);
}
impl Errorcode {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for Errorcode {
fn default() -> Self {
Self(cef_errorcode_t::ERR_NONE)
}
}
/// See [`cef_cert_status_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct CertStatus(cef_cert_status_t);
impl AsRef<cef_cert_status_t> for CertStatus {
fn as_ref(&self) -> &cef_cert_status_t {
&self.0
}
}
impl AsMut<cef_cert_status_t> for CertStatus {
fn as_mut(&mut self) -> &mut cef_cert_status_t {
&mut self.0
}
}
impl From<cef_cert_status_t> for CertStatus {
fn from(value: cef_cert_status_t) -> Self {
Self(value)
}
}
impl From<CertStatus> for cef_cert_status_t {
fn from(value: CertStatus) -> Self {
value.0
}
}
impl CertStatus {
#[doc = "See [`cef_cert_status_t::CERT_STATUS_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_cert_status_t::CERT_STATUS_NONE);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_COMMON_NAME_INVALID`] for more documentation."]
pub const COMMON_NAME_INVALID: Self = Self(cef_cert_status_t::CERT_STATUS_COMMON_NAME_INVALID);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_DATE_INVALID`] for more documentation."]
pub const DATE_INVALID: Self = Self(cef_cert_status_t::CERT_STATUS_DATE_INVALID);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_AUTHORITY_INVALID`] for more documentation."]
pub const AUTHORITY_INVALID: Self = Self(cef_cert_status_t::CERT_STATUS_AUTHORITY_INVALID);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_NO_REVOCATION_MECHANISM`] for more documentation."]
pub const NO_REVOCATION_MECHANISM: Self =
Self(cef_cert_status_t::CERT_STATUS_NO_REVOCATION_MECHANISM);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION`] for more documentation."]
pub const UNABLE_TO_CHECK_REVOCATION: Self =
Self(cef_cert_status_t::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_REVOKED`] for more documentation."]
pub const REVOKED: Self = Self(cef_cert_status_t::CERT_STATUS_REVOKED);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_INVALID`] for more documentation."]
pub const INVALID: Self = Self(cef_cert_status_t::CERT_STATUS_INVALID);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_WEAK_SIGNATURE_ALGORITHM`] for more documentation."]
pub const WEAK_SIGNATURE_ALGORITHM: Self =
Self(cef_cert_status_t::CERT_STATUS_WEAK_SIGNATURE_ALGORITHM);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_NON_UNIQUE_NAME`] for more documentation."]
pub const NON_UNIQUE_NAME: Self = Self(cef_cert_status_t::CERT_STATUS_NON_UNIQUE_NAME);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_WEAK_KEY`] for more documentation."]
pub const WEAK_KEY: Self = Self(cef_cert_status_t::CERT_STATUS_WEAK_KEY);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_PINNED_KEY_MISSING`] for more documentation."]
pub const PINNED_KEY_MISSING: Self = Self(cef_cert_status_t::CERT_STATUS_PINNED_KEY_MISSING);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_NAME_CONSTRAINT_VIOLATION`] for more documentation."]
pub const NAME_CONSTRAINT_VIOLATION: Self =
Self(cef_cert_status_t::CERT_STATUS_NAME_CONSTRAINT_VIOLATION);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_VALIDITY_TOO_LONG`] for more documentation."]
pub const VALIDITY_TOO_LONG: Self = Self(cef_cert_status_t::CERT_STATUS_VALIDITY_TOO_LONG);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_IS_EV`] for more documentation."]
pub const IS_EV: Self = Self(cef_cert_status_t::CERT_STATUS_IS_EV);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_REV_CHECKING_ENABLED`] for more documentation."]
pub const REV_CHECKING_ENABLED: Self =
Self(cef_cert_status_t::CERT_STATUS_REV_CHECKING_ENABLED);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_SHA1_SIGNATURE_PRESENT`] for more documentation."]
pub const SHA1_SIGNATURE_PRESENT: Self =
Self(cef_cert_status_t::CERT_STATUS_SHA1_SIGNATURE_PRESENT);
#[doc = "See [`cef_cert_status_t::CERT_STATUS_CT_COMPLIANCE_FAILED`] for more documentation."]
pub const CT_COMPLIANCE_FAILED: Self =
Self(cef_cert_status_t::CERT_STATUS_CT_COMPLIANCE_FAILED);
}
impl CertStatus {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for CertStatus {
fn default() -> Self {
Self(cef_cert_status_t::CERT_STATUS_NONE)
}
}
/// See [`cef_resultcode_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Resultcode(cef_resultcode_t);
impl AsRef<cef_resultcode_t> for Resultcode {
fn as_ref(&self) -> &cef_resultcode_t {
&self.0
}
}
impl AsMut<cef_resultcode_t> for Resultcode {
fn as_mut(&mut self) -> &mut cef_resultcode_t {
&mut self.0
}
}
impl From<cef_resultcode_t> for Resultcode {
fn from(value: cef_resultcode_t) -> Self {
Self(value)
}
}
impl From<Resultcode> for cef_resultcode_t {
fn from(value: Resultcode) -> Self {
value.0
}
}
impl Resultcode {
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT`] for more documentation."]
pub const NORMAL_EXIT: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_KILLED`] for more documentation."]
pub const KILLED: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_KILLED);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_HUNG`] for more documentation."]
pub const HUNG: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_HUNG);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_KILLED_BAD_MESSAGE`] for more documentation."]
pub const KILLED_BAD_MESSAGE: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_KILLED_BAD_MESSAGE);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_GPU_DEAD_ON_ARRIVAL`] for more documentation."]
pub const GPU_DEAD_ON_ARRIVAL: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_GPU_DEAD_ON_ARRIVAL);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_CHROME_FIRST`] for more documentation."]
pub const CHROME_FIRST: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_CHROME_FIRST);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_BAD_PROCESS_TYPE`] for more documentation."]
pub const BAD_PROCESS_TYPE: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_BAD_PROCESS_TYPE);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_MISSING_DATA`] for more documentation."]
pub const MISSING_DATA: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_MISSING_DATA);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_UNSUPPORTED_PARAM`] for more documentation."]
pub const UNSUPPORTED_PARAM: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_UNSUPPORTED_PARAM);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_PROFILE_IN_USE`] for more documentation."]
pub const PROFILE_IN_USE: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_PROFILE_IN_USE);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_PACK_EXTENSION_ERROR`] for more documentation."]
pub const PACK_EXTENSION_ERROR: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_PACK_EXTENSION_ERROR);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED`] for more documentation."]
pub const NORMAL_EXIT_PROCESS_NOTIFIED: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_INVALID_SANDBOX_STATE`] for more documentation."]
pub const INVALID_SANDBOX_STATE: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_INVALID_SANDBOX_STATE);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED`] for more documentation."]
pub const CLOUD_POLICY_ENROLLMENT_FAILED: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST`] for more documentation."]
pub const GPU_EXIT_ON_CONTEXT_LOST: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS`] for more documentation."]
pub const NORMAL_EXIT_PACK_EXTENSION_SUCCESS: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED`] for more documentation."]
pub const SYSTEM_RESOURCE_EXHAUSTED: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT_AUTO_DE_ELEVATED`] for more documentation."]
pub const NORMAL_EXIT_AUTO_DE_ELEVATED: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT_AUTO_DE_ELEVATED);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_TERMINATED_BY_OTHER_PROCESS_ON_COMMIT_FAILURE`] for more documentation."]
pub const TERMINATED_BY_OTHER_PROCESS_ON_COMMIT_FAILURE: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_TERMINATED_BY_OTHER_PROCESS_ON_COMMIT_FAILURE);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_INVALID_ISOLATED_BROWSER_PROCESS`] for more documentation."]
pub const INVALID_ISOLATED_BROWSER_PROCESS: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_INVALID_ISOLATED_BROWSER_PROCESS);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_CHROME_LAST`] for more documentation."]
pub const CHROME_LAST: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_CHROME_LAST);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_FIRST`] for more documentation."]
pub const SANDBOX_FATAL_FIRST: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_FIRST);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_DROPTOKEN`] for more documentation."]
pub const SANDBOX_FATAL_DROPTOKEN: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_DROPTOKEN);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_FLUSHANDLES`] for more documentation."]
pub const SANDBOX_FATAL_FLUSHANDLES: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_FLUSHANDLES);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_CACHEDISABLE`] for more documentation."]
pub const SANDBOX_FATAL_CACHEDISABLE: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_CACHEDISABLE);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_CLOSEHANDLES`] for more documentation."]
pub const SANDBOX_FATAL_CLOSEHANDLES: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_CLOSEHANDLES);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_MITIGATION`] for more documentation."]
pub const SANDBOX_FATAL_MITIGATION: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_MITIGATION);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_MEMORY_EXCEEDED`] for more documentation."]
pub const SANDBOX_FATAL_MEMORY_EXCEEDED: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_MEMORY_EXCEEDED);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_WARMUP`] for more documentation."]
pub const SANDBOX_FATAL_WARMUP: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_WARMUP);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_BROKER_SHUTDOWN_HUNG`] for more documentation."]
pub const SANDBOX_FATAL_BROKER_SHUTDOWN_HUNG: Self =
Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_BROKER_SHUTDOWN_HUNG);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_LAST`] for more documentation."]
pub const SANDBOX_FATAL_LAST: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_SANDBOX_FATAL_LAST);
#[doc = "See [`cef_resultcode_t::CEF_RESULT_CODE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_resultcode_t::CEF_RESULT_CODE_NUM_VALUES);
}
impl Resultcode {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for Resultcode {
fn default() -> Self {
Self(cef_resultcode_t::CEF_RESULT_CODE_NORMAL_EXIT)
}
}
/// See [`cef_window_open_disposition_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct WindowOpenDisposition(cef_window_open_disposition_t);
impl AsRef<cef_window_open_disposition_t> for WindowOpenDisposition {
fn as_ref(&self) -> &cef_window_open_disposition_t {
&self.0
}
}
impl AsMut<cef_window_open_disposition_t> for WindowOpenDisposition {
fn as_mut(&mut self) -> &mut cef_window_open_disposition_t {
&mut self.0
}
}
impl From<cef_window_open_disposition_t> for WindowOpenDisposition {
fn from(value: cef_window_open_disposition_t) -> Self {
Self(value)
}
}
impl From<WindowOpenDisposition> for cef_window_open_disposition_t {
fn from(value: WindowOpenDisposition) -> Self {
value.0
}
}
impl WindowOpenDisposition {
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_window_open_disposition_t::CEF_WOD_UNKNOWN);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_CURRENT_TAB`] for more documentation."]
pub const CURRENT_TAB: Self = Self(cef_window_open_disposition_t::CEF_WOD_CURRENT_TAB);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_SINGLETON_TAB`] for more documentation."]
pub const SINGLETON_TAB: Self = Self(cef_window_open_disposition_t::CEF_WOD_SINGLETON_TAB);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_NEW_FOREGROUND_TAB`] for more documentation."]
pub const NEW_FOREGROUND_TAB: Self =
Self(cef_window_open_disposition_t::CEF_WOD_NEW_FOREGROUND_TAB);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_NEW_BACKGROUND_TAB`] for more documentation."]
pub const NEW_BACKGROUND_TAB: Self =
Self(cef_window_open_disposition_t::CEF_WOD_NEW_BACKGROUND_TAB);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_NEW_POPUP`] for more documentation."]
pub const NEW_POPUP: Self = Self(cef_window_open_disposition_t::CEF_WOD_NEW_POPUP);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_NEW_WINDOW`] for more documentation."]
pub const NEW_WINDOW: Self = Self(cef_window_open_disposition_t::CEF_WOD_NEW_WINDOW);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_SAVE_TO_DISK`] for more documentation."]
pub const SAVE_TO_DISK: Self = Self(cef_window_open_disposition_t::CEF_WOD_SAVE_TO_DISK);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_OFF_THE_RECORD`] for more documentation."]
pub const OFF_THE_RECORD: Self = Self(cef_window_open_disposition_t::CEF_WOD_OFF_THE_RECORD);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_IGNORE_ACTION`] for more documentation."]
pub const IGNORE_ACTION: Self = Self(cef_window_open_disposition_t::CEF_WOD_IGNORE_ACTION);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_SWITCH_TO_TAB`] for more documentation."]
pub const SWITCH_TO_TAB: Self = Self(cef_window_open_disposition_t::CEF_WOD_SWITCH_TO_TAB);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_NEW_PICTURE_IN_PICTURE`] for more documentation."]
pub const NEW_PICTURE_IN_PICTURE: Self =
Self(cef_window_open_disposition_t::CEF_WOD_NEW_PICTURE_IN_PICTURE);
#[doc = "See [`cef_window_open_disposition_t::CEF_WOD_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_window_open_disposition_t::CEF_WOD_NUM_VALUES);
}
impl WindowOpenDisposition {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for WindowOpenDisposition {
fn default() -> Self {
Self(cef_window_open_disposition_t::CEF_WOD_UNKNOWN)
}
}
/// See [`cef_drag_operations_mask_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DragOperationsMask(cef_drag_operations_mask_t);
impl AsRef<cef_drag_operations_mask_t> for DragOperationsMask {
fn as_ref(&self) -> &cef_drag_operations_mask_t {
&self.0
}
}
impl AsMut<cef_drag_operations_mask_t> for DragOperationsMask {
fn as_mut(&mut self) -> &mut cef_drag_operations_mask_t {
&mut self.0
}
}
impl From<cef_drag_operations_mask_t> for DragOperationsMask {
fn from(value: cef_drag_operations_mask_t) -> Self {
Self(value)
}
}
impl From<DragOperationsMask> for cef_drag_operations_mask_t {
fn from(value: DragOperationsMask) -> Self {
value.0
}
}
impl Default for DragOperationsMask {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_text_input_mode_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TextInputMode(cef_text_input_mode_t);
impl AsRef<cef_text_input_mode_t> for TextInputMode {
fn as_ref(&self) -> &cef_text_input_mode_t {
&self.0
}
}
impl AsMut<cef_text_input_mode_t> for TextInputMode {
fn as_mut(&mut self) -> &mut cef_text_input_mode_t {
&mut self.0
}
}
impl From<cef_text_input_mode_t> for TextInputMode {
fn from(value: cef_text_input_mode_t) -> Self {
Self(value)
}
}
impl From<TextInputMode> for cef_text_input_mode_t {
fn from(value: TextInputMode) -> Self {
value.0
}
}
impl TextInputMode {
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_DEFAULT);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_NONE);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_TEXT`] for more documentation."]
pub const TEXT: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_TEXT);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_TEL`] for more documentation."]
pub const TEL: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_TEL);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_URL`] for more documentation."]
pub const URL: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_URL);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_EMAIL`] for more documentation."]
pub const EMAIL: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_EMAIL);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_NUMERIC`] for more documentation."]
pub const NUMERIC: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_NUMERIC);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_DECIMAL`] for more documentation."]
pub const DECIMAL: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_DECIMAL);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_SEARCH`] for more documentation."]
pub const SEARCH: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_SEARCH);
#[doc = "See [`cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_NUM_VALUES);
}
impl TextInputMode {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TextInputMode {
fn default() -> Self {
Self(cef_text_input_mode_t::CEF_TEXT_INPUT_MODE_DEFAULT)
}
}
/// See [`cef_v8_propertyattribute_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct V8Propertyattribute(cef_v8_propertyattribute_t);
impl AsRef<cef_v8_propertyattribute_t> for V8Propertyattribute {
fn as_ref(&self) -> &cef_v8_propertyattribute_t {
&self.0
}
}
impl AsMut<cef_v8_propertyattribute_t> for V8Propertyattribute {
fn as_mut(&mut self) -> &mut cef_v8_propertyattribute_t {
&mut self.0
}
}
impl From<cef_v8_propertyattribute_t> for V8Propertyattribute {
fn from(value: cef_v8_propertyattribute_t) -> Self {
Self(value)
}
}
impl From<V8Propertyattribute> for cef_v8_propertyattribute_t {
fn from(value: V8Propertyattribute) -> Self {
value.0
}
}
impl Default for V8Propertyattribute {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_postdataelement_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PostdataelementType(cef_postdataelement_type_t);
impl AsRef<cef_postdataelement_type_t> for PostdataelementType {
fn as_ref(&self) -> &cef_postdataelement_type_t {
&self.0
}
}
impl AsMut<cef_postdataelement_type_t> for PostdataelementType {
fn as_mut(&mut self) -> &mut cef_postdataelement_type_t {
&mut self.0
}
}
impl From<cef_postdataelement_type_t> for PostdataelementType {
fn from(value: cef_postdataelement_type_t) -> Self {
Self(value)
}
}
impl From<PostdataelementType> for cef_postdataelement_type_t {
fn from(value: PostdataelementType) -> Self {
value.0
}
}
impl PostdataelementType {
#[doc = "See [`cef_postdataelement_type_t::PDE_TYPE_EMPTY`] for more documentation."]
pub const EMPTY: Self = Self(cef_postdataelement_type_t::PDE_TYPE_EMPTY);
#[doc = "See [`cef_postdataelement_type_t::PDE_TYPE_BYTES`] for more documentation."]
pub const BYTES: Self = Self(cef_postdataelement_type_t::PDE_TYPE_BYTES);
#[doc = "See [`cef_postdataelement_type_t::PDE_TYPE_FILE`] for more documentation."]
pub const FILE: Self = Self(cef_postdataelement_type_t::PDE_TYPE_FILE);
#[doc = "See [`cef_postdataelement_type_t::PDE_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_postdataelement_type_t::PDE_TYPE_NUM_VALUES);
}
impl PostdataelementType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PostdataelementType {
fn default() -> Self {
Self(cef_postdataelement_type_t::PDE_TYPE_EMPTY)
}
}
/// See [`cef_resource_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ResourceType(cef_resource_type_t);
impl AsRef<cef_resource_type_t> for ResourceType {
fn as_ref(&self) -> &cef_resource_type_t {
&self.0
}
}
impl AsMut<cef_resource_type_t> for ResourceType {
fn as_mut(&mut self) -> &mut cef_resource_type_t {
&mut self.0
}
}
impl From<cef_resource_type_t> for ResourceType {
fn from(value: cef_resource_type_t) -> Self {
Self(value)
}
}
impl From<ResourceType> for cef_resource_type_t {
fn from(value: ResourceType) -> Self {
value.0
}
}
impl ResourceType {
#[doc = "See [`cef_resource_type_t::RT_MAIN_FRAME`] for more documentation."]
pub const MAIN_FRAME: Self = Self(cef_resource_type_t::RT_MAIN_FRAME);
#[doc = "See [`cef_resource_type_t::RT_SUB_FRAME`] for more documentation."]
pub const SUB_FRAME: Self = Self(cef_resource_type_t::RT_SUB_FRAME);
#[doc = "See [`cef_resource_type_t::RT_STYLESHEET`] for more documentation."]
pub const STYLESHEET: Self = Self(cef_resource_type_t::RT_STYLESHEET);
#[doc = "See [`cef_resource_type_t::RT_SCRIPT`] for more documentation."]
pub const SCRIPT: Self = Self(cef_resource_type_t::RT_SCRIPT);
#[doc = "See [`cef_resource_type_t::RT_IMAGE`] for more documentation."]
pub const IMAGE: Self = Self(cef_resource_type_t::RT_IMAGE);
#[doc = "See [`cef_resource_type_t::RT_FONT_RESOURCE`] for more documentation."]
pub const FONT_RESOURCE: Self = Self(cef_resource_type_t::RT_FONT_RESOURCE);
#[doc = "See [`cef_resource_type_t::RT_SUB_RESOURCE`] for more documentation."]
pub const SUB_RESOURCE: Self = Self(cef_resource_type_t::RT_SUB_RESOURCE);
#[doc = "See [`cef_resource_type_t::RT_OBJECT`] for more documentation."]
pub const OBJECT: Self = Self(cef_resource_type_t::RT_OBJECT);
#[doc = "See [`cef_resource_type_t::RT_MEDIA`] for more documentation."]
pub const MEDIA: Self = Self(cef_resource_type_t::RT_MEDIA);
#[doc = "See [`cef_resource_type_t::RT_WORKER`] for more documentation."]
pub const WORKER: Self = Self(cef_resource_type_t::RT_WORKER);
#[doc = "See [`cef_resource_type_t::RT_SHARED_WORKER`] for more documentation."]
pub const SHARED_WORKER: Self = Self(cef_resource_type_t::RT_SHARED_WORKER);
#[doc = "See [`cef_resource_type_t::RT_PREFETCH`] for more documentation."]
pub const PREFETCH: Self = Self(cef_resource_type_t::RT_PREFETCH);
#[doc = "See [`cef_resource_type_t::RT_FAVICON`] for more documentation."]
pub const FAVICON: Self = Self(cef_resource_type_t::RT_FAVICON);
#[doc = "See [`cef_resource_type_t::RT_XHR`] for more documentation."]
pub const XHR: Self = Self(cef_resource_type_t::RT_XHR);
#[doc = "See [`cef_resource_type_t::RT_PING`] for more documentation."]
pub const PING: Self = Self(cef_resource_type_t::RT_PING);
#[doc = "See [`cef_resource_type_t::RT_SERVICE_WORKER`] for more documentation."]
pub const SERVICE_WORKER: Self = Self(cef_resource_type_t::RT_SERVICE_WORKER);
#[doc = "See [`cef_resource_type_t::RT_CSP_REPORT`] for more documentation."]
pub const CSP_REPORT: Self = Self(cef_resource_type_t::RT_CSP_REPORT);
#[doc = "See [`cef_resource_type_t::RT_PLUGIN_RESOURCE`] for more documentation."]
pub const PLUGIN_RESOURCE: Self = Self(cef_resource_type_t::RT_PLUGIN_RESOURCE);
#[doc = "See [`cef_resource_type_t::RT_NAVIGATION_PRELOAD_MAIN_FRAME`] for more documentation."]
pub const NAVIGATION_PRELOAD_MAIN_FRAME: Self =
Self(cef_resource_type_t::RT_NAVIGATION_PRELOAD_MAIN_FRAME);
#[doc = "See [`cef_resource_type_t::RT_NAVIGATION_PRELOAD_SUB_FRAME`] for more documentation."]
pub const NAVIGATION_PRELOAD_SUB_FRAME: Self =
Self(cef_resource_type_t::RT_NAVIGATION_PRELOAD_SUB_FRAME);
#[doc = "See [`cef_resource_type_t::RT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_resource_type_t::RT_NUM_VALUES);
}
impl ResourceType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ResourceType {
fn default() -> Self {
Self(cef_resource_type_t::RT_MAIN_FRAME)
}
}
/// See [`cef_transition_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TransitionType(cef_transition_type_t);
impl AsRef<cef_transition_type_t> for TransitionType {
fn as_ref(&self) -> &cef_transition_type_t {
&self.0
}
}
impl AsMut<cef_transition_type_t> for TransitionType {
fn as_mut(&mut self) -> &mut cef_transition_type_t {
&mut self.0
}
}
impl From<cef_transition_type_t> for TransitionType {
fn from(value: cef_transition_type_t) -> Self {
Self(value)
}
}
impl From<TransitionType> for cef_transition_type_t {
fn from(value: TransitionType) -> Self {
value.0
}
}
impl TransitionType {
#[doc = "See [`cef_transition_type_t::TT_LINK`] for more documentation."]
pub const LINK: Self = Self(cef_transition_type_t::TT_LINK);
#[doc = "See [`cef_transition_type_t::TT_EXPLICIT`] for more documentation."]
pub const EXPLICIT: Self = Self(cef_transition_type_t::TT_EXPLICIT);
#[doc = "See [`cef_transition_type_t::TT_AUTO_BOOKMARK`] for more documentation."]
pub const AUTO_BOOKMARK: Self = Self(cef_transition_type_t::TT_AUTO_BOOKMARK);
#[doc = "See [`cef_transition_type_t::TT_AUTO_SUBFRAME`] for more documentation."]
pub const AUTO_SUBFRAME: Self = Self(cef_transition_type_t::TT_AUTO_SUBFRAME);
#[doc = "See [`cef_transition_type_t::TT_MANUAL_SUBFRAME`] for more documentation."]
pub const MANUAL_SUBFRAME: Self = Self(cef_transition_type_t::TT_MANUAL_SUBFRAME);
#[doc = "See [`cef_transition_type_t::TT_GENERATED`] for more documentation."]
pub const GENERATED: Self = Self(cef_transition_type_t::TT_GENERATED);
#[doc = "See [`cef_transition_type_t::TT_AUTO_TOPLEVEL`] for more documentation."]
pub const AUTO_TOPLEVEL: Self = Self(cef_transition_type_t::TT_AUTO_TOPLEVEL);
#[doc = "See [`cef_transition_type_t::TT_FORM_SUBMIT`] for more documentation."]
pub const FORM_SUBMIT: Self = Self(cef_transition_type_t::TT_FORM_SUBMIT);
#[doc = "See [`cef_transition_type_t::TT_RELOAD`] for more documentation."]
pub const RELOAD: Self = Self(cef_transition_type_t::TT_RELOAD);
#[doc = "See [`cef_transition_type_t::TT_KEYWORD`] for more documentation."]
pub const KEYWORD: Self = Self(cef_transition_type_t::TT_KEYWORD);
#[doc = "See [`cef_transition_type_t::TT_KEYWORD_GENERATED`] for more documentation."]
pub const KEYWORD_GENERATED: Self = Self(cef_transition_type_t::TT_KEYWORD_GENERATED);
#[doc = "See [`cef_transition_type_t::TT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_transition_type_t::TT_NUM_VALUES);
#[doc = "See [`cef_transition_type_t::TT_SOURCE_MASK`] for more documentation."]
pub const SOURCE_MASK: Self = Self(cef_transition_type_t::TT_SOURCE_MASK);
#[doc = "See [`cef_transition_type_t::TT_BLOCKED_FLAG`] for more documentation."]
pub const BLOCKED_FLAG: Self = Self(cef_transition_type_t::TT_BLOCKED_FLAG);
#[doc = "See [`cef_transition_type_t::TT_FORWARD_BACK_FLAG`] for more documentation."]
pub const FORWARD_BACK_FLAG: Self = Self(cef_transition_type_t::TT_FORWARD_BACK_FLAG);
#[doc = "See [`cef_transition_type_t::TT_DIRECT_LOAD_FLAG`] for more documentation."]
pub const DIRECT_LOAD_FLAG: Self = Self(cef_transition_type_t::TT_DIRECT_LOAD_FLAG);
#[doc = "See [`cef_transition_type_t::TT_HOME_PAGE_FLAG`] for more documentation."]
pub const HOME_PAGE_FLAG: Self = Self(cef_transition_type_t::TT_HOME_PAGE_FLAG);
#[doc = "See [`cef_transition_type_t::TT_FROM_API_FLAG`] for more documentation."]
pub const FROM_API_FLAG: Self = Self(cef_transition_type_t::TT_FROM_API_FLAG);
#[doc = "See [`cef_transition_type_t::TT_CHAIN_START_FLAG`] for more documentation."]
pub const CHAIN_START_FLAG: Self = Self(cef_transition_type_t::TT_CHAIN_START_FLAG);
#[doc = "See [`cef_transition_type_t::TT_CHAIN_END_FLAG`] for more documentation."]
pub const CHAIN_END_FLAG: Self = Self(cef_transition_type_t::TT_CHAIN_END_FLAG);
#[doc = "See [`cef_transition_type_t::TT_CLIENT_REDIRECT_FLAG`] for more documentation."]
pub const CLIENT_REDIRECT_FLAG: Self = Self(cef_transition_type_t::TT_CLIENT_REDIRECT_FLAG);
#[doc = "See [`cef_transition_type_t::TT_SERVER_REDIRECT_FLAG`] for more documentation."]
pub const SERVER_REDIRECT_FLAG: Self = Self(cef_transition_type_t::TT_SERVER_REDIRECT_FLAG);
#[doc = "See [`cef_transition_type_t::TT_IS_REDIRECT_MASK`] for more documentation."]
pub const IS_REDIRECT_MASK: Self = Self(cef_transition_type_t::TT_IS_REDIRECT_MASK);
#[doc = "See [`cef_transition_type_t::TT_QUALIFIER_MASK`] for more documentation."]
pub const QUALIFIER_MASK: Self = Self(cef_transition_type_t::TT_QUALIFIER_MASK);
}
impl TransitionType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TransitionType {
fn default() -> Self {
Self(cef_transition_type_t::TT_LINK)
}
}
/// See [`cef_urlrequest_flags_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct UrlrequestFlags(cef_urlrequest_flags_t);
impl AsRef<cef_urlrequest_flags_t> for UrlrequestFlags {
fn as_ref(&self) -> &cef_urlrequest_flags_t {
&self.0
}
}
impl AsMut<cef_urlrequest_flags_t> for UrlrequestFlags {
fn as_mut(&mut self) -> &mut cef_urlrequest_flags_t {
&mut self.0
}
}
impl From<cef_urlrequest_flags_t> for UrlrequestFlags {
fn from(value: cef_urlrequest_flags_t) -> Self {
Self(value)
}
}
impl From<UrlrequestFlags> for cef_urlrequest_flags_t {
fn from(value: UrlrequestFlags) -> Self {
value.0
}
}
impl Default for UrlrequestFlags {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_urlrequest_status_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct UrlrequestStatus(cef_urlrequest_status_t);
impl AsRef<cef_urlrequest_status_t> for UrlrequestStatus {
fn as_ref(&self) -> &cef_urlrequest_status_t {
&self.0
}
}
impl AsMut<cef_urlrequest_status_t> for UrlrequestStatus {
fn as_mut(&mut self) -> &mut cef_urlrequest_status_t {
&mut self.0
}
}
impl From<cef_urlrequest_status_t> for UrlrequestStatus {
fn from(value: cef_urlrequest_status_t) -> Self {
Self(value)
}
}
impl From<UrlrequestStatus> for cef_urlrequest_status_t {
fn from(value: UrlrequestStatus) -> Self {
value.0
}
}
impl UrlrequestStatus {
#[doc = "See [`cef_urlrequest_status_t::UR_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_urlrequest_status_t::UR_UNKNOWN);
#[doc = "See [`cef_urlrequest_status_t::UR_SUCCESS`] for more documentation."]
pub const SUCCESS: Self = Self(cef_urlrequest_status_t::UR_SUCCESS);
#[doc = "See [`cef_urlrequest_status_t::UR_IO_PENDING`] for more documentation."]
pub const IO_PENDING: Self = Self(cef_urlrequest_status_t::UR_IO_PENDING);
#[doc = "See [`cef_urlrequest_status_t::UR_CANCELED`] for more documentation."]
pub const CANCELED: Self = Self(cef_urlrequest_status_t::UR_CANCELED);
#[doc = "See [`cef_urlrequest_status_t::UR_FAILED`] for more documentation."]
pub const FAILED: Self = Self(cef_urlrequest_status_t::UR_FAILED);
#[doc = "See [`cef_urlrequest_status_t::UR_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_urlrequest_status_t::UR_NUM_VALUES);
}
impl UrlrequestStatus {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for UrlrequestStatus {
fn default() -> Self {
Self(cef_urlrequest_status_t::UR_UNKNOWN)
}
}
/// See [`cef_process_id_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ProcessId(cef_process_id_t);
impl AsRef<cef_process_id_t> for ProcessId {
fn as_ref(&self) -> &cef_process_id_t {
&self.0
}
}
impl AsMut<cef_process_id_t> for ProcessId {
fn as_mut(&mut self) -> &mut cef_process_id_t {
&mut self.0
}
}
impl From<cef_process_id_t> for ProcessId {
fn from(value: cef_process_id_t) -> Self {
Self(value)
}
}
impl From<ProcessId> for cef_process_id_t {
fn from(value: ProcessId) -> Self {
value.0
}
}
impl ProcessId {
#[doc = "See [`cef_process_id_t::PID_BROWSER`] for more documentation."]
pub const BROWSER: Self = Self(cef_process_id_t::PID_BROWSER);
#[doc = "See [`cef_process_id_t::PID_RENDERER`] for more documentation."]
pub const RENDERER: Self = Self(cef_process_id_t::PID_RENDERER);
}
impl ProcessId {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ProcessId {
fn default() -> Self {
Self(cef_process_id_t::PID_BROWSER)
}
}
/// See [`cef_thread_id_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ThreadId(cef_thread_id_t);
impl AsRef<cef_thread_id_t> for ThreadId {
fn as_ref(&self) -> &cef_thread_id_t {
&self.0
}
}
impl AsMut<cef_thread_id_t> for ThreadId {
fn as_mut(&mut self) -> &mut cef_thread_id_t {
&mut self.0
}
}
impl From<cef_thread_id_t> for ThreadId {
fn from(value: cef_thread_id_t) -> Self {
Self(value)
}
}
impl From<ThreadId> for cef_thread_id_t {
fn from(value: ThreadId) -> Self {
value.0
}
}
impl ThreadId {
#[doc = "See [`cef_thread_id_t::TID_UI`] for more documentation."]
pub const UI: Self = Self(cef_thread_id_t::TID_UI);
#[doc = "See [`cef_thread_id_t::TID_FILE_BACKGROUND`] for more documentation."]
pub const FILE_BACKGROUND: Self = Self(cef_thread_id_t::TID_FILE_BACKGROUND);
#[doc = "See [`cef_thread_id_t::TID_FILE_USER_VISIBLE`] for more documentation."]
pub const FILE_USER_VISIBLE: Self = Self(cef_thread_id_t::TID_FILE_USER_VISIBLE);
#[doc = "See [`cef_thread_id_t::TID_FILE_USER_BLOCKING`] for more documentation."]
pub const FILE_USER_BLOCKING: Self = Self(cef_thread_id_t::TID_FILE_USER_BLOCKING);
#[doc = "See [`cef_thread_id_t::TID_PROCESS_LAUNCHER`] for more documentation."]
pub const PROCESS_LAUNCHER: Self = Self(cef_thread_id_t::TID_PROCESS_LAUNCHER);
#[doc = "See [`cef_thread_id_t::TID_IO`] for more documentation."]
pub const IO: Self = Self(cef_thread_id_t::TID_IO);
#[doc = "See [`cef_thread_id_t::TID_RENDERER`] for more documentation."]
pub const RENDERER: Self = Self(cef_thread_id_t::TID_RENDERER);
#[doc = "See [`cef_thread_id_t::TID_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_thread_id_t::TID_NUM_VALUES);
}
impl ThreadId {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ThreadId {
fn default() -> Self {
Self(cef_thread_id_t::TID_UI)
}
}
/// See [`cef_thread_priority_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ThreadPriority(cef_thread_priority_t);
impl AsRef<cef_thread_priority_t> for ThreadPriority {
fn as_ref(&self) -> &cef_thread_priority_t {
&self.0
}
}
impl AsMut<cef_thread_priority_t> for ThreadPriority {
fn as_mut(&mut self) -> &mut cef_thread_priority_t {
&mut self.0
}
}
impl From<cef_thread_priority_t> for ThreadPriority {
fn from(value: cef_thread_priority_t) -> Self {
Self(value)
}
}
impl From<ThreadPriority> for cef_thread_priority_t {
fn from(value: ThreadPriority) -> Self {
value.0
}
}
impl ThreadPriority {
#[doc = "See [`cef_thread_priority_t::TP_BACKGROUND`] for more documentation."]
pub const BACKGROUND: Self = Self(cef_thread_priority_t::TP_BACKGROUND);
#[doc = "See [`cef_thread_priority_t::TP_NORMAL`] for more documentation."]
pub const NORMAL: Self = Self(cef_thread_priority_t::TP_NORMAL);
#[doc = "See [`cef_thread_priority_t::TP_DISPLAY`] for more documentation."]
pub const DISPLAY: Self = Self(cef_thread_priority_t::TP_DISPLAY);
#[doc = "See [`cef_thread_priority_t::TP_REALTIME_AUDIO`] for more documentation."]
pub const REALTIME_AUDIO: Self = Self(cef_thread_priority_t::TP_REALTIME_AUDIO);
#[doc = "See [`cef_thread_priority_t::TP_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_thread_priority_t::TP_NUM_VALUES);
}
impl ThreadPriority {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ThreadPriority {
fn default() -> Self {
Self(cef_thread_priority_t::TP_BACKGROUND)
}
}
/// See [`cef_message_loop_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MessageLoopType(cef_message_loop_type_t);
impl AsRef<cef_message_loop_type_t> for MessageLoopType {
fn as_ref(&self) -> &cef_message_loop_type_t {
&self.0
}
}
impl AsMut<cef_message_loop_type_t> for MessageLoopType {
fn as_mut(&mut self) -> &mut cef_message_loop_type_t {
&mut self.0
}
}
impl From<cef_message_loop_type_t> for MessageLoopType {
fn from(value: cef_message_loop_type_t) -> Self {
Self(value)
}
}
impl From<MessageLoopType> for cef_message_loop_type_t {
fn from(value: MessageLoopType) -> Self {
value.0
}
}
impl MessageLoopType {
#[doc = "See [`cef_message_loop_type_t::ML_TYPE_DEFAULT`] for more documentation."]
pub const TYPE_DEFAULT: Self = Self(cef_message_loop_type_t::ML_TYPE_DEFAULT);
#[doc = "See [`cef_message_loop_type_t::ML_TYPE_UI`] for more documentation."]
pub const TYPE_UI: Self = Self(cef_message_loop_type_t::ML_TYPE_UI);
#[doc = "See [`cef_message_loop_type_t::ML_TYPE_IO`] for more documentation."]
pub const TYPE_IO: Self = Self(cef_message_loop_type_t::ML_TYPE_IO);
#[doc = "See [`cef_message_loop_type_t::ML_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_message_loop_type_t::ML_NUM_VALUES);
}
impl MessageLoopType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MessageLoopType {
fn default() -> Self {
Self(cef_message_loop_type_t::ML_TYPE_DEFAULT)
}
}
/// See [`cef_com_init_mode_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ComInitMode(cef_com_init_mode_t);
impl AsRef<cef_com_init_mode_t> for ComInitMode {
fn as_ref(&self) -> &cef_com_init_mode_t {
&self.0
}
}
impl AsMut<cef_com_init_mode_t> for ComInitMode {
fn as_mut(&mut self) -> &mut cef_com_init_mode_t {
&mut self.0
}
}
impl From<cef_com_init_mode_t> for ComInitMode {
fn from(value: cef_com_init_mode_t) -> Self {
Self(value)
}
}
impl From<ComInitMode> for cef_com_init_mode_t {
fn from(value: ComInitMode) -> Self {
value.0
}
}
impl ComInitMode {
#[doc = "See [`cef_com_init_mode_t::COM_INIT_MODE_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_com_init_mode_t::COM_INIT_MODE_NONE);
#[doc = "See [`cef_com_init_mode_t::COM_INIT_MODE_STA`] for more documentation."]
pub const STA: Self = Self(cef_com_init_mode_t::COM_INIT_MODE_STA);
#[doc = "See [`cef_com_init_mode_t::COM_INIT_MODE_MTA`] for more documentation."]
pub const MTA: Self = Self(cef_com_init_mode_t::COM_INIT_MODE_MTA);
}
impl ComInitMode {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ComInitMode {
fn default() -> Self {
Self(cef_com_init_mode_t::COM_INIT_MODE_NONE)
}
}
/// See [`cef_value_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ValueType(cef_value_type_t);
impl AsRef<cef_value_type_t> for ValueType {
fn as_ref(&self) -> &cef_value_type_t {
&self.0
}
}
impl AsMut<cef_value_type_t> for ValueType {
fn as_mut(&mut self) -> &mut cef_value_type_t {
&mut self.0
}
}
impl From<cef_value_type_t> for ValueType {
fn from(value: cef_value_type_t) -> Self {
Self(value)
}
}
impl From<ValueType> for cef_value_type_t {
fn from(value: ValueType) -> Self {
value.0
}
}
impl ValueType {
#[doc = "See [`cef_value_type_t::VTYPE_INVALID`] for more documentation."]
pub const INVALID: Self = Self(cef_value_type_t::VTYPE_INVALID);
#[doc = "See [`cef_value_type_t::VTYPE_NULL`] for more documentation."]
pub const NULL: Self = Self(cef_value_type_t::VTYPE_NULL);
#[doc = "See [`cef_value_type_t::VTYPE_BOOL`] for more documentation."]
pub const BOOL: Self = Self(cef_value_type_t::VTYPE_BOOL);
#[doc = "See [`cef_value_type_t::VTYPE_INT`] for more documentation."]
pub const INT: Self = Self(cef_value_type_t::VTYPE_INT);
#[doc = "See [`cef_value_type_t::VTYPE_DOUBLE`] for more documentation."]
pub const DOUBLE: Self = Self(cef_value_type_t::VTYPE_DOUBLE);
#[doc = "See [`cef_value_type_t::VTYPE_STRING`] for more documentation."]
pub const STRING: Self = Self(cef_value_type_t::VTYPE_STRING);
#[doc = "See [`cef_value_type_t::VTYPE_BINARY`] for more documentation."]
pub const BINARY: Self = Self(cef_value_type_t::VTYPE_BINARY);
#[doc = "See [`cef_value_type_t::VTYPE_DICTIONARY`] for more documentation."]
pub const DICTIONARY: Self = Self(cef_value_type_t::VTYPE_DICTIONARY);
#[doc = "See [`cef_value_type_t::VTYPE_LIST`] for more documentation."]
pub const LIST: Self = Self(cef_value_type_t::VTYPE_LIST);
#[doc = "See [`cef_value_type_t::VTYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_value_type_t::VTYPE_NUM_VALUES);
}
impl ValueType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ValueType {
fn default() -> Self {
Self(cef_value_type_t::VTYPE_INVALID)
}
}
/// See [`cef_jsdialog_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct JsdialogType(cef_jsdialog_type_t);
impl AsRef<cef_jsdialog_type_t> for JsdialogType {
fn as_ref(&self) -> &cef_jsdialog_type_t {
&self.0
}
}
impl AsMut<cef_jsdialog_type_t> for JsdialogType {
fn as_mut(&mut self) -> &mut cef_jsdialog_type_t {
&mut self.0
}
}
impl From<cef_jsdialog_type_t> for JsdialogType {
fn from(value: cef_jsdialog_type_t) -> Self {
Self(value)
}
}
impl From<JsdialogType> for cef_jsdialog_type_t {
fn from(value: JsdialogType) -> Self {
value.0
}
}
impl JsdialogType {
#[doc = "See [`cef_jsdialog_type_t::JSDIALOGTYPE_ALERT`] for more documentation."]
pub const ALERT: Self = Self(cef_jsdialog_type_t::JSDIALOGTYPE_ALERT);
#[doc = "See [`cef_jsdialog_type_t::JSDIALOGTYPE_CONFIRM`] for more documentation."]
pub const CONFIRM: Self = Self(cef_jsdialog_type_t::JSDIALOGTYPE_CONFIRM);
#[doc = "See [`cef_jsdialog_type_t::JSDIALOGTYPE_PROMPT`] for more documentation."]
pub const PROMPT: Self = Self(cef_jsdialog_type_t::JSDIALOGTYPE_PROMPT);
#[doc = "See [`cef_jsdialog_type_t::JSDIALOGTYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_jsdialog_type_t::JSDIALOGTYPE_NUM_VALUES);
}
impl JsdialogType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for JsdialogType {
fn default() -> Self {
Self(cef_jsdialog_type_t::JSDIALOGTYPE_ALERT)
}
}
/// See [`cef_menu_id_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MenuId(cef_menu_id_t);
impl AsRef<cef_menu_id_t> for MenuId {
fn as_ref(&self) -> &cef_menu_id_t {
&self.0
}
}
impl AsMut<cef_menu_id_t> for MenuId {
fn as_mut(&mut self) -> &mut cef_menu_id_t {
&mut self.0
}
}
impl From<cef_menu_id_t> for MenuId {
fn from(value: cef_menu_id_t) -> Self {
Self(value)
}
}
impl From<MenuId> for cef_menu_id_t {
fn from(value: MenuId) -> Self {
value.0
}
}
impl MenuId {
#[doc = "See [`cef_menu_id_t::MENU_ID_BACK`] for more documentation."]
pub const BACK: Self = Self(cef_menu_id_t::MENU_ID_BACK);
#[doc = "See [`cef_menu_id_t::MENU_ID_FORWARD`] for more documentation."]
pub const FORWARD: Self = Self(cef_menu_id_t::MENU_ID_FORWARD);
#[doc = "See [`cef_menu_id_t::MENU_ID_RELOAD`] for more documentation."]
pub const RELOAD: Self = Self(cef_menu_id_t::MENU_ID_RELOAD);
#[doc = "See [`cef_menu_id_t::MENU_ID_RELOAD_NOCACHE`] for more documentation."]
pub const RELOAD_NOCACHE: Self = Self(cef_menu_id_t::MENU_ID_RELOAD_NOCACHE);
#[doc = "See [`cef_menu_id_t::MENU_ID_STOPLOAD`] for more documentation."]
pub const STOPLOAD: Self = Self(cef_menu_id_t::MENU_ID_STOPLOAD);
#[doc = "See [`cef_menu_id_t::MENU_ID_UNDO`] for more documentation."]
pub const UNDO: Self = Self(cef_menu_id_t::MENU_ID_UNDO);
#[doc = "See [`cef_menu_id_t::MENU_ID_REDO`] for more documentation."]
pub const REDO: Self = Self(cef_menu_id_t::MENU_ID_REDO);
#[doc = "See [`cef_menu_id_t::MENU_ID_CUT`] for more documentation."]
pub const CUT: Self = Self(cef_menu_id_t::MENU_ID_CUT);
#[doc = "See [`cef_menu_id_t::MENU_ID_COPY`] for more documentation."]
pub const COPY: Self = Self(cef_menu_id_t::MENU_ID_COPY);
#[doc = "See [`cef_menu_id_t::MENU_ID_PASTE`] for more documentation."]
pub const PASTE: Self = Self(cef_menu_id_t::MENU_ID_PASTE);
#[doc = "See [`cef_menu_id_t::MENU_ID_PASTE_MATCH_STYLE`] for more documentation."]
pub const PASTE_MATCH_STYLE: Self = Self(cef_menu_id_t::MENU_ID_PASTE_MATCH_STYLE);
#[doc = "See [`cef_menu_id_t::MENU_ID_DELETE`] for more documentation."]
pub const DELETE: Self = Self(cef_menu_id_t::MENU_ID_DELETE);
#[doc = "See [`cef_menu_id_t::MENU_ID_SELECT_ALL`] for more documentation."]
pub const SELECT_ALL: Self = Self(cef_menu_id_t::MENU_ID_SELECT_ALL);
#[doc = "See [`cef_menu_id_t::MENU_ID_FIND`] for more documentation."]
pub const FIND: Self = Self(cef_menu_id_t::MENU_ID_FIND);
#[doc = "See [`cef_menu_id_t::MENU_ID_PRINT`] for more documentation."]
pub const PRINT: Self = Self(cef_menu_id_t::MENU_ID_PRINT);
#[doc = "See [`cef_menu_id_t::MENU_ID_VIEW_SOURCE`] for more documentation."]
pub const VIEW_SOURCE: Self = Self(cef_menu_id_t::MENU_ID_VIEW_SOURCE);
#[doc = "See [`cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_0`] for more documentation."]
pub const SPELLCHECK_SUGGESTION_0: Self = Self(cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_0);
#[doc = "See [`cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_1`] for more documentation."]
pub const SPELLCHECK_SUGGESTION_1: Self = Self(cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_1);
#[doc = "See [`cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_2`] for more documentation."]
pub const SPELLCHECK_SUGGESTION_2: Self = Self(cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_2);
#[doc = "See [`cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_3`] for more documentation."]
pub const SPELLCHECK_SUGGESTION_3: Self = Self(cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_3);
#[doc = "See [`cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_4`] for more documentation."]
pub const SPELLCHECK_SUGGESTION_4: Self = Self(cef_menu_id_t::MENU_ID_SPELLCHECK_SUGGESTION_4);
#[doc = "See [`cef_menu_id_t::MENU_ID_NO_SPELLING_SUGGESTIONS`] for more documentation."]
pub const NO_SPELLING_SUGGESTIONS: Self = Self(cef_menu_id_t::MENU_ID_NO_SPELLING_SUGGESTIONS);
#[doc = "See [`cef_menu_id_t::MENU_ID_ADD_TO_DICTIONARY`] for more documentation."]
pub const ADD_TO_DICTIONARY: Self = Self(cef_menu_id_t::MENU_ID_ADD_TO_DICTIONARY);
#[doc = "See [`cef_menu_id_t::MENU_ID_CUSTOM_FIRST`] for more documentation."]
pub const CUSTOM_FIRST: Self = Self(cef_menu_id_t::MENU_ID_CUSTOM_FIRST);
#[doc = "See [`cef_menu_id_t::MENU_ID_CUSTOM_LAST`] for more documentation."]
pub const CUSTOM_LAST: Self = Self(cef_menu_id_t::MENU_ID_CUSTOM_LAST);
#[doc = "See [`cef_menu_id_t::MENU_ID_USER_FIRST`] for more documentation."]
pub const USER_FIRST: Self = Self(cef_menu_id_t::MENU_ID_USER_FIRST);
#[doc = "See [`cef_menu_id_t::MENU_ID_USER_LAST`] for more documentation."]
pub const USER_LAST: Self = Self(cef_menu_id_t::MENU_ID_USER_LAST);
}
impl MenuId {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MenuId {
fn default() -> Self {
Self(cef_menu_id_t::MENU_ID_BACK)
}
}
/// See [`cef_mouse_button_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MouseButtonType(cef_mouse_button_type_t);
impl AsRef<cef_mouse_button_type_t> for MouseButtonType {
fn as_ref(&self) -> &cef_mouse_button_type_t {
&self.0
}
}
impl AsMut<cef_mouse_button_type_t> for MouseButtonType {
fn as_mut(&mut self) -> &mut cef_mouse_button_type_t {
&mut self.0
}
}
impl From<cef_mouse_button_type_t> for MouseButtonType {
fn from(value: cef_mouse_button_type_t) -> Self {
Self(value)
}
}
impl From<MouseButtonType> for cef_mouse_button_type_t {
fn from(value: MouseButtonType) -> Self {
value.0
}
}
impl MouseButtonType {
#[doc = "See [`cef_mouse_button_type_t::MBT_LEFT`] for more documentation."]
pub const LEFT: Self = Self(cef_mouse_button_type_t::MBT_LEFT);
#[doc = "See [`cef_mouse_button_type_t::MBT_MIDDLE`] for more documentation."]
pub const MIDDLE: Self = Self(cef_mouse_button_type_t::MBT_MIDDLE);
#[doc = "See [`cef_mouse_button_type_t::MBT_RIGHT`] for more documentation."]
pub const RIGHT: Self = Self(cef_mouse_button_type_t::MBT_RIGHT);
}
impl MouseButtonType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MouseButtonType {
fn default() -> Self {
Self(cef_mouse_button_type_t::MBT_LEFT)
}
}
/// See [`cef_touch_event_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TouchEventType(cef_touch_event_type_t);
impl AsRef<cef_touch_event_type_t> for TouchEventType {
fn as_ref(&self) -> &cef_touch_event_type_t {
&self.0
}
}
impl AsMut<cef_touch_event_type_t> for TouchEventType {
fn as_mut(&mut self) -> &mut cef_touch_event_type_t {
&mut self.0
}
}
impl From<cef_touch_event_type_t> for TouchEventType {
fn from(value: cef_touch_event_type_t) -> Self {
Self(value)
}
}
impl From<TouchEventType> for cef_touch_event_type_t {
fn from(value: TouchEventType) -> Self {
value.0
}
}
impl TouchEventType {
#[doc = "See [`cef_touch_event_type_t::CEF_TET_RELEASED`] for more documentation."]
pub const RELEASED: Self = Self(cef_touch_event_type_t::CEF_TET_RELEASED);
#[doc = "See [`cef_touch_event_type_t::CEF_TET_PRESSED`] for more documentation."]
pub const PRESSED: Self = Self(cef_touch_event_type_t::CEF_TET_PRESSED);
#[doc = "See [`cef_touch_event_type_t::CEF_TET_MOVED`] for more documentation."]
pub const MOVED: Self = Self(cef_touch_event_type_t::CEF_TET_MOVED);
#[doc = "See [`cef_touch_event_type_t::CEF_TET_CANCELLED`] for more documentation."]
pub const CANCELLED: Self = Self(cef_touch_event_type_t::CEF_TET_CANCELLED);
}
impl TouchEventType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TouchEventType {
fn default() -> Self {
Self(cef_touch_event_type_t::CEF_TET_RELEASED)
}
}
/// See [`cef_pointer_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PointerType(cef_pointer_type_t);
impl AsRef<cef_pointer_type_t> for PointerType {
fn as_ref(&self) -> &cef_pointer_type_t {
&self.0
}
}
impl AsMut<cef_pointer_type_t> for PointerType {
fn as_mut(&mut self) -> &mut cef_pointer_type_t {
&mut self.0
}
}
impl From<cef_pointer_type_t> for PointerType {
fn from(value: cef_pointer_type_t) -> Self {
Self(value)
}
}
impl From<PointerType> for cef_pointer_type_t {
fn from(value: PointerType) -> Self {
value.0
}
}
impl PointerType {
#[doc = "See [`cef_pointer_type_t::CEF_POINTER_TYPE_TOUCH`] for more documentation."]
pub const TOUCH: Self = Self(cef_pointer_type_t::CEF_POINTER_TYPE_TOUCH);
#[doc = "See [`cef_pointer_type_t::CEF_POINTER_TYPE_MOUSE`] for more documentation."]
pub const MOUSE: Self = Self(cef_pointer_type_t::CEF_POINTER_TYPE_MOUSE);
#[doc = "See [`cef_pointer_type_t::CEF_POINTER_TYPE_PEN`] for more documentation."]
pub const PEN: Self = Self(cef_pointer_type_t::CEF_POINTER_TYPE_PEN);
#[doc = "See [`cef_pointer_type_t::CEF_POINTER_TYPE_ERASER`] for more documentation."]
pub const ERASER: Self = Self(cef_pointer_type_t::CEF_POINTER_TYPE_ERASER);
#[doc = "See [`cef_pointer_type_t::CEF_POINTER_TYPE_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_pointer_type_t::CEF_POINTER_TYPE_UNKNOWN);
}
impl PointerType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PointerType {
fn default() -> Self {
Self(cef_pointer_type_t::CEF_POINTER_TYPE_TOUCH)
}
}
/// See [`cef_paint_element_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PaintElementType(cef_paint_element_type_t);
impl AsRef<cef_paint_element_type_t> for PaintElementType {
fn as_ref(&self) -> &cef_paint_element_type_t {
&self.0
}
}
impl AsMut<cef_paint_element_type_t> for PaintElementType {
fn as_mut(&mut self) -> &mut cef_paint_element_type_t {
&mut self.0
}
}
impl From<cef_paint_element_type_t> for PaintElementType {
fn from(value: cef_paint_element_type_t) -> Self {
Self(value)
}
}
impl From<PaintElementType> for cef_paint_element_type_t {
fn from(value: PaintElementType) -> Self {
value.0
}
}
impl PaintElementType {
#[doc = "See [`cef_paint_element_type_t::PET_VIEW`] for more documentation."]
pub const VIEW: Self = Self(cef_paint_element_type_t::PET_VIEW);
#[doc = "See [`cef_paint_element_type_t::PET_POPUP`] for more documentation."]
pub const POPUP: Self = Self(cef_paint_element_type_t::PET_POPUP);
}
impl PaintElementType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PaintElementType {
fn default() -> Self {
Self(cef_paint_element_type_t::PET_VIEW)
}
}
/// See [`cef_event_flags_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct EventFlags(cef_event_flags_t);
impl AsRef<cef_event_flags_t> for EventFlags {
fn as_ref(&self) -> &cef_event_flags_t {
&self.0
}
}
impl AsMut<cef_event_flags_t> for EventFlags {
fn as_mut(&mut self) -> &mut cef_event_flags_t {
&mut self.0
}
}
impl From<cef_event_flags_t> for EventFlags {
fn from(value: cef_event_flags_t) -> Self {
Self(value)
}
}
impl From<EventFlags> for cef_event_flags_t {
fn from(value: EventFlags) -> Self {
value.0
}
}
impl Default for EventFlags {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_menu_item_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MenuItemType(cef_menu_item_type_t);
impl AsRef<cef_menu_item_type_t> for MenuItemType {
fn as_ref(&self) -> &cef_menu_item_type_t {
&self.0
}
}
impl AsMut<cef_menu_item_type_t> for MenuItemType {
fn as_mut(&mut self) -> &mut cef_menu_item_type_t {
&mut self.0
}
}
impl From<cef_menu_item_type_t> for MenuItemType {
fn from(value: cef_menu_item_type_t) -> Self {
Self(value)
}
}
impl From<MenuItemType> for cef_menu_item_type_t {
fn from(value: MenuItemType) -> Self {
value.0
}
}
impl MenuItemType {
#[doc = "See [`cef_menu_item_type_t::MENUITEMTYPE_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_menu_item_type_t::MENUITEMTYPE_NONE);
#[doc = "See [`cef_menu_item_type_t::MENUITEMTYPE_COMMAND`] for more documentation."]
pub const COMMAND: Self = Self(cef_menu_item_type_t::MENUITEMTYPE_COMMAND);
#[doc = "See [`cef_menu_item_type_t::MENUITEMTYPE_CHECK`] for more documentation."]
pub const CHECK: Self = Self(cef_menu_item_type_t::MENUITEMTYPE_CHECK);
#[doc = "See [`cef_menu_item_type_t::MENUITEMTYPE_RADIO`] for more documentation."]
pub const RADIO: Self = Self(cef_menu_item_type_t::MENUITEMTYPE_RADIO);
#[doc = "See [`cef_menu_item_type_t::MENUITEMTYPE_SEPARATOR`] for more documentation."]
pub const SEPARATOR: Self = Self(cef_menu_item_type_t::MENUITEMTYPE_SEPARATOR);
#[doc = "See [`cef_menu_item_type_t::MENUITEMTYPE_SUBMENU`] for more documentation."]
pub const SUBMENU: Self = Self(cef_menu_item_type_t::MENUITEMTYPE_SUBMENU);
}
impl MenuItemType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MenuItemType {
fn default() -> Self {
Self(cef_menu_item_type_t::MENUITEMTYPE_NONE)
}
}
/// See [`cef_context_menu_type_flags_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ContextMenuTypeFlags(cef_context_menu_type_flags_t);
impl AsRef<cef_context_menu_type_flags_t> for ContextMenuTypeFlags {
fn as_ref(&self) -> &cef_context_menu_type_flags_t {
&self.0
}
}
impl AsMut<cef_context_menu_type_flags_t> for ContextMenuTypeFlags {
fn as_mut(&mut self) -> &mut cef_context_menu_type_flags_t {
&mut self.0
}
}
impl From<cef_context_menu_type_flags_t> for ContextMenuTypeFlags {
fn from(value: cef_context_menu_type_flags_t) -> Self {
Self(value)
}
}
impl From<ContextMenuTypeFlags> for cef_context_menu_type_flags_t {
fn from(value: ContextMenuTypeFlags) -> Self {
value.0
}
}
impl Default for ContextMenuTypeFlags {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_context_menu_media_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ContextMenuMediaType(cef_context_menu_media_type_t);
impl AsRef<cef_context_menu_media_type_t> for ContextMenuMediaType {
fn as_ref(&self) -> &cef_context_menu_media_type_t {
&self.0
}
}
impl AsMut<cef_context_menu_media_type_t> for ContextMenuMediaType {
fn as_mut(&mut self) -> &mut cef_context_menu_media_type_t {
&mut self.0
}
}
impl From<cef_context_menu_media_type_t> for ContextMenuMediaType {
fn from(value: cef_context_menu_media_type_t) -> Self {
Self(value)
}
}
impl From<ContextMenuMediaType> for cef_context_menu_media_type_t {
fn from(value: ContextMenuMediaType) -> Self {
value.0
}
}
impl ContextMenuMediaType {
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_NONE);
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_IMAGE`] for more documentation."]
pub const IMAGE: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_IMAGE);
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_VIDEO`] for more documentation."]
pub const VIDEO: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_VIDEO);
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_AUDIO`] for more documentation."]
pub const AUDIO: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_AUDIO);
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_CANVAS`] for more documentation."]
pub const CANVAS: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_CANVAS);
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_FILE`] for more documentation."]
pub const FILE: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_FILE);
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_PLUGIN`] for more documentation."]
pub const PLUGIN: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_PLUGIN);
#[doc = "See [`cef_context_menu_media_type_t::CM_MEDIATYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_context_menu_media_type_t::CM_MEDIATYPE_NUM_VALUES);
}
impl ContextMenuMediaType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ContextMenuMediaType {
fn default() -> Self {
Self(cef_context_menu_media_type_t::CM_MEDIATYPE_NONE)
}
}
/// See [`cef_context_menu_media_state_flags_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ContextMenuMediaStateFlags(cef_context_menu_media_state_flags_t);
impl AsRef<cef_context_menu_media_state_flags_t> for ContextMenuMediaStateFlags {
fn as_ref(&self) -> &cef_context_menu_media_state_flags_t {
&self.0
}
}
impl AsMut<cef_context_menu_media_state_flags_t> for ContextMenuMediaStateFlags {
fn as_mut(&mut self) -> &mut cef_context_menu_media_state_flags_t {
&mut self.0
}
}
impl From<cef_context_menu_media_state_flags_t> for ContextMenuMediaStateFlags {
fn from(value: cef_context_menu_media_state_flags_t) -> Self {
Self(value)
}
}
impl From<ContextMenuMediaStateFlags> for cef_context_menu_media_state_flags_t {
fn from(value: ContextMenuMediaStateFlags) -> Self {
value.0
}
}
impl Default for ContextMenuMediaStateFlags {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_context_menu_edit_state_flags_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ContextMenuEditStateFlags(cef_context_menu_edit_state_flags_t);
impl AsRef<cef_context_menu_edit_state_flags_t> for ContextMenuEditStateFlags {
fn as_ref(&self) -> &cef_context_menu_edit_state_flags_t {
&self.0
}
}
impl AsMut<cef_context_menu_edit_state_flags_t> for ContextMenuEditStateFlags {
fn as_mut(&mut self) -> &mut cef_context_menu_edit_state_flags_t {
&mut self.0
}
}
impl From<cef_context_menu_edit_state_flags_t> for ContextMenuEditStateFlags {
fn from(value: cef_context_menu_edit_state_flags_t) -> Self {
Self(value)
}
}
impl From<ContextMenuEditStateFlags> for cef_context_menu_edit_state_flags_t {
fn from(value: ContextMenuEditStateFlags) -> Self {
value.0
}
}
impl Default for ContextMenuEditStateFlags {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_quick_menu_edit_state_flags_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct QuickMenuEditStateFlags(cef_quick_menu_edit_state_flags_t);
impl AsRef<cef_quick_menu_edit_state_flags_t> for QuickMenuEditStateFlags {
fn as_ref(&self) -> &cef_quick_menu_edit_state_flags_t {
&self.0
}
}
impl AsMut<cef_quick_menu_edit_state_flags_t> for QuickMenuEditStateFlags {
fn as_mut(&mut self) -> &mut cef_quick_menu_edit_state_flags_t {
&mut self.0
}
}
impl From<cef_quick_menu_edit_state_flags_t> for QuickMenuEditStateFlags {
fn from(value: cef_quick_menu_edit_state_flags_t) -> Self {
Self(value)
}
}
impl From<QuickMenuEditStateFlags> for cef_quick_menu_edit_state_flags_t {
fn from(value: QuickMenuEditStateFlags) -> Self {
value.0
}
}
impl Default for QuickMenuEditStateFlags {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_key_event_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct KeyEventType(cef_key_event_type_t);
impl AsRef<cef_key_event_type_t> for KeyEventType {
fn as_ref(&self) -> &cef_key_event_type_t {
&self.0
}
}
impl AsMut<cef_key_event_type_t> for KeyEventType {
fn as_mut(&mut self) -> &mut cef_key_event_type_t {
&mut self.0
}
}
impl From<cef_key_event_type_t> for KeyEventType {
fn from(value: cef_key_event_type_t) -> Self {
Self(value)
}
}
impl From<KeyEventType> for cef_key_event_type_t {
fn from(value: KeyEventType) -> Self {
value.0
}
}
impl KeyEventType {
#[doc = "See [`cef_key_event_type_t::KEYEVENT_RAWKEYDOWN`] for more documentation."]
pub const RAWKEYDOWN: Self = Self(cef_key_event_type_t::KEYEVENT_RAWKEYDOWN);
#[doc = "See [`cef_key_event_type_t::KEYEVENT_KEYDOWN`] for more documentation."]
pub const KEYDOWN: Self = Self(cef_key_event_type_t::KEYEVENT_KEYDOWN);
#[doc = "See [`cef_key_event_type_t::KEYEVENT_KEYUP`] for more documentation."]
pub const KEYUP: Self = Self(cef_key_event_type_t::KEYEVENT_KEYUP);
#[doc = "See [`cef_key_event_type_t::KEYEVENT_CHAR`] for more documentation."]
pub const CHAR: Self = Self(cef_key_event_type_t::KEYEVENT_CHAR);
}
impl KeyEventType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for KeyEventType {
fn default() -> Self {
Self(cef_key_event_type_t::KEYEVENT_RAWKEYDOWN)
}
}
/// See [`cef_focus_source_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct FocusSource(cef_focus_source_t);
impl AsRef<cef_focus_source_t> for FocusSource {
fn as_ref(&self) -> &cef_focus_source_t {
&self.0
}
}
impl AsMut<cef_focus_source_t> for FocusSource {
fn as_mut(&mut self) -> &mut cef_focus_source_t {
&mut self.0
}
}
impl From<cef_focus_source_t> for FocusSource {
fn from(value: cef_focus_source_t) -> Self {
Self(value)
}
}
impl From<FocusSource> for cef_focus_source_t {
fn from(value: FocusSource) -> Self {
value.0
}
}
impl FocusSource {
#[doc = "See [`cef_focus_source_t::FOCUS_SOURCE_NAVIGATION`] for more documentation."]
pub const NAVIGATION: Self = Self(cef_focus_source_t::FOCUS_SOURCE_NAVIGATION);
#[doc = "See [`cef_focus_source_t::FOCUS_SOURCE_SYSTEM`] for more documentation."]
pub const SYSTEM: Self = Self(cef_focus_source_t::FOCUS_SOURCE_SYSTEM);
#[doc = "See [`cef_focus_source_t::FOCUS_SOURCE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_focus_source_t::FOCUS_SOURCE_NUM_VALUES);
}
impl FocusSource {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for FocusSource {
fn default() -> Self {
Self(cef_focus_source_t::FOCUS_SOURCE_NAVIGATION)
}
}
/// See [`cef_navigation_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NavigationType(cef_navigation_type_t);
impl AsRef<cef_navigation_type_t> for NavigationType {
fn as_ref(&self) -> &cef_navigation_type_t {
&self.0
}
}
impl AsMut<cef_navigation_type_t> for NavigationType {
fn as_mut(&mut self) -> &mut cef_navigation_type_t {
&mut self.0
}
}
impl From<cef_navigation_type_t> for NavigationType {
fn from(value: cef_navigation_type_t) -> Self {
Self(value)
}
}
impl From<NavigationType> for cef_navigation_type_t {
fn from(value: NavigationType) -> Self {
value.0
}
}
impl NavigationType {
#[doc = "See [`cef_navigation_type_t::NAVIGATION_LINK_CLICKED`] for more documentation."]
pub const LINK_CLICKED: Self = Self(cef_navigation_type_t::NAVIGATION_LINK_CLICKED);
#[doc = "See [`cef_navigation_type_t::NAVIGATION_FORM_SUBMITTED`] for more documentation."]
pub const FORM_SUBMITTED: Self = Self(cef_navigation_type_t::NAVIGATION_FORM_SUBMITTED);
#[doc = "See [`cef_navigation_type_t::NAVIGATION_BACK_FORWARD`] for more documentation."]
pub const BACK_FORWARD: Self = Self(cef_navigation_type_t::NAVIGATION_BACK_FORWARD);
#[doc = "See [`cef_navigation_type_t::NAVIGATION_RELOAD`] for more documentation."]
pub const RELOAD: Self = Self(cef_navigation_type_t::NAVIGATION_RELOAD);
#[doc = "See [`cef_navigation_type_t::NAVIGATION_FORM_RESUBMITTED`] for more documentation."]
pub const FORM_RESUBMITTED: Self = Self(cef_navigation_type_t::NAVIGATION_FORM_RESUBMITTED);
#[doc = "See [`cef_navigation_type_t::NAVIGATION_OTHER`] for more documentation."]
pub const OTHER: Self = Self(cef_navigation_type_t::NAVIGATION_OTHER);
#[doc = "See [`cef_navigation_type_t::NAVIGATION_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_navigation_type_t::NAVIGATION_NUM_VALUES);
}
impl NavigationType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for NavigationType {
fn default() -> Self {
Self(cef_navigation_type_t::NAVIGATION_LINK_CLICKED)
}
}
/// See [`cef_xml_encoding_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct XmlEncodingType(cef_xml_encoding_type_t);
impl AsRef<cef_xml_encoding_type_t> for XmlEncodingType {
fn as_ref(&self) -> &cef_xml_encoding_type_t {
&self.0
}
}
impl AsMut<cef_xml_encoding_type_t> for XmlEncodingType {
fn as_mut(&mut self) -> &mut cef_xml_encoding_type_t {
&mut self.0
}
}
impl From<cef_xml_encoding_type_t> for XmlEncodingType {
fn from(value: cef_xml_encoding_type_t) -> Self {
Self(value)
}
}
impl From<XmlEncodingType> for cef_xml_encoding_type_t {
fn from(value: XmlEncodingType) -> Self {
value.0
}
}
impl XmlEncodingType {
#[doc = "See [`cef_xml_encoding_type_t::XML_ENCODING_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_xml_encoding_type_t::XML_ENCODING_NONE);
#[doc = "See [`cef_xml_encoding_type_t::XML_ENCODING_UTF8`] for more documentation."]
pub const UTF8: Self = Self(cef_xml_encoding_type_t::XML_ENCODING_UTF8);
#[doc = "See [`cef_xml_encoding_type_t::XML_ENCODING_UTF16LE`] for more documentation."]
pub const UTF16LE: Self = Self(cef_xml_encoding_type_t::XML_ENCODING_UTF16LE);
#[doc = "See [`cef_xml_encoding_type_t::XML_ENCODING_UTF16BE`] for more documentation."]
pub const UTF16BE: Self = Self(cef_xml_encoding_type_t::XML_ENCODING_UTF16BE);
#[doc = "See [`cef_xml_encoding_type_t::XML_ENCODING_ASCII`] for more documentation."]
pub const ASCII: Self = Self(cef_xml_encoding_type_t::XML_ENCODING_ASCII);
#[doc = "See [`cef_xml_encoding_type_t::XML_ENCODING_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_xml_encoding_type_t::XML_ENCODING_NUM_VALUES);
}
impl XmlEncodingType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for XmlEncodingType {
fn default() -> Self {
Self(cef_xml_encoding_type_t::XML_ENCODING_NONE)
}
}
/// See [`cef_xml_node_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct XmlNodeType(cef_xml_node_type_t);
impl AsRef<cef_xml_node_type_t> for XmlNodeType {
fn as_ref(&self) -> &cef_xml_node_type_t {
&self.0
}
}
impl AsMut<cef_xml_node_type_t> for XmlNodeType {
fn as_mut(&mut self) -> &mut cef_xml_node_type_t {
&mut self.0
}
}
impl From<cef_xml_node_type_t> for XmlNodeType {
fn from(value: cef_xml_node_type_t) -> Self {
Self(value)
}
}
impl From<XmlNodeType> for cef_xml_node_type_t {
fn from(value: XmlNodeType) -> Self {
value.0
}
}
impl XmlNodeType {
#[doc = "See [`cef_xml_node_type_t::XML_NODE_UNSUPPORTED`] for more documentation."]
pub const UNSUPPORTED: Self = Self(cef_xml_node_type_t::XML_NODE_UNSUPPORTED);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_PROCESSING_INSTRUCTION`] for more documentation."]
pub const PROCESSING_INSTRUCTION: Self =
Self(cef_xml_node_type_t::XML_NODE_PROCESSING_INSTRUCTION);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_DOCUMENT_TYPE`] for more documentation."]
pub const DOCUMENT_TYPE: Self = Self(cef_xml_node_type_t::XML_NODE_DOCUMENT_TYPE);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_ELEMENT_START`] for more documentation."]
pub const ELEMENT_START: Self = Self(cef_xml_node_type_t::XML_NODE_ELEMENT_START);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_ELEMENT_END`] for more documentation."]
pub const ELEMENT_END: Self = Self(cef_xml_node_type_t::XML_NODE_ELEMENT_END);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_ATTRIBUTE`] for more documentation."]
pub const ATTRIBUTE: Self = Self(cef_xml_node_type_t::XML_NODE_ATTRIBUTE);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_TEXT`] for more documentation."]
pub const TEXT: Self = Self(cef_xml_node_type_t::XML_NODE_TEXT);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_CDATA`] for more documentation."]
pub const CDATA: Self = Self(cef_xml_node_type_t::XML_NODE_CDATA);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_ENTITY_REFERENCE`] for more documentation."]
pub const ENTITY_REFERENCE: Self = Self(cef_xml_node_type_t::XML_NODE_ENTITY_REFERENCE);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_WHITESPACE`] for more documentation."]
pub const WHITESPACE: Self = Self(cef_xml_node_type_t::XML_NODE_WHITESPACE);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_COMMENT`] for more documentation."]
pub const COMMENT: Self = Self(cef_xml_node_type_t::XML_NODE_COMMENT);
#[doc = "See [`cef_xml_node_type_t::XML_NODE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_xml_node_type_t::XML_NODE_NUM_VALUES);
}
impl XmlNodeType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for XmlNodeType {
fn default() -> Self {
Self(cef_xml_node_type_t::XML_NODE_UNSUPPORTED)
}
}
/// See [`cef_dom_document_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DomDocumentType(cef_dom_document_type_t);
impl AsRef<cef_dom_document_type_t> for DomDocumentType {
fn as_ref(&self) -> &cef_dom_document_type_t {
&self.0
}
}
impl AsMut<cef_dom_document_type_t> for DomDocumentType {
fn as_mut(&mut self) -> &mut cef_dom_document_type_t {
&mut self.0
}
}
impl From<cef_dom_document_type_t> for DomDocumentType {
fn from(value: cef_dom_document_type_t) -> Self {
Self(value)
}
}
impl From<DomDocumentType> for cef_dom_document_type_t {
fn from(value: DomDocumentType) -> Self {
value.0
}
}
impl DomDocumentType {
#[doc = "See [`cef_dom_document_type_t::DOM_DOCUMENT_TYPE_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_dom_document_type_t::DOM_DOCUMENT_TYPE_UNKNOWN);
#[doc = "See [`cef_dom_document_type_t::DOM_DOCUMENT_TYPE_HTML`] for more documentation."]
pub const HTML: Self = Self(cef_dom_document_type_t::DOM_DOCUMENT_TYPE_HTML);
#[doc = "See [`cef_dom_document_type_t::DOM_DOCUMENT_TYPE_XHTML`] for more documentation."]
pub const XHTML: Self = Self(cef_dom_document_type_t::DOM_DOCUMENT_TYPE_XHTML);
#[doc = "See [`cef_dom_document_type_t::DOM_DOCUMENT_TYPE_PLUGIN`] for more documentation."]
pub const PLUGIN: Self = Self(cef_dom_document_type_t::DOM_DOCUMENT_TYPE_PLUGIN);
#[doc = "See [`cef_dom_document_type_t::DOM_DOCUMENT_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_dom_document_type_t::DOM_DOCUMENT_TYPE_NUM_VALUES);
}
impl DomDocumentType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DomDocumentType {
fn default() -> Self {
Self(cef_dom_document_type_t::DOM_DOCUMENT_TYPE_UNKNOWN)
}
}
/// See [`cef_dom_event_category_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DomEventCategory(cef_dom_event_category_t);
impl AsRef<cef_dom_event_category_t> for DomEventCategory {
fn as_ref(&self) -> &cef_dom_event_category_t {
&self.0
}
}
impl AsMut<cef_dom_event_category_t> for DomEventCategory {
fn as_mut(&mut self) -> &mut cef_dom_event_category_t {
&mut self.0
}
}
impl From<cef_dom_event_category_t> for DomEventCategory {
fn from(value: cef_dom_event_category_t) -> Self {
Self(value)
}
}
impl From<DomEventCategory> for cef_dom_event_category_t {
fn from(value: DomEventCategory) -> Self {
value.0
}
}
impl DomEventCategory {
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_UNKNOWN);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_UI`] for more documentation."]
pub const UI: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_UI);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_MOUSE`] for more documentation."]
pub const MOUSE: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_MOUSE);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_MUTATION`] for more documentation."]
pub const MUTATION: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_MUTATION);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_KEYBOARD`] for more documentation."]
pub const KEYBOARD: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_KEYBOARD);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_TEXT`] for more documentation."]
pub const TEXT: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_TEXT);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_COMPOSITION`] for more documentation."]
pub const COMPOSITION: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_COMPOSITION);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_DRAG`] for more documentation."]
pub const DRAG: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_DRAG);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_CLIPBOARD`] for more documentation."]
pub const CLIPBOARD: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_CLIPBOARD);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_MESSAGE`] for more documentation."]
pub const MESSAGE: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_MESSAGE);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_WHEEL`] for more documentation."]
pub const WHEEL: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_WHEEL);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED`] for more documentation."]
pub const BEFORE_TEXT_INSERTED: Self =
Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_OVERFLOW`] for more documentation."]
pub const OVERFLOW: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_OVERFLOW);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_PAGE_TRANSITION`] for more documentation."]
pub const PAGE_TRANSITION: Self =
Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_PAGE_TRANSITION);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_POPSTATE`] for more documentation."]
pub const POPSTATE: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_POPSTATE);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_PROGRESS`] for more documentation."]
pub const PROGRESS: Self = Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_PROGRESS);
#[doc = "See [`cef_dom_event_category_t::DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS`] for more documentation."]
pub const XMLHTTPREQUEST_PROGRESS: Self =
Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS);
}
impl DomEventCategory {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DomEventCategory {
fn default() -> Self {
Self(cef_dom_event_category_t::DOM_EVENT_CATEGORY_UNKNOWN)
}
}
/// See [`cef_dom_event_phase_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DomEventPhase(cef_dom_event_phase_t);
impl AsRef<cef_dom_event_phase_t> for DomEventPhase {
fn as_ref(&self) -> &cef_dom_event_phase_t {
&self.0
}
}
impl AsMut<cef_dom_event_phase_t> for DomEventPhase {
fn as_mut(&mut self) -> &mut cef_dom_event_phase_t {
&mut self.0
}
}
impl From<cef_dom_event_phase_t> for DomEventPhase {
fn from(value: cef_dom_event_phase_t) -> Self {
Self(value)
}
}
impl From<DomEventPhase> for cef_dom_event_phase_t {
fn from(value: DomEventPhase) -> Self {
value.0
}
}
impl DomEventPhase {
#[doc = "See [`cef_dom_event_phase_t::DOM_EVENT_PHASE_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_dom_event_phase_t::DOM_EVENT_PHASE_UNKNOWN);
#[doc = "See [`cef_dom_event_phase_t::DOM_EVENT_PHASE_CAPTURING`] for more documentation."]
pub const CAPTURING: Self = Self(cef_dom_event_phase_t::DOM_EVENT_PHASE_CAPTURING);
#[doc = "See [`cef_dom_event_phase_t::DOM_EVENT_PHASE_AT_TARGET`] for more documentation."]
pub const AT_TARGET: Self = Self(cef_dom_event_phase_t::DOM_EVENT_PHASE_AT_TARGET);
#[doc = "See [`cef_dom_event_phase_t::DOM_EVENT_PHASE_BUBBLING`] for more documentation."]
pub const BUBBLING: Self = Self(cef_dom_event_phase_t::DOM_EVENT_PHASE_BUBBLING);
#[doc = "See [`cef_dom_event_phase_t::DOM_EVENT_PHASE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_dom_event_phase_t::DOM_EVENT_PHASE_NUM_VALUES);
}
impl DomEventPhase {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DomEventPhase {
fn default() -> Self {
Self(cef_dom_event_phase_t::DOM_EVENT_PHASE_UNKNOWN)
}
}
/// See [`cef_dom_node_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DomNodeType(cef_dom_node_type_t);
impl AsRef<cef_dom_node_type_t> for DomNodeType {
fn as_ref(&self) -> &cef_dom_node_type_t {
&self.0
}
}
impl AsMut<cef_dom_node_type_t> for DomNodeType {
fn as_mut(&mut self) -> &mut cef_dom_node_type_t {
&mut self.0
}
}
impl From<cef_dom_node_type_t> for DomNodeType {
fn from(value: cef_dom_node_type_t) -> Self {
Self(value)
}
}
impl From<DomNodeType> for cef_dom_node_type_t {
fn from(value: DomNodeType) -> Self {
value.0
}
}
impl DomNodeType {
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_UNSUPPORTED`] for more documentation."]
pub const UNSUPPORTED: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_UNSUPPORTED);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_ELEMENT`] for more documentation."]
pub const ELEMENT: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_ELEMENT);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_ATTRIBUTE`] for more documentation."]
pub const ATTRIBUTE: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_ATTRIBUTE);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_TEXT`] for more documentation."]
pub const TEXT: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_TEXT);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_CDATA_SECTION`] for more documentation."]
pub const CDATA_SECTION: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_CDATA_SECTION);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS`] for more documentation."]
pub const PROCESSING_INSTRUCTIONS: Self =
Self(cef_dom_node_type_t::DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_COMMENT`] for more documentation."]
pub const COMMENT: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_COMMENT);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_DOCUMENT`] for more documentation."]
pub const DOCUMENT: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_DOCUMENT);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_DOCUMENT_TYPE`] for more documentation."]
pub const DOCUMENT_TYPE: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_DOCUMENT_TYPE);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_DOCUMENT_FRAGMENT`] for more documentation."]
pub const DOCUMENT_FRAGMENT: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_DOCUMENT_FRAGMENT);
#[doc = "See [`cef_dom_node_type_t::DOM_NODE_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_dom_node_type_t::DOM_NODE_TYPE_NUM_VALUES);
}
impl DomNodeType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DomNodeType {
fn default() -> Self {
Self(cef_dom_node_type_t::DOM_NODE_TYPE_UNSUPPORTED)
}
}
/// See [`cef_dom_form_control_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DomFormControlType(cef_dom_form_control_type_t);
impl AsRef<cef_dom_form_control_type_t> for DomFormControlType {
fn as_ref(&self) -> &cef_dom_form_control_type_t {
&self.0
}
}
impl AsMut<cef_dom_form_control_type_t> for DomFormControlType {
fn as_mut(&mut self) -> &mut cef_dom_form_control_type_t {
&mut self.0
}
}
impl From<cef_dom_form_control_type_t> for DomFormControlType {
fn from(value: cef_dom_form_control_type_t) -> Self {
Self(value)
}
}
impl From<DomFormControlType> for cef_dom_form_control_type_t {
fn from(value: DomFormControlType) -> Self {
value.0
}
}
impl DomFormControlType {
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_UNSUPPORTED`] for more documentation."]
pub const UNSUPPORTED: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_UNSUPPORTED);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_BUTTON`] for more documentation."]
pub const BUTTON_BUTTON: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_BUTTON);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_SUBMIT`] for more documentation."]
pub const BUTTON_SUBMIT: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_SUBMIT);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_RESET`] for more documentation."]
pub const BUTTON_RESET: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_RESET);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_POPOVER`] for more documentation."]
pub const BUTTON_POPOVER: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_BUTTON_POPOVER);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_FIELDSET`] for more documentation."]
pub const FIELDSET: Self = Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_FIELDSET);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_BUTTON`] for more documentation."]
pub const INPUT_BUTTON: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_BUTTON);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_CHECKBOX`] for more documentation."]
pub const INPUT_CHECKBOX: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_CHECKBOX);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_COLOR`] for more documentation."]
pub const INPUT_COLOR: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_COLOR);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_DATE`] for more documentation."]
pub const INPUT_DATE: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_DATE);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_DATETIME_LOCAL`] for more documentation."]
pub const INPUT_DATETIME_LOCAL: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_DATETIME_LOCAL);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_EMAIL`] for more documentation."]
pub const INPUT_EMAIL: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_EMAIL);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_FILE`] for more documentation."]
pub const INPUT_FILE: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_FILE);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_HIDDEN`] for more documentation."]
pub const INPUT_HIDDEN: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_HIDDEN);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_IMAGE`] for more documentation."]
pub const INPUT_IMAGE: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_IMAGE);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_MONTH`] for more documentation."]
pub const INPUT_MONTH: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_MONTH);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_NUMBER`] for more documentation."]
pub const INPUT_NUMBER: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_NUMBER);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_PASSWORD`] for more documentation."]
pub const INPUT_PASSWORD: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_PASSWORD);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_RADIO`] for more documentation."]
pub const INPUT_RADIO: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_RADIO);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_RANGE`] for more documentation."]
pub const INPUT_RANGE: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_RANGE);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_RESET`] for more documentation."]
pub const INPUT_RESET: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_RESET);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_SEARCH`] for more documentation."]
pub const INPUT_SEARCH: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_SEARCH);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_SUBMIT`] for more documentation."]
pub const INPUT_SUBMIT: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_SUBMIT);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_TELEPHONE`] for more documentation."]
pub const INPUT_TELEPHONE: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_TELEPHONE);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_TEXT`] for more documentation."]
pub const INPUT_TEXT: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_TEXT);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_TIME`] for more documentation."]
pub const INPUT_TIME: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_TIME);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_URL`] for more documentation."]
pub const INPUT_URL: Self = Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_URL);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_WEEK`] for more documentation."]
pub const INPUT_WEEK: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_INPUT_WEEK);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_OUTPUT`] for more documentation."]
pub const OUTPUT: Self = Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_OUTPUT);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_SELECT_ONE`] for more documentation."]
pub const SELECT_ONE: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_SELECT_ONE);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_SELECT_MULTIPLE`] for more documentation."]
pub const SELECT_MULTIPLE: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_SELECT_MULTIPLE);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_TEXT_AREA`] for more documentation."]
pub const TEXT_AREA: Self = Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_TEXT_AREA);
#[doc = "See [`cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self =
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_NUM_VALUES);
}
impl DomFormControlType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DomFormControlType {
fn default() -> Self {
Self(cef_dom_form_control_type_t::DOM_FORM_CONTROL_TYPE_UNSUPPORTED)
}
}
/// See [`cef_file_dialog_mode_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct FileDialogMode(cef_file_dialog_mode_t);
impl AsRef<cef_file_dialog_mode_t> for FileDialogMode {
fn as_ref(&self) -> &cef_file_dialog_mode_t {
&self.0
}
}
impl AsMut<cef_file_dialog_mode_t> for FileDialogMode {
fn as_mut(&mut self) -> &mut cef_file_dialog_mode_t {
&mut self.0
}
}
impl From<cef_file_dialog_mode_t> for FileDialogMode {
fn from(value: cef_file_dialog_mode_t) -> Self {
Self(value)
}
}
impl From<FileDialogMode> for cef_file_dialog_mode_t {
fn from(value: FileDialogMode) -> Self {
value.0
}
}
impl FileDialogMode {
#[doc = "See [`cef_file_dialog_mode_t::FILE_DIALOG_OPEN`] for more documentation."]
pub const OPEN: Self = Self(cef_file_dialog_mode_t::FILE_DIALOG_OPEN);
#[doc = "See [`cef_file_dialog_mode_t::FILE_DIALOG_OPEN_MULTIPLE`] for more documentation."]
pub const OPEN_MULTIPLE: Self = Self(cef_file_dialog_mode_t::FILE_DIALOG_OPEN_MULTIPLE);
#[doc = "See [`cef_file_dialog_mode_t::FILE_DIALOG_OPEN_FOLDER`] for more documentation."]
pub const OPEN_FOLDER: Self = Self(cef_file_dialog_mode_t::FILE_DIALOG_OPEN_FOLDER);
#[doc = "See [`cef_file_dialog_mode_t::FILE_DIALOG_SAVE`] for more documentation."]
pub const SAVE: Self = Self(cef_file_dialog_mode_t::FILE_DIALOG_SAVE);
#[doc = "See [`cef_file_dialog_mode_t::FILE_DIALOG_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_file_dialog_mode_t::FILE_DIALOG_NUM_VALUES);
}
impl FileDialogMode {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for FileDialogMode {
fn default() -> Self {
Self(cef_file_dialog_mode_t::FILE_DIALOG_OPEN)
}
}
/// See [`cef_color_model_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ColorModel(cef_color_model_t);
impl AsRef<cef_color_model_t> for ColorModel {
fn as_ref(&self) -> &cef_color_model_t {
&self.0
}
}
impl AsMut<cef_color_model_t> for ColorModel {
fn as_mut(&mut self) -> &mut cef_color_model_t {
&mut self.0
}
}
impl From<cef_color_model_t> for ColorModel {
fn from(value: cef_color_model_t) -> Self {
Self(value)
}
}
impl From<ColorModel> for cef_color_model_t {
fn from(value: ColorModel) -> Self {
value.0
}
}
impl ColorModel {
#[doc = "See [`cef_color_model_t::COLOR_MODEL_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_color_model_t::COLOR_MODEL_UNKNOWN);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_GRAY`] for more documentation."]
pub const GRAY: Self = Self(cef_color_model_t::COLOR_MODEL_GRAY);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_COLOR`] for more documentation."]
pub const COLOR: Self = Self(cef_color_model_t::COLOR_MODEL_COLOR);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_CMYK`] for more documentation."]
pub const CMYK: Self = Self(cef_color_model_t::COLOR_MODEL_CMYK);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_CMY`] for more documentation."]
pub const CMY: Self = Self(cef_color_model_t::COLOR_MODEL_CMY);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_KCMY`] for more documentation."]
pub const KCMY: Self = Self(cef_color_model_t::COLOR_MODEL_KCMY);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_CMY_K`] for more documentation."]
pub const CMY_K: Self = Self(cef_color_model_t::COLOR_MODEL_CMY_K);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_BLACK`] for more documentation."]
pub const BLACK: Self = Self(cef_color_model_t::COLOR_MODEL_BLACK);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_GRAYSCALE`] for more documentation."]
pub const GRAYSCALE: Self = Self(cef_color_model_t::COLOR_MODEL_GRAYSCALE);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_RGB`] for more documentation."]
pub const RGB: Self = Self(cef_color_model_t::COLOR_MODEL_RGB);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_RGB16`] for more documentation."]
pub const RGB16: Self = Self(cef_color_model_t::COLOR_MODEL_RGB16);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_RGBA`] for more documentation."]
pub const RGBA: Self = Self(cef_color_model_t::COLOR_MODEL_RGBA);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_COLORMODE_COLOR`] for more documentation."]
pub const COLORMODE_COLOR: Self = Self(cef_color_model_t::COLOR_MODEL_COLORMODE_COLOR);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_COLORMODE_MONOCHROME`] for more documentation."]
pub const COLORMODE_MONOCHROME: Self =
Self(cef_color_model_t::COLOR_MODEL_COLORMODE_MONOCHROME);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_HP_COLOR_COLOR`] for more documentation."]
pub const HP_COLOR_COLOR: Self = Self(cef_color_model_t::COLOR_MODEL_HP_COLOR_COLOR);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_HP_COLOR_BLACK`] for more documentation."]
pub const HP_COLOR_BLACK: Self = Self(cef_color_model_t::COLOR_MODEL_HP_COLOR_BLACK);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_PRINTOUTMODE_NORMAL`] for more documentation."]
pub const PRINTOUTMODE_NORMAL: Self = Self(cef_color_model_t::COLOR_MODEL_PRINTOUTMODE_NORMAL);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY`] for more documentation."]
pub const PRINTOUTMODE_NORMAL_GRAY: Self =
Self(cef_color_model_t::COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_PROCESSCOLORMODEL_CMYK`] for more documentation."]
pub const PROCESSCOLORMODEL_CMYK: Self =
Self(cef_color_model_t::COLOR_MODEL_PROCESSCOLORMODEL_CMYK);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE`] for more documentation."]
pub const PROCESSCOLORMODEL_GREYSCALE: Self =
Self(cef_color_model_t::COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_PROCESSCOLORMODEL_RGB`] for more documentation."]
pub const PROCESSCOLORMODEL_RGB: Self =
Self(cef_color_model_t::COLOR_MODEL_PROCESSCOLORMODEL_RGB);
#[doc = "See [`cef_color_model_t::COLOR_MODEL_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_color_model_t::COLOR_MODEL_NUM_VALUES);
}
impl ColorModel {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ColorModel {
fn default() -> Self {
Self(cef_color_model_t::COLOR_MODEL_UNKNOWN)
}
}
/// See [`cef_duplex_mode_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DuplexMode(cef_duplex_mode_t);
impl AsRef<cef_duplex_mode_t> for DuplexMode {
fn as_ref(&self) -> &cef_duplex_mode_t {
&self.0
}
}
impl AsMut<cef_duplex_mode_t> for DuplexMode {
fn as_mut(&mut self) -> &mut cef_duplex_mode_t {
&mut self.0
}
}
impl From<cef_duplex_mode_t> for DuplexMode {
fn from(value: cef_duplex_mode_t) -> Self {
Self(value)
}
}
impl From<DuplexMode> for cef_duplex_mode_t {
fn from(value: DuplexMode) -> Self {
value.0
}
}
impl DuplexMode {
#[doc = "See [`cef_duplex_mode_t::DUPLEX_MODE_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_duplex_mode_t::DUPLEX_MODE_UNKNOWN);
#[doc = "See [`cef_duplex_mode_t::DUPLEX_MODE_SIMPLEX`] for more documentation."]
pub const SIMPLEX: Self = Self(cef_duplex_mode_t::DUPLEX_MODE_SIMPLEX);
#[doc = "See [`cef_duplex_mode_t::DUPLEX_MODE_LONG_EDGE`] for more documentation."]
pub const LONG_EDGE: Self = Self(cef_duplex_mode_t::DUPLEX_MODE_LONG_EDGE);
#[doc = "See [`cef_duplex_mode_t::DUPLEX_MODE_SHORT_EDGE`] for more documentation."]
pub const SHORT_EDGE: Self = Self(cef_duplex_mode_t::DUPLEX_MODE_SHORT_EDGE);
#[doc = "See [`cef_duplex_mode_t::DUPLEX_MODE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_duplex_mode_t::DUPLEX_MODE_NUM_VALUES);
}
impl DuplexMode {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DuplexMode {
fn default() -> Self {
Self(cef_duplex_mode_t::DUPLEX_MODE_UNKNOWN)
}
}
/// See [`cef_cursor_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct CursorType(cef_cursor_type_t);
impl AsRef<cef_cursor_type_t> for CursorType {
fn as_ref(&self) -> &cef_cursor_type_t {
&self.0
}
}
impl AsMut<cef_cursor_type_t> for CursorType {
fn as_mut(&mut self) -> &mut cef_cursor_type_t {
&mut self.0
}
}
impl From<cef_cursor_type_t> for CursorType {
fn from(value: cef_cursor_type_t) -> Self {
Self(value)
}
}
impl From<CursorType> for cef_cursor_type_t {
fn from(value: CursorType) -> Self {
value.0
}
}
impl CursorType {
#[doc = "See [`cef_cursor_type_t::CT_POINTER`] for more documentation."]
pub const POINTER: Self = Self(cef_cursor_type_t::CT_POINTER);
#[doc = "See [`cef_cursor_type_t::CT_CROSS`] for more documentation."]
pub const CROSS: Self = Self(cef_cursor_type_t::CT_CROSS);
#[doc = "See [`cef_cursor_type_t::CT_HAND`] for more documentation."]
pub const HAND: Self = Self(cef_cursor_type_t::CT_HAND);
#[doc = "See [`cef_cursor_type_t::CT_IBEAM`] for more documentation."]
pub const IBEAM: Self = Self(cef_cursor_type_t::CT_IBEAM);
#[doc = "See [`cef_cursor_type_t::CT_WAIT`] for more documentation."]
pub const WAIT: Self = Self(cef_cursor_type_t::CT_WAIT);
#[doc = "See [`cef_cursor_type_t::CT_HELP`] for more documentation."]
pub const HELP: Self = Self(cef_cursor_type_t::CT_HELP);
#[doc = "See [`cef_cursor_type_t::CT_EASTRESIZE`] for more documentation."]
pub const EASTRESIZE: Self = Self(cef_cursor_type_t::CT_EASTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_NORTHRESIZE`] for more documentation."]
pub const NORTHRESIZE: Self = Self(cef_cursor_type_t::CT_NORTHRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_NORTHEASTRESIZE`] for more documentation."]
pub const NORTHEASTRESIZE: Self = Self(cef_cursor_type_t::CT_NORTHEASTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_NORTHWESTRESIZE`] for more documentation."]
pub const NORTHWESTRESIZE: Self = Self(cef_cursor_type_t::CT_NORTHWESTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_SOUTHRESIZE`] for more documentation."]
pub const SOUTHRESIZE: Self = Self(cef_cursor_type_t::CT_SOUTHRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_SOUTHEASTRESIZE`] for more documentation."]
pub const SOUTHEASTRESIZE: Self = Self(cef_cursor_type_t::CT_SOUTHEASTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_SOUTHWESTRESIZE`] for more documentation."]
pub const SOUTHWESTRESIZE: Self = Self(cef_cursor_type_t::CT_SOUTHWESTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_WESTRESIZE`] for more documentation."]
pub const WESTRESIZE: Self = Self(cef_cursor_type_t::CT_WESTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_NORTHSOUTHRESIZE`] for more documentation."]
pub const NORTHSOUTHRESIZE: Self = Self(cef_cursor_type_t::CT_NORTHSOUTHRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_EASTWESTRESIZE`] for more documentation."]
pub const EASTWESTRESIZE: Self = Self(cef_cursor_type_t::CT_EASTWESTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_NORTHEASTSOUTHWESTRESIZE`] for more documentation."]
pub const NORTHEASTSOUTHWESTRESIZE: Self = Self(cef_cursor_type_t::CT_NORTHEASTSOUTHWESTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_NORTHWESTSOUTHEASTRESIZE`] for more documentation."]
pub const NORTHWESTSOUTHEASTRESIZE: Self = Self(cef_cursor_type_t::CT_NORTHWESTSOUTHEASTRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_COLUMNRESIZE`] for more documentation."]
pub const COLUMNRESIZE: Self = Self(cef_cursor_type_t::CT_COLUMNRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_ROWRESIZE`] for more documentation."]
pub const ROWRESIZE: Self = Self(cef_cursor_type_t::CT_ROWRESIZE);
#[doc = "See [`cef_cursor_type_t::CT_MIDDLEPANNING`] for more documentation."]
pub const MIDDLEPANNING: Self = Self(cef_cursor_type_t::CT_MIDDLEPANNING);
#[doc = "See [`cef_cursor_type_t::CT_EASTPANNING`] for more documentation."]
pub const EASTPANNING: Self = Self(cef_cursor_type_t::CT_EASTPANNING);
#[doc = "See [`cef_cursor_type_t::CT_NORTHPANNING`] for more documentation."]
pub const NORTHPANNING: Self = Self(cef_cursor_type_t::CT_NORTHPANNING);
#[doc = "See [`cef_cursor_type_t::CT_NORTHEASTPANNING`] for more documentation."]
pub const NORTHEASTPANNING: Self = Self(cef_cursor_type_t::CT_NORTHEASTPANNING);
#[doc = "See [`cef_cursor_type_t::CT_NORTHWESTPANNING`] for more documentation."]
pub const NORTHWESTPANNING: Self = Self(cef_cursor_type_t::CT_NORTHWESTPANNING);
#[doc = "See [`cef_cursor_type_t::CT_SOUTHPANNING`] for more documentation."]
pub const SOUTHPANNING: Self = Self(cef_cursor_type_t::CT_SOUTHPANNING);
#[doc = "See [`cef_cursor_type_t::CT_SOUTHEASTPANNING`] for more documentation."]
pub const SOUTHEASTPANNING: Self = Self(cef_cursor_type_t::CT_SOUTHEASTPANNING);
#[doc = "See [`cef_cursor_type_t::CT_SOUTHWESTPANNING`] for more documentation."]
pub const SOUTHWESTPANNING: Self = Self(cef_cursor_type_t::CT_SOUTHWESTPANNING);
#[doc = "See [`cef_cursor_type_t::CT_WESTPANNING`] for more documentation."]
pub const WESTPANNING: Self = Self(cef_cursor_type_t::CT_WESTPANNING);
#[doc = "See [`cef_cursor_type_t::CT_MOVE`] for more documentation."]
pub const MOVE: Self = Self(cef_cursor_type_t::CT_MOVE);
#[doc = "See [`cef_cursor_type_t::CT_VERTICALTEXT`] for more documentation."]
pub const VERTICALTEXT: Self = Self(cef_cursor_type_t::CT_VERTICALTEXT);
#[doc = "See [`cef_cursor_type_t::CT_CELL`] for more documentation."]
pub const CELL: Self = Self(cef_cursor_type_t::CT_CELL);
#[doc = "See [`cef_cursor_type_t::CT_CONTEXTMENU`] for more documentation."]
pub const CONTEXTMENU: Self = Self(cef_cursor_type_t::CT_CONTEXTMENU);
#[doc = "See [`cef_cursor_type_t::CT_ALIAS`] for more documentation."]
pub const ALIAS: Self = Self(cef_cursor_type_t::CT_ALIAS);
#[doc = "See [`cef_cursor_type_t::CT_PROGRESS`] for more documentation."]
pub const PROGRESS: Self = Self(cef_cursor_type_t::CT_PROGRESS);
#[doc = "See [`cef_cursor_type_t::CT_NODROP`] for more documentation."]
pub const NODROP: Self = Self(cef_cursor_type_t::CT_NODROP);
#[doc = "See [`cef_cursor_type_t::CT_COPY`] for more documentation."]
pub const COPY: Self = Self(cef_cursor_type_t::CT_COPY);
#[doc = "See [`cef_cursor_type_t::CT_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_cursor_type_t::CT_NONE);
#[doc = "See [`cef_cursor_type_t::CT_NOTALLOWED`] for more documentation."]
pub const NOTALLOWED: Self = Self(cef_cursor_type_t::CT_NOTALLOWED);
#[doc = "See [`cef_cursor_type_t::CT_ZOOMIN`] for more documentation."]
pub const ZOOMIN: Self = Self(cef_cursor_type_t::CT_ZOOMIN);
#[doc = "See [`cef_cursor_type_t::CT_ZOOMOUT`] for more documentation."]
pub const ZOOMOUT: Self = Self(cef_cursor_type_t::CT_ZOOMOUT);
#[doc = "See [`cef_cursor_type_t::CT_GRAB`] for more documentation."]
pub const GRAB: Self = Self(cef_cursor_type_t::CT_GRAB);
#[doc = "See [`cef_cursor_type_t::CT_GRABBING`] for more documentation."]
pub const GRABBING: Self = Self(cef_cursor_type_t::CT_GRABBING);
#[doc = "See [`cef_cursor_type_t::CT_MIDDLE_PANNING_VERTICAL`] for more documentation."]
pub const MIDDLE_PANNING_VERTICAL: Self = Self(cef_cursor_type_t::CT_MIDDLE_PANNING_VERTICAL);
#[doc = "See [`cef_cursor_type_t::CT_MIDDLE_PANNING_HORIZONTAL`] for more documentation."]
pub const MIDDLE_PANNING_HORIZONTAL: Self =
Self(cef_cursor_type_t::CT_MIDDLE_PANNING_HORIZONTAL);
#[doc = "See [`cef_cursor_type_t::CT_CUSTOM`] for more documentation."]
pub const CUSTOM: Self = Self(cef_cursor_type_t::CT_CUSTOM);
#[doc = "See [`cef_cursor_type_t::CT_DND_NONE`] for more documentation."]
pub const DND_NONE: Self = Self(cef_cursor_type_t::CT_DND_NONE);
#[doc = "See [`cef_cursor_type_t::CT_DND_MOVE`] for more documentation."]
pub const DND_MOVE: Self = Self(cef_cursor_type_t::CT_DND_MOVE);
#[doc = "See [`cef_cursor_type_t::CT_DND_COPY`] for more documentation."]
pub const DND_COPY: Self = Self(cef_cursor_type_t::CT_DND_COPY);
#[doc = "See [`cef_cursor_type_t::CT_DND_LINK`] for more documentation."]
pub const DND_LINK: Self = Self(cef_cursor_type_t::CT_DND_LINK);
#[doc = "See [`cef_cursor_type_t::CT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_cursor_type_t::CT_NUM_VALUES);
}
impl CursorType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for CursorType {
fn default() -> Self {
Self(cef_cursor_type_t::CT_POINTER)
}
}
/// See [`cef_uri_unescape_rule_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct UriUnescapeRule(cef_uri_unescape_rule_t);
impl AsRef<cef_uri_unescape_rule_t> for UriUnescapeRule {
fn as_ref(&self) -> &cef_uri_unescape_rule_t {
&self.0
}
}
impl AsMut<cef_uri_unescape_rule_t> for UriUnescapeRule {
fn as_mut(&mut self) -> &mut cef_uri_unescape_rule_t {
&mut self.0
}
}
impl From<cef_uri_unescape_rule_t> for UriUnescapeRule {
fn from(value: cef_uri_unescape_rule_t) -> Self {
Self(value)
}
}
impl From<UriUnescapeRule> for cef_uri_unescape_rule_t {
fn from(value: UriUnescapeRule) -> Self {
value.0
}
}
impl UriUnescapeRule {
#[doc = "See [`cef_uri_unescape_rule_t::UU_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_uri_unescape_rule_t::UU_NONE);
#[doc = "See [`cef_uri_unescape_rule_t::UU_NORMAL`] for more documentation."]
pub const NORMAL: Self = Self(cef_uri_unescape_rule_t::UU_NORMAL);
#[doc = "See [`cef_uri_unescape_rule_t::UU_SPACES`] for more documentation."]
pub const SPACES: Self = Self(cef_uri_unescape_rule_t::UU_SPACES);
#[doc = "See [`cef_uri_unescape_rule_t::UU_PATH_SEPARATORS`] for more documentation."]
pub const PATH_SEPARATORS: Self = Self(cef_uri_unescape_rule_t::UU_PATH_SEPARATORS);
#[doc = "See [`cef_uri_unescape_rule_t::UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS`] for more documentation."]
pub const URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS: Self =
Self(cef_uri_unescape_rule_t::UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS);
#[doc = "See [`cef_uri_unescape_rule_t::UU_REPLACE_PLUS_WITH_SPACE`] for more documentation."]
pub const REPLACE_PLUS_WITH_SPACE: Self =
Self(cef_uri_unescape_rule_t::UU_REPLACE_PLUS_WITH_SPACE);
}
impl UriUnescapeRule {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for UriUnescapeRule {
fn default() -> Self {
Self(cef_uri_unescape_rule_t::UU_NONE)
}
}
/// See [`cef_json_parser_options_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct JsonParserOptions(cef_json_parser_options_t);
impl AsRef<cef_json_parser_options_t> for JsonParserOptions {
fn as_ref(&self) -> &cef_json_parser_options_t {
&self.0
}
}
impl AsMut<cef_json_parser_options_t> for JsonParserOptions {
fn as_mut(&mut self) -> &mut cef_json_parser_options_t {
&mut self.0
}
}
impl From<cef_json_parser_options_t> for JsonParserOptions {
fn from(value: cef_json_parser_options_t) -> Self {
Self(value)
}
}
impl From<JsonParserOptions> for cef_json_parser_options_t {
fn from(value: JsonParserOptions) -> Self {
value.0
}
}
impl JsonParserOptions {
#[doc = "See [`cef_json_parser_options_t::JSON_PARSER_RFC`] for more documentation."]
pub const RFC: Self = Self(cef_json_parser_options_t::JSON_PARSER_RFC);
#[doc = "See [`cef_json_parser_options_t::JSON_PARSER_ALLOW_TRAILING_COMMAS`] for more documentation."]
pub const ALLOW_TRAILING_COMMAS: Self =
Self(cef_json_parser_options_t::JSON_PARSER_ALLOW_TRAILING_COMMAS);
}
impl JsonParserOptions {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for JsonParserOptions {
fn default() -> Self {
Self(cef_json_parser_options_t::JSON_PARSER_RFC)
}
}
/// See [`cef_json_writer_options_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct JsonWriterOptions(cef_json_writer_options_t);
impl AsRef<cef_json_writer_options_t> for JsonWriterOptions {
fn as_ref(&self) -> &cef_json_writer_options_t {
&self.0
}
}
impl AsMut<cef_json_writer_options_t> for JsonWriterOptions {
fn as_mut(&mut self) -> &mut cef_json_writer_options_t {
&mut self.0
}
}
impl From<cef_json_writer_options_t> for JsonWriterOptions {
fn from(value: cef_json_writer_options_t) -> Self {
Self(value)
}
}
impl From<JsonWriterOptions> for cef_json_writer_options_t {
fn from(value: JsonWriterOptions) -> Self {
value.0
}
}
impl JsonWriterOptions {
#[doc = "See [`cef_json_writer_options_t::JSON_WRITER_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_json_writer_options_t::JSON_WRITER_DEFAULT);
#[doc = "See [`cef_json_writer_options_t::JSON_WRITER_OMIT_BINARY_VALUES`] for more documentation."]
pub const OMIT_BINARY_VALUES: Self =
Self(cef_json_writer_options_t::JSON_WRITER_OMIT_BINARY_VALUES);
#[doc = "See [`cef_json_writer_options_t::JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION`] for more documentation."]
pub const OMIT_DOUBLE_TYPE_PRESERVATION: Self =
Self(cef_json_writer_options_t::JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION);
#[doc = "See [`cef_json_writer_options_t::JSON_WRITER_PRETTY_PRINT`] for more documentation."]
pub const PRETTY_PRINT: Self = Self(cef_json_writer_options_t::JSON_WRITER_PRETTY_PRINT);
}
impl JsonWriterOptions {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for JsonWriterOptions {
fn default() -> Self {
Self(cef_json_writer_options_t::JSON_WRITER_DEFAULT)
}
}
/// See [`cef_pdf_print_margin_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PdfPrintMarginType(cef_pdf_print_margin_type_t);
impl AsRef<cef_pdf_print_margin_type_t> for PdfPrintMarginType {
fn as_ref(&self) -> &cef_pdf_print_margin_type_t {
&self.0
}
}
impl AsMut<cef_pdf_print_margin_type_t> for PdfPrintMarginType {
fn as_mut(&mut self) -> &mut cef_pdf_print_margin_type_t {
&mut self.0
}
}
impl From<cef_pdf_print_margin_type_t> for PdfPrintMarginType {
fn from(value: cef_pdf_print_margin_type_t) -> Self {
Self(value)
}
}
impl From<PdfPrintMarginType> for cef_pdf_print_margin_type_t {
fn from(value: PdfPrintMarginType) -> Self {
value.0
}
}
impl PdfPrintMarginType {
#[doc = "See [`cef_pdf_print_margin_type_t::PDF_PRINT_MARGIN_DEFAULT`] for more documentation."]
pub const DEFAULT: Self = Self(cef_pdf_print_margin_type_t::PDF_PRINT_MARGIN_DEFAULT);
#[doc = "See [`cef_pdf_print_margin_type_t::PDF_PRINT_MARGIN_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_pdf_print_margin_type_t::PDF_PRINT_MARGIN_NONE);
#[doc = "See [`cef_pdf_print_margin_type_t::PDF_PRINT_MARGIN_CUSTOM`] for more documentation."]
pub const CUSTOM: Self = Self(cef_pdf_print_margin_type_t::PDF_PRINT_MARGIN_CUSTOM);
}
impl PdfPrintMarginType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PdfPrintMarginType {
fn default() -> Self {
Self(cef_pdf_print_margin_type_t::PDF_PRINT_MARGIN_DEFAULT)
}
}
/// See [`cef_scale_factor_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ScaleFactor(cef_scale_factor_t);
impl AsRef<cef_scale_factor_t> for ScaleFactor {
fn as_ref(&self) -> &cef_scale_factor_t {
&self.0
}
}
impl AsMut<cef_scale_factor_t> for ScaleFactor {
fn as_mut(&mut self) -> &mut cef_scale_factor_t {
&mut self.0
}
}
impl From<cef_scale_factor_t> for ScaleFactor {
fn from(value: cef_scale_factor_t) -> Self {
Self(value)
}
}
impl From<ScaleFactor> for cef_scale_factor_t {
fn from(value: ScaleFactor) -> Self {
value.0
}
}
impl ScaleFactor {
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_scale_factor_t::SCALE_FACTOR_NONE);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_100P`] for more documentation."]
pub const FACTOR_100P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_100P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_125P`] for more documentation."]
pub const FACTOR_125P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_125P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_133P`] for more documentation."]
pub const FACTOR_133P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_133P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_140P`] for more documentation."]
pub const FACTOR_140P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_140P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_150P`] for more documentation."]
pub const FACTOR_150P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_150P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_180P`] for more documentation."]
pub const FACTOR_180P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_180P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_200P`] for more documentation."]
pub const FACTOR_200P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_200P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_250P`] for more documentation."]
pub const FACTOR_250P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_250P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_300P`] for more documentation."]
pub const FACTOR_300P: Self = Self(cef_scale_factor_t::SCALE_FACTOR_300P);
#[doc = "See [`cef_scale_factor_t::SCALE_FACTOR_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_scale_factor_t::SCALE_FACTOR_NUM_VALUES);
}
impl ScaleFactor {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ScaleFactor {
fn default() -> Self {
Self(cef_scale_factor_t::SCALE_FACTOR_NONE)
}
}
/// See [`cef_referrer_policy_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ReferrerPolicy(cef_referrer_policy_t);
impl AsRef<cef_referrer_policy_t> for ReferrerPolicy {
fn as_ref(&self) -> &cef_referrer_policy_t {
&self.0
}
}
impl AsMut<cef_referrer_policy_t> for ReferrerPolicy {
fn as_mut(&mut self) -> &mut cef_referrer_policy_t {
&mut self.0
}
}
impl From<cef_referrer_policy_t> for ReferrerPolicy {
fn from(value: cef_referrer_policy_t) -> Self {
Self(value)
}
}
impl From<ReferrerPolicy> for cef_referrer_policy_t {
fn from(value: ReferrerPolicy) -> Self {
value.0
}
}
impl ReferrerPolicy {
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE`] for more documentation."]
pub const CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: Self = Self(
cef_referrer_policy_t::REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
);
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN`] for more documentation."]
pub const REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN : Self = Self (cef_referrer_policy_t :: REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN) ;
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN`] for more documentation."]
pub const ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN: Self =
Self(cef_referrer_policy_t::REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN);
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_NEVER_CLEAR_REFERRER`] for more documentation."]
pub const NEVER_CLEAR_REFERRER: Self =
Self(cef_referrer_policy_t::REFERRER_POLICY_NEVER_CLEAR_REFERRER);
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_ORIGIN`] for more documentation."]
pub const ORIGIN: Self = Self(cef_referrer_policy_t::REFERRER_POLICY_ORIGIN);
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN`] for more documentation."]
pub const CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN: Self =
Self(cef_referrer_policy_t::REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN);
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE`] for more documentation."]
pub const ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE: Self = Self(
cef_referrer_policy_t::REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
);
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_NO_REFERRER`] for more documentation."]
pub const NO_REFERRER: Self = Self(cef_referrer_policy_t::REFERRER_POLICY_NO_REFERRER);
#[doc = "See [`cef_referrer_policy_t::REFERRER_POLICY_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_referrer_policy_t::REFERRER_POLICY_NUM_VALUES);
}
impl ReferrerPolicy {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ReferrerPolicy {
fn default() -> Self {
Self (cef_referrer_policy_t :: REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE)
}
}
/// See [`cef_response_filter_status_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ResponseFilterStatus(cef_response_filter_status_t);
impl AsRef<cef_response_filter_status_t> for ResponseFilterStatus {
fn as_ref(&self) -> &cef_response_filter_status_t {
&self.0
}
}
impl AsMut<cef_response_filter_status_t> for ResponseFilterStatus {
fn as_mut(&mut self) -> &mut cef_response_filter_status_t {
&mut self.0
}
}
impl From<cef_response_filter_status_t> for ResponseFilterStatus {
fn from(value: cef_response_filter_status_t) -> Self {
Self(value)
}
}
impl From<ResponseFilterStatus> for cef_response_filter_status_t {
fn from(value: ResponseFilterStatus) -> Self {
value.0
}
}
impl ResponseFilterStatus {
#[doc = "See [`cef_response_filter_status_t::RESPONSE_FILTER_NEED_MORE_DATA`] for more documentation."]
pub const NEED_MORE_DATA: Self =
Self(cef_response_filter_status_t::RESPONSE_FILTER_NEED_MORE_DATA);
#[doc = "See [`cef_response_filter_status_t::RESPONSE_FILTER_DONE`] for more documentation."]
pub const DONE: Self = Self(cef_response_filter_status_t::RESPONSE_FILTER_DONE);
#[doc = "See [`cef_response_filter_status_t::RESPONSE_FILTER_ERROR`] for more documentation."]
pub const ERROR: Self = Self(cef_response_filter_status_t::RESPONSE_FILTER_ERROR);
}
impl ResponseFilterStatus {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ResponseFilterStatus {
fn default() -> Self {
Self(cef_response_filter_status_t::RESPONSE_FILTER_NEED_MORE_DATA)
}
}
/// See [`cef_alpha_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct AlphaType(cef_alpha_type_t);
impl AsRef<cef_alpha_type_t> for AlphaType {
fn as_ref(&self) -> &cef_alpha_type_t {
&self.0
}
}
impl AsMut<cef_alpha_type_t> for AlphaType {
fn as_mut(&mut self) -> &mut cef_alpha_type_t {
&mut self.0
}
}
impl From<cef_alpha_type_t> for AlphaType {
fn from(value: cef_alpha_type_t) -> Self {
Self(value)
}
}
impl From<AlphaType> for cef_alpha_type_t {
fn from(value: AlphaType) -> Self {
value.0
}
}
impl AlphaType {
#[doc = "See [`cef_alpha_type_t::CEF_ALPHA_TYPE_OPAQUE`] for more documentation."]
pub const OPAQUE: Self = Self(cef_alpha_type_t::CEF_ALPHA_TYPE_OPAQUE);
#[doc = "See [`cef_alpha_type_t::CEF_ALPHA_TYPE_PREMULTIPLIED`] for more documentation."]
pub const PREMULTIPLIED: Self = Self(cef_alpha_type_t::CEF_ALPHA_TYPE_PREMULTIPLIED);
#[doc = "See [`cef_alpha_type_t::CEF_ALPHA_TYPE_POSTMULTIPLIED`] for more documentation."]
pub const POSTMULTIPLIED: Self = Self(cef_alpha_type_t::CEF_ALPHA_TYPE_POSTMULTIPLIED);
}
impl AlphaType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for AlphaType {
fn default() -> Self {
Self(cef_alpha_type_t::CEF_ALPHA_TYPE_OPAQUE)
}
}
/// See [`cef_text_style_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TextStyle(cef_text_style_t);
impl AsRef<cef_text_style_t> for TextStyle {
fn as_ref(&self) -> &cef_text_style_t {
&self.0
}
}
impl AsMut<cef_text_style_t> for TextStyle {
fn as_mut(&mut self) -> &mut cef_text_style_t {
&mut self.0
}
}
impl From<cef_text_style_t> for TextStyle {
fn from(value: cef_text_style_t) -> Self {
Self(value)
}
}
impl From<TextStyle> for cef_text_style_t {
fn from(value: TextStyle) -> Self {
value.0
}
}
impl TextStyle {
#[doc = "See [`cef_text_style_t::CEF_TEXT_STYLE_BOLD`] for more documentation."]
pub const BOLD: Self = Self(cef_text_style_t::CEF_TEXT_STYLE_BOLD);
#[doc = "See [`cef_text_style_t::CEF_TEXT_STYLE_ITALIC`] for more documentation."]
pub const ITALIC: Self = Self(cef_text_style_t::CEF_TEXT_STYLE_ITALIC);
#[doc = "See [`cef_text_style_t::CEF_TEXT_STYLE_STRIKE`] for more documentation."]
pub const STRIKE: Self = Self(cef_text_style_t::CEF_TEXT_STYLE_STRIKE);
#[doc = "See [`cef_text_style_t::CEF_TEXT_STYLE_DIAGONAL_STRIKE`] for more documentation."]
pub const DIAGONAL_STRIKE: Self = Self(cef_text_style_t::CEF_TEXT_STYLE_DIAGONAL_STRIKE);
#[doc = "See [`cef_text_style_t::CEF_TEXT_STYLE_UNDERLINE`] for more documentation."]
pub const UNDERLINE: Self = Self(cef_text_style_t::CEF_TEXT_STYLE_UNDERLINE);
#[doc = "See [`cef_text_style_t::CEF_TEXT_STYLE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_text_style_t::CEF_TEXT_STYLE_NUM_VALUES);
}
impl TextStyle {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TextStyle {
fn default() -> Self {
Self(cef_text_style_t::CEF_TEXT_STYLE_BOLD)
}
}
/// See [`cef_axis_alignment_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct AxisAlignment(cef_axis_alignment_t);
impl AsRef<cef_axis_alignment_t> for AxisAlignment {
fn as_ref(&self) -> &cef_axis_alignment_t {
&self.0
}
}
impl AsMut<cef_axis_alignment_t> for AxisAlignment {
fn as_mut(&mut self) -> &mut cef_axis_alignment_t {
&mut self.0
}
}
impl From<cef_axis_alignment_t> for AxisAlignment {
fn from(value: cef_axis_alignment_t) -> Self {
Self(value)
}
}
impl From<AxisAlignment> for cef_axis_alignment_t {
fn from(value: AxisAlignment) -> Self {
value.0
}
}
impl AxisAlignment {
#[doc = "See [`cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_START`] for more documentation."]
pub const START: Self = Self(cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_START);
#[doc = "See [`cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_CENTER`] for more documentation."]
pub const CENTER: Self = Self(cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_CENTER);
#[doc = "See [`cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_END`] for more documentation."]
pub const END: Self = Self(cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_END);
#[doc = "See [`cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_STRETCH`] for more documentation."]
pub const STRETCH: Self = Self(cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_STRETCH);
#[doc = "See [`cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_NUM_VALUES);
}
impl AxisAlignment {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for AxisAlignment {
fn default() -> Self {
Self(cef_axis_alignment_t::CEF_AXIS_ALIGNMENT_START)
}
}
/// See [`cef_button_state_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ButtonState(cef_button_state_t);
impl AsRef<cef_button_state_t> for ButtonState {
fn as_ref(&self) -> &cef_button_state_t {
&self.0
}
}
impl AsMut<cef_button_state_t> for ButtonState {
fn as_mut(&mut self) -> &mut cef_button_state_t {
&mut self.0
}
}
impl From<cef_button_state_t> for ButtonState {
fn from(value: cef_button_state_t) -> Self {
Self(value)
}
}
impl From<ButtonState> for cef_button_state_t {
fn from(value: ButtonState) -> Self {
value.0
}
}
impl ButtonState {
#[doc = "See [`cef_button_state_t::CEF_BUTTON_STATE_NORMAL`] for more documentation."]
pub const NORMAL: Self = Self(cef_button_state_t::CEF_BUTTON_STATE_NORMAL);
#[doc = "See [`cef_button_state_t::CEF_BUTTON_STATE_HOVERED`] for more documentation."]
pub const HOVERED: Self = Self(cef_button_state_t::CEF_BUTTON_STATE_HOVERED);
#[doc = "See [`cef_button_state_t::CEF_BUTTON_STATE_PRESSED`] for more documentation."]
pub const PRESSED: Self = Self(cef_button_state_t::CEF_BUTTON_STATE_PRESSED);
#[doc = "See [`cef_button_state_t::CEF_BUTTON_STATE_DISABLED`] for more documentation."]
pub const DISABLED: Self = Self(cef_button_state_t::CEF_BUTTON_STATE_DISABLED);
#[doc = "See [`cef_button_state_t::CEF_BUTTON_STATE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_button_state_t::CEF_BUTTON_STATE_NUM_VALUES);
}
impl ButtonState {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ButtonState {
fn default() -> Self {
Self(cef_button_state_t::CEF_BUTTON_STATE_NORMAL)
}
}
/// See [`cef_horizontal_alignment_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct HorizontalAlignment(cef_horizontal_alignment_t);
impl AsRef<cef_horizontal_alignment_t> for HorizontalAlignment {
fn as_ref(&self) -> &cef_horizontal_alignment_t {
&self.0
}
}
impl AsMut<cef_horizontal_alignment_t> for HorizontalAlignment {
fn as_mut(&mut self) -> &mut cef_horizontal_alignment_t {
&mut self.0
}
}
impl From<cef_horizontal_alignment_t> for HorizontalAlignment {
fn from(value: cef_horizontal_alignment_t) -> Self {
Self(value)
}
}
impl From<HorizontalAlignment> for cef_horizontal_alignment_t {
fn from(value: HorizontalAlignment) -> Self {
value.0
}
}
impl HorizontalAlignment {
#[doc = "See [`cef_horizontal_alignment_t::CEF_HORIZONTAL_ALIGNMENT_LEFT`] for more documentation."]
pub const LEFT: Self = Self(cef_horizontal_alignment_t::CEF_HORIZONTAL_ALIGNMENT_LEFT);
#[doc = "See [`cef_horizontal_alignment_t::CEF_HORIZONTAL_ALIGNMENT_CENTER`] for more documentation."]
pub const CENTER: Self = Self(cef_horizontal_alignment_t::CEF_HORIZONTAL_ALIGNMENT_CENTER);
#[doc = "See [`cef_horizontal_alignment_t::CEF_HORIZONTAL_ALIGNMENT_RIGHT`] for more documentation."]
pub const RIGHT: Self = Self(cef_horizontal_alignment_t::CEF_HORIZONTAL_ALIGNMENT_RIGHT);
}
impl HorizontalAlignment {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for HorizontalAlignment {
fn default() -> Self {
Self(cef_horizontal_alignment_t::CEF_HORIZONTAL_ALIGNMENT_LEFT)
}
}
/// See [`cef_menu_anchor_position_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MenuAnchorPosition(cef_menu_anchor_position_t);
impl AsRef<cef_menu_anchor_position_t> for MenuAnchorPosition {
fn as_ref(&self) -> &cef_menu_anchor_position_t {
&self.0
}
}
impl AsMut<cef_menu_anchor_position_t> for MenuAnchorPosition {
fn as_mut(&mut self) -> &mut cef_menu_anchor_position_t {
&mut self.0
}
}
impl From<cef_menu_anchor_position_t> for MenuAnchorPosition {
fn from(value: cef_menu_anchor_position_t) -> Self {
Self(value)
}
}
impl From<MenuAnchorPosition> for cef_menu_anchor_position_t {
fn from(value: MenuAnchorPosition) -> Self {
value.0
}
}
impl MenuAnchorPosition {
#[doc = "See [`cef_menu_anchor_position_t::CEF_MENU_ANCHOR_TOPLEFT`] for more documentation."]
pub const TOPLEFT: Self = Self(cef_menu_anchor_position_t::CEF_MENU_ANCHOR_TOPLEFT);
#[doc = "See [`cef_menu_anchor_position_t::CEF_MENU_ANCHOR_TOPRIGHT`] for more documentation."]
pub const TOPRIGHT: Self = Self(cef_menu_anchor_position_t::CEF_MENU_ANCHOR_TOPRIGHT);
#[doc = "See [`cef_menu_anchor_position_t::CEF_MENU_ANCHOR_BOTTOMCENTER`] for more documentation."]
pub const BOTTOMCENTER: Self = Self(cef_menu_anchor_position_t::CEF_MENU_ANCHOR_BOTTOMCENTER);
#[doc = "See [`cef_menu_anchor_position_t::CEF_MENU_ANCHOR_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_menu_anchor_position_t::CEF_MENU_ANCHOR_NUM_VALUES);
}
impl MenuAnchorPosition {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MenuAnchorPosition {
fn default() -> Self {
Self(cef_menu_anchor_position_t::CEF_MENU_ANCHOR_TOPLEFT)
}
}
/// See [`cef_menu_color_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MenuColorType(cef_menu_color_type_t);
impl AsRef<cef_menu_color_type_t> for MenuColorType {
fn as_ref(&self) -> &cef_menu_color_type_t {
&self.0
}
}
impl AsMut<cef_menu_color_type_t> for MenuColorType {
fn as_mut(&mut self) -> &mut cef_menu_color_type_t {
&mut self.0
}
}
impl From<cef_menu_color_type_t> for MenuColorType {
fn from(value: cef_menu_color_type_t) -> Self {
Self(value)
}
}
impl From<MenuColorType> for cef_menu_color_type_t {
fn from(value: MenuColorType) -> Self {
value.0
}
}
impl MenuColorType {
#[doc = "See [`cef_menu_color_type_t::CEF_MENU_COLOR_TEXT`] for more documentation."]
pub const TEXT: Self = Self(cef_menu_color_type_t::CEF_MENU_COLOR_TEXT);
#[doc = "See [`cef_menu_color_type_t::CEF_MENU_COLOR_TEXT_HOVERED`] for more documentation."]
pub const TEXT_HOVERED: Self = Self(cef_menu_color_type_t::CEF_MENU_COLOR_TEXT_HOVERED);
#[doc = "See [`cef_menu_color_type_t::CEF_MENU_COLOR_TEXT_ACCELERATOR`] for more documentation."]
pub const TEXT_ACCELERATOR: Self = Self(cef_menu_color_type_t::CEF_MENU_COLOR_TEXT_ACCELERATOR);
#[doc = "See [`cef_menu_color_type_t::CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED`] for more documentation."]
pub const TEXT_ACCELERATOR_HOVERED: Self =
Self(cef_menu_color_type_t::CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED);
#[doc = "See [`cef_menu_color_type_t::CEF_MENU_COLOR_BACKGROUND`] for more documentation."]
pub const BACKGROUND: Self = Self(cef_menu_color_type_t::CEF_MENU_COLOR_BACKGROUND);
#[doc = "See [`cef_menu_color_type_t::CEF_MENU_COLOR_BACKGROUND_HOVERED`] for more documentation."]
pub const BACKGROUND_HOVERED: Self =
Self(cef_menu_color_type_t::CEF_MENU_COLOR_BACKGROUND_HOVERED);
#[doc = "See [`cef_menu_color_type_t::CEF_MENU_COLOR_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_menu_color_type_t::CEF_MENU_COLOR_NUM_VALUES);
}
impl MenuColorType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MenuColorType {
fn default() -> Self {
Self(cef_menu_color_type_t::CEF_MENU_COLOR_TEXT)
}
}
/// See [`cef_ssl_version_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct SslVersion(cef_ssl_version_t);
impl AsRef<cef_ssl_version_t> for SslVersion {
fn as_ref(&self) -> &cef_ssl_version_t {
&self.0
}
}
impl AsMut<cef_ssl_version_t> for SslVersion {
fn as_mut(&mut self) -> &mut cef_ssl_version_t {
&mut self.0
}
}
impl From<cef_ssl_version_t> for SslVersion {
fn from(value: cef_ssl_version_t) -> Self {
Self(value)
}
}
impl From<SslVersion> for cef_ssl_version_t {
fn from(value: SslVersion) -> Self {
value.0
}
}
impl SslVersion {
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_UNKNOWN);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_SSL2`] for more documentation."]
pub const SSL2: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_SSL2);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_SSL3`] for more documentation."]
pub const SSL3: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_SSL3);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1`] for more documentation."]
pub const TLS1: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1_1`] for more documentation."]
pub const TLS1_1: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1_1);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1_2`] for more documentation."]
pub const TLS1_2: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1_2);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1_3`] for more documentation."]
pub const TLS1_3: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_TLS1_3);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_QUIC`] for more documentation."]
pub const QUIC: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_QUIC);
#[doc = "See [`cef_ssl_version_t::SSL_CONNECTION_VERSION_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_NUM_VALUES);
}
impl SslVersion {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for SslVersion {
fn default() -> Self {
Self(cef_ssl_version_t::SSL_CONNECTION_VERSION_UNKNOWN)
}
}
/// See [`cef_ssl_content_status_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct SslContentStatus(cef_ssl_content_status_t);
impl AsRef<cef_ssl_content_status_t> for SslContentStatus {
fn as_ref(&self) -> &cef_ssl_content_status_t {
&self.0
}
}
impl AsMut<cef_ssl_content_status_t> for SslContentStatus {
fn as_mut(&mut self) -> &mut cef_ssl_content_status_t {
&mut self.0
}
}
impl From<cef_ssl_content_status_t> for SslContentStatus {
fn from(value: cef_ssl_content_status_t) -> Self {
Self(value)
}
}
impl From<SslContentStatus> for cef_ssl_content_status_t {
fn from(value: SslContentStatus) -> Self {
value.0
}
}
impl SslContentStatus {
#[doc = "See [`cef_ssl_content_status_t::SSL_CONTENT_NORMAL_CONTENT`] for more documentation."]
pub const NORMAL_CONTENT: Self = Self(cef_ssl_content_status_t::SSL_CONTENT_NORMAL_CONTENT);
#[doc = "See [`cef_ssl_content_status_t::SSL_CONTENT_DISPLAYED_INSECURE_CONTENT`] for more documentation."]
pub const DISPLAYED_INSECURE_CONTENT: Self =
Self(cef_ssl_content_status_t::SSL_CONTENT_DISPLAYED_INSECURE_CONTENT);
#[doc = "See [`cef_ssl_content_status_t::SSL_CONTENT_RAN_INSECURE_CONTENT`] for more documentation."]
pub const RAN_INSECURE_CONTENT: Self =
Self(cef_ssl_content_status_t::SSL_CONTENT_RAN_INSECURE_CONTENT);
}
impl SslContentStatus {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for SslContentStatus {
fn default() -> Self {
Self(cef_ssl_content_status_t::SSL_CONTENT_NORMAL_CONTENT)
}
}
/// See [`cef_scheme_options_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct SchemeOptions(cef_scheme_options_t);
impl AsRef<cef_scheme_options_t> for SchemeOptions {
fn as_ref(&self) -> &cef_scheme_options_t {
&self.0
}
}
impl AsMut<cef_scheme_options_t> for SchemeOptions {
fn as_mut(&mut self) -> &mut cef_scheme_options_t {
&mut self.0
}
}
impl From<cef_scheme_options_t> for SchemeOptions {
fn from(value: cef_scheme_options_t) -> Self {
Self(value)
}
}
impl From<SchemeOptions> for cef_scheme_options_t {
fn from(value: SchemeOptions) -> Self {
value.0
}
}
impl SchemeOptions {
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_scheme_options_t::CEF_SCHEME_OPTION_NONE);
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_STANDARD`] for more documentation."]
pub const STANDARD: Self = Self(cef_scheme_options_t::CEF_SCHEME_OPTION_STANDARD);
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_LOCAL`] for more documentation."]
pub const LOCAL: Self = Self(cef_scheme_options_t::CEF_SCHEME_OPTION_LOCAL);
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_DISPLAY_ISOLATED`] for more documentation."]
pub const DISPLAY_ISOLATED: Self =
Self(cef_scheme_options_t::CEF_SCHEME_OPTION_DISPLAY_ISOLATED);
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_SECURE`] for more documentation."]
pub const SECURE: Self = Self(cef_scheme_options_t::CEF_SCHEME_OPTION_SECURE);
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_CORS_ENABLED`] for more documentation."]
pub const CORS_ENABLED: Self = Self(cef_scheme_options_t::CEF_SCHEME_OPTION_CORS_ENABLED);
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_CSP_BYPASSING`] for more documentation."]
pub const CSP_BYPASSING: Self = Self(cef_scheme_options_t::CEF_SCHEME_OPTION_CSP_BYPASSING);
#[doc = "See [`cef_scheme_options_t::CEF_SCHEME_OPTION_FETCH_ENABLED`] for more documentation."]
pub const FETCH_ENABLED: Self = Self(cef_scheme_options_t::CEF_SCHEME_OPTION_FETCH_ENABLED);
}
impl SchemeOptions {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for SchemeOptions {
fn default() -> Self {
Self(cef_scheme_options_t::CEF_SCHEME_OPTION_NONE)
}
}
/// See [`cef_composition_underline_style_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct CompositionUnderlineStyle(cef_composition_underline_style_t);
impl AsRef<cef_composition_underline_style_t> for CompositionUnderlineStyle {
fn as_ref(&self) -> &cef_composition_underline_style_t {
&self.0
}
}
impl AsMut<cef_composition_underline_style_t> for CompositionUnderlineStyle {
fn as_mut(&mut self) -> &mut cef_composition_underline_style_t {
&mut self.0
}
}
impl From<cef_composition_underline_style_t> for CompositionUnderlineStyle {
fn from(value: cef_composition_underline_style_t) -> Self {
Self(value)
}
}
impl From<CompositionUnderlineStyle> for cef_composition_underline_style_t {
fn from(value: CompositionUnderlineStyle) -> Self {
value.0
}
}
impl CompositionUnderlineStyle {
#[doc = "See [`cef_composition_underline_style_t::CEF_CUS_SOLID`] for more documentation."]
pub const SOLID: Self = Self(cef_composition_underline_style_t::CEF_CUS_SOLID);
#[doc = "See [`cef_composition_underline_style_t::CEF_CUS_DOT`] for more documentation."]
pub const DOT: Self = Self(cef_composition_underline_style_t::CEF_CUS_DOT);
#[doc = "See [`cef_composition_underline_style_t::CEF_CUS_DASH`] for more documentation."]
pub const DASH: Self = Self(cef_composition_underline_style_t::CEF_CUS_DASH);
#[doc = "See [`cef_composition_underline_style_t::CEF_CUS_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_composition_underline_style_t::CEF_CUS_NONE);
#[doc = "See [`cef_composition_underline_style_t::CEF_CUS_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_composition_underline_style_t::CEF_CUS_NUM_VALUES);
}
impl CompositionUnderlineStyle {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for CompositionUnderlineStyle {
fn default() -> Self {
Self(cef_composition_underline_style_t::CEF_CUS_SOLID)
}
}
/// See [`cef_channel_layout_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ChannelLayout(cef_channel_layout_t);
impl AsRef<cef_channel_layout_t> for ChannelLayout {
fn as_ref(&self) -> &cef_channel_layout_t {
&self.0
}
}
impl AsMut<cef_channel_layout_t> for ChannelLayout {
fn as_mut(&mut self) -> &mut cef_channel_layout_t {
&mut self.0
}
}
impl From<cef_channel_layout_t> for ChannelLayout {
fn from(value: cef_channel_layout_t) -> Self {
Self(value)
}
}
impl From<ChannelLayout> for cef_channel_layout_t {
fn from(value: ChannelLayout) -> Self {
value.0
}
}
impl ChannelLayout {
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_NONE`] for more documentation."]
pub const LAYOUT_NONE: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_NONE);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_UNSUPPORTED`] for more documentation."]
pub const LAYOUT_UNSUPPORTED: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_UNSUPPORTED);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_MONO`] for more documentation."]
pub const LAYOUT_MONO: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_MONO);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_STEREO`] for more documentation."]
pub const LAYOUT_STEREO: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_STEREO);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_2_1`] for more documentation."]
pub const LAYOUT_2_1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_2_1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_SURROUND`] for more documentation."]
pub const LAYOUT_SURROUND: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_SURROUND);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_4_0`] for more documentation."]
pub const LAYOUT_4_0: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_4_0);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_2_2`] for more documentation."]
pub const LAYOUT_2_2: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_2_2);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_QUAD`] for more documentation."]
pub const LAYOUT_QUAD: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_QUAD);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_0`] for more documentation."]
pub const LAYOUT_5_0: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_0);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_1`] for more documentation."]
pub const LAYOUT_5_1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_0_BACK`] for more documentation."]
pub const LAYOUT_5_0_BACK: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_0_BACK);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_1_BACK`] for more documentation."]
pub const LAYOUT_5_1_BACK: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_1_BACK);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_0`] for more documentation."]
pub const LAYOUT_7_0: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_0);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_1`] for more documentation."]
pub const LAYOUT_7_1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_1_WIDE`] for more documentation."]
pub const LAYOUT_7_1_WIDE: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_1_WIDE);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX`] for more documentation."]
pub const LAYOUT_STEREO_DOWNMIX: Self =
Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_2POINT1`] for more documentation."]
pub const LAYOUT_2POINT1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_2POINT1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_3_1`] for more documentation."]
pub const LAYOUT_3_1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_3_1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_4_1`] for more documentation."]
pub const LAYOUT_4_1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_4_1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_0`] for more documentation."]
pub const LAYOUT_6_0: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_0);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_0_FRONT`] for more documentation."]
pub const LAYOUT_6_0_FRONT: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_0_FRONT);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_HEXAGONAL`] for more documentation."]
pub const LAYOUT_HEXAGONAL: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_HEXAGONAL);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_1`] for more documentation."]
pub const LAYOUT_6_1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_1_BACK`] for more documentation."]
pub const LAYOUT_6_1_BACK: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_1_BACK);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_1_FRONT`] for more documentation."]
pub const LAYOUT_6_1_FRONT: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_6_1_FRONT);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_0_FRONT`] for more documentation."]
pub const LAYOUT_7_0_FRONT: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_0_FRONT);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK`] for more documentation."]
pub const LAYOUT_7_1_WIDE_BACK: Self =
Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_OCTAGONAL`] for more documentation."]
pub const LAYOUT_OCTAGONAL: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_OCTAGONAL);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_DISCRETE`] for more documentation."]
pub const LAYOUT_DISCRETE: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_DISCRETE);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC`] for more documentation."]
pub const LAYOUT_STEREO_AND_KEYBOARD_MIC: Self =
Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE`] for more documentation."]
pub const LAYOUT_4_1_QUAD_SIDE: Self =
Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_BITSTREAM`] for more documentation."]
pub const LAYOUT_BITSTREAM: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_BITSTREAM);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX`] for more documentation."]
pub const LAYOUT_5_1_4_DOWNMIX: Self =
Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_1_1`] for more documentation."]
pub const LAYOUT_1_1: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_1_1);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_LAYOUT_3_1_BACK`] for more documentation."]
pub const LAYOUT_3_1_BACK: Self = Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_3_1_BACK);
#[doc = "See [`cef_channel_layout_t::CEF_CHANNEL_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_channel_layout_t::CEF_CHANNEL_NUM_VALUES);
}
impl ChannelLayout {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ChannelLayout {
fn default() -> Self {
Self(cef_channel_layout_t::CEF_CHANNEL_LAYOUT_NONE)
}
}
/// See [`cef_media_route_create_result_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MediaRouteCreateResult(cef_media_route_create_result_t);
impl AsRef<cef_media_route_create_result_t> for MediaRouteCreateResult {
fn as_ref(&self) -> &cef_media_route_create_result_t {
&self.0
}
}
impl AsMut<cef_media_route_create_result_t> for MediaRouteCreateResult {
fn as_mut(&mut self) -> &mut cef_media_route_create_result_t {
&mut self.0
}
}
impl From<cef_media_route_create_result_t> for MediaRouteCreateResult {
fn from(value: cef_media_route_create_result_t) -> Self {
Self(value)
}
}
impl From<MediaRouteCreateResult> for cef_media_route_create_result_t {
fn from(value: MediaRouteCreateResult) -> Self {
value.0
}
}
impl MediaRouteCreateResult {
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_UNKNOWN_ERROR`] for more documentation."]
pub const UNKNOWN_ERROR: Self = Self(cef_media_route_create_result_t::CEF_MRCR_UNKNOWN_ERROR);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_OK`] for more documentation."]
pub const OK: Self = Self(cef_media_route_create_result_t::CEF_MRCR_OK);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_TIMED_OUT`] for more documentation."]
pub const TIMED_OUT: Self = Self(cef_media_route_create_result_t::CEF_MRCR_TIMED_OUT);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_ROUTE_NOT_FOUND`] for more documentation."]
pub const ROUTE_NOT_FOUND: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_ROUTE_NOT_FOUND);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_SINK_NOT_FOUND`] for more documentation."]
pub const SINK_NOT_FOUND: Self = Self(cef_media_route_create_result_t::CEF_MRCR_SINK_NOT_FOUND);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_INVALID_ORIGIN`] for more documentation."]
pub const INVALID_ORIGIN: Self = Self(cef_media_route_create_result_t::CEF_MRCR_INVALID_ORIGIN);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_OFF_THE_RECORD_MISMATCH_DEPRECATED`] for more documentation."]
pub const OFF_THE_RECORD_MISMATCH_DEPRECATED: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_OFF_THE_RECORD_MISMATCH_DEPRECATED);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_NO_SUPPORTED_PROVIDER`] for more documentation."]
pub const NO_SUPPORTED_PROVIDER: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_NO_SUPPORTED_PROVIDER);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_CANCELLED`] for more documentation."]
pub const CANCELLED: Self = Self(cef_media_route_create_result_t::CEF_MRCR_CANCELLED);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_ROUTE_ALREADY_EXISTS`] for more documentation."]
pub const ROUTE_ALREADY_EXISTS: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_ROUTE_ALREADY_EXISTS);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_DESKTOP_PICKER_FAILED`] for more documentation."]
pub const DESKTOP_PICKER_FAILED: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_DESKTOP_PICKER_FAILED);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_ROUTE_ALREADY_TERMINATED`] for more documentation."]
pub const ROUTE_ALREADY_TERMINATED: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_ROUTE_ALREADY_TERMINATED);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_REDUNDANT_REQUEST`] for more documentation."]
pub const REDUNDANT_REQUEST: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_REDUNDANT_REQUEST);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_USER_NOT_ALLOWED`] for more documentation."]
pub const USER_NOT_ALLOWED: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_USER_NOT_ALLOWED);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_NOTIFICATION_DISABLED`] for more documentation."]
pub const NOTIFICATION_DISABLED: Self =
Self(cef_media_route_create_result_t::CEF_MRCR_NOTIFICATION_DISABLED);
#[doc = "See [`cef_media_route_create_result_t::CEF_MRCR_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_media_route_create_result_t::CEF_MRCR_NUM_VALUES);
}
impl MediaRouteCreateResult {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MediaRouteCreateResult {
fn default() -> Self {
Self(cef_media_route_create_result_t::CEF_MRCR_UNKNOWN_ERROR)
}
}
/// See [`cef_media_route_connection_state_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MediaRouteConnectionState(cef_media_route_connection_state_t);
impl AsRef<cef_media_route_connection_state_t> for MediaRouteConnectionState {
fn as_ref(&self) -> &cef_media_route_connection_state_t {
&self.0
}
}
impl AsMut<cef_media_route_connection_state_t> for MediaRouteConnectionState {
fn as_mut(&mut self) -> &mut cef_media_route_connection_state_t {
&mut self.0
}
}
impl From<cef_media_route_connection_state_t> for MediaRouteConnectionState {
fn from(value: cef_media_route_connection_state_t) -> Self {
Self(value)
}
}
impl From<MediaRouteConnectionState> for cef_media_route_connection_state_t {
fn from(value: MediaRouteConnectionState) -> Self {
value.0
}
}
impl MediaRouteConnectionState {
#[doc = "See [`cef_media_route_connection_state_t::CEF_MRCS_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_media_route_connection_state_t::CEF_MRCS_UNKNOWN);
#[doc = "See [`cef_media_route_connection_state_t::CEF_MRCS_CONNECTING`] for more documentation."]
pub const CONNECTING: Self = Self(cef_media_route_connection_state_t::CEF_MRCS_CONNECTING);
#[doc = "See [`cef_media_route_connection_state_t::CEF_MRCS_CONNECTED`] for more documentation."]
pub const CONNECTED: Self = Self(cef_media_route_connection_state_t::CEF_MRCS_CONNECTED);
#[doc = "See [`cef_media_route_connection_state_t::CEF_MRCS_CLOSED`] for more documentation."]
pub const CLOSED: Self = Self(cef_media_route_connection_state_t::CEF_MRCS_CLOSED);
#[doc = "See [`cef_media_route_connection_state_t::CEF_MRCS_TERMINATED`] for more documentation."]
pub const TERMINATED: Self = Self(cef_media_route_connection_state_t::CEF_MRCS_TERMINATED);
#[doc = "See [`cef_media_route_connection_state_t::CEF_MRCS_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_media_route_connection_state_t::CEF_MRCS_NUM_VALUES);
}
impl MediaRouteConnectionState {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MediaRouteConnectionState {
fn default() -> Self {
Self(cef_media_route_connection_state_t::CEF_MRCS_UNKNOWN)
}
}
/// See [`cef_media_sink_icon_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MediaSinkIconType(cef_media_sink_icon_type_t);
impl AsRef<cef_media_sink_icon_type_t> for MediaSinkIconType {
fn as_ref(&self) -> &cef_media_sink_icon_type_t {
&self.0
}
}
impl AsMut<cef_media_sink_icon_type_t> for MediaSinkIconType {
fn as_mut(&mut self) -> &mut cef_media_sink_icon_type_t {
&mut self.0
}
}
impl From<cef_media_sink_icon_type_t> for MediaSinkIconType {
fn from(value: cef_media_sink_icon_type_t) -> Self {
Self(value)
}
}
impl From<MediaSinkIconType> for cef_media_sink_icon_type_t {
fn from(value: MediaSinkIconType) -> Self {
value.0
}
}
impl MediaSinkIconType {
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_CAST`] for more documentation."]
pub const CAST: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_CAST);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_CAST_AUDIO_GROUP`] for more documentation."]
pub const CAST_AUDIO_GROUP: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_CAST_AUDIO_GROUP);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_CAST_AUDIO`] for more documentation."]
pub const CAST_AUDIO: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_CAST_AUDIO);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_MEETING`] for more documentation."]
pub const MEETING: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_MEETING);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_HANGOUT`] for more documentation."]
pub const HANGOUT: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_HANGOUT);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_EDUCATION`] for more documentation."]
pub const EDUCATION: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_EDUCATION);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_WIRED_DISPLAY`] for more documentation."]
pub const WIRED_DISPLAY: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_WIRED_DISPLAY);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_GENERIC`] for more documentation."]
pub const GENERIC: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_GENERIC);
#[doc = "See [`cef_media_sink_icon_type_t::CEF_MSIT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_media_sink_icon_type_t::CEF_MSIT_NUM_VALUES);
}
impl MediaSinkIconType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MediaSinkIconType {
fn default() -> Self {
Self(cef_media_sink_icon_type_t::CEF_MSIT_CAST)
}
}
/// See [`cef_text_field_commands_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TextFieldCommands(cef_text_field_commands_t);
impl AsRef<cef_text_field_commands_t> for TextFieldCommands {
fn as_ref(&self) -> &cef_text_field_commands_t {
&self.0
}
}
impl AsMut<cef_text_field_commands_t> for TextFieldCommands {
fn as_mut(&mut self) -> &mut cef_text_field_commands_t {
&mut self.0
}
}
impl From<cef_text_field_commands_t> for TextFieldCommands {
fn from(value: cef_text_field_commands_t) -> Self {
Self(value)
}
}
impl From<TextFieldCommands> for cef_text_field_commands_t {
fn from(value: TextFieldCommands) -> Self {
value.0
}
}
impl TextFieldCommands {
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_text_field_commands_t::CEF_TFC_UNKNOWN);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_CUT`] for more documentation."]
pub const CUT: Self = Self(cef_text_field_commands_t::CEF_TFC_CUT);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_COPY`] for more documentation."]
pub const COPY: Self = Self(cef_text_field_commands_t::CEF_TFC_COPY);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_PASTE`] for more documentation."]
pub const PASTE: Self = Self(cef_text_field_commands_t::CEF_TFC_PASTE);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_SELECT_ALL`] for more documentation."]
pub const SELECT_ALL: Self = Self(cef_text_field_commands_t::CEF_TFC_SELECT_ALL);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_SELECT_WORD`] for more documentation."]
pub const SELECT_WORD: Self = Self(cef_text_field_commands_t::CEF_TFC_SELECT_WORD);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_UNDO`] for more documentation."]
pub const UNDO: Self = Self(cef_text_field_commands_t::CEF_TFC_UNDO);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_DELETE`] for more documentation."]
pub const DELETE: Self = Self(cef_text_field_commands_t::CEF_TFC_DELETE);
#[doc = "See [`cef_text_field_commands_t::CEF_TFC_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_text_field_commands_t::CEF_TFC_NUM_VALUES);
}
impl TextFieldCommands {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TextFieldCommands {
fn default() -> Self {
Self(cef_text_field_commands_t::CEF_TFC_UNKNOWN)
}
}
/// See [`cef_chrome_toolbar_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ChromeToolbarType(cef_chrome_toolbar_type_t);
impl AsRef<cef_chrome_toolbar_type_t> for ChromeToolbarType {
fn as_ref(&self) -> &cef_chrome_toolbar_type_t {
&self.0
}
}
impl AsMut<cef_chrome_toolbar_type_t> for ChromeToolbarType {
fn as_mut(&mut self) -> &mut cef_chrome_toolbar_type_t {
&mut self.0
}
}
impl From<cef_chrome_toolbar_type_t> for ChromeToolbarType {
fn from(value: cef_chrome_toolbar_type_t) -> Self {
Self(value)
}
}
impl From<ChromeToolbarType> for cef_chrome_toolbar_type_t {
fn from(value: ChromeToolbarType) -> Self {
value.0
}
}
impl ChromeToolbarType {
#[doc = "See [`cef_chrome_toolbar_type_t::CEF_CTT_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_chrome_toolbar_type_t::CEF_CTT_UNKNOWN);
#[doc = "See [`cef_chrome_toolbar_type_t::CEF_CTT_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_chrome_toolbar_type_t::CEF_CTT_NONE);
#[doc = "See [`cef_chrome_toolbar_type_t::CEF_CTT_NORMAL`] for more documentation."]
pub const NORMAL: Self = Self(cef_chrome_toolbar_type_t::CEF_CTT_NORMAL);
#[doc = "See [`cef_chrome_toolbar_type_t::CEF_CTT_LOCATION`] for more documentation."]
pub const LOCATION: Self = Self(cef_chrome_toolbar_type_t::CEF_CTT_LOCATION);
#[doc = "See [`cef_chrome_toolbar_type_t::CEF_CTT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_chrome_toolbar_type_t::CEF_CTT_NUM_VALUES);
}
impl ChromeToolbarType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ChromeToolbarType {
fn default() -> Self {
Self(cef_chrome_toolbar_type_t::CEF_CTT_UNKNOWN)
}
}
/// See [`cef_chrome_page_action_icon_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ChromePageActionIconType(cef_chrome_page_action_icon_type_t);
impl AsRef<cef_chrome_page_action_icon_type_t> for ChromePageActionIconType {
fn as_ref(&self) -> &cef_chrome_page_action_icon_type_t {
&self.0
}
}
impl AsMut<cef_chrome_page_action_icon_type_t> for ChromePageActionIconType {
fn as_mut(&mut self) -> &mut cef_chrome_page_action_icon_type_t {
&mut self.0
}
}
impl From<cef_chrome_page_action_icon_type_t> for ChromePageActionIconType {
fn from(value: cef_chrome_page_action_icon_type_t) -> Self {
Self(value)
}
}
impl From<ChromePageActionIconType> for cef_chrome_page_action_icon_type_t {
fn from(value: ChromePageActionIconType) -> Self {
value.0
}
}
impl ChromePageActionIconType {
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_BOOKMARK_STAR`] for more documentation."]
pub const BOOKMARK_STAR: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_BOOKMARK_STAR);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_CLICK_TO_CALL_DEPRECATED`] for more documentation."]
pub const CLICK_TO_CALL_DEPRECATED: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_CLICK_TO_CALL_DEPRECATED);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_COOKIE_CONTROLS`] for more documentation."]
pub const COOKIE_CONTROLS: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_COOKIE_CONTROLS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_FILE_SYSTEM_ACCESS`] for more documentation."]
pub const FILE_SYSTEM_ACCESS: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_FILE_SYSTEM_ACCESS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_FIND`] for more documentation."]
pub const FIND: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_FIND);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_MEMORY_SAVER`] for more documentation."]
pub const MEMORY_SAVER: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_MEMORY_SAVER);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_INTENT_PICKER`] for more documentation."]
pub const INTENT_PICKER: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_INTENT_PICKER);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_LOCAL_CARD_MIGRATION`] for more documentation."]
pub const LOCAL_CARD_MIGRATION: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_LOCAL_CARD_MIGRATION);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_MANAGE_PASSWORDS`] for more documentation."]
pub const MANAGE_PASSWORDS: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_MANAGE_PASSWORDS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION`] for more documentation."]
pub const PAYMENTS_OFFER_NOTIFICATION: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_PRICE_TRACKING`] for more documentation."]
pub const PRICE_TRACKING: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_PRICE_TRACKING);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_PWA_INSTALL`] for more documentation."]
pub const PWA_INSTALL: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_PWA_INSTALL);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_QR_CODE_GENERATOR_DEPRECATED`] for more documentation."]
pub const QR_CODE_GENERATOR_DEPRECATED: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_QR_CODE_GENERATOR_DEPRECATED);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_READER_MODE_DEPRECATED`] for more documentation."]
pub const READER_MODE_DEPRECATED: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_READER_MODE_DEPRECATED);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_SAVE_AUTOFILL_ADDRESS`] for more documentation."]
pub const SAVE_AUTOFILL_ADDRESS: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_SAVE_AUTOFILL_ADDRESS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_SAVE_CARD`] for more documentation."]
pub const SAVE_CARD: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_SAVE_CARD);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_SEND_TAB_TO_SELF_DEPRECATED`] for more documentation."]
pub const SEND_TAB_TO_SELF_DEPRECATED: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_SEND_TAB_TO_SELF_DEPRECATED);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_SHARING_HUB`] for more documentation."]
pub const SHARING_HUB: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_SHARING_HUB);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_SIDE_SEARCH_DEPRECATED`] for more documentation."]
pub const SIDE_SEARCH_DEPRECATED: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_SIDE_SEARCH_DEPRECATED);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_SMS_REMOTE_FETCHER`] for more documentation."]
pub const SMS_REMOTE_FETCHER: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_SMS_REMOTE_FETCHER);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_TRANSLATE`] for more documentation."]
pub const TRANSLATE: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_TRANSLATE);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_VIRTUAL_CARD_ENROLL`] for more documentation."]
pub const VIRTUAL_CARD_ENROLL: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_VIRTUAL_CARD_ENROLL);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_VIRTUAL_CARD_INFORMATION`] for more documentation."]
pub const VIRTUAL_CARD_INFORMATION: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_VIRTUAL_CARD_INFORMATION);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_ZOOM`] for more documentation."]
pub const ZOOM: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_ZOOM);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_SAVE_IBAN`] for more documentation."]
pub const SAVE_IBAN: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_SAVE_IBAN);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_MANDATORY_REAUTH`] for more documentation."]
pub const MANDATORY_REAUTH: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_MANDATORY_REAUTH);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_PRICE_INSIGHTS`] for more documentation."]
pub const PRICE_INSIGHTS: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_PRICE_INSIGHTS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_READ_ANYTHING_DEPRECATED`] for more documentation."]
pub const READ_ANYTHING_DEPRECATED: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_READ_ANYTHING_DEPRECATED);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_PRODUCT_SPECIFICATIONS`] for more documentation."]
pub const PRODUCT_SPECIFICATIONS: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_PRODUCT_SPECIFICATIONS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_LENS_OVERLAY`] for more documentation."]
pub const LENS_OVERLAY: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_LENS_OVERLAY);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_DISCOUNTS`] for more documentation."]
pub const DISCOUNTS: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_DISCOUNTS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_OPTIMIZATION_GUIDE`] for more documentation."]
pub const OPTIMIZATION_GUIDE: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_OPTIMIZATION_GUIDE);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_COLLABORATION_MESSAGING`] for more documentation."]
pub const COLLABORATION_MESSAGING: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_COLLABORATION_MESSAGING);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_CHANGE_PASSWORD`] for more documentation."]
pub const CHANGE_PASSWORD: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_CHANGE_PASSWORD);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_LENS_OVERLAY_HOMEWORK`] for more documentation."]
pub const LENS_OVERLAY_HOMEWORK: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_LENS_OVERLAY_HOMEWORK);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_AI_MODE`] for more documentation."]
pub const AI_MODE: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_AI_MODE);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_READING_MODE`] for more documentation."]
pub const READING_MODE: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_READING_MODE);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_CONTEXTUAL_SIDE_PANEL`] for more documentation."]
pub const CONTEXTUAL_SIDE_PANEL: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_CONTEXTUAL_SIDE_PANEL);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_JS_OPTIMIZATIONS`] for more documentation."]
pub const JS_OPTIMIZATIONS: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_JS_OPTIMIZATIONS);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_RECORD_REPLAY`] for more documentation."]
pub const RECORD_REPLAY: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_RECORD_REPLAY);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_INDIGO`] for more documentation."]
pub const INDIGO: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_INDIGO);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_FEDERATION_DEPRECATED`] for more documentation."]
pub const FEDERATION_DEPRECATED: Self =
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_FEDERATION_DEPRECATED);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_GLIC`] for more documentation."]
pub const GLIC: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_GLIC);
#[doc = "See [`cef_chrome_page_action_icon_type_t::CEF_CPAIT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_NUM_VALUES);
}
impl ChromePageActionIconType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ChromePageActionIconType {
fn default() -> Self {
Self(cef_chrome_page_action_icon_type_t::CEF_CPAIT_BOOKMARK_STAR)
}
}
/// See [`cef_chrome_toolbar_button_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ChromeToolbarButtonType(cef_chrome_toolbar_button_type_t);
impl AsRef<cef_chrome_toolbar_button_type_t> for ChromeToolbarButtonType {
fn as_ref(&self) -> &cef_chrome_toolbar_button_type_t {
&self.0
}
}
impl AsMut<cef_chrome_toolbar_button_type_t> for ChromeToolbarButtonType {
fn as_mut(&mut self) -> &mut cef_chrome_toolbar_button_type_t {
&mut self.0
}
}
impl From<cef_chrome_toolbar_button_type_t> for ChromeToolbarButtonType {
fn from(value: cef_chrome_toolbar_button_type_t) -> Self {
Self(value)
}
}
impl From<ChromeToolbarButtonType> for cef_chrome_toolbar_button_type_t {
fn from(value: ChromeToolbarButtonType) -> Self {
value.0
}
}
impl ChromeToolbarButtonType {
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_CAST_DEPRECATED`] for more documentation."]
pub const CAST_DEPRECATED: Self =
Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_CAST_DEPRECATED);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_DOWNLOAD_DEPRECATED`] for more documentation."]
pub const DOWNLOAD_DEPRECATED: Self =
Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_DOWNLOAD_DEPRECATED);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_SEND_TAB_TO_SELF_DEPRECATED`] for more documentation."]
pub const SEND_TAB_TO_SELF_DEPRECATED: Self =
Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_SEND_TAB_TO_SELF_DEPRECATED);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_SIDE_PANEL_DEPRECATED`] for more documentation."]
pub const SIDE_PANEL_DEPRECATED: Self =
Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_SIDE_PANEL_DEPRECATED);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_MEDIA`] for more documentation."]
pub const MEDIA: Self = Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_MEDIA);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_TAB_SEARCH`] for more documentation."]
pub const TAB_SEARCH: Self = Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_TAB_SEARCH);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_BATTERY_SAVER`] for more documentation."]
pub const BATTERY_SAVER: Self = Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_BATTERY_SAVER);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_AVATAR`] for more documentation."]
pub const AVATAR: Self = Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_AVATAR);
#[doc = "See [`cef_chrome_toolbar_button_type_t::CEF_CTBT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_NUM_VALUES);
}
impl ChromeToolbarButtonType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ChromeToolbarButtonType {
fn default() -> Self {
Self(cef_chrome_toolbar_button_type_t::CEF_CTBT_CAST_DEPRECATED)
}
}
/// See [`cef_docking_mode_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DockingMode(cef_docking_mode_t);
impl AsRef<cef_docking_mode_t> for DockingMode {
fn as_ref(&self) -> &cef_docking_mode_t {
&self.0
}
}
impl AsMut<cef_docking_mode_t> for DockingMode {
fn as_mut(&mut self) -> &mut cef_docking_mode_t {
&mut self.0
}
}
impl From<cef_docking_mode_t> for DockingMode {
fn from(value: cef_docking_mode_t) -> Self {
Self(value)
}
}
impl From<DockingMode> for cef_docking_mode_t {
fn from(value: DockingMode) -> Self {
value.0
}
}
impl DockingMode {
#[doc = "See [`cef_docking_mode_t::CEF_DOCKING_MODE_TOP_LEFT`] for more documentation."]
pub const TOP_LEFT: Self = Self(cef_docking_mode_t::CEF_DOCKING_MODE_TOP_LEFT);
#[doc = "See [`cef_docking_mode_t::CEF_DOCKING_MODE_TOP_RIGHT`] for more documentation."]
pub const TOP_RIGHT: Self = Self(cef_docking_mode_t::CEF_DOCKING_MODE_TOP_RIGHT);
#[doc = "See [`cef_docking_mode_t::CEF_DOCKING_MODE_BOTTOM_LEFT`] for more documentation."]
pub const BOTTOM_LEFT: Self = Self(cef_docking_mode_t::CEF_DOCKING_MODE_BOTTOM_LEFT);
#[doc = "See [`cef_docking_mode_t::CEF_DOCKING_MODE_BOTTOM_RIGHT`] for more documentation."]
pub const BOTTOM_RIGHT: Self = Self(cef_docking_mode_t::CEF_DOCKING_MODE_BOTTOM_RIGHT);
#[doc = "See [`cef_docking_mode_t::CEF_DOCKING_MODE_CUSTOM`] for more documentation."]
pub const CUSTOM: Self = Self(cef_docking_mode_t::CEF_DOCKING_MODE_CUSTOM);
#[doc = "See [`cef_docking_mode_t::CEF_DOCKING_MODE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_docking_mode_t::CEF_DOCKING_MODE_NUM_VALUES);
}
impl DockingMode {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DockingMode {
fn default() -> Self {
Self(cef_docking_mode_t::CEF_DOCKING_MODE_TOP_LEFT)
}
}
/// See [`cef_show_state_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ShowState(cef_show_state_t);
impl AsRef<cef_show_state_t> for ShowState {
fn as_ref(&self) -> &cef_show_state_t {
&self.0
}
}
impl AsMut<cef_show_state_t> for ShowState {
fn as_mut(&mut self) -> &mut cef_show_state_t {
&mut self.0
}
}
impl From<cef_show_state_t> for ShowState {
fn from(value: cef_show_state_t) -> Self {
Self(value)
}
}
impl From<ShowState> for cef_show_state_t {
fn from(value: ShowState) -> Self {
value.0
}
}
impl ShowState {
#[doc = "See [`cef_show_state_t::CEF_SHOW_STATE_NORMAL`] for more documentation."]
pub const NORMAL: Self = Self(cef_show_state_t::CEF_SHOW_STATE_NORMAL);
#[doc = "See [`cef_show_state_t::CEF_SHOW_STATE_MINIMIZED`] for more documentation."]
pub const MINIMIZED: Self = Self(cef_show_state_t::CEF_SHOW_STATE_MINIMIZED);
#[doc = "See [`cef_show_state_t::CEF_SHOW_STATE_MAXIMIZED`] for more documentation."]
pub const MAXIMIZED: Self = Self(cef_show_state_t::CEF_SHOW_STATE_MAXIMIZED);
#[doc = "See [`cef_show_state_t::CEF_SHOW_STATE_FULLSCREEN`] for more documentation."]
pub const FULLSCREEN: Self = Self(cef_show_state_t::CEF_SHOW_STATE_FULLSCREEN);
#[doc = "See [`cef_show_state_t::CEF_SHOW_STATE_HIDDEN`] for more documentation."]
pub const HIDDEN: Self = Self(cef_show_state_t::CEF_SHOW_STATE_HIDDEN);
#[doc = "See [`cef_show_state_t::CEF_SHOW_STATE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_show_state_t::CEF_SHOW_STATE_NUM_VALUES);
}
impl ShowState {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ShowState {
fn default() -> Self {
Self(cef_show_state_t::CEF_SHOW_STATE_NORMAL)
}
}
/// See [`cef_touch_handle_state_flags_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TouchHandleStateFlags(cef_touch_handle_state_flags_t);
impl AsRef<cef_touch_handle_state_flags_t> for TouchHandleStateFlags {
fn as_ref(&self) -> &cef_touch_handle_state_flags_t {
&self.0
}
}
impl AsMut<cef_touch_handle_state_flags_t> for TouchHandleStateFlags {
fn as_mut(&mut self) -> &mut cef_touch_handle_state_flags_t {
&mut self.0
}
}
impl From<cef_touch_handle_state_flags_t> for TouchHandleStateFlags {
fn from(value: cef_touch_handle_state_flags_t) -> Self {
Self(value)
}
}
impl From<TouchHandleStateFlags> for cef_touch_handle_state_flags_t {
fn from(value: TouchHandleStateFlags) -> Self {
value.0
}
}
impl Default for TouchHandleStateFlags {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
/// See [`cef_media_access_permission_types_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MediaAccessPermissionTypes(cef_media_access_permission_types_t);
impl AsRef<cef_media_access_permission_types_t> for MediaAccessPermissionTypes {
fn as_ref(&self) -> &cef_media_access_permission_types_t {
&self.0
}
}
impl AsMut<cef_media_access_permission_types_t> for MediaAccessPermissionTypes {
fn as_mut(&mut self) -> &mut cef_media_access_permission_types_t {
&mut self.0
}
}
impl From<cef_media_access_permission_types_t> for MediaAccessPermissionTypes {
fn from(value: cef_media_access_permission_types_t) -> Self {
Self(value)
}
}
impl From<MediaAccessPermissionTypes> for cef_media_access_permission_types_t {
fn from(value: MediaAccessPermissionTypes) -> Self {
value.0
}
}
impl MediaAccessPermissionTypes {
#[doc = "See [`cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_NONE);
#[doc = "See [`cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE`] for more documentation."]
pub const DEVICE_AUDIO_CAPTURE: Self =
Self(cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE);
#[doc = "See [`cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE`] for more documentation."]
pub const DEVICE_VIDEO_CAPTURE: Self =
Self(cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE);
#[doc = "See [`cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DESKTOP_AUDIO_CAPTURE`] for more documentation."]
pub const DESKTOP_AUDIO_CAPTURE: Self =
Self(cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DESKTOP_AUDIO_CAPTURE);
#[doc = "See [`cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DESKTOP_VIDEO_CAPTURE`] for more documentation."]
pub const DESKTOP_VIDEO_CAPTURE: Self =
Self(cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_DESKTOP_VIDEO_CAPTURE);
}
impl MediaAccessPermissionTypes {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for MediaAccessPermissionTypes {
fn default() -> Self {
Self(cef_media_access_permission_types_t::CEF_MEDIA_PERMISSION_NONE)
}
}
/// See [`cef_permission_request_types_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PermissionRequestTypes(cef_permission_request_types_t);
impl AsRef<cef_permission_request_types_t> for PermissionRequestTypes {
fn as_ref(&self) -> &cef_permission_request_types_t {
&self.0
}
}
impl AsMut<cef_permission_request_types_t> for PermissionRequestTypes {
fn as_mut(&mut self) -> &mut cef_permission_request_types_t {
&mut self.0
}
}
impl From<cef_permission_request_types_t> for PermissionRequestTypes {
fn from(value: cef_permission_request_types_t) -> Self {
Self(value)
}
}
impl From<PermissionRequestTypes> for cef_permission_request_types_t {
fn from(value: PermissionRequestTypes) -> Self {
value.0
}
}
impl PermissionRequestTypes {
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_NONE);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_AR_SESSION`] for more documentation."]
pub const AR_SESSION: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_AR_SESSION);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM`] for more documentation."]
pub const CAMERA_PAN_TILT_ZOOM: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_CAMERA_STREAM`] for more documentation."]
pub const CAMERA_STREAM: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_CAMERA_STREAM);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL`] for more documentation."]
pub const CAPTURED_SURFACE_CONTROL: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_CLIPBOARD`] for more documentation."]
pub const CLIPBOARD: Self = Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_CLIPBOARD);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS`] for more documentation."]
pub const TOP_LEVEL_STORAGE_ACCESS: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_DISK_QUOTA`] for more documentation."]
pub const DISK_QUOTA: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_DISK_QUOTA);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOCAL_FONTS`] for more documentation."]
pub const LOCAL_FONTS: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOCAL_FONTS);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_GEOLOCATION`] for more documentation."]
pub const GEOLOCATION: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_GEOLOCATION);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_HAND_TRACKING`] for more documentation."]
pub const HAND_TRACKING: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_HAND_TRACKING);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_IDENTITY_PROVIDER`] for more documentation."]
pub const IDENTITY_PROVIDER: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_IDENTITY_PROVIDER);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_IDLE_DETECTION`] for more documentation."]
pub const IDLE_DETECTION: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_IDLE_DETECTION);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_MIC_STREAM`] for more documentation."]
pub const MIC_STREAM: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_MIC_STREAM);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_MIDI_SYSEX`] for more documentation."]
pub const MIDI_SYSEX: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_MIDI_SYSEX);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS`] for more documentation."]
pub const MULTIPLE_DOWNLOADS: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_NOTIFICATIONS`] for more documentation."]
pub const NOTIFICATIONS: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_NOTIFICATIONS);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_KEYBOARD_LOCK`] for more documentation."]
pub const KEYBOARD_LOCK: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_KEYBOARD_LOCK);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_POINTER_LOCK`] for more documentation."]
pub const POINTER_LOCK: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_POINTER_LOCK);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER`] for more documentation."]
pub const PROTECTED_MEDIA_IDENTIFIER: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER`] for more documentation."]
pub const REGISTER_PROTOCOL_HANDLER: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_STORAGE_ACCESS`] for more documentation."]
pub const STORAGE_ACCESS: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_STORAGE_ACCESS);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_VR_SESSION`] for more documentation."]
pub const VR_SESSION: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_VR_SESSION);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_WEB_APP_INSTALLATION`] for more documentation."]
pub const WEB_APP_INSTALLATION: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_WEB_APP_INSTALLATION);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT`] for more documentation."]
pub const WINDOW_MANAGEMENT: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS`] for more documentation."]
pub const FILE_SYSTEM_ACCESS: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOCAL_NETWORK_ACCESS`] for more documentation."]
pub const LOCAL_NETWORK_ACCESS: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOCAL_NETWORK_ACCESS);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOCAL_NETWORK`] for more documentation."]
pub const LOCAL_NETWORK: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOCAL_NETWORK);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOOPBACK_NETWORK`] for more documentation."]
pub const LOOPBACK_NETWORK: Self =
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_LOOPBACK_NETWORK);
#[doc = "See [`cef_permission_request_types_t::CEF_PERMISSION_TYPE_SENSORS`] for more documentation."]
pub const SENSORS: Self = Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_SENSORS);
}
impl PermissionRequestTypes {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PermissionRequestTypes {
fn default() -> Self {
Self(cef_permission_request_types_t::CEF_PERMISSION_TYPE_NONE)
}
}
/// See [`cef_permission_request_result_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PermissionRequestResult(cef_permission_request_result_t);
impl AsRef<cef_permission_request_result_t> for PermissionRequestResult {
fn as_ref(&self) -> &cef_permission_request_result_t {
&self.0
}
}
impl AsMut<cef_permission_request_result_t> for PermissionRequestResult {
fn as_mut(&mut self) -> &mut cef_permission_request_result_t {
&mut self.0
}
}
impl From<cef_permission_request_result_t> for PermissionRequestResult {
fn from(value: cef_permission_request_result_t) -> Self {
Self(value)
}
}
impl From<PermissionRequestResult> for cef_permission_request_result_t {
fn from(value: PermissionRequestResult) -> Self {
value.0
}
}
impl PermissionRequestResult {
#[doc = "See [`cef_permission_request_result_t::CEF_PERMISSION_RESULT_ACCEPT`] for more documentation."]
pub const ACCEPT: Self = Self(cef_permission_request_result_t::CEF_PERMISSION_RESULT_ACCEPT);
#[doc = "See [`cef_permission_request_result_t::CEF_PERMISSION_RESULT_DENY`] for more documentation."]
pub const DENY: Self = Self(cef_permission_request_result_t::CEF_PERMISSION_RESULT_DENY);
#[doc = "See [`cef_permission_request_result_t::CEF_PERMISSION_RESULT_DISMISS`] for more documentation."]
pub const DISMISS: Self = Self(cef_permission_request_result_t::CEF_PERMISSION_RESULT_DISMISS);
#[doc = "See [`cef_permission_request_result_t::CEF_PERMISSION_RESULT_IGNORE`] for more documentation."]
pub const IGNORE: Self = Self(cef_permission_request_result_t::CEF_PERMISSION_RESULT_IGNORE);
#[doc = "See [`cef_permission_request_result_t::CEF_PERMISSION_RESULT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self =
Self(cef_permission_request_result_t::CEF_PERMISSION_RESULT_NUM_VALUES);
}
impl PermissionRequestResult {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PermissionRequestResult {
fn default() -> Self {
Self(cef_permission_request_result_t::CEF_PERMISSION_RESULT_ACCEPT)
}
}
/// See [`cef_test_cert_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TestCertType(cef_test_cert_type_t);
impl AsRef<cef_test_cert_type_t> for TestCertType {
fn as_ref(&self) -> &cef_test_cert_type_t {
&self.0
}
}
impl AsMut<cef_test_cert_type_t> for TestCertType {
fn as_mut(&mut self) -> &mut cef_test_cert_type_t {
&mut self.0
}
}
impl From<cef_test_cert_type_t> for TestCertType {
fn from(value: cef_test_cert_type_t) -> Self {
Self(value)
}
}
impl From<TestCertType> for cef_test_cert_type_t {
fn from(value: TestCertType) -> Self {
value.0
}
}
impl TestCertType {
#[doc = "See [`cef_test_cert_type_t::CEF_TEST_CERT_OK_IP`] for more documentation."]
pub const OK_IP: Self = Self(cef_test_cert_type_t::CEF_TEST_CERT_OK_IP);
#[doc = "See [`cef_test_cert_type_t::CEF_TEST_CERT_OK_DOMAIN`] for more documentation."]
pub const OK_DOMAIN: Self = Self(cef_test_cert_type_t::CEF_TEST_CERT_OK_DOMAIN);
#[doc = "See [`cef_test_cert_type_t::CEF_TEST_CERT_EXPIRED`] for more documentation."]
pub const EXPIRED: Self = Self(cef_test_cert_type_t::CEF_TEST_CERT_EXPIRED);
#[doc = "See [`cef_test_cert_type_t::CEF_TEST_CERT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_test_cert_type_t::CEF_TEST_CERT_NUM_VALUES);
}
impl TestCertType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TestCertType {
fn default() -> Self {
Self(cef_test_cert_type_t::CEF_TEST_CERT_OK_IP)
}
}
/// See [`cef_preferences_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PreferencesType(cef_preferences_type_t);
impl AsRef<cef_preferences_type_t> for PreferencesType {
fn as_ref(&self) -> &cef_preferences_type_t {
&self.0
}
}
impl AsMut<cef_preferences_type_t> for PreferencesType {
fn as_mut(&mut self) -> &mut cef_preferences_type_t {
&mut self.0
}
}
impl From<cef_preferences_type_t> for PreferencesType {
fn from(value: cef_preferences_type_t) -> Self {
Self(value)
}
}
impl From<PreferencesType> for cef_preferences_type_t {
fn from(value: PreferencesType) -> Self {
value.0
}
}
impl PreferencesType {
#[doc = "See [`cef_preferences_type_t::CEF_PREFERENCES_TYPE_GLOBAL`] for more documentation."]
pub const GLOBAL: Self = Self(cef_preferences_type_t::CEF_PREFERENCES_TYPE_GLOBAL);
#[doc = "See [`cef_preferences_type_t::CEF_PREFERENCES_TYPE_REQUEST_CONTEXT`] for more documentation."]
pub const REQUEST_CONTEXT: Self =
Self(cef_preferences_type_t::CEF_PREFERENCES_TYPE_REQUEST_CONTEXT);
#[doc = "See [`cef_preferences_type_t::CEF_PREFERENCES_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_preferences_type_t::CEF_PREFERENCES_TYPE_NUM_VALUES);
}
impl PreferencesType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for PreferencesType {
fn default() -> Self {
Self(cef_preferences_type_t::CEF_PREFERENCES_TYPE_GLOBAL)
}
}
/// See [`cef_download_interrupt_reason_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DownloadInterruptReason(cef_download_interrupt_reason_t);
impl AsRef<cef_download_interrupt_reason_t> for DownloadInterruptReason {
fn as_ref(&self) -> &cef_download_interrupt_reason_t {
&self.0
}
}
impl AsMut<cef_download_interrupt_reason_t> for DownloadInterruptReason {
fn as_mut(&mut self) -> &mut cef_download_interrupt_reason_t {
&mut self.0
}
}
impl From<cef_download_interrupt_reason_t> for DownloadInterruptReason {
fn from(value: cef_download_interrupt_reason_t) -> Self {
Self(value)
}
}
impl From<DownloadInterruptReason> for cef_download_interrupt_reason_t {
fn from(value: DownloadInterruptReason) -> Self {
value.0
}
}
impl DownloadInterruptReason {
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NONE`] for more documentation."]
pub const NONE: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NONE);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED`] for more documentation."]
pub const FILE_FAILED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED`] for more documentation."]
pub const FILE_ACCESS_DENIED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE`] for more documentation."]
pub const FILE_NO_SPACE: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG`] for more documentation."]
pub const FILE_NAME_TOO_LONG: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE`] for more documentation."]
pub const FILE_TOO_LARGE: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED`] for more documentation."]
pub const FILE_VIRUS_INFECTED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR`] for more documentation."]
pub const FILE_TRANSIENT_ERROR: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED`] for more documentation."]
pub const FILE_BLOCKED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED`] for more documentation."]
pub const FILE_SECURITY_CHECK_FAILED: Self = Self(
cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED,
);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT`] for more documentation."]
pub const FILE_TOO_SHORT: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH`] for more documentation."]
pub const FILE_HASH_MISMATCH: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SAME_AS_SOURCE`] for more documentation."]
pub const FILE_SAME_AS_SOURCE: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SAME_AS_SOURCE);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED`] for more documentation."]
pub const NETWORK_FAILED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT`] for more documentation."]
pub const NETWORK_TIMEOUT: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED`] for more documentation."]
pub const NETWORK_DISCONNECTED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN`] for more documentation."]
pub const NETWORK_SERVER_DOWN: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST`] for more documentation."]
pub const NETWORK_INVALID_REQUEST: Self = Self(
cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST,
);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED`] for more documentation."]
pub const SERVER_FAILED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE`] for more documentation."]
pub const SERVER_NO_RANGE: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT`] for more documentation."]
pub const SERVER_BAD_CONTENT: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED`] for more documentation."]
pub const SERVER_UNAUTHORIZED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM`] for more documentation."]
pub const SERVER_CERT_PROBLEM: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN`] for more documentation."]
pub const SERVER_FORBIDDEN: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE`] for more documentation."]
pub const SERVER_UNREACHABLE: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH`] for more documentation."]
pub const SERVER_CONTENT_LENGTH_MISMATCH : Self = Self (cef_download_interrupt_reason_t :: CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH) ;
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT`] for more documentation."]
pub const SERVER_CROSS_ORIGIN_REDIRECT: Self = Self(
cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT,
);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED`] for more documentation."]
pub const USER_CANCELED: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN`] for more documentation."]
pub const USER_SHUTDOWN: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN);
#[doc = "See [`cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_CRASH`] for more documentation."]
pub const CRASH: Self =
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_CRASH);
}
impl DownloadInterruptReason {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for DownloadInterruptReason {
fn default() -> Self {
Self(cef_download_interrupt_reason_t::CEF_DOWNLOAD_INTERRUPT_REASON_NONE)
}
}
/// See [`cef_gesture_command_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct GestureCommand(cef_gesture_command_t);
impl AsRef<cef_gesture_command_t> for GestureCommand {
fn as_ref(&self) -> &cef_gesture_command_t {
&self.0
}
}
impl AsMut<cef_gesture_command_t> for GestureCommand {
fn as_mut(&mut self) -> &mut cef_gesture_command_t {
&mut self.0
}
}
impl From<cef_gesture_command_t> for GestureCommand {
fn from(value: cef_gesture_command_t) -> Self {
Self(value)
}
}
impl From<GestureCommand> for cef_gesture_command_t {
fn from(value: GestureCommand) -> Self {
value.0
}
}
impl GestureCommand {
#[doc = "See [`cef_gesture_command_t::CEF_GESTURE_COMMAND_BACK`] for more documentation."]
pub const BACK: Self = Self(cef_gesture_command_t::CEF_GESTURE_COMMAND_BACK);
#[doc = "See [`cef_gesture_command_t::CEF_GESTURE_COMMAND_FORWARD`] for more documentation."]
pub const FORWARD: Self = Self(cef_gesture_command_t::CEF_GESTURE_COMMAND_FORWARD);
}
impl GestureCommand {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for GestureCommand {
fn default() -> Self {
Self(cef_gesture_command_t::CEF_GESTURE_COMMAND_BACK)
}
}
/// See [`cef_zoom_command_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ZoomCommand(cef_zoom_command_t);
impl AsRef<cef_zoom_command_t> for ZoomCommand {
fn as_ref(&self) -> &cef_zoom_command_t {
&self.0
}
}
impl AsMut<cef_zoom_command_t> for ZoomCommand {
fn as_mut(&mut self) -> &mut cef_zoom_command_t {
&mut self.0
}
}
impl From<cef_zoom_command_t> for ZoomCommand {
fn from(value: cef_zoom_command_t) -> Self {
Self(value)
}
}
impl From<ZoomCommand> for cef_zoom_command_t {
fn from(value: ZoomCommand) -> Self {
value.0
}
}
impl ZoomCommand {
#[doc = "See [`cef_zoom_command_t::CEF_ZOOM_COMMAND_OUT`] for more documentation."]
pub const OUT: Self = Self(cef_zoom_command_t::CEF_ZOOM_COMMAND_OUT);
#[doc = "See [`cef_zoom_command_t::CEF_ZOOM_COMMAND_RESET`] for more documentation."]
pub const RESET: Self = Self(cef_zoom_command_t::CEF_ZOOM_COMMAND_RESET);
#[doc = "See [`cef_zoom_command_t::CEF_ZOOM_COMMAND_IN`] for more documentation."]
pub const IN: Self = Self(cef_zoom_command_t::CEF_ZOOM_COMMAND_IN);
}
impl ZoomCommand {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ZoomCommand {
fn default() -> Self {
Self(cef_zoom_command_t::CEF_ZOOM_COMMAND_OUT)
}
}
/// See [`cef_color_variant_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ColorVariant(cef_color_variant_t);
impl AsRef<cef_color_variant_t> for ColorVariant {
fn as_ref(&self) -> &cef_color_variant_t {
&self.0
}
}
impl AsMut<cef_color_variant_t> for ColorVariant {
fn as_mut(&mut self) -> &mut cef_color_variant_t {
&mut self.0
}
}
impl From<cef_color_variant_t> for ColorVariant {
fn from(value: cef_color_variant_t) -> Self {
Self(value)
}
}
impl From<ColorVariant> for cef_color_variant_t {
fn from(value: ColorVariant) -> Self {
value.0
}
}
impl ColorVariant {
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_SYSTEM`] for more documentation."]
pub const SYSTEM: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_SYSTEM);
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_LIGHT`] for more documentation."]
pub const LIGHT: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_LIGHT);
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_DARK`] for more documentation."]
pub const DARK: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_DARK);
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_TONAL_SPOT`] for more documentation."]
pub const TONAL_SPOT: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_TONAL_SPOT);
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_NEUTRAL`] for more documentation."]
pub const NEUTRAL: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_NEUTRAL);
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_VIBRANT`] for more documentation."]
pub const VIBRANT: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_VIBRANT);
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_EXPRESSIVE`] for more documentation."]
pub const EXPRESSIVE: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_EXPRESSIVE);
#[doc = "See [`cef_color_variant_t::CEF_COLOR_VARIANT_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_color_variant_t::CEF_COLOR_VARIANT_NUM_VALUES);
}
impl ColorVariant {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ColorVariant {
fn default() -> Self {
Self(cef_color_variant_t::CEF_COLOR_VARIANT_SYSTEM)
}
}
/// See [`cef_task_type_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TaskType(cef_task_type_t);
impl AsRef<cef_task_type_t> for TaskType {
fn as_ref(&self) -> &cef_task_type_t {
&self.0
}
}
impl AsMut<cef_task_type_t> for TaskType {
fn as_mut(&mut self) -> &mut cef_task_type_t {
&mut self.0
}
}
impl From<cef_task_type_t> for TaskType {
fn from(value: cef_task_type_t) -> Self {
Self(value)
}
}
impl From<TaskType> for cef_task_type_t {
fn from(value: TaskType) -> Self {
value.0
}
}
impl TaskType {
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_UNKNOWN`] for more documentation."]
pub const UNKNOWN: Self = Self(cef_task_type_t::CEF_TASK_TYPE_UNKNOWN);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_BROWSER`] for more documentation."]
pub const BROWSER: Self = Self(cef_task_type_t::CEF_TASK_TYPE_BROWSER);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_GPU`] for more documentation."]
pub const GPU: Self = Self(cef_task_type_t::CEF_TASK_TYPE_GPU);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_ZYGOTE`] for more documentation."]
pub const ZYGOTE: Self = Self(cef_task_type_t::CEF_TASK_TYPE_ZYGOTE);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_UTILITY`] for more documentation."]
pub const UTILITY: Self = Self(cef_task_type_t::CEF_TASK_TYPE_UTILITY);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_RENDERER`] for more documentation."]
pub const RENDERER: Self = Self(cef_task_type_t::CEF_TASK_TYPE_RENDERER);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_EXTENSION`] for more documentation."]
pub const EXTENSION: Self = Self(cef_task_type_t::CEF_TASK_TYPE_EXTENSION);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_GUEST`] for more documentation."]
pub const GUEST: Self = Self(cef_task_type_t::CEF_TASK_TYPE_GUEST);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_PLUGIN_DEPRECATED`] for more documentation."]
pub const PLUGIN_DEPRECATED: Self = Self(cef_task_type_t::CEF_TASK_TYPE_PLUGIN_DEPRECATED);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_SANDBOX_HELPER`] for more documentation."]
pub const SANDBOX_HELPER: Self = Self(cef_task_type_t::CEF_TASK_TYPE_SANDBOX_HELPER);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_DEDICATED_WORKER`] for more documentation."]
pub const DEDICATED_WORKER: Self = Self(cef_task_type_t::CEF_TASK_TYPE_DEDICATED_WORKER);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_SHARED_WORKER`] for more documentation."]
pub const SHARED_WORKER: Self = Self(cef_task_type_t::CEF_TASK_TYPE_SHARED_WORKER);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_SERVICE_WORKER`] for more documentation."]
pub const SERVICE_WORKER: Self = Self(cef_task_type_t::CEF_TASK_TYPE_SERVICE_WORKER);
#[doc = "See [`cef_task_type_t::CEF_TASK_TYPE_NUM_VALUES`] for more documentation."]
pub const NUM_VALUES: Self = Self(cef_task_type_t::CEF_TASK_TYPE_NUM_VALUES);
}
impl TaskType {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for TaskType {
fn default() -> Self {
Self(cef_task_type_t::CEF_TASK_TYPE_UNKNOWN)
}
}
/// See [`cef_component_update_error_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ComponentUpdateError(cef_component_update_error_t);
impl AsRef<cef_component_update_error_t> for ComponentUpdateError {
fn as_ref(&self) -> &cef_component_update_error_t {
&self.0
}
}
impl AsMut<cef_component_update_error_t> for ComponentUpdateError {
fn as_mut(&mut self) -> &mut cef_component_update_error_t {
&mut self.0
}
}
impl From<cef_component_update_error_t> for ComponentUpdateError {
fn from(value: cef_component_update_error_t) -> Self {
Self(value)
}
}
impl From<ComponentUpdateError> for cef_component_update_error_t {
fn from(value: ComponentUpdateError) -> Self {
value.0
}
}
impl ComponentUpdateError {
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_NONE`] for more documentation."]
pub const NONE: Self = Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_NONE);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_UPDATE_IN_PROGRESS`] for more documentation."]
pub const UPDATE_IN_PROGRESS: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_UPDATE_IN_PROGRESS);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_UPDATE_CANCELED`] for more documentation."]
pub const UPDATE_CANCELED: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_UPDATE_CANCELED);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_RETRY_LATER`] for more documentation."]
pub const RETRY_LATER: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_RETRY_LATER);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_SERVICE_ERROR`] for more documentation."]
pub const SERVICE_ERROR: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_SERVICE_ERROR);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_UPDATE_CHECK_ERROR`] for more documentation."]
pub const UPDATE_CHECK_ERROR: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_UPDATE_CHECK_ERROR);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_CRX_NOT_FOUND`] for more documentation."]
pub const CRX_NOT_FOUND: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_CRX_NOT_FOUND);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_INVALID_ARGUMENT`] for more documentation."]
pub const INVALID_ARGUMENT: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_INVALID_ARGUMENT);
#[doc = "See [`cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_BAD_CRX_DATA_CALLBACK`] for more documentation."]
pub const BAD_CRX_DATA_CALLBACK: Self =
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_BAD_CRX_DATA_CALLBACK);
}
impl ComponentUpdateError {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ComponentUpdateError {
fn default() -> Self {
Self(cef_component_update_error_t::CEF_COMPONENT_UPDATE_ERROR_NONE)
}
}
/// See [`cef_component_update_priority_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ComponentUpdatePriority(cef_component_update_priority_t);
impl AsRef<cef_component_update_priority_t> for ComponentUpdatePriority {
fn as_ref(&self) -> &cef_component_update_priority_t {
&self.0
}
}
impl AsMut<cef_component_update_priority_t> for ComponentUpdatePriority {
fn as_mut(&mut self) -> &mut cef_component_update_priority_t {
&mut self.0
}
}
impl From<cef_component_update_priority_t> for ComponentUpdatePriority {
fn from(value: cef_component_update_priority_t) -> Self {
Self(value)
}
}
impl From<ComponentUpdatePriority> for cef_component_update_priority_t {
fn from(value: ComponentUpdatePriority) -> Self {
value.0
}
}
impl ComponentUpdatePriority {
#[doc = "See [`cef_component_update_priority_t::CEF_COMPONENT_UPDATE_PRIORITY_BACKGROUND`] for more documentation."]
pub const BACKGROUND: Self =
Self(cef_component_update_priority_t::CEF_COMPONENT_UPDATE_PRIORITY_BACKGROUND);
#[doc = "See [`cef_component_update_priority_t::CEF_COMPONENT_UPDATE_PRIORITY_FOREGROUND`] for more documentation."]
pub const FOREGROUND: Self =
Self(cef_component_update_priority_t::CEF_COMPONENT_UPDATE_PRIORITY_FOREGROUND);
}
impl ComponentUpdatePriority {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ComponentUpdatePriority {
fn default() -> Self {
Self(cef_component_update_priority_t::CEF_COMPONENT_UPDATE_PRIORITY_BACKGROUND)
}
}
/// See [`cef_component_state_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ComponentState(cef_component_state_t);
impl AsRef<cef_component_state_t> for ComponentState {
fn as_ref(&self) -> &cef_component_state_t {
&self.0
}
}
impl AsMut<cef_component_state_t> for ComponentState {
fn as_mut(&mut self) -> &mut cef_component_state_t {
&mut self.0
}
}
impl From<cef_component_state_t> for ComponentState {
fn from(value: cef_component_state_t) -> Self {
Self(value)
}
}
impl From<ComponentState> for cef_component_state_t {
fn from(value: ComponentState) -> Self {
value.0
}
}
impl ComponentState {
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_NEW`] for more documentation."]
pub const NEW: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_NEW);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_CHECKING`] for more documentation."]
pub const CHECKING: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_CHECKING);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_CAN_UPDATE`] for more documentation."]
pub const CAN_UPDATE: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_CAN_UPDATE);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_DOWNLOADING`] for more documentation."]
pub const DOWNLOADING: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_DOWNLOADING);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_DECOMPRESSING`] for more documentation."]
pub const DECOMPRESSING: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_DECOMPRESSING);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_PATCHING`] for more documentation."]
pub const PATCHING: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_PATCHING);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_UPDATING`] for more documentation."]
pub const UPDATING: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_UPDATING);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_UPDATED`] for more documentation."]
pub const UPDATED: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_UPDATED);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_UP_TO_DATE`] for more documentation."]
pub const UP_TO_DATE: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_UP_TO_DATE);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_UPDATE_ERROR`] for more documentation."]
pub const UPDATE_ERROR: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_UPDATE_ERROR);
#[doc = "See [`cef_component_state_t::CEF_COMPONENT_STATE_RUN`] for more documentation."]
pub const RUN: Self = Self(cef_component_state_t::CEF_COMPONENT_STATE_RUN);
}
impl ComponentState {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ComponentState {
fn default() -> Self {
Self(cef_component_state_t::CEF_COMPONENT_STATE_NEW)
}
}
/// See [`cef_color_id_t`] for more documentation.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ColorId(cef_color_id_t);
impl AsRef<cef_color_id_t> for ColorId {
fn as_ref(&self) -> &cef_color_id_t {
&self.0
}
}
impl AsMut<cef_color_id_t> for ColorId {
fn as_mut(&mut self) -> &mut cef_color_id_t {
&mut self.0
}
}
impl From<cef_color_id_t> for ColorId {
fn from(value: cef_color_id_t) -> Self {
Self(value)
}
}
impl From<ColorId> for cef_color_id_t {
fn from(value: ColorId) -> Self {
value.0
}
}
impl ColorId {
#[doc = "See [`cef_color_id_t::CEF_UiColorsStart`] for more documentation."]
pub const UI_COLORS_START: Self = Self(cef_color_id_t::CEF_UiColorsStart);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary10`] for more documentation."]
pub const COLOR_REF_PRIMARY10: Self = Self(cef_color_id_t::CEF_ColorRefPrimary10);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary20`] for more documentation."]
pub const COLOR_REF_PRIMARY20: Self = Self(cef_color_id_t::CEF_ColorRefPrimary20);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary25`] for more documentation."]
pub const COLOR_REF_PRIMARY25: Self = Self(cef_color_id_t::CEF_ColorRefPrimary25);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary30`] for more documentation."]
pub const COLOR_REF_PRIMARY30: Self = Self(cef_color_id_t::CEF_ColorRefPrimary30);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary40`] for more documentation."]
pub const COLOR_REF_PRIMARY40: Self = Self(cef_color_id_t::CEF_ColorRefPrimary40);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary50`] for more documentation."]
pub const COLOR_REF_PRIMARY50: Self = Self(cef_color_id_t::CEF_ColorRefPrimary50);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary60`] for more documentation."]
pub const COLOR_REF_PRIMARY60: Self = Self(cef_color_id_t::CEF_ColorRefPrimary60);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary70`] for more documentation."]
pub const COLOR_REF_PRIMARY70: Self = Self(cef_color_id_t::CEF_ColorRefPrimary70);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary80`] for more documentation."]
pub const COLOR_REF_PRIMARY80: Self = Self(cef_color_id_t::CEF_ColorRefPrimary80);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary90`] for more documentation."]
pub const COLOR_REF_PRIMARY90: Self = Self(cef_color_id_t::CEF_ColorRefPrimary90);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary95`] for more documentation."]
pub const COLOR_REF_PRIMARY95: Self = Self(cef_color_id_t::CEF_ColorRefPrimary95);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary99`] for more documentation."]
pub const COLOR_REF_PRIMARY99: Self = Self(cef_color_id_t::CEF_ColorRefPrimary99);
#[doc = "See [`cef_color_id_t::CEF_ColorRefPrimary100`] for more documentation."]
pub const COLOR_REF_PRIMARY100: Self = Self(cef_color_id_t::CEF_ColorRefPrimary100);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary0`] for more documentation."]
pub const COLOR_REF_SECONDARY0: Self = Self(cef_color_id_t::CEF_ColorRefSecondary0);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary10`] for more documentation."]
pub const COLOR_REF_SECONDARY10: Self = Self(cef_color_id_t::CEF_ColorRefSecondary10);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary12`] for more documentation."]
pub const COLOR_REF_SECONDARY12: Self = Self(cef_color_id_t::CEF_ColorRefSecondary12);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary15`] for more documentation."]
pub const COLOR_REF_SECONDARY15: Self = Self(cef_color_id_t::CEF_ColorRefSecondary15);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary20`] for more documentation."]
pub const COLOR_REF_SECONDARY20: Self = Self(cef_color_id_t::CEF_ColorRefSecondary20);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary25`] for more documentation."]
pub const COLOR_REF_SECONDARY25: Self = Self(cef_color_id_t::CEF_ColorRefSecondary25);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary30`] for more documentation."]
pub const COLOR_REF_SECONDARY30: Self = Self(cef_color_id_t::CEF_ColorRefSecondary30);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary35`] for more documentation."]
pub const COLOR_REF_SECONDARY35: Self = Self(cef_color_id_t::CEF_ColorRefSecondary35);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary40`] for more documentation."]
pub const COLOR_REF_SECONDARY40: Self = Self(cef_color_id_t::CEF_ColorRefSecondary40);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary50`] for more documentation."]
pub const COLOR_REF_SECONDARY50: Self = Self(cef_color_id_t::CEF_ColorRefSecondary50);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary60`] for more documentation."]
pub const COLOR_REF_SECONDARY60: Self = Self(cef_color_id_t::CEF_ColorRefSecondary60);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary70`] for more documentation."]
pub const COLOR_REF_SECONDARY70: Self = Self(cef_color_id_t::CEF_ColorRefSecondary70);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary80`] for more documentation."]
pub const COLOR_REF_SECONDARY80: Self = Self(cef_color_id_t::CEF_ColorRefSecondary80);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary90`] for more documentation."]
pub const COLOR_REF_SECONDARY90: Self = Self(cef_color_id_t::CEF_ColorRefSecondary90);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary95`] for more documentation."]
pub const COLOR_REF_SECONDARY95: Self = Self(cef_color_id_t::CEF_ColorRefSecondary95);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary99`] for more documentation."]
pub const COLOR_REF_SECONDARY99: Self = Self(cef_color_id_t::CEF_ColorRefSecondary99);
#[doc = "See [`cef_color_id_t::CEF_ColorRefSecondary100`] for more documentation."]
pub const COLOR_REF_SECONDARY100: Self = Self(cef_color_id_t::CEF_ColorRefSecondary100);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary0`] for more documentation."]
pub const COLOR_REF_TERTIARY0: Self = Self(cef_color_id_t::CEF_ColorRefTertiary0);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary10`] for more documentation."]
pub const COLOR_REF_TERTIARY10: Self = Self(cef_color_id_t::CEF_ColorRefTertiary10);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary20`] for more documentation."]
pub const COLOR_REF_TERTIARY20: Self = Self(cef_color_id_t::CEF_ColorRefTertiary20);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary30`] for more documentation."]
pub const COLOR_REF_TERTIARY30: Self = Self(cef_color_id_t::CEF_ColorRefTertiary30);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary40`] for more documentation."]
pub const COLOR_REF_TERTIARY40: Self = Self(cef_color_id_t::CEF_ColorRefTertiary40);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary50`] for more documentation."]
pub const COLOR_REF_TERTIARY50: Self = Self(cef_color_id_t::CEF_ColorRefTertiary50);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary60`] for more documentation."]
pub const COLOR_REF_TERTIARY60: Self = Self(cef_color_id_t::CEF_ColorRefTertiary60);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary70`] for more documentation."]
pub const COLOR_REF_TERTIARY70: Self = Self(cef_color_id_t::CEF_ColorRefTertiary70);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary80`] for more documentation."]
pub const COLOR_REF_TERTIARY80: Self = Self(cef_color_id_t::CEF_ColorRefTertiary80);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary90`] for more documentation."]
pub const COLOR_REF_TERTIARY90: Self = Self(cef_color_id_t::CEF_ColorRefTertiary90);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary95`] for more documentation."]
pub const COLOR_REF_TERTIARY95: Self = Self(cef_color_id_t::CEF_ColorRefTertiary95);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary99`] for more documentation."]
pub const COLOR_REF_TERTIARY99: Self = Self(cef_color_id_t::CEF_ColorRefTertiary99);
#[doc = "See [`cef_color_id_t::CEF_ColorRefTertiary100`] for more documentation."]
pub const COLOR_REF_TERTIARY100: Self = Self(cef_color_id_t::CEF_ColorRefTertiary100);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError0`] for more documentation."]
pub const COLOR_REF_ERROR0: Self = Self(cef_color_id_t::CEF_ColorRefError0);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError10`] for more documentation."]
pub const COLOR_REF_ERROR10: Self = Self(cef_color_id_t::CEF_ColorRefError10);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError20`] for more documentation."]
pub const COLOR_REF_ERROR20: Self = Self(cef_color_id_t::CEF_ColorRefError20);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError30`] for more documentation."]
pub const COLOR_REF_ERROR30: Self = Self(cef_color_id_t::CEF_ColorRefError30);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError40`] for more documentation."]
pub const COLOR_REF_ERROR40: Self = Self(cef_color_id_t::CEF_ColorRefError40);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError50`] for more documentation."]
pub const COLOR_REF_ERROR50: Self = Self(cef_color_id_t::CEF_ColorRefError50);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError60`] for more documentation."]
pub const COLOR_REF_ERROR60: Self = Self(cef_color_id_t::CEF_ColorRefError60);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError70`] for more documentation."]
pub const COLOR_REF_ERROR70: Self = Self(cef_color_id_t::CEF_ColorRefError70);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError80`] for more documentation."]
pub const COLOR_REF_ERROR80: Self = Self(cef_color_id_t::CEF_ColorRefError80);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError90`] for more documentation."]
pub const COLOR_REF_ERROR90: Self = Self(cef_color_id_t::CEF_ColorRefError90);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError95`] for more documentation."]
pub const COLOR_REF_ERROR95: Self = Self(cef_color_id_t::CEF_ColorRefError95);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError99`] for more documentation."]
pub const COLOR_REF_ERROR99: Self = Self(cef_color_id_t::CEF_ColorRefError99);
#[doc = "See [`cef_color_id_t::CEF_ColorRefError100`] for more documentation."]
pub const COLOR_REF_ERROR100: Self = Self(cef_color_id_t::CEF_ColorRefError100);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral0`] for more documentation."]
pub const COLOR_REF_NEUTRAL0: Self = Self(cef_color_id_t::CEF_ColorRefNeutral0);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral4`] for more documentation."]
pub const COLOR_REF_NEUTRAL4: Self = Self(cef_color_id_t::CEF_ColorRefNeutral4);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral6`] for more documentation."]
pub const COLOR_REF_NEUTRAL6: Self = Self(cef_color_id_t::CEF_ColorRefNeutral6);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral8`] for more documentation."]
pub const COLOR_REF_NEUTRAL8: Self = Self(cef_color_id_t::CEF_ColorRefNeutral8);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral10`] for more documentation."]
pub const COLOR_REF_NEUTRAL10: Self = Self(cef_color_id_t::CEF_ColorRefNeutral10);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral12`] for more documentation."]
pub const COLOR_REF_NEUTRAL12: Self = Self(cef_color_id_t::CEF_ColorRefNeutral12);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral15`] for more documentation."]
pub const COLOR_REF_NEUTRAL15: Self = Self(cef_color_id_t::CEF_ColorRefNeutral15);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral17`] for more documentation."]
pub const COLOR_REF_NEUTRAL17: Self = Self(cef_color_id_t::CEF_ColorRefNeutral17);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral20`] for more documentation."]
pub const COLOR_REF_NEUTRAL20: Self = Self(cef_color_id_t::CEF_ColorRefNeutral20);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral22`] for more documentation."]
pub const COLOR_REF_NEUTRAL22: Self = Self(cef_color_id_t::CEF_ColorRefNeutral22);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral24`] for more documentation."]
pub const COLOR_REF_NEUTRAL24: Self = Self(cef_color_id_t::CEF_ColorRefNeutral24);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral25`] for more documentation."]
pub const COLOR_REF_NEUTRAL25: Self = Self(cef_color_id_t::CEF_ColorRefNeutral25);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral30`] for more documentation."]
pub const COLOR_REF_NEUTRAL30: Self = Self(cef_color_id_t::CEF_ColorRefNeutral30);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral40`] for more documentation."]
pub const COLOR_REF_NEUTRAL40: Self = Self(cef_color_id_t::CEF_ColorRefNeutral40);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral50`] for more documentation."]
pub const COLOR_REF_NEUTRAL50: Self = Self(cef_color_id_t::CEF_ColorRefNeutral50);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral60`] for more documentation."]
pub const COLOR_REF_NEUTRAL60: Self = Self(cef_color_id_t::CEF_ColorRefNeutral60);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral70`] for more documentation."]
pub const COLOR_REF_NEUTRAL70: Self = Self(cef_color_id_t::CEF_ColorRefNeutral70);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral80`] for more documentation."]
pub const COLOR_REF_NEUTRAL80: Self = Self(cef_color_id_t::CEF_ColorRefNeutral80);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral87`] for more documentation."]
pub const COLOR_REF_NEUTRAL87: Self = Self(cef_color_id_t::CEF_ColorRefNeutral87);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral90`] for more documentation."]
pub const COLOR_REF_NEUTRAL90: Self = Self(cef_color_id_t::CEF_ColorRefNeutral90);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral92`] for more documentation."]
pub const COLOR_REF_NEUTRAL92: Self = Self(cef_color_id_t::CEF_ColorRefNeutral92);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral94`] for more documentation."]
pub const COLOR_REF_NEUTRAL94: Self = Self(cef_color_id_t::CEF_ColorRefNeutral94);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral95`] for more documentation."]
pub const COLOR_REF_NEUTRAL95: Self = Self(cef_color_id_t::CEF_ColorRefNeutral95);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral96`] for more documentation."]
pub const COLOR_REF_NEUTRAL96: Self = Self(cef_color_id_t::CEF_ColorRefNeutral96);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral98`] for more documentation."]
pub const COLOR_REF_NEUTRAL98: Self = Self(cef_color_id_t::CEF_ColorRefNeutral98);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral99`] for more documentation."]
pub const COLOR_REF_NEUTRAL99: Self = Self(cef_color_id_t::CEF_ColorRefNeutral99);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutral100`] for more documentation."]
pub const COLOR_REF_NEUTRAL100: Self = Self(cef_color_id_t::CEF_ColorRefNeutral100);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant0`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT0: Self = Self(cef_color_id_t::CEF_ColorRefNeutralVariant0);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant10`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT10: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant10);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant15`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT15: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant15);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant20`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT20: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant20);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant30`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT30: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant30);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant40`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT40: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant40);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant50`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT50: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant50);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant60`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT60: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant60);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant70`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT70: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant70);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant80`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT80: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant80);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant90`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT90: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant90);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant95`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT95: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant95);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant99`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT99: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant99);
#[doc = "See [`cef_color_id_t::CEF_ColorRefNeutralVariant100`] for more documentation."]
pub const COLOR_REF_NEUTRAL_VARIANT100: Self =
Self(cef_color_id_t::CEF_ColorRefNeutralVariant100);
#[doc = "See [`cef_color_id_t::CEF_ColorSysPrimary`] for more documentation."]
pub const COLOR_SYS_PRIMARY: Self = Self(cef_color_id_t::CEF_ColorSysPrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnPrimary`] for more documentation."]
pub const COLOR_SYS_ON_PRIMARY: Self = Self(cef_color_id_t::CEF_ColorSysOnPrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysPrimaryContainer`] for more documentation."]
pub const COLOR_SYS_PRIMARY_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysPrimaryContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnPrimaryContainer`] for more documentation."]
pub const COLOR_SYS_ON_PRIMARY_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysOnPrimaryContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSecondary`] for more documentation."]
pub const COLOR_SYS_SECONDARY: Self = Self(cef_color_id_t::CEF_ColorSysSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSecondary`] for more documentation."]
pub const COLOR_SYS_ON_SECONDARY: Self = Self(cef_color_id_t::CEF_ColorSysOnSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSecondaryContainer`] for more documentation."]
pub const COLOR_SYS_SECONDARY_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysSecondaryContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSecondaryContainer`] for more documentation."]
pub const COLOR_SYS_ON_SECONDARY_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysOnSecondaryContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysTertiary`] for more documentation."]
pub const COLOR_SYS_TERTIARY: Self = Self(cef_color_id_t::CEF_ColorSysTertiary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnTertiary`] for more documentation."]
pub const COLOR_SYS_ON_TERTIARY: Self = Self(cef_color_id_t::CEF_ColorSysOnTertiary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysTertiaryContainer`] for more documentation."]
pub const COLOR_SYS_TERTIARY_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysTertiaryContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnTertiaryContainer`] for more documentation."]
pub const COLOR_SYS_ON_TERTIARY_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysOnTertiaryContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysError`] for more documentation."]
pub const COLOR_SYS_ERROR: Self = Self(cef_color_id_t::CEF_ColorSysError);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnError`] for more documentation."]
pub const COLOR_SYS_ON_ERROR: Self = Self(cef_color_id_t::CEF_ColorSysOnError);
#[doc = "See [`cef_color_id_t::CEF_ColorSysErrorContainer`] for more documentation."]
pub const COLOR_SYS_ERROR_CONTAINER: Self = Self(cef_color_id_t::CEF_ColorSysErrorContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnErrorContainer`] for more documentation."]
pub const COLOR_SYS_ON_ERROR_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysOnErrorContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSurface`] for more documentation."]
pub const COLOR_SYS_ON_SURFACE: Self = Self(cef_color_id_t::CEF_ColorSysOnSurface);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSurfaceVariant`] for more documentation."]
pub const COLOR_SYS_ON_SURFACE_VARIANT: Self =
Self(cef_color_id_t::CEF_ColorSysOnSurfaceVariant);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOutline`] for more documentation."]
pub const COLOR_SYS_OUTLINE: Self = Self(cef_color_id_t::CEF_ColorSysOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurfaceVariant`] for more documentation."]
pub const COLOR_SYS_SURFACE_VARIANT: Self = Self(cef_color_id_t::CEF_ColorSysSurfaceVariant);
#[doc = "See [`cef_color_id_t::CEF_ColorSysBlack`] for more documentation."]
pub const COLOR_SYS_BLACK: Self = Self(cef_color_id_t::CEF_ColorSysBlack);
#[doc = "See [`cef_color_id_t::CEF_ColorSysWhite`] for more documentation."]
pub const COLOR_SYS_WHITE: Self = Self(cef_color_id_t::CEF_ColorSysWhite);
#[doc = "See [`cef_color_id_t::CEF_ColorSysInversePrimary`] for more documentation."]
pub const COLOR_SYS_INVERSE_PRIMARY: Self = Self(cef_color_id_t::CEF_ColorSysInversePrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysInverseOnSurface`] for more documentation."]
pub const COLOR_SYS_INVERSE_ON_SURFACE: Self =
Self(cef_color_id_t::CEF_ColorSysInverseOnSurface);
#[doc = "See [`cef_color_id_t::CEF_ColorSysInverseSurface`] for more documentation."]
pub const COLOR_SYS_INVERSE_SURFACE: Self = Self(cef_color_id_t::CEF_ColorSysInverseSurface);
#[doc = "See [`cef_color_id_t::CEF_ColorSysInverseSurfacePrimary`] for more documentation."]
pub const COLOR_SYS_INVERSE_SURFACE_PRIMARY: Self =
Self(cef_color_id_t::CEF_ColorSysInverseSurfacePrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurface`] for more documentation."]
pub const COLOR_SYS_SURFACE: Self = Self(cef_color_id_t::CEF_ColorSysSurface);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurface1`] for more documentation."]
pub const COLOR_SYS_SURFACE1: Self = Self(cef_color_id_t::CEF_ColorSysSurface1);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurface2`] for more documentation."]
pub const COLOR_SYS_SURFACE2: Self = Self(cef_color_id_t::CEF_ColorSysSurface2);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurface3`] for more documentation."]
pub const COLOR_SYS_SURFACE3: Self = Self(cef_color_id_t::CEF_ColorSysSurface3);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurface4`] for more documentation."]
pub const COLOR_SYS_SURFACE4: Self = Self(cef_color_id_t::CEF_ColorSysSurface4);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurface5`] for more documentation."]
pub const COLOR_SYS_SURFACE5: Self = Self(cef_color_id_t::CEF_ColorSysSurface5);
#[doc = "See [`cef_color_id_t::CEF_ColorSysSurfaceNumberedForeground`] for more documentation."]
pub const COLOR_SYS_SURFACE_NUMBERED_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSysSurfaceNumberedForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSurfaceSecondary`] for more documentation."]
pub const COLOR_SYS_ON_SURFACE_SECONDARY: Self =
Self(cef_color_id_t::CEF_ColorSysOnSurfaceSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSurfaceSubtle`] for more documentation."]
pub const COLOR_SYS_ON_SURFACE_SUBTLE: Self = Self(cef_color_id_t::CEF_ColorSysOnSurfaceSubtle);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSurfacePrimary`] for more documentation."]
pub const COLOR_SYS_ON_SURFACE_PRIMARY: Self =
Self(cef_color_id_t::CEF_ColorSysOnSurfacePrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnSurfacePrimaryInactive`] for more documentation."]
pub const COLOR_SYS_ON_SURFACE_PRIMARY_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorSysOnSurfacePrimaryInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorSysTonalContainer`] for more documentation."]
pub const COLOR_SYS_TONAL_CONTAINER: Self = Self(cef_color_id_t::CEF_ColorSysTonalContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnTonalContainer`] for more documentation."]
pub const COLOR_SYS_ON_TONAL_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysOnTonalContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysBaseTonalContainer`] for more documentation."]
pub const COLOR_SYS_BASE_TONAL_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysBaseTonalContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnBaseTonalContainer`] for more documentation."]
pub const COLOR_SYS_ON_BASE_TONAL_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysOnBaseTonalContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysTonalOutline`] for more documentation."]
pub const COLOR_SYS_TONAL_OUTLINE: Self = Self(cef_color_id_t::CEF_ColorSysTonalOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorSysNeutralOutline`] for more documentation."]
pub const COLOR_SYS_NEUTRAL_OUTLINE: Self = Self(cef_color_id_t::CEF_ColorSysNeutralOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorSysNeutralContainer`] for more documentation."]
pub const COLOR_SYS_NEUTRAL_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysNeutralContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysDivider`] for more documentation."]
pub const COLOR_SYS_DIVIDER: Self = Self(cef_color_id_t::CEF_ColorSysDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorSysBase`] for more documentation."]
pub const COLOR_SYS_BASE: Self = Self(cef_color_id_t::CEF_ColorSysBase);
#[doc = "See [`cef_color_id_t::CEF_ColorSysBaseContainer`] for more documentation."]
pub const COLOR_SYS_BASE_CONTAINER: Self = Self(cef_color_id_t::CEF_ColorSysBaseContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysBaseContainerElevated`] for more documentation."]
pub const COLOR_SYS_BASE_CONTAINER_ELEVATED: Self =
Self(cef_color_id_t::CEF_ColorSysBaseContainerElevated);
#[doc = "See [`cef_color_id_t::CEF_ColorSysHeader`] for more documentation."]
pub const COLOR_SYS_HEADER: Self = Self(cef_color_id_t::CEF_ColorSysHeader);
#[doc = "See [`cef_color_id_t::CEF_ColorSysHeaderInactive`] for more documentation."]
pub const COLOR_SYS_HEADER_INACTIVE: Self = Self(cef_color_id_t::CEF_ColorSysHeaderInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorSysHeaderContainer`] for more documentation."]
pub const COLOR_SYS_HEADER_CONTAINER: Self = Self(cef_color_id_t::CEF_ColorSysHeaderContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysHeaderContainerInactive`] for more documentation."]
pub const COLOR_SYS_HEADER_CONTAINER_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorSysHeaderContainerInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnHeaderDivider`] for more documentation."]
pub const COLOR_SYS_ON_HEADER_DIVIDER: Self = Self(cef_color_id_t::CEF_ColorSysOnHeaderDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnHeaderDividerInactive`] for more documentation."]
pub const COLOR_SYS_ON_HEADER_DIVIDER_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorSysOnHeaderDividerInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnHeaderPrimary`] for more documentation."]
pub const COLOR_SYS_ON_HEADER_PRIMARY: Self = Self(cef_color_id_t::CEF_ColorSysOnHeaderPrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOnHeaderPrimaryInactive`] for more documentation."]
pub const COLOR_SYS_ON_HEADER_PRIMARY_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorSysOnHeaderPrimaryInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHoverOnProminent`] for more documentation."]
pub const COLOR_SYS_STATE_HOVER_ON_PROMINENT: Self =
Self(cef_color_id_t::CEF_ColorSysStateHoverOnProminent);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHoverOnSubtle`] for more documentation."]
pub const COLOR_SYS_STATE_HOVER_ON_SUBTLE: Self =
Self(cef_color_id_t::CEF_ColorSysStateHoverOnSubtle);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateRippleNeutralOnProminent`] for more documentation."]
pub const COLOR_SYS_STATE_RIPPLE_NEUTRAL_ON_PROMINENT: Self =
Self(cef_color_id_t::CEF_ColorSysStateRippleNeutralOnProminent);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateRippleNeutralOnSubtle`] for more documentation."]
pub const COLOR_SYS_STATE_RIPPLE_NEUTRAL_ON_SUBTLE: Self =
Self(cef_color_id_t::CEF_ColorSysStateRippleNeutralOnSubtle);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateRipplePrimary`] for more documentation."]
pub const COLOR_SYS_STATE_RIPPLE_PRIMARY: Self =
Self(cef_color_id_t::CEF_ColorSysStateRipplePrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateFocusRing`] for more documentation."]
pub const COLOR_SYS_STATE_FOCUS_RING: Self = Self(cef_color_id_t::CEF_ColorSysStateFocusRing);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateFocusRingInverse`] for more documentation."]
pub const COLOR_SYS_STATE_FOCUS_RING_INVERSE: Self =
Self(cef_color_id_t::CEF_ColorSysStateFocusRingInverse);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateTextHighlight`] for more documentation."]
pub const COLOR_SYS_STATE_TEXT_HIGHLIGHT: Self =
Self(cef_color_id_t::CEF_ColorSysStateTextHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateOnTextHighlight`] for more documentation."]
pub const COLOR_SYS_STATE_ON_TEXT_HIGHLIGHT: Self =
Self(cef_color_id_t::CEF_ColorSysStateOnTextHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateFocusHighlight`] for more documentation."]
pub const COLOR_SYS_STATE_FOCUS_HIGHLIGHT: Self =
Self(cef_color_id_t::CEF_ColorSysStateFocusHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateDisabled`] for more documentation."]
pub const COLOR_SYS_STATE_DISABLED: Self = Self(cef_color_id_t::CEF_ColorSysStateDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateDisabledContainer`] for more documentation."]
pub const COLOR_SYS_STATE_DISABLED_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysStateDisabledContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHoverDimBlendProtection`] for more documentation."]
pub const COLOR_SYS_STATE_HOVER_DIM_BLEND_PROTECTION: Self =
Self(cef_color_id_t::CEF_ColorSysStateHoverDimBlendProtection);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHoverBrightBlendProtection`] for more documentation."]
pub const COLOR_SYS_STATE_HOVER_BRIGHT_BLEND_PROTECTION: Self =
Self(cef_color_id_t::CEF_ColorSysStateHoverBrightBlendProtection);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateInactiveRing`] for more documentation."]
pub const COLOR_SYS_STATE_INACTIVE_RING: Self =
Self(cef_color_id_t::CEF_ColorSysStateInactiveRing);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateScrim`] for more documentation."]
pub const COLOR_SYS_STATE_SCRIM: Self = Self(cef_color_id_t::CEF_ColorSysStateScrim);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateOnHeaderHover`] for more documentation."]
pub const COLOR_SYS_STATE_ON_HEADER_HOVER: Self =
Self(cef_color_id_t::CEF_ColorSysStateOnHeaderHover);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHeaderHover`] for more documentation."]
pub const COLOR_SYS_STATE_HEADER_HOVER: Self =
Self(cef_color_id_t::CEF_ColorSysStateHeaderHover);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHeaderHoverInactive`] for more documentation."]
pub const COLOR_SYS_STATE_HEADER_HOVER_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorSysStateHeaderHoverInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHeaderSelect`] for more documentation."]
pub const COLOR_SYS_STATE_HEADER_SELECT: Self =
Self(cef_color_id_t::CEF_ColorSysStateHeaderSelect);
#[doc = "See [`cef_color_id_t::CEF_ColorSysShadow`] for more documentation."]
pub const COLOR_SYS_SHADOW: Self = Self(cef_color_id_t::CEF_ColorSysShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorSysGradientPrimary`] for more documentation."]
pub const COLOR_SYS_GRADIENT_PRIMARY: Self = Self(cef_color_id_t::CEF_ColorSysGradientPrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysGradientTertiary`] for more documentation."]
pub const COLOR_SYS_GRADIENT_TERTIARY: Self =
Self(cef_color_id_t::CEF_ColorSysGradientTertiary);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloPrimaryMin`] for more documentation."]
pub const COLOR_SYS_ILLO_PRIMARY_MIN: Self = Self(cef_color_id_t::CEF_ColorSysIlloPrimaryMin);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloPrimaryLow`] for more documentation."]
pub const COLOR_SYS_ILLO_PRIMARY_LOW: Self = Self(cef_color_id_t::CEF_ColorSysIlloPrimaryLow);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloPrimaryMid`] for more documentation."]
pub const COLOR_SYS_ILLO_PRIMARY_MID: Self = Self(cef_color_id_t::CEF_ColorSysIlloPrimaryMid);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloPrimaryHigh`] for more documentation."]
pub const COLOR_SYS_ILLO_PRIMARY_HIGH: Self = Self(cef_color_id_t::CEF_ColorSysIlloPrimaryHigh);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloPrimaryMax`] for more documentation."]
pub const COLOR_SYS_ILLO_PRIMARY_MAX: Self = Self(cef_color_id_t::CEF_ColorSysIlloPrimaryMax);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloSecondaryMin`] for more documentation."]
pub const COLOR_SYS_ILLO_SECONDARY_MIN: Self =
Self(cef_color_id_t::CEF_ColorSysIlloSecondaryMin);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloSecondaryLow`] for more documentation."]
pub const COLOR_SYS_ILLO_SECONDARY_LOW: Self =
Self(cef_color_id_t::CEF_ColorSysIlloSecondaryLow);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloSecondaryMid`] for more documentation."]
pub const COLOR_SYS_ILLO_SECONDARY_MID: Self =
Self(cef_color_id_t::CEF_ColorSysIlloSecondaryMid);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloSecondaryHigh`] for more documentation."]
pub const COLOR_SYS_ILLO_SECONDARY_HIGH: Self =
Self(cef_color_id_t::CEF_ColorSysIlloSecondaryHigh);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloSecondaryMax`] for more documentation."]
pub const COLOR_SYS_ILLO_SECONDARY_MAX: Self =
Self(cef_color_id_t::CEF_ColorSysIlloSecondaryMax);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloTertiaryMin`] for more documentation."]
pub const COLOR_SYS_ILLO_TERTIARY_MIN: Self = Self(cef_color_id_t::CEF_ColorSysIlloTertiaryMin);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloTertiaryLow`] for more documentation."]
pub const COLOR_SYS_ILLO_TERTIARY_LOW: Self = Self(cef_color_id_t::CEF_ColorSysIlloTertiaryLow);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloTertiaryMid`] for more documentation."]
pub const COLOR_SYS_ILLO_TERTIARY_MID: Self = Self(cef_color_id_t::CEF_ColorSysIlloTertiaryMid);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloTertiaryHigh`] for more documentation."]
pub const COLOR_SYS_ILLO_TERTIARY_HIGH: Self =
Self(cef_color_id_t::CEF_ColorSysIlloTertiaryHigh);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloTertiaryMax`] for more documentation."]
pub const COLOR_SYS_ILLO_TERTIARY_MAX: Self = Self(cef_color_id_t::CEF_ColorSysIlloTertiaryMax);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloNeutralMin`] for more documentation."]
pub const COLOR_SYS_ILLO_NEUTRAL_MIN: Self = Self(cef_color_id_t::CEF_ColorSysIlloNeutralMin);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloNeutralLow`] for more documentation."]
pub const COLOR_SYS_ILLO_NEUTRAL_LOW: Self = Self(cef_color_id_t::CEF_ColorSysIlloNeutralLow);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloNeutralMid`] for more documentation."]
pub const COLOR_SYS_ILLO_NEUTRAL_MID: Self = Self(cef_color_id_t::CEF_ColorSysIlloNeutralMid);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloNeutralHigh`] for more documentation."]
pub const COLOR_SYS_ILLO_NEUTRAL_HIGH: Self = Self(cef_color_id_t::CEF_ColorSysIlloNeutralHigh);
#[doc = "See [`cef_color_id_t::CEF_ColorSysIlloNeutralMax`] for more documentation."]
pub const COLOR_SYS_ILLO_NEUTRAL_MAX: Self = Self(cef_color_id_t::CEF_ColorSysIlloNeutralMax);
#[doc = "See [`cef_color_id_t::CEF_ColorSysActorUiBorder`] for more documentation."]
pub const COLOR_SYS_ACTOR_UI_BORDER: Self = Self(cef_color_id_t::CEF_ColorSysActorUiBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSysActorUiGradientStart`] for more documentation."]
pub const COLOR_SYS_ACTOR_UI_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorSysActorUiGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorSysActorUiGradientMiddle`] for more documentation."]
pub const COLOR_SYS_ACTOR_UI_GRADIENT_MIDDLE: Self =
Self(cef_color_id_t::CEF_ColorSysActorUiGradientMiddle);
#[doc = "See [`cef_color_id_t::CEF_ColorSysActorUiGradientEnd`] for more documentation."]
pub const COLOR_SYS_ACTOR_UI_GRADIENT_END: Self =
Self(cef_color_id_t::CEF_ColorSysActorUiGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicTabUnderline1`] for more documentation."]
pub const COLOR_GLIC_TAB_UNDERLINE1: Self = Self(cef_color_id_t::CEF_ColorGlicTabUnderline1);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicTabUnderline2`] for more documentation."]
pub const COLOR_GLIC_TAB_UNDERLINE2: Self = Self(cef_color_id_t::CEF_ColorGlicTabUnderline2);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicTabUnderline3`] for more documentation."]
pub const COLOR_GLIC_TAB_UNDERLINE3: Self = Self(cef_color_id_t::CEF_ColorGlicTabUnderline3);
#[doc = "See [`cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurface1`] for more documentation."]
pub const COLOR_SYS_AI_ILLUSTRATION_SHAPE_SURFACE1: Self =
Self(cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurface1);
#[doc = "See [`cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurface2`] for more documentation."]
pub const COLOR_SYS_AI_ILLUSTRATION_SHAPE_SURFACE2: Self =
Self(cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurface2);
#[doc = "See [`cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurfaceGradientStart`] for more documentation."]
pub const COLOR_SYS_AI_ILLUSTRATION_SHAPE_SURFACE_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurfaceGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurfaceGradientEnd`] for more documentation."]
pub const COLOR_SYS_AI_ILLUSTRATION_SHAPE_SURFACE_GRADIENT_END: Self =
Self(cef_color_id_t::CEF_ColorSysAiIllustrationShapeSurfaceGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorSysOmniboxContainer`] for more documentation."]
pub const COLOR_SYS_OMNIBOX_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSysOmniboxContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateHover`] for more documentation."]
pub const COLOR_SYS_STATE_HOVER: Self = Self(cef_color_id_t::CEF_ColorSysStateHover);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStateFocus`] for more documentation."]
pub const COLOR_SYS_STATE_FOCUS: Self = Self(cef_color_id_t::CEF_ColorSysStateFocus);
#[doc = "See [`cef_color_id_t::CEF_ColorSysStatePressed`] for more documentation."]
pub const COLOR_SYS_STATE_PRESSED: Self = Self(cef_color_id_t::CEF_ColorSysStatePressed);
#[doc = "See [`cef_color_id_t::CEF_ColorAccent`] for more documentation."]
pub const COLOR_ACCENT: Self = Self(cef_color_id_t::CEF_ColorAccent);
#[doc = "See [`cef_color_id_t::CEF_ColorAccentWithGuaranteedContrastAtopPrimaryBackground`] for more documentation."]
pub const COLOR_ACCENT_WITH_GUARANTEED_CONTRAST_ATOP_PRIMARY_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorAccentWithGuaranteedContrastAtopPrimaryBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorAlertHighSeverity`] for more documentation."]
pub const COLOR_ALERT_HIGH_SEVERITY: Self = Self(cef_color_id_t::CEF_ColorAlertHighSeverity);
#[doc = "See [`cef_color_id_t::CEF_ColorAlertLowSeverity`] for more documentation."]
pub const COLOR_ALERT_LOW_SEVERITY: Self = Self(cef_color_id_t::CEF_ColorAlertLowSeverity);
#[doc = "See [`cef_color_id_t::CEF_ColorAlertMediumSeverityIcon`] for more documentation."]
pub const COLOR_ALERT_MEDIUM_SEVERITY_ICON: Self =
Self(cef_color_id_t::CEF_ColorAlertMediumSeverityIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorAlertMediumSeverityText`] for more documentation."]
pub const COLOR_ALERT_MEDIUM_SEVERITY_TEXT: Self =
Self(cef_color_id_t::CEF_ColorAlertMediumSeverityText);
#[doc = "See [`cef_color_id_t::CEF_ColorDisabledForeground`] for more documentation."]
pub const COLOR_DISABLED_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorDisabledForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorEndpointBackground`] for more documentation."]
pub const COLOR_ENDPOINT_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorEndpointBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorEndpointForeground`] for more documentation."]
pub const COLOR_ENDPOINT_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorEndpointForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorItemHighlight`] for more documentation."]
pub const COLOR_ITEM_HIGHLIGHT: Self = Self(cef_color_id_t::CEF_ColorItemHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorItemSelectionBackground`] for more documentation."]
pub const COLOR_ITEM_SELECTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorItemSelectionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuSelectionBackground`] for more documentation."]
pub const COLOR_MENU_SELECTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorMenuSelectionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorMidground`] for more documentation."]
pub const COLOR_MIDGROUND: Self = Self(cef_color_id_t::CEF_ColorMidground);
#[doc = "See [`cef_color_id_t::CEF_ColorPrimaryBackground`] for more documentation."]
pub const COLOR_PRIMARY_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorPrimaryBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPrimaryForeground`] for more documentation."]
pub const COLOR_PRIMARY_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorPrimaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSecondaryForeground`] for more documentation."]
pub const COLOR_SECONDARY_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorSecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSubtleAccent`] for more documentation."]
pub const COLOR_SUBTLE_ACCENT: Self = Self(cef_color_id_t::CEF_ColorSubtleAccent);
#[doc = "See [`cef_color_id_t::CEF_ColorSubtleEmphasisBackground`] for more documentation."]
pub const COLOR_SUBTLE_EMPHASIS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSubtleEmphasisBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTextSelectionBackground`] for more documentation."]
pub const COLOR_TEXT_SELECTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTextSelectionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTextSelectionForeground`] for more documentation."]
pub const COLOR_TEXT_SELECTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorTextSelectionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuProfileRowBackground`] for more documentation."]
pub const COLOR_APP_MENU_PROFILE_ROW_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorAppMenuProfileRowBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuProfileRowChipBackground`] for more documentation."]
pub const COLOR_APP_MENU_PROFILE_ROW_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorAppMenuProfileRowChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuProfileRowChipHovered`] for more documentation."]
pub const COLOR_APP_MENU_PROFILE_ROW_CHIP_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorAppMenuProfileRowChipHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuRowBackgroundHovered`] for more documentation."]
pub const COLOR_APP_MENU_ROW_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorAppMenuRowBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuUpgradeRowBackground`] for more documentation."]
pub const COLOR_APP_MENU_UPGRADE_ROW_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorAppMenuUpgradeRowBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuUpgradeRowSubstringForeground`] for more documentation."]
pub const COLOR_APP_MENU_UPGRADE_ROW_SUBSTRING_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorAppMenuUpgradeRowSubstringForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarIconGuest`] for more documentation."]
pub const COLOR_AVATAR_ICON_GUEST: Self = Self(cef_color_id_t::CEF_ColorAvatarIconGuest);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarIconIncognito`] for more documentation."]
pub const COLOR_AVATAR_ICON_INCOGNITO: Self =
Self(cef_color_id_t::CEF_ColorAvatarIconIncognito);
#[doc = "See [`cef_color_id_t::CEF_ColorBadgeBackground`] for more documentation."]
pub const COLOR_BADGE_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorBadgeBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBadgeForeground`] for more documentation."]
pub const COLOR_BADGE_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorBadgeForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorBadgeInCocoaMenuBackground`] for more documentation."]
pub const COLOR_BADGE_IN_COCOA_MENU_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBadgeInCocoaMenuBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBadgeInCocoaMenuForeground`] for more documentation."]
pub const COLOR_BADGE_IN_COCOA_MENU_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorBadgeInCocoaMenuForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorBubbleBackground`] for more documentation."]
pub const COLOR_BUBBLE_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorBubbleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBubbleBorder`] for more documentation."]
pub const COLOR_BUBBLE_BORDER: Self = Self(cef_color_id_t::CEF_ColorBubbleBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorBubbleBorderShadowLarge`] for more documentation."]
pub const COLOR_BUBBLE_BORDER_SHADOW_LARGE: Self =
Self(cef_color_id_t::CEF_ColorBubbleBorderShadowLarge);
#[doc = "See [`cef_color_id_t::CEF_ColorBubbleBorderShadowSmall`] for more documentation."]
pub const COLOR_BUBBLE_BORDER_SHADOW_SMALL: Self =
Self(cef_color_id_t::CEF_ColorBubbleBorderShadowSmall);
#[doc = "See [`cef_color_id_t::CEF_ColorBubbleFooterBackground`] for more documentation."]
pub const COLOR_BUBBLE_FOOTER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBubbleFooterBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBubbleFooterBorder`] for more documentation."]
pub const COLOR_BUBBLE_FOOTER_BORDER: Self = Self(cef_color_id_t::CEF_ColorBubbleFooterBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonFeatureAttentionHighlight`] for more documentation."]
pub const COLOR_BUTTON_FEATURE_ATTENTION_HIGHLIGHT: Self =
Self(cef_color_id_t::CEF_ColorButtonFeatureAttentionHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackground`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundPressed`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundProminent`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_PROMINENT: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundProminent);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundProminentDisabled`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_PROMINENT_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundProminentDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundProminentFocused`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_PROMINENT_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundProminentFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundTonal`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_TONAL: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundTonal);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundTonalDisabled`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_TONAL_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundTonalDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundTonalFocused`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_TONAL_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundTonalFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBackgroundWithAttention`] for more documentation."]
pub const COLOR_BUTTON_BACKGROUND_WITH_ATTENTION: Self =
Self(cef_color_id_t::CEF_ColorButtonBackgroundWithAttention);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBorder`] for more documentation."]
pub const COLOR_BUTTON_BORDER: Self = Self(cef_color_id_t::CEF_ColorButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonBorderDisabled`] for more documentation."]
pub const COLOR_BUTTON_BORDER_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorButtonBorderDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonForeground`] for more documentation."]
pub const COLOR_BUTTON_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorButtonForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonForegroundDisabled`] for more documentation."]
pub const COLOR_BUTTON_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorButtonForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonForegroundProminent`] for more documentation."]
pub const COLOR_BUTTON_FOREGROUND_PROMINENT: Self =
Self(cef_color_id_t::CEF_ColorButtonForegroundProminent);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonForegroundTonal`] for more documentation."]
pub const COLOR_BUTTON_FOREGROUND_TONAL: Self =
Self(cef_color_id_t::CEF_ColorButtonForegroundTonal);
#[doc = "See [`cef_color_id_t::CEF_ColorButtonHoverBackgroundText`] for more documentation."]
pub const COLOR_BUTTON_HOVER_BACKGROUND_TEXT: Self =
Self(cef_color_id_t::CEF_ColorButtonHoverBackgroundText);
#[doc = "See [`cef_color_id_t::CEF_ColorMultitaskMenuNudgePulse`] for more documentation."]
pub const COLOR_MULTITASK_MENU_NUDGE_PULSE: Self =
Self(cef_color_id_t::CEF_ColorMultitaskMenuNudgePulse);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxCheck`] for more documentation."]
pub const COLOR_CHECKBOX_CHECK: Self = Self(cef_color_id_t::CEF_ColorCheckboxCheck);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxCheckDisabled`] for more documentation."]
pub const COLOR_CHECKBOX_CHECK_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorCheckboxCheckDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxContainer`] for more documentation."]
pub const COLOR_CHECKBOX_CONTAINER: Self = Self(cef_color_id_t::CEF_ColorCheckboxContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxContainerDisabled`] for more documentation."]
pub const COLOR_CHECKBOX_CONTAINER_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorCheckboxContainerDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxOutline`] for more documentation."]
pub const COLOR_CHECKBOX_OUTLINE: Self = Self(cef_color_id_t::CEF_ColorCheckboxOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxOutlineDisabled`] for more documentation."]
pub const COLOR_CHECKBOX_OUTLINE_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorCheckboxOutlineDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxForegroundChecked`] for more documentation."]
pub const COLOR_CHECKBOX_FOREGROUND_CHECKED: Self =
Self(cef_color_id_t::CEF_ColorCheckboxForegroundChecked);
#[doc = "See [`cef_color_id_t::CEF_ColorCheckboxForegroundUnchecked`] for more documentation."]
pub const COLOR_CHECKBOX_FOREGROUND_UNCHECKED: Self =
Self(cef_color_id_t::CEF_ColorCheckboxForegroundUnchecked);
#[doc = "See [`cef_color_id_t::CEF_ColorChipBackgroundHover`] for more documentation."]
pub const COLOR_CHIP_BACKGROUND_HOVER: Self =
Self(cef_color_id_t::CEF_ColorChipBackgroundHover);
#[doc = "See [`cef_color_id_t::CEF_ColorChipBackgroundSelected`] for more documentation."]
pub const COLOR_CHIP_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorChipBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorChipBorder`] for more documentation."]
pub const COLOR_CHIP_BORDER: Self = Self(cef_color_id_t::CEF_ColorChipBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorChipForeground`] for more documentation."]
pub const COLOR_CHIP_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorChipForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorChipForegroundSelected`] for more documentation."]
pub const COLOR_CHIP_FOREGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorChipForegroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorChipIcon`] for more documentation."]
pub const COLOR_CHIP_ICON: Self = Self(cef_color_id_t::CEF_ColorChipIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorChipIconSelected`] for more documentation."]
pub const COLOR_CHIP_ICON_SELECTED: Self = Self(cef_color_id_t::CEF_ColorChipIconSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorComboboxBackground`] for more documentation."]
pub const COLOR_COMBOBOX_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorComboboxBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComboboxBackgroundDisabled`] for more documentation."]
pub const COLOR_COMBOBOX_BACKGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorComboboxBackgroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorComboboxContainerOutline`] for more documentation."]
pub const COLOR_COMBOBOX_CONTAINER_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorComboboxContainerOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorComboboxInkDropHovered`] for more documentation."]
pub const COLOR_COMBOBOX_INK_DROP_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorComboboxInkDropHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorComboboxInkDropRipple`] for more documentation."]
pub const COLOR_COMBOBOX_INK_DROP_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorComboboxInkDropRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemActiveText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_ACTIVE_TEXT: Self =
Self(cef_color_id_t::CEF_ColorCssSystemActiveText);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemBtnFace`] for more documentation."]
pub const COLOR_CSS_SYSTEM_BTN_FACE: Self = Self(cef_color_id_t::CEF_ColorCssSystemBtnFace);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemBtnText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_BTN_TEXT: Self = Self(cef_color_id_t::CEF_ColorCssSystemBtnText);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemField`] for more documentation."]
pub const COLOR_CSS_SYSTEM_FIELD: Self = Self(cef_color_id_t::CEF_ColorCssSystemField);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemFieldText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_FIELD_TEXT: Self = Self(cef_color_id_t::CEF_ColorCssSystemFieldText);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemGrayText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_GRAY_TEXT: Self = Self(cef_color_id_t::CEF_ColorCssSystemGrayText);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemHighlight`] for more documentation."]
pub const COLOR_CSS_SYSTEM_HIGHLIGHT: Self = Self(cef_color_id_t::CEF_ColorCssSystemHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemHighlightText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_HIGHLIGHT_TEXT: Self =
Self(cef_color_id_t::CEF_ColorCssSystemHighlightText);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemHotlight`] for more documentation."]
pub const COLOR_CSS_SYSTEM_HOTLIGHT: Self = Self(cef_color_id_t::CEF_ColorCssSystemHotlight);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemLinkText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_LINK_TEXT: Self = Self(cef_color_id_t::CEF_ColorCssSystemLinkText);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemMenuHilight`] for more documentation."]
pub const COLOR_CSS_SYSTEM_MENU_HILIGHT: Self =
Self(cef_color_id_t::CEF_ColorCssSystemMenuHilight);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemScrollbar`] for more documentation."]
pub const COLOR_CSS_SYSTEM_SCROLLBAR: Self = Self(cef_color_id_t::CEF_ColorCssSystemScrollbar);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemVisitedText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_VISITED_TEXT: Self =
Self(cef_color_id_t::CEF_ColorCssSystemVisitedText);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemWindow`] for more documentation."]
pub const COLOR_CSS_SYSTEM_WINDOW: Self = Self(cef_color_id_t::CEF_ColorCssSystemWindow);
#[doc = "See [`cef_color_id_t::CEF_ColorCssSystemWindowText`] for more documentation."]
pub const COLOR_CSS_SYSTEM_WINDOW_TEXT: Self =
Self(cef_color_id_t::CEF_ColorCssSystemWindowText);
#[doc = "See [`cef_color_id_t::CEF_ColorCustomFrameCaptionForeground`] for more documentation."]
pub const COLOR_CUSTOM_FRAME_CAPTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorCustomFrameCaptionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorDebugBoundsOutline`] for more documentation."]
pub const COLOR_DEBUG_BOUNDS_OUTLINE: Self = Self(cef_color_id_t::CEF_ColorDebugBoundsOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorDebugContentOutline`] for more documentation."]
pub const COLOR_DEBUG_CONTENT_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorDebugContentOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorDialogBackground`] for more documentation."]
pub const COLOR_DIALOG_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorDialogBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorDialogForeground`] for more documentation."]
pub const COLOR_DIALOG_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorDialogForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorDropdownBackground`] for more documentation."]
pub const COLOR_DROPDOWN_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorDropdownBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorDropdownBackgroundSelected`] for more documentation."]
pub const COLOR_DROPDOWN_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorDropdownBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorDropdownForeground`] for more documentation."]
pub const COLOR_DROPDOWN_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorDropdownForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorDropdownForegroundSelected`] for more documentation."]
pub const COLOR_DROPDOWN_FOREGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorDropdownForegroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorFocusableBorderFocused`] for more documentation."]
pub const COLOR_FOCUSABLE_BORDER_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorFocusableBorderFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorFocusableBorderUnfocused`] for more documentation."]
pub const COLOR_FOCUSABLE_BORDER_UNFOCUSED: Self =
Self(cef_color_id_t::CEF_ColorFocusableBorderUnfocused);
#[doc = "See [`cef_color_id_t::CEF_ColorFrameActive`] for more documentation."]
pub const COLOR_FRAME_ACTIVE: Self = Self(cef_color_id_t::CEF_ColorFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorFrameActiveUnthemed`] for more documentation."]
pub const COLOR_FRAME_ACTIVE_UNTHEMED: Self =
Self(cef_color_id_t::CEF_ColorFrameActiveUnthemed);
#[doc = "See [`cef_color_id_t::CEF_ColorFrameCaptionButtonUnfocused`] for more documentation."]
pub const COLOR_FRAME_CAPTION_BUTTON_UNFOCUSED: Self =
Self(cef_color_id_t::CEF_ColorFrameCaptionButtonUnfocused);
#[doc = "See [`cef_color_id_t::CEF_ColorFrameInactive`] for more documentation."]
pub const COLOR_FRAME_INACTIVE: Self = Self(cef_color_id_t::CEF_ColorFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorHelpIconActive`] for more documentation."]
pub const COLOR_HELP_ICON_ACTIVE: Self = Self(cef_color_id_t::CEF_ColorHelpIconActive);
#[doc = "See [`cef_color_id_t::CEF_ColorHelpIconInactive`] for more documentation."]
pub const COLOR_HELP_ICON_INACTIVE: Self = Self(cef_color_id_t::CEF_ColorHelpIconInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryClustersSidePanelDivider`] for more documentation."]
pub const COLOR_HISTORY_CLUSTERS_SIDE_PANEL_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorHistoryClustersSidePanelDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogBackground`] for more documentation."]
pub const COLOR_HISTORY_CLUSTERS_SIDE_PANEL_DIALOG_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogDivider`] for more documentation."]
pub const COLOR_HISTORY_CLUSTERS_SIDE_PANEL_DIALOG_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogPrimaryForeground`] for more documentation."]
pub const COLOR_HISTORY_CLUSTERS_SIDE_PANEL_DIALOG_PRIMARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogPrimaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogSecondaryForeground`] for more documentation."]
pub const COLOR_HISTORY_CLUSTERS_SIDE_PANEL_DIALOG_SECONDARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorHistoryClustersSidePanelDialogSecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryClustersSidePanelCardSecondaryForeground`] for more documentation."]
pub const COLOR_HISTORY_CLUSTERS_SIDE_PANEL_CARD_SECONDARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorHistoryClustersSidePanelCardSecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorIcon`] for more documentation."]
pub const COLOR_ICON: Self = Self(cef_color_id_t::CEF_ColorIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorIconDisabled`] for more documentation."]
pub const COLOR_ICON_DISABLED: Self = Self(cef_color_id_t::CEF_ColorIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorIconHovered`] for more documentation."]
pub const COLOR_ICON_HOVERED: Self = Self(cef_color_id_t::CEF_ColorIconHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorIconSecondary`] for more documentation."]
pub const COLOR_ICON_SECONDARY: Self = Self(cef_color_id_t::CEF_ColorIconSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorInfoBarIcon`] for more documentation."]
pub const COLOR_INFO_BAR_ICON: Self = Self(cef_color_id_t::CEF_ColorInfoBarIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorLabelForeground`] for more documentation."]
pub const COLOR_LABEL_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorLabelForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorLabelForegroundDisabled`] for more documentation."]
pub const COLOR_LABEL_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorLabelForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorLabelForegroundSecondary`] for more documentation."]
pub const COLOR_LABEL_FOREGROUND_SECONDARY: Self =
Self(cef_color_id_t::CEF_ColorLabelForegroundSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorLabelSelectionBackground`] for more documentation."]
pub const COLOR_LABEL_SELECTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorLabelSelectionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorLabelSelectionForeground`] for more documentation."]
pub const COLOR_LABEL_SELECTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorLabelSelectionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorLinkForeground`] for more documentation."]
pub const COLOR_LINK_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorLinkForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorLinkForegroundDefault`] for more documentation."]
pub const COLOR_LINK_FOREGROUND_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorLinkForegroundDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorLinkForegroundDisabled`] for more documentation."]
pub const COLOR_LINK_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorLinkForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorLinkForegroundOnBubbleFooter`] for more documentation."]
pub const COLOR_LINK_FOREGROUND_ON_BUBBLE_FOOTER: Self =
Self(cef_color_id_t::CEF_ColorLinkForegroundOnBubbleFooter);
#[doc = "See [`cef_color_id_t::CEF_ColorLinkForegroundPressed`] for more documentation."]
pub const COLOR_LINK_FOREGROUND_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorLinkForegroundPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorLinkForegroundPressedDefault`] for more documentation."]
pub const COLOR_LINK_FOREGROUND_PRESSED_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorLinkForegroundPressedDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorLinkForegroundPressedOnBubbleFooter`] for more documentation."]
pub const COLOR_LINK_FOREGROUND_PRESSED_ON_BUBBLE_FOOTER: Self =
Self(cef_color_id_t::CEF_ColorLinkForegroundPressedOnBubbleFooter);
#[doc = "See [`cef_color_id_t::CEF_ColorListItemFolderIconBackground`] for more documentation."]
pub const COLOR_LIST_ITEM_FOLDER_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorListItemFolderIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorListItemFolderIconForeground`] for more documentation."]
pub const COLOR_LIST_ITEM_FOLDER_ICON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorListItemFolderIconForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorListItemUrlFaviconBackground`] for more documentation."]
pub const COLOR_LIST_ITEM_URL_FAVICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorListItemUrlFaviconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleBackgroundDefault`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_BACKGROUND_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleBackgroundDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleButtonBackground`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleButtonIcon`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleButtonIconDisabled`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleForegroundDefault`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_FOREGROUND_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleForegroundDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleForegroundSecondary`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_FOREGROUND_SECONDARY: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleForegroundSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleCheckbox`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_CHECKBOX: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleCheckbox);
#[doc = "See [`cef_color_id_t::CEF_ColorLiveCaptionBubbleLink`] for more documentation."]
pub const COLOR_LIVE_CAPTION_BUBBLE_LINK: Self =
Self(cef_color_id_t::CEF_ColorLiveCaptionBubbleLink);
#[doc = "See [`cef_color_id_t::CEF_ColorLoadingGradientBorder`] for more documentation."]
pub const COLOR_LOADING_GRADIENT_BORDER: Self =
Self(cef_color_id_t::CEF_ColorLoadingGradientBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorLoadingGradientEnd`] for more documentation."]
pub const COLOR_LOADING_GRADIENT_END: Self = Self(cef_color_id_t::CEF_ColorLoadingGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorLoadingGradientMiddle`] for more documentation."]
pub const COLOR_LOADING_GRADIENT_MIDDLE: Self =
Self(cef_color_id_t::CEF_ColorLoadingGradientMiddle);
#[doc = "See [`cef_color_id_t::CEF_ColorLoadingGradientStart`] for more documentation."]
pub const COLOR_LOADING_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorLoadingGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuBackground`] for more documentation."]
pub const COLOR_MENU_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorMenuBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuBorder`] for more documentation."]
pub const COLOR_MENU_BORDER: Self = Self(cef_color_id_t::CEF_ColorMenuBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuButtonBackground`] for more documentation."]
pub const COLOR_MENU_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorMenuButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuButtonBackgroundSelected`] for more documentation."]
pub const COLOR_MENU_BUTTON_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorMenuButtonBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuDropmarker`] for more documentation."]
pub const COLOR_MENU_DROPMARKER: Self = Self(cef_color_id_t::CEF_ColorMenuDropmarker);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuIcon`] for more documentation."]
pub const COLOR_MENU_ICON: Self = Self(cef_color_id_t::CEF_ColorMenuIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuIconDisabled`] for more documentation."]
pub const COLOR_MENU_ICON_DISABLED: Self = Self(cef_color_id_t::CEF_ColorMenuIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuIconOnEmphasizedBackground`] for more documentation."]
pub const COLOR_MENU_ICON_ON_EMPHASIZED_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorMenuIconOnEmphasizedBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemBackgroundAlertedInitial`] for more documentation."]
pub const COLOR_MENU_ITEM_BACKGROUND_ALERTED_INITIAL: Self =
Self(cef_color_id_t::CEF_ColorMenuItemBackgroundAlertedInitial);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemBackgroundAlertedTarget`] for more documentation."]
pub const COLOR_MENU_ITEM_BACKGROUND_ALERTED_TARGET: Self =
Self(cef_color_id_t::CEF_ColorMenuItemBackgroundAlertedTarget);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemBackgroundHighlighted`] for more documentation."]
pub const COLOR_MENU_ITEM_BACKGROUND_HIGHLIGHTED: Self =
Self(cef_color_id_t::CEF_ColorMenuItemBackgroundHighlighted);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemBackgroundSelected`] for more documentation."]
pub const COLOR_MENU_ITEM_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorMenuItemBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemForeground`] for more documentation."]
pub const COLOR_MENU_ITEM_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorMenuItemForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemForegroundDisabled`] for more documentation."]
pub const COLOR_MENU_ITEM_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorMenuItemForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemForegroundHighlighted`] for more documentation."]
pub const COLOR_MENU_ITEM_FOREGROUND_HIGHLIGHTED: Self =
Self(cef_color_id_t::CEF_ColorMenuItemForegroundHighlighted);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemForegroundSecondary`] for more documentation."]
pub const COLOR_MENU_ITEM_FOREGROUND_SECONDARY: Self =
Self(cef_color_id_t::CEF_ColorMenuItemForegroundSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuItemForegroundSelected`] for more documentation."]
pub const COLOR_MENU_ITEM_FOREGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorMenuItemForegroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorMenuSeparator`] for more documentation."]
pub const COLOR_MENU_SEPARATOR: Self = Self(cef_color_id_t::CEF_ColorMenuSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationActionsBackground`] for more documentation."]
pub const COLOR_NOTIFICATION_ACTIONS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationActionsBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationBackgroundActive`] for more documentation."]
pub const COLOR_NOTIFICATION_BACKGROUND_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNotificationBackgroundActive);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationBackgroundInactive`] for more documentation."]
pub const COLOR_NOTIFICATION_BACKGROUND_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNotificationBackgroundInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationHeaderForeground`] for more documentation."]
pub const COLOR_NOTIFICATION_HEADER_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationHeaderForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationIconBackground`] for more documentation."]
pub const COLOR_NOTIFICATION_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationIconForeground`] for more documentation."]
pub const COLOR_NOTIFICATION_ICON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationIconForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationImageBackground`] for more documentation."]
pub const COLOR_NOTIFICATION_IMAGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationImageBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationInputBackground`] for more documentation."]
pub const COLOR_NOTIFICATION_INPUT_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationInputBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationInputForeground`] for more documentation."]
pub const COLOR_NOTIFICATION_INPUT_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationInputForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNotificationInputPlaceholderForeground`] for more documentation."]
pub const COLOR_NOTIFICATION_INPUT_PLACEHOLDER_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNotificationInputPlaceholderForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorOverlayScrollbarFill`] for more documentation."]
pub const COLOR_OVERLAY_SCROLLBAR_FILL: Self =
Self(cef_color_id_t::CEF_ColorOverlayScrollbarFill);
#[doc = "See [`cef_color_id_t::CEF_ColorOverlayScrollbarFillHovered`] for more documentation."]
pub const COLOR_OVERLAY_SCROLLBAR_FILL_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorOverlayScrollbarFillHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorOverlayScrollbarStroke`] for more documentation."]
pub const COLOR_OVERLAY_SCROLLBAR_STROKE: Self =
Self(cef_color_id_t::CEF_ColorOverlayScrollbarStroke);
#[doc = "See [`cef_color_id_t::CEF_ColorOverlayScrollbarStrokeHovered`] for more documentation."]
pub const COLOR_OVERLAY_SCROLLBAR_STROKE_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorOverlayScrollbarStrokeHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorProgressBar`] for more documentation."]
pub const COLOR_PROGRESS_BAR: Self = Self(cef_color_id_t::CEF_ColorProgressBar);
#[doc = "See [`cef_color_id_t::CEF_ColorProgressBarBackground`] for more documentation."]
pub const COLOR_PROGRESS_BAR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProgressBarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProgressBarPaused`] for more documentation."]
pub const COLOR_PROGRESS_BAR_PAUSED: Self = Self(cef_color_id_t::CEF_ColorProgressBarPaused);
#[doc = "See [`cef_color_id_t::CEF_ColorRadioButtonForegroundUnchecked`] for more documentation."]
pub const COLOR_RADIO_BUTTON_FOREGROUND_UNCHECKED: Self =
Self(cef_color_id_t::CEF_ColorRadioButtonForegroundUnchecked);
#[doc = "See [`cef_color_id_t::CEF_ColorRadioButtonForegroundDisabled`] for more documentation."]
pub const COLOR_RADIO_BUTTON_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorRadioButtonForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorRadioButtonForegroundChecked`] for more documentation."]
pub const COLOR_RADIO_BUTTON_FOREGROUND_CHECKED: Self =
Self(cef_color_id_t::CEF_ColorRadioButtonForegroundChecked);
#[doc = "See [`cef_color_id_t::CEF_ColorSegmentedButtonBorder`] for more documentation."]
pub const COLOR_SEGMENTED_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSegmentedButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSegmentedButtonFocus`] for more documentation."]
pub const COLOR_SEGMENTED_BUTTON_FOCUS: Self =
Self(cef_color_id_t::CEF_ColorSegmentedButtonFocus);
#[doc = "See [`cef_color_id_t::CEF_ColorSegmentedButtonForegroundChecked`] for more documentation."]
pub const COLOR_SEGMENTED_BUTTON_FOREGROUND_CHECKED: Self =
Self(cef_color_id_t::CEF_ColorSegmentedButtonForegroundChecked);
#[doc = "See [`cef_color_id_t::CEF_ColorSegmentedButtonForegroundUnchecked`] for more documentation."]
pub const COLOR_SEGMENTED_BUTTON_FOREGROUND_UNCHECKED: Self =
Self(cef_color_id_t::CEF_ColorSegmentedButtonForegroundUnchecked);
#[doc = "See [`cef_color_id_t::CEF_ColorSegmentedButtonHover`] for more documentation."]
pub const COLOR_SEGMENTED_BUTTON_HOVER: Self =
Self(cef_color_id_t::CEF_ColorSegmentedButtonHover);
#[doc = "See [`cef_color_id_t::CEF_ColorSegmentedButtonRipple`] for more documentation."]
pub const COLOR_SEGMENTED_BUTTON_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorSegmentedButtonRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorSegmentedButtonChecked`] for more documentation."]
pub const COLOR_SEGMENTED_BUTTON_CHECKED: Self =
Self(cef_color_id_t::CEF_ColorSegmentedButtonChecked);
#[doc = "See [`cef_color_id_t::CEF_ColorSeparator`] for more documentation."]
pub const COLOR_SEPARATOR: Self = Self(cef_color_id_t::CEF_ColorSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowBase`] for more documentation."]
pub const COLOR_SHADOW_BASE: Self = Self(cef_color_id_t::CEF_ColorShadowBase);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationFour`] for more documentation."]
pub const COLOR_SHADOW_VALUE_AMBIENT_SHADOW_ELEVATION_FOUR: Self =
Self(cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationFour);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationSixteen`] for more documentation."]
pub const COLOR_SHADOW_VALUE_AMBIENT_SHADOW_ELEVATION_SIXTEEN: Self =
Self(cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationSixteen);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationThree`] for more documentation."]
pub const COLOR_SHADOW_VALUE_AMBIENT_SHADOW_ELEVATION_THREE: Self =
Self(cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationThree);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationTwelve`] for more documentation."]
pub const COLOR_SHADOW_VALUE_AMBIENT_SHADOW_ELEVATION_TWELVE: Self =
Self(cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationTwelve);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationTwentyFour`] for more documentation."]
pub const COLOR_SHADOW_VALUE_AMBIENT_SHADOW_ELEVATION_TWENTY_FOUR: Self =
Self(cef_color_id_t::CEF_ColorShadowValueAmbientShadowElevationTwentyFour);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationFour`] for more documentation."]
pub const COLOR_SHADOW_VALUE_KEY_SHADOW_ELEVATION_FOUR: Self =
Self(cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationFour);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationSixteen`] for more documentation."]
pub const COLOR_SHADOW_VALUE_KEY_SHADOW_ELEVATION_SIXTEEN: Self =
Self(cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationSixteen);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationThree`] for more documentation."]
pub const COLOR_SHADOW_VALUE_KEY_SHADOW_ELEVATION_THREE: Self =
Self(cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationThree);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationTwelve`] for more documentation."]
pub const COLOR_SHADOW_VALUE_KEY_SHADOW_ELEVATION_TWELVE: Self =
Self(cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationTwelve);
#[doc = "See [`cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationTwentyFour`] for more documentation."]
pub const COLOR_SHADOW_VALUE_KEY_SHADOW_ELEVATION_TWENTY_FOUR: Self =
Self(cef_color_id_t::CEF_ColorShadowValueKeyShadowElevationTwentyFour);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelComboboxBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_COMBOBOX_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelComboboxBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelComboboxBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_COMBOBOX_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelComboboxBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSliderThumb`] for more documentation."]
pub const COLOR_SLIDER_THUMB: Self = Self(cef_color_id_t::CEF_ColorSliderThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorSliderThumbMinimal`] for more documentation."]
pub const COLOR_SLIDER_THUMB_MINIMAL: Self = Self(cef_color_id_t::CEF_ColorSliderThumbMinimal);
#[doc = "See [`cef_color_id_t::CEF_ColorSliderTrack`] for more documentation."]
pub const COLOR_SLIDER_TRACK: Self = Self(cef_color_id_t::CEF_ColorSliderTrack);
#[doc = "See [`cef_color_id_t::CEF_ColorSliderTrackMinimal`] for more documentation."]
pub const COLOR_SLIDER_TRACK_MINIMAL: Self = Self(cef_color_id_t::CEF_ColorSliderTrackMinimal);
#[doc = "See [`cef_color_id_t::CEF_ColorSyncInfoBackground`] for more documentation."]
pub const COLOR_SYNC_INFO_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorSyncInfoBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSyncInfoBackgroundError`] for more documentation."]
pub const COLOR_SYNC_INFO_BACKGROUND_ERROR: Self =
Self(cef_color_id_t::CEF_ColorSyncInfoBackgroundError);
#[doc = "See [`cef_color_id_t::CEF_ColorSyncInfoBackgroundPaused`] for more documentation."]
pub const COLOR_SYNC_INFO_BACKGROUND_PAUSED: Self =
Self(cef_color_id_t::CEF_ColorSyncInfoBackgroundPaused);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundHighlighted`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_HIGHLIGHTED: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundHighlighted);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundHighlightedFocused`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_HIGHLIGHTED_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundHighlightedFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBorderSelected`] for more documentation."]
pub const COLOR_TAB_BORDER_SELECTED: Self = Self(cef_color_id_t::CEF_ColorTabBorderSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorTabContentSeparator`] for more documentation."]
pub const COLOR_TAB_CONTENT_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorTabContentSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorTabForegroundDisabled`] for more documentation."]
pub const COLOR_TAB_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorTabForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorTabForeground`] for more documentation."]
pub const COLOR_TAB_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorTabForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabForegroundSelected`] for more documentation."]
pub const COLOR_TAB_FOREGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorTabForegroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorTableBackground`] for more documentation."]
pub const COLOR_TABLE_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorTableBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTableBackgroundAlternate`] for more documentation."]
pub const COLOR_TABLE_BACKGROUND_ALTERNATE: Self =
Self(cef_color_id_t::CEF_ColorTableBackgroundAlternate);
#[doc = "See [`cef_color_id_t::CEF_ColorTableBackgroundSelectedFocused`] for more documentation."]
pub const COLOR_TABLE_BACKGROUND_SELECTED_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTableBackgroundSelectedFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTableBackgroundSelectedUnfocused`] for more documentation."]
pub const COLOR_TABLE_BACKGROUND_SELECTED_UNFOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTableBackgroundSelectedUnfocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTableForeground`] for more documentation."]
pub const COLOR_TABLE_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorTableForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTableForegroundSelectedFocused`] for more documentation."]
pub const COLOR_TABLE_FOREGROUND_SELECTED_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTableForegroundSelectedFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTableForegroundSelectedUnfocused`] for more documentation."]
pub const COLOR_TABLE_FOREGROUND_SELECTED_UNFOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTableForegroundSelectedUnfocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTableGroupingIndicator`] for more documentation."]
pub const COLOR_TABLE_GROUPING_INDICATOR: Self =
Self(cef_color_id_t::CEF_ColorTableGroupingIndicator);
#[doc = "See [`cef_color_id_t::CEF_ColorTableHeaderBackground`] for more documentation."]
pub const COLOR_TABLE_HEADER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTableHeaderBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTableHeaderForeground`] for more documentation."]
pub const COLOR_TABLE_HEADER_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorTableHeaderForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTableHeaderSeparator`] for more documentation."]
pub const COLOR_TABLE_HEADER_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorTableHeaderSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorTableIconBackground`] for more documentation."]
pub const COLOR_TABLE_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTableIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTableRowHighlight`] for more documentation."]
pub const COLOR_TABLE_ROW_HIGHLIGHT: Self = Self(cef_color_id_t::CEF_ColorTableRowHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorSuggestionChipBorder`] for more documentation."]
pub const COLOR_SUGGESTION_CHIP_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSuggestionChipBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSuggestionChipIcon`] for more documentation."]
pub const COLOR_SUGGESTION_CHIP_ICON: Self = Self(cef_color_id_t::CEF_ColorSuggestionChipIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldBackground`] for more documentation."]
pub const COLOR_TEXTFIELD_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorTextfieldBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldBackgroundDisabled`] for more documentation."]
pub const COLOR_TEXTFIELD_BACKGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorTextfieldBackgroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldFilledBackground`] for more documentation."]
pub const COLOR_TEXTFIELD_FILLED_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTextfieldFilledBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldFilledForegroundInvalid`] for more documentation."]
pub const COLOR_TEXTFIELD_FILLED_FOREGROUND_INVALID: Self =
Self(cef_color_id_t::CEF_ColorTextfieldFilledForegroundInvalid);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldFilledUnderline`] for more documentation."]
pub const COLOR_TEXTFIELD_FILLED_UNDERLINE: Self =
Self(cef_color_id_t::CEF_ColorTextfieldFilledUnderline);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldFilledUnderlineFocused`] for more documentation."]
pub const COLOR_TEXTFIELD_FILLED_UNDERLINE_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTextfieldFilledUnderlineFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldForeground`] for more documentation."]
pub const COLOR_TEXTFIELD_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorTextfieldForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldForegroundDisabled`] for more documentation."]
pub const COLOR_TEXTFIELD_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorTextfieldForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldForegroundIcon`] for more documentation."]
pub const COLOR_TEXTFIELD_FOREGROUND_ICON: Self =
Self(cef_color_id_t::CEF_ColorTextfieldForegroundIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldForegroundLabel`] for more documentation."]
pub const COLOR_TEXTFIELD_FOREGROUND_LABEL: Self =
Self(cef_color_id_t::CEF_ColorTextfieldForegroundLabel);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldForegroundPlaceholderInvalid`] for more documentation."]
pub const COLOR_TEXTFIELD_FOREGROUND_PLACEHOLDER_INVALID: Self =
Self(cef_color_id_t::CEF_ColorTextfieldForegroundPlaceholderInvalid);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldForegroundPlaceholder`] for more documentation."]
pub const COLOR_TEXTFIELD_FOREGROUND_PLACEHOLDER: Self =
Self(cef_color_id_t::CEF_ColorTextfieldForegroundPlaceholder);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldHover`] for more documentation."]
pub const COLOR_TEXTFIELD_HOVER: Self = Self(cef_color_id_t::CEF_ColorTextfieldHover);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldSelectionBackground`] for more documentation."]
pub const COLOR_TEXTFIELD_SELECTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTextfieldSelectionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldSelectionForeground`] for more documentation."]
pub const COLOR_TEXTFIELD_SELECTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorTextfieldSelectionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldOutline`] for more documentation."]
pub const COLOR_TEXTFIELD_OUTLINE: Self = Self(cef_color_id_t::CEF_ColorTextfieldOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldOutlineDisabled`] for more documentation."]
pub const COLOR_TEXTFIELD_OUTLINE_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorTextfieldOutlineDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorTextfieldOutlineInvalid`] for more documentation."]
pub const COLOR_TEXTFIELD_OUTLINE_INVALID: Self =
Self(cef_color_id_t::CEF_ColorTextfieldOutlineInvalid);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerCheckmarkBackground`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_CHECKMARK_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerCheckmarkBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerCheckmarkForeground`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_CHECKMARK_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerCheckmarkForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerCustomColorIconBackground`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_CUSTOM_COLOR_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerCustomColorIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerHueSliderDialogBackground`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_HUE_SLIDER_DIALOG_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerHueSliderDialogBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerHueSliderDialogForeground`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_HUE_SLIDER_DIALOG_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerHueSliderDialogForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerHueSliderDialogIcon`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_HUE_SLIDER_DIALOG_ICON: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerHueSliderDialogIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerHueSliderHandle`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_HUE_SLIDER_HANDLE: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerHueSliderHandle);
#[doc = "See [`cef_color_id_t::CEF_ColorThemeColorPickerOptionBackground`] for more documentation."]
pub const COLOR_THEME_COLOR_PICKER_OPTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorThemeColorPickerOptionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorThrobber`] for more documentation."]
pub const COLOR_THROBBER: Self = Self(cef_color_id_t::CEF_ColorThrobber);
#[doc = "See [`cef_color_id_t::CEF_ColorThrobberPreconnect`] for more documentation."]
pub const COLOR_THROBBER_PRECONNECT: Self = Self(cef_color_id_t::CEF_ColorThrobberPreconnect);
#[doc = "See [`cef_color_id_t::CEF_ColorToastBackground`] for more documentation."]
pub const COLOR_TOAST_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorToastBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorToastBackgroundProminent`] for more documentation."]
pub const COLOR_TOAST_BACKGROUND_PROMINENT: Self =
Self(cef_color_id_t::CEF_ColorToastBackgroundProminent);
#[doc = "See [`cef_color_id_t::CEF_ColorToastButton`] for more documentation."]
pub const COLOR_TOAST_BUTTON: Self = Self(cef_color_id_t::CEF_ColorToastButton);
#[doc = "See [`cef_color_id_t::CEF_ColorToastForeground`] for more documentation."]
pub const COLOR_TOAST_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorToastForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonHover`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_HOVER: Self = Self(cef_color_id_t::CEF_ColorToggleButtonHover);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonPressed`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonShadow`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_SHADOW: Self = Self(cef_color_id_t::CEF_ColorToggleButtonShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonThumbOff`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_THUMB_OFF: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonThumbOff);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonThumbOffDisabled`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_THUMB_OFF_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonThumbOffDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonThumbOn`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_THUMB_ON: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonThumbOn);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonThumbOnDisabled`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_THUMB_ON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonThumbOnDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonThumbOnHover`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_THUMB_ON_HOVER: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonThumbOnHover);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonTrackOff`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_TRACK_OFF: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonTrackOff);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonTrackOffDisabled`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_TRACK_OFF_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonTrackOffDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonTrackOn`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_TRACK_ON: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonTrackOn);
#[doc = "See [`cef_color_id_t::CEF_ColorToggleButtonTrackOnDisabled`] for more documentation."]
pub const COLOR_TOGGLE_BUTTON_TRACK_ON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorToggleButtonTrackOnDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSearchFieldBackground`] for more documentation."]
pub const COLOR_TOOLBAR_SEARCH_FIELD_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorToolbarSearchFieldBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSearchFieldBackgroundHover`] for more documentation."]
pub const COLOR_TOOLBAR_SEARCH_FIELD_BACKGROUND_HOVER: Self =
Self(cef_color_id_t::CEF_ColorToolbarSearchFieldBackgroundHover);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSearchFieldBackgroundPressed`] for more documentation."]
pub const COLOR_TOOLBAR_SEARCH_FIELD_BACKGROUND_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorToolbarSearchFieldBackgroundPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSearchFieldForeground`] for more documentation."]
pub const COLOR_TOOLBAR_SEARCH_FIELD_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorToolbarSearchFieldForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSearchFieldForegroundPlaceholder`] for more documentation."]
pub const COLOR_TOOLBAR_SEARCH_FIELD_FOREGROUND_PLACEHOLDER: Self =
Self(cef_color_id_t::CEF_ColorToolbarSearchFieldForegroundPlaceholder);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSearchFieldIcon`] for more documentation."]
pub const COLOR_TOOLBAR_SEARCH_FIELD_ICON: Self =
Self(cef_color_id_t::CEF_ColorToolbarSearchFieldIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTooltipBackground`] for more documentation."]
pub const COLOR_TOOLTIP_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorTooltipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTooltipForeground`] for more documentation."]
pub const COLOR_TOOLTIP_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorTooltipForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTreeBackground`] for more documentation."]
pub const COLOR_TREE_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorTreeBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTreeNodeBackgroundSelectedFocused`] for more documentation."]
pub const COLOR_TREE_NODE_BACKGROUND_SELECTED_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTreeNodeBackgroundSelectedFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTreeNodeBackgroundSelectedUnfocused`] for more documentation."]
pub const COLOR_TREE_NODE_BACKGROUND_SELECTED_UNFOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTreeNodeBackgroundSelectedUnfocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTreeNodeForeground`] for more documentation."]
pub const COLOR_TREE_NODE_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorTreeNodeForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTreeNodeForegroundSelectedFocused`] for more documentation."]
pub const COLOR_TREE_NODE_FOREGROUND_SELECTED_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTreeNodeForegroundSelectedFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTreeNodeForegroundSelectedUnfocused`] for more documentation."]
pub const COLOR_TREE_NODE_FOREGROUND_SELECTED_UNFOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTreeNodeForegroundSelectedUnfocused);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlAccent`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_ACCENT: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlAccent);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlAccentDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_ACCENT_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlAccentDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlAccentHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_ACCENT_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlAccentHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlAccentPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_ACCENT_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlAccentPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlAutoCompleteBackground`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_AUTO_COMPLETE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlAutoCompleteBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlBorder`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BORDER: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlBorderDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BORDER_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlBorderDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlBorderHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BORDER_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlBorderHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlBorderPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BORDER_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlBorderPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonBorder`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonBorderDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_BORDER_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonBorderDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonBorderHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_BORDER_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonBorderHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonBorderPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_BORDER_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonBorderPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonFill`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_FILL: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonFill);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonFillDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_FILL_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonFillDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonFillHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_FILL_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonFillHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlButtonFillPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_BUTTON_FILL_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlButtonFillPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlCheckboxBackground`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_CHECKBOX_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlCheckboxBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlCheckboxBackgroundDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_CHECKBOX_BACKGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlCheckboxBackgroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlFill`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_FILL: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlFill);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlFillDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_FILL_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlFillDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlFillHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_FILL_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlFillHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlFillPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_FILL_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlFillPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlLightenLayer`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_LIGHTEN_LAYER: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlLightenLayer);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlProgressValue`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_PROGRESS_VALUE: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlProgressValue);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowBackgroundDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_ARROW_BACKGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowBackgroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowBackgroundHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_ARROW_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowBackgroundPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_ARROW_BACKGROUND_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowBackgroundPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowForeground`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_ARROW_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowForegroundDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_ARROW_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowForegroundPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_ARROW_FOREGROUND_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarArrowForegroundPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarCorner`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_CORNER: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarCorner);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumb`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumbHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_THUMB_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumbHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumbOverlayMinimalMode`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_THUMB_OVERLAY_MINIMAL_MODE: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumbOverlayMinimalMode);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumbPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_THUMB_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarThumbPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlScrollbarTrack`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SCROLLBAR_TRACK: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlScrollbarTrack);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlSlider`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SLIDER: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlSlider);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlSliderBorder`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SLIDER_BORDER: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlSliderBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlSliderBorderHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SLIDER_BORDER_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlSliderBorderHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlSliderBorderPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SLIDER_BORDER_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlSliderBorderPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlSliderDisabled`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SLIDER_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlSliderDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlSliderHovered`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SLIDER_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlSliderHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorWebNativeControlSliderPressed`] for more documentation."]
pub const COLOR_WEB_NATIVE_CONTROL_SLIDER_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorWebNativeControlSliderPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorWindowBackground`] for more documentation."]
pub const COLOR_WINDOW_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorWindowBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeBtnFace`] for more documentation."]
pub const COLOR_NATIVE_BTN_FACE: Self = Self(cef_color_id_t::CEF_ColorNativeBtnFace);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeBtnHighlight`] for more documentation."]
pub const COLOR_NATIVE_BTN_HIGHLIGHT: Self = Self(cef_color_id_t::CEF_ColorNativeBtnHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeBtnShadow`] for more documentation."]
pub const COLOR_NATIVE_BTN_SHADOW: Self = Self(cef_color_id_t::CEF_ColorNativeBtnShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeBtnText`] for more documentation."]
pub const COLOR_NATIVE_BTN_TEXT: Self = Self(cef_color_id_t::CEF_ColorNativeBtnText);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeGrayText`] for more documentation."]
pub const COLOR_NATIVE_GRAY_TEXT: Self = Self(cef_color_id_t::CEF_ColorNativeGrayText);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeHighlight`] for more documentation."]
pub const COLOR_NATIVE_HIGHLIGHT: Self = Self(cef_color_id_t::CEF_ColorNativeHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeHighlightText`] for more documentation."]
pub const COLOR_NATIVE_HIGHLIGHT_TEXT: Self =
Self(cef_color_id_t::CEF_ColorNativeHighlightText);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeHotlight`] for more documentation."]
pub const COLOR_NATIVE_HOTLIGHT: Self = Self(cef_color_id_t::CEF_ColorNativeHotlight);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeMenuHilight`] for more documentation."]
pub const COLOR_NATIVE_MENU_HILIGHT: Self = Self(cef_color_id_t::CEF_ColorNativeMenuHilight);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeScrollbar`] for more documentation."]
pub const COLOR_NATIVE_SCROLLBAR: Self = Self(cef_color_id_t::CEF_ColorNativeScrollbar);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeWindow`] for more documentation."]
pub const COLOR_NATIVE_WINDOW: Self = Self(cef_color_id_t::CEF_ColorNativeWindow);
#[doc = "See [`cef_color_id_t::CEF_ColorNativeWindowText`] for more documentation."]
pub const COLOR_NATIVE_WINDOW_TEXT: Self = Self(cef_color_id_t::CEF_ColorNativeWindowText);
#[doc = "See [`cef_color_id_t::CEF_UiColorsEnd`] for more documentation."]
pub const UI_COLORS_END: Self = Self(cef_color_id_t::CEF_UiColorsEnd);
#[doc = "See [`cef_color_id_t::kFullscreenNotificationOpaqueBackgroundColor`] for more documentation."]
pub const FULLSCREEN_NOTIFICATION_OPAQUE_BACKGROUND_COLOR: Self =
Self(cef_color_id_t::kFullscreenNotificationOpaqueBackgroundColor);
#[doc = "See [`cef_color_id_t::kFullscreenNotificationTransparentBackgroundColor`] for more documentation."]
pub const FULLSCREEN_NOTIFICATION_TRANSPARENT_BACKGROUND_COLOR: Self =
Self(cef_color_id_t::kFullscreenNotificationTransparentBackgroundColor);
#[doc = "See [`cef_color_id_t::CEF_ColorEyedropperBoundary`] for more documentation."]
pub const COLOR_EYEDROPPER_BOUNDARY: Self = Self(cef_color_id_t::CEF_ColorEyedropperBoundary);
#[doc = "See [`cef_color_id_t::CEF_ColorEyedropperCentralPixelInnerRing`] for more documentation."]
pub const COLOR_EYEDROPPER_CENTRAL_PIXEL_INNER_RING: Self =
Self(cef_color_id_t::CEF_ColorEyedropperCentralPixelInnerRing);
#[doc = "See [`cef_color_id_t::CEF_ColorEyedropperCentralPixelOuterRing`] for more documentation."]
pub const COLOR_EYEDROPPER_CENTRAL_PIXEL_OUTER_RING: Self =
Self(cef_color_id_t::CEF_ColorEyedropperCentralPixelOuterRing);
#[doc = "See [`cef_color_id_t::CEF_ColorEyedropperGrid`] for more documentation."]
pub const COLOR_EYEDROPPER_GRID: Self = Self(cef_color_id_t::CEF_ColorEyedropperGrid);
#[doc = "See [`cef_color_id_t::CEF_ComponentsColorsEnd`] for more documentation."]
pub const COMPONENTS_COLORS_END: Self = Self(cef_color_id_t::CEF_ComponentsColorsEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuHighlightSeverityHigh`] for more documentation."]
pub const COLOR_APP_MENU_HIGHLIGHT_SEVERITY_HIGH: Self =
Self(cef_color_id_t::CEF_ColorAppMenuHighlightSeverityHigh);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuHighlightSeverityMedium`] for more documentation."]
pub const COLOR_APP_MENU_HIGHLIGHT_SEVERITY_MEDIUM: Self =
Self(cef_color_id_t::CEF_ColorAppMenuHighlightSeverityMedium);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuHighlightDefault`] for more documentation."]
pub const COLOR_APP_MENU_HIGHLIGHT_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorAppMenuHighlightDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuHighlightPrimary`] for more documentation."]
pub const COLOR_APP_MENU_HIGHLIGHT_PRIMARY: Self =
Self(cef_color_id_t::CEF_ColorAppMenuHighlightPrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuExpandedForegroundDefault`] for more documentation."]
pub const COLOR_APP_MENU_EXPANDED_FOREGROUND_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorAppMenuExpandedForegroundDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuExpandedForegroundPrimary`] for more documentation."]
pub const COLOR_APP_MENU_EXPANDED_FOREGROUND_PRIMARY: Self =
Self(cef_color_id_t::CEF_ColorAppMenuExpandedForegroundPrimary);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuChipInkDropHover`] for more documentation."]
pub const COLOR_APP_MENU_CHIP_INK_DROP_HOVER: Self =
Self(cef_color_id_t::CEF_ColorAppMenuChipInkDropHover);
#[doc = "See [`cef_color_id_t::CEF_ColorAppMenuChipInkDropRipple`] for more documentation."]
pub const COLOR_APP_MENU_CHIP_INK_DROP_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorAppMenuChipInkDropRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorActorUiHandoffButtonBorder`] for more documentation."]
pub const COLOR_ACTOR_UI_HANDOFF_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorActorUiHandoffButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorActorUiOverlayBorder`] for more documentation."]
pub const COLOR_ACTOR_UI_OVERLAY_BORDER: Self =
Self(cef_color_id_t::CEF_ColorActorUiOverlayBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorActorUiOverlayBorderGlow`] for more documentation."]
pub const COLOR_ACTOR_UI_OVERLAY_BORDER_GLOW: Self =
Self(cef_color_id_t::CEF_ColorActorUiOverlayBorderGlow);
#[doc = "See [`cef_color_id_t::CEF_ColorActorUiScrimStart`] for more documentation."]
pub const COLOR_ACTOR_UI_SCRIM_START: Self = Self(cef_color_id_t::CEF_ColorActorUiScrimStart);
#[doc = "See [`cef_color_id_t::CEF_ColorActorUiScrimMiddle`] for more documentation."]
pub const COLOR_ACTOR_UI_SCRIM_MIDDLE: Self = Self(cef_color_id_t::CEF_ColorActorUiScrimMiddle);
#[doc = "See [`cef_color_id_t::CEF_ColorActorUiScrimEnd`] for more documentation."]
pub const COLOR_ACTOR_UI_SCRIM_END: Self = Self(cef_color_id_t::CEF_ColorActorUiScrimEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorActorUiMagicCursor`] for more documentation."]
pub const COLOR_ACTOR_UI_MAGIC_CURSOR: Self = Self(cef_color_id_t::CEF_ColorActorUiMagicCursor);
#[doc = "See [`cef_color_id_t::CEF_ColorActivityIndicatorForeground`] for more documentation."]
pub const COLOR_ACTIVITY_INDICATOR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorActivityIndicatorForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorActivityIndicatorSubtitleForeground`] for more documentation."]
pub const COLOR_ACTIVITY_INDICATOR_SUBTITLE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorActivityIndicatorSubtitleForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightDefault`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightGuest`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_GUEST: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightGuest);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightSyncError`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_SYNC_ERROR: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightSyncError);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightSyncPaused`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_SYNC_PAUSED: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightSyncPaused);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightPasskeysLocked`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_PASSKEYS_LOCKED: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightPasskeysLocked);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightSigninPaused`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_SIGNIN_PAUSED: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightSigninPaused);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightExplicitText`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_EXPLICIT_TEXT: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightExplicitText);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightIncognito`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_INCOGNITO: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightIncognito);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightManagement`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_MANAGEMENT: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightManagement);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightGuestForeground`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_GUEST_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightGuestForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightDefaultForeground`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_DEFAULT_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightDefaultForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightSyncErrorForeground`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_SYNC_ERROR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightSyncErrorForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightIncognitoForeground`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_INCOGNITO_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightIncognitoForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonHighlightManagementForeground`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_HIGHLIGHT_MANAGEMENT_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonHighlightManagementForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonIncognitoHover`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_INCOGNITO_HOVER: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonIncognitoHover);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarButtonNormalRipple`] for more documentation."]
pub const COLOR_AVATAR_BUTTON_NORMAL_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorAvatarButtonNormalRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarStroke`] for more documentation."]
pub const COLOR_AVATAR_STROKE: Self = Self(cef_color_id_t::CEF_ColorAvatarStroke);
#[doc = "See [`cef_color_id_t::CEF_ColorAvatarFillForContrast`] for more documentation."]
pub const COLOR_AVATAR_FILL_FOR_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorAvatarFillForContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkBarBackground`] for more documentation."]
pub const COLOR_BOOKMARK_BAR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBookmarkBarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkBarForeground`] for more documentation."]
pub const COLOR_BOOKMARK_BAR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorBookmarkBarForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkBarForegroundDisabled`] for more documentation."]
pub const COLOR_BOOKMARK_BAR_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorBookmarkBarForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkBarSeparator`] for more documentation."]
pub const COLOR_BOOKMARK_BAR_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorBookmarkBarSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkBarSeparatorChromeRefresh`] for more documentation."]
pub const COLOR_BOOKMARK_BAR_SEPARATOR_CHROME_REFRESH: Self =
Self(cef_color_id_t::CEF_ColorBookmarkBarSeparatorChromeRefresh);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkButtonIcon`] for more documentation."]
pub const COLOR_BOOKMARK_BUTTON_ICON: Self = Self(cef_color_id_t::CEF_ColorBookmarkButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkDialogTrackPriceIcon`] for more documentation."]
pub const COLOR_BOOKMARK_DIALOG_TRACK_PRICE_ICON: Self =
Self(cef_color_id_t::CEF_ColorBookmarkDialogTrackPriceIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkDialogProductImageBorder`] for more documentation."]
pub const COLOR_BOOKMARK_DIALOG_PRODUCT_IMAGE_BORDER: Self =
Self(cef_color_id_t::CEF_ColorBookmarkDialogProductImageBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkDragImageBackground`] for more documentation."]
pub const COLOR_BOOKMARK_DRAG_IMAGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBookmarkDragImageBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkDragImageCountBackground`] for more documentation."]
pub const COLOR_BOOKMARK_DRAG_IMAGE_COUNT_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBookmarkDragImageCountBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkDragImageCountForeground`] for more documentation."]
pub const COLOR_BOOKMARK_DRAG_IMAGE_COUNT_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorBookmarkDragImageCountForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkDragImageForeground`] for more documentation."]
pub const COLOR_BOOKMARK_DRAG_IMAGE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorBookmarkDragImageForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkDragImageIconBackground`] for more documentation."]
pub const COLOR_BOOKMARK_DRAG_IMAGE_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBookmarkDragImageIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkFavicon`] for more documentation."]
pub const COLOR_BOOKMARK_FAVICON: Self = Self(cef_color_id_t::CEF_ColorBookmarkFavicon);
#[doc = "See [`cef_color_id_t::CEF_ColorBookmarkFolderIcon`] for more documentation."]
pub const COLOR_BOOKMARK_FOLDER_ICON: Self = Self(cef_color_id_t::CEF_ColorBookmarkFolderIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionButtonBackground`] for more documentation."]
pub const COLOR_CAPTION_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorCaptionButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorCapturedTabContentsBorder`] for more documentation."]
pub const COLOR_CAPTURED_TAB_CONTENTS_BORDER: Self =
Self(cef_color_id_t::CEF_ColorCapturedTabContentsBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorCastDialogHelpIcon`] for more documentation."]
pub const COLOR_CAST_DIALOG_HELP_ICON: Self = Self(cef_color_id_t::CEF_ColorCastDialogHelpIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorChromeSigninBubbleBackground`] for more documentation."]
pub const COLOR_CHROME_SIGNIN_BUBBLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorChromeSigninBubbleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorChromeSigninBubbleInfoBackground`] for more documentation."]
pub const COLOR_CHROME_SIGNIN_BUBBLE_INFO_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorChromeSigninBubbleInfoBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBatchUploadBackground`] for more documentation."]
pub const COLOR_BATCH_UPLOAD_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBatchUploadBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBatchUploadDataBackground`] for more documentation."]
pub const COLOR_BATCH_UPLOAD_DATA_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBatchUploadDataBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBatchUploadDataSeparator`] for more documentation."]
pub const COLOR_BATCH_UPLOAD_DATA_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorBatchUploadDataSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorBnplIssuerLabelForeground`] for more documentation."]
pub const COLOR_BNPL_ISSUER_LABEL_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorBnplIssuerLabelForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorBnplIssuerLabelForegroundDisabled`] for more documentation."]
pub const COLOR_BNPL_ISSUER_LABEL_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorBnplIssuerLabelForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorBnplIssuerLinkedIneligibleBackground`] for more documentation."]
pub const COLOR_BNPL_ISSUER_LINKED_INELIGIBLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBnplIssuerLinkedIneligibleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBnplIssuerLinkedPillBackground`] for more documentation."]
pub const COLOR_BNPL_ISSUER_LINKED_PILL_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorBnplIssuerLinkedPillBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorBnplIssuerLinkedPillForeground`] for more documentation."]
pub const COLOR_BNPL_ISSUER_LINKED_PILL_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorBnplIssuerLinkedPillForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogBackground`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogDivider`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogError`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_ERROR: Self = Self(cef_color_id_t::CEF_ColorComposeDialogError);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogForegroundSubtle`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_FOREGROUND_SUBTLE: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogForegroundSubtle);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogLink`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_LINK: Self = Self(cef_color_id_t::CEF_ColorComposeDialogLink);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogLogo`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_LOGO: Self = Self(cef_color_id_t::CEF_ColorComposeDialogLogo);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogResultBackground`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_RESULT_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogResultBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogResultForeground`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_RESULT_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogResultForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogResultForegroundWhileLoading`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_RESULT_FOREGROUND_WHILE_LOADING: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogResultForegroundWhileLoading);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogResultIcon`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_RESULT_ICON: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogResultIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogResultContainerScrollbarThumb`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_RESULT_CONTAINER_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogResultContainerScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogScrollbarThumb`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogTitle`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_TITLE: Self = Self(cef_color_id_t::CEF_ColorComposeDialogTitle);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogTextarea`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_TEXTAREA: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogTextarea);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogTextareaOutline`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_TEXTAREA_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogTextareaOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogTextareaPlaceholder`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_TEXTAREA_PLACEHOLDER: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogTextareaPlaceholder);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogTextareaReadonlyBackground`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_TEXTAREA_READONLY_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogTextareaReadonlyBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogTextareaReadonlyForeground`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_TEXTAREA_READONLY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogTextareaReadonlyForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogTextareaIcon`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_TEXTAREA_ICON: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogTextareaIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeDialogSelectOptionDisabled`] for more documentation."]
pub const COLOR_COMPOSE_DIALOG_SELECT_OPTION_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorComposeDialogSelectOptionDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorDesktopMediaPickerDescriptionLabel`] for more documentation."]
pub const COLOR_DESKTOP_MEDIA_PICKER_DESCRIPTION_LABEL: Self =
Self(cef_color_id_t::CEF_ColorDesktopMediaPickerDescriptionLabel);
#[doc = "See [`cef_color_id_t::CEF_ColorDesktopMediaTabListBorder`] for more documentation."]
pub const COLOR_DESKTOP_MEDIA_TAB_LIST_BORDER: Self =
Self(cef_color_id_t::CEF_ColorDesktopMediaTabListBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorDesktopMediaTabListPreviewBackground`] for more documentation."]
pub const COLOR_DESKTOP_MEDIA_TAB_LIST_PREVIEW_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorDesktopMediaTabListPreviewBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorDesktopToIOSPromoFooterSubtitleLabel`] for more documentation."]
pub const COLOR_DESKTOP_TO_IOS_PROMO_FOOTER_SUBTITLE_LABEL: Self =
Self(cef_color_id_t::CEF_ColorDesktopToIOSPromoFooterSubtitleLabel);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadItemIconDangerous`] for more documentation."]
pub const COLOR_DOWNLOAD_ITEM_ICON_DANGEROUS: Self =
Self(cef_color_id_t::CEF_ColorDownloadItemIconDangerous);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadItemTextDangerous`] for more documentation."]
pub const COLOR_DOWNLOAD_ITEM_TEXT_DANGEROUS: Self =
Self(cef_color_id_t::CEF_ColorDownloadItemTextDangerous);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadItemIconWarning`] for more documentation."]
pub const COLOR_DOWNLOAD_ITEM_ICON_WARNING: Self =
Self(cef_color_id_t::CEF_ColorDownloadItemIconWarning);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadItemTextWarning`] for more documentation."]
pub const COLOR_DOWNLOAD_ITEM_TEXT_WARNING: Self =
Self(cef_color_id_t::CEF_ColorDownloadItemTextWarning);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadBubbleInfoBackground`] for more documentation."]
pub const COLOR_DOWNLOAD_BUBBLE_INFO_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorDownloadBubbleInfoBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadBubbleInfoIcon`] for more documentation."]
pub const COLOR_DOWNLOAD_BUBBLE_INFO_ICON: Self =
Self(cef_color_id_t::CEF_ColorDownloadBubbleInfoIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadBubbleRowHover`] for more documentation."]
pub const COLOR_DOWNLOAD_BUBBLE_ROW_HOVER: Self =
Self(cef_color_id_t::CEF_ColorDownloadBubbleRowHover);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadBubbleShowAllDownloadsIcon`] for more documentation."]
pub const COLOR_DOWNLOAD_BUBBLE_SHOW_ALL_DOWNLOADS_ICON: Self =
Self(cef_color_id_t::CEF_ColorDownloadBubbleShowAllDownloadsIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadBubblePrimaryIcon`] for more documentation."]
pub const COLOR_DOWNLOAD_BUBBLE_PRIMARY_ICON: Self =
Self(cef_color_id_t::CEF_ColorDownloadBubblePrimaryIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadToolbarButtonActive`] for more documentation."]
pub const COLOR_DOWNLOAD_TOOLBAR_BUTTON_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorDownloadToolbarButtonActive);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadToolbarButtonAnimationBackground`] for more documentation."]
pub const COLOR_DOWNLOAD_TOOLBAR_BUTTON_ANIMATION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorDownloadToolbarButtonAnimationBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadToolbarButtonAnimationForeground`] for more documentation."]
pub const COLOR_DOWNLOAD_TOOLBAR_BUTTON_ANIMATION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorDownloadToolbarButtonAnimationForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadToolbarButtonInactive`] for more documentation."]
pub const COLOR_DOWNLOAD_TOOLBAR_BUTTON_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorDownloadToolbarButtonInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorDownloadToolbarButtonRingBackground`] for more documentation."]
pub const COLOR_DOWNLOAD_TOOLBAR_BUTTON_RING_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorDownloadToolbarButtonRingBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionDialogBackground`] for more documentation."]
pub const COLOR_EXTENSION_DIALOG_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorExtensionDialogBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionIconBadgeBackgroundDefault`] for more documentation."]
pub const COLOR_EXTENSION_ICON_BADGE_BACKGROUND_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorExtensionIconBadgeBackgroundDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionIconDecorationAmbientShadow`] for more documentation."]
pub const COLOR_EXTENSION_ICON_DECORATION_AMBIENT_SHADOW: Self =
Self(cef_color_id_t::CEF_ColorExtensionIconDecorationAmbientShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionIconDecorationBackground`] for more documentation."]
pub const COLOR_EXTENSION_ICON_DECORATION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorExtensionIconDecorationBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionIconDecorationKeyShadow`] for more documentation."]
pub const COLOR_EXTENSION_ICON_DECORATION_KEY_SHADOW: Self =
Self(cef_color_id_t::CEF_ColorExtensionIconDecorationKeyShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionMenuIcon`] for more documentation."]
pub const COLOR_EXTENSION_MENU_ICON: Self = Self(cef_color_id_t::CEF_ColorExtensionMenuIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionMenuIconDisabled`] for more documentation."]
pub const COLOR_EXTENSION_MENU_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorExtensionMenuIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionMenuPinButtonIcon`] for more documentation."]
pub const COLOR_EXTENSION_MENU_PIN_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorExtensionMenuPinButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionMenuPinButtonIconDisabled`] for more documentation."]
pub const COLOR_EXTENSION_MENU_PIN_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorExtensionMenuPinButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionsMenuContainerBackground`] for more documentation."]
pub const COLOR_EXTENSIONS_MENU_CONTAINER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorExtensionsMenuContainerBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionsMenuText`] for more documentation."]
pub const COLOR_EXTENSIONS_MENU_TEXT: Self = Self(cef_color_id_t::CEF_ColorExtensionsMenuText);
#[doc = "See [`cef_color_id_t::CEF_ColorExtensionsMenuSecondaryText`] for more documentation."]
pub const COLOR_EXTENSIONS_MENU_SECONDARY_TEXT: Self =
Self(cef_color_id_t::CEF_ColorExtensionsMenuSecondaryText);
#[doc = "See [`cef_color_id_t::CEF_ColorFeatureFirstRunInfoContainerBackground`] for more documentation."]
pub const COLOR_FEATURE_FIRST_RUN_INFO_CONTAINER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorFeatureFirstRunInfoContainerBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorFeatureFirstRunIconColor`] for more documentation."]
pub const COLOR_FEATURE_FIRST_RUN_ICON_COLOR: Self =
Self(cef_color_id_t::CEF_ColorFeatureFirstRunIconColor);
#[doc = "See [`cef_color_id_t::CEF_ColorFeaturePromoBubbleBackground`] for more documentation."]
pub const COLOR_FEATURE_PROMO_BUBBLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorFeaturePromoBubbleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorFeaturePromoBubbleButtonBorder`] for more documentation."]
pub const COLOR_FEATURE_PROMO_BUBBLE_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorFeaturePromoBubbleButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorFeaturePromoBubbleCloseButtonInkDrop`] for more documentation."]
pub const COLOR_FEATURE_PROMO_BUBBLE_CLOSE_BUTTON_INK_DROP: Self =
Self(cef_color_id_t::CEF_ColorFeaturePromoBubbleCloseButtonInkDrop);
#[doc = "See [`cef_color_id_t::CEF_ColorFeaturePromoBubbleDefaultButtonBackground`] for more documentation."]
pub const COLOR_FEATURE_PROMO_BUBBLE_DEFAULT_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorFeaturePromoBubbleDefaultButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorFeaturePromoBubbleDefaultButtonForeground`] for more documentation."]
pub const COLOR_FEATURE_PROMO_BUBBLE_DEFAULT_BUTTON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorFeaturePromoBubbleDefaultButtonForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorFeaturePromoBubbleForeground`] for more documentation."]
pub const COLOR_FEATURE_PROMO_BUBBLE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorFeaturePromoBubbleForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorFeatureLensPromoBubbleBackground`] for more documentation."]
pub const COLOR_FEATURE_LENS_PROMO_BUBBLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorFeatureLensPromoBubbleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorFeatureLensPromoBubbleForeground`] for more documentation."]
pub const COLOR_FEATURE_LENS_PROMO_BUBBLE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorFeatureLensPromoBubbleForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorFindBarBackground`] for more documentation."]
pub const COLOR_FIND_BAR_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorFindBarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorFindBarButtonIcon`] for more documentation."]
pub const COLOR_FIND_BAR_BUTTON_ICON: Self = Self(cef_color_id_t::CEF_ColorFindBarButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorFindBarButtonIconHovered`] for more documentation."]
pub const COLOR_FIND_BAR_BUTTON_ICON_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorFindBarButtonIconHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorFindBarButtonIconDisabled`] for more documentation."]
pub const COLOR_FIND_BAR_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorFindBarButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorFindBarForeground`] for more documentation."]
pub const COLOR_FIND_BAR_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorFindBarForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorFindBarMatchCount`] for more documentation."]
pub const COLOR_FIND_BAR_MATCH_COUNT: Self = Self(cef_color_id_t::CEF_ColorFindBarMatchCount);
#[doc = "See [`cef_color_id_t::CEF_ColorFlyingIndicatorBackground`] for more documentation."]
pub const COLOR_FLYING_INDICATOR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorFlyingIndicatorBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorFlyingIndicatorForeground`] for more documentation."]
pub const COLOR_FLYING_INDICATOR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorFlyingIndicatorForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorFocusHighlightDefault`] for more documentation."]
pub const COLOR_FOCUS_HIGHLIGHT_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorFocusHighlightDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorFrameCaptionActive`] for more documentation."]
pub const COLOR_FRAME_CAPTION_ACTIVE: Self = Self(cef_color_id_t::CEF_ColorFrameCaptionActive);
#[doc = "See [`cef_color_id_t::CEF_ColorFrameCaptionInactive`] for more documentation."]
pub const COLOR_FRAME_CAPTION_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorFrameCaptionInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryEmbeddingsBackground`] for more documentation."]
pub const COLOR_HISTORY_EMBEDDINGS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorHistoryEmbeddingsBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryEmbeddingsDivider`] for more documentation."]
pub const COLOR_HISTORY_EMBEDDINGS_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorHistoryEmbeddingsDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryEmbeddingsForeground`] for more documentation."]
pub const COLOR_HISTORY_EMBEDDINGS_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorHistoryEmbeddingsForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryEmbeddingsForegroundSubtle`] for more documentation."]
pub const COLOR_HISTORY_EMBEDDINGS_FOREGROUND_SUBTLE: Self =
Self(cef_color_id_t::CEF_ColorHistoryEmbeddingsForegroundSubtle);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryEmbeddingsImageBackground`] for more documentation."]
pub const COLOR_HISTORY_EMBEDDINGS_IMAGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorHistoryEmbeddingsImageBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryEmbeddingsImageBackgroundGradientEnd`] for more documentation."]
pub const COLOR_HISTORY_EMBEDDINGS_IMAGE_BACKGROUND_GRADIENT_END: Self =
Self(cef_color_id_t::CEF_ColorHistoryEmbeddingsImageBackgroundGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorHistoryEmbeddingsImageBackgroundGradientStart`] for more documentation."]
pub const COLOR_HISTORY_EMBEDDINGS_IMAGE_BACKGROUND_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorHistoryEmbeddingsImageBackgroundGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorInfoBarBackground`] for more documentation."]
pub const COLOR_INFO_BAR_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorInfoBarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorInfoBarButtonIcon`] for more documentation."]
pub const COLOR_INFO_BAR_BUTTON_ICON: Self = Self(cef_color_id_t::CEF_ColorInfoBarButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorInfoBarButtonIconDisabled`] for more documentation."]
pub const COLOR_INFO_BAR_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorInfoBarButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorInfoBarButtonIconHovered`] for more documentation."]
pub const COLOR_INFO_BAR_BUTTON_ICON_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorInfoBarButtonIconHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorInfoBarContentAreaSeparator`] for more documentation."]
pub const COLOR_INFO_BAR_CONTENT_AREA_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorInfoBarContentAreaSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorInfoBarForeground`] for more documentation."]
pub const COLOR_INFO_BAR_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorInfoBarForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorIntentPickerItemBackgroundHovered`] for more documentation."]
pub const COLOR_INTENT_PICKER_ITEM_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorIntentPickerItemBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorIntentPickerItemBackgroundSelected`] for more documentation."]
pub const COLOR_INTENT_PICKER_ITEM_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorIntentPickerItemBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicBackground`] for more documentation."]
pub const COLOR_GLIC_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorGlicBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicModalBackground`] for more documentation."]
pub const COLOR_GLIC_MODAL_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorGlicModalBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicModalForeground`] for more documentation."]
pub const COLOR_GLIC_MODAL_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorGlicModalForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicActiveTabUnderlineGradient1`] for more documentation."]
pub const COLOR_GLIC_ACTIVE_TAB_UNDERLINE_GRADIENT1: Self =
Self(cef_color_id_t::CEF_ColorGlicActiveTabUnderlineGradient1);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicActiveTabUnderlineGradient2`] for more documentation."]
pub const COLOR_GLIC_ACTIVE_TAB_UNDERLINE_GRADIENT2: Self =
Self(cef_color_id_t::CEF_ColorGlicActiveTabUnderlineGradient2);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicActiveTabUnderlineGradient3`] for more documentation."]
pub const COLOR_GLIC_ACTIVE_TAB_UNDERLINE_GRADIENT3: Self =
Self(cef_color_id_t::CEF_ColorGlicActiveTabUnderlineGradient3);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicInactiveTabUnderlineGradient1`] for more documentation."]
pub const COLOR_GLIC_INACTIVE_TAB_UNDERLINE_GRADIENT1: Self =
Self(cef_color_id_t::CEF_ColorGlicInactiveTabUnderlineGradient1);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicInactiveTabUnderlineGradient2`] for more documentation."]
pub const COLOR_GLIC_INACTIVE_TAB_UNDERLINE_GRADIENT2: Self =
Self(cef_color_id_t::CEF_ColorGlicInactiveTabUnderlineGradient2);
#[doc = "See [`cef_color_id_t::CEF_ColorGlicInactiveTabUnderlineGradient3`] for more documentation."]
pub const COLOR_GLIC_INACTIVE_TAB_UNDERLINE_GRADIENT3: Self =
Self(cef_color_id_t::CEF_ColorGlicInactiveTabUnderlineGradient3);
#[doc = "See [`cef_color_id_t::CEF_ColorHoverButtonBackgroundHovered`] for more documentation."]
pub const COLOR_HOVER_BUTTON_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorHoverButtonBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorLensOverlayToastBackground`] for more documentation."]
pub const COLOR_LENS_OVERLAY_TOAST_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorLensOverlayToastBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorLensOverlayToastButtonBorder`] for more documentation."]
pub const COLOR_LENS_OVERLAY_TOAST_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorLensOverlayToastButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorLensOverlayToastForeground`] for more documentation."]
pub const COLOR_LENS_OVERLAY_TOAST_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorLensOverlayToastForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorLocationBarBackground`] for more documentation."]
pub const COLOR_LOCATION_BAR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorLocationBarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorLocationBarBackgroundHovered`] for more documentation."]
pub const COLOR_LOCATION_BAR_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorLocationBarBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorLocationBarBorder`] for more documentation."]
pub const COLOR_LOCATION_BAR_BORDER: Self = Self(cef_color_id_t::CEF_ColorLocationBarBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorLocationBarBorderOnMismatch`] for more documentation."]
pub const COLOR_LOCATION_BAR_BORDER_ON_MISMATCH: Self =
Self(cef_color_id_t::CEF_ColorLocationBarBorderOnMismatch);
#[doc = "See [`cef_color_id_t::CEF_ColorLocationBarBorderOpaque`] for more documentation."]
pub const COLOR_LOCATION_BAR_BORDER_OPAQUE: Self =
Self(cef_color_id_t::CEF_ColorLocationBarBorderOpaque);
#[doc = "See [`cef_color_id_t::CEF_ColorLocationBarClearAllButtonIcon`] for more documentation."]
pub const COLOR_LOCATION_BAR_CLEAR_ALL_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorLocationBarClearAllButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorLocationBarClearAllButtonIconDisabled`] for more documentation."]
pub const COLOR_LOCATION_BAR_CLEAR_ALL_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorLocationBarClearAllButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorMediaRouterIconActive`] for more documentation."]
pub const COLOR_MEDIA_ROUTER_ICON_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorMediaRouterIconActive);
#[doc = "See [`cef_color_id_t::CEF_ColorMediaRouterIconWarning`] for more documentation."]
pub const COLOR_MEDIA_ROUTER_ICON_WARNING: Self =
Self(cef_color_id_t::CEF_ColorMediaRouterIconWarning);
#[doc = "See [`cef_color_id_t::CEF_ColorMultiContentsViewActiveContentOutline`] for more documentation."]
pub const COLOR_MULTI_CONTENTS_VIEW_ACTIVE_CONTENT_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorMultiContentsViewActiveContentOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorMultiContentsViewInactiveContentOutline`] for more documentation."]
pub const COLOR_MULTI_CONTENTS_VIEW_INACTIVE_CONTENT_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorMultiContentsViewInactiveContentOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorMultiContentsViewHighlightContentOutline`] for more documentation."]
pub const COLOR_MULTI_CONTENTS_VIEW_HIGHLIGHT_CONTENT_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorMultiContentsViewHighlightContentOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorMultiContentsViewMiniToolbarForeground`] for more documentation."]
pub const COLOR_MULTI_CONTENTS_VIEW_MINI_TOOLBAR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorMultiContentsViewMiniToolbarForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonForegroundFrameActive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_FOREGROUND_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonForegroundFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonForegroundFrameInactive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_FOREGROUND_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonForegroundFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonBackgroundFrameActive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_BACKGROUND_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonBackgroundFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonBackgroundFrameInactive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_BACKGROUND_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonBackgroundFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonFocusRing`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_FOCUS_RING: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonFocusRing);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonInkDropFrameActive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_INK_DROP_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonInkDropFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonInkDropFrameInactive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_INK_DROP_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonInkDropFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabStripComboButtonSeparator`] for more documentation."]
pub const COLOR_TAB_STRIP_COMBO_BUTTON_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorTabStripComboButtonSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorTabStripControlButtonInkDrop`] for more documentation."]
pub const COLOR_TAB_STRIP_CONTROL_BUTTON_INK_DROP: Self =
Self(cef_color_id_t::CEF_ColorTabStripControlButtonInkDrop);
#[doc = "See [`cef_color_id_t::CEF_ColorTabStripControlButtonInkDropRipple`] for more documentation."]
pub const COLOR_TAB_STRIP_CONTROL_BUTTON_INK_DROP_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorTabStripControlButtonInkDropRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonCRForegroundFrameActive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_CR_FOREGROUND_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonCRForegroundFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonCRForegroundFrameInactive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_CR_FOREGROUND_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonCRForegroundFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonCRBackgroundFrameActive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_CR_BACKGROUND_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonCRBackgroundFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabButtonCRBackgroundFrameInactive`] for more documentation."]
pub const COLOR_NEW_TAB_BUTTON_CR_BACKGROUND_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabButtonCRBackgroundFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionButtonBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionButtonBorder`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionButtonBorderHovered`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_BUTTON_BORDER_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionButtonBorderHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionButtonForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_BUTTON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionButtonForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActiveBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTIVE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActiveBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageAddShortcutBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ADD_SHORTCUT_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageAddShortcutBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageAddShortcutForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ADD_SHORTCUT_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageAddShortcutForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageAttributionForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ATTRIBUTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageAttributionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageBackgroundOverride`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_BACKGROUND_OVERRIDE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageBackgroundOverride);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageBorder`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_BORDER: Self = Self(cef_color_id_t::CEF_ColorNewTabPageBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageButtonBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageButtonBackgroundHovered`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_BUTTON_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageButtonBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageButtonForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_BUTTON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageButtonForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageCartModuleDiscountChipBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_CART_MODULE_DISCOUNT_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageCartModuleDiscountChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageCartModuleDiscountChipForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_CART_MODULE_DISCOUNT_CHIP_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageCartModuleDiscountChipForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionChipTextBody`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_CHIP_TEXT_BODY: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionChipTextBody);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionChipTextTitle`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_CHIP_TEXT_TITLE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionChipTextTitle);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionChipDeepSearchIcon`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_CHIP_DEEP_SEARCH_ICON: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionChipDeepSearchIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageThreadsRailBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_THREADS_RAIL_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageThreadsRailBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageThreadsRailIconButton`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_THREADS_RAIL_ICON_BUTTON: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageThreadsRailIconButton);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageChipBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageChipForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_CHIP_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageChipForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileChipSpinner`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CHIP_SPINNER: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileChipSpinner);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFont`] for more documentation."]
pub const COLOR_COMPOSEBOX_FONT: Self = Self(cef_color_id_t::CEF_ColorComposeboxFont);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFontLight`] for more documentation."]
pub const COLOR_COMPOSEBOX_FONT_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFontLight);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxCancelButton`] for more documentation."]
pub const COLOR_COMPOSEBOX_CANCEL_BUTTON: Self =
Self(cef_color_id_t::CEF_ColorComposeboxCancelButton);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxCancelButtonLight`] for more documentation."]
pub const COLOR_COMPOSEBOX_CANCEL_BUTTON_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorComposeboxCancelButtonLight);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxErrorScrimBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_ERROR_SCRIM_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxErrorScrimBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxErrorScrimButtonBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_ERROR_SCRIM_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxErrorScrimButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxErrorScrimButtonBackgroundHover`] for more documentation."]
pub const COLOR_COMPOSEBOX_ERROR_SCRIM_BUTTON_BACKGROUND_HOVER: Self =
Self(cef_color_id_t::CEF_ColorComposeboxErrorScrimButtonBackgroundHover);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxErrorScrimButtonText`] for more documentation."]
pub const COLOR_COMPOSEBOX_ERROR_SCRIM_BUTTON_TEXT: Self =
Self(cef_color_id_t::CEF_ColorComposeboxErrorScrimButtonText);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxErrorScrimForeground`] for more documentation."]
pub const COLOR_COMPOSEBOX_ERROR_SCRIM_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxErrorScrimForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxHover`] for more documentation."]
pub const COLOR_COMPOSEBOX_HOVER: Self = Self(cef_color_id_t::CEF_ColorComposeboxHover);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxInputIcon`] for more documentation."]
pub const COLOR_COMPOSEBOX_INPUT_ICON: Self =
Self(cef_color_id_t::CEF_ColorComposeboxInputIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxLensButton`] for more documentation."]
pub const COLOR_COMPOSEBOX_LENS_BUTTON: Self =
Self(cef_color_id_t::CEF_ColorComposeboxLensButton);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxOutlineHcm`] for more documentation."]
pub const COLOR_COMPOSEBOX_OUTLINE_HCM: Self =
Self(cef_color_id_t::CEF_ColorComposeboxOutlineHcm);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxRecentTabChipOutline`] for more documentation."]
pub const COLOR_COMPOSEBOX_RECENT_TAB_CHIP_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorComposeboxRecentTabChipOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxScrimBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_SCRIM_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxScrimBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxSubmitButtonBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_SUBMIT_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxSubmitButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxSuggestionActivity`] for more documentation."]
pub const COLOR_COMPOSEBOX_SUGGESTION_ACTIVITY: Self =
Self(cef_color_id_t::CEF_ColorComposeboxSuggestionActivity);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxTabSelectorButtonSelected`] for more documentation."]
pub const COLOR_COMPOSEBOX_TAB_SELECTOR_BUTTON_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorComposeboxTabSelectorButtonSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxTypeAhead`] for more documentation."]
pub const COLOR_COMPOSEBOX_TYPE_AHEAD: Self =
Self(cef_color_id_t::CEF_ColorComposeboxTypeAhead);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxTypeAheadChip`] for more documentation."]
pub const COLOR_COMPOSEBOX_TYPE_AHEAD_CHIP: Self =
Self(cef_color_id_t::CEF_ColorComposeboxTypeAheadChip);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxUploadButton`] for more documentation."]
pub const COLOR_COMPOSEBOX_UPLOAD_BUTTON: Self =
Self(cef_color_id_t::CEF_ColorComposeboxUploadButton);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxUploadButtonDisabled`] for more documentation."]
pub const COLOR_COMPOSEBOX_UPLOAD_BUTTON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorComposeboxUploadButtonDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileChipBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileChipFaviconBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CHIP_FAVICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileChipFaviconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileChipText`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CHIP_TEXT: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileChipText);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxPdfChipIcon`] for more documentation."]
pub const COLOR_COMPOSEBOX_PDF_CHIP_ICON: Self =
Self(cef_color_id_t::CEF_ColorComposeboxPdfChipIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileImageOverlay`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_IMAGE_OVERLAY: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileImageOverlay);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileCarouselDivider`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CAROUSEL_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileCarouselDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileCarouselRemoveButton`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CAROUSEL_REMOVE_BUTTON: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileCarouselRemoveButton);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileCarouselRemoveGradientStart`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CAROUSEL_REMOVE_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileCarouselRemoveGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileCarouselRemoveGradientEnd`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CAROUSEL_REMOVE_GRADIENT_END: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileCarouselRemoveGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxFileCarouselUrl`] for more documentation."]
pub const COLOR_COMPOSEBOX_FILE_CAROUSEL_URL: Self =
Self(cef_color_id_t::CEF_ColorComposeboxFileCarouselUrl);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxContextEntrypointTextDisabled`] for more documentation."]
pub const COLOR_COMPOSEBOX_CONTEXT_ENTRYPOINT_TEXT_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorComposeboxContextEntrypointTextDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxContextEntrypointHoverBackground`] for more documentation."]
pub const COLOR_COMPOSEBOX_CONTEXT_ENTRYPOINT_HOVER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorComposeboxContextEntrypointHoverBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorComposeboxLink`] for more documentation."]
pub const COLOR_COMPOSEBOX_LINK: Self = Self(cef_color_id_t::CEF_ColorComposeboxLink);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageCommonInputPlaceholder`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_COMMON_INPUT_PLACEHOLDER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageCommonInputPlaceholder);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageControlBackgroundHovered`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_CONTROL_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageControlBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageControlBackgroundSelected`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_CONTROL_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageControlBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageFirstRunBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_FIRST_RUN_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageFirstRunBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageFocusRing`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_FOCUS_RING: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageFocusRing);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageHeader`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_HEADER: Self = Self(cef_color_id_t::CEF_ColorNewTabPageHeader);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageHistoryClustersModuleItemBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_HISTORY_CLUSTERS_MODULE_ITEM_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageHistoryClustersModuleItemBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPagePromoBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_PROMO_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPagePromoBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPagePromoImageBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_PROMO_IMAGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPagePromoImageBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageIconButtonBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ICON_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageIconButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageIconButtonBackgroundActive`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ICON_BUTTON_BACKGROUND_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageIconButtonBackgroundActive);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageLink`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_LINK: Self = Self(cef_color_id_t::CEF_ColorNewTabPageLink);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageLogo`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_LOGO: Self = Self(cef_color_id_t::CEF_ColorNewTabPageLogo);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageLogoUnthemedDark`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_LOGO_UNTHEMED_DARK: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageLogoUnthemedDark);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageLogoUnthemedLight`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_LOGO_UNTHEMED_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageLogoUnthemedLight);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMenuInnerShadow`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MENU_INNER_SHADOW: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMenuInnerShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMenuOuterShadow`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MENU_OUTER_SHADOW: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMenuOuterShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMicBorderColor`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MIC_BORDER_COLOR: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMicBorderColor);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMicIconColor`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MIC_ICON_COLOR: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMicIconColor);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleControlBorder`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_CONTROL_BORDER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleControlBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleContextMenuDivider`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_CONTEXT_MENU_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleContextMenuDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleCalendarEventTimeStatusBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_CALENDAR_EVENT_TIME_STATUS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleCalendarEventTimeStatusBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleCalendarAttachmentScrollbarThumb`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_CALENDAR_ATTACHMENT_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleCalendarAttachmentScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleCalendarDividerColor`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_CALENDAR_DIVIDER_COLOR: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleCalendarDividerColor);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleIconBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleElementDivider`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_ELEMENT_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleElementDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleIconContainerBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_ICON_CONTAINER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleIconContainerBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleItemBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_ITEM_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleItemBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleItemBackgroundHovered`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_ITEM_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleItemBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleScrollButtonBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_SCROLL_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleScrollButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleScrollButtonBackgroundHovered`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_SCROLL_BUTTON_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleScrollButtonBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsGrey`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_GREY: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsBlue`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_BLUE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsRed`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_RED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsRed);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsYellow`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsGreen`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_GREEN: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsPink`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_PINK: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsPink);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsPurple`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsPurple);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsCyan`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_CYAN: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsOrange`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotGrey`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_GREY: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotBlue`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_BLUE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotRed`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_RED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotRed);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotYellow`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotGreen`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_GREEN: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotPink`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_PINK: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotPink);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotPurple`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotPurple);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotCyan`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_CYAN: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotOrange`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MODULE_TAB_GROUPS_DOT_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageModuleTabGroupsDotOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMostVisitedForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MOST_VISITED_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMostVisitedForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMostVisitedTileBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MOST_VISITED_TILE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMostVisitedTileBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMostVisitedTileBackgroundThemed`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MOST_VISITED_TILE_BACKGROUND_THEMED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMostVisitedTileBackgroundThemed);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageMostVisitedTileBackgroundUnthemed`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_MOST_VISITED_TILE_BACKGROUND_UNTHEMED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageMostVisitedTileBackgroundUnthemed);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageOnThemeForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ON_THEME_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageOnThemeForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageOverlayBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_OVERLAY_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageOverlayBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageOverlayForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_OVERLAY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageOverlayForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageOverlaySecondaryForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_OVERLAY_SECONDARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageOverlaySecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPagePrimaryForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_PRIMARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPagePrimaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageRealboxNextIconHover`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_REALBOX_NEXT_ICON_HOVER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageRealboxNextIconHover);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageSearchBoxBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_SEARCH_BOX_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageSearchBoxBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageSearchBoxBackgroundHovered`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_SEARCH_BOX_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageSearchBoxBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageSearchBoxResultsTextDimmedSelected`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_SEARCH_BOX_RESULTS_TEXT_DIMMED_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageSearchBoxResultsTextDimmedSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageSecondaryForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_SECONDARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageSecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageSectionBorder`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_SECTION_BORDER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageSectionBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageTagBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_TAG_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageTagBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageText`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_TEXT: Self = Self(cef_color_id_t::CEF_ColorNewTabPageText);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageTextUnthemed`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_TEXT_UNTHEMED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageTextUnthemed);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageTextLight`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_TEXT_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageTextLight);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageWallpaperSearchButtonBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_WALLPAPER_SEARCH_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageWallpaperSearchButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageWallpaperSearchButtonBackgroundHovered`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_WALLPAPER_SEARCH_BUTTON_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageWallpaperSearchButtonBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageWallpaperSearchButtonForeground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_WALLPAPER_SEARCH_BUTTON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageWallpaperSearchButtonForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageDoodleShareButtonBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_DOODLE_SHARE_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageDoodleShareButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageDoodleShareButtonIcon`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_DOODLE_SHARE_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageDoodleShareButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabFooterBackground`] for more documentation."]
pub const COLOR_NEW_TAB_FOOTER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabFooterBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabFooterText`] for more documentation."]
pub const COLOR_NEW_TAB_FOOTER_TEXT: Self = Self(cef_color_id_t::CEF_ColorNewTabFooterText);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabFooterLogoBackground`] for more documentation."]
pub const COLOR_NEW_TAB_FOOTER_LOGO_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabFooterLogoBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxActionIcon`] for more documentation."]
pub const COLOR_OMNIBOX_ACTION_ICON: Self = Self(cef_color_id_t::CEF_ColorOmniboxActionIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxActionIconHover`] for more documentation."]
pub const COLOR_OMNIBOX_ACTION_ICON_HOVER: Self =
Self(cef_color_id_t::CEF_ColorOmniboxActionIconHover);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxAnswerIconGM3Background`] for more documentation."]
pub const COLOR_OMNIBOX_ANSWER_ICON_GM3BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxAnswerIconGM3Background);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxAnswerIconGM3Foreground`] for more documentation."]
pub const COLOR_OMNIBOX_ANSWER_ICON_GM3FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxAnswerIconGM3Foreground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxBubbleOutline`] for more documentation."]
pub const COLOR_OMNIBOX_BUBBLE_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorOmniboxBubbleOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipInUseActivityIndicatorBackground`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_IN_USE_ACTIVITY_INDICATOR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipInUseActivityIndicatorBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipInUseActivityIndicatorForeground`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_IN_USE_ACTIVITY_INDICATOR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipInUseActivityIndicatorForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipBackground`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipBlockedActivityIndicatorBackground`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_BLOCKED_ACTIVITY_INDICATOR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipBlockedActivityIndicatorBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipBlockedActivityIndicatorForeground`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_BLOCKED_ACTIVITY_INDICATOR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipBlockedActivityIndicatorForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipForegroundLowVisibility`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_FOREGROUND_LOW_VISIBILITY: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipForegroundLowVisibility);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipForegroundNormalVisibility`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_FOREGROUND_NORMAL_VISIBILITY: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipForegroundNormalVisibility);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipInkDropHover`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_INK_DROP_HOVER: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipInkDropHover);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipInkDropRipple`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_INK_DROP_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipInkDropRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipOnSystemBlockedActivityIndicatorBackground`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_ON_SYSTEM_BLOCKED_ACTIVITY_INDICATOR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipOnSystemBlockedActivityIndicatorBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxChipOnSystemBlockedActivityIndicatorForeground`] for more documentation."]
pub const COLOR_OMNIBOX_CHIP_ON_SYSTEM_BLOCKED_ACTIVITY_INDICATOR_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxChipOnSystemBlockedActivityIndicatorForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxChipBackground`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxDivider`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxFaviconBackground`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_FAVICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxFaviconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxFileThumbnailOverlay`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_FILE_THUMBNAIL_OVERLAY: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxFileThumbnailOverlay);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxFileThumbnailOverlayIcon`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_FILE_THUMBNAIL_OVERLAY_ICON: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxFileThumbnailOverlayIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxPrimaryAction`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_PRIMARY_ACTION: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxPrimaryAction);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxSubmitButtonBackground`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_SUBMIT_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxSubmitButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxComposeboxSubmitButtonIcon`] for more documentation."]
pub const COLOR_OMNIBOX_COMPOSEBOX_SUBMIT_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorOmniboxComposeboxSubmitButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxContextEntrypointHoverBackground`] for more documentation."]
pub const COLOR_OMNIBOX_CONTEXT_ENTRYPOINT_HOVER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxContextEntrypointHoverBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxContextEntrypointText`] for more documentation."]
pub const COLOR_OMNIBOX_CONTEXT_ENTRYPOINT_TEXT: Self =
Self(cef_color_id_t::CEF_ColorOmniboxContextEntrypointText);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxForegroundDisabled`] for more documentation."]
pub const COLOR_OMNIBOX_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIconBackground`] for more documentation."]
pub const COLOR_OMNIBOX_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIconBackgroundTonal`] for more documentation."]
pub const COLOR_OMNIBOX_ICON_BACKGROUND_TONAL: Self =
Self(cef_color_id_t::CEF_ColorOmniboxIconBackgroundTonal);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIconForeground`] for more documentation."]
pub const COLOR_OMNIBOX_ICON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxIconForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIconForegroundTonal`] for more documentation."]
pub const COLOR_OMNIBOX_ICON_FOREGROUND_TONAL: Self =
Self(cef_color_id_t::CEF_ColorOmniboxIconForegroundTonal);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIconHover`] for more documentation."]
pub const COLOR_OMNIBOX_ICON_HOVER: Self = Self(cef_color_id_t::CEF_ColorOmniboxIconHover);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIconPressed`] for more documentation."]
pub const COLOR_OMNIBOX_ICON_PRESSED: Self = Self(cef_color_id_t::CEF_ColorOmniboxIconPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIntentChipBackground`] for more documentation."]
pub const COLOR_OMNIBOX_INTENT_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxIntentChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxIntentChipIcon`] for more documentation."]
pub const COLOR_OMNIBOX_INTENT_CHIP_ICON: Self =
Self(cef_color_id_t::CEF_ColorOmniboxIntentChipIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxKeywordSelected`] for more documentation."]
pub const COLOR_OMNIBOX_KEYWORD_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxKeywordSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxKeywordSeparator`] for more documentation."]
pub const COLOR_OMNIBOX_KEYWORD_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorOmniboxKeywordSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsBackground`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsBackgroundHovered`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsBackgroundSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsBackgroundIph`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BACKGROUND_IPH: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsBackgroundIph);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonBorder`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonIcon`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonIconSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_ICON_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonIconSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDrop`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_INK_DROP: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDrop);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropRowHovered`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_INK_DROP_ROW_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropRowHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropRowSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_INK_DROP_ROW_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropRowSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_INK_DROP_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropSelectedRowHovered`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_INK_DROP_SELECTED_ROW_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropSelectedRowHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropSelectedRowSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_BUTTON_INK_DROP_SELECTED_ROW_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsButtonInkDropSelectedRowSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsChipBackground`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsFocusIndicator`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_FOCUS_INDICATOR: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsFocusIndicator);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsIcon`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_ICON: Self = Self(cef_color_id_t::CEF_ColorOmniboxResultsIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsIconGM3Background`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_ICON_GM3BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsIconGM3Background);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsIconSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_ICON_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsIconSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsIconHovered`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_ICON_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsIconHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsStarterPackIcon`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_STARTER_PACK_ICON: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsStarterPackIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextAnswer`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_ANSWER: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextAnswer);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextDimmed`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_DIMMED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextDimmed);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextDimmedSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_DIMMED_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextDimmedSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextNegative`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_NEGATIVE: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextNegative);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextNegativeSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_NEGATIVE_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextNegativeSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextPositive`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_POSITIVE: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextPositive);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextPositiveSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_POSITIVE_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextPositiveSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextSecondary`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_SECONDARY: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextSecondary);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextSecondarySelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_SECONDARY_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextSecondarySelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsTextSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_TEXT_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsTextSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsUrl`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_URL: Self = Self(cef_color_id_t::CEF_ColorOmniboxResultsUrl);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxResultsUrlSelected`] for more documentation."]
pub const COLOR_OMNIBOX_RESULTS_URL_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorOmniboxResultsUrlSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSecurityChipDangerous`] for more documentation."]
pub const COLOR_OMNIBOX_SECURITY_CHIP_DANGEROUS: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSecurityChipDangerous);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSecurityChipDangerousBackground`] for more documentation."]
pub const COLOR_OMNIBOX_SECURITY_CHIP_DANGEROUS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSecurityChipDangerousBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSecurityChipDefault`] for more documentation."]
pub const COLOR_OMNIBOX_SECURITY_CHIP_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSecurityChipDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSecurityChipInkDropHover`] for more documentation."]
pub const COLOR_OMNIBOX_SECURITY_CHIP_INK_DROP_HOVER: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSecurityChipInkDropHover);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSecurityChipInkDropRipple`] for more documentation."]
pub const COLOR_OMNIBOX_SECURITY_CHIP_INK_DROP_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSecurityChipInkDropRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSecurityChipSecure`] for more documentation."]
pub const COLOR_OMNIBOX_SECURITY_CHIP_SECURE: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSecurityChipSecure);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSecurityChipText`] for more documentation."]
pub const COLOR_OMNIBOX_SECURITY_CHIP_TEXT: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSecurityChipText);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSelectionBackground`] for more documentation."]
pub const COLOR_OMNIBOX_SELECTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSelectionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxSelectionForeground`] for more documentation."]
pub const COLOR_OMNIBOX_SELECTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorOmniboxSelectionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxText`] for more documentation."]
pub const COLOR_OMNIBOX_TEXT: Self = Self(cef_color_id_t::CEF_ColorOmniboxText);
#[doc = "See [`cef_color_id_t::CEF_ColorOmniboxTextDimmed`] for more documentation."]
pub const COLOR_OMNIBOX_TEXT_DIMMED: Self = Self(cef_color_id_t::CEF_ColorOmniboxTextDimmed);
#[doc = "See [`cef_color_id_t::CEF_ColorPageInfoChosenObjectDeleteButtonIcon`] for more documentation."]
pub const COLOR_PAGE_INFO_CHOSEN_OBJECT_DELETE_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorPageInfoChosenObjectDeleteButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorPageInfoChosenObjectDeleteButtonIconDisabled`] for more documentation."]
pub const COLOR_PAGE_INFO_CHOSEN_OBJECT_DELETE_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorPageInfoChosenObjectDeleteButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorPageInfoForeground`] for more documentation."]
pub const COLOR_PAGE_INFO_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorPageInfoForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorPageInfoSubtitleForeground`] for more documentation."]
pub const COLOR_PAGE_INFO_SUBTITLE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorPageInfoSubtitleForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorPageInfoPermissionBlockedOnSystemLevelDisabled`] for more documentation."]
pub const COLOR_PAGE_INFO_PERMISSION_BLOCKED_ON_SYSTEM_LEVEL_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorPageInfoPermissionBlockedOnSystemLevelDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorPageInfoPermissionUsedIcon`] for more documentation."]
pub const COLOR_PAGE_INFO_PERMISSION_USED_ICON: Self =
Self(cef_color_id_t::CEF_ColorPageInfoPermissionUsedIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorParentAccessViewLocalWebApprovalBackground`] for more documentation."]
pub const COLOR_PARENT_ACCESS_VIEW_LOCAL_WEB_APPROVAL_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorParentAccessViewLocalWebApprovalBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsFeedbackTipBackground`] for more documentation."]
pub const COLOR_PAYMENTS_FEEDBACK_TIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorPaymentsFeedbackTipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsFeedbackTipBorder`] for more documentation."]
pub const COLOR_PAYMENTS_FEEDBACK_TIP_BORDER: Self =
Self(cef_color_id_t::CEF_ColorPaymentsFeedbackTipBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsFeedbackTipForeground`] for more documentation."]
pub const COLOR_PAYMENTS_FEEDBACK_TIP_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorPaymentsFeedbackTipForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsFeedbackTipIcon`] for more documentation."]
pub const COLOR_PAYMENTS_FEEDBACK_TIP_ICON: Self =
Self(cef_color_id_t::CEF_ColorPaymentsFeedbackTipIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsGooglePayLogo`] for more documentation."]
pub const COLOR_PAYMENTS_GOOGLE_PAY_LOGO: Self =
Self(cef_color_id_t::CEF_ColorPaymentsGooglePayLogo);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsPromoCodeBackground`] for more documentation."]
pub const COLOR_PAYMENTS_PROMO_CODE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorPaymentsPromoCodeBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsPromoCodeForeground`] for more documentation."]
pub const COLOR_PAYMENTS_PROMO_CODE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorPaymentsPromoCodeForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsPromoCodeForegroundHovered`] for more documentation."]
pub const COLOR_PAYMENTS_PROMO_CODE_FOREGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorPaymentsPromoCodeForegroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsPromoCodeForegroundPressed`] for more documentation."]
pub const COLOR_PAYMENTS_PROMO_CODE_FOREGROUND_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorPaymentsPromoCodeForegroundPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsPromoCodeInkDrop`] for more documentation."]
pub const COLOR_PAYMENTS_PROMO_CODE_INK_DROP: Self =
Self(cef_color_id_t::CEF_ColorPaymentsPromoCodeInkDrop);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsRequestBackArrowButtonIcon`] for more documentation."]
pub const COLOR_PAYMENTS_REQUEST_BACK_ARROW_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorPaymentsRequestBackArrowButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsRequestBackArrowButtonIconDisabled`] for more documentation."]
pub const COLOR_PAYMENTS_REQUEST_BACK_ARROW_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorPaymentsRequestBackArrowButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorPaymentsRequestRowBackgroundHighlighted`] for more documentation."]
pub const COLOR_PAYMENTS_REQUEST_ROW_BACKGROUND_HIGHLIGHTED: Self =
Self(cef_color_id_t::CEF_ColorPaymentsRequestRowBackgroundHighlighted);
#[doc = "See [`cef_color_id_t::CEF_ColorPermissionPromptRequestText`] for more documentation."]
pub const COLOR_PERMISSION_PROMPT_REQUEST_TEXT: Self =
Self(cef_color_id_t::CEF_ColorPermissionPromptRequestText);
#[doc = "See [`cef_color_id_t::CEF_ColorPerformanceInterventionButtonIconActive`] for more documentation."]
pub const COLOR_PERFORMANCE_INTERVENTION_BUTTON_ICON_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorPerformanceInterventionButtonIconActive);
#[doc = "See [`cef_color_id_t::CEF_ColorPerformanceInterventionButtonIconInactive`] for more documentation."]
pub const COLOR_PERFORMANCE_INTERVENTION_BUTTON_ICON_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorPerformanceInterventionButtonIconInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowBackToTabButtonBackground`] for more documentation."]
pub const COLOR_PIP_WINDOW_BACK_TO_TAB_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorPipWindowBackToTabButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowBackground`] for more documentation."]
pub const COLOR_PIP_WINDOW_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorPipWindowBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowTopBarBackground`] for more documentation."]
pub const COLOR_PIP_WINDOW_TOP_BAR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorPipWindowTopBarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowForeground`] for more documentation."]
pub const COLOR_PIP_WINDOW_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorPipWindowForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowForegroundInactive`] for more documentation."]
pub const COLOR_PIP_WINDOW_FOREGROUND_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorPipWindowForegroundInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowScrimFull`] for more documentation."]
pub const COLOR_PIP_WINDOW_SCRIM_FULL: Self = Self(cef_color_id_t::CEF_ColorPipWindowScrimFull);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowScrimTopGradientStart`] for more documentation."]
pub const COLOR_PIP_WINDOW_SCRIM_TOP_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorPipWindowScrimTopGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowScrimTopGradientEnd`] for more documentation."]
pub const COLOR_PIP_WINDOW_SCRIM_TOP_GRADIENT_END: Self =
Self(cef_color_id_t::CEF_ColorPipWindowScrimTopGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowScrimBottomGradientStart`] for more documentation."]
pub const COLOR_PIP_WINDOW_SCRIM_BOTTOM_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorPipWindowScrimBottomGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowScrimBottomGradientEnd`] for more documentation."]
pub const COLOR_PIP_WINDOW_SCRIM_BOTTOM_GRADIENT_END: Self =
Self(cef_color_id_t::CEF_ColorPipWindowScrimBottomGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowSkipAdButtonBackground`] for more documentation."]
pub const COLOR_PIP_WINDOW_SKIP_AD_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorPipWindowSkipAdButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPipWindowSkipAdButtonBorder`] for more documentation."]
pub const COLOR_PIP_WINDOW_SKIP_AD_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorPipWindowSkipAdButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsButtonBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsCitationBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_CITATION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsCitationBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsCitationPopupBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_CITATION_POPUP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsCitationPopupBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsCitationPopupText`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_CITATION_POPUP_TEXT: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsCitationPopupText);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsCitationPopupTitle`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_CITATION_POPUP_TITLE: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsCitationPopupTitle);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsComparisonTableListBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_COMPARISON_TABLE_LIST_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsComparisonTableListBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsDetailChipBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_DETAIL_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsDetailChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsDisclosureBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_DISCLOSURE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsDisclosureBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsDisclosureForeground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_DISCLOSURE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsDisclosureForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsDisclosureGradientEnd`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_DISCLOSURE_GRADIENT_END: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsDisclosureGradientEnd);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsDisclosureGradientStart`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_DISCLOSURE_GRADIENT_START: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsDisclosureGradientStart);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsDisclosureSummaryBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_DISCLOSURE_SUMMARY_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsDisclosureSummaryBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsDivider`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsGradientIcon`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_GRADIENT_ICON: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsGradientIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsHorizontalCarouselScrollbarThumb`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_HORIZONTAL_CAROUSEL_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsHorizontalCarouselScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsIcon`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_ICON: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsIconButtonBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_ICON_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsIconButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsIconButtonHoveredBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_ICON_BUTTON_HOVERED_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsIconButtonHoveredBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsLink`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_LINK: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsLink);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsPageBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_PAGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsPageBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsSummaryBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_SUMMARY_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsSummaryBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsSummaryBackgroundDragging`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_SUMMARY_BACKGROUND_DRAGGING: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsSummaryBackgroundDragging);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsTonalButtonBackground`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_TONAL_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsTonalButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProductSpecificationsTonalButtonIcon`] for more documentation."]
pub const COLOR_PRODUCT_SPECIFICATIONS_TONAL_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorProductSpecificationsTonalButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorProfileMenuBackground`] for more documentation."]
pub const COLOR_PROFILE_MENU_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProfileMenuBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProfileMenuIdentityInfoBackground`] for more documentation."]
pub const COLOR_PROFILE_MENU_IDENTITY_INFO_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProfileMenuIdentityInfoBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProfileMenuIdentityInfoTitle`] for more documentation."]
pub const COLOR_PROFILE_MENU_IDENTITY_INFO_TITLE: Self =
Self(cef_color_id_t::CEF_ColorProfileMenuIdentityInfoTitle);
#[doc = "See [`cef_color_id_t::CEF_ColorProfileMenuIdentityInfoSubtitle`] for more documentation."]
pub const COLOR_PROFILE_MENU_IDENTITY_INFO_SUBTITLE: Self =
Self(cef_color_id_t::CEF_ColorProfileMenuIdentityInfoSubtitle);
#[doc = "See [`cef_color_id_t::CEF_ColorProfileMenuPromoButtonsBackground`] for more documentation."]
pub const COLOR_PROFILE_MENU_PROMO_BUTTONS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProfileMenuPromoButtonsBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProfilesReauthDialogBorder`] for more documentation."]
pub const COLOR_PROFILES_REAUTH_DIALOG_BORDER: Self =
Self(cef_color_id_t::CEF_ColorProfilesReauthDialogBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelBackground`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelButtonDisabledIcon`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_BUTTON_DISABLED_ICON: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelButtonDisabledIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelButtonHoverBackground`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_BUTTON_HOVER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelButtonHoverBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelButtonIcon`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelListsSeparator`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_LISTS_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelListsSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelNoTabGroupsText`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_NO_TAB_GROUPS_TEXT: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelNoTabGroupsText);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelTabGroupsDragPlaceholder`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_TAB_GROUPS_DRAG_PLACEHOLDER: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelTabGroupsDragPlaceholder);
#[doc = "See [`cef_color_id_t::CEF_ColorProjectsPanelTabGroupsDropIndicator`] for more documentation."]
pub const COLOR_PROJECTS_PANEL_TAB_GROUPS_DROP_INDICATOR: Self =
Self(cef_color_id_t::CEF_ColorProjectsPanelTabGroupsDropIndicator);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaBackground`] for more documentation."]
pub const COLOR_PWA_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorPwaBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaMenuButtonIcon`] for more documentation."]
pub const COLOR_PWA_MENU_BUTTON_ICON: Self = Self(cef_color_id_t::CEF_ColorPwaMenuButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaSecurityChipForeground`] for more documentation."]
pub const COLOR_PWA_SECURITY_CHIP_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorPwaSecurityChipForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaSecurityChipForegroundDangerous`] for more documentation."]
pub const COLOR_PWA_SECURITY_CHIP_FOREGROUND_DANGEROUS: Self =
Self(cef_color_id_t::CEF_ColorPwaSecurityChipForegroundDangerous);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaSecurityChipForegroundSecure`] for more documentation."]
pub const COLOR_PWA_SECURITY_CHIP_FOREGROUND_SECURE: Self =
Self(cef_color_id_t::CEF_ColorPwaSecurityChipForegroundSecure);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaTabBarBottomSeparator`] for more documentation."]
pub const COLOR_PWA_TAB_BAR_BOTTOM_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorPwaTabBarBottomSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaTabBarTopSeparator`] for more documentation."]
pub const COLOR_PWA_TAB_BAR_TOP_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorPwaTabBarTopSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaTheme`] for more documentation."]
pub const COLOR_PWA_THEME: Self = Self(cef_color_id_t::CEF_ColorPwaTheme);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaToolbarBackground`] for more documentation."]
pub const COLOR_PWA_TOOLBAR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorPwaToolbarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaToolbarButtonIcon`] for more documentation."]
pub const COLOR_PWA_TOOLBAR_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorPwaToolbarButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorPwaToolbarButtonIconDisabled`] for more documentation."]
pub const COLOR_PWA_TOOLBAR_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorPwaToolbarButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorQrCodeBackground`] for more documentation."]
pub const COLOR_QR_CODE_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorQrCodeBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorQrCodeBorder`] for more documentation."]
pub const COLOR_QR_CODE_BORDER: Self = Self(cef_color_id_t::CEF_ColorQrCodeBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorQuickAnswersReportQueryButtonBackground`] for more documentation."]
pub const COLOR_QUICK_ANSWERS_REPORT_QUERY_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorQuickAnswersReportQueryButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorQuickAnswersReportQueryButtonForeground`] for more documentation."]
pub const COLOR_QUICK_ANSWERS_REPORT_QUERY_BUTTON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorQuickAnswersReportQueryButtonForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackground`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackgroundBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackgroundBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackgroundDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackgroundDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackgroundLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackgroundLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackgroundYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackgroundYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackgroundHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackgroundHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackgroundLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackgroundLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingBackgroundLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_BACKGROUND_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingBackgroundLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlight`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_CURRENT_READ_ALOUD_HIGHLIGHT_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingCurrentReadAloudHighlightLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackground`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOCUS_RING_BACKGROUND_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingFocusRingBackgroundLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForeground`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForegroundBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForegroundBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForegroundDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForegroundDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForegroundLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForegroundLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForegroundYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForegroundYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForegroundHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForegroundHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForegroundLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForegroundLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingForegroundLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_FOREGROUND_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingForegroundLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocus`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocus);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusScrim`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_SCRIM: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusScrim);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLineFocusLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINE_FOCUS_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLineFocusLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparator`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparatorBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparatorBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparatorDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparatorDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparatorLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparatorLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparatorYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparatorYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparatorHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparatorHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparatorLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparatorLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingSeparatorLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_SEPARATOR_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingSeparatorLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackground`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_BACKGROUND_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownBackgroundLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelected`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_DROPDOWN_SELECTED_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingDropdownSelectedLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelection`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelection);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelectionBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelectionBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelectionDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelectionDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelectionLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelectionLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelectionYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelectionYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelectionHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelectionHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelectionLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelectionLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingTextSelectionLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TEXT_SELECTION_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingTextSelectionLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefault`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefaultBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefaultBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefaultDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefaultDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefaultLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefaultLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefaultYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefaultYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefaultHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefaultHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefaultLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefaultLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkDefaultLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_DEFAULT_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkDefaultLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisited`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisited);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisitedBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisitedBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisitedDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisitedDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisitedLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisitedLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisitedYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisitedYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisitedHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisitedHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisitedLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisitedLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingLinkVisitedLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_LINK_VISITED_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingLinkVisitedLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlight`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_PREVIOUS_READ_ALOUD_HIGHLIGHT_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingPreviousReadAloudHighlightLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackground`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_BACKGROUND_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerBackgroundLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIcon`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_PLAYER_ICON_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioPlayerIconLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIcon`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconLowContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_LOW_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconLowContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackground`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_ICON_HOVER_BACKGROUND_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarIconHoverBackgroundLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutline`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_TOOLBAR_FOCUS_OUTLINE_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingToolbarFocusOutlineLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutline`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_ON_AUDIO_PLAYER_FOCUS_OUTLINE_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingOnAudioPlayerFocusOutlineLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIcon`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconBlue`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON_BLUE: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconDark);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconYellow`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconHighContrast`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON_HIGH_CONTRAST: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconHighContrast);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconLowContrastLight`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON_LOW_CONTRAST_LIGHT: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconLowContrastLight);
#[doc = "See [`cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconLowContrastDark`] for more documentation."]
pub const COLOR_READ_ANYTHING_AUDIO_CONTROLS_ICON_LOW_CONTRAST_DARK: Self =
Self(cef_color_id_t::CEF_ColorReadAnythingAudioControlsIconLowContrastDark);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxAnswerIconBackground`] for more documentation."]
pub const COLOR_SEARCHBOX_ANSWER_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxAnswerIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxAnswerIconForeground`] for more documentation."]
pub const COLOR_SEARCHBOX_ANSWER_ICON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxAnswerIconForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxBackground`] for more documentation."]
pub const COLOR_SEARCHBOX_BACKGROUND: Self = Self(cef_color_id_t::CEF_ColorSearchboxBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxBackgroundHovered`] for more documentation."]
pub const COLOR_SEARCHBOX_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorSearchboxBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxBorder`] for more documentation."]
pub const COLOR_SEARCHBOX_BORDER: Self = Self(cef_color_id_t::CEF_ColorSearchboxBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxForeground`] for more documentation."]
pub const COLOR_SEARCHBOX_FOREGROUND: Self = Self(cef_color_id_t::CEF_ColorSearchboxForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxLensVoiceIconBackground`] for more documentation."]
pub const COLOR_SEARCHBOX_LENS_VOICE_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxLensVoiceIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxPlaceholder`] for more documentation."]
pub const COLOR_SEARCHBOX_PLACEHOLDER: Self =
Self(cef_color_id_t::CEF_ColorSearchboxPlaceholder);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsActionChip`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_ACTION_CHIP: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsActionChip);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsActionChipIcon`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_ACTION_CHIP_ICON: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsActionChipIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsActionChipFocusOutline`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_ACTION_CHIP_FOCUS_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsActionChipFocusOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsBackground`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsBackgroundHovered`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsButtonHover`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_BUTTON_HOVER: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsButtonHover);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsDimSelected`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_DIM_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsDimSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsFocusIndicator`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_FOCUS_INDICATOR: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsFocusIndicator);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsForeground`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsForegroundDimmed`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_FOREGROUND_DIMMED: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsForegroundDimmed);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsIcon`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_ICON: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsIconFocusedOutline`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_ICON_FOCUSED_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsIconFocusedOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsIconSelected`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_ICON_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsIconSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsUrl`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_URL: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsUrl);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxResultsUrlSelected`] for more documentation."]
pub const COLOR_SEARCHBOX_RESULTS_URL_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorSearchboxResultsUrlSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxSearchIconBackground`] for more documentation."]
pub const COLOR_SEARCHBOX_SEARCH_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxSearchIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxSelectionBackground`] for more documentation."]
pub const COLOR_SEARCHBOX_SELECTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxSelectionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxSelectionForeground`] for more documentation."]
pub const COLOR_SEARCHBOX_SELECTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSearchboxSelectionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSearchboxShadow`] for more documentation."]
pub const COLOR_SEARCHBOX_SHADOW: Self = Self(cef_color_id_t::CEF_ColorSearchboxShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionChipBackground`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_CHIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionChipBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorNewTabPageActionChipBackgroundHover`] for more documentation."]
pub const COLOR_NEW_TAB_PAGE_ACTION_CHIP_BACKGROUND_HOVER: Self =
Self(cef_color_id_t::CEF_ColorNewTabPageActionChipBackgroundHover);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundGrey`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_GREY: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundBlue`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_BLUE: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundRed`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_RED: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundRed);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundYellow`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundGreen`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_GREEN: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundPink`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_PINK: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundPink);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundPurple`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundPurple);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundCyan`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_CYAN: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupForegroundOrange`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_FOREGROUND_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupForegroundOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlineGrey`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_GREY: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlineGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlineBlue`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_BLUE: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlineBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlineRed`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_RED: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlineRed);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlineYellow`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlineYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlineGreen`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_GREEN: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlineGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlinePink`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_PINK: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlinePink);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlinePurple`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlinePurple);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlineCyan`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_CYAN: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlineCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorSavedTabGroupOutlineOrange`] for more documentation."]
pub const COLOR_SAVED_TAB_GROUP_OUTLINE_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorSavedTabGroupOutlineOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorScreenshotCapturedImageBackground`] for more documentation."]
pub const COLOR_SCREENSHOT_CAPTURED_IMAGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorScreenshotCapturedImageBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorScreenshotCapturedImageBorder`] for more documentation."]
pub const COLOR_SCREENSHOT_CAPTURED_IMAGE_BORDER: Self =
Self(cef_color_id_t::CEF_ColorScreenshotCapturedImageBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorShareThisTabAudioToggleBackground`] for more documentation."]
pub const COLOR_SHARE_THIS_TAB_AUDIO_TOGGLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorShareThisTabAudioToggleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorShareThisTabSourceViewBorder`] for more documentation."]
pub const COLOR_SHARE_THIS_TAB_SOURCE_VIEW_BORDER: Self =
Self(cef_color_id_t::CEF_ColorShareThisTabSourceViewBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSharingRecentActivityDialogFaviconContainer`] for more documentation."]
pub const COLOR_SHARING_RECENT_ACTIVITY_DIALOG_FAVICON_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSharingRecentActivityDialogFaviconContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSharingRecentActivityDialogActivityContainer`] for more documentation."]
pub const COLOR_SHARING_RECENT_ACTIVITY_DIALOG_ACTIVITY_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSharingRecentActivityDialogActivityContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBadgeBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_BADGE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBadgeBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBadgeBackgroundUpdated`] for more documentation."]
pub const COLOR_SIDE_PANEL_BADGE_BACKGROUND_UPDATED: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBadgeBackgroundUpdated);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBadgeForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_BADGE_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBadgeForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBadgeForegroundUpdated`] for more documentation."]
pub const COLOR_SIDE_PANEL_BADGE_FOREGROUND_UPDATED: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBadgeForegroundUpdated);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBookmarksSelectedFolderBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_BOOKMARKS_SELECTED_FOLDER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBookmarksSelectedFolderBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBookmarksSelectedFolderForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_BOOKMARKS_SELECTED_FOLDER_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBookmarksSelectedFolderForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBookmarksSelectedFolderIcon`] for more documentation."]
pub const COLOR_SIDE_PANEL_BOOKMARKS_SELECTED_FOLDER_ICON: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBookmarksSelectedFolderIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBookmarksActiveFolderForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_BOOKMARKS_ACTIVE_FOLDER_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBookmarksActiveFolderForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelBookmarksActiveFolderBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_BOOKMARKS_ACTIVE_FOLDER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelBookmarksActiveFolderBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCardBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CARD_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCardBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCardPrimaryForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CARD_PRIMARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCardPrimaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCardSecondaryForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CARD_SECONDARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCardSecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCommerceGraphAxis`] for more documentation."]
pub const COLOR_SIDE_PANEL_COMMERCE_GRAPH_AXIS: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCommerceGraphAxis);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCommerceGraphBubbleBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_COMMERCE_GRAPH_BUBBLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCommerceGraphBubbleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCommerceGraphLine`] for more documentation."]
pub const COLOR_SIDE_PANEL_COMMERCE_GRAPH_LINE: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCommerceGraphLine);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelContentAreaSeparator`] for more documentation."]
pub const COLOR_SIDE_PANEL_CONTENT_AREA_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorSidePanelContentAreaSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelContentBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CONTENT_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelContentBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeClassicChromeTileBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_CLASSIC_CHROME_TILE_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeClassicChromeTileBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeCornerNtpBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_CORNER_NTP_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeCornerNtpBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeCustomOptionBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_CUSTOM_OPTION_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeCustomOptionBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeCustomOptionForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_CUSTOM_OPTION_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeCustomOptionForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpActiveTab`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_ACTIVE_TAB: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpActiveTab);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpArrowsAndRefreshButton`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_ARROWS_AND_REFRESH_BUTTON: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpArrowsAndRefreshButton);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpCaron`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_CARON: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpCaron);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpCaronContainer`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_CARON_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpCaronContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpChromeLogo`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_CHROME_LOGO: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpChromeLogo);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpOmnibox`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_OMNIBOX: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpOmnibox);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpTabStripBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_MINI_NTP_TAB_STRIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeMiniNtpTabStripBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_THEME_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeCheckmarkBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_THEME_CHECKMARK_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeCheckmarkBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeCheckmarkForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_THEME_CHECKMARK_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeCheckmarkForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeSnapshotBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_THEME_SNAPSHOT_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeThemeSnapshotBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelCustomizeChromeWebStoreBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_CUSTOMIZE_CHROME_WEB_STORE_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelCustomizeChromeWebStoreBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelDialogBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_DIALOG_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelDialogBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelDialogDivider`] for more documentation."]
pub const COLOR_SIDE_PANEL_DIALOG_DIVIDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelDialogDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelDialogPrimaryForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_DIALOG_PRIMARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelDialogPrimaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelDialogSecondaryForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_DIALOG_SECONDARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelDialogSecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelDivider`] for more documentation."]
pub const COLOR_SIDE_PANEL_DIVIDER: Self = Self(cef_color_id_t::CEF_ColorSidePanelDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelEditFooterBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_EDIT_FOOTER_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelEditFooterBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelComboboxEntryIcon`] for more documentation."]
pub const COLOR_SIDE_PANEL_COMBOBOX_ENTRY_ICON: Self =
Self(cef_color_id_t::CEF_ColorSidePanelComboboxEntryIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelComboboxEntryTitle`] for more documentation."]
pub const COLOR_SIDE_PANEL_COMBOBOX_ENTRY_TITLE: Self =
Self(cef_color_id_t::CEF_ColorSidePanelComboboxEntryTitle);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelEntryIcon`] for more documentation."]
pub const COLOR_SIDE_PANEL_ENTRY_ICON: Self = Self(cef_color_id_t::CEF_ColorSidePanelEntryIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelEntryDropdownIcon`] for more documentation."]
pub const COLOR_SIDE_PANEL_ENTRY_DROPDOWN_ICON: Self =
Self(cef_color_id_t::CEF_ColorSidePanelEntryDropdownIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelEntryTitle`] for more documentation."]
pub const COLOR_SIDE_PANEL_ENTRY_TITLE: Self =
Self(cef_color_id_t::CEF_ColorSidePanelEntryTitle);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelFilterChipBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_FILTER_CHIP_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelFilterChipBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelFilterChipForeground`] for more documentation."]
pub const COLOR_SIDE_PANEL_FILTER_CHIP_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelFilterChipForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelFilterChipForegroundSelected`] for more documentation."]
pub const COLOR_SIDE_PANEL_FILTER_CHIP_FOREGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorSidePanelFilterChipForegroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelFilterChipIcon`] for more documentation."]
pub const COLOR_SIDE_PANEL_FILTER_CHIP_ICON: Self =
Self(cef_color_id_t::CEF_ColorSidePanelFilterChipIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelFilterChipIconSelected`] for more documentation."]
pub const COLOR_SIDE_PANEL_FILTER_CHIP_ICON_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorSidePanelFilterChipIconSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelFilterChipBackgroundHover`] for more documentation."]
pub const COLOR_SIDE_PANEL_FILTER_CHIP_BACKGROUND_HOVER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelFilterChipBackgroundHover);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelFilterChipBackgroundSelected`] for more documentation."]
pub const COLOR_SIDE_PANEL_FILTER_CHIP_BACKGROUND_SELECTED: Self =
Self(cef_color_id_t::CEF_ColorSidePanelFilterChipBackgroundSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelHeaderButtonIcon`] for more documentation."]
pub const COLOR_SIDE_PANEL_HEADER_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorSidePanelHeaderButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelHeaderButtonIconDisabled`] for more documentation."]
pub const COLOR_SIDE_PANEL_HEADER_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorSidePanelHeaderButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelHoverResizeAreaHandle`] for more documentation."]
pub const COLOR_SIDE_PANEL_HOVER_RESIZE_AREA_HANDLE: Self =
Self(cef_color_id_t::CEF_ColorSidePanelHoverResizeAreaHandle);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelResizeAreaHandle`] for more documentation."]
pub const COLOR_SIDE_PANEL_RESIZE_AREA_HANDLE: Self =
Self(cef_color_id_t::CEF_ColorSidePanelResizeAreaHandle);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelScrollbarThumb`] for more documentation."]
pub const COLOR_SIDE_PANEL_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorSidePanelScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelTextfieldBorder`] for more documentation."]
pub const COLOR_SIDE_PANEL_TEXTFIELD_BORDER: Self =
Self(cef_color_id_t::CEF_ColorSidePanelTextfieldBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelWallpaperSearchTileBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_WALLPAPER_SEARCH_TILE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelWallpaperSearchTileBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelWallpaperSearchErrorButtonBackground`] for more documentation."]
pub const COLOR_SIDE_PANEL_WALLPAPER_SEARCH_ERROR_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSidePanelWallpaperSearchErrorButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelWallpaperSearchErrorButtonText`] for more documentation."]
pub const COLOR_SIDE_PANEL_WALLPAPER_SEARCH_ERROR_BUTTON_TEXT: Self =
Self(cef_color_id_t::CEF_ColorSidePanelWallpaperSearchErrorButtonText);
#[doc = "See [`cef_color_id_t::CEF_ColorSidePanelWallpaperSearchInspirationDescriptors`] for more documentation."]
pub const COLOR_SIDE_PANEL_WALLPAPER_SEARCH_INSPIRATION_DESCRIPTORS: Self =
Self(cef_color_id_t::CEF_ColorSidePanelWallpaperSearchInspirationDescriptors);
#[doc = "See [`cef_color_id_t::CEF_ColorSplitViewBackground`] for more documentation."]
pub const COLOR_SPLIT_VIEW_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorSplitViewBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorStarRatingFullIcon`] for more documentation."]
pub const COLOR_STAR_RATING_FULL_ICON: Self = Self(cef_color_id_t::CEF_ColorStarRatingFullIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorStarRatingEmptyIcon`] for more documentation."]
pub const COLOR_STAR_RATING_EMPTY_ICON: Self =
Self(cef_color_id_t::CEF_ColorStarRatingEmptyIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorStatusBubbleBackgroundFrameActive`] for more documentation."]
pub const COLOR_STATUS_BUBBLE_BACKGROUND_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorStatusBubbleBackgroundFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorStatusBubbleBackgroundFrameInactive`] for more documentation."]
pub const COLOR_STATUS_BUBBLE_BACKGROUND_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorStatusBubbleBackgroundFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorStatusBubbleForegroundFrameActive`] for more documentation."]
pub const COLOR_STATUS_BUBBLE_FOREGROUND_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorStatusBubbleForegroundFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorStatusBubbleForegroundFrameInactive`] for more documentation."]
pub const COLOR_STATUS_BUBBLE_FOREGROUND_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorStatusBubbleForegroundFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorStatusBubbleShadow`] for more documentation."]
pub const COLOR_STATUS_BUBBLE_SHADOW: Self = Self(cef_color_id_t::CEF_ColorStatusBubbleShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertAudioPlayingActiveFrameActive`] for more documentation."]
pub const COLOR_TAB_ALERT_AUDIO_PLAYING_ACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertAudioPlayingActiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertAudioPlayingActiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_ALERT_AUDIO_PLAYING_ACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertAudioPlayingActiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertAudioPlayingInactiveFrameActive`] for more documentation."]
pub const COLOR_TAB_ALERT_AUDIO_PLAYING_INACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertAudioPlayingInactiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertAudioPlayingInactiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_ALERT_AUDIO_PLAYING_INACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertAudioPlayingInactiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertMediaRecordingActiveFrameActive`] for more documentation."]
pub const COLOR_TAB_ALERT_MEDIA_RECORDING_ACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertMediaRecordingActiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertMediaRecordingActiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_ALERT_MEDIA_RECORDING_ACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertMediaRecordingActiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertMediaRecordingInactiveFrameActive`] for more documentation."]
pub const COLOR_TAB_ALERT_MEDIA_RECORDING_INACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertMediaRecordingInactiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertMediaRecordingInactiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_ALERT_MEDIA_RECORDING_INACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertMediaRecordingInactiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertPipPlayingActiveFrameActive`] for more documentation."]
pub const COLOR_TAB_ALERT_PIP_PLAYING_ACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertPipPlayingActiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertPipPlayingActiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_ALERT_PIP_PLAYING_ACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertPipPlayingActiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertPipPlayingInactiveFrameActive`] for more documentation."]
pub const COLOR_TAB_ALERT_PIP_PLAYING_INACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertPipPlayingInactiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabAlertPipPlayingInactiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_ALERT_PIP_PLAYING_INACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabAlertPipPlayingInactiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorHoverCardTabAlertMediaRecordingIcon`] for more documentation."]
pub const COLOR_HOVER_CARD_TAB_ALERT_MEDIA_RECORDING_ICON: Self =
Self(cef_color_id_t::CEF_ColorHoverCardTabAlertMediaRecordingIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorHoverCardTabAlertPipPlayingIcon`] for more documentation."]
pub const COLOR_HOVER_CARD_TAB_ALERT_PIP_PLAYING_ICON: Self =
Self(cef_color_id_t::CEF_ColorHoverCardTabAlertPipPlayingIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorHoverCardTabAlertAudioPlayingIcon`] for more documentation."]
pub const COLOR_HOVER_CARD_TAB_ALERT_AUDIO_PLAYING_ICON: Self =
Self(cef_color_id_t::CEF_ColorHoverCardTabAlertAudioPlayingIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundActiveFrameActive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_ACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundActiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundActiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_ACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundActiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundInactiveFrameActive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_INACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundInactiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundInactiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_INACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundInactiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundInactiveHoverFrameActive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_INACTIVE_HOVER_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundInactiveHoverFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundInactiveHoverFrameInactive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_INACTIVE_HOVER_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundInactiveHoverFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundSelectedFrameActive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_SELECTED_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundSelectedFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundSelectedFrameInactive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_SELECTED_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundSelectedFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundSelectedHoverFrameActive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_SELECTED_HOVER_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundSelectedHoverFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabBackgroundSelectedHoverFrameInactive`] for more documentation."]
pub const COLOR_TAB_BACKGROUND_SELECTED_HOVER_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabBackgroundSelectedHoverFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabCloseButtonFocusRingActive`] for more documentation."]
pub const COLOR_TAB_CLOSE_BUTTON_FOCUS_RING_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabCloseButtonFocusRingActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabCloseButtonFocusRingInactive`] for more documentation."]
pub const COLOR_TAB_CLOSE_BUTTON_FOCUS_RING_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabCloseButtonFocusRingInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabDiscardRingFrameActive`] for more documentation."]
pub const COLOR_TAB_DISCARD_RING_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabDiscardRingFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabDiscardRingFrameInactive`] for more documentation."]
pub const COLOR_TAB_DISCARD_RING_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabDiscardRingFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabFocusRingActive`] for more documentation."]
pub const COLOR_TAB_FOCUS_RING_ACTIVE: Self = Self(cef_color_id_t::CEF_ColorTabFocusRingActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabFocusRingInactive`] for more documentation."]
pub const COLOR_TAB_FOCUS_RING_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabFocusRingInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabForegroundActiveFrameActive`] for more documentation."]
pub const COLOR_TAB_FOREGROUND_ACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabForegroundActiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabForegroundActiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_FOREGROUND_ACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabForegroundActiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabForegroundInactiveFrameActive`] for more documentation."]
pub const COLOR_TAB_FOREGROUND_INACTIVE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabForegroundInactiveFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabForegroundInactiveFrameInactive`] for more documentation."]
pub const COLOR_TAB_FOREGROUND_INACTIVE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabForegroundInactiveFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabDividerFrameActive`] for more documentation."]
pub const COLOR_TAB_DIVIDER_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabDividerFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabDividerFrameInactive`] for more documentation."]
pub const COLOR_TAB_DIVIDER_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabDividerFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabHoverCardBackground`] for more documentation."]
pub const COLOR_TAB_HOVER_CARD_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabHoverCardBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabHoverCardForeground`] for more documentation."]
pub const COLOR_TAB_HOVER_CARD_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabHoverCardForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabHoverCardSecondaryText`] for more documentation."]
pub const COLOR_TAB_HOVER_CARD_SECONDARY_TEXT: Self =
Self(cef_color_id_t::CEF_ColorTabHoverCardSecondaryText);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarGrey`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_GREY: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarBlue`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_BLUE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarRed`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_RED: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarRed);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarYellow`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarGreen`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_GREEN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarPink`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_PINK: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarPink);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarPurple`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarPurple);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarCyan`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_CYAN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupBookmarkBarOrange`] for more documentation."]
pub const COLOR_TAB_GROUP_BOOKMARK_BAR_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupBookmarkBarOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuBlue`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_BLUE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuCyan`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_CYAN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuGreen`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_GREEN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuGrey`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_GREY: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuOrange`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuPink`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_PINK: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuPink);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuPurple`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuPurple);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuRed`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_RED: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuRed);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupContextMenuYellow`] for more documentation."]
pub const COLOR_TAB_GROUP_CONTEXT_MENU_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorTabGroupContextMenuYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogGrey`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_GREY: Self = Self(cef_color_id_t::CEF_ColorTabGroupDialogGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogBlue`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_BLUE: Self = Self(cef_color_id_t::CEF_ColorTabGroupDialogBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogRed`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_RED: Self = Self(cef_color_id_t::CEF_ColorTabGroupDialogRed);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogYellow`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorTabGroupDialogYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogGreen`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_GREEN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupDialogGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogPink`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_PINK: Self = Self(cef_color_id_t::CEF_ColorTabGroupDialogPink);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogPurple`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupDialogPurple);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogCyan`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_CYAN: Self = Self(cef_color_id_t::CEF_ColorTabGroupDialogCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogOrange`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupDialogOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupDialogIconEnabled`] for more documentation."]
pub const COLOR_TAB_GROUP_DIALOG_ICON_ENABLED: Self =
Self(cef_color_id_t::CEF_ColorTabGroupDialogIconEnabled);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveGrey`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_GREY: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveBlue`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_BLUE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveRed`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_RED: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveRed);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveYellow`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveGreen`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_GREEN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActivePink`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_PINK: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActivePink);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActivePurple`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActivePurple);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveCyan`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_CYAN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveOrange`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_ACTIVE_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameActiveOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveGrey`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_GREY: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveBlue`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_BLUE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveRed`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_RED: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveRed);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveYellow`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveGreen`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_GREEN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactivePink`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_PINK: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactivePink);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactivePurple`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactivePurple);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveCyan`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_CYAN: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveOrange`] for more documentation."]
pub const COLOR_TAB_GROUP_TAB_STRIP_FRAME_INACTIVE_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorTabGroupTabStripFrameInactiveOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorTabStrokeFrameActive`] for more documentation."]
pub const COLOR_TAB_STROKE_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabStrokeFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabStrokeFrameInactive`] for more documentation."]
pub const COLOR_TAB_STROKE_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabStrokeFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabstripLoadingProgressBackground`] for more documentation."]
pub const COLOR_TABSTRIP_LOADING_PROGRESS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabstripLoadingProgressBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabstripLoadingProgressForeground`] for more documentation."]
pub const COLOR_TABSTRIP_LOADING_PROGRESS_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabstripLoadingProgressForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabstripScrollContainerShadow`] for more documentation."]
pub const COLOR_TABSTRIP_SCROLL_CONTAINER_SHADOW: Self =
Self(cef_color_id_t::CEF_ColorTabstripScrollContainerShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorTabThrobber`] for more documentation."]
pub const COLOR_TAB_THROBBER: Self = Self(cef_color_id_t::CEF_ColorTabThrobber);
#[doc = "See [`cef_color_id_t::CEF_ColorTabThrobberPreconnect`] for more documentation."]
pub const COLOR_TAB_THROBBER_PRECONNECT: Self =
Self(cef_color_id_t::CEF_ColorTabThrobberPreconnect);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchButtonBackground`] for more documentation."]
pub const COLOR_TAB_SEARCH_BUTTON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabSearchButtonBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchButtonIcon`] for more documentation."]
pub const COLOR_TAB_SEARCH_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorTabSearchButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchButtonIconBackground`] for more documentation."]
pub const COLOR_TAB_SEARCH_BUTTON_ICON_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabSearchButtonIconBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchBackground`] for more documentation."]
pub const COLOR_TAB_SEARCH_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabSearchBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchButtonCRForegroundFrameActive`] for more documentation."]
pub const COLOR_TAB_SEARCH_BUTTON_CR_FOREGROUND_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabSearchButtonCRForegroundFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchButtonCRForegroundFrameInactive`] for more documentation."]
pub const COLOR_TAB_SEARCH_BUTTON_CR_FOREGROUND_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorTabSearchButtonCRForegroundFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchCardBackground`] for more documentation."]
pub const COLOR_TAB_SEARCH_CARD_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabSearchCardBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchDisabled`] for more documentation."]
pub const COLOR_TAB_SEARCH_DISABLED: Self = Self(cef_color_id_t::CEF_ColorTabSearchDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchDisabledContainer`] for more documentation."]
pub const COLOR_TAB_SEARCH_DISABLED_CONTAINER: Self =
Self(cef_color_id_t::CEF_ColorTabSearchDisabledContainer);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchDivider`] for more documentation."]
pub const COLOR_TAB_SEARCH_DIVIDER: Self = Self(cef_color_id_t::CEF_ColorTabSearchDivider);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchFooterBackground`] for more documentation."]
pub const COLOR_TAB_SEARCH_FOOTER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabSearchFooterBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchImageTabContentBottom`] for more documentation."]
pub const COLOR_TAB_SEARCH_IMAGE_TAB_CONTENT_BOTTOM: Self =
Self(cef_color_id_t::CEF_ColorTabSearchImageTabContentBottom);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchImageTabContentTop`] for more documentation."]
pub const COLOR_TAB_SEARCH_IMAGE_TAB_CONTENT_TOP: Self =
Self(cef_color_id_t::CEF_ColorTabSearchImageTabContentTop);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchImageTabText`] for more documentation."]
pub const COLOR_TAB_SEARCH_IMAGE_TAB_TEXT: Self =
Self(cef_color_id_t::CEF_ColorTabSearchImageTabText);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchImageWindowFrame`] for more documentation."]
pub const COLOR_TAB_SEARCH_IMAGE_WINDOW_FRAME: Self =
Self(cef_color_id_t::CEF_ColorTabSearchImageWindowFrame);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchMediaIcon`] for more documentation."]
pub const COLOR_TAB_SEARCH_MEDIA_ICON: Self = Self(cef_color_id_t::CEF_ColorTabSearchMediaIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchMediaRecordingIcon`] for more documentation."]
pub const COLOR_TAB_SEARCH_MEDIA_RECORDING_ICON: Self =
Self(cef_color_id_t::CEF_ColorTabSearchMediaRecordingIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchMediaGlicActiveIcon`] for more documentation."]
pub const COLOR_TAB_SEARCH_MEDIA_GLIC_ACTIVE_ICON: Self =
Self(cef_color_id_t::CEF_ColorTabSearchMediaGlicActiveIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchPrimaryForeground`] for more documentation."]
pub const COLOR_TAB_SEARCH_PRIMARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabSearchPrimaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchSecondaryForeground`] for more documentation."]
pub const COLOR_TAB_SEARCH_SECONDARY_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorTabSearchSecondaryForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchSelected`] for more documentation."]
pub const COLOR_TAB_SEARCH_SELECTED: Self = Self(cef_color_id_t::CEF_ColorTabSearchSelected);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchScrollbarThumb`] for more documentation."]
pub const COLOR_TAB_SEARCH_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorTabSearchScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerBackground`] for more documentation."]
pub const COLOR_TASK_MANAGER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerTableBackground`] for more documentation."]
pub const COLOR_TASK_MANAGER_TABLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerTableBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerTableBackgroundAlternate`] for more documentation."]
pub const COLOR_TASK_MANAGER_TABLE_BACKGROUND_ALTERNATE: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerTableBackgroundAlternate);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerTableBackgroundSelectedFocused`] for more documentation."]
pub const COLOR_TASK_MANAGER_TABLE_BACKGROUND_SELECTED_FOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerTableBackgroundSelectedFocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerTableBackgroundSelectedUnfocused`] for more documentation."]
pub const COLOR_TASK_MANAGER_TABLE_BACKGROUND_SELECTED_UNFOCUSED: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerTableBackgroundSelectedUnfocused);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerTableHeaderBackground`] for more documentation."]
pub const COLOR_TASK_MANAGER_TABLE_HEADER_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerTableHeaderBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerSearchBarBackground`] for more documentation."]
pub const COLOR_TASK_MANAGER_SEARCH_BAR_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerSearchBarBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerSearchBarTransparent`] for more documentation."]
pub const COLOR_TASK_MANAGER_SEARCH_BAR_TRANSPARENT: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerSearchBarTransparent);
#[doc = "See [`cef_color_id_t::CEF_ColorTaskManagerSearchBarPlaceholderText`] for more documentation."]
pub const COLOR_TASK_MANAGER_SEARCH_BAR_PLACEHOLDER_TEXT: Self =
Self(cef_color_id_t::CEF_ColorTaskManagerSearchBarPlaceholderText);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabBackground`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabForeground`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripBackgroundActive`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_BACKGROUND_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripBackgroundActive);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripBackgroundInactive`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_BACKGROUND_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripBackgroundInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveGrey`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_GREY: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveBlue`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_BLUE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveRed`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_RED: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveRed);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveYellow`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveGreen`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_GREEN: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActivePink`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_PINK: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActivePink);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActivePurple`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActivePurple);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveCyan`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_CYAN: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveOrange`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_ACTIVE_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameActiveOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveGrey`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_GREY: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveGrey);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveBlue`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_BLUE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveBlue);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveRed`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_RED: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveRed);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveYellow`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_YELLOW: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveYellow);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveGreen`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_GREEN: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveGreen);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactivePink`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_PINK: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactivePink);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactivePurple`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_PURPLE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactivePurple);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveCyan`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_CYAN: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveCyan);
#[doc = "See [`cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveOrange`] for more documentation."]
pub const COLOR_THUMBNAIL_TAB_STRIP_TAB_GROUP_FRAME_INACTIVE_ORANGE: Self =
Self(cef_color_id_t::CEF_ColorThumbnailTabStripTabGroupFrameInactiveOrange);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbar`] for more documentation."]
pub const COLOR_TOOLBAR: Self = Self(cef_color_id_t::CEF_ColorToolbar);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarBackgroundSubtleEmphasis`] for more documentation."]
pub const COLOR_TOOLBAR_BACKGROUND_SUBTLE_EMPHASIS: Self =
Self(cef_color_id_t::CEF_ColorToolbarBackgroundSubtleEmphasis);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarBackgroundSubtleEmphasisHovered`] for more documentation."]
pub const COLOR_TOOLBAR_BACKGROUND_SUBTLE_EMPHASIS_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorToolbarBackgroundSubtleEmphasisHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonBackgroundHighlightedDefault`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_BACKGROUND_HIGHLIGHTED_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorToolbarButtonBackgroundHighlightedDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonBorder`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_BORDER: Self =
Self(cef_color_id_t::CEF_ColorToolbarButtonBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonIcon`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_ICON: Self = Self(cef_color_id_t::CEF_ColorToolbarButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonIconDefault`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_ICON_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorToolbarButtonIconDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonIconDisabled`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorToolbarButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonIconHovered`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_ICON_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorToolbarButtonIconHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonIconInactive`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_ICON_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorToolbarButtonIconInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonIconPressed`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_ICON_PRESSED: Self =
Self(cef_color_id_t::CEF_ColorToolbarButtonIconPressed);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarButtonText`] for more documentation."]
pub const COLOR_TOOLBAR_BUTTON_TEXT: Self = Self(cef_color_id_t::CEF_ColorToolbarButtonText);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarCloseButtonBackgroundDefault`] for more documentation."]
pub const COLOR_TOOLBAR_CLOSE_BUTTON_BACKGROUND_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorToolbarCloseButtonBackgroundDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarContentAreaSeparator`] for more documentation."]
pub const COLOR_TOOLBAR_CONTENT_AREA_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorToolbarContentAreaSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarExtensionSeparatorDisabled`] for more documentation."]
pub const COLOR_TOOLBAR_EXTENSION_SEPARATOR_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorToolbarExtensionSeparatorDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarExtensionSeparatorEnabled`] for more documentation."]
pub const COLOR_TOOLBAR_EXTENSION_SEPARATOR_ENABLED: Self =
Self(cef_color_id_t::CEF_ColorToolbarExtensionSeparatorEnabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarFeaturePromoHighlight`] for more documentation."]
pub const COLOR_TOOLBAR_FEATURE_PROMO_HIGHLIGHT: Self =
Self(cef_color_id_t::CEF_ColorToolbarFeaturePromoHighlight);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarGlicButtonBackgroundDefault`] for more documentation."]
pub const COLOR_TOOLBAR_GLIC_BUTTON_BACKGROUND_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorToolbarGlicButtonBackgroundDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarIconContainerBorder`] for more documentation."]
pub const COLOR_TOOLBAR_ICON_CONTAINER_BORDER: Self =
Self(cef_color_id_t::CEF_ColorToolbarIconContainerBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarInkDrop`] for more documentation."]
pub const COLOR_TOOLBAR_INK_DROP: Self = Self(cef_color_id_t::CEF_ColorToolbarInkDrop);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarInkDropHover`] for more documentation."]
pub const COLOR_TOOLBAR_INK_DROP_HOVER: Self =
Self(cef_color_id_t::CEF_ColorToolbarInkDropHover);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarInkDropRipple`] for more documentation."]
pub const COLOR_TOOLBAR_INK_DROP_RIPPLE: Self =
Self(cef_color_id_t::CEF_ColorToolbarInkDropRipple);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSeparator`] for more documentation."]
pub const COLOR_TOOLBAR_SEPARATOR: Self = Self(cef_color_id_t::CEF_ColorToolbarSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarActionItemEngaged`] for more documentation."]
pub const COLOR_TOOLBAR_ACTION_ITEM_ENGAGED: Self =
Self(cef_color_id_t::CEF_ColorToolbarActionItemEngaged);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarSeparatorDefault`] for more documentation."]
pub const COLOR_TOOLBAR_SEPARATOR_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorToolbarSeparatorDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarText`] for more documentation."]
pub const COLOR_TOOLBAR_TEXT: Self = Self(cef_color_id_t::CEF_ColorToolbarText);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarTextDefault`] for more documentation."]
pub const COLOR_TOOLBAR_TEXT_DEFAULT: Self = Self(cef_color_id_t::CEF_ColorToolbarTextDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarTextDisabled`] for more documentation."]
pub const COLOR_TOOLBAR_TEXT_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorToolbarTextDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarTextDisabledDefault`] for more documentation."]
pub const COLOR_TOOLBAR_TEXT_DISABLED_DEFAULT: Self =
Self(cef_color_id_t::CEF_ColorToolbarTextDisabledDefault);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarTopSeparatorFrameActive`] for more documentation."]
pub const COLOR_TOOLBAR_TOP_SEPARATOR_FRAME_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorToolbarTopSeparatorFrameActive);
#[doc = "See [`cef_color_id_t::CEF_ColorToolbarTopSeparatorFrameInactive`] for more documentation."]
pub const COLOR_TOOLBAR_TOP_SEPARATOR_FRAME_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorToolbarTopSeparatorFrameInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorVerticalTabStripShadow`] for more documentation."]
pub const COLOR_VERTICAL_TAB_STRIP_SHADOW: Self =
Self(cef_color_id_t::CEF_ColorVerticalTabStripShadow);
#[doc = "See [`cef_color_id_t::CEF_ColorVerticalTabPinnedOutline`] for more documentation."]
pub const COLOR_VERTICAL_TAB_PINNED_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorVerticalTabPinnedOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnHoverButtonForeground`] for more documentation."]
pub const COLOR_WEB_AUTHN_HOVER_BUTTON_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnHoverButtonForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnHoverButtonForegroundDisabled`] for more documentation."]
pub const COLOR_WEB_AUTHN_HOVER_BUTTON_FOREGROUND_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnHoverButtonForegroundDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnBackArrowButtonIcon`] for more documentation."]
pub const COLOR_WEB_AUTHN_BACK_ARROW_BUTTON_ICON: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnBackArrowButtonIcon);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnBackArrowButtonIconDisabled`] for more documentation."]
pub const COLOR_WEB_AUTHN_BACK_ARROW_BUTTON_ICON_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnBackArrowButtonIconDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnIconColor`] for more documentation."]
pub const COLOR_WEB_AUTHN_ICON_COLOR: Self = Self(cef_color_id_t::CEF_ColorWebAuthnIconColor);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnIconColorDisabled`] for more documentation."]
pub const COLOR_WEB_AUTHN_ICON_COLOR_DISABLED: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnIconColorDisabled);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnPinTextfieldBottomBorder`] for more documentation."]
pub const COLOR_WEB_AUTHN_PIN_TEXTFIELD_BOTTOM_BORDER: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnPinTextfieldBottomBorder);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnProgressRingBackground`] for more documentation."]
pub const COLOR_WEB_AUTHN_PROGRESS_RING_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnProgressRingBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebAuthnProgressRingForeground`] for more documentation."]
pub const COLOR_WEB_AUTHN_PROGRESS_RING_FOREGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebAuthnProgressRingForeground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebContentsBackground`] for more documentation."]
pub const COLOR_WEB_CONTENTS_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebContentsBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebContentsBackgroundLetterboxing`] for more documentation."]
pub const COLOR_WEB_CONTENTS_BACKGROUND_LETTERBOXING: Self =
Self(cef_color_id_t::CEF_ColorWebContentsBackgroundLetterboxing);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripBackground`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripFocusOutline`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_FOCUS_OUTLINE: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripFocusOutline);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripIndicatorCapturing`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_INDICATOR_CAPTURING: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripIndicatorCapturing);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripIndicatorPip`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_INDICATOR_PIP: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripIndicatorPip);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripIndicatorRecording`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_INDICATOR_RECORDING: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripIndicatorRecording);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripScrollbarThumb`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_SCROLLBAR_THUMB: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripScrollbarThumb);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabActiveTitleBackground`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_ACTIVE_TITLE_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabActiveTitleBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabActiveTitleContent`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_ACTIVE_TITLE_CONTENT: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabActiveTitleContent);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabBackground`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_BACKGROUND: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabBackground);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabBlocked`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_BLOCKED: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabBlocked);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabLoadingSpinning`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_LOADING_SPINNING: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabLoadingSpinning);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabSeparator`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_SEPARATOR: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabSeparator);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabText`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_TEXT: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabText);
#[doc = "See [`cef_color_id_t::CEF_ColorWebUiTabStripTabWaitingSpinning`] for more documentation."]
pub const COLOR_WEB_UI_TAB_STRIP_TAB_WAITING_SPINNING: Self =
Self(cef_color_id_t::CEF_ColorWebUiTabStripTabWaitingSpinning);
#[doc = "See [`cef_color_id_t::CEF_ColorWindowControlButtonBackgroundActive`] for more documentation."]
pub const COLOR_WINDOW_CONTROL_BUTTON_BACKGROUND_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorWindowControlButtonBackgroundActive);
#[doc = "See [`cef_color_id_t::CEF_ColorWindowControlButtonBackgroundInactive`] for more documentation."]
pub const COLOR_WINDOW_CONTROL_BUTTON_BACKGROUND_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorWindowControlButtonBackgroundInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorAccentBorderActive`] for more documentation."]
pub const COLOR_ACCENT_BORDER_ACTIVE: Self = Self(cef_color_id_t::CEF_ColorAccentBorderActive);
#[doc = "See [`cef_color_id_t::CEF_ColorAccentBorderInactive`] for more documentation."]
pub const COLOR_ACCENT_BORDER_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorAccentBorderInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionButtonForegroundActive`] for more documentation."]
pub const COLOR_CAPTION_BUTTON_FOREGROUND_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorCaptionButtonForegroundActive);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionButtonForegroundInactive`] for more documentation."]
pub const COLOR_CAPTION_BUTTON_FOREGROUND_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorCaptionButtonForegroundInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionButtonOnToolbar`] for more documentation."]
pub const COLOR_CAPTION_BUTTON_ON_TOOLBAR: Self =
Self(cef_color_id_t::CEF_ColorCaptionButtonOnToolbar);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionCloseButtonBackgroundHovered`] for more documentation."]
pub const COLOR_CAPTION_CLOSE_BUTTON_BACKGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorCaptionCloseButtonBackgroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionCloseButtonForegroundHovered`] for more documentation."]
pub const COLOR_CAPTION_CLOSE_BUTTON_FOREGROUND_HOVERED: Self =
Self(cef_color_id_t::CEF_ColorCaptionCloseButtonForegroundHovered);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionForegroundActive`] for more documentation."]
pub const COLOR_CAPTION_FOREGROUND_ACTIVE: Self =
Self(cef_color_id_t::CEF_ColorCaptionForegroundActive);
#[doc = "See [`cef_color_id_t::CEF_ColorCaptionForegroundInactive`] for more documentation."]
pub const COLOR_CAPTION_FOREGROUND_INACTIVE: Self =
Self(cef_color_id_t::CEF_ColorCaptionForegroundInactive);
#[doc = "See [`cef_color_id_t::CEF_ColorTabSearchCaptionButtonFocusRing`] for more documentation."]
pub const COLOR_TAB_SEARCH_CAPTION_BUTTON_FOCUS_RING: Self =
Self(cef_color_id_t::CEF_ColorTabSearchCaptionButtonFocusRing);
#[doc = "See [`cef_color_id_t::CEF_ChromeColorsEnd`] for more documentation."]
pub const CHROME_COLORS_END: Self = Self(cef_color_id_t::CEF_ChromeColorsEnd);
#[doc = "See [`cef_color_id_t::CEF_UiColorsLast`] for more documentation."]
pub const UI_COLORS_LAST: Self = Self(cef_color_id_t::CEF_UiColorsLast);
}
impl ColorId {
#[doc = "Get the raw integer representation."]
pub fn get_raw(&self) -> i32 {
self.0 as i32
}
}
impl Default for ColorId {
fn default() -> Self {
Self(cef_color_id_t::CEF_UiColorsStart)
}
}
/// See [`cef_api_hash`] for more documentation.
pub fn api_hash(
version: ::std::os::raw::c_int,
entry: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char {
unsafe {
let (arg_version, arg_entry) = (version, entry);
let result = cef_api_hash(arg_version, arg_entry);
result.wrap_result()
}
}
/// See [`cef_api_version`] for more documentation.
pub fn api_version() -> ::std::os::raw::c_int {
unsafe {
let result = cef_api_version();
result.wrap_result()
}
}
/// See [`cef_string_wide_set`] for more documentation.
pub fn string_wide_set(
src: Option<&[wchar_t]>,
output: Option<&mut CefStringWide>,
copy: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output, arg_copy) = (src, output, copy);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_wide_set(arg_src, arg_src_len, arg_output, arg_copy);
result.wrap_result()
}
}
/// See [`cef_string_utf8_set`] for more documentation.
pub fn string_utf8_set(
src: Option<&[::std::os::raw::c_char]>,
output: Option<&mut CefStringUtf8>,
copy: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output, arg_copy) = (src, output, copy);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf8_set(arg_src, arg_src_len, arg_output, arg_copy);
result.wrap_result()
}
}
/// See [`cef_string_utf16_set`] for more documentation.
pub fn string_utf16_set(
src: Option<&[char16_t]>,
output: Option<&mut CefStringUtf16>,
copy: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output, arg_copy) = (src, output, copy);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf16_set(arg_src, arg_src_len, arg_output, arg_copy);
result.wrap_result()
}
}
/// See [`cef_string_wide_clear`] for more documentation.
pub fn string_wide_clear(str_: Option<&mut CefStringWide>) {
unsafe {
let arg_str_ = str_;
let arg_str_ = arg_str_
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_wide_clear(arg_str_);
}
}
/// See [`cef_string_utf8_clear`] for more documentation.
pub fn string_utf8_clear(str_: Option<&mut CefStringUtf8>) {
unsafe {
let arg_str_ = str_;
let arg_str_ = arg_str_
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_utf8_clear(arg_str_);
}
}
/// See [`cef_string_utf16_clear`] for more documentation.
pub fn string_utf16_clear(str_: Option<&mut CefStringUtf16>) {
unsafe {
let arg_str_ = str_;
let arg_str_ = arg_str_
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_utf16_clear(arg_str_);
}
}
/// See [`cef_string_wide_cmp`] for more documentation.
pub fn string_wide_cmp(
str_1: Option<&CefStringWide>,
str_2: Option<&CefStringWide>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_str_1, arg_str_2) = (str_1, str_2);
let arg_str_1 = arg_str_1
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_str_2 = arg_str_2
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_string_wide_cmp(arg_str_1, arg_str_2);
result.wrap_result()
}
}
/// See [`cef_string_utf8_cmp`] for more documentation.
pub fn string_utf8_cmp(
str_1: Option<&CefStringUtf8>,
str_2: Option<&CefStringUtf8>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_str_1, arg_str_2) = (str_1, str_2);
let arg_str_1 = arg_str_1
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_str_2 = arg_str_2
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_string_utf8_cmp(arg_str_1, arg_str_2);
result.wrap_result()
}
}
/// See [`cef_string_utf16_cmp`] for more documentation.
pub fn string_utf16_cmp(
str_1: Option<&CefStringUtf16>,
str_2: Option<&CefStringUtf16>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_str_1, arg_str_2) = (str_1, str_2);
let arg_str_1 = arg_str_1
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_str_2 = arg_str_2
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_string_utf16_cmp(arg_str_1, arg_str_2);
result.wrap_result()
}
}
/// See [`cef_string_wide_to_utf8`] for more documentation.
pub fn string_wide_to_utf8(
src: Option<&[wchar_t]>,
output: Option<&mut CefStringUtf8>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_wide_to_utf8(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_utf8_to_wide`] for more documentation.
pub fn string_utf8_to_wide(
src: Option<&[::std::os::raw::c_char]>,
output: Option<&mut CefStringWide>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf8_to_wide(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_wide_to_utf16`] for more documentation.
pub fn string_wide_to_utf16(
src: Option<&[wchar_t]>,
output: Option<&mut CefStringUtf16>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_wide_to_utf16(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_utf16_to_wide`] for more documentation.
pub fn string_utf16_to_wide(
src: Option<&[char16_t]>,
output: Option<&mut CefStringWide>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf16_to_wide(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_utf8_to_utf16`] for more documentation.
pub fn string_utf8_to_utf16(
src: Option<&[::std::os::raw::c_char]>,
output: Option<&mut CefStringUtf16>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf8_to_utf16(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_utf16_to_utf8`] for more documentation.
pub fn string_utf16_to_utf8(
src: Option<&[char16_t]>,
output: Option<&mut CefStringUtf8>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf16_to_utf8(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_ascii_to_wide`] for more documentation.
pub fn string_ascii_to_wide(
src: Option<&[::std::os::raw::c_char]>,
output: Option<&mut CefStringWide>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_ascii_to_wide(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_ascii_to_utf16`] for more documentation.
pub fn string_ascii_to_utf16(
src: Option<&[::std::os::raw::c_char]>,
output: Option<&mut CefStringUtf16>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_ascii_to_utf16(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_userfree_wide_alloc`] for more documentation.
pub fn string_userfree_wide_alloc() -> CefStringUserfreeWide {
unsafe {
let result = cef_string_userfree_wide_alloc();
result.wrap_result()
}
}
/// See [`cef_string_userfree_utf8_alloc`] for more documentation.
pub fn string_userfree_utf8_alloc() -> CefStringUserfreeUtf8 {
unsafe {
let result = cef_string_userfree_utf8_alloc();
result.wrap_result()
}
}
/// See [`cef_string_userfree_utf16_alloc`] for more documentation.
pub fn string_userfree_utf16_alloc() -> CefStringUserfreeUtf16 {
unsafe {
let result = cef_string_userfree_utf16_alloc();
result.wrap_result()
}
}
/// See [`cef_string_userfree_wide_free`] for more documentation.
pub fn string_userfree_wide_free(str_: CefStringUserfreeWide) {
unsafe {
let arg_str_ = str_;
let arg_str_ = arg_str_.into_raw();
cef_string_userfree_wide_free(arg_str_);
}
}
/// See [`cef_string_userfree_utf8_free`] for more documentation.
pub fn string_userfree_utf8_free(str_: CefStringUserfreeUtf8) {
unsafe {
let arg_str_ = str_;
let arg_str_ = arg_str_.into_raw();
cef_string_userfree_utf8_free(arg_str_);
}
}
/// See [`cef_string_userfree_utf16_free`] for more documentation.
pub fn string_userfree_utf16_free(str_: CefStringUserfreeUtf16) {
unsafe {
let arg_str_ = str_;
let arg_str_ = arg_str_.into_raw();
cef_string_userfree_utf16_free(arg_str_);
}
}
/// See [`cef_string_utf16_to_lower`] for more documentation.
pub fn string_utf16_to_lower(
src: Option<&[char16_t]>,
output: Option<&mut CefStringUtf16>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf16_to_lower(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_utf16_to_upper`] for more documentation.
pub fn string_utf16_to_upper(
src: Option<&[char16_t]>,
output: Option<&mut CefStringUtf16>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src, arg_output) = (src, output);
let arg_src_len = arg_src.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_src = arg_src
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_output = arg_output
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_utf16_to_upper(arg_src, arg_src_len, arg_output);
result.wrap_result()
}
}
/// See [`cef_string_list_alloc`] for more documentation.
pub fn string_list_alloc() -> Option<CefStringList> {
unsafe {
let result = cef_string_list_alloc();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_string_list_size`] for more documentation.
pub fn string_list_size(list: Option<&mut CefStringList>) -> usize {
unsafe {
let arg_list = list;
let arg_list = arg_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_list_size(arg_list);
result.wrap_result()
}
}
/// See [`cef_string_list_value`] for more documentation.
pub fn string_list_value(
list: Option<&mut CefStringList>,
index: usize,
value: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_list, arg_index, arg_value) = (list, index, value);
let arg_list = arg_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_list_value(arg_list, arg_index, arg_value);
result.wrap_result()
}
}
/// See [`cef_string_list_append`] for more documentation.
pub fn string_list_append(list: Option<&mut CefStringList>, value: Option<&CefString>) {
unsafe {
let (arg_list, arg_value) = (list, value);
let arg_list = arg_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
cef_string_list_append(arg_list, arg_value);
}
}
/// See [`cef_string_list_clear`] for more documentation.
pub fn string_list_clear(list: Option<&mut CefStringList>) {
unsafe {
let arg_list = list;
let arg_list = arg_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_list_clear(arg_list);
}
}
/// See [`cef_string_list_free`] for more documentation.
pub fn string_list_free(list: Option<&mut CefStringList>) {
unsafe {
let arg_list = list;
let arg_list = arg_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_list_free(arg_list);
}
}
/// See [`cef_string_list_copy`] for more documentation.
pub fn string_list_copy(list: Option<&mut CefStringList>) -> Option<CefStringList> {
unsafe {
let arg_list = list;
let arg_list = arg_list
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_list_copy(arg_list);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_string_map_alloc`] for more documentation.
pub fn string_map_alloc() -> Option<CefStringMap> {
unsafe {
let result = cef_string_map_alloc();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_string_map_size`] for more documentation.
pub fn string_map_size(map: Option<&mut CefStringMap>) -> usize {
unsafe {
let arg_map = map;
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_map_size(arg_map);
result.wrap_result()
}
}
/// See [`cef_string_map_find`] for more documentation.
pub fn string_map_find(
map: Option<&mut CefStringMap>,
key: Option<&CefString>,
value: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_key, arg_value) = (map, key, value);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_map_find(arg_map, arg_key, arg_value);
result.wrap_result()
}
}
/// See [`cef_string_map_key`] for more documentation.
pub fn string_map_key(
map: Option<&mut CefStringMap>,
index: usize,
key: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_index, arg_key) = (map, index, key);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_map_key(arg_map, arg_index, arg_key);
result.wrap_result()
}
}
/// See [`cef_string_map_value`] for more documentation.
pub fn string_map_value(
map: Option<&mut CefStringMap>,
index: usize,
value: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_index, arg_value) = (map, index, value);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_map_value(arg_map, arg_index, arg_value);
result.wrap_result()
}
}
/// See [`cef_string_map_append`] for more documentation.
pub fn string_map_append(
map: Option<&mut CefStringMap>,
key: Option<&CefString>,
value: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_key, arg_value) = (map, key, value);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_string_map_append(arg_map, arg_key, arg_value);
result.wrap_result()
}
}
/// See [`cef_string_map_clear`] for more documentation.
pub fn string_map_clear(map: Option<&mut CefStringMap>) {
unsafe {
let arg_map = map;
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_map_clear(arg_map);
}
}
/// See [`cef_string_map_free`] for more documentation.
pub fn string_map_free(map: Option<&mut CefStringMap>) {
unsafe {
let arg_map = map;
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_map_free(arg_map);
}
}
/// See [`cef_string_multimap_alloc`] for more documentation.
pub fn string_multimap_alloc() -> Option<CefStringMultimap> {
unsafe {
let result = cef_string_multimap_alloc();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_string_multimap_size`] for more documentation.
pub fn string_multimap_size(map: Option<&mut CefStringMultimap>) -> usize {
unsafe {
let arg_map = map;
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_multimap_size(arg_map);
result.wrap_result()
}
}
/// See [`cef_string_multimap_find_count`] for more documentation.
pub fn string_multimap_find_count(
map: Option<&mut CefStringMultimap>,
key: Option<&CefString>,
) -> usize {
unsafe {
let (arg_map, arg_key) = (map, key);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_string_multimap_find_count(arg_map, arg_key);
result.wrap_result()
}
}
/// See [`cef_string_multimap_enumerate`] for more documentation.
pub fn string_multimap_enumerate(
map: Option<&mut CefStringMultimap>,
key: Option<&CefString>,
value_index: usize,
value: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_key, arg_value_index, arg_value) = (map, key, value_index, value);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_multimap_enumerate(arg_map, arg_key, arg_value_index, arg_value);
result.wrap_result()
}
}
/// See [`cef_string_multimap_key`] for more documentation.
pub fn string_multimap_key(
map: Option<&mut CefStringMultimap>,
index: usize,
key: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_index, arg_key) = (map, index, key);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_multimap_key(arg_map, arg_index, arg_key);
result.wrap_result()
}
}
/// See [`cef_string_multimap_value`] for more documentation.
pub fn string_multimap_value(
map: Option<&mut CefStringMultimap>,
index: usize,
value: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_index, arg_value) = (map, index, value);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_string_multimap_value(arg_map, arg_index, arg_value);
result.wrap_result()
}
}
/// See [`cef_string_multimap_append`] for more documentation.
pub fn string_multimap_append(
map: Option<&mut CefStringMultimap>,
key: Option<&CefString>,
value: Option<&CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_map, arg_key, arg_value) = (map, key, value);
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_string_multimap_append(arg_map, arg_key, arg_value);
result.wrap_result()
}
}
/// See [`cef_string_multimap_clear`] for more documentation.
pub fn string_multimap_clear(map: Option<&mut CefStringMultimap>) {
unsafe {
let arg_map = map;
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_multimap_clear(arg_map);
}
}
/// See [`cef_string_multimap_free`] for more documentation.
pub fn string_multimap_free(map: Option<&mut CefStringMultimap>) {
unsafe {
let arg_map = map;
let arg_map = arg_map
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_string_multimap_free(arg_map);
}
}
/// See [`cef_time_to_timet`] for more documentation.
pub fn time_to_timet(cef_time: Option<&Time>, time: Option<&mut time_t>) -> ::std::os::raw::c_int {
unsafe {
let (arg_cef_time, arg_time) = (cef_time, time);
let arg_cef_time = arg_cef_time.cloned().map(|arg| arg.into());
let arg_cef_time = arg_cef_time
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_time = arg_time
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_to_timet(arg_cef_time, arg_time);
result.wrap_result()
}
}
/// See [`cef_time_from_timet`] for more documentation.
pub fn time_from_timet(time: time_t, cef_time: Option<&mut Time>) -> ::std::os::raw::c_int {
unsafe {
let (arg_time, arg_cef_time) = (time, cef_time);
let mut arg_cef_time = arg_cef_time.cloned().map(|arg| arg.into());
let arg_cef_time = arg_cef_time
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_from_timet(arg_time, arg_cef_time);
result.wrap_result()
}
}
/// See [`cef_time_to_doublet`] for more documentation.
pub fn time_to_doublet(cef_time: Option<&Time>, time: Option<&mut f64>) -> ::std::os::raw::c_int {
unsafe {
let (arg_cef_time, arg_time) = (cef_time, time);
let arg_cef_time = arg_cef_time.cloned().map(|arg| arg.into());
let arg_cef_time = arg_cef_time
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_time = arg_time
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_to_doublet(arg_cef_time, arg_time);
result.wrap_result()
}
}
/// See [`cef_time_from_doublet`] for more documentation.
pub fn time_from_doublet(time: f64, cef_time: Option<&mut Time>) -> ::std::os::raw::c_int {
unsafe {
let (arg_time, arg_cef_time) = (time, cef_time);
let mut arg_cef_time = arg_cef_time.cloned().map(|arg| arg.into());
let arg_cef_time = arg_cef_time
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_from_doublet(arg_time, arg_cef_time);
result.wrap_result()
}
}
/// See [`cef_time_now`] for more documentation.
pub fn time_now(cef_time: Option<&mut Time>) -> ::std::os::raw::c_int {
unsafe {
let arg_cef_time = cef_time;
let mut arg_cef_time = arg_cef_time.cloned().map(|arg| arg.into());
let arg_cef_time = arg_cef_time
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_now(arg_cef_time);
result.wrap_result()
}
}
/// See [`cef_basetime_now`] for more documentation.
pub fn basetime_now() -> Basetime {
unsafe {
let result = cef_basetime_now();
result.wrap_result()
}
}
/// See [`cef_time_delta`] for more documentation.
pub fn time_delta(
cef_time_1: Option<&Time>,
cef_time_2: Option<&Time>,
delta: Option<&mut ::std::os::raw::c_longlong>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_cef_time_1, arg_cef_time_2, arg_delta) = (cef_time_1, cef_time_2, delta);
let arg_cef_time_1 = arg_cef_time_1.cloned().map(|arg| arg.into());
let arg_cef_time_1 = arg_cef_time_1
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_cef_time_2 = arg_cef_time_2.cloned().map(|arg| arg.into());
let arg_cef_time_2 = arg_cef_time_2
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_delta = arg_delta
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_delta(arg_cef_time_1, arg_cef_time_2, arg_delta);
result.wrap_result()
}
}
/// See [`cef_time_to_basetime`] for more documentation.
pub fn time_to_basetime(from: Option<&Time>, to: Option<&mut Basetime>) -> ::std::os::raw::c_int {
unsafe {
let (arg_from, arg_to) = (from, to);
let arg_from = arg_from.cloned().map(|arg| arg.into());
let arg_from = arg_from
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let mut arg_to = arg_to.cloned().map(|arg| arg.into());
let arg_to = arg_to
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_to_basetime(arg_from, arg_to);
result.wrap_result()
}
}
/// See [`cef_time_from_basetime`] for more documentation.
pub fn time_from_basetime(from: _cef_basetime_t, to: Option<&mut Time>) -> ::std::os::raw::c_int {
unsafe {
let (arg_from, arg_to) = (from, to);
let mut arg_to = arg_to.cloned().map(|arg| arg.into());
let arg_to = arg_to
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_time_from_basetime(arg_from, arg_to);
result.wrap_result()
}
}
/// See [`cef_value_create`] for more documentation.
pub fn value_create() -> Option<Value> {
unsafe {
let result = cef_value_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_binary_value_create`] for more documentation.
pub fn binary_value_create(data: Option<&[u8]>) -> Option<BinaryValue> {
unsafe {
let arg_data = data;
let arg_data_size = arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data = arg_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let result = cef_binary_value_create(arg_data, arg_data_size);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_dictionary_value_create`] for more documentation.
pub fn dictionary_value_create() -> Option<DictionaryValue> {
unsafe {
let result = cef_dictionary_value_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_list_value_create`] for more documentation.
pub fn list_value_create() -> Option<ListValue> {
unsafe {
let result = cef_list_value_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_image_create`] for more documentation.
pub fn image_create() -> Option<Image> {
unsafe {
let result = cef_image_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_stream_reader_create_for_file`] for more documentation.
pub fn stream_reader_create_for_file(file_name: Option<&CefString>) -> Option<StreamReader> {
unsafe {
let arg_file_name = file_name;
let arg_file_name = arg_file_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_stream_reader_create_for_file(arg_file_name);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_stream_reader_create_for_data`] for more documentation.
pub fn stream_reader_create_for_data(data: *mut u8, size: usize) -> Option<StreamReader> {
unsafe {
let (arg_data, arg_size) = (data, size);
let arg_data = arg_data.cast();
let result = cef_stream_reader_create_for_data(arg_data, arg_size);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_stream_reader_create_for_handler`] for more documentation.
pub fn stream_reader_create_for_handler(handler: Option<&mut ReadHandler>) -> Option<StreamReader> {
unsafe {
let arg_handler = handler;
let arg_handler = arg_handler
.map(|arg| {
arg.add_ref();
ImplReadHandler::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_stream_reader_create_for_handler(arg_handler);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_stream_writer_create_for_file`] for more documentation.
pub fn stream_writer_create_for_file(file_name: Option<&CefString>) -> Option<StreamWriter> {
unsafe {
let arg_file_name = file_name;
let arg_file_name = arg_file_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_stream_writer_create_for_file(arg_file_name);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_stream_writer_create_for_handler`] for more documentation.
pub fn stream_writer_create_for_handler(
handler: Option<&mut WriteHandler>,
) -> Option<StreamWriter> {
unsafe {
let arg_handler = handler;
let arg_handler = arg_handler
.map(|arg| {
arg.add_ref();
ImplWriteHandler::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_stream_writer_create_for_handler(arg_handler);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_drag_data_create`] for more documentation.
pub fn drag_data_create() -> Option<DragData> {
unsafe {
let result = cef_drag_data_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_process_message_create`] for more documentation.
pub fn process_message_create(name: Option<&CefString>) -> Option<ProcessMessage> {
unsafe {
let arg_name = name;
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_process_message_create(arg_name);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_request_create`] for more documentation.
pub fn request_create() -> Option<Request> {
unsafe {
let result = cef_request_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_post_data_create`] for more documentation.
pub fn post_data_create() -> Option<PostData> {
unsafe {
let result = cef_post_data_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_post_data_element_create`] for more documentation.
pub fn post_data_element_create() -> Option<PostDataElement> {
unsafe {
let result = cef_post_data_element_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_cookie_manager_get_global_manager`] for more documentation.
pub fn cookie_manager_get_global_manager(
callback: Option<&mut CompletionCallback>,
) -> Option<CookieManager> {
unsafe {
let arg_callback = callback;
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_cookie_manager_get_global_manager(arg_callback);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_media_router_get_global`] for more documentation.
pub fn media_router_get_global(callback: Option<&mut CompletionCallback>) -> Option<MediaRouter> {
unsafe {
let arg_callback = callback;
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_media_router_get_global(arg_callback);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_preference_manager_get_chrome_variations_as_switches`] for more documentation.
pub fn preference_manager_get_chrome_variations_as_switches(switches: Option<&mut CefStringList>) {
unsafe {
let arg_switches = switches;
let arg_switches = arg_switches
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_preference_manager_get_chrome_variations_as_switches(arg_switches);
}
}
/// See [`cef_preference_manager_get_chrome_variations_as_strings`] for more documentation.
pub fn preference_manager_get_chrome_variations_as_strings(strings: Option<&mut CefStringList>) {
unsafe {
let arg_strings = strings;
let arg_strings = arg_strings
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_preference_manager_get_chrome_variations_as_strings(arg_strings);
}
}
/// See [`cef_preference_manager_get_global`] for more documentation.
pub fn preference_manager_get_global() -> Option<PreferenceManager> {
unsafe {
let result = cef_preference_manager_get_global();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_request_context_get_global_context`] for more documentation.
pub fn request_context_get_global_context() -> Option<RequestContext> {
unsafe {
let result = cef_request_context_get_global_context();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_request_context_create_context`] for more documentation.
pub fn request_context_create_context(
settings: Option<&RequestContextSettings>,
handler: Option<&mut RequestContextHandler>,
) -> Option<RequestContext> {
unsafe {
let (arg_settings, arg_handler) = (settings, handler);
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_handler = arg_handler
.map(|arg| {
arg.add_ref();
ImplRequestContextHandler::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_request_context_create_context(arg_settings, arg_handler);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_request_context_cef_create_context_shared`] for more documentation.
pub fn request_context_cef_create_context_shared(
other: Option<&mut RequestContext>,
handler: Option<&mut RequestContextHandler>,
) -> Option<RequestContext> {
unsafe {
let (arg_other, arg_handler) = (other, handler);
let arg_other = arg_other
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_handler = arg_handler
.map(|arg| {
arg.add_ref();
ImplRequestContextHandler::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_request_context_cef_create_context_shared(arg_other, arg_handler);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_browser_host_create_browser`] for more documentation.
pub fn browser_host_create_browser(
window_info: Option<&WindowInfo>,
client: Option<&mut Client>,
url: Option<&CefString>,
settings: Option<&BrowserSettings>,
extra_info: Option<&mut DictionaryValue>,
request_context: Option<&mut RequestContext>,
) -> ::std::os::raw::c_int {
unsafe {
let (
arg_window_info,
arg_client,
arg_url,
arg_settings,
arg_extra_info,
arg_request_context,
) = (
window_info,
client,
url,
settings,
extra_info,
request_context,
);
let arg_window_info = arg_window_info.cloned().map(|arg| arg.into());
let arg_window_info = arg_window_info
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_client = arg_client
.map(|arg| {
arg.add_ref();
ImplClient::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_extra_info = arg_extra_info
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request_context = arg_request_context
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_browser_host_create_browser(
arg_window_info,
arg_client,
arg_url,
arg_settings,
arg_extra_info,
arg_request_context,
);
result.wrap_result()
}
}
/// See [`cef_browser_host_create_browser_sync`] for more documentation.
pub fn browser_host_create_browser_sync(
window_info: Option<&WindowInfo>,
client: Option<&mut Client>,
url: Option<&CefString>,
settings: Option<&BrowserSettings>,
extra_info: Option<&mut DictionaryValue>,
request_context: Option<&mut RequestContext>,
) -> Option<Browser> {
unsafe {
let (
arg_window_info,
arg_client,
arg_url,
arg_settings,
arg_extra_info,
arg_request_context,
) = (
window_info,
client,
url,
settings,
extra_info,
request_context,
);
let arg_window_info = arg_window_info.cloned().map(|arg| arg.into());
let arg_window_info = arg_window_info
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_client = arg_client
.map(|arg| {
arg.add_ref();
ImplClient::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_extra_info = arg_extra_info
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request_context = arg_request_context
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_browser_host_create_browser_sync(
arg_window_info,
arg_client,
arg_url,
arg_settings,
arg_extra_info,
arg_request_context,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_browser_host_get_browser_by_identifier`] for more documentation.
pub fn browser_host_get_browser_by_identifier(
browser_id: ::std::os::raw::c_int,
) -> Option<Browser> {
unsafe {
let arg_browser_id = browser_id;
let result = cef_browser_host_get_browser_by_identifier(arg_browser_id);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_menu_model_create`] for more documentation.
pub fn menu_model_create(delegate: Option<&mut MenuModelDelegate>) -> Option<MenuModel> {
unsafe {
let arg_delegate = delegate;
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplMenuModelDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_menu_model_create(arg_delegate);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_print_settings_create`] for more documentation.
pub fn print_settings_create() -> Option<PrintSettings> {
unsafe {
let result = cef_print_settings_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_response_create`] for more documentation.
pub fn response_create() -> Option<Response> {
unsafe {
let result = cef_response_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_is_cert_status_error`] for more documentation.
pub fn is_cert_status_error(status: CertStatus) -> ::std::os::raw::c_int {
unsafe {
let arg_status = status;
let arg_status = arg_status.into_raw();
let result = cef_is_cert_status_error(arg_status);
result.wrap_result()
}
}
/// See [`cef_command_line_create`] for more documentation.
pub fn command_line_create() -> Option<CommandLine> {
unsafe {
let result = cef_command_line_create();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_command_line_get_global`] for more documentation.
pub fn command_line_get_global() -> Option<CommandLine> {
unsafe {
let result = cef_command_line_get_global();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_task_runner_get_for_current_thread`] for more documentation.
pub fn task_runner_get_for_current_thread() -> Option<TaskRunner> {
unsafe {
let result = cef_task_runner_get_for_current_thread();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_task_runner_get_for_thread`] for more documentation.
pub fn task_runner_get_for_thread(thread_id: ThreadId) -> Option<TaskRunner> {
unsafe {
let arg_thread_id = thread_id;
let arg_thread_id = arg_thread_id.into_raw();
let result = cef_task_runner_get_for_thread(arg_thread_id);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_currently_on`] for more documentation.
pub fn currently_on(thread_id: ThreadId) -> ::std::os::raw::c_int {
unsafe {
let arg_thread_id = thread_id;
let arg_thread_id = arg_thread_id.into_raw();
let result = cef_currently_on(arg_thread_id);
result.wrap_result()
}
}
/// See [`cef_post_task`] for more documentation.
pub fn post_task(thread_id: ThreadId, task: Option<&mut Task>) -> ::std::os::raw::c_int {
unsafe {
let (arg_thread_id, arg_task) = (thread_id, task);
let arg_thread_id = arg_thread_id.into_raw();
let arg_task = arg_task
.map(|arg| {
arg.add_ref();
ImplTask::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_post_task(arg_thread_id, arg_task);
result.wrap_result()
}
}
/// See [`cef_post_delayed_task`] for more documentation.
pub fn post_delayed_task(
thread_id: ThreadId,
task: Option<&mut Task>,
delay_ms: i64,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_thread_id, arg_task, arg_delay_ms) = (thread_id, task, delay_ms);
let arg_thread_id = arg_thread_id.into_raw();
let arg_task = arg_task
.map(|arg| {
arg.add_ref();
ImplTask::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_post_delayed_task(arg_thread_id, arg_task, arg_delay_ms);
result.wrap_result()
}
}
/// See [`cef_v8_context_get_current_context`] for more documentation.
pub fn v8_context_get_current_context() -> Option<V8Context> {
unsafe {
let result = cef_v8_context_get_current_context();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_context_get_entered_context`] for more documentation.
pub fn v8_context_get_entered_context() -> Option<V8Context> {
unsafe {
let result = cef_v8_context_get_entered_context();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_context_in_context`] for more documentation.
pub fn v8_context_in_context() -> ::std::os::raw::c_int {
unsafe {
let result = cef_v8_context_in_context();
result.wrap_result()
}
}
/// See [`cef_v8_backing_store_create`] for more documentation.
pub fn v8_backing_store_create(byte_length: usize) -> Option<V8BackingStore> {
unsafe {
let arg_byte_length = byte_length;
let result = cef_v8_backing_store_create(arg_byte_length);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_undefined`] for more documentation.
pub fn v8_value_create_undefined() -> Option<V8Value> {
unsafe {
let result = cef_v8_value_create_undefined();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_null`] for more documentation.
pub fn v8_value_create_null() -> Option<V8Value> {
unsafe {
let result = cef_v8_value_create_null();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_bool`] for more documentation.
pub fn v8_value_create_bool(value: ::std::os::raw::c_int) -> Option<V8Value> {
unsafe {
let arg_value = value;
let result = cef_v8_value_create_bool(arg_value);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_int`] for more documentation.
pub fn v8_value_create_int(value: i32) -> Option<V8Value> {
unsafe {
let arg_value = value;
let result = cef_v8_value_create_int(arg_value);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_uint`] for more documentation.
pub fn v8_value_create_uint(value: u32) -> Option<V8Value> {
unsafe {
let arg_value = value;
let result = cef_v8_value_create_uint(arg_value);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_double`] for more documentation.
pub fn v8_value_create_double(value: f64) -> Option<V8Value> {
unsafe {
let arg_value = value;
let result = cef_v8_value_create_double(arg_value);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_date`] for more documentation.
pub fn v8_value_create_date(date: _cef_basetime_t) -> Option<V8Value> {
unsafe {
let arg_date = date;
let result = cef_v8_value_create_date(arg_date);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_string`] for more documentation.
pub fn v8_value_create_string(value: Option<&CefString>) -> Option<V8Value> {
unsafe {
let arg_value = value;
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_v8_value_create_string(arg_value);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_object`] for more documentation.
pub fn v8_value_create_object(
accessor: Option<&mut V8Accessor>,
interceptor: Option<&mut V8Interceptor>,
) -> Option<V8Value> {
unsafe {
let (arg_accessor, arg_interceptor) = (accessor, interceptor);
let arg_accessor = arg_accessor
.map(|arg| {
arg.add_ref();
ImplV8Accessor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_interceptor = arg_interceptor
.map(|arg| {
arg.add_ref();
ImplV8Interceptor::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_v8_value_create_object(arg_accessor, arg_interceptor);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_array`] for more documentation.
pub fn v8_value_create_array(length: ::std::os::raw::c_int) -> Option<V8Value> {
unsafe {
let arg_length = length;
let result = cef_v8_value_create_array(arg_length);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_array_buffer`] for more documentation.
pub fn v8_value_create_array_buffer(
buffer: *mut u8,
length: usize,
release_callback: Option<&mut V8ArrayBufferReleaseCallback>,
) -> Option<V8Value> {
unsafe {
let (arg_buffer, arg_length, arg_release_callback) = (buffer, length, release_callback);
let arg_buffer = arg_buffer.cast();
let arg_release_callback = arg_release_callback
.map(|arg| {
arg.add_ref();
ImplV8ArrayBufferReleaseCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_v8_value_create_array_buffer(arg_buffer, arg_length, arg_release_callback);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_array_buffer_with_copy`] for more documentation.
pub fn v8_value_create_array_buffer_with_copy(buffer: *mut u8, length: usize) -> Option<V8Value> {
unsafe {
let (arg_buffer, arg_length) = (buffer, length);
let arg_buffer = arg_buffer.cast();
let result = cef_v8_value_create_array_buffer_with_copy(arg_buffer, arg_length);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_array_buffer_from_backing_store`] for more documentation.
pub fn v8_value_create_array_buffer_from_backing_store(
backing_store: Option<&mut V8BackingStore>,
) -> Option<V8Value> {
unsafe {
let arg_backing_store = backing_store;
let arg_backing_store = arg_backing_store
.map(|arg| {
arg.add_ref();
ImplV8BackingStore::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_v8_value_create_array_buffer_from_backing_store(arg_backing_store);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_function`] for more documentation.
pub fn v8_value_create_function(
name: Option<&CefString>,
handler: Option<&mut V8Handler>,
) -> Option<V8Value> {
unsafe {
let (arg_name, arg_handler) = (name, handler);
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_handler = arg_handler
.map(|arg| {
arg.add_ref();
ImplV8Handler::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_v8_value_create_function(arg_name, arg_handler);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_value_create_promise`] for more documentation.
pub fn v8_value_create_promise() -> Option<V8Value> {
unsafe {
let result = cef_v8_value_create_promise();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_v8_stack_trace_get_current`] for more documentation.
pub fn v8_stack_trace_get_current(frame_limit: ::std::os::raw::c_int) -> Option<V8StackTrace> {
unsafe {
let arg_frame_limit = frame_limit;
let result = cef_v8_stack_trace_get_current(arg_frame_limit);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_register_extension`] for more documentation.
pub fn register_extension(
extension_name: Option<&CefString>,
javascript_code: Option<&CefString>,
handler: Option<&mut V8Handler>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_extension_name, arg_javascript_code, arg_handler) =
(extension_name, javascript_code, handler);
let arg_extension_name = arg_extension_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_javascript_code = arg_javascript_code
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_handler = arg_handler
.map(|arg| {
arg.add_ref();
ImplV8Handler::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_register_extension(arg_extension_name, arg_javascript_code, arg_handler);
result.wrap_result()
}
}
/// See [`cef_register_scheme_handler_factory`] for more documentation.
pub fn register_scheme_handler_factory(
scheme_name: Option<&CefString>,
domain_name: Option<&CefString>,
factory: Option<&mut SchemeHandlerFactory>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_scheme_name, arg_domain_name, arg_factory) = (scheme_name, domain_name, factory);
let arg_scheme_name = arg_scheme_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_domain_name = arg_domain_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_factory = arg_factory
.map(|arg| {
arg.add_ref();
ImplSchemeHandlerFactory::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result =
cef_register_scheme_handler_factory(arg_scheme_name, arg_domain_name, arg_factory);
result.wrap_result()
}
}
/// See [`cef_clear_scheme_handler_factories`] for more documentation.
pub fn clear_scheme_handler_factories() -> ::std::os::raw::c_int {
unsafe {
let result = cef_clear_scheme_handler_factories();
result.wrap_result()
}
}
/// See [`cef_execute_process`] for more documentation.
pub fn execute_process(
args: Option<&MainArgs>,
application: Option<&mut App>,
windows_sandbox_info: *mut u8,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_args, arg_application, arg_windows_sandbox_info) =
(args, application, windows_sandbox_info);
let arg_args = arg_args.cloned().map(|arg| arg.into());
let arg_args = arg_args
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_application = arg_application
.map(|arg| {
arg.add_ref();
ImplApp::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_windows_sandbox_info = arg_windows_sandbox_info.cast();
let result = cef_execute_process(arg_args, arg_application, arg_windows_sandbox_info);
result.wrap_result()
}
}
/// See [`cef_initialize`] for more documentation.
pub fn initialize(
args: Option<&MainArgs>,
settings: Option<&Settings>,
application: Option<&mut App>,
windows_sandbox_info: *mut u8,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_args, arg_settings, arg_application, arg_windows_sandbox_info) =
(args, settings, application, windows_sandbox_info);
let arg_args = arg_args.cloned().map(|arg| arg.into());
let arg_args = arg_args
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_application = arg_application
.map(|arg| {
arg.add_ref();
ImplApp::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_windows_sandbox_info = arg_windows_sandbox_info.cast();
let result = cef_initialize(
arg_args,
arg_settings,
arg_application,
arg_windows_sandbox_info,
);
result.wrap_result()
}
}
/// See [`cef_get_exit_code`] for more documentation.
pub fn get_exit_code() -> ::std::os::raw::c_int {
unsafe {
let result = cef_get_exit_code();
result.wrap_result()
}
}
/// See [`cef_shutdown`] for more documentation.
pub fn shutdown() {
unsafe {
cef_shutdown();
}
}
/// See [`cef_do_message_loop_work`] for more documentation.
pub fn do_message_loop_work() {
unsafe {
cef_do_message_loop_work();
}
}
/// See [`cef_run_message_loop`] for more documentation.
pub fn run_message_loop() {
unsafe {
cef_run_message_loop();
}
}
/// See [`cef_quit_message_loop`] for more documentation.
pub fn quit_message_loop() {
unsafe {
cef_quit_message_loop();
}
}
/// See [`cef_set_nestable_tasks_allowed`] for more documentation.
pub fn set_nestable_tasks_allowed(allowed: ::std::os::raw::c_int) {
unsafe {
let arg_allowed = allowed;
cef_set_nestable_tasks_allowed(arg_allowed);
}
}
/// See [`cef_component_updater_get`] for more documentation.
pub fn component_updater_get() -> Option<ComponentUpdater> {
unsafe {
let result = cef_component_updater_get();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_crash_reporting_enabled`] for more documentation.
pub fn crash_reporting_enabled() -> ::std::os::raw::c_int {
unsafe {
let result = cef_crash_reporting_enabled();
result.wrap_result()
}
}
/// See [`cef_set_crash_key_value`] for more documentation.
pub fn set_crash_key_value(key: Option<&CefString>, value: Option<&CefString>) {
unsafe {
let (arg_key, arg_value) = (key, value);
let arg_key = arg_key
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_value = arg_value
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
cef_set_crash_key_value(arg_key, arg_value);
}
}
/// See [`cef_create_directory`] for more documentation.
pub fn create_directory(full_path: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
let arg_full_path = full_path;
let arg_full_path = arg_full_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_create_directory(arg_full_path);
result.wrap_result()
}
}
/// See [`cef_get_temp_directory`] for more documentation.
pub fn get_temp_directory(temp_dir: Option<&mut CefString>) -> ::std::os::raw::c_int {
unsafe {
let arg_temp_dir = temp_dir;
let arg_temp_dir = arg_temp_dir
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_get_temp_directory(arg_temp_dir);
result.wrap_result()
}
}
/// See [`cef_create_new_temp_directory`] for more documentation.
pub fn create_new_temp_directory(
prefix: Option<&CefString>,
new_temp_path: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_prefix, arg_new_temp_path) = (prefix, new_temp_path);
let arg_prefix = arg_prefix
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_new_temp_path = arg_new_temp_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_create_new_temp_directory(arg_prefix, arg_new_temp_path);
result.wrap_result()
}
}
/// See [`cef_create_temp_directory_in_directory`] for more documentation.
pub fn create_temp_directory_in_directory(
base_dir: Option<&CefString>,
prefix: Option<&CefString>,
new_dir: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_base_dir, arg_prefix, arg_new_dir) = (base_dir, prefix, new_dir);
let arg_base_dir = arg_base_dir
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_prefix = arg_prefix
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_new_dir = arg_new_dir
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_create_temp_directory_in_directory(arg_base_dir, arg_prefix, arg_new_dir);
result.wrap_result()
}
}
/// See [`cef_directory_exists`] for more documentation.
pub fn directory_exists(path: Option<&CefString>) -> ::std::os::raw::c_int {
unsafe {
let arg_path = path;
let arg_path = arg_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_directory_exists(arg_path);
result.wrap_result()
}
}
/// See [`cef_delete_file`] for more documentation.
pub fn delete_file(
path: Option<&CefString>,
recursive: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_path, arg_recursive) = (path, recursive);
let arg_path = arg_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_delete_file(arg_path, arg_recursive);
result.wrap_result()
}
}
/// See [`cef_zip_directory`] for more documentation.
pub fn zip_directory(
src_dir: Option<&CefString>,
dest_file: Option<&CefString>,
include_hidden_files: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_src_dir, arg_dest_file, arg_include_hidden_files) =
(src_dir, dest_file, include_hidden_files);
let arg_src_dir = arg_src_dir
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_dest_file = arg_dest_file
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_zip_directory(arg_src_dir, arg_dest_file, arg_include_hidden_files);
result.wrap_result()
}
}
/// See [`cef_load_crlsets_file`] for more documentation.
pub fn load_crlsets_file(path: Option<&CefString>) {
unsafe {
let arg_path = path;
let arg_path = arg_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
cef_load_crlsets_file(arg_path);
}
}
/// See [`cef_is_rtl`] for more documentation.
pub fn is_rtl() -> ::std::os::raw::c_int {
unsafe {
let result = cef_is_rtl();
result.wrap_result()
}
}
/// See [`cef_add_cross_origin_whitelist_entry`] for more documentation.
pub fn add_cross_origin_whitelist_entry(
source_origin: Option<&CefString>,
target_protocol: Option<&CefString>,
target_domain: Option<&CefString>,
allow_target_subdomains: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
let (
arg_source_origin,
arg_target_protocol,
arg_target_domain,
arg_allow_target_subdomains,
) = (
source_origin,
target_protocol,
target_domain,
allow_target_subdomains,
);
let arg_source_origin = arg_source_origin
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_target_protocol = arg_target_protocol
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_target_domain = arg_target_domain
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_add_cross_origin_whitelist_entry(
arg_source_origin,
arg_target_protocol,
arg_target_domain,
arg_allow_target_subdomains,
);
result.wrap_result()
}
}
/// See [`cef_remove_cross_origin_whitelist_entry`] for more documentation.
pub fn remove_cross_origin_whitelist_entry(
source_origin: Option<&CefString>,
target_protocol: Option<&CefString>,
target_domain: Option<&CefString>,
allow_target_subdomains: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int {
unsafe {
let (
arg_source_origin,
arg_target_protocol,
arg_target_domain,
arg_allow_target_subdomains,
) = (
source_origin,
target_protocol,
target_domain,
allow_target_subdomains,
);
let arg_source_origin = arg_source_origin
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_target_protocol = arg_target_protocol
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_target_domain = arg_target_domain
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_remove_cross_origin_whitelist_entry(
arg_source_origin,
arg_target_protocol,
arg_target_domain,
arg_allow_target_subdomains,
);
result.wrap_result()
}
}
/// See [`cef_clear_cross_origin_whitelist`] for more documentation.
pub fn clear_cross_origin_whitelist() -> ::std::os::raw::c_int {
unsafe {
let result = cef_clear_cross_origin_whitelist();
result.wrap_result()
}
}
/// See [`cef_resolve_url`] for more documentation.
pub fn resolve_url(
base_url: Option<&CefString>,
relative_url: Option<&CefString>,
resolved_url: Option<&mut CefString>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_base_url, arg_relative_url, arg_resolved_url) =
(base_url, relative_url, resolved_url);
let arg_base_url = arg_base_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_relative_url = arg_relative_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_resolved_url = arg_resolved_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_resolve_url(arg_base_url, arg_relative_url, arg_resolved_url);
result.wrap_result()
}
}
/// See [`cef_parse_url`] for more documentation.
pub fn parse_url(url: Option<&CefString>, parts: Option<&mut Urlparts>) -> ::std::os::raw::c_int {
unsafe {
let (arg_url, arg_parts) = (url, parts);
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let mut arg_parts = arg_parts.cloned().map(|arg| arg.into());
let arg_parts = arg_parts
.as_mut()
.map(std::ptr::from_mut)
.unwrap_or(std::ptr::null_mut());
let result = cef_parse_url(arg_url, arg_parts);
result.wrap_result()
}
}
/// See [`cef_create_url`] for more documentation.
pub fn create_url(parts: Option<&Urlparts>, url: Option<&mut CefString>) -> ::std::os::raw::c_int {
unsafe {
let (arg_parts, arg_url) = (parts, url);
let arg_parts = arg_parts.cloned().map(|arg| arg.into());
let arg_parts = arg_parts
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_create_url(arg_parts, arg_url);
result.wrap_result()
}
}
/// See [`cef_format_url_for_security_display`] for more documentation.
pub fn format_url_for_security_display(origin_url: Option<&CefString>) -> CefStringUserfree {
unsafe {
let arg_origin_url = origin_url;
let arg_origin_url = arg_origin_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_format_url_for_security_display(arg_origin_url);
result.wrap_result()
}
}
/// See [`cef_get_mime_type`] for more documentation.
pub fn get_mime_type(extension: Option<&CefString>) -> CefStringUserfree {
unsafe {
let arg_extension = extension;
let arg_extension = arg_extension
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_get_mime_type(arg_extension);
result.wrap_result()
}
}
/// See [`cef_get_extensions_for_mime_type`] for more documentation.
pub fn get_extensions_for_mime_type(
mime_type: Option<&CefString>,
extensions: Option<&mut CefStringList>,
) {
unsafe {
let (arg_mime_type, arg_extensions) = (mime_type, extensions);
let arg_mime_type = arg_mime_type
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_extensions = arg_extensions
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
cef_get_extensions_for_mime_type(arg_mime_type, arg_extensions);
}
}
/// See [`cef_base64_encode`] for more documentation.
pub fn base64_encode(data: Option<&[u8]>) -> CefStringUserfree {
unsafe {
let arg_data = data;
let arg_data_size = arg_data.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_data = arg_data
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let result = cef_base64_encode(arg_data, arg_data_size);
result.wrap_result()
}
}
/// See [`cef_base64_decode`] for more documentation.
pub fn base64_decode(data: Option<&CefString>) -> Option<BinaryValue> {
unsafe {
let arg_data = data;
let arg_data = arg_data
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_base64_decode(arg_data);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_uriencode`] for more documentation.
pub fn uriencode(text: Option<&CefString>, use_plus: ::std::os::raw::c_int) -> CefStringUserfree {
unsafe {
let (arg_text, arg_use_plus) = (text, use_plus);
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_uriencode(arg_text, arg_use_plus);
result.wrap_result()
}
}
/// See [`cef_uridecode`] for more documentation.
pub fn uridecode(
text: Option<&CefString>,
convert_to_utf_8: ::std::os::raw::c_int,
unescape_rule: UriUnescapeRule,
) -> CefStringUserfree {
unsafe {
let (arg_text, arg_convert_to_utf_8, arg_unescape_rule) =
(text, convert_to_utf_8, unescape_rule);
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_unescape_rule = arg_unescape_rule.into_raw();
let result = cef_uridecode(arg_text, arg_convert_to_utf_8, arg_unescape_rule);
result.wrap_result()
}
}
/// See [`cef_parse_json`] for more documentation.
pub fn parse_json(json_string: Option<&CefString>, options: JsonParserOptions) -> Option<Value> {
unsafe {
let (arg_json_string, arg_options) = (json_string, options);
let arg_json_string = arg_json_string
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_options = arg_options.into_raw();
let result = cef_parse_json(arg_json_string, arg_options);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_parse_json_buffer`] for more documentation.
pub fn parse_json_buffer(json: Option<&[u8]>, options: JsonParserOptions) -> Option<Value> {
unsafe {
let (arg_json, arg_options) = (json, options);
let arg_json_size = arg_json.as_ref().map(|arg| arg.len()).unwrap_or_default();
let arg_json = arg_json
.and_then(|arg| {
if arg.is_empty() {
None
} else {
Some(arg.as_ptr().cast())
}
})
.unwrap_or(std::ptr::null());
let arg_options = arg_options.into_raw();
let result = cef_parse_json_buffer(arg_json, arg_json_size, arg_options);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_parse_jsonand_return_error`] for more documentation.
pub fn parse_jsonand_return_error(
json_string: Option<&CefString>,
options: JsonParserOptions,
error_msg_out: Option<&mut CefString>,
) -> Option<Value> {
unsafe {
let (arg_json_string, arg_options, arg_error_msg_out) =
(json_string, options, error_msg_out);
let arg_json_string = arg_json_string
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_options = arg_options.into_raw();
let arg_error_msg_out = arg_error_msg_out
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result =
cef_parse_jsonand_return_error(arg_json_string, arg_options, arg_error_msg_out);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_write_json`] for more documentation.
pub fn write_json(node: Option<&mut Value>, options: JsonWriterOptions) -> CefStringUserfree {
unsafe {
let (arg_node, arg_options) = (node, options);
let arg_node = arg_node
.map(|arg| {
arg.add_ref();
ImplValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_options = arg_options.into_raw();
let result = cef_write_json(arg_node, arg_options);
result.wrap_result()
}
}
/// See [`cef_get_path`] for more documentation.
pub fn get_path(key: PathKey, path: Option<&mut CefString>) -> ::std::os::raw::c_int {
unsafe {
let (arg_key, arg_path) = (key, path);
let arg_key = arg_key.into_raw();
let arg_path = arg_path
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null_mut());
let result = cef_get_path(arg_key, arg_path);
result.wrap_result()
}
}
/// See [`cef_launch_process`] for more documentation.
pub fn launch_process(command_line: Option<&mut CommandLine>) -> ::std::os::raw::c_int {
unsafe {
let arg_command_line = command_line;
let arg_command_line = arg_command_line
.map(|arg| {
arg.add_ref();
ImplCommandLine::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_launch_process(arg_command_line);
result.wrap_result()
}
}
/// See [`cef_resource_bundle_get_global`] for more documentation.
pub fn resource_bundle_get_global() -> Option<ResourceBundle> {
unsafe {
let result = cef_resource_bundle_get_global();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_server_create`] for more documentation.
pub fn server_create(
address: Option<&CefString>,
port: u16,
backlog: ::std::os::raw::c_int,
handler: Option<&mut ServerHandler>,
) {
unsafe {
let (arg_address, arg_port, arg_backlog, arg_handler) = (address, port, backlog, handler);
let arg_address = arg_address
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_handler = arg_handler
.map(|arg| {
arg.add_ref();
ImplServerHandler::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
cef_server_create(arg_address, arg_port, arg_backlog, arg_handler);
}
}
/// See [`cef_shared_process_message_builder_create`] for more documentation.
pub fn shared_process_message_builder_create(
name: Option<&CefString>,
byte_size: usize,
) -> Option<SharedProcessMessageBuilder> {
unsafe {
let (arg_name, arg_byte_size) = (name, byte_size);
let arg_name = arg_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_shared_process_message_builder_create(arg_name, arg_byte_size);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_task_manager_get`] for more documentation.
pub fn task_manager_get() -> Option<TaskManager> {
unsafe {
let result = cef_task_manager_get();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_get_current_platform_thread_id`] for more documentation.
pub fn get_current_platform_thread_id() -> cef_platform_thread_id_t {
unsafe {
let result = cef_get_current_platform_thread_id();
result.wrap_result()
}
}
/// See [`cef_get_current_platform_thread_handle`] for more documentation.
pub fn get_current_platform_thread_handle() -> cef_platform_thread_handle_t {
unsafe {
let result = cef_get_current_platform_thread_handle();
result.wrap_result()
}
}
/// See [`cef_thread_create`] for more documentation.
pub fn thread_create(
display_name: Option<&CefString>,
priority: ThreadPriority,
message_loop_type: MessageLoopType,
stoppable: ::std::os::raw::c_int,
com_init_mode: ComInitMode,
) -> Option<Thread> {
unsafe {
let (
arg_display_name,
arg_priority,
arg_message_loop_type,
arg_stoppable,
arg_com_init_mode,
) = (
display_name,
priority,
message_loop_type,
stoppable,
com_init_mode,
);
let arg_display_name = arg_display_name
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_priority = arg_priority.into_raw();
let arg_message_loop_type = arg_message_loop_type.into_raw();
let arg_com_init_mode = arg_com_init_mode.into_raw();
let result = cef_thread_create(
arg_display_name,
arg_priority,
arg_message_loop_type,
arg_stoppable,
arg_com_init_mode,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_begin_tracing`] for more documentation.
pub fn begin_tracing(
categories: Option<&CefString>,
callback: Option<&mut CompletionCallback>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_categories, arg_callback) = (categories, callback);
let arg_categories = arg_categories
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplCompletionCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_begin_tracing(arg_categories, arg_callback);
result.wrap_result()
}
}
/// See [`cef_end_tracing`] for more documentation.
pub fn end_tracing(
tracing_file: Option<&CefString>,
callback: Option<&mut EndTracingCallback>,
) -> ::std::os::raw::c_int {
unsafe {
let (arg_tracing_file, arg_callback) = (tracing_file, callback);
let arg_tracing_file = arg_tracing_file
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_callback = arg_callback
.map(|arg| {
arg.add_ref();
ImplEndTracingCallback::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_end_tracing(arg_tracing_file, arg_callback);
result.wrap_result()
}
}
/// See [`cef_now_from_system_trace_time`] for more documentation.
pub fn now_from_system_trace_time() -> i64 {
unsafe {
let result = cef_now_from_system_trace_time();
result.wrap_result()
}
}
/// See [`cef_urlrequest_create`] for more documentation.
pub fn urlrequest_create(
request: Option<&mut Request>,
client: Option<&mut UrlrequestClient>,
request_context: Option<&mut RequestContext>,
) -> Option<Urlrequest> {
unsafe {
let (arg_request, arg_client, arg_request_context) = (request, client, request_context);
let arg_request = arg_request
.map(|arg| {
arg.add_ref();
ImplRequest::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_client = arg_client
.map(|arg| {
arg.add_ref();
ImplUrlrequestClient::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request_context = arg_request_context
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_urlrequest_create(arg_request, arg_client, arg_request_context);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_waitable_event_create`] for more documentation.
pub fn waitable_event_create(
automatic_reset: ::std::os::raw::c_int,
initially_signaled: ::std::os::raw::c_int,
) -> Option<WaitableEvent> {
unsafe {
let (arg_automatic_reset, arg_initially_signaled) = (automatic_reset, initially_signaled);
let result = cef_waitable_event_create(arg_automatic_reset, arg_initially_signaled);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_xml_reader_create`] for more documentation.
pub fn xml_reader_create(
stream: Option<&mut StreamReader>,
encoding_type: XmlEncodingType,
uri: Option<&CefString>,
) -> Option<XmlReader> {
unsafe {
let (arg_stream, arg_encoding_type, arg_uri) = (stream, encoding_type, uri);
let arg_stream = arg_stream
.map(|arg| {
arg.add_ref();
ImplStreamReader::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_encoding_type = arg_encoding_type.into_raw();
let arg_uri = arg_uri
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_xml_reader_create(arg_stream, arg_encoding_type, arg_uri);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_zip_reader_create`] for more documentation.
pub fn zip_reader_create(stream: Option<&mut StreamReader>) -> Option<ZipReader> {
unsafe {
let arg_stream = stream;
let arg_stream = arg_stream
.map(|arg| {
arg.add_ref();
ImplStreamReader::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_zip_reader_create(arg_stream);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_browser_view_create`] for more documentation.
pub fn browser_view_create(
client: Option<&mut Client>,
url: Option<&CefString>,
settings: Option<&BrowserSettings>,
extra_info: Option<&mut DictionaryValue>,
request_context: Option<&mut RequestContext>,
delegate: Option<&mut BrowserViewDelegate>,
) -> Option<BrowserView> {
unsafe {
let (arg_client, arg_url, arg_settings, arg_extra_info, arg_request_context, arg_delegate) =
(client, url, settings, extra_info, request_context, delegate);
let arg_client = arg_client
.map(|arg| {
arg.add_ref();
ImplClient::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_url = arg_url
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let arg_settings = arg_settings.cloned().map(|arg| arg.into());
let arg_settings = arg_settings
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let arg_extra_info = arg_extra_info
.map(|arg| {
arg.add_ref();
ImplDictionaryValue::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_request_context = arg_request_context
.map(|arg| {
arg.add_ref();
ImplRequestContext::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplBrowserViewDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_browser_view_create(
arg_client,
arg_url,
arg_settings,
arg_extra_info,
arg_request_context,
arg_delegate,
);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_browser_view_get_for_browser`] for more documentation.
pub fn browser_view_get_for_browser(browser: Option<&mut Browser>) -> Option<BrowserView> {
unsafe {
let arg_browser = browser;
let arg_browser = arg_browser
.map(|arg| {
arg.add_ref();
ImplBrowser::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_browser_view_get_for_browser(arg_browser);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_display_get_primary`] for more documentation.
pub fn display_get_primary() -> Option<Display> {
unsafe {
let result = cef_display_get_primary();
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_display_get_nearest_point`] for more documentation.
pub fn display_get_nearest_point(
point: Option<&Point>,
input_pixel_coords: ::std::os::raw::c_int,
) -> Option<Display> {
unsafe {
let (arg_point, arg_input_pixel_coords) = (point, input_pixel_coords);
let arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = cef_display_get_nearest_point(arg_point, arg_input_pixel_coords);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_display_get_matching_bounds`] for more documentation.
pub fn display_get_matching_bounds(
bounds: Option<&Rect>,
input_pixel_coords: ::std::os::raw::c_int,
) -> Option<Display> {
unsafe {
let (arg_bounds, arg_input_pixel_coords) = (bounds, input_pixel_coords);
let arg_bounds = arg_bounds.cloned().map(|arg| arg.into());
let arg_bounds = arg_bounds
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = cef_display_get_matching_bounds(arg_bounds, arg_input_pixel_coords);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_display_get_count`] for more documentation.
pub fn display_get_count() -> usize {
unsafe {
let result = cef_display_get_count();
result.wrap_result()
}
}
/// See [`cef_display_get_alls`] for more documentation.
pub fn display_get_alls(displays: Option<&mut Vec<Option<Display>>>) {
unsafe {
let arg_displays = displays;
let mut out_displays_count = arg_displays
.as_ref()
.map(|arg| arg.len())
.unwrap_or_default();
let arg_displays_count = &mut out_displays_count;
let out_displays = arg_displays;
let mut vec_displays = out_displays
.as_ref()
.map(|arg| {
arg.iter()
.map(|elem| {
elem.as_ref()
.map(|elem| {
elem.add_ref();
elem.get_raw()
})
.unwrap_or(std::ptr::null_mut())
})
.collect::<Vec<_>>()
})
.unwrap_or_default();
let arg_displays = if vec_displays.is_empty() {
std::ptr::null_mut()
} else {
vec_displays.as_mut_ptr()
};
cef_display_get_alls(arg_displays_count, arg_displays);
if let Some(out_displays) = out_displays {
*out_displays = vec_displays
.into_iter()
.take(out_displays_count)
.map(|elem| {
if elem.is_null() {
None
} else {
Some(elem.wrap_result())
}
})
.collect();
}
}
}
/// See [`cef_display_convert_screen_point_to_pixels`] for more documentation.
pub fn display_convert_screen_point_to_pixels(point: Option<&Point>) -> Point {
unsafe {
let arg_point = point;
let arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = cef_display_convert_screen_point_to_pixels(arg_point);
result.wrap_result()
}
}
/// See [`cef_display_convert_screen_point_from_pixels`] for more documentation.
pub fn display_convert_screen_point_from_pixels(point: Option<&Point>) -> Point {
unsafe {
let arg_point = point;
let arg_point = arg_point.cloned().map(|arg| arg.into());
let arg_point = arg_point
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = cef_display_convert_screen_point_from_pixels(arg_point);
result.wrap_result()
}
}
/// See [`cef_display_convert_screen_rect_to_pixels`] for more documentation.
pub fn display_convert_screen_rect_to_pixels(rect: Option<&Rect>) -> Rect {
unsafe {
let arg_rect = rect;
let arg_rect = arg_rect.cloned().map(|arg| arg.into());
let arg_rect = arg_rect
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = cef_display_convert_screen_rect_to_pixels(arg_rect);
result.wrap_result()
}
}
/// See [`cef_display_convert_screen_rect_from_pixels`] for more documentation.
pub fn display_convert_screen_rect_from_pixels(rect: Option<&Rect>) -> Rect {
unsafe {
let arg_rect = rect;
let arg_rect = arg_rect.cloned().map(|arg| arg.into());
let arg_rect = arg_rect
.as_ref()
.map(std::ptr::from_ref)
.unwrap_or(std::ptr::null());
let result = cef_display_convert_screen_rect_from_pixels(arg_rect);
result.wrap_result()
}
}
/// See [`cef_label_button_create`] for more documentation.
pub fn label_button_create(
delegate: Option<&mut ButtonDelegate>,
text: Option<&CefString>,
) -> Option<LabelButton> {
unsafe {
let (arg_delegate, arg_text) = (delegate, text);
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplButtonDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_label_button_create(arg_delegate, arg_text);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_menu_button_create`] for more documentation.
pub fn menu_button_create(
delegate: Option<&mut MenuButtonDelegate>,
text: Option<&CefString>,
) -> Option<MenuButton> {
unsafe {
let (arg_delegate, arg_text) = (delegate, text);
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplMenuButtonDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let arg_text = arg_text
.map(|arg| arg.into_raw())
.unwrap_or(std::ptr::null());
let result = cef_menu_button_create(arg_delegate, arg_text);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_panel_create`] for more documentation.
pub fn panel_create(delegate: Option<&mut PanelDelegate>) -> Option<Panel> {
unsafe {
let arg_delegate = delegate;
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplPanelDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_panel_create(arg_delegate);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_scroll_view_create`] for more documentation.
pub fn scroll_view_create(delegate: Option<&mut ViewDelegate>) -> Option<ScrollView> {
unsafe {
let arg_delegate = delegate;
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplViewDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_scroll_view_create(arg_delegate);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_textfield_create`] for more documentation.
pub fn textfield_create(delegate: Option<&mut TextfieldDelegate>) -> Option<Textfield> {
unsafe {
let arg_delegate = delegate;
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplTextfieldDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_textfield_create(arg_delegate);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}
/// See [`cef_window_create_top_level`] for more documentation.
pub fn window_create_top_level(delegate: Option<&mut WindowDelegate>) -> Option<Window> {
unsafe {
let arg_delegate = delegate;
let arg_delegate = arg_delegate
.map(|arg| {
arg.add_ref();
ImplWindowDelegate::get_raw(arg)
})
.unwrap_or(std::ptr::null_mut());
let result = cef_window_create_top_level(arg_delegate);
if result.is_null() {
None
} else {
Some(result.wrap_result())
}
}
}