Moved more GDI definitions to gdi_private.h.

Get rid of bitmap.h and palette.h.
This commit is contained in:
Alexandre Julliard 2004-03-04 20:41:12 +00:00
parent 7b48ddcbba
commit 05df86a38f
25 changed files with 155 additions and 213 deletions

View File

@ -28,7 +28,6 @@
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "winerror.h"
#include "bitmap.h"
#include "wine/debug.h"
#include "ddraw_private.h"
#include "dsurface/main.h"
@ -36,6 +35,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
/* FIXME */
extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOID *bits,
HANDLE section, DWORD offset, DWORD ovr_pitch );
static ICOM_VTABLE(IDirectDrawSurface7) DIB_IDirectDrawSurface7_VTable;
/* Return the width of a DIB bitmap in bytes. DIB bitmap data is 32-bit aligned. */

View File

@ -26,7 +26,6 @@
#include "wingdi.h"
#include "gdi.h"
#include "enhmetafiledrv.h"
#include "bitmap.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);

View File

@ -27,6 +27,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "gdi.h"
#include "gdi_private.h"
/* Enhanced Metafile driver physical DC */

View File

@ -22,7 +22,7 @@
#include <stdio.h>
#include <string.h>
#include "bitmap.h"
#include "gdi.h"
#include "enhmfdrv/enhmetafiledrv.h"
#include "gdi_private.h"
#include "wine/debug.h"

View File

@ -46,6 +46,8 @@ struct hdc_list
/* Device functions for the Wine driver interface */
typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */
typedef struct tagDC_FUNCS
{
INT (*pAbortDoc)(PHYSDEV);
@ -170,6 +172,92 @@ typedef struct tagDC_FUNCS
BOOL (*pWidenPath)(PHYSDEV);
} DC_FUNCTIONS;
/* It should not be necessary to access the contents of the GdiPath
* structure directly; if you find that the exported functions don't
* allow you to do what you want, then please place a new exported
* function that does this job in path.c.
*/
typedef enum tagGdiPathState
{
PATH_Null,
PATH_Open,
PATH_Closed
} GdiPathState;
typedef struct tagGdiPath
{
GdiPathState state;
POINT *pPoints;
BYTE *pFlags;
int numEntriesUsed, numEntriesAllocated;
BOOL newStroke;
} GdiPath;
typedef struct tagGdiFont *GdiFont;
typedef struct tagDC
{
GDIOBJHDR header;
HDC hSelf; /* Handle to this DC */
const struct tagDC_FUNCS *funcs; /* DC function table */
PHYSDEV physDev; /* Physical device (driver-specific) */
INT saveLevel;
DWORD dwHookData;
FARPROC16 hookProc; /* the original SEGPTR ... */
DCHOOKPROC hookThunk; /* ... and the thunk to call it */
INT wndOrgX; /* Window origin */
INT wndOrgY;
INT wndExtX; /* Window extent */
INT wndExtY;
INT vportOrgX; /* Viewport origin */
INT vportOrgY;
INT vportExtX; /* Viewport extent */
INT vportExtY;
int flags;
HRGN hClipRgn; /* Clip region (may be 0) */
HRGN hVisRgn; /* Visible region (must never be 0) */
HPEN hPen;
HBRUSH hBrush;
HFONT hFont;
HBITMAP hBitmap;
HANDLE hDevice;
HPALETTE hPalette;
GdiFont gdiFont;
GdiPath path;
WORD ROPmode;
WORD polyFillMode;
WORD stretchBltMode;
WORD relAbsMode;
WORD backgroundMode;
COLORREF backgroundColor;
COLORREF textColor;
COLORREF dcBrushColor;
COLORREF dcPenColor;
short brushOrgX;
short brushOrgY;
WORD textAlign; /* Text alignment from SetTextAlign() */
INT charExtra; /* Spacing from SetTextCharacterExtra() */
INT breakExtra; /* breakTotalExtra / breakCount */
INT breakRem; /* breakTotalExtra % breakCount */
INT MapMode;
INT GraphicsMode; /* Graphics mode */
ABORTPROC pAbortProc; /* AbortProc for Printing */
ABORTPROC16 pAbortProc16;
INT CursPosX; /* Current position */
INT CursPosY;
INT ArcDirection;
XFORM xformWorld2Wnd; /* World-to-window transformation */
XFORM xformWorld2Vport; /* World-to-viewport transformation */
XFORM xformVport2World; /* Inverse of the above transformation */
BOOL vport2WorldValid; /* Is xformVport2World valid? */
RECT BoundsRect; /* Current bounding rect */
} DC;
/* DC flags */
#define DC_SAVED 0x0002 /* It is a saved DC */
#define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
@ -180,6 +268,15 @@ typedef struct tagDC_FUNCS
Used by mfdrv for example. */
#define GDI_NO_MORE_WORK 2
/* Rounds a floating point number to integer. The world-to-viewport
* transformation process is done in floating point internally. This function
* is then used to round these coordinates to integer values.
*/
static inline INT WINE_UNUSED GDI_ROUND(FLOAT val)
{
return (int)floor(val + 0.5);
}
/* bidi.c */
/* Wine_GCPW Flags */
@ -196,6 +293,10 @@ extern BOOL BIDI_Reorder( LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwW
LPWSTR lpOutString, INT uCountOut, UINT *lpOrder );
extern BOOL BidiAvail;
/* bitmap.c */
extern HBITMAP BITMAP_CopyBitmap( HBITMAP hbitmap );
extern BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, DC *dc );
/* clipping.c */
extern void CLIPPING_UpdateGCRegion( DC * dc );
@ -206,6 +307,11 @@ extern DC * DC_GetDCPtr( HDC hdc );
extern void DC_InitDC( DC * dc );
extern void DC_UpdateXforms( DC * dc );
/* dib.c */
extern int DIB_GetDIBWidthBytes( int width, int depth );
extern int DIB_GetDIBImageBytes( int width, int height, int depth );
extern int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse );
/* driver.c */
extern const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name );
extern const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs );
@ -286,6 +392,7 @@ extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
/* palette.c */
extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg);
extern UINT WINAPI GDIRealizePalette( HDC hdc );
extern HPALETTE PALETTE_Init(void);
/* region.c */
extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );

View File

@ -23,7 +23,6 @@
#include "gdi.h"
#include "mfdrv/metafiledrv.h"
#include "wine/debug.h"
#include "bitmap.h"
WINE_DEFAULT_DEBUG_CHANNEL(metafile);

View File

@ -27,6 +27,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "gdi.h"
#include "gdi_private.h"
/* Metafile driver physical DC */

View File

@ -21,10 +21,14 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "bitmap.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wownt32.h"
#include "mfdrv/metafiledrv.h"
#include "gdi.h"
#include "gdi_private.h"
#include "wine/debug.h"

View File

@ -32,7 +32,6 @@
#include "wingdi.h"
#include "winerror.h"
#include "gdi.h"
#include "bitmap.h"
#include "gdi_private.h"
#include "wine/debug.h"

View File

@ -20,11 +20,11 @@
#include "config.h"
#include "wine/winuser16.h"
#include "bitmap.h"
#include "wine/debug.h"
#include "windef.h"
#include "wownt32.h"
#include "gdi.h"
#include "wine/winuser16.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wing);

View File

@ -22,7 +22,7 @@
#include <stdlib.h>
#include "palette.h"
#include "gdi.h"
#include "winbase.h"
#include "ttydrv.h"
#include "wine/debug.h"

View File

@ -24,7 +24,6 @@
#include <stdio.h>
#include <stdlib.h>
#include "gdi.h"
#include "bitmap.h"
#include "wine/debug.h"
#include "x11drv.h"
#include "wingdi.h"

View File

@ -22,7 +22,7 @@
#include <stdlib.h>
#include "bitmap.h"
#include "gdi.h"
#include "x11drv.h"
#include "wine/debug.h"

View File

@ -36,7 +36,7 @@
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "bitmap.h"
#include "gdi.h"
#include "x11drv.h"
#include "wine/debug.h"

View File

@ -24,7 +24,6 @@
#include <string.h>
#include "gdi.h"
#include "palette.h"
#include "windef.h"
#include "winreg.h"
#include "x11drv.h"

View File

@ -34,7 +34,7 @@
#include "windef.h"
#include "wingdi.h"
#include "ddrawi.h"
#include "bitmap.h"
#include "gdi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(x11drv);

View File

@ -1,52 +0,0 @@
/*
* GDI bitmap definitions
*
* Copyright 1993, 1994 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_BITMAP_H
#define __WINE_BITMAP_H
#include <gdi.h>
/* GDI logical bitmap object */
typedef struct tagBITMAPOBJ
{
GDIOBJHDR header;
BITMAP bitmap;
SIZE size; /* For SetBitmapDimension() */
const struct tagDC_FUNCS *funcs; /* DC function table */
void *physBitmap; /* ptr to device specific data */
/* For device-independent bitmaps: */
DIBSECTION *dib;
SEGPTR segptr_bits; /* segptr to DIB bits */
} BITMAPOBJ;
/* objects/bitmap.c */
extern HBITMAP BITMAP_CopyBitmap( HBITMAP hbitmap );
extern BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, DC *dc );
/* objects/dib.c */
extern int DIB_GetDIBWidthBytes( int width, int depth );
extern int DIB_GetDIBImageBytes( int width, int height, int depth );
extern int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse );
extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOID *bits,
HANDLE section, DWORD offset, DWORD ovr_pitch );
extern void DIB_UpdateDIBSection( DC *dc, BOOL toDIB );
extern void DIB_SelectDIBSection( DC *dc, BITMAPOBJ *bmp );
#endif /* __WINE_BITMAP_H */

View File

@ -66,106 +66,37 @@ typedef struct tagGDIOBJHDR
struct hdc_list *hdcs;
} GDIOBJHDR;
/* It should not be necessary to access the contents of the GdiPath
* structure directly; if you find that the exported functions don't
* allow you to do what you want, then please place a new exported
* function that does this job in path.c.
*/
typedef enum tagGdiPathState
{
PATH_Null,
PATH_Open,
PATH_Closed
} GdiPathState;
typedef struct tagGdiPath
{
GdiPathState state;
POINT *pPoints;
BYTE *pFlags;
int numEntriesUsed, numEntriesAllocated;
BOOL newStroke;
} GdiPath;
typedef struct tagGdiFont *GdiFont;
typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */
typedef struct tagDC
{
GDIOBJHDR header;
HDC hSelf; /* Handle to this DC */
const struct tagDC_FUNCS *funcs; /* DC function table */
PHYSDEV physDev; /* Physical device (driver-specific) */
INT saveLevel;
DWORD dwHookData;
FARPROC16 hookProc; /* the original SEGPTR ... */
DCHOOKPROC hookThunk; /* ... and the thunk to call it */
INT wndOrgX; /* Window origin */
INT wndOrgY;
INT wndExtX; /* Window extent */
INT wndExtY;
INT vportOrgX; /* Viewport origin */
INT vportOrgY;
INT vportExtX; /* Viewport extent */
INT vportExtY;
int flags;
HRGN hClipRgn; /* Clip region (may be 0) */
HRGN hVisRgn; /* Visible region (must never be 0) */
HPEN hPen;
HBRUSH hBrush;
HFONT hFont;
HBITMAP hBitmap;
HANDLE hDevice;
HPALETTE hPalette;
GdiFont gdiFont;
GdiPath path;
WORD ROPmode;
WORD polyFillMode;
WORD stretchBltMode;
WORD relAbsMode;
WORD backgroundMode;
COLORREF backgroundColor;
COLORREF textColor;
COLORREF dcBrushColor;
COLORREF dcPenColor;
short brushOrgX;
short brushOrgY;
WORD textAlign; /* Text alignment from SetTextAlign() */
INT charExtra; /* Spacing from SetTextCharacterExtra() */
INT breakExtra; /* breakTotalExtra / breakCount */
INT breakRem; /* breakTotalExtra % breakCount */
INT MapMode;
INT GraphicsMode; /* Graphics mode */
ABORTPROC pAbortProc; /* AbortProc for Printing */
ABORTPROC16 pAbortProc16;
INT CursPosX; /* Current position */
INT CursPosY;
INT ArcDirection;
XFORM xformWorld2Wnd; /* World-to-window transformation */
XFORM xformWorld2Vport; /* World-to-viewport transformation */
XFORM xformVport2World; /* Inverse of the above transformation */
BOOL vport2WorldValid; /* Is xformVport2World valid? */
RECT BoundsRect; /* Current bounding rect */
} DC;
/* extra stock object: default 1x1 bitmap for memory DCs */
#define DEFAULT_BITMAP (STOCK_LAST+1)
/* Rounds a floating point number to integer. The world-to-viewport
* transformation process is done in floating point internally. This function
* is then used to round these coordinates to integer values.
*/
static inline INT WINE_UNUSED GDI_ROUND(FLOAT val)
/* bitmap object */
typedef struct tagBITMAPOBJ
{
return (int)floor(val + 0.5);
}
GDIOBJHDR header;
BITMAP bitmap;
SIZE size; /* For SetBitmapDimension() */
const struct tagDC_FUNCS *funcs; /* DC function table */
void *physBitmap; /* ptr to device specific data */
/* For device-independent bitmaps: */
DIBSECTION *dib;
SEGPTR segptr_bits; /* segptr to DIB bits */
} BITMAPOBJ;
/* palette object */
#define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */
#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */
#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */
#define PC_SYS_MAPPED 0x10 /* logical palentry is a direct alias for system palentry */
typedef struct tagPALETTEOBJ
{
GDIOBJHDR header;
int *mapping;
LOGPALETTE logpalette; /* _MUST_ be the last field */
} PALETTEOBJ;
/* GDI local heap */

View File

@ -1,42 +0,0 @@
/*
* GDI palette definitions
*
* Copyright 1994 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_PALETTE_H
#define __WINE_PALETTE_H
#include <gdi.h>
#define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */
#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */
#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */
#define PC_SYS_MAPPED 0x10 /* logical palentry is a direct alias for system palentry */
/* GDI logical palette object */
typedef struct tagPALETTEOBJ
{
GDIOBJHDR header;
int *mapping;
LOGPALETTE logpalette; /* _MUST_ be the last field */
} PALETTEOBJ;
extern HPALETTE PALETTE_Init(void);
#endif /* __WINE_PALETTE_H */

View File

@ -25,7 +25,6 @@
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "gdi.h"
#include "bitmap.h"
#include "gdi_private.h"
#include "wine/debug.h"

View File

@ -27,7 +27,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "wine/wingdi16.h"
#include "bitmap.h"
#include "gdi.h"
#include "wownt32.h"
#include "gdi_private.h"
#include "wine/debug.h"

View File

@ -24,12 +24,10 @@
#include "windef.h"
#include "winbase.h"
#include "bitmap.h"
#include "gdi.h"
#include "wownt32.h"
#include "gdi_private.h"
#include "wine/debug.h"
#include "palette.h"
WINE_DEFAULT_DEBUG_CHANNEL(bitmap);

View File

@ -31,9 +31,7 @@
#include "winreg.h"
#include "winerror.h"
#include "bitmap.h"
#include "local.h"
#include "palette.h"
#include "gdi.h"
#include "gdi_private.h"
#include "wine/debug.h"

View File

@ -50,7 +50,7 @@
#include "wine/winbase16.h"
#include "wine/wingdi16.h"
#include "bitmap.h"
#include "gdi.h"
#include "wownt32.h"
#include "winreg.h"
#include "winternl.h"

View File

@ -34,7 +34,6 @@
#include "wine/winuser16.h"
#include "gdi.h"
#include "gdi_private.h"
#include "palette.h"
#include "wine/debug.h"
#include "winerror.h"