efl.edje.Edje
Class¶efl.edje.
Edje
(Canvas canvas, file=None, group=None, size=None, geometry=None, **kwargs)¶Bases: efl.evas.Object
This is a high level efl.evas.SmartObject
that is defined as a
group of parts, usually written in text files (.edc) and compiled as a
package using EET to store resources (.edj).
Attention
messages are one way only! If you emit a message from Python you will just get it from your Embryo script, if you emit from Embryo you just get it in Python. If you want to emit events and capture them on the same side, use signals.
canvas (Canvas
) – Evas canvas for this object
file (string) – File name
group (string) – Group name
size (tuple of ints) – Min size for the object
geometry (tuple of ints) – Geometry for the object
**kwargs – All the remaining keyword arguments are interpreted as properties of the instance
animation_get
¶bool
animation_set
¶Set animation state.
base_scale
¶The base scale factor set in the edc collection.
float
New in version 1.12.
base_scale_get
¶calc_force
¶Force recalculation of parts state (geometry, position, …)
color_class_clear
¶Clear all object color classes.
True on success, False otherwise
bool
New in version 1.17.
color_class_del
¶Delete a specific color class.
color_class_get
¶Get a specific color class.
color_class – the name of the color class to query
the tuple (r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3)
tuple of int
color_class_set
¶Set color class.
color_class – color class name
r –
g –
b –
a –
r2 –
g2 –
b2 –
a2 –
r3 –
g3 –
b3 –
a3 –
data_get
¶Get data from Edje data collection (defined in .edj).
Data collection is defined inside an Edje file as:
collections {
group {
name: "a_group";
data {
item: "key1" "value1";
item: "key2" "value2";
}
}
}
Attention
this differs from Edje.data! Edje.data is a Python specific utility provided as a dictionary. This function returns data stored on the Edje (.edj), stored inside a data section inside the group that defines this object.
string
file_get
¶Get the file and group used to load the object.
the tuple (file, group)
tuple of str
file_set
¶Set the file (.edj) and the group to load the Edje object from.
file (string) – the name of the file to load
group (string) – the name of the group inside the edj to load
EdjeLoadError – if error occurred during load.
freeze
¶This puts all changes on hold.
Successive freezes will nest, requiring an equal number of thaws.
int
load_error_get
¶int
message_handler_set
¶Set the handler of messages coming from Embryo.
Signature:
function(object, message, *args, **kargs)
Note
this just handle messages sent from Embryo.
TypeError – if func is not callable or None.
message_send
¶Send message with given id and data.
Data should be pure-python types that will be converted to the Message subclass that better fits it. Supported are: - long, int, float, str - list of long, int, float, str - str and one of long, int, float - str and a list of one of long, int, float
Messages sent will NOT be available at Python-side (ie: message_handler_set()), but just at Embryo-side.
TypeError – if data has no supported EdjeMessage counterpart.
message_signal_process
¶Manually iterate message signal system.
mirrored
¶The RTL orientation for this object.
int
New in version 1.8.
mirrored_get
¶mirrored_set
¶part_box_append
¶Adds an item to a BOX part.
Appends an item to the BOX edje part, where some box’s properties inherited. Like the color properties has some nice effect on the box’s childrens.
part – the name of the BOX part
obj – the efl.evas.Object to append
bool
part_box_insert_after
¶Inserts an item in a BOX part after the reference object.
part – the name of the BOX part
obj – the efl.evas.Object to append
reference – the efl.evas.Object used as reference
bool
New in version 1.18.
part_box_insert_at
¶Inserts an item at the given position in a BOX part.
part – the name of the BOX part
obj – the efl.evas.Object to append
pos – the position to append the object
bool
part_box_insert_before
¶Inserts an item in a BOX part before the reference object.
part – the name of the BOX part
obj – the efl.evas.Object to append
reference – the efl.evas.Object used as reference
bool
part_box_prepend
¶Prepend an item to a BOX part.
Prepends an item to the BOX edje part, where some box’s properties inherited. Like the color properties has some nice effect on the box’s childrens.
part – the name of the BOX part
obj – the efl.evas.Object to append
bool
part_box_remove
¶Removes the object given from a BOX part.
Returns the object removed, or None if it wasn’t found or is internal to Edje.
part – the name of the BOX part
obj – the efl.evas.Object to remove
the removed object
efl.evas.Object or None
part_box_remove_all
¶Removes all objects from a BOX part.
part – the name of the BOX part to remove from.
clear – if 1, it will delete the objects it removes.
Note: this function doesn’t remove items created from the theme.
bool
part_box_remove_at
¶Removes the object at the given position in a BOX part.
Returns the object removed, or None nothing was found at the given position, or if the object was internal to Edje.
part – the name of the BOX part
pos – the position to remove from
the removed object
efl.evas.Object or None
part_drag_dir_get
¶int
part_drag_page
¶part_drag_page_get
¶tuple of float
part_drag_page_set
¶part_drag_size_get
¶tuple of float
part_drag_size_set
¶Set the drag size of part :param dw: :param dh:
part_drag_step
¶part_drag_step_get
¶tuple of float
part_drag_step_set
¶Set the drag step of part :param dx: :param dy:
part_drag_value_get
¶tuple of float
part_drag_value_set
¶Set the drag value of part :param dx: :param dy:
part_exists
¶bool
part_external_object_get
¶part_external_param_get
¶Get a parameter of the external part.
part – EXTERNAL part to set parameter.
param – EXTERNAL parameter name.
None for errors, other values depending on the parameter type.
part_external_param_set
¶Set a parameter of the external part.
part – EXTERNAL part to set parameter.
param – EXTERNAL parameter name.
value – value to set, type is guessed from it, so must be of types bool, int, float or str.
bool
part_geometry_get
¶tuple of int
part_object_get
¶Get the efl.evas.Object that represents this part.
Warning
You should never modify the state of the returned object (with Edje.move() or Edje.hide() for example), but you can safely query info about its current state (with Edje.visible_get() or Edje.color_get() for example).
part_pos_get
¶tuple of int
part_size_get
¶tuple of int
part_state_get
¶(name, value)
part_swallow
¶Swallows an object into the edje
Swallows the object into the edje part so that all geometry changes for the part affect the swallowed object. (e.g. resize, move, show, raise/lower, etc.).
If an object has already been swallowed into this part, then it will first be unswallowed before the new object is swallowed.
part (str) – the name of the SWALLOW part
obj (efl.evas.Object) – the efl.evas.Object to swallow inside part
part_swallow_get
¶part_table_child_get
¶Retrieve a child from a table.
part – the name of the TABLE part to get child from.
row – row index of the child.
column – column index of the child.
the object ath the given position
part_table_clear
¶Clears a TABLE part.
part – the name of the TABLE part to clear all its elements from.
clear – Delete objects when removed from the table.
Note
This function will not remove the elements defined by the theme.
bool
part_table_col_row_size_get
¶Returns the size in columns/rows of the TABLE part.
part – the anme of the TABLE part to get the size of.
the tuple (cols, rows)
tuple of int
part_table_pack
¶Pack an object inside a TABLE part.
part – name of the TABLE part to pack in.
child – efl.evas.Object to pack into the table.
col –
row –
colspan –
rowspan –
bool
part_table_unpack
¶Remove an object from a TABLE part.
part – the name of the TABLE part to remove from.
child – the efl.evas.Object to remove.
bool
part_text_get
¶Get the text of a given part.
the text of part
str
part_text_input_hint_get
¶Gets the value of input hint.
part (str) – the part name
New in version 1.12.
part_text_input_hint_set
¶Sets the input hint which allows input methods to fine-tune their behavior.
part (str) – the part name
input_hints (Edje_Input_Hints) – the hints to set
New in version 1.12.
part_text_prediction_hint_hash_del
¶Removes the prediction hint data identified by a key
part (str) – the part name
key (str) – the key of the prediction hint
True on success, False otherwise
New in version 1.21.
part_text_prediction_hint_hash_set
¶Sets the prediction hint data at the specified key
part (str) – the part name
key (str) – the key of the prediction hint
value (str) – the data to replace
True on success, False otherwise
New in version 1.21.
part_text_prediction_hint_set
¶Sets the prediction hint to use an intelligent reply suggestion service.
part (str) – the part name
hint (str) – the prediction hint text
New in version 1.20.
part_text_select_all
¶Select all the text of the given TEXT or TEXTBLOCK part
part_text_select_none
¶Deselect all the text of the given TEXT or TEXTBLOCK part
part_text_set
¶Set the text of a given part.
part – name of the text part to edit
text – the new text to set
part_text_unescaped_get
¶Automatically removes escape from text if using TEXTBLOCK.
Similar to part_text_get(), but if it is a textblock contents will be unescaped automatically.
part_text_get()
part_text_unescaped_set()
part_text_unescaped_set
¶Automatically escapes text if using TEXTBLOCK.
Similar to part_text_set(), but if it is a textblock contents will be escaped automatically so it is displayed without any formatting.
part_text_set()
part_text_unescaped_get()
part_unswallow
¶Unswallow the given object from the edje
parts_extends_calc
¶Calculate the geometry of the region, relative to a given Edje object’s area, occupied by all parts in the object
(x, y, w, h)
tuple of 4 ints
play_get
¶bool
play_set
¶Set the Edje to play or pause.
value (int) – True to play or False to pause
preload
¶Preload the images on the Edje Object in the background.
This function requests the preload of all data images in the background. The work is queued before being processed (because there might be other pending requests of this type). It emits the signal “preload,done” when finished.
cancel (bool) – True will add it the preloading work queue, False will remove it (if it was issued before).
bool
New in version 1.8.
scale
¶The scaling factor for a given Edje object.
float
New in version 1.8.
scale_get
¶scale_set
¶signal_callback_add
¶Add callback to given signal (emission, source).
Signature:
function(object, emission, source, *args, **kargs)
emission – the emission to listen, may be or contain ‘*’ to match multiple.
source – the emission’s source to listen, may be or contain ‘*’ to match multiple.
func – the callable to use. Will get any further arguments you gave to signal_callback_add().
TypeError – if func is not callable.
signal_callback_del
¶Remove the callable associated with given emission and source.
signal_emit
¶Emit signal with emission
and source
size_class_del
¶Delete the object size class.
This function deletes any values at the object level for the specified object and size class.
Note: Deleting the size class will revert it to the values defined by edje_size_class_set() or the size class defined in the theme file.
size_class (str) – The size class name
New in version 1.17.
size_class_get
¶Gets the object size class.
This function gets the min and max values for an object level size class. These values will only be valid until the size class is changed or the edje object is deleted.
size_class (str) – The size class name
(minw, minh, maxw, maxh)
4 int’s tuple
New in version 1.17.
size_class_set
¶Sets the object size class.
This function sets the min and max values for an object level size class. This will make all edje parts in the specified object that have the specified size class update their min and max size with given values.
size_class (str) – The size class name
minw (int) – The min width
minh (int) – The min height
maxw (int) – The max width
maxh (int) – The max height
True on success or False on error
bool
New in version 1.17.
size_max_get
¶tuple of int
size_min_calc
¶Request object to calculate minimum size.
size_min_get
¶tuple of int
size_min_restricted_calc
¶This call will trigger an internal recalculation of all parts of the object, in order to return its minimum required dimensions for width and height. The user might choose to impose those minimum sizes, making the resulting calculation to get values equal or bigger than minw and minh, for width and height, respectively.
At the end of this call, the object won’t be automatically resized to new dimensions, but just return the calculated sizes. The caller is the one up to change its geometry or not.
Be advised that invisible parts in the object obj will be taken into account in this calculation.
New in version 1.8.
text_change_cb_set
¶Set function to callback on text changes.
func –
The function to call when text change Expected signature:
function(object, part, *args, **kargs)
text_class_del
¶Delete the object text class.
This function deletes any values at the object level for the specified text class.
Note: deleting the text class will revert it to the values defined by edje_text_class_set() or the text class defined in the theme file.
text_class (string) – The text class name to be deleted
New in version 1.17.
text_class_get
¶Gets font and font size from edje text class.
This function gets the font and the font size from the object text class.
text_class (string) – The text class name to query
The font name and the font size
(font_name, font_size)
New in version 1.14.
text_class_set
¶Set text class.
text_class – text class name
font – the font name
size – the font size
thaw
¶Thaw (unfreeze) the object.
update_hints
¶Edje will automatically update the size hints on itself.
By default edje doesn’t set size hints on itself. With this property set to True it will do so. Be carefully, it cost a lot to trigger this feature as it will recalc the object every time it make sense to be sure that’s its minimal size hint is always accurate.
bool
New in version 1.8.
update_hints_get
¶update_hints_set
¶