diff options
author | Murray Cumming <murrayc@murrayc.com> | 2006-07-05 15:37:12 +0000 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2006-07-05 15:37:12 +0000 |
commit | 68e569629b43cf6546980613eeebf0c059fef355 (patch) | |
tree | 86c9142e15550615c280b05ba781a057c04c2577 | |
parent | 57c1ebd87df368e3f625f84887779cb10f265e48 (diff) |
2006-07-05 Murray Cumming <murrayc@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.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | cairomm/context.h | 4 | ||||
-rw-r--r-- | cairomm/fontface.h | 3 | ||||
-rw-r--r-- | cairomm/pattern.h | 3 | ||||
-rw-r--r-- | cairomm/surface.cc | 4 | ||||
-rw-r--r-- | cairomm/surface.h | 10 | ||||
-rw-r--r-- | cairomm/xlib_surface.cc | 4 | ||||
-rw-r--r-- | cairomm/xlib_surface.h | 2 |
8 files changed, 23 insertions, 19 deletions
@@ -1,5 +1,17 @@ 2006-07-05 Murray Cumming <murrayc@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. + +2006-07-05 Murray Cumming <murrayc@murrayc.com> + * cairomm/scaledfont.cc: * cairomm/scaledfont.h: create(): Make the font_matrix and ctm parameters const (they are now const in the C API too). Maybe the font diff --git a/cairomm/context.h b/cairomm/context.h index 3c20fd8..f590560 100644 --- a/cairomm/context.h +++ b/cairomm/context.h @@ -42,9 +42,7 @@ typedef cairo_matrix_t Matrix; //A simple struct. //TODO: Derive and add operato * 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 { diff --git a/cairomm/fontface.h b/cairomm/fontface.h index c71fe0b..69581f6 100644 --- a/cairomm/fontface.h +++ b/cairomm/fontface.h @@ -27,8 +27,7 @@ namespace Cairo { /** - * 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 { diff --git a/cairomm/pattern.h b/cairomm/pattern.h index 96274a9..2624d7a 100644 --- a/cairomm/pattern.h +++ b/cairomm/pattern.h @@ -28,8 +28,7 @@ namespace Cairo { /** - * 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 { diff --git a/cairomm/surface.cc b/cairomm/surface.cc index 2d0a0ee..90cc303 100644 --- a/cairomm/surface.cc +++ b/cairomm/surface.cc @@ -76,9 +76,9 @@ void Surface::set_device_offset(double x_offset, double y_offset) 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) diff --git a/cairomm/surface.h b/cairomm/surface.h index c7bf2fe..001f754 100644 --- a/cairomm/surface.h +++ b/cairomm/surface.h @@ -53,9 +53,7 @@ namespace Cairo * 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 @@ public: /** 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 @@ protected: * 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 { diff --git a/cairomm/xlib_surface.cc b/cairomm/xlib_surface.cc index 8514c9b..8320521 100644 --- a/cairomm/xlib_surface.cc +++ b/cairomm/xlib_surface.cc @@ -34,14 +34,14 @@ XlibSurface::~XlibSurface() // 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)); diff --git a/cairomm/xlib_surface.h b/cairomm/xlib_surface.h index 8637293..cddd880 100644 --- a/cairomm/xlib_surface.h +++ b/cairomm/xlib_surface.h @@ -71,7 +71,7 @@ public: * @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. |