diff --git a/ChangeLog b/ChangeLog index 9eb58061f..ac38068d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2003-10-24 Carl Worth + * src/cairo_ft_font.c (_init_cairo_ft_lib): Fix missing void from + function prototype. + (_utf8_to_ucs4): Mark static. + + * src/cairo_xlib_surface.c: Remove unused function + _cairo_xlib_surface_get_picture. + + * src/cairo_ft_font.c (_cairo_ft_font_copy) + (_cairo_ft_font_glyph_extents, _cairo_ft_font_glyph_path): + Internal functions can't receive a NULL font pointer. + + * src/cairo.c (cairo_text_extents, cairo_glyph_extents) + (cairo_text_path, cairo_glyph_path): Comment-out functions without + complete implementations to squelch compiler warnings. + + * configure.in: Bump version to 0.1.8 for font API changes. + + * src/cairo.c (cairo_current_font): Fix missing return value. + * src/cairoint.h: No need for CAIRO_INT_STATUS_NULL_POINTER (CAIRO_FONT_BACKEND_DEFAULT): Move declaration of default font backend up into cairoint.h diff --git a/configure.in b/configure.in index 0c4649245..cf8c68c27 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ AC_INIT(src/cairo.h) dnl =========================================================================== # Package version number, (as distinct from shared library version) -CAIRO_VERSION=0.1.7 +CAIRO_VERSION=0.1.8 # libtool shared library version diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index 76a7da93b..43ae2ea04 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -42,7 +42,8 @@ typedef struct { + ((double)((t) & 0xFFFF) / 65535.0)) static FT_Library _cairo_ft_lib = NULL; -static int _init_cairo_ft_lib () +static int +_init_cairo_ft_lib (void) { if (_cairo_ft_lib != NULL) return 1; @@ -190,9 +191,6 @@ _cairo_ft_font_copy (cairo_font_t *font) cairo_ft_font_t * ft_font_new = NULL; cairo_ft_font_t * ft_font = NULL; - if (font == NULL) - return; - ft_font = (cairo_ft_font_t *)font; ft_font_new = (cairo_ft_font_t *)cairo_ft_font_create_for_ft_face (ft_font->face); @@ -310,10 +308,11 @@ _install_font_matrix(cairo_matrix_t *matrix, FT_Face face) } -int _utf8_to_glyphs (cairo_font_t *font, - const unsigned char *utf8, - cairo_glyph_t **glyphs, - size_t *nglyphs) +static int +_utf8_to_glyphs (cairo_font_t *font, + const unsigned char *utf8, + cairo_glyph_t **glyphs, + size_t *nglyphs) { cairo_ft_font_t *ft; double x = 0., y = 0.; @@ -384,9 +383,6 @@ _cairo_ft_font_glyph_extents (cairo_font_t *font, cairo_ft_font_t *ft; cairo_status_t status = CAIRO_STATUS_SUCCESS; - if (font == NULL) - return; - ft = (cairo_ft_font_t *)font; /* FIXME: lift code from xft to do this */ @@ -511,9 +507,6 @@ _cairo_ft_font_glyph_path (cairo_font_t *font, cairo_status_t status = CAIRO_STATUS_SUCCESS; cairo_ft_font_t *ft; - if (font == NULL) - return; - ft = (cairo_ft_font_t *)font; /* FIXME: lift code from xft to do this */ diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 4fb208fda..57b2c51e8 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -463,15 +463,6 @@ static const struct cairo_surface_backend cairo_xlib_surface_backend = { composite_trapezoids: (void *) _cairo_xlib_surface_composite_trapezoids, }; -static Picture -_cairo_xlib_surface_get_picture (cairo_surface_t *surface) -{ - if (surface->backend != &cairo_xlib_surface_backend) - return 0; - - return ((cairo_xlib_surface *) surface)->picture; -} - cairo_surface_t * cairo_xlib_surface_create (Display *dpy, Drawable drawable, diff --git a/src/cairo.c b/src/cairo.c index a9ab811c8..cc04afcea 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -608,7 +608,7 @@ cairo_font_t * cairo_current_font (cairo_t *cr) { if (cr->status) - return; + return NULL; cairo_font_t *ret; cr->status = _cairo_gstate_current_font (cr->gstate, &ret); @@ -654,6 +654,7 @@ cairo_transform_font (cairo_t *cr, cairo_matrix_t *matrix) } +/* XXX: NYI void cairo_text_extents (cairo_t *cr, const unsigned char *utf8, @@ -677,6 +678,7 @@ cairo_glyph_extents (cairo_t *cr, cr->status = _cairo_gstate_glyph_extents (cr->gstate, glyphs, num_glyphs, extents); } +*/ void cairo_show_text (cairo_t *cr, const unsigned char *utf8) @@ -696,6 +698,7 @@ cairo_show_glyphs (cairo_t *cr, cairo_glyph_t *glyphs, int num_glyphs) cr->status = _cairo_gstate_show_glyphs (cr->gstate, glyphs, num_glyphs); } +/* XXX: NYI void cairo_text_path (cairo_t *cr, const unsigned char *utf8) { @@ -713,7 +716,7 @@ cairo_glyph_path (cairo_t *cr, cairo_glyph_t *glyphs, int num_glyphs) cr->status = _cairo_gstate_glyph_path (cr->gstate, glyphs, num_glyphs); } - +*/ void cairo_show_surface (cairo_t *cr, diff --git a/src/cairo.h b/src/cairo.h index 582bef9bc..b61059b0e 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -389,7 +389,7 @@ extern void __external_linkage cairo_set_font (cairo_t *ct, cairo_font_t *font); -/* NYI +/* XXX: NYI extern void __external_linkage cairo_text_extents (cairo_t *ct, diff --git a/src/cairo_ft_font.c b/src/cairo_ft_font.c index 76a7da93b..43ae2ea04 100644 --- a/src/cairo_ft_font.c +++ b/src/cairo_ft_font.c @@ -42,7 +42,8 @@ typedef struct { + ((double)((t) & 0xFFFF) / 65535.0)) static FT_Library _cairo_ft_lib = NULL; -static int _init_cairo_ft_lib () +static int +_init_cairo_ft_lib (void) { if (_cairo_ft_lib != NULL) return 1; @@ -190,9 +191,6 @@ _cairo_ft_font_copy (cairo_font_t *font) cairo_ft_font_t * ft_font_new = NULL; cairo_ft_font_t * ft_font = NULL; - if (font == NULL) - return; - ft_font = (cairo_ft_font_t *)font; ft_font_new = (cairo_ft_font_t *)cairo_ft_font_create_for_ft_face (ft_font->face); @@ -310,10 +308,11 @@ _install_font_matrix(cairo_matrix_t *matrix, FT_Face face) } -int _utf8_to_glyphs (cairo_font_t *font, - const unsigned char *utf8, - cairo_glyph_t **glyphs, - size_t *nglyphs) +static int +_utf8_to_glyphs (cairo_font_t *font, + const unsigned char *utf8, + cairo_glyph_t **glyphs, + size_t *nglyphs) { cairo_ft_font_t *ft; double x = 0., y = 0.; @@ -384,9 +383,6 @@ _cairo_ft_font_glyph_extents (cairo_font_t *font, cairo_ft_font_t *ft; cairo_status_t status = CAIRO_STATUS_SUCCESS; - if (font == NULL) - return; - ft = (cairo_ft_font_t *)font; /* FIXME: lift code from xft to do this */ @@ -511,9 +507,6 @@ _cairo_ft_font_glyph_path (cairo_font_t *font, cairo_status_t status = CAIRO_STATUS_SUCCESS; cairo_ft_font_t *ft; - if (font == NULL) - return; - ft = (cairo_ft_font_t *)font; /* FIXME: lift code from xft to do this */ diff --git a/src/cairo_xlib_surface.c b/src/cairo_xlib_surface.c index 4fb208fda..57b2c51e8 100644 --- a/src/cairo_xlib_surface.c +++ b/src/cairo_xlib_surface.c @@ -463,15 +463,6 @@ static const struct cairo_surface_backend cairo_xlib_surface_backend = { composite_trapezoids: (void *) _cairo_xlib_surface_composite_trapezoids, }; -static Picture -_cairo_xlib_surface_get_picture (cairo_surface_t *surface) -{ - if (surface->backend != &cairo_xlib_surface_backend) - return 0; - - return ((cairo_xlib_surface *) surface)->picture; -} - cairo_surface_t * cairo_xlib_surface_create (Display *dpy, Drawable drawable,