Refactor enums to classes with static fields

This commit is contained in:
SpaiR committed 2019-12-29 23:59:39 +03:00
1 parent d4c59568d7
commit 8d241a60e6
35 files changed
+551 -769

No files matched your search

@@ -4,35 +4,24 @@ package imgui.enums;
* Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
*/
public final class ImGuiTreeNodeFlags {
public static ImGuiTreeNodeFlags None = new ImGuiTreeNodeFlags(0);
public static ImGuiTreeNodeFlags Selected = new ImGuiTreeNodeFlags(1 << 0);
public static ImGuiTreeNodeFlags Framed = new ImGuiTreeNodeFlags(1 << 1);
public static ImGuiTreeNodeFlags AllowItemOverlap = new ImGuiTreeNodeFlags(1 << 2);
public static ImGuiTreeNodeFlags NoTreePushOnOpen = new ImGuiTreeNodeFlags(1 << 3);
public static ImGuiTreeNodeFlags NoAutoOpenOnLog = new ImGuiTreeNodeFlags(1 << 4);
public static ImGuiTreeNodeFlags DefaultOpen = new ImGuiTreeNodeFlags(1 << 5);
public static ImGuiTreeNodeFlags OpenOnDoubleClick = new ImGuiTreeNodeFlags(1 << 6);
public static ImGuiTreeNodeFlags OpenOnArrow = new ImGuiTreeNodeFlags(1 << 7);
public static ImGuiTreeNodeFlags Leaf = new ImGuiTreeNodeFlags(1 << 8);
public static ImGuiTreeNodeFlags Bullet = new ImGuiTreeNodeFlags(1 << 9);
public static ImGuiTreeNodeFlags FramePadding = new ImGuiTreeNodeFlags(1 << 10);
// public static ImGuiTreeNodeFlags SpanAllAvailWidth = new ImGuiTreeNodeFlags(1 << 11);
// public static ImGuiTreeNodeFlags NoScrollOnOpen = new ImGuiTreeNodeFlags(1 << 12);
public static ImGuiTreeNodeFlags NavLeftJumpsBackHere = new ImGuiTreeNodeFlags(1 << 13);
public static ImGuiTreeNodeFlags CollapsingHeader = new ImGuiTreeNodeFlags(Framed.getValue() | NoTreePushOnOpen.getValue() | NoAutoOpenOnLog.getValue());
private static ImGuiTreeNodeFlags Custom = new ImGuiTreeNodeFlags(0);
int value;
private ImGuiTreeNodeFlags(int value) {
this.value = value;
private ImGuiTreeNodeFlags() {
}
public int getValue() {
return value;
}
public ImGuiTreeNodeFlags or(ImGuiTreeNodeFlags otherEnum) {
ImGuiTreeNodeFlags.Custom.value = value | otherEnum.value;
return ImGuiTreeNodeFlags.Custom;
}
public static final int None = 0;
public static final int Selected = 1; // Draw as selected
public static final int Framed = 1 << 1; // Full colored frame (e.g. for CollapsingHeader)
public static final int AllowItemOverlap = 1 << 2; // Hit testing to allow subsequent widgets to overlap this one
public static final int NoTreePushOnOpen = 1 << 3; // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
public static final int NoAutoOpenOnLog = 1 << 4; // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
public static final int DefaultOpen = 1 << 5; // Default node to be open
public static final int OpenOnDoubleClick = 1 << 6; // Need double-click to open node
public static final int OpenOnArrow = 1 << 7; // Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
public static final int Leaf = 1 << 8; // No collapsing, no arrow (use as a convenience for leaf nodes).
public static final int Bullet = 1 << 9; // Display a bullet instead of arrow
public static final int FramePadding = 1 << 1; // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
public static final int SpanAvailWidth = 1 << 1; // Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default.
public static final int SpanFullWidth = 1 << 1; // Extend hit box to the left-most and right-most edges (bypass the indented area).
public static final int NavLeftJumpsBackHere = 1 << 1; // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14; // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
public static final int CollapsingHeader = Framed | NoTreePushOnOpen | NoAutoOpenOnLog;
}