gtkmm 4.16.0
|
The description of a constraint. More...
#include <gtkmm/constraint.h>
Classes | |
class | Strength_Wrapper |
Wrapper for enum Strength. More... | |
Public Types | |
enum class | Attribute { NONE , LEFT , RIGHT , TOP , BOTTOM , START , END , WIDTH , HEIGHT , CENTER_X , CENTER_Y , BASELINE } |
enum class | Relation { LE = -1 , EQ , GE } |
using | Strength = Strength_Wrapper::Strength |
Strength enumerators are scoped by the wrapper class and can be implicitly converted to int. | |
Public Member Functions | |
Constraint (Constraint &&src) noexcept | |
Constraint & | operator= (Constraint &&src) noexcept |
~Constraint () noexcept override | |
GtkConstraint * | gobj () |
Provides access to the underlying C GObject. | |
const GtkConstraint * | gobj () const |
Provides access to the underlying C GObject. | |
GtkConstraint * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< ConstraintTarget > | get_target () |
Retrieves the Gtk::ConstraintTarget used as the target for the constraint. | |
Glib::RefPtr< const ConstraintTarget > | get_target () const |
Retrieves the Gtk::ConstraintTarget used as the target for the constraint. | |
Attribute | get_target_attribute () const |
Retrieves the attribute of the target to be set by the constraint. | |
Glib::RefPtr< ConstraintTarget > | get_source () |
Retrieves the Gtk::ConstraintTarget used as the source for the constraint. | |
Glib::RefPtr< const ConstraintTarget > | get_source () const |
Retrieves the Gtk::ConstraintTarget used as the source for the constraint. | |
Attribute | get_source_attribute () const |
Retrieves the attribute of the source to be read by the constraint. | |
Relation | get_relation () const |
The order relation between the terms of the constraint. | |
double | get_multiplier () const |
Retrieves the multiplication factor applied to the source attribute's value. | |
double | get_constant () const |
Retrieves the constant factor added to the source attributes' value. | |
int | get_strength () const |
Retrieves the strength of the constraint. | |
bool | is_required () const |
Checks whether the constraint is a required relation for solving the constraint layout. | |
bool | is_attached () const |
Checks whether the constraint is attached to a Gtk::ConstraintLayout, and it is contributing to the layout. | |
bool | is_constant () const |
Checks whether the constraint describes a relation between an attribute on the property_target() and a constant value. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ConstraintTarget > > | property_target () const |
The target of the constraint. | |
Glib::PropertyProxy_ReadOnly< Attribute > | property_target_attribute () const |
The attribute of the property_target() set by the constraint. | |
Glib::PropertyProxy_ReadOnly< Relation > | property_relation () const |
The order relation between the terms of the constraint. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ConstraintTarget > > | property_source () const |
The source of the constraint. | |
Glib::PropertyProxy_ReadOnly< Attribute > | property_source_attribute () const |
The attribute of the property_source() read by the constraint. | |
Glib::PropertyProxy_ReadOnly< double > | property_multiplier () const |
The multiplication factor to be applied to the property_source_attribute(). | |
Glib::PropertyProxy_ReadOnly< double > | property_constant () const |
The constant value to be added to the property_source_attribute(). | |
Glib::PropertyProxy_ReadOnly< int > | property_strength () const |
The strength of the constraint. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
static Glib::RefPtr< Constraint > | create (const Glib::RefPtr< ConstraintTarget > & target, Attribute target_attribute, Relation relation, const Glib::RefPtr< ConstraintTarget > &source, Attribute source_attribute, double multiplier, double constant, int strength) |
Creates a new Gtk::Constraint representing a relation between a layout attribute on a source and a layout attribute on a target. | |
static Glib::RefPtr< Constraint > | create (const Glib::RefPtr< ConstraintTarget > & target, Attribute target_attribute, Relation relation, double constant, int strength) |
Creates a new Gtk::Constraint representing a relation between a layout attribute on a target and a constant value. | |
Protected Member Functions | |
Constraint (const Glib::RefPtr< ConstraintTarget > & target, Attribute target_attribute, Relation relation, const Glib::RefPtr< ConstraintTarget > &source, Attribute source_attribute, double multiplier, double constant, int strength) | |
Constraint (const Glib::RefPtr< ConstraintTarget > & target, Attribute target_attribute, Relation relation, double constant, int strength) | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::Constraint > | wrap (GtkConstraint *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
The description of a constraint.
Gtk::Constraint describes a constraint between an attribute on a widget and another attribute on another widget, expressed as a linear equation like:
target.attr1 = source.attr2 × multiplier + constant
Each Constraint is part of a system that will be solved by a Gtk::ConstraintLayout in order to allocate and position each child widget.
A Constraint is immutable once it's created.
|
strong |
Enumerator | |
---|---|
NONE | No attribute, used for constant relations. |
LEFT | The left edge of a widget, regardless of text direction. |
RIGHT | The right edge of a widget, regardless of text direction. |
TOP | The top edge of a widget. |
BOTTOM | The bottom edge of a widget. |
START | The leading edge of a widget, depending on text direction; equivalent to Gtk::Constraint::Attribute::LEFT for LTR languages, and Gtk::Constraint::Attribute::RIGHT for RTL ones. |
END | The trailing edge of a widget, depending on text direction; equivalent to Gtk::Constraint::Attribute::RIGHT for LTR languages, and Gtk::Constraint::Attribute::LEFT for RTL ones. |
WIDTH | The width of a widget. |
HEIGHT | The height of a widget. |
CENTER_X | The center of a widget, on the horizontal axis. |
CENTER_Y | The center of a widget, on the vertical axis. |
BASELINE | The baseline of a widget. |
|
strong |
|
noexcept |
|
overridenoexcept |
|
explicitprotected |
|
explicitprotected |
|
static |
Creates a new Gtk::Constraint representing a relation between a layout attribute on a source and a layout attribute on a target.
target | A Gtk::ConstraintTarget or an empty Glib::RefPtr. |
target_attribute | The attribute of target to be set. |
relation | The relation equivalence between target_attribute and source_attribute. |
source | A Gtk::ConstraintTarget or an empty Glib::RefPtr. |
source_attribute | The attribute of source to be read. |
multiplier | A multiplication factor to be applied to source_attribute. |
constant | A constant to be added to source_attribute. |
strength | The strength of the constraint. |
|
static |
Creates a new Gtk::Constraint representing a relation between a layout attribute on a target and a constant value.
target | A Gtk::ConstraintTarget or an empty Glib::RefPtr. |
target_attribute | The attribute of target to be set. |
relation | The relation equivalence between target_attribute and constant. |
constant | A constant to be set on target_attribute. |
strength | The strength of the constraint. |
double Gtk::Constraint::get_constant | ( | ) | const |
Retrieves the constant factor added to the source attributes' value.
double Gtk::Constraint::get_multiplier | ( | ) | const |
Retrieves the multiplication factor applied to the source attribute's value.
Relation Gtk::Constraint::get_relation | ( | ) | const |
The order relation between the terms of the constraint.
Glib::RefPtr< ConstraintTarget > Gtk::Constraint::get_source | ( | ) |
Retrieves the Gtk::ConstraintTarget used as the source for the constraint.
If the source is set to nullptr
at creation, the constraint will use the widget using the Gtk::ConstraintLayout as the source.
Glib::RefPtr< const ConstraintTarget > Gtk::Constraint::get_source | ( | ) | const |
Retrieves the Gtk::ConstraintTarget used as the source for the constraint.
If the source is set to nullptr
at creation, the constraint will use the widget using the Gtk::ConstraintLayout as the source.
Attribute Gtk::Constraint::get_source_attribute | ( | ) | const |
Retrieves the attribute of the source to be read by the constraint.
int Gtk::Constraint::get_strength | ( | ) | const |
Retrieves the strength of the constraint.
Glib::RefPtr< ConstraintTarget > Gtk::Constraint::get_target | ( | ) |
Retrieves the Gtk::ConstraintTarget used as the target for the constraint.
If the targe is set to nullptr
at creation, the constraint will use the widget using the Gtk::ConstraintLayout as the target.
Gtk::ConstraintTarget
. Glib::RefPtr< const ConstraintTarget > Gtk::Constraint::get_target | ( | ) | const |
Retrieves the Gtk::ConstraintTarget used as the target for the constraint.
If the targe is set to nullptr
at creation, the constraint will use the widget using the Gtk::ConstraintLayout as the target.
Gtk::ConstraintTarget
. Attribute Gtk::Constraint::get_target_attribute | ( | ) | const |
Retrieves the attribute of the target to be set by the constraint.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkConstraint * Gtk::Constraint::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gtk::Constraint::is_attached | ( | ) | const |
Checks whether the constraint is attached to a Gtk::ConstraintLayout, and it is contributing to the layout.
true
if the constraint is attached. bool Gtk::Constraint::is_constant | ( | ) | const |
Checks whether the constraint describes a relation between an attribute on the property_target() and a constant value.
true
if the constraint is a constant relation. bool Gtk::Constraint::is_required | ( | ) | const |
Checks whether the constraint is a required relation for solving the constraint layout.
true
if the constraint is required.
|
noexcept |
Glib::PropertyProxy_ReadOnly< double > Gtk::Constraint::property_constant | ( | ) | const |
The constant value to be added to the property_source_attribute().
Default value: 0
Glib::PropertyProxy_ReadOnly< double > Gtk::Constraint::property_multiplier | ( | ) | const |
The multiplication factor to be applied to the property_source_attribute().
Default value: 1
Glib::PropertyProxy_ReadOnly< Relation > Gtk::Constraint::property_relation | ( | ) | const |
The order relation between the terms of the constraint.
Default value: Gtk::Constraint::Relation::EQ
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ConstraintTarget > > Gtk::Constraint::property_source | ( | ) | const |
The source of the constraint.
The constraint will set the property_target_attribute() property of the target using the property_source_attribute() property of the source.
Glib::PropertyProxy_ReadOnly< Attribute > Gtk::Constraint::property_source_attribute | ( | ) | const |
The attribute of the property_source() read by the constraint.
Default value: Gtk::Constraint::Attribute::NONE
Glib::PropertyProxy_ReadOnly< int > Gtk::Constraint::property_strength | ( | ) | const |
The strength of the constraint.
The strength can be expressed either using one of the symbolic values of the Gtk::ConstraintStrength enumeration, or any positive integer value.
Default value: 1001001000
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ConstraintTarget > > Gtk::Constraint::property_target | ( | ) | const |
The target of the constraint.
The constraint will set the property_target_attribute() property of the target using the property_source_attribute() property of the source widget.
Glib::PropertyProxy_ReadOnly< Attribute > Gtk::Constraint::property_target_attribute | ( | ) | const |
The attribute of the property_target() set by the constraint.
Default value: Gtk::Constraint::Attribute::NONE
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |