mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Implementation of ScrollWindow, ScrollWindowEx, ScrollDC and DDE ported from Wine.
svn path=/trunk/; revision=6916
This commit is contained in:
parent
893644d308
commit
7c18970a16
13 changed files with 5330 additions and 455 deletions
|
@ -1246,17 +1246,9 @@ NtUserScrollDC(
|
|||
HRGN hrgnUpdate,
|
||||
LPRECT lprcUpdate);
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
NtUserScrollWindowEx(
|
||||
DWORD Unknown0,
|
||||
DWORD Unknown1,
|
||||
DWORD Unknown2,
|
||||
DWORD Unknown3,
|
||||
DWORD Unknown4,
|
||||
DWORD Unknown5,
|
||||
DWORD Unknown6,
|
||||
DWORD Unknown7);
|
||||
DWORD STDCALL
|
||||
NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *rect,
|
||||
const RECT *clipRect, HRGN hrgnUpdate, LPRECT rcUpdate, UINT flags);
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.32 2003/12/02 18:12:05 navaraf Exp $
|
||||
# $Id: Makefile,v 1.33 2003/12/08 18:21:24 navaraf Exp $
|
||||
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
|
@ -37,6 +37,8 @@ CONTROLS_OBJECTS = \
|
|||
|
||||
MISC_OBJECTS = \
|
||||
misc/dde.o \
|
||||
misc/ddeclient.o \
|
||||
misc/ddeserver.o \
|
||||
misc/desktop.o \
|
||||
misc/display.o \
|
||||
misc/dllmain.o \
|
||||
|
|
File diff suppressed because it is too large
Load diff
268
reactos/lib/user32/misc/dde_private.h
Normal file
268
reactos/lib/user32/misc/dde_private.h
Normal file
|
@ -0,0 +1,268 @@
|
|||
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
||||
|
||||
/*
|
||||
* DDEML library
|
||||
*
|
||||
* Copyright 1997 Alexandre Julliard
|
||||
* Copyright 1997 Len White
|
||||
* Copyright 1999 Keith Matthews
|
||||
* Copyright 2000 Corel
|
||||
* Copyright 2001 Eric Pouech
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_DDEML_PRIVATE_H
|
||||
#define __WINE_DDEML_PRIVATE_H
|
||||
|
||||
/* defined in atom.c file.
|
||||
*/
|
||||
#define MAX_ATOM_LEN 255
|
||||
|
||||
/* Maximum buffer size ( including the '\0' ).
|
||||
*/
|
||||
#define MAX_BUFFER_LEN (MAX_ATOM_LEN + 1)
|
||||
|
||||
/* The internal structures (prefixed by WDML) are used as follows:
|
||||
* + a WDML_INSTANCE is created for each instance creation (DdeInitialize)
|
||||
* - a popup window (InstanceClass) is created for each instance.
|
||||
* - this window is used to receive all the DDEML events (server registration,
|
||||
* conversation confirmation...). See the WM_WDML_???? messages for details
|
||||
* + when registring a server (DdeNameService) a WDML_SERVER is created
|
||||
* - a popup window (ServerNameClass) is created
|
||||
* + a conversation is represented by two WDML_CONV structures:
|
||||
* - one on the client side, the other one on the server side
|
||||
* - this is needed because the address spaces may be different
|
||||
* - therefore, two lists of links are kept for each instance
|
||||
* - two windows are created for a conversation:
|
||||
* o a popup window on client side (ClientConvClass)
|
||||
* o a child window (of the ServerName) on the server side
|
||||
* (ServerConvClass)
|
||||
* - all the exchanges then take place between those two windows
|
||||
* - windows for the conversation exist in two forms (Ansi & Unicode). This
|
||||
* is only needed when a partner in a conv is not handled by DDEML. The
|
||||
* type (A/W) of the window is used to handle the ansi <=> unicode
|
||||
* transformations
|
||||
* - two handles are created for a conversation (on each side). Each handle
|
||||
* is linked to a structure. To help differentiate those handles, the
|
||||
* local one has an even value, whereas the remote one has an odd value.
|
||||
* + a (warm or link) is represented by two WDML_LINK structures:
|
||||
* - one on client side, the other one on server side
|
||||
* - therefore, two lists of links are kept for each instance
|
||||
*
|
||||
* To help getting back to data, WDML windows store information:
|
||||
* - offset 0: the DDE instance
|
||||
* - offset 4: the current conversation (for ClientConv and ServerConv only)
|
||||
*
|
||||
* All the implementation (client & server) makes the assumption that the other side
|
||||
* is not always a DDEML partner. However, if it's the case, supplementary services
|
||||
* are available (most notably the REGISTER/UNREGISTER and CONNECT_CONFIRM messages
|
||||
* to the callback function). To be correct in every situation, all the basic
|
||||
* exchanges are made using the 'pure' DDE protocol. A (future !) enhancement would
|
||||
* be to provide a new protocol in the case were both partners are handled by DDEML.
|
||||
*
|
||||
* The StringHandles are in fact stored as local atoms. So an HSZ and a (local) atom
|
||||
* can be used interchangably. However, in order to keep track of the allocated HSZ,
|
||||
* and to free them upon instance termination, all HSZ are stored in a link list.
|
||||
* When the HSZ need to be passed thru DDE messages, we need to convert them back and
|
||||
* forth to global atoms.
|
||||
*/
|
||||
|
||||
/* this struct has the same mapping as all the DDE??? structures */
|
||||
typedef struct {
|
||||
unsigned short unused:12,
|
||||
fResponse:1,
|
||||
fRelease:1,
|
||||
fDeferUpd:1,
|
||||
fAckReq:1;
|
||||
short cfFormat;
|
||||
} WINE_DDEHEAD;
|
||||
|
||||
typedef struct tagHSZNode
|
||||
{
|
||||
struct tagHSZNode* next;
|
||||
HSZ hsz;
|
||||
unsigned refCount;
|
||||
} HSZNode;
|
||||
|
||||
typedef struct tagWDML_SERVER
|
||||
{
|
||||
struct tagWDML_SERVER* next;
|
||||
HSZ hszService;
|
||||
HSZ hszServiceSpec;
|
||||
ATOM atomService;
|
||||
ATOM atomServiceSpec;
|
||||
BOOL filterOn;
|
||||
HWND hwndServer;
|
||||
} WDML_SERVER;
|
||||
|
||||
typedef struct tagWDML_XACT {
|
||||
struct tagWDML_XACT* next; /* list of transactions in conversation */
|
||||
DWORD xActID;
|
||||
UINT ddeMsg;
|
||||
HDDEDATA hDdeData;
|
||||
DWORD dwTimeout;
|
||||
DWORD hUser;
|
||||
UINT wType;
|
||||
UINT wFmt;
|
||||
HSZ hszItem;
|
||||
ATOM atom; /* as converted from or to hszItem */
|
||||
HGLOBAL hMem;
|
||||
LPARAM lParam; /* useful for reusing */
|
||||
} WDML_XACT;
|
||||
|
||||
typedef struct tagWDML_CONV
|
||||
{
|
||||
struct tagWDML_CONV* next; /* to link all the conversations */
|
||||
struct tagWDML_INSTANCE* instance;
|
||||
HSZ hszService; /* pmt used for connection */
|
||||
HSZ hszTopic; /* pmt used for connection */
|
||||
UINT afCmd; /* service name flag */
|
||||
CONVCONTEXT convContext;
|
||||
HWND hwndClient; /* source of conversation (ClientConvClass) */
|
||||
HWND hwndServer; /* destination of conversation (ServerConvClass) */
|
||||
WDML_XACT* transactions; /* pending transactions */
|
||||
DWORD hUser; /* user defined value */
|
||||
DWORD wStatus; /* same bits as convinfo.wStatus */
|
||||
DWORD wConvst; /* same values as convinfo.wConvst */
|
||||
} WDML_CONV;
|
||||
|
||||
/* DDE_LINK struct defines hot, warm, and cold links */
|
||||
typedef struct tagWDML_LINK {
|
||||
struct tagWDML_LINK* next; /* to link all the active links */
|
||||
HCONV hConv; /* to get back to the converstaion */
|
||||
UINT transactionType;/* 0 for no link */
|
||||
HSZ hszItem; /* item targetted for (hot/warm) link */
|
||||
UINT uFmt; /* format for data */
|
||||
} WDML_LINK;
|
||||
|
||||
typedef struct tagWDML_INSTANCE
|
||||
{
|
||||
struct tagWDML_INSTANCE* next;
|
||||
DWORD instanceID; /* needed to track monitor usage */
|
||||
DWORD threadID; /* needed to keep instance linked to a unique thread */
|
||||
BOOL monitor; /* have these two as full Booleans cos they'll be tested frequently */
|
||||
BOOL clientOnly; /* bit wasteful of space but it will be faster */
|
||||
BOOL unicode; /* Flag to indicate Win32 API used to initialise */
|
||||
BOOL win16; /* flag to indicate Win16 API used to initialize */
|
||||
HSZNode* nodeList; /* for cleaning upon exit */
|
||||
PFNCALLBACK callback;
|
||||
DWORD CBFflags;
|
||||
DWORD monitorFlags;
|
||||
DWORD lastError;
|
||||
HWND hwndEvent;
|
||||
WDML_SERVER* servers; /* list of registered servers */
|
||||
WDML_CONV* convs[2]; /* active conversations for this instance (client and server) */
|
||||
WDML_LINK* links[2]; /* active links for this instance (client and server) */
|
||||
} WDML_INSTANCE;
|
||||
|
||||
extern CRITICAL_SECTION WDML_CritSect; /* protection for instance list */
|
||||
|
||||
/* header for the DDE Data objects */
|
||||
typedef struct tagDDE_DATAHANDLE_HEAD
|
||||
{
|
||||
short cfFormat;
|
||||
WORD bAppOwned;
|
||||
} DDE_DATAHANDLE_HEAD;
|
||||
|
||||
typedef enum tagWDML_SIDE
|
||||
{
|
||||
WDML_CLIENT_SIDE = 0, WDML_SERVER_SIDE = 1
|
||||
} WDML_SIDE;
|
||||
|
||||
typedef enum {
|
||||
WDML_QS_ERROR, WDML_QS_HANDLED, WDML_QS_PASS, WDML_QS_SWALLOWED, WDML_QS_BLOCK,
|
||||
} WDML_QUEUE_STATE;
|
||||
|
||||
extern HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInst, UINT uType, UINT uFmt, HCONV hConv,
|
||||
HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
|
||||
DWORD dwData1, DWORD dwData2);
|
||||
extern HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt, HCONV hConv,
|
||||
HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
|
||||
DWORD dwData1, DWORD dwData2);
|
||||
extern WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic);
|
||||
extern void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic);
|
||||
extern WDML_SERVER* WDML_FindServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic);
|
||||
/* transaction handler on the server side */
|
||||
extern WDML_QUEUE_STATE WDML_ServerHandle(WDML_CONV* pConv, WDML_XACT* pXAct);
|
||||
/* called both in DdeClientTransaction and server side. */
|
||||
extern UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
|
||||
DWORD afCmd, DWORD ulRes, BOOL bUnicode, BOOL b16);
|
||||
extern WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
|
||||
HSZ hszService, HSZ hszTopic, HWND hwndClient, HWND hwndServer);
|
||||
extern void WDML_RemoveConv(WDML_CONV* pConv, WDML_SIDE side);
|
||||
extern WDML_CONV* WDML_GetConv(HCONV hConv, BOOL checkConnected);
|
||||
extern WDML_CONV* WDML_GetConvFromWnd(HWND hWnd);
|
||||
extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
|
||||
HSZ hszService, HSZ hszTopic);
|
||||
extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode,
|
||||
BOOL fBusy, BOOL fAck, UINT pmt, LPARAM lParam, UINT oldMsg);
|
||||
extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
|
||||
UINT wType, HSZ hszItem, UINT wFmt);
|
||||
extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
|
||||
HSZ hszItem, BOOL use_fmt, UINT uFmt);
|
||||
extern void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
|
||||
HSZ hszItem, UINT wFmt);
|
||||
extern void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side);
|
||||
/* string internals */
|
||||
extern void WDML_FreeAllHSZ(WDML_INSTANCE* pInstance);
|
||||
extern BOOL WDML_DecHSZ(WDML_INSTANCE* pInstance, HSZ hsz);
|
||||
extern BOOL WDML_IncHSZ(WDML_INSTANCE* pInstance, HSZ hsz);
|
||||
extern ATOM WDML_MakeAtomFromHsz(HSZ hsz);
|
||||
extern HSZ WDML_MakeHszFromAtom(WDML_INSTANCE* pInstance, ATOM atom);
|
||||
/* client calls these */
|
||||
extern WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, UINT wFmt, HSZ hszItem);
|
||||
extern void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct);
|
||||
extern BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct);
|
||||
extern void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt);
|
||||
extern WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid);
|
||||
extern HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease,
|
||||
BOOL fDeferUpd, BOOL dAckReq);
|
||||
extern HDDEDATA WDML_Global2DataHandle(HGLOBAL hMem, WINE_DDEHEAD* da);
|
||||
extern BOOL WDML_IsAppOwned(HDDEDATA hDdeData);
|
||||
extern WDML_INSTANCE* WDML_GetInstance(DWORD InstId);
|
||||
extern WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd);
|
||||
/* broadcasting to DDE windows */
|
||||
extern void WDML_BroadcastDDEWindows(const char* clsName, UINT uMsg,
|
||||
WPARAM wParam, LPARAM lParam);
|
||||
extern void WDML_NotifyThreadExit(DWORD tid);
|
||||
|
||||
static inline void WDML_ExtractAck(WORD status, DDEACK* da)
|
||||
{
|
||||
*da = *((DDEACK*)&status);
|
||||
}
|
||||
|
||||
extern const char WDML_szEventClass[]; /* class of window for events (aka instance) */
|
||||
extern const char WDML_szServerConvClassA[]; /* class of window for server side conv (ansi) */
|
||||
extern const WCHAR WDML_szServerConvClassW[]; /* class of window for server side conv (unicode) */
|
||||
extern const char WDML_szClientConvClassA[]; /* class of window for client side conv (ansi) */
|
||||
extern const WCHAR WDML_szClientConvClassW[]; /* class of window for client side conv (unicode) */
|
||||
|
||||
#define WM_WDML_REGISTER (WM_USER + 0x200)
|
||||
#define WM_WDML_UNREGISTER (WM_USER + 0x201)
|
||||
#define WM_WDML_CONNECT_CONFIRM (WM_USER + 0x202)
|
||||
|
||||
/* parameters for messages:
|
||||
* wParam lParam
|
||||
* Register atom for service name atom for service spec
|
||||
* Unregister atom for service name atom for service spec
|
||||
* ConnectConfirm client window handle server window handle
|
||||
*/
|
||||
|
||||
#define GWL_WDML_INSTANCE (0)
|
||||
#define GWL_WDML_CONVERSATION (4)
|
||||
#define GWL_WDML_SERVER (4)
|
||||
|
||||
#endif /* __WINE_DDEML_PRIVATE_H */
|
1416
reactos/lib/user32/misc/ddeclient.c
Normal file
1416
reactos/lib/user32/misc/ddeclient.c
Normal file
File diff suppressed because it is too large
Load diff
1074
reactos/lib/user32/misc/ddeserver.c
Normal file
1074
reactos/lib/user32/misc/ddeserver.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
/* $Id: stubs.c,v 1.54 2003/12/07 18:54:15 navaraf Exp $
|
||||
/* $Id: stubs.c,v 1.55 2003/12/08 18:21:24 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -212,43 +212,6 @@ RealMsgWaitForMultipleObjectsEx(
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
WINBOOL
|
||||
STDCALL
|
||||
ScrollWindow(
|
||||
HWND hWnd,
|
||||
int XAmount,
|
||||
int YAmount,
|
||||
CONST RECT *lpRect,
|
||||
CONST RECT *lpClipRect)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
int
|
||||
STDCALL
|
||||
ScrollWindowEx(
|
||||
HWND hWnd,
|
||||
int dx,
|
||||
int dy,
|
||||
CONST RECT *prcScroll,
|
||||
CONST RECT *prcClip,
|
||||
HRGN hrgnUpdate,
|
||||
LPRECT prcUpdate,
|
||||
UINT flags)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: defwnd.c,v 1.106 2003/11/09 11:42:08 navaraf Exp $
|
||||
/* $Id: defwnd.c,v 1.107 2003/12/08 18:21:24 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -879,6 +879,11 @@ DefWndControlColor(HDC hDC, UINT ctlType)
|
|||
return GetSysColorBrush(COLOR_WINDOW);
|
||||
}
|
||||
|
||||
VOID FASTCALL
|
||||
DefWndScreenshot(HWND hWnd)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LRESULT STDCALL
|
||||
User32DefWindowProc(HWND hWnd,
|
||||
|
@ -1200,7 +1205,11 @@ User32DefWindowProc(HWND hWnd,
|
|||
else
|
||||
PostMessageA(top, WM_SYSCOMMAND, SC_CLOSE, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (wParam == VK_SNAPSHOT)
|
||||
{
|
||||
DefWndScreenshot(hWnd);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: paint.c,v 1.18 2003/08/22 07:51:32 gvg Exp $
|
||||
/* $Id: paint.c,v 1.19 2003/12/08 18:21:24 navaraf Exp $
|
||||
*
|
||||
* PROJECT: ReactOS user32.dll
|
||||
* FILE: lib/user32/windows/input.c
|
||||
|
@ -193,19 +193,12 @@ RedrawWindow(
|
|||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
WINBOOL
|
||||
STDCALL
|
||||
ScrollDC(
|
||||
HDC hDC,
|
||||
int dx,
|
||||
int dy,
|
||||
CONST RECT *lprcScroll,
|
||||
CONST RECT *lprcClip,
|
||||
HRGN hrgnUpdate,
|
||||
LPRECT lprcUpdate)
|
||||
WINBOOL STDCALL
|
||||
ScrollDC(HDC hDC, int dx, int dy, CONST RECT *lprcScroll, CONST RECT *lprcClip,
|
||||
HRGN hrgnUpdate, LPRECT lprcUpdate)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
return NtUserScrollDC(hDC, dx, dy, lprcScroll, lprcClip, hrgnUpdate,
|
||||
lprcUpdate);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: window.c,v 1.85 2003/12/07 23:02:57 gvg Exp $
|
||||
/* $Id: window.c,v 1.86 2003/12/08 18:21:24 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -1734,4 +1734,27 @@ GetTaskmanWindow(VOID)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
WINBOOL STDCALL
|
||||
ScrollWindow(HWND hWnd, int dx, int dy, CONST RECT *lpRect,
|
||||
CONST RECT *prcClip)
|
||||
{
|
||||
return NtUserScrollWindowEx(hWnd, dx, dy, lpRect, prcClip, 0, NULL,
|
||||
(lpRect ? 0 : SW_SCROLLCHILDREN) | SW_INVALIDATE) != ERROR;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
INT STDCALL
|
||||
ScrollWindowEx(HWND hWnd, int dx, int dy, CONST RECT *prcScroll,
|
||||
CONST RECT *prcClip, HRGN hrgnUpdate, LPRECT prcUpdate, UINT flags)
|
||||
{
|
||||
return NtUserScrollWindowEx(hWnd, dx, dy, prcScroll, prcClip, hrgnUpdate,
|
||||
prcUpdate, flags);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: painting.c,v 1.43 2003/12/07 23:02:57 gvg Exp $
|
||||
* $Id: painting.c,v 1.44 2003/12/08 18:21:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -36,7 +36,9 @@
|
|||
#include <include/object.h>
|
||||
#include <include/guicheck.h>
|
||||
#include <include/window.h>
|
||||
#include <include/winpos.h>
|
||||
#include <include/class.h>
|
||||
#include <include/caret.h>
|
||||
#include <include/error.h>
|
||||
#include <include/winsta.h>
|
||||
#include <windows.h>
|
||||
|
@ -675,6 +677,43 @@ IntGetPaintMessage(HWND hWnd, PW32THREAD Thread, MSG *Message,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
HWND FASTCALL
|
||||
IntFixCaret(HWND hWnd, LPRECT lprc, UINT flags)
|
||||
{
|
||||
GUITHREADINFO info;
|
||||
|
||||
if (!NtUserGetGUIThreadInfo(0, &info))
|
||||
return 0;
|
||||
if (!info.hwndCaret)
|
||||
return 0;
|
||||
if (info.hwndCaret == hWnd ||
|
||||
((flags & SW_SCROLLCHILDREN) && IntIsChildWindow(hWnd, info.hwndCaret)))
|
||||
{
|
||||
POINT pt, FromOffset, ToOffset, Offset;
|
||||
|
||||
pt.x = info.rcCaret.left;
|
||||
pt.y = info.rcCaret.top;
|
||||
|
||||
NtUserGetClientOrigin(info.hwndCaret, &FromOffset);
|
||||
NtUserGetClientOrigin(hWnd, &ToOffset);
|
||||
Offset.x = FromOffset.x - ToOffset.x;
|
||||
Offset.y = FromOffset.y - ToOffset.y;
|
||||
info.rcCaret.left += Offset.x;
|
||||
info.rcCaret.top += Offset.y;
|
||||
info.rcCaret.right += Offset.x;
|
||||
info.rcCaret.bottom += Offset.y;
|
||||
if (NtGdiIntersectRect(lprc, lprc, &info.rcCaret))
|
||||
{
|
||||
NtUserHideCaret(0);
|
||||
lprc->left = pt.x;
|
||||
lprc->top = pt.y;
|
||||
return info.hwndCaret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||
|
||||
/*
|
||||
|
@ -926,4 +965,224 @@ NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* NtUserScrollDC
|
||||
*
|
||||
* Status
|
||||
* @implemented
|
||||
*/
|
||||
|
||||
DWORD STDCALL
|
||||
NtUserScrollDC(HDC hDC, INT dx, INT dy, const RECT *lprcScroll,
|
||||
const RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate)
|
||||
{
|
||||
RECT rSrc, rClipped_src, rClip, rDst, offset;
|
||||
|
||||
/*
|
||||
* Compute device clipping region (in device coordinates).
|
||||
*/
|
||||
|
||||
if (lprcScroll)
|
||||
rSrc = *lprcScroll;
|
||||
else
|
||||
NtGdiGetClipBox(hDC, &rSrc);
|
||||
NtGdiLPtoDP(hDC, (LPPOINT)&rSrc, 2);
|
||||
|
||||
if (lprcClip)
|
||||
rClip = *lprcClip;
|
||||
else
|
||||
NtGdiGetClipBox(hDC, &rClip);
|
||||
NtGdiLPtoDP(hDC, (LPPOINT)&rClip, 2);
|
||||
|
||||
NtGdiIntersectRect(&rClipped_src, &rSrc, &rClip);
|
||||
|
||||
rDst = rClipped_src;
|
||||
NtGdiSetRect(&offset, 0, 0, dx, dy);
|
||||
NtGdiLPtoDP(hDC, (LPPOINT)&offset, 2);
|
||||
NtGdiOffsetRect(&rDst, offset.right - offset.left, offset.bottom - offset.top);
|
||||
NtGdiIntersectRect(&rDst, &rDst, &rClip);
|
||||
|
||||
/*
|
||||
* Copy bits, if possible.
|
||||
*/
|
||||
|
||||
if (rDst.bottom > rDst.top && rDst.right > rDst.left)
|
||||
{
|
||||
RECT rDst_lp = rDst, rSrc_lp = rDst;
|
||||
|
||||
NtGdiOffsetRect(&rSrc_lp, offset.left - offset.right, offset.top - offset.bottom);
|
||||
NtGdiDPtoLP(hDC, (LPPOINT)&rDst_lp, 2);
|
||||
NtGdiDPtoLP(hDC, (LPPOINT)&rSrc_lp, 2);
|
||||
|
||||
if (!NtGdiBitBlt(hDC, rDst_lp.left, rDst_lp.top, rDst_lp.right - rDst_lp.left,
|
||||
rDst_lp.bottom - rDst_lp.top, hDC, rSrc_lp.left, rSrc_lp.top,
|
||||
SRCCOPY))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute update areas. This is the clipped source or'ed with the
|
||||
* unclipped source translated minus the clipped src translated (rDst)
|
||||
* all clipped to rClip.
|
||||
*/
|
||||
|
||||
if (hrgnUpdate || lprcUpdate)
|
||||
{
|
||||
HRGN hRgn = hrgnUpdate, hRgn2;
|
||||
|
||||
if (hRgn)
|
||||
NtGdiSetRectRgn(hRgn, rClipped_src.left, rClipped_src.top, rClipped_src.right, rClipped_src.bottom);
|
||||
else
|
||||
hRgn = NtGdiCreateRectRgn(rClipped_src.left, rClipped_src.top, rClipped_src.right, rClipped_src.bottom);
|
||||
|
||||
hRgn2 = NtGdiCreateRectRgnIndirect(&rSrc);
|
||||
NtGdiOffsetRgn(hRgn2, offset.right - offset.left, offset.bottom - offset.top);
|
||||
NtGdiCombineRgn(hRgn, hRgn, hRgn2, RGN_OR);
|
||||
|
||||
NtGdiSetRectRgn(hRgn2, rDst.left, rDst.top, rDst.right, rDst.bottom);
|
||||
NtGdiCombineRgn(hRgn, hRgn, hRgn2, RGN_DIFF);
|
||||
|
||||
NtGdiSetRectRgn(hRgn2, rClip.left, rClip.top, rClip.right, rClip.bottom);
|
||||
NtGdiCombineRgn(hRgn, hRgn, hRgn2, RGN_AND);
|
||||
|
||||
if (lprcUpdate)
|
||||
{
|
||||
NtGdiGetRgnBox(hRgn, lprcUpdate);
|
||||
|
||||
/* Put the lprcUpdate in logical coordinate */
|
||||
NtGdiDPtoLP(hDC, (LPPOINT)lprcUpdate, 2);
|
||||
}
|
||||
if (!hrgnUpdate)
|
||||
NtGdiDeleteObject(hRgn);
|
||||
NtGdiDeleteObject(hRgn2);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* NtUserScrollWindowEx
|
||||
*
|
||||
* Status
|
||||
* @unimplemented
|
||||
*/
|
||||
|
||||
DWORD STDCALL
|
||||
NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *rect,
|
||||
const RECT *clipRect, HRGN hrgnUpdate, LPRECT rcUpdate, UINT flags)
|
||||
{
|
||||
RECT rc, cliprc, caretrc;
|
||||
INT Result;
|
||||
PWINDOW_OBJECT Window;
|
||||
HDC hDC;
|
||||
HRGN hrgnTemp;
|
||||
HWND hwndCaret;
|
||||
BOOL bUpdate = (rcUpdate || hrgnUpdate || flags & (SW_INVALIDATE | SW_ERASE));
|
||||
BOOL bOwnRgn = TRUE;
|
||||
|
||||
Window = IntGetWindowObject(hWnd);
|
||||
if (!Window || !IntIsWindowDrawable(Window))
|
||||
{
|
||||
IntReleaseWindowObject(Window);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
IntGetClientRect(Window, &rc);
|
||||
if (rect)
|
||||
NtGdiIntersectRect(&rc, &rc, rect);
|
||||
|
||||
if (clipRect)
|
||||
NtGdiIntersectRect(&cliprc, &rc, clipRect);
|
||||
else
|
||||
cliprc = rc;
|
||||
|
||||
if (cliprc.right <= cliprc.left || cliprc.bottom <= cliprc.top ||
|
||||
(dx == 0 && dy == 0))
|
||||
{
|
||||
return NULLREGION;
|
||||
}
|
||||
|
||||
caretrc = rc;
|
||||
hwndCaret = IntFixCaret(hWnd, &caretrc, flags);
|
||||
|
||||
if (hrgnUpdate)
|
||||
bOwnRgn = FALSE;
|
||||
else if (bUpdate)
|
||||
hrgnUpdate = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||
|
||||
hDC = NtUserGetDCEx( hWnd, 0, DCX_CACHE | DCX_USESTYLE );
|
||||
if (hDC)
|
||||
{
|
||||
HRGN hRgn = NtGdiCreateRectRgn( 0, 0, 0, 0 );
|
||||
|
||||
NtUserScrollDC(hDC, dx, dy, &rc, &cliprc, hrgnUpdate, rcUpdate);
|
||||
NtUserReleaseDC(hWnd, hDC);
|
||||
if (bUpdate)
|
||||
NtGdiCombineRgn(hrgnUpdate, hrgnUpdate, hRgn, RGN_OR);
|
||||
else
|
||||
NtUserRedrawWindow(hWnd, NULL, hRgn, RDW_INVALIDATE | RDW_ERASE);
|
||||
NtGdiDeleteObject(hRgn);
|
||||
}
|
||||
|
||||
/*
|
||||
* Take into account the fact that some damage may have occurred during
|
||||
* the scroll.
|
||||
*/
|
||||
|
||||
hrgnTemp = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||
Result = NtUserGetUpdateRgn(hWnd, hrgnTemp, FALSE);
|
||||
if (Result != NULLREGION)
|
||||
{
|
||||
HRGN hrgnClip = NtGdiCreateRectRgnIndirect(&cliprc);
|
||||
NtGdiOffsetRgn(hrgnTemp, dx, dy);
|
||||
NtGdiCombineRgn(hrgnTemp, hrgnTemp, hrgnClip, RGN_AND);
|
||||
NtUserRedrawWindow(hWnd, NULL, hrgnTemp, RDW_INVALIDATE | RDW_ERASE);
|
||||
NtGdiDeleteObject(hrgnClip);
|
||||
}
|
||||
NtGdiDeleteObject(hrgnTemp);
|
||||
|
||||
if (flags & SW_SCROLLCHILDREN)
|
||||
{
|
||||
HWND *List = IntWinListChildren(Window);
|
||||
if (List)
|
||||
{
|
||||
int i;
|
||||
RECT r, dummy;
|
||||
POINT ClientOrigin;
|
||||
|
||||
for (i = 0; List[i]; i++)
|
||||
{
|
||||
NtUserGetWindowRect(List[i], &r);
|
||||
NtUserGetClientOrigin(hWnd, &ClientOrigin);
|
||||
r.left -= ClientOrigin.x;
|
||||
r.top -= ClientOrigin.y;
|
||||
r.right -= ClientOrigin.x;
|
||||
r.bottom -= ClientOrigin.y;
|
||||
if (!rect || NtGdiIntersectRect(&dummy, &r, &rc))
|
||||
WinPosSetWindowPos(List[i], 0, r.left + dx, r.top + dy, 0, 0,
|
||||
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE |
|
||||
SWP_NOREDRAW);
|
||||
}
|
||||
ExFreePool(List);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & (SW_INVALIDATE | SW_ERASE))
|
||||
NtUserRedrawWindow(hWnd, NULL, hrgnUpdate, RDW_INVALIDATE | RDW_ERASE |
|
||||
((flags & SW_ERASE) ? RDW_ERASENOW : 0) |
|
||||
((flags & SW_SCROLLCHILDREN) ? RDW_ALLCHILDREN : 0));
|
||||
|
||||
if (bOwnRgn && hrgnUpdate)
|
||||
NtGdiDeleteObject(hrgnUpdate);
|
||||
|
||||
if (hwndCaret)
|
||||
{
|
||||
IntSetCaretPos(caretrc.left + dx, caretrc.top + dy);
|
||||
NtUserShowCaret(hwndCaret);
|
||||
}
|
||||
|
||||
IntReleaseWindowObject(Window);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: scrollbar.c,v 1.18 2003/10/25 22:57:34 navaraf Exp $
|
||||
/* $Id: scrollbar.c,v 1.19 2003/12/08 18:21:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -745,23 +745,6 @@ NtUserEnableScrollBar(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
NtUserScrollDC(
|
||||
HDC hDC,
|
||||
int dx,
|
||||
int dy,
|
||||
CONST RECT *lprcScroll,
|
||||
CONST RECT *lprcClip ,
|
||||
HRGN hrgnUpdate,
|
||||
LPRECT lprcUpdate)
|
||||
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
NtUserSetScrollInfo(
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: window.c,v 1.154 2003/12/07 23:02:57 gvg Exp $
|
||||
/* $Id: window.c,v 1.155 2003/12/08 18:21:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -2811,25 +2811,6 @@ NtUserRegisterWindowMessage(PUNICODE_STRING MessageNameUnsafe)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
DWORD STDCALL
|
||||
NtUserScrollWindowEx(DWORD Unknown0,
|
||||
DWORD Unknown1,
|
||||
DWORD Unknown2,
|
||||
DWORD Unknown3,
|
||||
DWORD Unknown4,
|
||||
DWORD Unknown5,
|
||||
DWORD Unknown6,
|
||||
DWORD Unknown7)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue