src/rb_cairo_exception.c in cairo-1.5.1 vs src/rb_cairo_exception.c in cairo-1.6.0
- old
+ new
@@ -1,11 +1,11 @@
/* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
/*
* Ruby Cairo Binding
*
* $Author: kou $
- * $Date: 2007/03/06 12:17:34 $
+ * $Date: 2008-02-21 13:18:10 $
*
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
*
* This file is made available under the same terms as Ruby
@@ -35,10 +35,14 @@
static VALUE rb_eCairo_InvalidDscCommentError;
#if CAIRO_CHECK_VERSION(1, 3, 0)
static VALUE rb_eCairo_InvalidIndexError;
static VALUE rb_eCairo_ClipNotRepresentableError;
#endif
+#if CAIRO_CHECK_VERSION(1, 5, 6)
+static VALUE rb_eCairo_TempFileError;
+static VALUE rb_eCairo_InvalidStrideError;
+#endif
void
rb_cairo_check_status (cairo_status_t status)
{
const char *string = cairo_status_to_string (status);
@@ -113,10 +117,18 @@
break;
case CAIRO_STATUS_CLIP_NOT_REPRESENTABLE:
rb_raise (rb_eCairo_ClipNotRepresentableError, string);
break;
#endif
+#if CAIRO_CHECK_VERSION(1, 5, 6)
+ case CAIRO_STATUS_TEMP_FILE_ERROR:
+ rb_raise (rb_eCairo_TempFileError, string);
+ break;
+ case CAIRO_STATUS_INVALID_STRIDE:
+ rb_raise (rb_eCairo_InvalidStringError, string);
+ break;
+#endif
}
}
void
Init_cairo_exception ()
@@ -186,7 +198,17 @@
rb_define_class_under (rb_mCairo, "InvalidIndexError",
rb_eArgError);
rb_eCairo_ClipNotRepresentableError =
rb_define_class_under (rb_mCairo, "ClipNotRepresentableError",
rb_eCairo_Error);
+#endif
+
+#if CAIRO_CHECK_VERSION(1, 5, 6)
+ rb_eCairo_TempFileError =
+ rb_define_class_under (rb_mCairo, "TempFileError",
+ rb_eCairo_Error);
+
+ rb_eCairo_InvalidStrideError =
+ rb_define_class_under (rb_mCairo, "InvalidStrideError",
+ rb_eArgError);
#endif
}