2 * GDI bitmap definitions
4 * Copyright 1993, 1994 Alexandre Julliard
7 #ifndef __WINE_BITMAP_H
8 #define __WINE_BITMAP_H
13 #ifdef PRELIMINARY_WING16_SUPPORT
14 /* FIXME: this doesn't belong here */
25 /* Additional info for DIB section objects */
28 /* Windows DIB section */
29 DIBSECTION dibSection
;
32 enum { DIB_NoHandler
, DIB_InSync
, DIB_AppMod
, DIB_GdiMod
} status
;
43 /* GDI logical bitmap object */
49 SIZE16 size
; /* For SetBitmapDimension() */
51 /* For device-independent bitmaps: */
56 /* GCs used for B&W and color bitmap operations */
57 extern GC BITMAP_monoGC
, BITMAP_colorGC
;
59 #define BITMAP_GC(bmp) \
60 (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
62 #define BITMAP_WIDTH_BYTES(width,bpp) \
63 (((bpp) == 24) ? (width) * 4 : ( ((bpp) == 15) ? (width) * 2 : \
64 ((width) * (bpp) + 15) / 16 * 2 ))
66 #define XCREATEIMAGE(image,width,height,bpp) \
68 int width_bytes = DIB_GetXImageWidthBytes( (width), (bpp) ); \
69 (image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
70 (bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
71 (width), (height), 32, width_bytes ); \
74 /* objects/bitmap.c */
75 extern BOOL32
BITMAP_Init(void);
76 extern INT16
BITMAP_GetObject16( BITMAPOBJ
* bmp
, INT16 count
, LPVOID buffer
);
77 extern INT32
BITMAP_GetObject32( BITMAPOBJ
* bmp
, INT32 count
, LPVOID buffer
);
78 extern BOOL32
BITMAP_DeleteObject( HBITMAP16 hbitmap
, BITMAPOBJ
* bitmap
);
79 extern XImage
*BITMAP_GetXImage( const BITMAPOBJ
*bmp
);
80 extern INT32
BITMAP_GetBitsPadding( int width
, int depth
);
81 extern INT32
BITMAP_GetBitsWidth( int width
, int depth
);
82 extern HBITMAP32
BITMAP_LoadBitmap32W(HINSTANCE32 instance
,LPCWSTR name
,
86 extern int DIB_GetDIBWidthBytes( int width
, int depth
);
87 extern int DIB_GetXImageWidthBytes( int width
, int depth
);
88 extern int DIB_BitmapInfoSize( BITMAPINFO
* info
, WORD coloruse
);
89 extern void DIB_UpdateDIBSection( DC
*dc
, BOOL32 toDIB
);
90 extern void DIB_DeleteDIBSection( BITMAPOBJ
*bmp
);
91 extern void DIB_SelectDIBSection( DC
*dc
, BITMAPOBJ
*bmp
);
92 extern void DIB_FixColorsToLoadflags(BITMAPINFO
* bmi
, UINT32 loadflags
,
95 /* objects/oembitmap.c */
96 extern BOOL32
OBM_Init(void);
97 extern HBITMAP16
OBM_LoadBitmap( WORD id
);
98 extern HGLOBAL16
OBM_LoadCursorIcon( WORD id
, BOOL32 fCursor
);
100 #endif /* __WINE_BITMAP_H */