1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
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 |
|
|
/** Slider Management (Slider) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_widget.h" |
29 |
|
|
#include "gx_slider.h" |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _gx_pixelmap_slider_pixelmap_update PORTABLE C */ |
37 |
|
|
/* 6.1 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* This function creates a pixelmap slider, which is a type of widget */ |
45 |
|
|
/* for displaying a user-adjustable value in graphical fashion. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* slider Slider control block */ |
50 |
|
|
/* pixinfo Slider infomration block */ |
51 |
|
|
/* */ |
52 |
|
|
/* OUTPUT */ |
53 |
|
|
/* */ |
54 |
|
|
/* status Completion status */ |
55 |
|
|
/* */ |
56 |
|
|
/* CALLS */ |
57 |
|
|
/* */ |
58 |
|
|
/* _gx_widget_pixelmap_get Retrieve the pixelmap */ |
59 |
|
|
/* _gx_widget_status_add Add status flag */ |
60 |
|
|
/* _gx_system_dirty_mark Mark the widget as dirty */ |
61 |
|
|
/* */ |
62 |
|
|
/* CALLED BY */ |
63 |
|
|
/* */ |
64 |
|
|
/* _gx_pixelmap_slider_event_process Event process routine for */ |
65 |
|
|
/* pixelmap slider widget */ |
66 |
|
|
/* _gx_pixelmap_slider_pixelmap_set Assign pixelmap to the */ |
67 |
|
|
/* pixelmap slider widget */ |
68 |
|
|
/* */ |
69 |
|
|
/**************************************************************************/ |
70 |
|
1264 |
VOID _gx_pixelmap_slider_pixelmap_update(GX_PIXELMAP_SLIDER *slider) |
71 |
|
|
{ |
72 |
|
1264 |
GX_PIXELMAP_SLIDER_INFO *pixelmap_info = &slider -> gx_pixelmap_slider_pixelmap_info; |
73 |
|
1264 |
GX_WIDGET *widget = (GX_WIDGET *)slider; |
74 |
|
|
GX_PIXELMAP *map; |
75 |
|
|
|
76 |
|
|
/* if any of my pixelmaps are transparent, give myself transparent status */ |
77 |
|
|
|
78 |
✓✓ |
1264 |
if (pixelmap_info -> gx_pixelmap_slider_info_needle_pixelmap) |
79 |
|
|
{ |
80 |
|
1199 |
_gx_widget_pixelmap_get(widget, pixelmap_info -> gx_pixelmap_slider_info_needle_pixelmap, &map); |
81 |
|
|
|
82 |
✓✓ |
1199 |
if (map) |
83 |
|
|
{ |
84 |
|
1198 |
slider -> gx_slider_info.gx_slider_info_needle_height = map -> gx_pixelmap_height; |
85 |
|
1198 |
slider -> gx_slider_info.gx_slider_info_needle_width = map -> gx_pixelmap_width; |
86 |
|
|
|
87 |
✓✓ |
1198 |
if (PIXELMAP_IS_TRANSPARENT(map)) |
88 |
|
|
{ |
89 |
|
1197 |
_gx_widget_status_add((GX_WIDGET *)slider, GX_STATUS_TRANSPARENT); |
90 |
|
|
} |
91 |
|
|
} |
92 |
|
|
} |
93 |
|
|
|
94 |
✓✓ |
1264 |
if (pixelmap_info -> gx_pixelmap_slider_info_lower_background_pixelmap) |
95 |
|
|
{ |
96 |
|
997 |
_gx_widget_pixelmap_get(widget, pixelmap_info -> gx_pixelmap_slider_info_lower_background_pixelmap, &map); |
97 |
|
|
|
98 |
✓✓✓✓
|
997 |
if (map && PIXELMAP_IS_TRANSPARENT(map)) |
99 |
|
|
{ |
100 |
|
566 |
_gx_widget_status_add((GX_WIDGET *)slider, GX_STATUS_TRANSPARENT); |
101 |
|
|
} |
102 |
|
|
} |
103 |
|
1264 |
} |
104 |
|
|
|