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 /**   Display Management (Display)                                        */
19 /**                                                                       */
20 /**************************************************************************/
21 #define GX_SOURCE_CODE
22 
23 #include "gx_api.h"
24 #include "gx_display.h"
25 
26 /**************************************************************************/
27 /*                                                                        */
28 /*  FUNCTION                                               RELEASE        */
29 /*                                                                        */
30 /*    _gx_display_driver_32argb_rotated_setup             PORTABLE C      */
31 /*                                                           6.1.4        */
32 /*  AUTHOR                                                                */
33 /*                                                                        */
34 /*    Kenneth Maxwell, Microsoft Corporation                              */
35 /*                                                                        */
36 /*  DESCRIPTION                                                           */
37 /*                                                                        */
38 /*    Generic rotated 32-bit ARGB color format display driver setup       */
39 /*    routine.                                                            */
40 /*                                                                        */
41 /*  INPUT                                                                 */
42 /*                                                                        */
43 /*    display                               The display control block     */
44 /*    aux_data                              Driver-defined auxiliary data */
45 /*    toggle_function                       Driver-defined screen toggle  */
46 /*                                            function                    */
47 /*                                                                        */
48 /*  OUTPUT                                                                */
49 /*                                                                        */
50 /*    None                                                                */
51 /*                                                                        */
52 /*  CALLS                                                                 */
53 /*                                                                        */
54 /*    None                                                                */
55 /*                                                                        */
56 /*  CALLED BY                                                             */
57 /*                                                                        */
58 /*    GUIX Internal Code                                                  */
59 /*                                                                        */
60 /*  RELEASE HISTORY                                                       */
61 /*                                                                        */
62 /*    DATE              NAME                      DESCRIPTION             */
63 /*                                                                        */
64 /*  02-02-2021     Kenneth Maxwell          Initial Version 6.1.4         */
65 /*                                                                        */
66 /**************************************************************************/
_gx_display_driver_32argb_rotated_setup(GX_DISPLAY * display,VOID * aux_data,VOID (* toggle_function)(struct GX_CANVAS_STRUCT * canvas,GX_RECTANGLE * dirty_area))67 VOID _gx_display_driver_32argb_rotated_setup(GX_DISPLAY *display, VOID *aux_data,
68                                              VOID (*toggle_function)(struct GX_CANVAS_STRUCT *canvas,
69                                                                      GX_RECTANGLE *dirty_area))
70 {
71     _gx_display_driver_32argb_setup(display, aux_data, toggle_function);
72 
73 #if defined(GX_MOUSE_SUPPORT)
74     display -> gx_display_mouse_capture = GX_NULL;
75     display -> gx_display_mouse_restore = GX_NULL;
76     display -> gx_display_mouse_capture = GX_NULL;
77     display -> gx_display_mouse_restore = GX_NULL;
78     display -> gx_display_mouse_draw = GX_NULL;
79     display -> gx_display_driver_drawing_initiate = GX_NULL;
80     display -> gx_display_driver_drawing_complete = GX_NULL;
81     display -> gx_display_mouse_position_set = GX_NULL;
82     display -> gx_display_mouse_enable = GX_NULL;
83 #endif
84 
85     display -> gx_display_rotation_angle                       = GX_SCREEN_ROTATION_CW;
86     display -> gx_display_driver_canvas_copy                   = _gx_display_driver_32bpp_rotated_canvas_copy;
87     display -> gx_display_driver_simple_line_draw              = _gx_display_driver_32bpp_rotated_simple_line_draw;
88     display -> gx_display_driver_horizontal_line_draw          = _gx_display_driver_32bpp_rotated_horizontal_line_draw;
89     display -> gx_display_driver_vertical_line_draw            = _gx_display_driver_32bpp_rotated_vertical_line_draw;
90     display -> gx_display_driver_horizontal_pattern_line_draw  = _gx_display_driver_32bpp_rotated_horizontal_pattern_line_draw;
91     display -> gx_display_driver_vertical_pattern_line_draw    = _gx_display_driver_32bpp_rotated_vertical_pattern_line_draw;
92     display -> gx_display_driver_horizontal_pixelmap_line_draw = _gx_display_driver_32bpp_rotated_horizontal_pixelmap_line_draw;
93     display -> gx_display_driver_pixel_write                   = _gx_display_driver_32bpp_rotated_pixel_write;
94     display -> gx_display_driver_block_move                    = _gx_display_driver_32bpp_rotated_block_move;
95     display -> gx_display_driver_pixelmap_draw                 = _gx_display_driver_32bpp_rotated_pixelmap_draw;
96     display -> gx_display_driver_alphamap_draw                 = _gx_display_driver_generic_rotated_alphamap_draw;
97     display -> gx_display_driver_polygon_fill                  = _gx_display_driver_generic_rotated_polygon_fill;
98 
99 #if defined(GX_ARC_DRAWING_SUPPORT)
100     display -> gx_display_driver_circle_fill                   = _gx_display_driver_generic_rotated_circle_fill;
101     display -> gx_display_driver_pie_fill                      = _gx_display_driver_generic_rotated_pie_fill;
102     display -> gx_display_driver_arc_fill                      = _gx_display_driver_generic_rotated_arc_fill;
103     display -> gx_display_driver_ellipse_fill                  = _gx_display_driver_generic_rotated_ellipse_fill;
104     display -> gx_display_driver_anti_aliased_wide_ellipse_draw = _gx_display_driver_generic_aliased_wide_ellipse_draw;
105 #endif
106 
107     display -> gx_display_driver_canvas_blend                  = _gx_display_driver_24xrgb_rotated_canvas_blend;
108     display -> gx_display_driver_pixel_blend                   = _gx_display_driver_32argb_rotated_pixel_blend;
109     display -> gx_display_driver_pixelmap_blend                = _gx_display_driver_32bpp_rotated_pixelmap_blend;
110     display -> gx_display_driver_pixelmap_rotate               = _gx_display_driver_32bpp_rotated_pixelmap_rotate;
111 
112     display -> gx_display_driver_8bit_glyph_draw               = _gx_display_driver_generic_rotated_glyph_8bit_draw;
113     display -> gx_display_driver_4bit_glyph_draw               = _gx_display_driver_generic_rotated_glyph_4bit_draw;
114     display -> gx_display_driver_1bit_glyph_draw               = _gx_display_driver_32bpp_rotated_glyph_1bit_draw;
115 #if defined(GX_SOFTWARE_DECODER_SUPPORT)
116     display -> gx_display_driver_jpeg_draw                     = _gx_display_driver_24xrgb_rotated_jpeg_draw;
117     display -> gx_display_driver_png_draw                      = _gx_display_driver_24xrgb_rotated_png_draw;
118 #endif
119 }
120 
121