[cairo-commit] pycairo/cairo pycairo-surface.c, 1.88, 1.89 pycairo-context.c, 1.86, 1.87 pycairo-private.h, 1.44, 1.45

Steve Chaplin commit at pdx.freedesktop.org
Mon May 12 05:06:39 PDT 2008


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory kemper:/tmp/cvs-serv7565/cairo

Modified Files:
	pycairo-surface.c pycairo-context.c pycairo-private.h 
Log Message:
'SC'

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- pycairo-surface.c	8 May 2008 14:58:56 -0000	1.88
+++ pycairo-surface.c	12 May 2008 12:06:37 -0000	1.89
@@ -154,6 +154,14 @@
 }
 
 static PyObject *
+surface_copy_page (PycairoSurface *o)
+{
+    cairo_surface_copy_page (o->surface);
+    RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
 surface_create_similar (PycairoSurface *o, PyObject *args)
 {
     cairo_content_t content;
@@ -249,6 +257,14 @@
     Py_RETURN_NONE;
 }
 
+static PyObject *
+surface_show_page (PycairoSurface *o)
+{
+    cairo_surface_show_page (o->surface);
+    RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+    Py_RETURN_NONE;
+}
+
 #ifdef CAIRO_HAS_PNG_FUNCTIONS
 /* METH_O */
 static PyObject *
@@ -288,20 +304,20 @@
      * cairo_surface_reference()
      * cairo_surface_set_user_data()
      */
-    {"create_similar", (PyCFunction)surface_create_similar,    METH_VARARGS },
-    {"finish",         (PyCFunction)surface_finish,            METH_NOARGS },
-    {"flush",          (PyCFunction)surface_flush,             METH_NOARGS },
-    {"get_content",    (PyCFunction)surface_get_content,       METH_NOARGS },
-    {"get_device_offset",(PyCFunction)surface_get_device_offset,
-                                                                METH_NOARGS },
-    {"get_font_options",(PyCFunction)surface_get_font_options, METH_NOARGS },
-    {"mark_dirty",     (PyCFunction)surface_mark_dirty,        METH_KEYWORDS },
-    {"set_device_offset",(PyCFunction)surface_set_device_offset,
-                                                                METH_VARARGS },
+    {"copy_page",      (PyCFunction)surface_copy_page,          METH_NOARGS},
+    {"create_similar", (PyCFunction)surface_create_similar,     METH_VARARGS},
+    {"finish",         (PyCFunction)surface_finish,             METH_NOARGS},
+    {"flush",          (PyCFunction)surface_flush,              METH_NOARGS},
+    {"get_content",    (PyCFunction)surface_get_content,        METH_NOARGS},
+    {"get_device_offset",(PyCFunction)surface_get_device_offset,METH_NOARGS},
+    {"get_font_options",(PyCFunction)surface_get_font_options,  METH_NOARGS},
+    {"mark_dirty",     (PyCFunction)surface_mark_dirty,         METH_KEYWORDS},
+    {"set_device_offset",(PyCFunction)surface_set_device_offset,METH_VARARGS},
     {"set_fallback_resolution",(PyCFunction)surface_set_fallback_resolution,
-                                                                METH_VARARGS },
+                                                                METH_VARARGS},
+    {"show_page",      (PyCFunction)surface_show_page,          METH_NOARGS},
 #ifdef CAIRO_HAS_PNG_FUNCTIONS
-    {"write_to_png",   (PyCFunction)surface_write_to_png,      METH_O },
+    {"write_to_png",   (PyCFunction)surface_write_to_png,       METH_O },
 #endif
     {NULL, NULL, 0, NULL},
 };
@@ -390,29 +406,17 @@
     if (width <= 0) {
 	PyErr_SetString(PyExc_ValueError, "width must be positive");
 	return NULL;
-    }
+	}
     if (height <= 0) {
 	PyErr_SetString(PyExc_ValueError, "height must be positive");
 	return NULL;
     }
     /* if stride is missing, calculate it from width */
     if (stride < 0) {
-	switch (format) {
-	case CAIRO_FORMAT_ARGB32:
-	case CAIRO_FORMAT_RGB24:
-	    stride = width * 4;
-	    break;
-	case CAIRO_FORMAT_RGB16_565:
-	    stride = width * 2;
-	    break;
-	case CAIRO_FORMAT_A8:
-	    stride = width;
-	    break;
-	case CAIRO_FORMAT_A1: /* should be stride = (width + 31) / 32 * 4 ? */
-	    stride = (width + 1) / 8;
-	    break;
-	default:
-	    PyErr_SetString(CairoError, "Unknown format");
+	stride = cairo_format_stride_for_width (format, width);
+	if (stride == -1){
+	    PyErr_SetString(CairoError,
+			    "format is invalid or the width too large");
 	    return NULL;
 	}
     }
@@ -472,6 +476,17 @@
 }
 #endif /* CAIRO_HAS_PNG_FUNCTIONS */
 
+/* METH_STATIC */
+static PyObject *
+image_surface_format_stride_for_width (PyObject *self, PyObject *args)
+{
+    cairo_format_t format;
+    int width;
+    if (!PyArg_ParseTuple(args, "ii:format_stride_for_width", &format, &width))
+	return NULL;
+    return PyInt_FromLong (cairo_format_stride_for_width (format, width));
+}
+
 static PyObject *
 image_surface_get_data (PycairoImageSurface *o)
 {
@@ -563,16 +578,19 @@
 
 static PyMethodDef image_surface_methods[] = {
     {"create_for_data",(PyCFunction)image_surface_create_for_data,
-                                                   METH_VARARGS | METH_CLASS },
+                                                    METH_VARARGS | METH_CLASS},
 #ifdef CAIRO_HAS_PNG_FUNCTIONS
     {"create_from_png", (PyCFunction)image_surface_create_from_png,
-                                                   METH_O | METH_CLASS },
+                                                          METH_O | METH_CLASS},
 #endif
-    {"get_data",      (PyCFunction)image_surface_get_data,       METH_NOARGS},
-    {"get_format",    (PyCFunction)image_surface_get_format,     METH_NOARGS},
-    {"get_height",    (PyCFunction)image_surface_get_height,     METH_NOARGS},
-    {"get_width",     (PyCFunction)image_surface_get_width,      METH_NOARGS},
-    {"get_stride",    (PyCFunction)image_surface_get_stride,     METH_NOARGS},
+    {"format_stride_for_width",
+     (PyCFunction)image_surface_format_stride_for_width,
+                                                   METH_VARARGS | METH_STATIC},
+    {"get_data",      (PyCFunction)image_surface_get_data,        METH_NOARGS},
+    {"get_format",    (PyCFunction)image_surface_get_format,      METH_NOARGS},
+    {"get_height",    (PyCFunction)image_surface_get_height,      METH_NOARGS},
+    {"get_width",     (PyCFunction)image_surface_get_width,       METH_NOARGS},
+    {"get_stride",    (PyCFunction)image_surface_get_stride,      METH_NOARGS},
     {NULL, NULL, 0, NULL},
 };
 
@@ -801,6 +819,22 @@
     return eps;
 }
 
+/* METH_STATIC */
+static PyObject *
+ps_surface_ps_level_to_string (PyObject *self, PyObject *args)
+{
+    int level;
+    if (!PyArg_ParseTuple(args, "i:ps_level_to_string", &level))
+	return NULL;
+    const char *s = cairo_ps_level_to_string (level);
+    if (s == NULL){
+	PyErr_SetString(CairoError, "ps_level_to_string: "
+			"invalid level argument");
+	return NULL;
+    }
+    return PyString_FromString(s);
+}
+
 static PyObject *
 ps_surface_restrict_to_level (PycairoPSSurface *o, PyObject *args)
 {
@@ -843,6 +877,9 @@
     {"dsc_begin_setup", (PyCFunction)ps_surface_dsc_begin_setup, METH_NOARGS },
     {"dsc_comment", (PyCFunction)ps_surface_dsc_comment,        METH_VARARGS },
     {"get_eps", (PyCFunction)ps_surface_get_eps,                 METH_NOARGS },
+    /* ps_get_levels - not implemented yet*/
+    {"ps_level_to_string", (PyCFunction)ps_surface_ps_level_to_string,
+                                                   METH_VARARGS | METH_STATIC},
     {"restrict_to_level", (PyCFunction)ps_surface_restrict_to_level,
                                                                 METH_VARARGS },
     {"set_eps", (PyCFunction)ps_surface_set_eps,                METH_VARARGS },

Index: pycairo-context.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-context.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- pycairo-context.c	11 Dec 2007 02:56:48 -0000	1.86
+++ pycairo-context.c	12 May 2008 12:06:37 -0000	1.87
@@ -572,6 +572,15 @@
 }
 
 static PyObject *
+pycairo_has_current_point (PycairoContext *o)
+{
+    PyObject *b = cairo_has_current_point (o->ctx) ? Py_True : Py_False;
+    RETURN_NULL_IF_CAIRO_CONTEXT_ERROR(o->ctx);
+    Py_INCREF(b);
+    return b;
+}
+
+static PyObject *
 pycairo_identity_matrix (PycairoContext *o)
 {
     cairo_identity_matrix (o->ctx);
@@ -701,6 +710,15 @@
 }
 
 static PyObject *
+pycairo_path_extents (PycairoContext *o)
+{
+    double x1, y1, x2, y2;
+    cairo_path_extents (o->ctx, &x1, &y1, &x2, &y2);
+    RETURN_NULL_IF_CAIRO_CONTEXT_ERROR(o->ctx);
+    return Py_BuildValue("(dddd)", x1, y1, x2, y2);
+}
+
+static PyObject *
 pycairo_pop_group (PycairoContext *o)
 {
     return PycairoPattern_FromPattern (cairo_pop_group (o->ctx));
@@ -1298,107 +1316,109 @@
      * - not needed since Pycairo calls Pycairo_Check_Status() to check
      *   for errors and raise exceptions
      */
-    {"append_path",     (PyCFunction)pycairo_append_path,     METH_VARARGS},
-    {"arc",             (PyCFunction)pycairo_arc,             METH_VARARGS},
-    {"arc_negative",    (PyCFunction)pycairo_arc_negative,    METH_VARARGS},
-    {"clip",            (PyCFunction)pycairo_clip,            METH_NOARGS},
-    {"clip_extents",    (PyCFunction)pycairo_clip_extents,    METH_NOARGS},
-    {"clip_preserve",   (PyCFunction)pycairo_clip_preserve,   METH_NOARGS},
-    {"close_path",      (PyCFunction)pycairo_close_path,      METH_NOARGS},
+    {"append_path",     (PyCFunction)pycairo_append_path,      METH_VARARGS},
+    {"arc",             (PyCFunction)pycairo_arc,              METH_VARARGS},
+    {"arc_negative",    (PyCFunction)pycairo_arc_negative,     METH_VARARGS},
+    {"clip",            (PyCFunction)pycairo_clip,             METH_NOARGS},
+    {"clip_extents",    (PyCFunction)pycairo_clip_extents,     METH_NOARGS},
+    {"clip_preserve",   (PyCFunction)pycairo_clip_preserve,    METH_NOARGS},
+    {"close_path",      (PyCFunction)pycairo_close_path,       METH_NOARGS},
     {"copy_clip_rectangle_list", (PyCFunction)pycairo_copy_clip_rectangle_list,
-                                                              METH_NOARGS},
-    {"copy_page",       (PyCFunction)pycairo_copy_page,       METH_NOARGS},
-    {"copy_path",       (PyCFunction)pycairo_copy_path,       METH_NOARGS},
-    {"copy_path_flat",  (PyCFunction)pycairo_copy_path_flat,  METH_NOARGS},
-    {"curve_to",        (PyCFunction)pycairo_curve_to,        METH_VARARGS},
-    {"device_to_user",  (PyCFunction)pycairo_device_to_user,  METH_VARARGS},
+                                                               METH_NOARGS},
+    {"copy_page",       (PyCFunction)pycairo_copy_page,        METH_NOARGS},
+    {"copy_path",       (PyCFunction)pycairo_copy_path,        METH_NOARGS},
+    {"copy_path_flat",  (PyCFunction)pycairo_copy_path_flat,   METH_NOARGS},
+    {"curve_to",        (PyCFunction)pycairo_curve_to,         METH_VARARGS},
+    {"device_to_user",  (PyCFunction)pycairo_device_to_user,   METH_VARARGS},
     {"device_to_user_distance",
-               (PyCFunction)pycairo_device_to_user_distance,  METH_VARARGS},
-    {"fill",            (PyCFunction)pycairo_fill,            METH_NOARGS},
-    {"fill_extents",    (PyCFunction)pycairo_fill_extents,    METH_NOARGS},
-    {"fill_preserve",   (PyCFunction)pycairo_fill_preserve,   METH_NOARGS},
-    {"font_extents",    (PyCFunction)pycairo_font_extents,    METH_NOARGS},
-    {"get_antialias",   (PyCFunction)pycairo_get_antialias,   METH_NOARGS},
+               (PyCFunction)pycairo_device_to_user_distance,   METH_VARARGS},
+    {"fill",            (PyCFunction)pycairo_fill,             METH_NOARGS},
+    {"fill_extents",    (PyCFunction)pycairo_fill_extents,     METH_NOARGS},
+    {"fill_preserve",   (PyCFunction)pycairo_fill_preserve,    METH_NOARGS},
+    {"font_extents",    (PyCFunction)pycairo_font_extents,     METH_NOARGS},
+    {"get_antialias",   (PyCFunction)pycairo_get_antialias,    METH_NOARGS},
     {"get_current_point",(PyCFunction)pycairo_get_current_point,METH_NOARGS},
-    {"get_dash",        (PyCFunction)pycairo_get_dash,        METH_NOARGS},
-    {"get_dash_count",  (PyCFunction)pycairo_get_dash_count,  METH_NOARGS},
-    {"get_fill_rule",   (PyCFunction)pycairo_get_fill_rule,   METH_NOARGS},
-    {"get_font_face",   (PyCFunction)pycairo_get_font_face,   METH_NOARGS},
-    {"get_font_matrix", (PyCFunction)pycairo_get_font_matrix, METH_NOARGS},
-    {"get_font_options",(PyCFunction)pycairo_get_font_options,METH_NOARGS},
-    {"get_group_target",(PyCFunction)pycairo_get_group_target,METH_NOARGS},
-    {"get_line_cap",    (PyCFunction)pycairo_get_line_cap,    METH_NOARGS},
-    {"get_line_join",   (PyCFunction)pycairo_get_line_join,   METH_NOARGS},
-    {"get_line_width",  (PyCFunction)pycairo_get_line_width,  METH_NOARGS},
-    {"get_matrix",      (PyCFunction)pycairo_get_matrix,      METH_NOARGS},
-    {"get_miter_limit", (PyCFunction)pycairo_get_miter_limit, METH_NOARGS},
-    {"get_operator",    (PyCFunction)pycairo_get_operator,    METH_NOARGS},
-    {"get_scaled_font", (PyCFunction)pycairo_get_scaled_font, METH_NOARGS},
-    {"get_source",      (PyCFunction)pycairo_get_source,      METH_NOARGS},
-    {"get_target",      (PyCFunction)pycairo_get_target,      METH_NOARGS},
-    {"get_tolerance",   (PyCFunction)pycairo_get_tolerance,   METH_NOARGS},
-    {"glyph_extents",   (PyCFunction)pycairo_glyph_extents,   METH_VARARGS},
-    {"glyph_path",      (PyCFunction)pycairo_glyph_path,      METH_VARARGS},
-    {"identity_matrix", (PyCFunction)pycairo_identity_matrix, METH_NOARGS},
-    {"in_fill",         (PyCFunction)pycairo_in_fill,         METH_VARARGS},
-    {"in_stroke",       (PyCFunction)pycairo_in_stroke,       METH_VARARGS},
-    {"line_to",         (PyCFunction)pycairo_line_to,         METH_VARARGS},
-    {"mask",            (PyCFunction)pycairo_mask,            METH_VARARGS},
-    {"mask_surface",    (PyCFunction)pycairo_mask_surface,    METH_VARARGS},
-    {"move_to",         (PyCFunction)pycairo_move_to,         METH_VARARGS},
-    {"new_path",        (PyCFunction)pycairo_new_path,        METH_NOARGS},
-    {"new_sub_path",    (PyCFunction)pycairo_new_sub_path,    METH_NOARGS},
-    {"paint",           (PyCFunction)pycairo_paint,           METH_NOARGS},
-    {"paint_with_alpha",(PyCFunction)pycairo_paint_with_alpha,METH_VARARGS},
-    {"pop_group",       (PyCFunction)pycairo_pop_group,       METH_NOARGS},
+    {"get_dash",        (PyCFunction)pycairo_get_dash,         METH_NOARGS},
+    {"get_dash_count",  (PyCFunction)pycairo_get_dash_count,   METH_NOARGS},
+    {"get_fill_rule",   (PyCFunction)pycairo_get_fill_rule,    METH_NOARGS},
+    {"get_font_face",   (PyCFunction)pycairo_get_font_face,    METH_NOARGS},
+    {"get_font_matrix", (PyCFunction)pycairo_get_font_matrix,  METH_NOARGS},
+    {"get_font_options",(PyCFunction)pycairo_get_font_options, METH_NOARGS},
+    {"get_group_target",(PyCFunction)pycairo_get_group_target, METH_NOARGS},
+    {"get_line_cap",    (PyCFunction)pycairo_get_line_cap,     METH_NOARGS},
+    {"get_line_join",   (PyCFunction)pycairo_get_line_join,    METH_NOARGS},
+    {"get_line_width",  (PyCFunction)pycairo_get_line_width,   METH_NOARGS},
+    {"get_matrix",      (PyCFunction)pycairo_get_matrix,       METH_NOARGS},
+    {"get_miter_limit", (PyCFunction)pycairo_get_miter_limit,  METH_NOARGS},
+    {"get_operator",    (PyCFunction)pycairo_get_operator,     METH_NOARGS},
+    {"get_scaled_font", (PyCFunction)pycairo_get_scaled_font,  METH_NOARGS},
+    {"get_source",      (PyCFunction)pycairo_get_source,       METH_NOARGS},
+    {"get_target",      (PyCFunction)pycairo_get_target,       METH_NOARGS},
+    {"get_tolerance",   (PyCFunction)pycairo_get_tolerance,    METH_NOARGS},
+    {"glyph_extents",   (PyCFunction)pycairo_glyph_extents,    METH_VARARGS},
+    {"glyph_path",      (PyCFunction)pycairo_glyph_path,       METH_VARARGS},
+    {"has_current_point",(PyCFunction)pycairo_has_current_point, METH_NOARGS},
+    {"identity_matrix", (PyCFunction)pycairo_identity_matrix,  METH_NOARGS},
+    {"in_fill",         (PyCFunction)pycairo_in_fill,          METH_VARARGS},
+    {"in_stroke",       (PyCFunction)pycairo_in_stroke,        METH_VARARGS},
+    {"line_to",         (PyCFunction)pycairo_line_to,          METH_VARARGS},
+    {"mask",            (PyCFunction)pycairo_mask,             METH_VARARGS},
+    {"mask_surface",    (PyCFunction)pycairo_mask_surface,     METH_VARARGS},
+    {"move_to",         (PyCFunction)pycairo_move_to,          METH_VARARGS},
+    {"new_path",        (PyCFunction)pycairo_new_path,         METH_NOARGS},
+    {"new_sub_path",    (PyCFunction)pycairo_new_sub_path,     METH_NOARGS},
+    {"paint",           (PyCFunction)pycairo_paint,            METH_NOARGS},
+    {"paint_with_alpha",(PyCFunction)pycairo_paint_with_alpha, METH_VARARGS},
+    {"path_extents",    (PyCFunction)pycairo_path_extents,     METH_NOARGS},
+    {"pop_group",       (PyCFunction)pycairo_pop_group,        METH_NOARGS},
     {"pop_group_to_source",
-                    (PyCFunction)pycairo_pop_group_to_source, METH_NOARGS},
-    {"push_group",      (PyCFunction)pycairo_push_group,      METH_NOARGS},
+                    (PyCFunction)pycairo_pop_group_to_source,  METH_NOARGS},
+    {"push_group",      (PyCFunction)pycairo_push_group,       METH_NOARGS},
     {"push_group_with_content",
-                (PyCFunction)pycairo_push_group_with_content, METH_VARARGS},
-    {"rectangle",       (PyCFunction)pycairo_rectangle,       METH_VARARGS},
-    {"rel_curve_to",    (PyCFunction)pycairo_rel_curve_to,    METH_VARARGS},
-    {"rel_line_to",     (PyCFunction)pycairo_rel_line_to,     METH_VARARGS},
-    {"rel_move_to",     (PyCFunction)pycairo_rel_move_to,     METH_VARARGS},
-    {"reset_clip",      (PyCFunction)pycairo_reset_clip,      METH_NOARGS},
-    {"restore",         (PyCFunction)pycairo_restore,         METH_NOARGS},
-    {"rotate",          (PyCFunction)pycairo_rotate,          METH_VARARGS},
-    {"save",            (PyCFunction)pycairo_save,            METH_NOARGS},
-    {"scale",           (PyCFunction)pycairo_scale,           METH_VARARGS},
-    {"select_font_face",(PyCFunction)pycairo_select_font_face,METH_VARARGS},
-    {"set_antialias",   (PyCFunction)pycairo_set_antialias,   METH_VARARGS},
-    {"set_dash",        (PyCFunction)pycairo_set_dash,        METH_VARARGS},
-    {"set_fill_rule",   (PyCFunction)pycairo_set_fill_rule,   METH_VARARGS},
-    {"set_font_face",   (PyCFunction)pycairo_set_font_face,   METH_O},
-    {"set_font_matrix", (PyCFunction)pycairo_set_font_matrix, METH_VARARGS},
-    {"set_font_options",(PyCFunction)pycairo_set_font_options,METH_VARARGS},
-    {"set_font_size",   (PyCFunction)pycairo_set_font_size,   METH_VARARGS},
-    {"set_line_cap",    (PyCFunction)pycairo_set_line_cap,    METH_VARARGS},
-    {"set_line_join",   (PyCFunction)pycairo_set_line_join,   METH_VARARGS},
-    {"set_line_width",  (PyCFunction)pycairo_set_line_width,  METH_VARARGS},
-    {"set_matrix",      (PyCFunction)pycairo_set_matrix,      METH_VARARGS},
-    {"set_miter_limit", (PyCFunction)pycairo_set_miter_limit, METH_VARARGS},
-    {"set_operator",    (PyCFunction)pycairo_set_operator,    METH_VARARGS},
-    /* set_scaled_font */
-    {"set_source",      (PyCFunction)pycairo_set_source,      METH_VARARGS},
-    {"set_source_rgb",  (PyCFunction)pycairo_set_source_rgb,  METH_VARARGS},
-    {"set_source_rgba", (PyCFunction)pycairo_set_source_rgba, METH_VARARGS},
+                (PyCFunction)pycairo_push_group_with_content,  METH_VARARGS},
+    {"rectangle",       (PyCFunction)pycairo_rectangle,        METH_VARARGS},
+    {"rel_curve_to",    (PyCFunction)pycairo_rel_curve_to,     METH_VARARGS},
+    {"rel_line_to",     (PyCFunction)pycairo_rel_line_to,      METH_VARARGS},
+    {"rel_move_to",     (PyCFunction)pycairo_rel_move_to,      METH_VARARGS},
+    {"reset_clip",      (PyCFunction)pycairo_reset_clip,       METH_NOARGS},
+    {"restore",         (PyCFunction)pycairo_restore,          METH_NOARGS},
+    {"rotate",          (PyCFunction)pycairo_rotate,           METH_VARARGS},
+    {"save",            (PyCFunction)pycairo_save,             METH_NOARGS},
+    {"scale",           (PyCFunction)pycairo_scale,            METH_VARARGS},
+    {"select_font_face",(PyCFunction)pycairo_select_font_face, METH_VARARGS},
+    {"set_antialias",   (PyCFunction)pycairo_set_antialias,    METH_VARARGS},
+    {"set_dash",        (PyCFunction)pycairo_set_dash,         METH_VARARGS},
+    {"set_fill_rule",   (PyCFunction)pycairo_set_fill_rule,    METH_VARARGS},
+    {"set_font_face",   (PyCFunction)pycairo_set_font_face,    METH_O},
+    {"set_font_matrix", (PyCFunction)pycairo_set_font_matrix,  METH_VARARGS},
+    {"set_font_options",(PyCFunction)pycairo_set_font_options, METH_VARARGS},
+    {"set_font_size",   (PyCFunction)pycairo_set_font_size,    METH_VARARGS},
+    {"set_line_cap",    (PyCFunction)pycairo_set_line_cap,     METH_VARARGS},
+    {"set_line_join",   (PyCFunction)pycairo_set_line_join,    METH_VARARGS},
+    {"set_line_width",  (PyCFunction)pycairo_set_line_width,   METH_VARARGS},
+    {"set_matrix",      (PyCFunction)pycairo_set_matrix,       METH_VARARGS},
+    {"set_miter_limit", (PyCFunction)pycairo_set_miter_limit,  METH_VARARGS},
+    {"set_operator",    (PyCFunction)pycairo_set_operator,     METH_VARARGS},
+    /* set_scaled_font - not implemented yet */
+    {"set_source",      (PyCFunction)pycairo_set_source,       METH_VARARGS},
+    {"set_source_rgb",  (PyCFunction)pycairo_set_source_rgb,   METH_VARARGS},
+    {"set_source_rgba", (PyCFunction)pycairo_set_source_rgba,  METH_VARARGS},
     {"set_source_surface",(PyCFunction)pycairo_set_source_surface,
-                                                              METH_VARARGS},
-    {"set_tolerance",   (PyCFunction)pycairo_set_tolerance,   METH_VARARGS},
-    {"show_glyphs",     (PyCFunction)pycairo_show_glyphs,     METH_VARARGS},
-    {"show_page",       (PyCFunction)pycairo_show_page,       METH_NOARGS},
-    {"show_text",       (PyCFunction)pycairo_show_text,       METH_O},
-    {"stroke",          (PyCFunction)pycairo_stroke,          METH_NOARGS},
-    {"stroke_extents",  (PyCFunction)pycairo_stroke_extents,  METH_NOARGS},
-    {"stroke_preserve", (PyCFunction)pycairo_stroke_preserve, METH_NOARGS},
-    {"text_extents",    (PyCFunction)pycairo_text_extents,    METH_O},
-    {"text_path",       (PyCFunction)pycairo_text_path,       METH_O},
-    {"transform",       (PyCFunction)pycairo_transform,       METH_VARARGS},
-    {"translate",       (PyCFunction)pycairo_translate,       METH_VARARGS},
-    {"user_to_device",  (PyCFunction)pycairo_user_to_device,  METH_VARARGS},
+                                                               METH_VARARGS},
+    {"set_tolerance",   (PyCFunction)pycairo_set_tolerance,    METH_VARARGS},
+    {"show_glyphs",     (PyCFunction)pycairo_show_glyphs,      METH_VARARGS},
+    {"show_page",       (PyCFunction)pycairo_show_page,        METH_NOARGS},
+    {"show_text",       (PyCFunction)pycairo_show_text,        METH_O},
+    {"stroke",          (PyCFunction)pycairo_stroke,           METH_NOARGS},
+    {"stroke_extents",  (PyCFunction)pycairo_stroke_extents,   METH_NOARGS},
+    {"stroke_preserve", (PyCFunction)pycairo_stroke_preserve,  METH_NOARGS},
+    {"text_extents",    (PyCFunction)pycairo_text_extents,     METH_O},
+    {"text_path",       (PyCFunction)pycairo_text_path,        METH_O},
+    {"transform",       (PyCFunction)pycairo_transform,        METH_VARARGS},
+    {"translate",       (PyCFunction)pycairo_translate,        METH_VARARGS},
+    {"user_to_device",  (PyCFunction)pycairo_user_to_device,   METH_VARARGS},
     {"user_to_device_distance",(PyCFunction)pycairo_user_to_device_distance,
-                                                              METH_VARARGS},
+                                                               METH_VARARGS},
     {NULL, NULL, 0, NULL},
 };
 

Index: pycairo-private.h
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-private.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- pycairo-private.h	12 Dec 2007 12:14:19 -0000	1.44
+++ pycairo-private.h	12 May 2008 12:06:37 -0000	1.45
@@ -103,20 +103,6 @@
 
 int Pycairo_Check_Status (cairo_status_t status);
 
-/* Python 2.5 compatibility */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-typedef inquiry lenfunc;
-typedef intargfunc ssizeargfunc;
-typedef intobjargproc ssizeobjargproc;
-typedef getreadbufferproc readbufferproc;
-typedef getwritebufferproc writebufferproc;
-typedef getsegcountproc segcountproc;
-typedef getcharbufferproc charbufferproc;
-#endif
-
 /* error checking macros */
 #define RETURN_NULL_IF_CAIRO_ERROR(status)    \
     do {                                      \



More information about the cairo-commit mailing list