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 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_widget.h" |
29 |
|
|
#include "gx_scrollbar.h" |
30 |
|
|
|
31 |
|
|
GX_CALLER_CHECKING_EXTERNS |
32 |
|
|
|
33 |
|
|
/**************************************************************************/ |
34 |
|
|
/* */ |
35 |
|
|
/* FUNCTION RELEASE */ |
36 |
|
|
/* */ |
37 |
|
|
/* _gxe_horizontal_scrollbar_create PORTABLE C */ |
38 |
|
|
/* 6.1 */ |
39 |
|
|
/* AUTHOR */ |
40 |
|
|
/* */ |
41 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
42 |
|
|
/* */ |
43 |
|
|
/* DESCRIPTION */ |
44 |
|
|
/* */ |
45 |
|
|
/* This function checks for errors in the horizontal scrollbar create */ |
46 |
|
|
/* function call. */ |
47 |
|
|
/* */ |
48 |
|
|
/* INPUT */ |
49 |
|
|
/* */ |
50 |
|
|
/* scrollbar scroll control block */ |
51 |
|
|
/* name Name of scroll */ |
52 |
|
|
/* parent parent window */ |
53 |
|
|
/* appearance style of scroll bar */ |
54 |
|
|
/* */ |
55 |
|
|
/* OUTPUT */ |
56 |
|
|
/* */ |
57 |
|
|
/* status Completion status */ |
58 |
|
|
/* */ |
59 |
|
|
/* CALLS */ |
60 |
|
|
/* */ |
61 |
|
|
/* _gx_horizontal_scrollbar_create Actual horizontal scrollbar */ |
62 |
|
|
/* create function */ |
63 |
|
|
/* */ |
64 |
|
|
/* CALLED BY */ |
65 |
|
|
/* */ |
66 |
|
|
/* Application Code */ |
67 |
|
|
/* */ |
68 |
|
|
/**************************************************************************/ |
69 |
|
1066 |
UINT _gxe_horizontal_scrollbar_create(GX_SCROLLBAR *scrollbar, GX_CONST GX_CHAR *name, |
70 |
|
|
GX_WINDOW *parent, GX_SCROLLBAR_APPEARANCE *appearance, |
71 |
|
|
ULONG style, UINT scrollbar_control_block_size) |
72 |
|
|
{ |
73 |
|
|
UINT status; |
74 |
|
|
|
75 |
|
|
/* Check for appropriate caller. */ |
76 |
✓✓✓✓ ✓✓ |
1066 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
77 |
|
|
|
78 |
|
|
/* Check for invalid input pointers. */ |
79 |
✓✓ |
1064 |
if (scrollbar == GX_NULL) |
80 |
|
|
{ |
81 |
|
2 |
return(GX_PTR_ERROR); |
82 |
|
|
} |
83 |
|
|
|
84 |
✓✓ |
1062 |
if (scrollbar_control_block_size != sizeof(GX_SCROLLBAR)) |
85 |
|
|
{ |
86 |
|
1 |
return(GX_INVALID_SIZE); |
87 |
|
|
} |
88 |
|
|
|
89 |
|
|
/* Check for id is created. */ |
90 |
✓✓ |
1061 |
if (scrollbar -> gx_widget_type != 0) |
91 |
|
|
{ |
92 |
|
1 |
return(GX_ALREADY_CREATED); |
93 |
|
|
} |
94 |
|
|
|
95 |
|
|
/* Call the actual horizontal scroll*/ |
96 |
|
1060 |
status = _gx_horizontal_scrollbar_create(scrollbar, name, parent, appearance, style); |
97 |
|
|
|
98 |
|
|
/* Return completion status. */ |
99 |
|
1060 |
return status; |
100 |
|
|
} |
101 |
|
|
|