1 
2 /***************************************************************************
3  * Copyright (c) 2024 Microsoft Corporation
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the MIT License which is available at
7  * https://opensource.org/licenses/MIT.
8  *
9  * SPDX-License-Identifier: MIT
10  **************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** GUIX Component                                                        */
17 /**                                                                       */
18 /**   Dispaly Management (Dispaly)                                        */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "gx_api.h"
28 #include "gx_display.h"
29 #include "gx_canvas.h"
30 
31 #if defined(GX_MOUSE_SUPPORT)
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _gx_display_driver_generic_drawing_complete         PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Kenneth Maxwell, Microsoft Corporation                              */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This function provides default drawing complete operatoin for       */
45 /*    generic display driver instance. Performs mouse cursor drawing      */
46 /*    if mouse support is enabled.                                        */
47 /*                                                                        */
48 /*  INPUT                                                                 */
49 /*                                                                        */
50 /*    display                               Display control block         */
51 /*    canvas                                Canvas control block          */
52 /*                                                                        */
53 /*  OUTPUT                                                                */
54 /*                                                                        */
55 /*  CALLS                                                                 */
56 /*                                                                        */
57 /*                                                                        */
58 /*  CALLED BY                                                             */
59 /*                                                                        */
60 /*    Application Code                                                    */
61 /*                                                                        */
62 /*  RELEASE HISTORY                                                       */
63 /*                                                                        */
64 /*    DATE              NAME                      DESCRIPTION             */
65 /*                                                                        */
66 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
67 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
68 /*                                            resulting in version 6.1    */
69 /*                                                                        */
70 /**************************************************************************/
71 #if !defined (GX_HARDWARE_MOUSE_SUPPORT)
_gx_display_driver_generic_drawing_complete(GX_DISPLAY * display,GX_CANVAS * canvas)72 VOID _gx_display_driver_generic_drawing_complete(GX_DISPLAY *display, GX_CANVAS *canvas)
73 {
74 GX_CANVAS      *mouse_canvas;
75 
76     if (display -> gx_display_mouse.gx_mouse_cursor_info)
77     {
78         mouse_canvas = display -> gx_display_mouse.gx_mouse_canvas;
79 
80         if (canvas == mouse_canvas)
81         {
82             if (canvas -> gx_canvas_draw_nesting == 1)
83             {
84                 if ((display -> gx_display_mouse.gx_mouse_status & (GX_MOUSE_ENABLED | GX_MOUSE_VISIBLE)) == GX_MOUSE_ENABLED)
85                 {
86                     display -> gx_display_mouse_capture(display);
87                     display -> gx_display_mouse_draw(display);
88                 }
89             }
90         }
91     }
92 }
93 #endif
94 #endif
95 
96