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 |
|
|
#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_context.h" |
29 |
|
|
|
30 |
|
|
|
31 |
|
|
/**************************************************************************/ |
32 |
|
|
/* */ |
33 |
|
|
/* FUNCTION RELEASE */ |
34 |
|
|
/* */ |
35 |
|
|
/* _gx_context_line_color_set PORTABLE C */ |
36 |
|
|
/* 6.1 */ |
37 |
|
|
/* AUTHOR */ |
38 |
|
|
/* */ |
39 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
40 |
|
|
/* */ |
41 |
|
|
/* DESCRIPTION */ |
42 |
|
|
/* */ |
43 |
|
|
/* This service sets the line color of the current display context. */ |
44 |
|
|
/* */ |
45 |
|
|
/* INPUT */ |
46 |
|
|
/* */ |
47 |
|
|
/* line_color_id Line color of current context */ |
48 |
|
|
/* */ |
49 |
|
|
/* OUTPUT */ |
50 |
|
|
/* */ |
51 |
|
|
/* status Completion status */ |
52 |
|
|
/* */ |
53 |
|
|
/* CALLS */ |
54 |
|
|
/* */ |
55 |
|
|
/* _gx_context_color_get Retrieve context color */ |
56 |
|
|
/* */ |
57 |
|
|
/* CALLED BY */ |
58 |
|
|
/* */ |
59 |
|
|
/* _gx_multi_line_text_view_draw */ |
60 |
|
|
/* _gx_single_line_text_input_draw */ |
61 |
|
|
/* _gx_slider_needle_draw */ |
62 |
|
|
/* _gx_slider_tickmarks_draw */ |
63 |
|
|
/* _gx_widget_border_draw */ |
64 |
|
|
/* _gx_widget_text_draw */ |
65 |
|
|
/* */ |
66 |
|
|
/* RELEASE HISTORY */ |
67 |
|
|
/* */ |
68 |
|
|
/* DATE NAME DESCRIPTION */ |
69 |
|
|
/* */ |
70 |
|
|
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ |
71 |
|
|
/* 09-30-2020 Kenneth Maxwell Modified comment(s), */ |
72 |
|
|
/* resulting in version 6.1 */ |
73 |
|
|
/* */ |
74 |
|
|
/**************************************************************************/ |
75 |
|
3748032 |
UINT _gx_context_line_color_set(GX_RESOURCE_ID line_color_id) |
76 |
|
|
{ |
77 |
|
|
UINT status; |
78 |
|
|
GX_COLOR linecolor; |
79 |
|
|
GX_DRAW_CONTEXT *context; |
80 |
|
|
|
81 |
|
|
|
82 |
|
|
/* Get the line color for the current context. */ |
83 |
|
3748032 |
status = _gx_context_color_get(line_color_id, &linecolor); |
84 |
|
|
|
85 |
|
3748032 |
context = _gx_system_current_draw_context; |
86 |
|
|
|
87 |
|
|
/* Set the brush. */ |
88 |
|
3748032 |
context -> gx_draw_context_brush.gx_brush_line_color = linecolor; |
89 |
|
|
|
90 |
|
|
/* Return successful completion. */ |
91 |
|
3748032 |
return(status); |
92 |
|
|
} |
93 |
|
|
|