float_pigment_forest/ffi.rs
1use crate::NodeType;
2use crate::{
3 node::DumpNode, node::DumpOptions, node::DumpStyleMode, ChildOperation, Len, MeasureMode, Node,
4 StyleSetter,
5};
6use float_pigment_css::length_num::*;
7use float_pigment_css::property::PropertyValueWithGlobal;
8use float_pigment_css::typing::{
9 AlignContentType, AlignItemsType, AlignSelfType, BoxSizingType, DisplayType, FlexDirectionType,
10 FlexWrapType, JustifyContentType, OverflowType, PositionType, TextAlignType, WritingModeType,
11};
12use float_pigment_layout::{DefLength, OptionNum};
13use std::{ffi::CString, os::raw::c_char};
14
15pub type Width = f32;
16pub type Height = f32;
17pub type Baseline = f32;
18pub type MeasureMinWidth = f32;
19pub type MeasureMinHeight = f32;
20pub type MeasureMaxWidth = f32;
21pub type MeasureMaxHeight = f32;
22pub type MeasureMaxContentWidth = f32;
23pub type MeasureMaxContentHeight = f32;
24
25pub type BaselineFunc = unsafe extern "C" fn(NodePtr, Width, Height) -> Baseline;
26
27pub type MeasureFunc = unsafe extern "C" fn(
28 NodePtr,
29 MeasureMaxWidth,
30 MeasureMode,
31 MeasureMaxHeight,
32 MeasureMode,
33 MeasureMinWidth,
34 MeasureMinHeight,
35 MeasureMaxContentWidth,
36 MeasureMaxContentHeight,
37) -> Size;
38
39pub type CalcHandle = i32;
40
41pub type ResolveCalc = unsafe extern "C" fn(CalcHandle, f32) -> f32;
42
43pub type DirtyCallback = unsafe extern "C" fn(NodePtr);
44
45#[repr(C)]
46pub struct Size {
47 pub width: f32,
48 pub height: f32,
49}
50
51impl Size {
52 pub fn new(width: f32, height: f32) -> Self {
53 Self { width, height }
54 }
55}
56impl From<Size> for float_pigment_layout::Size<Len> {
57 fn from(val: Size) -> Self {
58 float_pigment_layout::Size::new(Len::from_f32(val.width), Len::from_f32(val.height))
59 }
60}
61
62pub type RawMutPtr = *mut ();
63
64pub type NullPtr = *const ();
65
66pub type NodePtr = RawMutPtr;
67
68/// # Safety
69///
70/// Convert a node instance to a string.
71///
72/// # Arguments
73/// * `node` - Raw pointer to the Node instance
74/// * `recursive` - Recursive
75/// * `layout` - Layout
76/// * `style` - Style
77///
78/// # Returns
79/// A string representation of the node
80///
81/// # Example
82///
83/// ```c
84/// NodeToString(node, true, true, true);
85/// ```
86#[no_mangle]
87pub unsafe extern "C" fn NodeToString(
88 node: NodePtr,
89 recursive: bool,
90 layout: bool,
91 style: bool,
92) -> *const c_char {
93 let node = &*(node as *mut Node);
94 let node_str = node.dump_to_html(
95 DumpOptions {
96 recursive,
97 layout,
98 style: if style {
99 DumpStyleMode::Mutation
100 } else {
101 DumpStyleMode::None
102 },
103 },
104 1,
105 );
106 let node_str = CString::new(node_str).expect("CString new error");
107 node_str.into_raw()
108}
109/// # Safety
110///
111/// Free a string instance.
112///
113/// # Arguments
114/// * `str` - Raw pointer to the string instance
115///
116/// # Example
117///
118/// ```c
119/// FreeString(str);
120/// ```
121#[no_mangle]
122pub unsafe extern "C" fn FreeString(str: *const c_char) {
123 drop(CString::from_raw(str as *mut c_char));
124}
125
126/// # Safety
127///
128/// Create a node instance.
129///
130/// # Returns
131/// Raw pointer to the Node instance
132///
133/// # Example
134///
135/// ```c
136/// NodePtr node = NodeNew();
137/// ```
138///
139#[no_mangle]
140pub unsafe extern "C" fn NodeNew() -> NodePtr {
141 Node::new_ptr() as NodePtr
142}
143
144/// # Safety
145///
146/// Free a node instance.
147///
148/// # Arguments
149/// * `node` - Raw pointer to the Node instance
150///
151/// # Example
152///
153/// ```c
154/// NodeFree(node);
155/// ```
156#[no_mangle]
157pub unsafe extern "C" fn NodeFree(node: NodePtr) {
158 drop(Box::from_raw(node as *mut Node))
159}
160
161/// # Safety
162///
163/// Get the external host of a node instance.
164///
165/// # Arguments
166/// * `node` - Raw pointer to the Node instance
167///
168/// # Returns
169/// Raw pointer to the external host
170///
171/// # Example
172///
173/// ```c
174/// NodePtr external_host = NodeGetExternalHost(node);
175/// ```
176#[no_mangle]
177pub unsafe extern "C" fn NodeGetExternalHost(node: NodePtr) -> *mut () {
178 let node = &*(node as *mut Node);
179 let external_host = node.external_host();
180 external_host.expect("[fp:: NodeGetExternalHost] external host is empty")
181}
182
183/// # Safety
184///
185/// Set the external host of a node instance.
186///
187/// # Arguments
188/// * `node` - Raw pointer to the Node instance
189/// * `external_host` - Raw pointer to the external host
190///
191/// # Example
192///
193/// ```c
194/// NodeSetExternalHost(node, external_host);
195/// ```
196#[no_mangle]
197pub unsafe extern "C" fn NodeSetExternalHost(node: NodePtr, external_host: *mut ()) {
198 let node = &*(node as *mut Node);
199 node.set_external_host(Some(external_host));
200}
201
202/// # Safety
203///
204/// Set the node type of a node instance.
205///
206/// # Arguments
207/// * `node` - Raw pointer to the Node instance
208///
209/// # Example
210///
211/// ```c
212/// NodeSetAsText(node);
213/// ```
214#[no_mangle]
215pub unsafe extern "C" fn NodeSetAsText(node: NodePtr) {
216 let node = &*(node as *mut Node);
217 node.set_node_type(NodeType::Text);
218}
219
220/// # Safety
221///
222/// Insert a child node at a specific index.
223///
224/// # Arguments
225/// * `node` - Raw pointer to the Node instance
226/// * `child` - Raw pointer to the child Node instance
227/// * `index` - Index to insert the child node at
228///
229/// # Example
230///
231/// ```c
232/// NodeInsertChild(node, child, index);
233/// ```
234#[no_mangle]
235pub unsafe extern "C" fn NodeInsertChild(node: NodePtr, child: NodePtr, index: usize) {
236 let node = &*(node as *mut Node);
237 let child = child as *mut Node;
238 node.insert_child_at(child, index);
239}
240
241/// # Safety
242///
243/// Append a child node to a node instance.
244///
245/// # Arguments
246/// * `node` - Raw pointer to the Node instance
247/// * `child` - Raw pointer to the child Node instance
248///
249/// # Example
250///
251/// ```c
252/// NodeAppendChild(node, child);
253/// ```
254#[no_mangle]
255pub unsafe extern "C" fn NodeAppendChild(node: NodePtr, child: NodePtr) {
256 let node = &*(node as *mut Node);
257 let child = child as *mut Node;
258 node.append_child(child);
259}
260
261/// # Safety
262///
263/// Insert a child node before a pivot node.
264///
265/// # Arguments
266/// * `node` - Raw pointer to the Node instance
267/// * `child` - Raw pointer to the child Node instance
268/// * `pivot` - Raw pointer to the pivot Node instance
269///
270/// # Example
271///
272/// ```c
273/// NodeInsertBefore(node, child, pivot);
274/// ```
275#[no_mangle]
276pub unsafe extern "C" fn NodeInsertBefore(node: NodePtr, child: NodePtr, pivot: NodePtr) {
277 let node = &*(node as *mut Node);
278 let child = child as *mut Node;
279 let pivot = pivot as *mut Node;
280 node.insert_child_before(child, pivot);
281}
282
283/// # Safety
284///
285/// Remove a child node from a node instance.
286///
287/// # Arguments
288/// * `node` - Raw pointer to the Node instance
289/// * `child` - Raw pointer to the child Node instance
290///
291/// # Example
292///
293/// ```c
294/// NodeRemoveChild(node, child);
295/// ```
296#[no_mangle]
297pub unsafe extern "C" fn NodeRemoveChild(node: NodePtr, child: NodePtr) {
298 let node = &*(node as *mut Node);
299 let child = child as *mut Node;
300 node.remove_child(child);
301}
302
303/// # Safety
304///
305/// Remove all children from a node instance.
306///
307/// # Arguments
308/// * `node` - Raw pointer to the Node instance
309///
310/// # Example
311///
312/// ```c
313/// NodeRemoveAllChildren(node);
314/// ```
315#[no_mangle]
316pub unsafe extern "C" fn NodeRemoveAllChildren(node: NodePtr) {
317 let node = &*(node as *mut Node);
318 node.remove_all_children();
319}
320
321/// # Safety
322///
323/// Get a child node at a specific index.
324///
325/// # Arguments
326/// * `node` - Raw pointer to the Node instance
327/// * `index` - Index to get the child node at
328///
329/// # Returns
330/// * `NodePtr` - Raw pointer to the child Node instance
331///
332/// # Example
333///
334/// ```c
335/// NodePtr child = NodeGetChild(node, index);
336/// ```
337#[no_mangle]
338pub unsafe extern "C" fn NodeGetChild(node: NodePtr, index: usize) -> NodePtr {
339 let node = &*(node as *mut Node);
340 let node_ptr = node
341 .get_child_ptr_at(index)
342 .expect("[fp:: NodeGetChild] Child is not found");
343 node_ptr as NodePtr
344}
345
346/// # Safety
347///
348/// Get the parent node of a node instance.
349///
350/// # Arguments
351/// * `node` - Raw pointer to the Node instance
352///
353/// # Returns
354/// * `NodePtr` - Raw pointer to the parent Node instance
355///
356/// # Example
357///
358/// ```c
359/// NodePtr parent = NodeGetParent(node);
360/// ```
361#[no_mangle]
362pub unsafe extern "C" fn NodeGetParent(node: NodePtr) -> NodePtr {
363 let node = &*(node as *mut Node);
364 let node_ptr = node
365 .parent_ptr()
366 .expect("[fp:: NodeGetParent] Parent is not found");
367 node_ptr as NodePtr
368}
369
370/// # Safety
371///
372/// Get the number of children of a node instance.
373///
374/// # Arguments
375/// * `node` - Raw pointer to the Node instance
376///
377/// # Returns
378/// * `usize` - Number of children
379///
380/// # Example
381///
382/// ```c
383/// usize child_count = NodeGetChildCount(node);
384/// ```
385#[no_mangle]
386pub unsafe extern "C" fn NodeGetChildCount(node: NodePtr) -> usize {
387 let node = &*(node as *mut Node);
388 node.children_len()
389}
390
391/// # Safety
392///
393/// Calculate the layout of a node instance.
394///
395/// # Arguments
396/// * `node` - Raw pointer to the Node instance
397/// * `available_width` - Available width
398/// * `available_height` - Available height
399/// * `viewport_width` - Viewport width
400/// * `viewport_height` - Viewport height
401///
402/// # Example
403///
404/// ```c
405/// NodeCalculateLayout(node, available_width, available_height, viewport_width, viewport_height);
406/// ```
407#[no_mangle]
408pub unsafe extern "C" fn NodeCalculateLayout(
409 node: NodePtr,
410 available_width: f32,
411 available_height: f32,
412 viewport_width: f32,
413 viewport_height: f32,
414) {
415 let node = &*(node as *mut Node);
416 let available_width = if available_width.is_finite() {
417 OptionNum::some(Len::from_f32(available_width))
418 } else {
419 OptionNum::none()
420 };
421 let available_height = if available_height.is_finite() {
422 OptionNum::some(Len::from_f32(available_height))
423 } else {
424 OptionNum::none()
425 };
426 node.layout(
427 crate::node::OptionSize::new(available_width, available_height),
428 crate::node::Size::new(
429 Len::from_f32(viewport_width),
430 Len::from_f32(viewport_height),
431 ),
432 );
433}
434
435/// # Safety
436///
437/// Calculate the dry layout of a node instance.
438///
439/// # Arguments
440/// * `node` - Raw pointer to the Node instance
441/// * `available_width` - Available width
442/// * `available_height` - Available height
443/// * `viewport_width` - Viewport width
444/// * `viewport_height` - Viewport height
445///
446/// # Example
447///
448/// ```c
449/// NodeCalculateDryLayout(node, available_width, available_height, viewport_width, viewport_height);
450/// ```
451#[no_mangle]
452pub unsafe extern "C" fn NodeCalculateDryLayout(
453 node: NodePtr,
454 available_width: f32,
455 available_height: f32,
456 viewport_width: f32,
457 viewport_height: f32,
458) {
459 let node = &*(node as *mut Node);
460 let available_width = if available_width.is_finite() {
461 OptionNum::some(Len::from_f32(available_width))
462 } else {
463 OptionNum::none()
464 };
465 let available_height = if available_height.is_finite() {
466 OptionNum::some(Len::from_f32(available_height))
467 } else {
468 OptionNum::none()
469 };
470 node.dry_layout(
471 crate::node::OptionSize::new(available_width, available_height),
472 crate::node::Size::new(
473 Len::from_f32(viewport_width),
474 Len::from_f32(viewport_height),
475 ),
476 );
477}
478
479/// # Safety
480///
481/// Calculate the layout of a node instance with a containing size.
482///
483/// # Arguments
484/// * `node` - Raw pointer to the Node instance
485/// * `available_width` - Available width
486/// * `available_height` - Available height
487/// * `viewport_width` - Viewport width
488/// * `viewport_height` - Viewport height
489/// * `containing_width` - Containing width
490/// * `containing_height` - Containing height
491///
492/// # Example
493///
494/// ```c
495/// NodeCalculateLayoutWithContainingSize(node, available_width, available_height, viewport_width, viewport_height, containing_width, containing_height);
496/// ```
497#[no_mangle]
498pub unsafe extern "C" fn NodeCalculateLayoutWithContainingSize(
499 node: NodePtr,
500 available_width: f32,
501 available_height: f32,
502 viewport_width: f32,
503 viewport_height: f32,
504 containing_width: f32,
505 containing_height: f32,
506) {
507 let node = &*(node as *mut Node);
508 let available_width = if available_width.is_finite() {
509 OptionNum::some(Len::from_f32(available_width))
510 } else {
511 crate::node::OptionNum::none()
512 };
513 let available_height = if available_height.is_finite() {
514 OptionNum::some(Len::from_f32(available_height))
515 } else {
516 crate::node::OptionNum::none()
517 };
518 let containing_width = if containing_width.is_finite() {
519 OptionNum::some(Len::from_f32(containing_width))
520 } else {
521 crate::node::OptionNum::none()
522 };
523 let containing_height = if containing_height.is_finite() {
524 OptionNum::some(Len::from_f32(containing_height))
525 } else {
526 crate::node::OptionNum::none()
527 };
528 node.layout_with_containing_size(
529 crate::node::OptionSize::new(available_width, available_height),
530 crate::node::Size::new(
531 Len::from_f32(viewport_width),
532 Len::from_f32(viewport_height),
533 ),
534 crate::node::OptionSize::new(containing_width, containing_height),
535 );
536}
537
538/// # Safety
539///
540/// Calculate the dry layout of a node instance with a containing size.
541///
542/// # Arguments
543/// * `node` - Raw pointer to the Node instance
544/// * `available_width` - Available width
545/// * `available_height` - Available height
546/// * `viewport_width` - Viewport width
547/// * `viewport_height` - Viewport height
548/// * `containing_width` - Containing width
549/// * `containing_height` - Containing height
550///
551/// # Example
552///
553/// ```c
554/// NodeCalculateDryLayoutWithContainingSize(node, available_width, available_height, viewport_width, viewport_height, containing_width, containing_height);
555/// ```
556#[no_mangle]
557pub unsafe extern "C" fn NodeCalculateDryLayoutWithContainingSize(
558 node: NodePtr,
559 available_width: f32,
560 available_height: f32,
561 viewport_width: f32,
562 viewport_height: f32,
563 containing_width: f32,
564 containing_height: f32,
565) {
566 let node = &*(node as *mut Node);
567 let available_width = if available_width.is_finite() {
568 OptionNum::some(Len::from_f32(available_width))
569 } else {
570 crate::node::OptionNum::none()
571 };
572 let available_height = if available_height.is_finite() {
573 OptionNum::some(Len::from_f32(available_height))
574 } else {
575 crate::node::OptionNum::none()
576 };
577 let containing_width = if containing_width.is_finite() {
578 OptionNum::some(Len::from_f32(containing_width))
579 } else {
580 crate::node::OptionNum::none()
581 };
582 let containing_height = if containing_height.is_finite() {
583 OptionNum::some(Len::from_f32(containing_height))
584 } else {
585 crate::node::OptionNum::none()
586 };
587 node.layout_with_containing_size(
588 crate::node::OptionSize::new(available_width, available_height),
589 crate::node::Size::new(
590 Len::from_f32(viewport_width),
591 Len::from_f32(viewport_height),
592 ),
593 crate::node::OptionSize::new(containing_width, containing_height),
594 );
595}
596
597/// # Safety
598///
599/// Mark a node instance as dirty.
600///
601/// # Arguments
602/// * `node` - Raw pointer to the Node instance
603///
604/// # Example
605///
606/// ```c
607/// NodeMarkDirty(node);
608/// ```
609#[no_mangle]
610pub unsafe extern "C" fn NodeMarkDirty(node: NodePtr) {
611 let node = &*(node as *mut Node);
612 node.mark_dirty_propagate()
613}
614
615/// # Safety
616///
617/// Mark a node instance as dirty and propagate the dirty state to its descendants.
618///
619/// # Arguments
620/// * `node` - Raw pointer to the Node instance
621///
622/// # Example
623///
624/// ```c
625/// NodeMarkDirtyAndPropagateToDescendants(node);
626/// ```
627#[no_mangle]
628pub unsafe extern "C" fn NodeMarkDirtyAndPropagateToDescendants(node: NodePtr) {
629 let node = &*(node as *mut Node);
630 node.mark_dirty_propagate_to_descendants()
631}
632
633/// # Safety
634///
635/// Set the resolve calc function for a node instance.
636///
637/// # Arguments
638/// * `node` - Raw pointer to the Node instance
639/// * `resolve_calc` - Resolve calc function
640///
641/// # Example
642///
643/// ```c
644/// NodeSetResolveCalc(node, resolve_calc);
645/// ```
646#[no_mangle]
647pub unsafe extern "C" fn NodeSetResolveCalc(node: NodePtr, resolve_calc: ResolveCalc) {
648 let node = &*(node as *mut Node);
649 node.set_resolve_calc(Some(Box::new(move |handle: i32, parent: Len| -> Len {
650 let parent_f32 = parent.to_f32();
651 let ret = resolve_calc(handle, parent_f32);
652 Len::from_f32(ret)
653 })));
654}
655
656pub(crate) fn convert_len_max_to_infinity(v: Len) -> f32 {
657 if v == Len::MAX {
658 f32::INFINITY
659 } else {
660 v.to_f32()
661 }
662}
663
664/// # Safety
665///
666/// Set the measure function for a node instance.
667///
668/// # Arguments
669/// * `node` - Raw pointer to the Node instance
670/// * `measure_func` - Measure function
671///
672/// # Example
673///
674/// ```c
675/// NodeSetMeasureFunc(node, measure_func);
676/// ```
677#[no_mangle]
678pub unsafe extern "C" fn NodeSetMeasureFunc(node: NodePtr, measure_func: MeasureFunc) {
679 let node = &*(node as *mut Node);
680 node.set_measure_func(Some(Box::new(
681 move |node: *mut Node,
682 max_width: crate::node::MeasureMaxWidth,
683 width_mode: MeasureMode,
684 max_height: crate::node::MeasureMaxHeight,
685 height_mode: MeasureMode,
686 min_width: crate::node::MeasureMinWidth,
687 min_height: crate::node::MeasureMinHeight,
688 max_content_width: crate::node::MeasureMaxContentWidth,
689 max_content_height: crate::node::MeasureMaxContentHeight|
690 -> crate::node::Size<Len> {
691 measure_func(
692 node as NodePtr,
693 convert_len_max_to_infinity(max_width),
694 width_mode,
695 convert_len_max_to_infinity(max_height),
696 height_mode,
697 min_width.to_f32(),
698 min_height.to_f32(),
699 convert_len_max_to_infinity(max_content_width),
700 convert_len_max_to_infinity(max_content_height),
701 )
702 .into()
703 },
704 )));
705}
706
707/// # Safety
708///
709/// Clear the measure function for a node instance.
710///
711/// # Arguments
712/// * `node` - Raw pointer to the Node instance
713///
714/// # Example
715///
716/// ```c
717/// NodeClearMeasureFunc(node);
718/// ```
719#[no_mangle]
720pub unsafe extern "C" fn NodeClearMeasureFunc(node: NodePtr) {
721 let node = &*(node as *mut Node);
722 node.set_measure_func(None);
723}
724
725/// # Safety
726///
727/// Check if a node instance has a measure function.
728///
729/// # Arguments
730/// * `node` - Raw pointer to the Node instance
731///
732/// # Returns
733/// * `bool` - True if the node has a measure function, false otherwise
734///
735/// # Example
736///
737/// ```c
738/// NodeHasMeasureFunc(node);
739/// ```
740#[no_mangle]
741pub unsafe extern "C" fn NodeHasMeasureFunc(node: NodePtr) -> bool {
742 let node = &*(node as *mut Node);
743 node.has_measure_func()
744}
745
746/// # Safety
747///
748/// Set the baseline function for a node instance.
749///
750/// # Arguments
751/// * `node` - Raw pointer to the Node instance
752/// * `baseline_func` - Baseline function
753///
754/// # Example
755///
756/// ```c
757/// NodeSetBaselineFunc(node, baseline_func);
758/// ```
759#[no_mangle]
760pub unsafe extern "C" fn NodeSetBaselineFunc(node: NodePtr, baseline_func: BaselineFunc) {
761 let node = &*(node as *mut Node);
762 node.set_baseline_func(Some(Box::new(
763 move |node: *mut Node, width: Len, height: Len| -> Len {
764 Len::from_f32(baseline_func(
765 node as NodePtr,
766 width.to_f32(),
767 height.to_f32(),
768 ))
769 },
770 )));
771}
772
773/// # Safety
774///
775/// Clear the measure cache for a node instance.
776///
777/// # Arguments
778/// * `node` - Raw pointer to the Node instance
779///
780/// # Example
781///
782/// ```c
783/// NodeClearMeasureCache(node);
784/// ```
785#[no_mangle]
786pub unsafe extern "C" fn NodeClearMeasureCache(node: NodePtr) {
787 let node: &Node = &*(node as *mut Node);
788 node.clear_measure_cache();
789 node.clear_baseline_cache();
790}
791
792/// # Safety
793///
794/// Set the dirty callback for a node instance.
795///
796/// # Arguments
797/// * `node` - Raw pointer to the Node instance
798/// * `dirty_cb` - Dirty callback
799///
800/// # Example
801///
802/// ```c
803/// NodeSetDirtyCallback(node, dirty_cb);
804/// ```
805#[no_mangle]
806pub unsafe extern "C" fn NodeSetDirtyCallback(node: NodePtr, dirty_cb: DirtyCallback) {
807 let node = &*(node as *mut Node);
808 node.set_dirty_callback(Some(Box::new(move |node: *mut Node| {
809 dirty_cb(node as NodePtr)
810 })))
811}
812
813/// # Safety
814///
815/// Clear the dirty callback for a node instance.
816///
817/// # Arguments
818/// * `node` - Raw pointer to the Node instance
819///
820/// # Example
821///
822/// ```c
823/// NodeClearDirtyCallback(node);
824/// ```
825#[no_mangle]
826pub unsafe extern "C" fn NodeClearDirtyCallback(node: NodePtr) {
827 let node = &*(node as *mut Node);
828 node.set_dirty_callback(None);
829}
830
831/// # Safety
832///
833/// Check if a node instance is dirty.
834///
835/// # Arguments
836/// * `node` - Raw pointer to the Node instance
837///
838/// # Returns
839/// * `bool` - True if the node is dirty, false otherwise
840///
841/// # Example
842///
843/// ```c
844/// NodeIsDirty(node);
845/// ```
846#[no_mangle]
847pub unsafe extern "C" fn NodeIsDirty(node: NodePtr) -> bool {
848 let node = &*(node as *mut Node);
849 node.is_dirty()
850}
851
852/// # Safety
853///
854/// Get the flex direction of a node instance.
855///
856/// # Arguments
857/// * `node` - Raw pointer to the Node instance
858///
859/// # Returns
860/// * `FlexDirectionType` - Flex direction type
861///
862/// # Example
863///
864/// ```c
865/// NodeStyleGetFlexDirection(node);
866/// ```
867#[no_mangle]
868pub unsafe extern "C" fn NodeStyleGetFlexDirection(node: NodePtr) -> FlexDirectionType {
869 let node = &*(node as *mut Node);
870 node.style_manager().flex_direction().into()
871}
872
873/// # Safety
874///
875/// Set the display of a node instance.
876///
877/// # Arguments
878/// * `node` - Raw pointer to the Node instance
879/// * `value` - Display type
880///
881/// # Example
882///
883/// ```c
884/// NodeStyleSetDisplay(node, value);
885/// ```
886#[no_mangle]
887pub unsafe extern "C" fn NodeStyleSetDisplay(node: NodePtr, value: DisplayType) {
888 let node = &*(node as *mut Node);
889 if let Some(value) = value.to_inner_without_global() {
890 node.set_display(value);
891 }
892}
893
894/// # Safety
895///
896/// Set the box sizing of a node instance.
897///
898/// # Arguments
899/// * `node` - Raw pointer to the Node instance
900/// * `value` - Box sizing type
901///
902/// # Example
903///
904/// ```c
905/// NodeStyleSetBoxSizing(node, value);
906/// ```
907#[no_mangle]
908pub unsafe extern "C" fn NodeStyleSetBoxSizing(node: NodePtr, value: BoxSizingType) {
909 let node = &*(node as *mut Node);
910 if let Some(value) = value.to_inner_without_global() {
911 node.set_box_sizing(value);
912 }
913}
914
915/// # Safety
916///
917/// Set the writing mode of a node instance.
918///
919/// # Arguments
920/// * `node` - Raw pointer to the Node instance
921/// * `value` - Writing mode type
922///
923/// # Example
924///
925/// ```c
926/// NodeStyleSetWritingMode(node, value);
927/// ```
928#[no_mangle]
929pub unsafe extern "C" fn NodeStyleSetWritingMode(node: NodePtr, value: WritingModeType) {
930 let node = &*(node as *mut Node);
931 if let Some(value) = value.to_inner_without_global() {
932 node.set_writing_mode(value);
933 }
934}
935
936/// # Safety
937///
938/// Set the position of a node instance.
939///
940/// # Arguments
941/// * `node` - Raw pointer to the Node instance
942/// * `value` - Position type
943///
944/// # Example
945///
946/// ```c
947/// NodeStyleSetPosition(node, value);
948/// ```
949#[no_mangle]
950pub unsafe extern "C" fn NodeStyleSetPosition(node: NodePtr, value: PositionType) {
951 let node = &*(node as *mut Node);
952 if let Some(value) = value.to_inner_without_global() {
953 node.set_position(value);
954 }
955}
956
957/// # Safety
958///
959/// Set the left of a node instance.
960///
961/// # Arguments
962/// * `node` - Raw pointer to the Node instance
963/// * `value` - Left type
964///
965/// # Example
966///
967/// ```c
968/// NodeStyleSetLeft(node, value);
969/// ```
970#[no_mangle]
971pub unsafe extern "C" fn NodeStyleSetLeft(node: NodePtr, value: f32) {
972 let node = &*(node as *mut Node);
973 node.set_left(DefLength::Points(Len::from_f32(value)));
974}
975/// # Safety
976///
977/// Set the left of a node instance to undefined.
978///
979/// # Arguments
980/// * `node` - Raw pointer to the Node instance
981///
982/// # Example
983///
984/// ```c
985/// NodeStyleSetLeftNone(node);
986/// ```
987#[no_mangle]
988pub unsafe extern "C" fn NodeStyleSetLeftNone(node: NodePtr) {
989 let node = &*(node as *mut Node);
990 node.set_left(DefLength::Undefined);
991}
992/// # Safety
993///
994/// Set the left of a node instance to a percentage.
995///
996/// # Arguments
997/// * `node` - Raw pointer to the Node instance
998/// * `value` - Percentage
999///
1000/// # Example
1001///
1002/// ```c
1003/// NodeStyleSetLeftPercentage(node, value);
1004/// ```
1005#[no_mangle]
1006pub unsafe extern "C" fn NodeStyleSetLeftPercentage(node: NodePtr, value: f32) {
1007 let node = &*(node as *mut Node);
1008 node.set_left(DefLength::Percent(value));
1009}
1010
1011/// # Safety
1012///
1013/// Set the left of a node instance to auto.
1014///
1015/// # Arguments
1016/// * `node` - Raw pointer to the Node instance
1017///
1018/// # Example
1019///
1020/// ```c
1021/// NodeStyleSetLeftAuto(node);
1022/// ```
1023#[no_mangle]
1024pub unsafe extern "C" fn NodeStyleSetLeftAuto(node: NodePtr) {
1025 let node = &*(node as *mut Node);
1026 node.set_left(DefLength::Auto);
1027}
1028/// # Safety
1029///
1030/// Set the left of a node instance to a calc handle.
1031///
1032/// # Arguments
1033/// * `node` - Raw pointer to the Node instance
1034/// * `calc_handle` - Calc handle
1035///
1036/// # Example
1037///
1038/// ```c
1039/// NodeStyleSetLeftCalcHandle(node, calc_handle);
1040/// ```
1041#[no_mangle]
1042pub unsafe extern "C" fn NodeStyleSetLeftCalcHandle(node: NodePtr, calc_handle: i32) {
1043 let node = &*(node as *mut Node);
1044 node.set_left(DefLength::Custom(calc_handle));
1045}
1046
1047/// # Safety
1048///
1049/// Set the right of a node instance.
1050///
1051/// # Arguments
1052/// * `node` - Raw pointer to the Node instance
1053/// * `value` - Right type
1054///
1055/// # Example
1056///
1057/// ```c
1058/// NodeStyleSetRight(node, value);
1059/// ```
1060#[no_mangle]
1061pub unsafe extern "C" fn NodeStyleSetRight(node: NodePtr, value: f32) {
1062 let node = &*(node as *mut Node);
1063 node.set_right(DefLength::Points(Len::from_f32(value)));
1064}
1065/// # Safety
1066///
1067/// Set the right of a node instance to undefined.
1068///
1069/// # Arguments
1070/// * `node` - Raw pointer to the Node instance
1071///
1072/// # Example
1073///
1074/// ```c
1075/// NodeStyleSetRightNone(node);
1076/// ```
1077#[no_mangle]
1078pub unsafe extern "C" fn NodeStyleSetRightNone(node: NodePtr) {
1079 let node = &*(node as *mut Node);
1080 node.set_right(DefLength::Undefined);
1081}
1082/// # Safety
1083///
1084/// Set the right of a node instance to a percentage.
1085///
1086/// # Arguments
1087/// * `node` - Raw pointer to the Node instance
1088/// * `value` - Percentage
1089///
1090/// # Example
1091///
1092/// ```c
1093/// NodeStyleSetRightPercentage(node, value);
1094/// ```
1095#[no_mangle]
1096pub unsafe extern "C" fn NodeStyleSetRightPercentage(node: NodePtr, value: f32) {
1097 let node = &*(node as *mut Node);
1098 node.set_right(DefLength::Percent(value));
1099}
1100/// # Safety
1101///
1102/// Set the right of a node instance to auto.
1103///
1104/// # Arguments
1105/// * `node` - Raw pointer to the Node instance
1106///
1107/// # Example
1108///
1109/// ```c
1110/// NodeStyleSetRightAuto(node);
1111/// ```
1112#[no_mangle]
1113pub unsafe extern "C" fn NodeStyleSetRightAuto(node: NodePtr) {
1114 let node = &*(node as *mut Node);
1115 node.set_right(DefLength::Auto);
1116}
1117/// # Safety
1118///
1119/// Set the right of a node instance to a calc handle.
1120///
1121/// # Arguments
1122/// * `node` - Raw pointer to the Node instance
1123/// * `calc_handle` - Calc handle
1124///
1125/// # Example
1126///
1127/// ```c
1128/// NodeStyleSetRightCalcHandle(node, calc_handle);
1129/// ```
1130#[no_mangle]
1131pub unsafe extern "C" fn NodeStyleSetRightCalcHandle(node: NodePtr, calc_handle: i32) {
1132 let node = &*(node as *mut Node);
1133 node.set_right(DefLength::Custom(calc_handle));
1134}
1135/// # Safety
1136///
1137/// Set the top of a node instance.
1138///
1139/// # Arguments
1140/// * `node` - Raw pointer to the Node instance
1141/// * `value` - Top type
1142///
1143/// # Example
1144///
1145/// ```c
1146/// NodeStyleSetTop(node, value);
1147/// ```
1148#[no_mangle]
1149pub unsafe extern "C" fn NodeStyleSetTop(node: NodePtr, value: f32) {
1150 let node = &*(node as *mut Node);
1151 node.set_top(DefLength::Points(Len::from_f32(value)));
1152}
1153/// # Safety
1154///
1155/// Set the top of a node instance to undefined.
1156///
1157/// # Arguments
1158/// * `node` - Raw pointer to the Node instance
1159///
1160/// # Example
1161///
1162/// ```c
1163/// NodeStyleSetTopNone(node);
1164/// ```
1165#[no_mangle]
1166pub unsafe extern "C" fn NodeStyleSetTopNone(node: NodePtr) {
1167 let node = &*(node as *mut Node);
1168 node.set_top(DefLength::Undefined);
1169}
1170/// # Safety
1171///
1172/// Set the top of a node instance to a percentage.
1173///
1174/// # Arguments
1175/// * `node` - Raw pointer to the Node instance
1176/// * `value` - Percentage
1177///
1178/// # Example
1179///
1180/// ```c
1181/// NodeStyleSetTopPercentage(node, value);
1182/// ```
1183#[no_mangle]
1184pub unsafe extern "C" fn NodeStyleSetTopPercentage(node: NodePtr, value: f32) {
1185 let node = &*(node as *mut Node);
1186 node.set_top(DefLength::Percent(value));
1187}
1188/// # Safety
1189///
1190/// Set the top of a node instance to auto.
1191///
1192/// # Arguments
1193/// * `node` - Raw pointer to the Node instance
1194///
1195/// # Example
1196///
1197/// ```c
1198/// NodeStyleSetTopAuto(node);
1199/// ```
1200#[no_mangle]
1201pub unsafe extern "C" fn NodeStyleSetTopAuto(node: NodePtr) {
1202 let node = &*(node as *mut Node);
1203 node.set_top(DefLength::Auto);
1204}
1205/// # Safety
1206///
1207/// Set the top of a node instance to a calc handle.
1208///
1209/// # Arguments
1210/// * `node` - Raw pointer to the Node instance
1211/// * `calc_handle` - Calc handle
1212///
1213/// # Example
1214///
1215/// ```c
1216/// NodeStyleSetTopCalcHandle(node, calc_handle);
1217/// ```
1218#[no_mangle]
1219pub unsafe extern "C" fn NodeStyleSetTopCalcHandle(node: NodePtr, calc_handle: i32) {
1220 let node = &*(node as *mut Node);
1221 node.set_top(DefLength::Custom(calc_handle));
1222}
1223/// # Safety
1224///
1225/// Set the bottom of a node instance.
1226///
1227/// # Arguments
1228/// * `node` - Raw pointer to the Node instance
1229/// * `value` - Bottom type
1230///
1231/// # Example
1232///
1233/// ```c
1234/// NodeStyleSetBottom(node, value);
1235/// ```
1236#[no_mangle]
1237pub unsafe extern "C" fn NodeStyleSetBottom(node: NodePtr, value: f32) {
1238 let node = &*(node as *mut Node);
1239 node.set_bottom(DefLength::Points(Len::from_f32(value)));
1240}
1241/// # Safety
1242///
1243/// Set the bottom of a node instance to undefined.
1244///
1245/// # Arguments
1246/// * `node` - Raw pointer to the Node instance
1247///
1248/// # Example
1249///
1250/// ```c
1251/// NodeStyleSetBottomNone(node);
1252/// ```
1253#[no_mangle]
1254pub unsafe extern "C" fn NodeStyleSetBottomNone(node: NodePtr) {
1255 let node = &*(node as *mut Node);
1256 node.set_bottom(DefLength::Undefined);
1257}
1258/// # Safety
1259///
1260/// Set the bottom of a node instance to a percentage.
1261///
1262/// # Arguments
1263/// * `node` - Raw pointer to the Node instance
1264/// * `value` - Percentage
1265///
1266/// # Example
1267///
1268/// ```c
1269/// NodeStyleSetBottomPercentage(node, value);
1270/// ```
1271#[no_mangle]
1272pub unsafe extern "C" fn NodeStyleSetBottomPercentage(node: NodePtr, value: f32) {
1273 let node = &*(node as *mut Node);
1274 node.set_bottom(DefLength::Percent(value));
1275}
1276/// # Safety
1277///
1278/// Set the bottom of a node instance to auto.
1279///
1280/// # Arguments
1281/// * `node` - Raw pointer to the Node instance
1282///
1283/// # Example
1284///
1285/// ```c
1286/// NodeStyleSetBottomAuto(node);
1287/// ```
1288#[no_mangle]
1289pub unsafe extern "C" fn NodeStyleSetBottomAuto(node: NodePtr) {
1290 let node = &*(node as *mut Node);
1291 node.set_bottom(DefLength::Auto);
1292}
1293/// # Safety
1294///
1295/// Set the bottom of a node instance to a calc handle.
1296///
1297/// # Arguments
1298/// * `node` - Raw pointer to the Node instance
1299/// * `calc_handle` - Calc handle
1300///
1301/// # Example
1302///
1303/// ```c
1304/// NodeStyleSetBottomCalcHandle(node, calc_handle);
1305/// ```
1306#[no_mangle]
1307pub unsafe extern "C" fn NodeStyleSetBottomCalcHandle(node: NodePtr, calc_handle: i32) {
1308 let node = &*(node as *mut Node);
1309 node.set_bottom(DefLength::Custom(calc_handle));
1310}
1311
1312/// # Safety
1313///
1314/// Set the overflow of a node instance.
1315///
1316/// # Arguments
1317/// * `node` - Raw pointer to the Node instance
1318/// * `value` - Overflow type
1319///
1320/// # Example
1321///
1322/// ```c
1323/// NodeStyleSetOverflowX(node, value);
1324/// ```
1325#[no_mangle]
1326pub unsafe extern "C" fn NodeStyleSetOverflowX(node: NodePtr, value: OverflowType) {
1327 let node = &*(node as *mut Node);
1328 if let Some(value) = value.to_inner_without_global() {
1329 node.set_overflow_x(value);
1330 }
1331}
1332
1333/// # Safety
1334///
1335/// Set the overflow of a node instance.
1336///
1337/// # Arguments
1338/// * `node` - Raw pointer to the Node instance
1339/// * `value` - Overflow type
1340///
1341/// # Example
1342///
1343/// ```c
1344/// NodeStyleSetOverflowY(node, value);
1345/// ```
1346#[no_mangle]
1347pub unsafe extern "C" fn NodeStyleSetOverflowY(node: NodePtr, value: OverflowType) {
1348 let node = &*(node as *mut Node);
1349 if let Some(value) = value.to_inner_without_global() {
1350 node.set_overflow_y(value);
1351 }
1352}
1353
1354/// # Safety
1355///
1356/// Set the width of a node instance.
1357///
1358/// # Arguments
1359/// * `node` - Raw pointer to the Node instance
1360/// * `value` - Width type
1361///
1362/// # Example
1363///
1364/// ```c
1365///
1366///
1367#[no_mangle]
1368pub unsafe extern "C" fn NodeStyleSetWidth(node: NodePtr, value: f32) {
1369 let node = &*(node as *mut Node);
1370 node.set_width(DefLength::Points(Len::from_f32(value)));
1371}
1372/// # Safety
1373///
1374/// Set the width of a node instance to undefined.
1375///
1376/// # Arguments
1377/// * `node` - Raw pointer to the Node instance
1378///
1379/// # Example
1380///
1381/// ```c
1382/// NodeStyleSetWidthNone(node);
1383/// ```
1384#[no_mangle]
1385pub unsafe extern "C" fn NodeStyleSetWidthNone(node: NodePtr) {
1386 let node = &*(node as *mut Node);
1387 node.set_width(DefLength::Undefined);
1388}
1389
1390/// # Safety
1391///
1392/// Set the width of a node instance to a percentage.
1393///
1394/// # Arguments
1395/// * `node` - Raw pointer to the Node instance
1396/// * `value` - Percentage
1397///
1398/// # Example
1399///
1400/// ```c
1401/// NodeStyleSetWidthPercentage(node, value);
1402/// ```
1403#[no_mangle]
1404pub unsafe extern "C" fn NodeStyleSetWidthPercentage(node: NodePtr, value: f32) {
1405 let node = &*(node as *mut Node);
1406 node.set_width(DefLength::Percent(value));
1407}
1408/// # Safety
1409///
1410/// Set the width of a node instance to auto.
1411///
1412/// # Arguments
1413/// * `node` - Raw pointer to the Node instance
1414///
1415/// # Example
1416///
1417/// ```c
1418/// NodeStyleSetWidthAuto(node);
1419/// ```
1420#[no_mangle]
1421pub unsafe extern "C" fn NodeStyleSetWidthAuto(node: NodePtr) {
1422 let node = &*(node as *mut Node);
1423 node.set_width(DefLength::Auto);
1424}
1425/// # Safety
1426///
1427/// Set the width of a node instance to a calc handle.
1428///
1429/// # Arguments
1430/// * `node` - Raw pointer to the Node instance
1431/// * `calc_handle` - Calc handle
1432///
1433/// # Example
1434///
1435/// ```c
1436/// NodeStyleSetWidthCalcHandle(node, calc_handle);
1437/// ```
1438#[no_mangle]
1439pub unsafe extern "C" fn NodeStyleSetWidthCalcHandle(node: NodePtr, calc_handle: i32) {
1440 let node = &*(node as *mut Node);
1441 node.set_width(DefLength::Custom(calc_handle));
1442}
1443
1444/// # Safety
1445///
1446/// Set the height of a node instance.
1447///
1448/// # Arguments
1449/// * `node` - Raw pointer to the Node instance
1450/// * `value` - Height type
1451///
1452/// # Example
1453///
1454/// ```c
1455/// NodeStyleSetHeight(node, value);
1456/// ```
1457#[no_mangle]
1458pub unsafe extern "C" fn NodeStyleSetHeight(node: NodePtr, value: f32) {
1459 let node = &*(node as *mut Node);
1460 node.set_height(DefLength::Points(Len::from_f32(value)));
1461}
1462
1463/// # Safety
1464///
1465/// Set the height of a node instance to undefined.
1466///
1467/// # Arguments
1468/// * `node` - Raw pointer to the Node instance
1469///
1470/// # Example
1471///
1472/// ```c
1473/// NodeStyleSetHeightNone(node);
1474/// ```
1475#[no_mangle]
1476pub unsafe extern "C" fn NodeStyleSetHeightNone(node: NodePtr) {
1477 let node = &*(node as *mut Node);
1478 node.set_height(DefLength::Undefined);
1479}
1480/// # Safety
1481///
1482/// Set the height of a node instance to a percentage.
1483///
1484/// # Arguments
1485/// * `node` - Raw pointer to the Node instance
1486/// * `value` - Percentage
1487///
1488/// # Example
1489///
1490/// ```c
1491/// NodeStyleSetHeightPercentage(node, value);
1492/// ```
1493#[no_mangle]
1494pub unsafe extern "C" fn NodeStyleSetHeightPercentage(node: NodePtr, value: f32) {
1495 let node = &*(node as *mut Node);
1496 node.set_height(DefLength::Percent(value));
1497}
1498/// # Safety
1499///
1500/// Set the height of a node instance to auto.
1501///
1502/// # Arguments
1503/// * `node` - Raw pointer to the Node instance
1504///
1505/// # Example
1506///
1507/// ```c
1508/// NodeStyleSetHeightAuto(node);
1509/// ```
1510#[no_mangle]
1511pub unsafe extern "C" fn NodeStyleSetHeightAuto(node: NodePtr) {
1512 let node = &*(node as *mut Node);
1513 node.set_height(DefLength::Auto);
1514}
1515/// # Safety
1516///
1517/// Set the height of a node instance to a calc handle.
1518///
1519/// # Arguments
1520/// * `node` - Raw pointer to the Node instance
1521/// * `calc_handle` - Calc handle
1522///
1523/// # Example
1524///
1525/// ```c
1526/// NodeStyleSetHeightCalcHandle(node, calc_handle);
1527/// ```
1528#[no_mangle]
1529pub unsafe extern "C" fn NodeStyleSetHeightCalcHandle(node: NodePtr, calc_handle: i32) {
1530 let node = &*(node as *mut Node);
1531 node.set_height(DefLength::Custom(calc_handle));
1532}
1533/// # Safety
1534///
1535/// Set the min width of a node instance.
1536///
1537/// # Arguments
1538/// * `node` - Raw pointer to the Node instance
1539/// * `value` - Min width type
1540///
1541/// # Example
1542///
1543/// ```c
1544/// NodeStyleSetMinWidth(node, value);
1545/// ```
1546#[no_mangle]
1547pub unsafe extern "C" fn NodeStyleSetMinWidth(node: NodePtr, value: f32) {
1548 let node = &*(node as *mut Node);
1549 node.set_min_width(DefLength::Points(Len::from_f32(value)));
1550}
1551/// # Safety
1552///
1553/// Set the min width of a node instance to undefined.
1554///
1555/// # Arguments
1556/// * `node` - Raw pointer to the Node instance
1557///
1558/// # Example
1559///
1560/// ```c
1561/// NodeStyleSetMinWidthNone(node);
1562/// ```
1563#[no_mangle]
1564pub unsafe extern "C" fn NodeStyleSetMinWidthNone(node: NodePtr) {
1565 let node = &*(node as *mut Node);
1566 node.set_min_width(DefLength::Undefined);
1567}
1568/// # Safety
1569///
1570/// Set the min width of a node instance to a percentage.
1571///
1572/// # Arguments
1573/// * `node` - Raw pointer to the Node instance
1574/// * `value` - Percentage
1575///
1576/// # Example
1577///
1578/// ```c
1579/// NodeStyleSetMinWidthPercentage(node, value);
1580/// ```
1581#[no_mangle]
1582pub unsafe extern "C" fn NodeStyleSetMinWidthPercentage(node: NodePtr, value: f32) {
1583 let node = &*(node as *mut Node);
1584 node.set_min_width(DefLength::Percent(value));
1585}
1586/// # Safety
1587///
1588/// Set the min width of a node instance to auto.
1589///
1590/// # Arguments
1591/// * `node` - Raw pointer to the Node instance
1592///
1593/// # Example
1594///
1595/// ```c
1596/// NodeStyleSetMinWidthAuto(node);
1597/// ```
1598#[no_mangle]
1599pub unsafe extern "C" fn NodeStyleSetMinWidthAuto(node: NodePtr) {
1600 let node = &*(node as *mut Node);
1601 node.set_min_width(DefLength::Auto);
1602}
1603/// # Safety
1604///
1605///
1606/// # Arguments
1607/// * `node` - Raw pointer to the Node instance
1608/// * `calc_handle` - Calc handle
1609///
1610/// # Example
1611///
1612/// ```c
1613/// NodeStyleSetMinWidthCalcHandle(node, calc_handle);
1614/// ```
1615#[no_mangle]
1616pub unsafe extern "C" fn NodeStyleSetMinWidthCalcHandle(node: NodePtr, calc_handle: i32) {
1617 let node = &*(node as *mut Node);
1618 node.set_min_width(DefLength::Custom(calc_handle));
1619}
1620
1621/// # Safety
1622///
1623/// Set the min height of a node instance.
1624///
1625/// # Arguments
1626/// * `node` - Raw pointer to the Node instance
1627/// * `value` - Min height type
1628///
1629/// # Example
1630///
1631/// ```c
1632/// NodeStyleSetMinHeight(node, value);
1633/// ```
1634#[no_mangle]
1635pub unsafe extern "C" fn NodeStyleSetMinHeight(node: NodePtr, value: f32) {
1636 let node = &*(node as *mut Node);
1637 node.set_min_height(DefLength::Points(Len::from_f32(value)));
1638}
1639/// # Safety
1640///
1641/// Set the min height of a node instance to undefined.
1642///
1643/// # Arguments
1644/// * `node` - Raw pointer to the Node instance
1645///
1646/// # Example
1647///
1648/// ```c
1649/// NodeStyleSetMinHeightNone(node);
1650/// ```
1651#[no_mangle]
1652pub unsafe extern "C" fn NodeStyleSetMinHeightNone(node: NodePtr) {
1653 let node = &*(node as *mut Node);
1654 node.set_min_height(DefLength::Undefined);
1655}
1656/// # Safety
1657///
1658/// Set the min height of a node instance to a percentage.
1659///
1660/// # Arguments
1661/// * `node` - Raw pointer to the Node instance
1662/// * `value` - Percentage
1663///
1664/// # Example
1665///
1666/// ```c
1667/// NodeStyleSetMinHeightPercentage(node, value);
1668/// ```
1669#[no_mangle]
1670pub unsafe extern "C" fn NodeStyleSetMinHeightPercentage(node: NodePtr, value: f32) {
1671 let node = &*(node as *mut Node);
1672 node.set_min_height(DefLength::Percent(value));
1673}
1674/// # Safety
1675///
1676/// Set the min height of a node instance to auto.
1677///
1678/// # Arguments
1679/// * `node` - Raw pointer to the Node instance
1680///
1681/// # Example
1682///
1683/// ```c
1684/// NodeStyleSetMinHeightAuto(node);
1685/// ```
1686#[no_mangle]
1687pub unsafe extern "C" fn NodeStyleSetMinHeightAuto(node: NodePtr) {
1688 let node = &*(node as *mut Node);
1689 node.set_min_height(DefLength::Auto);
1690}
1691/// # Safety
1692///
1693/// Set the min height of a node instance to a calc handle.
1694///
1695/// # Arguments
1696/// * `node` - Raw pointer to the Node instance
1697/// * `calc_handle` - Calc handle
1698///
1699/// # Example
1700///
1701/// ```c
1702/// NodeStyleSetMinHeightCalcHandle(node, calc_handle);
1703/// ```
1704#[no_mangle]
1705pub unsafe extern "C" fn NodeStyleSetMinHeightCalcHandle(node: NodePtr, calc_handle: i32) {
1706 let node = &*(node as *mut Node);
1707 node.set_min_height(DefLength::Custom(calc_handle));
1708}
1709
1710/// # Safety
1711///
1712/// Set the max width of a node instance.
1713///
1714/// # Arguments
1715/// * `node` - Raw pointer to the Node instance
1716/// * `value` - Max width type
1717///
1718/// # Example
1719///
1720/// ```c
1721/// NodeStyleSetMaxWidth(node, value);
1722/// ```
1723#[no_mangle]
1724pub unsafe extern "C" fn NodeStyleSetMaxWidth(node: NodePtr, value: f32) {
1725 let node = &*(node as *mut Node);
1726 node.set_max_width(DefLength::Points(Len::from_f32(value)));
1727}
1728/// # Safety
1729///
1730/// Set the max width of a node instance to undefined.
1731///
1732/// # Arguments
1733/// * `node` - Raw pointer to the Node instance
1734///
1735/// # Example
1736///
1737/// ```c
1738/// NodeStyleSetMaxWidthNone(node);
1739/// ```
1740#[no_mangle]
1741pub unsafe extern "C" fn NodeStyleSetMaxWidthNone(node: NodePtr) {
1742 let node = &*(node as *mut Node);
1743 node.set_max_width(DefLength::Undefined);
1744}
1745/// # Safety
1746///
1747/// Set the max width of a node instance to a percentage.
1748///
1749/// # Arguments
1750/// * `node` - Raw pointer to the Node instance
1751/// * `value` - Percentage
1752///
1753/// # Example
1754///
1755/// ```c
1756/// NodeStyleSetMaxWidthPercentage(node, value);
1757/// ```
1758#[no_mangle]
1759pub unsafe extern "C" fn NodeStyleSetMaxWidthPercentage(node: NodePtr, value: f32) {
1760 let node = &*(node as *mut Node);
1761 node.set_max_width(DefLength::Percent(value));
1762}
1763/// # Safety
1764///
1765/// Set the max width of a node instance to auto.
1766///
1767/// # Arguments
1768/// * `node` - Raw pointer to the Node instance
1769///
1770/// # Example
1771///
1772/// ```c
1773/// NodeStyleSetMaxWidthAuto(node);
1774/// ```
1775#[no_mangle]
1776pub unsafe extern "C" fn NodeStyleSetMaxWidthAuto(node: NodePtr) {
1777 let node = &*(node as *mut Node);
1778 node.set_max_width(DefLength::Auto);
1779}
1780/// # Safety
1781///
1782/// Set the max width of a node instance to a calc handle.
1783///
1784/// # Arguments
1785/// * `node` - Raw pointer to the Node instance
1786/// * `calc_handle` - Calc handle
1787///
1788/// # Example
1789///
1790/// ```c
1791/// NodeStyleSetMaxWidthCalcHandle(node, calc_handle);
1792/// ```
1793#[no_mangle]
1794pub unsafe extern "C" fn NodeStyleSetMaxWidthCalcHandle(node: NodePtr, calc_handle: i32) {
1795 let node = &*(node as *mut Node);
1796 node.set_max_width(DefLength::Custom(calc_handle));
1797}
1798
1799/// # Safety
1800///
1801/// Set the max height of a node instance.
1802///
1803/// # Arguments
1804/// * `node` - Raw pointer to the Node instance
1805/// * `value` - Max height type
1806///
1807/// # Example
1808///
1809/// ```c
1810/// NodeStyleSetMaxHeight(node, value);
1811/// ```
1812#[no_mangle]
1813pub unsafe extern "C" fn NodeStyleSetMaxHeight(node: NodePtr, value: f32) {
1814 let node = &*(node as *mut Node);
1815 node.set_max_height(DefLength::Points(Len::from_f32(value)));
1816}
1817/// # Safety
1818///
1819/// Set the max height of a node instance to undefined.
1820///
1821/// # Arguments
1822/// * `node` - Raw pointer to the Node instance
1823///
1824/// # Example
1825///
1826/// ```c
1827/// NodeStyleSetMaxHeightNone(node);
1828/// ```
1829#[no_mangle]
1830pub unsafe extern "C" fn NodeStyleSetMaxHeightNone(node: NodePtr) {
1831 let node = &*(node as *mut Node);
1832 node.set_max_height(DefLength::Undefined);
1833}
1834/// # Safety
1835///
1836/// Set the max height of a node instance to a percentage.
1837///
1838/// # Arguments
1839/// * `node` - Raw pointer to the Node instance
1840/// * `value` - Percentage
1841///
1842/// # Example
1843///
1844/// ```c
1845/// NodeStyleSetMaxHeightPercentage(node, value);
1846/// ```
1847#[no_mangle]
1848pub unsafe extern "C" fn NodeStyleSetMaxHeightPercentage(node: NodePtr, value: f32) {
1849 let node = &*(node as *mut Node);
1850 node.set_max_height(DefLength::Percent(value));
1851}
1852/// # Safety
1853///
1854/// Set the max height of a node instance to auto.
1855///
1856/// # Arguments
1857/// * `node` - Raw pointer to the Node instance
1858///
1859/// # Example
1860///
1861/// ```c
1862/// NodeStyleSetMaxHeightAuto(node);
1863/// ```
1864#[no_mangle]
1865pub unsafe extern "C" fn NodeStyleSetMaxHeightAuto(node: NodePtr) {
1866 let node = &*(node as *mut Node);
1867 node.set_max_height(DefLength::Auto);
1868}
1869/// # Safety
1870///
1871/// Set the max height of a node instance to a calc handle.
1872///
1873/// # Arguments
1874/// * `node` - Raw pointer to the Node instance
1875/// * `calc_handle` - Calc handle
1876///
1877/// # Example
1878///
1879/// ```c
1880/// NodeStyleSetMaxHeightCalcHandle(node, calc_handle);
1881/// ```
1882#[no_mangle]
1883pub unsafe extern "C" fn NodeStyleSetMaxHeightCalcHandle(node: NodePtr, calc_handle: i32) {
1884 let node = &*(node as *mut Node);
1885 node.set_max_height(DefLength::Custom(calc_handle));
1886}
1887
1888/// # Safety
1889///
1890/// Set the margin left of a node instance.
1891///
1892/// # Arguments
1893/// * `node` - Raw pointer to the Node instance
1894/// * `value` - Margin left type
1895///
1896/// # Example
1897///
1898/// ```c
1899/// NodeStyleSetMarginLeft(node, value);
1900#[no_mangle]
1901pub unsafe extern "C" fn NodeStyleSetMarginLeft(node: NodePtr, value: f32) {
1902 let node = &*(node as *mut Node);
1903 node.set_margin_left(DefLength::Points(Len::from_f32(value)));
1904}
1905
1906/// # Safety
1907///
1908/// Set the margin left of a node instance to undefined.
1909///
1910/// # Arguments
1911/// * `node` - Raw pointer to the Node instance
1912///
1913/// # Example
1914///
1915/// ```c
1916/// NodeStyleSetMarginLeftNone(node);
1917/// ```
1918#[no_mangle]
1919pub unsafe extern "C" fn NodeStyleSetMarginLeftNone(node: NodePtr) {
1920 let node = &*(node as *mut Node);
1921 node.set_margin_left(DefLength::Undefined);
1922}
1923/// # Safety
1924///
1925/// Set the margin left of a node instance to a percentage.
1926///
1927/// # Arguments
1928/// * `node` - Raw pointer to the Node instance
1929/// * `value` - Percentage
1930///
1931/// # Example
1932///
1933/// ```c
1934/// NodeStyleSetMarginLeftPercentage(node, value);
1935/// ```
1936#[no_mangle]
1937pub unsafe extern "C" fn NodeStyleSetMarginLeftPercentage(node: NodePtr, value: f32) {
1938 let node = &*(node as *mut Node);
1939 node.set_margin_left(DefLength::Percent(value));
1940}
1941/// # Safety
1942///
1943/// Set the margin left of a node instance to auto.
1944///
1945/// # Arguments
1946/// * `node` - Raw pointer to the Node instance
1947///
1948/// # Example
1949///
1950/// ```c
1951/// NodeStyleSetMarginLeftAuto(node);
1952/// ```
1953#[no_mangle]
1954pub unsafe extern "C" fn NodeStyleSetMarginLeftAuto(node: NodePtr) {
1955 let node = &*(node as *mut Node);
1956 node.set_margin_left(DefLength::Auto);
1957}
1958/// # Safety
1959///
1960/// Set the margin left of a node instance to a calc handle.
1961///
1962/// # Arguments
1963/// * `node` - Raw pointer to the Node instance
1964/// * `calc_handle` - Calc handle
1965///
1966/// # Example
1967///
1968/// ```c
1969/// NodeStyleSetMarginLeftCalcHandle(node, calc_handle);
1970/// ```
1971#[no_mangle]
1972pub unsafe extern "C" fn NodeStyleSetMarginLeftCalcHandle(node: NodePtr, calc_handle: i32) {
1973 let node = &*(node as *mut Node);
1974 node.set_margin_left(DefLength::Custom(calc_handle));
1975}
1976
1977/// # Safety
1978///
1979/// Set the margin right of a node instance.
1980///
1981/// # Arguments
1982/// * `node` - Raw pointer to the Node instance
1983/// * `value` - Margin right type
1984///
1985/// # Example
1986///
1987/// ```c
1988/// NodeStyleSetMarginRight(node, value);
1989#[no_mangle]
1990pub unsafe extern "C" fn NodeStyleSetMarginRight(node: NodePtr, value: f32) {
1991 let node = &*(node as *mut Node);
1992 node.set_margin_right(DefLength::Points(Len::from_f32(value)));
1993}
1994
1995/// # Safety
1996///
1997/// Set the margin right of a node instance to undefined.
1998///
1999/// # Arguments
2000/// * `node` - Raw pointer to the Node instance
2001///
2002/// # Example
2003///
2004/// ```c
2005/// NodeStyleSetMarginRightNone(node);
2006/// ```
2007#[no_mangle]
2008pub unsafe extern "C" fn NodeStyleSetMarginRightNone(node: NodePtr) {
2009 let node = &*(node as *mut Node);
2010 node.set_margin_right(DefLength::Undefined);
2011}
2012
2013/// # Safety
2014///
2015/// Set the margin right of a node instance to a percentage.
2016///
2017/// # Arguments
2018/// * `node` - Raw pointer to the Node instance
2019/// * `value` - Percentage
2020///
2021/// # Example
2022///
2023/// ```c
2024/// NodeStyleSetMarginRightPercentage(node, value);
2025#[no_mangle]
2026pub unsafe extern "C" fn NodeStyleSetMarginRightPercentage(node: NodePtr, value: f32) {
2027 let node = &*(node as *mut Node);
2028 node.set_margin_right(DefLength::Percent(value));
2029}
2030/// # Safety
2031///
2032/// Set the margin right of a node instance to auto.
2033///
2034/// # Arguments
2035/// * `node` - Raw pointer to the Node instance
2036///
2037/// # Example
2038///
2039/// ```c
2040/// NodeStyleSetMarginRightAuto(node);
2041/// ```
2042#[no_mangle]
2043pub unsafe extern "C" fn NodeStyleSetMarginRightAuto(node: NodePtr) {
2044 let node = &*(node as *mut Node);
2045 node.set_margin_right(DefLength::Auto);
2046}
2047/// # Safety
2048///
2049/// Set the margin right of a node instance to a calc handle.
2050///
2051/// # Arguments
2052/// * `node` - Raw pointer to the Node instance
2053/// * `calc_handle` - Calc handle
2054///
2055/// # Example
2056///
2057/// ```c
2058/// NodeStyleSetMarginRightCalcHandle(node, calc_handle);
2059/// ```
2060#[no_mangle]
2061pub unsafe extern "C" fn NodeStyleSetMarginRightCalcHandle(node: NodePtr, calc_handle: i32) {
2062 let node = &*(node as *mut Node);
2063 node.set_margin_right(DefLength::Custom(calc_handle));
2064}
2065
2066/// # Safety
2067///
2068/// Set the margin top of a node instance.
2069///
2070/// # Arguments
2071/// * `node` - Raw pointer to the Node instance
2072/// * `value` - Margin top type
2073///
2074/// # Example
2075///
2076/// ```c
2077/// NodeStyleSetMarginTop(node, value);
2078/// ```
2079#[no_mangle]
2080pub unsafe extern "C" fn NodeStyleSetMarginTop(node: NodePtr, value: f32) {
2081 let node = &*(node as *mut Node);
2082 node.set_margin_top(DefLength::Points(Len::from_f32(value)));
2083}
2084/// # Safety
2085///
2086/// Set the margin top of a node instance to undefined.
2087///
2088/// # Arguments
2089/// * `node` - Raw pointer to the Node instance
2090///
2091/// # Example
2092///
2093/// ```c
2094/// NodeStyleSetMarginTopNone(node);
2095/// ```
2096#[no_mangle]
2097pub unsafe extern "C" fn NodeStyleSetMarginTopNone(node: NodePtr) {
2098 let node = &*(node as *mut Node);
2099 node.set_margin_top(DefLength::Undefined);
2100}
2101/// # Safety
2102///
2103/// Set the margin top of a node instance to a percentage.
2104///
2105/// # Arguments
2106/// * `node` - Raw pointer to the Node instance
2107/// * `value` - Percentage
2108///
2109/// # Example
2110///
2111/// ```c
2112/// NodeStyleSetMarginTopPercentage(node, value);
2113/// ```
2114#[no_mangle]
2115pub unsafe extern "C" fn NodeStyleSetMarginTopPercentage(node: NodePtr, value: f32) {
2116 let node = &*(node as *mut Node);
2117 node.set_margin_top(DefLength::Percent(value));
2118}
2119/// # Safety
2120///
2121/// Set the margin top of a node instance to auto.
2122///
2123/// # Arguments
2124/// * `node` - Raw pointer to the Node instance
2125///
2126/// # Example
2127///
2128/// ```c
2129/// NodeStyleSetMarginTopAuto(node);
2130/// ```
2131#[no_mangle]
2132pub unsafe extern "C" fn NodeStyleSetMarginTopAuto(node: NodePtr) {
2133 let node = &*(node as *mut Node);
2134 node.set_margin_top(DefLength::Auto);
2135}
2136/// # Safety
2137///
2138/// Set the margin top of a node instance to a calc handle.
2139///
2140/// # Arguments
2141/// * `node` - Raw pointer to the Node instance
2142/// * `calc_handle` - Calc handle
2143///
2144/// # Example
2145///
2146/// ```c
2147/// NodeStyleSetMarginTopCalcHandle(node, calc_handle);
2148/// ```
2149#[no_mangle]
2150pub unsafe extern "C" fn NodeStyleSetMarginTopCalcHandle(node: NodePtr, calc_handle: i32) {
2151 let node = &*(node as *mut Node);
2152 node.set_margin_top(DefLength::Custom(calc_handle));
2153}
2154
2155/// # Safety
2156///
2157/// Set the margin bottom of a node instance.
2158///
2159/// # Arguments
2160/// * `node` - Raw pointer to the Node instance
2161/// * `value` - Margin bottom type
2162///
2163/// # Example
2164///
2165/// ```c
2166/// NodeStyleSetMarginBottom(node, value);
2167/// ```
2168#[no_mangle]
2169pub unsafe extern "C" fn NodeStyleSetMarginBottom(node: NodePtr, value: f32) {
2170 let node = &*(node as *mut Node);
2171 node.set_margin_bottom(DefLength::Points(Len::from_f32(value)));
2172}
2173/// # Safety
2174///
2175/// Set the margin bottom of a node instance to undefined.
2176///
2177/// # Arguments
2178/// * `node` - Raw pointer to the Node instance
2179///
2180/// # Example
2181///
2182/// ```c
2183/// NodeStyleSetMarginBottomNone(node);
2184/// ```
2185#[no_mangle]
2186pub unsafe extern "C" fn NodeStyleSetMarginBottomNone(node: NodePtr) {
2187 let node = &*(node as *mut Node);
2188 node.set_margin_bottom(DefLength::Undefined);
2189}
2190/// # Safety
2191///
2192/// Set the margin bottom of a node instance to a percentage.
2193///
2194/// # Arguments
2195/// * `node` - Raw pointer to the Node instance
2196/// * `value` - Percentage
2197///
2198/// # Example
2199///
2200/// ```c
2201/// NodeStyleSetMarginBottomPercentage(node, value);
2202/// ```
2203#[no_mangle]
2204pub unsafe extern "C" fn NodeStyleSetMarginBottomPercentage(node: NodePtr, value: f32) {
2205 let node = &*(node as *mut Node);
2206 node.set_margin_bottom(DefLength::Percent(value));
2207}
2208/// # Safety
2209///
2210/// Set the margin bottom of a node instance to auto.
2211///
2212/// # Arguments
2213/// * `node` - Raw pointer to the Node instance
2214///
2215/// # Example
2216///
2217/// ```c
2218/// NodeStyleSetMarginBottomAuto(node);
2219/// ```
2220#[no_mangle]
2221pub unsafe extern "C" fn NodeStyleSetMarginBottomAuto(node: NodePtr) {
2222 let node = &*(node as *mut Node);
2223 node.set_margin_bottom(DefLength::Auto);
2224}
2225/// # Safety
2226///
2227///
2228/// # Arguments
2229/// * `node` - Raw pointer to the Node instance
2230/// * `calc_handle` - Calc handle
2231///
2232/// # Example
2233///
2234/// ```c
2235/// NodeStyleSetMarginBottomCalcHandle(node, calc_handle);
2236/// ```
2237#[no_mangle]
2238pub unsafe extern "C" fn NodeStyleSetMarginBottomCalcHandle(node: NodePtr, calc_handle: i32) {
2239 let node = &*(node as *mut Node);
2240 node.set_margin_bottom(DefLength::Custom(calc_handle));
2241}
2242
2243/// # Safety
2244///
2245/// Set the padding left of a node instance.
2246///
2247/// # Arguments
2248/// * `node` - Raw pointer to the Node instance
2249/// * `value` - Padding left type
2250///
2251/// # Example
2252///
2253/// ```c
2254/// NodeStyleSetPaddingLeft(node, value);
2255/// ```
2256#[no_mangle]
2257pub unsafe extern "C" fn NodeStyleSetPaddingLeft(node: NodePtr, value: f32) {
2258 let node = &*(node as *mut Node);
2259 node.set_padding_left(DefLength::Points(Len::from_f32(value)));
2260}
2261/// # Safety
2262///
2263/// Set the padding left of a node instance to undefined.
2264///
2265/// # Arguments
2266/// * `node` - Raw pointer to the Node instance
2267///
2268/// # Example
2269///
2270/// ```c
2271/// NodeStyleSetPaddingLeftNone(node);
2272/// ```
2273#[no_mangle]
2274pub unsafe extern "C" fn NodeStyleSetPaddingLeftNone(node: NodePtr) {
2275 let node = &*(node as *mut Node);
2276 node.set_padding_left(DefLength::Undefined);
2277}
2278/// # Safety
2279///
2280/// Set the padding left of a node instance to a percentage.
2281///
2282/// # Arguments
2283/// * `node` - Raw pointer to the Node instance
2284/// * `value` - Percentage
2285///
2286/// # Example
2287///
2288/// ```c
2289/// NodeStyleSetPaddingLeftPercentage(node, value);
2290/// ```
2291#[no_mangle]
2292pub unsafe extern "C" fn NodeStyleSetPaddingLeftPercentage(node: NodePtr, value: f32) {
2293 let node = &*(node as *mut Node);
2294 node.set_padding_left(DefLength::Percent(value));
2295}
2296/// # Safety
2297///
2298/// Set the padding left of a node instance to auto.
2299///
2300/// # Arguments
2301/// * `node` - Raw pointer to the Node instance
2302///
2303/// # Example
2304///
2305/// ```c
2306/// NodeStyleSetPaddingLeftAuto(node);
2307/// ```
2308#[no_mangle]
2309pub unsafe extern "C" fn NodeStyleSetPaddingLeftAuto(node: NodePtr) {
2310 let node = &*(node as *mut Node);
2311 node.set_padding_left(DefLength::Auto);
2312}
2313/// # Safety
2314///
2315/// Set the padding left of a node instance to a calc handle.
2316///
2317/// # Arguments
2318/// * `node` - Raw pointer to the Node instance
2319/// * `calc_handle` - Calc handle
2320///
2321/// # Example
2322///
2323/// ```c
2324/// NodeStyleSetPaddingLeftCalcHandle(node, calc_handle);
2325/// ```
2326#[no_mangle]
2327pub unsafe extern "C" fn NodeStyleSetPaddingLeftCalcHandle(node: NodePtr, calc_handle: i32) {
2328 let node = &*(node as *mut Node);
2329 node.set_padding_left(DefLength::Custom(calc_handle));
2330}
2331
2332/// # Safety
2333///
2334/// Set the padding right of a node instance.
2335///
2336/// # Arguments
2337/// * `node` - Raw pointer to the Node instance
2338/// * `value` - Padding right type
2339///
2340/// # Example
2341///
2342/// ```c
2343/// NodeStyleSetPaddingRight(node, value);
2344/// ```
2345#[no_mangle]
2346pub unsafe extern "C" fn NodeStyleSetPaddingRight(node: NodePtr, value: f32) {
2347 let node = &*(node as *mut Node);
2348 node.set_padding_right(DefLength::Points(Len::from_f32(value)));
2349}
2350/// # Safety
2351///
2352/// Set the padding right of a node instance to undefined.
2353///
2354/// # Arguments
2355/// * `node` - Raw pointer to the Node instance
2356///
2357/// # Example
2358///
2359/// ```c
2360/// NodeStyleSetPaddingRightNone(node);
2361/// ```
2362#[no_mangle]
2363pub unsafe extern "C" fn NodeStyleSetPaddingRightNone(node: NodePtr) {
2364 let node = &*(node as *mut Node);
2365 node.set_padding_right(DefLength::Undefined);
2366}
2367
2368/// # Safety
2369///
2370/// Set the padding right of a node instance to a percentage.
2371///
2372/// # Arguments
2373/// * `node` - Raw pointer to the Node instance
2374/// * `value` - Percentage
2375///
2376/// # Example
2377///
2378/// ```c
2379/// NodeStyleSetPaddingRightPercentage(node, value);
2380/// ```
2381#[no_mangle]
2382pub unsafe extern "C" fn NodeStyleSetPaddingRightPercentage(node: NodePtr, value: f32) {
2383 let node = &*(node as *mut Node);
2384 node.set_padding_right(DefLength::Percent(value));
2385}
2386/// # Safety
2387///
2388/// Set the padding right of a node instance to auto.
2389///
2390/// # Arguments
2391/// * `node` - Raw pointer to the Node instance
2392///
2393/// # Example
2394///
2395/// ```c
2396/// NodeStyleSetPaddingRightAuto(node);
2397/// ```
2398#[no_mangle]
2399pub unsafe extern "C" fn NodeStyleSetPaddingRightAuto(node: NodePtr) {
2400 let node = &*(node as *mut Node);
2401 node.set_padding_right(DefLength::Auto);
2402}
2403
2404/// # Safety
2405///
2406/// Set the padding right of a node instance to a calc handle.
2407///
2408/// # Arguments
2409/// * `node` - Raw pointer to the Node instance
2410/// * `calc_handle` - Calc handle
2411///
2412/// # Example
2413///
2414/// ```c
2415/// NodeStyleSetPaddingRightCalcHandle(node, calc_handle);
2416/// ```
2417#[no_mangle]
2418pub unsafe extern "C" fn NodeStyleSetPaddingRightCalcHandle(node: NodePtr, calc_handle: i32) {
2419 let node = &*(node as *mut Node);
2420 node.set_padding_right(DefLength::Custom(calc_handle));
2421}
2422
2423/// # Safety
2424///
2425/// Set the padding top of a node instance.
2426///
2427/// # Arguments
2428/// * `node` - Raw pointer to the Node instance
2429/// * `value` - Padding top type
2430///
2431/// # Example
2432///
2433/// ```c
2434/// NodeStyleSetPaddingTop(node, value);
2435/// ```
2436#[no_mangle]
2437pub unsafe extern "C" fn NodeStyleSetPaddingTop(node: NodePtr, value: f32) {
2438 let node = &*(node as *mut Node);
2439 node.set_padding_top(DefLength::Points(Len::from_f32(value)));
2440}
2441/// # Safety
2442///
2443/// Set the padding top of a node instance to undefined.
2444///
2445/// # Arguments
2446/// * `node` - Raw pointer to the Node instance
2447///
2448/// # Example
2449///
2450/// ```c
2451/// NodeStyleSetPaddingTopNone(node);
2452/// ```
2453#[no_mangle]
2454pub unsafe extern "C" fn NodeStyleSetPaddingTopNone(node: NodePtr) {
2455 let node = &*(node as *mut Node);
2456 node.set_padding_top(DefLength::Undefined);
2457}
2458/// # Safety
2459///
2460/// Set the padding top of a node instance to a percentage.
2461///
2462/// # Arguments
2463/// * `node` - Raw pointer to the Node instance
2464/// * `value` - Percentage
2465///
2466/// # Example
2467///
2468/// ```c
2469/// NodeStyleSetPaddingTopPercentage(node, value);
2470/// ```
2471#[no_mangle]
2472pub unsafe extern "C" fn NodeStyleSetPaddingTopPercentage(node: NodePtr, value: f32) {
2473 let node = &*(node as *mut Node);
2474 node.set_padding_top(DefLength::Percent(value));
2475}
2476/// # Safety
2477///
2478/// Set the padding top of a node instance to auto.
2479///
2480/// # Arguments
2481/// * `node` - Raw pointer to the Node instance
2482///
2483/// # Example
2484///
2485/// ```c
2486/// NodeStyleSetPaddingTopAuto(node);
2487/// ```
2488#[no_mangle]
2489pub unsafe extern "C" fn NodeStyleSetPaddingTopAuto(node: NodePtr) {
2490 let node = &*(node as *mut Node);
2491 node.set_padding_top(DefLength::Auto);
2492}
2493/// # Safety
2494///
2495/// Set the padding top of a node instance to a calc handle.
2496///
2497/// # Arguments
2498/// * `node` - Raw pointer to the Node instance
2499/// * `calc_handle` - Calc handle
2500///
2501/// # Example
2502///
2503/// ```c
2504/// NodeStyleSetPaddingTopCalcHandle(node, calc_handle);
2505/// ```
2506#[no_mangle]
2507pub unsafe extern "C" fn NodeStyleSetPaddingTopCalcHandle(node: NodePtr, calc_handle: i32) {
2508 let node = &*(node as *mut Node);
2509 node.set_padding_top(DefLength::Custom(calc_handle));
2510}
2511
2512/// # Safety
2513///
2514/// Set the padding bottom of a node instance.
2515///
2516/// # Arguments
2517/// * `node` - Raw pointer to the Node instance
2518/// * `value` - Padding bottom type
2519///
2520/// # Example
2521///
2522/// ```c
2523/// NodeStyleSetPaddingBottom(node, value);
2524/// ```
2525#[no_mangle]
2526pub unsafe extern "C" fn NodeStyleSetPaddingBottom(node: NodePtr, value: f32) {
2527 let node = &*(node as *mut Node);
2528 node.set_padding_bottom(DefLength::Points(Len::from_f32(value)));
2529}
2530/// # Safety
2531///
2532/// Set the padding bottom of a node instance to undefined.
2533///
2534/// # Arguments
2535/// * `node` - Raw pointer to the Node instance
2536///
2537/// # Example
2538///
2539/// ```c
2540/// NodeStyleSetPaddingBottomNone(node);
2541/// ```
2542#[no_mangle]
2543pub unsafe extern "C" fn NodeStyleSetPaddingBottomNone(node: NodePtr) {
2544 let node = &*(node as *mut Node);
2545 node.set_padding_bottom(DefLength::Undefined);
2546}
2547/// # Safety
2548///
2549/// Set the padding bottom of a node instance to a percentage.
2550///
2551/// # Arguments
2552/// * `node` - Raw pointer to the Node instance
2553/// * `value` - Percentage
2554///
2555/// # Example
2556///
2557/// ```c
2558/// NodeStyleSetPaddingBottomPercentage(node, value);
2559/// ```
2560#[no_mangle]
2561pub unsafe extern "C" fn NodeStyleSetPaddingBottomPercentage(node: NodePtr, value: f32) {
2562 let node = &*(node as *mut Node);
2563 node.set_padding_bottom(DefLength::Percent(value));
2564}
2565/// # Safety
2566///
2567/// Set the padding bottom of a node instance to auto.
2568///
2569/// # Arguments
2570/// * `node` - Raw pointer to the Node instance
2571///
2572/// # Example
2573///
2574/// ```c
2575/// NodeStyleSetPaddingBottomAuto(node);
2576/// ```
2577#[no_mangle]
2578pub unsafe extern "C" fn NodeStyleSetPaddingBottomAuto(node: NodePtr) {
2579 let node = &*(node as *mut Node);
2580 node.set_padding_bottom(DefLength::Auto);
2581}
2582/// # Safety
2583///
2584/// Set the padding bottom of a node instance to a calc handle.
2585///
2586/// # Arguments
2587/// * `node` - Raw pointer to the Node instance
2588/// * `calc_handle` - Calc handle
2589///
2590/// # Example
2591///
2592/// ```c
2593/// NodeStyleSetPaddingBottomCalcHandle(node, calc_handle);
2594/// ```
2595#[no_mangle]
2596pub unsafe extern "C" fn NodeStyleSetPaddingBottomCalcHandle(node: NodePtr, calc_handle: i32) {
2597 let node = &*(node as *mut Node);
2598 node.set_padding_bottom(DefLength::Custom(calc_handle));
2599}
2600
2601/// # Safety
2602///
2603/// Set the border left of a node instance.
2604///
2605/// # Arguments
2606/// * `node` - Raw pointer to the Node instance
2607/// * `value` - Border left type
2608///
2609/// # Example
2610///
2611/// ```c
2612/// NodeStyleSetBorderLeft(node, value);
2613/// ```
2614#[no_mangle]
2615pub unsafe extern "C" fn NodeStyleSetBorderLeft(node: NodePtr, value: f32) {
2616 let node = &*(node as *mut Node);
2617 node.set_border_left(DefLength::Points(Len::from_f32(value)));
2618}
2619
2620/// # Safety
2621///
2622/// Set the border left of a node instance to undefined.
2623///
2624/// # Arguments
2625/// * `node` - Raw pointer to the Node instance
2626///
2627/// # Example
2628///
2629/// ```c
2630/// NodeStyleSetBorderLeftNone(node);
2631/// ```
2632#[no_mangle]
2633pub unsafe extern "C" fn NodeStyleSetBorderLeftNone(node: NodePtr) {
2634 let node = &*(node as *mut Node);
2635 node.set_border_left(DefLength::Undefined);
2636}
2637/// # Safety
2638///
2639/// Set the border left of a node instance to a percentage.
2640///
2641/// # Arguments
2642/// * `node` - Raw pointer to the Node instance
2643/// * `value` - Percentage
2644///
2645/// # Example
2646///
2647/// ```c
2648/// NodeStyleSetBorderLeftPercentage(node, value);
2649/// ```
2650#[no_mangle]
2651pub unsafe extern "C" fn NodeStyleSetBorderLeftPercentage(node: NodePtr, value: f32) {
2652 let node = &*(node as *mut Node);
2653 node.set_border_left(DefLength::Percent(value));
2654}
2655/// # Safety
2656///
2657/// Set the border left of a node instance to auto.
2658///
2659/// # Arguments
2660/// * `node` - Raw pointer to the Node instance
2661///
2662/// # Example
2663///
2664/// ```c
2665/// NodeStyleSetBorderLeftAuto(node);
2666/// ```
2667#[no_mangle]
2668pub unsafe extern "C" fn NodeStyleSetBorderLeftAuto(node: NodePtr) {
2669 let node = &*(node as *mut Node);
2670 node.set_border_left(DefLength::Auto);
2671}
2672/// # Safety
2673///
2674/// Set the border left of a node instance to a calc handle.
2675///
2676/// # Arguments
2677/// * `node` - Raw pointer to the Node instance
2678/// * `calc_handle` - Calc handle
2679///
2680/// # Example
2681///
2682/// ```c
2683/// NodeStyleSetBorderLeftCalcHandle(node, calc_handle);
2684/// ```
2685#[no_mangle]
2686pub unsafe extern "C" fn NodeStyleSetBorderLeftCalcHandle(node: NodePtr, calc_handle: i32) {
2687 let node = &*(node as *mut Node);
2688 node.set_border_left(DefLength::Custom(calc_handle));
2689}
2690
2691/// # Safety
2692///
2693/// Set the border right of a node instance.
2694///
2695/// # Arguments
2696/// * `node` - Raw pointer to the Node instance
2697/// * `value` - Border right type
2698///
2699/// # Example
2700///
2701/// ```c
2702/// NodeStyleSetBorderRight(node, value);
2703/// ```
2704#[no_mangle]
2705pub unsafe extern "C" fn NodeStyleSetBorderRight(node: NodePtr, value: f32) {
2706 let node = &*(node as *mut Node);
2707 node.set_border_right(DefLength::Points(Len::from_f32(value)));
2708}
2709/// # Safety
2710///
2711/// Set the border right of a node instance to undefined.
2712///
2713/// # Arguments
2714/// * `node` - Raw pointer to the Node instance
2715///
2716/// # Example
2717///
2718/// ```c
2719/// NodeStyleSetBorderRightNone(node);
2720/// ```
2721#[no_mangle]
2722pub unsafe extern "C" fn NodeStyleSetBorderRightNone(node: NodePtr) {
2723 let node = &*(node as *mut Node);
2724 node.set_border_right(DefLength::Undefined);
2725}
2726/// # Safety
2727///
2728/// Set the border right of a node instance to a percentage.
2729///
2730/// # Arguments
2731/// * `node` - Raw pointer to the Node instance
2732/// * `value` - Percentage
2733///
2734/// # Example
2735///
2736/// ```c
2737/// NodeStyleSetBorderRightPercentage(node, value);
2738/// ```
2739#[no_mangle]
2740pub unsafe extern "C" fn NodeStyleSetBorderRightPercentage(node: NodePtr, value: f32) {
2741 let node = &*(node as *mut Node);
2742 node.set_border_right(DefLength::Percent(value));
2743}
2744/// # Safety
2745///
2746/// Set the border right of a node instance to auto.
2747///
2748/// # Arguments
2749/// * `node` - Raw pointer to the Node instance
2750///
2751/// # Example
2752///
2753/// ```c
2754/// NodeStyleSetBorderRightAuto(node);
2755/// ```
2756#[no_mangle]
2757pub unsafe extern "C" fn NodeStyleSetBorderRightAuto(node: NodePtr) {
2758 let node = &*(node as *mut Node);
2759 node.set_border_right(DefLength::Auto);
2760}
2761/// # Safety
2762///
2763/// Set the border right of a node instance to a calc handle.
2764///
2765/// # Arguments
2766/// * `node` - Raw pointer to the Node instance
2767/// * `calc_handle` - Calc handle
2768///
2769/// # Example
2770///
2771/// ```c
2772/// NodeStyleSetBorderRightCalcHandle(node, calc_handle);
2773/// ```
2774#[no_mangle]
2775pub unsafe extern "C" fn NodeStyleSetBorderRightCalcHandle(node: NodePtr, calc_handle: i32) {
2776 let node = &*(node as *mut Node);
2777 node.set_border_right(DefLength::Custom(calc_handle));
2778}
2779
2780/// # Safety
2781///
2782/// Set the border top of a node instance.
2783///
2784/// # Arguments
2785/// * `node` - Raw pointer to the Node instance
2786/// * `value` - Border top type
2787///
2788/// # Example
2789///
2790/// ```c
2791/// NodeStyleSetBorderTop(node, value);
2792/// ```
2793#[no_mangle]
2794pub unsafe extern "C" fn NodeStyleSetBorderTop(node: NodePtr, value: f32) {
2795 let node = &*(node as *mut Node);
2796 node.set_border_top(DefLength::Points(Len::from_f32(value)));
2797}
2798/// # Safety
2799///
2800/// Set the border top of a node instance to undefined.
2801///
2802/// # Arguments
2803/// * `node` - Raw pointer to the Node instance
2804///
2805/// # Example
2806///
2807/// ```c
2808/// NodeStyleSetBorderTopNone(node);
2809/// ```
2810#[no_mangle]
2811pub unsafe extern "C" fn NodeStyleSetBorderTopNone(node: NodePtr) {
2812 let node = &*(node as *mut Node);
2813 node.set_border_top(DefLength::Undefined);
2814}
2815/// # Safety
2816///
2817/// Set the border top of a node instance to a percentage.
2818///
2819/// # Arguments
2820/// * `node` - Raw pointer to the Node instance
2821/// * `value` - Percentage
2822///
2823/// # Example
2824///
2825/// ```c
2826/// NodeStyleSetBorderTopPercentage(node, value);
2827/// ```
2828#[no_mangle]
2829pub unsafe extern "C" fn NodeStyleSetBorderTopPercentage(node: NodePtr, value: f32) {
2830 let node = &*(node as *mut Node);
2831 node.set_border_top(DefLength::Percent(value));
2832}
2833/// # Safety
2834///
2835/// Set the border top of a node instance to auto.
2836///
2837/// # Arguments
2838/// * `node` - Raw pointer to the Node instance
2839///
2840/// # Example
2841///
2842/// ```c
2843/// NodeStyleSetBorderTopAuto(node);
2844/// ```
2845#[no_mangle]
2846pub unsafe extern "C" fn NodeStyleSetBorderTopAuto(node: NodePtr) {
2847 let node = &*(node as *mut Node);
2848 node.set_border_top(DefLength::Auto);
2849}
2850/// # Safety
2851///
2852/// Set the border top of a node instance to a calc handle.
2853///
2854/// # Arguments
2855/// * `node` - Raw pointer to the Node instance
2856/// * `calc_handle` - Calc handle
2857///
2858/// # Example
2859///
2860/// ```c
2861/// NodeStyleSetBorderTopCalcHandle(node, calc_handle);
2862/// ```
2863#[no_mangle]
2864pub unsafe extern "C" fn NodeStyleSetBorderTopCalcHandle(node: NodePtr, calc_handle: i32) {
2865 let node = &*(node as *mut Node);
2866 node.set_border_top(DefLength::Custom(calc_handle));
2867}
2868
2869/// # Safety
2870///
2871/// Set the border bottom of a node instance.
2872///
2873/// # Arguments
2874/// * `node` - Raw pointer to the Node instance
2875/// * `value` - Border bottom type
2876///
2877/// # Example
2878///
2879/// ```c
2880/// NodeStyleSetBorderBottom(node, value);
2881/// ```
2882#[no_mangle]
2883pub unsafe extern "C" fn NodeStyleSetBorderBottom(node: NodePtr, value: f32) {
2884 let node = &*(node as *mut Node);
2885 node.set_border_bottom(DefLength::Points(Len::from_f32(value)));
2886}
2887/// # Safety
2888///
2889/// Set the border bottom of a node instance to undefined.
2890///
2891/// # Arguments
2892/// * `node` - Raw pointer to the Node instance
2893///
2894/// # Example
2895///
2896/// ```c
2897/// NodeStyleSetBorderBottomNone(node);
2898/// ```
2899#[no_mangle]
2900pub unsafe extern "C" fn NodeStyleSetBorderBottomNone(node: NodePtr) {
2901 let node = &*(node as *mut Node);
2902 node.set_border_bottom(DefLength::Undefined);
2903}
2904/// # Safety
2905///
2906/// Set the border bottom of a node instance to a percentage.
2907///
2908/// # Arguments
2909/// * `node` - Raw pointer to the Node instance
2910/// * `value` - Percentage
2911///
2912/// # Example
2913///
2914/// ```c
2915/// NodeStyleSetBorderBottomPercentage(node, value);
2916/// ```
2917#[no_mangle]
2918pub unsafe extern "C" fn NodeStyleSetBorderBottomPercentage(node: NodePtr, value: f32) {
2919 let node = &*(node as *mut Node);
2920 node.set_border_bottom(DefLength::Percent(value));
2921}
2922/// # Safety
2923///
2924/// Set the border bottom of a node instance to auto.
2925///
2926/// # Arguments
2927/// * `node` - Raw pointer to the Node instance
2928///
2929/// # Example
2930///
2931/// ```c
2932/// NodeStyleSetBorderBottomAuto(node);
2933/// ```
2934#[no_mangle]
2935pub unsafe extern "C" fn NodeStyleSetBorderBottomAuto(node: NodePtr) {
2936 let node = &*(node as *mut Node);
2937 node.set_border_bottom(DefLength::Auto);
2938}
2939/// # Safety
2940///
2941/// Set the border bottom of a node instance to a calc handle.
2942///
2943/// # Arguments
2944/// * `node` - Raw pointer to the Node instance
2945/// * `calc_handle` - Calc handle
2946///
2947/// # Example
2948///
2949/// ```c
2950/// NodeStyleSetBorderBottomCalcHandle(node, calc_handle);
2951/// ```
2952#[no_mangle]
2953pub unsafe extern "C" fn NodeStyleSetBorderBottomCalcHandle(node: NodePtr, calc_handle: i32) {
2954 let node = &*(node as *mut Node);
2955 node.set_border_bottom(DefLength::Custom(calc_handle));
2956}
2957/// # Safety
2958///
2959/// Set the flex grow of a node instance.
2960///
2961/// # Arguments
2962/// * `node` - Raw pointer to the Node instance
2963/// * `value` - Flex grow
2964///
2965/// # Example
2966///
2967/// ```c
2968/// NodeStyleSetFlexGrow(node, value);
2969/// ```
2970#[no_mangle]
2971pub unsafe extern "C" fn NodeStyleSetFlexGrow(node: NodePtr, value: f32) {
2972 let node = &*(node as *mut Node);
2973 node.set_flex_grow(value);
2974}
2975
2976/// # Safety
2977///
2978/// Set the flex shrink of a node instance.
2979///
2980/// # Arguments
2981/// * `node` - Raw pointer to the Node instance
2982/// * `value` - Flex shrink
2983///
2984/// # Example
2985///
2986/// ```c
2987/// NodeStyleSetFlexShrink(node, value);
2988/// ```
2989#[no_mangle]
2990pub unsafe extern "C" fn NodeStyleSetFlexShrink(node: NodePtr, value: f32) {
2991 let node = &*(node as *mut Node);
2992 node.set_flex_shrink(value);
2993}
2994
2995/// # Safety
2996///
2997/// Set the flex basis of a node instance.
2998///
2999/// # Arguments
3000/// * `node` - Raw pointer to the Node instance
3001/// * `value` - Flex basis
3002///
3003/// # Example
3004///
3005/// ```c
3006/// NodeStyleSetFlexBasis(node, value);
3007/// ```
3008#[no_mangle]
3009pub unsafe extern "C" fn NodeStyleSetFlexBasis(node: NodePtr, value: f32) {
3010 let node = &*(node as *mut Node);
3011 node.set_flex_basis(DefLength::Points(Len::from_f32(value)));
3012}
3013/// # Safety
3014///
3015/// Set the flex basis of a node instance to auto.
3016///
3017/// # Arguments
3018/// * `node` - Raw pointer to the Node instance
3019///
3020/// # Example
3021///
3022/// ```c
3023/// NodeStyleSetFlexBasisAuto(node);
3024/// ```
3025#[no_mangle]
3026pub unsafe extern "C" fn NodeStyleSetFlexBasisAuto(node: NodePtr) {
3027 let node = &*(node as *mut Node);
3028 node.set_flex_basis(DefLength::Auto);
3029}
3030/// # Safety
3031///
3032/// Set the flex basis of a node instance to undefined.
3033///
3034/// # Arguments
3035/// * `node` - Raw pointer to the Node instance
3036///
3037/// # Example
3038///
3039/// ```c
3040/// NodeStyleSetFlexBasisNone(node);
3041/// ```
3042#[no_mangle]
3043pub unsafe extern "C" fn NodeStyleSetFlexBasisNone(node: NodePtr) {
3044 let node = &*(node as *mut Node);
3045 node.set_flex_basis(DefLength::Undefined);
3046}
3047/// # Safety
3048///
3049/// Set the flex basis of a node instance to a percentage.
3050///
3051/// # Arguments
3052/// * `node` - Raw pointer to the Node instance
3053/// * `value` - Percentage
3054///
3055/// # Example
3056///
3057/// ```c
3058/// NodeStyleSetFlexBasisPercentage(node, value);
3059/// ```
3060#[no_mangle]
3061pub unsafe extern "C" fn NodeStyleSetFlexBasisPercentage(node: NodePtr, value: f32) {
3062 let node = &*(node as *mut Node);
3063 node.set_flex_basis(DefLength::Percent(value));
3064}
3065/// # Safety
3066///
3067/// Set the flex basis of a node instance to a calc handle.
3068///
3069/// # Arguments
3070/// * `node` - Raw pointer to the Node instance
3071/// * `calc_handle` - Calc handle
3072///
3073/// # Example
3074///
3075/// ```c
3076/// NodeStyleSetFlexBasisCalcHandle(node, calc_handle);
3077/// ```
3078#[no_mangle]
3079pub unsafe extern "C" fn NodeStyleSetFlexBasisCalcHandle(node: NodePtr, calc_handle: i32) {
3080 let node = &*(node as *mut Node);
3081 node.set_flex_basis(DefLength::Custom(calc_handle));
3082}
3083
3084/// # Safety
3085///
3086/// Set the flex direction of a node instance.
3087///
3088/// # Arguments
3089/// * `node` - Raw pointer to the Node instance
3090/// * `value` - Flex direction
3091///
3092/// # Example
3093///
3094/// ```c
3095/// NodeStyleSetFlexDirection(node, value);
3096/// ```
3097#[no_mangle]
3098pub unsafe extern "C" fn NodeStyleSetFlexDirection(node: NodePtr, value: FlexDirectionType) {
3099 let node = &*(node as *mut Node);
3100 if let Some(value) = value.to_inner_without_global() {
3101 node.set_flex_direction(value);
3102 }
3103}
3104
3105/// # Safety
3106///
3107/// Set the flex wrap of a node instance.
3108///
3109/// # Arguments
3110/// * `node` - Raw pointer to the Node instance
3111/// * `value` - Flex wrap
3112///
3113/// # Example
3114///
3115/// ```c
3116/// NodeStyleSetFlexWrap(node, value);
3117/// ```
3118#[no_mangle]
3119pub unsafe extern "C" fn NodeStyleSetFlexWrap(node: NodePtr, value: FlexWrapType) {
3120 let node = &*(node as *mut Node);
3121 if let Some(value) = value.to_inner_without_global() {
3122 node.set_flex_wrap(value);
3123 }
3124}
3125
3126/// # Safety
3127///
3128/// Set the justify content of a node instance.
3129///
3130/// # Arguments
3131/// * `node` - Raw pointer to the Node instance
3132/// * `value` - Justify content
3133///
3134/// # Example
3135///
3136/// ```c
3137/// NodeStyleSetJustifyContent(node, value);
3138/// ```
3139#[no_mangle]
3140pub unsafe extern "C" fn NodeStyleSetJustifyContent(node: NodePtr, value: JustifyContentType) {
3141 let node = &*(node as *mut Node);
3142 if let Some(value) = value.to_inner_without_global() {
3143 node.set_justify_content(value);
3144 }
3145}
3146
3147/// # Safety
3148///
3149/// Set the align content of a node instance.
3150///
3151/// # Arguments
3152/// * `node` - Raw pointer to the Node instance
3153/// * `value` - Align content
3154///
3155/// # Example
3156///
3157/// ```c
3158/// NodeStyleSetAlignContent(node, value);
3159/// ```
3160#[no_mangle]
3161pub unsafe extern "C" fn NodeStyleSetAlignContent(node: NodePtr, value: AlignContentType) {
3162 let node = &*(node as *mut Node);
3163 if let Some(value) = value.to_inner_without_global() {
3164 node.set_align_content(value);
3165 }
3166}
3167
3168/// # Safety
3169///
3170/// Set the align items of a node instance.
3171///
3172/// # Arguments
3173/// * `node` - Raw pointer to the Node instance
3174/// * `value` - Align items
3175///
3176/// # Example
3177///
3178/// ```c
3179/// NodeStyleSetAlignItems(node, value);
3180/// ```
3181#[no_mangle]
3182pub unsafe extern "C" fn NodeStyleSetAlignItems(node: NodePtr, value: AlignItemsType) {
3183 let node = &*(node as *mut Node);
3184 if let Some(value) = value.to_inner_without_global() {
3185 node.set_align_items(value);
3186 }
3187}
3188
3189/// # Safety
3190///
3191/// Set the align self of a node instance.
3192///
3193/// # Arguments
3194/// * `node` - Raw pointer to the Node instance
3195/// * `value` - Align self
3196///
3197/// # Example
3198///
3199/// ```c
3200/// NodeStyleSetAlignSelf(node, value);
3201/// ```
3202#[no_mangle]
3203pub unsafe extern "C" fn NodeStyleSetAlignSelf(node: NodePtr, value: AlignSelfType) {
3204 let node = &*(node as *mut Node);
3205 if let Some(value) = value.to_inner_without_global() {
3206 node.set_align_self(value);
3207 }
3208}
3209
3210/// # Safety
3211///
3212/// Set the order of a node instance.
3213///
3214/// # Arguments
3215/// * `node` - Raw pointer to the Node instance
3216/// * `value` - Order
3217///
3218/// # Example
3219///
3220/// ```c
3221/// NodeStyleSetOrder(node, value);
3222/// ```
3223#[no_mangle]
3224pub unsafe extern "C" fn NodeStyleSetOrder(node: NodePtr, value: i32) {
3225 let node = &*(node as *mut Node);
3226 node.set_order(value);
3227}
3228
3229/// # Safety
3230///
3231/// Set the row gap of a node instance.
3232///
3233/// # Arguments
3234/// * `node` - Raw pointer to the Node instance
3235/// * `value` - Row gap
3236///
3237/// # Example
3238///
3239/// ```c
3240/// NodeStyleSetRowGap(node, value);
3241/// ```
3242#[no_mangle]
3243pub unsafe extern "C" fn NodeStyleSetRowGap(node: NodePtr, value: f32) {
3244 let node = &*(node as *mut Node);
3245 node.set_row_gap(DefLength::Points(Len::from_f32(value)));
3246}
3247
3248/// # Safety
3249///
3250/// Set the row gap of a node instance to undefined.
3251///
3252/// # Arguments
3253/// * `node` - Raw pointer to the Node instance
3254///
3255/// # Example
3256///
3257/// ```c
3258/// NodeStyleSetRowGapNormal(node);
3259/// ```
3260#[no_mangle]
3261pub unsafe extern "C" fn NodeStyleSetRowGapNormal(node: NodePtr) {
3262 let node = &*(node as *mut Node);
3263 node.set_row_gap(DefLength::Undefined);
3264}
3265
3266/// # Safety
3267///
3268/// Set the row gap of a node instance to a percentage.
3269///
3270/// # Arguments
3271/// * `node` - Raw pointer to the Node instance
3272/// * `value` - Row gap percentage
3273///
3274/// # Example
3275///
3276/// ```c
3277/// NodeStyleSetRowGapPercentage(node, value);
3278/// ```
3279#[no_mangle]
3280pub unsafe extern "C" fn NodeStyleSetRowGapPercentage(node: NodePtr, value: f32) {
3281 let node = &*(node as *mut Node);
3282 node.set_row_gap(DefLength::Percent(value));
3283}
3284
3285/// # Safety
3286///
3287/// Set the row gap of a node instance to a calc handle.
3288///
3289/// # Arguments
3290/// * `node` - Raw pointer to the Node instance
3291/// * `calc_handle` - Calc handle
3292///
3293/// # Example
3294///
3295/// ```c
3296/// NodeStyleSetRowGapCalcHandle(node, calc_handle);
3297/// ```
3298#[no_mangle]
3299pub unsafe extern "C" fn NodeStyleSetRowGapCalcHandle(node: NodePtr, calc_handle: i32) {
3300 let node = &*(node as *mut Node);
3301 node.set_row_gap(DefLength::Custom(calc_handle));
3302}
3303
3304/// # Safety
3305///
3306/// Set the column gap of a node instance.
3307///
3308/// # Arguments
3309/// * `node` - Raw pointer to the Node instance
3310/// * `value` - Column gap
3311///
3312/// # Example
3313///
3314/// ```c
3315/// NodeStyleSetColumnGap(node, value);
3316/// ```
3317#[no_mangle]
3318pub unsafe extern "C" fn NodeStyleSetColumnGap(node: NodePtr, value: f32) {
3319 let node = &*(node as *mut Node);
3320 node.set_column_gap(DefLength::Points(Len::from_f32(value)));
3321}
3322
3323/// # Safety
3324///
3325/// Set the column gap of a node instance to undefined.
3326///
3327/// # Arguments
3328/// * `node` - Raw pointer to the Node instance
3329///
3330/// # Example
3331///
3332/// ```c
3333/// NodeStyleSetColumnGapNormal(node);
3334/// ```
3335#[no_mangle]
3336pub unsafe extern "C" fn NodeStyleSetColumnGapNormal(node: NodePtr) {
3337 let node = &*(node as *mut Node);
3338 node.set_column_gap(DefLength::Undefined);
3339}
3340
3341/// # Safety
3342///
3343/// Set the column gap of a node instance to a percentage.
3344///
3345/// # Arguments
3346/// * `node` - Raw pointer to the Node instance
3347/// * `value` - Column gap percentage
3348///
3349/// # Example
3350///
3351/// ```c
3352/// NodeStyleSetColumnGapPercentage(node, value);
3353/// ```
3354#[no_mangle]
3355pub unsafe extern "C" fn NodeStyleSetColumnGapPercentage(node: NodePtr, value: f32) {
3356 let node = &*(node as *mut Node);
3357 node.set_column_gap(DefLength::Percent(value));
3358}
3359
3360/// # Safety
3361///
3362/// Set the column gap of a node instance to a calc handle.
3363///
3364/// # Arguments
3365/// * `node` - Raw pointer to the Node instance
3366/// * `calc_handle` - Calc handle
3367///
3368/// # Example
3369///
3370/// ```c
3371/// NodeStyleSetColumnGapCalcHandle(node, calc_handle);
3372/// ```
3373#[no_mangle]
3374pub unsafe extern "C" fn NodeStyleSetColumnGapCalcHandle(node: NodePtr, calc_handle: i32) {
3375 let node = &*(node as *mut Node);
3376 node.set_column_gap(DefLength::Custom(calc_handle));
3377}
3378
3379/// # Safety
3380///
3381/// Set the text align of a node instance.
3382///
3383/// # Arguments
3384/// * `node` - Raw pointer to the Node instance
3385/// * `value` - Text align
3386///
3387/// # Example
3388///
3389/// ```c
3390/// NodeStyleSetTextAlign(node, value);
3391/// ```
3392#[no_mangle]
3393pub unsafe extern "C" fn NodeStyleSetTextAlign(node: NodePtr, value: TextAlignType) {
3394 let node = &*(node as *mut Node);
3395 if let Some(value) = value.to_inner_without_global() {
3396 node.set_text_align(value);
3397 }
3398}
3399
3400/// # Safety
3401///
3402/// Set the aspect ratio of a node instance.
3403///
3404/// # Arguments
3405/// * `node` - Raw pointer to the Node instance
3406/// * `x` - Aspect ratio x
3407/// * `y` - Aspect ratio y
3408///
3409/// # Example
3410///
3411/// ```c
3412/// NodeStyleSetAspectRatio(node, x, y);
3413/// ```
3414#[no_mangle]
3415pub unsafe extern "C" fn NodeStyleSetAspectRatio(node: NodePtr, x: f32, y: f32) {
3416 let node = &*(node as *mut Node);
3417 node.set_aspect_ratio(Some(x / y));
3418}
3419
3420/// # Safety
3421///
3422/// Set the aspect ratio of a node instance to auto.
3423///
3424/// # Arguments
3425/// * `node` - Raw pointer to the Node instance
3426///
3427/// # Example
3428///
3429/// ```c
3430/// NodeStyleSetAspectRatioAuto(node);
3431/// ```
3432#[no_mangle]
3433pub unsafe extern "C" fn NodeStyleSetAspectRatioAuto(node: NodePtr) {
3434 let node = &*(node as *mut Node);
3435 node.set_aspect_ratio(None);
3436}
3437
3438// layout getter
3439
3440/// # Safety
3441///
3442/// Get the left position of a node instance.
3443///
3444/// # Arguments
3445/// * `node` - Raw pointer to the Node instance
3446///
3447/// # Returns
3448/// * `f32` - Left position
3449///
3450/// # Example
3451///
3452/// ```c
3453/// NodeLayoutGetLeft(node);
3454/// ```
3455#[no_mangle]
3456pub unsafe extern "C" fn NodeLayoutGetLeft(node: NodePtr) -> f32 {
3457 let node = &*(node as *mut Node);
3458 node.layout_position().left.to_f32()
3459}
3460
3461/// # Safety
3462///
3463/// Get the right position of a node instance.
3464///
3465/// # Arguments
3466/// * `node` - Raw pointer to the Node instance
3467///
3468/// # Returns
3469/// * `f32` - Right position
3470///
3471/// # Example
3472///
3473/// ```c
3474/// NodeLayoutGetRight(node);
3475/// ```
3476#[no_mangle]
3477pub unsafe extern "C" fn NodeLayoutGetRight(node: NodePtr) -> f32 {
3478 let _node = &*(node as *mut Node);
3479 // TODO: return real right
3480 0.
3481}
3482
3483/// # Safety
3484///
3485/// Get the top position of a node instance.
3486///
3487/// # Arguments
3488/// * `node` - Raw pointer to the Node instance
3489///
3490/// # Returns
3491/// * `f32` - Top position
3492///
3493/// # Example
3494///
3495/// ```c
3496/// NodeLayoutGetTop(node);
3497/// ```
3498#[no_mangle]
3499pub unsafe extern "C" fn NodeLayoutGetTop(node: NodePtr) -> f32 {
3500 let node = &*(node as *mut Node);
3501 node.layout_position().top.to_f32()
3502}
3503
3504/// # Safety
3505///
3506/// Get the bottom position of a node instance.
3507///
3508/// # Arguments
3509/// * `node` - Raw pointer to the Node instance
3510///
3511/// # Returns
3512/// * `f32` - Bottom position
3513///
3514/// # Example
3515///
3516/// ```c
3517/// NodeLayoutGetBottom(node);
3518/// ```
3519#[no_mangle]
3520pub unsafe extern "C" fn NodeLayoutGetBottom(node: NodePtr) -> f32 {
3521 let _node = &*(node as *mut Node);
3522 // TODO: return real bottom
3523 0.
3524}
3525
3526/// # Safety
3527///
3528/// Get the width of a node instance.
3529///
3530/// # Arguments
3531/// * `node` - Raw pointer to the Node instance
3532///
3533/// # Returns
3534/// * `f32` - Width
3535///
3536/// # Example
3537///
3538/// ```c
3539/// NodeLayoutGetWidth(node);
3540/// ```
3541#[no_mangle]
3542pub unsafe extern "C" fn NodeLayoutGetWidth(node: NodePtr) -> f32 {
3543 let node = &*(node as *mut Node);
3544 node.layout_position().width.to_f32()
3545}
3546
3547/// # Safety
3548///
3549/// Get the height of a node instance.
3550///
3551/// # Arguments
3552/// * `node` - Raw pointer to the Node instance
3553///
3554/// # Returns
3555/// * `f32` - Height
3556///
3557/// # Example
3558///
3559/// ```c
3560/// NodeLayoutGetHeight(node);
3561/// ```
3562#[no_mangle]
3563pub unsafe extern "C" fn NodeLayoutGetHeight(node: NodePtr) -> f32 {
3564 let node = &*(node as *mut Node);
3565 node.layout_position().height.to_f32()
3566}
3567
3568/// # Safety
3569///
3570/// Get the margin left of a node instance.
3571///
3572/// # Arguments
3573/// * `node` - Raw pointer to the Node instance
3574///
3575/// # Returns
3576/// * `f32` - Margin left
3577///
3578/// # Example
3579///
3580/// ```c
3581/// NodeLayoutGetMarginLeft(node);
3582/// ```
3583#[no_mangle]
3584pub unsafe extern "C" fn NodeLayoutGetMarginLeft(node: NodePtr) -> f32 {
3585 let node = &*(node as *mut Node);
3586 node.computed_style().margin.left.to_f32()
3587}
3588
3589/// # Safety
3590///
3591/// Get the margin right of a node instance.
3592///
3593/// # Arguments
3594/// * `node` - Raw pointer to the Node instance
3595///
3596/// # Returns
3597/// * `f32` - Margin right
3598///
3599/// # Example
3600///
3601/// ```c
3602/// NodeLayoutGetMarginRight(node);
3603/// ```
3604#[no_mangle]
3605pub unsafe extern "C" fn NodeLayoutGetMarginRight(node: NodePtr) -> f32 {
3606 let node = &*(node as *mut Node);
3607 node.computed_style().margin.right.to_f32()
3608}
3609
3610/// # Safety
3611///
3612/// Get the margin top of a node instance.
3613///
3614/// # Arguments
3615/// * `node` - Raw pointer to the Node instance
3616///
3617/// # Returns
3618/// * `f32` - Margin top
3619///
3620/// # Example
3621///
3622/// ```c
3623/// NodeLayoutGetMarginTop(node);
3624/// ```
3625#[no_mangle]
3626pub unsafe extern "C" fn NodeLayoutGetMarginTop(node: NodePtr) -> f32 {
3627 let node = &*(node as *mut Node);
3628 node.computed_style().margin.top.to_f32()
3629}
3630
3631/// # Safety
3632///
3633/// Get the margin bottom of a node instance.
3634///
3635/// # Arguments
3636/// * `node` - Raw pointer to the Node instance
3637///
3638/// # Returns
3639/// * `f32` - Margin bottom
3640///
3641/// # Example
3642///
3643/// ```c
3644/// NodeLayoutGetMarginBottom(node);
3645/// ```
3646#[no_mangle]
3647pub unsafe extern "C" fn NodeLayoutGetMarginBottom(node: NodePtr) -> f32 {
3648 let node = &*(node as *mut Node);
3649 node.computed_style().margin.bottom.to_f32()
3650}
3651
3652/// # Safety
3653///
3654/// Get the border left of a node instance.
3655///
3656/// # Arguments
3657/// * `node` - Raw pointer to the Node instance
3658///
3659/// # Returns
3660/// * `f32` - Border left
3661///
3662/// # Example
3663///
3664/// ```c
3665/// NodeLayoutGetBorderLeft(node);
3666/// ```
3667#[no_mangle]
3668pub unsafe extern "C" fn NodeLayoutGetBorderLeft(node: NodePtr) -> f32 {
3669 let node = &*(node as *mut Node);
3670 node.computed_style().border.left.to_f32()
3671}
3672
3673/// # Safety
3674///
3675/// Get the border right of a node instance.
3676///
3677/// # Arguments
3678/// * `node` - Raw pointer to the Node instance
3679///
3680/// # Returns
3681/// * `f32` - Border right
3682///
3683/// # Example
3684///
3685/// ```c
3686/// NodeLayoutGetBorderRight(node);
3687/// ```
3688#[no_mangle]
3689pub unsafe extern "C" fn NodeLayoutGetBorderRight(node: NodePtr) -> f32 {
3690 let node = &*(node as *mut Node);
3691 node.computed_style().border.right.to_f32()
3692}
3693
3694/// # Safety
3695///
3696/// Get the border top of a node instance.
3697///
3698/// # Arguments
3699/// * `node` - Raw pointer to the Node instance
3700///
3701/// # Returns
3702/// * `f32` - Border top
3703///
3704/// # Example
3705///
3706/// ```c
3707/// NodeLayoutGetBorderTop(node);
3708/// ```
3709#[no_mangle]
3710pub unsafe extern "C" fn NodeLayoutGetBorderTop(node: NodePtr) -> f32 {
3711 let node = &*(node as *mut Node);
3712 node.computed_style().border.top.to_f32()
3713}
3714
3715/// # Safety
3716///
3717/// Get the border bottom of a node instance.
3718///
3719/// # Arguments
3720/// * `node` - Raw pointer to the Node instance
3721///
3722/// # Returns
3723/// * `f32` - Border bottom
3724///
3725/// # Example
3726///
3727/// ```c
3728/// NodeLayoutGetBorderBottom(node);
3729/// ```
3730#[no_mangle]
3731pub unsafe extern "C" fn NodeLayoutGetBorderBottom(node: NodePtr) -> f32 {
3732 let node = &*(node as *mut Node);
3733 node.computed_style().border.bottom.to_f32()
3734}
3735
3736/// # Safety
3737///
3738/// Get the padding left of a node instance.
3739///
3740/// # Arguments
3741/// * `node` - Raw pointer to the Node instance
3742///
3743/// # Returns
3744/// * `f32` - Padding left
3745///
3746/// # Example
3747///
3748/// ```c
3749/// NodeLayoutGetPaddingLeft(node);
3750/// ```
3751#[no_mangle]
3752pub unsafe extern "C" fn NodeLayoutGetPaddingLeft(node: NodePtr) -> f32 {
3753 let node = &*(node as *mut Node);
3754 node.computed_style().padding.left.to_f32()
3755}
3756
3757/// # Safety
3758///
3759/// Get the padding right of a node instance.
3760///
3761/// # Arguments
3762/// * `node` - Raw pointer to the Node instance
3763///
3764/// # Returns
3765/// * `f32` - Padding right
3766///
3767/// # Example
3768///
3769/// ```c
3770/// NodeLayoutGetPaddingRight(node);
3771/// ```
3772#[no_mangle]
3773pub unsafe extern "C" fn NodeLayoutGetPaddingRight(node: NodePtr) -> f32 {
3774 let node = &*(node as *mut Node);
3775 node.computed_style().padding.right.to_f32()
3776}
3777
3778/// # Safety
3779///
3780/// Get the padding top of a node instance.
3781///
3782/// # Arguments
3783/// * `node` - Raw pointer to the Node instance
3784///
3785/// # Returns
3786/// * `f32` - Padding top
3787///
3788/// # Example
3789///
3790/// ```c
3791/// NodeLayoutGetPaddingTop(node);
3792/// ```
3793#[no_mangle]
3794pub unsafe extern "C" fn NodeLayoutGetPaddingTop(node: NodePtr) -> f32 {
3795 let node = &*(node as *mut Node);
3796 node.computed_style().padding.top.to_f32()
3797}
3798
3799/// # Safety
3800///
3801/// Get the padding bottom of a node instance.
3802///
3803/// # Arguments
3804/// * `node` - Raw pointer to the Node instance
3805///
3806/// # Returns
3807/// * `f32` - Padding bottom
3808///
3809/// # Example
3810///
3811/// ```c
3812/// NodeLayoutGetPaddingBottom(node);
3813/// ```
3814#[no_mangle]
3815pub unsafe extern "C" fn NodeLayoutGetPaddingBottom(node: NodePtr) -> f32 {
3816 let node = &*(node as *mut Node);
3817 node.computed_style().padding.bottom.to_f32()
3818}