New functions ILGlobalClone/ILGlobalFree.
[wine/multimedia.git] / objects / oembitmap.c
blobc3c45b9c855dce7721c2e12e547a8dd7af3a9001
1 /*
2 * GDI OEM bitmap objects
4 * Copyright 1994, 1995 Alexandre Julliard
6 */
8 #include <stdlib.h>
9 #include <string.h>
10 #include "ts_xlib.h"
11 #include "ts_xutil.h"
12 #include "ts_xpm.h"
13 #include "gdi.h"
14 #include "bitmap.h"
15 #include "callback.h"
16 #include "color.h"
17 #include "cursoricon.h"
18 #include "heap.h"
19 #include "tweak.h"
20 #include "debug.h"
22 /* Include OEM pixmaps */
23 #include "bitmaps/obm_cdrom"
24 #include "bitmaps/obm_harddisk"
25 #include "bitmaps/obm_drive"
26 #include "bitmaps/obm_folder2"
27 #include "bitmaps/obm_folder"
28 #include "bitmaps/obm_lfarrowi"
29 #include "bitmaps/obm_rgarrowi"
30 #include "bitmaps/obm_dnarrowi"
31 #include "bitmaps/obm_uparrowi"
32 #include "bitmaps/obm_combo"
33 #include "bitmaps/obm_mnarrow"
34 #include "bitmaps/obm_lfarrowd"
35 #include "bitmaps/obm_rgarrowd"
36 #include "bitmaps/obm_dnarrowd"
37 #include "bitmaps/obm_uparrowd"
38 #include "bitmaps/obm_restored"
39 #include "bitmaps/obm_restore"
40 #include "bitmaps/obm_lfarrow"
41 #include "bitmaps/obm_rgarrow"
42 #include "bitmaps/obm_dnarrow"
43 #include "bitmaps/obm_uparrow"
44 #include "bitmaps/obm_old_restore"
45 #include "bitmaps/obm_old_zoom"
46 #include "bitmaps/obm_old_reduce"
47 #include "bitmaps/obm_btncorners"
48 #include "bitmaps/obm_checkboxes"
49 #include "bitmaps/obm_check"
50 #include "bitmaps/obm_btsize"
51 #include "bitmaps/obm_old_lfarrow"
52 #include "bitmaps/obm_old_rgarrow"
53 #include "bitmaps/obm_old_dnarrow"
54 #include "bitmaps/obm_old_uparrow"
55 #include "bitmaps/obm_size"
56 #include "bitmaps/obm_old_close"
57 #include "bitmaps/obm_trtype"
58 #include "bitmaps/obm_radiocheck"
60 #include "bitmaps/obm_zoomd"
61 #include "bitmaps/obm_reduced"
62 #include "bitmaps/obm_zoom"
63 #include "bitmaps/obm_reduce"
64 #include "bitmaps/obm_close"
65 #include "bitmaps/obm_zoomd_95"
66 #include "bitmaps/obm_reduced_95"
67 #include "bitmaps/obm_zoom_95"
68 #include "bitmaps/obm_reduce_95"
69 #include "bitmaps/obm_close_95"
70 #include "bitmaps/obm_closed_95"
71 #include "bitmaps/obm_restore_95"
72 #include "bitmaps/obm_restored_95"
75 #define OBM_FIRST OBM_RADIOCHECK /* First OEM bitmap */
76 #define OBM_LAST OBM_OLD_CLOSE /* Last OEM bitmap */
78 static struct
80 char** data; /* Pointer to bitmap data */
81 BOOL32 color; /* Is it a color bitmap? */
82 } OBM_Pixmaps_Data[OBM_LAST-OBM_FIRST+1] = {
83 { obm_radiocheck, FALSE }, /* OBM_RADIOCHECK */
84 { obm_trtype, TRUE }, /* OBM_TRTYPE */
85 { obm_cdrom, TRUE }, /* OBM_CDROM */
86 { obm_harddisk, TRUE }, /* OBM_HARDDISK */
87 { obm_drive, TRUE }, /* OBM_DRIVE */
88 { obm_folder2, TRUE }, /* OBM_FOLDER2 */
89 { obm_folder, TRUE }, /* OBM_FOLDER */
90 { obm_lfarrowi, TRUE }, /* OBM_LFARROWI */
91 { obm_rgarrowi, TRUE }, /* OBM_RGARROWI */
92 { obm_dnarrowi, TRUE }, /* OBM_DNARROWI */
93 { obm_uparrowi, TRUE }, /* OBM_UPARROWI */
94 { obm_combo, FALSE }, /* OBM_COMBO */
95 { obm_mnarrow, FALSE }, /* OBM_MNARROW */
96 { obm_lfarrowd, TRUE }, /* OBM_LFARROWD */
97 { obm_rgarrowd, TRUE }, /* OBM_RGARROWD */
98 { obm_dnarrowd, TRUE }, /* OBM_DNARROWD */
99 { obm_uparrowd, TRUE }, /* OBM_UPARROWD */
100 { obm_restored, TRUE }, /* OBM_RESTORED */
101 { obm_zoomd, TRUE }, /* OBM_ZOOMD */
102 { obm_reduced, TRUE }, /* OBM_REDUCED */
103 { obm_restore, TRUE }, /* OBM_RESTORE */
104 { obm_zoom, TRUE }, /* OBM_ZOOM */
105 { obm_reduce, TRUE }, /* OBM_REDUCE */
106 { obm_lfarrow, TRUE }, /* OBM_LFARROW */
107 { obm_rgarrow, TRUE }, /* OBM_RGARROW */
108 { obm_dnarrow, TRUE }, /* OBM_DNARROW */
109 { obm_uparrow, TRUE }, /* OBM_UPARROW */
110 { obm_close, TRUE }, /* OBM_CLOSE */
111 { obm_old_restore, FALSE }, /* OBM_OLD_RESTORE */
112 { obm_old_zoom, FALSE }, /* OBM_OLD_ZOOM */
113 { obm_old_reduce, FALSE }, /* OBM_OLD_REDUCE */
114 { obm_btncorners, FALSE }, /* OBM_BTNCORNERS */
115 { obm_checkboxes, FALSE }, /* OBM_CHECKBOXES */
116 { obm_check, FALSE }, /* OBM_CHECK */
117 { obm_btsize, FALSE }, /* OBM_BTSIZE */
118 { obm_old_lfarrow, FALSE }, /* OBM_OLD_LFARROW */
119 { obm_old_rgarrow, FALSE }, /* OBM_OLD_RGARROW */
120 { obm_old_dnarrow, FALSE }, /* OBM_OLD_DNARROW */
121 { obm_old_uparrow, FALSE }, /* OBM_OLD_UPARROW */
122 { obm_size, FALSE }, /* OBM_SIZE */
123 { obm_old_close, FALSE }, /* OBM_OLD_CLOSE */
127 /* Include OEM icons */
128 #include "bitmaps/oic_sample"
129 #include "bitmaps/oic_hand"
130 #include "bitmaps/oic_ques"
131 #include "bitmaps/oic_bang"
132 #include "bitmaps/oic_note"
133 #include "bitmaps/oic_portrait"
134 #include "bitmaps/oic_landscape"
135 #include "bitmaps/oic_wineicon"
136 #include "bitmaps/oic_hand_95"
137 #include "bitmaps/oic_ques_95"
138 #include "bitmaps/oic_bang_95"
139 #include "bitmaps/oic_note_95"
141 #define OIC_FIRST OIC_SAMPLE /* First OEM icon */
142 #define OIC_LAST OIC_WINEICON /* Last OEM icon */
144 static char **OBM_Icons_Data[OIC_LAST-OIC_FIRST+1] =
146 oic_sample, /* OIC_SAMPLE */
147 oic_hand, /* OIC_HAND */
148 oic_ques, /* OIC_QUES */
149 oic_bang, /* OIC_BANG */
150 oic_note, /* OIC_NOTE */
151 oic_portrait, /* OIC_PORTRAIT */
152 oic_landscape, /* OIC_LANDSCAPE */
153 oic_wineicon /* OIC_WINEICON */
157 /* Include OEM cursors */
158 #include "bitmaps/ocr_normal"
159 #include "bitmaps/ocr_ibeam"
160 #include "bitmaps/ocr_wait"
161 #include "bitmaps/ocr_cross"
162 #include "bitmaps/ocr_up"
163 #include "bitmaps/ocr_size"
164 #include "bitmaps/ocr_icon"
165 #include "bitmaps/ocr_sizenwse"
166 #include "bitmaps/ocr_sizenesw"
167 #include "bitmaps/ocr_sizewe"
168 #include "bitmaps/ocr_sizens"
169 #include "bitmaps/ocr_bummer"
170 #include "bitmaps/ocr_dragobject"
171 /*#include "bitmaps/ocr_sizeall"*/
172 /*#include "bitmaps/ocr_icocur"*/
173 #include "bitmaps/ocr_no"
174 #include "bitmaps/ocr_appstarting"
175 #include "bitmaps/ocr_help"
177 /* Cursor are not all contiguous (go figure...) */
178 #define OCR_FIRST0 OCR_BUMMER
179 #define OCR_LAST0 OCR_DRAGOBJECT
180 #define OCR_BASE0 0
182 #define OCR_FIRST1 OCR_NORMAL
183 #define OCR_LAST1 OCR_UP
184 #define OCR_BASE1 (OCR_BASE0 + OCR_LAST0 - OCR_FIRST0 + 1)
186 #define OCR_FIRST2 OCR_SIZE
187 #define OCR_LAST2 OCR_SIZENS
188 #define OCR_BASE2 (OCR_BASE1 + OCR_LAST1 - OCR_FIRST1 + 1)
190 #define OCR_FIRST3 OCR_NO
191 #define OCR_LAST3 OCR_NO
192 #define OCR_BASE3 (OCR_BASE2 + OCR_LAST2 - OCR_FIRST2 + 1)
194 #define OCR_FIRST4 OCR_APPSTARTING
195 #define OCR_LAST4 OCR_APPSTARTING
196 #define OCR_BASE4 (OCR_BASE3 + OCR_LAST3 - OCR_FIRST3 + 1)
198 #define OCR_FIRST5 OCR_HELP
199 #define OCR_LAST5 OCR_HELP
200 #define OCR_BASE5 (OCR_BASE4 + OCR_LAST4 - OCR_FIRST4 + 1)
202 #define NB_CURSORS (OCR_BASE5 + OCR_LAST5 - OCR_FIRST5 + 1)
203 static char **OBM_Cursors_Data[NB_CURSORS] =
205 ocr_bummer, /* OCR_BUMMER */
206 ocr_dragobject, /* OCR_DRAGOBJECT */
207 ocr_normal, /* OCR_NORMAL */
208 ocr_ibeam, /* OCR_IBEAM */
209 ocr_wait, /* OCR_WAIT */
210 ocr_cross, /* OCR_CROSS */
211 ocr_up, /* OCR_UP */
212 ocr_size, /* OCR_SIZE */
213 ocr_icon, /* OCR_ICON */
214 ocr_sizenwse, /* OCR_SIZENWSE */
215 ocr_sizenesw, /* OCR_SIZENESW */
216 ocr_sizewe, /* OCR_SIZEWE */
217 ocr_sizens, /* OCR_SIZENS */
218 #if 0
219 ocr_sizeall, /* OCR_SIZEALL */
220 ocr_icocur /* OCR_ICOCUR */
221 #endif
222 ocr_no, /* OCR_NO */
223 ocr_appstarting, /* OCR_APPSTARTING */
224 ocr_help /* OCR_HELP */
227 static HGLOBAL16 OBM_Cursors[NB_CURSORS];
230 /* All the colors used in the xpm files must be included in this */
231 /* list, to make sure that the loaded bitmaps only use colors from */
232 /* the Windows colormap. Note: the PALETTEINDEX() are not really */
233 /* palette indexes, but system colors that will be converted to */
234 /* indexes later on. */
236 #if 0
237 static const struct
239 char * name;
240 COLORREF color;
241 } OBM_SymbolicColors[] =
242 #endif
243 static XpmColorSymbol OBM_Colors[] =
245 { "black", NULL, (Pixel)RGB(0,0,0) },
246 { "white", NULL, (Pixel)RGB(255,255,255) },
247 { "red", NULL, (Pixel)RGB(255,0,0) },
248 { "green", NULL, (Pixel)RGB(0,255,0) },
249 { "blue", NULL, (Pixel)RGB(0,0,255) },
250 { "yellow", NULL, (Pixel)RGB(255,255,0) },
251 { "cyan", NULL, (Pixel)RGB(0,255,255) },
252 { "dkyellow", NULL, (Pixel)RGB(128,128,0) },
253 { "purple", NULL, (Pixel)RGB(128,0,128) },
254 { "ltgray", NULL, (Pixel)RGB(192,192,192) },
255 { "dkgray", NULL, (Pixel)RGB(128,128,128) },
256 { "foldercol", NULL, (Pixel)RGB(0,191,191) },
257 { "button_face", NULL, (Pixel)PALETTEINDEX(COLOR_BTNFACE) },
258 { "button_shadow", NULL, (Pixel)PALETTEINDEX(COLOR_BTNSHADOW) },
259 { "button_highlight", NULL, (Pixel)PALETTEINDEX(COLOR_BTNHIGHLIGHT) },
260 { "button_edge", NULL, (Pixel)PALETTEINDEX(COLOR_BTNHIGHLIGHT) },
261 { "button_text", NULL, (Pixel)PALETTEINDEX(COLOR_BTNTEXT) },
262 { "window_frame", NULL, (Pixel)PALETTEINDEX(COLOR_WINDOWFRAME) }
265 #define NB_COLOR_SYMBOLS (sizeof(OBM_Colors)/sizeof(OBM_Colors[0]))
267 /* These are the symbolic colors for monochrome bitmaps */
268 /* This is needed to make sure that black is always 0 and */
269 /* white always 1, as required by Windows. */
271 static XpmColorSymbol OBM_BlackAndWhite[2] =
273 { "black", NULL, 0 },
274 { "white", NULL, 0xffffffff }
277 /* This structure holds the arguments for OBM_CreateBitmaps() */
278 typedef struct
280 char **data; /* In: bitmap data */
281 BOOL32 color; /* In: color or monochrome */
282 BOOL32 need_mask; /* In: do we need a mask? */
283 HBITMAP16 bitmap; /* Out: resulting bitmap */
284 HBITMAP16 mask; /* Out: resulting mask (if needed) */
285 POINT32 hotspot; /* Out: bitmap hotspot */
286 } OBM_BITMAP_DESCR;
289 /***********************************************************************
290 * OBM_InitColorSymbols
292 static BOOL32 OBM_InitColorSymbols()
294 static BOOL32 initialized = FALSE;
295 int i;
297 if (initialized) return TRUE; /* Already initialised */
298 initialized = TRUE;
300 for (i = 0; i < NB_COLOR_SYMBOLS; i++)
302 if (OBM_Colors[i].pixel & 0xff000000) /* PALETTEINDEX */
303 OBM_Colors[i].pixel = COLOR_ToPhysical( NULL,
304 GetSysColor32(OBM_Colors[i].pixel & 0xff));
305 else /* RGB*/
306 OBM_Colors[i].pixel = COLOR_ToPhysical( NULL, OBM_Colors[i].pixel);
308 return TRUE;
312 /***********************************************************************
313 * OBM_MakeBitmap
315 * Allocate a GDI bitmap.
317 static HBITMAP16 OBM_MakeBitmap( WORD width, WORD height,
318 WORD bpp, Pixmap pixmap )
320 HBITMAP16 hbitmap;
321 BITMAPOBJ * bmpObjPtr;
322 X11DRV_PHYSBITMAP *pbitmap;
324 if (!pixmap) return 0;
326 hbitmap = GDI_AllocObject( sizeof(BITMAPOBJ), BITMAP_MAGIC );
327 if (!hbitmap) return 0;
329 bmpObjPtr = (BITMAPOBJ *) GDI_HEAP_LOCK( hbitmap );
330 bmpObjPtr->size.cx = width;
331 bmpObjPtr->size.cy = height;
332 bmpObjPtr->bitmap.bmType = 0;
333 bmpObjPtr->bitmap.bmWidth = width;
334 bmpObjPtr->bitmap.bmHeight = height;
335 bmpObjPtr->bitmap.bmWidthBytes = BITMAP_GetWidthBytes( width, bpp );
336 bmpObjPtr->bitmap.bmPlanes = 1;
337 bmpObjPtr->bitmap.bmBitsPixel = bpp;
338 bmpObjPtr->bitmap.bmBits = NULL;
339 bmpObjPtr->dib = NULL;
341 pbitmap = X11DRV_AllocBitmap(bmpObjPtr);
343 pbitmap->pixmap = pixmap;
345 GDI_HEAP_UNLOCK( hbitmap );
346 return hbitmap;
350 /***********************************************************************
351 * OBM_CreateBitmaps
353 * Create the 2 bitmaps from XPM data.
355 * The Xlib critical section must be entered before calling this function.
357 static BOOL32 OBM_CreateBitmaps( OBM_BITMAP_DESCR *descr )
359 Pixmap pixmap, pixmask;
360 XpmAttributes *attrs;
361 int err;
363 attrs = (XpmAttributes *)HEAP_xalloc( GetProcessHeap(), 0,
364 XpmAttributesSize() );
365 attrs->valuemask = XpmColormap | XpmDepth | XpmColorSymbols |XpmHotspot;
366 attrs->colormap = COLOR_GetColormap();
367 attrs->depth = descr->color ? screenDepth : 1;
368 attrs->colorsymbols = (attrs->depth > 1) ? OBM_Colors : OBM_BlackAndWhite;
369 attrs->numsymbols = (attrs->depth > 1) ? NB_COLOR_SYMBOLS : 2;
371 err = XpmCreatePixmapFromData( display, rootWindow, descr->data,
372 &pixmap, &pixmask, attrs );
374 if (err != XpmSuccess)
376 HeapFree( GetProcessHeap(), 0, attrs );
377 return FALSE;
379 descr->hotspot.x = attrs->x_hotspot;
380 descr->hotspot.y = attrs->y_hotspot;
381 descr->bitmap = OBM_MakeBitmap( attrs->width, attrs->height,
382 attrs->depth, pixmap );
383 if (descr->need_mask)
384 descr->mask = OBM_MakeBitmap( attrs->width, attrs->height,
385 1, pixmask );
386 HeapFree( GetProcessHeap(), 0, attrs );
387 if (!descr->bitmap)
389 if (pixmap) XFreePixmap( display, pixmap );
390 if (pixmask) XFreePixmap( display, pixmask );
391 if (descr->bitmap) GDI_FreeObject( descr->bitmap );
392 if (descr->need_mask && descr->mask) GDI_FreeObject( descr->mask );
393 return FALSE;
395 else return TRUE;
399 /***********************************************************************
400 * OBM_LoadBitmap
402 HBITMAP16 OBM_LoadBitmap( WORD id )
404 OBM_BITMAP_DESCR descr;
406 if ((id < OBM_FIRST) || (id > OBM_LAST)) return 0;
407 id -= OBM_FIRST;
409 if (!OBM_InitColorSymbols()) return 0;
411 descr.data = OBM_Pixmaps_Data[id].data;
412 descr.color = OBM_Pixmaps_Data[id].color;
413 descr.need_mask = FALSE;
415 EnterCriticalSection( &X11DRV_CritSection );
416 if (!CALL_LARGE_STACK( OBM_CreateBitmaps, &descr ))
418 LeaveCriticalSection( &X11DRV_CritSection );
419 WARN(bitmap, "Error creating OEM bitmap %d\n", OBM_FIRST+id );
420 return 0;
422 LeaveCriticalSection( &X11DRV_CritSection );
423 return descr.bitmap;
427 /***********************************************************************
428 * OBM_LoadCursorIcon
430 HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL32 fCursor )
432 OBM_BITMAP_DESCR descr;
433 HGLOBAL16 handle;
434 CURSORICONINFO *pInfo;
435 BITMAPOBJ *bmpXor, *bmpAnd;
436 int sizeXor, sizeAnd;
438 if (fCursor)
440 if ((id >= OCR_FIRST1) && (id <= OCR_LAST1))
441 id = OCR_BASE1 + id - OCR_FIRST1;
442 else if ((id >= OCR_FIRST2) && (id <= OCR_LAST2))
443 id = OCR_BASE2 + id - OCR_FIRST2;
444 else if ((id >= OCR_FIRST0) && (id <= OCR_LAST0))
445 id = OCR_BASE0 + id - OCR_FIRST0;
446 else if ((id >= OCR_FIRST3) && (id <= OCR_LAST3))
447 id = OCR_BASE3 + id - OCR_FIRST3;
448 else if ((id >= OCR_FIRST4) && (id <= OCR_LAST4))
449 id = OCR_BASE4 + id - OCR_FIRST4;
450 else if ((id >= OCR_FIRST5) && (id <= OCR_LAST5))
451 id = OCR_BASE5 + id - OCR_FIRST5;
452 else return 0;
453 if (OBM_Cursors[id]) return OBM_Cursors[id];
455 else
457 if ((id < OIC_FIRST) || (id > OIC_LAST)) return 0;
458 id -= OIC_FIRST;
461 if (!OBM_InitColorSymbols()) return 0;
463 descr.data = fCursor ? OBM_Cursors_Data[id] : OBM_Icons_Data[id];
464 descr.color = !fCursor;
465 descr.need_mask = TRUE;
467 EnterCriticalSection( &X11DRV_CritSection );
468 if (!CALL_LARGE_STACK( OBM_CreateBitmaps, &descr ))
470 LeaveCriticalSection( &X11DRV_CritSection );
471 WARN(cursor, "Error creating OEM cursor/icon %d\n", id );
472 return 0;
474 LeaveCriticalSection( &X11DRV_CritSection );
476 bmpXor = (BITMAPOBJ *) GDI_GetObjPtr( descr.bitmap, BITMAP_MAGIC );
477 bmpAnd = (BITMAPOBJ *) GDI_GetObjPtr( descr.mask, BITMAP_MAGIC );
478 sizeXor = bmpXor->bitmap.bmHeight * bmpXor->bitmap.bmWidthBytes;
479 sizeAnd = bmpXor->bitmap.bmHeight *
480 BITMAP_GetWidthBytes( bmpXor->bitmap.bmWidth, 1 );
482 if (!(handle = GlobalAlloc16( GMEM_MOVEABLE,
483 sizeof(CURSORICONINFO) + sizeXor + sizeAnd)))
485 DeleteObject32( descr.bitmap );
486 DeleteObject32( descr.mask );
487 return 0;
490 pInfo = (CURSORICONINFO *)GlobalLock16( handle );
491 pInfo->ptHotSpot.x = descr.hotspot.x;
492 pInfo->ptHotSpot.y = descr.hotspot.y;
493 pInfo->nWidth = bmpXor->bitmap.bmWidth;
494 pInfo->nHeight = bmpXor->bitmap.bmHeight;
495 pInfo->nWidthBytes = bmpXor->bitmap.bmWidthBytes;
496 pInfo->bPlanes = bmpXor->bitmap.bmPlanes;
497 pInfo->bBitsPerPixel = bmpXor->bitmap.bmBitsPixel;
499 if (descr.mask)
501 X11DRV_PHYSBITMAP *pbitmapAnd = bmpAnd->DDBitmap->physBitmap;
502 /* Invert the mask */
504 TSXSetFunction( display, BITMAP_monoGC, GXinvert );
505 TSXFillRectangle( display, pbitmapAnd->pixmap, BITMAP_monoGC, 0, 0,
506 bmpAnd->bitmap.bmWidth, bmpAnd->bitmap.bmHeight );
507 TSXSetFunction( display, BITMAP_monoGC, GXcopy );
509 /* Set the masked pixels to black */
511 if (bmpXor->bitmap.bmBitsPixel != 1)
513 X11DRV_PHYSBITMAP *pbitmapXor = bmpXor->DDBitmap->physBitmap;
514 TSXSetForeground( display, BITMAP_colorGC,
515 COLOR_ToPhysical( NULL, RGB(0,0,0) ));
516 TSXSetBackground( display, BITMAP_colorGC, 0 );
517 TSXSetFunction( display, BITMAP_colorGC, GXor );
518 TSXCopyPlane(display, pbitmapAnd->pixmap, pbitmapXor->pixmap, BITMAP_colorGC,
519 0, 0, bmpXor->bitmap.bmWidth, bmpXor->bitmap.bmHeight,
520 0, 0, 1 );
521 TSXSetFunction( display, BITMAP_colorGC, GXcopy );
525 if (descr.mask) GetBitmapBits32( descr.mask, sizeAnd, (char *)(pInfo + 1));
526 else memset( (char *)(pInfo + 1), 0xff, sizeAnd );
527 GetBitmapBits32( descr.bitmap, sizeXor, (char *)(pInfo + 1) + sizeAnd );
529 DeleteObject32( descr.bitmap );
530 DeleteObject32( descr.mask );
532 if (fCursor) OBM_Cursors[id] = handle;
533 return handle;
537 /***********************************************************************
538 * OBM_Init
540 * Initializes the OBM_Pixmaps_Data and OBM_Icons_Data struct
542 BOOL32 OBM_Init()
544 if (TWEAK_WineLook == WIN31_LOOK) {
545 OBM_Pixmaps_Data[OBM_ZOOMD - OBM_FIRST].data = obm_zoomd;
546 OBM_Pixmaps_Data[OBM_REDUCED - OBM_FIRST].data = obm_reduced;
547 OBM_Pixmaps_Data[OBM_ZOOM - OBM_FIRST].data = obm_zoom;
548 OBM_Pixmaps_Data[OBM_REDUCE - OBM_FIRST].data = obm_reduce;
549 OBM_Pixmaps_Data[OBM_CLOSE - OBM_FIRST].data = obm_close;
550 OBM_Pixmaps_Data[OBM_RESTORE - OBM_FIRST].data = obm_restore;
551 OBM_Pixmaps_Data[OBM_RESTORED - OBM_FIRST].data = obm_restored;
553 OBM_Icons_Data[OIC_HAND - OIC_FIRST] = oic_hand;
554 OBM_Icons_Data[OIC_QUES - OIC_FIRST] = oic_ques;
555 OBM_Icons_Data[OIC_BANG - OIC_FIRST] = oic_bang;
556 OBM_Icons_Data[OIC_NOTE - OIC_FIRST] = oic_note;
558 else {
559 OBM_Pixmaps_Data[OBM_ZOOMD - OBM_FIRST].data = obm_zoomd_95;
560 OBM_Pixmaps_Data[OBM_REDUCED - OBM_FIRST].data = obm_reduced_95;
561 OBM_Pixmaps_Data[OBM_ZOOM - OBM_FIRST].data = obm_zoom_95;
562 OBM_Pixmaps_Data[OBM_REDUCE - OBM_FIRST].data = obm_reduce_95;
563 OBM_Pixmaps_Data[OBM_CLOSE - OBM_FIRST].data = obm_close_95;
564 OBM_Pixmaps_Data[OBM_RESTORE - OBM_FIRST].data = obm_restore_95;
565 OBM_Pixmaps_Data[OBM_RESTORED - OBM_FIRST].data = obm_restored_95;
567 OBM_Icons_Data[OIC_HAND - OIC_FIRST] = oic_hand_95;
568 OBM_Icons_Data[OIC_QUES - OIC_FIRST] = oic_ques_95;
569 OBM_Icons_Data[OIC_BANG - OIC_FIRST] = oic_bang_95;
570 OBM_Icons_Data[OIC_NOTE - OIC_FIRST] = oic_note_95;
573 return 1;