comparison dwt/graphics/Cursor.d @ 117:25f88bf5a6df

Only one file was damaged Backed out changeset 640928daee8c
author Frank Benoit <benoit@tionex.de>
date Mon, 11 Feb 2008 04:18:24 +0100
parents 640928daee8c
children 0a96e5a30470
comparison
equal deleted inserted replaced
115:640928daee8c 117:25f88bf5a6df
229 if (handle is null && style is DWT.CURSOR_HAND) { 229 if (handle is null && style is DWT.CURSOR_HAND) {
230 int width = OS.GetSystemMetrics(OS.SM_CXCURSOR); 230 int width = OS.GetSystemMetrics(OS.SM_CXCURSOR);
231 int height = OS.GetSystemMetrics(OS.SM_CYCURSOR); 231 int height = OS.GetSystemMetrics(OS.SM_CYCURSOR);
232 if (width is 32 && height is 32) { 232 if (width is 32 && height is 32) {
233 auto hInst = OS.GetModuleHandle(null); 233 auto hInst = OS.GetModuleHandle(null);
234 if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 234 static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED);
235 handle = OS.CreateCursor(hInst, 5, 0, 32, 32, HAND_SOURCE.ptr, HAND_MASK.ptr); 235 handle = OS.CreateCursor(hInst, 5, 0, 32, 32, HAND_SOURCE.ptr, HAND_MASK.ptr);
236 236
237 } 237 }
238 } 238 }
239 if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); 239 if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES);
299 byte[] sourceData = ImageData.convertPad(source.data, source.width, source.height, source.depth, source.scanlinePad, 2); 299 byte[] sourceData = ImageData.convertPad(source.data, source.width, source.height, source.depth, source.scanlinePad, 2);
300 byte[] maskData = ImageData.convertPad(mask.data, mask.width, mask.height, mask.depth, mask.scanlinePad, 2); 300 byte[] maskData = ImageData.convertPad(mask.data, mask.width, mask.height, mask.depth, mask.scanlinePad, 2);
301 301
302 /* Create the cursor */ 302 /* Create the cursor */
303 auto hInst = OS.GetModuleHandle(null); 303 auto hInst = OS.GetModuleHandle(null);
304 if (OS.IsWinCE) DWT.error (DWT.ERROR_NOT_IMPLEMENTED); 304 static if (OS.IsWinCE) DWT.error (DWT.ERROR_NOT_IMPLEMENTED);
305 handle = OS.CreateCursor(hInst, hotspotX, hotspotY, source.width, source.height, sourceData.ptr, maskData.ptr); 305 handle = OS.CreateCursor(hInst, hotspotX, hotspotY, source.width, source.height, sourceData.ptr, maskData.ptr);
306 if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); 306 if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES);
307 if (device.tracking) device.new_Object(this); 307 if (device.tracking) device.new_Object(this);
308 } 308 }
309 309
394 * However, it does not appear to do any harm, so rather 394 * However, it does not appear to do any harm, so rather
395 * than keep track of how a cursor was created, we just 395 * than keep track of how a cursor was created, we just
396 * destroy them all. If this causes problems in the future, 396 * destroy them all. If this causes problems in the future,
397 * put the flag back in. 397 * put the flag back in.
398 */ 398 */
399 if (!OS.IsWinCE) OS.DestroyCursor(handle); 399 static if (!OS.IsWinCE) OS.DestroyCursor(handle);
400 } 400 }
401 handle = null; 401 handle = null;
402 if (device.tracking) device.dispose_Object(this); 402 if (device.tracking) device.dispose_Object(this);
403 device = null; 403 device = null;
404 } 404 }