[cairo-commit] cairomm/cairomm context.cc, 1.4, 1.5 context.h, 1.3, 1.4

Murray Cumming commit at pdx.freedesktop.org
Wed Dec 7 07:30:59 PST 2005


Committed by: murrayc

Update of /cvs/cairo/cairomm/cairomm
In directory gabe:/tmp/cvs-serv26169/cairomm

Modified Files:
	context.cc context.h 
Log Message:
2005-12-07  Murray Cumming <murrayc at 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.


Index: context.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/context.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- context.cc	7 Dec 2005 14:41:10 -0000	1.4
+++ context.cc	7 Dec 2005 15:30:57 -0000	1.5
@@ -199,13 +199,13 @@
   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 @@
   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 @@
   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);

Index: context.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/context.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- context.h	7 Dec 2005 14:34:27 -0000	1.3
+++ context.h	7 Dec 2005 15:30:57 -0000	1.4
@@ -40,6 +40,7 @@
 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 @@
   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 @@
   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 @@
   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;



More information about the cairo-commit mailing list