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 /**   Circular Gauge Management (Circular Gauge)                          */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 
23 /**************************************************************************/
24 /*                                                                        */
25 /*  COMPONENT DEFINITION                                   RELEASE        */
26 /*                                                                        */
27 /*    gx_circular_gauge.h                                 PORTABLE C      */
28 /*                                                           6.1          */
29 /*  AUTHOR                                                                */
30 /*                                                                        */
31 /*    Kenneth Maxwell, Microsoft Corporation                              */
32 /*                                                                        */
33 /*  DESCRIPTION                                                           */
34 /*                                                                        */
35 /*    This file defines the GUIX circular gauge widget,                   */
36 /*    including all data types and external references.  It is assumed    */
37 /*    that gx_api.h and gx_port.h have already been included.             */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
44 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
45 /*                                            resulting in version 6.1    */
46 /*                                                                        */
47 /**************************************************************************/
48 
49 #ifndef GX_CIRCULAR_GAUGE_H
50 #define GX_CIRCULAR_GAUGE_H
51 
52 
53 /* Define prompt management function prototypes.  */
54 
55 UINT _gx_circular_gauge_angle_get(GX_CIRCULAR_GAUGE *circular_gauge, INT *angle);
56 UINT _gx_circular_gauge_angle_set(GX_CIRCULAR_GAUGE *circular_gauge, INT angle);
57 UINT _gx_circular_gauge_animation_set(GX_CIRCULAR_GAUGE *circular_gauge, INT steps, INT delay);
58 VOID _gx_circular_gauge_background_draw(GX_CIRCULAR_GAUGE *gauge);
59 UINT _gx_circular_gauge_create(GX_CIRCULAR_GAUGE *circular_gauge,
60                                GX_CONST GX_CHAR *name,
61                                GX_WIDGET *parent,
62                                GX_CIRCULAR_GAUGE_INFO *circular_gauge_info,
63                                GX_RESOURCE_ID background,
64                                ULONG style,
65                                USHORT circular_gauge_id,
66                                GX_VALUE xpos, GX_VALUE ypos);
67 
68 VOID _gx_circular_gauge_draw(GX_CIRCULAR_GAUGE *circular_gauge);
69 UINT _gx_circular_gauge_event_process(GX_CIRCULAR_GAUGE *circular_gauge, GX_EVENT *event_ptr);
70 UINT _gx_circular_gauge_needle_rectangle_calculate(GX_CIRCULAR_GAUGE *gauge, INT angle, GX_RECTANGLE *rect);
71 UINT _gx_circular_gauge_needle_rotate(GX_CIRCULAR_GAUGE *circular_gauge);
72 UINT _gx_circular_gauge_needle_rotate_callback(VOID *gauge);
73 UINT _gx_circular_gauge_angle_increment_calculate(GX_CIRCULAR_GAUGE *circular_gauge);
74 UINT _gx_circular_gauge_needle_dirty_mark(GX_CIRCULAR_GAUGE *circular_gauge);
75 
76 
77 /* Define error checking shells for API services.  These are only referenced by the
78    application.  */
79 UINT _gxe_circular_gauge_angle_get(GX_CIRCULAR_GAUGE *circular_gauge, INT *angle);
80 UINT _gxe_circular_gauge_angle_set(GX_CIRCULAR_GAUGE *circular_gauge, INT angle);
81 UINT _gxe_circular_gauge_animation_set(GX_CIRCULAR_GAUGE *circular_gauge, INT steps, INT delay);
82 UINT _gxe_circular_gauge_create(GX_CIRCULAR_GAUGE *circular_gauge,
83                                 GX_CONST GX_CHAR *name,
84                                 GX_WIDGET *parent,
85                                 GX_CIRCULAR_GAUGE_INFO *circular_gauge_info,
86                                 GX_RESOURCE_ID background,
87                                 ULONG style,
88                                 USHORT circular_gauge_id,
89                                 GX_VALUE xpos, GX_VALUE ypos, UINT checkbox_control_block_size);
90 UINT _gxe_circular_gauge_event_process(GX_CIRCULAR_GAUGE *circular_gauge, GX_EVENT *event_ptr);
91 #endif
92 
93