1 /*************************************************************************** 2 * Copyright (c) 2024 Microsoft Corporation 3 * 4 * This program and the accompanying materials are made available under the 5 * terms of the MIT License which is available at 6 * https://opensource.org/licenses/MIT. 7 * 8 * SPDX-License-Identifier: MIT 9 **************************************************************************/ 10 11 12 /**************************************************************************/ 13 /**************************************************************************/ 14 /** */ 15 /** GUIX Component */ 16 /** */ 17 /** Scroll Wheel Management (Generic Scroll Wheel) */ 18 /** */ 19 /**************************************************************************/ 20 21 #define GX_SOURCE_CODE 22 23 24 /* Include necessary system files. */ 25 26 #include "gx_api.h" 27 #include "gx_scroll_wheel.h" 28 29 GX_CALLER_CHECKING_EXTERNS 30 31 /**************************************************************************/ 32 /* */ 33 /* FUNCTION RELEASE */ 34 /* */ 35 /* _gxe_generic_scroll_wheel_total_rows_set PORTABLE C */ 36 /* 6.1.7 */ 37 /* AUTHOR */ 38 /* */ 39 /* Ting Zhu, Microsoft Corporation */ 40 /* */ 41 /* DESCRIPTION */ 42 /* */ 43 /* This function checks for errors in generic scroll wheel total rows */ 44 /* set. */ 45 /* */ 46 /* INPUT */ 47 /* */ 48 /* wheel Generic scroll wheel control */ 49 /* block */ 50 /* total_rows Total rows of the scroll wheel*/ 51 /* */ 52 /* OUTPUT */ 53 /* */ 54 /* status Completion status */ 55 /* */ 56 /* CALLS */ 57 /* */ 58 /* _gx_generic_scroll_wheel_total_rows_set */ 59 /* Actual scroll wheel total rows*/ 60 /* set call */ 61 /* */ 62 /* CALLED BY */ 63 /* */ 64 /* Application Code */ 65 /* */ 66 /* RELEASE HISTORY */ 67 /* */ 68 /* DATE NAME DESCRIPTION */ 69 /* */ 70 /* 06-02-2021 Ting Zhu Initial Version 6.1.7 */ 71 /* */ 72 /**************************************************************************/ _gxe_generic_scroll_wheel_total_rows_set(GX_GENERIC_SCROLL_WHEEL * wheel,INT total_rows)73UINT _gxe_generic_scroll_wheel_total_rows_set(GX_GENERIC_SCROLL_WHEEL *wheel, INT total_rows) 74 { 75 76 /* Check for appropriate caller. */ 77 GX_INIT_AND_THREADS_CALLER_CHECKING 78 79 if (wheel == GX_NULL) 80 { 81 return GX_PTR_ERROR; 82 } 83 84 if (wheel -> gx_widget_type == 0) 85 { 86 return GX_INVALID_WIDGET; 87 } 88 89 if (total_rows < 0) 90 { 91 return GX_INVALID_VALUE; 92 } 93 94 return _gx_generic_scroll_wheel_total_rows_set(wheel, total_rows); 95 } 96 97