[][src]Trait gtk::CellAreaContextExt

pub trait CellAreaContextExt: 'static {
    fn allocate(&self, width: i32, height: i32);
fn get_allocation(&self) -> (i32, i32);
fn get_area(&self) -> Option<CellArea>;
fn get_preferred_height(&self) -> (i32, i32);
fn get_preferred_height_for_width(&self, width: i32) -> (i32, i32);
fn get_preferred_width(&self) -> (i32, i32);
fn get_preferred_width_for_height(&self, height: i32) -> (i32, i32);
fn push_preferred_height(&self, minimum_height: i32, natural_height: i32);
fn push_preferred_width(&self, minimum_width: i32, natural_width: i32);
fn reset(&self);
fn get_property_minimum_height(&self) -> i32;
fn get_property_minimum_width(&self) -> i32;
fn get_property_natural_height(&self) -> i32;
fn get_property_natural_width(&self) -> i32;
fn connect_property_minimum_height_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_minimum_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_natural_height_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_natural_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all CellAreaContext methods.

Implementors

CellAreaContext

Required methods

fn allocate(&self, width: i32, height: i32)

Allocates a width and/or a height for all rows which are to be rendered with self.

Usually allocation is performed only horizontally or sometimes vertically since a group of rows are usually rendered side by side vertically or horizontally and share either the same width or the same height. Sometimes they are allocated in both horizontal and vertical orientations producing a homogeneous effect of the rows. This is generally the case for TreeView when TreeView:fixed-height-mode is enabled.

Since 3.0

width

the allocated width for all TreeModel rows rendered with self, or -1.

height

the allocated height for all TreeModel rows rendered with self, or -1.

fn get_allocation(&self) -> (i32, i32)

Fetches the current allocation size for self.

If the context was not allocated in width or height, or if the context was recently reset with CellAreaContextExt::reset, the returned value will be -1.

width

location to store the allocated width, or None

height

location to store the allocated height, or None

fn get_area(&self) -> Option<CellArea>

Fetches the CellArea this self was created by.

This is generally unneeded by layouting widgets; however, it is important for the context implementation itself to fetch information about the area it is being used for.

For instance at CellAreaContextClass.allocate() time it’s important to know details about any cell spacing that the CellArea is configured with in order to compute a proper allocation.

Returns

the CellArea this context was created by.

fn get_preferred_height(&self) -> (i32, i32)

Gets the accumulative preferred height for all rows which have been requested with this context.

After CellAreaContextExt::reset is called and/or before ever requesting the size of a CellArea, the returned values are 0.

minimum_height

location to store the minimum height, or None

natural_height

location to store the natural height, or None

fn get_preferred_height_for_width(&self, width: i32) -> (i32, i32)

Gets the accumulative preferred height for width for all rows which have been requested for the same said width with this context.

After CellAreaContextExt::reset is called and/or before ever requesting the size of a CellArea, the returned values are -1.

width

a proposed width for allocation

minimum_height

location to store the minimum height, or None

natural_height

location to store the natural height, or None

fn get_preferred_width(&self) -> (i32, i32)

Gets the accumulative preferred width for all rows which have been requested with this context.

After CellAreaContextExt::reset is called and/or before ever requesting the size of a CellArea, the returned values are 0.

minimum_width

location to store the minimum width, or None

natural_width

location to store the natural width, or None

fn get_preferred_width_for_height(&self, height: i32) -> (i32, i32)

Gets the accumulative preferred width for height for all rows which have been requested for the same said height with this context.

After CellAreaContextExt::reset is called and/or before ever requesting the size of a CellArea, the returned values are -1.

height

a proposed height for allocation

minimum_width

location to store the minimum width, or None

natural_width

location to store the natural width, or None

fn push_preferred_height(&self, minimum_height: i32, natural_height: i32)

Causes the minimum and/or natural height to grow if the new proposed sizes exceed the current minimum and natural height.

This is used by CellAreaContext implementations during the request process over a series of TreeModel rows to progressively push the requested height over a series of CellAreaExt::get_preferred_height requests.

minimum_height

the proposed new minimum height for self

natural_height

the proposed new natural height for self

fn push_preferred_width(&self, minimum_width: i32, natural_width: i32)

Causes the minimum and/or natural width to grow if the new proposed sizes exceed the current minimum and natural width.

This is used by CellAreaContext implementations during the request process over a series of TreeModel rows to progressively push the requested width over a series of CellAreaExt::get_preferred_width requests.

minimum_width

the proposed new minimum width for self

natural_width

the proposed new natural width for self

fn reset(&self)

Resets any previously cached request and allocation data.

When underlying TreeModel data changes its important to reset the context if the content size is allowed to shrink. If the content size is only allowed to grow (this is usually an option for views rendering large data stores as a measure of optimization), then only the row that changed or was inserted needs to be (re)requested with CellAreaExt::get_preferred_width.

When the new overall size of the context requires that the allocated size changes (or whenever this allocation changes at all), the variable row sizes need to be re-requested for every row.

For instance, if the rows are displayed all with the same width from top to bottom then a change in the allocated width necessitates a recalculation of all the displayed row heights using CellAreaExt::get_preferred_height_for_width.

Since 3.0

fn get_property_minimum_height(&self) -> i32

The minimum height for the CellArea in this context for all TreeModel rows that this context was requested for using CellAreaExt::get_preferred_height.

fn get_property_minimum_width(&self) -> i32

The minimum width for the CellArea in this context for all TreeModel rows that this context was requested for using CellAreaExt::get_preferred_width.

fn get_property_natural_height(&self) -> i32

The natural height for the CellArea in this context for all TreeModel rows that this context was requested for using CellAreaExt::get_preferred_height.

fn get_property_natural_width(&self) -> i32

The natural width for the CellArea in this context for all TreeModel rows that this context was requested for using CellAreaExt::get_preferred_width.

fn connect_property_minimum_height_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_minimum_width_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_natural_height_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_natural_width_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

Loading content...

Implementors

impl<O: IsA<CellAreaContext>> CellAreaContextExt for O[src]

Loading content...