[cairo-commit] configure.in src/cairo-atsui-font.c src/cairo-quartz-private.h src/cairo-quartz-surface.c

Brian Ewins brianewins at kemper.freedesktop.org
Mon Mar 5 15:23:54 PST 2007


 configure.in               |   17 +++++++----------
 src/cairo-atsui-font.c     |   12 ++++++------
 src/cairo-quartz-private.h |    8 +++++---
 src/cairo-quartz-surface.c |    8 +++++++-
 4 files changed, 25 insertions(+), 20 deletions(-)

New commits:
diff-tree a724f816e17bfe3d9abefb1f6dcfe30480a0d143 (from 83fcce0e93071cffe20377ab3fe6281204b2f80d)
Author: Brian Ewins <Brian.Ewins at gmail.com>
Date:   Mon Mar 5 23:19:24 2007 +0000

    [quartz,atsui] separate the quartz surface and atsui font backend
    
    Make it possible to use the --enable-quartz and --enable-atsui
    independently. Quartz on its own will use the ft font backend.

diff --git a/configure.in b/configure.in
index 8608f10..b023c4c 100644
--- a/configure.in
+++ b/configure.in
@@ -269,13 +269,9 @@ CAIRO_BACKEND_ENABLE(xcb, XCB, xcb, XCB_
 dnl ===========================================================================
 
 CAIRO_BACKEND_ENABLE(quartz, Quartz, quartz, QUARTZ_SURFACE, no, [
-  if test "x$use_xlib" = "xyes"; then
-    use_quartz="no (requires --disable-xlib)";
-  else
-    dnl There is no pkgconfig for quartz; lets do a header check
-    AC_CHECK_HEADER(Carbon/Carbon.h, , [use_quartz="no (Carbon headers not found)"])
-    quartz_LIBS="-Xlinker -framework -Xlinker Carbon"
-  fi
+  dnl There is no pkgconfig for quartz; lets do a header check
+  AC_CHECK_HEADER(Carbon/Carbon.h, , [use_quartz="no (Carbon headers not found)"])
+  quartz_LIBS="-Xlinker -framework -Xlinker Carbon"
 ])
 
 dnl ===========================================================================
@@ -572,9 +568,10 @@ dnl ====================================
 dnl This check should default to 'auto' once we have code to actually
 dnl check for the atsui font backend.
 
-CAIRO_BACKEND_ENABLE(atsui, ATSUI font, atsui, ATSUI_FONT, auto, [
-  dnl Quartz requires and is required by atsui.
-  use_atsui=$use_quartz
+CAIRO_BACKEND_ENABLE(atsui, ATSUI font, atsui, ATSUI_FONT, no, [
+  dnl There is no pkgconfig for atsui; lets do a header check
+  AC_CHECK_HEADER(Carbon/Carbon.h, , [use_atsui="no (Carbon headers not found)"])
+  atsui_LIBS="-Xlinker -framework -Xlinker Carbon"
 ])
 
 dnl ===========================================================================
diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c
index fff7a22..cf02a5c 100644
--- a/src/cairo-atsui-font.c
+++ b/src/cairo-atsui-font.c
@@ -908,6 +908,7 @@ _cairo_atsui_font_text_to_glyphs (void		
     return CAIRO_STATUS_SUCCESS;
 }
 
+#if CAIRO_HAS_QUARTZ_SURFACE
 static cairo_int_status_t
 _cairo_atsui_font_old_show_glyphs (void		       *abstract_font,
 				   cairo_operator_t    	op,
@@ -1024,12 +1025,7 @@ _cairo_atsui_font_old_show_glyphs (void	
 
     return CAIRO_STATUS_SUCCESS;
 }
-
-cairo_bool_t
-_cairo_scaled_font_is_atsui (cairo_scaled_font_t *sfont)
-{
-    return (sfont->backend == &cairo_atsui_scaled_font_backend);
-}
+#endif /* CAIRO_HAS_QUARTZ_SURFACE */
 
 ATSUStyle
 _cairo_atsui_scaled_font_get_atsu_style (cairo_scaled_font_t *sfont)
@@ -1078,7 +1074,11 @@ const cairo_scaled_font_backend_t cairo_
     _cairo_atsui_font_scaled_glyph_init,
     _cairo_atsui_font_text_to_glyphs,
     NULL, /* ucs4_to_index */
+#if CAIRO_HAS_QUARTZ_SURFACE
     _cairo_atsui_font_old_show_glyphs,
+#else
+    NULL,
+#endif /* CAIRO_HAS_QUARTZ_SURFACE */
     _cairo_atsui_load_truetype_table,
     NULL, /* map_glyphs_to_unicode */
 };
diff --git a/src/cairo-quartz-private.h b/src/cairo-quartz-private.h
index 1000e73..f377f46 100644
--- a/src/cairo-quartz-private.h
+++ b/src/cairo-quartz-private.h
@@ -39,6 +39,8 @@
 #define CAIRO_QUARTZ_PRIVATE_H
 
 #include <cairoint.h>
+
+#ifdef CAIRO_HAS_QUARTZ_SURFACE
 #include <cairo-quartz.h>
 
 typedef struct cairo_nquartz_surface {
@@ -59,14 +61,14 @@ typedef struct cairo_nquartz_surface {
     CGShadingRef sourceShading;
     CGPatternRef sourcePattern;
 } cairo_nquartz_surface_t, cairo_quartz_surface_t;
+#endif /* CAIRO_HAS_QUARTZ_SURFACE */
 
-cairo_bool_t
-_cairo_scaled_font_is_atsui (cairo_scaled_font_t *sfont);
-
+#if CAIRO_HAS_ATSUI_FONT
 ATSUStyle
 _cairo_atsui_scaled_font_get_atsu_style (cairo_scaled_font_t *sfont);
 
 ATSUFontID
 _cairo_atsui_scaled_font_get_atsu_font_id (cairo_scaled_font_t *sfont);
+#endif /* CAIRO_HAS_ATSUI_FONT */
 
 #endif /* CAIRO_QUARTZ_PRIVATE_H */
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 6dfcff3..f0149de 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -1239,6 +1239,7 @@ _cairo_nquartz_surface_stroke (void *abs
     return rv;
 }
 
+#if CAIRO_HAS_ATSUI_FONT
 static cairo_int_status_t
 _cairo_nquartz_surface_show_glyphs (void *abstract_surface,
 				    cairo_operator_t op,
@@ -1258,7 +1259,7 @@ _cairo_nquartz_surface_show_glyphs (void
     if (op == CAIRO_OPERATOR_DEST)
 	return CAIRO_STATUS_SUCCESS;
 
-    if (!_cairo_scaled_font_is_atsui (scaled_font))
+    if (cairo_scaled_font_get_type (scaled_font) != CAIRO_FONT_TYPE_ATSUI)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
     CGContextSaveGState (surface->cgContext);
@@ -1351,6 +1352,7 @@ _cairo_nquartz_surface_show_glyphs (void
 
     return rv;
 }
+#endif /* CAIRO_HAS_ATSUI_FONT */
 
 static cairo_int_status_t
 _cairo_nquartz_surface_mask (void *abstract_surface,
@@ -1455,7 +1457,11 @@ static const struct _cairo_surface_backe
     _cairo_nquartz_surface_mask,
     _cairo_nquartz_surface_stroke,
     _cairo_nquartz_surface_fill,
+#if CAIRO_HAS_ATSUI_FONT
     _cairo_nquartz_surface_show_glyphs,
+#else 
+    NULL, /* surface_show_glyphs */
+#endif /* CAIRO_HAS_ATSUI_FONT */
 
     NULL, /* snapshot */
 };


More information about the cairo-commit mailing list