Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/lwjgl3
Path: blob/3.3.1/modules/lwjgl/nuklear/src/generated/java/org/lwjgl/nuklear/NkConfigStackStyleItem.java
2570 views
1
/*
2
* Copyright LWJGL. All rights reserved.
3
* License terms: https://www.lwjgl.org/license
4
* MACHINE GENERATED FILE, DO NOT EDIT
5
*/
6
package org.lwjgl.nuklear;
7
8
import javax.annotation.*;
9
10
import java.nio.*;
11
12
import org.lwjgl.system.*;
13
14
import static org.lwjgl.system.Checks.*;
15
import static org.lwjgl.system.MemoryUtil.*;
16
17
/**
18
* <h3>Layout</h3>
19
*
20
* <pre><code>
21
* struct nk_config_stack_style_item {
22
* int head;
23
* {@link NkConfigStackStyleItemElement struct nk_config_stack_style_item_element} elements[16];
24
* }</code></pre>
25
*/
26
@NativeType("struct nk_config_stack_style_item")
27
class NkConfigStackStyleItem extends Struct {
28
29
/** The struct size in bytes. */
30
public static final int SIZEOF;
31
32
/** The struct alignment in bytes. */
33
public static final int ALIGNOF;
34
35
/** The struct member offsets. */
36
public static final int
37
HEAD,
38
ELEMENTS;
39
40
static {
41
Layout layout = __struct(
42
__member(4),
43
__array(NkConfigStackStyleItemElement.SIZEOF, NkConfigStackStyleItemElement.ALIGNOF, 16)
44
);
45
46
SIZEOF = layout.getSize();
47
ALIGNOF = layout.getAlignment();
48
49
HEAD = layout.offsetof(0);
50
ELEMENTS = layout.offsetof(1);
51
}
52
53
/**
54
* Creates a {@code NkConfigStackStyleItem} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
55
* visible to the struct instance and vice versa.
56
*
57
* <p>The created instance holds a strong reference to the container object.</p>
58
*/
59
NkConfigStackStyleItem(ByteBuffer container) {
60
super(memAddress(container), __checkContainer(container, SIZEOF));
61
}
62
63
@Override
64
public int sizeof() { return SIZEOF; }
65
66
/** @return the value of the {@code head} field. */
67
public int head() { return nhead(address()); }
68
/** @return a {@link NkConfigStackStyleItemElement}.Buffer view of the {@code elements} field. */
69
@NativeType("struct nk_config_stack_style_item_element[16]")
70
public NkConfigStackStyleItemElement.Buffer elements() { return nelements(address()); }
71
/** @return a {@link NkConfigStackStyleItemElement} view of the struct at the specified index of the {@code elements} field. */
72
@NativeType("struct nk_config_stack_style_item_element")
73
public NkConfigStackStyleItemElement elements(int index) { return nelements(address(), index); }
74
75
// -----------------------------------
76
77
/** Returns a new {@code NkConfigStackStyleItem} instance for the specified memory address. */
78
public static NkConfigStackStyleItem create(long address) {
79
return wrap(NkConfigStackStyleItem.class, address);
80
}
81
82
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
83
@Nullable
84
public static NkConfigStackStyleItem createSafe(long address) {
85
return address == NULL ? null : wrap(NkConfigStackStyleItem.class, address);
86
}
87
88
/**
89
* Create a {@link NkConfigStackStyleItem.Buffer} instance at the specified memory.
90
*
91
* @param address the memory address
92
* @param capacity the buffer capacity
93
*/
94
public static NkConfigStackStyleItem.Buffer create(long address, int capacity) {
95
return wrap(Buffer.class, address, capacity);
96
}
97
98
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
99
@Nullable
100
public static NkConfigStackStyleItem.Buffer createSafe(long address, int capacity) {
101
return address == NULL ? null : wrap(Buffer.class, address, capacity);
102
}
103
104
// -----------------------------------
105
106
/** Unsafe version of {@link #head}. */
107
public static int nhead(long struct) { return UNSAFE.getInt(null, struct + NkConfigStackStyleItem.HEAD); }
108
/** Unsafe version of {@link #elements}. */
109
public static NkConfigStackStyleItemElement.Buffer nelements(long struct) { return NkConfigStackStyleItemElement.create(struct + NkConfigStackStyleItem.ELEMENTS, 16); }
110
/** Unsafe version of {@link #elements(int) elements}. */
111
public static NkConfigStackStyleItemElement nelements(long struct, int index) {
112
return NkConfigStackStyleItemElement.create(struct + NkConfigStackStyleItem.ELEMENTS + check(index, 16) * NkConfigStackStyleItemElement.SIZEOF);
113
}
114
115
// -----------------------------------
116
117
/** An array of {@link NkConfigStackStyleItem} structs. */
118
public static class Buffer extends StructBuffer<NkConfigStackStyleItem, Buffer> {
119
120
private static final NkConfigStackStyleItem ELEMENT_FACTORY = NkConfigStackStyleItem.create(-1L);
121
122
/**
123
* Creates a new {@code NkConfigStackStyleItem.Buffer} instance backed by the specified container.
124
*
125
* Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
126
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
127
* by {@link NkConfigStackStyleItem#SIZEOF}, and its mark will be undefined.
128
*
129
* <p>The created buffer instance holds a strong reference to the container object.</p>
130
*/
131
public Buffer(ByteBuffer container) {
132
super(container, container.remaining() / SIZEOF);
133
}
134
135
public Buffer(long address, int cap) {
136
super(address, null, -1, 0, cap, cap);
137
}
138
139
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
140
super(address, container, mark, pos, lim, cap);
141
}
142
143
@Override
144
protected Buffer self() {
145
return this;
146
}
147
148
@Override
149
protected NkConfigStackStyleItem getElementFactory() {
150
return ELEMENT_FACTORY;
151
}
152
153
/** @return the value of the {@code head} field. */
154
public int head() { return NkConfigStackStyleItem.nhead(address()); }
155
/** @return a {@link NkConfigStackStyleItemElement}.Buffer view of the {@code elements} field. */
156
@NativeType("struct nk_config_stack_style_item_element[16]")
157
public NkConfigStackStyleItemElement.Buffer elements() { return NkConfigStackStyleItem.nelements(address()); }
158
/** @return a {@link NkConfigStackStyleItemElement} view of the struct at the specified index of the {@code elements} field. */
159
@NativeType("struct nk_config_stack_style_item_element")
160
public NkConfigStackStyleItemElement elements(int index) { return NkConfigStackStyleItem.nelements(address(), index); }
161
162
}
163
164
}
165