aboutsummaryrefslogtreecommitdiff
path: root/include/GtkGif.hpp
blob: 91b3a12ab82ccd009953dc4a24e1c4a74bacbca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
    };
}