[cairo-commit] cairomm/cairomm context.cc, 1.3, 1.4 fontoptions.cc,
1.2, 1.3 surface.cc, 1.2, 1.3
Murray Cumming
commit at pdx.freedesktop.org
Wed Dec 7 06:41:12 PST 2005
Committed by: murrayc
Update of /cvs/cairo/cairomm/cairomm
In directory gabe:/tmp/cvs-serv17096/cairomm
Modified Files:
context.cc fontoptions.cc surface.cc
Log Message:
2005-12-07 Murray Cumming <murrayc at murrayc.com>
* cairomm/context.cc:
* cairomm/fontoptions.cc:
* cairomm/surface.cc: Check for errors in
constructors, as per the error-handling advice in the
language bindings section of the cairo documentation.
Index: context.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/context.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- context.cc 7 Dec 2005 14:34:27 -0000 1.3
+++ context.cc 7 Dec 2005 14:41:10 -0000 1.4
@@ -25,6 +25,7 @@
: m_cobject(0)
{
m_cobject = cairo_create(target.cobj());
+ check_object_status_and_throw_exception(*this);
}
Context::Context(cairo_t* cobject, bool has_reference)
Index: fontoptions.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/fontoptions.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fontoptions.cc 2 Dec 2005 14:05:17 -0000 1.2
+++ fontoptions.cc 7 Dec 2005 14:41:10 -0000 1.3
@@ -25,6 +25,7 @@
: m_cobject(0)
{
m_cobject = cairo_font_options_create();
+ check_object_status_and_throw_exception(*this);
}
FontOptions::FontOptions(cairo_font_options_t* cobject, bool take_ownership)
@@ -34,6 +35,8 @@
m_cobject = cobject;
else
m_cobject = cairo_font_options_copy(cobject);
+
+ check_object_status_and_throw_exception(*this);
}
FontOptions::FontOptions(const FontOptions& src)
@@ -43,6 +46,8 @@
m_cobject = 0;
else
m_cobject = cairo_font_options_copy(src.m_cobject);
+
+ check_object_status_and_throw_exception(*this);
}
FontOptions::~FontOptions()
Index: surface.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- surface.cc 2 Dec 2005 14:05:17 -0000 1.2
+++ surface.cc 7 Dec 2005 14:41:10 -0000 1.3
@@ -73,21 +73,21 @@
Surface Surface::create(Format format, int width, int height)
{
cairo_surface_t* cobject = cairo_image_surface_create((cairo_format_t)format, width, height);
- //Not possible with a static method: check_object_status_and_throw_exception(*this);
+ check_status_and_throw_exception(cairo_surface_status(cobject));
return Surface(cobject, true /* has reference */);
}
Surface Surface::create(unsigned char* data, Format format, int width, int height, int stride)
{
cairo_surface_t* cobject = cairo_image_surface_create_for_data(data, (cairo_format_t)format, width, height, stride);
- //Not possible with a static method: check_object_status_and_throw_exception(*this);
+ check_status_and_throw_exception(cairo_surface_status(cobject));
return Surface(cobject, true /* has reference */);
}
Surface Surface::create(const Surface& other, Content content, int width, int height)
{
cairo_surface_t* cobject = cairo_surface_create_similar(other.m_cobject, (cairo_content_t)content, width, height);
- //Not possible with a static method: check_object_status_and_throw_exception(*this);
+ check_status_and_throw_exception(cairo_surface_status(cobject));
return Surface(cobject, true /* has reference */);
}
More information about the cairo-commit
mailing list