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