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