7 #include <X11/extensions/XShm.h>
8 #include <X11/extensions/Xrender.h>
12 typedef struct _Ximage_Info Ximage_Info;
13 typedef struct _Ximage_Image Ximage_Image;
14 typedef struct _Xrender_Surface Xrender_Surface;
25 unsigned char can_do_shm;
26 XRenderPictFormat *fmt32;
27 XRenderPictFormat *fmt24;
28 XRenderPictFormat *fmt8;
29 XRenderPictFormat *fmt4;
30 XRenderPictFormat *fmt1;
31 XRenderPictFormat *fmtdef;
32 unsigned char mul_r, mul_g, mul_b, mul_a;
41 XShmSegmentInfo *shm_info;
46 unsigned char available : 1;
49 struct _Xrender_Surface
54 XRenderPictFormat *fmt;
57 unsigned char alpha : 1;
58 unsigned char allocated : 1;
59 unsigned char bordered : 1;
62 /* ximage support calls (ximage vs xshmimage, cache etc.) */
63 Ximage_Info *_xr_image_info_get(Display *disp, Drawable draw, Visual *vis);
64 void _xr_image_info_free(Ximage_Info *xinf);
65 void _xr_image_info_pool_flush(Ximage_Info *xinf, int max_num, int max_mem);
66 Ximage_Image *_xr_image_new(Ximage_Info *xinf, int w, int h, int depth);
67 void _xr_image_free(Ximage_Image *xim);
68 void _xr_image_put(Ximage_Image *xim, Drawable draw, int x, int y, int w, int h);
70 /* xrender support calls */
71 Xrender_Surface *_xr_render_surface_new(Ximage_Info *xinf, int w, int h, XRenderPictFormat *fmt, int alpha);
72 Xrender_Surface *_xr_render_surface_adopt(Ximage_Info *xinf, Drawable draw, int w, int h, int alpha);
73 Xrender_Surface *_xr_render_surface_format_adopt(Ximage_Info *xinf, Drawable draw, int w, int h, XRenderPictFormat *fmt, int alpha);
74 void _xr_render_surface_free(Xrender_Surface *rs);
75 void _xr_render_surface_repeat_set(Xrender_Surface *rs, int repeat);
76 void _xr_render_surface_solid_rectangle_set(Xrender_Surface *rs, int r, int g, int b, int a, int x, int y, int w, int h);
77 void _xr_render_surface_argb_pixels_fill(Xrender_Surface *rs, int sw, int sh, void *pixels, int x, int y, int w, int h, int ox, int oy);
78 void _xr_render_surface_rgb_pixels_fill(Xrender_Surface *rs, int sw, int sh, void *pixels, int x, int y, int w, int h, int ox, int oy);
79 void _xr_render_surface_clips_set(Xrender_Surface *rs, RGBA_Draw_Context *dc, int rx, int ry, int rw, int rh);
80 void _xr_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Draw_Context *dc, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int smooth);
81 void _xr_render_surface_copy(Xrender_Surface *srs, Xrender_Surface *drs, int sx, int sy, int x, int y, int w, int h);
82 void _xr_render_surface_rectangle_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
83 void _xr_render_surface_line_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
84 void _xre_poly_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
87 typedef struct _XR_Image XR_Image;
98 Xrender_Surface *surface;
103 RGBA_Image_Loadopts load_opts;
107 unsigned char no_free : 1;
109 unsigned char alpha : 1;
110 unsigned char dirty : 1;
111 unsigned char free_data : 1;
114 XR_Image *_xre_image_load(Ximage_Info *xinf, const char *file, const char *key, Evas_Image_Load_Opts *lo);
115 XR_Image *_xre_image_new_from_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
116 XR_Image *_xre_image_new_from_copied_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
117 XR_Image *_xre_image_new(Ximage_Info *xinf, int w, int h);
118 void _xre_image_resize(XR_Image *im, int w, int h);
119 void _xre_image_free(XR_Image *im);
120 void _xre_image_region_dirty(XR_Image *im, int x, int y, int w, int h);
121 void _xre_image_dirty(XR_Image *im);
122 XR_Image *_xre_image_copy(XR_Image *im);
123 void *_xre_image_data_get(XR_Image *im);
124 XR_Image *_xre_image_data_find(void *data);
125 void _xre_image_data_put(XR_Image *im, void *data);
126 void _xre_image_alpha_set(XR_Image *im, int alpha);
127 int _xre_image_alpha_get(XR_Image *im);
128 void _xre_image_border_set(XR_Image *im, int l, int r, int t, int b);
129 void _xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b);
130 void _xre_image_surface_gen(XR_Image *im);
131 void _xre_image_cache_set(int size);
132 int _xre_image_cache_get(void);
134 typedef struct _XR_Font_Surface XR_Font_Surface;
136 struct _XR_Font_Surface
145 XR_Font_Surface *_xre_font_surface_new(Ximage_Info *xinf, RGBA_Font_Glyph *fg);
146 void _xre_font_surface_free(XR_Font_Surface *fs);
147 void _xre_font_surface_draw(Ximage_Info *xinf, RGBA_Image *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
149 typedef struct _XR_Gradient XR_Gradient;
154 Xrender_Surface *surface;
156 unsigned char changed : 1;
160 XR_Gradient *_xre_gradient_new(Ximage_Info *xinf);
161 void _xre_gradient_free(XR_Gradient *gr);
162 void _xre_gradient_color_stop_add(XR_Gradient *gr, int r, int g, int b, int a, int delta);
163 void _xre_gradient_alpha_stop_add(XR_Gradient *gr, int a, int delta);
164 void _xre_gradient_color_data_set(XR_Gradient *gr, void *map, int len, int has_alpha);
165 void _xre_gradient_alpha_data_set(XR_Gradient *gr, void *alpha_map, int len);
166 void _xre_gradient_clear(XR_Gradient *gr);
167 void _xre_gradient_fill_set(XR_Gradient *gr, int x, int y, int w, int h);
168 void _xre_gradient_fill_angle_set(XR_Gradient *gr, double angle);
169 void _xre_gradient_fill_spread_set(XR_Gradient *gr, int spread);
170 void _xre_gradient_angle_set(XR_Gradient *gr, double angle);
171 void _xre_gradient_offset_set(XR_Gradient *gr, float offset);
172 void _xre_gradient_direction_set(XR_Gradient *gr, int direction);
173 void _xre_gradient_type_set(XR_Gradient *gr, char *name, char *params);
174 void _xre_gradient_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h);