Hello community,
here is the log from the commit of package python-cairo
checked in at Sat Sep 13 12:04:21 CEST 2008.
--------
--- python-cairo/python-cairo.changes 2008-07-18 15:47:46.000000000 +0200
+++ /mounts/work_src_done/STABLE/python-cairo/python-cairo.changes 2008-09-12 15:56:40.000000000 +0200
@@ -1,0 +2,13 @@
+Fri Sep 12 08:55:06 CDT 2008 - maw@suse.de
+
+- Update to version 1.6.4:
+ + Bugs fixed: bfo#16112
+ + New methods: Context.has_current_point, Context.path_extents,
+ ImageSurface.format_stride_for_width, PSSurface.get_eps,
+ PSSurface.set_eps, PSSurface.ps_level_to_string,
+ PSSurface.restrict_to_level, Surface.copy_page, and
+ Surface.show_page
+ + New Constants: cairo.PS_LEVEL_2, cairo.PS_LEVEL_3
+ + Updated examples.
+
+-------------------------------------------------------------------
Old:
----
pycairo-1.4.12.tar.bz2
New:
----
pycairo-1.6.4.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-cairo.spec ++++++
--- /var/tmp/diff_new_pack.J17134/_old 2008-09-13 12:04:13.000000000 +0200
+++ /var/tmp/diff_new_pack.J17134/_new 2008-09-13 12:04:13.000000000 +0200
@@ -1,10 +1,17 @@
#
-# spec file for package python-cairo (Version 1.4.12)
+# spec file for package python-cairo (Version 1.6.4)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@@ -17,8 +24,8 @@
License: LGPL v2.1 or later; MOZILLA PUBLIC LICENSE (MPL/NPL)
Group: Development/Libraries/Python
Summary: Python Bindings for Cairo
-Version: 1.4.12
-Release: 26
+Version: 1.6.4
+Release: 1
Url: http://www.cairographics.org/
Source: pycairo-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -80,6 +87,16 @@
%{_libdir}/pkgconfig/pycairo.pc
%changelog
+* Fri Sep 12 2008 maw@suse.de
+- Update to version 1.6.4:
+ + Bugs fixed: bfo#16112
+ + New methods: Context.has_current_point, Context.path_extents,
+ ImageSurface.format_stride_for_width, PSSurface.get_eps,
+ PSSurface.set_eps, PSSurface.ps_level_to_string,
+ PSSurface.restrict_to_level, Surface.copy_page, and
+ Surface.show_page
+ + New Constants: cairo.PS_LEVEL_2, cairo.PS_LEVEL_3
+ + Updated examples.
* Fri Jul 18 2008 jpr@suse.de
- Remove libsvg-cairo-devel from BuildRequires, it hasn't been
needed for a long time
++++++ pycairo-1.4.12.tar.bz2 -> pycairo-1.6.4.tar.bz2 ++++++
++++ 5549 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/cairo/cairomodule.c new/pycairo-1.6.4/cairo/cairomodule.c
--- old/pycairo-1.4.12/cairo/cairomodule.c 2007-12-13 06:48:08.000000000 +0100
+++ new/pycairo-1.6.4/cairo/cairomodule.c 2008-07-17 06:03:52.000000000 +0200
@@ -36,10 +36,15 @@
#endif
#include "pycairo-private.h"
+#ifdef CAIRO_HAS_PS_SURFACE
+# include
+#endif
+
+
#define VERSION_MAJOR 1
-#define VERSION_MINOR 4
-#define VERSION_MICRO 12
-static char pycairo_version_string[] = "1.4.12";
+#define VERSION_MINOR 6
+#define VERSION_MICRO 4
+static char pycairo_version_string[] = "1.6.4";
/* A module specific exception */
@@ -451,6 +456,11 @@
CONSTANT(PATH_CURVE_TO);
CONSTANT(PATH_CLOSE_PATH);
+#ifdef CAIRO_HAS_PS_SURFACE
+ CONSTANT(PS_LEVEL_2);
+ CONSTANT(PS_LEVEL_3);
+#endif
+
CONSTANT(SUBPIXEL_ORDER_DEFAULT);
CONSTANT(SUBPIXEL_ORDER_RGB);
CONSTANT(SUBPIXEL_ORDER_BGR);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/cairo/pycairo-context.c new/pycairo-1.6.4/cairo/pycairo-context.c
--- old/pycairo-1.4.12/cairo/pycairo-context.c 2007-12-11 03:46:22.000000000 +0100
+++ new/pycairo-1.6.4/cairo/pycairo-context.c 2008-05-12 13:59:58.000000000 +0200
@@ -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},
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/cairo/pycairo-private.h new/pycairo-1.6.4/cairo/pycairo-private.h
--- old/pycairo-1.4.12/cairo/pycairo-private.h 2007-12-12 10:32:48.000000000 +0100
+++ new/pycairo-1.6.4/cairo/pycairo-private.h 2008-05-09 04:27:07.000000000 +0200
@@ -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 { \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/cairo/pycairo-surface.c new/pycairo-1.6.4/cairo/pycairo-surface.c
--- old/pycairo-1.4.12/cairo/pycairo-surface.c 2007-12-11 03:49:03.000000000 +0100
+++ new/pycairo-1.6.4/cairo/pycairo-surface.c 2008-05-12 13:58:55.000000000 +0200
@@ -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},
};
@@ -793,6 +811,55 @@
}
static PyObject *
+ps_surface_get_eps (PycairoPSSurface *o)
+{
+ PyObject *eps = cairo_ps_surface_get_eps (o->surface) ? Py_True : Py_False;
+ RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+ Py_INCREF(eps);
+ 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)
+{
+ int level;
+
+ if (!PyArg_ParseTuple(args, "i:PSSurface.restrict_to_level", &level))
+ return NULL;
+ cairo_ps_surface_restrict_to_level (o->surface, level);
+ RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+ps_surface_set_eps (PycairoPSSurface *o, PyObject *args)
+{
+ PyObject *py_eps;
+ if (!PyArg_ParseTuple(args, "O!:PSSurface.set_eps",
+ &PyBool_Type, &py_eps))
+ return NULL;
+ cairo_ps_surface_set_eps (o->surface, (py_eps == Py_True));
+ RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
ps_surface_set_size (PycairoPSSurface *o, PyObject *args)
{
double width_in_points, height_in_points;
@@ -809,6 +876,13 @@
(PyCFunction)ps_surface_dsc_begin_page_setup, METH_NOARGS },
{"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 },
{"set_size", (PyCFunction)ps_surface_set_size, METH_VARARGS },
{NULL, NULL, 0, NULL},
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/ChangeLog new/pycairo-1.6.4/ChangeLog
--- old/pycairo-1.4.12/ChangeLog 2007-12-13 07:14:37.000000000 +0100
+++ new/pycairo-1.6.4/ChangeLog 2008-07-17 06:12:19.000000000 +0200
@@ -1,3 +1,69 @@
+=== Pycairo 1.6.4 ===
+2008-07-17 Steven Chaplin
+
+ * NEWS: update for 1.6.4 release
+
+ * setup.py :
+ * cairo/cairomodule.c:
+ * configure.ac:
+ update pycairo version to 1.6.4
+
+2008-07-17 Steven Chaplin
+
+ * examples/cairo_snippets/snippets/ellipse.py (path_ellipse): Update
+ so line-width is a constant width in device-space not user-space
+
+ * doc/FAQ : Add new FAQs
+
+ * test/Makefile.am (EXTRA_DIST)
+ * test/pygame-test1.py, test/pygame-test2.py : Add new tests
+
+2008-07-17 Steven Chaplin
+
+ * setup.py (pkg_config_version_check): apply patch (modified) from
+ Kirill Smelkov to fix #16112.
+
+2008-05-12 Steven Chaplin
+
+ * test/isurface_create_for_data1.py:
+ * test/isurface_create_for_data2.py:
+ update tests
+
+ * cairo/pycairo-surface.c (pycairo_format_stride_for_width)
+ (ps_surface_ps_level_to_string):
+ Add ImageSurface.format_stride_for_width and
+ PSSurface.ps_level_to_string static methods.
+ (image_surface_create_for_data): Use the new function
+ cairo_format_stride_for_width() to calculate the stride.
+
+ * cairo/pycairo-context.c (pycairo_has_current_point)
+ (pycairo_path_extents):
+ * cairo/pycairo-surface.c (surface_copy_page, surface_show_page):
+ Add new bindings
+
+ * configure.ac:
+ * README :
+ * setup.py :
+ Require cairo 1.6.4 and Python 2.5
+
+ * cairo/pycairo-private.h: remove code used for Python < 2.5
+
+2008-05-08 Steven Chaplin
+
+ * cairo/cairomodule.c: add new constants cairo.PS_LEVEL_2 and
+ cairo.PS_LEVEL_3
+ * cairo/pycairo-surface.c (ps_surface_get_eps, ps_surface_set_eps)
+ (ps_surface_restrict_to_level):
+ Add some new cairo 1.6.4 API - apply patch (with some changes)
+ from Tom Hughes to fix #15618.
+
+2007-12-13 Steven Chaplin
+
+ * setup.py (pycairo_version):
+ * cairo/cairomodule.c:
+ * configure.ac:
+ Increment pycairo version to 1.4.13
+
=== Pycairo 1.4.12 ===
2007-12-13 Steven Chaplin
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/configure.ac new/pycairo-1.6.4/configure.ac
--- old/pycairo-1.4.12/configure.ac 2007-12-13 06:47:11.000000000 +0100
+++ new/pycairo-1.6.4/configure.ac 2008-07-17 06:01:43.000000000 +0200
@@ -3,12 +3,12 @@
# the pycairo version number
m4_define(pycairo_version_major, 1)
-m4_define(pycairo_version_minor, 4)
-m4_define(pycairo_version_micro, 12)
+m4_define(pycairo_version_minor, 6)
+m4_define(pycairo_version_micro, 4)
m4_define(pycairo_version, pycairo_version_major.pycairo_version_minor.pycairo_version_micro)
# versions of packages we require
-m4_define(cairo_required_version, 1.4.12)
+m4_define(cairo_required_version, 1.6.4)
AC_INIT([pycairo],
[pycairo_version],
@@ -34,7 +34,7 @@
AC_DISABLE_STATIC
AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE - used by autogen.sh
-AM_PATH_PYTHON(2.4)
+AM_PATH_PYTHON(2.5)
# Checks for libraries ---
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/doc/FAQ new/pycairo-1.6.4/doc/FAQ
--- old/pycairo-1.4.12/doc/FAQ 2007-12-12 12:37:28.000000000 +0100
+++ new/pycairo-1.6.4/doc/FAQ 2008-07-17 05:37:22.000000000 +0200
@@ -1,12 +1,11 @@
Pycairo FAQ - Frequently Asked Questions
----------------------------------------
-Q Can I subclass pycairo classes?
-A
-Cairo, the C library, is not an object oriented library, so a Python binding
-can never be a truly object oriented interface to cairo. One way to write the
-Python bindings for cairo would be as a single long list of module functions -
-this would be the most accurate representation of the underlying C
+Q: Can I subclass pycairo classes?
+A: Cairo, the C library, is not an object oriented library, so a Python
+binding can never be a truly object oriented interface to cairo. One way to
+write the Python bindings for cairo would be as a single long list of module
+functions - this would be the most accurate representation of the underlying C
library. Pycairo (and most other cairo language bindings?) instead chose to
implement the bindings using Context, Surface, Pattern, etc classes. An
advantage is that the classes organise cairo into groups of similar functions.
@@ -21,3 +20,23 @@
cairo.Context can be subclassed.
All other pycairo subclasses cannot be subclassed.
+
+
+Q: Where is the pycairo documentation?
+A: The documentation has not been written or generated yet. The Python cairo
+bindings follow the underlying C API quite closely, so the C documentation can
+be used. It would be quite a long and tedious task to write Pycairo
+documentation from scratch; and it would essentially involve duplicating most
+of the C documentation. Another approach would be to take the existing C
+documentation and generate Python documentation from it, and just edit bits to
+make it Python-specific. If anyone knows a good way to do this then any
+contributions would be welcome ...
+
+
+Q: How do I use pycairo with numpy?
+A: See test/isurface_create_for_data2.py
+
+
+Q: How do I use pycairo with pygame?
+A: See test/pygame-test1.py
+ test/pygame-test2.py
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/examples/cairo_snippets/snippets/ellipse.py new/pycairo-1.6.4/examples/cairo_snippets/snippets/ellipse.py
--- old/pycairo-1.4.12/examples/cairo_snippets/snippets/ellipse.py 2006-04-29 04:29:24.000000000 +0200
+++ new/pycairo-1.6.4/examples/cairo_snippets/snippets/ellipse.py 2008-07-17 05:30:51.000000000 +0200
@@ -1,6 +1,6 @@
-snippet_normalize (cr, width, height)
+snippet_normalize(cr, width, height)
-def path_ellipse (cr, x, y, width, height, angle=0):
+def path_ellipse(cr, x, y, width, height, angle=0):
"""
x - center x
y - center y
@@ -9,29 +9,25 @@
angle - angle in radians to rotate, clockwise
"""
cr.save()
- cr.translate (x, y)
- cr.rotate (angle)
- cr.scale (width / 2.0, height / 2.0)
- cr.arc (0.0, 0.0, 1.0, 0.0, 2.0 * M_PI)
+ cr.translate(x, y)
+ cr.rotate(angle)
+ cr.scale(width / 2.0, height / 2.0)
+ cr.arc(0.0, 0.0, 1.0, 0.0, 2.0 * M_PI)
cr.restore()
-def fill_and_stroke (cr, fill_c, stroke_c, stroke_linewidth):
- assert fill_c is not None or stroke_c is not None
- cr.save()
-
- if fill_c is not None:
- cr.set_source_rgba(*fill_c)
- if stroke_c is not None:
- cr.fill_preserve()
- else:
- cr.fill()
- if stroke_c is not None:
- cr.set_source_rgba(*stroke_c)
- cr.set_line_width(stroke_linewidth)
- cr.stroke()
-
- cr.restore()
+path_ellipse(cr, 0.5, 0.5, 1.0, 0.3, M_PI/4.0)
-path_ellipse (cr, 0.5, 0.5, 1.0, 0.3, M_PI/4.0)
-fill_and_stroke (cr, (1,0,0,1), (0,0,0,1), 0.02)
+# fill
+cr.set_source_rgba(1,0,0,1)
+cr.fill_preserve()
+
+# stroke
+# reset identity matrix so line_width is a constant
+# width in device-space, not user-space
+cr.save()
+cr.identity_matrix()
+cr.set_source_rgba(0,0,0,1)
+cr.set_line_width(3)
+cr.stroke()
+cr.restore()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/NEWS new/pycairo-1.6.4/NEWS
--- old/pycairo-1.4.12/NEWS 2007-12-13 06:45:58.000000000 +0100
+++ new/pycairo-1.6.4/NEWS 2008-07-17 06:00:36.000000000 +0200
@@ -1,3 +1,33 @@
+Overview of changes from pycairo 1.4.0 to pycairo 1.6.4
+========================================================
+General changes:
+ Pycairo 1.6.4 requires cairo 1.6.4 (or later).
+ requires Python 2.5 (or later).
+
+Bug fixes:
+ 16112: Fix win32 'python setup.py ...' build -- use double quotes
+
+New Methods:
+ Context.has_current_point
+ Context.path_extents
+ ImageSurface.format_stride_for_width
+ PSSurface.get_eps
+ PSSurface.set_eps
+ PSSurface.ps_level_to_string
+ PSSurface.restrict_to_level
+ Surface.copy_page
+ Surface.show_page
+
+New Constants:
+ cairo.PS_LEVEL_2, cairo.PS_LEVEL_3
+
+Other changes:
+ test/pygame-test1.py, test/pygame-test2.py : pygame tests
+
+ examples/cairo_snippets/snippets/ellipse.py : Update
+ so line-width is a constant width in device-space not user-space
+
+
Overview of changes from pycairo 1.4.0 to pycairo 1.4.12
========================================================
General changes:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/README new/pycairo-1.6.4/README
--- old/pycairo-1.4.12/README 2007-12-13 05:29:40.000000000 +0100
+++ new/pycairo-1.6.4/README 2008-05-09 04:01:49.000000000 +0200
@@ -3,8 +3,8 @@
Dependencies
------------
- cairo >= 1.4.12
- Python >= 2.4
+ cairo >= 1.6.4
+ Python >= 2.5
Compiling
---------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/setup.py new/pycairo-1.6.4/setup.py
--- old/pycairo-1.4.12/setup.py 2007-12-13 06:49:08.000000000 +0100
+++ new/pycairo-1.6.4/setup.py 2008-07-17 06:04:32.000000000 +0200
@@ -6,8 +6,8 @@
import subprocess
import sys
-pycairo_version = '1.4.12'
-cairo_version_required = '1.4.12'
+pycairo_version = '1.6.4'
+cairo_version_required = '1.6.4'
# Notes:
# on Fedora Core 5 module is compiled with 'gcc -g' - why -g?
@@ -20,7 +20,7 @@
return pipe
def pkg_config_version_check(pkg, version):
- pipe = call("pkg-config --print-errors --exists '%s >= %s'" %
+ pipe = call('pkg-config --print-errors --exists "%s >= %s"' %
(pkg, version))
if pipe.returncode == 0:
print '%s >= %s detected' % (pkg, version)
@@ -35,8 +35,8 @@
return [x.lstrip(opt) for x in output.split()]
-if sys.version_info < (2,4):
- raise SystemExit('Error: Python >= 2.4 is required')
+if sys.version_info < (2,5):
+ raise SystemExit('Error: Python >= 2.5 is required')
pkg_config_version_check ('cairo', cairo_version_required)
if sys.platform == 'win32':
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/test/isurface_create_for_data1.py new/pycairo-1.6.4/test/isurface_create_for_data1.py
--- old/pycairo-1.4.12/test/isurface_create_for_data1.py 2006-12-27 09:12:47.000000000 +0100
+++ new/pycairo-1.6.4/test/isurface_create_for_data1.py 2008-05-10 13:34:15.000000000 +0200
@@ -7,12 +7,12 @@
import cairo
dir_ = "/tmp/"
-imgW, imgH = 255, 255
-data = array.array('B', [0] * imgW * imgH * 4)
+width, height = 255, 255
+data = array.array('B', [0] * width * height * 4)
-for y in range(imgH):
- for x in range(imgW):
- offset = (x + (y * imgW)) * 4
+for y in range(height):
+ for x in range(width):
+ offset = (x + (y * width)) * 4
alpha = y
# cairo.FORMAT_ARGB32 uses pre-multiplied alpha
@@ -21,8 +21,7 @@
data[offset+2] = 0 # R
data[offset+3] = alpha # A
-stride = imgW * 4
-surface = cairo.ImageSurface.create_for_data (data, cairo.FORMAT_ARGB32,
- imgW, imgH, stride)
-ctx = cairo.Context (surface)
-surface.write_to_png (dir_ + 'for_data1.png')
+surface = cairo.ImageSurface.create_for_data(data, cairo.FORMAT_ARGB32,
+ width, height)
+ctx = cairo.Context(surface)
+surface.write_to_png(dir_ + 'for_data1.png')
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/test/isurface_create_for_data2.py new/pycairo-1.6.4/test/isurface_create_for_data2.py
--- old/pycairo-1.4.12/test/isurface_create_for_data2.py 2006-12-27 09:13:05.000000000 +0100
+++ new/pycairo-1.6.4/test/isurface_create_for_data2.py 2008-05-10 13:48:56.000000000 +0200
@@ -3,14 +3,15 @@
"""
import cairo
+
import numpy
dir_ = "/tmp/"
-imgW, imgH = 255, 255
-data = numpy.ndarray (shape=(imgH,imgW,4), dtype=numpy.uint8)
+width, height = 255, 255
+data = numpy.ndarray (shape=(height,width,4), dtype=numpy.uint8)
-for x in range(imgW):
- for y in range(imgH):
+for x in range(width):
+ for y in range(height):
alpha = y
# cairo.FORMAT_ARGB32 uses pre-multiplied alpha
@@ -19,8 +20,7 @@
data[y][x][2] = 0
data[y][x][3] = alpha
-stride = imgW * 4
surface = cairo.ImageSurface.create_for_data (data, cairo.FORMAT_ARGB32,
- imgW, imgH, stride)
-ctx = cairo.Context (surface)
-surface.write_to_png (dir_ + 'for_data2.png')
+ width, height)
+ctx = cairo.Context(surface)
+surface.write_to_png(dir_ + 'for_data2.png')
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/test/Makefile.am new/pycairo-1.6.4/test/Makefile.am
--- old/pycairo-1.4.12/test/Makefile.am 2007-01-17 07:34:40.000000000 +0100
+++ new/pycairo-1.6.4/test/Makefile.am 2008-07-17 05:11:05.000000000 +0200
@@ -3,6 +3,8 @@
isurface_create_for_data2.py \
isurface_create_from_png.py \
isurface_get_data.py \
+ pygame-test1.py \
+ pygame-test2.py \
surface_create_for_stream.py \
surface_write_to_png.py \
test.py \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/test/pygame-test1.py new/pycairo-1.6.4/test/pygame-test1.py
--- old/pycairo-1.4.12/test/pygame-test1.py 1970-01-01 01:00:00.000000000 +0100
+++ new/pycairo-1.6.4/test/pygame-test1.py 2008-07-17 05:09:13.000000000 +0200
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+"""demonstrate pycairo and pygame
+method1: use a pycairo and pygame directly
+"""
+
+import array
+import math
+import sys
+
+import cairo
+import pygame
+
+def draw(surface):
+ x,y, radius = (250,250, 200)
+ ctx = cairo.Context(surface)
+ ctx.set_line_width(15)
+ ctx.arc(x, y, radius, 0, 2.0 * math.pi)
+ ctx.set_source_rgb(0.8, 0.8, 0.8)
+ ctx.fill_preserve()
+ ctx.set_source_rgb(1, 1, 1)
+ ctx.stroke()
+
+def input(events):
+ for event in events:
+ if event.type == pygame.QUIT:
+ sys.exit(0)
+ else:
+ print event
+
+
+Width, Height = 512, 512
+surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, Width, Height)
+
+pygame.init()
+window = pygame.display.set_mode( (Width,Height) )
+screen = pygame.display.get_surface()
+
+draw(surface)
+
+#Create PyGame surface from Cairo Surface
+buf = surface.get_data()
+image = pygame.image.frombuffer(buf,(Width,Height),"ARGB",)
+#Tranfer to Screen
+screen.blit(image, (0,0))
+pygame.display.flip()
+
+while True:
+ input(pygame.event.get())
+
+
+"""
+with pycairo 1.4.12 and pygame 1.7.1 you get the error message:
+
+Traceback (most recent call last):
+ File "./pygame-test1.py", line 42, in <module>
+ image = pygame.image.frombuffer(buf,(Width,Height),"ARGB",)
+TypeError: char buffer type not available
+
+This is because with
+ buf = surface.get_data()
+pycairo provides a binary image buffer,
+whereas with
+ image = pygame.image.frombuffer(buf,(Width,Height),"ARGB",)
+pygame is expecting a text-based character buffer!
+"""
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.4.12/test/pygame-test2.py new/pycairo-1.6.4/test/pygame-test2.py
--- old/pycairo-1.4.12/test/pygame-test2.py 1970-01-01 01:00:00.000000000 +0100
+++ new/pycairo-1.6.4/test/pygame-test2.py 2008-07-17 05:00:27.000000000 +0200
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+"""demonstrate pycairo and pygame
+method1: use an intermediate Python array object
+"""
+
+import array
+import math
+import sys
+
+import cairo
+import pygame
+
+def draw(surface):
+ x,y, radius = (250,250, 200)
+ ctx = cairo.Context(surface)
+ ctx.set_line_width(15)
+ ctx.arc(x, y, radius, 0, 2.0 * math.pi)
+ ctx.set_source_rgb(0.8, 0.8, 0.8)
+ ctx.fill_preserve()
+ ctx.set_source_rgb(1, 1, 1)
+ ctx.stroke()
+
+def input(events):
+ for event in events:
+ if event.type == pygame.QUIT:
+ sys.exit(0)
+ else:
+ print event
+
+
+Width, Height = 512, 512
+data = array.array('c', chr(0) * Width * Height * 4)
+stride = Width * 4
+surface = cairo.ImageSurface.create_for_data(data, cairo.FORMAT_ARGB32,Width, Height, stride)
+
+pygame.init()
+window = pygame.display.set_mode( (Width,Height) )
+screen = pygame.display.get_surface()
+
+draw(surface)
+
+#Create PyGame surface from Cairo Surface
+image = pygame.image.frombuffer(data.tostring(),(Width,Height),"ARGB",)
+#Tranfer to Screen
+screen.blit(image, (0,0))
+pygame.display.flip()
+
+while True:
+ input(pygame.event.get())
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org