[cairo-commit] rcairo/src cairo.def, 1.17, 1.18 rb_cairo.h, 1.23, 1.24 rb_cairo_constants.c, 1.10, 1.11 rb_cairo_context.c, 1.30, 1.31 rb_cairo_font_face.c, 1.9, 1.10 rb_cairo_font_options.c, 1.5, 1.6 rb_cairo_scaled_font.c, 1.7, 1.8

Kouhei Sutou commit at pdx.freedesktop.org
Fri Sep 19 05:56:30 PDT 2008


Committed by: kou

Update of /cvs/cairo/rcairo/src
In directory kemper:/tmp/cvs-serv30490/src

Modified Files:
	cairo.def rb_cairo.h rb_cairo_constants.c rb_cairo_context.c 
	rb_cairo_font_face.c rb_cairo_font_options.c 
	rb_cairo_scaled_font.c 
Log Message:
* src/, test/: support cairo 1.7.6.


Index: cairo.def
===================================================================
RCS file: /cvs/cairo/rcairo/src/cairo.def,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cairo.def	16 Aug 2008 12:52:16 -0000	1.17
+++ cairo.def	19 Sep 2008 12:56:27 -0000	1.18
@@ -100,5 +100,5 @@
     rb_cairo_filter_from_ruby_object
     rb_cairo_svg_version_from_ruby_object
     rb_cairo_ps_level_from_ruby_object
-    rb_cairo_lcd_filter_from_ruby_object
+    rb_cairo_text_cluster_flags_from_ruby_object
     rb_cairo_check_status

Index: rb_cairo.h
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- rb_cairo.h	17 Aug 2008 07:21:42 -0000	1.23
+++ rb_cairo.h	19 Sep 2008 12:56:27 -0000	1.24
@@ -233,8 +233,8 @@
 #define RVAL2CRPSLEVEL(obj)       (rb_cairo_ps_level_from_ruby_object(obj))
 #  endif
 #endif
-#if CAIRO_CHECK_VERSION(1, 7, 2)
-#define RVAL2CRLCDFILTER(obj)     (rb_cairo_lcd_filter_from_ruby_object(obj))
+#if CAIRO_CHECK_VERSION(1, 7, 6)
+#define RVAL2CRTEXTCLUSTERFLAGS(obj) (rb_cairo_text_cluster_flags_from_ruby_object(obj))
 #endif
 
 cairo_operator_t       rb_cairo_operator_from_ruby_object       (VALUE obj);
@@ -260,8 +260,8 @@
 cairo_ps_level_t       rb_cairo_ps_level_from_ruby_object       (VALUE obj);
 #  endif
 #endif
-#if CAIRO_CHECK_VERSION(1, 7, 2)
-cairo_lcd_filter_t     rb_cairo_lcd_filter_from_ruby_object     (VALUE obj);
+#if CAIRO_CHECK_VERSION(1, 7, 6)
+cairo_text_cluster_flags_t rb_cairo_text_cluster_flags_from_ruby_object (VALUE obj);
 #endif
 
 void rb_cairo_check_status (cairo_status_t status);

Index: rb_cairo_constants.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_constants.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- rb_cairo_constants.c	13 Aug 2008 12:27:39 -0000	1.10
+++ rb_cairo_constants.c	19 Sep 2008 12:56:27 -0000	1.11
@@ -33,7 +33,7 @@
 VALUE rb_mCairo_Filter;
 VALUE rb_mCairo_SVGVersion = Qnil;
 VALUE rb_mCairo_PSLevel = Qnil;
-VALUE rb_mCairo_LCDFilter = Qnil;
+VALUE rb_mCairo_TextClusterFlag = Qnil;
 
 #define CAIRO_OPERATOR_MIN CAIRO_OPERATOR_CLEAR
 #define CAIRO_OPERATOR_MAX CAIRO_OPERATOR_SATURATE
@@ -86,8 +86,8 @@
 #define CAIRO_PS_LEVEL_MIN CAIRO_PS_LEVEL_2
 #define CAIRO_PS_LEVEL_MAX CAIRO_PS_LEVEL_3
 
-#define CAIRO_LCD_FILTER_MIN CAIRO_LCD_FILTER_DEFAULT
-#define CAIRO_LCD_FILTER_MAX CAIRO_LCD_FILTER_FIR5
+#define CAIRO_TEXT_CLUSTER_FLAG_MIN 0
+#define CAIRO_TEXT_CLUSTER_FLAG_MAX CAIRO_TEXT_CLUSTER_FLAG_BACKWARD
 
 #define DEFINE_RVAL2ENUM(name, const_name)                      \
 cairo_ ## name ## _t                                            \
@@ -139,8 +139,8 @@
 #  endif
 #endif
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
-DEFINE_RVAL2ENUM(lcd_filter, LCD_FILTER)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
+DEFINE_RVAL2ENUM(text_cluster_flags, TEXT_CLUSTER_FLAG)
 #endif
 
 #if defined(RB_CAIRO_PLATFORM_WIN32) && !defined(PS_LEVEL_ENUM_DEFINED)
@@ -468,18 +468,11 @@
 #  endif
 #endif
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
-  /* cairo_lcd_filter_t */
-  rb_mCairo_LCDFilter = rb_define_module_under (rb_mCairo, "LCDFilter");
-  rb_define_const (rb_mCairo_LCDFilter, "DEFAULT",
-                   INT2FIX (CAIRO_LCD_FILTER_DEFAULT));
-  rb_define_const (rb_mCairo_LCDFilter, "NONE",
-                   INT2FIX (CAIRO_LCD_FILTER_NONE));
-  rb_define_const (rb_mCairo_LCDFilter, "INTRA_PIXEL",
-                   INT2FIX (CAIRO_LCD_FILTER_INTRA_PIXEL));
-  rb_define_const (rb_mCairo_LCDFilter, "FIR3",
-                   INT2FIX (CAIRO_LCD_FILTER_FIR3));
-  rb_define_const (rb_mCairo_LCDFilter, "FIR5",
-                   INT2FIX (CAIRO_LCD_FILTER_FIR5));
+#if CAIRO_CHECK_VERSION(1, 7, 6)
+  /* cairo_text_cluster_flags_t */
+  rb_mCairo_TextClusterFlag =
+    rb_define_module_under (rb_mCairo, "TextClusterFlag");
+  rb_define_const (rb_mCairo_TextClusterFlag, "BACKWARD",
+                   INT2FIX (CAIRO_TEXT_CLUSTER_FLAG_BACKWARD));
 #endif
 }

Index: rb_cairo_context.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_context.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- rb_cairo_context.c	6 Sep 2008 11:13:34 -0000	1.30
+++ rb_cairo_context.c	19 Sep 2008 12:56:27 -0000	1.31
@@ -1205,7 +1205,7 @@
   return self;
 }
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
 static VALUE
 cr_has_show_text_glyphs (VALUE self)
 {
@@ -1214,7 +1214,7 @@
 
 static VALUE
 cr_show_text_glyphs (VALUE self, VALUE rb_utf8, VALUE rb_glyphs,
-                     VALUE rb_clusters, VALUE rb_backward)
+                     VALUE rb_clusters, VALUE rb_cluster_flags)
 {
   cairo_t *cr;
   const char *utf8;
@@ -1223,7 +1223,7 @@
   int num_glyphs = 0;
   cairo_text_cluster_t *clusters = NULL;
   int num_clusters = 0;
-  cairo_bool_t backward;
+  cairo_text_cluster_flags_t cluster_flags;
 
   cr = _SELF;
   utf8 = RSTRING_PTR (rb_utf8);
@@ -1231,11 +1231,11 @@
   rb_cairo__glyphs_from_ruby_object (rb_glyphs, &glyphs, &num_glyphs);
   rb_cairo__text_clusters_from_ruby_object (rb_clusters,
                                             &clusters, &num_clusters);
-  backward = RVAL2CBOOL (rb_backward);
+  cluster_flags = RVAL2CRTEXTCLUSTERFLAGS (rb_cluster_flags);
   cairo_show_text_glyphs (cr, utf8, utf8_len,
                           glyphs, num_glyphs,
                           clusters, num_clusters,
-                          backward);
+                          cluster_flags);
   if (glyphs)
     cairo_glyph_free (glyphs);
   if (clusters)

Index: rb_cairo_font_face.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_font_face.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- rb_cairo_font_face.c	17 Aug 2008 06:11:51 -0000	1.9
+++ rb_cairo_font_face.c	19 Sep 2008 12:56:27 -0000	1.10
@@ -21,7 +21,7 @@
 VALUE rb_cCairo_UserFontFace = Qnil;
 VALUE rb_cCairo_UserFontFace_TextToGlyphsData = Qnil;
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
 static cairo_user_data_key_t ruby_object_key;
 static ID cr_id_call;
 static ID cr_id_new;
@@ -33,10 +33,10 @@
 
 static ID cr_id_at_glyphs;
 static ID cr_id_at_clusters;
-static ID cr_id_at_backward;
+static ID cr_id_at_cluster_flags;
 static ID cr_id_at_need_glyphs;
 static ID cr_id_at_need_clusters;
-static ID cr_id_at_need_backward;
+static ID cr_id_at_need_cluster_flags;
 #endif
 
 #define _SELF  (RVAL2CRFONTFACE(self))
@@ -84,7 +84,7 @@
 
       switch (cairo_font_face_get_type (face))
         {
-#if CAIRO_CHECK_VERSION(1, 7, 2)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
         case CAIRO_FONT_TYPE_TOY:
           klass = rb_cCairo_ToyFontFace;
           break;
@@ -111,7 +111,7 @@
   return Data_Wrap_Struct (klass, NULL, cr_font_face_free, NULL);
 }
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
 static VALUE
 cr_toy_font_face_initialize (int argc, VALUE *argv, VALUE self)
 {
@@ -346,7 +346,7 @@
   int *num_glyphs;
   cairo_text_cluster_t **clusters;
   int *num_clusters;
-  cairo_bool_t *backward;
+  cairo_text_cluster_flags_t *cluster_flags;
 } cr_text_to_glyphs_after_hook_data_t;
 
 static VALUE
@@ -381,12 +381,14 @@
                                                 after_hook_data->num_clusters);
     }
 
-  if (after_hook_data->backward)
+  if (after_hook_data->cluster_flags)
     {
-      VALUE rb_backward;
+      VALUE rb_cluster_flags;
 
-      rb_backward = rb_ivar_get (text_to_glyphs_data, cr_id_at_backward);
-      *(after_hook_data->backward) = RVAL2CBOOL (rb_backward);
+      rb_cluster_flags = rb_ivar_get (text_to_glyphs_data,
+                                      cr_id_at_cluster_flags);
+      *(after_hook_data->cluster_flags) =
+        RVAL2CRTEXTCLUSTERFLAGS (rb_cluster_flags);
     }
 
   return data->result;
@@ -398,7 +400,7 @@
                                        cairo_glyph_t **glyphs, int *num_glyphs,
                                        cairo_text_cluster_t **clusters,
                                        int *num_clusters,
-                                       cairo_bool_t *backward)
+                                       cairo_text_cluster_flags_t *cluster_flags)
 {
   cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED;
   cairo_font_face_t *face;
@@ -434,7 +436,7 @@
                                         3,
                                         CBOOL2RVAL (glyphs != NULL),
                                         CBOOL2RVAL (clusters != NULL),
-                                        CBOOL2RVAL (backward != NULL));
+                                        CBOOL2RVAL (cluster_flags != NULL));
       argv[2] = text_to_glyphs_data;
 
       data.receiver = receiver;
@@ -450,7 +452,7 @@
       after_hook_data.num_glyphs = num_glyphs;
       after_hook_data.clusters = clusters;
       after_hook_data.num_clusters = num_clusters;
-      after_hook_data.backward = backward;
+      after_hook_data.cluster_flags = cluster_flags;
 
       rb_cairo__invoke_callback (cr_user_font_face_invoke_func, (VALUE)&data);
     }
@@ -581,22 +583,30 @@
 static VALUE
 cr_text_to_glyphs_data_initialize (VALUE self,
                                    VALUE need_glyphs, VALUE need_clusters,
-                                   VALUE need_backward)
+                                   VALUE need_cluster_flags)
 {
   rb_ivar_set (self, cr_id_at_glyphs, Qnil);
   rb_ivar_set (self, cr_id_at_clusters, Qnil);
-  rb_ivar_set (self, cr_id_at_backward, Qfalse);
+  rb_ivar_set (self, cr_id_at_cluster_flags, INT2NUM (0));
   rb_ivar_set (self, cr_id_at_need_glyphs, need_glyphs);
   rb_ivar_set (self, cr_id_at_need_clusters, need_clusters);
-  rb_ivar_set (self, cr_id_at_need_backward, need_backward);
+  rb_ivar_set (self, cr_id_at_need_cluster_flags, need_cluster_flags);
 
   return Qnil;
 }
 
 static VALUE
-cr_text_to_glyphs_data_backward_p (VALUE self)
+cr_text_to_glyphs_data_get_cluster_flags (VALUE self)
 {
-  return rb_ivar_get (self, cr_id_at_backward);
+  return rb_ivar_get (self, cr_id_at_cluster_flags);
+}
+
+static VALUE
+cr_text_to_glyphs_data_set_cluster_flags (VALUE self, VALUE cluster_flags)
+{
+  rb_ivar_set (self, cr_id_at_cluster_flags,
+               INT2NUM (RVAL2CRTEXTCLUSTERFLAGS (cluster_flags)));
+  return Qnil;
 }
 
 static VALUE
@@ -612,16 +622,16 @@
 }
 
 static VALUE
-cr_text_to_glyphs_data_need_backward (VALUE self)
+cr_text_to_glyphs_data_need_cluster_flags (VALUE self)
 {
-  return rb_ivar_get (self, cr_id_at_need_backward);
+  return rb_ivar_get (self, cr_id_at_need_cluster_flags);
 }
 #endif
 
 void
 Init_cairo_font (void)
 {
-#if CAIRO_CHECK_VERSION(1, 7, 2)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
   cr_id_call = rb_intern ("call");
   cr_id_new = rb_intern ("new");
 
@@ -632,17 +642,17 @@
 
   cr_id_at_glyphs = rb_intern ("@glyphs");
   cr_id_at_clusters = rb_intern ("@clusters");
-  cr_id_at_backward = rb_intern ("@backward");
+  cr_id_at_cluster_flags = rb_intern ("@cluster_flags");
   cr_id_at_need_glyphs = rb_intern ("@need_glyphs");
   cr_id_at_need_clusters = rb_intern ("@need_clusters");
-  cr_id_at_need_backward = rb_intern ("@need_backward");
+  cr_id_at_need_cluster_flags = rb_intern ("@need_cluster_flags");
 #endif
 
   rb_cCairo_FontFace =
     rb_define_class_under (rb_mCairo, "FontFace", rb_cObject);
   rb_define_alloc_func (rb_cCairo_FontFace, cr_font_face_allocate);
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
   rb_cCairo_ToyFontFace =
     rb_define_class_under (rb_mCairo, "ToyFontFace", rb_cCairo_FontFace);
 
@@ -680,19 +690,24 @@
            CR_TRUE, CR_TRUE, CR_TRUE);
   rb_attr (rb_cCairo_UserFontFace_TextToGlyphsData, rb_intern ("clusters"),
            CR_TRUE, CR_TRUE, CR_TRUE);
-  rb_attr (rb_cCairo_UserFontFace_TextToGlyphsData, rb_intern ("backward"),
-           CR_FALSE, CR_TRUE, CR_TRUE);
 
   rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
                     "initialize", cr_text_to_glyphs_data_initialize, 3);
 
   rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
-                    "backward?", cr_text_to_glyphs_data_backward_p, 0);
+                    "cluster_flags",
+                    cr_text_to_glyphs_data_get_cluster_flags, 0);
+  rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
+                    "set_cluster_flags",
+                    cr_text_to_glyphs_data_set_cluster_flags, 1);
   rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
                     "need_glyphs?", cr_text_to_glyphs_data_need_glyphs, 0);
   rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
                     "need_clusters?", cr_text_to_glyphs_data_need_clusters, 0);
   rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
-                    "need_backward?", cr_text_to_glyphs_data_need_backward, 0);
+                    "need_cluster_flags?",
+                    cr_text_to_glyphs_data_need_cluster_flags, 0);
+
+  RB_CAIRO_DEF_SETTERS (rb_cCairo_UserFontFace_TextToGlyphsData);
 #endif
 }

Index: rb_cairo_font_options.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_font_options.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- rb_cairo_font_options.c	17 Aug 2008 07:21:42 -0000	1.5
+++ rb_cairo_font_options.c	19 Sep 2008 12:56:27 -0000	1.6
@@ -160,22 +160,6 @@
   return INT2NUM (cairo_font_options_get_hint_metrics (_SELF (self)));
 }
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
-static VALUE
-cr_options_set_lcd_filter (VALUE self, VALUE lcd_filter)
-{
-  cairo_font_options_set_lcd_filter (_SELF (self),
-                                     RVAL2CRLCDFILTER (lcd_filter));
-  return self;
-}
-
-static VALUE
-cr_options_get_lcd_filter (VALUE self)
-{
-  return INT2NUM (cairo_font_options_get_lcd_filter (_SELF (self)));
-}
-#endif
-
 
 void
 Init_cairo_font_options (void)
@@ -208,12 +192,6 @@
                     cr_options_set_hint_metrics, 1);
   rb_define_method (rb_cCairo_FontOptions, "hint_metrics",
                     cr_options_get_hint_metrics, 0);
-#if CAIRO_CHECK_VERSION(1, 7, 2)
-  rb_define_method (rb_cCairo_FontOptions, "set_lcd_filter",
-                    cr_options_set_lcd_filter, 1);
-  rb_define_method (rb_cCairo_FontOptions, "lcd_filter",
-                    cr_options_get_lcd_filter, 0);
-#endif
 
   RB_CAIRO_DEF_SETTERS (rb_cCairo_FontOptions);
 }

Index: rb_cairo_scaled_font.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_scaled_font.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rb_cairo_scaled_font.c	16 Aug 2008 08:34:19 -0000	1.7
+++ rb_cairo_scaled_font.c	19 Sep 2008 12:56:27 -0000	1.8
@@ -114,7 +114,7 @@
   return CRTEXTEXTENTS2RVAL (&extents);
 }
 
-#if CAIRO_CHECK_VERSION(1, 7, 2)
+#if CAIRO_CHECK_VERSION(1, 7, 6)
 static VALUE
 cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8)
 {
@@ -125,7 +125,7 @@
   int num_glyphs;
   cairo_text_cluster_t *clusters = NULL;
   int num_clusters;
-  cairo_bool_t backward;
+  cairo_text_cluster_flags_t cluster_flags;
   cairo_status_t status;
   VALUE rb_glyphs, rb_clusters;
 
@@ -138,7 +138,7 @@
                                              x, y, utf8, utf8_len,
                                              &glyphs, &num_glyphs,
                                              &clusters, &num_clusters,
-                                             &backward);
+                                             &cluster_flags);
   rb_cairo_check_status (status);
 
   rb_glyphs = rb_cairo__glyphs_to_ruby_object (glyphs, num_glyphs);
@@ -146,7 +146,7 @@
   rb_clusters = rb_cairo__text_clusters_to_ruby_object (clusters, num_clusters);
   cairo_text_cluster_free (clusters);
 
-  return rb_ary_new3 (3, rb_glyphs, rb_clusters, CBOOL2RVAL (backward));
+  return rb_ary_new3 (3, rb_glyphs, rb_clusters, INT2NUM (cluster_flags));
 }
 #endif
 



More information about the cairo-commit mailing list