diff options
author | Murray Cumming <murrayc@murrayc.com> | 2017-04-19 11:46:20 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2017-04-19 12:35:37 +0200 |
commit | e9202b3db99a6fb7a6fcc8906642a1e1eda878cf (patch) | |
tree | 454b02cf96d505caf65cbf9e110586b482db5911 | |
parent | abffd980fd43984513584507d62b8e9cc50195f3 (diff) |
Change Cairo::LineJoin enum to Cairo::Context::LineJoin.
And change this from an old-style enum to a C++11 enum class.
-rw-r--r-- | cairomm/context.cc | 2 | ||||
-rw-r--r-- | cairomm/context.h | 28 | ||||
-rw-r--r-- | cairomm/enums.h | 24 |
3 files changed, 27 insertions, 27 deletions
diff --git a/cairomm/context.cc b/cairomm/context.cc index b170877..528de9a 100644 --- a/cairomm/context.cc +++ b/cairomm/context.cc @@ -681,7 +681,7 @@ Context::LineCap Context::get_line_cap() const return result; } -LineJoin Context::get_line_join() const +Context::LineJoin Context::get_line_join() const { const auto result = static_cast<LineJoin>(cairo_get_line_join(const_cast<cobject*>(cobj()))); check_object_status_and_throw_exception(*this); diff --git a/cairomm/context.h b/cairomm/context.h index 2cd2b94..181331e 100644 --- a/cairomm/context.h +++ b/cairomm/context.h @@ -201,6 +201,30 @@ public: SQUARE = CAIRO_LINE_CAP_SQUARE }; + /** + * Specifies how to render the junction of two lines when stroking. + * + * The default line join style is Cairo::LineJoin::MITER. + */ + enum class LineJoin + { + /** + * Use a sharp (angled) corner, see Context::set_miter_limit() + */ + MITER = CAIRO_LINE_JOIN_MITER, + + /** + * Use a rounded join, the center of teh circle is the joint point + */ + ROUND = CAIRO_LINE_JOIN_ROUND, + + /** + * Use cut-off join, the join is cut off at half the line width from the + * join point + */ + BEVEL = CAIRO_LINE_JOIN_BEVEL + }; + /** Create a C++ wrapper for the C instance. This C++ instance should then be * given to a RefPtr. * @@ -400,7 +424,7 @@ public: * examined by stroke(), stroke_extents(), and stroke_to_path(), but does not * have any effect during path construction. * - * The default line join style is Cairo::LINE_JOIN_MITER. + * The default line join style is Cairo::LineJoin::MITER. * * @param line_join a line joint style, as a LineJoin */ @@ -447,7 +471,7 @@ public: /** * Sets the current miter limit within the cairo context. * - * If the current line join style is set to Cairo::LINE_JOIN_MITER (see + * If the current line join style is set to Cairo::LineJoin::MITER (see * set_line_join()), the miter limit is used to determine whether the lines * should be joined with a bevel instead of a miter. Cairo divides the length * of the miter by the line width. If the result is greater than the miter diff --git a/cairomm/enums.h b/cairomm/enums.h index 70a244b..d64fe8d 100644 --- a/cairomm/enums.h +++ b/cairomm/enums.h @@ -63,30 +63,6 @@ typedef enum } Antialias; /** - * Specifies how to render the junction of two lines when stroking. - * - * The default line join style is Cairo::LINE_JOIN_MITER. - */ -typedef enum -{ - /** - * Use a sharp (angled) corner, see Context::set_miter_limit() - */ - LINE_JOIN_MITER = CAIRO_LINE_JOIN_MITER, - - /** - * Use a rounded join, the center of teh circle is the joint point - */ - LINE_JOIN_ROUND = CAIRO_LINE_JOIN_ROUND, - - /** - * Use cut-off join, the join is cut off at half the line width from the - * join point - */ - LINE_JOIN_BEVEL = CAIRO_LINE_JOIN_BEVEL -} LineJoin; - -/** * Specifies variants of a font face based on their slant. */ typedef enum |