mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 13:10:28 +00:00
3ed37e0869
Sun Nov 6 18:52:04 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [objects/oembitmap.c] (New file) Added possibility to use .xpm files for OEM bitmaps. * [include/bitmaps/obm*] (New files) Redrawn all OEM bitmaps in xpm format. * [objects/font.c] Add space for internal leading when using a negative font height. Stubs for AddFontResource() and RemoveFontResource(). Fix in FONT_Init() for uninitialised default font. * [windows/dialog.c] Make font height negative as it is really a point size and not a pixel size; dialogs using 8-point fonts look better now. * [windows/graphics.c] Fixed the fix :-) for Pie() to make it work for Arc() and Chord() also. * [windows/nonclient.c] A few changes for new OEM bitmaps. Sun Nov 6 18:22:18 1994 Michael Patra <micky@marie.physik.tu-berlin.de> * [windows/class.c] The names of local classes have to be stored using GlobalAtom*. Otherwise they couldn't be accessed from other modules (e.g. BWCC) * [if1632/call.S] CallTo16(cx): It's possible to set the contents of the cx-register. * [loader/ne_image.c] InitNEDLL(): The size of the local heap is now passed in the cx- register when initializing a DLL. * [memory/heap.c] LocalInit(): The case start==0 is now handled in the way it should. * [windows/win.c] GetWindowLong(): If the adress of the windows function is requested it's no longer returned if it's within the Wine code (and therefore unreachable by a windows program). This makes Borland's OWL happy. * [controls/edit.c] EDIT_GetStr(): Added handling for off<0. Sun Nov 6 17:37:14 1994 Chris Jones <chrisj@ichips.intel.com> * [loader/library.c] Fixed infinite loop bug when two DLLs refer to each other (fixes hangup of Quicken during loading). Thu Nov 04 12:00:00 1994 Jan Willamowius (jan@janhh.sh.sub.de) * [misc/dos_fs.c] Bug fix: The size of a disk an the available space is now returned in bytes instead of (incorrectly) KBytes. Thu Nov 03 12:00:00 1994 Jan Willamowius (jan@janhh.sh.sub.de) * [windows/graphics.c] Bug fix: Pie segments are now filled with correct brush. Thu Nov 3 10:40:09 1994 Martin von Loewis (martin@cs.csufresno.edu) * [Imakefile] generate rc.o before loader.o * [controls/menu.c] CopySysMenu: generate SYSMENU on the fly, eliminate hSysMenu * [include/resource.h] Add struct ResourceTable * [loader/bitmap.h] Load system bitmaps from sysresbmTable * [misc/clipboard.c] [windows/event.c] IsClipboardFormatAvailable,EVENT_SelectionRequest: bug fixes * [rc/Imakefile] generate rc.o from sysres.o and sysresbm.o. Added -lfl * [rc/rc.y] change style handling to allow ( S1 | S2 ) | S3 * [rc/sysres.rc] [rc/sysresbm.rc] Put bitmaps and icons to sysresbm, everything else to sysres * [rc/winerc.c] [rc/winerc.h] Added -o, -c flags. New function set_out_file. Output to files. * [windows/dialog.c] DialogBoxIndirectPtr, DialogBoxIndirectParamPtr: New functions * [windows/nonclient.c] Create AboutWine dialog from template pointer
166 lines
3.8 KiB
C
166 lines
3.8 KiB
C
/*
|
|
* Scroll windows and DCs
|
|
*
|
|
* Copyright David W. Metcalfe, 1993
|
|
*
|
|
*/
|
|
|
|
static char Copyright[] = "Copyright David W. Metcalfe, 1993";
|
|
|
|
#include <stdlib.h>
|
|
#include "windows.h"
|
|
#include "gdi.h"
|
|
#include "stddebug.h"
|
|
/* #define DEBUG_SCROLL /* */
|
|
/* #undef DEBUG_SCROLL /* */
|
|
#include "debug.h"
|
|
|
|
|
|
static int RgnType;
|
|
|
|
|
|
/*************************************************************************
|
|
* ScrollWindow (USER.61)
|
|
*/
|
|
|
|
void ScrollWindow(HWND hwnd, short dx, short dy, LPRECT rect, LPRECT clipRect)
|
|
{
|
|
HDC hdc;
|
|
HRGN hrgnUpdate;
|
|
RECT rc, cliprc;
|
|
|
|
dprintf_scroll(stddeb,"ScrollWindow: dx=%d, dy=%d, rect=%d,%d,%d,%d\n",
|
|
dx, dy, rect->left, rect->top, rect->right, rect->bottom);
|
|
|
|
hdc = GetDC(hwnd);
|
|
|
|
if (rect == NULL)
|
|
GetClientRect(hwnd, &rc);
|
|
else
|
|
CopyRect(&rc, rect);
|
|
if (clipRect == NULL)
|
|
GetClientRect(hwnd, &cliprc);
|
|
else
|
|
CopyRect(&cliprc, clipRect);
|
|
|
|
hrgnUpdate = CreateRectRgn(0, 0, 0, 0);
|
|
ScrollDC(hdc, dx, dy, &rc, &cliprc, hrgnUpdate, NULL);
|
|
InvalidateRgn(hwnd, hrgnUpdate, TRUE);
|
|
ReleaseDC(hwnd, hdc);
|
|
}
|
|
|
|
|
|
/*************************************************************************
|
|
* ScrollDC (USER.221)
|
|
*/
|
|
|
|
BOOL ScrollDC(HDC hdc, short dx, short dy, LPRECT rc, LPRECT cliprc,
|
|
HRGN hrgnUpdate, LPRECT rcUpdate)
|
|
{
|
|
HRGN hrgnClip, hrgn1, hrgn2;
|
|
POINT src, dest;
|
|
short width, height;
|
|
DC *dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC);
|
|
|
|
dprintf_scroll(stddeb, "ScrollDC: dx=%d, dy=%d, rc=%d,%d,%d,%d\n", dx, dy,
|
|
rc->left, rc->top, rc->right, rc->bottom);
|
|
|
|
if (rc == NULL)
|
|
return FALSE;
|
|
|
|
if (cliprc)
|
|
{
|
|
hrgnClip = CreateRectRgnIndirect(cliprc);
|
|
SelectClipRgn(hdc, hrgnClip);
|
|
}
|
|
|
|
if (dx > 0)
|
|
{
|
|
src.x = XDPTOLP(dc, rc->left);
|
|
dest.x = XDPTOLP(dc, rc->left + abs(dx));
|
|
}
|
|
else
|
|
{
|
|
src.x = XDPTOLP(dc, rc->left + abs(dx));
|
|
dest.x = XDPTOLP(dc, rc->left);
|
|
}
|
|
if (dy > 0)
|
|
{
|
|
src.y = YDPTOLP(dc, rc->top);
|
|
dest.y = YDPTOLP(dc, rc->top + abs(dy));
|
|
}
|
|
else
|
|
{
|
|
src.y = YDPTOLP(dc, rc->top + abs(dy));
|
|
dest.y = YDPTOLP(dc, rc->top);
|
|
}
|
|
|
|
width = rc->right - rc->left - abs(dx);
|
|
height = rc->bottom - rc->top - abs(dy);
|
|
|
|
if (!BitBlt(hdc, dest.x, dest.y, width, height, hdc, src.x, src.y,
|
|
SRCCOPY))
|
|
return FALSE;
|
|
|
|
if (hrgnUpdate)
|
|
{
|
|
if (dx > 0)
|
|
hrgn1 = CreateRectRgn(rc->left, rc->top, rc->left+dx, rc->bottom);
|
|
else if (dx < 0)
|
|
hrgn1 = CreateRectRgn(rc->right+dx, rc->top, rc->right,
|
|
rc->bottom);
|
|
else
|
|
hrgn1 = CreateRectRgn(0, 0, 0, 0);
|
|
|
|
if (dy > 0)
|
|
hrgn2 = CreateRectRgn(rc->left, rc->top, rc->right, rc->top+dy);
|
|
else if (dy < 0)
|
|
hrgn2 = CreateRectRgn(rc->left, rc->bottom+dy, rc->right,
|
|
rc->bottom);
|
|
else
|
|
hrgn2 = CreateRectRgn(0, 0, 0, 0);
|
|
|
|
RgnType = CombineRgn(hrgnUpdate, hrgn1, hrgn2, RGN_OR);
|
|
}
|
|
|
|
if (rcUpdate) GetRgnBox( hrgnUpdate, rcUpdate );
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
/*************************************************************************
|
|
* ScrollWindowEx (USER.319)
|
|
*/
|
|
|
|
int ScrollWindowEx(HWND hwnd, short dx, short dy, LPRECT rect, LPRECT clipRect,
|
|
HRGN hrgnUpdate, LPRECT rcUpdate, WORD flags)
|
|
{
|
|
HDC hdc;
|
|
RECT rc, cliprc;
|
|
|
|
dprintf_scroll(stddeb,"ScrollWindowEx: dx=%d, dy=%d, rect=%d,%d,%d,%d\n",
|
|
dx, dy, rect->left, rect->top, rect->right, rect->bottom);
|
|
|
|
hdc = GetDC(hwnd);
|
|
|
|
if (rect == NULL)
|
|
GetClientRect(hwnd, &rc);
|
|
else
|
|
CopyRect(&rc, rect);
|
|
if (clipRect == NULL)
|
|
GetClientRect(hwnd, &cliprc);
|
|
else
|
|
CopyRect(&cliprc, clipRect);
|
|
|
|
ScrollDC(hdc, dx, dy, &rc, &cliprc, hrgnUpdate, rcUpdate);
|
|
|
|
if (flags | SW_INVALIDATE)
|
|
{
|
|
RedrawWindow(hwnd, NULL, hrgnUpdate,
|
|
RDW_INVALIDATE | ((flags & SW_ERASE) ? RDW_ERASENOW : 0));
|
|
}
|
|
|
|
ReleaseDC(hwnd, hdc);
|
|
return RgnType;
|
|
}
|