efl/src/lib/elementary/efl_ui_position_manager_ent...

159 lines
7.3 KiB
Plaintext
Raw Normal View History

import efl_ui;
enum Efl.Ui.Position_Manager.Batch_Group_State{
[[Enum expressing the group related state of a item.]]
no_group = 0, [[This item is not a group item and is not part of any group.]]
group = 1, [[This item is a group item.]]
part_of_group = 2 [[This item is part of a group.]]
}
struct Efl.Ui.Position_Manager.Batch_Entity_Access{
[[Struct that is getting filled by the object function callback.]]
entity : Efl.Gfx.Entity; [[The canvas object.]]
group : Efl.Ui.Position_Manager.Batch_Group_State; [[If this is a group item.]]
}
struct Efl.Ui.Position_Manager.Batch_Size_Access{
[[Struct that is getting filled by the size function callback.]]
size : Eina.Size2D; [[The size of the element.]]
group : Efl.Ui.Position_Manager.Batch_Group_State; [[If this is a group item.]]
}
struct Efl.Ui.Position_Manager.Batch_Result {
[[Struct that is returned by the function callbacks.]]
group_id : int; [[The group of the first item. If the first item is a group, or the first item does not have a group, -1 will be the id]]
filled_items : int; [[The number of items that are filled into the slice]]
}
function Efl.Ui.Position_Manager.Batch_Access_Entity {
[[ Function callback for getting a batch of items.]]
params {
start_id : int; [[The id of the first item to fetch]]
memory : rw_slice<Efl.Ui.Position_Manager.Batch_Entity_Access>; [[The slice to fill the information in, the full slice will be filled if there are enough items]]
}
return: Efl.Ui.Position_Manager.Batch_Result; [[The returned stats of this function call.]]
};
function Efl.Ui.Position_Manager.Batch_Access_Size {
[[ Function callback for getting sizes of a batch of items]]
params {
start_id : int; [[The id of the first item to fetch]]
memory : rw_slice<Efl.Ui.Position_Manager.Batch_Size_Access>; [[The slice to fill the information in, the full slice will be filled if there are enough items]]
}
return: Efl.Ui.Position_Manager.Batch_Result; [[The returned stats of this function call]]
};
struct Efl.Ui.Position_Manager.Range_Update {
[[A struct containing the 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 absolut size of items is changed, content_size,changed is called.
]]
methods {
@property data_access {
[[This gives access to items to be managed. The manager reads this information and modifies the retrieved items' positions and sizes.
$obj_access gives access to the graphical entitites to manage. Some of them might be NULL, meaning they are not yet ready to be displayed. Their size in the $size_access array will be correct, though, so other entities can still be positioned correctly.
Typically, only entities inside the viewport will be retrieved.
$size_access gives access to the 2D sizes for the items to manage. All sizes will always be valid, and might change over time (indicated through the @.item_size_changed method).
The whole range might need to be traversed in order to calculate the position of all items in some arrangements.
You can access a batch of objects or sizes by calling the here passed function callbacks. Further details can be found at the function definitions.
]]
set {
}
values {
obj_access : Efl.Ui.Position_Manager.Batch_Access_Entity; [[Function callback for canvas objects, even if the start_id is valid, the returned objects may be NULL]]
size_access : Efl.Ui.Position_Manager.Batch_Access_Size; [[Function callback for the size, returned values are always valid, but might be changed / updated]]
size : int; [[valid size for start_id, 0 <= i < size]]
}
}
@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 coordinations]]
}
item_added {
[[The new item $subobj has been added at the $added_index field.
The accessor provided through @.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 @.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]]
}
}
relative_item {
[[translate 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 at *least* to display a single item.]]
visible_range,changed : Efl.Ui.Position_Manager.Range_Update;
}
}