diff options
author | Murray Cumming <murrayc@murrayc.com> | 2005-12-07 15:30:57 +0000 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2005-12-07 15:30:57 +0000 |
commit | b3ab19aa25c0c9800172d3452da64155d3cb3dfd (patch) | |
tree | 98f46d5db2f9852382434509e46594f551036fdc | |
parent | 6ebbeaddbe3bdf3ad6c38de83b4229fdaedc2a13 (diff) |
2005-12-07 Murray Cumming <murrayc@murrayc.com>
* cairomm/context.cc:
* cairomm/context.h: Add typedef for Matrix, though we
probably want to derive a class with a C++-like matrix
API, with operator overloading.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | cairomm/context.cc | 10 | ||||
-rw-r--r-- | cairomm/context.h | 11 |
3 files changed, 18 insertions, 10 deletions
@@ -1,5 +1,12 @@ 2005-12-07 Murray Cumming <murrayc@murrayc.com> + * cairomm/context.cc: + * cairomm/context.h: Add typedef for Matrix, though we + probably want to derive a class with a C++-like matrix + API, with operator overloading. + +2005-12-07 Murray Cumming <murrayc@murrayc.com> + * cairomm/exception.cc: * cairomm/exception.h: Rename to logic_error, because the cairo documentation says that most of them are diff --git a/cairomm/context.cc b/cairomm/context.cc index faeaeb4..dc5ba44 100644 --- a/cairomm/context.cc +++ b/cairomm/context.cc @@ -199,13 +199,13 @@ void Context::rotate_deg(double angle) check_object_status_and_throw_exception(*this); } -void Context::transform(const cairo_matrix_t& matrix) +void Context::transform(const Matrix& matrix) { cairo_transform(m_cobject, &matrix); check_object_status_and_throw_exception(*this); } -void Context::set_matrix(const cairo_matrix_t& matrix) +void Context::set_matrix(const Matrix& matrix) { cairo_set_matrix(m_cobject, &matrix); check_object_status_and_throw_exception(*this); @@ -423,13 +423,13 @@ void Context::set_font_size(double size) check_object_status_and_throw_exception(*this); } -void Context::set_font_matrix(const cairo_matrix_t &matrix) +void Context::set_font_matrix(const Matrix& matrix) { cairo_set_font_matrix(m_cobject, &matrix); check_object_status_and_throw_exception(*this); } -void Context::get_font_matrix(cairo_matrix_t &matrix) const +void Context::get_font_matrix(Matrix& matrix) const { cairo_get_font_matrix(m_cobject, &matrix); check_object_status_and_throw_exception(*this); @@ -565,7 +565,7 @@ double Context::get_miter_limit() const return result; } -void Context::get_matrix(cairo_matrix_t &matrix) +void Context::get_matrix(Matrix& matrix) { cairo_get_matrix(m_cobject, &matrix); check_object_status_and_throw_exception(*this); diff --git a/cairomm/context.h b/cairomm/context.h index 62119ac..5531fd8 100644 --- a/cairomm/context.h +++ b/cairomm/context.h @@ -40,6 +40,7 @@ typedef cairo_font_weight_t FontWeight; typedef cairo_glyph_t Glyph; //A simple struct. typedef cairo_font_extents_t FontExtents; //A simple struct. typedef cairo_text_extents_t TextExtents; //A simple struct. +typedef cairo_matrix_t Matrix; //A simple struct. //TODO: Derive and add operator[] and operator. matrix multiplication? /** The context is the main object used when drawing with cairo. To draw with cairo, you create a context, * set the target surface, and drawing options for the context, create shapes with methods like move_to() and @@ -95,8 +96,8 @@ public: void scale(double sx, double sy); void rotate(double angle); void rotate_deg(double angle); - void transform(const cairo_matrix_t &matrix); - void set_matrix(const cairo_matrix_t &matrix); + void transform(const Matrix& matrix); + void set_matrix(const Matrix& matrix); void identity_matrix(); void user_to_device(double& x, double& y); void user_to_device_distance(double& dx, double& dy); @@ -132,8 +133,8 @@ public: void clip_preserve(); void select_font_face (const std::string& family, FontSlant slant, FontWeight weight); void set_font_size(double size); - void set_font_matrix(const cairo_matrix_t &matrix); - void get_font_matrix(cairo_matrix_t &matrix) const; + void set_font_matrix(const Matrix& matrix); + void get_font_matrix(Matrix& matrix) const; void set_font_options(const FontOptions& options); void show_text(const std::string& utf8); void show_glyphs(const std::vector<Glyph>& glyphs); @@ -155,7 +156,7 @@ public: LineJoin get_line_join() const; double get_miter_limit() const; - void get_matrix(cairo_matrix_t &matrix); + void get_matrix(Matrix& matrix); Surface get_target(); const Surface get_target() const; |