GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_text_scroll_wheel_create.c Lines: 13 13 100.0 %
Date: 2024-12-05 08:52:37 Branches: 0 0 - %

Line Branch Exec Source
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
/**   Text Scroll Wheel Management (Scroll Wheel)                         */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_scroll_wheel.h"
28
29
/**************************************************************************/
30
/*                                                                        */
31
/*  FUNCTION                                               RELEASE        */
32
/*                                                                        */
33
/*    _gx_text_scroll_wheel_create                        PORTABLE C      */
34
/*                                                           6.1          */
35
/*  AUTHOR                                                                */
36
/*                                                                        */
37
/*    Kenneth Maxwell, Microsoft Corporation                              */
38
/*                                                                        */
39
/*  DESCRIPTION                                                           */
40
/*                                                                        */
41
/*    This function creates a scroll wheel selector widget.               */
42
/*                                                                        */
43
/*  INPUT                                                                 */
44
/*                                                                        */
45
/*    wheel                                 Scroll wheel control block    */
46
/*    name                                  Name of widget                */
47
/*    parent                                Parent widget control block   */
48
/*    total_rows                            Total rows of the scroll wheel*/
49
/*    style                                 Style of widget               */
50
/*    Id                                    Application-defined ID of the */
51
/*                                            the widget                  */
52
/*    size                                  Widget size                   */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    status                                Completion status             */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_scroll_wheel_create               Create a text scroll wheel    */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*    GUIX Internal Code                                                  */
66
/*                                                                        */
67
/*  RELEASE HISTORY                                                       */
68
/*                                                                        */
69
/*    DATE              NAME                      DESCRIPTION             */
70
/*                                                                        */
71
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
72
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
73
/*                                            added logic to init new     */
74
/*                                            structure member for        */
75
/*                                            dynamic bidi text support,  */
76
/*                                            resulting in version 6.1    */
77
/*                                                                        */
78
/**************************************************************************/
79
460
UINT  _gx_text_scroll_wheel_create(GX_TEXT_SCROLL_WHEEL *wheel,
80
                                   GX_CONST GX_CHAR *name, GX_WIDGET *parent, INT total_rows,
81
                                   ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size)
82
{
83
84
    /* Call default widget create. */
85
460
    _gx_scroll_wheel_create((GX_SCROLL_WHEEL *)wheel, name, parent, total_rows, style, Id, size);
86
87
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
88
460
    wheel -> gx_text_scroll_wheel_text_get_deprecated = GX_NULL;
89
#endif
90
460
    wheel -> gx_text_scroll_wheel_text_get = GX_NULL;
91
460
    wheel -> gx_widget_type = GX_TYPE_TEXT_SCROLL_WHEEL;
92
460
    wheel -> gx_text_scroll_wheel_normal_font = GX_FONT_ID_DEFAULT;
93
460
    wheel -> gx_text_scroll_wheel_selected_font = GX_FONT_ID_DEFAULT;
94
460
    wheel -> gx_text_scroll_wheel_normal_text_color = GX_COLOR_ID_SHADOW;
95
460
    wheel -> gx_text_scroll_wheel_selected_text_color = GX_COLOR_ID_TEXT;
96
460
    wheel -> gx_text_scroll_wheel_disabled_text_color = GX_COLOR_ID_DISABLED_TEXT;
97
460
    wheel -> gx_widget_draw_function = (VOID (*)(GX_WIDGET *))_gx_text_scroll_wheel_draw;
98
460
    wheel -> gx_widget_event_process_function = (UINT (*)(GX_WIDGET *, GX_EVENT *))_gx_text_scroll_wheel_event_process;
99
100
#ifdef GX_DYNAMIC_BIDI_TEXT_SUPPORT
101
    wheel -> gx_text_scroll_wheel_bidi_resolved_text_info = GX_NULL;
102
#endif  // GX_DYNAMIC_BIDI_TEXT_SUPPORT
103
104
460
    return(GX_SUCCESS);
105
}
106