summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-07-19 18:31:16 +0100
committerTom Hacohen <tom@stosb.com>2014-08-11 13:34:55 +0100
commit0fc1c492d42fbf415b3fccf5aa5583007c8964e6 (patch)
tree87a51c1f8e395d7685dfc775725e94559cf052d0
parent189b9537c671a67dd7f977755f928a5a9a91eacc (diff)
downloadefl-0fc1c492d42fbf415b3fccf5aa5583007c8964e6.tar.gz
Efl interfaces: Start using the text_properties interface.
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile_Ecore_Cxx.am1
-rw-r--r--src/Makefile_Efl_Cxx.am3
-rw-r--r--src/Makefile_Evas_Cxx.am1
-rw-r--r--src/lib/edje/edje_text.c42
-rw-r--r--src/lib/efl/Efl.h1
-rw-r--r--src/lib/efl/interfaces/efl_interface_text_properties.eo30
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c1
-rw-r--r--src/lib/evas/Evas_Eo.h2
-rw-r--r--src/lib/evas/Evas_Legacy.h147
-rw-r--r--src/lib/evas/canvas/evas_object_text.c38
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c38
-rw-r--r--src/lib/evas/canvas/evas_text.eo60
-rw-r--r--src/lib/evas/canvas/evas_textgrid.eo87
14 files changed, 279 insertions, 173 deletions
diff --git a/configure.ac b/configure.ac
index f490f88f72..d32e8aee49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1553,6 +1553,7 @@ EFL_PLATFORM_DEPEND([EVAS], [all])
EFL_INTERNAL_DEPEND_PKG([EVAS], [eo])
EFL_INTERNAL_DEPEND_PKG([EVAS], [eet])
EFL_INTERNAL_DEPEND_PKG([EVAS], [eina])
+EFL_INTERNAL_DEPEND_PKG([EVAS], [efl])
EFL_ADD_LIBS([EVAS], [-lm])
diff --git a/src/Makefile_Ecore_Cxx.am b/src/Makefile_Ecore_Cxx.am
index 5e63415c43..3db71dbbb7 100644
--- a/src/Makefile_Ecore_Cxx.am
+++ b/src/Makefile_Ecore_Cxx.am
@@ -51,6 +51,7 @@ tests_ecore_cxx_ecore_cxx_suite_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@
tests_ecore_cxx_cxx_compile_test_SOURCES = tests/ecore_cxx/cxx_compile_test.cc
tests_ecore_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
+-I$(top_builddir)/src/lib/efl/interfaces/ \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_cxx\" \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_cxx\" \
@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EINA_CFLAGS@ \
diff --git a/src/Makefile_Efl_Cxx.am b/src/Makefile_Efl_Cxx.am
index 30a4f9a9bf..43eb8ebce3 100644
--- a/src/Makefile_Efl_Cxx.am
+++ b/src/Makefile_Efl_Cxx.am
@@ -3,7 +3,8 @@ if HAVE_CXX11
### Generated headers
generated_efl_cxx_bindings = \
- lib/efl/interfaces/efl_interface_file.eo.hh
+ lib/efl/interfaces/efl_interface_file.eo.hh \
+ lib/efl/interfaces/efl_interface_text_properties.eo.hh
lib/efl/Efl.hh: $(generated_efl_cxx_bindings)
@echo -e "#ifndef EFL_CXX_EDJE_HH\n#define EFL_CXX_EDJE_HH\n" > $(top_builddir)/src/lib/efl/Efl.hh
diff --git a/src/Makefile_Evas_Cxx.am b/src/Makefile_Evas_Cxx.am
index 57da81ee4e..45155c1c0e 100644
--- a/src/Makefile_Evas_Cxx.am
+++ b/src/Makefile_Evas_Cxx.am
@@ -52,6 +52,7 @@ TESTS += tests/evas_cxx/cxx_compile_test
tests_evas_cxx_cxx_compile_test_SOURCES = tests/evas_cxx/cxx_compile_test.cc
tests_evas_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
+ -I$(top_builddir)/src/lib/efl/interfaces/ \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/evas_cxx\" \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/evas_cxx\" \
@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \
diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c
index c820e0bb9e..b38c284577 100644
--- a/src/lib/edje/edje_text.c
+++ b/src/lib/edje/edje_text.c
@@ -98,7 +98,7 @@ _edje_text_fit_x(Edje *ed, Edje_Real_Part *ep,
eo_do(ep->object,
evas_obj_text_ellipsis_set(params->type.text.ellipsis),
- evas_obj_text_font_set(font, size),
+ efl_interface_text_properties_font_set(font, size),
evas_obj_text_set(text),
evas_obj_size_set(sw, sh));
@@ -288,12 +288,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
{
eo_do(ep->object,
- if (inlined_font) evas_obj_text_font_source_set(ed->path);
- else evas_obj_text_font_source_set(NULL);
+ if (inlined_font) efl_interface_text_properties_font_source_set(ed->path);
+ else efl_interface_text_properties_font_source_set(NULL);
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, size);
+ efl_interface_text_properties_font_set(font, size);
evas_obj_text_set(text));
part_get_geometry(ep, &tw, &th);
@@ -304,12 +304,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
eo_do(ep->object,
- if (inlined_font) evas_obj_text_font_source_set(ed->path);
- else evas_obj_text_font_source_set(NULL);
+ if (inlined_font) efl_interface_text_properties_font_source_set(ed->path);
+ else efl_interface_text_properties_font_source_set(NULL);
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, size));
+ efl_interface_text_properties_font_set(font, size));
part_get_geometry(ep, &tw, &th);
}
@@ -328,12 +328,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
eo_do(ep->object,
- if (inlined_font) evas_obj_text_font_source_set(ed->path);
- else evas_obj_text_font_source_set(NULL);
+ if (inlined_font) efl_interface_text_properties_font_source_set(ed->path);
+ else efl_interface_text_properties_font_source_set(NULL);
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, size);
+ efl_interface_text_properties_font_set(font, size);
evas_obj_text_set(text));
part_get_geometry(ep, &tw, &th);
@@ -353,11 +353,11 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
eo_do(ep->object,
- if (inlined_font) evas_obj_text_font_source_set(ed->path);
- else evas_obj_text_font_source_set(NULL);
+ if (inlined_font) efl_interface_text_properties_font_source_set(ed->path);
+ else efl_interface_text_properties_font_source_set(NULL);
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, size));
+ efl_interface_text_properties_font_set(font, size));
part_get_geometry(ep, &tw, &th);
if ((size > 0) && (th == 0)) break;
@@ -370,7 +370,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
eo_do(ep->object,
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, 10));
+ efl_interface_text_properties_font_set(font, 10));
part_get_geometry(ep, &tw, &th);
@@ -392,7 +392,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
eo_do(ep->object,
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, current));
+ efl_interface_text_properties_font_set(font, current));
part_get_geometry(ep, &tw, &th);
@@ -408,7 +408,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
eo_do(ep->object,
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, current));
+ efl_interface_text_properties_font_set(font, current));
part_get_geometry(ep, &tw, &th);
} while (th <= sh);
@@ -429,8 +429,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
if (!chosen_desc->text.min_x)
{
eo_do(ep->object,
- if (inlined_font) evas_obj_text_font_source_set(ed->path);
- else evas_obj_text_font_source_set(NULL));
+ if (inlined_font) efl_interface_text_properties_font_source_set(ed->path);
+ else efl_interface_text_properties_font_source_set(NULL));
text = _edje_text_fit_x(ed, ep, params,
text, font, size,
@@ -472,12 +472,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
arrange_text:
eo_do(ep->object,
- if (inlined_font) evas_obj_text_font_source_set(ed->path);
- else evas_obj_text_font_source_set(NULL);
+ if (inlined_font) efl_interface_text_properties_font_source_set(ed->path);
+ else efl_interface_text_properties_font_source_set(NULL);
if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
- evas_obj_text_font_set(font, size),
+ efl_interface_text_properties_font_set(font, size),
evas_obj_text_set(text));
part_get_geometry(ep, &tw, &th);
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index dbc8ddb5f7..3962093a05 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -5,5 +5,6 @@
/* Interfaces */
#include "interfaces/efl_interface_file.eo.h"
+#include "interfaces/efl_interface_text_properties.eo.h"
#endif
diff --git a/src/lib/efl/interfaces/efl_interface_text_properties.eo b/src/lib/efl/interfaces/efl_interface_text_properties.eo
index 31c6088079..785209a6c7 100644
--- a/src/lib/efl/interfaces/efl_interface_text_properties.eo
+++ b/src/lib/efl/interfaces/efl_interface_text_properties.eo
@@ -1,4 +1,6 @@
-interface Efl_Interface_Text_Properties {
+type Efl_Font_Size: int;
+
+interface Efl.Interface.Text_Properties {
legacy_prefix: null;
properties {
font {
@@ -28,7 +30,31 @@ interface Efl_Interface_Text_Properties {
}
values {
const(char) *font; /*@ The font family name or filename. */
- Evas_Font_Size size; /*@ The font size, in points. */
+ Efl_Font_Size size; /*@ The font size, in points. */
+ }
+ }
+ font_source {
+ set {
+ /*@
+ Set the font (source) file to be used on a given text object.
+
+ This function allows the font file to be explicitly set for a given
+ text object, overriding system lookup, which will first occur in
+ the given file's contents.
+
+ @see evas_object_text_font_get() */
+ }
+ get {
+ /*@
+ Get the font file's path which is being used on a given text
+ object.
+
+ @return The font file's path.
+
+ @see evas_object_text_font_get() for more details */
+ }
+ values {
+ const(char)* font_source; /*@ The font file's path. */
}
}
}
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index 62fbce712b..d1a407f35e 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -5,3 +5,4 @@
#include <Efl.h>
#include "interfaces/efl_interface_file.eo.c"
+#include "interfaces/efl_interface_text_properties.eo.c"
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index 5f578cf966..e46014fa17 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -4,6 +4,8 @@
#include <Eo.h>
+#include <Efl.h>
+
EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_IN;
EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_OUT;
EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE;
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 012c4d108c..7b4aae8541 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -1288,6 +1288,67 @@ EAPI Evas_Object *evas_object_text_add(Evas *e) EINA_WARN_UNUSED_RESULT
#include "canvas/evas_text.eo.legacy.h"
/**
+ *
+ * Set the font (source) file to be used on a given text object.
+ *
+ * This function allows the font file to be explicitly set for a given
+ * text object, overriding system lookup, which will first occur in
+ * the given file's contents.
+ *
+ * @see evas_object_text_font_get()
+ *
+ * @param[in] font_source The font file's path.
+ */
+EAPI void evas_object_text_font_source_set(Eo *obj, const char *font_source);
+
+/**
+ *
+ * Get the font file's path which is being used on a given text
+ * object.
+ *
+ * @return The font file's path.
+ *
+ * @see evas_object_text_font_get() for more details
+ *
+ */
+EAPI const char *evas_object_text_font_source_get(const Eo *obj);
+
+/**
+ *
+ * Set the font family or filename, and size on a given text object.
+ *
+ * This function allows the font name and size of a text object to be
+ * set. The @p font string has to follow fontconfig's convention on
+ * naming fonts, as it's the underlying library used to query system
+ * fonts by Evas (see the @c fc-list command's output, on your system,
+ * to get an idea). Alternatively, one can use a full path to a font file.
+ *
+ * @see evas_object_text_font_get()
+ * @see evas_object_text_font_source_set()
+ *
+ * @param[in] font The font family name or filename.
+ * @param[in] size The font size, in points.
+ */
+EAPI void evas_object_text_font_set(Eo *obj, const char *font, Evas_Font_Size size);
+
+/**
+ *
+ * Retrieve the font family and size in use on a given text object.
+ *
+ * This function allows the font name and size of a text object to be
+ * queried. Be aware that the font name string is still owned by Evas
+ * and should @b not have free() called on it by the caller of the
+ * function.
+ *
+ * @see evas_object_text_font_set()
+ *
+ * @param[out] font The font family name or filename.
+ * @param[out] size The font size, in points.
+ */
+EAPI void evas_object_text_font_get(const Eo *obj, const char **font, Evas_Font_Size *size);
+
+
+/**
* @}
*/
@@ -1368,6 +1429,92 @@ EAPI Evas_Object *evas_object_textgrid_add(Evas *e);
#include "canvas/evas_textgrid.eo.legacy.h"
/**
+ *
+ * @brief Set the font (source) file to be used on a given textgrid object.
+ *
+ * This function allows the font file @p font_source to be explicitly
+ * set for the textgrid object @p obj, overriding system lookup, which
+ * will first occur in the given file's contents. If @p font_source is
+ * @c NULL or is an empty string, or the same font_source has already
+ * been set, or on error, this function does nothing.
+ *
+ * @see evas_object_textgrid_font_get()
+ * @see evas_object_textgrid_font_set()
+ * @see evas_object_textgrid_font_source_get()
+ *
+ * @since 1.7
+ *
+ * @param[in] font_source The font file's path.
+ */
+EAPI void evas_object_textgrid_font_source_set(Eo *obj, const char *font_source);
+
+/**
+ *
+ * @brief Get the font file's path which is being used on a given textgrid object.
+ *
+ * @return The font file's path.
+ *
+ * This function returns the font source path of the textgrid object
+ * @p obj. If the font source path has not been set, or on error,
+ * @c NULL is returned.
+ *
+ * @see evas_object_textgrid_font_get()
+ * @see evas_object_textgrid_font_set()
+ * @see evas_object_textgrid_font_source_set()
+ *
+ * @since 1.7
+ *
+ */
+EAPI const char *evas_object_textgrid_font_source_get(const Eo *obj);
+
+/**
+ *
+ * @brief Set the font family and size on a given textgrid object.
+ *
+ * This function allows the font name @p font_name and size
+ * @p font_size of the textgrid object @p obj to be set. The @p font_name
+ * string has to follow fontconfig's convention on naming fonts, as
+ * it's the underlying library used to query system fonts by Evas (see
+ * the @c fc-list command's output, on your system, to get an
+ * idea). It also has to be a monospace font. If @p font_name is
+ * @c NULL, or if it is an empty string, or if @p font_size is less or
+ * equal than 0, or on error, this function does nothing.
+ *
+ * @see evas_object_textgrid_font_get()
+ * @see evas_object_textgrid_font_source_set()
+ * @see evas_object_textgrid_font_source_get()
+ *
+ * @since 1.7
+ *
+ * @param[in] font_name The font (family) name.
+ * @param[in] font_size The font size, in points.
+ */
+EAPI void evas_object_textgrid_font_set(Eo *obj, const char *font_name, Evas_Font_Size font_size);
+
+/**
+ *
+ * @brief Retrieve the font family and size in use on a given textgrid object.
+ *
+ * This function allows the font name and size of a textgrid object
+ * @p obj to be queried and stored respectively in the buffers
+ * @p font_name and @p font_size. Be aware that the font name string is
+ * still owned by Evas and should @b not have free() called on it by
+ * the caller of the function. On error, the font name is the empty
+ * string and the font size is 0. @p font_name and @p font_source can
+ * be @c NULL.
+ *
+ * @see evas_object_textgrid_font_set()
+ * @see evas_object_textgrid_font_source_set()
+ * @see evas_object_textgrid_font_source_get()
+ *
+ * @since 1.7
+ *
+ * @param[out] font_name The font (family) name.
+ * @param[out] font_size The font size, in points.
+ */
+EAPI void evas_object_textgrid_font_get(const Eo *obj, const char **font_name, Evas_Font_Size *font_size);
+
+/**
* @}
*/
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index a56aa5074d..426b1d41e0 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -388,7 +388,7 @@ _evas_text_eo_base_constructor(Eo *eo_obj, Evas_Text_Data *class_data EINA_UNUSE
}
EOLIAN static void
-_evas_text_font_source_set(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char *font_source)
+_evas_text_efl_interface_text_properties_font_source_set(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char *font_source)
{
if ((o->cur.source) && (font_source) &&
(!strcmp(o->cur.source, font_source)))
@@ -402,14 +402,14 @@ _evas_text_font_source_set(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char
}
EOLIAN static const char*
-_evas_text_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
+_evas_text_efl_interface_text_properties_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o)
{
return o->cur.source;
}
EOLIAN static void
-_evas_text_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size)
+_evas_text_efl_interface_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size)
{
Eina_Bool is, was = EINA_FALSE;
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
@@ -497,7 +497,7 @@ _evas_text_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_S
}
EOLIAN static void
-_evas_text_font_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char **font, Evas_Font_Size *size)
+_evas_text_efl_interface_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char **font, Evas_Font_Size *size)
{
if (font) *font = o->cur.font;
if (size) *size = o->cur.size;
@@ -955,11 +955,11 @@ _evas_text_eo_base_dbg_info_get(Eo *eo_obj, Evas_Text_Data *o EINA_UNUSED, Eo_Db
const char *text;
int size;
- eo_do(eo_obj, evas_obj_text_font_get(&text, &size));
+ eo_do(eo_obj, efl_interface_text_properties_font_get(&text, &size));
EO_DBG_INFO_APPEND(group, "Font", EINA_VALUE_TYPE_STRING, text);
EO_DBG_INFO_APPEND(group, "Text size", EINA_VALUE_TYPE_INT, size);
- eo_do(eo_obj, text = evas_obj_text_font_source_get());
+ eo_do(eo_obj, text = efl_interface_text_properties_font_source_get());
EO_DBG_INFO_APPEND(group, "Font source", EINA_VALUE_TYPE_STRING, text);
eo_do(eo_obj, text = evas_obj_text_get());
@@ -2466,4 +2466,30 @@ update:
/* EXPERIMENTAL CODE END */
+EAPI void
+evas_object_text_font_source_set(Eo *obj, const char *font_source)
+{
+ eo_do((Eo *) obj, efl_interface_text_properties_font_source_set(font_source));
+}
+
+EAPI const char *
+evas_object_text_font_source_get(const Eo *obj)
+{
+ const char *font_source = 0;
+ eo_do((Eo *) obj, font_source = efl_interface_text_properties_font_source_get());
+ return font_source;
+}
+
+EAPI void
+evas_object_text_font_set(Eo *obj, const char *font, Evas_Font_Size size)
+{
+ eo_do((Eo *) obj, efl_interface_text_properties_font_set(font, size));
+}
+
+EAPI void
+evas_object_text_font_get(const Eo *obj, const char **font, Evas_Font_Size *size)
+{
+ eo_do((Eo *) obj, efl_interface_text_properties_font_get(font, size));
+}
+
#include "canvas/evas_text.eo.c"
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c
index 30784127ad..acecbb2858 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -1124,7 +1124,7 @@ _evas_textgrid_size_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, int *w, i
}
EOLIAN static void
-_evas_textgrid_font_source_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *font_source)
+_evas_textgrid_efl_interface_text_properties_font_source_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *font_source)
{
if ((!font_source) || (!*font_source))
@@ -1141,13 +1141,13 @@ _evas_textgrid_font_source_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *fo
}
EOLIAN static const char*
-_evas_textgrid_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o)
+_evas_textgrid_efl_interface_text_properties_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o)
{
return o->cur.font_source;
}
EOLIAN static void
-_evas_textgrid_font_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *font_name, Evas_Font_Size font_size)
+_evas_textgrid_efl_interface_text_properties_font_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *font_name, Evas_Font_Size font_size)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
Eina_Bool is, was = EINA_FALSE;
@@ -1283,7 +1283,7 @@ _evas_textgrid_font_set(Eo *eo_obj, Evas_Textgrid_Data *o, const char *font_name
}
EOLIAN static void
-_evas_textgrid_font_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, const char **font_name, Evas_Font_Size *font_size)
+_evas_textgrid_efl_interface_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, const char **font_name, Evas_Font_Size *font_size)
{
if (font_name) *font_name = o->cur.font_name;
if (font_size) *font_size = o->cur.font_size;
@@ -1491,11 +1491,11 @@ _evas_textgrid_eo_base_dbg_info_get(Eo *eo_obj, Evas_Textgrid_Data *o EINA_UNUSE
const char *text;
int size;
- eo_do(eo_obj, evas_obj_textgrid_font_get(&text, &size));
+ eo_do(eo_obj, efl_interface_text_properties_font_get(&text, &size));
EO_DBG_INFO_APPEND(group, "Font", EINA_VALUE_TYPE_STRING, text);
EO_DBG_INFO_APPEND(group, "Text size", EINA_VALUE_TYPE_INT, size);
- eo_do(eo_obj, text = evas_obj_textgrid_font_source_get());
+ eo_do(eo_obj, text = efl_interface_text_properties_font_source_get());
EO_DBG_INFO_APPEND(group, "Font source", EINA_VALUE_TYPE_STRING, text);
{
@@ -1507,4 +1507,30 @@ _evas_textgrid_eo_base_dbg_info_get(Eo *eo_obj, Evas_Textgrid_Data *o EINA_UNUSE
}
}
+EAPI void
+evas_object_textgrid_font_source_set(Eo *obj, const char *font_source)
+{
+ eo_do((Eo *) obj, efl_interface_text_properties_font_source_set(font_source));
+}
+
+EAPI const char *
+evas_object_textgrid_font_source_get(const Eo *obj)
+{
+ const char *font_source = NULL;
+ eo_do((Eo *) obj, font_source = efl_interface_text_properties_font_source_get());
+ return font_source;
+}
+
+EAPI void
+evas_object_textgrid_font_set(Eo *obj, const char *font_name, Evas_Font_Size font_size)
+{
+ eo_do((Eo *) obj, efl_interface_text_properties_font_set(font_name, font_size));
+}
+
+EAPI void
+evas_object_textgrid_font_get(const Eo *obj, const char **font_name, Evas_Font_Size *font_size)
+{
+ eo_do((Eo *) obj, efl_interface_text_properties_font_get(font_name, font_size));
+}
+
#include "canvas/evas_textgrid.eo.c"
diff --git a/src/lib/evas/canvas/evas_text.eo b/src/lib/evas/canvas/evas_text.eo
index db93c6333e..7019f62cc7 100644
--- a/src/lib/evas/canvas/evas_text.eo
+++ b/src/lib/evas/canvas/evas_text.eo
@@ -1,32 +1,8 @@
-class Evas.Text (Evas.Object)
+class Evas.Text (Evas.Object, Efl.Interface.Text_Properties)
{
legacy_prefix: evas_object_text;
eo_prefix: evas_obj_text;
properties {
- font_source {
- set {
- /*@
- Set the font (source) file to be used on a given text object.
-
- This function allows the font file to be explicitly set for a given
- text object, overriding system lookup, which will first occur in
- the given file's contents.
-
- @see evas_object_text_font_get() */
- }
- get {
- /*@
- Get the font file's path which is being used on a given text
- object.
-
- @return The font file's path.
-
- @see evas_object_text_font_get() for more details */
- }
- values {
- const(char)* font_source; /*@ The font file's path. */
- }
- }
shadow_color {
set {
/*@
@@ -196,36 +172,6 @@ class Evas.Text (Evas.Object)
int a; /*@ The alpha component of the given color. */
}
}
- font {
- set {
- /*@
- Set the font family or filename, and size on a given text object.
-
- This function allows the font name and size of a text object to be
- set. The @p font string has to follow fontconfig's convention on
- naming fonts, as it's the underlying library used to query system
- fonts by Evas (see the @c fc-list command's output, on your system,
- to get an idea). Alternatively, one can use a full path to a font file.
-
- @see evas_object_text_font_get()
- @see evas_object_text_font_source_set() */
- }
- get {
- /*@
- Retrieve the font family and size in use on a given text object.
-
- This function allows the font name and size of a text object to be
- queried. Be aware that the font name string is still owned by Evas
- and should @b not have free() called on it by the caller of the
- function.
-
- @see evas_object_text_font_set() */
- }
- values {
- const(char)* font; /*@ The font family name or filename. */
- Evas_Font_Size size; /*@ The font size, in points. */
- }
- }
style {
set {
/*@
@@ -439,5 +385,9 @@ class Evas.Text (Evas.Object)
Eo.Base.destructor;
Eo.Base.dbg_info_get;
Evas.Object.size.set;
+ Efl.Interface.Text_Properties.font.get;
+ Efl.Interface.Text_Properties.font.set;
+ Efl.Interface.Text_Properties.font_source.get;
+ Efl.Interface.Text_Properties.font_source.set;
}
}
diff --git a/src/lib/evas/canvas/evas_textgrid.eo b/src/lib/evas/canvas/evas_textgrid.eo
index d0a8dd2fc4..f1465e5d33 100644
--- a/src/lib/evas/canvas/evas_textgrid.eo
+++ b/src/lib/evas/canvas/evas_textgrid.eo
@@ -1,45 +1,8 @@
-class Evas.Textgrid (Evas.Object)
+class Evas.Textgrid (Evas.Object, Efl.Interface.Text_Properties)
{
legacy_prefix: evas_object_textgrid;
eo_prefix: evas_obj_textgrid;
properties {
- font_source {
- set {
- /*@
- @brief Set the font (source) file to be used on a given textgrid object.
-
- This function allows the font file @p font_source to be explicitly
- set for the textgrid object @p obj, overriding system lookup, which
- will first occur in the given file's contents. If @p font_source is
- @c NULL or is an empty string, or the same font_source has already
- been set, or on error, this function does nothing.
-
- @see evas_object_textgrid_font_get()
- @see evas_object_textgrid_font_set()
- @see evas_object_textgrid_font_source_get()
-
- @since 1.7 */
- }
- get {
- /*@
- @brief Get the font file's path which is being used on a given textgrid object.
-
- @return The font file's path.
-
- This function returns the font source path of the textgrid object
- @p obj. If the font source path has not been set, or on error,
- @c NULL is returned.
-
- @see evas_object_textgrid_font_get()
- @see evas_object_textgrid_font_set()
- @see evas_object_textgrid_font_source_set()
-
- @since 1.7 */
- }
- values {
- const(char)* font_source; /*@ The font file's path. */
- }
- }
supported_font_styles {
set {
/*@ No description supplied by the EAPI. */
@@ -51,49 +14,6 @@ class Evas.Textgrid (Evas.Object)
Evas_Textgrid_Font_Style styles;
}
}
- font {
- set {
- /*@
- @brief Set the font family and size on a given textgrid object.
-
- This function allows the font name @p font_name and size
- @p font_size of the textgrid object @p obj to be set. The @p font_name
- string has to follow fontconfig's convention on naming fonts, as
- it's the underlying library used to query system fonts by Evas (see
- the @c fc-list command's output, on your system, to get an
- idea). It also has to be a monospace font. If @p font_name is
- @c NULL, or if it is an empty string, or if @p font_size is less or
- equal than 0, or on error, this function does nothing.
-
- @see evas_object_textgrid_font_get()
- @see evas_object_textgrid_font_source_set()
- @see evas_object_textgrid_font_source_get()
-
- @since 1.7 */
- }
- get {
- /*@
- @brief Retrieve the font family and size in use on a given textgrid object.
-
- This function allows the font name and size of a textgrid object
- @p obj to be queried and stored respectively in the buffers
- @p font_name and @p font_size. Be aware that the font name string is
- still owned by Evas and should @b not have free() called on it by
- the caller of the function. On error, the font name is the empty
- string and the font size is 0. @p font_name and @p font_source can
- be @c NULL.
-
- @see evas_object_textgrid_font_set()
- @see evas_object_textgrid_font_source_set()
- @see evas_object_textgrid_font_source_get()
-
- @since 1.7 */
- }
- values {
- const(char)* font_name; /*@ The font (family) name. */
- Evas_Font_Size font_size; /*@ The font size, in points. */
- }
- }
size {
set {
/*@
@@ -275,6 +195,9 @@ class Evas.Textgrid (Evas.Object)
Eo.Base.constructor;
Eo.Base.destructor;
Eo.Base.dbg_info_get;
+ Efl.Interface.Text_Properties.font.get;
+ Efl.Interface.Text_Properties.font.set;
+ Efl.Interface.Text_Properties.font_source.get;
+ Efl.Interface.Text_Properties.font_source.set;
}
-
}