lib/edje/efl_canvas_layout_internal_table.eo \
lib/edje/efl_canvas_layout_internal_swallow.eo \
lib/edje/efl_canvas_layout_external.eo \
+ lib/edje/efl_canvas_layout_internal_text.eo \
lib/edje/edje_edit.eo
edje_eolian_type_files = \
lib/edje/edje_part_external.c \
lib/edje/edje_part_swallow.c \
lib/edje/edje_part_table.c \
-lib/edje/edje_part_box.c
+lib/edje/edje_part_box.c \
+lib/edje/edje_part_text.c
lib_edje_libedje_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EDJE_COMMON_CPPFLAGS)
lib_edje_libedje_la_LIBADD = @EDJE_LIBS@ @EDJE_LUA_LIBS@
#include "efl_canvas_layout_internal_box.eo.h"
#include "efl_canvas_layout_internal_table.eo.h"
#include "efl_canvas_layout_internal_swallow.eo.h"
+#include "efl_canvas_layout_internal_text.eo.h"
#include "efl_canvas_layout_external.eo.h"
EAPI Eina_Bool edje_object_part_drag_page(Edje_Object *obj, const char *part, double dx, double dy);
/**
- * @}
+ * @brief Sets a given text to an Edje object @c TEXT or TEXTBLOCK
+ * parts.
+ *
+ * @param[in] part The part name
+ * @param[in] text The text to set on that part
+ *
+ * @ingroup Edje_Object
+ */
+EAPI Eina_Bool edje_object_part_text_set(const Edje_Object *obj, const char *part, const char *text);
+
+/**
+ * @brief Gets the text currntly set to the given part
+ *
+ * @param[in] part The part name
+ *
+ * @return The text set on the part, @c null otherwise.
+ *
+ * @ingroup Edje_Object
*/
+EAPI const char * edje_object_part_text_get(const Edje_Object *obj, const char *part);
+/**
+ * @}
+ */
#include "edje_object.eo.legacy.h"
#include "edje_edit.eo.legacy.h"
data: void_ptr; [[The data associated to the callback function.]]
}
}
- @property part_text {
- set {
- [[Sets the text for an object part]]
- return: bool; [[$true on success, $false otherwise]]
- }
- get {
- [[Returns the text of the object part.
-
- This function returns the text associated to the object part.
-
- See also @.part_text.set().]]
- }
- keys {
- part: string; [[The part name]]
- }
- values {
- text: string; [[The text string]]
- }
- }
@property part_text_escaped {
set {
[[Sets the text for an object part, but converts HTML escapes to UTF8
PROXY_INIT(table)
PROXY_INIT(swallow)
PROXY_INIT(external)
+PROXY_INIT(text)
PROXY_INIT(other)
void
_table_shutdown();
_swallow_shutdown();
_external_shutdown();
+ _text_shutdown();
_other_shutdown();
}
--- /dev/null
+#include "edje_private.h"
+#include "edje_part_helper.h"
+#include "efl_canvas_layout_internal_text.eo.h"
+#define MY_CLASS EFL_CANVAS_LAYOUT_INTERNAL_TEXT_CLASS
+
+PROXY_IMPLEMENTATION(text, INTERNAL_TEXT, EINA_FALSE)
+#undef PROXY_IMPLEMENTATION
+
+EOLIAN static void
+_efl_canvas_layout_internal_text_efl_text_text_set(Eo *obj,
+ void *_pd EINA_UNUSED, const char *text)
+{
+ PROXY_DATA_GET(obj, pd);
+ _edje_efl_text_set(obj, pd->ed, pd->part, text);
+}
+
+EOLIAN static const char *
+_efl_canvas_layout_internal_text_efl_text_text_get(Eo *obj,
+ void *_pd EINA_UNUSED)
+{
+ PROXY_DATA_GET(obj, pd);
+ RETURN_VAL(_edje_efl_text_get(obj, pd->ed, pd->part));
+}
+
+#include "efl_canvas_layout_internal_text.eo.c"
+
Evas_Object *_edje_object_part_external_object_get(Edje *ed, const char *part);
Evas_Object *_edje_object_part_external_content_get(Edje *ed, const char *part, const char *content);
+/* part text */
+Eo *_edje_text_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
+Eina_Bool _edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text);
+const char *_edje_efl_text_get(Eo *obj, Edje *ed, const char *part);
+
void _edje_internal_proxy_shutdown(void);
// Svg loader
eud->u.string.type = type;
}
-EOLIAN Eina_Bool
-_edje_object_part_text_set(Eo *obj, Edje *ed, const char *part, const char *text)
+Eina_Bool
+_edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text)
{
Edje_Real_Part *rp;
Eina_Bool int_ret;
return int_ret;
}
-EOLIAN const char *
-_edje_object_part_text_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part)
+const char *
+_edje_efl_text_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part)
{
Edje_Real_Part *rp;
return _edje_swallow_internal_proxy_get(obj, ed, rp);
else if (rp->part->type == EDJE_PART_TYPE_EXTERNAL)
return _edje_external_internal_proxy_get(obj, ed, rp);
+ else if (rp->part->type == EDJE_PART_TYPE_TEXT)
+ return _edje_text_internal_proxy_get(obj, ed, rp);
+ else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
+ return _edje_text_internal_proxy_get(obj, ed, rp);
else
return _edje_other_internal_proxy_get(obj, ed, rp);
}
return efl_content_get(efl_part(obj, part));
}
+EAPI Eina_Bool
+edje_object_part_text_set(const Edje_Object *obj, const char *part, const char *text)
+{
+ efl_text_set(efl_part(obj, part), text);
+ return EINA_TRUE;
+}
+
+EAPI const char *
+edje_object_part_text_get(const Edje_Object *obj, const char *part)
+{
+ return efl_text_get(efl_part(obj, part));
+}
+
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
--- /dev/null
+class Efl.Canvas.Layout_Internal.Text (Efl.Canvas.Layout_Internal, Efl.Text)
+{
+ [[Represents a TEXT part of a layout
+
+ Its lifetime is limited to one function call only, unless an extra
+ reference is explicitely held.
+ ]]
+ data: null;
+ implements {
+ Efl.Text.text { set; get; }
+ }
+}
snprintf(buf, sizeof(buf), "%i:%02i:%02i.%02i / %i:%02i:%02i",
ph, pm, ps, pf, lh, lm, ls);
- edje_obj_part_text_set(edje, "video_progress_txt", buf);
+ efl_text_set(efl_part(edje, "video_progress_txt"), buf);
}
static void
alpha = 255 * y;
efl_gfx_color_set(ov, alpha, alpha, alpha, alpha);
snprintf(buf, sizeof(buf), "alpha %.0f", alpha);
- edje_obj_part_text_set(o, "video_alpha_txt", buf);
+ efl_text_set(efl_part(o, "video_alpha_txt"), buf);
}
static void
efl_ui_drag_value_get(efl_part(o, source), NULL, &vol);
emotion_object_audio_volume_set(ov, vol);
snprintf(buf, sizeof(buf), "vol %.2f", vol);
- edje_obj_part_text_set(o, "video_volume_txt", buf);
+ efl_text_set(efl_part(o, "video_volume_txt"), buf);
}
static void
edje_obj_signal_callback_add(oe, "frame_resize", "stop", video_obj_signal_frame_resize_stop_cb, oe);
edje_obj_signal_callback_add(oe, "mouse, move", "*", video_obj_signal_frame_move_cb, oe);
efl_ui_drag_value_set(efl_part(oe, "video_alpha"), 0.0, 1.0);
- edje_obj_part_text_set(oe, "video_alpha_txt", "alpha 255");
+ efl_text_set(efl_part(oe, "video_alpha_txt"), "alpha 255");
efl_ui_drag_value_set(efl_part(oe, "video_volume"), 0.0, 0.5);
- edje_obj_part_text_set(oe, "video_volume_txt", "vol 0.50");
+ efl_text_set(efl_part(oe, "video_volume_txt"), "vol 0.50");
edje_obj_signal_emit(oe, "video_state", "play");
efl_gfx_visible_set(oe, EINA_TRUE);
}