[cairo-commit] pycairo/cairo cairomodule.c, 1.21, 1.22 pycairo.h, 1.19, 1.20 pycairo-private.h, 1.14, 1.15 pycairo-context.c, 1.33, 1.34 pycairo-surface.c, 1.22, 1.23

Steve Chaplin commit at pdx.freedesktop.org
Wed Apr 13 18:43:50 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory gabe:/tmp/cvs-serv3868/cairo

Modified Files:
	cairomodule.c pycairo.h pycairo-private.h pycairo-context.c 
	pycairo-surface.c 
Log Message:
SC 2005/04/14

Index: cairomodule.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/cairomodule.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cairomodule.c	13 Apr 2005 14:14:18 -0000	1.21
+++ cairomodule.c	14 Apr 2005 01:43:48 -0000	1.22
@@ -184,11 +184,11 @@
 
 static struct _PyCairo_FunctionStruct api = {
     pycairo_check_status,
+    &PyCairoContext_Type,  PyCairoContext_FromContext,
+    &PyCairoFont_Type,     pycairo_font_wrap,
     &PyCairoMatrix_Type,   PyCairoMatrix_FromMatrix,
     &PyCairoPattern_Type,  PyCairoPattern_FromPattern,
     &PyCairoSurface_Type,  PyCairoSurface_FromSurface,
-    &PyCairoFont_Type,     pycairo_font_wrap,
-    &PyCairoContext_Type,  pycairo_context_wrap,
 };
 
 DL_EXPORT(void)

Index: pycairo.h
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- pycairo.h	13 Apr 2005 14:14:18 -0000	1.19
+++ pycairo.h	14 Apr 2005 01:43:48 -0000	1.20
@@ -68,16 +68,16 @@
 
 struct _PyCairo_FunctionStruct {
     int (* check_status)(cairo_status_t status);
+    PyTypeObject *context_type;
+    PyObject *(* context_wrap)(cairo_t *ctx);
+    PyTypeObject *font_type;
+    PyObject *(* font_wrap)(cairo_font_face_t *font);
     PyTypeObject *matrix_type;
     PyObject *(* matrix_wrap)(cairo_matrix_t *matrix);
     PyTypeObject *pattern_type;
     PyObject *(* pattern_wrap)(cairo_pattern_t *pattern);
     PyTypeObject *surface_type;
     PyObject *(* surface_wrap)(cairo_surface_t *surface, PyObject *base);
-    PyTypeObject *font_type;
-    PyObject *(* font_wrap)(cairo_font_face_t *font);
-    PyTypeObject *context_type;
-    PyObject *(* context_wrap)(cairo_t *ctx);
 };
 
 #ifndef _INSIDE_PYCAIRO_
@@ -89,6 +89,8 @@
 #endif
 
 #define pycairo_check_status       (_PyCairo_API->check_status)
+#define PyCairoContext_Type       *(_PyCairo_API->context_type)
+#define PyCairoContext_FromContext (_PyCairo_API->context_wrap)
 #define PyCairoMatrix_Type        *(_PyCairo_API->matrix_type)
 #define PyCairoMatrix_FromMatrix   (_PyCairo_API->matrix_wrap)
 #define PyCairoPattern_Type       *(_PyCairo_API->pattern_type)
@@ -97,8 +99,6 @@
 #define PyCairoSurface_FromSurface (_PyCairo_API->surface_wrap)
 #define PyCairoFont_Type          *(_PyCairo_API->font_type)
 #define pycairo_font_wrap          (_PyCairo_API->font_wrap)
-#define PyCairoContext_Type       *(_PyCairo_API->context_type)
-#define pycairo_context_wrap       (_PyCairo_API->context_wrap)
 
 #define init_pycairo() { \
     PyObject *pycairo = PyImport_ImportModule("cairo._cairo"); \

Index: pycairo-private.h
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-private.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- pycairo-private.h	13 Apr 2005 14:14:18 -0000	1.14
+++ pycairo-private.h	14 Apr 2005 01:43:48 -0000	1.15
@@ -51,7 +51,7 @@
 int       pycairo_check_status(cairo_status_t status);
 
 /* takes ownership of reference */
-PyObject *pycairo_context_wrap(cairo_t *ctx);
+PyObject *PyCairoContext_FromContext(cairo_t *ctx);
 PyObject *pycairo_font_wrap(cairo_font_face_t *font);
 PyObject *PyCairoMatrix_FromMatrix(const cairo_matrix_t *matrix);
 PyObject *PyCairoPattern_FromPattern(cairo_pattern_t *pattern);

Index: pycairo-context.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-context.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- pycairo-context.c	13 Apr 2005 14:14:18 -0000	1.33
+++ pycairo-context.c	14 Apr 2005 01:43:48 -0000	1.34
@@ -38,63 +38,61 @@
 #include "pycairo-private.h"
 #include "pycairo-misc.h"
 
+/* PyCairoContext_FromContext
+ * Create a new PyCairoContext from a cairo_t
+ * Return value: New reference (NULL on failure)
+ */
 PyObject *
-pycairo_context_wrap(cairo_t *ctx)
+PyCairoContext_FromContext(cairo_t *ctx)
 {
[...1256 lines suppressed...]
     0,                                  /* tp_members */
     pycairo_getsets,                    /* tp_getset */
-    (PyTypeObject *)0,                  /* tp_base */
-    (PyObject *)0,                      /* tp_dict */
+    &PyBaseObject_Type,                 /* tp_base */
+    0,                                  /* tp_dict */
     0,                                  /* tp_descr_get */
     0,                                  /* tp_descr_set */
     0,                                  /* tp_dictoffset */
-    (initproc)0,                        /* tp_init */
-    (allocfunc)0,                       /* tp_alloc */
+    (initproc)pycairo_init,             /* tp_init */
+    0,                                  /* tp_alloc */
     (newfunc)pycairo_new,               /* tp_new */
     0,                                  /* tp_free */
-    (inquiry)0,                         /* tp_is_gc */
-    (PyObject *)0,                      /* tp_bases */
+    0,                                  /* tp_is_gc */
+    0,                                  /* tp_bases */
 };

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- pycairo-surface.c	13 Apr 2005 10:20:04 -0000	1.22
+++ pycairo-surface.c	14 Apr 2005 01:43:48 -0000	1.23
@@ -56,7 +56,7 @@
 	s->base = base;
 	Py_XINCREF(base);
     }
-    return (PyObject *)s;
+    return (PyObject *) s;
 }
 
 static void
@@ -69,7 +69,6 @@
 	cairo_surface_destroy(s->surface);
 	s->surface = NULL;
     }
-
     Py_CLEAR(s->base);
 
     s->ob_type->tp_free((PyObject *)s);
@@ -226,9 +225,6 @@
     if (pycairo_check_status(status))
 	return NULL;
     Py_RETURN_NONE;
-    /* Segmentation fault when call surface.finish() twice
-     * https://bugs.freedesktop.org  bug #2950 Apr 10 2005
-    */
 }
 
 static PyObject *




More information about the cairo-commit mailing list