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 |
|
|
/** Display management (Display) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_display.h" |
29 |
|
|
|
30 |
|
|
/* Bring in externs for caller checking code. */ |
31 |
|
|
GX_CALLER_CHECKING_EXTERNS |
32 |
|
|
|
33 |
|
|
/**************************************************************************/ |
34 |
|
|
/* */ |
35 |
|
|
/* FUNCTION RELEASE */ |
36 |
|
|
/* */ |
37 |
|
|
/* _gxe_display_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 display create function */ |
46 |
|
|
/* call. */ |
47 |
|
|
/* */ |
48 |
|
|
/* INPUT */ |
49 |
|
|
/* */ |
50 |
|
|
/* display Display control block */ |
51 |
|
|
/* name Name of display */ |
52 |
|
|
/* display_driver_setup Display driver setup function */ |
53 |
|
|
/* width Display width in pixels */ |
54 |
|
|
/* height Display height in pixels */ |
55 |
|
|
/* display_control_block_size Size of the display control */ |
56 |
|
|
/* block */ |
57 |
|
|
/* */ |
58 |
|
|
/* OUTPUT */ |
59 |
|
|
/* */ |
60 |
|
|
/* status Completion status */ |
61 |
|
|
/* */ |
62 |
|
|
/* CALLS */ |
63 |
|
|
/* */ |
64 |
|
|
/* _gx_display_create Actual display create */ |
65 |
|
|
/* function */ |
66 |
|
|
/* */ |
67 |
|
|
/* CALLED BY */ |
68 |
|
|
/* */ |
69 |
|
|
/* Application Code */ |
70 |
|
|
/* */ |
71 |
|
|
/**************************************************************************/ |
72 |
|
744 |
UINT _gxe_display_create(GX_DISPLAY *display, GX_CONST GX_CHAR *name, |
73 |
|
|
UINT (*display_driver_setup)(GX_DISPLAY *), |
74 |
|
|
GX_VALUE width, GX_VALUE height, UINT display_control_block_size) |
75 |
|
|
{ |
76 |
|
|
UINT status; |
77 |
|
|
|
78 |
|
|
/* Check for appropriate caller. */ |
79 |
✓✓✓✓ ✓✓ |
744 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
80 |
|
|
|
81 |
|
|
/* Check for invalid input pointers. */ |
82 |
✓✓✓✓
|
742 |
if ((display == GX_NULL) || (display_driver_setup == GX_NULL)) |
83 |
|
|
{ |
84 |
|
3 |
return(GX_PTR_ERROR); |
85 |
|
|
} |
86 |
|
|
|
87 |
✓✓ |
739 |
if (display_control_block_size != sizeof(GX_DISPLAY)) |
88 |
|
|
{ |
89 |
|
1 |
return(GX_INVALID_SIZE); |
90 |
|
|
} |
91 |
|
|
|
92 |
✓✓ |
738 |
if (display -> gx_display_id == GX_DISPLAY_ID) |
93 |
|
|
{ |
94 |
|
1 |
return (GX_ALREADY_CREATED); |
95 |
|
|
} |
96 |
|
|
|
97 |
|
|
/* Call actual window create function. */ |
98 |
|
737 |
status = _gx_display_create(display, name, display_driver_setup, width, height); |
99 |
|
|
|
100 |
|
|
/* Return completion status. */ |
101 |
|
737 |
return(status); |
102 |
|
|
} |
103 |
|
|
|