1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// SPDX-FileCopyrightText: Copyright (c) 2026 Mike Li/Mikewolfli/Wei Li(mikewolfli@163.com)
// SPDX-License-Identifier: MIT
//! By-id control-state access for the crate-root convenience wrappers.
//!
//! # Why the wrappers cannot ask the platform
//!
//! `set_widget_text` / `set_widget_value` / `set_widget_checked` and their
//! siblings are the crate-root spelling of "change this control". They called
//! `platform::get_platform().set_widget_*`, which was right while the host owned
//! the controls. After BLUE15 the host owns a window and a drawing surface only
//! (rule #56), so those trait methods are honest defaults that report "no such
//! control" — the wrappers therefore returned `false` and changed nothing, while
//! the C ABI functions of the same name went through the control backend and did
//! work. Two paths, one of which silently did nothing.
//!
//! The live path is the control's **own property contract** — where BLUE15 rule
//! #67 puts control state. These helpers are the thin adapter: resolve the
//! property on the widget the id addresses, and report failure rather than
//! pretending success.
//!
//! # Why the names are probed instead of looked up by kind
//!
//! Controls publish the same concept under different spellings: a slider has
//! `minimum`/`maximum`, a combo box has `current_index`, a list box has
//! `current_row`, a text entry has `placeholder_text`. A central "kind → name"
//! table is exactly the centralised match that rule #67 removed, so a wrapper
//! that holds only an id probes the spellings the concept is documented under and
//! fails when none is accepted. This is the same technique the control backend
//! already uses for label names, and it is pinned by
//! `tests/widget_accessor_routing_test.rs`, which drives each accessor against a
//! real control and reads the property back.
//!
//! # Profiles without a property registry
//!
//! `widgets_unstripped` gates the registry itself (`capability::access`), so in
//! `mini`/`embedded` there is no property to write and no widget that carries one.
//! Every helper then answers "no", which is the same truthful absence the rest of
//! the stripped profiles report, and keeps this module compiled everywhere the
//! wrappers are.
//! Every helper is compiled in every profile so the wrappers that call them are
//! too, but `mini` compiles neither the wrappers (`not(alloc_frugal)`) nor a
//! property registry — so nothing calls them there, legitimately.
use ;
use CapabilityValue;
use crateObjectId;
/// Writes `value` under the first of `names` the control accepts.
pub
/// Reads the first of `names` the control answers.
///
/// A stored `Null` is a real answer (an unset index, an absent group), not a
/// miss, so it is returned rather than skipped in favour of a later spelling.
pub
/// Writes a number, negotiating the control's own numeric representation.
///
/// Controls disagree on how a number is stored: a slider's range is `i64`, a
/// combo box's index is `u64`, and a chart axis may be `f64`. The extractors in
/// `coercion` do not cross the integer/float boundary, so an integral value is
/// offered as an integer first — that spelling satisfies all three storage kinds —
/// and only as a float when it is genuinely fractional. A fractional value sent to
/// an integer-typed property is refused, which is the honest answer: the control
/// cannot hold it.
pub
/// Reads a number from the first of `names` that holds one.
pub
/// Reads a count/index from the first of `names` that holds one.
///
/// `Null` maps to `None`: the control is saying "nothing is selected", which is
/// not the same as an index of zero.
pub
/// Reads a boolean from the first of `names` that holds one.
pub
/// Reads a string from the first of `names` that holds one.
pub