[cairo-commit] pycairo/cairo pycairo-font.c, 1.38, 1.39 pycairo-matrix.c, 1.27, 1.28 pycairo-surface.c, 1.91, 1.92

Steve Chaplin commit at pdx.freedesktop.org
Tue Dec 9 22:51:32 PST 2008


Committed by: stevech1097

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

Modified Files:
	pycairo-font.c pycairo-matrix.c pycairo-surface.c 
Log Message:
'SC'

Index: pycairo-font.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-font.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- pycairo-font.c	24 Nov 2008 15:39:38 -0000	1.38
+++ pycairo-font.c	10 Dec 2008 06:51:30 -0000	1.39
@@ -87,11 +87,10 @@
 static PyMethodDef font_face_methods[] = {
      * methods never exposed in a language binding:
      * cairo_font_face_destroy()
-     * cairo_font_face_get_type()
      * cairo_font_face_get_user_data()
+     * cairo_font_face_get_type()
      * cairo_font_face_reference()
      * cairo_font_face_set_user_data(),
-     *
     {NULL, NULL, 0, NULL},
 };
 */
@@ -255,6 +254,7 @@
      * cairo_scaled_font_get_font_matrix
      * cairo_scaled_font_get_font_options
      * cairo_scaled_font_glyph_extents
+     * cairo_scaled_font_text_to_glyphs
      */
     {"extents",       (PyCFunction)scaled_font_extents,        METH_NOARGS},
     {"get_font_face", (PyCFunction)scaled_font_get_font_face,  METH_NOARGS},
@@ -442,6 +442,7 @@
      */
     /* TODO: */
     /* copy */
+    /* hash */
     /* merge */
     /* equal (richcmp?) */
     {"get_antialias",     (PyCFunction)font_options_get_antialias,

Index: pycairo-matrix.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-matrix.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- pycairo-matrix.c	20 Nov 2007 09:16:10 -0000	1.27
+++ pycairo-matrix.c	10 Dec 2008 06:51:30 -0000	1.28
@@ -2,7 +2,7 @@
  *
  * Pycairo - Python bindings for cairo
  *
- * Copyright © 2003-2005 James Henstridge
+ * Copyright © 2003 James Henstridge, Steven Chaplin
  *
  * This library is free software; you can redistribute it and/or
  * modify it either under the terms of the GNU Lesser General Public
@@ -170,18 +170,6 @@
 }
 
 static PyObject *
-matrix_translate (PycairoMatrix *o, PyObject *args)
-{
-    double tx, ty;
-
-    if (!PyArg_ParseTuple(args, "dd:Matrix.translate", &tx, &ty))
-	return NULL;
-
-    cairo_matrix_translate (&o->matrix, tx, ty);
-    Py_RETURN_NONE;
-}
-
-static PyObject *
 matrix_transform_distance (PycairoMatrix *o, PyObject *args)
 {
     double dx, dy;
@@ -206,6 +194,18 @@
 }
 
 static PyObject *
+matrix_translate (PycairoMatrix *o, PyObject *args)
+{
+    double tx, ty;
+
+    if (!PyArg_ParseTuple(args, "dd:Matrix.translate", &tx, &ty))
+	return NULL;
+
+    cairo_matrix_translate (&o->matrix, tx, ty);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
 matrix_item (PycairoMatrix *o, Py_ssize_t i)
 {
     switch (i) {
@@ -284,10 +284,11 @@
     /* Do not need to wrap all cairo_matrix_init_*() functions
      * C API Matrix constructors       Python equivalents
      * cairo_matrix_init()             cairo.Matrix(xx,yx,xy,yy,x0,y0)
+     * cairo_matrix_init_rotate()      cairo.Matrix.init_rotate(radians)
+
      * cairo_matrix_init_identity()    cairo.Matrix()
      * cairo_matrix_init_translate()   cairo.Matrix(x0=x0,y0=y0)
      * cairo_matrix_init_scale()       cairo.Matrix(xx=xx,yy=yy)
-     * cairo_matrix_init_rotate()      cairo.Matrix.init_rotate(radians)
      */
     {"init_rotate", (PyCFunction)matrix_init_rotate,
                                                    METH_VARARGS | METH_CLASS },

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- pycairo-surface.c	24 Nov 2008 15:39:38 -0000	1.91
+++ pycairo-surface.c	10 Dec 2008 06:51:30 -0000	1.92
@@ -213,6 +213,14 @@
 }
 
 static PyObject *
+surface_get_fallback_resolution (PycairoSurface *o)
+{
+    double x_ppi, y_ppi;
+    cairo_surface_get_fallback_resolution (o->surface, &x_ppi, &y_ppi);
+    return Py_BuildValue("(dd)", x_ppi, y_ppi);
+}
+
+static PyObject *
 surface_get_font_options (PycairoSurface *o)
 {
     cairo_font_options_t *options = cairo_font_options_create();
@@ -223,14 +231,20 @@
 }
 
 static PyObject *
-surface_mark_dirty (PycairoSurface *o, PyObject *args, PyObject *kwds)
+surface_mark_dirty (PycairoSurface *o)
 {
-    static char *kwlist[] = {"x", "y", "width", "height", NULL};
-    int x = 0, y = 0, width = -1, height = -1;
+    cairo_surface_mark_dirty (o->surface);
+    RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+    Py_RETURN_NONE;
+}
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwds,
-				     "|iiii:Surface.mark_dirty", kwlist,
-				     &x, &y, &width, &height))
+static PyObject *
+surface_mark_dirty_rectangle (PycairoSurface *o, PyObject *args)
+{
+    int x, y, width, height;
+
+    if (!PyArg_ParseTuple(args, "iiii:Surface.mark_dirty_rectangle",
+			  &x, &y, &width, &height))
 	return NULL;
 
     cairo_surface_mark_dirty_rectangle (o->surface, x, y, width, height);
@@ -322,8 +336,12 @@
     {"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_fallback_resolution",(PyCFunction)surface_get_fallback_resolution,
+                                                                METH_NOARGS},
     {"get_font_options",(PyCFunction)surface_get_font_options,  METH_NOARGS},
-    {"mark_dirty",     (PyCFunction)surface_mark_dirty,         METH_KEYWORDS},
+    {"mark_dirty",     (PyCFunction)surface_mark_dirty,         METH_NOARGS},
+    {"mark_dirty_rectangle", (PyCFunction)surface_mark_dirty_rectangle,
+                                                                METH_VARARGS},
     {"set_device_offset",(PyCFunction)surface_set_device_offset,METH_VARARGS},
     {"set_fallback_resolution",(PyCFunction)surface_set_fallback_resolution,
                                                                 METH_VARARGS},
@@ -968,7 +986,7 @@
 {
     double width_in_points, height_in_points;
     PyObject *file, *writer;
-    cairo_surface_t *sfc; 
+    cairo_surface_t *sfc;
 
     if (!PyArg_ParseTuple(args, "Odd:SVGSurface.__new__",
 			  &file, &width_in_points, &height_in_points))



More information about the cairo-commit mailing list