1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
10 /**************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** GUIX Component */
17 /** */
18 /** Slider Management (Slider) */
19 /** */
20 /**************************************************************************/
21
22 #define GX_SOURCE_CODE
23
24
25 /* Include necessary system files. */
26
27 #include "gx_api.h"
28 #include "gx_system.h"
29 #include "gx_widget.h"
30 #include "gx_slider.h"
31
32 /* Bring in externs for caller checking code. */
33 GX_CALLER_CHECKING_EXTERNS
34
35 /**************************************************************************/
36 /* */
37 /* FUNCTION RELEASE */
38 /* */
39 /* _gxe_pixelmap_slider_create PORTABLE C */
40 /* 6.1 */
41 /* AUTHOR */
42 /* */
43 /* Kenneth Maxwell, Microsoft Corporation */
44 /* */
45 /* DESCRIPTION */
46 /* */
47 /* This function checks for error in pixelmap slider create call. */
48 /* */
49 /* INPUT */
50 /* */
51 /* slider Slider control block */
52 /* name Name of prompt */
53 /* parent Parent widget control block */
54 /* info Pointer to a GX_SLIDER_INFO */
55 /* pixelmap_info Pointer to the pixelmap */
56 /* info block */
57 /* style Style of the slider */
58 /* pixelmap_slider_id Application-defined ID of */
59 /* pixelmap slider */
60 /* size Dimensions of pixelmap prompt */
61 /* pixelmap_slider_control_block_size Size of the pixelmap slider */
62 /* control block */
63 /* */
64 /* OUTPUT */
65 /* */
66 /* status Completion status */
67 /* */
68 /* CALLS */
69 /* */
70 /* _gx_pixelmap_slider_create The actual function */
71 /* */
72 /* CALLED BY */
73 /* */
74 /* Application Code */
75 /* */
76 /* RELEASE HISTORY */
77 /* */
78 /* DATE NAME DESCRIPTION */
79 /* */
80 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
81 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */
82 /* resulting in version 6.1 */
83 /* */
84 /**************************************************************************/
_gxe_pixelmap_slider_create(GX_PIXELMAP_SLIDER * slider,GX_CONST GX_CHAR * name,GX_WIDGET * parent,GX_SLIDER_INFO * info,GX_PIXELMAP_SLIDER_INFO * pixelmap_info,ULONG style,USHORT pixelmap_slider_id,GX_CONST GX_RECTANGLE * size,UINT pixelmap_slider_control_block_size)85 UINT _gxe_pixelmap_slider_create(GX_PIXELMAP_SLIDER *slider,
86 GX_CONST GX_CHAR *name,
87 GX_WIDGET *parent,
88 GX_SLIDER_INFO *info,
89 GX_PIXELMAP_SLIDER_INFO *pixelmap_info,
90 ULONG style,
91 USHORT pixelmap_slider_id,
92 GX_CONST GX_RECTANGLE *size,
93 UINT pixelmap_slider_control_block_size)
94 {
95
96 UINT status;
97
98 /* Check for appropriate caller. */
99 GX_INIT_AND_THREADS_CALLER_CHECKING
100
101 /* Check error for valid pointer. */
102 if ((slider == GX_NULL) || (size == GX_NULL) ||
103 (info == GX_NULL) || (pixelmap_info == GX_NULL))
104 {
105 return(GX_PTR_ERROR);
106 }
107
108 /* Check for invalid widget control block size. */
109 if (pixelmap_slider_control_block_size != sizeof(GX_PIXELMAP_SLIDER))
110 {
111 return(GX_INVALID_SIZE);
112 }
113
114 /* Check for widget already created. */
115 if (slider -> gx_widget_type != 0)
116 {
117 return(GX_ALREADY_CREATED);
118 }
119
120 status = _gx_pixelmap_slider_create(slider, name, parent, info, pixelmap_info, style, pixelmap_slider_id, size);
121
122 return(status);
123 }
124
125