Reactos
at master 31 lines 1.3 kB view raw
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 11typedef 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 26void OnKeyScroll(HWND hWnd, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state); 27void OnMouseScroll(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state); 28void OnScroll(HWND hWnd, INT nBar, WPARAM wParam, INT iDelta, LPSCROLLSTATE state); 29 30void UpdateLinesToScroll(LPSCROLLSTATE state); 31void UpdateWindowScrollState(HWND hWnd, INT nMaxWidth, INT nMaxHeight, LPSCROLLSTATE lpState);