Wed Jul 5 19:06:35 1995 Alexandre Julliard <julliard@sunsite.unc.edu> * [controls/scroll.c] Fixed drawing bug that caused part of a non-client scroll bar to be painted even when the scroll-bar was hidden. * [debugger/break.c] [debugger/dbg.y] Rewrote breakpoint handling to work in 16-bit mode. Implemented single-stepping ('step' and 'next' instructions). * [debugger/debug.l] Format specifier is now a separate token. Entering an empty line at the debugger prompt causes the previous command to be repeated, like under gdb. * [debugger/debug.l] [debugger/registers.c] Differentiate 16-bit and 32-bit registers without taking current mode into account ($eax is always 32-bit, $ax always 16-bit). * [debugger/stack.c] Fixed stack information routines to differentiate between 16-bit and 32-bit stacks. * [loader/task.c] Option -debug now sets a breakpoint at the first instruction of every loaded task. * [miscemu/instr.c] Added handling of lock, repe and repne prefixes. * [objects/dib.c] Changed StretchDIBits() to do the correct thing, even if it's still not really optimal. * [windows/graphics.c] Fixes in RoundRect(), thanks to Babak Masalehdan. * [windows/message.c] Tried to fix mouse event handling with respect to disabled windows. * [windows/painting.c] Clear WIN_NEEDS_NCPAINT flag before sending WM_NCPAINT to avoid infinite loops. * [windows/win.c] Fixed IsWindowVisible() to return FALSE when one of the parent windows is hidden. Sat Jul 1 22:08:21 1995 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/compobj.spec][misc/compobj.c] CoGetMalloc: New function Added relay entries for COMPOBJ ordinals above 100 CoInitialize: Changed parameter to DWORD * [if1632/ole2.spec] Exported implementation of OleBuildVersion * [if1632/ole2disp.spec][misc/ole2disp.c][misc/Imakefile] ole2disp.c: New file SysAllocString, SysReallocString, SysAllocStringLen, SysReAllocStringLen, SysFreeString, SysStringLen: new functions * [if1632/ole2nls.spec][include/winnls.h][misc/ole2nls.c] CompareStringA: New function Thu Jun 29 19:42:02 1995 Marcus Meissner <msmeissn@faui01.informatik.uni-erlangen.de> * [objects/font.c] [if1632/gdi.spec] New stubs for CreateScalableFontResource, GetGlyphOutline. Thu Jun 29 13:47:08 GMT 1995 Göran Thyni (goran@norrsken.bildbasen.se) * [misc/commdlg.c] Extensive changes and bug fixes to FileDialog handling, behaves more like native Windows. Wed Jun 28 13:04:44 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> * [controls/listbox.c] [controls/combo.c] Some minor optimizations. * [memory/local.c] LOCAL_FindFreeBlock(): Never use the last one. * [memory/global.c] GlobalReAlloc(): GMEM_MODIFY must not be ignored when size==0. * [misc/file.c] read() returns an error when length==0. This is not what Windows programs expect, so pay attention to this in _lread(). Changed this in _lwrite(), _hread(), _hwrite(), too. * [loader/resource.c] LoadIcon(): Ignore bih->biSizeImage, some icons have wrong values in there. * [if1632/shell.spec] [misc/shell.c] Wrong spec file entries caused havoc: HKEY has 32 bit, not 16. Accept some more combinations of parameters in the Reg..() functions. * [if1632/toolhelp.spec] Make InterruptRegister() and InterruptUnregister() return false. * [windows/hook.c] CallNextHookEx() used to crash when called with a null hhook. Fixed. Wed Jun 28 10:14:34 1995 Martin von Loewis <martin@informatik.hu-berlin.de> * [include/neexe.h][loader/ne_image.c] NE_LoadSegment: Detect iterated segments * [misc/ole2nls.c] LOCALE_SLONGDATE: fixed typo * [miscemu/int5c.c] Reordered include files to avoid conflicts with Linux libc.5.1 * [rc/winerc.c] Added -b option to process binary resource files into C arrays * [include/callback.h] CallWndProc: Added dummy ds parameter for libwine * [include/gdi.h][include/user.h] USER_HEAP_ALLOC, GDI_HEAP_ALLOC: dropped flags parameter * [include/ldt.h][include/stackframe.h] defined segment conversion macros for libwine * [misc/atom.c] Defined USER_HeapSel for libwine * [misc/main.c] Disable -dll option for libwine * [misc/user.c] removed GetFreeSystemResources, SystemHeapInfo from libwine for now * [toolkit/heap.c] fixed LocalLock prototype * [toolkit/sup.c] sync'ed load_mz_header, load_ne_header with structures * [toolkit/winmain.c] Disabled resource DLLs for libwine for now Mon Jun 26 19:30:24 1995 Hans de Graaff (graaff@twi72.twi.tudelft.nl) * [misc/main.c] Fixed -enhanced option to report a 386 CPU instead of a 286. Fri Jun 23 23:18:25 1995 Marcus Meissner <msmeissn@faui01.informatik.uni-erlangen.de> * [misc/dos_fs.c] Remove maximum open dosdirent limit (fixing the winfile.exe problem) by using telldir()/seekdir(). Fri Jun 23 13:42:25 1995 Hans de Graaff (graaff@twi72.twi.tudelft.nl) * [misc/profile.c] Fixed problem parsing empty lines within sections in .ini files.
282 lines
8.8 KiB
C
282 lines
8.8 KiB
C
/*
|
|
* GDI definitions
|
|
*
|
|
* Copyright 1993 Alexandre Julliard
|
|
*/
|
|
|
|
#ifndef GDI_H
|
|
#define GDI_H
|
|
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xutil.h>
|
|
|
|
#include "windows.h"
|
|
#include "ldt.h"
|
|
#include "local.h"
|
|
|
|
/* GDI objects magic numbers */
|
|
#define PEN_MAGIC 0x4f47
|
|
#define BRUSH_MAGIC 0x4f48
|
|
#define FONT_MAGIC 0x4f49
|
|
#define PALETTE_MAGIC 0x4f4a
|
|
#define BITMAP_MAGIC 0x4f4b
|
|
#define REGION_MAGIC 0x4f4c
|
|
#define DC_MAGIC 0x4f4d
|
|
#define DISABLED_DC_MAGIC 0x4f4e
|
|
#define META_DC_MAGIC 0x4f4f
|
|
#define METAFILE_MAGIC 0x4f50
|
|
#define METAFILE_DC_MAGIC 0x4f51
|
|
|
|
#ifndef WINELIB
|
|
#pragma pack(1)
|
|
#endif
|
|
|
|
typedef struct tagGDIOBJHDR
|
|
{
|
|
HANDLE hNext;
|
|
WORD wMagic;
|
|
DWORD dwCount;
|
|
WORD wMetaList;
|
|
} GDIOBJHDR;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
WORD version; /* 0: driver version */
|
|
WORD technology; /* 2: device technology */
|
|
WORD horzSize; /* 4: width of display in mm */
|
|
WORD vertSize; /* 6: height of display in mm */
|
|
WORD horzRes; /* 8: width of display in pixels */
|
|
WORD vertRes; /* 10: width of display in pixels */
|
|
WORD bitsPixel; /* 12: bits per pixel */
|
|
WORD planes; /* 14: color planes */
|
|
WORD numBrushes; /* 16: device-specific brushes */
|
|
WORD numPens; /* 18: device-specific pens */
|
|
WORD numMarkers; /* 20: device-specific markers */
|
|
WORD numFonts; /* 22: device-specific fonts */
|
|
WORD numColors; /* 24: size of color table */
|
|
WORD pdeviceSize; /* 26: size of PDEVICE structure */
|
|
WORD curveCaps; /* 28: curve capabilities */
|
|
WORD lineCaps; /* 30: line capabilities */
|
|
WORD polygonalCaps; /* 32: polygon capabilities */
|
|
WORD textCaps; /* 34: text capabilities */
|
|
WORD clipCaps; /* 36: clipping capabilities */
|
|
WORD rasterCaps; /* 38: raster capabilities */
|
|
WORD aspectX; /* 40: relative width of device pixel */
|
|
WORD aspectY; /* 42: relative height of device pixel */
|
|
WORD aspectXY; /* 44: relative diagonal width of device pixel */
|
|
WORD pad1[21]; /* 46-86: reserved */
|
|
WORD logPixelsX; /* 88: pixels / logical X inch */
|
|
WORD logPixelsY; /* 90: pixels / logical Y inch */
|
|
WORD pad2[6]; /* 92-102: reserved */
|
|
WORD sizePalette; /* 104: entries in system palette */
|
|
WORD numReserved; /* 106: reserved entries */
|
|
WORD colorRes; /* 108: color resolution */
|
|
} DeviceCaps;
|
|
|
|
#ifndef WINELIB
|
|
#pragma pack(4)
|
|
#endif
|
|
|
|
|
|
/* Device independent DC information */
|
|
typedef struct
|
|
{
|
|
int flags;
|
|
DeviceCaps *devCaps;
|
|
|
|
HANDLE hMetaFile;
|
|
HRGN hClipRgn; /* Clip region (may be 0) */
|
|
HRGN hVisRgn; /* Visible region (must never be 0) */
|
|
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
|
|
HPEN hPen;
|
|
HBRUSH hBrush;
|
|
HFONT hFont;
|
|
HBITMAP hBitmap;
|
|
HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
|
|
HANDLE hDevice;
|
|
HPALETTE hPalette;
|
|
|
|
WORD ROPmode;
|
|
WORD polyFillMode;
|
|
WORD stretchBltMode;
|
|
WORD relAbsMode;
|
|
WORD backgroundMode;
|
|
COLORREF backgroundColor;
|
|
COLORREF textColor;
|
|
int backgroundPixel;
|
|
int textPixel;
|
|
short brushOrgX;
|
|
short brushOrgY;
|
|
|
|
WORD textAlign; /* Text alignment from SetTextAlign() */
|
|
short charExtra; /* Spacing from SetTextCharacterExtra() */
|
|
short breakTotalExtra; /* Total extra space for justification */
|
|
short breakCount; /* Break char. count */
|
|
short breakExtra; /* breakTotalExtra / breakCount */
|
|
short breakRem; /* breakTotalExtra % breakCount */
|
|
|
|
BYTE bitsPerPixel;
|
|
|
|
WORD MapMode;
|
|
short DCOrgX; /* DC origin */
|
|
short DCOrgY;
|
|
short CursPosX; /* Current position */
|
|
short CursPosY;
|
|
short WndOrgX;
|
|
short WndOrgY;
|
|
short WndExtX;
|
|
short WndExtY;
|
|
short VportOrgX;
|
|
short VportOrgY;
|
|
short VportExtX;
|
|
short VportExtY;
|
|
} WIN_DC_INFO;
|
|
|
|
|
|
/* X physical pen */
|
|
typedef struct
|
|
{
|
|
int style;
|
|
int pixel;
|
|
int width;
|
|
char * dashes;
|
|
int dash_len;
|
|
} X_PHYSPEN;
|
|
|
|
/* X physical brush */
|
|
typedef struct
|
|
{
|
|
int style;
|
|
int fillStyle;
|
|
int pixel;
|
|
Pixmap pixmap;
|
|
} X_PHYSBRUSH;
|
|
|
|
/* X physical font */
|
|
typedef struct
|
|
{
|
|
XFontStruct * fstruct;
|
|
TEXTMETRIC metrics;
|
|
} X_PHYSFONT;
|
|
|
|
/* X physical palette information */
|
|
typedef struct
|
|
{
|
|
HANDLE hMapping; /* Color mapping table (or 0 for identity) */
|
|
HANDLE hRevMapping; /* Reverse color mapping table */
|
|
WORD mappingSize;
|
|
} X_PHYSPALETTE;
|
|
|
|
/* X-specific DC information */
|
|
typedef struct
|
|
{
|
|
GC gc; /* X Window GC */
|
|
Drawable drawable;
|
|
X_PHYSFONT font;
|
|
X_PHYSPEN pen;
|
|
X_PHYSBRUSH brush;
|
|
X_PHYSPALETTE pal;
|
|
} X_DC_INFO;
|
|
|
|
|
|
typedef struct tagDC
|
|
{
|
|
GDIOBJHDR header;
|
|
WORD saveLevel;
|
|
WIN_DC_INFO w;
|
|
union
|
|
{
|
|
X_DC_INFO x;
|
|
/* other devices (e.g. printer) */
|
|
} u;
|
|
} DC;
|
|
|
|
/* DC flags */
|
|
#define DC_MEMORY 1 /* It is a memory DC */
|
|
#define DC_SAVED 2 /* It is a saved DC */
|
|
|
|
/* Last 32 bytes are reserved for stock object handles */
|
|
#define GDI_HEAP_SIZE 0xffe0
|
|
|
|
/* First handle possible for stock objects (must be >= GDI_HEAP_SIZE) */
|
|
#define FIRST_STOCK_HANDLE GDI_HEAP_SIZE
|
|
|
|
/* Stock objects handles */
|
|
|
|
#define STOCK_WHITE_BRUSH (FIRST_STOCK_HANDLE + WHITE_BRUSH)
|
|
#define STOCK_LTGRAY_BRUSH (FIRST_STOCK_HANDLE + LTGRAY_BRUSH)
|
|
#define STOCK_GRAY_BRUSH (FIRST_STOCK_HANDLE + GRAY_BRUSH)
|
|
#define STOCK_DKGRAY_BRUSH (FIRST_STOCK_HANDLE + DKGRAY_BRUSH)
|
|
#define STOCK_BLACK_BRUSH (FIRST_STOCK_HANDLE + BLACK_BRUSH)
|
|
#define STOCK_NULL_BRUSH (FIRST_STOCK_HANDLE + NULL_BRUSH)
|
|
#define STOCK_HOLLOW_BRUSH (FIRST_STOCK_HANDLE + HOLLOW_BRUSH)
|
|
#define STOCK_WHITE_PEN (FIRST_STOCK_HANDLE + WHITE_PEN)
|
|
#define STOCK_BLACK_PEN (FIRST_STOCK_HANDLE + BLACK_PEN)
|
|
#define STOCK_NULL_PEN (FIRST_STOCK_HANDLE + NULL_PEN)
|
|
#define STOCK_OEM_FIXED_FONT (FIRST_STOCK_HANDLE + OEM_FIXED_FONT)
|
|
#define STOCK_ANSI_FIXED_FONT (FIRST_STOCK_HANDLE + ANSI_FIXED_FONT)
|
|
#define STOCK_ANSI_VAR_FONT (FIRST_STOCK_HANDLE + ANSI_VAR_FONT)
|
|
#define STOCK_SYSTEM_FONT (FIRST_STOCK_HANDLE + SYSTEM_FONT)
|
|
#define STOCK_DEVICE_DEFAULT_FONT (FIRST_STOCK_HANDLE + DEVICE_DEFAULT_FONT)
|
|
#define STOCK_DEFAULT_PALETTE (FIRST_STOCK_HANDLE + DEFAULT_PALETTE)
|
|
#define STOCK_SYSTEM_FIXED_FONT (FIRST_STOCK_HANDLE + SYSTEM_FIXED_FONT)
|
|
|
|
#define NB_STOCK_OBJECTS (SYSTEM_FIXED_FONT + 1)
|
|
|
|
#define FIRST_STOCK_FONT STOCK_OEM_FIXED_FONT
|
|
#define LAST_STOCK_FONT STOCK_SYSTEM_FIXED_FONT
|
|
|
|
|
|
|
|
/* Device <-> logical coords conversion */
|
|
|
|
#define XDPTOLP(dc,x) \
|
|
(((x)-(dc)->w.VportOrgX) * (dc)->w.WndExtX / (dc)->w.VportExtX+(dc)->w.WndOrgX)
|
|
#define YDPTOLP(dc,y) \
|
|
(((y)-(dc)->w.VportOrgY) * (dc)->w.WndExtY / (dc)->w.VportExtY+(dc)->w.WndOrgY)
|
|
#define XLPTODP(dc,x) \
|
|
(((x)-(dc)->w.WndOrgX) * (dc)->w.VportExtX / (dc)->w.WndExtX+(dc)->w.VportOrgX)
|
|
#define YLPTODP(dc,y) \
|
|
(((y)-(dc)->w.WndOrgY) * (dc)->w.VportExtY / (dc)->w.WndExtY+(dc)->w.VportOrgY)
|
|
|
|
|
|
/* GDI local heap */
|
|
|
|
#ifdef WINELIB
|
|
|
|
#define GDI_HEAP_ALLOC(size) LocalAlloc (LMEM_FIXED,size)
|
|
#define GDI_HEAP_LIN_ADDR(handle) LocalLock (handle)
|
|
#define GDI_HEAP_SEG_ADDR(handle) LocalLock (handle)
|
|
#define GDI_HEAP_FREE(handle) LocalFree (handle)
|
|
|
|
#else
|
|
|
|
extern LPSTR GDI_Heap;
|
|
extern WORD GDI_HeapSel;
|
|
|
|
#define GDI_HEAP_ALLOC(size) \
|
|
LOCAL_Alloc( GDI_HeapSel, LMEM_FIXED, (size) )
|
|
#define GDI_HEAP_REALLOC(handle,size) \
|
|
LOCAL_ReAlloc( GDI_HeapSel, (handle), (size), LMEM_FIXED )
|
|
#define GDI_HEAP_FREE(handle) \
|
|
LOCAL_Free( GDI_HeapSel, (handle) )
|
|
#define GDI_HEAP_LIN_ADDR(handle) \
|
|
((handle) ? PTR_SEG_OFF_TO_LIN(GDI_HeapSel, (handle)) : NULL)
|
|
#define GDI_HEAP_SEG_ADDR(handle) \
|
|
((handle) ? MAKELONG((handle), GDI_HeapSel) : 0)
|
|
|
|
#endif
|
|
|
|
extern BOOL GDI_Init(void);
|
|
extern HANDLE GDI_AllocObject( WORD, WORD );
|
|
extern BOOL GDI_FreeObject( HANDLE );
|
|
extern GDIOBJHDR * GDI_GetObjPtr( HANDLE, WORD );
|
|
|
|
extern Display * display;
|
|
extern Screen * screen;
|
|
extern Window rootWindow;
|
|
extern int screenWidth, screenHeight, screenDepth;
|
|
extern int desktopX, desktopY; /* misc/main.c */
|
|
|
|
#endif /* GDI_H */
|