Release 980201
[wine.git] / include / bitmap.h
blob3690de2227c8a367c6653b564a96c40c878b17d6
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 "ts_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 : ( ((bpp) == 15) ? (width) * 2 : \
42 ((width) * (bpp) + 15) / 16 * 2 ))
44 #define XCREATEIMAGE(image,width,height,bpp) \
45 { \
46 int width_bytes = DIB_GetXImageWidthBytes( (width), (bpp) ); \
47 (image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
48 (bpp), ZPixmap, 0, xmalloc( (height)*width_bytes ),\
49 (width), (height), 32, width_bytes ); \
52 /* objects/bitmap.c */
53 extern BOOL32 BITMAP_Init(void);
54 extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
55 extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
56 extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
57 extern XImage *BITMAP_GetXImage( const BITMAPOBJ *bmp );
58 extern INT32 BITMAP_GetBitsPadding( int width, int depth );
59 extern INT32 BITMAP_GetBitsWidth( int width, int depth );
61 /* objects/dib.c */
62 extern int DIB_GetDIBWidthBytes( int width, int depth );
63 extern int DIB_GetXImageWidthBytes( int width, int depth );
64 extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
66 /* objects/oembitmap.c */
67 extern BOOL32 OBM_Init(void);
68 extern HBITMAP16 OBM_LoadBitmap( WORD id );
69 extern HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL32 fCursor );
71 #endif /* __WINE_BITMAP_H */