aboutsummaryrefslogtreecommitdiff
path: root/include/GtkGif.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-10-31 18:12:49 +0100
committerdec05eba <dec05eba@protonmail.com>2018-10-31 18:12:53 +0100
commita535703add6bf29878845cb270997514489cfc16 (patch)
tree6816c8749c0dde59cc936cdc274307b0561bac27 /include/GtkGif.hpp
parent687796532d80fc6a0ae8327eec8f901002bdc0dd (diff)
Start with images/gif, resize chat input
Diffstat (limited to 'include/GtkGif.hpp')
-rw-r--r--include/GtkGif.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/GtkGif.hpp b/include/GtkGif.hpp
new file mode 100644
index 0000000..91b3a12
--- /dev/null
+++ b/include/GtkGif.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <dchat/Gif.hpp>
+#include <gtkmm/drawingarea.h>
+#include <gdkmm/pixbuf.h>
+
+namespace dchat
+{
+ class GtkGif : public Gif, public Gtk::DrawingArea
+ {
+ public:
+ GtkGif(StringView fileContent);
+ virtual ~GtkGif(){}
+ protected:
+ // Return false if texture creation failed
+ bool createTexture(int width, int height) override;
+ // Size of texture data is same as the size that the texture was created with (also same size returned by @getSize function)
+ void updateTexture(void *textureData) override;
+ private:
+ bool on_draw(const Cairo::RefPtr<Cairo::Context> &cairo) override;
+ private:
+ Cairo::RefPtr<Cairo::ImageSurface> surface;
+ };
+} \ No newline at end of file