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 /**   Drop List (List)                                                    */
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_system.h"
30 #include "gx_drop_list.h"
31 
32 /* Bring in externs for caller checking code.  */
33 GX_CALLER_CHECKING_EXTERNS
34 /**************************************************************************/
35 /*                                                                        */
36 /*  FUNCTION                                               RELEASE        */
37 /*                                                                        */
38 /*    _gxe_drop_list_create                               PORTABLE C      */
39 /*                                                           6.1          */
40 /*  AUTHOR                                                                */
41 /*                                                                        */
42 /*    Kenneth Maxwell, Microsoft Corporation                              */
43 /*                                                                        */
44 /*  DESCRIPTION                                                           */
45 /*                                                                        */
46 /*    This function checks for errors in the drop list create function    */
47 /*    call.                                                               */
48 /*                                                                        */
49 /*  INPUT                                                                 */
50 /*                                                                        */
51 /*    drop_list                             Drop list control block       */
52 /*    name                                  Name of drop list             */
53 /*    parent                                Pointer to parent widget      */
54 /*    total_rows                            Total number of rows in       */
55 /*                                            drop list                   */
56 /*    open_height                           Height of the vertical list   */
57 /*    callback                              Callback function             */
58 /*    style                                 Style of scrollbar widget     */
59 /*    drop_list_id                          Application-defined ID of     */
60 /*                                            the drop list               */
61 /*    size                                  Dimensions of the drop list   */
62 /*    drop_list_control_block_size          Control block size            */
63 /*                                                                        */
64 /*  OUTPUT                                                                */
65 /*                                                                        */
66 /*    status                                Completion status             */
67 /*                                                                        */
68 /*  CALLS                                                                 */
69 /*                                                                        */
70 /*    _gx_drop_list_create                  Actual drop list create call  */
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_drop_list_create(GX_DROP_LIST * drop_list,GX_CONST GX_CHAR * name,GX_WIDGET * parent,INT total_rows,INT open_height,VOID (* callback)(GX_VERTICAL_LIST *,GX_WIDGET *,INT),ULONG style,USHORT drop_list_id,GX_CONST GX_RECTANGLE * size,UINT drop_list_control_block_size)85 UINT  _gxe_drop_list_create(GX_DROP_LIST *drop_list, GX_CONST GX_CHAR *name,
86                             GX_WIDGET *parent, INT total_rows, INT open_height,
87                             VOID (*callback)(GX_VERTICAL_LIST *, GX_WIDGET *, INT),
88                             ULONG style, USHORT drop_list_id, GX_CONST GX_RECTANGLE *size, UINT drop_list_control_block_size)
89 {
90 UINT status;
91 
92     /* Check for appropriate caller.  */
93     GX_INIT_AND_THREADS_CALLER_CHECKING
94 
95     /* Check for invalid input pointers.  */
96     if (!drop_list || !size)
97     {
98         return(GX_PTR_ERROR);
99     }
100 
101     /* Check for control block size. */
102     if (drop_list_control_block_size != sizeof(GX_DROP_LIST))
103     {
104         return(GX_INVALID_SIZE);
105     }
106 
107     /* Check for widget already created.  */
108     if (drop_list -> gx_widget_type != 0)
109     {
110         return(GX_ALREADY_CREATED);
111     }
112 
113     /* Call actual widget hide function.  */
114     status = _gx_drop_list_create(drop_list, name, parent, total_rows, open_height,
115                                   callback, style, drop_list_id, size);
116 
117     return(status);
118 }
119 
120