[cairo-commit] rcairo/src cairo.def, 1.13, 1.14 rb_cairo.h, 1.18, 1.19 rb_cairo_constants.c, 1.9, 1.10 rb_cairo_font_options.c, 1.3, 1.4

Kouhei Sutou commit at pdx.freedesktop.org
Wed Aug 13 05:27:42 PDT 2008


Committed by: kou

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

Modified Files:
	cairo.def rb_cairo.h rb_cairo_constants.c 
	rb_cairo_font_options.c 
Log Message:
        * src/lib/cairo/constants.rb (Cairo::LCD_FILTER_*): define.

        * src/rb_cairo.h (RVAL2CRLCDFILTER,
        rb_cairo_lcd_filter_from_ruby_object): add.

        * src/cairo.def (rb_cairo_lcd_filter_from_ruby_object): add.

        * src/rb_cairo_font_options.c (Cairo::FontOptions#lcd_filter,
        Cairo::FontOptions#lcd_filter=): add.

        * test/test_font_options.rb: add.


Index: cairo.def
===================================================================
RCS file: /cvs/cairo/rcairo/src/cairo.def,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cairo.def	13 Aug 2008 12:05:29 -0000	1.13
+++ cairo.def	13 Aug 2008 12:27:39 -0000	1.14
@@ -94,4 +94,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_check_status

Index: rb_cairo.h
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- rb_cairo.h	13 Aug 2008 12:05:29 -0000	1.18
+++ rb_cairo.h	13 Aug 2008 12:27:39 -0000	1.19
@@ -5,6 +5,7 @@
  * $Author$
  * $Date$
  *
+ * Copyright 2006-2008 Kouhei Sutou <kou at cozmixng.org>
  * Copyright 2005 Øyvind Kolås <pippin at freedesktop.org>
  * Copyright 2004-2005 MenTaLguY <mental at rydia.com>
  *
@@ -221,6 +222,9 @@
 #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))
+#endif
 
 cairo_operator_t       rb_cairo_operator_from_ruby_object       (VALUE obj);
 cairo_antialias_t      rb_cairo_antialias_from_ruby_object      (VALUE obj);
@@ -245,6 +249,9 @@
 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);
+#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.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- rb_cairo_constants.c	13 Aug 2008 12:05:29 -0000	1.9
+++ rb_cairo_constants.c	13 Aug 2008 12:27:39 -0000	1.10
@@ -469,6 +469,7 @@
 #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));

Index: rb_cairo_font_options.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_font_options.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rb_cairo_font_options.c	26 May 2007 15:13:25 -0000	1.3
+++ rb_cairo_font_options.c	13 Aug 2008 12:27:40 -0000	1.4
@@ -5,7 +5,7 @@
  * $Author$
  * $Date$
  *
- * Copyright 2005 Kouhei Sutou <kou at cozmixng.org>
+ * Copyright 2005-2008 Kouhei Sutou <kou at cozmixng.org>
  *
  * This file is made available under the same terms as Ruby
  *
@@ -160,6 +160,20 @@
   return INT2NUM (cairo_font_options_get_hint_metrics (_SELF (self)));
 }
 
+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)));
+}
+
 
 void
 Init_cairo_font_options (void)
@@ -192,6 +206,10 @@
                     cr_options_set_hint_metrics, 1);
   rb_define_method (rb_cCairo_FontOptions, "hint_metrics",
                     cr_options_get_hint_metrics, 0);
+  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);
 
   RB_CAIRO_DEF_SETTERS (rb_cCairo_FontOptions);
 }



More information about the cairo-commit mailing list