Release 950319
[wine] / include / bitmap.h
1 /*
2  * GDI bitmap definitions
3  *
4  * Copyright 1993, 1994  Alexandre Julliard
5  */
6
7 #ifndef __WINE_BITMAP_H
8 #define __WINE_BITMAP_H
9
10 #include "gdi.h"
11
12   /* GDI logical bitmap object */
13 typedef struct
14 {
15     GDIOBJHDR   header;
16     BITMAP      bitmap;
17     Pixmap      pixmap;
18     SIZE        size;   /* For SetBitmapDimension() */
19 } BITMAPOBJ;
20
21   /* GCs used for B&W and color bitmap operations */
22 extern GC BITMAP_monoGC, BITMAP_colorGC;
23
24 #define BITMAP_GC(bmp) \
25   (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
26
27 #define XCREATEIMAGE(image,width,height,bpp) \
28 { \
29     int width_bytes = DIB_GetImageWidthBytes( (width), (bpp) ); \
30     (image) = XCreateImage(display, DefaultVisualOfScreen(screen), \
31                            (bpp), ZPixmap, 0, malloc( (height)*width_bytes ), \
32                            (width), (height), 32, width_bytes ); \
33 }
34
35   /* objects/bitmap.c */
36 extern BOOL BITMAP_Init(void);
37 extern int BITMAP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer );
38 extern BOOL BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap );
39 extern HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap,
40                                     BITMAPOBJ * bmp );
41
42   /* objects/dib.c */
43 extern int DIB_GetImageWidthBytes( int width, int depth );
44 extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
45
46   /* objects/oembitmap.c */
47 extern HBITMAP OBM_LoadBitmap( WORD id );
48 extern HICON OBM_LoadIcon( WORD id );
49
50 #endif  /* __WINE_BITMAP_H */