Package edje :: Module c_edje :: Class Edje
[hide private]
[frames] | no frames]

Class Edje

        object --+    
                 |    
evas.c_evas.Object --+
                     |
                    Edje

Edje evas object.

This is a high level evas.SmartObject that is defined as a group of parts (evas.c_evas.Object, usually written in text files (.edc) and compiled as a package using EET to store resources (.edj).

Edje is an important EFL component because it makes easy to split logic and UI, usually used as theme engine but can be much more powerful than just changing some random images or text fonts.

Edje also provides scripting through Embryo and communication can be done using messages and signals.


Warning: although Edje provides part_object_get(), you should NOT mess with these objects states or you'll screw the given Edje. The objects you get with this function should be handled as "read-only".

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.

Note: You can debug messages and signals by capturing all of them, example:

>>> def sig_dbg(obj, emission, source):
...     print "%s: %s %s" % (obj, emission, source)
...
>>> my_edje.signal_callback_add("*", "*", sig_dbg)
>>> def msg_dbg(obj, msg):
...     print "%s: %s" % (obj, msg)
...
>>> my_edje.message_handler_set(msg_dbg)

Instance Methods [hide private]
 
__free_wrapper_resources(...)
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__repr__(...)
repr(x)
 
__str__(...)
str(x)
 
_set_common_params(...)
Set common parameters in one go.
bool
animation_get(...)
 
animation_set(...)
Set animation state.
 
calc_force(...)
Force recalculation of parts state (geometry, position, ...)
 
color_class_del(...)
 
color_class_set(...)
Set color class.
 
data_get(...)
Get data from Edje data collection (defined in .edj).
tuple for str
file_get(...)
 
file_set(...)
int
freeze(...)
This puts all changes on hold.
int
load_error_get(...)
 
message_handler_set(...)
Set the handler of messages comming from Embryo.
 
message_send(...)
Send message with given id and data.
 
message_signal_process(...)
Manually iterate message signal system.
int
part_drag_dir_get(...)
 
part_drag_page(...)
tuple of float
part_drag_page_get(...)
 
part_drag_page_set(...)
tuple of float
part_drag_size_get(...)
 
part_drag_size_set(...)
 
part_drag_step(...)
tuple of float
part_drag_step_get(...)
 
part_drag_step_set(...)
tuple of float
part_drag_value_get(...)
 
part_drag_value_set(...)
bool
part_exists(...)
tuple of int
part_geometry_get(...)
 
part_object_get(...)
Get evas.c_evas.Object that represents this part.
tuple of int
part_pos_get(...)
tuple of int
part_size_get(...)
(name, value)
part_state_get(...)
 
part_swallow(...)
Swallows an object into the edje
evas.c_evas.Object
part_swallow_get(...)
str
part_text_get(...)
 
part_text_select_all(...)
 
part_text_select_none(...)
 
part_text_set(...)
 
part_text_unescaped_get(...)
Automatically removes escape from text if using TEXTBLOCK.
 
part_text_unescaped_set(...)
Automatically escapes text if using TEXTBLOCK.
 
part_unswallow(...)
bool
play_get(...)
 
play_set(...)
Set the Edje to play or pause.
 
signal_callback_add(...)
Add callback to given signal (emission, source).
 
signal_callback_del(...)
Remove the callable associated with given emission and source.
 
signal_emit(...)
Emit signal with emission and source
tuple of int
size_max_get(...)
 
size_min_calc(...)
Request object to calculate minimum size.
tuple of int
size_min_get(...)
 
text_change_cb_set(...)
Set function to callback on text changes.
 
text_class_set(...)
Set text class.
 
thaw(...)
Thaw object.

Inherited from evas.c_evas.Object: clipees_get, evas_get, name_get, name_set, on_changed_size_hints_add, on_changed_size_hints_del, on_del_add, on_del_del, parent_get, size_hint_align_get, size_hint_align_set, size_hint_aspect_get, size_hint_aspect_set, size_hint_max_get, size_hint_max_set, size_hint_min_get, size_hint_min_set, size_hint_padding_get, size_hint_padding_set, size_hint_request_get, size_hint_request_set, size_hint_weight_get, size_hint_weight_set, type_get

Inherited from evas.c_evas.Object (private): _set_evas

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

    State manipulation

Inherited from evas.c_evas.Object: clip_get, clip_set, clip_unset, color_get, color_set, delete, hide, is_deleted, show, visible_get, visible_set

    Positioning

Inherited from evas.c_evas.Object: bottom_left_get, bottom_left_set, bottom_right_get, bottom_right_set, center_get, center_set, geometry_get, geometry_set, move, move_relative, pos_get, pos_set, resize, size_get, size_set, top_left_get, top_left_set, top_right_get, top_right_set

    Layer & Stack manipulation

Inherited from evas.c_evas.Object: above_get, below_get, bottom_get, layer_get, layer_set, lower, raise_, stack_above, stack_below, top_get

    Event processing control

Inherited from evas.c_evas.Object: focus_get, focus_set, pass_events_get, pass_events_set, propagate_events_get, propagate_events_set, repeat_events_get, repeat_events_set

    Event callbacks

Inherited from evas.c_evas.Object: event_callback_add, event_callback_del, on_focus_in_add, on_focus_in_del, on_focus_out_add, on_focus_out_del, on_free_add, on_free_del, on_hide_add, on_hide_del, on_hold_add, on_hold_del, on_key_down_add, on_key_down_del, on_key_up_add, on_key_up_del, on_mouse_down_add, on_mouse_down_del, on_mouse_in_add, on_mouse_in_del, on_mouse_move_add, on_mouse_move_del, on_mouse_out_add, on_mouse_out_del, on_mouse_up_add, on_mouse_up_del, on_mouse_wheel_add, on_mouse_wheel_del, on_move_add, on_move_del, on_resize_add, on_resize_del, on_restack_add, on_restack_del, on_show_add, on_show_del

    Often unused

Inherited from evas.c_evas.Object: anti_alias_get, anti_alias_set, color_interpolation_get, color_interpolation_set, pointer_mode_get, pointer_mode_set, render_op_get, render_op_set

Instance Variables [hide private]

Inherited from evas.c_evas.Object: clipees, data, evas, name, parent, rect, type

    State manipulation

Inherited from evas.c_evas.Object: clip, color, visible

    Positioning

Inherited from evas.c_evas.Object: bottom_left, bottom_right, center, geometry, pos, size, top_left, top_right

    Layer & Stack manipulation

Inherited from evas.c_evas.Object: above, below, layer

    Event processing control

Inherited from evas.c_evas.Object: focus, pass_events, propagate_events, repeat_events

    Often unused

Inherited from evas.c_evas.Object: anti_alias, color_interpolation, pointer_mode, render_op

Properties [hide private]
  animation
  play
  size_max
  size_min

Inherited from evas.c_evas.Object: size_hint_align, size_hint_aspect, size_hint_max, size_hint_min, size_hint_padding, size_hint_request, size_hint_weight

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(...)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(...)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

_set_common_params(...)

 

Set common parameters in one go.

Overrides: evas.c_evas.Object._set_common_params
(inherited documentation)

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.

file_set(...)

 
Raises:

freeze(...)

 

This puts all changes on hold.

Successive freezes will nest, requiring an equal number of thaws.

Returns: int

message_handler_set(...)

 

Set the handler of messages comming from Embryo.

Signature: function(object, message, *args, **kargs)

Raises:
  • TypeError - if func is not callable or None.

Attention: this just handle messages sent from Embryo.

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.

Raises:
  • TypeError - if data has no supported EdjeMessage counterpart.

part_object_get(...)

 

Get evas.c_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_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_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.

See Also:
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.

See Also:
part_text_set(), part_text_unescaped_get()

signal_callback_add(...)

 

Add callback to given signal (emission, source).

Signature: function(object, emission, source, *args, **kargs)

Raises:
  • TypeError - if func is not callable.

text_change_cb_set(...)

 

Set function to callback on text changes.

Signature: function(object, part, *args, **kargs)