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