diff options
author | Murray Cumming <murrayc@murrayc.com> | 2017-04-19 11:49:21 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2017-04-19 12:35:44 +0200 |
commit | eb083bae8433bf5dc01237d45dc3147a7551edc6 (patch) | |
tree | 76d3d31811e842566e445ec41e9b22a81f91e4dd | |
parent | e9202b3db99a6fb7a6fcc8906642a1e1eda878cf (diff) |
Change Cairo::DeviceType enum to Cairo::Device::DeviceType.
And change this from an old-style enum to a C++11 enum class.
-rw-r--r-- | cairomm/device.cc | 2 | ||||
-rw-r--r-- | cairomm/device.h | 37 |
2 files changed, 38 insertions, 1 deletions
diff --git a/cairomm/device.cc b/cairomm/device.cc index 99c75a8..cc8bdef 100644 --- a/cairomm/device.cc +++ b/cairomm/device.cc @@ -47,7 +47,7 @@ void Device::unreference() const cairo_device_destroy(m_cobject); } -DeviceType Device::get_type() const +Device::DeviceType Device::get_type() const { auto surface_type = cairo_device_get_type(const_cast<cobject*>(cobj())); diff --git a/cairomm/device.h b/cairomm/device.h index 3cb1e7c..e3e8237 100644 --- a/cairomm/device.h +++ b/cairomm/device.h @@ -86,6 +86,43 @@ public: RefPtr<Device> m_device; }; + + /** + * @since 1.10 + */ + enum class DeviceType + { + /** + * + */ + DRM = CAIRO_DEVICE_TYPE_DRM, + + /** + * + */ + GL = CAIRO_DEVICE_TYPE_GL, + + /** + * + */ + SCRIPT = CAIRO_DEVICE_TYPE_SCRIPT, + + /** + * + */ + XCB = CAIRO_DEVICE_TYPE_XCB, + + /** + * + */ + XLIB = CAIRO_DEVICE_TYPE_XLIB, + + /** + * + */ + XML = CAIRO_DEVICE_TYPE_XML + }; + /** 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. |