Release 970525
[wine/multimedia.git] / include / bitmap.h
blob3b8bfe2097e6122b9591d793de51a22aafb0b4c3
1 /*
2 * GDI bitmap definitions
4 * Copyright 1993, 1994 Alexandre Julliard
5 */
7 #ifndef __WINE_BITMAP_H
8 #define __WINE_BITMAP_H
10 #include "gdi.h"
11 #include "xmalloc.h"
13 #ifdef PRELIMINARY_WING16_SUPPORT
14 /* FIXME: this doesn't belong here */
15 #include <X11/extensions/XShm.h>
17 typedef struct
19 XShmSegmentInfo si;
20 SEGPTR bits;
21 } __ShmBitmapCtl;
23 #endif
25 /* GDI logical bitmap object */
26 typedef struct
28 GDIOBJHDR header;
29 BITMAP16 bitmap;
30 Pixmap pixmap;
31 SIZE16 size; /* For SetBitmapDimension() */
32 } BITMAPOBJ;
34 /* GCs used for B&W and color bitmap operations */
35 extern GC BITMAP_monoGC, BITMAP_colorGC;
37 #define BITMAP_GC(bmp) \
38 (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
40 #define BITMAP_WIDTH_BYTES(width,bpp) \
41 (((bpp) == 24) ? (width) * 4 : ((width) * (bpp) + 15) / 16 * 2)
43 #define XCREATEIMAGE(image,width,height,bpp) \
44 { \
45 int width_bytes = DIB_GetXImageWidthBytes( (width), (bpp) ); \
46 (image) = XCreateImage(display, DefaultVisualOfScreen(screen), \
47 (bpp), ZPixmap, 0, xmalloc( (height)*width_bytes ),\
48 (width), (height), 32, width_bytes ); \
51 /* objects/bitmap.c */
52 extern BOOL32 BITMAP_Init(void);
53 extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
54 extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
55 extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
57 /* objects/dib.c */
58 extern int DIB_GetDIBWidthBytes( int width, int depth );
59 extern int DIB_GetXImageWidthBytes( int width, int depth );
60 extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
62 /* objects/oembitmap.c */
63 extern HBITMAP16 OBM_LoadBitmap( WORD id );
64 extern HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL32 fCursor );
66 #endif /* __WINE_BITMAP_H */