Commit 7cbe6572 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 950109

Thu Jan 5 13:37:42 1995 Cameron Heide (heide@ee.ualberta.ca) * [memory/global.c] GlobalCompact should now return the correct value when the largest run of free blocks includes the last block. * [windows/mdi.c] Tiling and cascading windows without any MDI children should no longer crash (assuming no-op is the correct thing to do). Sun Jan 1 23:30:25 1995 Fons Botman <botman@rabo.nl> * [objects/font.c] GetTextExtentPoint: fixed debug output, str is counted string, not zero terminated. * [if1632/relay.c] DLLRelay: when debugging_stack got segv, added upper bound for stack dump.
parent 3a5816f8
This is release 941227 of Wine the MS Windows emulator. This is still a
This is release 950109 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "wine-new@amscons.com". Please don't forget
to include a ChangeLog entry. I'll try to make a new release every Sunday.
WHAT'S NEW with Wine-941227: (see ChangeLog for details)
- Better BitBlt()
WHAT'S NEW with Wine-950109: (see ChangeLog for details)
- Compiling with -Wall. Don't panic if you get many warnings...
- Better StretchBlt()
- Lots of bug fixes
See the README file in the distribution for installation instructions.
......@@ -15,11 +16,11 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-941227.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-941227.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-941227.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-941227.tar.gz
ftp.wonderland.org:/Wine/Wine-941227.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-950109.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-950109.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-950109.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-950109.tar.gz
ftp.wonderland.org:/Wine/Wine-950109.tar.gz
If you submitted a patch, please check to make sure it has been
included in the new release.
......
Thu Jan 5 13:37:42 1995 Cameron Heide (heide@ee.ualberta.ca)
* [memory/global.c]
GlobalCompact should now return the correct value when the
largest run of free blocks includes the last block.
* [windows/mdi.c]
Tiling and cascading windows without any MDI children should
no longer crash (assuming no-op is the correct thing to do).
Sun Jan 1 23:30:25 1995 Fons Botman <botman@rabo.nl>
* objects/font.c (GetTextExtentPoint):
Fixed debug output, str is counted string, not zero terminated.
* if1632/relay.c (DLLRelay):
When debugging_stack got segv, added upper bound for stack dump.
----------------------------------------------------------------------
Tue Dec 27 13:35:16 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [*/Imakefile]
......
......@@ -7,6 +7,7 @@ CC = gcc -D__FreeBSD__
#endif
DEFINES = AutoDefines -DUSE_READLINE -DWINESTAT
CDEBUGFLAGS = -O2 -Wall
/*
* This is the second try at using Imakefiles. There are probably many
......
......@@ -367,7 +367,7 @@ static void CB_Paint( HWND hWnd, HDC hDC, WORD action )
((wndPtr->dwStyle & 0x0f) == BS_AUTORADIOBUTTON)) y += checkBoxHeight;
else if (infoPtr->state & BUTTON_3STATE) y += 2 * checkBoxHeight;
GRAPH_DrawBitmap( hDC, hbitmapCheckBoxes, rc.left, rc.top + delta,
x, y, checkBoxWidth, checkBoxHeight, SRCCOPY );
x, y, checkBoxWidth, checkBoxHeight );
rc.left += checkBoxWidth + tm.tmAveCharWidth / 2;
if (action == ODA_DRAWENTIRE)
......
......@@ -16,7 +16,6 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "user.h"
#include "heap.h"
#include "win.h"
#include "prototypes.h"
#include "stddebug.h"
/* #define DEBUG_COMBO */
#include "debug.h"
......@@ -271,8 +270,7 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
GetObject(hComboBit, sizeof(BITMAP), (LPSTR)&bm);
GRAPH_DrawBitmap( hDC, hComboBit,
rect.right - bm.bmWidth, 0,
0, 0, bm.bmWidth, bm.bmHeight,
SRCCOPY );
0, 0, bm.bmWidth, bm.bmHeight );
}
EndPaint(hwnd, &paintstruct);
lphc = ComboGetStorageHeader(hwnd);
......
......@@ -95,7 +95,7 @@ static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
GRAPH_DrawBitmap( hdc, infoPtr->hbitmapWallPaper,
x, y, 0, 0,
infoPtr->bitmapSize.cx,
infoPtr->bitmapSize.cy, SRCCOPY );
infoPtr->bitmapSize.cy );
}
else
{
......@@ -104,8 +104,7 @@ static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
if (x < 0) x = 0;
if (y < 0) y = 0;
GRAPH_DrawBitmap( hdc, infoPtr->hbitmapWallPaper, x, y, 0, 0,
infoPtr->bitmapSize.cx, infoPtr->bitmapSize.cy,
SRCCOPY );
infoPtr->bitmapSize.cx, infoPtr->bitmapSize.cy );
}
}
......
......@@ -1091,7 +1091,7 @@ int ListBoxGetSel(HWND hwnd, WORD wIndex)
int ListBoxDirectory(HWND hwnd, UINT attrib, LPSTR filespec)
{
struct dosdirent *dp;
int x, wRet;
int x, wRet = LB_OKAY;
BOOL OldFlag;
char temp[256];
LPHEADLIST lphl;
......
/*
* Menus functions
static char RCSId[] = "$Id$";
static char Copyright[] = "Copyright Martin Ayotte, 1993";
static char Copyright2[] = "Copyright Alexandre Julliard, 1994";
*/
* Menu functions
*
* Copyright 1993 Martin Ayotte
* Copyright 1994 Alexandre Julliard
*/
/*
* Note: the style MF_MOUSESELECT is used to mark popup items that
......@@ -18,7 +18,6 @@ static char Copyright2[] = "Copyright Alexandre Julliard, 1994";
#include "windows.h"
#include "syscolor.h"
#include "sysmetrics.h"
#include "prototypes.h"
#include "menu.h"
#include "user.h"
#include "win.h"
......@@ -482,15 +481,13 @@ static void MENU_DrawMenuItem( HDC hdc, LPMENUITEM lpitem,
GRAPH_DrawBitmap(hdc, lpitem->hCheckBit ? lpitem->hCheckBit :
hStdCheck, rect.left,
(rect.top+rect.bottom-check_bitmap_height) / 2,
0, 0, check_bitmap_width, check_bitmap_height,
SRCCOPY);
0, 0, check_bitmap_width, check_bitmap_height );
}
else if (lpitem->hUnCheckBit != 0) /* Not checked */
{
GRAPH_DrawBitmap(hdc, lpitem->hUnCheckBit, rect.left,
(rect.top+rect.bottom-check_bitmap_height) / 2,
0, 0, check_bitmap_width, check_bitmap_height,
SRCCOPY);
0, 0, check_bitmap_width, check_bitmap_height );
}
/* Draw the popup-menu arrow */
......@@ -500,8 +497,7 @@ static void MENU_DrawMenuItem( HDC hdc, LPMENUITEM lpitem,
GRAPH_DrawBitmap( hdc, hStdMnArrow,
rect.right-arrow_bitmap_width-1,
(rect.top+rect.bottom-arrow_bitmap_height) / 2,
0, 0, arrow_bitmap_width, arrow_bitmap_height,
SRCCOPY );
0, 0, arrow_bitmap_width, arrow_bitmap_height );
}
rect.left += check_bitmap_width;
......@@ -513,8 +509,7 @@ static void MENU_DrawMenuItem( HDC hdc, LPMENUITEM lpitem,
if (lpitem->item_flags & MF_BITMAP)
{
GRAPH_DrawBitmap( hdc, (HBITMAP)lpitem->hText, rect.left, rect.top,
0, 0, rect.right-rect.left, rect.bottom-rect.top,
SRCCOPY );
0, 0, rect.right-rect.left, rect.bottom-rect.top );
return;
}
/* No bitmap - process text if present */
......@@ -1018,7 +1013,7 @@ static BOOL MENU_ButtonUp( HWND hwndOwner, HMENU hmenu, HMENU *hmenuCurrent,
{
POPUPMENU *menu;
MENUITEM *item;
HMENU hsubmenu;
HMENU hsubmenu = 0;
WORD id;
if (!hmenu) return FALSE; /* Outside all menus */
......
......@@ -163,6 +163,9 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, int nBar, RECT *lprect,
GetClientRect( hwnd, lprect );
vertical = ((wndPtr->dwStyle & SBS_VERT) != 0);
break;
default:
return FALSE;
}
if (vertical) pixels = lprect->bottom - lprect->top;
......@@ -267,6 +270,7 @@ static void SCROLL_DrawArrows( HDC hdc, SCROLLINFO *infoPtr, RECT *rect,
HBITMAP hbmpPrev = SelectObject( hdcMem, vertical ?
TOP_ARROW(infoPtr->flags, top_pressed)
: LEFT_ARROW(infoPtr->flags, top_pressed));
SetStretchBltMode( hdc, STRETCH_DELETESCANS );
StretchBlt( hdc, rect->left, rect->top,
vertical ? rect->right-rect->left : arrowSize+1,
vertical ? arrowSize+1 : rect->bottom-rect->top,
......@@ -385,7 +389,7 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect,
if (!thumbPos) /* No thumb to draw */
{
PatBlt( hdc, r.left+1, r.top+1, r.right - r.left - 2,
r.bottom - r.top - 2, SRCCOPY );
r.bottom - r.top - 2, PATCOPY );
return;
}
......@@ -394,12 +398,12 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect,
PatBlt( hdc, r.left + 1, r.top + 1,
r.right - r.left - 2,
thumbPos - arrowSize,
top_selected ? NOTSRCCOPY : SRCCOPY );
top_selected ? 0x0f0000 : PATCOPY );
r.top += thumbPos - arrowSize;
PatBlt( hdc, r.left + 1, r.top + SYSMETRICS_CYHSCROLL + 1,
r.right - r.left - 2,
r.bottom - r.top - SYSMETRICS_CYHSCROLL - 2,
bottom_selected ? NOTSRCCOPY : SRCCOPY );
bottom_selected ? 0x0f0000 : PATCOPY );
r.bottom = r.top + SYSMETRICS_CYHSCROLL + 1;
}
else /* horizontal */
......@@ -407,12 +411,12 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect,
PatBlt( hdc, r.left + 1, r.top + 1,
thumbPos - arrowSize,
r.bottom - r.top - 2,
top_selected ? NOTSRCCOPY : SRCCOPY );
top_selected ? 0x0f0000 : PATCOPY );
r.left += thumbPos - arrowSize;
PatBlt( hdc, r.left + SYSMETRICS_CYHSCROLL + 1, r.top + 1,
r.right - r.left - SYSMETRICS_CYHSCROLL - 2,
r.bottom - r.top - 2,
bottom_selected ? NOTSRCCOPY : SRCCOPY );
bottom_selected ? 0x0f0000 : PATCOPY );
r.right = r.left + SYSMETRICS_CXVSCROLL + 1;
}
......
......@@ -211,6 +211,9 @@ static void PaintTextfn( HWND hwnd, HDC hdc )
case SS_LEFTNOWORDWRAP:
wFormat = DT_LEFT | DT_SINGLELINE | DT_EXPANDTABS | DT_VCENTER;
break;
default:
return;
}
if (style & SS_NOPREFIX)
......@@ -247,6 +250,9 @@ static void PaintRectfn( HWND hwnd, HDC hdc )
case SS_WHITERECT:
hBrush = CreateSolidBrush(color_window);
break;
default:
return;
}
FillRect( hdc, &rc, hBrush );
}
......@@ -274,6 +280,9 @@ static void PaintFramefn( HWND hwnd, HDC hdc )
case SS_WHITEFRAME:
hPen = CreatePen(PS_SOLID, 1, color_window);
break;
default:
return;
}
hBrush = CreateSolidBrush(color_window);
......
......@@ -11,7 +11,6 @@
#include <sys/types.h>
#include <neexe.h>
#include <segmem.h>
#include <prototypes.h>
#include "selectors.h"
#include <wine.h>
#include <dlls.h>
......
......@@ -555,7 +555,7 @@ substrcmp(text, pat, len)
if ((c = *pat) == '\0')
return *text == '\0';
for ( ; *text; text++)
if (*text == c && strncmp(text, pat, len) == 0)
if ((CHAR)*text == c && strncmp(text, pat, len) == 0)
return 0;
return 1;
}
......
......@@ -195,7 +195,7 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
}
else if (IS_16_BIT_ADDRESS(func))
{
dprintf_callback(stddeb, "CallWindowProc // 16bit func=%p !\n",
dprintf_callback(stddeb, "CallWindowProc // 16bit func=%08x !\n",
(unsigned int) func);
PushOn16( CALLBACK_SIZE_WORD, hwnd );
PushOn16( CALLBACK_SIZE_WORD, message );
......
......@@ -23,8 +23,8 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "dlls.h"
#include "options.h"
#include "stddebug.h"
/* #define DEBUG_RELAY /* */
/* #define DEBUG_STACK /* */
/* #define DEBUG_RELAY */
/* #define DEBUG_STACK */
#include "debug.h"
#if 0
......@@ -129,7 +129,9 @@ DLLRelay(unsigned int func_num, unsigned int seg_off)
if(debugging_stack)
{
unsigned short *stack_p = (unsigned short *) seg_off;
for (i = 0; i < 24; i++, stack_p++)
/* FIXME: Is there an end-of-stack-pointer somewhere ? */
int n = min(24, (0x10000 - (seg_off & 0xffff)) / sizeof(*stack_p));
for (i = 0; i < n; i++, stack_p++)
{
printf("%04x ", *stack_p);
if ((i & 7) == 7)
......
......@@ -4,19 +4,19 @@
* Copyright 1993, 1994 Alexandre Julliard
*/
#ifndef BITMAP_H
#define BITMAP_H
#ifndef __WINE_BITMAP_H
#define __WINE_BITMAP_H
#include <stdlib.h>
#include <X11/Xlib.h>
#include "windows.h"
#include "gdi.h"
/* objects/bitmap.c */
extern BOOL BITMAP_Init(void);
/* objects/dib.c */
extern int DIB_GetImageWidthBytes( int width, int depth );
extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
/* GDI logical bitmap object */
typedef struct
{
GDIOBJHDR header;
BITMAP bitmap;
Pixmap pixmap;
SIZE size; /* For SetBitmapDimension() */
} BITMAPOBJ;
/* GCs used for B&W and color bitmap operations */
extern GC BITMAP_monoGC, BITMAP_colorGC;
......@@ -32,4 +32,15 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
(width), (height), 32, width_bytes ); \
}
#endif /* BITMAP_H */
/* objects/bitmap.c */
extern BOOL BITMAP_Init(void);
extern int BITMAP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer );
extern BOOL BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap );
extern HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap,
BITMAPOBJ * bmp );
/* objects/dib.c */
extern int DIB_GetImageWidthBytes( int width, int depth );
extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
#endif /* __WINE_BITMAP_H */
/*
* GDI brush definitions
*
* Copyright 1994 Alexandre Julliard
*/
#ifndef __WINE_BRUSH_H
#define __WINE_BRUSH_H
#include "gdi.h"
#pragma pack(1)
/* GDI logical brush object */
typedef struct
{
GDIOBJHDR header;
LOGBRUSH logbrush WINE_PACKED;
} BRUSHOBJ;
#pragma pack(4)
extern BOOL BRUSH_Init(void);
extern int BRUSH_GetObject( BRUSHOBJ * brush, int count, LPSTR buffer );
extern BOOL BRUSH_DeleteObject( HBRUSH hbrush, BRUSHOBJ * brush );
extern HBRUSH BRUSH_SelectObject( HDC hdc, DC * dc, HBRUSH hbrush,
BRUSHOBJ * brush );
#endif /* __WINE_BRUSH_H */
/*
* GDI Device Context function prototypes
*
* Copyright 1994 Alexandre Julliard
*
*/
#ifndef __WINE_DC_H
#define __WINE_DC_H
#include "gdi.h"
extern void DC_InitDC( HDC hdc );
extern int DC_SetupGCForBrush( DC * dc );
extern int DC_SetupGCForPen( DC * dc );
extern int DC_SetupGCForText( DC * dc );
extern BOOL DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors );
extern BOOL DC_SetupGCForBrush( DC * dc );
extern BOOL DC_SetupGCForPen( DC * dc );
extern BOOL DC_SetupGCForText( DC * dc );
extern const int DC_XROPfunction[];
......
/*
* GDI font definitions
*
* Copyright 1994 Alexandre Julliard
*/
#ifndef __WINE_FONT_H
#define __WINE_FONT_H
extern void Font_Init( void );
#include "gdi.h"
#pragma pack(1)
/* GDI logical font object */
typedef struct
{
GDIOBJHDR header;
LOGFONT logfont WINE_PACKED;
} FONTOBJ;
#pragma pack(4)
extern BOOL FONT_Init( void );
extern int FONT_GetObject( FONTOBJ * font, int count, LPSTR buffer );
extern HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font );
......
......@@ -29,14 +29,6 @@
#pragma pack(1)
typedef struct tagREGION
{
WORD type;
RECT box;
Pixmap pixmap;
Region xrgn;
} REGION;
typedef struct tagGDIOBJHDR
{
HANDLE hNext;
......@@ -45,45 +37,6 @@ typedef struct tagGDIOBJHDR
WORD wMetaList;
} GDIOBJHDR;
typedef struct tagBRUSHOBJ
{
GDIOBJHDR header;
LOGBRUSH logbrush WINE_PACKED;
} BRUSHOBJ;
typedef struct tagPENOBJ
{
GDIOBJHDR header;
LOGPEN logpen WINE_PACKED;
} PENOBJ;
typedef struct tagPALETTEOBJ
{
GDIOBJHDR header;
LOGPALETTE logpalette WINE_PACKED;
} PALETTEOBJ;
typedef struct tagFONTOBJ
{
GDIOBJHDR header;
LOGFONT logfont WINE_PACKED;
} FONTOBJ;
typedef struct tagBITMAPOBJ
{
GDIOBJHDR header;
BITMAP bitmap;
Pixmap pixmap;
SIZE size; /* For SetBitmapDimension() */
} BITMAPOBJ;
typedef struct tagRGNOBJ
{
GDIOBJHDR header;
REGION region;
} RGNOBJ;
#pragma pack(4)
typedef struct
{
......@@ -119,6 +72,8 @@ typedef struct
WORD colorRes; /* 108: color resolution */
} DeviceCaps;
#pragma pack(4)
/* Device independent DC information */
typedef struct
......@@ -134,6 +89,7 @@ typedef struct
HBRUSH hBrush;
HFONT hFont;
HBITMAP hBitmap;
HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
HANDLE hDevice;
HPALETTE hPalette;
......
/*
* Internal graphics functions prototypes
*
* Copyright 1994 Alexandre Julliard
*
*/
#ifndef __WINE_GRAPHICS_H
#define __WINE_GRAPHICS_H
extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size,
int shadow_size, BOOL pressed );
extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height, int rop );
int xsrc, int ysrc, int width, int height );
#endif /* __WINE_GRAPHICS */
#endif /* __WINE_GRAPHICS_H */
......@@ -49,6 +49,7 @@ extern void MSG_DecPaintCount( HANDLE hQueue );
extern void MSG_IncTimerCount( HANDLE hQueue );
extern void MSG_DecTimerCount( HANDLE hQueue );
extern void MSG_Synchronize();
extern BOOL MSG_WaitXEvent( LONG maxWait );
extern BOOL MSG_CreateSysMsgQueue( int size );
extern void hardware_event( WORD message, WORD wParam, LONG lParam,
int xPos, int yPos, DWORD time, DWORD extraInfo );
......
......@@ -17,6 +17,10 @@ extern void inportb(struct sigcontext_struct *context);
extern void inport(struct sigcontext_struct *context);
extern void outportb(struct sigcontext_struct *context);
extern void outport(struct sigcontext_struct *context);
extern void inportb_abs(struct sigcontext_struct *context);
extern void inport_abs(struct sigcontext_struct *context);
extern void outportb_abs(struct sigcontext_struct *context);
extern void outport_abs(struct sigcontext_struct *context);
extern void IntBarf(int i, struct sigcontext_struct *context);
......
/*
* GDI palette definitions
*
* Copyright 1994 Alexandre Julliard
*/
#ifndef __WINE_PALETTE_H
#define __WINE_PALETTE_H
#include "gdi.h"
#pragma pack(1)
/* GDI logical palette object */
typedef struct
{
GDIOBJHDR header;
LOGPALETTE logpalette WINE_PACKED;
} PALETTEOBJ;
#pragma pack(4)
extern int PALETTE_GetObject( PALETTEOBJ * palette, int count, LPSTR buffer );
#endif /* __WINE_FONT_H */
/*
* GDI pen definitions
*
* Copyright 1994 Alexandre Julliard
*/
#ifndef __WINE_PEN_H
#define __WINE_PEN_H
#include "gdi.h"
#pragma pack(1)
/* GDI logical pen object */
typedef struct
{
GDIOBJHDR header;
LOGPEN logpen WINE_PACKED;
} PENOBJ;
#pragma pack(4)
extern int PEN_GetObject( PENOBJ * pen, int count, LPSTR buffer );
extern HPEN PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
#endif /* __WINE_PEN_H */
......@@ -32,7 +32,7 @@ extern HBITMAP ConvertInfoBitmap( HDC hdc, BITMAPINFO * image );
/* loader/signal.c */
extern int init_wine_signals(void);
extern void init_wine_signals(void);
extern void wine_debug(int signal, int * regs);
/* loader/wine.c */
......@@ -57,18 +57,6 @@ extern void SpyInit(void);
extern BOOL WIDGETS_Init(void);
/* objects/palette.c */
extern BOOL PALETTE_Init(void);
/* objects/region.c */
extern BOOL REGION_Init(void);
/* windows/graphic.c */
extern void DrawReliefRect(HDC hdc, RECT rect, int thickness, BOOL pressed);
/* windows/dce.c */
extern void DCE_Init(void);
......
/*
* GDI region definitions
*
* Copyright 1994 Alexandre Julliard
*/
#ifndef __WINE_REGION_H
#define __WINE_REGION_H
#include "gdi.h"
typedef struct
{
WORD type;
RECT box;
Pixmap pixmap;
Region xrgn;
} REGION;
/* GDI logical region object */
typedef struct
{
GDIOBJHDR header;
REGION region;
} RGNOBJ;
extern BOOL REGION_Init(void);
extern BOOL REGION_DeleteObject( HRGN hrgn, RGNOBJ * obj );
#endif /* __WINE_REGION_H */
......@@ -2,6 +2,8 @@
#define __WINE_SELECTORS_H
#include "dlls.h"
#include "segmem.h"
#include "windows.h"
extern int FindUnusedSelectors(int n_selectors);
extern int IPCCopySelector(int i_old, unsigned long new, int swap_type);
......
......@@ -77,6 +77,7 @@
#ifdef DEBUG_NONE
#undef DEBUG_ACCEL
#undef DEBUG_BITBLT
#undef DEBUG_BITMAP
#undef DEBUG_CALLBACK
#undef DEBUG_CARET
......@@ -146,6 +147,7 @@
#ifdef DEBUG_ALL
#define DEBUG_ACCEL
#define DEBUG_BITBLT
#define DEBUG_BITMAP
#define DEBUG_CALLBACK
#define DEBUG_CARET
......
......@@ -7,7 +7,7 @@
#ifndef SYSCOLOR_H
#define SYSCOLOR_H
#include "gdi.h"
#include "windows.h"
struct SysColorObjects
{
......
......@@ -67,14 +67,13 @@ typedef struct tagWND
#define WIN_CLASS_STYLE(wndPtr) (WIN_CLASS_INFO(wndPtr).style)
/* Window functions */
WND *WIN_FindWndPtr( HWND hwnd );
Window WIN_GetXWindow( HWND hwnd );
BOOL WIN_UnlinkWindow( HWND hwnd );
BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
HWND WIN_FindWinToRepaint( HWND hwnd );
BOOL WIN_CreateDesktopWindow(void);
BOOL WINPOS_IsAnActiveWindow( HWND hwnd );
void WINPOS_ActivateChild( HWND hwnd );
extern WND *WIN_FindWndPtr( HWND hwnd );
extern Window WIN_GetXWindow( HWND hwnd );
extern BOOL WIN_UnlinkWindow( HWND hwnd );
extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
extern HWND WIN_FindWinToRepaint( HWND hwnd );
extern void WIN_SendParentNotify( HWND hwnd, WORD event, LONG lParam );
extern BOOL WIN_CreateDesktopWindow(void);
extern Display * display;
extern Screen * screen;
......
......@@ -9,15 +9,6 @@
#define DWP_MAGIC 0x5057 /* 'WP' */
extern HWND WINPOS_ChangeActiveWindow( HWND hwnd, BOOL mouseMsg ); /*winpos.c*/
extern void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack ); /* winpos.c */
extern LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
RECT *newWindowRect, RECT *oldWindowRect,
RECT *oldClientRect, WINDOWPOS *winpos,
RECT *newClientRect ); /* winpos.c */
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS *winpos ); /* winpos.c */
typedef struct
{
WORD actualCount;
......@@ -28,4 +19,15 @@ typedef struct
WINDOWPOS winPos[1];
} DWP;
extern HWND WINPOS_NextWindowFromPoint( HWND hwnd, POINT pt );
extern HWND WINPOS_ChangeActiveWindow( HWND hwnd, BOOL mouseMsg );
extern void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack );
extern LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
RECT *newWindowRect, RECT *oldWindowRect,
RECT *oldClientRect, WINDOWPOS *winpos,
RECT *newClientRect );
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS *winpos );
#endif /* WINPOS_H */
......@@ -12,6 +12,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "arch.h"
#include "windows.h"
#include "gdi.h"
#include "bitmap.h"
#include "neexe.h"
#include "icon.h"
#include "menu.h"
......@@ -742,7 +743,7 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name)
}
if(!it->value)return 0;
dprintf_resource(stddeb,"Found %s\n",it->name);
lp=it->value;
lp=(long *)it->value;
rsc_mem=(HANDLE)NULL;
} else { /* Load from file - indent this code properly later */
......
......@@ -214,7 +214,7 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
XFlush(display);
fprintf(stderr,"In win_fault %x:%lx\n", scp->sc_cs, scp->sc_eip);
#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__)
wine_debug(signal, scp); /* Enter our debugger */
wine_debug(signal, (int *)scp); /* Enter our debugger */
#else
fprintf(stderr,"Stack: %x:%x\n", scp->sc_ss, scp->sc_esp);
dump = (int*) scp;
......@@ -229,7 +229,7 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
#endif
}
int init_wine_signals(void)
void init_wine_signals(void)
{
#ifdef linux
segv_act.sa_handler = (__sighandler_t) win_fault;
......
......@@ -167,15 +167,6 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments)
}
/**********************************************************************
* WIN16_GlobalAlloc
*/
HANDLE
WIN16_GlobalAlloc(unsigned int flags, unsigned long size)
{
return GlobalAlloc(flags & ~GLOBAL_FLAGS_MOVEABLE, size);
}
/**********************************************************************
* GlobalAlloc
*/
HANDLE
......@@ -289,6 +280,15 @@ GlobalAlloc(unsigned int flags, unsigned long size)
return g->handle;
}
}
/**********************************************************************
* WIN16_GlobalAlloc
*/
HANDLE
WIN16_GlobalAlloc(unsigned int flags, unsigned long size)
{
return GlobalAlloc(flags & ~GLOBAL_FLAGS_MOVEABLE, size);
}
/**********************************************************************
* GlobalFree
......@@ -549,6 +549,13 @@ GlobalCompact(unsigned int desired)
current_free = 0;
}
}
/* One final check just in case the last block was also marked free, in
* which case the above test against max_free doesn't occur for the
* last run of free blocks.
*/
if (current_free > max_free)
max_free = current_free;
return max_free << 16;
}
......
......@@ -26,11 +26,11 @@ HEAP_CheckHeap(MDESC **free_list)
for (m = *free_list; m != NULL; m = m->next)
{
if (((int) m & 0xffff0000) != ((int) *free_list & 0xffff0000))
{ dprintf_heap(stddeb,"Invalid block %08x\n",m);
{ dprintf_heap(stddeb,"Invalid block %p\n",m);
*(char *)0 = 0;
}
if (m->prev && (((int) m->prev & 0xffff0000) != ((int) *free_list & 0xffff0000)))
{ dprintf_heap(stddeb,"Invalid prev %08x from %08x\n", m->prev, m);
{ dprintf_heap(stddeb,"Invalid prev %p from %p\n", m->prev, m);
*(char *)0 = 0;
}
}
......@@ -164,7 +164,7 @@ HEAP_ReAlloc(MDESC **free_list, void *old_block,
if (m->prev != m || m->next != m ||
((int) m & 0xffff0000) != ((int) *free_list & 0xffff0000))
{
fprintf(stderr,"Attempt to resize bad pointer, m = %08x, *free_list = %08x\n",
fprintf(stderr,"Attempt to resize bad pointer, m = %p, *free_list = %p\n",
m, free_list);
HEAP_CheckHeap(free_list);
return NULL;
......@@ -235,7 +235,7 @@ HEAP_Free(MDESC **free_list, void *block)
MDESC *m;
MDESC *m_prev;
dprintf_heap(stddeb,"HeapFree: free_list %08x, block %08x\n",
dprintf_heap(stddeb,"HeapFree: free_list %p, block %p\n",
free_list, block);
if(debugging_heap)HEAP_CheckHeap(free_list);
......@@ -246,7 +246,7 @@ HEAP_Free(MDESC **free_list, void *block)
if (m_free->prev != m_free || m_free->next != m_free)
{
fprintf(stderr,"Attempt to free bad pointer,"
"m_free = %08x, *free_list = %08x\n",
"m_free = %p, *free_list = %p\n",
m_free, free_list);
return -1;
}
......@@ -261,7 +261,7 @@ HEAP_Free(MDESC **free_list, void *block)
else if (((int) m_free & 0xffff0000) != ((int) *free_list & 0xffff0000))
{
fprintf(stderr,"Attempt to free bad pointer,"
"m_free = %08x, *free_list = %08x\n",
"m_free = %p, *free_list = %p\n",
m_free, free_list);
return -1;
}
......@@ -276,7 +276,7 @@ HEAP_Free(MDESC **free_list, void *block)
if (m_prev != NULL && (int) m_prev + m_prev->length > (int) m_free)
{
fprintf(stderr,"Attempt to free bad pointer,"
"m_free = %08x, m_prev = %08x (length %x)\n",
"m_free = %p, m_prev = %p (length %x)\n",
m_free, m_prev, m_prev->length);
return -1;
}
......@@ -285,7 +285,7 @@ HEAP_Free(MDESC **free_list, void *block)
(int) m_free + m_free->length > ((int) m_free | 0xffff))
{
fprintf(stderr,"Attempt to free bad pointer,"
"m_free = %08x (length %x), m = %08x\n",
"m_free = %p (length %x), m = %p\n",
m_free, m_free->length, m);
return -1;
}
......@@ -347,7 +347,7 @@ HEAP_CheckLocalHeaps(char *file,int line)
LHEAP *lh;
dprintf_heap(stddeb,"CheckLocalHeaps called from %s %d\n",file,line);
for(lh=LocalHeaps; lh!=NULL; lh = lh->next)
{ dprintf_heap(stddeb,"Checking heap %08x, free_list %08x\n",
{ dprintf_heap(stddeb,"Checking heap %p, free_list %p\n",
lh,lh->free_list);
HEAP_CheckHeap(&lh->free_list);
}
......@@ -361,7 +361,6 @@ LHEAP *
HEAP_LocalFindHeap(unsigned short owner)
{
LHEAP *lh;
extern struct w_files *current_exe;
dprintf_heap(stddeb,"HEAP_LocalFindHeap: owner %04x\n", owner);
......@@ -383,7 +382,7 @@ HEAP_LocalInit(unsigned short owner, void *start, int length)
{
LHEAP *lh;
dprintf_heap(stddeb,"HEAP_LocalInit: owner %04x, start %08x, length %04x\n"
dprintf_heap(stddeb,"HEAP_LocalInit: owner %04x, start %p, length %04x\n"
,owner, start, length);
if (length < 2 * sizeof(MDESC))
......@@ -398,7 +397,7 @@ HEAP_LocalInit(unsigned short owner, void *start, int length)
lh->local_table = NULL;
lh->delta = 0x20;
HEAP_Init(&lh->free_list, start, length);
dprintf_heap(stddeb,"HEAP_LocalInit: free_list %08x, length %04x, prev %08x, next %08x\n",&lh->free_list,lh->free_list->length, lh->free_list->prev,lh->free_list->next);
dprintf_heap(stddeb,"HEAP_LocalInit: free_list %p, length %04x, prev %p, next %p\n",&lh->free_list,lh->free_list->length, lh->free_list->prev,lh->free_list->next);
LocalHeaps = lh;
}
......@@ -553,9 +552,9 @@ WIN16_LocalReAlloc(unsigned int handle, int bytes, int flags)
void *m;
dprintf_heap(stddeb,"WIN16_LocalReAlloc(%04X, %d, %04X); !\n",
handle, bytes, flags);
dprintf_heap(stddeb,"WIN16_LocalReAlloc // LOCALHEAP()=%08X !\n",
dprintf_heap(stddeb,"WIN16_LocalReAlloc // LOCALHEAP()=%p !\n",
LOCALHEAP());
dprintf_heap(stddeb,"WIN16_LocalReAlloc // *LOCALHEAP()=%08X !\n",
dprintf_heap(stddeb,"WIN16_LocalReAlloc // *LOCALHEAP()=%p !\n",
*LOCALHEAP());
m = HEAP_ReAlloc(LOCALHEAP(), (void *)
(((int) *LOCALHEAP() & 0xffff0000) | (handle & 0xffff)),
......
......@@ -14,9 +14,9 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include "prototypes.h"
#include "heap.h"
#include "win.h"
#include "message.h"
#include "clipboard.h"
#include "stddebug.h"
#include "debug.h"
......
......@@ -61,14 +61,14 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
HINSTANCE hInst;
WND *wndPtr;
BOOL bRet;
printf("GetOpenFileName(%08X); !\n", lpofn);
printf("GetOpenFileName(%p); !\n", lpofn);
if (lpofn == NULL) return FALSE;
printf("GetOpenFileName // Flags=%08X !\n", lpofn->Flags);
printf("GetOpenFileName // nMaxFile=%d lpstrFile='%s' !\n",
printf("GetOpenFileName // Flags=%08lX !\n", lpofn->Flags);
printf("GetOpenFileName // nMaxFile=%ld lpstrFile='%s' !\n",
lpofn->nMaxFile, lpofn->lpstrFile);
printf("GetOpenFileName // lpstrInitialDir='%s' !\n", lpofn->lpstrInitialDir);
printf("GetOpenFileName // lpstrFilter=%08X !\n", lpofn->lpstrFilter);
printf("GetOpenFileName // nFilterIndex=%d !\n", lpofn->nFilterIndex);
printf("GetOpenFileName // lpstrFilter=%p !\n", lpofn->lpstrFilter);
printf("GetOpenFileName // nFilterIndex=%ld !\n", lpofn->nFilterIndex);
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) {
hDlgTmpl = lpofn->hInstance;
}
......@@ -123,13 +123,13 @@ BOOL GetSaveFileName(LPOPENFILENAME lpofn)
HINSTANCE hInst;
WND *wndPtr;
BOOL bRet;
printf("GetSaveFileName(%08X); !\n", lpofn);
printf("GetSaveFileName(%p); !\n", lpofn);
if (lpofn == NULL) return FALSE;
printf("GetSaveFileName // Flags=%08X !\n", lpofn->Flags);
printf("GetSaveFileName // nMaxFile=%d lpstrFile='%s' !\n",
printf("GetSaveFileName // Flags=%08lX !\n", lpofn->Flags);
printf("GetSaveFileName // nMaxFile=%ld lpstrFile='%s' !\n",
lpofn->nMaxFile, lpofn->lpstrFile);
printf("GetSaveFileName // lpstrInitialDir='%s' !\n", lpofn->lpstrInitialDir);
printf("GetSaveFileName // lpstrFilter=%08X !\n", lpofn->lpstrFilter);
printf("GetSaveFileName // lpstrFilter=%p !\n", lpofn->lpstrFilter);
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) {
hDlgTmpl = lpofn->hInstance;
}
......@@ -197,7 +197,6 @@ BOOL FileOpenDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
HDC hMemDC;
HBITMAP hBitmap;
BITMAP bm;
WND *wndPtr;
LPMEASUREITEMSTRUCT lpmeasure;
LPDRAWITEMSTRUCT lpdis;
static int nDrive;
......@@ -209,7 +208,7 @@ BOOL FileOpenDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
#ifdef DEBUG_OPENDLG
printf("FileOpenDlgProc // WM_INITDIALOG lParam=%08X\n", lParam);
#endif
printf("FileOpenDlgProc // WM_INITDIALOG lParam=%08X\n", lParam);
printf("FileOpenDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
if (!FileDlg_Init(hWnd, lParam)) return TRUE;
SendDlgItemMessage(hWnd, cmb1, CB_RESETCONTENT, 0, 0L);
lpofn = (LPOPENFILENAME)lParam;
......@@ -632,8 +631,6 @@ BOOL FileSaveDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
LPMEASUREITEMSTRUCT lpmeasure;
LPDRAWITEMSTRUCT lpdis;
static int nDrive;
static int OldDrive;
static char OldPath[512];
static char CurPath[512];
static LPOPENFILENAME lpofn;
......@@ -874,7 +871,7 @@ BOOL ColorDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("ColorDlgProc // WM_INITDIALOG lParam=%08X\n", lParam);
printf("ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
......@@ -952,7 +949,7 @@ BOOL FindTextDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("FindTextDlgProc // WM_INITDIALOG lParam=%08X\n", lParam);
printf("FindTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
......@@ -978,7 +975,7 @@ BOOL ReplaceTextDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("ReplaceTextDlgProc // WM_INITDIALOG lParam=%08X\n", lParam);
printf("ReplaceTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
......@@ -1006,7 +1003,7 @@ BOOL PrintDlg(LPPRINTDLG lpPrint)
HANDLE hResInfo;
WND *wndPtr;
BOOL bRet;
printf("PrintDlg(%08X) // Flags=%08X\n", lpPrint->Flags);
printf("PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags);
if (lpPrint->Flags & PD_PRINTSETUP)
hResInfo = FindResource(hSysRes, MAKEINTRESOURCE(PRINTSETUPDLG), RT_DIALOG);
else
......@@ -1038,7 +1035,7 @@ BOOL PrintDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("PrintDlgProc // WM_INITDIALOG lParam=%08X\n", lParam);
printf("PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
......@@ -1064,7 +1061,7 @@ BOOL PrintSetupDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("PrintSetupDlgProc // WM_INITDIALOG lParam=%08X\n", lParam);
printf("PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
......@@ -1098,7 +1095,7 @@ DWORD CommDlgExtendError(void)
int GetFileTitle(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
{
int i, len;
printf("GetFileTitle(%08X %08X %d); \n", lpFile, lpTitle, cbBuf);
printf("GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf);
if (lpFile == NULL || lpTitle == NULL) return -1;
len = strlen(lpFile);
if (len == 0) return -1;
......
......@@ -89,6 +89,43 @@ void ChopOffSlash(char *path)
path[strlen(path)-1] = '\0';
}
void ToUnix(char *s)
{
/* \WINDOWS\\SYSTEM => /windows/system */
char *p;
for (p = s; *p; p++)
{
if (*p != '\\')
*s++ = tolower(*p);
else {
*s++ = '/';
if (*(p+1) == '/' || *(p+1) == '\\')
p++;
}
}
*s = '\0';
}
void ToDos(char *s)
{
/* /windows//system => \WINDOWS\SYSTEM */
char *p;
for (p = s; *p; p++)
{
if (*p != '/')
*s++ = toupper(*p);
else {
*s++ = '\\';
if (*(p+1) == '/' || *(p+1) == '\\')
p++;
}
}
*s = '\0';
}
void DOS_InitFS(void)
{
int x;
......@@ -279,43 +316,6 @@ void DOS_SetDefaultDrive(int drive)
CurrentDrive = drive;
}
void ToUnix(char *s)
{
/* \WINDOWS\\SYSTEM => /windows/system */
char *p;
for (p = s; *p; p++)
{
if (*p != '\\')
*s++ = tolower(*p);
else {
*s++ = '/';
if (*(p+1) == '/' || *(p+1) == '\\')
p++;
}
}
*s = '\0';
}
void ToDos(char *s)
{
/* /windows//system => \WINDOWS\SYSTEM */
char *p;
for (p = s; *p; p++)
{
if (*p != '/')
*s++ = toupper(*p);
else {
*s++ = '\\';
if (*(p+1) == '/' || *(p+1) == '\\')
p++;
}
}
*s = '\0';
}
int DOS_DisableDrive(int drive)
{
if (drive >= MAX_DOS_DRIVES)
......
......@@ -46,6 +46,7 @@ LRESULT WINAPI SendDriverMessage(HDRVR hDriver, WORD msg, LPARAM lParam1, LPARAM
{
dprintf_driver(stdnimp,"SendDriverMessage(%04X, %04X, %08lX, %08lX);\n",
hDriver, msg, lParam1, lParam2);
return 0;
}
/**************************************************************************
......
......@@ -6,7 +6,6 @@ static char Copyright[] = "Copyright Scott A. Laird, Erik Bos 1993, 1994";
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "prototypes.h"
#include "windows.h"
#include "keyboard.h"
#include "stddebug.h"
......
......@@ -9,7 +9,6 @@ static char Copyright[] = "Copyright Yngvi Sigurjonsson (yngvi@hafro.is), 1993"
#include <fcntl.h>
#include <unistd.h>
#include "prototypes.h"
#include "regfunc.h"
#include "windows.h"
......
......@@ -491,7 +491,6 @@ int main( int argc, char *argv[] )
MAIN_SaveSetup();
DOS_InitFS();
Comm_Init();
Font_Init();
#ifndef WINELIB
INT21_Init();
#endif
......@@ -553,7 +552,7 @@ int SetEnvironment(LPSTR lpPortName, LPSTR lpEnviron, WORD nCount)
}
free(lpEnv->Value);
lpEnv->Value = malloc(nCount);
if (lpNewEnv->Value == NULL) {
if (lpEnv->Value == NULL) {
printf("SetEnvironment() // Error allocating entry value !\n");
return 0;
}
......
......@@ -15,7 +15,6 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include "prototypes.h"
#include "heap.h"
#include "library.h"
#include "win.h"
......
......@@ -37,7 +37,7 @@ typedef LPSTR LPNETRESOURCE;
int WNetGetConnection(LPSTR lpLocalName,
LPSTR lpRemoteName, UINT FAR *cbRemoteName)
{
printf("EMPTY STUB !!! WNetGetConnection('%s', %08X, %08X);\n",
printf("EMPTY STUB !!! WNetGetConnection('%s', %p, %p);\n",
lpLocalName, lpRemoteName, cbRemoteName);
return WN_NET_ERROR;
}
......@@ -55,7 +55,7 @@ int WNetGetCaps(WORD capability)
*/
UINT WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
{
printf("EMPTY STUB !!! WNetGetUser('%s', %08X, %08X);\n",
printf("EMPTY STUB !!! WNetGetUser('%s', %p, %p);\n",
lpLocalName, lpUserName, lpSize);
return WN_NET_ERROR;
}
......@@ -65,7 +65,7 @@ UINT WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
*/
UINT WNetAddConnection(LPSTR lpNetPath, LPSTR lpPassWord, LPSTR lpLocalName)
{
printf("EMPTY STUB !!! WNetAddConnection('%s', %08X, '%s');\n",
printf("EMPTY STUB !!! WNetAddConnection('%s', %p, '%s');\n",
lpNetPath, lpPassWord, lpLocalName);
return WN_NET_ERROR;
}
......@@ -87,7 +87,7 @@ UINT WNetCancelConnection(LPSTR lpName, BOOL bForce)
UINT WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
LPSTR lpLocalName, LPSTR lpUserName)
{
printf("EMPTY STUB !!! WNetAddConnection2('%s', %08X, '%s', '%s');\n",
printf("EMPTY STUB !!! WNetAddConnection2('%s', %p, '%s', '%s');\n",
lpNetPath, lpPassWord, lpLocalName, lpUserName);
return WN_NET_ERROR;
}
......@@ -107,7 +107,7 @@ UINT WNetCloseEnum(HANDLE hEnum)
UINT WNetEnumResource(HANDLE hEnum, DWORD cRequ,
DWORD *lpCount, LPVOID lpBuf)
{
printf("EMPTY STUB !!! WNetEnumResource(%04X, %08X, %08X, %08X);\n",
printf("EMPTY STUB !!! WNetEnumResource(%04X, %08lX, %p, %p);\n",
hEnum, cRequ, lpCount, lpBuf);
return WN_NET_ERROR;
}
......@@ -118,7 +118,7 @@ UINT WNetEnumResource(HANDLE hEnum, DWORD cRequ,
UINT WNetOpenEnum(DWORD dwScope, DWORD dwType,
LPNETRESOURCE lpNet, HANDLE FAR *lphEnum)
{
printf("EMPTY STUB !!! WNetOpenEnum(%08X, %08X, %08X, %08X);\n",
printf("EMPTY STUB !!! WNetOpenEnum(%08lX, %08lX, %p, %p);\n",
dwScope, dwType, lpNet, lphEnum);
return WN_NET_ERROR;
}
......
......@@ -24,7 +24,6 @@ static char Copyright [] = "Copyright (C) 1993 Miguel de Icaza";
#include "wine.h"
#include "windows.h"
#include "dos_fs.h"
#include "prototypes.h"
#include "stddebug.h"
/* #define DEBUG_PROFILE */
#include "debug.h"
......
......@@ -5,10 +5,10 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "prototypes.h"
#include "windows.h"
#include "library.h"
#include "shell.h"
#include "neexe.h"
#include "../rc/sysres.h"
#include "stddebug.h"
/* #define DEBUG_REG */
......@@ -25,13 +25,13 @@ LONG RegOpenKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
LPSTR ptr;
char str[128];
dprintf_reg(stddeb, "RegOpenKey(%04X, %08X='%s', %08X)\n",
dprintf_reg(stddeb, "RegOpenKey(%08lX, %p='%s', %p)\n",
hKey, lpSubKey, lpSubKey, lphKey);
if (lpKey == NULL) return ERROR_BADKEY;
if (lpSubKey == NULL) return ERROR_INVALID_PARAMETER;
if (lphKey == NULL) return ERROR_INVALID_PARAMETER;
if (hKey != HKEY_CLASSES_ROOT) {
dprintf_reg(stddeb,"RegOpenKey // specific key = %04X !\n", hKey);
dprintf_reg(stddeb,"RegOpenKey // specific key = %08lX !\n", hKey);
lpKey = (LPKEYSTRUCT)GlobalLock(hKey);
}
while ( (ptr = strchr(lpSubKey, '\\')) != NULL ) {
......@@ -67,7 +67,7 @@ LONG RegOpenKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
lpKey = lpKey->lpNextKey;
}
*lphKey = lpKey->hKey;
dprintf_reg(stddeb,"RegOpenKey // return hKey=%04X !\n", lpKey->hKey);
dprintf_reg(stddeb,"RegOpenKey // return hKey=%08lX !\n", lpKey->hKey);
return ERROR_SUCCESS;
}
......@@ -84,11 +84,11 @@ LONG RegCreateKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
LONG dwRet;
LPSTR ptr;
char str[128];
dprintf_reg(stddeb, "RegCreateKey(%04X, '%s', %08X)\n", hKey, lpSubKey, lphKey);
dprintf_reg(stddeb, "RegCreateKey(%08lX, '%s', %p)\n", hKey, lpSubKey, lphKey);
if (lpSubKey == NULL) return ERROR_INVALID_PARAMETER;
if (lphKey == NULL) return ERROR_INVALID_PARAMETER;
if (hKey != HKEY_CLASSES_ROOT) {
dprintf_reg(stddeb,"RegCreateKey // specific key = %04X !\n", hKey);
dprintf_reg(stddeb,"RegCreateKey // specific key = %08lX !\n", hKey);
lpKey = (LPKEYSTRUCT)GlobalLock(hKey);
}
while ( (ptr = strchr(lpSubKey, '\\')) != NULL ) {
......@@ -158,7 +158,7 @@ LONG RegCreateKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
lpNewKey->lpNextKey = NULL;
lpNewKey->lpSubLvl = NULL;
*lphKey = hNewKey;
dprintf_reg(stddeb,"RegCreateKey // successful '%s' key=%04X !\n", lpSubKey, hNewKey);
dprintf_reg(stddeb,"RegCreateKey // successful '%s' key=%08lX !\n", lpSubKey, hNewKey);
return ERROR_SUCCESS;
}
......@@ -168,7 +168,7 @@ LONG RegCreateKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
*/
LONG RegCloseKey(HKEY hKey)
{
dprintf_reg(stdnimp, "EMPTY STUB !!! RegCloseKey(%04X);\n", hKey);
dprintf_reg(stdnimp, "EMPTY STUB !!! RegCloseKey(%08lX);\n", hKey);
return ERROR_INVALID_PARAMETER;
}
......@@ -178,7 +178,7 @@ LONG RegCloseKey(HKEY hKey)
*/
LONG RegDeleteKey(HKEY hKey, LPCSTR lpSubKey)
{
dprintf_reg(stdnimp, "EMPTY STUB !!! RegDeleteKey(%04X, '%s');\n",
dprintf_reg(stdnimp, "EMPTY STUB !!! RegDeleteKey(%08lX, '%s');\n",
hKey, lpSubKey);
return ERROR_INVALID_PARAMETER;
}
......@@ -193,14 +193,14 @@ LONG RegSetValue(HKEY hKey, LPCSTR lpSubKey, DWORD dwType,
HKEY hRetKey;
LPKEYSTRUCT lpKey;
LONG dwRet;
dprintf_reg(stddeb, "RegSetValue(%04X, '%s', %08X, '%s', %08X);\n",
dprintf_reg(stddeb, "RegSetValue(%08lX, '%s', %08lX, '%s', %08lX);\n",
hKey, lpSubKey, dwType, lpVal, dwIgnored);
if (lpSubKey == NULL) return ERROR_INVALID_PARAMETER;
if (lpVal == NULL) return ERROR_INVALID_PARAMETER;
if ((dwRet = RegOpenKey(hKey, lpSubKey, &hRetKey)) != ERROR_SUCCESS) {
dprintf_reg(stddeb, "RegSetValue // key not found ... so create it !\n");
if ((dwRet = RegCreateKey(hKey, lpSubKey, &hRetKey)) != ERROR_SUCCESS) {
fprintf(stderr, "RegSetValue // key creation error %04X !\n", dwRet);
fprintf(stderr, "RegSetValue // key creation error %08lX !\n", dwRet);
return dwRet;
}
}
......@@ -223,7 +223,7 @@ LONG RegQueryValue(HKEY hKey, LPCSTR lpSubKey, LPSTR lpVal, LONG FAR *lpcb)
LPKEYSTRUCT lpKey;
LONG dwRet;
int size;
dprintf_reg(stddeb, "RegQueryValue(%04X, '%s', %08X, %08X);\n",
dprintf_reg(stddeb, "RegQueryValue(%08lX, '%s', %p, %p);\n",
hKey, lpSubKey, lpVal, lpcb);
if (lpSubKey == NULL) return ERROR_INVALID_PARAMETER;
if (lpVal == NULL) return ERROR_INVALID_PARAMETER;
......@@ -317,7 +317,7 @@ HINSTANCE ShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpPa
HINSTANCE FindExecutable(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult)
{
dprintf_reg(stdnimp, "FindExecutable : Empty Stub !!!\n");
return 0;
}
char AppName[256], AppMisc[256];
......@@ -399,6 +399,7 @@ HICON ExtractIcon(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex)
HICON ExtractAssociatedIcon(HINSTANCE hInst,LPSTR lpIconPath, LPWORD lpiIcon)
{
dprintf_reg(stdnimp, "ExtractAssociatedIcon : Empty Stub !!!\n");
return 0;
}
/*************************************************************************
......@@ -417,4 +418,5 @@ int RegisterShellHook(void *ptr)
int ShellHookProc(void)
{
dprintf_reg(stdnimp, "ShellHookProc : Empty Stub !!!\n");
return 0;
}
......@@ -5,7 +5,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdlib.h>
#include <stdio.h>
#include "prototypes.h"
#include "windows.h"
int OpenSound(void)
{
......@@ -51,7 +51,7 @@ int SetSoundNoise(int nSource, int nDuration)
int SetVoiceSound(int nVoice, long lFrequency, int nDuration)
{
printf("SetVoiceSound(%d, %d, %d)\n",nVoice,lFrequency, nDuration);
printf("SetVoiceSound(%d, %ld, %d)\n",nVoice,lFrequency, nDuration);
return 0;
}
......@@ -68,31 +68,37 @@ int StopSound(void)
int WaitSoundState(int x)
{
fprintf(stderr, "WaitSoundState(%d)\n", x);
return 0;
}
int SyncAllVoices(void)
{
fprintf(stderr, "SyncAllVoices()\n");
return 0;
}
int CountVoiceNotes(int x)
{
fprintf(stderr, "CountVoiceNotes(%d)\n", x);
return 0;
}
LPINT GetThresholdEvent(void)
{
fprintf(stderr, "GetThresholdEvent()\n");
return NULL;
}
int GetThresholdStatus(void)
{
fprintf(stderr, "GetThresholdStatus()\n");
return 0;
}
int SetVoiceThreshold(int a, int b)
{
fprintf(stderr, "SetVoiceThreshold(%d,%d)\n", a, b);
return 0;
}
void DoBeep(void)
......
#include <stdlib.h>
#include <stdio.h>
#include "prototypes.h"
#include "regfunc.h"
#include "stddebug.h"
/* #define DEBUG_INT */
......@@ -18,8 +17,8 @@ struct Win87EmInfoStruct {
int
WIN87_fpmath()
{
dprintf_int(stddeb, "_fpmath: (%x:%lx %lx %x)\n",_CONTEXT->sc_cs,
_CONTEXT->sc_eip, _CONTEXT->sc_es, _BX & 0xffff);
dprintf_int(stddeb, "_fpmath: (%x:%lx %x %x)\n",_CONTEXT->sc_cs,
_CONTEXT->sc_eip, _CONTEXT->sc_es, (unsigned int)_BX & 0xffff);
switch(_BX & 0xffff)
{
......
......@@ -9,17 +9,12 @@
/* #define DEBUG_INT */
#include "debug.h"
#ifdef linux
#define inline __inline__ /* So we can compile with -ansi */
#include <linux/sched.h> /* needed for HZ */
#undef inline
#endif
#define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
#define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
int do_int1a(struct sigcontext_struct * context){
time_t ltime, ticks;
time_t ltime;
DWORD ticks;
struct tm *bdtime;
if (debugging_relay) {
......@@ -30,8 +25,7 @@ int do_int1a(struct sigcontext_struct * context){
switch(AH) {
case 0:
ltime = time(NULL);
ticks = (int) (ltime * HZ);
ticks = GetTickCount();
CX = ticks >> 16;
DX = ticks & 0x0000FFFF;
AX = 0; /* No midnight rollover */
......
......@@ -22,7 +22,6 @@
#include "msdos.h"
#include "registers.h"
#include "options.h"
#include "prototypes.h"
#include "miscemu.h"
#include "stddebug.h"
/* #define DEBUG_INT */
......@@ -485,7 +484,7 @@ void OpenExistingFile(struct sigcontext_struct *context)
case 0x30: /* DENYREAD */
dprintf_int(stdnimp,
"OpenExistingFile (%s): DENYREAD changed to DENYALL\n",
SAFEMAKEPTR(DS,DX));
(char *)SAFEMAKEPTR(DS,DX));
case 0x10: /* DENYALL */
lock = LOCK_EX;
break;
......@@ -549,7 +548,7 @@ static void RenameFile(struct sigcontext_struct *context)
char *newname, *oldname;
dprintf_int(stddeb,"int21: renaming %s to %s\n",
SAFEMAKEPTR(DS,DX), SAFEMAKEPTR(ES,DI) );
(char *)SAFEMAKEPTR(DS,DX), (char *)SAFEMAKEPTR(ES,DI) );
oldname = DOS_GetUnixFileName( SAFEMAKEPTR(DS,DX) );
newname = DOS_GetUnixFileName( SAFEMAKEPTR(ES,DI) );
......@@ -563,7 +562,7 @@ static void MakeDir(struct sigcontext_struct *context)
{
char *dirname;
dprintf_int(stddeb,"int21: makedir %s\n", SAFEMAKEPTR(DS,DX) );
dprintf_int(stddeb,"int21: makedir %s\n", (char *)SAFEMAKEPTR(DS,DX) );
if ((dirname = DOS_GetUnixFileName( SAFEMAKEPTR(DS,DX) ))== NULL) {
AL = CanNotMakeDir;
......@@ -600,7 +599,7 @@ static void RemoveDir(struct sigcontext_struct *context)
{
char *dirname;
dprintf_int(stddeb,"int21: removedir %s\n", SAFEMAKEPTR(DS,DX) );
dprintf_int(stddeb,"int21: removedir %s\n", (char *)SAFEMAKEPTR(DS,DX) );
if ((dirname = DOS_GetUnixFileName( SAFEMAKEPTR(DS,DX) ))== NULL) {
AL = CanNotMakeDir;
......@@ -1601,7 +1600,10 @@ void INT21_Init(void)
MDESC *DosHeapDesc;
if ((handle = GlobalAlloc(GMEM_FIXED,sizeof(struct DosHeap))) == 0)
myerror("out of memory");
{
fprintf( stderr, "INT21_Init: Out of memory\n");
exit(1);
}
heap = (struct DosHeap *) GlobalLock(handle);
HEAP_Init(&DosHeapDesc, heap, sizeof(struct DosHeap));
......
......@@ -25,7 +25,7 @@ int do_int25(struct sigcontext_struct *context)
length = CX;
}
dprintf_int(stdnimp, "int25: abs diskread, drive %d, sector %ld, "
"count %ld, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
"count %ld, buffer %d\n", (int)EAX & 0xff, begin, length, (int) dataptr);
memset(dataptr, 0, length * 512);
......
......@@ -25,7 +25,7 @@ int do_int26(struct sigcontext_struct *context)
}
dprintf_int(stdnimp,"int26: abs diskwrite, drive %d, sector %ld, "
"count %ld, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
"count %ld, buffer %d\n", (int)EAX & 0xff, begin, length, (int) dataptr);
ResetCflag;
......
......@@ -48,7 +48,7 @@ DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
#ifdef linux
int mixer;
int volume;
printf("AUX_GetDevCaps(%u, %08X, %u);\n", wDevID, lpCaps, dwSize);
printf("AUX_GetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("AUX_GetDevCaps // mixer device not available !\n");
......@@ -120,7 +120,7 @@ DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol)
int mixer;
int volume;
int cmd;
printf("AUX_GetVolume(%u, %08X);\n", wDevID, lpdwVol);
printf("AUX_GetVolume(%u, %p);\n", wDevID, lpdwVol);
if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("Linux 'AUX_GetVolume' // mixer device not available !\n");
......@@ -174,7 +174,7 @@ DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
int mixer;
int volume;
int cmd;
printf("AUX_SetVolume(%u, %08X);\n", wDevID, dwParam);
printf("AUX_SetVolume(%u, %08lX);\n", wDevID, dwParam);
volume = LOWORD(dwParam);
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("Linux 'AUX_SetVolume' // mixer device not available !\n");
......@@ -225,7 +225,7 @@ DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
printf("auxMessage(%u, %04X, %08X, %08X, %08X);\n",
printf("auxMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch(wMsg) {
case AUXDM_GETDEVCAPS:
......
......@@ -11,7 +11,6 @@ SRCS = \
dc.c \
dcvalues.c \
dib.c \
dither.c \
font.c \
gdiobj.c \
linedda.c \
......
......@@ -204,9 +204,9 @@ LONG SetBitmapBits( HBITMAP hbitmap, LONG count, LPSTR buffer )
/***********************************************************************
* BMP_DeleteObject
* BITMAP_DeleteObject
*/
BOOL BMP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap )
BOOL BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap )
{
XFreePixmap( display, bitmap->pixmap );
return GDI_FreeObject( hbitmap );
......@@ -214,9 +214,9 @@ BOOL BMP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap )
/***********************************************************************
* BMP_GetObject
* BITMAP_GetObject
*/
int BMP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer )
int BITMAP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer )
{
if (count > sizeof(BITMAP)) count = sizeof(BITMAP);
memcpy( buffer, &bmp->bitmap, count );
......
/*
* GDI brush objects
*
* Copyright 1993 Alexandre Julliard
*
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
* Copyright 1993, 1994 Alexandre Julliard
*/
#include "gdi.h"
#include <stdlib.h>
#include "brush.h"
#include "bitmap.h"
#include "metafile.h"
#include "stddebug.h"
#include "color.h"
#include "stddebug.h"
#include "debug.h"
#define NB_HATCH_STYLES 6
static char HatchBrushes[NB_HATCH_STYLES][8] =
static const char HatchBrushes[NB_HATCH_STYLES][8] =
{
{ 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00 }, /* HS_HORIZONTAL */
{ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 }, /* HS_VERTICAL */
......@@ -25,6 +24,118 @@ static char HatchBrushes[NB_HATCH_STYLES][8] =
{ 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81 } /* HS_DIAGCROSS */
};
/* Levels of each primary for dithering */
#define PRIMARY_LEVELS 3
#define TOTAL_LEVELS (PRIMARY_LEVELS*PRIMARY_LEVELS*PRIMARY_LEVELS)
/* Dithering matrix size */
#define MATRIX_SIZE 8
#define MATRIX_SIZE_2 (MATRIX_SIZE*MATRIX_SIZE)
/* Total number of possible levels for a dithered primary color */
#define DITHER_LEVELS (MATRIX_SIZE_2 * (PRIMARY_LEVELS-1) + 1)
/* Dithering matrix */
static const int dither_matrix[MATRIX_SIZE_2] =
{
0, 32, 8, 40, 2, 34, 10, 42,
48, 16, 56, 24, 50, 18, 58, 26,
12, 44, 4, 36, 14, 46, 6, 38,
60, 28, 52, 20, 62, 30, 54, 22,
3, 35, 11, 43, 1, 33, 9, 41,
51, 19, 59, 27, 49, 17, 57, 25,
15, 47, 7, 39, 13, 45, 5, 37,
63, 31, 55, 23, 61, 29, 53, 21
};
/* Mapping between (R,G,B) triples and EGA colors */
static const int EGAmapping[TOTAL_LEVELS] =
{
0, /* 000000 -> 000000 */
4, /* 00007f -> 000080 */
12, /* 0000ff -> 0000ff */
2, /* 007f00 -> 008000 */
6, /* 007f7f -> 008080 */
6, /* 007fff -> 008080 */
10, /* 00ff00 -> 00ff00 */
6, /* 00ff7f -> 008080 */
14, /* 00ffff -> 00ffff */
1, /* 7f0000 -> 800000 */
5, /* 7f007f -> 800080 */
5, /* 7f00ff -> 800080 */
3, /* 7f7f00 -> 808000 */
8, /* 7f7f7f -> 808080 */
7, /* 7f7fff -> c0c0c0 */
3, /* 7fff00 -> 808000 */
7, /* 7fff7f -> c0c0c0 */
7, /* 7fffff -> c0c0c0 */
9, /* ff0000 -> ff0000 */
5, /* ff007f -> 800080 */
13, /* ff00ff -> ff00ff */
3, /* ff7f00 -> 808000 */
7, /* ff7f7f -> c0c0c0 */
7, /* ff7fff -> c0c0c0 */
11, /* ffff00 -> ffff00 */
7, /* ffff7f -> c0c0c0 */
15 /* ffffff -> ffffff */
};
#define PIXEL_VALUE(r,g,b) \
COLOR_mapEGAPixel[EGAmapping[((r)*PRIMARY_LEVELS+(g))*PRIMARY_LEVELS+(b)]]
/* X image for building dithered pixmap */
static XImage *ditherImage = NULL;
/***********************************************************************
* BRUSH_Init
*
* Create the X image used for dithering.
*/
BOOL BRUSH_Init(void)
{
XCREATEIMAGE( ditherImage, MATRIX_SIZE, MATRIX_SIZE, screenDepth );
return (ditherImage != NULL);
}
/***********************************************************************
* BRUSH_DitherColor
*/
Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
{
static COLORREF prevColor = 0xffffffff;
unsigned int x, y;
Pixmap pixmap;
if (color != prevColor)
{
int r = GetRValue( color ) * DITHER_LEVELS;
int g = GetGValue( color ) * DITHER_LEVELS;
int b = GetBValue( color ) * DITHER_LEVELS;
const int *pmatrix = dither_matrix;
for (y = 0; y < MATRIX_SIZE; y++)
{
for (x = 0; x < MATRIX_SIZE; x++)
{
int d = *pmatrix++ * 256;
int dr = ((r + d) / MATRIX_SIZE_2) / 256;
int dg = ((g + d) / MATRIX_SIZE_2) / 256;
int db = ((b + d) / MATRIX_SIZE_2) / 256;
XPutPixel( ditherImage, x, y, PIXEL_VALUE(dr,dg,db) );
}
}
prevColor = color;
}
pixmap = XCreatePixmap( display, rootWindow,
MATRIX_SIZE, MATRIX_SIZE, screenDepth );
XPutImage( display, pixmap, BITMAP_colorGC, ditherImage, 0, 0,
0, 0, MATRIX_SIZE, MATRIX_SIZE );
return pixmap;
}
/***********************************************************************
* CreateBrushIndirect (GDI.50)
......@@ -172,14 +283,14 @@ int BRUSH_GetObject( BRUSHOBJ * brush, int count, LPSTR buffer )
/***********************************************************************
* BRUSH_MakeSolidBrush
* BRUSH_SelectSolidBrush
*/
static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
{
if ((dc->w.bitsPerPixel > 1) && (screenDepth <= 8) && !COLOR_IsSolid( color ))
{
/* Dithered brush */
dc->u.x.brush.pixmap = DITHER_DitherColor( dc, color );
dc->u.x.brush.pixmap = BRUSH_DitherColor( dc, color );
dc->u.x.brush.fillStyle = FillTiled;
dc->u.x.brush.pixel = 0;
}
......
......@@ -5,7 +5,7 @@
*/
#include <stdio.h>
#include "gdi.h"
#include "region.h"
#include "metafile.h"
#include "stddebug.h"
/* #define DEBUG_CLIPPING */
......
......@@ -114,7 +114,7 @@ static HPALETTE COLOR_InitPalette(void)
colorTranslation = (WORD *) GDI_HEAP_ADDR( hSysColorTranslation );
revTranslation = (WORD *) GDI_HEAP_ADDR( hRevSysColorTranslation );
if (COLOR_WinColormap == DefaultColormapOfScreen(screen))
if ((COLOR_WinColormap == DefaultColormapOfScreen(screen)) && (screenDepth <= 8))
{
COLOR_PaletteToPixel = (int *)malloc( sizeof(int) * size );
COLOR_PixelToPalette = (int *)malloc( sizeof(int) * size );
......@@ -151,7 +151,7 @@ static HPALETTE COLOR_InitPalette(void)
fprintf(stderr, "Warning: Not enough free colors. Try using the -privatemap option.\n" );
color.pixel = color.red = color.green = color.blue = 0;
}
else
else if (COLOR_PaletteToPixel)
{
COLOR_PaletteToPixel[pixel] = color.pixel;
COLOR_PixelToPalette[color.pixel] = pixel;
......@@ -254,6 +254,14 @@ int COLOR_ToPhysical( DC *dc, COLORREF color )
WORD *mapping;
if (screenDepth > 8) return color;
if (dc && (dc->w.bitsPerPixel == 1) && ((color >> 24) == 0))
{
if (((color >> 16) & 0xff) +
((color >> 8) & 0xff) + (color & 0xff) > 255*3/2)
return 1; /* white */
else return 0; /* black */
}
switch(color >> 24)
{
case 0: /* RGB */
......
......@@ -3,8 +3,8 @@
*
* Copyright 1993 Alexandre Julliard
*
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
*/
#include <stdlib.h>
#include <string.h>
#include "gdi.h"
......@@ -17,9 +17,57 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
static DeviceCaps * displayDevCaps = NULL;
extern const WIN_DC_INFO DCVAL_defaultValues;
extern void CLIPPING_UpdateGCRegion( DC * dc ); /* objects/clipping.c */
/* Default DC values */
static const WIN_DC_INFO DC_defaultValues =
{
0, /* flags */
NULL, /* devCaps */
0, /* hMetaFile */
0, /* hClipRgn */
0, /* hVisRgn */
0, /* hGCClipRgn */
STOCK_BLACK_PEN, /* hPen */
STOCK_WHITE_BRUSH, /* hBrush */
STOCK_SYSTEM_FONT, /* hFont */
0, /* hBitmap */
0, /* hFirstBitmap */
0, /* hDevice */
STOCK_DEFAULT_PALETTE, /* hPalette */
R2_COPYPEN, /* ROPmode */
ALTERNATE, /* polyFillMode */
BLACKONWHITE, /* stretchBltMode */
ABSOLUTE, /* relAbsMode */
OPAQUE, /* backgroundMode */
RGB( 255, 255, 255 ), /* backgroundColor */
RGB( 0, 0, 0 ), /* textColor */
0, /* backgroundPixel */
0, /* textPixel */
0, /* brushOrgX */
0, /* brushOrgY */
TA_LEFT | TA_TOP | TA_NOUPDATECP, /* textAlign */
0, /* charExtra */
0, /* breakTotalExtra */
0, /* breakCount */
0, /* breakExtra */
0, /* breakRem */
1, /* bitsPerPixel */
MM_TEXT, /* MapMode */
0, /* DCOrgX */
0, /* DCOrgY */
0, /* CursPosX */
0, /* CursPosY */
0, /* WndOrgX */
0, /* WndOrgY */
1, /* WndExtX */
1, /* WndExtY */
0, /* VportOrgX */
0, /* VportOrgY */
1, /* VportExtX */
1 /* VportExtY */
};
/* ROP code to GC function conversion */
const int DC_XROPfunction[16] =
{
......@@ -109,17 +157,19 @@ void DC_InitDC( HDC hdc )
/***********************************************************************
* DC_SetupDCForBrush
* DC_SetupDCForPatBlt
*
* Setup dc->u.x.gc for drawing operations using current brush.
* Return 0 if brush is BS_NULL, 1 otherwise.
* Setup the GC for a PatBlt operation using current brush.
* If fMapColors is TRUE, X pixels are mapped to Windows colors.
* Return FALSE if brush is BS_NULL, TRUE otherwise.
*/
int DC_SetupGCForBrush( DC * dc )
BOOL DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
{
XGCValues val;
unsigned long mask = 0;
unsigned long mask;
Pixmap pixmap = 0;
if (dc->u.x.brush.style == BS_NULL) return 0;
if (dc->u.x.brush.style == BS_NULL) return FALSE;
if (dc->u.x.brush.pixel == -1)
{
/* Special case used for monochrome pattern brushes.
......@@ -134,27 +184,68 @@ int DC_SetupGCForBrush( DC * dc )
val.foreground = dc->u.x.brush.pixel;
val.background = dc->w.backgroundPixel;
}
if (fMapColors && COLOR_PixelToPalette)
{
val.foreground = COLOR_PixelToPalette[val.foreground];
val.background = COLOR_PixelToPalette[val.background];
}
val.function = DC_XROPfunction[dc->w.ROPmode-1];
val.fill_style = dc->u.x.brush.fillStyle;
if ((val.fill_style==FillStippled) || (val.fill_style==FillOpaqueStippled))
switch(val.fill_style)
{
case FillStippled:
case FillOpaqueStippled:
if (dc->w.backgroundMode==OPAQUE) val.fill_style = FillOpaqueStippled;
val.stipple = dc->u.x.brush.pixmap;
mask = GCStipple;
}
else if (val.fill_style == FillTiled)
{
val.tile = dc->u.x.brush.pixmap;
break;
case FillTiled:
if (fMapColors && COLOR_PixelToPalette)
{
register int x, y;
XImage *image;
pixmap = XCreatePixmap( display, rootWindow, 8, 8, screenDepth );
image = XGetImage( display, dc->u.x.brush.pixmap, 0, 0, 8, 8,
AllPlanes, ZPixmap );
for (y = 0; y < 8; y++)
for (x = 0; x < 8; x++)
XPutPixel( image, x, y,
COLOR_PixelToPalette[XGetPixel( image, x, y)] );
XPutImage( display, pixmap, gc, image, 0, 0, 0, 0, 8, 8 );
XDestroyImage( image );
val.tile = pixmap;
}
else val.tile = dc->u.x.brush.pixmap;
mask = GCTile;
break;
default:
mask = 0;
break;
}
val.ts_x_origin = dc->w.DCOrgX + dc->w.brushOrgX;
val.ts_y_origin = dc->w.DCOrgY + dc->w.brushOrgY;
val.fill_rule = (dc->w.polyFillMode==WINDING) ? WindingRule : EvenOddRule;
XChangeGC( display, dc->u.x.gc,
XChangeGC( display, gc,
GCFunction | GCForeground | GCBackground | GCFillStyle |
GCFillRule | GCTileStipXOrigin | GCTileStipYOrigin | mask,
&val );
return 1;
if (pixmap) XFreePixmap( display, pixmap );
return TRUE;
}
/***********************************************************************
* DC_SetupDCForBrush
*
* Setup dc->u.x.gc for drawing operations using current brush.
* Return FALSE if brush is BS_NULL, TRUE otherwise.
*/
BOOL DC_SetupGCForBrush( DC * dc )
{
return DC_SetupGCForPatBlt( dc, dc->u.x.gc, FALSE );
}
......@@ -162,13 +253,13 @@ int DC_SetupGCForBrush( DC * dc )
* DC_SetupDCForPen
*
* Setup dc->u.x.gc for drawing operations using current pen.
* Return 0 if pen is PS_NULL, 1 otherwise.
* Return FALSE if pen is PS_NULL, TRUE otherwise.
*/
int DC_SetupGCForPen( DC * dc )
BOOL DC_SetupGCForPen( DC * dc )
{
XGCValues val;
if (dc->u.x.pen.style == PS_NULL) return 0;
if (dc->u.x.pen.style == PS_NULL) return FALSE;
val.function = DC_XROPfunction[dc->w.ROPmode-1];
val.foreground = dc->u.x.pen.pixel;
val.background = dc->w.backgroundPixel;
......@@ -187,7 +278,7 @@ int DC_SetupGCForPen( DC * dc )
XChangeGC( display, dc->u.x.gc,
GCFunction | GCForeground | GCBackground | GCLineWidth |
GCLineStyle | GCCapStyle | GCJoinStyle | GCFillStyle, &val );
return 1;
return TRUE;
}
......@@ -195,15 +286,16 @@ int DC_SetupGCForPen( DC * dc )
* DC_SetupGCForText
*
* Setup dc->u.x.gc for text drawing operations.
* Return 0 if the font is null, 1 otherwise.
* Return FALSE if the font is null, TRUE otherwise.
*/
int DC_SetupGCForText( DC * dc )
BOOL DC_SetupGCForText( DC * dc )
{
XGCValues val;
if (!dc->u.x.font.fstruct)
{
FONT_SelectObject(dc, STOCK_SYSTEM_FONT, NULL);
fprintf( stderr, "DC_SetupGCForText: fstruct is NULL. Please report this\n" );
return FALSE;
}
val.function = GXcopy; /* Text is always GXcopy */
val.foreground = dc->w.textPixel;
......@@ -213,7 +305,7 @@ int DC_SetupGCForText( DC * dc )
XChangeGC( display, dc->u.x.gc,
GCFunction | GCForeground | GCBackground | GCFillStyle |
GCFont, &val );
return 1;
return TRUE;
}
......@@ -364,7 +456,7 @@ HDC CreateDC( LPSTR driver, LPSTR device, LPSTR output, LPSTR initData )
}
dc->saveLevel = 0;
memcpy( &dc->w, &DCVAL_defaultValues, sizeof(DCVAL_defaultValues) );
memcpy( &dc->w, &DC_defaultValues, sizeof(DC_defaultValues) );
memset( &dc->u.x, 0, sizeof(dc->u.x) );
dc->u.x.drawable = rootWindow;
......@@ -421,7 +513,7 @@ HDC CreateCompatibleDC( HDC hdc )
bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
dc->saveLevel = 0;
memcpy( &dc->w, &DCVAL_defaultValues, sizeof(DCVAL_defaultValues) );
memcpy( &dc->w, &DC_defaultValues, sizeof(DC_defaultValues) );
memset( &dc->u.x, 0, sizeof(dc->u.x) );
dc->u.x.drawable = bmp->pixmap;
......@@ -430,6 +522,7 @@ HDC CreateCompatibleDC( HDC hdc )
dc->w.bitsPerPixel = 1;
dc->w.devCaps = displayDevCaps;
dc->w.hBitmap = hbitmap;
dc->w.hFirstBitmap = hbitmap;
dc->w.hVisRgn = CreateRectRgn( 0, 0, 1, 1 );
if (!dc->w.hVisRgn)
......@@ -473,8 +566,7 @@ BOOL DeleteDC( HDC hdc )
XFreeGC( display, dc->u.x.gc );
}
if (dc->w.flags & DC_MEMORY) DeleteObject( dc->w.hBitmap );
if (dc->w.flags & DC_MEMORY) DeleteObject( dc->w.hFirstBitmap );
if (dc->w.hClipRgn) DeleteObject( dc->w.hClipRgn );
if (dc->w.hVisRgn) DeleteObject( dc->w.hVisRgn );
if (dc->w.hGCClipRgn) DeleteObject( dc->w.hGCClipRgn );
......
......@@ -8,54 +8,6 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "gdi.h"
#include "metafile.h"
/* Default DC values */
const WIN_DC_INFO DCVAL_defaultValues =
{
0, /* flags */
NULL, /* devCaps */
0, /* hMetaFile */
0, /* hClipRgn */
0, /* hVisRgn */
0, /* hGCClipRgn */
STOCK_BLACK_PEN, /* hPen */
STOCK_WHITE_BRUSH, /* hBrush */
STOCK_SYSTEM_FONT, /* hFont */
0, /* hBitmap */
0, /* hDevice */
STOCK_DEFAULT_PALETTE, /* hPalette */
R2_COPYPEN, /* ROPmode */
ALTERNATE, /* polyFillMode */
BLACKONWHITE, /* stretchBltMode */
ABSOLUTE, /* relAbsMode */
OPAQUE, /* backgroundMode */
RGB( 255, 255, 255 ), /* backgroundColor */
RGB( 0, 0, 0 ), /* textColor */
0, /* backgroundPixel */
0, /* textPixel */
0, /* brushOrgX */
0, /* brushOrgY */
TA_LEFT | TA_TOP | TA_NOUPDATECP, /* textAlign */
0, /* charExtra */
0, /* breakTotalExtra */
0, /* breakCount */
0, /* breakExtra */
0, /* breakRem */
1, /* bitsPerPixel */
MM_TEXT, /* MapMode */
0, /* DCOrgX */
0, /* DCOrgY */
0, /* CursPosX */
0, /* CursPosY */
0, /* WndOrgX */
0, /* WndOrgY */
1, /* WndExtX */
1, /* WndExtY */
0, /* VportOrgX */
0, /* VportOrgY */
1, /* VportExtX */
1 /* VportExtY */
};
#define DC_GET_VAL( func_type, func_name, dc_field ) \
func_type func_name( HDC hdc ) \
......
......@@ -9,8 +9,8 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "dc.h"
#include "gdi.h"
#include "bitmap.h"
#include "palette.h"
#include "icon.h"
#include "stddebug.h"
#include "color.h"
......@@ -395,7 +395,7 @@ static void DIB_SetImageBits_RLE8(WORD lines,
* bytes are always read in pairs. [JAY]
*/
if (escape_code & 1)
(*pIn++); /* Get and throw away the pad byte. */
pIn++; /* Throw away the pad byte. */
break;
}
} /* switch (escape_code) : Escape sequence */
......
/*
* Dithering functions
*
* Copyright 1994 Alexandre Julliard
*
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
*/
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "color.h"
#include "gdi.h"
#include "bitmap.h"
/* Levels of each primary */
#define PRIMARY_LEVELS 3
#define TOTAL_LEVELS (PRIMARY_LEVELS*PRIMARY_LEVELS*PRIMARY_LEVELS)
/* Dithering matrix size */
#define MATRIX_SIZE 8
#define MATRIX_SIZE_2 (MATRIX_SIZE*MATRIX_SIZE)
/* Total number of possible levels for a dithered primary color */
#define DITHER_LEVELS (MATRIX_SIZE_2 * (PRIMARY_LEVELS-1) + 1)
/* Dithering matrix */
static const int dither_matrix[MATRIX_SIZE_2] =
{
0, 32, 8, 40, 2, 34, 10, 42,
48, 16, 56, 24, 50, 18, 58, 26,
12, 44, 4, 36, 14, 46, 6, 38,
60, 28, 52, 20, 62, 30, 54, 22,
3, 35, 11, 43, 1, 33, 9, 41,
51, 19, 59, 27, 49, 17, 57, 25,
15, 47, 7, 39, 13, 45, 5, 37,
63, 31, 55, 23, 61, 29, 53, 21
};
/* Mapping between (R,G,B) triples and EGA colors */
static const int EGAmapping[TOTAL_LEVELS] =
{
0, /* 000000 -> 000000 */
4, /* 00007f -> 000080 */
12, /* 0000ff -> 0000ff */
2, /* 007f00 -> 008000 */
6, /* 007f7f -> 008080 */
6, /* 007fff -> 008080 */
10, /* 00ff00 -> 00ff00 */
6, /* 00ff7f -> 008080 */
14, /* 00ffff -> 00ffff */
1, /* 7f0000 -> 800000 */
5, /* 7f007f -> 800080 */
5, /* 7f00ff -> 800080 */
3, /* 7f7f00 -> 808000 */
8, /* 7f7f7f -> 808080 */
7, /* 7f7fff -> c0c0c0 */
3, /* 7fff00 -> 808000 */
7, /* 7fff7f -> c0c0c0 */
7, /* 7fffff -> c0c0c0 */
9, /* ff0000 -> ff0000 */
5, /* ff007f -> 800080 */
13, /* ff00ff -> ff00ff */
3, /* ff7f00 -> 808000 */
7, /* ff7f7f -> c0c0c0 */
7, /* ff7fff -> c0c0c0 */
11, /* ffff00 -> ffff00 */
7, /* ffff7f -> c0c0c0 */
15 /* ffffff -> ffffff */
};
#define PIXEL_VALUE(r,g,b) \
COLOR_mapEGAPixel[EGAmapping[((r)*PRIMARY_LEVELS+(g))*PRIMARY_LEVELS+(b)]]
/* X image for building dithered pixmap */
static XImage *ditherImage = NULL;
static char *imageData = NULL;
/***********************************************************************
* DITHER_Init
*
* Create the X image used for dithering.
*/
BOOL DITHER_Init(void)
{
XCREATEIMAGE( ditherImage, MATRIX_SIZE, MATRIX_SIZE, screenDepth );
return (ditherImage != NULL);
}
/***********************************************************************
* DITHER_DitherColor
*/
Pixmap DITHER_DitherColor( DC *dc, COLORREF color )
{
static COLORREF prevColor = 0xffffffff;
unsigned int x, y;
Pixmap pixmap;
if (color != prevColor)
{
int r = GetRValue( color ) * DITHER_LEVELS;
int g = GetGValue( color ) * DITHER_LEVELS;
int b = GetBValue( color ) * DITHER_LEVELS;
const int *pmatrix = dither_matrix;
for (y = 0; y < MATRIX_SIZE; y++)
{
for (x = 0; x < MATRIX_SIZE; x++)
{
int d = *pmatrix++ * 256;
int dr = ((r + d) / MATRIX_SIZE_2) / 256;
int dg = ((g + d) / MATRIX_SIZE_2) / 256;
int db = ((b + d) / MATRIX_SIZE_2) / 256;
XPutPixel( ditherImage, x, y, PIXEL_VALUE(dr,dg,db) );
}
}
prevColor = color;
}
pixmap = XCreatePixmap( display, rootWindow,
MATRIX_SIZE, MATRIX_SIZE, screenDepth );
XPutImage( display, pixmap, BITMAP_colorGC, ditherImage, 0, 0,
0, 0, MATRIX_SIZE, MATRIX_SIZE );
return pixmap;
}
......@@ -10,8 +10,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <stdlib.h>
#include <string.h>
#include <X11/Xatom.h>
#include "user.h"
#include "gdi.h"
#include "font.h"
#include "metafile.h"
#include "callback.h"
#include "stddebug.h"
......@@ -55,11 +54,11 @@ struct FontStructure {
} FontNames[32];
int FontSize;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Font_Init
*/
void Font_Init( void )
/***********************************************************************
* FONT_Init
*/
BOOL FONT_Init( void )
{
char temp[1024];
LPSTR ptr;
......@@ -88,8 +87,10 @@ void Font_Init( void )
FontNames[6].window = "roman"; FontNames[6].x11 = "*-times";
FontSize = 7;
}
return TRUE;
}
/***********************************************************************
* FONT_TranslateName
*
......@@ -212,11 +213,13 @@ void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont,
metrics->tmLastChar = xfont->max_char_or_byte2;
metrics->tmDefaultChar = xfont->default_char;
metrics->tmBreakChar = ' ';
metrics->tmPitchAndFamily = logfont->lfPitchAndFamily;
metrics->tmCharSet = logfont->lfCharSet;
metrics->tmOverhang = 0;
metrics->tmDigitizedAspectX = 1;
metrics->tmDigitizedAspectY = 1;
metrics->tmPitchAndFamily = (logfont->lfPitchAndFamily&0xf0)|TMPF_DEVICE;
if (logfont->lfPitchAndFamily & FIXED_PITCH)
metrics->tmPitchAndFamily |= TMPF_FIXED_PITCH;
if (!xfont->per_char) average = metrics->tmMaxCharWidth;
else
......@@ -313,16 +316,29 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
if (!stockPtr || !stockPtr->fstruct)
{
fontStruct = FONT_MatchFont( &font->logfont, dc );
if (!(fontStruct = FONT_MatchFont( &font->logfont, dc )))
{
/* If it is not a stock font, we can simply return 0 */
if (!stockPtr) return 0;
/* Otherwise we must try to find a substitute */
dprintf_font(stddeb,"Loading font 'fixed' for %x\n", hfont );
font->logfont.lfPitchAndFamily &= ~VARIABLE_PITCH;
font->logfont.lfPitchAndFamily |= FIXED_PITCH;
fontStruct = XLoadQueryFont( display, "fixed" );
if (!fontStruct)
{
fprintf( stderr, "No system font could be found. Please check your font path.\n" );
exit( 1 );
}
}
}
else
{
fontStruct = stockPtr->fstruct;
dprintf_font(stddeb,
"FONT_SelectObject: Loaded font from cache %x %p\n",
dprintf_font(stddeb,
"FONT_SelectObject: Loaded font from cache %x %p\n",
hfont, fontStruct );
}
if (!fontStruct) return 0;
/* Free previous font */
......@@ -451,8 +467,8 @@ BOOL GetTextExtentPoint( HDC hdc, LPSTR str, short count, LPSIZE size )
size->cy = abs((dc->u.x.font.fstruct->ascent+dc->u.x.font.fstruct->descent)
* dc->w.WndExtY / dc->w.VportExtY);
dprintf_font(stddeb,"GetTextExtentPoint(%d '%s' %d %p): returning %d,%d\n",
hdc, str, count, size, size->cx, size->cy );
dprintf_font(stddeb,"GetTextExtentPoint(%d '%*.*s' %d %p): returning %d,%d\n",
hdc, count, count, str, count, size, size->cx, size->cy );
return TRUE;
}
......@@ -669,19 +685,19 @@ int EnumFonts(HDC hDC, LPSTR lpFaceName, FARPROC lpEnumFunc, LPSTR lpData)
int nRet;
int j, i = 0;
dprintf_font(stddeb,"EnumFonts(%04X, %08X='%s', %08X, %08X)\n",
dprintf_font(stddeb,"EnumFonts(%04X, %p='%s', %p, %p)\n",
hDC, lpFaceName, lpFaceName, lpEnumFunc, lpData);
if (lpEnumFunc == NULL) return 0;
hLog = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGFONT) + LF_FACESIZE);
lpLogFont = (LPLOGFONT) USER_HEAP_ADDR(hLog);
hLog = GDI_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGFONT) + LF_FACESIZE);
lpLogFont = (LPLOGFONT) GDI_HEAP_ADDR(hLog);
if (lpLogFont == NULL) {
dprintf_font(stddeb,"EnumFonts // can't alloc LOGFONT struct !\n");
return 0;
}
hMet = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(TEXTMETRIC));
lptm = (LPTEXTMETRIC) USER_HEAP_ADDR(hMet);
hMet = GDI_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(TEXTMETRIC));
lptm = (LPTEXTMETRIC) GDI_HEAP_ADDR(hMet);
if (lptm == NULL) {
USER_HEAP_FREE(hLog);
GDI_HEAP_FREE(hLog);
dprintf_font(stddeb, "EnumFonts // can't alloc TEXTMETRIC struct !\n");
return 0;
}
......@@ -718,7 +734,7 @@ int EnumFonts(HDC hDC, LPSTR lpFaceName, FARPROC lpEnumFunc, LPSTR lpData)
GetTextMetrics(hDC, lptm);
SelectObject(hDC, hOldFont);
DeleteObject(hFont);
dprintf_font(stddeb,"EnumFonts // i=%d lpLogFont=%08X lptm=%08X\n", i, lpLogFont, lptm);
dprintf_font(stddeb,"EnumFonts // i=%d lpLogFont=%p lptm=%p\n", i, lpLogFont, lptm);
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
......@@ -731,8 +747,8 @@ int EnumFonts(HDC hDC, LPSTR lpFaceName, FARPROC lpEnumFunc, LPSTR lpData)
break;
}
}
USER_HEAP_FREE(hMet);
USER_HEAP_FREE(hLog);
GDI_HEAP_FREE(hMet);
GDI_HEAP_FREE(hLog);
return 0;
}
......@@ -753,19 +769,19 @@ int EnumFontFamilies(HDC hDC, LPSTR lpszFamily, FARPROC lpEnumFunc, LPSTR lpData
int nRet;
int j, i = 0;
dprintf_font(stddeb,"EnumFontFamilies(%04X, %08X, %08X, %08X)\n",
dprintf_font(stddeb,"EnumFontFamilies(%04X, %p, %p, %p)\n",
hDC, lpszFamily, lpEnumFunc, lpData);
if (lpEnumFunc == NULL) return 0;
hLog = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGFONT) + LF_FACESIZE);
lpLogFont = (LPLOGFONT) USER_HEAP_ADDR(hLog);
hLog = GDI_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGFONT) + LF_FACESIZE);
lpLogFont = (LPLOGFONT) GDI_HEAP_ADDR(hLog);
if (lpLogFont == NULL) {
dprintf_font(stddeb,"EnumFontFamilies // can't alloc LOGFONT struct !\n");
return 0;
}
hMet = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(TEXTMETRIC));
lptm = (LPTEXTMETRIC) USER_HEAP_ADDR(hMet);
hMet = GDI_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(TEXTMETRIC));
lptm = (LPTEXTMETRIC) GDI_HEAP_ADDR(hMet);
if (lptm == NULL) {
USER_HEAP_FREE(hLog);
GDI_HEAP_FREE(hLog);
dprintf_font(stddeb,"EnumFontFamilies // can't alloc TEXTMETRIC struct !\n");
return 0;
}
......@@ -803,7 +819,7 @@ int EnumFontFamilies(HDC hDC, LPSTR lpszFamily, FARPROC lpEnumFunc, LPSTR lpData
GetTextMetrics(hDC, lptm);
SelectObject(hDC, hOldFont);
DeleteObject(hFont);
dprintf_font(stddeb, "EnumFontFamilies // i=%d lpLogFont=%08X lptm=%08X\n", i, lpLogFont, lptm);
dprintf_font(stddeb, "EnumFontFamilies // i=%d lpLogFont=%p lptm=%p\n", i, lpLogFont, lptm);
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
......@@ -816,8 +832,8 @@ int EnumFontFamilies(HDC hDC, LPSTR lpszFamily, FARPROC lpEnumFunc, LPSTR lpData
break;
}
}
USER_HEAP_FREE(hMet);
USER_HEAP_FREE(hLog);
GDI_HEAP_FREE(hMet);
GDI_HEAP_FREE(hLog);
return 0;
}
......
......@@ -8,13 +8,16 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <stdlib.h>
#include <stdio.h>
#include "user.h"
#include "selectors.h"
#include "gdi.h"
#include "color.h"
#include "prototypes.h"
#include "stddebug.h"
#include "bitmap.h"
#include "brush.h"
#include "font.h"
#include "palette.h"
#include "pen.h"
#include "region.h"
#include "stddebug.h"
/* #define DEBUG_GDI */
#include "debug.h"
......@@ -27,6 +30,7 @@ MDESC *GDI_Heap = NULL;
#define MAX_OBJ 1024
HANDLE *lpPenBrushList = NULL;
/***********************************************************************
* GDI stock objects
*/
......@@ -181,9 +185,13 @@ BOOL GDI_Init(void)
if (!REGION_Init()) return FALSE;
/* Initialise dithering */
/* Initialise brush dithering */
if (!BRUSH_Init()) return FALSE;
/* Initialise fonts */
if (!DITHER_Init()) return FALSE;
if (!FONT_Init()) return FALSE;
return TRUE;
}
......@@ -312,11 +320,11 @@ BOOL DeleteObject( HANDLE obj )
switch(header->wMagic)
{
case PEN_MAGIC: return GDI_FreeObject( obj );
case BRUSH_MAGIC: return BRUSH_DeleteObject( obj, header );
case BRUSH_MAGIC: return BRUSH_DeleteObject( obj, (BRUSHOBJ*)header );
case FONT_MAGIC: return GDI_FreeObject( obj );
case PALETTE_MAGIC: return GDI_FreeObject( obj );
case BITMAP_MAGIC: return BMP_DeleteObject( obj, header );
case REGION_MAGIC: return REGION_DeleteObject( obj, header );
case BITMAP_MAGIC: return BITMAP_DeleteObject( obj, (BITMAPOBJ*)header);
case REGION_MAGIC: return REGION_DeleteObject( obj, (RGNOBJ*)header );
}
return FALSE;
}
......@@ -359,7 +367,7 @@ int GetObject( HANDLE handle, int count, LPSTR buffer )
case BRUSH_MAGIC:
return BRUSH_GetObject( (BRUSHOBJ *)ptr, count, buffer );
case BITMAP_MAGIC:
return BMP_GetObject( (BITMAPOBJ *)ptr, count, buffer );
return BITMAP_GetObject( (BITMAPOBJ *)ptr, count, buffer );
case FONT_MAGIC:
return FONT_GetObject( (FONTOBJ *)ptr, count, buffer );
case PALETTE_MAGIC:
......@@ -440,10 +448,10 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
switch (nObjType) {
case OBJ_PEN:
wMagic = PEN_MAGIC;
dprintf_gdi(stddeb,"EnumObjects(%04X, OBJ_PEN, %08X, %08X);\n",
dprintf_gdi(stddeb,"EnumObjects(%04X, OBJ_PEN, %p, %p);\n",
hDC, lpEnumFunc, lpData);
hLog = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGPEN));
lpLog = (LPSTR) USER_HEAP_ADDR(hLog);
hLog = GDI_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGPEN));
lpLog = (LPSTR) GDI_HEAP_ADDR(hLog);
if (lpLog == NULL) {
fprintf(stderr,"EnumObjects // Unable to alloc LOGPEN struct !\n");
return 0;
......@@ -451,17 +459,17 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
break;
case OBJ_BRUSH:
wMagic = BRUSH_MAGIC;
dprintf_gdi(stddeb,"EnumObjects(%04X, OBJ_BRUSH, %08X, %08X);\n",
dprintf_gdi(stddeb,"EnumObjects(%04X, OBJ_BRUSH, %p, %p);\n",
hDC, lpEnumFunc, lpData);
hLog = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGBRUSH));
lpLog = (LPSTR) USER_HEAP_ADDR(hLog);
hLog = GDI_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGBRUSH));
lpLog = (LPSTR) GDI_HEAP_ADDR(hLog);
if (lpLog == NULL) {
fprintf(stderr,"EnumObjects // Unable to alloc LOGBRUSH struct !\n");
return 0;
}
break;
default:
fprintf(stderr,"EnumObjects(%04X, %04X, %08X, %08X); // Unknown OBJ type !\n",
fprintf(stderr,"EnumObjects(%04X, %04X, %p, %p); // Unknown OBJ type !\n",
hDC, nObjType, lpEnumFunc, lpData);
return 0;
}
......@@ -469,18 +477,18 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
for (i = 0; i < NB_STOCK_OBJECTS; i++) {
header = StockObjects[i];
if (header->wMagic == wMagic) {
PEN_GetObject( (PENOBJ *)header, sizeof(LOGPEN), (LPLOGPEN)lpLog);
BRUSH_GetObject( (BRUSHOBJ *)header, sizeof(LOGBRUSH), (LPLOGBRUSH)lpLog);
dprintf_gdi(stddeb,"EnumObjects // StockObj lpLog=%08X lpData=%08X\n", lpLog, lpData);
PEN_GetObject( (PENOBJ *)header, sizeof(LOGPEN), lpLog);
BRUSH_GetObject( (BRUSHOBJ *)header, sizeof(LOGBRUSH),lpLog);
dprintf_gdi(stddeb,"EnumObjects // StockObj lpLog=%p lpData=%p\n", lpLog, lpData);
if (header->wMagic == BRUSH_MAGIC) {
dprintf_gdi(stddeb,"EnumObjects // StockBrush lbStyle=%04X\n", ((LPLOGBRUSH)lpLog)->lbStyle);
dprintf_gdi(stddeb,"EnumObjects // StockBrush lbColor=%08X\n", ((LPLOGBRUSH)lpLog)->lbColor);
dprintf_gdi(stddeb,"EnumObjects // StockBrush lbColor=%08lX\n", ((LPLOGBRUSH)lpLog)->lbColor);
dprintf_gdi(stddeb,"EnumObjects // StockBrush lbHatch=%04X\n", ((LPLOGBRUSH)lpLog)->lbHatch);
}
if (header->wMagic == PEN_MAGIC) {
dprintf_gdi(stddeb,"EnumObjects // StockPen lopnStyle=%04X\n", ((LPLOGPEN)lpLog)->lopnStyle);
dprintf_gdi(stddeb,"EnumObjects // StockPen lopnWidth=%08X\n", ((LPLOGPEN)lpLog)->lopnWidth);
dprintf_gdi(stddeb,"EnumObjects // StockPen lopnColor=%08X\n", ((LPLOGPEN)lpLog)->lopnColor);
dprintf_gdi(stddeb,"EnumObjects // StockPen lopnWidth=%d\n", ((LPLOGPEN)lpLog)->lopnWidth.x);
dprintf_gdi(stddeb,"EnumObjects // StockPen lopnColor=%08lX\n", ((LPLOGPEN)lpLog)->lopnColor);
}
nRet = 1;
/*
......@@ -492,30 +500,30 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
*/
dprintf_gdi(stddeb,"EnumObjects // after CallBack16 !\n");
if (nRet == 0) {
USER_HEAP_FREE(hLog);
GDI_HEAP_FREE(hLog);
dprintf_gdi(stddeb,"EnumObjects // EnumEnd requested by application !\n");
return 0;
}
}
}
if (lpPenBrushList == NULL) return 0;
dprintf_gdi(stddeb,"EnumObjects // Now DC owned objects %08X !\n", header);
dprintf_gdi(stddeb,"EnumObjects // Now DC owned objects %p !\n", header);
for (lphObj = lpPenBrushList; *lphObj != 0; ) {
dprintf_gdi(stddeb,"EnumObjects // *lphObj=%04X\n", *lphObj);
header = (GDIOBJHDR *) GDI_HEAP_ADDR(*lphObj++);
if (header->wMagic == wMagic) {
dprintf_gdi(stddeb,"EnumObjects // DC_Obj lpLog=%08X lpData=%08X\n", lpLog, lpData);
dprintf_gdi(stddeb,"EnumObjects // DC_Obj lpLog=%p lpData=%p\n", lpLog, lpData);
if (header->wMagic == BRUSH_MAGIC) {
BRUSH_GetObject( (BRUSHOBJ *)header, sizeof(LOGBRUSH), (LPLOGBRUSH)lpLog);
BRUSH_GetObject( (BRUSHOBJ *)header, sizeof(LOGBRUSH), lpLog);
dprintf_gdi(stddeb,"EnumObjects // DC_Brush lbStyle=%04X\n", ((LPLOGBRUSH)lpLog)->lbStyle);
dprintf_gdi(stddeb,"EnumObjects // DC_Brush lbColor=%08X\n", ((LPLOGBRUSH)lpLog)->lbColor);
dprintf_gdi(stddeb,"EnumObjects // DC_Brush lbColor=%08lX\n", ((LPLOGBRUSH)lpLog)->lbColor);
dprintf_gdi(stddeb,"EnumObjects // DC_Brush lbHatch=%04X\n", ((LPLOGBRUSH)lpLog)->lbHatch);
}
if (header->wMagic == PEN_MAGIC) {
PEN_GetObject( (PENOBJ *)header, sizeof(LOGPEN), (LPLOGPEN)lpLog);
PEN_GetObject( (PENOBJ *)header, sizeof(LOGPEN), lpLog);
dprintf_gdi(stddeb,"EnumObjects // DC_Pen lopnStyle=%04X\n", ((LPLOGPEN)lpLog)->lopnStyle);
dprintf_gdi(stddeb,"EnumObjects // DC_Pen lopnWidth=%08X\n", ((LPLOGPEN)lpLog)->lopnWidth);
dprintf_gdi(stddeb,"EnumObjects // DC_Pen lopnColor=%08X\n", ((LPLOGPEN)lpLog)->lopnColor);
dprintf_gdi(stddeb,"EnumObjects // DC_Pen lopnWidth=%d\n", ((LPLOGPEN)lpLog)->lopnWidth.x);
dprintf_gdi(stddeb,"EnumObjects // DC_Pen lopnColor=%08lX\n", ((LPLOGPEN)lpLog)->lopnColor);
}
/*
#ifdef WINELIB
......@@ -527,13 +535,13 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
nRet = 1;
dprintf_gdi(stddeb,"EnumObjects // after CallBack16 !\n");
if (nRet == 0) {
USER_HEAP_FREE(hLog);
GDI_HEAP_FREE(hLog);
dprintf_gdi(stddeb,"EnumObjects // EnumEnd requested by application !\n");
return 0;
}
}
}
USER_HEAP_FREE(hLog);
GDI_HEAP_FREE(hLog);
dprintf_gdi(stddeb,"EnumObjects // End of enumeration !\n");
return 0;
}
......
......@@ -7,10 +7,9 @@ static char Copyright[] = "Copyright David W. Metcalfe, 1994";
*/
#include <string.h>
#include "windows.h"
#include "gdi.h"
#include "bitmap.h"
#include "metafile.h"
#include "prototypes.h"
#include "stddebug.h"
/* #define DEBUG_METAFILE */
#include "debug.h"
......@@ -25,8 +24,6 @@ static int HTLen; /* allocated length of handle table */
*/
HMETAFILE GetMetaFile(LPSTR lpFilename)
{
DC *dc;
HMETAFILE hmf;
METAFILE *mf;
METAHEADER *mh;
......@@ -143,7 +140,6 @@ HMETAFILE CloseMetaFile(HDC hdc)
METAFILE *mf;
METAHEADER *mh;
HMETAFILE hmf;
char buffer[15];
/* METARECORD *mr = (METARECORD *)&buffer;*/
dprintf_metafile(stddeb,"CloseMetaFile\n");
......@@ -804,6 +800,8 @@ BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush)
*(mr->rdParam + 1) = LOWORD(logbrush->lbColor);
memcpy(mr->rdParam + 2, info, biSize + bmSize);
break;
default:
return FALSE;
}
if (!MF_WriteRecord(dc->w.hMetaFile, mr, len))
{
......@@ -961,6 +959,7 @@ BOOL MF_BitBlt(DC *dcDest, short xDest, short yDest, short width,
short height, HDC hdcSrc, short xSrc, short ySrc, DWORD rop)
{
fprintf(stdnimp,"MF_BitBlt: not implemented yet\n");
return FALSE;
}
......@@ -972,4 +971,5 @@ BOOL MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
short widthSrc, short heightSrc, DWORD rop)
{
fprintf(stdnimp,"MF_StretchBlt: not implemented yet\n");
return FALSE;
}
......@@ -246,7 +246,7 @@ HBITMAP OBM_LoadOEMBitmap( WORD id )
{
fprintf( stderr, "Error %d creating pixmap %d\n",
err, OBM_FIRST+id );
pixmap = 0;
pixmap = width = height = 0;
}
else
{
......
......@@ -15,8 +15,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993,1994";
#endif
#include <X11/Xlib.h>
#include "gdi.h"
#include "color.h"
#include "palette.h"
#include "stddebug.h"
/* #define DEBUG_PALETTE */
#include "debug.h"
......
......@@ -2,10 +2,9 @@
* GDI pen objects
*
* Copyright 1993 Alexandre Julliard
*
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
#include "gdi.h"
*/
#include "pen.h"
#include "metafile.h"
#include "stddebug.h"
#include "color.h"
......
......@@ -8,7 +8,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994";
#include <stdlib.h>
#include <stdio.h>
#include "gdi.h"
#include "region.h"
#include "stddebug.h"
/* #define DEBUG_REGION */
#include "debug.h"
......@@ -341,6 +341,7 @@ HRGN CreatePolyPolygonRgn( POINT * points, short * count,
}
rgnObj = (RGNOBJ *) GDI_HEAP_ADDR( hrgn );
rgnObj->region.type = SIMPLEREGION;
rgnObj->region.xrgn = 0;
rgnObj->region.pixmap = 0;
/* Create X region */
......@@ -354,7 +355,13 @@ HRGN CreatePolyPolygonRgn( POINT * points, short * count,
}
xrgn = XPolygonRegion( xpoints, *count,
(mode == WINDING) ? WindingRule : EvenOddRule );
if (!xrgn) break;
if (!xrgn)
{
if (rgnObj->region.xrgn) XDestroyRegion( rgnObj->region.xrgn );
free( xpoints );
GDI_FreeObject( hrgn );
return 0;
}
if (i > 0)
{
Region tmprgn = XCreateRegion();
......@@ -367,11 +374,6 @@ HRGN CreatePolyPolygonRgn( POINT * points, short * count,
}
free( xpoints );
if (!xrgn)
{
GDI_FreeObject( hrgn );
return 0;
}
XClipBox( rgnObj->region.xrgn, &rect );
SetRect( &rgnObj->region.box, rect.x, rect.y,
rect.x + rect.width, rect.y + rect.height);
......
......@@ -52,7 +52,7 @@ static char *TEXT_NextLine(HDC hdc, char *str, int *count, char *dest,
int numspaces;
SIZE size;
int lasttab = 0;
int wb_i = 0, wb_j = 0, wb_count;
int wb_i = 0, wb_j = 0, wb_count = 0;
while (*count)
{
......@@ -301,8 +301,8 @@ BOOL ExtTextOut( HDC hdc, short x, short y, WORD flags, LPRECT lprect,
if (!DC_SetupGCForText( dc )) return TRUE;
font = dc->u.x.font.fstruct;
dprintf_text(stddeb,"ExtTextOut: %d,%d '%s', %d flags=%d rect=%d,%d,%d,%d\n",
x, y, str, count, flags,
dprintf_text(stddeb,"ExtTextOut: %d,%d '%*.*s', %d flags=%d rect=%d,%d,%d,%d\n",
x, y, count, count, str, count, flags,
lprect->left, lprect->top, lprect->right, lprect->bottom );
/* Setup coordinates */
......@@ -424,7 +424,7 @@ BOOL ExtTextOut( HDC hdc, short x, short y, WORD flags, LPRECT lprect,
continue; /* First iteration -> no delta */
}
pitem->delta = dc->w.charExtra;
if (str[i] == dc->u.x.font.metrics.tmBreakChar)
if (str[i] == (char)dc->u.x.font.metrics.tmBreakChar)
pitem->delta += dc->w.breakExtra;
if (lpDx)
{
......@@ -565,8 +565,8 @@ LONG TEXT_TabbedTextOut( HDC hdc, int x, int y, LPSTR lpstr, int count,
LONG TabbedTextOut( HDC hdc, short x, short y, LPSTR lpstr, short count,
short cTabStops, LPINT lpTabPos, short nTabOrg )
{
dprintf_text( stddeb, "TabbedTextOut: %x %d,%d '%s' %d\n",
hdc, x, y, lpstr, count );
dprintf_text( stddeb, "TabbedTextOut: %x %d,%d '%*.*s' %d\n",
hdc, x, y, count, count, lpstr, count );
return TEXT_TabbedTextOut( hdc, x, y, lpstr, count, cTabStops,
lpTabPos, nTabOrg, TRUE );
}
......@@ -578,8 +578,8 @@ LONG TabbedTextOut( HDC hdc, short x, short y, LPSTR lpstr, short count,
DWORD GetTabbedTextExtent( HDC hdc, LPSTR lpstr, int count,
int cTabStops, LPINT lpTabPos )
{
dprintf_text( stddeb, "GetTabbedTextExtent: %x '%s' %d\n",
hdc, lpstr, count );
dprintf_text( stddeb, "GetTabbedTextExtent: %x '%*.*s' %d\n",
hdc, count, count, lpstr, count );
return TEXT_TabbedTextOut( hdc, 0, 0, lpstr, count, cTabStops,
lpTabPos, 0, FALSE );
}
/* sysres.h
* This File is automatically generated. Do not edit
*/
#include "resource.h"
extern unsigned char sysres_MENU_SYSMENU[];
extern unsigned char sysres_DIALOG_2[];
extern unsigned char sysres_DIALOG_STOP_MSGBOX[];
extern unsigned char sysres_DIALOG_QUESTION_MSGBOX[];
extern unsigned char sysres_DIALOG_EXCLAMATION_MSGBOX[];
extern unsigned char sysres_DIALOG_SHELL_ABOUT_MSGBOX[];
extern unsigned char sysres_DIALOG_3[];
extern unsigned char sysres_DIALOG_4[];
extern unsigned char sysres_DIALOG_11[];
extern unsigned char sysres_DIALOG_12[];
extern unsigned char sysres_DIALOG_5[];
extern unsigned char sysres_DIALOG_6[];
extern unsigned char sysres_DIALOG_7[];
extern unsigned char sysres_DIALOG_8[];
extern unsigned char sysres_DIALOG_9[];
extern unsigned char sysres_DIALOG_10[];
extern struct ResourceTable sysresTable[];
/* sysresbm.h
* This File is automatically generated. Do not edit
*/
#include "resource.h"
extern unsigned char sysresbm_CURSOR_32514[];
extern unsigned char sysresbm_CURSOR_32648[];
extern unsigned char sysresbm_ICON_32516[];
extern unsigned char sysresbm_ICON_32515[];
extern unsigned char sysresbm_ICON_32513[];
extern unsigned char sysresbm_ICON_32514[];
extern unsigned char sysresbm_ICON_SYSIDI_STOPICON[];
extern unsigned char sysresbm_ICON_32512[];
extern unsigned char sysresbm_ICON_SYSIDI_HANDHAND[];
extern unsigned char sysresbm_ICON_WINEICON[];
extern unsigned char sysresbm_ICON_PORTRAIT[];
extern unsigned char sysresbm_ICON_LANDSCAP[];
extern unsigned char sysresbm_BITMAP_32754[];
extern unsigned char sysresbm_BITMAP_32753[];
extern unsigned char sysresbm_BITMAP_32752[];
extern unsigned char sysresbm_BITMAP_32751[];
extern unsigned char sysresbm_BITMAP_32750[];
extern unsigned char sysresbm_BITMAP_32749[];
extern unsigned char sysresbm_BITMAP_32748[];
extern unsigned char sysresbm_BITMAP_32747[];
extern unsigned char sysresbm_BITMAP_32746[];
extern unsigned char sysresbm_BITMAP_32745[];
extern unsigned char sysresbm_BITMAP_32744[];
extern unsigned char sysresbm_BITMAP_32743[];
extern unsigned char sysresbm_BITMAP_32742[];
extern unsigned char sysresbm_BITMAP_32741[];
extern unsigned char sysresbm_BITMAP_32740[];
extern unsigned char sysresbm_BITMAP_32739[];
extern unsigned char sysresbm_BITMAP_32738[];
extern unsigned char sysresbm_BITMAP_32737[];
extern unsigned char sysresbm_BITMAP_32736[];
extern unsigned char sysresbm_BITMAP_32735[];
extern unsigned char sysresbm_BITMAP_32734[];
extern unsigned char sysresbm_BITMAP_32767[];
extern unsigned char sysresbm_BITMAP_32766[];
extern unsigned char sysresbm_BITMAP_32765[];
extern unsigned char sysresbm_BITMAP_32764[];
extern unsigned char sysresbm_BITMAP_32763[];
extern unsigned char sysresbm_BITMAP_32762[];
extern unsigned char sysresbm_BITMAP_32761[];
extern unsigned char sysresbm_BITMAP_32760[];
extern unsigned char sysresbm_BITMAP_32759[];
extern unsigned char sysresbm_BITMAP_32758[];
extern unsigned char sysresbm_BITMAP_32757[];
extern unsigned char sysresbm_BITMAP_32756[];
extern unsigned char sysresbm_BITMAP_32755[];
extern unsigned char sysresbm_BITMAP_32520[];
extern unsigned char sysresbm_BITMAP_32521[];
extern unsigned char sysresbm_BITMAP_32522[];
extern unsigned char sysresbm_BITMAP_32523[];
extern unsigned char sysresbm_BITMAP_32524[];
extern unsigned char sysresbm_BITMAP_SMILE[];
extern unsigned char sysresbm_BITMAP_WINELOGO[];
extern unsigned char sysresbm_BITMAP_OBMCLOSE[];
extern struct ResourceTable sysresbmTable[];
static char RCSId[] = "$Id: build.c,v 1.3 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/* static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; */
#include <stdio.h>
#include <stdlib.h>
......@@ -679,8 +678,6 @@ OutputVariableCode(FILE *fp, char *storage, ORDDEF *odp)
ORDVARDEF *vdp;
int i;
fprintf(fp, PREFIX "%s_Ordinal_%d:\n", UpperDLLName, i);
vdp = odp->additional_data;
for (i = 0; i < vdp->n_values; i++)
{
......@@ -697,7 +694,7 @@ OutputVariableCode(FILE *fp, char *storage, ORDDEF *odp)
fprintf(fp, "\n");
}
main(int argc, char **argv)
int main(int argc, char **argv)
{
ORDDEF *odp;
ORDFUNCDEF *fdp;
......@@ -796,14 +793,17 @@ main(int argc, char **argv)
break;
case VARTYPE_BYTE:
fprintf(fp, PREFIX "%s_Ordinal_%d:\n", UpperDLLName, i);
OutputVariableCode(fp, ".byte", odp);
break;
case VARTYPE_WORD:
fprintf(fp, PREFIX "%s_Ordinal_%d:\n", UpperDLLName, i);
OutputVariableCode(fp, ".word", odp);
break;
case VARTYPE_LONG:
fprintf(fp, PREFIX "%s_Ordinal_%d:\n", UpperDLLName, i);
OutputVariableCode(fp, ".long", odp);
break;
......
......@@ -14,7 +14,6 @@ SRCS = \
focus.c \
graphics.c \
hook.c \
icon.c \
keyboard.c \
mapping.c \
mdi.c \
......
......@@ -12,11 +12,11 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include <unistd.h>
#include <X11/cursorfont.h>
#include <X11/Xlib.h>
#include "prototypes.h"
#include "windows.h"
#include "win.h"
#include "gdi.h"
#include "library.h"
#include "neexe.h"
#include "wine.h"
#include "cursor.h"
#include "stddebug.h"
......@@ -69,11 +69,10 @@ HCURSOR LoadCursor(HANDLE instance, LPSTR cursor_name)
for (i = 0; i < NB_SYS_CURSORS; i++)
if (system_cursor[i].name == cursor_name)
{
hCursor = system_cursor[i].cursor;
break;
if (system_cursor[i].cursor) return system_cursor[i].cursor;
else break;
}
if (i == NB_SYS_CURSORS) return 0;
if (hCursor) return hCursor;
}
hCursor = GlobalAlloc(GMEM_MOVEABLE, sizeof(CURSORALLOC) + 1024L);
if (hCursor == (HCURSOR)NULL) return 0;
......
......@@ -100,7 +100,7 @@ LONG DefWindowProc( HWND hwnd, WORD msg, WORD wParam, LONG lParam )
}
case WM_SETREDRAW:
if (wParam)
if (!wParam)
{
ValidateRect( hwnd, NULL );
wndPtr->flags |= WIN_NO_REDRAW;
......
......@@ -35,12 +35,18 @@ BOOL DIALOG_Init()
/* Calculate the dialog base units */
if (!(hdc = GetDC(GetDesktopWindow()))) return FALSE;
if (!(hdc = GetDC( 0 ))) return FALSE;
GetTextMetrics( hdc, &tm );
ReleaseDC( 0, hdc );
xBaseUnit = tm.tmAveCharWidth;
yBaseUnit = tm.tmHeight;
dprintf_dialog(stddeb, "DIALOG_Init: base units = %d,%d\n", xBaseUnit, yBaseUnit );
/* Dialog units are based on a proportional system font */
/* so we adjust them a bit for a fixed font. */
if (tm.tmPitchAndFamily & TMPF_FIXED_PITCH) xBaseUnit = xBaseUnit * 5 / 4;
dprintf_dialog( stddeb, "DIALOG_Init: base units = %d,%d\n",
xBaseUnit, yBaseUnit );
return TRUE;
}
......@@ -152,7 +158,7 @@ static void DIALOG_DisplayTemplate( DLGTEMPLATE * result )
{
dprintf_dialog(stddeb, "DIALOG %d, %d, %d, %d\n", result->header->x, result->header->y,
result->header->cx, result->header->cy );
dprintf_dialog(stddeb, " STYLE %08x\n", result->header->style );
dprintf_dialog(stddeb, " STYLE %08lx\n", result->header->style );
dprintf_dialog(stddeb, " CAPTION '%s'\n", result->caption );
dprintf_dialog(stddeb, " CLASS '%s'\n", result->className );
if (result->menuName[0] == 0xff)
......@@ -271,6 +277,8 @@ HWND CreateDialogIndirectParam( HINSTANCE hInst, LPCSTR dlgTemplate,
ReleaseDC( 0, hdc );
xUnit = tm.tmAveCharWidth;
yUnit = tm.tmHeight;
if (tm.tmPitchAndFamily & TMPF_FIXED_PITCH)
xBaseUnit = xBaseUnit * 5 / 4; /* See DIALOG_Init() */
}
}
......@@ -464,16 +472,6 @@ int DialogBoxIndirect( HINSTANCE hInst, HANDLE dlgTemplate,
return DialogBoxIndirectParam( hInst, dlgTemplate, owner, dlgProc, 0 );
}
/***********************************************************************
* DialogBoxIndirectPtr
* like DialogBoxIndirect, but expects pointer to template
*/
int DialogBoxIndirectPtr( HINSTANCE hInst, LPCSTR dlgTemplate,
HWND owner, WNDPROC dlgProc)
{
return DialogBoxIndirectParamPtr(hInst, dlgTemplate, owner, dlgProc, 0);
}
/***********************************************************************
* DialogBoxIndirectParam (USER.240)
......@@ -491,6 +489,7 @@ int DialogBoxIndirectParam( HINSTANCE hInst, HANDLE dlgTemplate,
return -1;
}
/***********************************************************************
* DialogBoxIndirectParamPtr
* like DialogBoxIndirectParam, but expects pointer to template
......@@ -504,6 +503,15 @@ int DialogBoxIndirectParamPtr(HINSTANCE hInst,LPCSTR dlgTemplate,
return -1;
}
/***********************************************************************
* DialogBoxIndirectPtr
* like DialogBoxIndirect, but expects pointer to template
*/
int DialogBoxIndirectPtr( HINSTANCE hInst, LPCSTR dlgTemplate,
HWND owner, WNDPROC dlgProc)
{
return DialogBoxIndirectParamPtr(hInst, dlgTemplate, owner, dlgProc, 0);
}
/***********************************************************************
* EndDialog (USER.88)
......@@ -530,16 +538,16 @@ BOOL IsDialogMessage( HWND hwndDlg, LPMSG msg )
if ((hwndDlg != msg->hwnd) && !IsChild( hwndDlg, msg->hwnd )) return FALSE;
/* Only the key messages get special processing */
if ((msg->message == WM_KEYDOWN) ||
(msg->message == WM_SYSCHAR) ||
(msg->message == WM_CHAR))
if ((msg->message != WM_KEYDOWN) &&
(msg->message != WM_SYSCHAR) &&
(msg->message != WM_CHAR))
return FALSE;
dlgCode = SendMessage( msg->hwnd, WM_GETDLGCODE, 0, 0 );
if (dlgCode & DLGC_WANTMESSAGE)
{
dlgCode = SendMessage( msg->hwnd, WM_GETDLGCODE, 0, 0 );
if (dlgCode & DLGC_WANTMESSAGE)
{
DispatchMessage( msg );
return TRUE;
}
DispatchMessage( msg );
return TRUE;
}
switch(msg->message)
......
......@@ -4,8 +4,6 @@
* Copyright 1993, 1994 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994";
#include <math.h>
#include <stdlib.h>
#include <X11/Xlib.h>
......@@ -15,7 +13,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994";
#define PI M_PI
#endif
#include "dc.h"
#include "gdi.h"
#include "bitmap.h"
#include "metafile.h"
#include "syscolor.h"
#include "stddebug.h"
......@@ -250,6 +248,16 @@ BOOL Ellipse( HDC hdc, int left, int top, int right, int bottom )
if (bottom < top)
swap_int(&bottom, &top);
if ((dc->u.x.pen.style == PS_INSIDEFRAME) &&
(dc->u.x.pen.width < right-left-1) &&
(dc->u.x.pen.width < bottom-top-1))
{
left += dc->u.x.pen.width / 2;
right -= (dc->u.x.pen.width + 1) / 2;
top += dc->u.x.pen.width / 2;
bottom -= (dc->u.x.pen.width + 1) / 2;
}
if (DC_SetupGCForBrush( dc ))
XFillArc( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
......@@ -286,7 +294,8 @@ BOOL Rectangle( HDC hdc, int left, int top, int right, int bottom )
if (bottom < top)
swap_int(&bottom, &top);
if ((left == right) || (top == bottom)) {
if ((left == right) || (top == bottom))
{
if (DC_SetupGCForPen( dc ))
XDrawLine(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left,
......@@ -296,6 +305,16 @@ BOOL Rectangle( HDC hdc, int left, int top, int right, int bottom )
return TRUE;
}
if ((dc->u.x.pen.style == PS_INSIDEFRAME) &&
(dc->u.x.pen.width < right-left) &&
(dc->u.x.pen.width < bottom-top))
{
left += dc->u.x.pen.width / 2;
right -= (dc->u.x.pen.width + 1) / 2;
top += dc->u.x.pen.width / 2;
bottom -= (dc->u.x.pen.width + 1) / 2;
}
if (DC_SetupGCForBrush( dc ))
XFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
......@@ -330,7 +349,8 @@ BOOL RoundRect( HDC hDC, short left, short top, short right, short bottom,
y1 = YLPTODP(dc, top);
x2 = XLPTODP(dc, right - ell_width);
y2 = YLPTODP(dc, bottom - ell_height);
if (DC_SetupGCForBrush(dc)) {
if (DC_SetupGCForBrush( dc ))
{
XFillArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x1, dc->w.DCOrgY + y1,
ell_width, ell_height, 90 * 64, 90 * 64);
......@@ -428,7 +448,8 @@ int FrameRect( HDC hdc, LPRECT rect, HBRUSH hbrush )
right = XLPTODP( dc, rect->right );
bottom = YLPTODP( dc, rect->bottom );
if (DC_SetupGCForBrush( dc )) {
if (DC_SetupGCForBrush( dc ))
{
PatBlt( hdc, rect->left, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt( hdc, rect->right - 1, rect->top, 1,
......@@ -498,19 +519,6 @@ COLORREF GetPixel( HDC hdc, short x, short y )
x = dc->w.DCOrgX + XLPTODP( dc, x );
y = dc->w.DCOrgY + YLPTODP( dc, y );
#if 0
if ((x < 0) || (y < 0)) return 0;
if (!(dc->w.flags & DC_MEMORY))
{
XWindowAttributes win_attr;
if (!XGetWindowAttributes( display, dc->u.x.drawable, &win_attr ))
return 0;
if (win_attr.map_state != IsViewable) return 0;
if ((x >= win_attr.width) || (y >= win_attr.height)) return 0;
}
#endif
image = XGetImage( display, dc->u.x.drawable, x, y,
1, 1, AllPlanes, ZPixmap );
pixel = XGetPixel( image, 0, 0 );
......@@ -534,6 +542,8 @@ BOOL PaintRgn( HDC hdc, HRGN hrgn )
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE;
/* FIXME: the region is supposed to be in logical coordinates */
/* Modify visible region */
if (!(prevVisRgn = SaveVisRgn( hdc ))) return FALSE;
......@@ -627,7 +637,7 @@ void DrawFocusRect( HDC hdc, LPRECT rc )
* Faster than CreateCompatibleDC() + SelectBitmap() + BitBlt() + DeleteDC().
*/
BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height, int rop )
int xsrc, int ysrc, int width, int height )
{
XGCValues val;
BITMAPOBJ *bmp;
......@@ -636,7 +646,7 @@ BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
return FALSE;
val.function = DC_XROPfunction[(rop >> 16) & 0x0f];
val.function = GXcopy;
val.foreground = dc->w.textPixel;
val.background = dc->w.backgroundPixel;
XChangeGC(display, dc->u.x.gc, GCFunction|GCForeground|GCBackground, &val);
......@@ -777,7 +787,7 @@ BOOL PolyPolygon( HDC hdc, LPPOINT pt, LPINT counts, WORD polygons )
/* MF_MetaPoly(dc, META_POLYGON, pt, count); */
return TRUE;
}
/* The points should be converted to device coords before */
/* FIXME: The points should be converted to device coords before */
/* creating the region. But as CreatePolyPolygonRgn is not */
/* really correct either, it doesn't matter much... */
/* At least the outline will be correct :-) */
......
......@@ -4,8 +4,6 @@
* Copyright 1994 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
/* Warning!
* HHOOK is not a real handle, but a 32-bit pointer to a HOOKDATA structure.
* This is for compatibility with Windows 3.0 where HHOOK was a HOOKPROC.
......
......@@ -4,8 +4,6 @@
* Copyright 1993 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "gdi.h"
#include "metafile.h"
#include "stddebug.h"
......
......@@ -361,6 +361,11 @@ LONG MDICascade(HWND parent, MDICLIENTINFO *ci)
if (ci->flagChildMaximized)
MDIRestoreChild(parent, ci);
/* If there aren't any children, don't even bother.
*/
if (ci->nActiveChildren == 0)
return 0;
GetClientRect(parent, &rect);
spacing = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYFRAME);
ysize = rect.bottom - 8 * spacing;
......@@ -406,6 +411,11 @@ LONG MDITile(HWND parent, MDICLIENTINFO *ci)
if (ci->flagChildMaximized)
MDIRestoreChild(parent, ci);
/* If there aren't any children, don't even bother.
*/
if (ci->nActiveChildren == 0)
return 0;
GetClientRect(parent, &rect);
rows = (int) sqrt((double) ci->nActiveChildren);
columns = ci->nActiveChildren / rows;
......
......@@ -9,8 +9,6 @@
* one message queue).
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994";
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
......@@ -844,7 +842,7 @@ BOOL PostMessage( HWND hwnd, WORD message, WORD wParam, LONG lParam )
while (hwnd) {
if (!(wndPtr = WIN_FindWndPtr(hwnd))) break;
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION) {
dprintf_msg(stddeb,"BROADCAST Message to hWnd=%04X m=%04X w=%04X l=%08X !\n",
dprintf_msg(stddeb,"BROADCAST Message to hWnd=%04X m=%04X w=%04X l=%08lX !\n",
hwnd, message, wParam, lParam);
PostMessage(hwnd, message, wParam, lParam);
}
......
......@@ -3,8 +3,7 @@
*
* Copyright 1994 Alexandre Julliard
*
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
*/
*/
#include "win.h"
#include "class.h"
......@@ -38,8 +37,8 @@ extern BOOL AboutWine_Proc( HWND hDlg, WORD msg, WORD wParam, LONG lParam );
/* Some useful macros */
#define HAS_DLGFRAME(style,exStyle) \
(((style) & WS_DLGFRAME) && \
(((exStyle) & WS_EX_DLGMODALFRAME) || !((style) & WS_BORDER)))
(((exStyle) & WS_EX_DLGMODALFRAME) || \
(((style) & WS_DLGFRAME) && !((style) & WS_BORDER)))
#define HAS_THICKFRAME(style) \
(((style) & WS_THICKFRAME) && \
......@@ -316,13 +315,18 @@ LONG NC_HandleNCHitTest( HWND hwnd, POINT pt )
void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down )
{
RECT rect;
HDC hdcMem;
HBITMAP hbitmap;
WND *wndPtr = WIN_FindWndPtr( hwnd );
NC_GetInsideRect( hwnd, &rect );
GRAPH_DrawBitmap( hdc, hbitmapClose,
rect.left, rect.top,
(wndPtr->dwStyle & WS_CHILD) ? SYSMETRICS_CXSIZE : 0, 0,
SYSMETRICS_CXSIZE, SYSMETRICS_CYSIZE,
down ? NOTSRCCOPY : SRCCOPY );
hdcMem = CreateCompatibleDC( hdc );
hbitmap = SelectObject( hdcMem, hbitmapClose );
BitBlt( hdc, rect.left, rect.top, SYSMETRICS_CXSIZE, SYSMETRICS_CYSIZE,
hdcMem, (wndPtr->dwStyle & WS_CHILD) ? SYSMETRICS_CXSIZE : 0, 0,
down ? NOTSRCCOPY : SRCCOPY );
SelectObject( hdcMem, hbitmap );
DeleteDC( hdcMem );
}
......@@ -337,7 +341,7 @@ static void NC_DrawMaxButton( HWND hwnd, HDC hdc, BOOL down )
(down ? hbitmapRestoreD : hbitmapRestore) :
(down ? hbitmapMaximizeD : hbitmapMaximize)),
rect.right - SYSMETRICS_CXSIZE - 1, rect.top,
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE, SRCCOPY );
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE );
}
......@@ -352,7 +356,7 @@ static void NC_DrawMinButton( HWND hwnd, HDC hdc, BOOL down )
if (wndPtr->dwStyle & WS_MAXIMIZEBOX) rect.right -= SYSMETRICS_CXSIZE + 1;
GRAPH_DrawBitmap( hdc, (down ? hbitmapMinimizeD : hbitmapMinimize),
rect.right - SYSMETRICS_CXSIZE - 1, rect.top,
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE, SRCCOPY );
0, 0, SYSMETRICS_CXSIZE+1, SYSMETRICS_CYSIZE );
}
......@@ -544,9 +548,9 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
dprintf_nonclient(stddeb, "NC_DoNCPaint: %d %d\n", hwnd, hrgn );
if (!wndPtr || !hrgn) return;
if ((!(wndPtr->dwStyle & (WS_BORDER | WS_DLGFRAME | WS_THICKFRAME))) ||
(!(wndPtr->dwStyle & WS_VISIBLE)))
return; /* Nothing to do! */
if (!(wndPtr->dwStyle & WS_VISIBLE)) return; /* Nothing to do */
if (!(wndPtr->dwStyle & (WS_BORDER | WS_DLGFRAME | WS_THICKFRAME)) &&
!(wndPtr->dwExStyle & WS_EX_DLGMODALFRAME)) return; /* Nothing to do */
if (hrgn == 1) hdc = GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW );
else
......@@ -594,7 +598,8 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
SelectObject( hdc, sysColorObjects.hpenWindowFrame );
if ((wndPtr->dwStyle & WS_BORDER) || (wndPtr->dwStyle & WS_DLGFRAME))
if ((wndPtr->dwStyle & WS_BORDER) || (wndPtr->dwStyle & WS_DLGFRAME) ||
(wndPtr->dwExStyle & WS_EX_DLGMODALFRAME))
{
MoveTo( hdc, 0, 0 );
LineTo( hdc, rect.right-1, 0 );
......
......@@ -4,8 +4,6 @@
* Copyright 1993 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <stdio.h>
#include <X11/Xlib.h>
......
......@@ -5,8 +5,6 @@
*
*/
static char Copyright[] = "Copyright David W. Metcalfe, 1993";
#include <stdlib.h>
#include "windows.h"
#include "gdi.h"
......
......@@ -6,12 +6,9 @@
*
*/
static char Copyright[] = "Copyright David W. Metcalfe, 1993";
static char Copyright2[] = "Copyright Alexandre Julliard, 1994";
#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
#include "gdi.h"
#include "syscolor.h"
#include "stddebug.h"
/* #define DEBUG_SYSCOLOR */
......
......@@ -4,8 +4,6 @@
* Copyright 1993 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "windows.h"
#include "message.h"
#include "stddebug.h"
......
......@@ -18,7 +18,7 @@
#include "debug.h"
static char Copyright[] = "Copyright Andrew C. Bulhak, 1993";
/* static char Copyright[] = "Copyright Andrew C. Bulhak, 1993"; */
/* MulDiv is a simple function that may as well have been
......@@ -72,6 +72,7 @@ void OutputDebugString(LPSTR foo)
DebugPrintString(foo);
};
#if 0
/* UTILITY_qualify(source, dest) takes the format string source and
* changes all the parameters to correspond to Linux integer sizes
* rather than Windows sizes. For example, it converts %i to %hi
......@@ -109,6 +110,7 @@ loop_end:
};
*dest = '\0';
};
#endif
/* UTILITY_argsize() evaluates the size of the argument list that
* accompanies a vsprintf() or wvsprintf() call.
......
......@@ -20,6 +20,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994";
#include "icon.h"
#include "cursor.h"
#include "event.h"
#include "message.h"
#include "winpos.h"
#include "color.h"
#include "stddebug.h"
......@@ -297,7 +298,7 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
int wmcreate;
XSetWindowAttributes win_attr;
dprintf_win(stddeb, "CreateWindowEx: %04X '%s' '%s' %04X %d,%d %dx%d %04X %04X %04X %08X\n",
dprintf_win(stddeb, "CreateWindowEx: %08lX '%s' '%s' %08lX %d,%d %dx%d %04X %04X %04X %p\n",
exStyle, className, windowName, style, x, y, width, height,
parent, menu, instance, data);
/* 'soundrec.exe' has negative position !
......@@ -444,7 +445,7 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
GlobalUnlock( hCursor );
}
dprintf_menu(stddeb,"CreateWindowEx // menu=%04X instance=%04X classmenu=%08X !\n",
dprintf_menu(stddeb,"CreateWindowEx // menu=%04X instance=%04X classmenu=%p !\n",
menu, instance, classPtr->wc.lpszMenuName);
if ((style & WS_CAPTION) && (style & WS_CHILD) == 0) {
......
......@@ -4,8 +4,6 @@
* Copyright 1993, 1994 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994";
#include "sysmetrics.h"
#include "user.h"
#include "win.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment