1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** GUIX Component                                                        */
17 /**                                                                       */
18 /**   Context Management (Context)                                        */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  COMPONENT DEFINITION                                   RELEASE        */
27 /*                                                                        */
28 /*    gx_context.h                                        PORTABLE C      */
29 /*                                                           6.1          */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Kenneth Maxwell, Microsoft Corporation                              */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file defines the GUIX draw context component, including all    */
37 /*    data types and external references.  It is assumed that gx_api.h    */
38 /*    and gx_port.h have already been included.                           */
39 /*                                                                        */
40 /*  RELEASE HISTORY                                                       */
41 /*                                                                        */
42 /*    DATE              NAME                      DESCRIPTION             */
43 /*                                                                        */
44 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
45 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
46 /*                                            resulting in version 6.1    */
47 /*                                                                        */
48 /**************************************************************************/
49 
50 #ifndef GX_DRAW_CONTEXT_H
51 #define GX_DRAW_CONTEXT_H
52 
53 /* Define context management function prototypes.  */
54 
55 UINT _gx_brush_default(GX_BRUSH *brush);
56 UINT _gx_brush_define(GX_BRUSH *brush, GX_COLOR line_color, GX_COLOR fill_color, UINT style);
57 
58 UINT _gx_context_brush_get(GX_BRUSH **return_brush);
59 UINT _gx_context_brush_set(GX_BRUSH *brush);
60 UINT _gx_context_brush_default(GX_DRAW_CONTEXT *context);
61 UINT _gx_context_brush_define(GX_RESOURCE_ID line_color_id, GX_RESOURCE_ID fill_color_id, UINT style);
62 UINT _gx_context_brush_pattern_set(ULONG pattern);
63 UINT _gx_context_brush_style_set(UINT style);
64 UINT _gx_context_brush_width_set(UINT width);
65 
66 UINT _gx_context_color_get(GX_RESOURCE_ID id, GX_COLOR *color);
67 UINT _gx_context_fill_color_set(GX_RESOURCE_ID fill_color_id);
68 UINT _gx_context_font_get(GX_RESOURCE_ID resource_id, GX_FONT **return_font);
69 UINT _gx_context_font_set(GX_RESOURCE_ID font_id);
70 UINT _gx_context_line_color_set(GX_RESOURCE_ID line_color_id);
71 
72 UINT _gx_context_pixelmap_get(GX_RESOURCE_ID resource_id, GX_PIXELMAP **return_pixelmap);
73 UINT _gx_context_pixelmap_set(GX_RESOURCE_ID pixelmap_id);
74 
75 /* functins for defining brush using r:g:b color description */
76 UINT _gx_context_raw_brush_define(GX_COLOR line_color, GX_COLOR fill_color, UINT style);
77 UINT _gx_context_raw_fill_color_set(GX_COLOR line_color);
78 UINT _gx_context_raw_line_color_set(GX_COLOR line_color);
79 
80 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
81 UINT _gx_context_string_get(GX_RESOURCE_ID string_id, GX_CONST GX_CHAR **return_string);
82 #endif
83 UINT _gx_context_string_get_ext(GX_RESOURCE_ID resource_id, GX_STRING *return_string);
84 
85 /* Define error checking shells for API services.  These are only referenced by the
86    application.  */
87 
88 UINT _gxe_brush_define(GX_BRUSH *brush, GX_COLOR line_color, GX_COLOR fill_color, UINT style);
89 UINT _gxe_brush_default(GX_BRUSH *brush);
90 
91 UINT _gxe_context_brush_default(GX_DRAW_CONTEXT *context);
92 UINT _gxe_context_brush_define(GX_RESOURCE_ID line_color_id, GX_RESOURCE_ID fill_color_id, UINT style);
93 UINT _gxe_context_brush_get(GX_BRUSH **return_brush);
94 UINT _gxe_context_brush_set(GX_BRUSH *brush);
95 UINT _gxe_context_brush_pattern_set(ULONG pattern);
96 UINT _gxe_context_brush_style_set(UINT style);
97 UINT _gxe_context_brush_width_set(UINT width);
98 UINT _gxe_context_color_get(GX_RESOURCE_ID color_id, GX_COLOR *return_color);
99 UINT _gxe_context_fill_color_set(GX_RESOURCE_ID fill_color_id);
100 UINT _gxe_context_font_set(GX_RESOURCE_ID font_id);
101 UINT _gxe_context_font_get(GX_RESOURCE_ID resource_id, GX_FONT **return_font);
102 UINT _gxe_context_line_color_set(GX_RESOURCE_ID line_color_id);
103 UINT _gxe_context_pixelmap_get(GX_RESOURCE_ID resource_id, GX_PIXELMAP **return_pixelmap);
104 UINT _gxe_context_pixelmap_set(GX_RESOURCE_ID pixelmap_id);
105 UINT _gxe_context_raw_brush_define(GX_COLOR line_color, GX_COLOR fill_color, UINT style);
106 UINT _gxe_context_raw_fill_color_set(GX_COLOR line_color);
107 UINT _gxe_context_raw_line_color_set(GX_COLOR line_color);
108 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
109 UINT _gxe_context_string_get(GX_RESOURCE_ID string_id, GX_CONST GX_CHAR **return_string);
110 #endif
111 UINT _gxe_context_string_get_ext(GX_RESOURCE_ID string_id, GX_STRING *return_string);
112 
113 #endif
114 
115