edje: Move part_state_get to efl_part

This commit is contained in:
Jean-Philippe Andre 2017-05-26 11:53:27 +09:00
parent da2a7e6587
commit 11d4daf90a
7 changed files with 58 additions and 18 deletions

View File

@ -175,6 +175,18 @@ EAPI const char *edje_load_error_str (Edje_Load_Error error);
*/
EAPI Eina_Bool edje_object_part_geometry_get(const Edje_Object *obj, const char * part, int *x, int *y, int *w, int *h);
/**
* @brief Returns the state of the Edje part.
*
* @param[in] part The part name
* @param[out] val_ret Part state value
*
* @return The part state: "default" for the default state "" for other states
*
* @ingroup Edje_Object
*/
EAPI const char *edje_object_part_state_get(const Edje_Object *obj, const char * part, double *val_ret);
/**
* @brief Gets a handle to the Evas object implementing a given Edje part, in
* an Edje object.

View File

@ -39,3 +39,11 @@ edje_object_part_geometry_get(const Edje_Object *obj, const char *part, int *x,
if (h) *h = rp->h;
return EINA_TRUE;
}
EAPI const char *
edje_object_part_state_get(const Edje_Object *obj, const char * part, double *val_ret)
{
const char *str = "";
efl_canvas_layout_internal_state_get(efl_part(obj, part), &str, val_ret);
return str;
}

View File

@ -823,20 +823,6 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
group]]
}
}
@property part_state {
get {
[[Returns the state of the Edje part.]]
return: string; [[The part state:
"default" for the default state
"" for other states]]
}
keys {
part: string; [[The part name]]
}
values {
val_ret: double; [[Part state value]]
}
}
@property part_drag_value {
set {
[[Sets the dragable object location.

View File

@ -53,4 +53,15 @@ _efl_canvas_layout_internal_efl_gfx_geometry_get(Eo *obj EINA_UNUSED, Efl_Canvas
RETURN_VOID;
}
EOLIAN static void
_efl_canvas_layout_internal_state_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Internal_Data *pd, const char **name, double *val)
{
const char *str;
if (!name && !val) return;
str = _edje_object_part_state_get(pd->ed, pd->part, val);
if (name) *name = str;
RETURN_VOID;
}
#include "efl_canvas_layout_internal.eo.c"

View File

@ -2506,6 +2506,7 @@ void _edje_seat_emit(Edje *ed, Efl_Input_Device *dev, const char *sig, const cha
void _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*free_func)(void *));
void _edje_emit_handle(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *data, Eina_Bool prop);
void _edje_signals_sources_patterns_clean(Edje_Signals_Sources_Patterns *ssp);
const char * _edje_object_part_state_get(Edje *ed, const char *part, double *val_ret);
void _edje_focused_part_set(Edje *ed, const char *seat_name, Edje_Real_Part *rp);
Edje_Real_Part *_edje_focused_part_get(Edje *ed, const char *seat_name);

View File

@ -3950,8 +3950,8 @@ again:
}
/* FIXME: Correctly return other states */
EOLIAN const char *
_edje_object_part_state_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part, double *val_ret)
const char *
_edje_object_part_state_get(Edje *ed, const char *part, double *val_ret)
{
const char *ret;

View File

@ -1,9 +1,31 @@
class Efl.Canvas.Layout_Internal (Efl.Object, Efl.Gfx)
{
[[Common class for part proxy objects for $Efl.Canvas.Layout.]]
[[Common class for part proxy objects for $Efl.Canvas.Layout.
As an @Efl.Part implementation class, all objects of this class are meant
to be used for one and only one function call. In pseudo-code, the use
of object of this type looks like the following:
layout.part("somepart").geometry_get(&x, &y, &w, &h);
@since 1.20
]]
methods {
@property state {
[[The name and value of the current state of this part (read-only).
This is the state name as it appears in EDC description blocks. A
state has both a name and a value (double). The default state is
"default" 0.0.
]]
get {}
values {
state: string("default"); [[The name of the state.]]
val: double; [[The value of the state.]]
}
}
}
implements {
Efl.Object.finalize;
Efl.Gfx.geometry { get; }
//Efl.Gfx.Size.size { get; }
}
}