[cairo-commit] cairomm/cairomm enums.h, 1.9, 1.10 fontface.cc, 1.7,
1.8 fontface.h, 1.8, 1.9 pattern.cc, 1.7, 1.8 pattern.h, 1.9,
1.10 surface.cc, 1.15, 1.16 surface.h, 1.13, 1.14
Jonathon Jongsma
commit at pdx.freedesktop.org
Tue Jun 27 17:26:12 PDT 2006
Committed by: jjongsma
Update of /cvs/cairo/cairomm/cairomm
In directory kemper:/tmp/cvs-serv17265/cairomm
Modified Files:
enums.h fontface.cc fontface.h pattern.cc pattern.h surface.cc
surface.h
Log Message:
2006-06-27 Jonathon Jongsma <jonathon.jongsma at gmail.com>
* cairomm/enums.h: Added enum types to support the new get_type() and SVG
Version API
* cairomm/fontface.cc, cairomm/fontface.h: add new get_type() API
* cairomm/pattern.cc, cairomm/pattern.h: add new get_type() API
* cairomm/surface.cc, cairomm/surface.h: add new get_type() API and
SvgSurface::restrict_to_version() API
Index: enums.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/enums.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- enums.h 23 Jun 2006 18:13:39 -0000 1.9
+++ enums.h 28 Jun 2006 00:26:10 -0000 1.10
@@ -163,6 +163,37 @@
HINT_METRICS_ON = CAIRO_HINT_METRICS_ON
} HintMetrics;
+typedef enum
+{
+ SURFACE_TYPE_IMAGE = CAIRO_SURFACE_TYPE_IMAGE,
+ SURFACE_TYPE_PDF = CAIRO_SURFACE_TYPE_PDF,
+ SURFACE_TYPE_PS = CAIRO_SURFACE_TYPE_PS,
+ SURFACE_TYPE_XLIB = CAIRO_SURFACE_TYPE_XLIB,
+ SURFACE_TYPE_XCB = CAIRO_SURFACE_TYPE_XCB,
+ SURFACE_TYPE_GLITZ = CAIRO_SURFACE_TYPE_GLITZ,
+ SURFACE_TYPE_QUARTZ = CAIRO_SURFACE_TYPE_QUARTZ,
+ SURFACE_TYPE_WIN32 = CAIRO_SURFACE_TYPE_WIN32,
+ SURFACE_TYPE_BEOS = CAIRO_SURFACE_TYPE_BEOS,
+ SURFACE_TYPE_DIRECTFB = CAIRO_SURFACE_TYPE_DIRECTFB,
+ SURFACE_TYPE_SVG = CAIRO_SURFACE_TYPE_SVG
+} SurfaceType;
+
+typedef enum
+{
+ PATTERN_TYPE_SOLID = CAIRO_PATTERN_TYPE_SOLID,
+ PATTERN_TYPE_SURFACE = CAIRO_PATTERN_TYPE_SURFACE,
+ PATTERN_TYPE_LINEAR = CAIRO_PATTERN_TYPE_LINEAR,
+ PATTERN_TYPE_RADIAL = CAIRO_PATTERN_TYPE_RADIAL
+} PatternType;
+
+typedef enum
+{
+ FONT_TYPE_TOY = CAIRO_FONT_TYPE_TOY,
+ FONT_TYPE_FT = CAIRO_FONT_TYPE_FT,
+ FONT_TYPE_WIN32 = CAIRO_FONT_TYPE_WIN32,
+ FONT_TYPE_ATSUI = CAIRO_FONT_TYPE_ATSUI
+} FontType;
+
} // namespace Cairo
#endif //__CAIROMM_ENUMS_H
Index: fontface.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/fontface.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- fontface.cc 6 Mar 2006 17:55:51 -0000 1.7
+++ fontface.cc 28 Jun 2006 00:26:10 -0000 1.8
@@ -62,6 +62,12 @@
}
*/
+FontType FontFace::get_type() const
+{
+ cairo_font_type_t font_type = cairo_font_face_get_type(m_cobject);
+ check_object_status_and_throw_exception(*this);
+ return static_cast<FontType>(font_type);
+}
} //namespace Cairo
Index: fontface.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/fontface.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- fontface.h 15 Mar 2006 01:00:59 -0000 1.8
+++ fontface.h 28 Jun 2006 00:26:10 -0000 1.9
@@ -53,6 +53,7 @@
void set_user_data(const cairo_user_data_key_t *key, void *user_data, cairo_destroy_func_t destroy); //TODO: Use a sigc::slot?
*/
+ FontType get_type() const;
typedef cairo_font_face_t cobject;
inline cobject* cobj() { return m_cobject; }
Index: pattern.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/pattern.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- pattern.cc 6 Mar 2006 17:55:51 -0000 1.7
+++ pattern.cc 28 Jun 2006 00:26:10 -0000 1.8
@@ -64,6 +64,13 @@
check_object_status_and_throw_exception(*this);
}
+PatternType Pattern::get_type() const
+{
+ cairo_pattern_type_t pattern_type = cairo_pattern_get_type(m_cobject);
+ check_object_status_and_throw_exception(*this);
+ return static_cast<PatternType>(pattern_type);
+}
+
SolidPattern::SolidPattern(cairo_pattern_t* cobject, bool has_reference)
Index: pattern.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/pattern.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pattern.h 15 Mar 2006 01:00:59 -0000 1.9
+++ pattern.h 28 Jun 2006 00:26:10 -0000 1.10
@@ -50,6 +50,7 @@
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;
inline cobject* cobj() { return m_cobject; }
Index: surface.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.cc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- surface.cc 27 Jun 2006 01:46:14 -0000 1.15
+++ surface.cc 28 Jun 2006 00:26:10 -0000 1.16
@@ -87,6 +87,13 @@
check_object_status_and_throw_exception(*this);
}
+SurfaceType Surface::get_type() const
+{
+ cairo_surface_type_t surface_type = cairo_surface_get_type(m_cobject);
+ check_object_status_and_throw_exception(*this);
+ return static_cast<SurfaceType>(surface_type);
+}
+
#ifdef CAIRO_HAS_PNG_FUNCTIONS
void Surface::write_to_png(const std::string& filename)
{
@@ -317,6 +324,12 @@
return RefPtr<SvgSurface>(new SvgSurface(cobject, true /* has reference */));
}
+void SvgSurface::restrict_to_version(SvgVersion version)
+{
+ cairo_svg_surface_restrict_to_version(m_cobject, static_cast<cairo_svg_version_t>(version));
+ check_object_status_and_throw_exception(*this);
+}
+
#endif // CAIRO_HAS_SVG_SURFACE
Index: surface.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- surface.h 27 Jun 2006 01:46:14 -0000 1.13
+++ surface.h 28 Jun 2006 00:26:10 -0000 1.14
@@ -148,6 +148,8 @@
*/
void set_fallback_resolution(double x_pixels_per_inch, double y_pixels_per_inch);
+ SurfaceType get_type() const;
+
#ifdef CAIRO_HAS_PNG_FUNCTIONS
/** Writes the contents of surface to a new file filename as a PNG image.
@@ -512,6 +514,13 @@
#ifdef CAIRO_HAS_SVG_SURFACE
+typedef enum
+{
+ SVG_VERSION_1_1 = CAIRO_SVG_VERSION_1_1,
+ SVG_VERSION_1_2 = CAIRO_SVG_VERSION_1_2,
+ SVG_VERSION_LAST = CAIRO_SVG_VERSION_LAST
+} SvgVersion;
+
/** A SvgSurface provides a way to render Scalable Vector Graphics (SVG) images
* from cairo. This surface is not rendered to the screen but instead renders
* the drawing to an SVG file on disk.
@@ -557,6 +566,8 @@
*/
static RefPtr<SvgSurface> create(cairo_write_func_t write_func, void *closure, double width_in_points, double height_in_points);
+ void restrict_to_version(SvgVersion version);
+
};
#endif // CAIRO_HAS_SVG_SURFACE
More information about the cairo-commit
mailing list