Trait animate::LayoutManagerExt [−][src]
pub trait LayoutManagerExt: 'static { fn allocate<P: IsA<Container>>(
&self,
container: &P,
allocation: &ActorBox,
flags: AllocationFlags
); fn child_get_property<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &mut Value
); fn child_set_property<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &Value
); fn find_child_property(&self, name: &str) -> Option<ParamSpec>; fn get_child_meta<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q
) -> Option<LayoutMeta>; fn get_preferred_height<P: IsA<Container>>(
&self,
container: &P,
for_width: f32
) -> (f32, f32); fn get_preferred_width<P: IsA<Container>>(
&self,
container: &P,
for_height: f32
) -> (f32, f32); fn layout_changed(&self); fn list_child_properties(&self) -> Vec<ParamSpec>ⓘ; fn set_container<P: IsA<Container>>(&self, container: Option<&P>); fn connect_layout_changed<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId; }
Trait containing all LayoutManager
methods.
Implementors
BinLayout
, BoxLayout
, FixedLayout
, FlowLayout
, GridLayout
, LayoutManager
Required methods
fn allocate<P: IsA<Container>>(
&self,
container: &P,
allocation: &ActorBox,
flags: AllocationFlags
)
[src]
&self,
container: &P,
allocation: &ActorBox,
flags: AllocationFlags
)
Allocates the children of container
given an area
See also ActorExt::allocate
container
the Container
using self
allocation
the ActorBox
containing the allocated area
of container
flags
the allocation flags
fn child_get_property<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &mut Value
)
[src]
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &mut Value
)
Gets a property on the LayoutMeta
created by self
and
attached to a child of container
The gobject::Value
must already be initialized to the type of the property
and has to be unset with gobject::Value::unset
after extracting the real
value out of it
container
a Container
using self
actor
a Actor
child of container
property_name
the name of the property to get
value
a gobject::Value
with the value of the property to get
fn child_set_property<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &Value
)
[src]
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &Value
)
Sets a property on the LayoutMeta
created by self
and
attached to a child of container
container
a Container
using self
actor
a Actor
child of container
property_name
the name of the property to set
value
a gobject::Value
with the value of the property to set
fn find_child_property(&self, name: &str) -> Option<ParamSpec>
[src]
Retrieves the gobject::ParamSpec
for the layout property name
inside
the LayoutMeta
sub-class used by self
name
the name of the property
Returns
a gobject::ParamSpec
describing the property,
or None
if no property with that name exists. The returned
gobject::ParamSpec
is owned by the layout manager and should not be
modified or freed
fn get_child_meta<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q
) -> Option<LayoutMeta>
[src]
&self,
container: &P,
actor: &Q
) -> Option<LayoutMeta>
Retrieves the LayoutMeta
that the layout self
associated
to the actor
child of container
, eventually by creating one if the
LayoutManager
supports layout properties
container
a Container
using self
actor
a Actor
child of container
Returns
a LayoutMeta
, or None
if the
LayoutManager
does not have layout properties. The returned
layout meta instance is owned by the LayoutManager
and it
should not be unreferenced
fn get_preferred_height<P: IsA<Container>>(
&self,
container: &P,
for_width: f32
) -> (f32, f32)
[src]
&self,
container: &P,
for_width: f32
) -> (f32, f32)
Computes the minimum and natural heights of the container
according
to self
.
See also ActorExt::get_preferred_height
container
the Container
using self
for_width
the width for which the height should be computed, or -1
min_height_p
return location for the minimum height
of the layout, or None
nat_height_p
return location for the natural height
of the layout, or None
fn get_preferred_width<P: IsA<Container>>(
&self,
container: &P,
for_height: f32
) -> (f32, f32)
[src]
&self,
container: &P,
for_height: f32
) -> (f32, f32)
Computes the minimum and natural widths of the container
according
to self
.
See also ActorExt::get_preferred_width
container
the Container
using self
for_height
the height for which the width should be computed, or -1
min_width_p
return location for the minimum width
of the layout, or None
nat_width_p
return location for the natural width
of the layout, or None
fn layout_changed(&self)
[src]
Emits the LayoutManager::layout-changed
signal on self
This function should only be called by implementations of the
LayoutManager
class
fn list_child_properties(&self) -> Vec<ParamSpec>ⓘ
[src]
Retrieves all the gobject::ParamSpec
s for the layout properties
stored inside the LayoutMeta
sub-class used by self
n_pspecs
return location for the number of returned
gobject::ParamSpec
s
Returns
the newly-allocated,
None
-terminated array of gobject::ParamSpec
s. Use g_free
to free the
resources allocated for the array
fn set_container<P: IsA<Container>>(&self, container: Option<&P>)
[src]
If the LayoutManager
sub-class allows it, allow
adding a weak reference of the container
using self
from within the layout manager
The layout manager should not increase the reference
count of the container
container
a Container
using self
fn connect_layout_changed<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
The ::layout-changed signal is emitted each time a layout manager
has been changed. Every Actor
using the manager
instance
as a layout manager should connect a handler to the ::layout-changed
signal and queue a relayout on themselves:
static void layout_changed (LayoutManager *manager,
Actor *self)
{
actor_queue_relayout (self);
}
...
self->manager = g_object_ref_sink (manager);
g_signal_connect (self->manager, "layout-changed",
G_CALLBACK (layout_changed),
self);
Sub-classes of LayoutManager
that implement a layout that
can be controlled or changed using parameters should emit the
::layout-changed signal whenever one of the parameters changes,
by using LayoutManagerExt::layout_changed
.
Implementors
impl<O: IsA<LayoutManager>> LayoutManagerExt for O
[src]
impl<O: IsA<LayoutManager>> LayoutManagerExt for O
[src]fn allocate<P: IsA<Container>>(
&self,
container: &P,
allocation: &ActorBox,
flags: AllocationFlags
)
[src]
&self,
container: &P,
allocation: &ActorBox,
flags: AllocationFlags
)
fn child_get_property<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &mut Value
)
[src]
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &mut Value
)
fn child_set_property<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &Value
)
[src]
&self,
container: &P,
actor: &Q,
property_name: &str,
value: &Value
)
fn find_child_property(&self, name: &str) -> Option<ParamSpec>
[src]
fn get_child_meta<P: IsA<Container>, Q: IsA<Actor>>(
&self,
container: &P,
actor: &Q
) -> Option<LayoutMeta>
[src]
&self,
container: &P,
actor: &Q
) -> Option<LayoutMeta>
fn get_preferred_height<P: IsA<Container>>(
&self,
container: &P,
for_width: f32
) -> (f32, f32)
[src]
&self,
container: &P,
for_width: f32
) -> (f32, f32)
fn get_preferred_width<P: IsA<Container>>(
&self,
container: &P,
for_height: f32
) -> (f32, f32)
[src]
&self,
container: &P,
for_height: f32
) -> (f32, f32)
fn layout_changed(&self)
[src]
fn list_child_properties(&self) -> Vec<ParamSpec>ⓘ
[src]
fn set_container<P: IsA<Container>>(&self, container: Option<&P>)
[src]
fn connect_layout_changed<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId