1 /* 2 * PROJECT: ReactOS Clipboard Viewer 3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) 4 * PURPOSE: Scrolling related helper functions. 5 * COPYRIGHT: Copyright 2015-2018 Ricardo Hanke 6 * Copyright 2015-2018 Hermes Belusca-Maito 7 */ 8 9 #pragma once 10 11 typedef struct _SCROLLSTATE 12 { 13 UINT uLinesToScroll; /* Number of lines to scroll on one wheel rotation movement (== one "click" == WHEEL_DELTA ticks) */ 14 INT iWheelCarryoverX; /* Unused wheel ticks (< WHEEL_DELTA) */ 15 INT iWheelCarryoverY; 16 INT nPageX; /* Number of lines per page */ 17 INT nPageY; 18 INT CurrentX; /* Current scrollbar position */ 19 INT CurrentY; 20 INT MaxX; /* Maximum scrollbar position */ 21 INT MaxY; 22 INT nMaxWidth; /* Maximum span of displayed data */ 23 INT nMaxHeight; 24 } SCROLLSTATE, *LPSCROLLSTATE; 25 26 void OnKeyScroll(HWND hWnd, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state); 27 void OnMouseScroll(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state); 28 void OnScroll(HWND hWnd, INT nBar, WPARAM wParam, INT iDelta, LPSCROLLSTATE state); 29 30 void UpdateLinesToScroll(LPSCROLLSTATE state); 31 void UpdateWindowScrollState(HWND hWnd, INT nMaxWidth, INT nMaxHeight, LPSCROLLSTATE lpState); 32