#[repr(C)]pub struct _cef_view_t {Show 53 fields
pub base: cef_base_ref_counted_t,
pub as_browser_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_browser_view_t>,
pub as_button: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_button_t>,
pub as_panel: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_panel_t>,
pub as_scroll_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_scroll_view_t>,
pub as_textfield: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_textfield_t>,
pub get_type_string: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_string_userfree_t>,
pub to_string: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, include_children: c_int) -> cef_string_userfree_t>,
pub is_valid: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub is_attached: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub is_same: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, that: *mut _cef_view_t) -> c_int>,
pub get_delegate: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_view_delegate_t>,
pub get_window: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_window_t>,
pub get_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub set_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, id: c_int)>,
pub get_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub set_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, group_id: c_int)>,
pub get_parent_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_view_t>,
pub get_view_for_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, id: c_int) -> *mut _cef_view_t>,
pub set_bounds: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, bounds: *const cef_rect_t)>,
pub get_bounds: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_rect_t>,
pub get_bounds_in_screen: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_rect_t>,
pub set_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, size: *const cef_size_t)>,
pub get_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>,
pub set_position: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, position: *const cef_point_t)>,
pub get_position: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_point_t>,
pub set_insets: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, insets: *const cef_insets_t)>,
pub get_insets: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_insets_t>,
pub get_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>,
pub size_to_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t)>,
pub get_minimum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>,
pub get_maximum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>,
pub get_height_for_width: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, width: c_int) -> c_int>,
pub invalidate_layout: Option<unsafe extern "C" fn(self_: *mut _cef_view_t)>,
pub set_visible: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, visible: c_int)>,
pub is_visible: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub is_drawn: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub set_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, enabled: c_int)>,
pub is_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub set_focusable: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, focusable: c_int)>,
pub is_focusable: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub is_accessibility_focusable: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub has_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>,
pub request_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_t)>,
pub set_background_color: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, color: cef_color_t)>,
pub get_background_color: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_color_t>,
pub get_theme_color: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, color_id: c_int) -> cef_color_t>,
pub convert_point_to_screen: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>,
pub convert_point_from_screen: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>,
pub convert_point_to_window: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>,
pub convert_point_from_window: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>,
pub convert_point_to_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, view: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>,
pub convert_point_from_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, view: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>,
}Expand description
A View is a rectangle within the views View hierarchy. It is the base structure for all Views. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
NOTE: This struct is allocated DLL-side.
Fields§
§base: cef_base_ref_counted_tBase structure.
as_browser_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_browser_view_t>Returns this View as a BrowserView or NULL if this is not a BrowserView.
Returns this View as a Button or NULL if this is not a Button.
as_panel: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_panel_t>Returns this View as a Panel or NULL if this is not a Panel.
as_scroll_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_scroll_view_t>Returns this View as a ScrollView or NULL if this is not a ScrollView.
as_textfield: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_textfield_t>Returns this View as a Textfield or NULL if this is not a Textfield.
get_type_string: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_string_userfree_t>Returns the type of this View as a string. Used primarily for testing purposes.
to_string: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, include_children: c_int) -> cef_string_userfree_t>Returns a string representation of this View which includes the type and various type-specific identifying attributes. If |include_children| is true (1) any child Views will also be included. Used primarily for testing purposes.
is_valid: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns true (1) if this View is valid.
is_attached: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns true (1) if this View is currently attached to another View. A View can only be attached to one View at a time.
is_same: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, that: *mut _cef_view_t) -> c_int>Returns true (1) if this View is the same as |that| View.
get_delegate: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_view_delegate_t>Returns the delegate associated with this View, if any.
get_window: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_window_t>Returns the top-level Window hosting this View, if any.
get_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns the ID for this View.
set_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, id: c_int)>Sets the ID for this View. ID should be unique within the subtree that you intend to search for it. 0 is the default ID for views.
get_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns the group id of this View, or -1 if not set.
set_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, group_id: c_int)>A group id is used to tag Views which are part of the same logical group. Focus can be moved between views with the same group using the arrow keys. The group id is immutable once it’s set.
get_parent_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> *mut _cef_view_t>Returns the View that contains this View, if any.
get_view_for_id: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, id: c_int) -> *mut _cef_view_t>Recursively descends the view tree starting at this View, and returns the first child that it encounters with the given ID. Returns NULL if no matching child view is found.
set_bounds: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, bounds: *const cef_rect_t)>Sets the bounds (size and position) of this View. |bounds| is in parent coordinates, or DIP screen coordinates if there is no parent.
get_bounds: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_rect_t>Returns the bounds (size and position) of this View in parent coordinates, or DIP screen coordinates if there is no parent.
get_bounds_in_screen: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_rect_t>Returns the bounds (size and position) of this View in DIP screen coordinates.
set_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, size: *const cef_size_t)>Sets the size of this View without changing the position. |size| in parent coordinates, or DIP screen coordinates if there is no parent.
get_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>Returns the size of this View in parent coordinates, or DIP screen coordinates if there is no parent.
set_position: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, position: *const cef_point_t)>Sets the position of this View without changing the size. |position| is in parent coordinates, or DIP screen coordinates if there is no parent.
get_position: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_point_t>Returns the position of this View. Position is in parent coordinates, or DIP screen coordinates if there is no parent.
set_insets: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, insets: *const cef_insets_t)>Sets the insets for this View. |insets| is in parent coordinates, or DIP screen coordinates if there is no parent.
get_insets: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_insets_t>Returns the insets for this View in parent coordinates, or DIP screen coordinates if there is no parent.
get_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>Returns the size this View would like to be if enough space is available. Size is in parent coordinates, or DIP screen coordinates if there is no parent.
size_to_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t)>Size this View to its preferred size. Size is in parent coordinates, or DIP screen coordinates if there is no parent.
get_minimum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>Returns the minimum size for this View. Size is in parent coordinates, or DIP screen coordinates if there is no parent.
get_maximum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_size_t>Returns the maximum size for this View. Size is in parent coordinates, or DIP screen coordinates if there is no parent.
get_height_for_width: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, width: c_int) -> c_int>Returns the height necessary to display this View with the provided width.
invalidate_layout: Option<unsafe extern "C" fn(self_: *mut _cef_view_t)>Indicate that this View and all parent Views require a re-layout. This ensures the next call to layout() will propagate to this View even if the bounds of parent Views do not change.
set_visible: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, visible: c_int)>Sets whether this View is visible. Windows are hidden by default and other views are visible by default. This View and any parent views must be set as visible for this View to be drawn in a Window. If this View is set as hidden then it and any child views will not be drawn and, if any of those views currently have focus, then focus will also be cleared. Painting is scheduled as needed. If this View is a Window then calling this function is equivalent to calling the Window show() and hide() functions.
is_visible: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns whether this View is visible. A view may be visible but still not drawn in a Window if any parent views are hidden. If this View is a Window then a return value of true (1) indicates that this Window is currently visible to the user on-screen. If this View is not a Window then call is_drawn() to determine whether this View and all parent views are visible and will be drawn.
is_drawn: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns whether this View is visible and drawn in a Window. A view is drawn if it and all parent views are visible. If this View is a Window then calling this function is equivalent to calling is_visible(). Otherwise, to determine if the containing Window is visible to the user on-screen call is_visible() on the Window.
set_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, enabled: c_int)>Set whether this View is enabled. A disabled View does not receive keyboard or mouse inputs. If |enabled| differs from the current value the View will be repainted. Also, clears focus if the focused View is disabled.
is_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns whether this View is enabled.
set_focusable: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, focusable: c_int)>Sets whether this View is capable of taking focus. It will clear focus if the focused View is set to be non-focusable. This is false (0) by default so that a View used as a container does not get the focus.
is_focusable: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns true (1) if this View is focusable, enabled and drawn.
is_accessibility_focusable: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Return whether this View is focusable when the user requires full keyboard access, even though it may not be normally focusable.
has_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> c_int>Returns true (1) if this View has focus in the context of the containing Window. Check both this function and cef_window_t::IsActive to determine global keyboard focus.
request_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_t)>Request focus for this View in the context of the containing Window. If this View is focusable it will become the focused View. Any focus changes while a Window is not active may be applied after that Window next becomes active.
set_background_color: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, color: cef_color_t)>Sets the background color for this View. The background color will be automatically reset when cef_view_delegate_t::OnThemeChanged is called.
get_background_color: Option<unsafe extern "C" fn(self_: *mut _cef_view_t) -> cef_color_t>Returns the background color for this View. If the background color is
unset then the current GetThemeColor(CEF_ColorPrimaryBackground) value
will be returned. If this View belongs to an overlay (created with
cef_window_t::AddOverlayView), and the background color is unset, then a
value of transparent (0) will be returned.
get_theme_color: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, color_id: c_int) -> cef_color_t>Returns the current theme color associated with |color_id|, or the placeholder color (red) if unset. See cef_color_ids.h for standard ID values. Standard colors can be overridden and custom colors can be added using cef_window_t::SetThemeColor.
convert_point_to_screen: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>Convert |point| from this View’s coordinate system to DIP screen coordinates. This View must belong to a Window when calling this function. Returns true (1) if the conversion is successful or false (0) otherwise. Use cef_display_t::convert_point_to_pixels() after calling this function if further conversion to display-specific pixel coordinates is desired.
convert_point_from_screen: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>Convert |point| to this View’s coordinate system from DIP screen coordinates. This View must belong to a Window when calling this function. Returns true (1) if the conversion is successful or false (0) otherwise. Use cef_display_t::convert_point_from_pixels() before calling this function if conversion from display-specific pixel coordinates is necessary.
convert_point_to_window: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>Convert |point| from this View’s coordinate system to that of the Window. This View must belong to a Window when calling this function. Returns true (1) if the conversion is successful or false (0) otherwise.
convert_point_from_window: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>Convert |point| to this View’s coordinate system from that of the Window. This View must belong to a Window when calling this function. Returns true (1) if the conversion is successful or false (0) otherwise.
convert_point_to_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, view: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>Convert |point| from this View’s coordinate system to that of |view|. |view| needs to be in the same Window but not necessarily the same view hierarchy. Returns true (1) if the conversion is successful or false (0) otherwise.
convert_point_from_view: Option<unsafe extern "C" fn(self_: *mut _cef_view_t, view: *mut _cef_view_t, point: *mut cef_point_t) -> c_int>Convert |point| to this View’s coordinate system from that |view|. |view| needs to be in the same Window but not necessarily the same view hierarchy. Returns true (1) if the conversion is successful or false (0) otherwise.
Trait Implementations§
Source§impl Clone for _cef_view_t
impl Clone for _cef_view_t
Source§fn clone(&self) -> _cef_view_t
fn clone(&self) -> _cef_view_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more