/*
**    $Id: gdi.h,v 1.1 1993/06/27 17:58:17 pjs Exp $
**    Copyright (C) 1993  Patrick Sweeney
**
**    This program is free software; you can redistribute it and/or modify
**    it under the terms of the GNU General Public License as published by
**    the Free Software Foundation; either version 2 of the License, or
**    any later version.
**
**    This program 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 General Public License for more details.
**
**    You should have received a copy of the GNU General Public License
**    along with this program; if not, write to the Free Software
**    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _GDI_H_
#define _GDI_H_

#include "std.h"
#include "windows.h"

/* All of this information was obtain from "Undocumented Windows" by
** Andrew Schulman by Addison & Wesley.
*/

/* Next we define Object signatures. See "Undocument Windows" page
** 537 for more information.
*/
#ifdef WINDOWS_30

#define OBJ_SIG_PEN		(1)
#define OBJ_SIG_BRUSH		(2)
#define OBJ_SIG_FONT		(3)
#define OBJ_SIG_PALETTE		(4)
#define OBJ_SIG_BITMAP		(5)
#define OBJ_SIG_REGION		(6)
#define OBJ_SIG_DC		(7)
#define OBJ_SIG_DISABLEDDC	(8)
#define OBJ_SIG_METADC		(9)
#define OBJ_SIG_METAFILE	(10)
#define OBJ_SIG_METAFILEDC	(11)

#else /* assume windows 3.1 */

#define OBJ_SIG_PEN		(0x4F47 /* 'GO' */)
#define OBJ_SIG_BRUSH		(0x4F48 /* 'HO' */)
#define OBJ_SIG_FONT		(0x4F49 /* 'IO' */)
#define OBJ_SIG_PALETTE		(0x4F4A /* 'JO' */)
#define OBJ_SIG_BITMAP		(0x4F4B /* 'KO' */)
#define OBJ_SIG_REGION		(0x4F4C /* 'LO' */)
#define OBJ_SIG_DC		(0x4F4D /* 'MO' */)
#define OBJ_SIG_DISABLEDDC	(0x4F4E /* 'NO' */)
#define OBJ_SIG_METADC		(0x4F4F /* 'OO' */)
#define OBJ_SIG_METAFILE	(0x4F50 /* 'PO' */)
#define OBJ_SIG_METAFILEDC	(0x4F51 /* 'QO' */)

/*
** These next flags are ORed in with the signature.
** OBJPRIVATE indicates the object is private.
** OBJDCSEL appears to indicate the object is currently
** selected in the DC.
*/
#define OBJ_SIG_FLAG_OBJPRIVATE	(0x2000)
#define OBJ_SIG_FLAG_OBJDCSEL	(0x8000)

#endif /* WINDOWS_30 */

typedef struct tagGDIOBJHDR
{
	HANDLE hNext;	/* Handle to next object */
	WORD wMagic;	/* signature for object */
	DWORD dwCount;	/* sequence number */
	WORD wMetaList;	/* ? */
} GDIOBJHDR, FAR *LPGDIOBJHDR;

/* The following is used in the debugged version of
** windows 3.1
*/
typedef struct tagGDIOBJ31DBG
{
	HANDLE hNext;
	WORD wMagic;
	DWORD dwCount;
	WORD wMetaList;
	WORD wSelCount;
	HANDLE hOwner;
} GDIOBJ32DBG, FAR *LPGDIOBJ31DBG;

#endif /* _GDI_H_ */
