cairo 1.7.0-x86-mswin32 → 1.8.0-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cairo might be problematic. Click here for more details.

Files changed (167) hide show
  1. data/ChangeLog +32 -0
  2. data/NEWS +9 -1
  3. data/README +1 -0
  4. data/Rakefile +2 -2
  5. data/cairo/DLL_FAQ.txt +397 -0
  6. data/cairo/README.txt +53 -0
  7. data/cairo/USAGE.txt +94 -0
  8. data/cairo/bin/libcairo-2.dll +0 -0
  9. data/cairo/bin/libpng12-0.dll +0 -0
  10. data/cairo/bin/zlib1.dll +0 -0
  11. data/cairo/include/cairo/cairo-deprecated.h +0 -4
  12. data/cairo/include/cairo/cairo-features.h +7 -22
  13. data/cairo/include/cairo/cairo-pdf.h +1 -1
  14. data/cairo/include/cairo/cairo-ps.h +1 -1
  15. data/cairo/include/cairo/cairo-svg.h +1 -1
  16. data/cairo/include/cairo/cairo-version.h +8 -0
  17. data/cairo/include/cairo/cairo-win32.h +9 -1
  18. data/cairo/include/cairo/cairo.h +420 -32
  19. data/cairo/include/libpng12/png.h +3592 -0
  20. data/cairo/include/libpng12/pngconf.h +1481 -0
  21. data/cairo/include/png.h +36 -13
  22. data/cairo/include/pngconf.h +3 -3
  23. data/cairo/include/zconf.h +332 -0
  24. data/cairo/include/zlib.h +1357 -0
  25. data/cairo/lib/cairo.def +22 -0
  26. data/cairo/lib/cairo.lib +0 -0
  27. data/cairo/lib/libcairo.dll.a +0 -0
  28. data/cairo/lib/libpng.def +1 -0
  29. data/cairo/lib/libpng.lib +0 -0
  30. data/cairo/lib/libpng12.dll.a +0 -0
  31. data/cairo/lib/pkgconfig/cairo-pdf.pc +5 -5
  32. data/cairo/lib/pkgconfig/cairo-png.pc +5 -5
  33. data/cairo/lib/pkgconfig/cairo-ps.pc +5 -5
  34. data/cairo/lib/pkgconfig/cairo-svg.pc +4 -4
  35. data/cairo/lib/pkgconfig/cairo-win32-font.pc +4 -4
  36. data/cairo/lib/pkgconfig/cairo-win32.pc +4 -4
  37. data/cairo/lib/pkgconfig/cairo.pc +4 -4
  38. data/cairo/lib/pkgconfig/libpng.pc +3 -2
  39. data/cairo/lib/pkgconfig/libpng12.pc +3 -2
  40. data/cairo/lib/zdll.exp +0 -0
  41. data/cairo/lib/zdll.lib +0 -0
  42. data/cairo/lib/zlib.def +60 -0
  43. data/cairo/manifest/cairo-dev_1.8.0-1_win32.mft +76 -0
  44. data/cairo/manifest/cairo_1.8.0-1_win32.mft +5 -0
  45. data/cairo/manifest/{libpng-dev-1.2.29.mft → libpng-dev_1.2.32-1_win32.mft} +5 -2
  46. data/cairo/manifest/libpng_1.2.32-1_win32.mft +2 -0
  47. data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING +0 -0
  48. data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING-LGPL-2.1 +0 -0
  49. data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING-MPL-1.1 +0 -0
  50. data/cairo/share/gtk-doc/html/cairo/bindings-errors.html +15 -11
  51. data/cairo/share/gtk-doc/html/cairo/bindings-fonts.html +15 -11
  52. data/cairo/share/gtk-doc/html/cairo/bindings-memory.html +20 -16
  53. data/cairo/share/gtk-doc/html/cairo/bindings-overloading.html +16 -12
  54. data/cairo/share/gtk-doc/html/cairo/bindings-path.html +17 -13
  55. data/cairo/share/gtk-doc/html/cairo/bindings-patterns.html +25 -21
  56. data/cairo/share/gtk-doc/html/cairo/bindings-return-values.html +17 -13
  57. data/cairo/share/gtk-doc/html/cairo/bindings-streams.html +14 -10
  58. data/cairo/share/gtk-doc/html/cairo/bindings-surfaces.html +19 -15
  59. data/cairo/share/gtk-doc/html/cairo/cairo-context.html +2721 -0
  60. data/cairo/share/gtk-doc/html/cairo/cairo-drawing.html +57 -0
  61. data/cairo/share/gtk-doc/html/cairo/cairo-error-status.html +361 -0
  62. data/cairo/share/gtk-doc/html/cairo/cairo-font-face.html +418 -0
  63. data/cairo/share/gtk-doc/html/cairo/cairo-font-options.html +695 -0
  64. data/cairo/share/gtk-doc/html/cairo/cairo-fonts.html +63 -0
  65. data/cairo/share/gtk-doc/html/cairo/cairo-ft-font.html +318 -0
  66. data/cairo/share/gtk-doc/html/cairo/cairo-image-surface.html +486 -0
  67. data/cairo/share/gtk-doc/html/cairo/{cairo-cairo-matrix-t.html → cairo-matrix.html} +137 -156
  68. data/cairo/share/gtk-doc/html/cairo/{cairo-Paths.html → cairo-paths.html} +275 -306
  69. data/cairo/share/gtk-doc/html/cairo/cairo-pattern.html +1524 -0
  70. data/cairo/share/gtk-doc/html/cairo/{cairo-PDF-Surfaces.html → cairo-pdf-surface.html} +60 -70
  71. data/cairo/share/gtk-doc/html/cairo/cairo-png-functions.html +332 -0
  72. data/cairo/share/gtk-doc/html/cairo/{cairo-PostScript-Surfaces.html → cairo-ps-surface.html} +131 -150
  73. data/cairo/share/gtk-doc/html/cairo/cairo-quartz-font.html +153 -0
  74. data/cairo/share/gtk-doc/html/cairo/{cairo-Quartz-Surfaces.html → cairo-quartz-surface.html} +53 -62
  75. data/cairo/share/gtk-doc/html/cairo/cairo-scaled-font.html +1051 -0
  76. data/cairo/share/gtk-doc/html/cairo/cairo-support.html +54 -0
  77. data/cairo/share/gtk-doc/html/cairo/cairo-surface.html +1064 -0
  78. data/cairo/share/gtk-doc/html/cairo/cairo-surfaces.html +69 -0
  79. data/cairo/share/gtk-doc/html/cairo/cairo-svg-surface.html +324 -0
  80. data/cairo/share/gtk-doc/html/cairo/cairo-text.html +1264 -0
  81. data/cairo/share/gtk-doc/html/cairo/{cairo-Transformations.html → cairo-transformations.html} +98 -115
  82. data/cairo/share/gtk-doc/html/cairo/cairo-types.html +134 -0
  83. data/cairo/share/gtk-doc/html/cairo/cairo-user-font.html +769 -0
  84. data/cairo/share/gtk-doc/html/cairo/cairo-version-info.html +355 -0
  85. data/cairo/share/gtk-doc/html/cairo/cairo-win32-font.html +366 -0
  86. data/cairo/share/gtk-doc/html/cairo/cairo-win32-surface.html +321 -0
  87. data/cairo/share/gtk-doc/html/cairo/{cairo-XLib-Surfaces.html → cairo-xlib-surface.html} +104 -121
  88. data/cairo/share/gtk-doc/html/cairo/cairo.devhelp +390 -405
  89. data/cairo/share/gtk-doc/html/cairo/cairo.devhelp2 +390 -405
  90. data/cairo/share/gtk-doc/html/cairo/index-1.2.html +63 -59
  91. data/cairo/share/gtk-doc/html/cairo/index-1.4.html +45 -41
  92. data/cairo/share/gtk-doc/html/cairo/index-1.6.html +29 -23
  93. data/cairo/share/gtk-doc/html/cairo/index-1.8.html +107 -0
  94. data/cairo/share/gtk-doc/html/cairo/index-all.html +759 -0
  95. data/cairo/share/gtk-doc/html/cairo/index.html +51 -41
  96. data/cairo/share/gtk-doc/html/cairo/index.sgml +478 -466
  97. data/cairo/share/gtk-doc/html/cairo/language-bindings.html +22 -18
  98. data/cairo/share/gtk-doc/html/cairo/style.css +14 -2
  99. data/cairo/share/man/man3/libpng.3 +443 -17
  100. data/cairo/share/man/man3/libpngpf.3 +618 -102
  101. data/cairo/share/man/man5/png.5 +1 -1
  102. data/cairo/src/tml/make/cairo_1.8.0-1_win32.log +1021 -0
  103. data/cairo/src/tml/make/cairo_1.8.0-1_win32.sh +68 -0
  104. data/cairo/src/tml/make/libpng_1.2.32-1_win32.log +269 -0
  105. data/cairo/src/tml/make/libpng_1.2.32-1_win32.sh +63 -0
  106. data/cairo/test/example_d.exe +0 -0
  107. data/cairo/test/minigzip_d.exe +0 -0
  108. data/cairo/test/testzlib_d.exe +0 -0
  109. data/cairo/test/untgz_d.exe +0 -0
  110. data/doc/en/cairo-context.html +81 -91
  111. data/doc/en/cairo-font-options.html +11 -26
  112. data/doc/en/cairo-text-cluster-flag.html +35 -0
  113. data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +3 -3
  114. data/doc/en/cairo.html +38 -42
  115. data/doc/en/index.html +129 -142
  116. data/doc/ja/cairo-font-options.html +3 -25
  117. data/doc/ja/cairo-text-cluster-flag.html +46 -0
  118. data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +16 -15
  119. data/doc/ja/cairo.html +3 -7
  120. data/doc/ja/index.html +9 -17
  121. data/src/cairo.def +1 -1
  122. data/src/cairo.so +0 -0
  123. data/src/lib/cairo/constants.rb +3 -1
  124. data/src/libruby-cairo.a +0 -0
  125. data/src/rb_cairo.c +2 -2
  126. data/src/rb_cairo.h +5 -5
  127. data/src/rb_cairo_constants.c +12 -19
  128. data/src/rb_cairo_context.c +25 -21
  129. data/src/rb_cairo_font_face.c +44 -29
  130. data/src/rb_cairo_font_options.c +1 -23
  131. data/src/rb_cairo_scaled_font.c +5 -5
  132. data/test/test_constants.rb +6 -9
  133. data/test/test_context.rb +0 -12
  134. data/test/test_font_face.rb +7 -7
  135. data/test/test_font_options.rb +2 -21
  136. data/test/test_scaled_font.rb +3 -3
  137. data/test/test_text_to_glyphs_data.rb +19 -15
  138. metadata +68 -45
  139. data/cairo/make/cairo-1.6.4-2.sh +0 -55
  140. data/cairo/make/libpng-1.2.29.sh +0 -35
  141. data/cairo/manifest/cairo-1.6.4-2.mft +0 -6
  142. data/cairo/manifest/cairo-dev-1.6.4-2.mft +0 -72
  143. data/cairo/manifest/libpng-1.2.29.mft +0 -2
  144. data/cairo/share/gtk-doc/html/cairo/Drawing.html +0 -53
  145. data/cairo/share/gtk-doc/html/cairo/Fonts.html +0 -56
  146. data/cairo/share/gtk-doc/html/cairo/Support.html +0 -50
  147. data/cairo/share/gtk-doc/html/cairo/Surfaces.html +0 -65
  148. data/cairo/share/gtk-doc/html/cairo/cairo-Error-Handling.html +0 -328
  149. data/cairo/share/gtk-doc/html/cairo/cairo-Font-Options.html +0 -720
  150. data/cairo/share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html +0 -297
  151. data/cairo/share/gtk-doc/html/cairo/cairo-Image-Surfaces.html +0 -484
  152. data/cairo/share/gtk-doc/html/cairo/cairo-PNG-Support.html +0 -345
  153. data/cairo/share/gtk-doc/html/cairo/cairo-Patterns.html +0 -1560
  154. data/cairo/share/gtk-doc/html/cairo/cairo-Quartz-Fonts.html +0 -161
  155. data/cairo/share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html +0 -337
  156. data/cairo/share/gtk-doc/html/cairo/cairo-Scaled-Fonts.html +0 -823
  157. data/cairo/share/gtk-doc/html/cairo/cairo-Text.html +0 -836
  158. data/cairo/share/gtk-doc/html/cairo/cairo-Types.html +0 -143
  159. data/cairo/share/gtk-doc/html/cairo/cairo-Version-Information.html +0 -325
  160. data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Fonts.html +0 -381
  161. data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html +0 -331
  162. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html +0 -427
  163. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html +0 -995
  164. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-t.html +0 -2795
  165. data/cairo/share/gtk-doc/html/cairo/ix01.html +0 -693
  166. data/doc/en/cairo-lcd-filter.html +0 -39
  167. data/doc/ja/cairo-lcd-filter.html +0 -63
@@ -3,7 +3,7 @@
3
3
  * Ruby Cairo Binding
4
4
  *
5
5
  * $Author: kou $
6
- * $Date: 2008-08-17 06:11:51 $
6
+ * $Date: 2008-09-26 14:13:58 $
7
7
  *
8
8
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
9
9
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
@@ -21,7 +21,7 @@ VALUE rb_cCairo_ToyFontFace = Qnil;
21
21
  VALUE rb_cCairo_UserFontFace = Qnil;
22
22
  VALUE rb_cCairo_UserFontFace_TextToGlyphsData = Qnil;
23
23
 
24
- #if CAIRO_CHECK_VERSION(1, 7, 2)
24
+ #if CAIRO_CHECK_VERSION(1, 7, 6)
25
25
  static cairo_user_data_key_t ruby_object_key;
26
26
  static ID cr_id_call;
27
27
  static ID cr_id_new;
@@ -33,10 +33,10 @@ static ID cr_id_unicode_to_glyph;
33
33
 
34
34
  static ID cr_id_at_glyphs;
35
35
  static ID cr_id_at_clusters;
36
- static ID cr_id_at_backward;
36
+ static ID cr_id_at_cluster_flags;
37
37
  static ID cr_id_at_need_glyphs;
38
38
  static ID cr_id_at_need_clusters;
39
- static ID cr_id_at_need_backward;
39
+ static ID cr_id_at_need_cluster_flags;
40
40
  #endif
41
41
 
42
42
  #define _SELF (RVAL2CRFONTFACE(self))
@@ -84,7 +84,7 @@ rb_cairo_font_face_to_ruby_object (cairo_font_face_t *face)
84
84
 
85
85
  switch (cairo_font_face_get_type (face))
86
86
  {
87
- #if CAIRO_CHECK_VERSION(1, 7, 2)
87
+ #if CAIRO_CHECK_VERSION(1, 7, 6)
88
88
  case CAIRO_FONT_TYPE_TOY:
89
89
  klass = rb_cCairo_ToyFontFace;
90
90
  break;
@@ -111,7 +111,7 @@ cr_font_face_allocate (VALUE klass)
111
111
  return Data_Wrap_Struct (klass, NULL, cr_font_face_free, NULL);
112
112
  }
113
113
 
114
- #if CAIRO_CHECK_VERSION(1, 7, 2)
114
+ #if CAIRO_CHECK_VERSION(1, 7, 6)
115
115
  static VALUE
116
116
  cr_toy_font_face_initialize (int argc, VALUE *argv, VALUE self)
117
117
  {
@@ -346,7 +346,7 @@ typedef struct _cr_text_to_glyphs_after_hook_data {
346
346
  int *num_glyphs;
347
347
  cairo_text_cluster_t **clusters;
348
348
  int *num_clusters;
349
- cairo_bool_t *backward;
349
+ cairo_text_cluster_flags_t *cluster_flags;
350
350
  } cr_text_to_glyphs_after_hook_data_t;
351
351
 
352
352
  static VALUE
@@ -381,12 +381,14 @@ cr_user_font_face_text_to_glyphs_func_after (VALUE user_data)
381
381
  after_hook_data->num_clusters);
382
382
  }
383
383
 
384
- if (after_hook_data->backward)
384
+ if (after_hook_data->cluster_flags)
385
385
  {
386
- VALUE rb_backward;
386
+ VALUE rb_cluster_flags;
387
387
 
388
- rb_backward = rb_ivar_get (text_to_glyphs_data, cr_id_at_backward);
389
- *(after_hook_data->backward) = RVAL2CBOOL (rb_backward);
388
+ rb_cluster_flags = rb_ivar_get (text_to_glyphs_data,
389
+ cr_id_at_cluster_flags);
390
+ *(after_hook_data->cluster_flags) =
391
+ RVAL2CRTEXTCLUSTERFLAGS (rb_cluster_flags);
390
392
  }
391
393
 
392
394
  return data->result;
@@ -398,7 +400,7 @@ cr_user_font_face_text_to_glyphs_func (cairo_scaled_font_t *scaled_font,
398
400
  cairo_glyph_t **glyphs, int *num_glyphs,
399
401
  cairo_text_cluster_t **clusters,
400
402
  int *num_clusters,
401
- cairo_bool_t *backward)
403
+ cairo_text_cluster_flags_t *cluster_flags)
402
404
  {
403
405
  cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED;
404
406
  cairo_font_face_t *face;
@@ -434,7 +436,7 @@ cr_user_font_face_text_to_glyphs_func (cairo_scaled_font_t *scaled_font,
434
436
  3,
435
437
  CBOOL2RVAL (glyphs != NULL),
436
438
  CBOOL2RVAL (clusters != NULL),
437
- CBOOL2RVAL (backward != NULL));
439
+ CBOOL2RVAL (cluster_flags != NULL));
438
440
  argv[2] = text_to_glyphs_data;
439
441
 
440
442
  data.receiver = receiver;
@@ -450,7 +452,7 @@ cr_user_font_face_text_to_glyphs_func (cairo_scaled_font_t *scaled_font,
450
452
  after_hook_data.num_glyphs = num_glyphs;
451
453
  after_hook_data.clusters = clusters;
452
454
  after_hook_data.num_clusters = num_clusters;
453
- after_hook_data.backward = backward;
455
+ after_hook_data.cluster_flags = cluster_flags;
454
456
 
455
457
  rb_cairo__invoke_callback (cr_user_font_face_invoke_func, (VALUE)&data);
456
458
  }
@@ -581,22 +583,30 @@ cr_user_font_face_on_unicode_to_glyph (VALUE self)
581
583
  static VALUE
582
584
  cr_text_to_glyphs_data_initialize (VALUE self,
583
585
  VALUE need_glyphs, VALUE need_clusters,
584
- VALUE need_backward)
586
+ VALUE need_cluster_flags)
585
587
  {
586
588
  rb_ivar_set (self, cr_id_at_glyphs, Qnil);
587
589
  rb_ivar_set (self, cr_id_at_clusters, Qnil);
588
- rb_ivar_set (self, cr_id_at_backward, Qfalse);
590
+ rb_ivar_set (self, cr_id_at_cluster_flags, INT2NUM (0));
589
591
  rb_ivar_set (self, cr_id_at_need_glyphs, need_glyphs);
590
592
  rb_ivar_set (self, cr_id_at_need_clusters, need_clusters);
591
- rb_ivar_set (self, cr_id_at_need_backward, need_backward);
593
+ rb_ivar_set (self, cr_id_at_need_cluster_flags, need_cluster_flags);
592
594
 
593
595
  return Qnil;
594
596
  }
595
597
 
596
598
  static VALUE
597
- cr_text_to_glyphs_data_backward_p (VALUE self)
599
+ cr_text_to_glyphs_data_get_cluster_flags (VALUE self)
598
600
  {
599
- return rb_ivar_get (self, cr_id_at_backward);
601
+ return rb_ivar_get (self, cr_id_at_cluster_flags);
602
+ }
603
+
604
+ static VALUE
605
+ cr_text_to_glyphs_data_set_cluster_flags (VALUE self, VALUE cluster_flags)
606
+ {
607
+ rb_ivar_set (self, cr_id_at_cluster_flags,
608
+ INT2NUM (RVAL2CRTEXTCLUSTERFLAGS (cluster_flags)));
609
+ return Qnil;
600
610
  }
601
611
 
602
612
  static VALUE
@@ -612,16 +622,16 @@ cr_text_to_glyphs_data_need_clusters (VALUE self)
612
622
  }
613
623
 
614
624
  static VALUE
615
- cr_text_to_glyphs_data_need_backward (VALUE self)
625
+ cr_text_to_glyphs_data_need_cluster_flags (VALUE self)
616
626
  {
617
- return rb_ivar_get (self, cr_id_at_need_backward);
627
+ return rb_ivar_get (self, cr_id_at_need_cluster_flags);
618
628
  }
619
629
  #endif
620
630
 
621
631
  void
622
632
  Init_cairo_font (void)
623
633
  {
624
- #if CAIRO_CHECK_VERSION(1, 7, 2)
634
+ #if CAIRO_CHECK_VERSION(1, 7, 6)
625
635
  cr_id_call = rb_intern ("call");
626
636
  cr_id_new = rb_intern ("new");
627
637
 
@@ -632,17 +642,17 @@ Init_cairo_font (void)
632
642
 
633
643
  cr_id_at_glyphs = rb_intern ("@glyphs");
634
644
  cr_id_at_clusters = rb_intern ("@clusters");
635
- cr_id_at_backward = rb_intern ("@backward");
645
+ cr_id_at_cluster_flags = rb_intern ("@cluster_flags");
636
646
  cr_id_at_need_glyphs = rb_intern ("@need_glyphs");
637
647
  cr_id_at_need_clusters = rb_intern ("@need_clusters");
638
- cr_id_at_need_backward = rb_intern ("@need_backward");
648
+ cr_id_at_need_cluster_flags = rb_intern ("@need_cluster_flags");
639
649
  #endif
640
650
 
641
651
  rb_cCairo_FontFace =
642
652
  rb_define_class_under (rb_mCairo, "FontFace", rb_cObject);
643
653
  rb_define_alloc_func (rb_cCairo_FontFace, cr_font_face_allocate);
644
654
 
645
- #if CAIRO_CHECK_VERSION(1, 7, 2)
655
+ #if CAIRO_CHECK_VERSION(1, 7, 6)
646
656
  rb_cCairo_ToyFontFace =
647
657
  rb_define_class_under (rb_mCairo, "ToyFontFace", rb_cCairo_FontFace);
648
658
 
@@ -680,19 +690,24 @@ Init_cairo_font (void)
680
690
  CR_TRUE, CR_TRUE, CR_TRUE);
681
691
  rb_attr (rb_cCairo_UserFontFace_TextToGlyphsData, rb_intern ("clusters"),
682
692
  CR_TRUE, CR_TRUE, CR_TRUE);
683
- rb_attr (rb_cCairo_UserFontFace_TextToGlyphsData, rb_intern ("backward"),
684
- CR_FALSE, CR_TRUE, CR_TRUE);
685
693
 
686
694
  rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
687
695
  "initialize", cr_text_to_glyphs_data_initialize, 3);
688
696
 
689
697
  rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
690
- "backward?", cr_text_to_glyphs_data_backward_p, 0);
698
+ "cluster_flags",
699
+ cr_text_to_glyphs_data_get_cluster_flags, 0);
700
+ rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
701
+ "cluster_flags=",
702
+ cr_text_to_glyphs_data_set_cluster_flags, 1);
691
703
  rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
692
704
  "need_glyphs?", cr_text_to_glyphs_data_need_glyphs, 0);
693
705
  rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
694
706
  "need_clusters?", cr_text_to_glyphs_data_need_clusters, 0);
695
707
  rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
696
- "need_backward?", cr_text_to_glyphs_data_need_backward, 0);
708
+ "need_cluster_flags?",
709
+ cr_text_to_glyphs_data_need_cluster_flags, 0);
710
+
711
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_UserFontFace_TextToGlyphsData);
697
712
  #endif
698
713
  }
@@ -3,7 +3,7 @@
3
3
  * Ruby Cairo Binding
4
4
  *
5
5
  * $Author: kou $
6
- * $Date: 2008-08-17 07:21:42 $
6
+ * $Date: 2008-09-19 12:56:27 $
7
7
  *
8
8
  * Copyright 2005-2008 Kouhei Sutou <kou@cozmixng.org>
9
9
  *
@@ -160,22 +160,6 @@ cr_options_get_hint_metrics (VALUE self)
160
160
  return INT2NUM (cairo_font_options_get_hint_metrics (_SELF (self)));
161
161
  }
162
162
 
163
- #if CAIRO_CHECK_VERSION(1, 7, 2)
164
- static VALUE
165
- cr_options_set_lcd_filter (VALUE self, VALUE lcd_filter)
166
- {
167
- cairo_font_options_set_lcd_filter (_SELF (self),
168
- RVAL2CRLCDFILTER (lcd_filter));
169
- return self;
170
- }
171
-
172
- static VALUE
173
- cr_options_get_lcd_filter (VALUE self)
174
- {
175
- return INT2NUM (cairo_font_options_get_lcd_filter (_SELF (self)));
176
- }
177
- #endif
178
-
179
163
 
180
164
  void
181
165
  Init_cairo_font_options (void)
@@ -208,12 +192,6 @@ Init_cairo_font_options (void)
208
192
  cr_options_set_hint_metrics, 1);
209
193
  rb_define_method (rb_cCairo_FontOptions, "hint_metrics",
210
194
  cr_options_get_hint_metrics, 0);
211
- #if CAIRO_CHECK_VERSION(1, 7, 2)
212
- rb_define_method (rb_cCairo_FontOptions, "set_lcd_filter",
213
- cr_options_set_lcd_filter, 1);
214
- rb_define_method (rb_cCairo_FontOptions, "lcd_filter",
215
- cr_options_get_lcd_filter, 0);
216
- #endif
217
195
 
218
196
  RB_CAIRO_DEF_SETTERS (rb_cCairo_FontOptions);
219
197
  }
@@ -3,7 +3,7 @@
3
3
  * Ruby Cairo Binding
4
4
  *
5
5
  * $Author: kou $
6
- * $Date: 2008-08-16 08:34:19 $
6
+ * $Date: 2008-09-19 12:56:27 $
7
7
  *
8
8
  * Copyright 2005-2008 Kouhei Sutou <kou@cozmixng.org>
9
9
  *
@@ -114,7 +114,7 @@ cr_scaled_font_glyph_extents (VALUE self, VALUE rb_glyphs)
114
114
  return CRTEXTEXTENTS2RVAL (&extents);
115
115
  }
116
116
 
117
- #if CAIRO_CHECK_VERSION(1, 7, 2)
117
+ #if CAIRO_CHECK_VERSION(1, 7, 6)
118
118
  static VALUE
119
119
  cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8)
120
120
  {
@@ -125,7 +125,7 @@ cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8
125
125
  int num_glyphs;
126
126
  cairo_text_cluster_t *clusters = NULL;
127
127
  int num_clusters;
128
- cairo_bool_t backward;
128
+ cairo_text_cluster_flags_t cluster_flags;
129
129
  cairo_status_t status;
130
130
  VALUE rb_glyphs, rb_clusters;
131
131
 
@@ -138,7 +138,7 @@ cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8
138
138
  x, y, utf8, utf8_len,
139
139
  &glyphs, &num_glyphs,
140
140
  &clusters, &num_clusters,
141
- &backward);
141
+ &cluster_flags);
142
142
  rb_cairo_check_status (status);
143
143
 
144
144
  rb_glyphs = rb_cairo__glyphs_to_ruby_object (glyphs, num_glyphs);
@@ -146,7 +146,7 @@ cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8
146
146
  rb_clusters = rb_cairo__text_clusters_to_ruby_object (clusters, num_clusters);
147
147
  cairo_text_cluster_free (clusters);
148
148
 
149
- return rb_ary_new3 (3, rb_glyphs, rb_clusters, CBOOL2RVAL (backward));
149
+ return rb_ary_new3 (3, rb_glyphs, rb_clusters, INT2NUM (cluster_flags));
150
150
  }
151
151
  #endif
152
152
 
@@ -1,19 +1,16 @@
1
1
  require 'cairo'
2
2
 
3
3
  class ConstantsTest < Test::Unit::TestCase
4
- def test_lcd_filter
5
- constant_name = "LCDFilter"
6
- unless Cairo.satisfied_version?(1, 7, 2)
4
+ def test_text_cluster_flags
5
+ constant_name = "TextClusterFlag"
6
+ unless Cairo.satisfied_version?(1, 7, 6)
7
7
  assert_false(Cairo.const_defined?(constant_name))
8
8
  return
9
9
  end
10
10
 
11
11
  assert_true(Cairo.const_defined?(constant_name))
12
- assert_equal((0..4).to_a,
13
- [Cairo::LCDFilter::DEFAULT,
14
- Cairo::LCDFilter::NONE,
15
- Cairo::LCDFilter::INTRA_PIXEL,
16
- Cairo::LCDFilter::FIR3,
17
- Cairo::LCDFilter::FIR5])
12
+ assert_equal((0..1).to_a,
13
+ [0,
14
+ Cairo::TextClusterFlag::BACKWARD])
18
15
  end
19
16
  end
data/test/test_context.rb CHANGED
@@ -49,18 +49,6 @@ class ContextTest < Test::Unit::TestCase
49
49
  assert_equal("sans", context.font_face.family)
50
50
  end
51
51
 
52
- def test_have_show_text_glyphs?
53
- only_cairo_version(1, 7, 2)
54
-
55
- pdf_surface = Cairo::PDFSurface.new(@output, 10, 10)
56
- context = Cairo::Context.new(pdf_surface)
57
- assert_true(context.have_show_text_glyphs?)
58
-
59
- image_surface = Cairo::ImageSurface.new(10, 10)
60
- context = Cairo::Context.new(image_surface)
61
- assert_false(context.have_show_text_glyphs?)
62
- end
63
-
64
52
  def test_text_to_glyphs
65
53
  only_cairo_version(1, 7, 2)
66
54
 
@@ -54,7 +54,7 @@ class FontFaceTest < Test::Unit::TestCase
54
54
  Cairo::Matrix.identity,
55
55
  Cairo::Matrix.identity,
56
56
  Cairo::FontOptions.new)
57
- assert_equal([[], [], false],
57
+ assert_equal([[], [], 0],
58
58
  scaled_font.text_to_glyphs(0, 0, "text"))
59
59
  end
60
60
 
@@ -77,7 +77,7 @@ class FontFaceTest < Test::Unit::TestCase
77
77
  face.on_text_to_glyphs do |*args|
78
78
  text_to_glyphs_args << args
79
79
  scaled_font, utf8, data = args
80
- data.backward = true
80
+ data.cluster_flags = :backward
81
81
  end
82
82
 
83
83
  unicode_to_glyph_args = []
@@ -102,7 +102,7 @@ class FontFaceTest < Test::Unit::TestCase
102
102
  [Cairo::ScaledFont, ?e],
103
103
  [Cairo::ScaledFont, ?x],
104
104
  [Cairo::ScaledFont, ?t]],
105
- [[], [], true]],
105
+ [[], [], Cairo::TextClusterFlag::BACKWARD]],
106
106
  [classify_cairo_object(init_args),
107
107
  classify_cairo_object(render_glyph_args),
108
108
  classify_cairo_object(text_to_glyphs_args),
@@ -133,7 +133,7 @@ class FontFaceTest < Test::Unit::TestCase
133
133
  def text_to_glyphs(*args)
134
134
  @text_to_glyphs_args << args
135
135
  scaled_font, utf8, data = args
136
- data.backward = true
136
+ data.cluster_flags = :backward
137
137
  end
138
138
 
139
139
  def unicode_to_glyph(*args)
@@ -164,7 +164,7 @@ class FontFaceTest < Test::Unit::TestCase
164
164
  [Cairo::ScaledFont, ?e],
165
165
  [Cairo::ScaledFont, ?x],
166
166
  [Cairo::ScaledFont, ?t]],
167
- [[], [], true]],
167
+ [[], [], Cairo::TextClusterFlag::BACKWARD]],
168
168
  [classify_cairo_object(face.init_args),
169
169
  classify_cairo_object(face.render_glyph_args),
170
170
  classify_cairo_object(face.text_to_glyphs_args),
@@ -191,7 +191,7 @@ class FontFaceTest < Test::Unit::TestCase
191
191
  face.on_text_to_glyphs do |*args|
192
192
  text_to_glyphs_args << args
193
193
  scaled_font, utf8, data = args
194
- data.backward = true
194
+ data.cluster_flags = :backward
195
195
  end
196
196
 
197
197
  unicode_to_glyph_args = []
@@ -220,7 +220,7 @@ class FontFaceTest < Test::Unit::TestCase
220
220
  [],
221
221
  [],
222
222
  [],
223
- [[], [], true]],
223
+ [[], [], Cairo::TextClusterFlag::BACKWARD]],
224
224
  [classify_cairo_object(init_args),
225
225
  classify_cairo_object(render_glyph_args),
226
226
  classify_cairo_object(text_to_glyphs_args),
@@ -7,26 +7,7 @@ class FontOptionsTest < Test::Unit::TestCase
7
7
  @options = Cairo::FontOptions.new
8
8
  end
9
9
 
10
- def test_lcd_filter
11
- only_cairo_version(1, 7, 2)
12
-
13
- assert_equal(Cairo::LCDFilter::DEFAULT, @options.lcd_filter)
14
- @options.lcd_filter = :fir3
15
- assert_equal(Cairo::LCDFilter::FIR3, @options.lcd_filter)
16
-
17
- assert_invalid_lcd_filter(Cairo::LCDFilter::DEFAULT - 1)
18
- assert_invalid_lcd_filter(Cairo::LCDFilter::FIR5 + 1)
19
- end
20
-
21
- def assert_invalid_lcd_filter(value)
22
- options = Cairo::FontOptions.new
23
- exception = assert_raise(ArgumentError) do
24
- options.lcd_filter = value
25
- end
26
- min = Cairo::LCDFilter::DEFAULT
27
- max = Cairo::LCDFilter::FIR5
28
- assert_equal("invalid lcd_filter: #{value} " +
29
- "(expect #{min} <= lcd_filter <= #{max})",
30
- exception.message)
10
+ def test_something
11
+ # WRITE ME!
31
12
  end
32
13
  end
@@ -17,7 +17,7 @@ class ScaledFontTest < Test::Unit::TestCase
17
17
  end
18
18
 
19
19
  def test_text_to_glyphs
20
- only_cairo_version(1, 7, 2)
20
+ only_cairo_version(1, 7, 6)
21
21
 
22
22
  surface = Cairo::PDFSurface.new(StringIO.new, 10, 10)
23
23
  context = Cairo::Context.new(surface)
@@ -27,8 +27,8 @@ class ScaledFontTest < Test::Unit::TestCase
27
27
  Cairo::FontOptions.new)
28
28
  expected_glyphs = []
29
29
  expected_clusters = []
30
- expected_backward = false
31
- assert_equal([expected_glyphs, expected_clusters, expected_backward],
30
+ expected_cluster_flags = 0
31
+ assert_equal([expected_glyphs, expected_clusters, expected_cluster_flags],
32
32
  scaled_font.text_to_glyphs(0, 0, "text"))
33
33
  end
34
34
  end