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