~ubuntu-branches/ubuntu/trusty/compiz/trusty

« back to all changes in this revision

Viewing changes to plugins/imgsvg/src/imgsvg.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-08-22 06:58:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3352.
  • Revision ID: package-import@ubuntu.com-20130822065807-17nlzez0d30y09so
Tags: upstream-0.9.10+13.10.20130822
ImportĀ upstreamĀ versionĀ 0.9.10+13.10.20130822

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    public ImgsvgOptions
59
59
{
60
60
    public:
 
61
 
61
62
        SvgScreen (CompScreen *screen);
62
63
        ~SvgScreen ();
63
64
 
64
 
        bool fileToImage (CompString &path, CompSize &size,
65
 
                          int &stride, void *&data);
66
 
        void handleCompizEvent (const char *plugin, const char *event,
 
65
        bool fileToImage (CompString &path,
 
66
                          CompSize   &size,
 
67
                          int        &stride,
 
68
                          void       *&data);
 
69
 
 
70
        void handleCompizEvent (const char         *plugin,
 
71
                                const char         *event,
67
72
                                CompOption::Vector &options);
68
73
 
69
74
        CompRect zoom;
70
75
 
71
76
    private:
72
 
        bool readSvgToImage (const char *file, CompSize &size, void *& data);
 
77
 
 
78
        bool readSvgToImage (const char *file,
 
79
                             CompSize   &size,
 
80
                             void       *&data);
73
81
};
74
82
 
75
83
class SvgWindow :
78
86
    public PluginClassHandler<SvgWindow, CompWindow>
79
87
{
80
88
    public:
 
89
 
81
90
        SvgWindow (CompWindow *window);
82
91
        ~SvgWindow ();
83
92
 
84
 
        bool glDraw (const GLMatrix &transform,
 
93
        bool glDraw (const GLMatrix            &transform,
85
94
                     const GLWindowPaintAttrib &attrib,
86
 
                     const CompRegion &region, unsigned int mask);
87
 
        void moveNotify (int dx, int dy, bool immediate);
88
 
        void resizeNotify (int dx, int dy, int dwidth, int dheight);
89
 
 
90
 
        void setSvg (CompString &data, decor_point_t p[2]);
 
95
                     const CompRegion          &region,
 
96
                     unsigned int              mask);
 
97
 
 
98
        void moveNotify (int  dx,
 
99
                         int  dy,
 
100
                         bool immediate);
 
101
 
 
102
        void resizeNotify (int dx,
 
103
                           int dy,
 
104
                           int dwidth,
 
105
                           int dheight);
 
106
 
 
107
        void setSvg (CompString    &data,
 
108
                     decor_point_t p[2]);
91
109
 
92
110
    private:
93
 
        typedef struct {
94
 
            decor_point_t p1;
95
 
            decor_point_t p2;
 
111
        typedef struct
 
112
        {
 
113
            decor_point_t     p1;
 
114
            decor_point_t     p2;
96
115
 
97
 
            RsvgHandle        *svg;
 
116
            RsvgHandle        *svg;
98
117
            RsvgDimensionData dimension;
99
118
        } SvgSource;
100
119
 
101
 
        typedef struct {
 
120
        typedef struct
 
121
        {
102
122
            GLTexture::List       textures;
103
123
            GLTexture::MatrixList matrices;
104
 
            cairo_t           *cr;
105
 
            Pixmap            pixmap;
106
 
            CompSize          size;
 
124
            cairo_t               *cr;
 
125
            Pixmap                pixmap;
 
126
            CompSize              size;
107
127
        } SvgTexture;
108
128
 
109
 
        typedef struct {
 
129
        typedef struct
 
130
        {
110
131
            SvgSource  *source;
111
132
            CompRegion box;
112
133
            SvgTexture texture[2];
126
147
        void updateSvgMatrix ();
127
148
        void updateSvgContext ();
128
149
 
129
 
        void renderSvg (SvgSource *source, SvgTexture &texture, CompSize size,
130
 
                        float x1, float y1, float x2, float y2);
131
 
        bool initTexture (SvgSource *source, SvgTexture &texture, CompSize size);
 
150
        void renderSvg (SvgSource  *source,
 
151
                        SvgTexture &texture,
 
152
                        CompSize   size,
 
153
                        float      x1,
 
154
                        float      y1,
 
155
                        float      x2,
 
156
                        float      y2);
 
157
 
 
158
        bool initTexture (SvgSource *source,
 
159
                          SvgTexture &texture,
 
160
                          CompSize size);
 
161
 
132
162
        void finiTexture (SvgTexture &texture);
133
163
};
134
164