Skip to main content

easy_imgui/
enums.rs

1// These enums have the same name as their C++ equivalent, do not warn about it
2#![allow(non_upper_case_globals)]
3
4use easy_imgui_sys::*;
5
6// In most API calls enums are passed as integers, but a few are true enums.
7// But since the code to wrap the enums is created by a macro, we use this trait
8// to do the necessary conversions.
9
10use std::ffi::c_int;
11
12trait BitEnumHelper {
13    fn to_bits(self) -> c_int;
14    fn from_bits(t: c_int) -> Self;
15}
16
17impl BitEnumHelper for c_int {
18    #[inline]
19    fn to_bits(self) -> c_int {
20        self
21    }
22    #[inline]
23    fn from_bits(t: c_int) -> Self {
24        t
25    }
26}
27
28macro_rules! impl_bit_enum_helper {
29    ($native_name:ident) => {
30        impl BitEnumHelper for $native_name {
31            #[inline]
32            fn to_bits(self) -> c_int {
33                self.0 as _
34            }
35            #[inline]
36            fn from_bits(t: c_int) -> Self {
37                Self(t as _)
38            }
39        }
40    };
41}
42
43macro_rules! imgui_enum_ex {
44    ($vis:vis $name:ident : $native_name:ident : $native_name_api:ty { $( $(#[$inner:ident $($args:tt)*])* $field:ident = $value:ident),* $(,)? }) => {
45        #[repr(i32)]
46        #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
47        $vis enum $name {
48            $(
49                $(#[$inner $($args)*])*
50                $field = $native_name::$value.0 as i32,
51            )*
52        }
53        impl $name {
54            pub fn bits(self) -> $native_name_api {
55                <$native_name_api>::from_bits(self as c_int)
56            }
57            pub fn from_bits(bits: $native_name_api) -> Option<Self> {
58                $(
59                    $(#[$inner $($args)*])*
60                    const $field: c_int = $native_name::$value.0 as i32;
61                )*
62                let r = match <$native_name_api>::to_bits(bits) {
63                    $(
64                        $(#[$inner $($args)*])*
65                        $field => Self::$field,
66                    )*
67                    _ => return std::option::Option::None,
68                };
69                Some(r)
70            }
71        }
72    };
73}
74
75macro_rules! imgui_enum {
76    ($vis:vis $name:ident: $native_name:ident { $( $(#[$inner:ident $($args:tt)*])* $field:ident ),* $(,)? }) => {
77        paste::paste! {
78            imgui_enum_ex! {
79                $vis $name: $native_name: i32 {
80                    $( $(#[$inner $($args)*])* $field = [<$native_name $field>],)*
81                }
82            }
83        }
84    };
85}
86
87// Just like imgui_enum but for native strong C++ enums
88macro_rules! imgui_scoped_enum {
89    ($vis:vis $name:ident: $native_name:ident { $( $(#[$inner:ident $($args:tt)*])* $field:ident ),* $(,)? }) => {
90        impl_bit_enum_helper!{$native_name}
91        paste::paste! {
92            imgui_enum_ex! {
93                $vis $name: $native_name: $native_name {
94                    $( $(#[$inner $($args)*])* $field = [<$native_name _ $field>],)*
95                }
96            }
97        }
98    };
99}
100
101macro_rules! imgui_flags_ex {
102    ($vis:vis $name:ident: $native_name:ident { $( $(#[$inner:ident $($args:tt)*])* $field:ident = $($value:ident)::*),* $(,)? }) => {
103        bitflags::bitflags! {
104            #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
105            $vis struct $name : i32 {
106                $(
107                    $(#[$inner $($args)*])*
108                    const $field = imgui_flags_ex! { @FIELD $native_name :: $($value)::* };
109                )*
110            }
111        }
112    };
113    (@FIELD $native_name:ident :: $value:ident) => {
114        $native_name::$value.0 as i32
115    };
116    (@FIELD $native_name:ident :: $alt_native_name:ident :: $value:ident) => {
117        // ignore native_name, use alt_native_name instead
118        $alt_native_name::$value.0 as i32
119    };
120}
121
122macro_rules! imgui_flags {
123    ($vis:vis $name:ident: $native_name:ident { $( $(#[$inner:ident $($args:tt)*])* $field:ident),* $(,)? }) => {
124        paste::paste! {
125            imgui_flags_ex! {
126                $vis $name: $native_name {
127                    $( $(#[$inner $($args)*])* $field = [<$native_name $field>],)*
128                }
129            }
130        }
131    };
132}
133imgui_flags! {
134    pub DrawFlags: ImDrawFlags_ {
135        None,
136        Closed,
137        RoundCornersTopLeft,
138        RoundCornersTopRight,
139        RoundCornersBottomLeft,
140        RoundCornersBottomRight,
141        RoundCornersNone,
142        RoundCornersTop,
143        RoundCornersBottom,
144        RoundCornersLeft,
145        RoundCornersRight,
146        RoundCornersAll,
147    }
148}
149
150imgui_enum! {
151    pub Cond: ImGuiCond_ {
152        Always,
153        Once,
154        FirstUseEver,
155        Appearing,
156    }
157}
158
159imgui_enum! {
160    pub ColorId: ImGuiCol_ {
161        Text,
162        TextDisabled,
163        WindowBg,
164        ChildBg,
165        PopupBg,
166        Border,
167        BorderShadow,
168        FrameBg,
169        FrameBgHovered,
170        FrameBgActive,
171        TitleBg,
172        TitleBgActive,
173        TitleBgCollapsed,
174        MenuBarBg,
175        ScrollbarBg,
176        ScrollbarGrab,
177        ScrollbarGrabHovered,
178        ScrollbarGrabActive,
179        CheckMark,
180        CheckboxSelectedBg,
181        SliderGrab,
182        SliderGrabActive,
183        Button,
184        ButtonHovered,
185        ButtonActive,
186        Header,
187        HeaderHovered,
188        HeaderActive,
189        Separator,
190        SeparatorHovered,
191        SeparatorActive,
192        ResizeGrip,
193        ResizeGripHovered,
194        ResizeGripActive,
195        InputTextCursor,
196        TabHovered,
197        Tab,
198        TabSelected,
199        TabSelectedOverline,
200        TabDimmed,
201        TabDimmedSelected,
202        TabDimmedSelectedOverline,
203        DockingPreview,
204        DockingEmptyBg,
205        PlotLines,
206        PlotLinesHovered,
207        PlotHistogram,
208        PlotHistogramHovered,
209        TableHeaderBg,
210        TableBorderStrong,
211        TableBorderLight,
212        TableRowBg,
213        TableRowBgAlt,
214        TextLink,
215        TextSelectedBg,
216        TreeLines,
217        DragDropTarget,
218        DragDropTargetBg,
219        UnsavedMarker,
220        NavCursor,
221        NavWindowingHighlight,
222        NavWindowingDimBg,
223        ModalWindowDimBg,
224    }
225}
226
227imgui_enum! {
228    pub StyleVar: ImGuiStyleVar_ {
229        Alpha,
230        DisabledAlpha,
231        WindowPadding,
232        WindowRounding,
233        WindowBorderSize,
234        WindowMinSize,
235        WindowTitleAlign,
236        ChildRounding,
237        ChildBorderSize,
238        PopupRounding,
239        PopupBorderSize,
240        FramePadding,
241        FrameRounding,
242        FrameBorderSize,
243        ItemSpacing,
244        ItemInnerSpacing,
245        IndentSpacing,
246        CellPadding,
247        ScrollbarSize,
248        ScrollbarRounding,
249        ScrollbarPadding,
250        GrabMinSize,
251        GrabRounding,
252        ImageRounding,
253        ImageBorderSize,
254        TabRounding,
255        TabBorderSize,
256        TabMinWidthBase,
257        TabMinWidthShrink,
258        TabBarBorderSize,
259        TabBarOverlineSize,
260        TableAngledHeadersAngle,
261        TableAngledHeadersTextAlign,
262        TreeLinesSize,
263        TreeLinesRounding,
264        DragDropTargetRounding,
265        ButtonTextAlign,
266        SelectableTextAlign,
267        SeparatorSize,
268        SeparatorTextBorderSize,
269        SeparatorTextAlign,
270        SeparatorTextPadding,
271        DockingSeparatorSize,
272    }
273}
274
275imgui_flags! {
276    pub WindowFlags: ImGuiWindowFlags_ {
277        None,
278        NoTitleBar,
279        NoResize,
280        NoMove,
281        NoScrollbar,
282        NoScrollWithMouse,
283        NoCollapse,
284        AlwaysAutoResize,
285        NoBackground,
286        NoSavedSettings,
287        NoMouseInputs,
288        MenuBar,
289        HorizontalScrollbar,
290        NoFocusOnAppearing,
291        NoBringToFrontOnFocus,
292        AlwaysVerticalScrollbar,
293        AlwaysHorizontalScrollbar,
294        NoNavInputs,
295        NoNavFocus,
296        UnsavedDocument,
297        NoDocking,
298        NoNav,
299        NoDecoration,
300        NoInputs,
301    }
302}
303
304imgui_flags! {
305    pub ChildFlags: ImGuiChildFlags_ {
306        None,
307        Borders,
308        AlwaysUseWindowPadding,
309        ResizeX,
310        ResizeY,
311        AutoResizeX,
312        AutoResizeY,
313        AlwaysAutoResize,
314        FrameStyle,
315        NavFlattened,
316    }
317}
318imgui_flags! {
319    pub ButtonFlags: ImGuiButtonFlags_ {
320        None,
321        MouseButtonLeft,
322        MouseButtonRight,
323        MouseButtonMiddle,
324        EnableNav,
325        AllowOverlap,
326    }
327}
328
329imgui_scoped_enum! {
330    pub Dir: ImGuiDir {
331        Left,
332        Right,
333        Up,
334        Down,
335    }
336}
337
338imgui_flags! {
339    pub ComboFlags: ImGuiComboFlags_ {
340        None,
341        PopupAlignLeft,
342        HeightSmall,
343        HeightRegular,
344        HeightLarge,
345        HeightLargest,
346        NoArrowButton,
347        NoPreview,
348    }
349}
350
351imgui_flags! {
352    pub SelectableFlags: ImGuiSelectableFlags_ {
353        None,
354        NoAutoClosePopups,
355        SpanAllColumns,
356        AllowDoubleClick,
357        Disabled,
358        AllowOverlap,
359        Highlight,
360        SelectOnNav,
361    }
362}
363
364imgui_flags! {
365    pub SliderFlags: ImGuiSliderFlags_ {
366        None,
367        Logarithmic,
368        NoRoundToFormat,
369        NoInput,
370        WrapAround,
371        ClampOnInput,
372        ClampZeroRange,
373        NoSpeedTweaks,
374        ColorMarkers,
375        AlwaysClamp,
376    }
377}
378
379imgui_flags! {
380    pub InputTextFlags: ImGuiInputTextFlags_ {
381        //Basic filters
382        None,
383        CharsDecimal,
384        CharsHexadecimal,
385        CharsScientific,
386        CharsUppercase,
387        CharsNoBlank,
388
389        // Inputs
390        AllowTabInput,
391        EnterReturnsTrue,
392        EscapeClearsAll,
393        CtrlEnterForNewLine,
394
395        // Other options
396        ReadOnly,
397        Password,
398        AlwaysOverwrite,
399        AutoSelectAll,
400        ParseEmptyRefVal,
401        DisplayEmptyRefVal,
402        NoHorizontalScroll,
403        NoUndoRedo,
404
405        // Elide display / Alignment
406        ElideLeft,
407
408        // Callback features
409        CallbackCompletion,
410        CallbackHistory,
411        CallbackAlways,
412        CallbackCharFilter,
413        CallbackResize,
414        CallbackEdit,
415
416        // Multi-line Word-Wrapping [BETA]
417        WordWrap,
418    }
419}
420
421imgui_flags! {
422    pub HoveredFlags: ImGuiHoveredFlags_ {
423        None,
424        ChildWindows,
425        RootWindow,
426        AnyWindow,
427        NoPopupHierarchy,
428        DockHierarchy,
429        AllowWhenBlockedByPopup,
430        //AllowWhenBlockedByModal,
431        AllowWhenBlockedByActiveItem,
432        AllowWhenOverlappedByItem,
433        AllowWhenOverlappedByWindow,
434        AllowWhenDisabled,
435        NoNavOverride,
436        AllowWhenOverlapped,
437        RectOnly,
438        RootAndChildWindows,
439        ForTooltip,
440        Stationary,
441        DelayNone,
442        DelayShort,
443        DelayNormal,
444        NoSharedDelay,
445    }
446}
447
448#[repr(i32)]
449#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
450pub enum MouseButton {
451    Left,
452    Right,
453    Middle,
454    Other(u16),
455}
456
457impl MouseButton {
458    pub fn bits(self) -> i32 {
459        match self {
460            MouseButton::Left => ImGuiMouseButton_::ImGuiMouseButton_Left.0 as i32,
461            MouseButton::Right => ImGuiMouseButton_::ImGuiMouseButton_Right.0 as i32,
462            MouseButton::Middle => ImGuiMouseButton_::ImGuiMouseButton_Middle.0 as i32,
463            MouseButton::Other(x) => x as i32,
464        }
465    }
466}
467
468imgui_enum! {
469    pub MouseCursor : ImGuiMouseCursor_ {
470        None,
471        Arrow,
472        TextInput,
473        ResizeAll,
474        ResizeNS,
475        ResizeEW,
476        ResizeNESW,
477        ResizeNWSE,
478        Hand,
479        NotAllowed,
480    }
481}
482
483// ImGuiKey is named weirdly
484impl_bit_enum_helper! {ImGuiKey}
485
486imgui_enum_ex! {
487    pub Key: ImGuiKey: ImGuiKey {
488        None = ImGuiKey_None,
489        Tab = ImGuiKey_Tab,
490        LeftArrow = ImGuiKey_LeftArrow,
491        RightArrow = ImGuiKey_RightArrow,
492        UpArrow = ImGuiKey_UpArrow,
493        DownArrow = ImGuiKey_DownArrow,
494        PageUp = ImGuiKey_PageUp,
495        PageDown = ImGuiKey_PageDown,
496        Home = ImGuiKey_Home,
497        End = ImGuiKey_End,
498        Insert = ImGuiKey_Insert,
499        Delete = ImGuiKey_Delete,
500        Backspace = ImGuiKey_Backspace,
501        Space = ImGuiKey_Space,
502        Enter = ImGuiKey_Enter,
503        Escape = ImGuiKey_Escape,
504        LeftCtrl = ImGuiKey_LeftCtrl,
505        LeftShift = ImGuiKey_LeftShift,
506        LeftAlt = ImGuiKey_LeftAlt,
507        LeftSuper = ImGuiKey_LeftSuper,
508        RightCtrl = ImGuiKey_RightCtrl,
509        RightShift = ImGuiKey_RightShift,
510        RightAlt = ImGuiKey_RightAlt,
511        RightSuper = ImGuiKey_RightSuper,
512        Menu = ImGuiKey_Menu,
513        Num0 = ImGuiKey_0,
514        Num1 = ImGuiKey_1,
515        Num2 = ImGuiKey_2,
516        Num3 = ImGuiKey_3,
517        Num4 = ImGuiKey_4,
518        Num5 = ImGuiKey_5,
519        Num6 = ImGuiKey_6,
520        Num7 = ImGuiKey_7,
521        Num8 = ImGuiKey_8,
522        Num9 = ImGuiKey_9,
523        A = ImGuiKey_A,
524        B = ImGuiKey_B,
525        C = ImGuiKey_C,
526        D = ImGuiKey_D,
527        E = ImGuiKey_E,
528        F = ImGuiKey_F,
529        G = ImGuiKey_G,
530        H = ImGuiKey_H,
531        I = ImGuiKey_I,
532        J = ImGuiKey_J,
533        K = ImGuiKey_K,
534        L = ImGuiKey_L,
535        M = ImGuiKey_M,
536        N = ImGuiKey_N,
537        O = ImGuiKey_O,
538        P = ImGuiKey_P,
539        Q = ImGuiKey_Q,
540        R = ImGuiKey_R,
541        S = ImGuiKey_S,
542        T = ImGuiKey_T,
543        U = ImGuiKey_U,
544        V = ImGuiKey_V,
545        W = ImGuiKey_W,
546        X = ImGuiKey_X,
547        Y = ImGuiKey_Y,
548        Z = ImGuiKey_Z,
549        F1 = ImGuiKey_F1,
550        F2 = ImGuiKey_F2,
551        F3 = ImGuiKey_F3,
552        F4 = ImGuiKey_F4,
553        F5 = ImGuiKey_F5,
554        F6 = ImGuiKey_F6,
555        F7 = ImGuiKey_F7,
556        F8 = ImGuiKey_F8,
557        F9 = ImGuiKey_F9,
558        F10 = ImGuiKey_F10,
559        F11 = ImGuiKey_F11,
560        F12 = ImGuiKey_F12,
561        Apostrophe = ImGuiKey_Apostrophe,
562        Comma = ImGuiKey_Comma,
563        Minus = ImGuiKey_Minus,
564        Period = ImGuiKey_Period,
565        Slash = ImGuiKey_Slash,
566        Semicolon = ImGuiKey_Semicolon,
567        Equal = ImGuiKey_Equal,
568        LeftBracket = ImGuiKey_LeftBracket,
569        Backslash = ImGuiKey_Backslash,
570        RightBracket = ImGuiKey_RightBracket,
571        GraveAccent = ImGuiKey_GraveAccent,
572        CapsLock = ImGuiKey_CapsLock,
573        ScrollLock = ImGuiKey_ScrollLock,
574        NumLock = ImGuiKey_NumLock,
575        PrintScreen = ImGuiKey_PrintScreen,
576        Pause = ImGuiKey_Pause,
577        Keypad0 = ImGuiKey_Keypad0,
578        Keypad1 = ImGuiKey_Keypad1,
579        Keypad2 = ImGuiKey_Keypad2,
580        Keypad3 = ImGuiKey_Keypad3,
581        Keypad4 = ImGuiKey_Keypad4,
582        Keypad5 = ImGuiKey_Keypad5,
583        Keypad6 = ImGuiKey_Keypad6,
584        Keypad7 = ImGuiKey_Keypad7,
585        Keypad8 = ImGuiKey_Keypad8,
586        Keypad9 = ImGuiKey_Keypad9,
587        KeypadDecimal = ImGuiKey_KeypadDecimal,
588        KeypadDivide = ImGuiKey_KeypadDivide,
589        KeypadMultiply = ImGuiKey_KeypadMultiply,
590        KeypadSubtract = ImGuiKey_KeypadSubtract,
591        KeypadAdd = ImGuiKey_KeypadAdd,
592        KeypadEnter = ImGuiKey_KeypadEnter,
593        KeypadEqual = ImGuiKey_KeypadEqual,
594        AppBack = ImGuiKey_AppBack,
595        AppForward = ImGuiKey_AppForward,
596        Oem102 = ImGuiKey_Oem102,
597
598        GamepadStart = ImGuiKey_GamepadStart,
599        GamepadBack = ImGuiKey_GamepadBack,
600        GamepadFaceLeft = ImGuiKey_GamepadFaceLeft,
601        GamepadFaceRight = ImGuiKey_GamepadFaceRight,
602        GamepadFaceUp = ImGuiKey_GamepadFaceUp,
603        GamepadFaceDown = ImGuiKey_GamepadFaceDown,
604        GamepadDpadLeft = ImGuiKey_GamepadDpadLeft,
605        GamepadDpadRight = ImGuiKey_GamepadDpadRight,
606        GamepadDpadUp = ImGuiKey_GamepadDpadUp,
607        GamepadDpadDown = ImGuiKey_GamepadDpadDown,
608        GamepadL1 = ImGuiKey_GamepadL1,
609        GamepadR1 = ImGuiKey_GamepadR1,
610        GamepadL2 = ImGuiKey_GamepadL2,
611        GamepadR2 = ImGuiKey_GamepadR2,
612        GamepadL3 = ImGuiKey_GamepadL3,
613        GamepadR3 = ImGuiKey_GamepadR3,
614        GamepadLStickLeft = ImGuiKey_GamepadLStickLeft,
615        GamepadLStickRight = ImGuiKey_GamepadLStickRight,
616        GamepadLStickUp = ImGuiKey_GamepadLStickUp,
617        GamepadLStickDown = ImGuiKey_GamepadLStickDown,
618        GamepadRStickLeft = ImGuiKey_GamepadRStickLeft,
619        GamepadRStickRight = ImGuiKey_GamepadRStickRight,
620        GamepadRStickUp = ImGuiKey_GamepadRStickUp,
621        GamepadRStickDown = ImGuiKey_GamepadRStickDown,
622
623        MouseLeft = ImGuiKey_MouseLeft,
624        MouseRight = ImGuiKey_MouseRight,
625        MouseMiddle = ImGuiKey_MouseMiddle,
626        MouseX1 = ImGuiKey_MouseX1,
627        MouseX2 = ImGuiKey_MouseX2,
628        MouseWheelX = ImGuiKey_MouseWheelX,
629        MouseWheelY = ImGuiKey_MouseWheelY,
630
631        // These are better handled as KeyMod, but sometimes can be seen as regular keys.
632        ModCtrl = ImGuiMod_Ctrl,
633        ModShift = ImGuiMod_Shift,
634        ModAlt = ImGuiMod_Alt,
635        ModSuper = ImGuiMod_Super,
636    }
637}
638
639// ImGuiMod is not a real enum in the .h but are part of ImGuiKey.
640// We week them separated because they can be OR-combined with keys and between them.
641imgui_flags_ex! {
642    pub KeyMod: ImGuiKey {
643        None = ImGuiMod_None,
644        Ctrl = ImGuiMod_Ctrl,
645        Shift = ImGuiMod_Shift,
646        Alt = ImGuiMod_Alt,
647        Super = ImGuiMod_Super,
648    }
649}
650
651impl TryFrom<Key> for KeyMod {
652    type Error = ();
653    fn try_from(key: Key) -> Result<KeyMod, Self::Error> {
654        match key {
655            Key::ModCtrl => Ok(KeyMod::Ctrl),
656            Key::ModShift => Ok(KeyMod::Shift),
657            Key::ModAlt => Ok(KeyMod::Alt),
658            Key::ModSuper => Ok(KeyMod::Super),
659            // KeyMod is a bitflags, but only one can be converted to Key
660            _ => Err(()),
661        }
662    }
663}
664
665imgui_flags! {
666    pub ViewportFlags: ImGuiViewportFlags_ {
667        None,
668        IsPlatformWindow,
669        IsPlatformMonitor,
670        OwnedByApp,
671        NoDecoration,
672        NoTaskBarIcon,
673        NoFocusOnAppearing,
674        NoFocusOnClick,
675        NoInputs,
676        NoRendererClear,
677        NoAutoMerge,
678        TopMost,
679        CanHostOtherWindows,
680        IsMinimized,
681        IsFocused,
682    }
683}
684
685imgui_flags! {
686    pub PopupFlags: ImGuiPopupFlags_ {
687        None,
688        MouseButtonLeft,
689        MouseButtonRight,
690        MouseButtonMiddle,
691        NoReopen,
692        NoOpenOverExistingPopup,
693        NoOpenOverItems,
694        AnyPopupId,
695        AnyPopupLevel,
696        AnyPopup,
697    }
698}
699
700imgui_flags! {
701    pub ConfigFlags: ImGuiConfigFlags_ {
702        None,
703        NavEnableKeyboard,
704        NavEnableGamepad,
705        NoMouse,
706        NoMouseCursorChange,
707        DockingEnable,
708        ViewportsEnable,
709        IsSRGB,
710        IsTouchScreen,
711    }
712}
713
714imgui_flags! {
715    pub TreeNodeFlags: ImGuiTreeNodeFlags_ {
716        None,
717        Selected,
718        Framed,
719        AllowOverlap,
720        NoTreePushOnOpen,
721        NoAutoOpenOnLog,
722        DefaultOpen,
723        OpenOnDoubleClick,
724        OpenOnArrow,
725        Leaf,
726        Bullet,
727        FramePadding,
728        SpanAvailWidth,
729        SpanFullWidth,
730        SpanLabelWidth,
731        SpanAllColumns,
732        LabelSpanAllColumns,
733        NavLeftJumpsToParent,
734        //NoScrollOnOpen,
735        CollapsingHeader,
736        DrawLinesNone,
737        DrawLinesFull,
738        DrawLinesToNodes,
739    }
740}
741
742imgui_flags! {
743    pub FocusedFlags: ImGuiFocusedFlags_ {
744        None,
745        ChildWindows,
746        RootWindow,
747        AnyWindow,
748        NoPopupHierarchy,
749        DockHierarchy,
750        RootAndChildWindows,
751    }
752}
753
754imgui_flags! {
755    pub ColorEditFlags: ImGuiColorEditFlags_ {
756        None,
757        NoAlpha,
758        NoPicker,
759        NoOptions,
760        NoSmallPreview,
761        NoInputs,
762        NoTooltip,
763        NoLabel,
764        NoSidePreview,
765        NoDragDrop,
766        NoBorder,
767        NoColorMarkers,
768        AlphaOpaque,
769        AlphaNoBg,
770        AlphaPreviewHalf,
771        AlphaBar,
772        HDR,
773        DisplayRGB,
774        DisplayHSV,
775        DisplayHex,
776        Uint8,
777        Float,
778        PickerHueBar,
779        PickerHueWheel,
780        InputRGB,
781        InputHSV,
782        DefaultOptions_,
783    }
784}
785
786imgui_flags! {
787    pub TabBarFlags: ImGuiTabBarFlags_ {
788        None,
789        Reorderable,
790        AutoSelectNewTabs,
791        TabListPopupButton,
792        NoCloseWithMiddleMouseButton,
793        NoTabListScrollingButtons,
794        NoTooltip,
795        DrawSelectedOverline,
796        FittingPolicyMixed,
797        FittingPolicyShrink,
798        FittingPolicyScroll,
799        FittingPolicyMask_,
800        FittingPolicyDefault_,
801    }
802}
803
804imgui_flags! {
805    pub TabItemFlags: ImGuiTabItemFlags_ {
806        None,
807        UnsavedDocument,
808        SetSelected,
809        NoCloseWithMiddleMouseButton,
810        NoPushId,
811        NoTooltip,
812        NoReorder,
813        Leading,
814        Trailing,
815    }
816}
817
818imgui_flags! {
819    pub BackendFlags: ImGuiBackendFlags_ {
820        None,
821        HasGamepad,
822        HasMouseCursors,
823        HasSetMousePos,
824        RendererHasVtxOffset,
825        RendererHasTextures,
826
827        RendererHasViewports,
828        PlatformHasViewports,
829        HasMouseHoveredViewport,
830        HasParentViewport,
831    }
832}
833
834imgui_flags! {
835    pub TableFlags: ImGuiTableFlags_ {
836        None,
837        // Features
838        Resizable,
839        Reorderable,
840        Hideable,
841        Sortable,
842        NoSavedSettings,
843        ContextMenuInBody,
844        // Decorations
845        RowBg,
846        BordersInnerH,
847        BordersOuterH,
848        BordersInnerV,
849        BordersOuterV,
850        BordersH,
851        BordersV,
852        BordersInner,
853        BordersOuter,
854        Borders,
855        NoBordersInBody,
856        NoBordersInBodyUntilResize,
857        // Sizing Policy (read above for defaults)
858        SizingFixedFit,
859        SizingFixedSame,
860        SizingStretchProp,
861        SizingStretchSame,
862        // Sizing Extra Options
863        NoHostExtendX,
864        NoHostExtendY,
865        NoKeepColumnsVisible,
866        PreciseWidths,
867        // Clipping
868        NoClip,
869        // Padding
870        PadOuterX,
871        NoPadOuterX,
872        NoPadInnerX,
873        // Scrolling
874        ScrollX,
875        ScrollY,
876        // Sorting
877        SortMulti,
878        SortTristate,
879        // Miscellaneous
880        HighlightHoveredColumn,
881    }
882}
883
884imgui_flags! {
885    pub TableRowFlags: ImGuiTableRowFlags_ {
886        None,
887        Headers,
888    }
889}
890
891imgui_flags! {
892    pub TableColumnFlags: ImGuiTableColumnFlags_ {
893        // Input configuration flags
894        None,
895        Disabled,
896        DefaultHide,
897        DefaultSort,
898        WidthStretch,
899        WidthFixed,
900        NoResize,
901        NoReorder,
902        NoHide,
903        NoClip,
904        NoSort,
905        NoSortAscending,
906        NoSortDescending,
907        NoHeaderLabel,
908        NoHeaderWidth,
909        PreferSortAscending,
910        PreferSortDescending,
911        IndentEnable,
912        IndentDisable,
913        AngledHeader,
914
915        // Output status flags, read-only via Table::get_column_flags()
916        IsEnabled,
917        IsVisible,
918        IsSorted,
919        IsHovered,
920    }
921}
922
923imgui_enum! {
924    pub TableBgTarget: ImGuiTableBgTarget_ {
925        None,
926        RowBg0,
927        RowBg1,
928        CellBg,
929    }
930}
931
932imgui_flags_ex! {
933    pub DockNodeFlags: ImGuiDockNodeFlags_ {
934        None = ImGuiDockNodeFlags_None,
935        KeepAliveOnly = ImGuiDockNodeFlags_KeepAliveOnly,
936        //NoCentralNode
937        NoDockingOverCentralNode = ImGuiDockNodeFlags_NoDockingOverCentralNode,
938        PassthruCentralNode = ImGuiDockNodeFlags_PassthruCentralNode,
939        NoDockingSplit = ImGuiDockNodeFlags_NoDockingSplit,
940        NoResize = ImGuiDockNodeFlags_NoResize,
941        AutoHideTabBar = ImGuiDockNodeFlags_AutoHideTabBar,
942        NoUndocking = ImGuiDockNodeFlags_NoUndocking,
943
944        // Internal
945        DockSpace = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_DockSpace,
946        CentralNode = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_CentralNode,
947        NoTabBar = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoTabBar,
948        HiddenTabBar = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_HiddenTabBar,
949        NoWindowMenuButton = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoWindowMenuButton,
950        NoCloseButton = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoCloseButton,
951        NoResizeX = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoResizeX,
952        NoResizeY = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoResizeY,
953        DockedWindowsInFocusRoute = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_DockedWindowsInFocusRoute,
954        NoDockingSplitOther = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoDockingSplitOther,
955        NoDockingOverMe = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoDockingOverMe,
956        NoDockingOverOther = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoDockingOverOther,
957        NoDockingOverEmpty = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoDockingOverEmpty,
958        NoDocking = ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoDocking,
959    }
960}
961
962// ImGuiDragDropFlags is split into two bitflags, one for the Source, one for the Accept.
963imgui_flags_ex! {
964    pub DragDropSourceFlags: ImGuiDragDropFlags_ {
965        None = ImGuiDragDropFlags_None,
966        NoPreviewTooltip = ImGuiDragDropFlags_SourceNoPreviewTooltip,
967        NoDisableHover = ImGuiDragDropFlags_SourceNoDisableHover,
968        NoHoldToOpenOthers = ImGuiDragDropFlags_SourceNoHoldToOpenOthers,
969        AllowNullID = ImGuiDragDropFlags_SourceAllowNullID,
970        Extern = ImGuiDragDropFlags_SourceExtern,
971        PayloadAutoExpire = ImGuiDragDropFlags_PayloadAutoExpire,
972        PayloadNoCrossContext = ImGuiDragDropFlags_PayloadNoCrossContext,
973        PayloadNoCrossProcess = ImGuiDragDropFlags_PayloadNoCrossProcess,
974    }
975}
976imgui_flags_ex! {
977    pub DragDropAcceptFlags: ImGuiDragDropFlags_ {
978        None = ImGuiDragDropFlags_None,
979        BeforeDelivery = ImGuiDragDropFlags_AcceptBeforeDelivery,
980        NoDrawDefaultRect = ImGuiDragDropFlags_AcceptNoDrawDefaultRect,
981        NoPreviewTooltip =  ImGuiDragDropFlags_AcceptNoPreviewTooltip,
982        AcceptDrawAsHovered = ImGuiDragDropFlags_AcceptDrawAsHovered,
983        PeekOnly = ImGuiDragDropFlags_AcceptPeekOnly,
984    }
985}
986
987imgui_flags! {
988    pub InputFlags: ImGuiInputFlags_ {
989        None,
990        RouteActive,
991        RouteFocused,
992        RouteGlobal,
993        RouteAlways,
994        RouteOverFocused,
995        RouteOverActive,
996        RouteUnlessBgFocused,
997        RouteFromRootWindow,
998        Tooltip,
999    }
1000}
1001
1002imgui_scoped_enum! {
1003    pub SortDirection: ImGuiSortDirection {
1004        None,
1005        Ascending,
1006        Descending,
1007    }
1008}
1009
1010imgui_flags! {
1011    pub ItemFlags: ImGuiItemFlags_ {
1012        None,
1013        NoTabStop,
1014        NoNav,
1015        NoNavDefaultFocus,
1016        ButtonRepeat,
1017        AutoClosePopups,
1018        AllowDuplicateId,
1019    }
1020}
1021
1022imgui_flags! {
1023    pub MultiSelectFlags: ImGuiMultiSelectFlags_ {
1024        None,
1025        SingleSelect,
1026        NoSelectAll,
1027        NoRangeSelect,
1028        NoAutoSelect,
1029        NoAutoClear,
1030        NoAutoClearOnReselect,
1031        BoxSelect1d,
1032        BoxSelect2d,
1033        BoxSelectNoScroll,
1034        ClearOnEscape,
1035        ClearOnClickVoid,
1036        ScopeWindow,
1037        ScopeRect,
1038        SelectOnAuto,
1039        SelectOnClickAlways,
1040        SelectOnClickRelease,
1041        //RangeSelect2d,
1042        NavWrapX,
1043        NoSelectOnRightClick,
1044    }
1045}
1046
1047imgui_scoped_enum! {
1048    pub SelectionRequestType: ImGuiSelectionRequestType {
1049        None,
1050        SetAll,
1051        SetRange,
1052    }
1053}
1054
1055imgui_flags! {
1056    pub FontAtlasFlags: ImFontAtlasFlags_ {
1057        None,
1058        NoPowerOfTwoHeight,
1059        NoMouseCursors,
1060        NoBakedLines,
1061    }
1062}
1063
1064imgui_flags! {
1065    pub FontFlags: ImFontFlags_ {
1066        None,
1067        NoLoadError,
1068
1069        // internal but bound anyways
1070        NoLoadGlyphs,
1071        LockBakedSizes,
1072    }
1073}