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 /**   Multi Line Text View Management (Multi Line Text View)              */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_system.h"
28 #include "gx_multi_line_text_view.h"
29 #include "gx_scrollbar.h"
30 #include "gx_window.h"
31 
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _gx_multi_line_text_view_font_set                   PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Kenneth Maxwell, Microsoft Corporation                              */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This service sets the font of a multi-line text view widget.        */
45 /*                                                                        */
46 /*                                                                        */
47 /*  INPUT                                                                 */
48 /*                                                                        */
49 /*    text_view                             Multi-line text view widget   */
50 /*                                            control block               */
51 /*    font_id                               Resource ID for the font      */
52 /*                                                                        */
53 /*  OUTPUT                                                                */
54 /*                                                                        */
55 /*    status                                Completion status             */
56 /*                                                                        */
57 /*  CALLS                                                                 */
58 /*                                                                        */
59 /*    _gx_window_scrollbar_find             Find scrollbar for a window   */
60 /*    _gx_scrollbar_reset                   Reset scrollbar information   */
61 /*    _gx_multi_line_text_view_line_cache_update                          */
62 /*                                          Update line cache             */
63 /*    _gx_system_dirty_mark                 Mark a widget as dirty        */
64 /*                                                                        */
65 /*  CALLED BY                                                             */
66 /*                                                                        */
67 /*    Application Code                                                    */
68 /*                                                                        */
69 /*  RELEASE HISTORY                                                       */
70 /*                                                                        */
71 /*    DATE              NAME                      DESCRIPTION             */
72 /*                                                                        */
73 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
74 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
75 /*                                            resulting in version 6.1    */
76 /*                                                                        */
77 /**************************************************************************/
_gx_multi_line_text_view_font_set(GX_MULTI_LINE_TEXT_VIEW * text_view,GX_RESOURCE_ID font_id)78 UINT  _gx_multi_line_text_view_font_set(GX_MULTI_LINE_TEXT_VIEW *text_view, GX_RESOURCE_ID font_id)
79 {
80     text_view -> gx_multi_line_text_view_font_id = font_id;
81     text_view -> gx_multi_line_text_view_line_index_old = GX_TRUE;
82 
83     if (text_view -> gx_widget_status & GX_STATUS_VISIBLE)
84     {
85         _gx_system_dirty_mark((GX_WIDGET *)text_view);
86     }
87     return(GX_SUCCESS);
88 }
89 
90