[gtkmm/gtkmm-3-24] Gdk::PixbufAnimation[Iter]: Disable warnings from deprecated GTimeVal
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-3-24] Gdk::PixbufAnimation[Iter]: Disable warnings from deprecated GTimeVal
- Date: Mon, 12 Aug 2019 17:04:34 +0000 (UTC)
commit 67c7528b2cb3ee372c749cd2c88a3b0e35bcecd7
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Mon Aug 12 19:02:39 2019 +0200
Gdk::PixbufAnimation[Iter]: Disable warnings from deprecated GTimeVal
GTimeVal has been deprecated in glib. Methods that use GTimeVal or
Glib::TimeVal can't be deprecated in the stable gtkmm-3-24 branch now.
This patch makes it possible to build gtkmm-3.24.x against the newest glib.
gdk/src/pixbufanimation.ccg | 9 +++++++--
gdk/src/pixbufanimation.hg | 10 +++++++++-
gdk/src/pixbufanimationiter.ccg | 9 +++++++--
gdk/src/pixbufanimationiter.hg | 7 ++++++-
4 files changed, 29 insertions(+), 6 deletions(-)
---
diff --git a/gdk/src/pixbufanimation.ccg b/gdk/src/pixbufanimation.ccg
index 55f7c4d9..5d80641b 100644
--- a/gdk/src/pixbufanimation.ccg
+++ b/gdk/src/pixbufanimation.ccg
@@ -30,6 +30,11 @@ Glib::RefPtr<PixbufAnimation> PixbufAnimation::create_from_file(const Glib::ustr
::Glib::Error::throw_exception(gerror);
}
-} //namespace Gdk
-
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+Glib::RefPtr<PixbufAnimationIter> PixbufAnimation::get_iter(const GTimeVal* start_time)
+{
+ return Glib::wrap(gdk_pixbuf_animation_get_iter(gobj(), start_time));
+}
+G_GNUC_END_IGNORE_DEPRECATIONS
+} //namespace Gdk
diff --git a/gdk/src/pixbufanimation.hg b/gdk/src/pixbufanimation.hg
index a62c1e02..4eb5eced 100644
--- a/gdk/src/pixbufanimation.hg
+++ b/gdk/src/pixbufanimation.hg
@@ -49,7 +49,15 @@ public:
_WRAP_METHOD(int get_height() const, gdk_pixbuf_animation_get_height)
_WRAP_METHOD(bool is_static_image() const, gdk_pixbuf_animation_is_static_image)
_WRAP_METHOD(Glib::RefPtr<Pixbuf> get_static_image(), gdk_pixbuf_animation_get_static_image, refreturn)
- _WRAP_METHOD(Glib::RefPtr<PixbufAnimationIter> get_iter(const GTimeVal* start_time),
gdk_pixbuf_animation_get_iter)
+
+ //TODO: GTimeVal is deprecated, but gdk_pixbuf_animation_get_iter() is not deprecated,
+ // and there is not replacement for it.
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+ _WRAP_METHOD_DOCS_ONLY(gdk_pixbuf_animation_get_iter)
+ Glib::RefPtr<PixbufAnimationIter> get_iter(const GTimeVal* start_time);
+ G_GNUC_END_IGNORE_DEPRECATIONS
+ //_WRAP_METHOD(Glib::RefPtr<PixbufAnimationIter> get_iter(const GTimeVal* start_time),
gdk_pixbuf_animation_get_iter,
+ // deprecated "Use ??? instead.")
};
} // namespace Gdk
diff --git a/gdk/src/pixbufanimationiter.ccg b/gdk/src/pixbufanimationiter.ccg
index 90559ea8..e03ff36c 100644
--- a/gdk/src/pixbufanimationiter.ccg
+++ b/gdk/src/pixbufanimationiter.ccg
@@ -24,6 +24,11 @@ bool PixbufAnimationIter::advance()
return gdk_pixbuf_animation_iter_advance(gobj(), nullptr);
}
-} //namespace Gdk
-
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+bool PixbufAnimationIter::advance(const Glib::TimeVal& current_time)
+{
+ return gdk_pixbuf_animation_iter_advance(gobj(), static_cast<const GTimeVal*>(¤t_time));
+}
+G_GNUC_END_IGNORE_DEPRECATIONS
+} //namespace Gdk
diff --git a/gdk/src/pixbufanimationiter.hg b/gdk/src/pixbufanimationiter.hg
index 39b439da..1d38c048 100644
--- a/gdk/src/pixbufanimationiter.hg
+++ b/gdk/src/pixbufanimationiter.hg
@@ -46,8 +46,13 @@ public:
_WRAP_METHOD(bool on_currently_loading_frame() const, gdk_pixbuf_animation_iter_on_currently_loading_frame)
+ //TODO: GTimeVal is deprecated, but gdk_pixbuf_animation_iter_advance() is not deprecated,
+ // and there is not replacement for it.
+ _WRAP_METHOD_DOCS_ONLY(gdk_pixbuf_animation_iter_advance)
+ bool advance(const Glib::TimeVal& current_time);
#m4 _CONVERSION(`const Glib::TimeVal&', `const GTimeVal*', static_cast<$2>(&$3))
- _WRAP_METHOD(bool advance(const Glib::TimeVal& current_time), gdk_pixbuf_animation_iter_advance)
+ //_WRAP_METHOD(bool advance(const Glib::TimeVal& current_time), gdk_pixbuf_animation_iter_advance,
+ // deprecated "Use ??? instead.")
/** Possibly advances an animation to a new frame. Chooses the frame based
* on the start time passed to Gdk::PixbufAnimation::get_iter().
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]