@opentui/core-linux-arm64 0.8.4 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE-GDTOA ADDED
@@ -0,0 +1,26 @@
1
+ The gdtoa number conversion code in MinGW-w64's runtime (mingw-w64-crt/gdtoa), which OpenTUI's
2
+ Windows libraries contain, carries this notice:
3
+
4
+ The author of this software is David M. Gay.
5
+
6
+ Copyright (C) 1998, 1999 by Lucent Technologies
7
+ All Rights Reserved
8
+
9
+ Permission to use, copy, modify, and distribute this software and
10
+ its documentation for any purpose and without fee is hereby
11
+ granted, provided that the above copyright notice appear in all
12
+ copies and that both that the copyright notice and this
13
+ permission notice and warranty disclaimer appear in supporting
14
+ documentation, and that the name of Lucent or any of its entities
15
+ not be used in advertising or publicity pertaining to
16
+ distribution of the software without specific, written prior
17
+ permission.
18
+
19
+ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
20
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
21
+ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
22
+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
24
+ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26
+ THIS SOFTWARE.
package/LICENSE-LLVM ADDED
@@ -0,0 +1,311 @@
1
+ ==============================================================================
2
+ The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
3
+ ==============================================================================
4
+
5
+ Apache License
6
+ Version 2.0, January 2004
7
+ http://www.apache.org/licenses/
8
+
9
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10
+
11
+ 1. Definitions.
12
+
13
+ "License" shall mean the terms and conditions for use, reproduction,
14
+ and distribution as defined by Sections 1 through 9 of this document.
15
+
16
+ "Licensor" shall mean the copyright owner or entity authorized by
17
+ the copyright owner that is granting the License.
18
+
19
+ "Legal Entity" shall mean the union of the acting entity and all
20
+ other entities that control, are controlled by, or are under common
21
+ control with that entity. For the purposes of this definition,
22
+ "control" means (i) the power, direct or indirect, to cause the
23
+ direction or management of such entity, whether by contract or
24
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
25
+ outstanding shares, or (iii) beneficial ownership of such entity.
26
+
27
+ "You" (or "Your") shall mean an individual or Legal Entity
28
+ exercising permissions granted by this License.
29
+
30
+ "Source" form shall mean the preferred form for making modifications,
31
+ including but not limited to software source code, documentation
32
+ source, and configuration files.
33
+
34
+ "Object" form shall mean any form resulting from mechanical
35
+ transformation or translation of a Source form, including but
36
+ not limited to compiled object code, generated documentation,
37
+ and conversions to other media types.
38
+
39
+ "Work" shall mean the work of authorship, whether in Source or
40
+ Object form, made available under the License, as indicated by a
41
+ copyright notice that is included in or attached to the work
42
+ (an example is provided in the Appendix below).
43
+
44
+ "Derivative Works" shall mean any work, whether in Source or Object
45
+ form, that is based on (or derived from) the Work and for which the
46
+ editorial revisions, annotations, elaborations, or other modifications
47
+ represent, as a whole, an original work of authorship. For the purposes
48
+ of this License, Derivative Works shall not include works that remain
49
+ separable from, or merely link (or bind by name) to the interfaces of,
50
+ the Work and Derivative Works thereof.
51
+
52
+ "Contribution" shall mean any work of authorship, including
53
+ the original version of the Work and any modifications or additions
54
+ to that Work or Derivative Works thereof, that is intentionally
55
+ submitted to Licensor for inclusion in the Work by the copyright owner
56
+ or by an individual or Legal Entity authorized to submit on behalf of
57
+ the copyright owner. For the purposes of this definition, "submitted"
58
+ means any form of electronic, verbal, or written communication sent
59
+ to the Licensor or its representatives, including but not limited to
60
+ communication on electronic mailing lists, source code control systems,
61
+ and issue tracking systems that are managed by, or on behalf of, the
62
+ Licensor for the purpose of discussing and improving the Work, but
63
+ excluding communication that is conspicuously marked or otherwise
64
+ designated in writing by the copyright owner as "Not a Contribution."
65
+
66
+ "Contributor" shall mean Licensor and any individual or Legal Entity
67
+ on behalf of whom a Contribution has been received by Licensor and
68
+ subsequently incorporated within the Work.
69
+
70
+ 2. Grant of Copyright License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ copyright license to reproduce, prepare Derivative Works of,
74
+ publicly display, publicly perform, sublicense, and distribute the
75
+ Work and such Derivative Works in Source or Object form.
76
+
77
+ 3. Grant of Patent License. Subject to the terms and conditions of
78
+ this License, each Contributor hereby grants to You a perpetual,
79
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
80
+ (except as stated in this section) patent license to make, have made,
81
+ use, offer to sell, sell, import, and otherwise transfer the Work,
82
+ where such license applies only to those patent claims licensable
83
+ by such Contributor that are necessarily infringed by their
84
+ Contribution(s) alone or by combination of their Contribution(s)
85
+ with the Work to which such Contribution(s) was submitted. If You
86
+ institute patent litigation against any entity (including a
87
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
88
+ or a Contribution incorporated within the Work constitutes direct
89
+ or contributory patent infringement, then any patent licenses
90
+ granted to You under this License for that Work shall terminate
91
+ as of the date such litigation is filed.
92
+
93
+ 4. Redistribution. You may reproduce and distribute copies of the
94
+ Work or Derivative Works thereof in any medium, with or without
95
+ modifications, and in Source or Object form, provided that You
96
+ meet the following conditions:
97
+
98
+ (a) You must give any other recipients of the Work or
99
+ Derivative Works a copy of this License; and
100
+
101
+ (b) You must cause any modified files to carry prominent notices
102
+ stating that You changed the files; and
103
+
104
+ (c) You must retain, in the Source form of any Derivative Works
105
+ that You distribute, all copyright, patent, trademark, and
106
+ attribution notices from the Source form of the Work,
107
+ excluding those notices that do not pertain to any part of
108
+ the Derivative Works; and
109
+
110
+ (d) If the Work includes a "NOTICE" text file as part of its
111
+ distribution, then any Derivative Works that You distribute must
112
+ include a readable copy of the attribution notices contained
113
+ within such NOTICE file, excluding those notices that do not
114
+ pertain to any part of the Derivative Works, in at least one
115
+ of the following places: within a NOTICE text file distributed
116
+ as part of the Derivative Works; within the Source form or
117
+ documentation, if provided along with the Derivative Works; or,
118
+ within a display generated by the Derivative Works, if and
119
+ wherever such third-party notices normally appear. The contents
120
+ of the NOTICE file are for informational purposes only and
121
+ do not modify the License. You may add Your own attribution
122
+ notices within Derivative Works that You distribute, alongside
123
+ or as an addendum to the NOTICE text from the Work, provided
124
+ that such additional attribution notices cannot be construed
125
+ as modifying the License.
126
+
127
+ You may add Your own copyright statement to Your modifications and
128
+ may provide additional or different license terms and conditions
129
+ for use, reproduction, or distribution of Your modifications, or
130
+ for any such Derivative Works as a whole, provided Your use,
131
+ reproduction, and distribution of the Work otherwise complies with
132
+ the conditions stated in this License.
133
+
134
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
135
+ any Contribution intentionally submitted for inclusion in the Work
136
+ by You to the Licensor shall be under the terms and conditions of
137
+ this License, without any additional terms or conditions.
138
+ Notwithstanding the above, nothing herein shall supersede or modify
139
+ the terms of any separate license agreement you may have executed
140
+ with Licensor regarding such Contributions.
141
+
142
+ 6. Trademarks. This License does not grant permission to use the trade
143
+ names, trademarks, service marks, or product names of the Licensor,
144
+ except as required for reasonable and customary use in describing the
145
+ origin of the Work and reproducing the content of the NOTICE file.
146
+
147
+ 7. Disclaimer of Warranty. Unless required by applicable law or
148
+ agreed to in writing, Licensor provides the Work (and each
149
+ Contributor provides its Contributions) on an "AS IS" BASIS,
150
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
151
+ implied, including, without limitation, any warranties or conditions
152
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
153
+ PARTICULAR PURPOSE. You are solely responsible for determining the
154
+ appropriateness of using or redistributing the Work and assume any
155
+ risks associated with Your exercise of permissions under this License.
156
+
157
+ 8. Limitation of Liability. In no event and under no legal theory,
158
+ whether in tort (including negligence), contract, or otherwise,
159
+ unless required by applicable law (such as deliberate and grossly
160
+ negligent acts) or agreed to in writing, shall any Contributor be
161
+ liable to You for damages, including any direct, indirect, special,
162
+ incidental, or consequential damages of any character arising as a
163
+ result of this License or out of the use or inability to use the
164
+ Work (including but not limited to damages for loss of goodwill,
165
+ work stoppage, computer failure or malfunction, or any and all
166
+ other commercial damages or losses), even if such Contributor
167
+ has been advised of the possibility of such damages.
168
+
169
+ 9. Accepting Warranty or Additional Liability. While redistributing
170
+ the Work or Derivative Works thereof, You may choose to offer,
171
+ and charge a fee for, acceptance of support, warranty, indemnity,
172
+ or other liability obligations and/or rights consistent with this
173
+ License. However, in accepting such obligations, You may act only
174
+ on Your own behalf and on Your sole responsibility, not on behalf
175
+ of any other Contributor, and only if You agree to indemnify,
176
+ defend, and hold each Contributor harmless for any liability
177
+ incurred by, or claims asserted against, such Contributor by reason
178
+ of your accepting any such warranty or additional liability.
179
+
180
+ END OF TERMS AND CONDITIONS
181
+
182
+ APPENDIX: How to apply the Apache License to your work.
183
+
184
+ To apply the Apache License to your work, attach the following
185
+ boilerplate notice, with the fields enclosed by brackets "[]"
186
+ replaced with your own identifying information. (Don't include
187
+ the brackets!) The text should be enclosed in the appropriate
188
+ comment syntax for the file format. We also recommend that a
189
+ file or class name and description of purpose be included on the
190
+ same "printed page" as the copyright notice for easier
191
+ identification within third-party archives.
192
+
193
+ Copyright [yyyy] [name of copyright owner]
194
+
195
+ Licensed under the Apache License, Version 2.0 (the "License");
196
+ you may not use this file except in compliance with the License.
197
+ You may obtain a copy of the License at
198
+
199
+ http://www.apache.org/licenses/LICENSE-2.0
200
+
201
+ Unless required by applicable law or agreed to in writing, software
202
+ distributed under the License is distributed on an "AS IS" BASIS,
203
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
204
+ See the License for the specific language governing permissions and
205
+ limitations under the License.
206
+
207
+
208
+ ---- LLVM Exceptions to the Apache 2.0 License ----
209
+
210
+ As an exception, if, as a result of your compiling your source code, portions
211
+ of this Software are embedded into an Object form of such source code, you
212
+ may redistribute such embedded portions in such Object form without complying
213
+ with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
214
+
215
+ In addition, if you combine or link compiled forms of this Software with
216
+ software that is licensed under the GPLv2 ("Combined Software") and if a
217
+ court of competent jurisdiction determines that the patent provision (Section
218
+ 3), the indemnity provision (Section 9) or other Section of the License
219
+ conflicts with the conditions of the GPLv2, you may retroactively and
220
+ prospectively choose to deem waived or otherwise exclude such Section(s) of
221
+ the License, but only in their entirety and only with respect to the Combined
222
+ Software.
223
+
224
+ ==============================================================================
225
+ Software from third parties included in the LLVM Project:
226
+ ==============================================================================
227
+ The LLVM Project contains third party software which is under different license
228
+ terms. All such code will be identified clearly using at least one of two
229
+ mechanisms:
230
+ 1) It will be in a separate directory tree with its own `LICENSE.txt` or
231
+ `LICENSE` file at the top containing the specific license and restrictions
232
+ which apply to that software, or
233
+ 2) It will contain specific license and restriction terms at the top of every
234
+ file.
235
+
236
+ ==============================================================================
237
+ Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
238
+ ==============================================================================
239
+
240
+ The libc++ library is dual licensed under both the University of Illinois
241
+ "BSD-Like" license and the MIT license. As a user of this code you may choose
242
+ to use it under either license. As a contributor, you agree to allow your code
243
+ to be used under both.
244
+
245
+ Full text of the relevant licenses is included below.
246
+
247
+ ==============================================================================
248
+
249
+ University of Illinois/NCSA
250
+ Open Source License
251
+
252
+ Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT
253
+
254
+ All rights reserved.
255
+
256
+ Developed by:
257
+
258
+ LLVM Team
259
+
260
+ University of Illinois at Urbana-Champaign
261
+
262
+ http://llvm.org
263
+
264
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
265
+ this software and associated documentation files (the "Software"), to deal with
266
+ the Software without restriction, including without limitation the rights to
267
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
268
+ of the Software, and to permit persons to whom the Software is furnished to do
269
+ so, subject to the following conditions:
270
+
271
+ * Redistributions of source code must retain the above copyright notice,
272
+ this list of conditions and the following disclaimers.
273
+
274
+ * Redistributions in binary form must reproduce the above copyright notice,
275
+ this list of conditions and the following disclaimers in the
276
+ documentation and/or other materials provided with the distribution.
277
+
278
+ * Neither the names of the LLVM Team, University of Illinois at
279
+ Urbana-Champaign, nor the names of its contributors may be used to
280
+ endorse or promote products derived from this Software without specific
281
+ prior written permission.
282
+
283
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
284
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
285
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
286
+ CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
287
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
288
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
289
+ SOFTWARE.
290
+
291
+ ==============================================================================
292
+
293
+ Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
294
+
295
+ Permission is hereby granted, free of charge, to any person obtaining a copy
296
+ of this software and associated documentation files (the "Software"), to deal
297
+ in the Software without restriction, including without limitation the rights
298
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
299
+ copies of the Software, and to permit persons to whom the Software is
300
+ furnished to do so, subject to the following conditions:
301
+
302
+ The above copyright notice and this permission notice shall be included in
303
+ all copies or substantial portions of the Software.
304
+
305
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
306
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
307
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
308
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
309
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
310
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
311
+ THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ With exception of certain parts that are prominently marked as being
2
+ in the Public Domain, BSD, or LGPL this Software is provided under the
3
+ Zope Public License (ZPL) Version 2.1.
4
+
5
+ Copyright (c) 2009 - 2013 by the mingw-w64 project
6
+
7
+ See the AUTHORS file for the list of contributors to the mingw-w64 project.
8
+
9
+ This license has been certified as open source. It has also been designated
10
+ as GPL compatible by the Free Software Foundation (FSF).
11
+
12
+ Redistribution and use in source and binary forms, with or without
13
+ modification, are permitted provided that the following conditions are met:
14
+
15
+ 1. Redistributions in source code must retain the accompanying copyright
16
+ notice, this list of conditions, and the following disclaimer.
17
+ 2. Redistributions in binary form must reproduce the accompanying
18
+ copyright notice, this list of conditions, and the following disclaimer
19
+ in the documentation and/or other materials provided with the
20
+ distribution.
21
+ 3. Names of the copyright holders must not be used to endorse or promote
22
+ products derived from this software without prior written permission
23
+ from the copyright holders.
24
+ 4. The right to distribute this software or to use it for any purpose does
25
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of
26
+ the copyright holders. Use of them is covered by separate agreement
27
+ with the copyright holders.
28
+ 5. If any files are modified, you must cause the modified files to carry
29
+ prominent notices stating that you changed the files and the date of
30
+ any change.
31
+
32
+ Disclaimer
33
+
34
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
35
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
36
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
37
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
38
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
40
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
43
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/LICENSE-YOGA ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Facebook, Inc. and its affiliates.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSE-ZIG ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (Expat)
2
+
3
+ Copyright (c) Zig contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  > Prebuilt linux-arm64 binaries for `@opentui/core`.
4
4
 
5
- `opentui.h` beside `libopentui.so` is the C ABI header that this library was built from (FNV-1a 64 `0x32e4ccfcdaff96ec`). A C host compiles against it and links the library in this directory. For opentui-rust, set `OPENTUI_LIB_DIR` to this directory; its build fails when the header differs from the one its bindings were generated from. See [C](https://opentui.com/docs/native/c).
5
+ `opentui.h` beside `libopentui.so` is the C ABI header that this library was built from (FNV-1a 64 `0x99dd2d0018a6caa3`). A C host compiles against it and links the library in this directory. For the Rust crates in packages/rust, set `OPENTUI_LIB_DIR` to this directory and turn off their default `static` feature (`default-features = false`), since this package has no static library; their build fails when the header differs from the one their bindings were generated from. See [C](https://opentui.com/docs/native/c).
package/libopentui.so CHANGED
Binary file
package/opentui.h CHANGED
@@ -123,6 +123,8 @@ typedef struct ot_handle {
123
123
  #define OT_STYLE_ENUM_OVERFLOW UINT32_C(8)
124
124
  #define OT_STYLE_ENUM_DISPLAY UINT32_C(9)
125
125
  #define OT_STYLE_ENUM_BOX_SIZING UINT32_C(10)
126
+ /* Scene layout only: LIST stacks in-flow children top to bottom without flex. */
127
+ #define OT_STYLE_ENUM_LAYOUT_MODE UINT32_C(11)
126
128
  #define OT_STYLE_FLOAT_FLEX UINT32_C(0)
127
129
  #define OT_STYLE_FLOAT_FLEX_GROW UINT32_C(1)
128
130
  #define OT_STYLE_FLOAT_FLEX_SHRINK UINT32_C(2)
@@ -192,6 +194,26 @@ typedef struct ot_handle {
192
194
  #define OT_DISPLAY_NONE UINT32_C(1)
193
195
  #define OT_BOX_SIZING_BORDER_BOX UINT32_C(0)
194
196
  #define OT_BOX_SIZING_CONTENT_BOX UINT32_C(1)
197
+ #define OT_LAYOUT_MODE_FLEX UINT32_C(0)
198
+ #define OT_LAYOUT_MODE_LIST UINT32_C(1)
199
+ /* Yoga values for the standalone Yoga bindings only; scene styles reject
200
+ * DISPLAY_CONTENTS (OT_STYLE_ENUM_DISPLAY_MAX). */
201
+ #define OT_DISPLAY_CONTENTS UINT32_C(2)
202
+ #define OT_YOGA_ERRATA_NONE UINT32_C(0)
203
+ #define OT_YOGA_ERRATA_STRETCH_FLEX_BASIS UINT32_C(1)
204
+ #define OT_YOGA_ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING UINT32_C(2)
205
+ #define OT_YOGA_ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE UINT32_C(4)
206
+ #define OT_YOGA_ERRATA_ALL UINT32_C(2147483647)
207
+ #define OT_YOGA_ERRATA_CLASSIC UINT32_C(2147483646)
208
+ #define OT_YOGA_EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS UINT32_C(0)
209
+ #define OT_YOGA_LOG_LEVEL_ERROR UINT32_C(0)
210
+ #define OT_YOGA_LOG_LEVEL_WARN UINT32_C(1)
211
+ #define OT_YOGA_LOG_LEVEL_INFO UINT32_C(2)
212
+ #define OT_YOGA_LOG_LEVEL_DEBUG UINT32_C(3)
213
+ #define OT_YOGA_LOG_LEVEL_VERBOSE UINT32_C(4)
214
+ #define OT_YOGA_LOG_LEVEL_FATAL UINT32_C(5)
215
+ #define OT_YOGA_NODE_TYPE_DEFAULT UINT32_C(0)
216
+ #define OT_YOGA_NODE_TYPE_TEXT UINT32_C(1)
195
217
  /* Inclusive enum limits also drive generated host validation. */
196
218
  #define OT_STYLE_ENUM_DIRECTION_MAX OT_DIRECTION_RTL
197
219
  #define OT_STYLE_ENUM_FLEX_DIRECTION_MAX OT_FLEX_DIRECTION_ROW_REVERSE
@@ -204,12 +226,14 @@ typedef struct ot_handle {
204
226
  #define OT_STYLE_ENUM_OVERFLOW_MAX OT_OVERFLOW_SCROLL
205
227
  #define OT_STYLE_ENUM_DISPLAY_MAX OT_DISPLAY_NONE
206
228
  #define OT_STYLE_ENUM_BOX_SIZING_MAX OT_BOX_SIZING_CONTENT_BOX
229
+ #define OT_STYLE_ENUM_LAYOUT_MODE_MAX OT_LAYOUT_MODE_LIST
207
230
  #define OT_MEASURE_UNDEFINED UINT32_C(0)
208
231
  #define OT_MEASURE_EXACTLY UINT32_C(1)
209
232
  #define OT_MEASURE_AT_MOST UINT32_C(2)
210
233
  #define OT_LAYOUT_PUBLIC UINT32_C(0)
211
234
  #define OT_LAYOUT_YOGA UINT32_C(1)
212
235
  #define OT_LAYOUT_PAINT UINT32_C(2)
236
+ #define OT_LAYOUT_CONTENT UINT32_C(3)
213
237
 
214
238
  /* Border masks are paint bits, not OT_EDGE_* layout selectors. */
215
239
  #define OT_BORDER_NONE UINT32_C(0)
@@ -238,6 +262,44 @@ typedef struct ot_handle {
238
262
  #define OT_COLOR_DEFAULT UINT32_C(2)
239
263
  #define OT_COLOR_CHANNEL_MASK UINT32_C(255)
240
264
  #define OT_COLOR_META_SHIFT UINT32_C(8)
265
+ /* The RGB snapshot of each palette slot, as 0xRRGGBB: slots 0..15 are ANSI_n;
266
+ * slots 16..231 are a 6x6x6 cube whose channel level n is 0 for n=0 and
267
+ * CUBE_BASE + CUBE_STEP * n otherwise; slots 232..255 are a gray ramp of
268
+ * GRAY_BASE + GRAY_STEP * (slot - 232). */
269
+ #define OT_COLOR_ANSI_0 UINT32_C(0x000000)
270
+ #define OT_COLOR_ANSI_1 UINT32_C(0x800000)
271
+ #define OT_COLOR_ANSI_2 UINT32_C(0x008000)
272
+ #define OT_COLOR_ANSI_3 UINT32_C(0x808000)
273
+ #define OT_COLOR_ANSI_4 UINT32_C(0x000080)
274
+ #define OT_COLOR_ANSI_5 UINT32_C(0x800080)
275
+ #define OT_COLOR_ANSI_6 UINT32_C(0x008080)
276
+ #define OT_COLOR_ANSI_7 UINT32_C(0xC0C0C0)
277
+ #define OT_COLOR_ANSI_8 UINT32_C(0x808080)
278
+ #define OT_COLOR_ANSI_9 UINT32_C(0xFF0000)
279
+ #define OT_COLOR_ANSI_10 UINT32_C(0x00FF00)
280
+ #define OT_COLOR_ANSI_11 UINT32_C(0xFFFF00)
281
+ #define OT_COLOR_ANSI_12 UINT32_C(0x0000FF)
282
+ #define OT_COLOR_ANSI_13 UINT32_C(0xFF00FF)
283
+ #define OT_COLOR_ANSI_14 UINT32_C(0x00FFFF)
284
+ #define OT_COLOR_ANSI_15 UINT32_C(0xFFFFFF)
285
+ #define OT_COLOR_CUBE_BASE UINT32_C(55)
286
+ #define OT_COLOR_CUBE_STEP UINT32_C(40)
287
+ #define OT_COLOR_GRAY_BASE UINT32_C(8)
288
+ #define OT_COLOR_GRAY_STEP UINT32_C(10)
289
+
290
+ /* Text attribute words: bits 0..7 are the ATTR flags. Where a call or plane
291
+ * carries a link, bits 8..31 hold its link ID: (attributes >> LINK_SHIFT) & LINK_MASK. */
292
+ #define OT_ATTR_BOLD UINT32_C(1)
293
+ #define OT_ATTR_DIM UINT32_C(2)
294
+ #define OT_ATTR_ITALIC UINT32_C(4)
295
+ #define OT_ATTR_UNDERLINE UINT32_C(8)
296
+ #define OT_ATTR_BLINK UINT32_C(16)
297
+ #define OT_ATTR_INVERSE UINT32_C(32)
298
+ #define OT_ATTR_HIDDEN UINT32_C(64)
299
+ #define OT_ATTR_STRIKETHROUGH UINT32_C(128)
300
+ #define OT_ATTR_BASE_MASK UINT32_C(255)
301
+ #define OT_ATTR_LINK_SHIFT UINT32_C(8)
302
+ #define OT_ATTR_LINK_MASK UINT32_C(0xFFFFFF)
241
303
 
242
304
  /* Complete slider options. orientation is horizontal=0 or vertical=1. Colors
243
305
  * retain terminal color intent. All numbers and derived thumb arithmetic must be finite.
@@ -304,6 +366,7 @@ typedef struct ot_scene_text_options {
304
366
  #define OT_SCENE_TEXT_SELECTION_RESET UINT32_C(0)
305
367
  #define OT_SCENE_TEXT_SELECTION_SET UINT32_C(1)
306
368
  #define OT_SCENE_TEXT_SELECTION_UPDATE UINT32_C(2)
369
+ #define OT_SCENE_TEXT_SELECTION_COLORS UINT32_C(3)
307
370
  #define OT_SCENE_TEXT_SELECTION_CELL UINT32_C(0)
308
371
  #define OT_SCENE_TEXT_SELECTION_WORD UINT32_C(1)
309
372
  #define OT_SCENE_TEXT_SELECTION_LINE UINT32_C(2)
@@ -484,6 +547,11 @@ typedef struct ot_scene_stats {
484
547
  uint32_t damage_rows;
485
548
  } ot_scene_stats;
486
549
 
550
+ /* Cursor styles of the session cursor, the scene cursor state and editors. */
551
+ #define OT_CURSOR_STYLE_BLOCK UINT32_C(0)
552
+ #define OT_CURSOR_STYLE_LINE UINT32_C(1)
553
+ #define OT_CURSOR_STYLE_UNDERLINE UINT32_C(2)
554
+ #define OT_CURSOR_STYLE_DEFAULT UINT32_C(3)
487
555
  typedef struct ot_scene_cursor_state {
488
556
  uint32_t struct_size;
489
557
  uint32_t abi_version;
@@ -601,8 +669,15 @@ ot_status ot_scene_set_hooks(ot_context *, const ot_handle *node, const ot_scene
601
669
  * Paint options are copied on each accepted step; max_layout_rounds and
602
670
  * max_host_requests stay positive and fixed for the attempt. Yoga completes before host work. Filtered
603
671
  * text viewports advance only when refreshed or painted, not during candidate layout.
604
- * UPDATE runs at most once per node per attempt; getter refresh
605
- * and resize ordering preserve the mounted and newly placed node contracts.
672
+ * UPDATE runs at most once per node per attempt. Each layout round walks the
673
+ * tree depth first in paint order (z_index, then child order): a node's UPDATE,
674
+ * its RESIZE, then its children's subtrees, so its requests follow those of every
675
+ * earlier sibling's subtree. A child inserted or moved since its last refresh gets
676
+ * its RESIZE when the walk reaches its parent, before its siblings' subtrees; a
677
+ * move to the index the child already has counts. A
678
+ * node with a viewport (ot_scene_set_viewport) or a culling scroll node refreshes
679
+ * all its children before walking the subtrees of those it does not cull. A node
680
+ * inserted during the walk waits for the next round.
606
681
  * LAYOUT_CHANGED follows an actual Yoga solve, before updates. Layout/preparation
607
682
  * limits fail before paint. Failure cancels the attempt without presenting
608
683
  * partial cells or rolling back mutations.
@@ -681,7 +756,11 @@ ot_status ot_scene_create_node(ot_context *, const ot_handle *session, uint32_t
681
756
  * OT_INTERNAL_ERROR until its nodes are destroyed. Destroy, detach, blur, clearing a measure provider, and selection
682
757
  * RESET still succeed. */
683
758
  ot_status ot_scene_destroy_node(ot_context *, const ot_handle *node);
759
+ /* Siblings with equal z_index paint in child order. At an overlap, the later child wins the hit test. */
684
760
  ot_status ot_scene_move_node(ot_context *, const ot_handle *node, const ot_handle *parent, uint32_t index);
761
+ /* Detaches every child of node, as moving each to NULL from first to last would, in
762
+ * time linear in the child count. On error no child is detached. */
763
+ ot_status ot_scene_clear_children(ot_context *, const ot_handle *node);
685
764
  /* Synchronous owner-thread measurement on leaves. The callback is borrowed until
686
765
  * replacement, unset, node destruction, or Context destruction. NULL clears the
687
766
  * single provider slot; it does not restore built-in measurement. Each set or clear
@@ -698,6 +777,9 @@ ot_status ot_scene_has_measure(ot_context *, const ot_handle *node, uint32_t *ou
698
777
  * and child count from the latest layout (a child moved since then has no position, and is
699
778
  * not selected). A node they do not reach gets no hook calls. */
700
779
  ot_status ot_scene_reaches_hooks(ot_context *, const ot_handle *node, uint32_t *out_reached);
780
+ /* out_painted is 1 when the last frame that finished paint painted the node, or the presented
781
+ * frame once a later one is cancelled; 0 for the root and before any frame. */
782
+ ot_status ot_scene_painted(ot_context *, const ot_handle *node, uint32_t *out_painted);
701
783
  ot_status ot_scene_mark_dirty(ot_context *, const ot_handle *node);
702
784
  /* Use OT_STYLE_* groups/kinds, OT_EDGE_* (or OT_GUTTER_* for GAP), and OT_UNIT_*.
703
785
  * Only OT_STYLE_DIMENSION accepts OT_STYLE_DISABLE_FLEX_SHRINK, which disables
@@ -851,8 +933,9 @@ typedef struct ot_scene_scroll_bar_options {
851
933
  uint16_t track_background[4];
852
934
  } ot_scene_scroll_bar_options;
853
935
 
936
+ #define OT_SCENE_SCROLL_PADDING_MAX UINT32_C(65535)
854
937
  /* axes holds OT_SCENE_SCROLL_X/Y. culling is 0 or 1. padding is the viewport
855
- * padding in whole cells, left, top, right, bottom, each 0..65535. fills selects
938
+ * padding in whole cells, left, top, right, bottom, each 0..PADDING_MAX. fills selects
856
939
  * which of the wrapper (box inner rect minus the vertical gutter), viewport, and
857
940
  * content (moving with the offset) backgrounds paint, in that order, before the
858
941
  * children. bars[0] is the horizontal bar, bars[1] the vertical bar. */
@@ -987,8 +1070,9 @@ ot_status ot_scene_set_text(ot_context *, const ot_handle *node, const uint8_t *
987
1070
  * Rejection preserves accepted content and resources. No style handles.
988
1071
  * Each array may be NULL only when its count is zero. link_offset and
989
1072
  * link_byte_count select bytes in urls; without LINK both must be zero. URLs are
990
- * copied raw metadata, not parsed or normalized. Empty URLs, URLs over 512 bytes,
991
- * and chunks with zero independently measured width produce no link. Oversized
1073
+ * copied, not normalized. Empty URLs, URLs over 512 bytes,
1074
+ * URLs that are not UTF-8 or hold a C0, DEL or C1 control, and chunks with zero
1075
+ * independently measured width produce no link; their text stays. Oversized
992
1076
  * URLs are not truncated. URLs and their references are prepared before publication;
993
1077
  * rejection preserves accepted text, styles, and links. urls may be NULL only
994
1078
  * when url_byte_count is zero. Link IDs stay local to the owning Context. */
@@ -1002,7 +1086,8 @@ ot_status ot_scene_set_text_options(ot_context *, const ot_handle *node, const o
1002
1086
  * existing document anchor across scrolling, or acts as SET without an anchor.
1003
1087
  * Exact size/version, zero reserved, and only BACKGROUND/FOREGROUND flags are
1004
1088
  * accepted. Present colors retain terminal color intent; absent color arrays must be zero.
1005
- * out_changed is the view's 0/1 change result. Failure preserves selection and
1089
+ * out_changed is the view's 0/1 change result. COLORS restyles the current selection
1090
+ * and ignores the coordinates. Failure preserves selection and
1006
1091
  * out_changed. RESET needs no allocation and is allowed after Session cancellation.
1007
1092
  * Mutation is forbidden during measurement callbacks, including RESET. */
1008
1093
  ot_status ot_scene_set_text_selection(ot_context *, const ot_handle *node,
@@ -1027,8 +1112,19 @@ ot_status ot_scene_get_text(ot_context *, const ot_handle *node, uint8_t *bytes,
1027
1112
  ot_status ot_scene_get_text_info(ot_context *, const ot_handle *node, ot_scene_text_info *out_info);
1028
1113
  ot_status ot_scene_get_text_lines(ot_context *, const ot_handle *node, uint32_t first_line,
1029
1114
  ot_scene_text_line *lines, uint32_t capacity, uint32_t *out_count);
1115
+ /* The byte offset, in the UTF-8 last set on the text node, where the grapheme the latest
1116
+ * finished frame drew at screen cell (x, y) starts. UINT32_MAX when that frame did not
1117
+ * paint the node, when its text or view options changed since, and when the cell lies
1118
+ * outside the node's painted cells or shows no whole grapheme: padding, a truncation
1119
+ * ellipsis, a wide grapheme an edge cuts, zero opacity, or a RENDER_SELF hook's body
1120
+ * in place of the text. A failed paint attempt leaves the answers of the frame before
1121
+ * it, except for nodes it drew. It never lays text out, and does not check
1122
+ * what covers the cell; ot_scene_hit_test does. Follows the text getter rules. */
1123
+ ot_status ot_scene_get_text_byte_at(ot_context *, const ot_handle *node, int32_t x, int32_t y, uint32_t *out_byte);
1030
1124
  /* OT_LAYOUT_PUBLIC copies local cell geometry from the node's latest preparation refresh.
1031
- * During host phases, mounted nodes retain their preceding projection until that
1125
+ * Below a child that its filtering parent's latest selection culled, which no refresh
1126
+ * reaches, it copies the latest solved geometry instead, if Yoga has laid the node out since
1127
+ * it was created or moved. During host phases, mounted nodes retain their preceding projection until that
1032
1128
  * refresh; newly placed children refresh before their own update. screen_x/y
1033
1129
  * combine that geometry with current accepted ancestor relationships
1034
1130
  * and translations immediately, without running layout. OT_LAYOUT_YOGA instead
@@ -1043,7 +1139,10 @@ ot_status ot_scene_get_text_lines(ot_context *, const ot_handle *node, uint32_t
1043
1139
  * after a solve or after a change between frames that drops the list, until the next list
1044
1140
  * paints it, reads its latest solved geometry composed with current translations and
1045
1141
  * offsets; zeros if Yoga has not laid it out since it was created or moved. While a host
1046
- * request is pending, such a node's first read holds.
1142
+ * request is pending, such a node's first read holds. OT_LAYOUT_CONTENT is PAINT without a
1143
+ * text node's padding, its content edges rounded as Yoga rounds the node's own edges (no
1144
+ * padding reads the box): the cells its text view fills, which paint, wrapping, text byte
1145
+ * hits, selection and body draws use. Other nodes read PAINT.
1047
1146
  * These reads do not run layout. Other selectors reject without changing output.
1048
1147
  * A scroll node's children report YOGA values local to its content node, and their
1049
1148
  * screen_x/y compose through the viewport and content origins and the offset. */
@@ -1060,6 +1159,9 @@ ot_status ot_scene_get_layout(ot_context *, const ot_handle *node, uint32_t obse
1060
1159
  * OT_UNSUPPORTED_RESOURCE. Use ot_scene_frame_step_with_geometry for host hooks. */
1061
1160
  ot_status ot_scene_paint(ot_context *, const ot_handle *session, const uint16_t background[4], uint32_t use_mouse, uint32_t excluded_hit_num, ot_scene_frame_request *out_frame);
1062
1161
  ot_status ot_scene_hit_test(ot_context *, const ot_handle *session, int32_t x, int32_t y, uint32_t *out_num);
1162
+ /* ot_scene_hit_test as if the node with public number excluded_num painted no hits (zero
1163
+ * excludes none). Its descendants still hit. A drag looks up targets through its source. */
1164
+ ot_status ot_scene_hit_test_excluding(ot_context *, const ot_handle *session, int32_t x, int32_t y, uint32_t excluded_num, uint32_t *out_num);
1063
1165
  ot_status ot_scene_get_stats(ot_context *, const ot_handle *session, ot_scene_stats *out_stats);
1064
1166
  #define OT_SCENE_DEBUG_FULL_FRAME UINT32_C(1)
1065
1167
  #define OT_SCENE_DEBUG_VERIFY UINT32_C(2)
@@ -1079,7 +1181,7 @@ ot_status ot_scene_get_stats(ot_context *, const ot_handle *session, ot_scene_st
1079
1181
  * repainted frame. A mismatch fails the frame step
1080
1182
  * with OT_INTERNAL_ERROR; VERIFY changes no other state or count. */
1081
1183
  ot_status ot_scene_set_debug_flags(ot_context *, const ot_handle *session, uint32_t flags);
1082
- /* Copied renderer cursor state. Style: block=0 line=1 underline=2 default=3.
1184
+ /* Copied renderer cursor state. style is an OT_CURSOR_STYLE_* value.
1083
1185
  * Colors use normalized float channels. Output requires exact size/version. */
1084
1186
  ot_status ot_scene_get_cursor_state(ot_context *, const ot_handle *session, ot_scene_cursor_state *out_state);
1085
1187
 
@@ -1186,7 +1288,8 @@ ot_status ot_scene_frame_copy_buffer(ot_context *, const ot_handle *session,
1186
1288
  /* Solve an idle scene's existing root without frame preparation, hooks, or painting.
1187
1289
  * Custom Yoga measurement providers may run. Read computed dimensions with raw_yoga=1. */
1188
1290
  ot_status ot_scene_measure_layout(ot_context *, const ot_handle *session, const ot_handle *root);
1189
- /* At most 64 snapshots; Context identities are checked before native bounded copies.
1291
+ #define OT_SPLIT_SNAPSHOTS_MAX UINT32_C(64)
1292
+ /* At most SPLIT_SNAPSHOTS_MAX snapshots; Context identities are checked before native bounded copies.
1190
1293
  * A null frame submits snapshots only, without painting or publishing the footer draft.
1191
1294
  * After suspension completes, null-frame snapshots remain permitted without reactivating
1192
1295
  * terminal modes; their output packet leaves the cursor restored. Non-null frames and
@@ -1296,6 +1399,11 @@ typedef struct ot_embedded_terminal_cursor {
1296
1399
  uint32_t color_b;
1297
1400
  uint32_t reserved;
1298
1401
  } ot_embedded_terminal_cursor;
1402
+ /* The emulator's cursor styles for style above; not the OT_CURSOR_STYLE_* order. */
1403
+ #define OT_EMBEDDED_TERMINAL_CURSOR_BAR UINT32_C(0)
1404
+ #define OT_EMBEDDED_TERMINAL_CURSOR_BLOCK UINT32_C(1)
1405
+ #define OT_EMBEDDED_TERMINAL_CURSOR_UNDERLINE UINT32_C(2)
1406
+ #define OT_EMBEDDED_TERMINAL_CURSOR_BLOCK_HOLLOW UINT32_C(3)
1299
1407
 
1300
1408
  /* The active screen's viewport, in rows. offset is the distance from the live
1301
1409
  * screen (0 there; total - visible at the top of history). total includes the
@@ -1332,10 +1440,36 @@ typedef struct ot_embedded_terminal_mouse {
1332
1440
  float y;
1333
1441
  } ot_embedded_terminal_mouse;
1334
1442
 
1443
+ /* mods and consumed_mods use the emulator's bits, not OT_INPUT_MOD_*. It has no
1444
+ * Hyper or Meta: hosts send Kitty Meta as ALT. button is BUTTON_NONE for motion
1445
+ * without a pressed button. */
1446
+ #define OT_EMBEDDED_TERMINAL_MOD_SHIFT UINT32_C(1)
1447
+ #define OT_EMBEDDED_TERMINAL_MOD_CTRL UINT32_C(2)
1448
+ #define OT_EMBEDDED_TERMINAL_MOD_ALT UINT32_C(4)
1449
+ #define OT_EMBEDDED_TERMINAL_MOD_SUPER UINT32_C(8)
1450
+ #define OT_EMBEDDED_TERMINAL_MOD_CAPS_LOCK UINT32_C(16)
1451
+ #define OT_EMBEDDED_TERMINAL_MOD_NUM_LOCK UINT32_C(32)
1452
+ #define OT_EMBEDDED_TERMINAL_KEY_RELEASE UINT32_C(0)
1453
+ #define OT_EMBEDDED_TERMINAL_KEY_PRESS UINT32_C(1)
1454
+ #define OT_EMBEDDED_TERMINAL_KEY_REPEAT UINT32_C(2)
1455
+ #define OT_EMBEDDED_TERMINAL_MOUSE_PRESS UINT32_C(0)
1456
+ #define OT_EMBEDDED_TERMINAL_MOUSE_RELEASE UINT32_C(1)
1457
+ #define OT_EMBEDDED_TERMINAL_MOUSE_MOTION UINT32_C(2)
1458
+ #define OT_EMBEDDED_TERMINAL_BUTTON_NONE INT32_C(-1)
1459
+ #define OT_EMBEDDED_TERMINAL_BUTTON_UNKNOWN INT32_C(0)
1460
+ #define OT_EMBEDDED_TERMINAL_BUTTON_LEFT INT32_C(1)
1461
+ #define OT_EMBEDDED_TERMINAL_BUTTON_RIGHT INT32_C(2)
1462
+ #define OT_EMBEDDED_TERMINAL_BUTTON_MIDDLE INT32_C(3)
1463
+ #define OT_EMBEDDED_TERMINAL_BUTTON_FOUR INT32_C(4)
1464
+ #define OT_EMBEDDED_TERMINAL_BUTTON_FIVE INT32_C(5)
1465
+ #define OT_EMBEDDED_TERMINAL_BUTTON_SIX INT32_C(6)
1466
+ #define OT_EMBEDDED_TERMINAL_BUTTON_SEVEN INT32_C(7)
1467
+
1335
1468
  /* All option records require exact size/version and zero reserved fields.
1336
1469
  * Booleans are 0/1. Input and output buffers are borrowed only during the call.
1337
1470
  * Columns and rows are positive u16 values within the Context cell budget.
1338
- * Write, key-name, key-text, and paste inputs are each limited to 1 MiB. */
1471
+ * Write, key-name, key-text, and paste inputs are each limited to INPUT_BYTES_MAX. */
1472
+ #define OT_EMBEDDED_TERMINAL_INPUT_BYTES_MAX UINT32_C(1048576)
1339
1473
  ot_status ot_embedded_terminal_create(ot_context *, const ot_embedded_terminal_options *, ot_handle *out_terminal);
1340
1474
  ot_status ot_embedded_terminal_destroy(ot_context *, const ot_handle *terminal);
1341
1475
  ot_status ot_embedded_terminal_write(ot_context *, const ot_handle *terminal, const uint8_t *bytes, uint32_t byte_count);
@@ -1366,19 +1500,28 @@ ot_status ot_embedded_terminal_encode_paste(ot_context *, const ot_handle *termi
1366
1500
  const uint8_t *input, uint32_t input_count, uint8_t *bytes, uint32_t capacity, uint32_t *out_count);
1367
1501
  ot_status ot_embedded_terminal_encode_focus(ot_context *, const ot_handle *terminal,
1368
1502
  uint32_t focused, uint8_t *bytes, uint32_t capacity, uint32_t *out_count);
1503
+ #define OT_EMBEDDED_TERMINAL_RESPONSE_BYTES_MAX UINT32_C(1048576)
1369
1504
  /* Drains at most capacity bytes, not a sizing query. Response overflow returns
1370
- * OT_OUTPUT_BACKPRESSURE once without consuming the retained 1 MiB prefix. */
1505
+ * OT_OUTPUT_BACKPRESSURE once without consuming the retained RESPONSE_BYTES_MAX prefix. */
1371
1506
  ot_status ot_embedded_terminal_drain_responses(ot_context *, const ot_handle *terminal,
1372
1507
  uint8_t *bytes, uint32_t capacity, uint32_t *out_count);
1373
1508
 
1374
1509
  /* Context-owned editor resources use checked handles, never legacy pointers.
1375
- * Options require exact size/version and zero reserved. width_method uses
1376
- * OT_WIDTH_METHOD_*. Creation failures leave output handles unchanged. */
1510
+ * Options require exact size/version and no unknown flags. width_method uses
1511
+ * OT_WIDTH_METHOD_*. Creation failures leave output handles unchanged.
1512
+ * OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH: whenever a scene node of a session shows the
1513
+ * buffer, and whenever that session's width method changes, the buffer measures with
1514
+ * the session's method; the cursor, selections, marks and undo points keep their text.
1515
+ * Nodes of one session at a time show such a buffer's views: binding a view while a node
1516
+ * of another session shows one returns OT_WRONG_SESSION and changes nothing; unbind
1517
+ * first to move. The flag is rejected with OT_WIDTH_METHOD_NO_ZWJ. Without it the
1518
+ * buffer keeps width_method. */
1519
+ #define OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH UINT32_C(1)
1377
1520
  typedef struct ot_edit_buffer_options {
1378
1521
  uint32_t struct_size;
1379
1522
  uint32_t abi_version;
1380
1523
  uint32_t width_method;
1381
- uint32_t reserved;
1524
+ uint32_t flags;
1382
1525
  } ot_edit_buffer_options;
1383
1526
 
1384
1527
  /* Initialize size/version and zero remaining fields. Other fields are copied output.
@@ -1446,7 +1589,7 @@ typedef struct ot_edit_buffer_info {
1446
1589
  #define OT_MOUSE_POINTER_UNCHANGED UINT32_C(0xFFFFFFFF)
1447
1590
 
1448
1591
  /* Complete cursor options, not a patch. Exact size/version and zero reserved.
1449
- * show_cursor and blinking are 0 or 1. style is block=0, line=1, underline=2, default=3.
1592
+ * show_cursor and blinking are 0 or 1. style is an OT_CURSOR_STYLE_* value.
1450
1593
  * color retains packed intent for capture; cursor output uses its RGB snapshot.
1451
1594
  * mouse_pointer is an OT_MOUSE_POINTER_* shape or OT_MOUSE_POINTER_UNCHANGED. */
1452
1595
  typedef struct ot_scene_editor_options {
@@ -1517,7 +1660,21 @@ ot_status ot_edit_buffer_set_tab_width(ot_context *, const ot_handle *edit_buffe
1517
1660
  #define OT_EDIT_CLEAR UINT32_C(10)
1518
1661
  #define OT_EDIT_CLEAR_HISTORY UINT32_C(11)
1519
1662
  #define OT_EDIT_DEBUG_ROPE UINT32_C(12)
1520
- /* argument is a line/offset for GOTO_LINE/CURSOR_OFFSET, zero otherwise. */
1663
+ #define OT_EDIT_CURSOR_OFFSET_ATOMIC UINT32_C(13)
1664
+ #define OT_EDIT_KEEP_OUTSIDE UINT32_C(14)
1665
+ #define OT_EDIT_ATOMIC UINT32_C(1)
1666
+ /* argument is a line/offset for GOTO_LINE/CURSOR_OFFSET/CURSOR_OFFSET_ATOMIC, zero or OT_EDIT_ATOMIC
1667
+ * for DELETE_FORWARD, BACKSPACE, MOVE_LEFT and MOVE_RIGHT, the edge for KEEP_OUTSIDE (0 the nearer,
1668
+ * ties to the end; 1 the end; 2 the start), zero otherwise.
1669
+ * OT_EDIT_ATOMIC applies the cursor rules around atomic edit marks; of overlapping marks the oldest
1670
+ * counts first. Each move steps over one mark: Left from a mark's end goes one unit before its
1671
+ * start, or to the start when another mark ends there; Right from its start, or from one cell before
1672
+ * it, goes to its end. Backspace at a mark's end or Delete at its start deletes the whole mark as
1673
+ * one edit (of marks with that edge there, the oldest). CURSOR_OFFSET_ATOMIC moves to the offset as
1674
+ * Left (toward the start) or Right (toward the end) would, past a mark it lands in. KEEP_OUTSIDE
1675
+ * moves the cursor to the start of its unit, then out of the atomic marks that surround it to the
1676
+ * outer edge of all of them. A move under these rules ends on a unit start outside every atomic
1677
+ * mark. */
1521
1678
  ot_status ot_edit_buffer_command(ot_context *, const ot_handle *, uint32_t command, uint32_t argument);
1522
1679
  /* redo is 0/1. Capacity must be at least 64, the native cursor-metadata bound,
1523
1680
  * before history is changed. No history returns zero bytes. */
@@ -1554,6 +1711,16 @@ ot_status ot_edit_buffer_get_position(ot_context *, const ot_handle *, uint32_t
1554
1711
  ot_status ot_edit_buffer_get_range(ot_context *, const ot_handle *, uint32_t by_coords,
1555
1712
  uint32_t start_row, uint32_t start_col, uint32_t end_row, uint32_t end_col,
1556
1713
  uint8_t *bytes, uint32_t capacity, uint32_t *out_count);
1714
+ #define OT_EDIT_BYTE_TO_CELL UINT32_C(0)
1715
+ #define OT_EDIT_CELL_TO_BYTE UINT32_C(1)
1716
+ #define OT_EDIT_UTF16_TO_CELL UINT32_C(2)
1717
+ #define OT_EDIT_CELL_TO_UTF16 UINT32_C(3)
1718
+ /* Converts an index in get_text (UTF-8 bytes or UTF-16 code units) to or from document
1719
+ * display cells, one per LF. Interior positions round down to the buffer grapheme's start;
1720
+ * a cell shared by zero-width text maps after it. Past the end clamps to the end.
1721
+ * Read-only. Unknown conversions fail and failures preserve out_value. */
1722
+ ot_status ot_edit_buffer_convert_offset(ot_context *, const ot_handle *edit_buffer,
1723
+ uint32_t conversion, uint32_t value, uint32_t *out_value);
1557
1724
  /* Lays UTF-8 bytes out as set_text would, without storing them, and reports the offset at
1558
1725
  * their end: display cells under the buffer's width method, tab width, and control notation,
1559
1726
  * plus one per line break (LF, CR, or CRLF). bytes may be NULL only for zero length; the
@@ -1569,6 +1736,9 @@ ot_status ot_edit_measure_text(ot_context *, const uint8_t *bytes, uint32_t byte
1569
1736
  #define OT_EDITOR_STYLE_FOREGROUND UINT32_C(1)
1570
1737
  #define OT_EDITOR_STYLE_BACKGROUND UINT32_C(2)
1571
1738
  #define OT_EDITOR_STYLE_ATTRIBUTES UINT32_C(4)
1739
+ /* Syntax styles only, with OT_EDITOR_STYLE_ATTRIBUTES: attributes bits 16..23 say which of bits
1740
+ * 0..7 the style supplies. */
1741
+ #define OT_EDITOR_STYLE_ATTRIBUTE_MASK UINT32_C(8)
1572
1742
  typedef struct ot_editor_style {
1573
1743
  uint32_t struct_size;
1574
1744
  uint32_t abi_version;
@@ -1583,7 +1753,10 @@ typedef struct ot_editor_style {
1583
1753
  ot_status ot_edit_buffer_set_defaults(ot_context *, const ot_handle *, uint32_t mask, const ot_editor_style *);
1584
1754
  /* Names are copied UTF-8; registering an existing name replaces its definition.
1585
1755
  * Empty names are valid; name may be NULL only when byte_count is zero. Ids are
1586
- * below OT_STYLE_RUN_FLAG. */
1756
+ * below OT_STYLE_RUN_FLAG. A group set composes its names in order: each later name
1757
+ * replaces fg, bg, and the attribute bits it supplies. Without
1758
+ * OT_EDITOR_STYLE_ATTRIBUTE_MASK, a style with OT_EDITOR_STYLE_ATTRIBUTES supplies all
1759
+ * eight bits and one without supplies none. Set bits 0..7 outside the supplied bits fail. */
1587
1760
  ot_status ot_syntax_style_register(ot_context *, const ot_handle *, const uint8_t *name,
1588
1761
  uint32_t byte_count, const ot_editor_style *, uint32_t *out_id);
1589
1762
  /* Unknown names return id=0. Names are borrowed only for the query. */
@@ -1621,6 +1794,213 @@ ot_status ot_edit_buffer_highlight(ot_context *, const ot_handle *, uint32_t ope
1621
1794
  ot_status ot_edit_buffer_get_highlights(ot_context *, const ot_handle *, uint32_t line,
1622
1795
  ot_edit_highlight *highlights, uint32_t capacity, uint32_t *out_count);
1623
1796
 
1797
+ /* Interns an ordered list of SyntaxStyle names as a group set. names is a pool of UTF-8
1798
+ * names; name_end_bytes[i] is the exclusive end of name i, and the last end is
1799
+ * name_byte_count. Equal lists give equal ids on this Context, whatever style a buffer binds;
1800
+ * ids are never freed. Paint composes the names against the buffer's bound style, later names
1801
+ * winning, and a missing name falls back to its first dotted component. Names must be
1802
+ * nonempty. More than OT_GROUP_SET_NAME_COUNT_MAX names, a name over
1803
+ * OT_GROUP_SET_NAME_BYTE_COUNT_MAX bytes, or a new set past 4,096 sets or 64 KiB of names fails
1804
+ * with OT_OBJECT_LIMIT. Failures preserve out_group_set. */
1805
+ #define OT_GROUP_SET_NAME_COUNT_MAX UINT32_C(16)
1806
+ #define OT_GROUP_SET_NAME_BYTE_COUNT_MAX UINT32_C(64)
1807
+ ot_status ot_context_group_set(ot_context *, const uint8_t *names, uint32_t name_byte_count,
1808
+ const uint32_t *name_end_bytes, uint32_t name_count, uint32_t *out_group_set);
1809
+
1810
+ typedef struct ot_highlight_run {
1811
+ uint32_t start_byte;
1812
+ uint32_t end_byte;
1813
+ uint32_t group_set; /* id from ot_context_group_set */
1814
+ } ot_highlight_run;
1815
+ /* Replaces layer layer_id of the buffer inside [start_byte, end_byte), start_byte <= end_byte,
1816
+ * with runs, in UTF-8 bytes of the text as get_text returns it (one byte per line break);
1817
+ * runs may be NULL only when run_count is zero. Runs are nonempty,
1818
+ * sorted, non-overlapping, inside the range and inside the text, and start and end on code
1819
+ * point boundaries; so must range edges inside the text. A range end past the text reaches
1820
+ * its end. Runs that cross the range edges keep their outside parts. One transaction: a
1821
+ * rejection leaves the layer unchanged. Runs move with edits: they shift, a run grows when
1822
+ * text is inserted strictly inside it, and deleted bytes clip them. set_text, clear, undo,
1823
+ * redo and the CLEAR_ALL highlight operation empty every layer; REMOVE_REF and CLEAR_LINE
1824
+ * leave layers alone. Layers paint at priority 0: above highlights of priority 0, below
1825
+ * higher priorities; where layers overlap, the higher layer_id wins. A run without a link
1826
+ * whose group set supplies no field (fg, bg or attribute bit) paints as if absent. At most 4 nonempty
1827
+ * layers per buffer: a fifth fails with OT_OBJECT_LIMIT, and a layer left empty is dropped. */
1828
+ ot_status ot_edit_buffer_set_layer(ot_context *, const ot_handle *, uint32_t layer_id,
1829
+ uint32_t start_byte, uint32_t end_byte, const ot_highlight_run *runs, uint32_t run_count);
1830
+
1831
+ /* Edit marks: ranges of the text that move with edits. Text inserted at a mark's start shifts it,
1832
+ * at its end leaves it (so an empty mark stays), and strictly inside grows it. A delete clips a
1833
+ * mark and drops it once none of its text is left. An OT_EDIT_MARK_ATOMIC mark is one unit: an
1834
+ * edit that changes part of its text drops it, and the edit changes exactly the text it asked
1835
+ * for. set_text and clear drop every mark. Undo and redo restore the marks of the text they
1836
+ * restore. Ids start at 1 and are never reused, undo included. At most 65,536 marks per buffer
1837
+ * (OT_OBJECT_LIMIT).
1838
+ * start and end are cursor offsets, start <= end; past the text they mean its end. On output a
1839
+ * start rounds down and an end up to a cursor stop, and start_byte/end_byte give the mark in
1840
+ * UTF-8 bytes of get_text; on input both are zero.
1841
+ * A styled mark paints and get_highlights reports it as one ADD_RANGE highlight with its style,
1842
+ * priority and ref = id & 0xFFFF, added after the buffer's own highlights in id order. style is
1843
+ * a SyntaxStyle id (0 for none); with OT_EDIT_MARK_STYLE_VALUE, style is 0 and value is the
1844
+ * style itself, kept by the buffer (at most 4,096 values; past it OT_OBJECT_LIMIT), and
1845
+ * get_highlights reports style id 0. Without it, value is all zero. */
1846
+ #define OT_EDIT_MARK_ADD UINT32_C(0)
1847
+ #define OT_EDIT_MARK_REMOVE UINT32_C(1)
1848
+ #define OT_EDIT_MARK_CLEAR UINT32_C(2)
1849
+ #define OT_EDIT_MARK_ATOMIC UINT32_C(1)
1850
+ #define OT_EDIT_MARK_STYLE_VALUE UINT32_C(2)
1851
+ #define OT_EDIT_MARK_ANY_KIND UINT32_C(0xFFFFFFFF)
1852
+ typedef struct ot_edit_mark {
1853
+ uint32_t struct_size;
1854
+ uint32_t abi_version;
1855
+ uint32_t id;
1856
+ uint32_t kind;
1857
+ uint32_t flags;
1858
+ uint32_t style;
1859
+ ot_editor_style value;
1860
+ uint32_t priority;
1861
+ uint32_t start;
1862
+ uint32_t end;
1863
+ uint32_t start_byte;
1864
+ uint32_t end_byte;
1865
+ } ot_edit_mark;
1866
+ /* ADD takes mark (id 0, priority <= 255 when styled) and writes the new id. REMOVE takes
1867
+ * mark->id (the rest zero) and writes it back, or 0 when there was no such mark. CLEAR drops
1868
+ * every mark; mark and out_id are NULL. */
1869
+ ot_status ot_edit_buffer_mark(ot_context *, const ot_handle *, uint32_t operation,
1870
+ const ot_edit_mark *mark, uint32_t *out_id);
1871
+ /* Copies the marks in (start, id) order: mark id, or all for id 0, of kind kind, or any for
1872
+ * OT_EDIT_MARK_ANY_KIND. Zero capacity reports the count; otherwise all must fit, and
1873
+ * undersized calls preserve both outputs. */
1874
+ ot_status ot_edit_buffer_get_marks(ot_context *, const ot_handle *, uint32_t id, uint32_t kind,
1875
+ ot_edit_mark *marks, uint32_t capacity, uint32_t *out_count);
1876
+
1877
+ /* A streamed Markdown document (CommonMark 0.31.2 with GFM tables, strikethrough, task lists and
1878
+ * extended autolinks), parsed incrementally. Blocks have preorder indices, which are their ids;
1879
+ * a removal is always a suffix. Complete lines parse exactly; the bytes after the last line
1880
+ * ending are laid out provisionally, held while their kind can still change. Limits: source
1881
+ * 64 MiB, 1,048,576 blocks, 4,096 link definitions, 32 levels of nesting, hook filter 256
1882
+ * bytes, 32 emphasis runs waiting for a closer (past it the oldest is text and never matches).
1883
+ * A rejected call changes nothing: the document, its bound nodes and its pending
1884
+ * changes stay as they were. An accepted call writes its bound nodes after its change; a node
1885
+ * write that runs out of memory leaves that node behind until a later call writes it whole. */
1886
+ #define OT_MD_CONCEAL UINT32_C(1) /* hide markers; off, a leaf shows its source, styled */
1887
+ #define OT_MD_HYPERLINKS UINT32_C(2) /* the terminal shows links; off, a label that is not its
1888
+ URL is followed by " (url)" */
1889
+ #define OT_MD_MATH UINT32_C(4) /* $…$, \(…\) inline math; $$ and \[ blocks (code, MATH) */
1890
+ #define OT_MD_HOOK UINT32_C(8) /* prose leaves whose source holds a filter substring latch
1891
+ HOOKED: the host writes them */
1892
+ typedef struct ot_markdown_options {
1893
+ uint32_t struct_size;
1894
+ uint32_t abi_version;
1895
+ uint32_t flags; /* OT_MD_* */
1896
+ uint32_t source_byte_limit; /* 0 = 64 MiB; may only lower it */
1897
+ ot_handle syntax_style; /* style the bound nodes and read_leaf resolve with; zero = none */
1898
+ uint32_t hook_filter_byte_count; /* <= OT_MD_HOOK_FILTER_BYTE_COUNT_MAX */
1899
+ uint32_t reserved;
1900
+ /* At most 16 NUL-separated substrings, each 1..64 bytes, in the first
1901
+ * hook_filter_byte_count bytes; none with OT_MD_HOOK = every prose leaf is hooked. */
1902
+ uint8_t hook_filter[256];
1903
+ } ot_markdown_options;
1904
+ #define OT_MD_HOOK_FILTER_BYTE_COUNT_MAX UINT32_C(256)
1905
+ typedef struct ot_markdown_result {
1906
+ uint32_t changed_block_count; /* blocks read_changes lists now */
1907
+ uint32_t committed_top_level_count; /* leading top-level blocks that are final */
1908
+ uint32_t removed_from_index; /* blocks at this index and after were removed since
1909
+ the last read; UINT32_MAX = none */
1910
+ } ot_markdown_result;
1911
+ /* The doc keeps a copy of the filter. syntax_style must name a live style. */
1912
+ ot_status ot_markdown_create(ot_context *, const ot_markdown_options *, ot_handle *out_doc);
1913
+ /* Bound nodes keep their last text. */
1914
+ ot_status ot_markdown_destroy(ot_context *, const ot_handle *doc);
1915
+ /* Conceal, hyperlink, math, hook and limit changes parse the source again: blocks equal to the
1916
+ * old ones keep their indices, bound nodes whose leaf output changed are written again (the
1917
+ * listed ones the host writes), and the blocks after the first difference are removed. A style
1918
+ * change binds the bound nodes to the new style without a rewrite. A finished doc stays
1919
+ * finished. */
1920
+ ot_status ot_markdown_set_options(ot_context *, const ot_handle *doc, const ot_markdown_options *,
1921
+ ot_markdown_result *out);
1922
+ /* bytes is valid UTF-8 and may be NULL only when byte_count is zero. After finish, an append is
1923
+ * a fresh parse of the whole source and the bytes. */
1924
+ ot_status ot_markdown_append(ot_context *, const ot_handle *doc, const uint8_t *bytes,
1925
+ uint32_t byte_count, ot_markdown_result *out);
1926
+ /* A fresh parse of bytes; leading blocks equal to the old ones keep their indices unreported. */
1927
+ ot_status ot_markdown_set(ot_context *, const ot_handle *doc, const uint8_t *bytes,
1928
+ uint32_t byte_count, ot_markdown_result *out);
1929
+ /* Ends the document: the pending line is complete and every block closes. A fence or math
1930
+ * block without its closer stays without OT_MD_BLOCK_CLOSED. */
1931
+ ot_status ot_markdown_finish(ot_context *, const ot_handle *doc, ot_markdown_result *out);
1932
+ /* The source, borrowed until the next mutating call on doc or its destruction. */
1933
+ ot_status ot_markdown_get_source(ot_context *, const ot_handle *doc, const uint8_t **out_bytes,
1934
+ uint32_t *out_byte_count);
1935
+
1936
+ #define OT_MD_PARAGRAPH UINT32_C(0)
1937
+ #define OT_MD_HEADING UINT32_C(1)
1938
+ #define OT_MD_CODE UINT32_C(2) /* fenced, indented, or display math (OT_MD_BLOCK_MATH) */
1939
+ #define OT_MD_HTML UINT32_C(3) /* shown as its source text */
1940
+ #define OT_MD_RULE UINT32_C(4)
1941
+ #define OT_MD_TABLE UINT32_C(5)
1942
+ #define OT_MD_TABLE_ROW UINT32_C(6)
1943
+ #define OT_MD_TABLE_CELL UINT32_C(7) /* a row's source cells only; shorter rows have fewer */
1944
+ #define OT_MD_QUOTE UINT32_C(8)
1945
+ #define OT_MD_LIST UINT32_C(9)
1946
+ #define OT_MD_ITEM UINT32_C(10)
1947
+ #define OT_MD_BLOCK_CLOSED UINT32_C(1) /* a fence's or math block's closer arrived */
1948
+ #define OT_MD_BLOCK_SETEXT UINT32_C(2)
1949
+ #define OT_MD_BLOCK_ORDERED UINT32_C(4)
1950
+ #define OT_MD_BLOCK_TIGHT UINT32_C(8) /* set when the list closes */
1951
+ #define OT_MD_BLOCK_TASK UINT32_C(16)
1952
+ #define OT_MD_BLOCK_CHECKED UINT32_C(32)
1953
+ #define OT_MD_BLOCK_BLANK_AFTER UINT32_C(64) /* a blank line separates the item from the next */
1954
+ #define OT_MD_BLOCK_FENCED UINT32_C(128)
1955
+ #define OT_MD_BLOCK_HOOKED UINT32_C(256)
1956
+ #define OT_MD_BLOCK_MATH UINT32_C(512) /* display math: a code block of the language math */
1957
+ #define OT_MD_BLOCK_HEADER UINT32_C(1024) /* a table's header row */
1958
+ #define OT_MD_BLOCK_OPEN UINT32_C(2048) /* later lines may still extend the block */
1959
+ /* A table cell's column alignment from the delimiter row: both = centred, neither = none. */
1960
+ #define OT_MD_BLOCK_ALIGN_LEFT UINT32_C(4096)
1961
+ #define OT_MD_BLOCK_ALIGN_RIGHT UINT32_C(8192)
1962
+ typedef struct ot_markdown_block {
1963
+ uint32_t index; /* preorder index = block id */
1964
+ uint32_t parent_index; /* UINT32_MAX at top level */
1965
+ uint16_t kind; /* OT_MD_PARAGRAPH .. OT_MD_ITEM */
1966
+ uint16_t flags; /* OT_MD_BLOCK_* */
1967
+ uint32_t source_start_byte;
1968
+ uint32_t source_end_byte;
1969
+ uint32_t info_start_byte; /* a fence's info string; empty otherwise */
1970
+ uint32_t info_end_byte;
1971
+ uint32_t number; /* heading level, list start, table column count, cell column */
1972
+ } ot_markdown_block;
1973
+ /* Lists every block changed since the last successful read, in document order, and clears the
1974
+ * pending changes and removed_from_index. A zero or short capacity reports the count and
1975
+ * acknowledges nothing. blocks may be NULL only when block_capacity is zero. */
1976
+ ot_status ot_markdown_read_changes(ot_context *, const ot_handle *doc, ot_markdown_block *blocks,
1977
+ uint32_t block_capacity, uint32_t *out_block_count);
1978
+ #define OT_MD_SPAN_CODE UINT32_C(1)
1979
+ #define OT_MD_SPAN_MATH UINT32_C(2)
1980
+ /* The parser's output for a leaf (paragraph, heading, code, HTML block or table cell), never a
1981
+ * host's: its display bytes, styled chunks resolved through the doc's style (links point into
1982
+ * urls, as ot_scene_set_styled_text takes them), and, when spans is not NULL, one OT_MD_SPAN_*
1983
+ * word per chunk. All capacities zero report the three counts; otherwise each must hold its
1984
+ * count, and an undersized call writes nothing. A pointer may be NULL only with zero capacity. */
1985
+ /* A paragraph's, heading's or table cell's inline source: its content with container markers
1986
+ * and leading whitespace removed, lines joined by '\n', trailing whitespace and leading link
1987
+ * definitions dropped, a cell's escaped pipes unescaped (what an inline hook gets as the
1988
+ * block's source). Zero capacity reports the count; a short one writes nothing. */
1989
+ ot_status ot_markdown_read_source(ot_context *, const ot_handle *doc, uint32_t block_index,
1990
+ uint8_t *bytes, uint32_t byte_capacity, uint32_t *out_byte_count);
1991
+ ot_status ot_markdown_read_leaf(ot_context *, const ot_handle *doc, uint32_t block_index,
1992
+ uint8_t *bytes, uint32_t byte_capacity, uint32_t *out_byte_count,
1993
+ ot_styled_text_chunk *chunks, uint32_t *spans, uint32_t chunk_capacity, uint32_t *out_chunk_count,
1994
+ uint8_t *urls, uint32_t url_byte_capacity, uint32_t *out_url_byte_count);
1995
+ /* Binds a scene text node to a paragraph or heading: the node draws with the doc's style, and
1996
+ * while the leaf is not hooked and the doc conceals and shows hyperlinks, the doc writes the
1997
+ * leaf's display and Markdown runs to it now and on every change. A removal of the block
1998
+ * unbinds it; a destroyed node is skipped. A node the host writes (the doc does not) is never
1999
+ * written by another call: when a call makes the doc write such a leaf, it unbinds the node and
2000
+ * lists the leaf, and binding the node again hands it over. */
2001
+ ot_status ot_markdown_bind(ot_context *, const ot_handle *doc, uint32_t block_index,
2002
+ const ot_handle *text_node);
2003
+
1624
2004
  typedef struct ot_editor_viewport {
1625
2005
  uint32_t struct_size;
1626
2006
  uint32_t abi_version;
@@ -1646,7 +2026,10 @@ ot_status ot_editor_view_set_scroll_margin(ot_context *, const ot_handle *, floa
1646
2026
  #define OT_EDITOR_WRAP_MODE UINT32_C(5)
1647
2027
  #define OT_EDITOR_TAB_INDICATOR UINT32_C(6)
1648
2028
  /* argument is offset, OT_SCENE_WRAP_*, or Unicode scalar (0 disables) for the
1649
- * last three commands, and zero otherwise. */
2029
+ * last three commands, zero or OT_EDIT_ATOMIC for MOVE_UP/MOVE_DOWN, and zero otherwise. With
2030
+ * OT_EDIT_ATOMIC a move that lands in an atomic edit mark leaves it: nearer its start, one unit
2031
+ * before it (outside the marks there); nearer its end, past it and the marks that surround that
2032
+ * end. Down never ends at or before where it started, nor Up at or after it. */
1650
2033
  ot_status ot_editor_view_command(ot_context *, const ot_handle *, uint32_t command, uint32_t argument);
1651
2034
  /* Atomic selected delete-then-insert using native editor history and event order.
1652
2035
  * Without a selection inserts at the primary cursor. Input bytes are copied. */
@@ -1786,8 +2169,9 @@ ot_status ot_scene_set_editor_options(ot_context *, const ot_handle *node, const
1786
2169
 
1787
2170
  ot_status ot_image_destroy(ot_context *, const ot_handle *image);
1788
2171
 
2172
+ #define OT_IMAGE_ENCODED_BYTES_MAX UINT32_C(67108864)
1789
2173
  /* Image resources use Context allocation, I/O and handle capacity. Encoded inputs
1790
- * are limited to 64 MiB; dimensions to 16384 per axis and 25000000 pixels.
2174
+ * are limited to ENCODED_BYTES_MAX; dimensions to 16384 per axis and 25000000 pixels.
1791
2175
  * Inputs are copied during creation. Failed operations leave outputs unchanged.
1792
2176
  * Transform/clone/retain return independently releasable handles. Clone copies
1793
2177
  * pixels and encoded data; retain shares immutable storage within one Context.
@@ -2114,6 +2498,12 @@ ot_status ot_text_buffer_get_range(ot_context *, const ot_handle *, uint32_t sta
2114
2498
  uint8_t *, uint32_t capacity, uint32_t *out_count);
2115
2499
  ot_status ot_text_buffer_set_defaults(ot_context *, const ot_handle *, uint32_t mask, const ot_editor_style *);
2116
2500
  ot_status ot_text_buffer_set_tab_width(ot_context *, const ot_handle *, uint32_t width);
2501
+ /* Measures the text with width_method (OT_WIDTH_METHOD_*) from now on; views keep their
2502
+ * selections, and styled text its runs, on the same text. For buffers created without
2503
+ * OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH, which drawing outside a scene keeps current. A
2504
+ * following buffer, and NO_ZWJ on either side (it splits graphemes the others join), return
2505
+ * OT_INVALID_ARGUMENT and change nothing. The same method changes nothing. */
2506
+ ot_status ot_text_buffer_set_width_method(ot_context *, const ot_handle *, uint32_t width_method);
2117
2507
  /* Same operations, units, and copy rules as ot_edit_buffer_highlight and
2118
2508
  * ot_edit_buffer_get_highlights. Styled text is stored as highlights with ref 0 and
2119
2509
  * priority 1: get_highlights returns them, and REMOVE_REF 0 and CLEAR_* remove them. */
@@ -2121,6 +2511,11 @@ ot_status ot_text_buffer_highlight(ot_context *, const ot_handle *, uint32_t ope
2121
2511
  uint32_t argument, const ot_edit_highlight *);
2122
2512
  ot_status ot_text_buffer_get_highlights(ot_context *, const ot_handle *, uint32_t line,
2123
2513
  ot_edit_highlight *, uint32_t capacity, uint32_t *out_count);
2514
+ /* Same arguments, validation, transaction and paint as ot_edit_buffer_set_layer. Appending
2515
+ * keeps the layers; set_text, set_styled_text, clear and the CLEAR_ALL highlight operation
2516
+ * empty them. */
2517
+ ot_status ot_text_buffer_set_layer(ot_context *, const ot_handle *, uint32_t layer_id,
2518
+ uint32_t start_byte, uint32_t end_byte, const ot_highlight_run *runs, uint32_t run_count);
2124
2519
  ot_status ot_text_buffer_view_set_viewport(ot_context *, const ot_handle *, const ot_editor_viewport *, uint32_t size_only);
2125
2520
  ot_status ot_text_buffer_view_command(ot_context *, const ot_handle *, uint32_t command, uint32_t argument);
2126
2521
  ot_status ot_text_buffer_view_set_tab_color(ot_context *, const ot_handle *, const uint16_t color[4]);
@@ -2308,6 +2703,14 @@ typedef struct ot_buffer_lease_snapshot {
2308
2703
  uint64_t reserved;
2309
2704
  } ot_buffer_lease_snapshot;
2310
2705
 
2706
+ /* Bits 31..30 of a char plane element (KIND_MASK) select its kind: 00 is a
2707
+ * Unicode scalar; IMAGE, GRAPHEME (a pooled grapheme's first cell) and
2708
+ * CONTINUATION (a later cell of a wide glyph) carry native payloads. */
2709
+ #define OT_CELL_CHAR_KIND_MASK UINT32_C(0xC0000000)
2710
+ #define OT_CELL_CHAR_IMAGE UINT32_C(0x40000000)
2711
+ #define OT_CELL_CHAR_GRAPHEME UINT32_C(0x80000000)
2712
+ #define OT_CELL_CHAR_CONTINUATION UINT32_C(0xC0000000)
2713
+
2311
2714
  /* Acquire local frame access for the exact retained DONE record. which is
2312
2715
  * OT_SESSION_BUFFER_CURRENT or NEXT. Both require this qualified operation while
2313
2716
  * a draft is live; ordinary Session draw, render, and borrowing cannot bypass it.
@@ -2353,15 +2756,16 @@ ot_status ot_scene_frame_commit(ot_context *, const ot_handle *session,
2353
2756
  #define OT_TERMINAL_HOST_MULTIPLEXER UINT32_C(128)
2354
2757
 
2355
2758
  /* flags is a combination of the eight OT_TERMINAL_* option bits above. Other bits
2356
- * must be zero. REPLY_SENTINEL ends the startup query packet with DA1 (CSI c),
2357
- * also inside tmux, and sends no other DA1; the host waits for its reply instead
2358
- * of a timer. A DA1 reply then also ends the startup cursor-report probes.
2759
+ * must be zero. REPLY_SENTINEL ends setup with DA1 (CSI c), after every other query,
2760
+ * also inside tmux, and sends no other DA1; the host waits for its reply instead of a
2761
+ * timer, and it ends the startup cursor reports. Otherwise the query packet ends with DA1.
2762
+ * Only an alternate screen of 3+ rows probes OSC 66 width, on row 2 after the switch.
2359
2763
  * Frames that paint are wrapped in synchronized output (DEC mode 2026) unless the terminal
2360
2764
  * is remote and, once its replies passed the 2026 query (a width-probe report
2361
2765
  * or DA1), either did not report the mode or HOST_MULTIPLEXER is set: the host
2362
2766
  * runs inside tmux, screen or Zellij between the app and the link.
2363
- * SYNC_ALWAYS or SYNC_NEVER (not both) forces the wrapper on or off. kitty_keyboard_flags accepts bits 0 through 4, or zero to disable
2364
- * Kitty keyboard. clear-on-close also controls surface clearing on suspend. It
2767
+ * SYNC_ALWAYS or SYNC_NEVER (not both) forces the wrapper on or off. kitty_keyboard_flags accepts OT_KITTY_KEYBOARD_* bits, or zero to
2768
+ * disable Kitty keyboard. clear-on-close also controls surface clearing on suspend. It
2365
2769
  * clears only a surface that setup or resume claimed: a close before their mode
2366
2770
  * packet leaves visible shell output in place. */
2367
2771
  typedef struct ot_session_terminal_options {
@@ -2371,6 +2775,15 @@ typedef struct ot_session_terminal_options {
2371
2775
  uint32_t kitty_keyboard_flags;
2372
2776
  } ot_session_terminal_options;
2373
2777
 
2778
+ /* Kitty keyboard protocol progressive-enhancement flags. */
2779
+ #define OT_KITTY_KEYBOARD_DISAMBIGUATE UINT32_C(1)
2780
+ #define OT_KITTY_KEYBOARD_EVENT_TYPES UINT32_C(2)
2781
+ #define OT_KITTY_KEYBOARD_ALTERNATE_KEYS UINT32_C(4)
2782
+ #define OT_KITTY_KEYBOARD_ALL_KEYS_AS_ESCAPES UINT32_C(8)
2783
+ #define OT_KITTY_KEYBOARD_REPORT_TEXT UINT32_C(16)
2784
+ #define OT_KITTY_KEYBOARD_ALL (OT_KITTY_KEYBOARD_DISAMBIGUATE | OT_KITTY_KEYBOARD_EVENT_TYPES | \
2785
+ OT_KITTY_KEYBOARD_ALTERNATE_KEYS | OT_KITTY_KEYBOARD_ALL_KEYS_AS_ESCAPES | OT_KITTY_KEYBOARD_REPORT_TEXT)
2786
+
2374
2787
  #define OT_CONTROL_CAPABILITY_RESPONSE UINT32_C(1)
2375
2788
  #define OT_CONTROL_TITLE UINT32_C(2)
2376
2789
  #define OT_CONTROL_MOUSE UINT32_C(3)
@@ -2382,10 +2795,16 @@ typedef struct ot_session_terminal_options {
2382
2795
  #define OT_CONTROL_RESET_BACKGROUND UINT32_C(9)
2383
2796
  #define OT_CONTROL_PALETTE_QUERY UINT32_C(10)
2384
2797
  #define OT_CONTROL_PROGRAM_STATUS UINT32_C(11)
2798
+ #define OT_CONTROL_END_REPLY_SENTINEL UINT32_C(12)
2385
2799
 
2386
2800
  /* argument is 0/1/2 (disabled/drag/motion) for MOUSE, 0..31 for Kitty flags,
2387
- * 0/1 for QUERY_PIXEL_RESOLUTION (1 appends the DA1 sentinel), and zero otherwise. CAPABILITY_RESPONSE, TITLE, CURSOR, PALETTE_QUERY, and
2388
- * PROGRAM_STATUS accept payload bytes. reserved must be zero. */
2801
+ * 0/1 for QUERY_PIXEL_RESOLUTION, QUERY_THEME_COLORS and PALETTE_QUERY (1 appends
2802
+ * the DA1 sentinel, after the validated palette queries in the same packet; a
2803
+ * tmux-wrapped query's replies trail tmux's own DA1, so it takes 0), and zero
2804
+ * otherwise. CAPABILITY_RESPONSE, TITLE, CURSOR, PALETTE_QUERY, and
2805
+ * PROGRAM_STATUS accept payload bytes. reserved must be zero. END_REPLY_SENTINEL,
2806
+ * accepted in every open phase, turns REPLY_SENTINEL off for good once a DA1
2807
+ * reply never came: later Kitty keyboard pushes send no CSI ? u query. */
2389
2808
  typedef struct ot_session_control_options {
2390
2809
  uint32_t struct_size;
2391
2810
  uint32_t abi_version;
@@ -2403,7 +2822,7 @@ typedef struct ot_session_control_options {
2403
2822
  /* CURSOR payload is exactly one copied ot_session_cursor_update, with native
2404
2823
  * byte order and no alignment requirement. fields selects updated properties;
2405
2824
  * other bits must be zero. x/y clamp to 1 and must not exceed 65536. visible and
2406
- * blinking are 0/1. style is 0=block, 1=line, 2=underline, 3=default. mouse_pointer
2825
+ * blinking are 0/1. style is an OT_CURSOR_STYLE_* value. mouse_pointer
2407
2826
  * is an OT_MOUSE_POINTER_* shape. Color uses the packed RGBA lanes. Unselected
2408
2827
  * fields must be zero. */
2409
2828
  typedef struct ot_session_cursor_update {
@@ -2652,6 +3071,7 @@ typedef struct ot_session_pump_result {
2652
3071
  #define OT_INPUT_EXPECT_KITTY_KEYBOARD UINT32_C(2)
2653
3072
  #define OT_INPUT_EXPECT_CURSOR_POSITION UINT32_C(4)
2654
3073
  #define OT_INPUT_EXPECT_SENTINEL UINT32_C(8)
3074
+ #define OT_INPUT_EXPECT_ESCAPE_PREFIX UINT32_C(16)
2655
3075
 
2656
3076
  #define OT_INPUT_EVENTS_MIN UINT32_C(4)
2657
3077
  #define OT_INPUT_PAYLOAD_BYTES_MIN UINT32_C(4384)
@@ -2727,6 +3147,7 @@ typedef struct ot_context_error {
2727
3147
 
2728
3148
  #define OT_DIAGNOSTIC_MESSAGE_BYTES UINT32_C(4096)
2729
3149
  #define OT_DIAGNOSTIC_TRUNCATED UINT32_C(1)
3150
+ #define OT_DIAGNOSTIC_QUEUE_MAX UINT32_C(64)
2730
3151
 
2731
3152
  /* Copied diagnostic record. level is 0 (error), 1 (warning), 2 (info), or
2732
3153
  * 3 (debug). message_len counts bytes, not a terminating NUL. Unused message
@@ -2776,7 +3197,7 @@ ot_status ot_context_destroy(ot_context *context);
2776
3197
  ot_status ot_context_get_last_error(ot_context *context, ot_context_error *out_error);
2777
3198
 
2778
3199
  /* Copy up to capacity records in arrival order without allocation or callbacks.
2779
- * Version 2 C contexts hold at most 64 records and drop newest on overflow.
3200
+ * Version 2 C contexts hold at most OT_DIAGNOSTIC_QUEUE_MAX records and drop newest on overflow.
2780
3201
  * records may be NULL only when capacity is zero. A zero-capacity drain reports
2781
3202
  * queue pressure without removing records. out_drain must have the exact size
2782
3203
  * and version. The caller owns both outputs for the call. Outputs and queued
@@ -2940,6 +3361,7 @@ ot_status ot_buffer_color_matrix(ot_context *, const ot_handle *, const ot_scene
2940
3361
  #define OT_SCENE_RECORD_SCENE_BODY UINT32_C(10)
2941
3362
  #define OT_SCENE_RECORD_IMAGE UINT32_C(11)
2942
3363
  #define OT_SCENE_RECORD_UNICODE UINT32_C(12)
3364
+ #define OT_SCENE_RECORD_CELLS UINT32_C(13)
2943
3365
  #define OT_SCENE_RECORD_GRAYSCALE_FOREGROUND UINT32_C(1)
2944
3366
  #define OT_SCENE_RECORD_GRAYSCALE_BACKGROUND UINT32_C(2)
2945
3367
  #define OT_SCENE_RECORD_GRAYSCALE_SUPERSAMPLED UINT32_C(4)
@@ -3060,6 +3482,25 @@ typedef struct ot_scene_record_unicode {
3060
3482
  uint16_t background[4];
3061
3483
  } ot_scene_record_unicode;
3062
3484
 
3485
+ /* One cell of a CELLS record, with the fields of ot_buffer_draw_cell. */
3486
+ typedef struct ot_scene_cell {
3487
+ uint32_t character;
3488
+ uint32_t attributes;
3489
+ uint16_t foreground[4];
3490
+ uint16_t background[4];
3491
+ } ot_scene_cell;
3492
+
3493
+ /* Followed by count ot_scene_cell records, in rows of width cells from (x, y).
3494
+ * Each cell draws as an OT_BUFFER_DRAW_CELL_BLEND record at its position would,
3495
+ * in order. width must be nonzero. */
3496
+ typedef struct ot_scene_record_cells {
3497
+ ot_scene_record_header header;
3498
+ int32_t x;
3499
+ int32_t y;
3500
+ uint32_t width;
3501
+ uint32_t count;
3502
+ } ot_scene_record_cells;
3503
+
3063
3504
  /* Retain one offscreen storage generation under the same limits and raw-plane
3064
3505
  * restrictions as Session leases. The snapshot requires exact size/version and
3065
3506
  * zero reserved. Rejection leaves it unchanged and acquires no lease. */
@@ -3267,7 +3708,8 @@ ot_status ot_session_set_palette_state(ot_context *, const ot_handle *,
3267
3708
  const uint16_t *background, uint32_t epoch);
3268
3709
 
3269
3710
  /* Notifications reuse terminal protocol selection and ordinary output capacity.
3270
- * Unsupported capability or rejected output returns out_written=0. Message and
3711
+ * Unsupported capability, text that is not UTF-8, or rejected output returns
3712
+ * out_written=0; C0, DEL, and C1 controls in the text become spaces. Message and
3271
3713
  * optional title are consumed only during this call; NULL requires zero length. */
3272
3714
  ot_status ot_session_notification(ot_context *, const ot_handle *,
3273
3715
  const uint8_t *message, uint32_t message_len, const uint8_t *title,
@@ -3301,7 +3743,8 @@ ot_status ot_session_pump(
3301
3743
  * at least OT_INPUT_EVENTS_MIN and payload_capacity at least
3302
3744
  * OT_INPUT_PAYLOAD_BYTES_MIN; the call consumes input until either runs low and
3303
3745
  * reports consumed. A bracketed paste arrives as one or more PASTE records from
3304
- * START to END. Records and payload are borrowed for the call and never retained.
3746
+ * START to END; a start marker cut by the timeout waits for a feed that begins with its
3747
+ * rest and more bytes. Records and payload are borrowed for the call and never retained.
3305
3748
  * bytes, records, payload, and out_drain must not overlap.
3306
3749
  * Accepted in any open session state; closing, closed, failed, and cancelled
3307
3750
  * sessions reject. A rejected call leaves out_drain, the records, and parser
@@ -3335,6 +3778,15 @@ ot_status ot_session_input_feed(
3335
3778
  * reply; another byte ends either one and is typed. A lone Escape still times
3336
3779
  * out, and a reply that follows it is not typed; if what follows that Escape is
3337
3780
  * cut before it matches a reply, its introducer is typed. KEEP_REPLY also keeps such a CSI.
3781
+ * ESCAPE_PREFIX, which implies KITTY_KEYBOARD, means the terminal confirmed
3782
+ * Kitty disambiguate or report-all keys, so no unit has a deadline. A raw ESC and the byte after it in the same
3783
+ * feed are Alt and that key as without the flag; a raw ESC that ends a feed is the Escape key at once. If the next
3784
+ * feed, however late, begins with [ and a byte that begins a CSI such a terminal sends (a digit, ?, >, <, or one of
3785
+ * ABCDEFHIOPQS), the CSI is kept whole and is never a key; _G begins a Kitty graphics reply, kept whole once that
3786
+ * feed matches its key= prefix and typed otherwise; other bytes are typed. With SENTINEL, an OSC, DCS, or APC
3787
+ * introducer or a lone [ after that Escape is recovered as after a timeout until SENTINEL is cleared.
3788
+ * A session with a renderer sets it itself once the terminal answers the CSI ? u
3789
+ * query that follows its current push (only with OT_TERMINAL_REPLY_SENTINEL).
3338
3790
  * Changing flags emits nothing; the next feed resolves a unit that may no longer wait. */
3339
3791
  ot_status ot_session_input_expect(ot_context *context, const ot_handle *session, uint32_t flags);
3340
3792
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentui/core-linux-arm64",
3
- "version": "0.8.4",
3
+ "version": "0.9.1",
4
4
  "description": "Prebuilt linux-arm64 binaries for @opentui/core",
5
5
  "type": "module",
6
6
  "main": "index.js",