Back to index

texmacs  1.0.7.15
tm_cairo.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : tm_cairo.hpp
00004 * DESCRIPTION: Interface with Cairo
00005 * COPYRIGHT  : (C) 2008 Massimiliano Gubinelli
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef TM_CAIRO_H
00013 #define TM_CAIRO_H
00014 //#include "tree.hpp"
00015 
00016 bool tm_cairo_initialize ();
00017 bool tm_cairo_present ();
00018 
00019 
00020 #ifdef USE_CAIRO
00021 #include <cairo.h>
00022 #ifdef CAIRO_HAS_FT_FONT
00023 #include <cairo-ft.h>
00024 #endif
00025 #ifdef CAIRO_HAS_PS_SURFACE
00026 #include <cairo-ps.h>
00027 #endif
00028 #ifdef CAIRO_HAS_XLIB_SURFACE
00029 #include <cairo-xlib.h>
00030 #undef KeyPress  // conflict between QEvent::KeyPrees and X11 defintion
00031 #endif
00032 #ifdef CAIRO_HAS_QUARTZ_SURFACE
00033 #define ID OTHER_ID
00034 // conflicts with X11 headers
00035 #undef Status
00036 #define Cursor OTHER_Cursor
00037 #include <cairo-quartz.h>
00038 #undef ID
00039 #undef Cursor
00040 #endif
00041 
00042 extern void (*tm_cairo_move_to) (cairo_t *cr, double x, double y);
00043 extern void (*tm_cairo_show_glyphs) (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs);
00044 extern cairo_status_t (*tm_cairo_font_face_status) (cairo_font_face_t *font_face);
00045 extern void (*tm_cairo_set_source_surface) (cairo_t *cr, cairo_surface_t *surface, double x, double y);
00046 extern void (*tm_cairo_new_path) (cairo_t *cr);
00047 extern void (*tm_cairo_stroke) (cairo_t *cr);
00048 extern cairo_status_t (*tm_cairo_font_face_set_user_data) (cairo_font_face_t *font_face, const cairo_user_data_key_t *key, void *user_data, cairo_destroy_func_t destroy);
00049 extern void (*tm_cairo_set_antialias) (cairo_t *cr, cairo_antialias_t antialias);
00050 extern void (*tm_cairo_set_font_size) (cairo_t *cr, double size);
00051 extern void (*tm_cairo_fill) (cairo_t *cr);
00052 extern void (*tm_cairo_set_source_rgba) (cairo_t *cr, double red, double green, double blue, double alpha);
00053 extern const char * (*tm_cairo_status_to_string) (cairo_status_t status);
00054 extern void (*tm_cairo_set_source_rgb) (cairo_t *cr, double red, double green, double blue);
00055 extern void (*tm_cairo_close_path) (cairo_t *cr);
00056 extern void (*tm_cairo_restore) (cairo_t *cr);
00057 extern void (*tm_cairo_translate) (cairo_t *cr, double tx, double ty);
00058 extern void (*tm_cairo_set_font_face) (cairo_t *cr, cairo_font_face_t *font_face);
00059 extern void (*tm_cairo_font_face_destroy) (cairo_font_face_t *font_face);
00060 extern void (*tm_cairo_set_line_width) (cairo_t *cr, double width);
00061 extern cairo_surface_t * (*tm_cairo_image_surface_create_from_png) (const char *filename);
00062 extern int (*tm_cairo_image_surface_get_width) (cairo_surface_t *surface);
00063 extern void (*tm_cairo_scale) (cairo_t *cr, double sx, double sy);
00064 extern void (*tm_cairo_mask) (cairo_t *cr, cairo_pattern_t *pattern);
00065 extern void (*tm_cairo_set_operator) (cairo_t *cr, cairo_operator_t op);
00066 extern cairo_surface_t * (*tm_cairo_image_surface_create) (cairo_format_t format, int width, int height);
00067 extern void (*tm_cairo_paint) (cairo_t *cr);
00068 extern void (*tm_cairo_rectangle) (cairo_t *cr, double x, double y, double width, double height);
00069 extern void (*tm_cairo_set_line_cap) (cairo_t *cr, cairo_line_cap_t line_cap);
00070 extern void (*tm_cairo_set_line_join) (cairo_t *cr, cairo_line_join_t line_join);
00071 extern cairo_surface_t * (*tm_cairo_surface_reference) (cairo_surface_t *surface);
00072 extern void (*tm_cairo_line_to) (cairo_t *cr, double x, double y);
00073 extern cairo_status_t (*tm_cairo_status) (cairo_t *cr);
00074 extern void (*tm_cairo_show_page) (cairo_t *cr);
00075 extern cairo_t * (*tm_cairo_reference) (cairo_t *cr);
00076 extern cairo_t * (*tm_cairo_create) (cairo_surface_t *target);
00077 extern void (*tm_cairo_surface_destroy) (cairo_surface_t *surface);
00078 extern void (*tm_cairo_set_fill_rule) (cairo_t *cr, cairo_fill_rule_t fill_rule);
00079 extern void (*tm_cairo_destroy) (cairo_t *cr);
00080 extern void (*tm_cairo_save) (cairo_t *cr);
00081 extern void (*tm_cairo_set_source) (cairo_t *cr, cairo_pattern_t *source);
00082 extern int (*tm_cairo_image_surface_get_height) (cairo_surface_t *surface);
00083 extern void (*tm_cairo_mask_surface) (cairo_t *cr, cairo_surface_t *surface, double surface_x, double surface_y);
00084 
00085 #ifdef CAIRO_HAS_FT_FONT
00086 extern cairo_font_face_t * (*tm_cairo_ft_font_face_create_for_ft_face) (FT_Face face, int load_flags);
00087 #endif
00088 
00089 #ifdef CAIRO_HAS_PS_SURFACE
00090 extern cairo_surface_t * (*tm_cairo_ps_surface_create) (const char *filename, double width_in_points, double height_in_points);
00091 #endif
00092 
00093 #ifdef CAIRO_HAS_XLIB_SURFACE
00094 extern cairo_surface_t * (*tm_cairo_xlib_surface_create) (Display *dpy, Drawable    drawable, Visual *visual, int width, int height);
00095 #endif
00096 
00097 #ifdef CAIRO_HAS_QUARTZ_SURFACE
00098 extern  cairo_surface_t * (*tm_cairo_quartz_surface_create_for_cg_context) (CGContextRef cgContext, unsigned int width, unsigned int height);
00099 #endif
00100 
00101 #endif
00102 
00103 #endif // TM_CAIRO_H