123 lines
4.9 KiB
Plaintext
123 lines
4.9 KiB
Plaintext
import efl_ui;
|
|
|
|
struct Efl.Ui.Position_Manager.Range_Update {
|
|
[[A structure containing the updated range of visible items in this position manger.]]
|
|
start_id : uint; [[The first item that is visible]]
|
|
end_id : uint; [[The last item that is visible]]
|
|
}
|
|
|
|
interface @beta Efl.Ui.Position_Manager.Entity extends Efl.Ui.Layout_Orientable
|
|
{
|
|
[[This abstracts the basic placement of items in a not-defined form under a viewport.
|
|
|
|
The interface gets a defined set of elements that is meant to be displayed.
|
|
The implementation provides a way to calculate the size that is required to display all items.
|
|
Every time this absolute size of items is changed, @[Efl.Ui.Position_Manager.Entity.content_size,changed] is
|
|
emitted.
|
|
]]
|
|
methods {
|
|
version {
|
|
[[Returns the version of Data_Access that is used.
|
|
This object needs to implement the interface @Efl.Ui.Position_Manager.Data_Access_V1 if 1 is returned.
|
|
]]
|
|
params {
|
|
max : int; [[The maximum version that is available from the data-provider.]]
|
|
}
|
|
return : int; [[The version that should be used here. 0 is an error.]]
|
|
}
|
|
@property viewport {
|
|
[[This is the position and size of the viewport, where elements are displayed in.
|
|
Entities outside this viewport will not be shown.]]
|
|
set {
|
|
|
|
}
|
|
values {
|
|
viewport : Eina.Rect;
|
|
}
|
|
}
|
|
@property scroll_position {
|
|
[[Move the items relative to the viewport.
|
|
|
|
The items that are managed with this position manager might be bigger than the actual viewport.
|
|
The positioning of the layer where all items are on is described by these values.
|
|
0.0,0.0 means that layer is moved that the top left items are shown,
|
|
1.0,1.0 means, that the lower right items are shown.
|
|
]]
|
|
set {
|
|
|
|
}
|
|
values {
|
|
x : double; [[X position of the scroller, valid form 0 to 1.0]]
|
|
y : double; [[Y position of the scroller, valid form 0 to 1.0]]
|
|
}
|
|
}
|
|
position_single_item {
|
|
[[Return the position and size of item idx.
|
|
|
|
This method returns the size and position of the item at $idx.
|
|
Even if the item is outside the viewport, the returned rectangle must be valid.
|
|
The result can be used for scrolling calculations.
|
|
]]
|
|
params {
|
|
idx : int; [[The id for the item]]
|
|
}
|
|
return : Eina.Rect; [[Position and Size in canvas coordinates.]]
|
|
}
|
|
item_added {
|
|
[[The new item $subobj has been added at the $added_index field.
|
|
|
|
The accessor provided through @Efl.Ui.Position_Manager.Data_Access_V1.data_access will contain updated
|
|
Entities.]]
|
|
params {
|
|
added_index : int;
|
|
subobj : Efl.Gfx.Entity;
|
|
}
|
|
}
|
|
item_removed {
|
|
[[The item $subobj previously at position $removed_index has been removed.
|
|
The accessor provided through @Efl.Ui.Position_Manager.Data_Access_V1.data_access will contain updated
|
|
Entities.
|
|
]]
|
|
params {
|
|
removed_index : int;
|
|
subobj : Efl.Gfx.Entity;
|
|
}
|
|
}
|
|
item_size_changed {
|
|
[[The size of the items from $start_id to $end_id have been changed.
|
|
The positioning and sizing of all items will be updated]]
|
|
params {
|
|
start_id : int; [[The first item that has a new size]]
|
|
end_id : int; [[The last item that has a new size]]
|
|
}
|
|
}
|
|
entities_ready {
|
|
[[The items from $start_id to $end_id now have their entities ready
|
|
|
|
The position manager will reapply the geometry to the elements if they are visible.
|
|
]]
|
|
params {
|
|
start_id : uint; [[The first item that is available]]
|
|
end_id : uint; [[The last item that is available]]
|
|
}
|
|
}
|
|
relative_item {
|
|
[[Translates the $current_id, into a new id which is oriented in the $direction of $current_id.
|
|
In case that there is no item, -1 is returned]]
|
|
params {
|
|
current_id : uint; [[The id where the direction is oriented at]]
|
|
direction : Efl.Ui.Focus.Direction; [[The direction where the new id is]]
|
|
}
|
|
return : int; [[The id of the item in that direction, or -1 if there is no item in that direction]]
|
|
}
|
|
}
|
|
events {
|
|
content_size,changed : Eina.Size2D; [[Emitted when the aggregate size of all items has changed.
|
|
This can be used to resize an enclosing Pan object.]]
|
|
content_min_size,changed : Eina.Size2D; [[Emitted when the minimum size of all items has changed.
|
|
The minimum size is the size that this position_manager needs
|
|
to display a single item.]]
|
|
visible_range,changed : Efl.Ui.Position_Manager.Range_Update;
|
|
}
|
|
}
|