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 |
|
|
/** Accordion Menu Management (Menu) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_menu.h" |
29 |
|
|
|
30 |
|
|
/* Bring in externs for caller checking code. */ |
31 |
|
|
GX_CALLER_CHECKING_EXTERNS |
32 |
|
|
|
33 |
|
|
/**************************************************************************/ |
34 |
|
|
/* */ |
35 |
|
|
/* FUNCTION RELEASE */ |
36 |
|
|
/* */ |
37 |
|
|
/* _gxe_accordion_menu_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 accordion menu create function */ |
46 |
|
|
/* call. */ |
47 |
|
|
/* */ |
48 |
|
|
/* INPUT */ |
49 |
|
|
/* */ |
50 |
|
|
/* menu Pointer to the accordion menu */ |
51 |
|
|
/* control block */ |
52 |
|
|
/* name Name of the menu */ |
53 |
|
|
/* parent Parent widget control block */ |
54 |
|
|
/* style Style of the widget */ |
55 |
|
|
/* tree_menu_id Application-defined ID of */ |
56 |
|
|
/* the accordion menu */ |
57 |
|
|
/* size Accordion menu size */ |
58 |
|
|
/* control_block_size Control block size */ |
59 |
|
|
/* */ |
60 |
|
|
/* OUTPUT */ |
61 |
|
|
/* */ |
62 |
|
|
/* status Completion status */ |
63 |
|
|
/* */ |
64 |
|
|
/* CALLS */ |
65 |
|
|
/* */ |
66 |
|
|
/* _gx_accordion_menu_create Actual accordion menu create */ |
67 |
|
|
/* function call */ |
68 |
|
|
/* */ |
69 |
|
|
/* CALLED BY */ |
70 |
|
|
/* */ |
71 |
|
|
/* Application Code */ |
72 |
|
|
/* */ |
73 |
|
|
/**************************************************************************/ |
74 |
|
3406 |
UINT _gxe_accordion_menu_create(GX_ACCORDION_MENU *accordion, GX_CONST GX_CHAR *name, GX_WIDGET *parent, |
75 |
|
|
ULONG style, USHORT accordion_menu_id, GX_CONST GX_RECTANGLE *size, UINT control_block_size) |
76 |
|
|
{ |
77 |
|
|
UINT status; |
78 |
|
|
|
79 |
|
|
/* Check for appropriate caller. */ |
80 |
✓✓✓✓ ✓✓ |
3406 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
81 |
|
|
|
82 |
|
|
/* Check for invalid input pointers. */ |
83 |
✓✓✓✓
|
3404 |
if ((!accordion) || (!size)) |
84 |
|
|
{ |
85 |
|
4 |
return(GX_PTR_ERROR); |
86 |
|
|
} |
87 |
|
|
|
88 |
|
|
/* Check for widget already created. */ |
89 |
✓✓ |
3400 |
if (accordion -> gx_widget_type != 0) |
90 |
|
|
{ |
91 |
|
1 |
return(GX_ALREADY_CREATED); |
92 |
|
|
} |
93 |
|
|
|
94 |
|
|
/* Check for invalid control block size. */ |
95 |
✓✓ |
3399 |
if (control_block_size != sizeof(GX_ACCORDION_MENU)) |
96 |
|
|
{ |
97 |
|
1 |
return(GX_INVALID_SIZE); |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
/* Call actual accordion menu create function. */ |
101 |
|
3398 |
status = _gx_accordion_menu_create(accordion, name, parent, style, accordion_menu_id, size); |
102 |
|
|
|
103 |
|
3398 |
return(status); |
104 |
|
|
} |
105 |
|
|
|