1 #ifndef EVAS_CAIRO_COMMON_H
2 #define EVAS_CAIRO_COMMON_H
4 #include "evas_common.h"
16 #include <X11/Xatom.h>
17 #include <X11/Xutil.h>
20 #include <cairo-xlib.h>
22 typedef struct _Evas_Cairo_Context Evas_Cairo_Context;
23 typedef struct _Evas_Cairo_Image Evas_Cairo_Image;
24 typedef struct _Evas_Cairo_Polygon Evas_Cairo_Polygon;
25 typedef struct _Evas_Cairo_Polygon_Point Evas_Cairo_Polygon_Point;
26 typedef struct _Evas_Cairo_Gradient Evas_Cairo_Gradient;
28 struct _Evas_Cairo_Context
41 struct _Evas_Cairo_Image
46 cairo_surface_t *surface;
47 cairo_pattern_t *pattern;
49 Evas_Cairo_Context *cc;
55 struct _Evas_Cairo_Polygon
60 struct _Evas_Cairo_Polygon_Point
66 struct _Evas_Cairo_Context
68 unsigned char r, g, b, a;
88 int sgis_generate_mipmap : 1;
89 int nv_texture_rectangle : 1;
97 struct _Evas_Cairo_Image
99 Evas_Cairo_Context *cc;
101 cairo_surface_t *surf;
108 struct _Evas_Cairo_Polygon
113 struct _Evas_Cairo_Polygon_Point
118 struct _Evas_Cairo_Gradient
125 Evas_GL_Context *evas_gl_common_context_new(void);
126 void evas_gl_common_context_free(Evas_GL_Context *gc);
127 void evas_gl_common_context_use(Evas_GL_Context *gc);
128 void evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h);
129 void evas_gl_common_context_color_set(Evas_GL_Context *gc, int r, int g, int b, int a);
130 void evas_gl_common_context_blend_set(Evas_GL_Context *gc, int blend);
131 void evas_gl_common_context_dither_set(Evas_GL_Context *gc, int dither);
132 void evas_gl_common_context_texture_set(Evas_GL_Context *gc, Evas_GL_Texture *tex, int smooth, int w, int h);
133 void evas_gl_common_context_font_texture_set(Evas_GL_Context *gc, Evas_GL_Font_Texture *ft);
134 void evas_gl_common_context_clip_set(Evas_GL_Context *gc, int on, int x, int y, int w, int h);
135 void evas_gl_common_context_read_buf_set(Evas_GL_Context *gc, GLenum buf);
136 void evas_gl_common_context_write_buf_set(Evas_GL_Context *gc, GLenum buf);
138 Evas_GL_Texture *evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im, int smooth);
139 void evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im, int smooth);
140 void evas_gl_common_texture_free(Evas_GL_Texture *tex);
141 void evas_gl_common_texture_mipmaps_build(Evas_GL_Texture *tex, RGBA_Image *im, int smooth);
143 Evas_GL_Image *evas_gl_common_image_load(Evas_GL_Context *gc, char *file, char *key);
144 Evas_GL_Image *evas_gl_common_image_new_from_data(Evas_GL_Context *gc, int w, int h, int *data);
145 Evas_GL_Image *evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc, int w, int h, int *data);
146 Evas_GL_Image *evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h);
147 void evas_gl_common_image_free(Evas_GL_Image *im);
148 void evas_gl_common_image_dirty(Evas_GL_Image *im);
150 Evas_GL_Polygon *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
151 Evas_GL_Polygon *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
153 Evas_GL_Gradient *evas_gl_common_gradient_color_add(Evas_GL_Gradient *gr, int r, int g, int b, int a, int distance);
154 Evas_GL_Gradient *evas_gl_common_gradient_colors_clear(Evas_GL_Gradient *gr);
156 void evas_gl_common_swap_rect(Evas_GL_Context *gc, int x, int y, int w, int h);
158 void evas_gl_common_rect_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x, int y, int w, int h);
159 void evas_gl_common_image_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
160 void evas_gl_common_line_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
161 void evas_gl_common_poly_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Polygon *poly);
162 void evas_gl_common_gradient_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Gradient *gr, int x, int y, int w, int h, double angle);
164 Evas_GL_Font_Texture *evas_gl_font_texture_new(Evas_GL_Context *gc, RGBA_Font_Glyph *fg);
165 void evas_gl_font_texture_free(Evas_GL_Font_Texture *ft);
166 void evas_gl_font_texture_draw(Evas_GL_Context *gc, void *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);