diff -Naurp cairomm-1.8.0.orig/cairomm/context.cc cairomm-1.8.0/cairomm/context.cc --- cairomm-1.8.0.orig/cairomm/context.cc 2008-12-20 19:37:46.000000000 +0200 +++ cairomm-1.8.0/cairomm/context.cc 2009-06-09 11:43:40.000000000 +0300 @@ -209,12 +209,24 @@ void Context::transform(const Matrix& ma check_object_status_and_throw_exception(*this); } +void Context::transform(const cairo_matrix_t& matrix) +{ + cairo_transform(cobj(), &matrix); + check_object_status_and_throw_exception(*this); +} + void Context::set_matrix(const Matrix& matrix) { cairo_set_matrix(cobj(), &matrix); check_object_status_and_throw_exception(*this); } +void Context::set_matrix(const cairo_matrix_t& matrix) +{ + cairo_set_matrix(cobj(), &matrix); + check_object_status_and_throw_exception(*this); +} + void Context::set_identity_matrix() { cairo_identity_matrix(cobj()); @@ -467,12 +479,24 @@ void Context::set_font_matrix(const Matr check_object_status_and_throw_exception(*this); } +void Context::set_font_matrix(const cairo_matrix_t& matrix) +{ + cairo_set_font_matrix(cobj(), &matrix); + check_object_status_and_throw_exception(*this); +} + void Context::get_font_matrix(Matrix& matrix) const { cairo_get_font_matrix(const_cast(cobj()), &matrix); check_object_status_and_throw_exception(*this); } +void Context::get_font_matrix(cairo_matrix_t& matrix) const +{ + cairo_get_font_matrix(const_cast(cobj()), &matrix); + check_object_status_and_throw_exception(*this); +} + void Context::set_font_options(const FontOptions& options) { cairo_set_font_options(cobj(), options.cobj()); @@ -698,6 +722,12 @@ void Context::get_matrix(Matrix& matrix) check_object_status_and_throw_exception(*this); } +void Context::get_matrix(cairo_matrix_t& matrix) +{ + cairo_get_matrix(cobj(), &matrix); + check_object_status_and_throw_exception(*this); +} + Matrix Context::get_matrix() const { Cairo::Matrix m; diff -Naurp cairomm-1.8.0.orig/cairomm/context.h cairomm-1.8.0/cairomm/context.h --- cairomm-1.8.0.orig/cairomm/context.h 2008-12-20 19:37:46.000000000 +0200 +++ cairomm-1.8.0/cairomm/context.h 2009-06-09 11:33:49.000000000 +0300 @@ -307,6 +307,9 @@ public: */ void transform(const Matrix& matrix); + /* To keep 1.6.x ABI */ + void transform(const cairo_matrix_t& matrix); + /** Modifies the current transformation matrix (CTM) by setting it equal to * matrix. * @@ -314,6 +317,9 @@ public: */ void set_matrix(const Matrix& matrix); + /* To keep 1.6.x ABI */ + void set_matrix(const cairo_matrix_t& matrix); + /** Resets the current transformation matrix (CTM) by setting it equal to the * identity matrix. That is, the user-space and device-space axes will be * aligned and one user-space unit will transform to one device-space unit. @@ -703,6 +709,10 @@ public: void get_font_matrix(Matrix& matrix) const; void set_font_options(const FontOptions& options); + /* To keep 1.6.x ABI */ + void set_font_matrix(const cairo_matrix_t& matrix); + void get_font_matrix(cairo_matrix_t& matrix) const; + //TODO: Documentation. /** * @since 1.8 @@ -815,6 +825,10 @@ public: * @param matrix return value for the matrix */ void get_matrix(Matrix& matrix); + + /* To keep 1.6.x ABI */ + void get_matrix(cairo_matrix_t& matrix); + /** @since 1.8 */ Matrix get_matrix() const; diff -Naurp cairomm-1.8.0.orig/cairomm/pattern.cc cairomm-1.8.0/cairomm/pattern.cc --- cairomm-1.8.0.orig/cairomm/pattern.cc 2008-12-20 19:37:46.000000000 +0200 +++ cairomm-1.8.0/cairomm/pattern.cc 2009-06-09 11:17:09.000000000 +0300 @@ -65,6 +65,18 @@ void Pattern::get_matrix(Matrix& matrix) check_object_status_and_throw_exception(*this); } +void Pattern::set_matrix(const cairo_matrix_t& matrix) +{ + cairo_pattern_set_matrix(m_cobject, (cairo_matrix_t*)&matrix); + check_object_status_and_throw_exception(*this); +} + +void Pattern::get_matrix(cairo_matrix_t& matrix) const +{ + cairo_pattern_get_matrix(m_cobject, (cairo_matrix_t*)&matrix); + check_object_status_and_throw_exception(*this); +} + Matrix Pattern::get_matrix() const { Cairo::Matrix m; diff -Naurp cairomm-1.8.0.orig/cairomm/pattern.h cairomm-1.8.0/cairomm/pattern.h --- cairomm-1.8.0.orig/cairomm/pattern.h 2008-12-20 19:37:46.000000000 +0200 +++ cairomm-1.8.0/cairomm/pattern.h 2009-06-09 11:16:15.000000000 +0300 @@ -59,6 +59,9 @@ public: /** @since 1.8 */ Matrix get_matrix() const; + /* To keep 1.6.x ABI */ + void set_matrix(const cairo_matrix_t& matrix); + void get_matrix(cairo_matrix_t& matrix) const; PatternType get_type() const; typedef cairo_pattern_t cobject; diff -Naurp cairomm-1.8.0.orig/cairomm/scaledfont.cc cairomm-1.8.0/cairomm/scaledfont.cc --- cairomm-1.8.0.orig/cairomm/scaledfont.cc 2008-12-20 19:37:46.000000000 +0200 +++ cairomm-1.8.0/cairomm/scaledfont.cc 2009-06-09 11:27:18.000000000 +0300 @@ -31,8 +31,8 @@ ScaledFont::ScaledFont(cobject* cobj, bo m_cobject = cairo_scaled_font_reference(cobj); } -ScaledFont::ScaledFont(const RefPtr& font_face, const Matrix& font_matrix, - const Matrix& ctm, const FontOptions& options) +ScaledFont::ScaledFont(const RefPtr& font_face, const cairo_matrix_t& font_matrix, + const cairo_matrix_t& ctm, const FontOptions& options) { m_cobject = cairo_scaled_font_create(font_face->cobj(), @@ -54,6 +54,12 @@ RefPtr ScaledFont::create(co return RefPtr(new ScaledFont(font_face, font_matrix, ctm, options)); } +RefPtr ScaledFont::create(const RefPtr& font_face, const cairo_matrix_t& font_matrix, + const cairo_matrix_t& ctm, const FontOptions& options) +{ + return RefPtr(new ScaledFont(font_face, font_matrix, ctm, options)); +} + void ScaledFont::extents(FontExtents& extents) const { cairo_scaled_font_extents(m_cobject, static_cast(&extents)); @@ -103,12 +109,25 @@ void ScaledFont::get_font_matrix(Matrix& check_object_status_and_throw_exception(*this); } +void ScaledFont::get_font_matrix(cairo_matrix_t& font_matrix) const +{ + cairo_scaled_font_get_font_matrix(m_cobject, + &font_matrix); + check_object_status_and_throw_exception(*this); +} + void ScaledFont::get_ctm(Matrix& ctm) const { cairo_scaled_font_get_ctm(m_cobject, &ctm); check_object_status_and_throw_exception(*this); } +void ScaledFont::get_ctm(cairo_matrix_t& ctm) const +{ + cairo_scaled_font_get_ctm(m_cobject, &ctm); + check_object_status_and_throw_exception(*this); +} + FontType ScaledFont::get_type() const { cairo_font_type_t font_type = cairo_scaled_font_get_type(m_cobject); diff -Naurp cairomm-1.8.0.orig/cairomm/scaledfont.h cairomm-1.8.0/cairomm/scaledfont.h --- cairomm-1.8.0.orig/cairomm/scaledfont.h 2008-12-20 19:37:46.000000000 +0200 +++ cairomm-1.8.0/cairomm/scaledfont.h 2009-06-09 11:27:18.000000000 +0300 @@ -82,6 +82,9 @@ public: */ static RefPtr create(const RefPtr& font_face, const Matrix& font_matrix, const Matrix& ctm, const FontOptions& options = FontOptions()); + /* To keep 1.6.x ABI */ + static RefPtr create(const RefPtr& font_face, const cairo_matrix_t& font_matrix, + const cairo_matrix_t& ctm, const FontOptions& options = FontOptions()); // NOTE: the constructor doesn't take a RefPtr because the // FontFace object can be changed in this constructor (in the case of user // fonts, the FontFace becomes immutable, i.e. you can't call any set_*_func() @@ -164,11 +167,15 @@ public: * @since 1.2 */ void get_font_matrix(Matrix& font_matrix) const; + /* To keep 1.6.x ABI */ + void get_font_matrix(cairo_matrix_t& font_matrix) const; /** Gets the CTM with which the ScaledFont was created. * @since 1.2 */ void get_ctm(Matrix& ctm) const; + /* To keep 1.6.x ABI */ + void get_ctm(cairo_matrix_t& ctm) const; /** Gets the type of scaled Font * @since 1.2 @@ -215,8 +222,9 @@ public: void get_scale_matrix(Matrix& scale_matrix) const; protected: - ScaledFont(const RefPtr& font_face, const Matrix& font_matrix, - const Matrix& ctm, const FontOptions& options = FontOptions()); + /* Cairo::Matrix parameters changed to cairo_matrix_t */ + ScaledFont(const RefPtr& font_face, const cairo_matrix_t& font_matrix, + const cairo_matrix_t& ctm, const FontOptions& options = FontOptions()); /** The underlying C cairo object that is wrapped by this ScaledFont */ cobject* m_cobject; };