1 21 package org.eclipse.swt.internal.cairo; 22 23 import org.eclipse.swt.internal.Library; 24 25 public class Cairo { 26 static { 27 Library.loadLibrary("swt-cairo"); 28 } 29 30 31 public static final int CAIRO_FORMAT_ARGB32 = 0; 32 public static final int CAIRO_FORMAT_RGB24 = 1; 33 public static final int CAIRO_FORMAT_A8 = 2; 34 public static final int CAIRO_FORMAT_A1 = 3; 35 public static final int CAIRO_OPERATOR_CLEAR = 0; 36 public static final int CAIRO_OPERATOR_SRC = 1; 37 public static final int CAIRO_OPERATOR_DST = 2; 38 public static final int CAIRO_OPERATOR_OVER = 3; 39 public static final int CAIRO_OPERATOR_OVER_REVERSE = 4; 40 public static final int CAIRO_OPERATOR_IN = 5; 41 public static final int CAIRO_OPERATOR_IN_REVERSE = 6; 42 public static final int CAIRO_OPERATOR_OUT = 7; 43 public static final int CAIRO_OPERATOR_OUT_REVERSE = 8; 44 public static final int CAIRO_OPERATOR_ATOP = 9; 45 public static final int CAIRO_OPERATOR_ATOP_REVERSE = 10; 46 public static final int CAIRO_OPERATOR_XOR = 11; 47 public static final int CAIRO_OPERATOR_ADD = 12; 48 public static final int CAIRO_OPERATOR_SATURATE = 13; 49 public static final int CAIRO_FILL_RULE_WINDING = 0; 50 public static final int CAIRO_FILL_RULE_EVEN_ODD = 1; 51 public static final int CAIRO_LINE_CAP_BUTT = 0; 52 public static final int CAIRO_LINE_CAP_ROUND = 1; 53 public static final int CAIRO_LINE_CAP_SQUARE = 2; 54 public static final int CAIRO_LINE_JOIN_MITER = 0; 55 public static final int CAIRO_LINE_JOIN_ROUND = 1; 56 public static final int CAIRO_LINE_JOIN_BEVEL = 2; 57 public static final int CAIRO_FONT_SLANT_NORMAL = 0; 58 public static final int CAIRO_FONT_SLANT_ITALIC = 1; 59 public static final int CAIRO_FONT_SLANT_OBLIQUE = 2; 60 public static final int CAIRO_FONT_WEIGHT_NORMAL = 0; 61 public static final int CAIRO_FONT_WEIGHT_BOLD = 1; 62 public static final int CAIRO_STATUS_SUCCESS = 0; 63 public static final int CAIRO_STATUS_NO_MEMORY = 1; 64 public static final int CAIRO_STATUS_INVALID_RESTORE = 2; 65 public static final int CAIRO_STATUS_INVALID_POP_GROUP = 3; 66 public static final int CAIRO_STATUS_NO_CURRENT_POINT = 4; 67 public static final int CAIRO_STATUS_INVALID_MATRIX = 5; 68 public static final int CAIRO_STATUS_NO_TARGET_SURFACE = 6; 69 public static final int CAIRO_STATUS_NULL_POINTER =7; 70 public static final int CAIRO_FILTER_FAST = 0; 71 public static final int CAIRO_FILTER_GOOD = 1; 72 public static final int CAIRO_FILTER_BEST = 2; 73 public static final int CAIRO_FILTER_NEAREST = 3; 74 public static final int CAIRO_FILTER_BILINEAR = 4; 75 public static final int CAIRO_FILTER_GAUSSIAN = 5; 76 public static final int CAIRO_EXTEND_NONE = 0; 77 public static final int CAIRO_EXTEND_REPEAT = 1; 78 public static final int CAIRO_EXTEND_REFLECT = 2; 79 public static final int CAIRO_PATH_MOVE_TO = 0; 80 public static final int CAIRO_PATH_LINE_TO = 1; 81 public static final int CAIRO_PATH_CURVE_TO = 2; 82 public static final int CAIRO_PATH_CLOSE_PATH = 3; 83 84 85 public static final synchronized native int cairo_font_extents_t_sizeof (); 86 public static final synchronized native int cairo_path_data_t_sizeof (); 87 public static final synchronized native int cairo_path_t_sizeof (); 88 89 90 public static final synchronized native int cairo_create (int target); 91 public static final synchronized native void cairo_reference (int cr); 92 public static final synchronized native void cairo_destroy (int cr); 93 public static final synchronized native void cairo_save (int cr); 94 public static final synchronized native void cairo_restore (int cr); 95 public static final synchronized native void cairo_set_operator (int cr, int op); 96 public static final synchronized native void cairo_set_source_rgb(int cr, double red, double green, double blue); 97 public static final synchronized native void cairo_set_source_rgba(int cr, double red, double green, double blue, double alpha); 98 public static final synchronized native void cairo_set_source(int cr, int source); 99 public static final synchronized native void cairo_set_source_surface(int cr, int surface, double x, double y); 100 public static final synchronized native void cairo_set_tolerance (int cr, double tolerance); 101 public static final synchronized native void cairo_set_fill_rule (int cr, int fill_rule); 102 public static final synchronized native void cairo_set_line_width (int cr, double width); 103 public static final synchronized native void cairo_set_line_cap (int cr, int line_cap); 104 public static final synchronized native void cairo_set_line_join (int cr, int line_join); 105 public static final synchronized native void cairo_set_dash (int cr, double[] dashes, int ndash, double offset); 106 public static final synchronized native void cairo_set_miter_limit (int cr, double limit); 107 public static final synchronized native void cairo_translate (int cr, double tx, double ty); 108 public static final synchronized native void cairo_scale (int cr, double sx, double sy); 109 public static final synchronized native void cairo_rotate (int cr, double angle); 110 public static final synchronized native void cairo_transform (int cr, double[] matrix); 111 public static final synchronized native void cairo_set_matrix (int cr, double[] matrix); 112 public static final synchronized native void cairo_identity_matrix (int cr); 113 public static final synchronized native void cairo_user_to_device (int cr, double[] x, double[] y); 114 public static final synchronized native void cairo_user_to_device_distance (int cr, double[] dx, double[] dy); 115 public static final synchronized native void cairo_device_to_user (int cr, double[] x, double[] y); 116 public static final synchronized native void cairo_device_to_user_distance (int cr, double[] dx, double[] dy); 117 public static final synchronized native void cairo_new_path (int cr); 118 public static final synchronized native void cairo_move_to (int cr, double x, double y); 119 public static final synchronized native void cairo_line_to (int cr, double x, double y); 120 public static final synchronized native void cairo_curve_to (int cr, double x1, double y1, double x2, double y2, double x3, double y3); 121 public static final synchronized native void cairo_arc (int cr, double xc, double yc, double radius, double angle1, double angle2); 122 public static final synchronized native void cairo_arc_negative (int cr, double xc, double yc, double radius, double angle1, double angle2); 123 public static final synchronized native void cairo_rel_move_to (int cr, double dx, double dy); 125 public static final synchronized native void cairo_rel_line_to (int cr, double dx, double dy); 126 public static final synchronized native void cairo_rel_curve_to (int cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); 127 public static final synchronized native void cairo_rectangle (int cr, double x, double y, double width, double height); 128 public static final synchronized native void cairo_close_path (int cr); 129 public static final synchronized native void cairo_paint (int cr); 130 public static final synchronized native void cairo_paint_with_alpha (int cr, double alpha); 131 public static final synchronized native void cairo_mask (int cr, int pattern); 132 public static final synchronized native void cairo_mask_surface (int cr, int surface, double surface_x, double surface_y); 133 public static final synchronized native void cairo_stroke (int cr); 134 public static final synchronized native void cairo_stroke_preserve (int cr); 135 public static final synchronized native void cairo_fill (int cr); 136 public static final synchronized native void cairo_fill_preserve (int cr); 137 public static final synchronized native void cairo_copy_page (int cr); 138 public static final synchronized native void cairo_show_page (int cr); 139 public static final synchronized native int cairo_in_stroke (int cr, double x, double y); 140 public static final synchronized native int cairo_in_fill (int cr, double x, double y); 141 public static final synchronized native void cairo_stroke_extents (int cr, double[] x1, double[] y1, double[] x2, double[] y2); 142 public static final synchronized native void cairo_fill_extents (int cr, double[] x1, double[] y1, double[] x2, double[] y2); 143 public static final synchronized native void cairo_clip (int cr); 144 public static final synchronized native void cairo_clip_preserve (int cr); 145 public static final synchronized native void cairo_reset_clip (int cr); 146 public static final synchronized native void cairo_select_font_face (int cr, byte[] family, int slant, int weight); 147 public static final synchronized native void cairo_set_font_size (int cr, double size); 148 public static final synchronized native void cairo_set_font_matrix (int cr, double[] matrix); 149 public static final synchronized native void cairo_get_font_matrix (int cr, double[] matrix); 150 public static final synchronized native void cairo_show_text (int cr, byte[] utf8); 151 public static final synchronized native void cairo_show_glyphs (int cr, int glyphs, int num_glyphs); 152 public static final synchronized native int cairo_get_font_face (int cr); 153 public static final synchronized native void cairo_font_extents (int cr, cairo_font_extents_t extents); 154 public static final synchronized native void cairo_set_font_face (int cr, int font_face); 155 public static final synchronized native void cairo_text_extents (int cr, byte[] utf8, int extents); 156 public static final synchronized native void cairo_glyph_extents (int cr, int glyphs, int num_glyphs, int extents); 157 public static final synchronized native void cairo_text_path (int cr, byte[] utf8); 158 public static final synchronized native void cairo_glyph_path (int cr, int glyphs, int num_glyphs); 159 public static final synchronized native int cairo_get_operator (int cr); 160 public static final synchronized native int cairo_get_source (int cr); 161 public static final synchronized native double cairo_get_tolerance (int cr); 162 public static final synchronized native void cairo_get_current_point (int cr, double[] x, double[] y); 163 public static final synchronized native int cairo_get_fill_rule (int cr); 164 public static final synchronized native double cairo_get_line_width (int cr); 165 public static final synchronized native int cairo_get_line_cap (int cr); 166 public static final synchronized native int cairo_get_line_join (int cr); 167 public static final synchronized native double cairo_get_miter_limit (int cr); 168 public static final synchronized native void cairo_get_matrix (int cr, double[] matrix); 169 public static final synchronized native int cairo_get_target (int cr); 170 public static final synchronized native int cairo_copy_path (int cr); 171 public static final synchronized native int cairo_copy_path_flat (int cr); 172 public static final synchronized native void cairo_append_path (int cr, int path); 173 public static final synchronized native void cairo_path_destroy (int path); 174 public static final synchronized native int cairo_status (int cr); 175 public static final synchronized native int cairo_status_to_string (int status); 176 public static final synchronized native int cairo_image_surface_create (int format, int width, int height); 177 public static final synchronized native int cairo_image_surface_create_for_data (int data, int format, int width, int height, int stride); 178 public static final synchronized native int cairo_image_surface_get_width (int surface); 179 public static final synchronized native int cairo_image_surface_get_height (int surface); 180 public static final synchronized native int cairo_surface_create_similar (int other, int format, int width, int height); 181 public static final synchronized native void cairo_surface_reference (int surface); 182 public static final synchronized native void cairo_surface_destroy (int surface); 183 public static final synchronized native int cairo_surface_finish (int surface); 184 public static final synchronized native int cairo_surface_set_user_data (int surface, int key, int user_data, int destroy); 185 public static final synchronized native int cairo_surface_get_user_data (int surface, int key); 186 public static final synchronized native void cairo_surface_set_device_offset (int surface, double x_offset, double y_offset); 187 public static final synchronized native int cairo_pattern_create_for_surface (int surface); 188 public static final synchronized native int cairo_pattern_create_linear (double x0, double y0, double x1, double y1); 189 public static final synchronized native int cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1); 190 public static final synchronized native void cairo_pattern_reference (int pattern); 191 public static final synchronized native void cairo_pattern_destroy (int pattern); 192 public static final synchronized native void cairo_pattern_add_color_stop_rgb (int pattern, double offset, double red, double green, double blue); 193 public static final synchronized native void cairo_pattern_add_color_stop_rgba (int pattern, double offset, double red, double green, double blue, double alpha); 194 public static final synchronized native void cairo_pattern_set_matrix (int pattern, double[] matrix); 195 public static final synchronized native void cairo_pattern_get_matrix (int pattern, double[] matrix); 196 public static final synchronized native void cairo_pattern_set_extend (int pattern, int extend); 197 public static final synchronized native int cairo_pattern_get_extend (int pattern); 198 public static final synchronized native void cairo_pattern_set_filter (int pattern, int filter); 199 public static final synchronized native int cairo_pattern_get_filter (int pattern); 200 public static final synchronized native void cairo_matrix_init (double[] matrix, double xx, double yx, double xy, double yy, double x0, double y0); 201 public static final synchronized native void cairo_matrix_init_identity (double[] matrix); 202 public static final synchronized native void cairo_matrix_init_translate (double[] matrix, double tx, double ty); 203 public static final synchronized native void cairo_matrix_init_scale (double[] matrix, double sx, double sy); 204 public static final synchronized native void cairo_matrix_init_rotate (double[] matrix, double radians); 205 public static final synchronized native void cairo_matrix_translate (double[] matrix, double tx, double ty); 206 public static final synchronized native void cairo_matrix_scale (double[] matrix, double sx, double sy); 207 public static final synchronized native void cairo_matrix_rotate (double[] matrix, double radians); 208 public static final synchronized native int cairo_matrix_invert (double[] matrix); 209 public static final synchronized native void cairo_matrix_multiply (double[] result, double[] a, double[] b); 210 public static final synchronized native void cairo_matrix_transform_distance (double[] matrix, double[] dx, double[] dy); 211 public static final synchronized native void cairo_matrix_transform_point (double[] matrix, double[] x, double[] y); 212 public static final synchronized native int cairo_xlib_surface_create (int dpy, int drawable, int visual, int width, int height); 213 public static final synchronized native int cairo_xlib_surface_create_for_bitmap (int dpy, int pixmap, int width, int height); 214 public static final synchronized native void cairo_xlib_surface_set_size (int surface, int width, int height); 215 public static final native void memmove(cairo_path_t dest, int src, int size); 216 public static final native void memmove(cairo_path_data_t dest, int src, int size); 217 public static final native void memmove(double[] dest, int src, int size); 218 219 } 220 | Popular Tags |