gtk4::subclass::cell_area

Trait CellAreaImpl

Source
pub trait CellAreaImpl: CellAreaImplExt + ObjectImpl {
Show 20 methods // Provided methods fn cell_properties() -> &'static [ParamSpec] { ... } fn set_cell_property<R: IsA<CellRenderer>>( &self, _renderer: &R, _id: usize, _value: &Value, _pspec: &ParamSpec, ) { ... } fn cell_property<R: IsA<CellRenderer>>( &self, _renderer: &R, _id: usize, _pspec: &ParamSpec, ) -> Value { ... } fn activate<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, area: &Rectangle, flags: CellRendererState, edit_only: bool, ) -> bool { ... } fn add<R: IsA<CellRenderer>>(&self, renderer: &R) { ... } fn apply_attributes<M: IsA<TreeModel>>( &self, tree_model: &M, iter: &TreeIter, is_expander: bool, is_expanded: bool, ) { ... } fn create_context(&self) -> Option<CellAreaContext> { ... } fn copy_context<P: IsA<CellAreaContext>>( &self, context: &P, ) -> Option<CellAreaContext> { ... } fn event<W: IsA<Widget>, P: IsA<CellAreaContext>>( &self, context: &P, widget: &W, event: &Event, area: &Rectangle, flags: CellRendererState, ) -> bool { ... } fn foreach(&self, callback: &CellCallback) { ... } fn foreach_alloc<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, area: &Rectangle, bg_area: &Rectangle, callback: &CellCallbackAllocate, ) { ... } fn remove<R: IsA<CellRenderer>>(&self, renderer: &R) { ... } fn is_activatable(&self) -> bool { ... } fn focus(&self, direction_type: DirectionType) -> bool { ... } fn request_mode(&self) -> SizeRequestMode { ... } fn preferred_width<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, ) -> (i32, i32) { ... } fn preferred_width_for_height<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, height: i32, ) -> (i32, i32) { ... } fn preferred_height<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, ) -> (i32, i32) { ... } fn preferred_height_for_width<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, width: i32, ) -> (i32, i32) { ... } fn snapshot<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, snapshot: &Snapshot, widget: &W, background_area: &Rectangle, cellarea: &Rectangle, flags: CellRendererState, paint_focus: bool, ) { ... }
}
👎Deprecated: Since 4.10

Provided Methods§

Source

fn cell_properties() -> &'static [ParamSpec]

👎Deprecated: Since 4.10
Source

fn set_cell_property<R: IsA<CellRenderer>>( &self, _renderer: &R, _id: usize, _value: &Value, _pspec: &ParamSpec, )

👎Deprecated: Since 4.10

This should be implemented to handle changes in child cell properties for a given CellRenderer that were previously installed on the [CellAreaClass][crate::CellAreaClass] with gtk_cell_area_class_install_cell_property().

Source

fn cell_property<R: IsA<CellRenderer>>( &self, _renderer: &R, _id: usize, _pspec: &ParamSpec, ) -> Value

👎Deprecated: Since 4.10

This should be implemented to report the values of child cell properties for a given child CellRenderer.

Source

fn activate<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, area: &Rectangle, flags: CellRendererState, edit_only: bool, ) -> bool

👎Deprecated: Since 4.10

Activates @self, usually by activating the currently focused cell, however some subclasses which embed widgets in the area can also activate a widget if it currently has the focus.

§Deprecated since 4.10
§context

the CellAreaContext in context with the current row data

§widget

the Widget that @self is rendering on

§cell_area

the size and location of @self relative to @widget’s allocation

§flags

the CellRendererState flags for @self for this row of data.

§edit_only

if true then only cell renderers that are CellRendererMode::Editable will be activated.

§Returns

Whether @self was successfully activated.

Source

fn add<R: IsA<CellRenderer>>(&self, renderer: &R)

👎Deprecated: Since 4.10

Adds @renderer to @self with the default child cell properties.

§Deprecated since 4.10
§renderer

the CellRenderer to add to @self

Source

fn apply_attributes<M: IsA<TreeModel>>( &self, tree_model: &M, iter: &TreeIter, is_expander: bool, is_expanded: bool, )

👎Deprecated: Since 4.10

Applies any connected attributes to the renderers in @self by pulling the values from @tree_model.

§Deprecated since 4.10
§tree_model

the TreeModel to pull values from

§iter

the TreeIter in @tree_model to apply values for

§is_expander

whether @iter has children

§is_expanded

whether @iter is expanded in the view and children are visible

Source

fn create_context(&self) -> Option<CellAreaContext>

👎Deprecated: Since 4.10

Creates a CellAreaContext to be used with @self for all purposes. CellAreaContext stores geometry information for rows for which it was operated on, it is important to use the same context for the same row of data at all times (i.e. one should render and handle events with the same CellAreaContext which was used to request the size of those rows of data).

§Deprecated since 4.10
§Returns

a newly created CellAreaContext which can be used with @self.

Source

fn copy_context<P: IsA<CellAreaContext>>( &self, context: &P, ) -> Option<CellAreaContext>

👎Deprecated: Since 4.10

This is sometimes needed for cases where rows need to share alignments in one orientation but may be separately grouped in the opposing orientation.

For instance, IconView creates all icons (rows) to have the same width and the cells theirin to have the same horizontal alignments. However each row of icons may have a separate collective height. IconView uses this to request the heights of each row based on a context which was already used to request all the row widths that are to be displayed.

§Deprecated since 4.10
§context

the CellAreaContext to copy

§Returns

a newly created CellAreaContext copy of @context.

Source

fn event<W: IsA<Widget>, P: IsA<CellAreaContext>>( &self, context: &P, widget: &W, event: &Event, area: &Rectangle, flags: CellRendererState, ) -> bool

👎Deprecated: Since 4.10

Delegates event handling to a CellArea.

§Deprecated since 4.10
§context

the CellAreaContext for this row of data.

§widget

the Widget that @self is rendering to

§event

the gdk::Event to handle

§cell_area

the @widget relative coordinates for @self

§flags

the CellRendererState for @self in this row.

§Returns

true if the event was handled by @self.

Source

fn foreach(&self, callback: &CellCallback)

👎Deprecated: Since 4.10

Calls @callback for every CellRenderer in @self.

§Deprecated since 4.10
§callback

the GtkCellCallback to call

§callback_data

user provided data pointer

Source

fn foreach_alloc<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, area: &Rectangle, bg_area: &Rectangle, callback: &CellCallbackAllocate, )

👎Deprecated: Since 4.10

Calls @callback for every CellRenderer in @self with the allocated rectangle inside @cell_area.

§context

the CellAreaContext for this row of data.

§widget

the Widget that @self is rendering to

§cell_area

the @widget relative coordinates and size for @self

§background_area

the @widget relative coordinates of the background area

§callback

the GtkCellAllocCallback to call

§callback_data

user provided data pointer

Source

fn remove<R: IsA<CellRenderer>>(&self, renderer: &R)

👎Deprecated: Since 4.10

Removes @renderer from @self.

§Deprecated since 4.10
§renderer

the CellRenderer to remove from @self

Source

fn is_activatable(&self) -> bool

👎Deprecated: Since 4.10

Returns whether the area can do anything when activated, after applying new attributes to @self.

§Deprecated since 4.10
§Returns

whether @self can do anything when activated.

Source

fn focus(&self, direction_type: DirectionType) -> bool

👎Deprecated: Since 4.10

This should be called by the @self’s owning layout widget when focus is to be passed to @self, or moved within @self for a given @direction and row data.

Implementing CellArea classes should implement this method to receive and navigate focus in its own way particular to how it lays out cells.

§Deprecated since 4.10
§direction

the DirectionType

§Returns

true if focus remains inside @self as a result of this call.

Source

fn request_mode(&self) -> SizeRequestMode

👎Deprecated: Since 4.10

Gets whether the area prefers a height-for-width layout or a width-for-height layout.

§Returns

The SizeRequestMode preferred by @self.

Source

fn preferred_width<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, ) -> (i32, i32)

👎Deprecated: Since 4.10

Retrieves a cell area’s initial minimum and natural width.

@self will store some geometrical information in @context along the way; when requesting sizes over an arbitrary number of rows, it’s not important to check the @minimum_width and @natural_width of this call but rather to consult gtk_cell_area_context_get_preferred_width() after a series of requests.

§Deprecated since 4.10
§context

the CellAreaContext to perform this request with

§widget

the Widget where @self will be rendering

§Returns
§minimum_width

location to store the minimum width

§natural_width

location to store the natural width

Source

fn preferred_width_for_height<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, height: i32, ) -> (i32, i32)

👎Deprecated: Since 4.10

Retrieves a cell area’s minimum and natural width if it would be given the specified @height.

@self stores some geometrical information in @context along the way while calling gtk_cell_area_get_preferred_height(). It’s important to perform a series of gtk_cell_area_get_preferred_height() requests with @context first and then call gtk_cell_area_get_preferred_width_for_height() on each cell area individually to get the height for width of each fully requested row.

If at some point, the height of a single row changes, it should be requested with gtk_cell_area_get_preferred_height() again and then the full height of the requested rows checked again with gtk_cell_area_context_get_preferred_height().

§Deprecated since 4.10
§context

the CellAreaContext which has already been requested for widths.

§widget

the Widget where @self will be rendering

§height

the height for which to check the width of this area

§Returns
§minimum_width

location to store the minimum width

§natural_width

location to store the natural width

Source

fn preferred_height<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, ) -> (i32, i32)

👎Deprecated: Since 4.10

Retrieves a cell area’s initial minimum and natural height.

@self will store some geometrical information in @context along the way; when requesting sizes over an arbitrary number of rows, it’s not important to check the @minimum_height and @natural_height of this call but rather to consult gtk_cell_area_context_get_preferred_height() after a series of requests.

§Deprecated since 4.10
§context

the CellAreaContext to perform this request with

§widget

the Widget where @self will be rendering

§Returns
§minimum_height

location to store the minimum height

§natural_height

location to store the natural height

Source

fn preferred_height_for_width<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, widget: &W, width: i32, ) -> (i32, i32)

👎Deprecated: Since 4.10

Retrieves a cell area’s minimum and natural height if it would be given the specified @width.

@self stores some geometrical information in @context along the way while calling gtk_cell_area_get_preferred_width(). It’s important to perform a series of gtk_cell_area_get_preferred_width() requests with @context first and then call gtk_cell_area_get_preferred_height_for_width() on each cell area individually to get the height for width of each fully requested row.

If at some point, the width of a single row changes, it should be requested with gtk_cell_area_get_preferred_width() again and then the full width of the requested rows checked again with gtk_cell_area_context_get_preferred_width().

§Deprecated since 4.10
§context

the CellAreaContext which has already been requested for widths.

§widget

the Widget where @self will be rendering

§width

the width for which to check the height of this area

§Returns
§minimum_height

location to store the minimum height

§natural_height

location to store the natural height

Source

fn snapshot<P: IsA<CellAreaContext>, W: IsA<Widget>>( &self, context: &P, snapshot: &Snapshot, widget: &W, background_area: &Rectangle, cellarea: &Rectangle, flags: CellRendererState, paint_focus: bool, )

👎Deprecated: Since 4.10

Snapshots @self’s cells according to @self’s layout onto at the given coordinates.

§Deprecated since 4.10
§context

the CellAreaContext for this row of data.

§widget

the Widget that @self is rendering to

§snapshot

the Snapshot to draw to

§background_area

the @widget relative coordinates for @self’s background

§cell_area

the @widget relative coordinates for @self

§flags

the CellRendererState for @self in this row.

§paint_focus

whether @self should paint focus on focused cells for focused rows or not.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§