diff options
author | Murray Cumming <murrayc@murrayc.com> | 2017-04-19 12:32:57 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2017-04-19 12:37:02 +0200 |
commit | 00da439fec8c7e22fe5c69c2d488c0af394477c5 (patch) | |
tree | fedb4df1505e4d06d900e3cd21eaa71cdd027337 | |
parent | 404f7330f503b3d7bc25fb6ecde54ce556b90e5a (diff) |
Change Cairo::RegionOverlap enum to Cairo::Region::Overlap.
And change this from an old-style enum to a C++11 enum class.
-rw-r--r-- | cairomm/enums.h | 19 | ||||
-rw-r--r-- | cairomm/region.cc | 4 | ||||
-rw-r--r-- | cairomm/region.h | 21 |
3 files changed, 22 insertions, 22 deletions
diff --git a/cairomm/enums.h b/cairomm/enums.h index 230add7..4611c4a 100644 --- a/cairomm/enums.h +++ b/cairomm/enums.h @@ -170,25 +170,6 @@ typedef enum TEXT_CLUSTER_FLAG_BACKWARD = CAIRO_TEXT_CLUSTER_FLAG_BACKWARD } TextClusterFlags; -//TODO: Documentation -typedef enum -{ - /** - * Completely inside region - */ - REGION_OVERLAP_IN = CAIRO_REGION_OVERLAP_IN, - - /** - * Completely outside region - */ - REGION_OVERLAP_OUT = CAIRO_REGION_OVERLAP_OUT, - - /** - * Partly inside region - */ - REGION_OVERLAP_PART = CAIRO_REGION_OVERLAP_PART -} RegionOverlap; - /** * A set of synthesis options to control how FreeType renders the glyphs for a * particular font face. diff --git a/cairomm/region.cc b/cairomm/region.cc index 1a7ea56..c262889 100644 --- a/cairomm/region.cc +++ b/cairomm/region.cc @@ -131,9 +131,9 @@ bool Region::empty() const return cairo_region_is_empty(m_cobject); } -RegionOverlap Region::contains_rectangle(const RectangleInt& rectangle) const +Region::Overlap Region::contains_rectangle(const RectangleInt& rectangle) const { - return (RegionOverlap)cairo_region_contains_rectangle(m_cobject, &rectangle); + return (Overlap)cairo_region_contains_rectangle(m_cobject, &rectangle); } bool Region::contains_point(int x, int y) const diff --git a/cairomm/region.h b/cairomm/region.h index 686d3f1..0695094 100644 --- a/cairomm/region.h +++ b/cairomm/region.h @@ -50,6 +50,25 @@ private: Region(const RectangleInt *rects, int count); public: + //TODO: Documentation + enum class Overlap + { + /** + * Completely inside region + */ + IN = CAIRO_REGION_OVERLAP_IN, + + /** + * Completely outside region + */ + OUT = CAIRO_REGION_OVERLAP_OUT, + + /** + * Partly inside region + */ + REGION_OVERLAP_PART = CAIRO_REGION_OVERLAP_PART + }; + /** Create a C++ wrapper for the C instance. This C++ instance should then be given to a RefPtr. * @param cobject The C instance. * @param has_reference Whether we already have a reference. Otherwise, the constructor will take an extra reference. @@ -85,7 +104,7 @@ public: /** Checks whether @a rectangle is inside, outside, or partially contained in * the region */ - RegionOverlap contains_rectangle(const RectangleInt& rectangle) const; + Overlap contains_rectangle(const RectangleInt& rectangle) const; /** Checks whether (x,y) is contained in the region */ bool contains_point(int x, int y) const; |