Changeset 502
- Timestamp:
- 06/22/08 12:20:39 (3 months ago)
- Files:
-
- trunk/src/cairo/Context.d (modified) (7 diffs)
- trunk/src/cairo/ImageSurface.d (modified) (3 diffs)
- trunk/src/gtkc/cairotypes.d (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cairo/Context.d
r499 r502 48 48 * - cairo.ScaledFont 49 49 * - cairo.Surface 50 * - cairo.Pattern 50 51 * - glib.Str 51 52 * - gdk.Region … … 60 61 * - cairo_font_options_t* -> FontOption 61 62 * - cairo_matrix_t* -> Matrix 63 * - cairo_pattern_t* -> Pattern 62 64 * - cairo_scaled_font_t* -> ScaledFont 63 65 * - cairo_surface_t* -> Surface … … 80 82 private import cairo.ScaledFont; 81 83 private import cairo.Surface; 84 private import cairo.Pattern; 82 85 private import glib.Str; 83 86 private import gdk.Region; … … 436 439 * Returns: a newly created (surface) pattern containing theresults of all drawing operations performed to the group. Thecaller owns the returned object and should callcairo_pattern_destroy() when finished with it. 437 440 */ 438 public cairo_pattern_t*popGroup()441 public Pattern popGroup() 439 442 { 440 443 // cairo_pattern_t* cairo_pop_group (cairo_t *cr); 441 return cairo_pop_group(cairo); 444 auto p = cairo_pop_group(cairo); 445 if(p is null) 446 { 447 version(Exceptions) throw new Exception("Null GObject from GTK+."); 448 else return null; 449 } 450 return new Pattern(cast(cairo_pattern_t*) p); 442 451 } 443 452 … … 536 545 * subsequent drawing operations. 537 546 */ 538 public void setSource( cairo_pattern_t*source)547 public void setSource(Pattern source) 539 548 { 540 549 // void cairo_set_source (cairo_t *cr, cairo_pattern_t *source); 541 cairo_set_source(cairo, source);550 cairo_set_source(cairo, (source is null) ? null : source.getPatternStruct()); 542 551 } 543 552 … … 571 580 * Returns: the current source pattern. This object is owned bycairo. To keep a reference to it, you must callcairo_pattern_reference(). 572 581 */ 573 public cairo_pattern_t*getSource()582 public Pattern getSource() 574 583 { 575 584 // cairo_pattern_t* cairo_get_source (cairo_t *cr); 576 return cairo_get_source(cairo); 585 auto p = cairo_get_source(cairo); 586 if(p is null) 587 { 588 version(Exceptions) throw new Exception("Null GObject from GTK+."); 589 else return null; 590 } 591 return new Pattern(cast(cairo_pattern_t*) p); 577 592 } 578 593 … … 1058 1073 * pattern = a cairo_pattern_t 1059 1074 */ 1060 public void mask( cairo_pattern_t*pattern)1075 public void mask(Pattern pattern) 1061 1076 { 1062 1077 // void cairo_mask (cairo_t *cr, cairo_pattern_t *pattern); 1063 cairo_mask(cairo, pattern);1078 cairo_mask(cairo, (pattern is null) ? null : pattern.getPatternStruct()); 1064 1079 } 1065 1080 trunk/src/cairo/ImageSurface.d
r499 r502 38 38 * prefixes: 39 39 * - cairo_image_surface_ 40 * - cairo_surface_ 40 41 * - cairo_ 41 42 * omit structs: … … 287 288 * image. 288 289 * Params: 289 * surface = a cairo_surface_t with pixel contents290 290 * filename = the name of a file to write to 291 291 * Returns: CAIRO_STATUS_SUCCESS if the PNG file was writtensuccessfully. Otherwise, CAIRO_STATUS_NO_MEMORY if memory could notbe allocated for the operation orCAIRO_STATUS_SURFACE_TYPE_MISMATCH if the surface does not havepixel contents, or CAIRO_STATUS_WRITE_ERROR if an I/O error occurswhile attempting to write the file. 292 292 */ 293 public cairo_status_t surfaceWriteToPng(string filename)293 public cairo_status_t writeToPng(string filename) 294 294 { 295 295 // cairo_status_t cairo_surface_write_to_png (cairo_surface_t *surface, const char *filename); … … 300 300 * Writes the image surface to the write function. 301 301 * Params: 302 * surface = a cairo_surface_t with pixel contents303 302 * writeFunc = a cairo_write_func_t 304 303 * closure = closure data for the write function 305 304 * Returns: CAIRO_STATUS_SUCCESS if the PNG file was writtensuccessfully. Otherwise, CAIRO_STATUS_NO_MEMORY is returned ifmemory could not be allocated for the operation,CAIRO_STATUS_SURFACE_TYPE_MISMATCH if the surface does not havepixel contents. 306 305 */ 307 public cairo_status_t surfaceWriteToPngStream(cairo_write_func_t writeFunc, void* closure)306 public cairo_status_t writeToPngStream(cairo_write_func_t writeFunc, void* closure) 308 307 { 309 308 // cairo_status_t cairo_surface_write_to_png_stream (cairo_surface_t *surface, cairo_write_func_t write_func, void *closure); trunk/src/gtkc/cairotypes.d
r499 r502 59 59 SUBPIXEL 60 60 } 61 alias cairo_antialias_t CairoAntialias; 62 61 63 /** 62 64 * cairo_fill_rule_t is used to select how paths are filled. For both … … 77 79 EVEN_ODD 78 80 } 81 alias cairo_fill_rule_t CairoFillRule; 82 79 83 /** 80 84 * Specifies how to render the endpoints of the path when stroking. … … 88 92 SQUARE 89 93 } 94 alias cairo_line_cap_t CairoLineCap; 95 90 96 /** 91 97 * Specifies how to render the junction of two lines when stroking. … … 99 105 BEVEL 100 106 } 107 alias cairo_line_join_t CairoLineJoin; 108 101 109 /** 102 110 * cairo_operator_t is used to set the compositing operator for all cairo … … 133 141 SATURATE 134 142 } 143 alias cairo_operator_t CairoOperator; 144 135 145 /** 136 146 * cairo_path_data_t is used to describe the type of one portion … … 146 156 CLOSE_PATH 147 157 } 158 alias cairo_path_data_type_t CairoPathDataType; 159 148 160 /** 149 161 * Specifies variants of a font face based on their slant. … … 156 168 OBLIQUE 157 169 } 170 alias cairo_font_slant_t CairoFontSlant; 171 158 172 /** 159 173 * Specifies variants of a font face based on their weight. … … 165 179 BOLD 166 180 } 181 alias cairo_font_weight_t CairoFontWeight; 182 167 183 /** 168 184 * cairo_extend_t is used to describe how pattern color/alpha will be … … 182 198 PAD 183 199 } 200 alias cairo_extend_t CairoExtend; 201 184 202 /** 185 203 * cairo_filter_t is used to indicate what filtering should be … … 198 216 GAUSSIAN 199 217 } 218 alias cairo_filter_t CairoFilter; 219 200 220 /** 201 221 * cairo_pattern_type_t is used to describe the type of a given pattern. … … 223 243 RADIAL 224 244 } 245 alias cairo_pattern_type_t CairoPatternType; 246 225 247 /** 226 248 * cairo_font_type_t is used to describe the type of a given font … … 253 275 QUARTZ 254 276 } 277 alias cairo_font_type_t CairoFontType; 278 255 279 /** 256 280 * The subpixel order specifies the order of color elements within … … 267 291 VBGR 268 292 } 293 alias cairo_subpixel_order_t CairoSubpixelOrder; 294 269 295 /** 270 296 * Specifies the type of hinting to do on font outlines. Hinting … … 285 311 FULL 286 312 } 313 alias cairo_hint_style_t CairoHintStyle; 314 287 315 /** 288 316 * Specifies whether to hint font metrics; hinting font metrics … … 299 327 ON 300 328 } 329 alias cairo_hint_metrics_t CairoHintMetrics; 330 301 331 /** 302 332 * cairo_content_t is used to describe the content that a surface will … … 314 344 COLOR_ALPHA = 0x3000 315 345 } 346 alias cairo_content_t CairoContent; 347 316 348 /** 317 349 * cairo_surface_type_t is used to describe the type of a given … … 349 381 QUARTZ_IMAGE 350 382 } 383 alias cairo_surface_type_t CairoSurfaceType; 384 351 385 /** 352 386 * cairo_format_t is used to identify the memory format of … … 366 400 +/ 367 401 } 402 alias cairo_format_t CairoFormat; 403 368 404 /** 369 405 * cairo_ps_level_t is used to describe the language level of the … … 377 413 LEVEL_3 378 414 } 415 alias cairo_ps_level_t CairoPsLevel; 416 379 417 /** 380 418 * cairo_svg_version_t is used to describe the version number of the SVG … … 387 425 VERSION_1_2 388 426 } 427 alias cairo_svg_version_t CairoSvgVersion; 428 389 429 /** 390 430 * cairo_status_t is used to indicate errors that can occur when … … 425 465 /+* after adding a new error: update LAST_STATUS inn cairoint.h +/ 426 466 } 467 alias cairo_status_t CairoStatus; 468 427 469 428 470 /**
