#[repr(C)]pub struct _cef_view_delegate_t {
pub base: cef_base_ref_counted_t,
pub get_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>,
pub get_minimum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>,
pub get_maximum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>,
pub get_height_for_width: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, width: c_int) -> c_int>,
pub on_parent_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, parent: *mut _cef_view_t)>,
pub on_child_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, child: *mut _cef_view_t)>,
pub on_window_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int)>,
pub on_layout_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, new_bounds: *const cef_rect_t)>,
pub on_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>,
pub on_blur: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>,
pub on_theme_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>,
}Expand description
Implement this structure to handle view events. All size and position values are in density independent pixels (DIP) unless otherwise indicated. The functions of this structure will be called on the browser process UI thread unless otherwise indicated.
NOTE: This struct is allocated client-side.
Fields§
§base: cef_base_ref_counted_tBase structure.
get_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>Return the preferred size for |view|. The Layout will use this information to determine the display size.
get_minimum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>Return the minimum size for |view|.
get_maximum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>Return the maximum size for |view|.
get_height_for_width: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, width: c_int) -> c_int>Return the height necessary to display |view| with the provided |width|. If not specified the result of get_preferred_size().height will be used by default. Override if |view|’s preferred height depends upon the width (for example, with Labels).
on_parent_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, parent: *mut _cef_view_t)>Called when the parent of |view| has changed. If |view| is being added to |parent| then |added| will be true (1). If |view| is being removed from |parent| then |added| will be false (0). If |view| is being reparented the remove notification will be sent before the add notification. Do not modify the view hierarchy in this callback.
on_child_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, child: *mut _cef_view_t)>Called when a child of |view| has changed. If |child| is being added to |view| then |added| will be true (1). If |child| is being removed from |view| then |added| will be false (0). If |child| is being reparented the remove notification will be sent to the old parent before the add notification is sent to the new parent. Do not modify the view hierarchy in this callback.
on_window_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int)>Called when |view| is added or removed from the cef_window_t.
on_layout_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, new_bounds: *const cef_rect_t)>Called when the layout of |view| has changed.
on_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>Called when |view| gains focus.
on_blur: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>Called when |view| loses focus.
on_theme_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>Called when the theme for |view| has changed, after the new theme colors have already been applied. Views are notified via the component hierarchy in depth-first reverse order (children before parents).
This will be called in the following cases:
- When |view|, or a parent of |view|, is added to a Window. 2. When the native/OS or Chrome theme changes for the Window that contains |view|. See CefWindowDelegate::OnThemeColorsChanged documentation.
- When the client explicitly calls cef_window_t::ThemeChanged on the Window that contains |view|.
Optionally use this callback to override the new per-View theme colors by calling cef_view_t::SetBackgroundColor or the appropriate component- specific function. See cef_window_t::SetThemeColor documentation for how to customize additional Window theme colors.
Trait Implementations§
Source§impl Clone for _cef_view_delegate_t
impl Clone for _cef_view_delegate_t
Source§fn clone(&self) -> _cef_view_delegate_t
fn clone(&self) -> _cef_view_delegate_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more