ReactOS  0.4.15-dev-1068-g467feb9
smoothscroll.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winerror.h"
#include "winuser.h"
#include "wine/debug.h"
Include dependency graph for smoothscroll.c:

Go to the source code of this file.

Classes

struct  tagSMOOTHSCROLLSTRUCT
 

Typedefs

typedef BOOL(CALLBACKSCROLLWINDOWEXPROC) (HWND, INT, INT, LPRECT, LPRECT, HRGN, LPRECT, DWORD)
 
typedef struct tagSMOOTHSCROLLSTRUCT SMOOTHSCROLLSTRUCT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (commctrl)
 
BOOL WINAPI SmoothScrollWindow (const SMOOTHSCROLLSTRUCT *smooth)
 

Variables

static DWORD smoothscroll = 2
 

Typedef Documentation

◆ SCROLLWINDOWEXPROC

typedef BOOL(CALLBACK * SCROLLWINDOWEXPROC) (HWND, INT, INT, LPRECT, LPRECT, HRGN, LPRECT, DWORD)

Definition at line 37 of file smoothscroll.c.

◆ SMOOTHSCROLLSTRUCT

Function Documentation

◆ SmoothScrollWindow()

BOOL WINAPI SmoothScrollWindow ( const SMOOTHSCROLLSTRUCT smooth)

Definition at line 71 of file smoothscroll.c.

71  {
72  LPRECT lpupdaterect = smooth->lpupdaterect;
73  HRGN hrgnupdate = smooth->hrgnupdate;
74  RECT tmprect;
75  DWORD flags = smooth->flags;
76 
77  if (smooth->dwSize!=sizeof(SMOOTHSCROLLSTRUCT))
78  return FALSE;
79 
80  if (!lpupdaterect)
81  lpupdaterect = &tmprect;
82  SetRectEmpty(lpupdaterect);
83 
84  if (!(flags & 0x40000)) { /* no override, use system wide defaults */
85  if (smoothscroll == 2) {
86  HKEY hkey;
87 
88  smoothscroll = 0;
89  if (!RegOpenKeyA(HKEY_CURRENT_USER,"Control Panel\\Desktop",&hkey)) {
90  DWORD len = 4;
91 
92  RegQueryValueExA(hkey,"SmoothScroll",0,0,(LPBYTE)&smoothscroll,&len);
93  RegCloseKey(hkey);
94  }
95  }
96  if (!smoothscroll)
97  flags |= 0x20000;
98  }
99 
100  if (flags & 0x20000) { /* are we doing jump scrolling? */
101  if ((smooth->x2 & 1) && smooth->scrollfun)
102  return smooth->scrollfun(
103  smooth->hwnd,smooth->dx,smooth->dy,smooth->lpscrollrect,
104  smooth->lpcliprect,hrgnupdate,lpupdaterect,
105  flags & 0xffff
106  );
107  else
108  return ScrollWindowEx(
109  smooth->hwnd,smooth->dx,smooth->dy,smooth->lpscrollrect,
110  smooth->lpcliprect,hrgnupdate,lpupdaterect,
111  flags & 0xffff
112  );
113  }
114 
115  FIXME("(hwnd=%p,flags=%x,x2=%x): should smooth scroll here.\n",
116  smooth->hwnd,flags,smooth->x2
117  );
118  /* FIXME: do timer based smooth scrolling */
119  if ((smooth->x2 & 1) && smooth->scrollfun)
120  return smooth->scrollfun(
121  smooth->hwnd,smooth->dx,smooth->dy,smooth->lpscrollrect,
122  smooth->lpcliprect,hrgnupdate,lpupdaterect,
123  flags & 0xffff
124  );
125  else
126  return ScrollWindowEx(
127  smooth->hwnd,smooth->dx,smooth->dy,smooth->lpscrollrect,
128  smooth->lpcliprect,hrgnupdate,lpupdaterect,
129  flags & 0xffff
130  );
131 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static DWORD smoothscroll
Definition: smoothscroll.c:35
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
SCROLLWINDOWEXPROC scrollfun
Definition: smoothscroll.c:55

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( commctrl  )

Variable Documentation

◆ smoothscroll

DWORD smoothscroll = 2
static

Definition at line 35 of file smoothscroll.c.

Referenced by SmoothScrollWindow().