From 8d1ca61b0e6a8e4f4eff7225becb23f1836df2ff Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 16 Aug 2022 17:09:48 +0200 Subject: Fix build with -Dbuild-deprecated-api=false Fixes #29 --- cairomm/context.cc | 14 ++++++++++---- cairomm/pattern.cc | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cairomm/context.cc b/cairomm/context.cc index a4125ba..f7763b9 100644 --- a/cairomm/context.cc +++ b/cairomm/context.cc @@ -151,6 +151,7 @@ void Context::set_line_join(LineJoin line_join) check_object_status_and_throw_exception(*this); } +#ifndef CAIROMM_DISABLE_DEPRECATED void Context::set_dash(std::valarray& dashes, double offset) { std::vector v(dashes.size()); @@ -167,6 +168,7 @@ void Context::set_dash(std::vector& dashes, double offset) dashes.size(), offset); check_object_status_and_throw_exception(*this); } +#endif //CAIROMM_DISABLE_DEPRECATED void Context::set_dash(const std::valarray& dashes, double offset) { @@ -251,12 +253,13 @@ void Context::set_identity_matrix() check_object_status_and_throw_exception(*this); } -//deprecated: +#ifndef CAIROMM_DISABLE_DEPRECATED void Context::user_to_device(double& x, double& y) { const Context* constThis = this; constThis->user_to_device(x, y); } +#endif //CAIROMM_DISABLE_DEPRECATED void Context::user_to_device(double& x, double& y) const { @@ -264,12 +267,13 @@ void Context::user_to_device(double& x, double& y) const check_object_status_and_throw_exception(*this); } -//deprecated: +#ifndef CAIROMM_DISABLE_DEPRECATED void Context::user_to_device_distance(double& dx, double& dy) { const Context* constThis = this; constThis->user_to_device_distance(dx, dy); } +#endif //CAIROMM_DISABLE_DEPRECATED void Context::user_to_device_distance(double& dx, double& dy) const { @@ -277,12 +281,13 @@ void Context::user_to_device_distance(double& dx, double& dy) const check_object_status_and_throw_exception(*this); } -//deprecated: +#ifndef CAIROMM_DISABLE_DEPRECATED void Context::device_to_user(double& x, double& y) { const Context* constThis = this; constThis->device_to_user(x, y); } +#endif //CAIROMM_DISABLE_DEPRECATED void Context::device_to_user(double& x, double& y) const { @@ -290,12 +295,13 @@ void Context::device_to_user(double& x, double& y) const check_object_status_and_throw_exception(*this); } -//deprecated: +#ifndef CAIROMM_DISABLE_DEPRECATED void Context::device_to_user_distance(double& dx, double& dy) { const Context* constThis = this; constThis->device_to_user_distance(dx, dy); } +#endif //CAIROMM_DISABLE_DEPRECATED void Context::device_to_user_distance(double& dx, double& dy) const { diff --git a/cairomm/pattern.cc b/cairomm/pattern.cc index 9ce7a26..727bb65 100644 --- a/cairomm/pattern.cc +++ b/cairomm/pattern.cc @@ -173,6 +173,7 @@ SurfacePattern::~SurfacePattern() { } +#ifndef CAIROMM_DISABLE_DEPRECATED void SurfacePattern::set_extend(Extend extend) { Pattern::set_extend(extend); @@ -182,6 +183,7 @@ Extend SurfacePattern::get_extend() const { return Pattern::get_extend(); } +#endif //CAIROMM_DISABLE_DEPRECATED void SurfacePattern::set_filter(Filter filter) { -- cgit v1.2.3