1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** GUIX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Scrollbar Management (Scrollbar) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
/* Include necessary system files. */ |
25 |
|
|
|
26 |
|
|
#include "gx_api.h" |
27 |
|
|
#include "gx_scrollbar.h" |
28 |
|
|
|
29 |
|
|
/* Bring in externs for caller checking code. */ |
30 |
|
|
GX_CALLER_CHECKING_EXTERNS |
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _gxe_scrollbar_reset PORTABLE C */ |
37 |
|
|
/* 6.3.0 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* This service checks errors in the scrollbar reset function call. */ |
45 |
|
|
/* */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* scrollbar Scrollbar control block */ |
50 |
|
|
/* info Pointer to GX_SCROLL */ |
51 |
|
|
/* structure that defines the */ |
52 |
|
|
/* scrollbar limits, current */ |
53 |
|
|
/* value, and step/increment. */ |
54 |
|
|
/* */ |
55 |
|
|
/* OUTPUT */ |
56 |
|
|
/* */ |
57 |
|
|
/* status Completion status */ |
58 |
|
|
/* */ |
59 |
|
|
/* CALLS */ |
60 |
|
|
/* */ |
61 |
|
|
/* _gx_scrollbar_reset The actual function */ |
62 |
|
|
/* */ |
63 |
|
|
/* CALLED BY */ |
64 |
|
|
/* */ |
65 |
|
|
/* Application Code */ |
66 |
|
|
/* */ |
67 |
|
|
/**************************************************************************/ |
68 |
|
15 |
UINT _gxe_scrollbar_reset(GX_SCROLLBAR *scrollbar, GX_SCROLL_INFO *info) |
69 |
|
|
{ |
70 |
|
|
UINT status; |
71 |
|
|
|
72 |
|
|
/* Check for appropriate caller. */ |
73 |
✓✓✓✓ ✓✓ |
15 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
74 |
|
|
|
75 |
|
|
/* Check for invalid input pointers. */ |
76 |
✓✓ |
13 |
if ((scrollbar == GX_NULL)) |
77 |
|
|
{ |
78 |
|
2 |
return(GX_PTR_ERROR); |
79 |
|
|
} |
80 |
|
|
|
81 |
|
|
/* Check for invalid widget. */ |
82 |
✓✓ |
11 |
if (scrollbar -> gx_widget_type == 0) |
83 |
|
|
{ |
84 |
|
2 |
return(GX_INVALID_WIDGET); |
85 |
|
|
} |
86 |
|
|
|
87 |
|
|
/* Check for valid scroll info. */ |
88 |
✓✓✓✓
|
9 |
if ((info != GX_NULL) && ((info -> gx_scroll_value > info -> gx_scroll_maximum) || |
89 |
✓✓ |
2 |
(info -> gx_scroll_value < info -> gx_scroll_minimum))) |
90 |
|
|
{ |
91 |
|
2 |
return(GX_INVALID_VALUE); |
92 |
|
|
} |
93 |
|
|
|
94 |
|
|
/* Call the actual function. */ |
95 |
|
7 |
status = _gx_scrollbar_reset(scrollbar, info); |
96 |
|
|
|
97 |
|
|
/* Return successful completion. */ |
98 |
|
7 |
return(status); |
99 |
|
|
} |
100 |
|
|
|