[gtkmm] Gdk::PixbufAnimation: Add some create_from_*() methods



commit a913158fb5dd9c2d35f7a6889a8d8524905cb748
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Jul 22 18:33:24 2021 +0200

    Gdk::PixbufAnimation: Add some create_from_*() methods
    
    Add Gdk::PixbufAnimation::create_from_stream(), create_from_stream_async(),
    create_from_stream_finish(), create_from_resource().

 gdk/src/pixbufanimation.ccg |  1 +
 gdk/src/pixbufanimation.hg  | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/gdk/src/pixbufanimation.ccg b/gdk/src/pixbufanimation.ccg
index 158b1c4d..35ad63af 100644
--- a/gdk/src/pixbufanimation.ccg
+++ b/gdk/src/pixbufanimation.ccg
@@ -16,6 +16,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <giomm/slot_async.h>
 #include <gdk/gdk.h>
 
 namespace Gdk
diff --git a/gdk/src/pixbufanimation.hg b/gdk/src/pixbufanimation.hg
index e555ce7f..99a0dac4 100644
--- a/gdk/src/pixbufanimation.hg
+++ b/gdk/src/pixbufanimation.hg
@@ -17,6 +17,7 @@
  */
 
 #include <glibmm/object.h>
+#include <giomm/asyncresult.h>
 #include <gdkmm/pixbuf.h>
 #include <gdkmm/pixbufanimationiter.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
@@ -42,9 +43,18 @@ class GDKMM_API PixbufAnimation : public Glib::Object
 protected:
 
 public:
-
   _WRAP_METHOD(static Glib::RefPtr<PixbufAnimation> create_from_file(const std::string& filename),
     gdk_pixbuf_animation_new_from_file, errthrow)
+  _WRAP_METHOD(static Glib::RefPtr<PixbufAnimation> create_from_stream(
+    const Glib::RefPtr<Gio::InputStream>& stream, const Glib::RefPtr<Gio::Cancellable>& cancellable = {}),
+    gdk_pixbuf_animation_new_from_stream, errthrow, newin "4,4")
+  _WRAP_METHOD(static void create_from_stream_async(const Glib::RefPtr<Gio::InputStream>& stream,
+    const Gio::SlotAsyncReady& slot{callback}, const Glib::RefPtr<Gio::Cancellable>& cancellable{.} = {}),
+    gdk_pixbuf_animation_new_from_stream_async, slot_name slot, slot_callback 
Gio::SignalProxy_async_callback, newin "4,4")
+  _WRAP_METHOD(static Glib::RefPtr<PixbufAnimation> create_from_stream_finish(const 
Glib::RefPtr<Gio::AsyncResult>& result),
+    gdk_pixbuf_animation_new_from_stream_finish, errthrow, newin "4,4")
+  _WRAP_METHOD(static Glib::RefPtr<PixbufAnimation> create_from_resource(const std::string& resource_path),
+    gdk_pixbuf_animation_new_from_resource, errthrow, newin "4,4")
 
   _WRAP_METHOD(int get_width() const, gdk_pixbuf_animation_get_width)
   _WRAP_METHOD(int get_height() const, gdk_pixbuf_animation_get_height)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]