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 #include "gx_scrollbar.h"
32 
33 /**************************************************************************/
34 /*                                                                        */
35 /*  FUNCTION                                               RELEASE        */
36 /*                                                                        */
37 /*    _gx_multi_line_text_view_line_pace_set              PORTABLE C      */
38 /*                                                           6.1          */
39 /*  AUTHOR                                                                */
40 /*                                                                        */
41 /*    Kenneth Maxwell, Microsoft Corporation                              */
42 /*                                                                        */
43 /*  DESCRIPTION                                                           */
44 /*                                                                        */
45 /*    This function sets the line space of a multi line text view widget. */
46 /*                                                                        */
47 /*  INPUT                                                                 */
48 /*                                                                        */
49 /*    view                                  Multi-line text view widget   */
50 /*                                            control block               */
51 /*    line_space                            Value to set                  */
52 /*                                                                        */
53 /*  OUTPUT                                                                */
54 /*                                                                        */
55 /*    status                                Completion status             */
56 /*                                                                        */
57 /*  CALLS                                                                 */
58 /*                                                                        */
59 /*    _gx_multi_line_text_view_string_total_rows_compute                  */
60 /*                                          Update string total rows      */
61 /*    _gx_window_scrollbar_find             Find scrollbar for a window   */
62 /*    _gx_scrollbar_reset                   Reset scrollbar information   */
63 /*    _gx_multi_line_text_view_line_cache_update                          */
64 /*                                          Update line cache             */
65 /*    _gx_system_dirty_mark                 Mark the widget dirty         */
66 /*    _gx_system_event_fold                 Fold a event                  */
67 /*                                                                        */
68 /*  CALLED BY                                                             */
69 /*                                                                        */
70 /*    Application Code                                                    */
71 /*                                                                        */
72 /*  RELEASE HISTORY                                                       */
73 /*                                                                        */
74 /*    DATE              NAME                      DESCRIPTION             */
75 /*                                                                        */
76 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
77 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
78 /*                                            resulting in version 6.1    */
79 /*                                                                        */
80 /**************************************************************************/
_gx_multi_line_text_view_line_space_set(GX_MULTI_LINE_TEXT_VIEW * view,GX_BYTE line_space)81 UINT _gx_multi_line_text_view_line_space_set(GX_MULTI_LINE_TEXT_VIEW *view, GX_BYTE line_space)
82 {
83 GX_EVENT      newevent;
84 
85     view -> gx_multi_line_text_view_line_space = line_space;
86     view -> gx_multi_line_text_view_line_index_old = GX_TRUE;
87 
88     if (view -> gx_widget_status & GX_STATUS_VISIBLE)
89     {
90         memset(&newevent, 0, sizeof(GX_EVENT));
91         newevent.gx_event_type = GX_EVENT_CLIENT_UPDATED;
92         newevent.gx_event_target = (GX_WIDGET *)view;
93         _gx_system_event_fold(&newevent);
94     }
95 
96     return(GX_SUCCESS);
97 }
98 
99