comparison dwt/graphics/Pattern.d @ 46:cfa563df4fdd

Updated Widget and Display to 3.514
author Jacob Carlborg <doob@me.com>
date Fri, 05 Dec 2008 16:00:41 +0100
parents d8635bb48c7c
children 62202ce0039f
comparison
equal deleted inserted replaced
45:d8635bb48c7c 46:cfa563df4fdd
29 import dwt.graphics.Color; 29 import dwt.graphics.Color;
30 import dwt.graphics.Device; 30 import dwt.graphics.Device;
31 import dwt.graphics.GC; 31 import dwt.graphics.GC;
32 import dwt.graphics.Image; 32 import dwt.graphics.Image;
33 import dwt.graphics.Resource; 33 import dwt.graphics.Resource;
34 import dwt.internal.cocoa.CGFloat; 34 import dwt.internal.c.Carbon;
35 35
36 /** 36 /**
37 * Instances of this class represent patterns to use while drawing. Patterns 37 * Instances of this class represent patterns to use while drawing. Patterns
38 * can be specified either as bitmaps or gradients. 38 * can be specified either as bitmaps or gradients.
39 * <p> 39 * <p>
90 public this(Device device, Image image) { 90 public this(Device device, Image image) {
91 super(device); 91 super(device);
92 if (image is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 92 if (image is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
93 if (image.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 93 if (image.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT);
94 NSAutoreleasePool pool = null; 94 NSAutoreleasePool pool = null;
95 if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init(); 95 if (!NSThread.isMainThread()) pool = cast(NSAutoreleasePool) (new NSAutoreleasePool()).alloc().init();
96 try { 96 try {
97 this.image = image; 97 this.image = image;
98 color = NSColor.colorWithPatternImage(image.handle); 98 color = NSColor.colorWithPatternImage(image.handle);
99 color.retain(); 99 color.retain();
100 init_(); 100 init_();