Refactor enums to classes with static fields
This commit is contained in:
1 parent
d4c59568d7
commit
8d241a60e6
35 files changed
+551
-769
No files matched your search
@@ -4,44 +4,31 @@ package imgui.enums;
|
||||
* Flags for ImGui::Begin()
|
||||
*/
|
||||
public final class ImGuiWindowFlags {
|
||||
public static ImGuiWindowFlags None = new ImGuiWindowFlags(0);
|
||||
public static ImGuiWindowFlags NoTitleBar = new ImGuiWindowFlags(1 << 0);
|
||||
public static ImGuiWindowFlags NoResize = new ImGuiWindowFlags(1 << 1);
|
||||
public static ImGuiWindowFlags NoMove = new ImGuiWindowFlags(1 << 2);
|
||||
public static ImGuiWindowFlags NoScrollbar = new ImGuiWindowFlags(1 << 3);
|
||||
public static ImGuiWindowFlags NoScrollWithMouse = new ImGuiWindowFlags(1 << 4);
|
||||
public static ImGuiWindowFlags NoCollapse = new ImGuiWindowFlags(1 << 5);
|
||||
public static ImGuiWindowFlags AlwaysAutoResize = new ImGuiWindowFlags(1 << 6);
|
||||
public static ImGuiWindowFlags NoBackground = new ImGuiWindowFlags(1 << 7);
|
||||
public static ImGuiWindowFlags NoSavedSettings = new ImGuiWindowFlags(1 << 8);
|
||||
public static ImGuiWindowFlags NoMouseInputs = new ImGuiWindowFlags(1 << 9);
|
||||
public static ImGuiWindowFlags MenuBar = new ImGuiWindowFlags(1 << 10);
|
||||
public static ImGuiWindowFlags HorizontalScrollbar = new ImGuiWindowFlags(1 << 11);
|
||||
public static ImGuiWindowFlags NoFocusOnAppearing = new ImGuiWindowFlags(1 << 12);
|
||||
public static ImGuiWindowFlags NoBringToFrontOnFocus = new ImGuiWindowFlags(1 << 13);
|
||||
public static ImGuiWindowFlags AlwaysVerticalScrollbar = new ImGuiWindowFlags(1 << 14);
|
||||
public static ImGuiWindowFlags AlwaysHorizontalScrollbar = new ImGuiWindowFlags(1 << 15);
|
||||
public static ImGuiWindowFlags AlwaysUseWindowPadding = new ImGuiWindowFlags(1 << 16);
|
||||
public static ImGuiWindowFlags NoNavInputs = new ImGuiWindowFlags(1 << 18);
|
||||
public static ImGuiWindowFlags NoNavFocus = new ImGuiWindowFlags(1 << 19);
|
||||
public static ImGuiWindowFlags UnsavedDocument = new ImGuiWindowFlags(1 << 20);
|
||||
public static ImGuiWindowFlags NoDocking = new ImGuiWindowFlags(1 << 21);
|
||||
public static ImGuiWindowFlags NoNav = new ImGuiWindowFlags(NoNavInputs.getValue() | NoNavFocus.getValue());
|
||||
public static ImGuiWindowFlags NoDecoration = new ImGuiWindowFlags(NoTitleBar.getValue() | NoResize.getValue() | NoScrollbar.getValue() | NoCollapse.getValue());
|
||||
public static ImGuiWindowFlags NoInputs = new ImGuiWindowFlags(NoMouseInputs.getValue() | NoNavInputs.getValue() | NoNavFocus.getValue());
|
||||
private static ImGuiWindowFlags Custom = new ImGuiWindowFlags(0);
|
||||
int value;
|
||||
|
||||
private ImGuiWindowFlags(int code) {
|
||||
value = code;
|
||||
private ImGuiWindowFlags() {
|
||||
}
|
||||
|
||||
public ImGuiWindowFlags or(ImGuiWindowFlags otherEnum) {
|
||||
ImGuiWindowFlags.Custom.value = value | otherEnum.value;
|
||||
return ImGuiWindowFlags.Custom;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
public static final int None = 0;
|
||||
public static final int NoTitleBar = 1; // Disable title-bar
|
||||
public static final int NoResize = 1 << 1; // Disable user resizing with the lower-right grip
|
||||
public static final int NoMove = 1 << 2; // Disable user moving the window
|
||||
public static final int NoScrollbar = 1 << 3; // Disable scrollbars (window can still scroll with mouse or programmatically)
|
||||
public static final int NoScrollWithMouse = 1 << 4; // Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set.
|
||||
public static final int NoCollapse = 1 << 5; // Disable user collapsing window by double-clicking on it
|
||||
public static final int AlwaysAutoResize = 1 << 6; // Resize every window to its content every frame
|
||||
public static final int NoBackground = 1 << 7; // Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f).
|
||||
public static final int NoSavedSettings = 1 << 8; // Never load/save settings in .ini file
|
||||
public static final int NoMouseInputs = 1 << 9; // Disable catching mouse, hovering test with pass through.
|
||||
public static final int MenuBar = 1 << 1; // Has a menu-bar
|
||||
public static final int HorizontalScrollbar = 1 << 1; // Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
|
||||
public static final int NoFocusOnAppearing = 1 << 1; // Disable taking focus when transitioning from hidden to visible state
|
||||
public static final int NoBringToFrontOnFocus = 1 << 1; // Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus)
|
||||
public static final int AlwaysVerticalScrollbar = 1 << 1; // Always show vertical scrollbar (even if ContentSize.y < Size.y)
|
||||
public static final int AlwaysHorizontalScrollbar = 1 << 1; // Always show horizontal scrollbar (even if ContentSize.x < Size.x)
|
||||
public static final int AlwaysUseWindowPadding = 1 << 1; // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
|
||||
public static final int NoNavInputs = 1 << 1; // No gamepad/keyboard navigation within the window
|
||||
public static final int NoNavFocus = 1 << 1; // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
|
||||
public static final int UnsavedDocument = 1 << 2; // Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator. When used in a tab/docking context, tab is selected on closure and closure is deferred by one frame to allow code to cancel the closure (with a confirmation popup, etc.) without flicker.
|
||||
public static final int NoNav = NoNavInputs | NoNavFocus;
|
||||
public static final int NoDecoration = NoTitleBar | NoResize | NoScrollbar | NoCollapse;
|
||||
public static final int NoInputs = NoMouseInputs | NoNavInputs | NoNavFocus;
|
||||
}
|
||||
Reference in new issue
Block a user