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