commit c253a007474851748a4c7e17176d8ee462468e11
parent ca95e85e64f24de426da625da1f7115e69f86989
Author: Michael Forney <mforney@mforney.org>
Date: Mon, 13 Jan 2014 04:30:03 -0800
Rename draw_text_utf8 -> draw_text
Diffstat:
9 files changed, 54 insertions(+), 59 deletions(-)
diff --git a/drawable.c b/drawable.c
@@ -94,7 +94,7 @@ void wld_copy_region(struct wld_drawable * src, struct wld_drawable * dst,
}
EXPORT
-void wld_draw_text_utf8_n(struct wld_drawable * drawable,
+void wld_draw_text_n(struct wld_drawable * drawable,
struct wld_font * font_base, uint32_t color,
int32_t x, int32_t y,
const char * text, int32_t length,
@@ -102,8 +102,8 @@ void wld_draw_text_utf8_n(struct wld_drawable * drawable,
{
struct font * font = (void *) font_base;
- drawable->impl->draw_text_utf8(drawable, font, color, x, y,
- text, length, extents);
+ drawable->impl->draw_text(drawable, font, color, x, y,
+ text, length, extents);
}
EXPORT
diff --git a/font.c b/font.c
@@ -209,9 +209,9 @@ bool wld_font_ensure_char(struct wld_font * font_base, uint32_t character)
}
EXPORT
-void wld_font_text_extents_utf8_n(struct wld_font * font_base,
- const char * text, int32_t length,
- struct wld_extents * extents)
+void wld_font_text_extents_n(struct wld_font * font_base,
+ const char * text, int32_t length,
+ struct wld_extents * extents)
{
struct font * font = (void *) font_base;
int ret;
diff --git a/intel.c b/intel.c
@@ -199,11 +199,10 @@ void drawable_copy_rectangle(struct wld_drawable * src_drawable,
dst->bo, dst->base.pitch, dst_x, dst_y, width, height);
}
-void drawable_draw_text_utf8(struct wld_drawable * drawable,
- struct font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text, int32_t length,
- struct wld_extents * extents)
+void drawable_draw_text(struct wld_drawable * drawable,
+ struct font * font, uint32_t color,
+ int32_t x, int32_t y, const char * text, int32_t length,
+ struct wld_extents * extents)
{
struct intel_drawable * intel = (void *) drawable;
int ret;
diff --git a/interface/drawable.h b/interface/drawable.h
@@ -37,11 +37,11 @@ static void drawable_copy_region(struct wld_drawable * src,
pixman_region32_t * region,
int32_t dst_x, int32_t dst_y);
#endif
-static void drawable_draw_text_utf8(struct wld_drawable * drawable,
- struct font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text, int32_t length,
- struct wld_extents * extents);
+static void drawable_draw_text(struct wld_drawable * drawable,
+ struct font * font, uint32_t color,
+ int32_t x, int32_t y,
+ const char * text, int32_t length,
+ struct wld_extents * extents);
static void drawable_write(struct wld_drawable * drawable,
const void * data, size_t size);
static pixman_image_t * drawable_map(struct wld_drawable * drawable);
@@ -58,7 +58,7 @@ static const struct wld_drawable_impl drawable_impl = {
.fill_region = &default_fill_region,
.copy_region = &default_copy_region,
#endif
- .draw_text_utf8 = &drawable_draw_text_utf8,
+ .draw_text = &drawable_draw_text,
.write = &drawable_write,
.map = &drawable_map,
.flush = &drawable_flush,
diff --git a/interface/drm_drawable.h b/interface/drm_drawable.h
@@ -37,11 +37,11 @@ static void drawable_copy_region(struct wld_drawable * src,
pixman_region32_t * region,
int32_t dst_x, int32_t dst_y);
#endif
-static void drawable_draw_text_utf8(struct wld_drawable * drawable,
- struct font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text, int32_t length,
- struct wld_extents * extents);
+static void drawable_draw_text(struct wld_drawable * drawable,
+ struct font * font, uint32_t color,
+ int32_t x, int32_t y,
+ const char * text, int32_t length,
+ struct wld_extents * extents);
static void drawable_write(struct wld_drawable * drawable,
const void * data, size_t size);
static pixman_image_t * drawable_map(struct wld_drawable * drawable);
@@ -62,7 +62,7 @@ static const struct drm_drawable_impl drawable_impl = {
.fill_region = &default_fill_region,
.copy_region = &default_copy_region,
#endif
- .draw_text_utf8 = &drawable_draw_text_utf8,
+ .draw_text = &drawable_draw_text,
.write = &drawable_write,
.map = &drawable_map,
.flush = &drawable_flush,
diff --git a/pixman.c b/pixman.c
@@ -232,11 +232,10 @@ static inline uint8_t reverse(uint8_t byte)
return byte;
}
-void drawable_draw_text_utf8(struct wld_drawable * drawable,
- struct font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text, int32_t length,
- struct wld_extents * extents)
+void drawable_draw_text(struct wld_drawable * drawable,
+ struct font * font, uint32_t color,
+ int32_t x, int32_t y, const char * text, int32_t length,
+ struct wld_extents * extents)
{
struct pixman_drawable * pixman = (void *) drawable;
int ret;
diff --git a/wayland.c b/wayland.c
@@ -346,11 +346,11 @@ void drawable_copy_region(struct wld_drawable * src_drawable,
fprintf(stderr, "wayland: Copy region is not implemented\n");
}
-void drawable_draw_text_utf8(struct wld_drawable * drawable,
- struct font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text, int32_t length,
- struct wld_extents * extents)
+void drawable_draw_text(struct wld_drawable * drawable,
+ struct font * font, uint32_t color,
+ int32_t x, int32_t y,
+ const char * text, int32_t length,
+ struct wld_extents * extents)
{
struct wld_extents extents0;
struct wayland_drawable * wayland = (void *) drawable;
@@ -359,8 +359,8 @@ void drawable_draw_text_utf8(struct wld_drawable * drawable,
extents = &extents0;
begin(wayland);
- wld_draw_text_utf8_n(BACKBUF(wayland).drawable, &font->base, color,
- x, y, text, length, extents);
+ wld_draw_text_n(BACKBUF(wayland).drawable, &font->base, color,
+ x, y, text, length, extents);
if (wayland->damage_tracking)
{
diff --git a/wld-private.h b/wld-private.h
@@ -110,11 +110,10 @@ struct wld_drawable_impl
void (* copy_region)(struct wld_drawable * src, struct wld_drawable * dst,
pixman_region32_t * region,
int32_t dst_x, int32_t dst_y);
- void (* draw_text_utf8)(struct wld_drawable * drawable,
- struct font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text, int32_t length,
- struct wld_extents * extents);
+ void (* draw_text)(struct wld_drawable * drawable,
+ struct font * font, uint32_t color,
+ int32_t x, int32_t y, const char * text, int32_t length,
+ struct wld_extents * extents);
void (* write)(struct wld_drawable * drawable,
const void * data, size_t size);
pixman_image_t * (* map)(struct wld_drawable * drawable);
diff --git a/wld.h b/wld.h
@@ -131,15 +131,15 @@ bool wld_font_ensure_char(struct wld_font * font, uint32_t character);
*
* @param length The maximum number of bytes in the string to process
*/
-void wld_font_text_extents_utf8_n(struct wld_font * font,
- const char * text, int32_t length,
- struct wld_extents * extents);
+void wld_font_text_extents_n(struct wld_font * font,
+ const char * text, int32_t length,
+ struct wld_extents * extents);
-static inline void wld_font_text_extents_utf8(struct wld_font * font,
- const char * text,
- struct wld_extents * extents)
+static inline void wld_font_text_extents(struct wld_font * font,
+ const char * text,
+ struct wld_extents * extents)
{
- wld_font_text_extents_utf8_n(font, text, INT32_MAX, extents);
+ wld_font_text_extents_n(font, text, INT32_MAX, extents);
}
/**** Drawables ****/
@@ -179,19 +179,17 @@ void wld_copy_region(struct wld_drawable * src, struct wld_drawable * dst,
* @param extents If not NULL, will be initialized to the extents of the
* drawn text
*/
-void wld_draw_text_utf8_n(struct wld_drawable * drawable,
- struct wld_font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text, int32_t length,
- struct wld_extents * extents);
-
-static inline void wld_draw_text_utf8(struct wld_drawable * drawable,
- struct wld_font * font, uint32_t color,
- int32_t x, int32_t y,
- const char * text,
- struct wld_extents * extents)
+void wld_draw_text_n(struct wld_drawable * drawable,
+ struct wld_font * font, uint32_t color,
+ int32_t x, int32_t y, const char * text, int32_t length,
+ struct wld_extents * extents);
+
+static inline void wld_draw_text(struct wld_drawable * drawable,
+ struct wld_font * font, uint32_t color,
+ int32_t x, int32_t y, const char * text,
+ struct wld_extents * extents)
{
- wld_draw_text_utf8_n(drawable, font, color, x, y, text, INT32_MAX, extents);
+ wld_draw_text_n(drawable, font, color, x, y, text, INT32_MAX, extents);
}
void wld_write(struct wld_drawable * drawable, const void * data, size_t size);