[cairo-commit]
cairomm/cairomm context.h, 1.16, 1.17 fontface.h, 1.9,
1.10 pattern.h, 1.10, 1.11 surface.cc, 1.17, 1.18 surface.h,
1.17, 1.18 xlib_surface.cc, 1.5, 1.6 xlib_surface.h, 1.7, 1.8
Murray Cumming
commit at pdx.freedesktop.org
Wed Jul 5 08:37:14 PDT 2006
Committed by: murrayc
Update of /cvs/cairo/cairomm/cairomm
In directory kemper:/tmp/cvs-serv17498/cairomm
Modified Files:
context.h fontface.h pattern.h surface.cc surface.h
xlib_surface.cc xlib_surface.h
Log Message:
2006-07-05 Murray Cumming <murrayc at murrayc.com>
* cairomm/context.h:
* cairomm/fontface.h:
* cairomm/pattern.h:
* cairomm/surface.cc:
* cairomm/surface.h:
* cairomm/xlib_surface.cc:
* cairomm/xlib_surface.h: Fix the generic text about reference-counted
objects, because we no longer use copy constructors for this. And some
pedantic white space changes.
Index: context.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/context.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- context.h 5 Jul 2006 14:59:12 -0000 1.16
+++ context.h 5 Jul 2006 15:37:12 -0000 1.17
@@ -42,9 +42,7 @@
* move_to() and line_to(), and then draw the shapes to the Surface using
* methods such as stroke() or fill().
*
- * Context is a reference-counted object. The copy constructor creates a second
- * reference to the object, instead of creating an independent copy of the
- * object.
+ * Context is a reference-counted object that should be used via Cairo::RefPtr.
*/
class Context
{
Index: fontface.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/fontface.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- fontface.h 28 Jun 2006 00:26:10 -0000 1.9
+++ fontface.h 5 Jul 2006 15:37:12 -0000 1.10
@@ -27,8 +27,7 @@
{
/**
- * This is a reference-counted object. The copy constructor creates a second reference to the object, instead
- * of creating an independent copy of the object.
+ * This is a reference-counted object that should be used via Cairo::RefPtr.
*/
class FontFace
{
Index: pattern.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/pattern.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- pattern.h 28 Jun 2006 00:26:10 -0000 1.10
+++ pattern.h 5 Jul 2006 15:37:12 -0000 1.11
@@ -28,8 +28,7 @@
{
/**
- * This is a reference-counted object. The copy constructor creates a second reference to the object, instead
- * of creating an independent copy of the object.
+ * This is a reference-counted object that should be used via Cairo::RefPtr.
*/
class Pattern
{
Index: surface.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.cc,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- surface.cc 4 Jul 2006 18:42:18 -0000 1.17
+++ surface.cc 5 Jul 2006 15:37:12 -0000 1.18
@@ -76,9 +76,9 @@
check_object_status_and_throw_exception(*this);
}
-void Surface::get_device_offset(double& x_offset, double& y_offset)
+void Surface::get_device_offset(double& x_offset, double& y_offset) const
{
- cairo_surface_get_device_offset(m_cobject, &x_offset, &y_offset);
+ cairo_surface_get_device_offset(const_cast<cobject*>(m_cobject), &x_offset, &y_offset);
}
void Surface::set_fallback_resolution(double x_pixels_per_inch, double y_pixels_per_inch)
Index: surface.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- surface.h 5 Jul 2006 14:59:12 -0000 1.17
+++ surface.h 5 Jul 2006 15:37:12 -0000 1.18
@@ -53,9 +53,7 @@
* different subtypes of cairo surface for different drawing backends. This
* class is a base class for all subtypes and should not be used directly
*
- * Surfaces are reference-counted objects. The copy constructor creates a
- * second reference to the object, instead of creating an independent copy of
- * the object.
+ * Surfaces are reference-counted objects that should be used via Cairo::RefPtr.
*/
class Surface
{
@@ -141,7 +139,7 @@
/** Returns a previous device offset set by set_device_offset().
*/
- void get_device_offset(double& x_offset, double& y_offset);
+ void get_device_offset(double& x_offset, double& y_offset) const;
/** Sets the fallback resolution of the image in dots per inch
*
@@ -229,9 +227,7 @@
* if you modify anything and later want to continue to draw to the surface
* with cairo, you must let cairo know via Cairo::Surface::mark_dirty()
*
- * Note that like all surfaces, an ImageSurface is a reference-counted object
- * in which the copy constructor creates a second reference to the Surface
- * instead of creating an independant copy
+ * Note that like all surfaces, an ImageSurface is a reference-counted object that should be used via Cairo::RefPtr.
*/
class ImageSurface : public Surface
{
Index: xlib_surface.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/xlib_surface.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xlib_surface.cc 1 Jul 2006 02:58:49 -0000 1.5
+++ xlib_surface.cc 5 Jul 2006 15:37:12 -0000 1.6
@@ -34,14 +34,14 @@
// surface is destroyed in base class
}
-RefPtr<XlibSurface> XlibSurface::create(Display *dpy, Drawable drawable, Visual *visual, int width, int height)
+RefPtr<XlibSurface> XlibSurface::create(Display* dpy, Drawable drawable, Visual* visual, int width, int height)
{
cairo_surface_t* cobject = cairo_xlib_surface_create(dpy, drawable, visual, width, height);
check_status_and_throw_exception(cairo_surface_status(cobject));
return RefPtr<XlibSurface>(new XlibSurface(cobject, true /* has reference */));
}
-RefPtr<XlibSurface> XlibSurface::create(Display *dpy, Pixmap bitmap, Screen *screen, int width, int height)
+RefPtr<XlibSurface> XlibSurface::create(Display* dpy, Pixmap bitmap, Screen* screen, int width, int height)
{
cairo_surface_t* cobject = cairo_xlib_surface_create_for_bitmap(dpy, bitmap, screen, width, height);
check_status_and_throw_exception(cairo_surface_status(cobject));
Index: xlib_surface.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/xlib_surface.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- xlib_surface.h 5 Jul 2006 14:59:12 -0000 1.7
+++ xlib_surface.h 5 Jul 2006 15:37:12 -0000 1.8
@@ -71,7 +71,7 @@
* @param height the current height of drawable.
* @return A RefPtr to the newly created surface
*/
- static RefPtr<XlibSurface> create(Display *dpy, Drawable drawable, Visual *visual, int width, int height);
+ static RefPtr<XlibSurface> create(Display* dpy, Drawable drawable, Visual* visual, int width, int height);
/** Creates an Xlib surface that draws to the given bitmap. This will be
* drawn to as a CAIRO_FORMAT_A1 object.
More information about the cairo-commit
mailing list