1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the MIT License which is available at
6 * https://opensource.org/licenses/MIT.
7 *
8 * SPDX-License-Identifier: MIT
9 **************************************************************************/
10
11
12 /**************************************************************************/
13 /**************************************************************************/
14 /** */
15 /** GUIX Component */
16 /** */
17 /** Progress Bar Management (Progress Bar) */
18 /** */
19 /**************************************************************************/
20
21 #define GX_SOURCE_CODE
22
23 /* Include necessary system files. */
24
25 #include "gx_api.h"
26 #include "gx_context.h"
27 #include "gx_widget.h"
28 #include "gx_canvas.h"
29 #include "gx_utility.h"
30 #include "gx_progress_bar.h"
31
32 /**************************************************************************/
33 /* */
34 /* FUNCTION RELEASE */
35 /* */
36 /* _gx_progress_bar_draw PORTABLE C */
37 /* 6.1 */
38 /* AUTHOR */
39 /* */
40 /* Kenneth Maxwell, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This service draws the specified progress bar. */
45 /* */
46 /* INPUT */
47 /* */
48 /* progress_bar Progress Bar control block */
49 /* */
50 /* OUTPUT */
51 /* */
52 /* None */
53 /* */
54 /* CALLS */
55 /* */
56 /* _gx_widget_border_draw Draw border */
57 /* _gx_context_pixelmap_get Retrieve pixelmap image */
58 /* _gx_widget_client_get Find the client area of a */
59 /* widget */
60 /* _gx_canvas_pixelmap_tile Tile a pixelmap */
61 /* _gx_widget_width_get Find width of a widget */
62 /* _gx_context_fill_color_set Set the draw context fill */
63 /* color */
64 /* _gx_widget_children_draw Draw children widgets */
65 /* */
66 /* CALLED BY */
67 /* */
68 /* Application Code */
69 /* GUIX Internal Code */
70 /* */
71 /* RELEASE HISTORY */
72 /* */
73 /* DATE NAME DESCRIPTION */
74 /* */
75 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
76 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */
77 /* resulting in version 6.1 */
78 /* */
79 /**************************************************************************/
_gx_progress_bar_draw(GX_PROGRESS_BAR * progress_bar)80 VOID _gx_progress_bar_draw(GX_PROGRESS_BAR *progress_bar)
81 {
82 /* Draw progress bar background. */
83 _gx_progress_bar_background_draw(progress_bar);
84
85 /* Draw text on the progress bar widget. */
86 if (progress_bar -> gx_widget_style & GX_STYLE_PROGRESS_TEXT_DRAW)
87 {
88 _gx_progress_bar_text_draw(progress_bar);
89 }
90
91 /* Draw children widgets of progress bar widget. */
92 _gx_widget_children_draw((GX_WIDGET *)progress_bar);
93 }
94
95