From b77a2c3c954013709e6d8ece43bb7a0c5c78fabd Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Tue, 3 Nov 2020 23:05:49 +0100 Subject: [PATCH] termio: add termio_character_size_get() --- src/bin/termio.c | 11 ++++++++++- src/bin/termio.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bin/termio.c b/src/bin/termio.c index e12a4bed..dfef09e2 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -138,12 +138,21 @@ termio_mouseover_suspend_pushpop(Evas_Object *obj, int dir) void termio_size_get(const Evas_Object *obj, int *w, int *h) { - Termio *sd = evas_object_smart_data_get(obj); + const Termio *sd = evas_object_smart_data_get(obj); EINA_SAFETY_ON_NULL_RETURN(sd); if (w) *w = sd->grid.w; if (h) *h = sd->grid.h; } +void +termio_character_size_get(const Evas_Object *obj, int *w, int *h) +{ + const Termio *sd = evas_object_smart_data_get(obj); + EINA_SAFETY_ON_NULL_RETURN(sd); + if (w) *w = sd->font.chw; + if (h) *h = sd->font.chh; +} + int termio_scroll_get(const Evas_Object *obj) { diff --git a/src/bin/termio.h b/src/bin/termio.h index 112b74b0..acb2765d 100644 --- a/src/bin/termio.h +++ b/src/bin/termio.h @@ -37,6 +37,7 @@ void termio_remove_links(Termio *sd); void termio_mouseover_suspend_pushpop(Evas_Object *obj, int dir); void termio_event_feed_mouse_in(Evas_Object *obj); void termio_size_get(const Evas_Object *obj, int *w, int *h); +void termio_character_size_get(const Evas_Object *obj, int *w, int *h); int termio_scroll_get(const Evas_Object *obj); void termio_font_size_set(Evas_Object *obj, int size); void termio_grid_size_set(Evas_Object *obj, int w, int h);