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