diff --git a/.gitattributes b/.gitattributes index 47aa91bce..16f4fb23c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ vendor/** linguist-vendored website/** linguist-documentation +pkg/cimgui/vendor/** linguist-vendored diff --git a/build.zig b/build.zig index 911ea8c05..e6e95b0fe 100644 --- a/build.zig +++ b/build.zig @@ -621,6 +621,7 @@ fn addDeps( }; // Dependencies + const cimgui_dep = b.dependency("cimgui", .{ .target = step.target, .optimize = step.optimize }); const js_dep = b.dependency("zig_js", .{ .target = step.target, .optimize = step.optimize }); const libxev_dep = b.dependency("libxev", .{ .target = step.target, .optimize = step.optimize }); const objc_dep = b.dependency("zig_objc", .{ .target = step.target, .optimize = step.optimize }); @@ -724,6 +725,11 @@ fn addDeps( try static_libs.append(macos_dep.artifact("macos").getEmittedBin()); } + // cimgui + step.addModule("cimgui", cimgui_dep.module("cimgui")); + step.linkLibrary(cimgui_dep.artifact("cimgui")); + try static_libs.append(cimgui_dep.artifact("cimgui").getEmittedBin()); + // Tracy step.addModule("tracy", tracy_dep.module("tracy")); if (tracy) { diff --git a/build.zig.zon b/build.zig.zon index e2d8d0fb2..bfca4e766 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -27,6 +27,7 @@ }, // C libs + .cimgui = .{ .path = "./pkg/cimgui" }, .fontconfig = .{ .path = "./pkg/fontconfig" }, .freetype = .{ .path = "./pkg/freetype" }, .harfbuzz = .{ .path = "./pkg/harfbuzz" }, diff --git a/include/ghostty.h b/include/ghostty.h index 5d85d8d51..78c6dfb89 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -27,6 +27,7 @@ extern "C" { typedef void *ghostty_app_t; typedef void *ghostty_config_t; typedef void *ghostty_surface_t; +typedef void *ghostty_inspector_t; // Enums are up top so we can reference them later. typedef enum { @@ -48,6 +49,12 @@ typedef enum { GHOSTTY_SPLIT_FOCUS_RIGHT, } ghostty_split_focus_direction_e; +typedef enum { + GHOSTTY_INSPECTOR_TOGGLE, + GHOSTTY_INSPECTOR_SHOW, + GHOSTTY_INSPECTOR_HIDE, +} ghostty_inspector_mode_e; + typedef enum { GHOSTTY_MOUSE_RELEASE, GHOSTTY_MOUSE_PRESS, @@ -322,12 +329,14 @@ typedef void (*ghostty_runtime_write_clipboard_cb)(void *, const char *, ghostty typedef void (*ghostty_runtime_new_split_cb)(void *, ghostty_split_direction_e, ghostty_surface_config_s); typedef void (*ghostty_runtime_new_tab_cb)(void *, ghostty_surface_config_s); typedef void (*ghostty_runtime_new_window_cb)(void *, ghostty_surface_config_s); +typedef void (*ghostty_runtime_control_inspector_cb)(void *, ghostty_inspector_mode_e); typedef void (*ghostty_runtime_close_surface_cb)(void *, bool); typedef void (*ghostty_runtime_focus_split_cb)(void *, ghostty_split_focus_direction_e); typedef void (*ghostty_runtime_toggle_split_zoom_cb)(void *); typedef void (*ghostty_runtime_goto_tab_cb)(void *, int32_t); typedef void (*ghostty_runtime_toggle_fullscreen_cb)(void *, ghostty_non_native_fullscreen_e); typedef void (*ghostty_runtime_set_initial_window_size_cb)(void *, uint32_t, uint32_t); +typedef void (*ghostty_runtime_render_inspector_cb)(void *); typedef struct { void *userdata; @@ -342,12 +351,14 @@ typedef struct { ghostty_runtime_new_split_cb new_split_cb; ghostty_runtime_new_tab_cb new_tab_cb; ghostty_runtime_new_window_cb new_window_cb; + ghostty_runtime_control_inspector_cb control_inspector_cb; ghostty_runtime_close_surface_cb close_surface_cb; ghostty_runtime_focus_split_cb focus_split_cb; ghostty_runtime_toggle_split_zoom_cb toggle_split_zoom_cb; ghostty_runtime_goto_tab_cb goto_tab_cb; ghostty_runtime_toggle_fullscreen_cb toggle_fullscreen_cb; ghostty_runtime_set_initial_window_size_cb set_initial_window_size_cb; + ghostty_runtime_render_inspector_cb render_inspector_cb; } ghostty_runtime_config_s; //------------------------------------------------------------------- @@ -399,6 +410,20 @@ void ghostty_surface_split_focus(ghostty_surface_t, ghostty_split_focus_directio bool ghostty_surface_binding_action(ghostty_surface_t, const char *, uintptr_t); void ghostty_surface_complete_clipboard_request(ghostty_surface_t, const char *, uintptr_t, void *); +ghostty_inspector_t ghostty_surface_inspector(ghostty_surface_t); +void ghostty_inspector_free(ghostty_surface_t); +bool ghostty_inspector_metal_init(ghostty_inspector_t, void *); +void ghostty_inspector_metal_render(ghostty_inspector_t, void *, void *); +bool ghostty_inspector_metal_shutdown(ghostty_inspector_t); +void ghostty_inspector_set_focus(ghostty_inspector_t, bool); +void ghostty_inspector_set_content_scale(ghostty_inspector_t, double, double); +void ghostty_inspector_set_size(ghostty_inspector_t, uint32_t, uint32_t); +void ghostty_inspector_mouse_button(ghostty_inspector_t, ghostty_input_mouse_state_e, ghostty_input_mouse_button_e, ghostty_input_mods_e); +void ghostty_inspector_mouse_pos(ghostty_inspector_t, double, double); +void ghostty_inspector_mouse_scroll(ghostty_inspector_t, double, double, ghostty_input_scroll_mods_t); +void ghostty_inspector_key(ghostty_inspector_t, ghostty_input_action_e, ghostty_input_key_e, ghostty_input_mods_e); +void ghostty_inspector_text(ghostty_inspector_t, const char *); + // APIs I'd like to get rid of eventually but are still needed for now. // Don't use these unless you know what you're doing. void ghostty_set_window_background_blur(ghostty_surface_t, void *); diff --git a/macos/Ghostty.xcodeproj/project.pbxproj b/macos/Ghostty.xcodeproj/project.pbxproj index dd6823fd0..f88f47cda 100644 --- a/macos/Ghostty.xcodeproj/project.pbxproj +++ b/macos/Ghostty.xcodeproj/project.pbxproj @@ -26,6 +26,8 @@ A56D58892ACDE6CA00508D2C /* ServiceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56D58882ACDE6CA00508D2C /* ServiceProvider.swift */; }; A571AB1D2A206FCF00248498 /* GhosttyKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5D495A1299BEC7E00DD1313 /* GhosttyKit.xcframework */; }; A59444F729A2ED5200725BBA /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59444F629A2ED5200725BBA /* SettingsView.swift */; }; + A59FB5CF2AE0DB50009128F3 /* InspectorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59FB5CE2AE0DB50009128F3 /* InspectorView.swift */; }; + A59FB5D12AE0DEA7009128F3 /* MetalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59FB5D02AE0DEA7009128F3 /* MetalView.swift */; }; A5A1F8852A489D6800D1E8BC /* terminfo in Resources */ = {isa = PBXBuildFile; fileRef = A5A1F8842A489D6800D1E8BC /* terminfo */; }; A5B30539299BEAAB0047F10C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5B30538299BEAAB0047F10C /* Assets.xcassets */; }; A5CDF1912AAF9A5800513312 /* ConfigurationErrors.xib in Resources */ = {isa = PBXBuildFile; fileRef = A5CDF1902AAF9A5800513312 /* ConfigurationErrors.xib */; }; @@ -59,6 +61,8 @@ A56D58882ACDE6CA00508D2C /* ServiceProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceProvider.swift; sourceTree = ""; }; A571AB1C2A206FC600248498 /* Ghostty-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Ghostty-Info.plist"; sourceTree = ""; }; A59444F629A2ED5200725BBA /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; + A59FB5CE2AE0DB50009128F3 /* InspectorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectorView.swift; sourceTree = ""; }; + A59FB5D02AE0DEA7009128F3 /* MetalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetalView.swift; sourceTree = ""; }; A5A1F8842A489D6800D1E8BC /* terminfo */ = {isa = PBXFileReference; lastKnownFileType = folder; name = terminfo; path = "../zig-out/share/terminfo"; sourceTree = ""; }; A5B30531299BEAAA0047F10C /* Ghostty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ghostty.app; sourceTree = BUILT_PRODUCTS_DIR; }; A5B30538299BEAAB0047F10C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -115,6 +119,7 @@ children = ( A5CEAFFE29C2410700646FDA /* Backport.swift */, 8503D7C62A549C66006CFF3D /* FullScreenHandler.swift */, + A59FB5D02AE0DEA7009128F3 /* MetalView.swift */, A5FECBD829D2010400022361 /* WindowAccessor.swift */, A5CEAFDA29B8005900646FDA /* SplitView */, ); @@ -151,6 +156,7 @@ A55B7BB729B6F53A0055DE60 /* Package.swift */, A55B7BB529B6F47F0055DE60 /* AppState.swift */, A55B7BBB29B6FC330055DE60 /* SurfaceView.swift */, + A59FB5CE2AE0DB50009128F3 /* InspectorView.swift */, A5278A9A2AA05B2600CD3039 /* Ghostty.Input.swift */, A56D58852ACDDB4100508D2C /* Ghostty.Shell.swift */, A55B7BBD29B701360055DE60 /* Ghostty.SplitView.swift */, @@ -288,6 +294,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A59FB5CF2AE0DB50009128F3 /* InspectorView.swift in Sources */, A53426392A7DC55C00EBB7A2 /* PrimaryWindowManager.swift in Sources */, 85DE1C922A6A3DCA00493853 /* PrimaryWindow.swift in Sources */, A56D58892ACDE6CA00508D2C /* ServiceProvider.swift in Sources */, @@ -304,6 +311,7 @@ A55B7BB629B6F47F0055DE60 /* AppState.swift in Sources */, A5CEAFDC29B8009000646FDA /* SplitView.swift in Sources */, A5CDF1932AAF9E0800513312 /* ConfigurationErrorsController.swift in Sources */, + A59FB5D12AE0DEA7009128F3 /* MetalView.swift in Sources */, A55685E029A03A9F004303CE /* AppError.swift in Sources */, A5FECBD929D2010400022361 /* WindowAccessor.swift in Sources */, A535B9DA299C569B0017E2E4 /* ErrorView.swift in Sources */, diff --git a/macos/Sources/AppDelegate.swift b/macos/Sources/AppDelegate.swift index 833fae4c4..cf9b53427 100644 --- a/macos/Sources/AppDelegate.swift +++ b/macos/Sources/AppDelegate.swift @@ -36,6 +36,7 @@ class AppDelegate: NSObject, ObservableObject, NSApplicationDelegate, GhosttyApp @IBOutlet private var menuIncreaseFontSize: NSMenuItem? @IBOutlet private var menuDecreaseFontSize: NSMenuItem? @IBOutlet private var menuResetFontSize: NSMenuItem? + @IBOutlet private var menuTerminalInspector: NSMenuItem? /// The dock menu private var dockMenu: NSMenu = NSMenu() @@ -216,6 +217,7 @@ class AppDelegate: NSObject, ObservableObject, NSApplicationDelegate, GhosttyApp syncMenuShortcut(action: "increase_font_size:1", menuItem: self.menuIncreaseFontSize) syncMenuShortcut(action: "decrease_font_size:1", menuItem: self.menuDecreaseFontSize) syncMenuShortcut(action: "reset_font_size", menuItem: self.menuResetFontSize) + syncMenuShortcut(action: "inspector:toggle", menuItem: self.menuTerminalInspector) // Dock menu reloadDockMenu() @@ -394,4 +396,9 @@ class AppDelegate: NSObject, ObservableObject, NSApplicationDelegate, GhosttyApp guard let surface = focusedSurface() else { return } ghostty.changeFontSize(surface: surface, .reset) } + + @IBAction func toggleTerminalInspector(_ sender: Any) { + guard let surface = focusedSurface() else { return } + ghostty.toggleTerminalInspector(surface: surface) + } } diff --git a/macos/Sources/Ghostty/AppState.swift b/macos/Sources/Ghostty/AppState.swift index 90df697a7..f81131b32 100644 --- a/macos/Sources/Ghostty/AppState.swift +++ b/macos/Sources/Ghostty/AppState.swift @@ -136,12 +136,14 @@ extension Ghostty { new_split_cb: { userdata, direction, surfaceConfig in AppState.newSplit(userdata, direction: direction, config: surfaceConfig) }, new_tab_cb: { userdata, surfaceConfig in AppState.newTab(userdata, config: surfaceConfig) }, new_window_cb: { userdata, surfaceConfig in AppState.newWindow(userdata, config: surfaceConfig) }, + control_inspector_cb: { userdata, mode in AppState.controlInspector(userdata, mode: mode) }, close_surface_cb: { userdata, processAlive in AppState.closeSurface(userdata, processAlive: processAlive) }, focus_split_cb: { userdata, direction in AppState.focusSplit(userdata, direction: direction) }, toggle_split_zoom_cb: { userdata in AppState.toggleSplitZoom(userdata) }, goto_tab_cb: { userdata, n in AppState.gotoTab(userdata, n: n) }, toggle_fullscreen_cb: { userdata, nonNativeFullscreen in AppState.toggleFullscreen(userdata, nonNativeFullscreen: nonNativeFullscreen) }, - set_initial_window_size_cb: { userdata, width, height in AppState.setInitialWindowSize(userdata, width: width, height: height) } + set_initial_window_size_cb: { userdata, width, height in AppState.setInitialWindowSize(userdata, width: width, height: height) }, + render_inspector_cb: { userdata in AppState.renderInspector(userdata) } ) // Create the ghostty app. @@ -298,6 +300,13 @@ extension Ghostty { AppDelegate.logger.warning("action failed action=\(action)") } } + + func toggleTerminalInspector(surface: ghostty_surface_t) { + let action = "inspector:toggle" + if (!ghostty_surface_binding_action(surface, action, UInt(action.count))) { + AppDelegate.logger.warning("action failed action=\(action)") + } + } // Called when the selected keyboard changes. We have to notify Ghostty so that // it can reload the keyboard mapping for input. @@ -415,6 +424,14 @@ extension Ghostty { // standpoint since we don't do this much. DispatchQueue.main.async { state.appTick() } } + + static func renderInspector(_ userdata: UnsafeMutableRawPointer?) { + guard let surface = self.surfaceUserdata(from: userdata) else { return } + NotificationCenter.default.post( + name: Notification.inspectorNeedsDisplay, + object: surface + ) + } static func setTitle(_ userdata: UnsafeMutableRawPointer?, title: UnsafePointer?) { let surfaceView = Unmanaged.fromOpaque(userdata!).takeUnretainedValue() @@ -485,6 +502,13 @@ extension Ghostty { ] ) } + + static func controlInspector(_ userdata: UnsafeMutableRawPointer?, mode: ghostty_inspector_mode_e) { + guard let surface = self.surfaceUserdata(from: userdata) else { return } + NotificationCenter.default.post(name: Notification.didControlInspector, object: surface, userInfo: [ + "mode": mode, + ]) + } /// Returns the GhosttyState from the given userdata value. static private func appState(fromView view: SurfaceView) -> AppState? { diff --git a/macos/Sources/Ghostty/Ghostty.Input.swift b/macos/Sources/Ghostty/Ghostty.Input.swift index 1655b80ad..dd71d2ed2 100644 --- a/macos/Sources/Ghostty/Ghostty.Input.swift +++ b/macos/Sources/Ghostty/Ghostty.Input.swift @@ -31,7 +31,28 @@ extension Ghostty { if (mods.rawValue & GHOSTTY_MODS_SUPER.rawValue != 0) { flags.insert(.command) } return flags } + + /// Translate event modifier flags to a ghostty mods enum. + static func ghosttyMods(_ flags: NSEvent.ModifierFlags) -> ghostty_input_mods_e { + var mods: UInt32 = GHOSTTY_MODS_NONE.rawValue + if (flags.contains(.shift)) { mods |= GHOSTTY_MODS_SHIFT.rawValue } + if (flags.contains(.control)) { mods |= GHOSTTY_MODS_CTRL.rawValue } + if (flags.contains(.option)) { mods |= GHOSTTY_MODS_ALT.rawValue } + if (flags.contains(.command)) { mods |= GHOSTTY_MODS_SUPER.rawValue } + if (flags.contains(.capsLock)) { mods |= GHOSTTY_MODS_CAPS.rawValue } + + // Handle sided input. We can't tell that both are pressed in the + // Ghostty structure but thats okay -- we don't use that information. + let rawFlags = flags.rawValue + if (rawFlags & UInt(NX_DEVICERSHIFTKEYMASK) != 0) { mods |= GHOSTTY_MODS_SHIFT_RIGHT.rawValue } + if (rawFlags & UInt(NX_DEVICERCTLKEYMASK) != 0) { mods |= GHOSTTY_MODS_CTRL_RIGHT.rawValue } + if (rawFlags & UInt(NX_DEVICERALTKEYMASK) != 0) { mods |= GHOSTTY_MODS_ALT_RIGHT.rawValue } + if (rawFlags & UInt(NX_DEVICERCMDKEYMASK) != 0) { mods |= GHOSTTY_MODS_SUPER_RIGHT.rawValue } + + return ghostty_input_mods_e(mods) + } + /// A map from the Ghostty key enum to the keyEquivalent string for shortcuts. static let keyToEquivalent: [ghostty_input_key_e : String] = [ // 0-9 @@ -214,5 +235,122 @@ extension Ghostty { 0x3B: GHOSTTY_KEY_SEMICOLON, 0x2F: GHOSTTY_KEY_SLASH, ] + + // Mapping of event keyCode to ghostty input key values. This is cribbed from + // glfw mostly since we started as a glfw-based app way back in the day! + static let keycodeToKey: [UInt16 : ghostty_input_key_e] = [ + 0x1D: GHOSTTY_KEY_ZERO, + 0x12: GHOSTTY_KEY_ONE, + 0x13: GHOSTTY_KEY_TWO, + 0x14: GHOSTTY_KEY_THREE, + 0x15: GHOSTTY_KEY_FOUR, + 0x17: GHOSTTY_KEY_FIVE, + 0x16: GHOSTTY_KEY_SIX, + 0x1A: GHOSTTY_KEY_SEVEN, + 0x1C: GHOSTTY_KEY_EIGHT, + 0x19: GHOSTTY_KEY_NINE, + 0x00: GHOSTTY_KEY_A, + 0x0B: GHOSTTY_KEY_B, + 0x08: GHOSTTY_KEY_C, + 0x02: GHOSTTY_KEY_D, + 0x0E: GHOSTTY_KEY_E, + 0x03: GHOSTTY_KEY_F, + 0x05: GHOSTTY_KEY_G, + 0x04: GHOSTTY_KEY_H, + 0x22: GHOSTTY_KEY_I, + 0x26: GHOSTTY_KEY_J, + 0x28: GHOSTTY_KEY_K, + 0x25: GHOSTTY_KEY_L, + 0x2E: GHOSTTY_KEY_M, + 0x2D: GHOSTTY_KEY_N, + 0x1F: GHOSTTY_KEY_O, + 0x23: GHOSTTY_KEY_P, + 0x0C: GHOSTTY_KEY_Q, + 0x0F: GHOSTTY_KEY_R, + 0x01: GHOSTTY_KEY_S, + 0x11: GHOSTTY_KEY_T, + 0x20: GHOSTTY_KEY_U, + 0x09: GHOSTTY_KEY_V, + 0x0D: GHOSTTY_KEY_W, + 0x07: GHOSTTY_KEY_X, + 0x10: GHOSTTY_KEY_Y, + 0x06: GHOSTTY_KEY_Z, + + 0x27: GHOSTTY_KEY_APOSTROPHE, + 0x2A: GHOSTTY_KEY_BACKSLASH, + 0x2B: GHOSTTY_KEY_COMMA, + 0x18: GHOSTTY_KEY_EQUAL, + 0x32: GHOSTTY_KEY_GRAVE_ACCENT, + 0x21: GHOSTTY_KEY_LEFT_BRACKET, + 0x1B: GHOSTTY_KEY_MINUS, + 0x2F: GHOSTTY_KEY_PERIOD, + 0x1E: GHOSTTY_KEY_RIGHT_BRACKET, + 0x29: GHOSTTY_KEY_SEMICOLON, + 0x2C: GHOSTTY_KEY_SLASH, + + 0x33: GHOSTTY_KEY_BACKSPACE, + 0x39: GHOSTTY_KEY_CAPS_LOCK, + 0x75: GHOSTTY_KEY_DELETE, + 0x7D: GHOSTTY_KEY_DOWN, + 0x77: GHOSTTY_KEY_END, + 0x24: GHOSTTY_KEY_ENTER, + 0x35: GHOSTTY_KEY_ESCAPE, + 0x7A: GHOSTTY_KEY_F1, + 0x78: GHOSTTY_KEY_F2, + 0x63: GHOSTTY_KEY_F3, + 0x76: GHOSTTY_KEY_F4, + 0x60: GHOSTTY_KEY_F5, + 0x61: GHOSTTY_KEY_F6, + 0x62: GHOSTTY_KEY_F7, + 0x64: GHOSTTY_KEY_F8, + 0x65: GHOSTTY_KEY_F9, + 0x6D: GHOSTTY_KEY_F10, + 0x67: GHOSTTY_KEY_F11, + 0x6F: GHOSTTY_KEY_F12, + 0x69: GHOSTTY_KEY_PRINT_SCREEN, + 0x6B: GHOSTTY_KEY_F14, + 0x71: GHOSTTY_KEY_F15, + 0x6A: GHOSTTY_KEY_F16, + 0x40: GHOSTTY_KEY_F17, + 0x4F: GHOSTTY_KEY_F18, + 0x50: GHOSTTY_KEY_F19, + 0x5A: GHOSTTY_KEY_F20, + 0x73: GHOSTTY_KEY_HOME, + 0x72: GHOSTTY_KEY_INSERT, + 0x7B: GHOSTTY_KEY_LEFT, + 0x3A: GHOSTTY_KEY_LEFT_ALT, + 0x3B: GHOSTTY_KEY_LEFT_CONTROL, + 0x38: GHOSTTY_KEY_LEFT_SHIFT, + 0x37: GHOSTTY_KEY_LEFT_SUPER, + 0x47: GHOSTTY_KEY_NUM_LOCK, + 0x79: GHOSTTY_KEY_PAGE_DOWN, + 0x74: GHOSTTY_KEY_PAGE_UP, + 0x7C: GHOSTTY_KEY_RIGHT, + 0x3D: GHOSTTY_KEY_RIGHT_ALT, + 0x3E: GHOSTTY_KEY_RIGHT_CONTROL, + 0x3C: GHOSTTY_KEY_RIGHT_SHIFT, + 0x36: GHOSTTY_KEY_RIGHT_SUPER, + 0x31: GHOSTTY_KEY_SPACE, + 0x30: GHOSTTY_KEY_TAB, + 0x7E: GHOSTTY_KEY_UP, + + 0x52: GHOSTTY_KEY_KP_0, + 0x53: GHOSTTY_KEY_KP_1, + 0x54: GHOSTTY_KEY_KP_2, + 0x55: GHOSTTY_KEY_KP_3, + 0x56: GHOSTTY_KEY_KP_4, + 0x57: GHOSTTY_KEY_KP_5, + 0x58: GHOSTTY_KEY_KP_6, + 0x59: GHOSTTY_KEY_KP_7, + 0x5B: GHOSTTY_KEY_KP_8, + 0x5C: GHOSTTY_KEY_KP_9, + 0x45: GHOSTTY_KEY_KP_ADD, + 0x41: GHOSTTY_KEY_KP_DECIMAL, + 0x4B: GHOSTTY_KEY_KP_DIVIDE, + 0x4C: GHOSTTY_KEY_KP_ENTER, + 0x51: GHOSTTY_KEY_KP_EQUAL, + 0x43: GHOSTTY_KEY_KP_MULTIPLY, + 0x4E: GHOSTTY_KEY_KP_SUBTRACT, + ]; } diff --git a/macos/Sources/Ghostty/Ghostty.SplitView.swift b/macos/Sources/Ghostty/Ghostty.SplitView.swift index 6990daae9..8287bfb1a 100644 --- a/macos/Sources/Ghostty/Ghostty.SplitView.swift +++ b/macos/Sources/Ghostty/Ghostty.SplitView.swift @@ -30,7 +30,7 @@ extension Ghostty { // surface. We need to keep the split root around so that we don't // lose all of the surface state so this must be a ZStack. if let surfaceView = zoomedSurface { - SurfaceWrapper(surfaceView: surfaceView) + InspectableSurface(surfaceView: surfaceView) } } .focusedValue(\.ghosttySurfaceZoomed, zoomedSurface != nil) @@ -343,7 +343,7 @@ extension Ghostty { let pubClose = center.publisher(for: Notification.ghosttyCloseSurface, object: leaf.surface) let pubFocus = center.publisher(for: Notification.ghosttyFocusSplit, object: leaf.surface) - SurfaceWrapper(surfaceView: leaf.surface, isSplit: !neighbors.isEmpty()) + InspectableSurface(surfaceView: leaf.surface, isSplit: !neighbors.isEmpty()) .onReceive(pub) { onNewSplit(notification: $0) } .onReceive(pubClose) { onClose(notification: $0) } .onReceive(pubFocus) { onMoveFocus(notification: $0) } diff --git a/macos/Sources/Ghostty/InspectorView.swift b/macos/Sources/Ghostty/InspectorView.swift new file mode 100644 index 000000000..2145174a9 --- /dev/null +++ b/macos/Sources/Ghostty/InspectorView.swift @@ -0,0 +1,443 @@ +import Foundation +import MetalKit +import SwiftUI +import GhosttyKit + +extension Ghostty { + /// InspectableSurface is a type of Surface view that allows an inspector to be attached. + struct InspectableSurface: View { + /// Same as SurfaceWrapper, see the doc comments there. + @ObservedObject var surfaceView: SurfaceView + var isSplit: Bool = false + + // Maintain whether our view has focus or not + @FocusState private var inspectorFocus: Bool + + var body: some View { + let center = NotificationCenter.default + let pubInspector = center.publisher(for: Notification.didControlInspector, object: surfaceView) + + ZStack { + if (!surfaceView.inspectorVisible) { + SurfaceWrapper(surfaceView: surfaceView, isSplit: isSplit) + } else { + SplitView(.vertical, left: { + SurfaceWrapper(surfaceView: surfaceView, isSplit: isSplit) + }, right: { + InspectorViewRepresentable(surfaceView: surfaceView) + .focused($inspectorFocus) + .focusedValue(\.ghosttySurfaceTitle, surfaceView.title) + .focusedValue(\.ghosttySurfaceView, surfaceView) + }) + } + } + .onReceive(pubInspector) { onControlInspector($0) } + } + + private func onControlInspector(_ notification: SwiftUI.Notification) { + // Determine our mode + guard let modeAny = notification.userInfo?["mode"] else { return } + guard let mode = modeAny as? ghostty_inspector_mode_e else { return } + + switch (mode) { + case GHOSTTY_INSPECTOR_TOGGLE: + surfaceView.inspectorVisible = !surfaceView.inspectorVisible + + case GHOSTTY_INSPECTOR_SHOW: + surfaceView.inspectorVisible = true + + case GHOSTTY_INSPECTOR_HIDE: + surfaceView.inspectorVisible = false + + default: + return + } + + // When we show the inspector, we want to focus on the inspector. + // When we hide the inspector, we want to move focus back to the surface. + if (surfaceView.inspectorVisible) { + // We need to delay this until SwiftUI shows the inspector. + DispatchQueue.main.async { + _ = surfaceView.resignFirstResponder() + inspectorFocus = true + } + } else { + Ghostty.moveFocus(to: surfaceView) + } + } + } + + struct InspectorViewRepresentable: NSViewRepresentable { + /// The surface that this inspector represents. + let surfaceView: SurfaceView + + func makeNSView(context: Context) -> InspectorView { + let view = InspectorView() + view.surfaceView = self.surfaceView + return view + } + + func updateNSView(_ view: InspectorView, context: Context) { + view.surfaceView = self.surfaceView + } + } + + /// Inspector view is the view for the surface inspector (similar to a web inspector). + class InspectorView: MTKView, NSTextInputClient { + let commandQueue: MTLCommandQueue + + var surfaceView: SurfaceView? = nil { + didSet { surfaceViewDidChange() } + } + + private var inspector: ghostty_inspector_t? { + guard let surfaceView = self.surfaceView else { return nil } + return surfaceView.inspector + } + + private var markedText: NSMutableAttributedString = NSMutableAttributedString() + + // We need to support being a first responder so that we can get input events + override var acceptsFirstResponder: Bool { return true } + + override init(frame: CGRect, device: MTLDevice?) { + // Initialize our Metal primitives + guard + let device = device ?? MTLCreateSystemDefaultDevice(), + let commandQueue = device.makeCommandQueue() else { + fatalError("GPU not available") + } + + // Setup our properties before initializing the parent + self.commandQueue = commandQueue + super.init(frame: frame, device: device) + + // This makes it so renders only happen when we request + self.enableSetNeedsDisplay = true + self.isPaused = true + + // After initializing the parent we can set our own properties + self.device = MTLCreateSystemDefaultDevice() + self.clearColor = MTLClearColor(red: 0x28 / 0xFF, green: 0x2C / 0xFF, blue: 0x34 / 0xFF, alpha: 1.0) + + // Setup our tracking areas for mouse events + updateTrackingAreas() + } + + required init(coder: NSCoder) { + fatalError("init(coder:) is not supported for this view") + } + + deinit { + trackingAreas.forEach { removeTrackingArea($0) } + NotificationCenter.default.removeObserver(self) + } + + // MARK: Internal Inspector Funcs + + private func surfaceViewDidChange() { + let center = NotificationCenter.default + center.removeObserver(self) + + guard let surfaceView = self.surfaceView else { return } + guard let inspector = self.inspector else { return } + guard let device = self.device else { return } + let devicePtr = Unmanaged.passRetained(device).toOpaque() + ghostty_inspector_metal_init(inspector, devicePtr) + + // Register an observer for render requests + center.addObserver( + self, + selector: #selector(didRequestRender), + name: Ghostty.Notification.inspectorNeedsDisplay, + object: surfaceView) + } + + @objc private func didRequestRender(notification: SwiftUI.Notification) { + self.needsDisplay = true + } + + private func updateSize() { + guard let inspector = self.inspector else { return } + + // Detect our X/Y scale factor so we can update our surface + let fbFrame = self.convertToBacking(self.frame) + let xScale = fbFrame.size.width / self.frame.size.width + let yScale = fbFrame.size.height / self.frame.size.height + ghostty_inspector_set_content_scale(inspector, xScale, yScale) + + // When our scale factor changes, so does our fb size so we send that too + ghostty_inspector_set_size(inspector, UInt32(fbFrame.size.width), UInt32(fbFrame.size.height)) + } + + // MARK: NSView + + override func becomeFirstResponder() -> Bool { + let result = super.becomeFirstResponder() + if (result) { + if let inspector = self.inspector { + ghostty_inspector_set_focus(inspector, true) + } + } + return result + } + + override func resignFirstResponder() -> Bool { + let result = super.resignFirstResponder() + if (result) { + if let inspector = self.inspector { + ghostty_inspector_set_focus(inspector, false) + } + } + return result + } + + override func updateTrackingAreas() { + // To update our tracking area we just recreate it all. + trackingAreas.forEach { removeTrackingArea($0) } + + // This tracking area is across the entire frame to notify us of mouse movements. + addTrackingArea(NSTrackingArea( + rect: frame, + options: [ + .mouseMoved, + + // Only send mouse events that happen in our visible (not obscured) rect + .inVisibleRect, + + // We want active always because we want to still send mouse reports + // even if we're not focused or key. + .activeAlways, + ], + owner: self, + userInfo: nil)) + } + + override func viewDidChangeBackingProperties() { + super.viewDidChangeBackingProperties() + updateSize() + } + + override func mouseDown(with event: NSEvent) { + guard let inspector = self.inspector else { return } + let mods = Ghostty.ghosttyMods(event.modifierFlags) + ghostty_inspector_mouse_button(inspector, GHOSTTY_MOUSE_PRESS, GHOSTTY_MOUSE_LEFT, mods) + } + + override func mouseUp(with event: NSEvent) { + guard let inspector = self.inspector else { return } + let mods = Ghostty.ghosttyMods(event.modifierFlags) + ghostty_inspector_mouse_button(inspector, GHOSTTY_MOUSE_RELEASE, GHOSTTY_MOUSE_LEFT, mods) + } + + override func rightMouseDown(with event: NSEvent) { + guard let inspector = self.inspector else { return } + let mods = Ghostty.ghosttyMods(event.modifierFlags) + ghostty_inspector_mouse_button(inspector, GHOSTTY_MOUSE_PRESS, GHOSTTY_MOUSE_RIGHT, mods) + } + + override func rightMouseUp(with event: NSEvent) { + guard let inspector = self.inspector else { return } + let mods = Ghostty.ghosttyMods(event.modifierFlags) + ghostty_inspector_mouse_button(inspector, GHOSTTY_MOUSE_RELEASE, GHOSTTY_MOUSE_RIGHT, mods) + } + + override func mouseMoved(with event: NSEvent) { + guard let inspector = self.inspector else { return } + + // Convert window position to view position. Note (0, 0) is bottom left. + let pos = self.convert(event.locationInWindow, from: nil) + ghostty_inspector_mouse_pos(inspector, pos.x, frame.height - pos.y) + + } + + override func mouseDragged(with event: NSEvent) { + self.mouseMoved(with: event) + } + + override func scrollWheel(with event: NSEvent) { + guard let inspector = self.inspector else { return } + + // Builds up the "input.ScrollMods" bitmask + var mods: Int32 = 0 + + var x = event.scrollingDeltaX + var y = event.scrollingDeltaY + if event.hasPreciseScrollingDeltas { + mods = 1 + + // We do a 2x speed multiplier. This is subjective, it "feels" better to me. + x *= 2; + y *= 2; + + // TODO(mitchellh): do we have to scale the x/y here by window scale factor? + } + + // Determine our momentum value + var momentum: ghostty_input_mouse_momentum_e = GHOSTTY_MOUSE_MOMENTUM_NONE + switch (event.momentumPhase) { + case .began: + momentum = GHOSTTY_MOUSE_MOMENTUM_BEGAN + case .stationary: + momentum = GHOSTTY_MOUSE_MOMENTUM_STATIONARY + case .changed: + momentum = GHOSTTY_MOUSE_MOMENTUM_CHANGED + case .ended: + momentum = GHOSTTY_MOUSE_MOMENTUM_ENDED + case .cancelled: + momentum = GHOSTTY_MOUSE_MOMENTUM_CANCELLED + case .mayBegin: + momentum = GHOSTTY_MOUSE_MOMENTUM_MAY_BEGIN + default: + break + } + + // Pack our momentum value into the mods bitmask + mods |= Int32(momentum.rawValue) << 1 + + ghostty_inspector_mouse_scroll(inspector, x, y, mods) + } + + override func keyDown(with event: NSEvent) { + let action = event.isARepeat ? GHOSTTY_ACTION_REPEAT : GHOSTTY_ACTION_PRESS + keyAction(action, event: event) + self.interpretKeyEvents([event]) + } + + override func keyUp(with event: NSEvent) { + keyAction(GHOSTTY_ACTION_RELEASE, event: event) + } + + override func flagsChanged(with event: NSEvent) { + let mod: UInt32; + switch (event.keyCode) { + case 0x39: mod = GHOSTTY_MODS_CAPS.rawValue + case 0x38, 0x3C: mod = GHOSTTY_MODS_SHIFT.rawValue + case 0x3B, 0x3E: mod = GHOSTTY_MODS_CTRL.rawValue + case 0x3A, 0x3D: mod = GHOSTTY_MODS_ALT.rawValue + case 0x37, 0x36: mod = GHOSTTY_MODS_SUPER.rawValue + default: return + } + + // The keyAction function will do this AGAIN below which sucks to repeat + // but this is super cheap and flagsChanged isn't that common. + let mods = Ghostty.ghosttyMods(event.modifierFlags) + + // If the key that pressed this is active, its a press, else release + var action = GHOSTTY_ACTION_RELEASE + if (mods.rawValue & mod != 0) { action = GHOSTTY_ACTION_PRESS } + + keyAction(action, event: event) + } + + private func keyAction(_ action: ghostty_input_action_e, event: NSEvent) { + guard let inspector = self.inspector else { return } + guard let key = Ghostty.keycodeToKey[event.keyCode] else { return } + let mods = Ghostty.ghosttyMods(event.modifierFlags) + ghostty_inspector_key(inspector, action, key, mods) + } + + // MARK: NSTextInputClient + + func hasMarkedText() -> Bool { + return markedText.length > 0 + } + + func markedRange() -> NSRange { + guard markedText.length > 0 else { return NSRange() } + return NSRange(0...(markedText.length-1)) + } + + func selectedRange() -> NSRange { + return NSRange() + } + + func setMarkedText(_ string: Any, selectedRange: NSRange, replacementRange: NSRange) { + switch string { + case let v as NSAttributedString: + self.markedText = NSMutableAttributedString(attributedString: v) + + case let v as String: + self.markedText = NSMutableAttributedString(string: v) + + default: + print("unknown marked text: \(string)") + } + } + + func unmarkText() { + self.markedText.mutableString.setString("") + } + + func validAttributesForMarkedText() -> [NSAttributedString.Key] { + return [] + } + + func attributedSubstring(forProposedRange range: NSRange, actualRange: NSRangePointer?) -> NSAttributedString? { + return nil + } + + func characterIndex(for point: NSPoint) -> Int { + return 0 + } + + func firstRect(forCharacterRange range: NSRange, actualRange: NSRangePointer?) -> NSRect { + return NSMakeRect(frame.origin.x, frame.origin.y, 0, 0) + } + + func insertText(_ string: Any, replacementRange: NSRange) { + // We must have an associated event + guard NSApp.currentEvent != nil else { return } + guard let inspector = self.inspector else { return } + + // We want the string view of the any value + var chars = "" + switch (string) { + case let v as NSAttributedString: + chars = v.string + case let v as String: + chars = v + default: + return + } + + let len = chars.utf8CString.count + if (len == 0) { return } + + chars.withCString { ptr in + ghostty_inspector_text(inspector, ptr) + } + } + + override func doCommand(by selector: Selector) { + // This currently just prevents NSBeep from interpretKeyEvents but in the future + // we may want to make some of this work. + } + + // MARK: MTKView + + override func draw(_ dirtyRect: NSRect) { + guard + let commandBuffer = self.commandQueue.makeCommandBuffer(), + let descriptor = self.currentRenderPassDescriptor else { + return + } + + // We always update our size because sometimes draw is called + // between resize events and if our size is wrong with the underlying + // drawable we will crash. + updateSize() + + // Render + ghostty_inspector_metal_render( + inspector, + Unmanaged.passRetained(commandBuffer).toOpaque(), + Unmanaged.passRetained(descriptor).toOpaque() + ) + + guard let drawable = self.currentDrawable else { return } + commandBuffer.present(drawable) + commandBuffer.commit() + } + } +} diff --git a/macos/Sources/Ghostty/Package.swift b/macos/Sources/Ghostty/Package.swift index 8f97a090d..bd8db5f12 100644 --- a/macos/Sources/Ghostty/Package.swift +++ b/macos/Sources/Ghostty/Package.swift @@ -102,6 +102,12 @@ extension Ghostty.Notification { /// Notification static let didReceiveInitialWindowFrame = Notification.Name("com.mitchellh.ghostty.didReceiveInitialWindowFrame") static let FrameKey = "com.mitchellh.ghostty.frame" + + /// Notification to render the inspector for a surface + static let inspectorNeedsDisplay = Notification.Name("com.mitchellh.ghostty.inspectorNeedsDisplay") + + /// Notification to show/hide the inspector + static let didControlInspector = Notification.Name("com.mitchellh.ghostty.didControlInspector") } // Make the input enum hashable. diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 4fa0247e2..1901bab9f 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -32,7 +32,7 @@ extension Ghostty { content(surfaceView) } } - + struct SurfaceWrapper: View { // The surface to create a view for. This must be created upstream. As long as this // remains the same, the surface that is being rendered remains the same. @@ -41,7 +41,7 @@ extension Ghostty { // True if this surface is part of a split view. This is important to know so // we know whether to dim the surface out of focus. var isSplit: Bool = false - + // Maintain whether our view has focus or not @FocusState private var surfaceFocus: Bool @@ -233,7 +233,7 @@ extension Ghostty { return config } } - + /// The NSView implementation for a terminal surface. class SurfaceView: NSView, NSTextInputClient, ObservableObject { // The current title of the surface as defined by the pty. This can be @@ -245,6 +245,23 @@ extension Ghostty { // then the view is moved to a new window. var initialSize: NSSize? = nil + // Returns the inspector instance for this surface, or nil if the + // surface has been closed. + var inspector: ghostty_inspector_t? { + guard let surface = self.surface else { return nil } + return ghostty_surface_inspector(surface) + } + + // True if the inspector should be visible + @Published var inspectorVisible: Bool = false { + didSet { + if (oldValue && !inspectorVisible) { + guard let surface = self.surface else { return } + ghostty_inspector_free(surface) + } + } + } + private(set) var surface: ghostty_surface_t? var error: Error? = nil @@ -561,28 +578,28 @@ extension Ghostty { override func mouseDown(with event: NSEvent) { guard let surface = self.surface else { return } - let mods = Self.translateFlags(event.modifierFlags) + let mods = Ghostty.ghosttyMods(event.modifierFlags) ghostty_surface_mouse_button(surface, GHOSTTY_MOUSE_PRESS, GHOSTTY_MOUSE_LEFT, mods) } override func mouseUp(with event: NSEvent) { guard let surface = self.surface else { return } - let mods = Self.translateFlags(event.modifierFlags) + let mods = Ghostty.ghosttyMods(event.modifierFlags) ghostty_surface_mouse_button(surface, GHOSTTY_MOUSE_RELEASE, GHOSTTY_MOUSE_LEFT, mods) } override func rightMouseDown(with event: NSEvent) { guard let surface = self.surface else { return } - let mods = Self.translateFlags(event.modifierFlags) + let mods = Ghostty.ghosttyMods(event.modifierFlags) ghostty_surface_mouse_button(surface, GHOSTTY_MOUSE_PRESS, GHOSTTY_MOUSE_RIGHT, mods) } override func rightMouseUp(with event: NSEvent) { guard let surface = self.surface else { return } - let mods = Self.translateFlags(event.modifierFlags) + let mods = Ghostty.ghosttyMods(event.modifierFlags) ghostty_surface_mouse_button(surface, GHOSTTY_MOUSE_RELEASE, GHOSTTY_MOUSE_RIGHT, mods) } - + override func mouseMoved(with event: NSEvent) { guard let surface = self.surface else { return } @@ -723,7 +740,7 @@ extension Ghostty { // The keyAction function will do this AGAIN below which sucks to repeat // but this is super cheap and flagsChanged isn't that common. - let mods = Self.translateFlags(event.modifierFlags) + let mods = Ghostty.ghosttyMods(event.modifierFlags) // If the key that pressed this is active, its a press, else release var action = GHOSTTY_ACTION_RELEASE @@ -734,7 +751,7 @@ extension Ghostty { private func keyAction(_ action: ghostty_input_action_e, event: NSEvent) { guard let surface = self.surface else { return } - let mods = Self.translateFlags(event.modifierFlags) + let mods = Ghostty.ghosttyMods(event.modifierFlags) ghostty_surface_key(surface, action, UInt32(event.keyCode), mods) } @@ -858,143 +875,6 @@ extension Ghostty { print("SEL: \(selector)") } - - private static func translateFlags(_ flags: NSEvent.ModifierFlags) -> ghostty_input_mods_e { - var mods: UInt32 = GHOSTTY_MODS_NONE.rawValue - - if (flags.contains(.shift)) { mods |= GHOSTTY_MODS_SHIFT.rawValue } - if (flags.contains(.control)) { mods |= GHOSTTY_MODS_CTRL.rawValue } - if (flags.contains(.option)) { mods |= GHOSTTY_MODS_ALT.rawValue } - if (flags.contains(.command)) { mods |= GHOSTTY_MODS_SUPER.rawValue } - if (flags.contains(.capsLock)) { mods |= GHOSTTY_MODS_CAPS.rawValue } - - // Handle sided input. We can't tell that both are pressed in the - // Ghostty structure but thats okay -- we don't use that information. - let rawFlags = flags.rawValue - if (rawFlags & UInt(NX_DEVICERSHIFTKEYMASK) != 0) { mods |= GHOSTTY_MODS_SHIFT_RIGHT.rawValue } - if (rawFlags & UInt(NX_DEVICERCTLKEYMASK) != 0) { mods |= GHOSTTY_MODS_CTRL_RIGHT.rawValue } - if (rawFlags & UInt(NX_DEVICERALTKEYMASK) != 0) { mods |= GHOSTTY_MODS_ALT_RIGHT.rawValue } - if (rawFlags & UInt(NX_DEVICERCMDKEYMASK) != 0) { mods |= GHOSTTY_MODS_SUPER_RIGHT.rawValue } - - return ghostty_input_mods_e(mods) - } - - // Mapping of event keyCode to ghostty input key values. This is cribbed from - // glfw mostly since we started as a glfw-based app way back in the day! - static let keycodes: [UInt16 : ghostty_input_key_e] = [ - 0x1D: GHOSTTY_KEY_ZERO, - 0x12: GHOSTTY_KEY_ONE, - 0x13: GHOSTTY_KEY_TWO, - 0x14: GHOSTTY_KEY_THREE, - 0x15: GHOSTTY_KEY_FOUR, - 0x17: GHOSTTY_KEY_FIVE, - 0x16: GHOSTTY_KEY_SIX, - 0x1A: GHOSTTY_KEY_SEVEN, - 0x1C: GHOSTTY_KEY_EIGHT, - 0x19: GHOSTTY_KEY_NINE, - 0x00: GHOSTTY_KEY_A, - 0x0B: GHOSTTY_KEY_B, - 0x08: GHOSTTY_KEY_C, - 0x02: GHOSTTY_KEY_D, - 0x0E: GHOSTTY_KEY_E, - 0x03: GHOSTTY_KEY_F, - 0x05: GHOSTTY_KEY_G, - 0x04: GHOSTTY_KEY_H, - 0x22: GHOSTTY_KEY_I, - 0x26: GHOSTTY_KEY_J, - 0x28: GHOSTTY_KEY_K, - 0x25: GHOSTTY_KEY_L, - 0x2E: GHOSTTY_KEY_M, - 0x2D: GHOSTTY_KEY_N, - 0x1F: GHOSTTY_KEY_O, - 0x23: GHOSTTY_KEY_P, - 0x0C: GHOSTTY_KEY_Q, - 0x0F: GHOSTTY_KEY_R, - 0x01: GHOSTTY_KEY_S, - 0x11: GHOSTTY_KEY_T, - 0x20: GHOSTTY_KEY_U, - 0x09: GHOSTTY_KEY_V, - 0x0D: GHOSTTY_KEY_W, - 0x07: GHOSTTY_KEY_X, - 0x10: GHOSTTY_KEY_Y, - 0x06: GHOSTTY_KEY_Z, - - 0x27: GHOSTTY_KEY_APOSTROPHE, - 0x2A: GHOSTTY_KEY_BACKSLASH, - 0x2B: GHOSTTY_KEY_COMMA, - 0x18: GHOSTTY_KEY_EQUAL, - 0x32: GHOSTTY_KEY_GRAVE_ACCENT, - 0x21: GHOSTTY_KEY_LEFT_BRACKET, - 0x1B: GHOSTTY_KEY_MINUS, - 0x2F: GHOSTTY_KEY_PERIOD, - 0x1E: GHOSTTY_KEY_RIGHT_BRACKET, - 0x29: GHOSTTY_KEY_SEMICOLON, - 0x2C: GHOSTTY_KEY_SLASH, - - 0x33: GHOSTTY_KEY_BACKSPACE, - 0x39: GHOSTTY_KEY_CAPS_LOCK, - 0x75: GHOSTTY_KEY_DELETE, - 0x7D: GHOSTTY_KEY_DOWN, - 0x77: GHOSTTY_KEY_END, - 0x24: GHOSTTY_KEY_ENTER, - 0x35: GHOSTTY_KEY_ESCAPE, - 0x7A: GHOSTTY_KEY_F1, - 0x78: GHOSTTY_KEY_F2, - 0x63: GHOSTTY_KEY_F3, - 0x76: GHOSTTY_KEY_F4, - 0x60: GHOSTTY_KEY_F5, - 0x61: GHOSTTY_KEY_F6, - 0x62: GHOSTTY_KEY_F7, - 0x64: GHOSTTY_KEY_F8, - 0x65: GHOSTTY_KEY_F9, - 0x6D: GHOSTTY_KEY_F10, - 0x67: GHOSTTY_KEY_F11, - 0x6F: GHOSTTY_KEY_F12, - 0x69: GHOSTTY_KEY_PRINT_SCREEN, - 0x6B: GHOSTTY_KEY_F14, - 0x71: GHOSTTY_KEY_F15, - 0x6A: GHOSTTY_KEY_F16, - 0x40: GHOSTTY_KEY_F17, - 0x4F: GHOSTTY_KEY_F18, - 0x50: GHOSTTY_KEY_F19, - 0x5A: GHOSTTY_KEY_F20, - 0x73: GHOSTTY_KEY_HOME, - 0x72: GHOSTTY_KEY_INSERT, - 0x7B: GHOSTTY_KEY_LEFT, - 0x3A: GHOSTTY_KEY_LEFT_ALT, - 0x3B: GHOSTTY_KEY_LEFT_CONTROL, - 0x38: GHOSTTY_KEY_LEFT_SHIFT, - 0x37: GHOSTTY_KEY_LEFT_SUPER, - 0x47: GHOSTTY_KEY_NUM_LOCK, - 0x79: GHOSTTY_KEY_PAGE_DOWN, - 0x74: GHOSTTY_KEY_PAGE_UP, - 0x7C: GHOSTTY_KEY_RIGHT, - 0x3D: GHOSTTY_KEY_RIGHT_ALT, - 0x3E: GHOSTTY_KEY_RIGHT_CONTROL, - 0x3C: GHOSTTY_KEY_RIGHT_SHIFT, - 0x36: GHOSTTY_KEY_RIGHT_SUPER, - 0x31: GHOSTTY_KEY_SPACE, - 0x30: GHOSTTY_KEY_TAB, - 0x7E: GHOSTTY_KEY_UP, - - 0x52: GHOSTTY_KEY_KP_0, - 0x53: GHOSTTY_KEY_KP_1, - 0x54: GHOSTTY_KEY_KP_2, - 0x55: GHOSTTY_KEY_KP_3, - 0x56: GHOSTTY_KEY_KP_4, - 0x57: GHOSTTY_KEY_KP_5, - 0x58: GHOSTTY_KEY_KP_6, - 0x59: GHOSTTY_KEY_KP_7, - 0x5B: GHOSTTY_KEY_KP_8, - 0x5C: GHOSTTY_KEY_KP_9, - 0x45: GHOSTTY_KEY_KP_ADD, - 0x41: GHOSTTY_KEY_KP_DECIMAL, - 0x4B: GHOSTTY_KEY_KP_DIVIDE, - 0x4C: GHOSTTY_KEY_KP_ENTER, - 0x51: GHOSTTY_KEY_KP_EQUAL, - 0x43: GHOSTTY_KEY_KP_MULTIPLY, - 0x4E: GHOSTTY_KEY_KP_SUBTRACT, - ]; } } diff --git a/macos/Sources/Helpers/MetalView.swift b/macos/Sources/Helpers/MetalView.swift new file mode 100644 index 000000000..ddbf00d1a --- /dev/null +++ b/macos/Sources/Helpers/MetalView.swift @@ -0,0 +1,26 @@ +import SwiftUI +import MetalKit + +/// Renders an MTKView with the given renderer class. +struct MetalView: View { + @State private var metalView = V() + + var body: some View { + MetalViewRepresentable(metalView: $metalView) + } +} + +fileprivate struct MetalViewRepresentable: NSViewRepresentable { + @Binding var metalView: V + + func makeNSView(context: Context) -> some NSView { + metalView + } + + func updateNSView(_ view: NSViewType, context: Context) { + updateMetalView() + } + + func updateMetalView() { + } +} diff --git a/macos/Sources/MainMenu.xib b/macos/Sources/MainMenu.xib index fa8beb2f0..910430b95 100644 --- a/macos/Sources/MainMenu.xib +++ b/macos/Sources/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -33,6 +33,7 @@ + @@ -153,6 +154,13 @@ + + + + + + + diff --git a/pkg/apple-sdk/build.zig.zon b/pkg/apple-sdk/build.zig.zon index f6bca6cec..bcc5f95cf 100644 --- a/pkg/apple-sdk/build.zig.zon +++ b/pkg/apple-sdk/build.zig.zon @@ -3,8 +3,8 @@ .version = "0.1.0", .dependencies = .{ .macos_sdk = .{ - .url = "https://github.com/mitchellh/zig-build-macos-sdk/archive/7e50d6ea241403615d5ebc9f1df4680d3907fa92.tar.gz", - .hash = "1220eb266898413ecfe5aaf7f29cc17eb479d046adecc94ebc7d5e1e807d2aabdd70", + .url = "https://github.com/mitchellh/zig-build-macos-sdk/archive/7a7cb3816617dbaf87ecbc3fd90ad56a6f828275.tar.gz", + .hash = "1220a1dd91457d0131b50db15fb1bc51208ecadf1a23ad5dfa2d3a6bb3d1de5230c1", }, }, } diff --git a/pkg/cimgui/build.zig b/pkg/cimgui/build.zig new file mode 100644 index 000000000..d0e02ded8 --- /dev/null +++ b/pkg/cimgui/build.zig @@ -0,0 +1,91 @@ +const std = @import("std"); +const NativeTargetInfo = std.zig.system.NativeTargetInfo; + +pub fn build(b: *std.Build) !void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + _ = b.addModule("cimgui", .{ .source_file = .{ .path = "main.zig" } }); + + const imgui = b.dependency("imgui", .{}); + const freetype = b.dependency("freetype", .{ + .target = target, + .optimize = optimize, + .@"enable-libpng" = true, + }); + const lib = b.addStaticLibrary(.{ + .name = "cimgui", + .target = target, + .optimize = optimize, + }); + lib.linkLibC(); + lib.linkLibCpp(); + lib.linkLibrary(freetype.artifact("freetype")); + if (target.isWindows()) { + lib.linkSystemLibrary("imm32"); + } + + lib.addIncludePath(imgui.path("")); + + var flags = std.ArrayList([]const u8).init(b.allocator); + defer flags.deinit(); + try flags.appendSlice(&.{ + "-DCIMGUI_FREETYPE=1", + "-DIMGUI_USE_WCHAR32=1", + "-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1", + }); + if (target.isWindows()) { + try flags.appendSlice(&.{ + "-DIMGUI_IMPL_API=extern\t\"C\"\t__declspec(dllexport)", + }); + } else { + try flags.appendSlice(&.{ + "-DIMGUI_IMPL_API=extern\t\"C\"", + }); + } + + lib.addCSourceFile(.{ .file = .{ .path = "vendor/cimgui.cpp" }, .flags = flags.items }); + lib.addCSourceFile(.{ .file = imgui.path("imgui.cpp"), .flags = flags.items }); + lib.addCSourceFile(.{ .file = imgui.path("imgui_draw.cpp"), .flags = flags.items }); + lib.addCSourceFile(.{ .file = imgui.path("imgui_demo.cpp"), .flags = flags.items }); + lib.addCSourceFile(.{ .file = imgui.path("imgui_widgets.cpp"), .flags = flags.items }); + lib.addCSourceFile(.{ .file = imgui.path("imgui_tables.cpp"), .flags = flags.items }); + lib.addCSourceFile(.{ .file = imgui.path("misc/freetype/imgui_freetype.cpp"), .flags = flags.items }); + + lib.addCSourceFile(.{ + .file = imgui.path("backends/imgui_impl_opengl3.cpp"), + .flags = flags.items, + }); + + if (target.isDarwin()) { + if (!target.isNative()) try @import("apple_sdk").addPaths(b, lib); + lib.addCSourceFile(.{ + .file = imgui.path("backends/imgui_impl_metal.mm"), + .flags = flags.items, + }); + lib.addCSourceFile(.{ + .file = imgui.path("backends/imgui_impl_osx.mm"), + .flags = flags.items, + }); + } + + lib.installHeadersDirectoryOptions(.{ + .source_dir = .{ .path = "vendor" }, + .install_dir = .header, + .install_subdir = "", + .include_extensions = &.{".h"}, + }); + + b.installArtifact(lib); + + const test_exe = b.addTest(.{ + .name = "test", + .root_source_file = .{ .path = "main.zig" }, + .target = target, + .optimize = optimize, + }); + test_exe.linkLibrary(lib); + const tests_run = b.addRunArtifact(test_exe); + const test_step = b.step("test", "Run tests"); + test_step.dependOn(&tests_run.step); +} diff --git a/pkg/cimgui/build.zig.zon b/pkg/cimgui/build.zig.zon new file mode 100644 index 000000000..63eb624b8 --- /dev/null +++ b/pkg/cimgui/build.zig.zon @@ -0,0 +1,16 @@ +.{ + .name = "cimgui", + .version = "1.89.9", + .paths = .{""}, + .dependencies = .{ + // This should be kept in sync with the submodule in the cimgui source + // code to be safe that they're compatible. + .imgui = .{ + .url = "https://github.com/ocornut/imgui/archive/1d8e48c161370c37628c4f37f3f87cb19fbcb723.tar.gz", + .hash = "12205e93e208aada4c835acdc3e2c1fac95b3ad92b47abe6412ab043f9f13817ad9b", + }, + + .apple_sdk = .{ .path = "../apple-sdk" }, + .freetype = .{ .path = "../freetype" }, + }, +} diff --git a/pkg/cimgui/c.zig b/pkg/cimgui/c.zig new file mode 100644 index 000000000..19a619634 --- /dev/null +++ b/pkg/cimgui/c.zig @@ -0,0 +1,24 @@ +const c = @cImport({ + @cDefine("CIMGUI_DEFINE_ENUMS_AND_STRUCTS", "1"); + @cInclude("cimgui.h"); +}); + +// Export all of the C API +pub usingnamespace c; + +// OpenGL +pub extern fn ImGui_ImplOpenGL3_Init(?[*:0]const u8) callconv(.C) bool; +pub extern fn ImGui_ImplOpenGL3_Shutdown() callconv(.C) void; +pub extern fn ImGui_ImplOpenGL3_NewFrame() callconv(.C) void; +pub extern fn ImGui_ImplOpenGL3_RenderDrawData(*c.ImDrawData) callconv(.C) void; + +// Metal +pub extern fn ImGui_ImplMetal_Init(*anyopaque) callconv(.C) bool; +pub extern fn ImGui_ImplMetal_Shutdown() callconv(.C) void; +pub extern fn ImGui_ImplMetal_NewFrame(*anyopaque) callconv(.C) void; +pub extern fn ImGui_ImplMetal_RenderDrawData(*c.ImDrawData, *anyopaque, *anyopaque) callconv(.C) void; + +// OSX +pub extern fn ImGui_ImplOSX_Init(*anyopaque) callconv(.C) bool; +pub extern fn ImGui_ImplOSX_Shutdown() callconv(.C) void; +pub extern fn ImGui_ImplOSX_NewFrame(*anyopaque) callconv(.C) void; diff --git a/pkg/cimgui/main.zig b/pkg/cimgui/main.zig new file mode 100644 index 000000000..22183a367 --- /dev/null +++ b/pkg/cimgui/main.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig"); + +test {} diff --git a/pkg/cimgui/vendor/cimgui.cpp b/pkg/cimgui/vendor/cimgui.cpp new file mode 100644 index 000000000..bed5e30d7 --- /dev/null +++ b/pkg/cimgui/vendor/cimgui.cpp @@ -0,0 +1,5554 @@ +//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui +//based on imgui.h file version "1.89.9" 18990 from Dear ImGui https://github.com/ocornut/imgui +//with imgui_internal.h api +//with imgui_freetype.h api +//docking branch +#define IMGUI_ENABLE_FREETYPE +#ifdef IMGUI_ENABLE_FREETYPE +#ifndef CIMGUI_FREETYPE +#error "IMGUI_FREETYPE should be defined for Freetype linking" +#endif +#else +#ifdef CIMGUI_FREETYPE +#error "IMGUI_FREETYPE should not be defined without freetype generated cimgui" +#endif +#endif +#include "imgui.h" +#ifdef IMGUI_ENABLE_FREETYPE +#include "misc/freetype/imgui_freetype.h" +#endif +#include "imgui_internal.h" +#include "cimgui.h" + + + +CIMGUI_API ImVec2* ImVec2_ImVec2_Nil(void) +{ + return IM_NEW(ImVec2)(); +} +CIMGUI_API void ImVec2_destroy(ImVec2* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImVec2* ImVec2_ImVec2_Float(float _x,float _y) +{ + return IM_NEW(ImVec2)(_x,_y); +} +CIMGUI_API ImVec4* ImVec4_ImVec4_Nil(void) +{ + return IM_NEW(ImVec4)(); +} +CIMGUI_API void ImVec4_destroy(ImVec4* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImVec4* ImVec4_ImVec4_Float(float _x,float _y,float _z,float _w) +{ + return IM_NEW(ImVec4)(_x,_y,_z,_w); +} +CIMGUI_API ImGuiContext* igCreateContext(ImFontAtlas* shared_font_atlas) +{ + return ImGui::CreateContext(shared_font_atlas); +} +CIMGUI_API void igDestroyContext(ImGuiContext* ctx) +{ + return ImGui::DestroyContext(ctx); +} +CIMGUI_API ImGuiContext* igGetCurrentContext() +{ + return ImGui::GetCurrentContext(); +} +CIMGUI_API void igSetCurrentContext(ImGuiContext* ctx) +{ + return ImGui::SetCurrentContext(ctx); +} +CIMGUI_API ImGuiIO* igGetIO() +{ + return &ImGui::GetIO(); +} +CIMGUI_API ImGuiStyle* igGetStyle() +{ + return &ImGui::GetStyle(); +} +CIMGUI_API void igNewFrame() +{ + return ImGui::NewFrame(); +} +CIMGUI_API void igEndFrame() +{ + return ImGui::EndFrame(); +} +CIMGUI_API void igRender() +{ + return ImGui::Render(); +} +CIMGUI_API ImDrawData* igGetDrawData() +{ + return ImGui::GetDrawData(); +} +CIMGUI_API void igShowDemoWindow(bool* p_open) +{ + return ImGui::ShowDemoWindow(p_open); +} +CIMGUI_API void igShowMetricsWindow(bool* p_open) +{ + return ImGui::ShowMetricsWindow(p_open); +} +CIMGUI_API void igShowDebugLogWindow(bool* p_open) +{ + return ImGui::ShowDebugLogWindow(p_open); +} +CIMGUI_API void igShowStackToolWindow(bool* p_open) +{ + return ImGui::ShowStackToolWindow(p_open); +} +CIMGUI_API void igShowAboutWindow(bool* p_open) +{ + return ImGui::ShowAboutWindow(p_open); +} +CIMGUI_API void igShowStyleEditor(ImGuiStyle* ref) +{ + return ImGui::ShowStyleEditor(ref); +} +CIMGUI_API bool igShowStyleSelector(const char* label) +{ + return ImGui::ShowStyleSelector(label); +} +CIMGUI_API void igShowFontSelector(const char* label) +{ + return ImGui::ShowFontSelector(label); +} +CIMGUI_API void igShowUserGuide() +{ + return ImGui::ShowUserGuide(); +} +CIMGUI_API const char* igGetVersion() +{ + return ImGui::GetVersion(); +} +CIMGUI_API void igStyleColorsDark(ImGuiStyle* dst) +{ + return ImGui::StyleColorsDark(dst); +} +CIMGUI_API void igStyleColorsLight(ImGuiStyle* dst) +{ + return ImGui::StyleColorsLight(dst); +} +CIMGUI_API void igStyleColorsClassic(ImGuiStyle* dst) +{ + return ImGui::StyleColorsClassic(dst); +} +CIMGUI_API bool igBegin(const char* name,bool* p_open,ImGuiWindowFlags flags) +{ + return ImGui::Begin(name,p_open,flags); +} +CIMGUI_API void igEnd() +{ + return ImGui::End(); +} +CIMGUI_API bool igBeginChild_Str(const char* str_id,const ImVec2 size,bool border,ImGuiWindowFlags flags) +{ + return ImGui::BeginChild(str_id,size,border,flags); +} +CIMGUI_API bool igBeginChild_ID(ImGuiID id,const ImVec2 size,bool border,ImGuiWindowFlags flags) +{ + return ImGui::BeginChild(id,size,border,flags); +} +CIMGUI_API void igEndChild() +{ + return ImGui::EndChild(); +} +CIMGUI_API bool igIsWindowAppearing() +{ + return ImGui::IsWindowAppearing(); +} +CIMGUI_API bool igIsWindowCollapsed() +{ + return ImGui::IsWindowCollapsed(); +} +CIMGUI_API bool igIsWindowFocused(ImGuiFocusedFlags flags) +{ + return ImGui::IsWindowFocused(flags); +} +CIMGUI_API bool igIsWindowHovered(ImGuiHoveredFlags flags) +{ + return ImGui::IsWindowHovered(flags); +} +CIMGUI_API ImDrawList* igGetWindowDrawList() +{ + return ImGui::GetWindowDrawList(); +} +CIMGUI_API float igGetWindowDpiScale() +{ + return ImGui::GetWindowDpiScale(); +} +CIMGUI_API void igGetWindowPos(ImVec2 *pOut) +{ + *pOut = ImGui::GetWindowPos(); +} +CIMGUI_API void igGetWindowSize(ImVec2 *pOut) +{ + *pOut = ImGui::GetWindowSize(); +} +CIMGUI_API float igGetWindowWidth() +{ + return ImGui::GetWindowWidth(); +} +CIMGUI_API float igGetWindowHeight() +{ + return ImGui::GetWindowHeight(); +} +CIMGUI_API ImGuiViewport* igGetWindowViewport() +{ + return ImGui::GetWindowViewport(); +} +CIMGUI_API void igSetNextWindowPos(const ImVec2 pos,ImGuiCond cond,const ImVec2 pivot) +{ + return ImGui::SetNextWindowPos(pos,cond,pivot); +} +CIMGUI_API void igSetNextWindowSize(const ImVec2 size,ImGuiCond cond) +{ + return ImGui::SetNextWindowSize(size,cond); +} +CIMGUI_API void igSetNextWindowSizeConstraints(const ImVec2 size_min,const ImVec2 size_max,ImGuiSizeCallback custom_callback,void* custom_callback_data) +{ + return ImGui::SetNextWindowSizeConstraints(size_min,size_max,custom_callback,custom_callback_data); +} +CIMGUI_API void igSetNextWindowContentSize(const ImVec2 size) +{ + return ImGui::SetNextWindowContentSize(size); +} +CIMGUI_API void igSetNextWindowCollapsed(bool collapsed,ImGuiCond cond) +{ + return ImGui::SetNextWindowCollapsed(collapsed,cond); +} +CIMGUI_API void igSetNextWindowFocus() +{ + return ImGui::SetNextWindowFocus(); +} +CIMGUI_API void igSetNextWindowScroll(const ImVec2 scroll) +{ + return ImGui::SetNextWindowScroll(scroll); +} +CIMGUI_API void igSetNextWindowBgAlpha(float alpha) +{ + return ImGui::SetNextWindowBgAlpha(alpha); +} +CIMGUI_API void igSetNextWindowViewport(ImGuiID viewport_id) +{ + return ImGui::SetNextWindowViewport(viewport_id); +} +CIMGUI_API void igSetWindowPos_Vec2(const ImVec2 pos,ImGuiCond cond) +{ + return ImGui::SetWindowPos(pos,cond); +} +CIMGUI_API void igSetWindowSize_Vec2(const ImVec2 size,ImGuiCond cond) +{ + return ImGui::SetWindowSize(size,cond); +} +CIMGUI_API void igSetWindowCollapsed_Bool(bool collapsed,ImGuiCond cond) +{ + return ImGui::SetWindowCollapsed(collapsed,cond); +} +CIMGUI_API void igSetWindowFocus_Nil() +{ + return ImGui::SetWindowFocus(); +} +CIMGUI_API void igSetWindowFontScale(float scale) +{ + return ImGui::SetWindowFontScale(scale); +} +CIMGUI_API void igSetWindowPos_Str(const char* name,const ImVec2 pos,ImGuiCond cond) +{ + return ImGui::SetWindowPos(name,pos,cond); +} +CIMGUI_API void igSetWindowSize_Str(const char* name,const ImVec2 size,ImGuiCond cond) +{ + return ImGui::SetWindowSize(name,size,cond); +} +CIMGUI_API void igSetWindowCollapsed_Str(const char* name,bool collapsed,ImGuiCond cond) +{ + return ImGui::SetWindowCollapsed(name,collapsed,cond); +} +CIMGUI_API void igSetWindowFocus_Str(const char* name) +{ + return ImGui::SetWindowFocus(name); +} +CIMGUI_API void igGetContentRegionAvail(ImVec2 *pOut) +{ + *pOut = ImGui::GetContentRegionAvail(); +} +CIMGUI_API void igGetContentRegionMax(ImVec2 *pOut) +{ + *pOut = ImGui::GetContentRegionMax(); +} +CIMGUI_API void igGetWindowContentRegionMin(ImVec2 *pOut) +{ + *pOut = ImGui::GetWindowContentRegionMin(); +} +CIMGUI_API void igGetWindowContentRegionMax(ImVec2 *pOut) +{ + *pOut = ImGui::GetWindowContentRegionMax(); +} +CIMGUI_API float igGetScrollX() +{ + return ImGui::GetScrollX(); +} +CIMGUI_API float igGetScrollY() +{ + return ImGui::GetScrollY(); +} +CIMGUI_API void igSetScrollX_Float(float scroll_x) +{ + return ImGui::SetScrollX(scroll_x); +} +CIMGUI_API void igSetScrollY_Float(float scroll_y) +{ + return ImGui::SetScrollY(scroll_y); +} +CIMGUI_API float igGetScrollMaxX() +{ + return ImGui::GetScrollMaxX(); +} +CIMGUI_API float igGetScrollMaxY() +{ + return ImGui::GetScrollMaxY(); +} +CIMGUI_API void igSetScrollHereX(float center_x_ratio) +{ + return ImGui::SetScrollHereX(center_x_ratio); +} +CIMGUI_API void igSetScrollHereY(float center_y_ratio) +{ + return ImGui::SetScrollHereY(center_y_ratio); +} +CIMGUI_API void igSetScrollFromPosX_Float(float local_x,float center_x_ratio) +{ + return ImGui::SetScrollFromPosX(local_x,center_x_ratio); +} +CIMGUI_API void igSetScrollFromPosY_Float(float local_y,float center_y_ratio) +{ + return ImGui::SetScrollFromPosY(local_y,center_y_ratio); +} +CIMGUI_API void igPushFont(ImFont* font) +{ + return ImGui::PushFont(font); +} +CIMGUI_API void igPopFont() +{ + return ImGui::PopFont(); +} +CIMGUI_API void igPushStyleColor_U32(ImGuiCol idx,ImU32 col) +{ + return ImGui::PushStyleColor(idx,col); +} +CIMGUI_API void igPushStyleColor_Vec4(ImGuiCol idx,const ImVec4 col) +{ + return ImGui::PushStyleColor(idx,col); +} +CIMGUI_API void igPopStyleColor(int count) +{ + return ImGui::PopStyleColor(count); +} +CIMGUI_API void igPushStyleVar_Float(ImGuiStyleVar idx,float val) +{ + return ImGui::PushStyleVar(idx,val); +} +CIMGUI_API void igPushStyleVar_Vec2(ImGuiStyleVar idx,const ImVec2 val) +{ + return ImGui::PushStyleVar(idx,val); +} +CIMGUI_API void igPopStyleVar(int count) +{ + return ImGui::PopStyleVar(count); +} +CIMGUI_API void igPushTabStop(bool tab_stop) +{ + return ImGui::PushTabStop(tab_stop); +} +CIMGUI_API void igPopTabStop() +{ + return ImGui::PopTabStop(); +} +CIMGUI_API void igPushButtonRepeat(bool repeat) +{ + return ImGui::PushButtonRepeat(repeat); +} +CIMGUI_API void igPopButtonRepeat() +{ + return ImGui::PopButtonRepeat(); +} +CIMGUI_API void igPushItemWidth(float item_width) +{ + return ImGui::PushItemWidth(item_width); +} +CIMGUI_API void igPopItemWidth() +{ + return ImGui::PopItemWidth(); +} +CIMGUI_API void igSetNextItemWidth(float item_width) +{ + return ImGui::SetNextItemWidth(item_width); +} +CIMGUI_API float igCalcItemWidth() +{ + return ImGui::CalcItemWidth(); +} +CIMGUI_API void igPushTextWrapPos(float wrap_local_pos_x) +{ + return ImGui::PushTextWrapPos(wrap_local_pos_x); +} +CIMGUI_API void igPopTextWrapPos() +{ + return ImGui::PopTextWrapPos(); +} +CIMGUI_API ImFont* igGetFont() +{ + return ImGui::GetFont(); +} +CIMGUI_API float igGetFontSize() +{ + return ImGui::GetFontSize(); +} +CIMGUI_API void igGetFontTexUvWhitePixel(ImVec2 *pOut) +{ + *pOut = ImGui::GetFontTexUvWhitePixel(); +} +CIMGUI_API ImU32 igGetColorU32_Col(ImGuiCol idx,float alpha_mul) +{ + return ImGui::GetColorU32(idx,alpha_mul); +} +CIMGUI_API ImU32 igGetColorU32_Vec4(const ImVec4 col) +{ + return ImGui::GetColorU32(col); +} +CIMGUI_API ImU32 igGetColorU32_U32(ImU32 col) +{ + return ImGui::GetColorU32(col); +} +CIMGUI_API const ImVec4* igGetStyleColorVec4(ImGuiCol idx) +{ + return &ImGui::GetStyleColorVec4(idx); +} +CIMGUI_API void igSeparator() +{ + return ImGui::Separator(); +} +CIMGUI_API void igSameLine(float offset_from_start_x,float spacing) +{ + return ImGui::SameLine(offset_from_start_x,spacing); +} +CIMGUI_API void igNewLine() +{ + return ImGui::NewLine(); +} +CIMGUI_API void igSpacing() +{ + return ImGui::Spacing(); +} +CIMGUI_API void igDummy(const ImVec2 size) +{ + return ImGui::Dummy(size); +} +CIMGUI_API void igIndent(float indent_w) +{ + return ImGui::Indent(indent_w); +} +CIMGUI_API void igUnindent(float indent_w) +{ + return ImGui::Unindent(indent_w); +} +CIMGUI_API void igBeginGroup() +{ + return ImGui::BeginGroup(); +} +CIMGUI_API void igEndGroup() +{ + return ImGui::EndGroup(); +} +CIMGUI_API void igGetCursorPos(ImVec2 *pOut) +{ + *pOut = ImGui::GetCursorPos(); +} +CIMGUI_API float igGetCursorPosX() +{ + return ImGui::GetCursorPosX(); +} +CIMGUI_API float igGetCursorPosY() +{ + return ImGui::GetCursorPosY(); +} +CIMGUI_API void igSetCursorPos(const ImVec2 local_pos) +{ + return ImGui::SetCursorPos(local_pos); +} +CIMGUI_API void igSetCursorPosX(float local_x) +{ + return ImGui::SetCursorPosX(local_x); +} +CIMGUI_API void igSetCursorPosY(float local_y) +{ + return ImGui::SetCursorPosY(local_y); +} +CIMGUI_API void igGetCursorStartPos(ImVec2 *pOut) +{ + *pOut = ImGui::GetCursorStartPos(); +} +CIMGUI_API void igGetCursorScreenPos(ImVec2 *pOut) +{ + *pOut = ImGui::GetCursorScreenPos(); +} +CIMGUI_API void igSetCursorScreenPos(const ImVec2 pos) +{ + return ImGui::SetCursorScreenPos(pos); +} +CIMGUI_API void igAlignTextToFramePadding() +{ + return ImGui::AlignTextToFramePadding(); +} +CIMGUI_API float igGetTextLineHeight() +{ + return ImGui::GetTextLineHeight(); +} +CIMGUI_API float igGetTextLineHeightWithSpacing() +{ + return ImGui::GetTextLineHeightWithSpacing(); +} +CIMGUI_API float igGetFrameHeight() +{ + return ImGui::GetFrameHeight(); +} +CIMGUI_API float igGetFrameHeightWithSpacing() +{ + return ImGui::GetFrameHeightWithSpacing(); +} +CIMGUI_API void igPushID_Str(const char* str_id) +{ + return ImGui::PushID(str_id); +} +CIMGUI_API void igPushID_StrStr(const char* str_id_begin,const char* str_id_end) +{ + return ImGui::PushID(str_id_begin,str_id_end); +} +CIMGUI_API void igPushID_Ptr(const void* ptr_id) +{ + return ImGui::PushID(ptr_id); +} +CIMGUI_API void igPushID_Int(int int_id) +{ + return ImGui::PushID(int_id); +} +CIMGUI_API void igPopID() +{ + return ImGui::PopID(); +} +CIMGUI_API ImGuiID igGetID_Str(const char* str_id) +{ + return ImGui::GetID(str_id); +} +CIMGUI_API ImGuiID igGetID_StrStr(const char* str_id_begin,const char* str_id_end) +{ + return ImGui::GetID(str_id_begin,str_id_end); +} +CIMGUI_API ImGuiID igGetID_Ptr(const void* ptr_id) +{ + return ImGui::GetID(ptr_id); +} +CIMGUI_API void igTextUnformatted(const char* text,const char* text_end) +{ + return ImGui::TextUnformatted(text,text_end); +} +CIMGUI_API void igText(const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::TextV(fmt,args); + va_end(args); +} +CIMGUI_API void igTextV(const char* fmt,va_list args) +{ + return ImGui::TextV(fmt,args); +} +CIMGUI_API void igTextColored(const ImVec4 col,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::TextColoredV(col,fmt,args); + va_end(args); +} +CIMGUI_API void igTextColoredV(const ImVec4 col,const char* fmt,va_list args) +{ + return ImGui::TextColoredV(col,fmt,args); +} +CIMGUI_API void igTextDisabled(const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::TextDisabledV(fmt,args); + va_end(args); +} +CIMGUI_API void igTextDisabledV(const char* fmt,va_list args) +{ + return ImGui::TextDisabledV(fmt,args); +} +CIMGUI_API void igTextWrapped(const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::TextWrappedV(fmt,args); + va_end(args); +} +CIMGUI_API void igTextWrappedV(const char* fmt,va_list args) +{ + return ImGui::TextWrappedV(fmt,args); +} +CIMGUI_API void igLabelText(const char* label,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::LabelTextV(label,fmt,args); + va_end(args); +} +CIMGUI_API void igLabelTextV(const char* label,const char* fmt,va_list args) +{ + return ImGui::LabelTextV(label,fmt,args); +} +CIMGUI_API void igBulletText(const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::BulletTextV(fmt,args); + va_end(args); +} +CIMGUI_API void igBulletTextV(const char* fmt,va_list args) +{ + return ImGui::BulletTextV(fmt,args); +} +CIMGUI_API void igSeparatorText(const char* label) +{ + return ImGui::SeparatorText(label); +} +CIMGUI_API bool igButton(const char* label,const ImVec2 size) +{ + return ImGui::Button(label,size); +} +CIMGUI_API bool igSmallButton(const char* label) +{ + return ImGui::SmallButton(label); +} +CIMGUI_API bool igInvisibleButton(const char* str_id,const ImVec2 size,ImGuiButtonFlags flags) +{ + return ImGui::InvisibleButton(str_id,size,flags); +} +CIMGUI_API bool igArrowButton(const char* str_id,ImGuiDir dir) +{ + return ImGui::ArrowButton(str_id,dir); +} +CIMGUI_API bool igCheckbox(const char* label,bool* v) +{ + return ImGui::Checkbox(label,v); +} +CIMGUI_API bool igCheckboxFlags_IntPtr(const char* label,int* flags,int flags_value) +{ + return ImGui::CheckboxFlags(label,flags,flags_value); +} +CIMGUI_API bool igCheckboxFlags_UintPtr(const char* label,unsigned int* flags,unsigned int flags_value) +{ + return ImGui::CheckboxFlags(label,flags,flags_value); +} +CIMGUI_API bool igRadioButton_Bool(const char* label,bool active) +{ + return ImGui::RadioButton(label,active); +} +CIMGUI_API bool igRadioButton_IntPtr(const char* label,int* v,int v_button) +{ + return ImGui::RadioButton(label,v,v_button); +} +CIMGUI_API void igProgressBar(float fraction,const ImVec2 size_arg,const char* overlay) +{ + return ImGui::ProgressBar(fraction,size_arg,overlay); +} +CIMGUI_API void igBullet() +{ + return ImGui::Bullet(); +} +CIMGUI_API void igImage(ImTextureID user_texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 tint_col,const ImVec4 border_col) +{ + return ImGui::Image(user_texture_id,size,uv0,uv1,tint_col,border_col); +} +CIMGUI_API bool igImageButton(const char* str_id,ImTextureID user_texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 bg_col,const ImVec4 tint_col) +{ + return ImGui::ImageButton(str_id,user_texture_id,size,uv0,uv1,bg_col,tint_col); +} +CIMGUI_API bool igBeginCombo(const char* label,const char* preview_value,ImGuiComboFlags flags) +{ + return ImGui::BeginCombo(label,preview_value,flags); +} +CIMGUI_API void igEndCombo() +{ + return ImGui::EndCombo(); +} +CIMGUI_API bool igCombo_Str_arr(const char* label,int* current_item,const char* const items[],int items_count,int popup_max_height_in_items) +{ + return ImGui::Combo(label,current_item,items,items_count,popup_max_height_in_items); +} +CIMGUI_API bool igCombo_Str(const char* label,int* current_item,const char* items_separated_by_zeros,int popup_max_height_in_items) +{ + return ImGui::Combo(label,current_item,items_separated_by_zeros,popup_max_height_in_items); +} +CIMGUI_API bool igCombo_FnBoolPtr(const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int popup_max_height_in_items) +{ + return ImGui::Combo(label,current_item,items_getter,data,items_count,popup_max_height_in_items); +} +CIMGUI_API bool igDragFloat(const char* label,float* v,float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragFloat(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragFloat2(const char* label,float v[2],float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragFloat2(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragFloat3(const char* label,float v[3],float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragFloat3(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragFloat4(const char* label,float v[4],float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragFloat4(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragFloatRange2(const char* label,float* v_current_min,float* v_current_max,float v_speed,float v_min,float v_max,const char* format,const char* format_max,ImGuiSliderFlags flags) +{ + return ImGui::DragFloatRange2(label,v_current_min,v_current_max,v_speed,v_min,v_max,format,format_max,flags); +} +CIMGUI_API bool igDragInt(const char* label,int* v,float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragInt(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragInt2(const char* label,int v[2],float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragInt2(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragInt3(const char* label,int v[3],float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragInt3(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragInt4(const char* label,int v[4],float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragInt4(label,v,v_speed,v_min,v_max,format,flags); +} +CIMGUI_API bool igDragIntRange2(const char* label,int* v_current_min,int* v_current_max,float v_speed,int v_min,int v_max,const char* format,const char* format_max,ImGuiSliderFlags flags) +{ + return ImGui::DragIntRange2(label,v_current_min,v_current_max,v_speed,v_min,v_max,format,format_max,flags); +} +CIMGUI_API bool igDragScalar(const char* label,ImGuiDataType data_type,void* p_data,float v_speed,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragScalar(label,data_type,p_data,v_speed,p_min,p_max,format,flags); +} +CIMGUI_API bool igDragScalarN(const char* label,ImGuiDataType data_type,void* p_data,int components,float v_speed,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragScalarN(label,data_type,p_data,components,v_speed,p_min,p_max,format,flags); +} +CIMGUI_API bool igSliderFloat(const char* label,float* v,float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderFloat(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderFloat2(const char* label,float v[2],float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderFloat2(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderFloat3(const char* label,float v[3],float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderFloat3(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderFloat4(const char* label,float v[4],float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderFloat4(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderAngle(const char* label,float* v_rad,float v_degrees_min,float v_degrees_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderAngle(label,v_rad,v_degrees_min,v_degrees_max,format,flags); +} +CIMGUI_API bool igSliderInt(const char* label,int* v,int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderInt(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderInt2(const char* label,int v[2],int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderInt2(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderInt3(const char* label,int v[3],int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderInt3(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderInt4(const char* label,int v[4],int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderInt4(label,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igSliderScalar(const char* label,ImGuiDataType data_type,void* p_data,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderScalar(label,data_type,p_data,p_min,p_max,format,flags); +} +CIMGUI_API bool igSliderScalarN(const char* label,ImGuiDataType data_type,void* p_data,int components,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::SliderScalarN(label,data_type,p_data,components,p_min,p_max,format,flags); +} +CIMGUI_API bool igVSliderFloat(const char* label,const ImVec2 size,float* v,float v_min,float v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::VSliderFloat(label,size,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igVSliderInt(const char* label,const ImVec2 size,int* v,int v_min,int v_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::VSliderInt(label,size,v,v_min,v_max,format,flags); +} +CIMGUI_API bool igVSliderScalar(const char* label,const ImVec2 size,ImGuiDataType data_type,void* p_data,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::VSliderScalar(label,size,data_type,p_data,p_min,p_max,format,flags); +} +CIMGUI_API bool igInputText(const char* label,char* buf,size_t buf_size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data) +{ + return ImGui::InputText(label,buf,buf_size,flags,callback,user_data); +} +CIMGUI_API bool igInputTextMultiline(const char* label,char* buf,size_t buf_size,const ImVec2 size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data) +{ + return ImGui::InputTextMultiline(label,buf,buf_size,size,flags,callback,user_data); +} +CIMGUI_API bool igInputTextWithHint(const char* label,const char* hint,char* buf,size_t buf_size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data) +{ + return ImGui::InputTextWithHint(label,hint,buf,buf_size,flags,callback,user_data); +} +CIMGUI_API bool igInputFloat(const char* label,float* v,float step,float step_fast,const char* format,ImGuiInputTextFlags flags) +{ + return ImGui::InputFloat(label,v,step,step_fast,format,flags); +} +CIMGUI_API bool igInputFloat2(const char* label,float v[2],const char* format,ImGuiInputTextFlags flags) +{ + return ImGui::InputFloat2(label,v,format,flags); +} +CIMGUI_API bool igInputFloat3(const char* label,float v[3],const char* format,ImGuiInputTextFlags flags) +{ + return ImGui::InputFloat3(label,v,format,flags); +} +CIMGUI_API bool igInputFloat4(const char* label,float v[4],const char* format,ImGuiInputTextFlags flags) +{ + return ImGui::InputFloat4(label,v,format,flags); +} +CIMGUI_API bool igInputInt(const char* label,int* v,int step,int step_fast,ImGuiInputTextFlags flags) +{ + return ImGui::InputInt(label,v,step,step_fast,flags); +} +CIMGUI_API bool igInputInt2(const char* label,int v[2],ImGuiInputTextFlags flags) +{ + return ImGui::InputInt2(label,v,flags); +} +CIMGUI_API bool igInputInt3(const char* label,int v[3],ImGuiInputTextFlags flags) +{ + return ImGui::InputInt3(label,v,flags); +} +CIMGUI_API bool igInputInt4(const char* label,int v[4],ImGuiInputTextFlags flags) +{ + return ImGui::InputInt4(label,v,flags); +} +CIMGUI_API bool igInputDouble(const char* label,double* v,double step,double step_fast,const char* format,ImGuiInputTextFlags flags) +{ + return ImGui::InputDouble(label,v,step,step_fast,format,flags); +} +CIMGUI_API bool igInputScalar(const char* label,ImGuiDataType data_type,void* p_data,const void* p_step,const void* p_step_fast,const char* format,ImGuiInputTextFlags flags) +{ + return ImGui::InputScalar(label,data_type,p_data,p_step,p_step_fast,format,flags); +} +CIMGUI_API bool igInputScalarN(const char* label,ImGuiDataType data_type,void* p_data,int components,const void* p_step,const void* p_step_fast,const char* format,ImGuiInputTextFlags flags) +{ + return ImGui::InputScalarN(label,data_type,p_data,components,p_step,p_step_fast,format,flags); +} +CIMGUI_API bool igColorEdit3(const char* label,float col[3],ImGuiColorEditFlags flags) +{ + return ImGui::ColorEdit3(label,col,flags); +} +CIMGUI_API bool igColorEdit4(const char* label,float col[4],ImGuiColorEditFlags flags) +{ + return ImGui::ColorEdit4(label,col,flags); +} +CIMGUI_API bool igColorPicker3(const char* label,float col[3],ImGuiColorEditFlags flags) +{ + return ImGui::ColorPicker3(label,col,flags); +} +CIMGUI_API bool igColorPicker4(const char* label,float col[4],ImGuiColorEditFlags flags,const float* ref_col) +{ + return ImGui::ColorPicker4(label,col,flags,ref_col); +} +CIMGUI_API bool igColorButton(const char* desc_id,const ImVec4 col,ImGuiColorEditFlags flags,const ImVec2 size) +{ + return ImGui::ColorButton(desc_id,col,flags,size); +} +CIMGUI_API void igSetColorEditOptions(ImGuiColorEditFlags flags) +{ + return ImGui::SetColorEditOptions(flags); +} +CIMGUI_API bool igTreeNode_Str(const char* label) +{ + return ImGui::TreeNode(label); +} +CIMGUI_API bool igTreeNode_StrStr(const char* str_id,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + bool ret = ImGui::TreeNodeV(str_id,fmt,args); + va_end(args); + return ret; +} +CIMGUI_API bool igTreeNode_Ptr(const void* ptr_id,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + bool ret = ImGui::TreeNodeV(ptr_id,fmt,args); + va_end(args); + return ret; +} +CIMGUI_API bool igTreeNodeV_Str(const char* str_id,const char* fmt,va_list args) +{ + return ImGui::TreeNodeV(str_id,fmt,args); +} +CIMGUI_API bool igTreeNodeV_Ptr(const void* ptr_id,const char* fmt,va_list args) +{ + return ImGui::TreeNodeV(ptr_id,fmt,args); +} +CIMGUI_API bool igTreeNodeEx_Str(const char* label,ImGuiTreeNodeFlags flags) +{ + return ImGui::TreeNodeEx(label,flags); +} +CIMGUI_API bool igTreeNodeEx_StrStr(const char* str_id,ImGuiTreeNodeFlags flags,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + bool ret = ImGui::TreeNodeExV(str_id,flags,fmt,args); + va_end(args); + return ret; +} +CIMGUI_API bool igTreeNodeEx_Ptr(const void* ptr_id,ImGuiTreeNodeFlags flags,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + bool ret = ImGui::TreeNodeExV(ptr_id,flags,fmt,args); + va_end(args); + return ret; +} +CIMGUI_API bool igTreeNodeExV_Str(const char* str_id,ImGuiTreeNodeFlags flags,const char* fmt,va_list args) +{ + return ImGui::TreeNodeExV(str_id,flags,fmt,args); +} +CIMGUI_API bool igTreeNodeExV_Ptr(const void* ptr_id,ImGuiTreeNodeFlags flags,const char* fmt,va_list args) +{ + return ImGui::TreeNodeExV(ptr_id,flags,fmt,args); +} +CIMGUI_API void igTreePush_Str(const char* str_id) +{ + return ImGui::TreePush(str_id); +} +CIMGUI_API void igTreePush_Ptr(const void* ptr_id) +{ + return ImGui::TreePush(ptr_id); +} +CIMGUI_API void igTreePop() +{ + return ImGui::TreePop(); +} +CIMGUI_API float igGetTreeNodeToLabelSpacing() +{ + return ImGui::GetTreeNodeToLabelSpacing(); +} +CIMGUI_API bool igCollapsingHeader_TreeNodeFlags(const char* label,ImGuiTreeNodeFlags flags) +{ + return ImGui::CollapsingHeader(label,flags); +} +CIMGUI_API bool igCollapsingHeader_BoolPtr(const char* label,bool* p_visible,ImGuiTreeNodeFlags flags) +{ + return ImGui::CollapsingHeader(label,p_visible,flags); +} +CIMGUI_API void igSetNextItemOpen(bool is_open,ImGuiCond cond) +{ + return ImGui::SetNextItemOpen(is_open,cond); +} +CIMGUI_API bool igSelectable_Bool(const char* label,bool selected,ImGuiSelectableFlags flags,const ImVec2 size) +{ + return ImGui::Selectable(label,selected,flags,size); +} +CIMGUI_API bool igSelectable_BoolPtr(const char* label,bool* p_selected,ImGuiSelectableFlags flags,const ImVec2 size) +{ + return ImGui::Selectable(label,p_selected,flags,size); +} +CIMGUI_API bool igBeginListBox(const char* label,const ImVec2 size) +{ + return ImGui::BeginListBox(label,size); +} +CIMGUI_API void igEndListBox() +{ + return ImGui::EndListBox(); +} +CIMGUI_API bool igListBox_Str_arr(const char* label,int* current_item,const char* const items[],int items_count,int height_in_items) +{ + return ImGui::ListBox(label,current_item,items,items_count,height_in_items); +} +CIMGUI_API bool igListBox_FnBoolPtr(const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int height_in_items) +{ + return ImGui::ListBox(label,current_item,items_getter,data,items_count,height_in_items); +} +CIMGUI_API void igPlotLines_FloatPtr(const char* label,const float* values,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride) +{ + return ImGui::PlotLines(label,values,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size,stride); +} +CIMGUI_API void igPlotLines_FnFloatPtr(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size) +{ + return ImGui::PlotLines(label,values_getter,data,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size); +} +CIMGUI_API void igPlotHistogram_FloatPtr(const char* label,const float* values,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride) +{ + return ImGui::PlotHistogram(label,values,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size,stride); +} +CIMGUI_API void igPlotHistogram_FnFloatPtr(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size) +{ + return ImGui::PlotHistogram(label,values_getter,data,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size); +} +CIMGUI_API void igValue_Bool(const char* prefix,bool b) +{ + return ImGui::Value(prefix,b); +} +CIMGUI_API void igValue_Int(const char* prefix,int v) +{ + return ImGui::Value(prefix,v); +} +CIMGUI_API void igValue_Uint(const char* prefix,unsigned int v) +{ + return ImGui::Value(prefix,v); +} +CIMGUI_API void igValue_Float(const char* prefix,float v,const char* float_format) +{ + return ImGui::Value(prefix,v,float_format); +} +CIMGUI_API bool igBeginMenuBar() +{ + return ImGui::BeginMenuBar(); +} +CIMGUI_API void igEndMenuBar() +{ + return ImGui::EndMenuBar(); +} +CIMGUI_API bool igBeginMainMenuBar() +{ + return ImGui::BeginMainMenuBar(); +} +CIMGUI_API void igEndMainMenuBar() +{ + return ImGui::EndMainMenuBar(); +} +CIMGUI_API bool igBeginMenu(const char* label,bool enabled) +{ + return ImGui::BeginMenu(label,enabled); +} +CIMGUI_API void igEndMenu() +{ + return ImGui::EndMenu(); +} +CIMGUI_API bool igMenuItem_Bool(const char* label,const char* shortcut,bool selected,bool enabled) +{ + return ImGui::MenuItem(label,shortcut,selected,enabled); +} +CIMGUI_API bool igMenuItem_BoolPtr(const char* label,const char* shortcut,bool* p_selected,bool enabled) +{ + return ImGui::MenuItem(label,shortcut,p_selected,enabled); +} +CIMGUI_API bool igBeginTooltip() +{ + return ImGui::BeginTooltip(); +} +CIMGUI_API void igEndTooltip() +{ + return ImGui::EndTooltip(); +} +CIMGUI_API void igSetTooltip(const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::SetTooltipV(fmt,args); + va_end(args); +} +CIMGUI_API void igSetTooltipV(const char* fmt,va_list args) +{ + return ImGui::SetTooltipV(fmt,args); +} +CIMGUI_API bool igBeginItemTooltip() +{ + return ImGui::BeginItemTooltip(); +} +CIMGUI_API void igSetItemTooltip(const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::SetItemTooltipV(fmt,args); + va_end(args); +} +CIMGUI_API void igSetItemTooltipV(const char* fmt,va_list args) +{ + return ImGui::SetItemTooltipV(fmt,args); +} +CIMGUI_API bool igBeginPopup(const char* str_id,ImGuiWindowFlags flags) +{ + return ImGui::BeginPopup(str_id,flags); +} +CIMGUI_API bool igBeginPopupModal(const char* name,bool* p_open,ImGuiWindowFlags flags) +{ + return ImGui::BeginPopupModal(name,p_open,flags); +} +CIMGUI_API void igEndPopup() +{ + return ImGui::EndPopup(); +} +CIMGUI_API void igOpenPopup_Str(const char* str_id,ImGuiPopupFlags popup_flags) +{ + return ImGui::OpenPopup(str_id,popup_flags); +} +CIMGUI_API void igOpenPopup_ID(ImGuiID id,ImGuiPopupFlags popup_flags) +{ + return ImGui::OpenPopup(id,popup_flags); +} +CIMGUI_API void igOpenPopupOnItemClick(const char* str_id,ImGuiPopupFlags popup_flags) +{ + return ImGui::OpenPopupOnItemClick(str_id,popup_flags); +} +CIMGUI_API void igCloseCurrentPopup() +{ + return ImGui::CloseCurrentPopup(); +} +CIMGUI_API bool igBeginPopupContextItem(const char* str_id,ImGuiPopupFlags popup_flags) +{ + return ImGui::BeginPopupContextItem(str_id,popup_flags); +} +CIMGUI_API bool igBeginPopupContextWindow(const char* str_id,ImGuiPopupFlags popup_flags) +{ + return ImGui::BeginPopupContextWindow(str_id,popup_flags); +} +CIMGUI_API bool igBeginPopupContextVoid(const char* str_id,ImGuiPopupFlags popup_flags) +{ + return ImGui::BeginPopupContextVoid(str_id,popup_flags); +} +CIMGUI_API bool igIsPopupOpen_Str(const char* str_id,ImGuiPopupFlags flags) +{ + return ImGui::IsPopupOpen(str_id,flags); +} +CIMGUI_API bool igBeginTable(const char* str_id,int column,ImGuiTableFlags flags,const ImVec2 outer_size,float inner_width) +{ + return ImGui::BeginTable(str_id,column,flags,outer_size,inner_width); +} +CIMGUI_API void igEndTable() +{ + return ImGui::EndTable(); +} +CIMGUI_API void igTableNextRow(ImGuiTableRowFlags row_flags,float min_row_height) +{ + return ImGui::TableNextRow(row_flags,min_row_height); +} +CIMGUI_API bool igTableNextColumn() +{ + return ImGui::TableNextColumn(); +} +CIMGUI_API bool igTableSetColumnIndex(int column_n) +{ + return ImGui::TableSetColumnIndex(column_n); +} +CIMGUI_API void igTableSetupColumn(const char* label,ImGuiTableColumnFlags flags,float init_width_or_weight,ImGuiID user_id) +{ + return ImGui::TableSetupColumn(label,flags,init_width_or_weight,user_id); +} +CIMGUI_API void igTableSetupScrollFreeze(int cols,int rows) +{ + return ImGui::TableSetupScrollFreeze(cols,rows); +} +CIMGUI_API void igTableHeadersRow() +{ + return ImGui::TableHeadersRow(); +} +CIMGUI_API void igTableHeader(const char* label) +{ + return ImGui::TableHeader(label); +} +CIMGUI_API ImGuiTableSortSpecs* igTableGetSortSpecs() +{ + return ImGui::TableGetSortSpecs(); +} +CIMGUI_API int igTableGetColumnCount() +{ + return ImGui::TableGetColumnCount(); +} +CIMGUI_API int igTableGetColumnIndex() +{ + return ImGui::TableGetColumnIndex(); +} +CIMGUI_API int igTableGetRowIndex() +{ + return ImGui::TableGetRowIndex(); +} +CIMGUI_API const char* igTableGetColumnName_Int(int column_n) +{ + return ImGui::TableGetColumnName(column_n); +} +CIMGUI_API ImGuiTableColumnFlags igTableGetColumnFlags(int column_n) +{ + return ImGui::TableGetColumnFlags(column_n); +} +CIMGUI_API void igTableSetColumnEnabled(int column_n,bool v) +{ + return ImGui::TableSetColumnEnabled(column_n,v); +} +CIMGUI_API void igTableSetBgColor(ImGuiTableBgTarget target,ImU32 color,int column_n) +{ + return ImGui::TableSetBgColor(target,color,column_n); +} +CIMGUI_API void igColumns(int count,const char* id,bool border) +{ + return ImGui::Columns(count,id,border); +} +CIMGUI_API void igNextColumn() +{ + return ImGui::NextColumn(); +} +CIMGUI_API int igGetColumnIndex() +{ + return ImGui::GetColumnIndex(); +} +CIMGUI_API float igGetColumnWidth(int column_index) +{ + return ImGui::GetColumnWidth(column_index); +} +CIMGUI_API void igSetColumnWidth(int column_index,float width) +{ + return ImGui::SetColumnWidth(column_index,width); +} +CIMGUI_API float igGetColumnOffset(int column_index) +{ + return ImGui::GetColumnOffset(column_index); +} +CIMGUI_API void igSetColumnOffset(int column_index,float offset_x) +{ + return ImGui::SetColumnOffset(column_index,offset_x); +} +CIMGUI_API int igGetColumnsCount() +{ + return ImGui::GetColumnsCount(); +} +CIMGUI_API bool igBeginTabBar(const char* str_id,ImGuiTabBarFlags flags) +{ + return ImGui::BeginTabBar(str_id,flags); +} +CIMGUI_API void igEndTabBar() +{ + return ImGui::EndTabBar(); +} +CIMGUI_API bool igBeginTabItem(const char* label,bool* p_open,ImGuiTabItemFlags flags) +{ + return ImGui::BeginTabItem(label,p_open,flags); +} +CIMGUI_API void igEndTabItem() +{ + return ImGui::EndTabItem(); +} +CIMGUI_API bool igTabItemButton(const char* label,ImGuiTabItemFlags flags) +{ + return ImGui::TabItemButton(label,flags); +} +CIMGUI_API void igSetTabItemClosed(const char* tab_or_docked_window_label) +{ + return ImGui::SetTabItemClosed(tab_or_docked_window_label); +} +CIMGUI_API ImGuiID igDockSpace(ImGuiID id,const ImVec2 size,ImGuiDockNodeFlags flags,const ImGuiWindowClass* window_class) +{ + return ImGui::DockSpace(id,size,flags,window_class); +} +CIMGUI_API ImGuiID igDockSpaceOverViewport(const ImGuiViewport* viewport,ImGuiDockNodeFlags flags,const ImGuiWindowClass* window_class) +{ + return ImGui::DockSpaceOverViewport(viewport,flags,window_class); +} +CIMGUI_API void igSetNextWindowDockID(ImGuiID dock_id,ImGuiCond cond) +{ + return ImGui::SetNextWindowDockID(dock_id,cond); +} +CIMGUI_API void igSetNextWindowClass(const ImGuiWindowClass* window_class) +{ + return ImGui::SetNextWindowClass(window_class); +} +CIMGUI_API ImGuiID igGetWindowDockID() +{ + return ImGui::GetWindowDockID(); +} +CIMGUI_API bool igIsWindowDocked() +{ + return ImGui::IsWindowDocked(); +} +CIMGUI_API void igLogToTTY(int auto_open_depth) +{ + return ImGui::LogToTTY(auto_open_depth); +} +CIMGUI_API void igLogToFile(int auto_open_depth,const char* filename) +{ + return ImGui::LogToFile(auto_open_depth,filename); +} +CIMGUI_API void igLogToClipboard(int auto_open_depth) +{ + return ImGui::LogToClipboard(auto_open_depth); +} +CIMGUI_API void igLogFinish() +{ + return ImGui::LogFinish(); +} +CIMGUI_API void igLogButtons() +{ + return ImGui::LogButtons(); +} +CIMGUI_API void igLogTextV(const char* fmt,va_list args) +{ + return ImGui::LogTextV(fmt,args); +} +CIMGUI_API bool igBeginDragDropSource(ImGuiDragDropFlags flags) +{ + return ImGui::BeginDragDropSource(flags); +} +CIMGUI_API bool igSetDragDropPayload(const char* type,const void* data,size_t sz,ImGuiCond cond) +{ + return ImGui::SetDragDropPayload(type,data,sz,cond); +} +CIMGUI_API void igEndDragDropSource() +{ + return ImGui::EndDragDropSource(); +} +CIMGUI_API bool igBeginDragDropTarget() +{ + return ImGui::BeginDragDropTarget(); +} +CIMGUI_API const ImGuiPayload* igAcceptDragDropPayload(const char* type,ImGuiDragDropFlags flags) +{ + return ImGui::AcceptDragDropPayload(type,flags); +} +CIMGUI_API void igEndDragDropTarget() +{ + return ImGui::EndDragDropTarget(); +} +CIMGUI_API const ImGuiPayload* igGetDragDropPayload() +{ + return ImGui::GetDragDropPayload(); +} +CIMGUI_API void igBeginDisabled(bool disabled) +{ + return ImGui::BeginDisabled(disabled); +} +CIMGUI_API void igEndDisabled() +{ + return ImGui::EndDisabled(); +} +CIMGUI_API void igPushClipRect(const ImVec2 clip_rect_min,const ImVec2 clip_rect_max,bool intersect_with_current_clip_rect) +{ + return ImGui::PushClipRect(clip_rect_min,clip_rect_max,intersect_with_current_clip_rect); +} +CIMGUI_API void igPopClipRect() +{ + return ImGui::PopClipRect(); +} +CIMGUI_API void igSetItemDefaultFocus() +{ + return ImGui::SetItemDefaultFocus(); +} +CIMGUI_API void igSetKeyboardFocusHere(int offset) +{ + return ImGui::SetKeyboardFocusHere(offset); +} +CIMGUI_API void igSetNextItemAllowOverlap() +{ + return ImGui::SetNextItemAllowOverlap(); +} +CIMGUI_API bool igIsItemHovered(ImGuiHoveredFlags flags) +{ + return ImGui::IsItemHovered(flags); +} +CIMGUI_API bool igIsItemActive() +{ + return ImGui::IsItemActive(); +} +CIMGUI_API bool igIsItemFocused() +{ + return ImGui::IsItemFocused(); +} +CIMGUI_API bool igIsItemClicked(ImGuiMouseButton mouse_button) +{ + return ImGui::IsItemClicked(mouse_button); +} +CIMGUI_API bool igIsItemVisible() +{ + return ImGui::IsItemVisible(); +} +CIMGUI_API bool igIsItemEdited() +{ + return ImGui::IsItemEdited(); +} +CIMGUI_API bool igIsItemActivated() +{ + return ImGui::IsItemActivated(); +} +CIMGUI_API bool igIsItemDeactivated() +{ + return ImGui::IsItemDeactivated(); +} +CIMGUI_API bool igIsItemDeactivatedAfterEdit() +{ + return ImGui::IsItemDeactivatedAfterEdit(); +} +CIMGUI_API bool igIsItemToggledOpen() +{ + return ImGui::IsItemToggledOpen(); +} +CIMGUI_API bool igIsAnyItemHovered() +{ + return ImGui::IsAnyItemHovered(); +} +CIMGUI_API bool igIsAnyItemActive() +{ + return ImGui::IsAnyItemActive(); +} +CIMGUI_API bool igIsAnyItemFocused() +{ + return ImGui::IsAnyItemFocused(); +} +CIMGUI_API ImGuiID igGetItemID() +{ + return ImGui::GetItemID(); +} +CIMGUI_API void igGetItemRectMin(ImVec2 *pOut) +{ + *pOut = ImGui::GetItemRectMin(); +} +CIMGUI_API void igGetItemRectMax(ImVec2 *pOut) +{ + *pOut = ImGui::GetItemRectMax(); +} +CIMGUI_API void igGetItemRectSize(ImVec2 *pOut) +{ + *pOut = ImGui::GetItemRectSize(); +} +CIMGUI_API ImGuiViewport* igGetMainViewport() +{ + return ImGui::GetMainViewport(); +} +CIMGUI_API ImDrawList* igGetBackgroundDrawList_Nil() +{ + return ImGui::GetBackgroundDrawList(); +} +CIMGUI_API ImDrawList* igGetForegroundDrawList_Nil() +{ + return ImGui::GetForegroundDrawList(); +} +CIMGUI_API ImDrawList* igGetBackgroundDrawList_ViewportPtr(ImGuiViewport* viewport) +{ + return ImGui::GetBackgroundDrawList(viewport); +} +CIMGUI_API ImDrawList* igGetForegroundDrawList_ViewportPtr(ImGuiViewport* viewport) +{ + return ImGui::GetForegroundDrawList(viewport); +} +CIMGUI_API bool igIsRectVisible_Nil(const ImVec2 size) +{ + return ImGui::IsRectVisible(size); +} +CIMGUI_API bool igIsRectVisible_Vec2(const ImVec2 rect_min,const ImVec2 rect_max) +{ + return ImGui::IsRectVisible(rect_min,rect_max); +} +CIMGUI_API double igGetTime() +{ + return ImGui::GetTime(); +} +CIMGUI_API int igGetFrameCount() +{ + return ImGui::GetFrameCount(); +} +CIMGUI_API ImDrawListSharedData* igGetDrawListSharedData() +{ + return ImGui::GetDrawListSharedData(); +} +CIMGUI_API const char* igGetStyleColorName(ImGuiCol idx) +{ + return ImGui::GetStyleColorName(idx); +} +CIMGUI_API void igSetStateStorage(ImGuiStorage* storage) +{ + return ImGui::SetStateStorage(storage); +} +CIMGUI_API ImGuiStorage* igGetStateStorage() +{ + return ImGui::GetStateStorage(); +} +CIMGUI_API bool igBeginChildFrame(ImGuiID id,const ImVec2 size,ImGuiWindowFlags flags) +{ + return ImGui::BeginChildFrame(id,size,flags); +} +CIMGUI_API void igEndChildFrame() +{ + return ImGui::EndChildFrame(); +} +CIMGUI_API void igCalcTextSize(ImVec2 *pOut,const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width) +{ + *pOut = ImGui::CalcTextSize(text,text_end,hide_text_after_double_hash,wrap_width); +} +CIMGUI_API void igColorConvertU32ToFloat4(ImVec4 *pOut,ImU32 in) +{ + *pOut = ImGui::ColorConvertU32ToFloat4(in); +} +CIMGUI_API ImU32 igColorConvertFloat4ToU32(const ImVec4 in) +{ + return ImGui::ColorConvertFloat4ToU32(in); +} +CIMGUI_API void igColorConvertRGBtoHSV(float r,float g,float b,float* out_h,float* out_s,float* out_v) +{ + return ImGui::ColorConvertRGBtoHSV(r,g,b,*out_h,*out_s,*out_v); +} +CIMGUI_API void igColorConvertHSVtoRGB(float h,float s,float v,float* out_r,float* out_g,float* out_b) +{ + return ImGui::ColorConvertHSVtoRGB(h,s,v,*out_r,*out_g,*out_b); +} +CIMGUI_API bool igIsKeyDown_Nil(ImGuiKey key) +{ + return ImGui::IsKeyDown(key); +} +CIMGUI_API bool igIsKeyPressed_Bool(ImGuiKey key,bool repeat) +{ + return ImGui::IsKeyPressed(key,repeat); +} +CIMGUI_API bool igIsKeyReleased_Nil(ImGuiKey key) +{ + return ImGui::IsKeyReleased(key); +} +CIMGUI_API int igGetKeyPressedAmount(ImGuiKey key,float repeat_delay,float rate) +{ + return ImGui::GetKeyPressedAmount(key,repeat_delay,rate); +} +CIMGUI_API const char* igGetKeyName(ImGuiKey key) +{ + return ImGui::GetKeyName(key); +} +CIMGUI_API void igSetNextFrameWantCaptureKeyboard(bool want_capture_keyboard) +{ + return ImGui::SetNextFrameWantCaptureKeyboard(want_capture_keyboard); +} +CIMGUI_API bool igIsMouseDown_Nil(ImGuiMouseButton button) +{ + return ImGui::IsMouseDown(button); +} +CIMGUI_API bool igIsMouseClicked_Bool(ImGuiMouseButton button,bool repeat) +{ + return ImGui::IsMouseClicked(button,repeat); +} +CIMGUI_API bool igIsMouseReleased_Nil(ImGuiMouseButton button) +{ + return ImGui::IsMouseReleased(button); +} +CIMGUI_API bool igIsMouseDoubleClicked(ImGuiMouseButton button) +{ + return ImGui::IsMouseDoubleClicked(button); +} +CIMGUI_API int igGetMouseClickedCount(ImGuiMouseButton button) +{ + return ImGui::GetMouseClickedCount(button); +} +CIMGUI_API bool igIsMouseHoveringRect(const ImVec2 r_min,const ImVec2 r_max,bool clip) +{ + return ImGui::IsMouseHoveringRect(r_min,r_max,clip); +} +CIMGUI_API bool igIsMousePosValid(const ImVec2* mouse_pos) +{ + return ImGui::IsMousePosValid(mouse_pos); +} +CIMGUI_API bool igIsAnyMouseDown() +{ + return ImGui::IsAnyMouseDown(); +} +CIMGUI_API void igGetMousePos(ImVec2 *pOut) +{ + *pOut = ImGui::GetMousePos(); +} +CIMGUI_API void igGetMousePosOnOpeningCurrentPopup(ImVec2 *pOut) +{ + *pOut = ImGui::GetMousePosOnOpeningCurrentPopup(); +} +CIMGUI_API bool igIsMouseDragging(ImGuiMouseButton button,float lock_threshold) +{ + return ImGui::IsMouseDragging(button,lock_threshold); +} +CIMGUI_API void igGetMouseDragDelta(ImVec2 *pOut,ImGuiMouseButton button,float lock_threshold) +{ + *pOut = ImGui::GetMouseDragDelta(button,lock_threshold); +} +CIMGUI_API void igResetMouseDragDelta(ImGuiMouseButton button) +{ + return ImGui::ResetMouseDragDelta(button); +} +CIMGUI_API ImGuiMouseCursor igGetMouseCursor() +{ + return ImGui::GetMouseCursor(); +} +CIMGUI_API void igSetMouseCursor(ImGuiMouseCursor cursor_type) +{ + return ImGui::SetMouseCursor(cursor_type); +} +CIMGUI_API void igSetNextFrameWantCaptureMouse(bool want_capture_mouse) +{ + return ImGui::SetNextFrameWantCaptureMouse(want_capture_mouse); +} +CIMGUI_API const char* igGetClipboardText() +{ + return ImGui::GetClipboardText(); +} +CIMGUI_API void igSetClipboardText(const char* text) +{ + return ImGui::SetClipboardText(text); +} +CIMGUI_API void igLoadIniSettingsFromDisk(const char* ini_filename) +{ + return ImGui::LoadIniSettingsFromDisk(ini_filename); +} +CIMGUI_API void igLoadIniSettingsFromMemory(const char* ini_data,size_t ini_size) +{ + return ImGui::LoadIniSettingsFromMemory(ini_data,ini_size); +} +CIMGUI_API void igSaveIniSettingsToDisk(const char* ini_filename) +{ + return ImGui::SaveIniSettingsToDisk(ini_filename); +} +CIMGUI_API const char* igSaveIniSettingsToMemory(size_t* out_ini_size) +{ + return ImGui::SaveIniSettingsToMemory(out_ini_size); +} +CIMGUI_API void igDebugTextEncoding(const char* text) +{ + return ImGui::DebugTextEncoding(text); +} +CIMGUI_API bool igDebugCheckVersionAndDataLayout(const char* version_str,size_t sz_io,size_t sz_style,size_t sz_vec2,size_t sz_vec4,size_t sz_drawvert,size_t sz_drawidx) +{ + return ImGui::DebugCheckVersionAndDataLayout(version_str,sz_io,sz_style,sz_vec2,sz_vec4,sz_drawvert,sz_drawidx); +} +CIMGUI_API void igSetAllocatorFunctions(ImGuiMemAllocFunc alloc_func,ImGuiMemFreeFunc free_func,void* user_data) +{ + return ImGui::SetAllocatorFunctions(alloc_func,free_func,user_data); +} +CIMGUI_API void igGetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func,ImGuiMemFreeFunc* p_free_func,void** p_user_data) +{ + return ImGui::GetAllocatorFunctions(p_alloc_func,p_free_func,p_user_data); +} +CIMGUI_API void* igMemAlloc(size_t size) +{ + return ImGui::MemAlloc(size); +} +CIMGUI_API void igMemFree(void* ptr) +{ + return ImGui::MemFree(ptr); +} +CIMGUI_API ImGuiPlatformIO* igGetPlatformIO() +{ + return &ImGui::GetPlatformIO(); +} +CIMGUI_API void igUpdatePlatformWindows() +{ + return ImGui::UpdatePlatformWindows(); +} +CIMGUI_API void igRenderPlatformWindowsDefault(void* platform_render_arg,void* renderer_render_arg) +{ + return ImGui::RenderPlatformWindowsDefault(platform_render_arg,renderer_render_arg); +} +CIMGUI_API void igDestroyPlatformWindows() +{ + return ImGui::DestroyPlatformWindows(); +} +CIMGUI_API ImGuiViewport* igFindViewportByID(ImGuiID id) +{ + return ImGui::FindViewportByID(id); +} +CIMGUI_API ImGuiViewport* igFindViewportByPlatformHandle(void* platform_handle) +{ + return ImGui::FindViewportByPlatformHandle(platform_handle); +} +CIMGUI_API ImGuiStyle* ImGuiStyle_ImGuiStyle(void) +{ + return IM_NEW(ImGuiStyle)(); +} +CIMGUI_API void ImGuiStyle_destroy(ImGuiStyle* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiStyle_ScaleAllSizes(ImGuiStyle* self,float scale_factor) +{ + return self->ScaleAllSizes(scale_factor); +} +CIMGUI_API void ImGuiIO_AddKeyEvent(ImGuiIO* self,ImGuiKey key,bool down) +{ + return self->AddKeyEvent(key,down); +} +CIMGUI_API void ImGuiIO_AddKeyAnalogEvent(ImGuiIO* self,ImGuiKey key,bool down,float v) +{ + return self->AddKeyAnalogEvent(key,down,v); +} +CIMGUI_API void ImGuiIO_AddMousePosEvent(ImGuiIO* self,float x,float y) +{ + return self->AddMousePosEvent(x,y); +} +CIMGUI_API void ImGuiIO_AddMouseButtonEvent(ImGuiIO* self,int button,bool down) +{ + return self->AddMouseButtonEvent(button,down); +} +CIMGUI_API void ImGuiIO_AddMouseWheelEvent(ImGuiIO* self,float wheel_x,float wheel_y) +{ + return self->AddMouseWheelEvent(wheel_x,wheel_y); +} +CIMGUI_API void ImGuiIO_AddMouseSourceEvent(ImGuiIO* self,ImGuiMouseSource source) +{ + return self->AddMouseSourceEvent(source); +} +CIMGUI_API void ImGuiIO_AddMouseViewportEvent(ImGuiIO* self,ImGuiID id) +{ + return self->AddMouseViewportEvent(id); +} +CIMGUI_API void ImGuiIO_AddFocusEvent(ImGuiIO* self,bool focused) +{ + return self->AddFocusEvent(focused); +} +CIMGUI_API void ImGuiIO_AddInputCharacter(ImGuiIO* self,unsigned int c) +{ + return self->AddInputCharacter(c); +} +CIMGUI_API void ImGuiIO_AddInputCharacterUTF16(ImGuiIO* self,ImWchar16 c) +{ + return self->AddInputCharacterUTF16(c); +} +CIMGUI_API void ImGuiIO_AddInputCharactersUTF8(ImGuiIO* self,const char* str) +{ + return self->AddInputCharactersUTF8(str); +} +CIMGUI_API void ImGuiIO_SetKeyEventNativeData(ImGuiIO* self,ImGuiKey key,int native_keycode,int native_scancode,int native_legacy_index) +{ + return self->SetKeyEventNativeData(key,native_keycode,native_scancode,native_legacy_index); +} +CIMGUI_API void ImGuiIO_SetAppAcceptingEvents(ImGuiIO* self,bool accepting_events) +{ + return self->SetAppAcceptingEvents(accepting_events); +} +CIMGUI_API void ImGuiIO_ClearEventsQueue(ImGuiIO* self) +{ + return self->ClearEventsQueue(); +} +CIMGUI_API void ImGuiIO_ClearInputKeys(ImGuiIO* self) +{ + return self->ClearInputKeys(); +} +CIMGUI_API ImGuiIO* ImGuiIO_ImGuiIO(void) +{ + return IM_NEW(ImGuiIO)(); +} +CIMGUI_API void ImGuiIO_destroy(ImGuiIO* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiInputTextCallbackData* ImGuiInputTextCallbackData_ImGuiInputTextCallbackData(void) +{ + return IM_NEW(ImGuiInputTextCallbackData)(); +} +CIMGUI_API void ImGuiInputTextCallbackData_destroy(ImGuiInputTextCallbackData* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiInputTextCallbackData_DeleteChars(ImGuiInputTextCallbackData* self,int pos,int bytes_count) +{ + return self->DeleteChars(pos,bytes_count); +} +CIMGUI_API void ImGuiInputTextCallbackData_InsertChars(ImGuiInputTextCallbackData* self,int pos,const char* text,const char* text_end) +{ + return self->InsertChars(pos,text,text_end); +} +CIMGUI_API void ImGuiInputTextCallbackData_SelectAll(ImGuiInputTextCallbackData* self) +{ + return self->SelectAll(); +} +CIMGUI_API void ImGuiInputTextCallbackData_ClearSelection(ImGuiInputTextCallbackData* self) +{ + return self->ClearSelection(); +} +CIMGUI_API bool ImGuiInputTextCallbackData_HasSelection(ImGuiInputTextCallbackData* self) +{ + return self->HasSelection(); +} +CIMGUI_API ImGuiWindowClass* ImGuiWindowClass_ImGuiWindowClass(void) +{ + return IM_NEW(ImGuiWindowClass)(); +} +CIMGUI_API void ImGuiWindowClass_destroy(ImGuiWindowClass* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiPayload* ImGuiPayload_ImGuiPayload(void) +{ + return IM_NEW(ImGuiPayload)(); +} +CIMGUI_API void ImGuiPayload_destroy(ImGuiPayload* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiPayload_Clear(ImGuiPayload* self) +{ + return self->Clear(); +} +CIMGUI_API bool ImGuiPayload_IsDataType(ImGuiPayload* self,const char* type) +{ + return self->IsDataType(type); +} +CIMGUI_API bool ImGuiPayload_IsPreview(ImGuiPayload* self) +{ + return self->IsPreview(); +} +CIMGUI_API bool ImGuiPayload_IsDelivery(ImGuiPayload* self) +{ + return self->IsDelivery(); +} +CIMGUI_API ImGuiTableColumnSortSpecs* ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs(void) +{ + return IM_NEW(ImGuiTableColumnSortSpecs)(); +} +CIMGUI_API void ImGuiTableColumnSortSpecs_destroy(ImGuiTableColumnSortSpecs* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTableSortSpecs* ImGuiTableSortSpecs_ImGuiTableSortSpecs(void) +{ + return IM_NEW(ImGuiTableSortSpecs)(); +} +CIMGUI_API void ImGuiTableSortSpecs_destroy(ImGuiTableSortSpecs* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiOnceUponAFrame* ImGuiOnceUponAFrame_ImGuiOnceUponAFrame(void) +{ + return IM_NEW(ImGuiOnceUponAFrame)(); +} +CIMGUI_API void ImGuiOnceUponAFrame_destroy(ImGuiOnceUponAFrame* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTextFilter* ImGuiTextFilter_ImGuiTextFilter(const char* default_filter) +{ + return IM_NEW(ImGuiTextFilter)(default_filter); +} +CIMGUI_API void ImGuiTextFilter_destroy(ImGuiTextFilter* self) +{ + IM_DELETE(self); +} +CIMGUI_API bool ImGuiTextFilter_Draw(ImGuiTextFilter* self,const char* label,float width) +{ + return self->Draw(label,width); +} +CIMGUI_API bool ImGuiTextFilter_PassFilter(ImGuiTextFilter* self,const char* text,const char* text_end) +{ + return self->PassFilter(text,text_end); +} +CIMGUI_API void ImGuiTextFilter_Build(ImGuiTextFilter* self) +{ + return self->Build(); +} +CIMGUI_API void ImGuiTextFilter_Clear(ImGuiTextFilter* self) +{ + return self->Clear(); +} +CIMGUI_API bool ImGuiTextFilter_IsActive(ImGuiTextFilter* self) +{ + return self->IsActive(); +} +CIMGUI_API ImGuiTextRange* ImGuiTextRange_ImGuiTextRange_Nil(void) +{ + return IM_NEW(ImGuiTextRange)(); +} +CIMGUI_API void ImGuiTextRange_destroy(ImGuiTextRange* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTextRange* ImGuiTextRange_ImGuiTextRange_Str(const char* _b,const char* _e) +{ + return IM_NEW(ImGuiTextRange)(_b,_e); +} +CIMGUI_API bool ImGuiTextRange_empty(ImGuiTextRange* self) +{ + return self->empty(); +} +CIMGUI_API void ImGuiTextRange_split(ImGuiTextRange* self,char separator,ImVector_ImGuiTextRange* out) +{ + return self->split(separator,out); +} +CIMGUI_API ImGuiTextBuffer* ImGuiTextBuffer_ImGuiTextBuffer(void) +{ + return IM_NEW(ImGuiTextBuffer)(); +} +CIMGUI_API void ImGuiTextBuffer_destroy(ImGuiTextBuffer* self) +{ + IM_DELETE(self); +} +CIMGUI_API const char* ImGuiTextBuffer_begin(ImGuiTextBuffer* self) +{ + return self->begin(); +} +CIMGUI_API const char* ImGuiTextBuffer_end(ImGuiTextBuffer* self) +{ + return self->end(); +} +CIMGUI_API int ImGuiTextBuffer_size(ImGuiTextBuffer* self) +{ + return self->size(); +} +CIMGUI_API bool ImGuiTextBuffer_empty(ImGuiTextBuffer* self) +{ + return self->empty(); +} +CIMGUI_API void ImGuiTextBuffer_clear(ImGuiTextBuffer* self) +{ + return self->clear(); +} +CIMGUI_API void ImGuiTextBuffer_reserve(ImGuiTextBuffer* self,int capacity) +{ + return self->reserve(capacity); +} +CIMGUI_API const char* ImGuiTextBuffer_c_str(ImGuiTextBuffer* self) +{ + return self->c_str(); +} +CIMGUI_API void ImGuiTextBuffer_append(ImGuiTextBuffer* self,const char* str,const char* str_end) +{ + return self->append(str,str_end); +} +CIMGUI_API void ImGuiTextBuffer_appendfv(ImGuiTextBuffer* self,const char* fmt,va_list args) +{ + return self->appendfv(fmt,args); +} +CIMGUI_API ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Int(ImGuiID _key,int _val_i) +{ + return IM_NEW(ImGuiStoragePair)(_key,_val_i); +} +CIMGUI_API void ImGuiStoragePair_destroy(ImGuiStoragePair* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Float(ImGuiID _key,float _val_f) +{ + return IM_NEW(ImGuiStoragePair)(_key,_val_f); +} +CIMGUI_API ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Ptr(ImGuiID _key,void* _val_p) +{ + return IM_NEW(ImGuiStoragePair)(_key,_val_p); +} +CIMGUI_API void ImGuiStorage_Clear(ImGuiStorage* self) +{ + return self->Clear(); +} +CIMGUI_API int ImGuiStorage_GetInt(ImGuiStorage* self,ImGuiID key,int default_val) +{ + return self->GetInt(key,default_val); +} +CIMGUI_API void ImGuiStorage_SetInt(ImGuiStorage* self,ImGuiID key,int val) +{ + return self->SetInt(key,val); +} +CIMGUI_API bool ImGuiStorage_GetBool(ImGuiStorage* self,ImGuiID key,bool default_val) +{ + return self->GetBool(key,default_val); +} +CIMGUI_API void ImGuiStorage_SetBool(ImGuiStorage* self,ImGuiID key,bool val) +{ + return self->SetBool(key,val); +} +CIMGUI_API float ImGuiStorage_GetFloat(ImGuiStorage* self,ImGuiID key,float default_val) +{ + return self->GetFloat(key,default_val); +} +CIMGUI_API void ImGuiStorage_SetFloat(ImGuiStorage* self,ImGuiID key,float val) +{ + return self->SetFloat(key,val); +} +CIMGUI_API void* ImGuiStorage_GetVoidPtr(ImGuiStorage* self,ImGuiID key) +{ + return self->GetVoidPtr(key); +} +CIMGUI_API void ImGuiStorage_SetVoidPtr(ImGuiStorage* self,ImGuiID key,void* val) +{ + return self->SetVoidPtr(key,val); +} +CIMGUI_API int* ImGuiStorage_GetIntRef(ImGuiStorage* self,ImGuiID key,int default_val) +{ + return self->GetIntRef(key,default_val); +} +CIMGUI_API bool* ImGuiStorage_GetBoolRef(ImGuiStorage* self,ImGuiID key,bool default_val) +{ + return self->GetBoolRef(key,default_val); +} +CIMGUI_API float* ImGuiStorage_GetFloatRef(ImGuiStorage* self,ImGuiID key,float default_val) +{ + return self->GetFloatRef(key,default_val); +} +CIMGUI_API void** ImGuiStorage_GetVoidPtrRef(ImGuiStorage* self,ImGuiID key,void* default_val) +{ + return self->GetVoidPtrRef(key,default_val); +} +CIMGUI_API void ImGuiStorage_SetAllInt(ImGuiStorage* self,int val) +{ + return self->SetAllInt(val); +} +CIMGUI_API void ImGuiStorage_BuildSortByKey(ImGuiStorage* self) +{ + return self->BuildSortByKey(); +} +CIMGUI_API ImGuiListClipper* ImGuiListClipper_ImGuiListClipper(void) +{ + return IM_NEW(ImGuiListClipper)(); +} +CIMGUI_API void ImGuiListClipper_destroy(ImGuiListClipper* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiListClipper_Begin(ImGuiListClipper* self,int items_count,float items_height) +{ + return self->Begin(items_count,items_height); +} +CIMGUI_API void ImGuiListClipper_End(ImGuiListClipper* self) +{ + return self->End(); +} +CIMGUI_API bool ImGuiListClipper_Step(ImGuiListClipper* self) +{ + return self->Step(); +} +CIMGUI_API void ImGuiListClipper_IncludeItemByIndex(ImGuiListClipper* self,int item_index) +{ + return self->IncludeItemByIndex(item_index); +} +CIMGUI_API void ImGuiListClipper_IncludeItemsByIndex(ImGuiListClipper* self,int item_begin,int item_end) +{ + return self->IncludeItemsByIndex(item_begin,item_end); +} +CIMGUI_API ImColor* ImColor_ImColor_Nil(void) +{ + return IM_NEW(ImColor)(); +} +CIMGUI_API void ImColor_destroy(ImColor* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImColor* ImColor_ImColor_Float(float r,float g,float b,float a) +{ + return IM_NEW(ImColor)(r,g,b,a); +} +CIMGUI_API ImColor* ImColor_ImColor_Vec4(const ImVec4 col) +{ + return IM_NEW(ImColor)(col); +} +CIMGUI_API ImColor* ImColor_ImColor_Int(int r,int g,int b,int a) +{ + return IM_NEW(ImColor)(r,g,b,a); +} +CIMGUI_API ImColor* ImColor_ImColor_U32(ImU32 rgba) +{ + return IM_NEW(ImColor)(rgba); +} +CIMGUI_API void ImColor_SetHSV(ImColor* self,float h,float s,float v,float a) +{ + return self->SetHSV(h,s,v,a); +} +CIMGUI_API void ImColor_HSV(ImColor *pOut,float h,float s,float v,float a) +{ + *pOut = ImColor::HSV(h,s,v,a); +} +CIMGUI_API ImDrawCmd* ImDrawCmd_ImDrawCmd(void) +{ + return IM_NEW(ImDrawCmd)(); +} +CIMGUI_API void ImDrawCmd_destroy(ImDrawCmd* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImTextureID ImDrawCmd_GetTexID(ImDrawCmd* self) +{ + return self->GetTexID(); +} +CIMGUI_API ImDrawListSplitter* ImDrawListSplitter_ImDrawListSplitter(void) +{ + return IM_NEW(ImDrawListSplitter)(); +} +CIMGUI_API void ImDrawListSplitter_destroy(ImDrawListSplitter* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImDrawListSplitter_Clear(ImDrawListSplitter* self) +{ + return self->Clear(); +} +CIMGUI_API void ImDrawListSplitter_ClearFreeMemory(ImDrawListSplitter* self) +{ + return self->ClearFreeMemory(); +} +CIMGUI_API void ImDrawListSplitter_Split(ImDrawListSplitter* self,ImDrawList* draw_list,int count) +{ + return self->Split(draw_list,count); +} +CIMGUI_API void ImDrawListSplitter_Merge(ImDrawListSplitter* self,ImDrawList* draw_list) +{ + return self->Merge(draw_list); +} +CIMGUI_API void ImDrawListSplitter_SetCurrentChannel(ImDrawListSplitter* self,ImDrawList* draw_list,int channel_idx) +{ + return self->SetCurrentChannel(draw_list,channel_idx); +} +CIMGUI_API ImDrawList* ImDrawList_ImDrawList(ImDrawListSharedData* shared_data) +{ + return IM_NEW(ImDrawList)(shared_data); +} +CIMGUI_API void ImDrawList_destroy(ImDrawList* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImDrawList_PushClipRect(ImDrawList* self,const ImVec2 clip_rect_min,const ImVec2 clip_rect_max,bool intersect_with_current_clip_rect) +{ + return self->PushClipRect(clip_rect_min,clip_rect_max,intersect_with_current_clip_rect); +} +CIMGUI_API void ImDrawList_PushClipRectFullScreen(ImDrawList* self) +{ + return self->PushClipRectFullScreen(); +} +CIMGUI_API void ImDrawList_PopClipRect(ImDrawList* self) +{ + return self->PopClipRect(); +} +CIMGUI_API void ImDrawList_PushTextureID(ImDrawList* self,ImTextureID texture_id) +{ + return self->PushTextureID(texture_id); +} +CIMGUI_API void ImDrawList_PopTextureID(ImDrawList* self) +{ + return self->PopTextureID(); +} +CIMGUI_API void ImDrawList_GetClipRectMin(ImVec2 *pOut,ImDrawList* self) +{ + *pOut = self->GetClipRectMin(); +} +CIMGUI_API void ImDrawList_GetClipRectMax(ImVec2 *pOut,ImDrawList* self) +{ + *pOut = self->GetClipRectMax(); +} +CIMGUI_API void ImDrawList_AddLine(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,ImU32 col,float thickness) +{ + return self->AddLine(p1,p2,col,thickness); +} +CIMGUI_API void ImDrawList_AddRect(ImDrawList* self,const ImVec2 p_min,const ImVec2 p_max,ImU32 col,float rounding,ImDrawFlags flags,float thickness) +{ + return self->AddRect(p_min,p_max,col,rounding,flags,thickness); +} +CIMGUI_API void ImDrawList_AddRectFilled(ImDrawList* self,const ImVec2 p_min,const ImVec2 p_max,ImU32 col,float rounding,ImDrawFlags flags) +{ + return self->AddRectFilled(p_min,p_max,col,rounding,flags); +} +CIMGUI_API void ImDrawList_AddRectFilledMultiColor(ImDrawList* self,const ImVec2 p_min,const ImVec2 p_max,ImU32 col_upr_left,ImU32 col_upr_right,ImU32 col_bot_right,ImU32 col_bot_left) +{ + return self->AddRectFilledMultiColor(p_min,p_max,col_upr_left,col_upr_right,col_bot_right,col_bot_left); +} +CIMGUI_API void ImDrawList_AddQuad(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col,float thickness) +{ + return self->AddQuad(p1,p2,p3,p4,col,thickness); +} +CIMGUI_API void ImDrawList_AddQuadFilled(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col) +{ + return self->AddQuadFilled(p1,p2,p3,p4,col); +} +CIMGUI_API void ImDrawList_AddTriangle(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,ImU32 col,float thickness) +{ + return self->AddTriangle(p1,p2,p3,col,thickness); +} +CIMGUI_API void ImDrawList_AddTriangleFilled(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,ImU32 col) +{ + return self->AddTriangleFilled(p1,p2,p3,col); +} +CIMGUI_API void ImDrawList_AddCircle(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments,float thickness) +{ + return self->AddCircle(center,radius,col,num_segments,thickness); +} +CIMGUI_API void ImDrawList_AddCircleFilled(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments) +{ + return self->AddCircleFilled(center,radius,col,num_segments); +} +CIMGUI_API void ImDrawList_AddNgon(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments,float thickness) +{ + return self->AddNgon(center,radius,col,num_segments,thickness); +} +CIMGUI_API void ImDrawList_AddNgonFilled(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments) +{ + return self->AddNgonFilled(center,radius,col,num_segments); +} +CIMGUI_API void ImDrawList_AddText_Vec2(ImDrawList* self,const ImVec2 pos,ImU32 col,const char* text_begin,const char* text_end) +{ + return self->AddText(pos,col,text_begin,text_end); +} +CIMGUI_API void ImDrawList_AddText_FontPtr(ImDrawList* self,const ImFont* font,float font_size,const ImVec2 pos,ImU32 col,const char* text_begin,const char* text_end,float wrap_width,const ImVec4* cpu_fine_clip_rect) +{ + return self->AddText(font,font_size,pos,col,text_begin,text_end,wrap_width,cpu_fine_clip_rect); +} +CIMGUI_API void ImDrawList_AddPolyline(ImDrawList* self,const ImVec2* points,int num_points,ImU32 col,ImDrawFlags flags,float thickness) +{ + return self->AddPolyline(points,num_points,col,flags,thickness); +} +CIMGUI_API void ImDrawList_AddConvexPolyFilled(ImDrawList* self,const ImVec2* points,int num_points,ImU32 col) +{ + return self->AddConvexPolyFilled(points,num_points,col); +} +CIMGUI_API void ImDrawList_AddBezierCubic(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col,float thickness,int num_segments) +{ + return self->AddBezierCubic(p1,p2,p3,p4,col,thickness,num_segments); +} +CIMGUI_API void ImDrawList_AddBezierQuadratic(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,ImU32 col,float thickness,int num_segments) +{ + return self->AddBezierQuadratic(p1,p2,p3,col,thickness,num_segments); +} +CIMGUI_API void ImDrawList_AddImage(ImDrawList* self,ImTextureID user_texture_id,const ImVec2 p_min,const ImVec2 p_max,const ImVec2 uv_min,const ImVec2 uv_max,ImU32 col) +{ + return self->AddImage(user_texture_id,p_min,p_max,uv_min,uv_max,col); +} +CIMGUI_API void ImDrawList_AddImageQuad(ImDrawList* self,ImTextureID user_texture_id,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 uv1,const ImVec2 uv2,const ImVec2 uv3,const ImVec2 uv4,ImU32 col) +{ + return self->AddImageQuad(user_texture_id,p1,p2,p3,p4,uv1,uv2,uv3,uv4,col); +} +CIMGUI_API void ImDrawList_AddImageRounded(ImDrawList* self,ImTextureID user_texture_id,const ImVec2 p_min,const ImVec2 p_max,const ImVec2 uv_min,const ImVec2 uv_max,ImU32 col,float rounding,ImDrawFlags flags) +{ + return self->AddImageRounded(user_texture_id,p_min,p_max,uv_min,uv_max,col,rounding,flags); +} +CIMGUI_API void ImDrawList_PathClear(ImDrawList* self) +{ + return self->PathClear(); +} +CIMGUI_API void ImDrawList_PathLineTo(ImDrawList* self,const ImVec2 pos) +{ + return self->PathLineTo(pos); +} +CIMGUI_API void ImDrawList_PathLineToMergeDuplicate(ImDrawList* self,const ImVec2 pos) +{ + return self->PathLineToMergeDuplicate(pos); +} +CIMGUI_API void ImDrawList_PathFillConvex(ImDrawList* self,ImU32 col) +{ + return self->PathFillConvex(col); +} +CIMGUI_API void ImDrawList_PathStroke(ImDrawList* self,ImU32 col,ImDrawFlags flags,float thickness) +{ + return self->PathStroke(col,flags,thickness); +} +CIMGUI_API void ImDrawList_PathArcTo(ImDrawList* self,const ImVec2 center,float radius,float a_min,float a_max,int num_segments) +{ + return self->PathArcTo(center,radius,a_min,a_max,num_segments); +} +CIMGUI_API void ImDrawList_PathArcToFast(ImDrawList* self,const ImVec2 center,float radius,int a_min_of_12,int a_max_of_12) +{ + return self->PathArcToFast(center,radius,a_min_of_12,a_max_of_12); +} +CIMGUI_API void ImDrawList_PathBezierCubicCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,int num_segments) +{ + return self->PathBezierCubicCurveTo(p2,p3,p4,num_segments); +} +CIMGUI_API void ImDrawList_PathBezierQuadraticCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,int num_segments) +{ + return self->PathBezierQuadraticCurveTo(p2,p3,num_segments); +} +CIMGUI_API void ImDrawList_PathRect(ImDrawList* self,const ImVec2 rect_min,const ImVec2 rect_max,float rounding,ImDrawFlags flags) +{ + return self->PathRect(rect_min,rect_max,rounding,flags); +} +CIMGUI_API void ImDrawList_AddCallback(ImDrawList* self,ImDrawCallback callback,void* callback_data) +{ + return self->AddCallback(callback,callback_data); +} +CIMGUI_API void ImDrawList_AddDrawCmd(ImDrawList* self) +{ + return self->AddDrawCmd(); +} +CIMGUI_API ImDrawList* ImDrawList_CloneOutput(ImDrawList* self) +{ + return self->CloneOutput(); +} +CIMGUI_API void ImDrawList_ChannelsSplit(ImDrawList* self,int count) +{ + return self->ChannelsSplit(count); +} +CIMGUI_API void ImDrawList_ChannelsMerge(ImDrawList* self) +{ + return self->ChannelsMerge(); +} +CIMGUI_API void ImDrawList_ChannelsSetCurrent(ImDrawList* self,int n) +{ + return self->ChannelsSetCurrent(n); +} +CIMGUI_API void ImDrawList_PrimReserve(ImDrawList* self,int idx_count,int vtx_count) +{ + return self->PrimReserve(idx_count,vtx_count); +} +CIMGUI_API void ImDrawList_PrimUnreserve(ImDrawList* self,int idx_count,int vtx_count) +{ + return self->PrimUnreserve(idx_count,vtx_count); +} +CIMGUI_API void ImDrawList_PrimRect(ImDrawList* self,const ImVec2 a,const ImVec2 b,ImU32 col) +{ + return self->PrimRect(a,b,col); +} +CIMGUI_API void ImDrawList_PrimRectUV(ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 uv_a,const ImVec2 uv_b,ImU32 col) +{ + return self->PrimRectUV(a,b,uv_a,uv_b,col); +} +CIMGUI_API void ImDrawList_PrimQuadUV(ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 d,const ImVec2 uv_a,const ImVec2 uv_b,const ImVec2 uv_c,const ImVec2 uv_d,ImU32 col) +{ + return self->PrimQuadUV(a,b,c,d,uv_a,uv_b,uv_c,uv_d,col); +} +CIMGUI_API void ImDrawList_PrimWriteVtx(ImDrawList* self,const ImVec2 pos,const ImVec2 uv,ImU32 col) +{ + return self->PrimWriteVtx(pos,uv,col); +} +CIMGUI_API void ImDrawList_PrimWriteIdx(ImDrawList* self,ImDrawIdx idx) +{ + return self->PrimWriteIdx(idx); +} +CIMGUI_API void ImDrawList_PrimVtx(ImDrawList* self,const ImVec2 pos,const ImVec2 uv,ImU32 col) +{ + return self->PrimVtx(pos,uv,col); +} +CIMGUI_API void ImDrawList__ResetForNewFrame(ImDrawList* self) +{ + return self->_ResetForNewFrame(); +} +CIMGUI_API void ImDrawList__ClearFreeMemory(ImDrawList* self) +{ + return self->_ClearFreeMemory(); +} +CIMGUI_API void ImDrawList__PopUnusedDrawCmd(ImDrawList* self) +{ + return self->_PopUnusedDrawCmd(); +} +CIMGUI_API void ImDrawList__TryMergeDrawCmds(ImDrawList* self) +{ + return self->_TryMergeDrawCmds(); +} +CIMGUI_API void ImDrawList__OnChangedClipRect(ImDrawList* self) +{ + return self->_OnChangedClipRect(); +} +CIMGUI_API void ImDrawList__OnChangedTextureID(ImDrawList* self) +{ + return self->_OnChangedTextureID(); +} +CIMGUI_API void ImDrawList__OnChangedVtxOffset(ImDrawList* self) +{ + return self->_OnChangedVtxOffset(); +} +CIMGUI_API int ImDrawList__CalcCircleAutoSegmentCount(ImDrawList* self,float radius) +{ + return self->_CalcCircleAutoSegmentCount(radius); +} +CIMGUI_API void ImDrawList__PathArcToFastEx(ImDrawList* self,const ImVec2 center,float radius,int a_min_sample,int a_max_sample,int a_step) +{ + return self->_PathArcToFastEx(center,radius,a_min_sample,a_max_sample,a_step); +} +CIMGUI_API void ImDrawList__PathArcToN(ImDrawList* self,const ImVec2 center,float radius,float a_min,float a_max,int num_segments) +{ + return self->_PathArcToN(center,radius,a_min,a_max,num_segments); +} +CIMGUI_API ImDrawData* ImDrawData_ImDrawData(void) +{ + return IM_NEW(ImDrawData)(); +} +CIMGUI_API void ImDrawData_destroy(ImDrawData* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImDrawData_Clear(ImDrawData* self) +{ + return self->Clear(); +} +CIMGUI_API void ImDrawData_AddDrawList(ImDrawData* self,ImDrawList* draw_list) +{ + return self->AddDrawList(draw_list); +} +CIMGUI_API void ImDrawData_DeIndexAllBuffers(ImDrawData* self) +{ + return self->DeIndexAllBuffers(); +} +CIMGUI_API void ImDrawData_ScaleClipRects(ImDrawData* self,const ImVec2 fb_scale) +{ + return self->ScaleClipRects(fb_scale); +} +CIMGUI_API ImFontConfig* ImFontConfig_ImFontConfig(void) +{ + return IM_NEW(ImFontConfig)(); +} +CIMGUI_API void ImFontConfig_destroy(ImFontConfig* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImFontGlyphRangesBuilder* ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder(void) +{ + return IM_NEW(ImFontGlyphRangesBuilder)(); +} +CIMGUI_API void ImFontGlyphRangesBuilder_destroy(ImFontGlyphRangesBuilder* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImFontGlyphRangesBuilder_Clear(ImFontGlyphRangesBuilder* self) +{ + return self->Clear(); +} +CIMGUI_API bool ImFontGlyphRangesBuilder_GetBit(ImFontGlyphRangesBuilder* self,size_t n) +{ + return self->GetBit(n); +} +CIMGUI_API void ImFontGlyphRangesBuilder_SetBit(ImFontGlyphRangesBuilder* self,size_t n) +{ + return self->SetBit(n); +} +CIMGUI_API void ImFontGlyphRangesBuilder_AddChar(ImFontGlyphRangesBuilder* self,ImWchar c) +{ + return self->AddChar(c); +} +CIMGUI_API void ImFontGlyphRangesBuilder_AddText(ImFontGlyphRangesBuilder* self,const char* text,const char* text_end) +{ + return self->AddText(text,text_end); +} +CIMGUI_API void ImFontGlyphRangesBuilder_AddRanges(ImFontGlyphRangesBuilder* self,const ImWchar* ranges) +{ + return self->AddRanges(ranges); +} +CIMGUI_API void ImFontGlyphRangesBuilder_BuildRanges(ImFontGlyphRangesBuilder* self,ImVector_ImWchar* out_ranges) +{ + return self->BuildRanges(out_ranges); +} +CIMGUI_API ImFontAtlasCustomRect* ImFontAtlasCustomRect_ImFontAtlasCustomRect(void) +{ + return IM_NEW(ImFontAtlasCustomRect)(); +} +CIMGUI_API void ImFontAtlasCustomRect_destroy(ImFontAtlasCustomRect* self) +{ + IM_DELETE(self); +} +CIMGUI_API bool ImFontAtlasCustomRect_IsPacked(ImFontAtlasCustomRect* self) +{ + return self->IsPacked(); +} +CIMGUI_API ImFontAtlas* ImFontAtlas_ImFontAtlas(void) +{ + return IM_NEW(ImFontAtlas)(); +} +CIMGUI_API void ImFontAtlas_destroy(ImFontAtlas* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImFont* ImFontAtlas_AddFont(ImFontAtlas* self,const ImFontConfig* font_cfg) +{ + return self->AddFont(font_cfg); +} +CIMGUI_API ImFont* ImFontAtlas_AddFontDefault(ImFontAtlas* self,const ImFontConfig* font_cfg) +{ + return self->AddFontDefault(font_cfg); +} +CIMGUI_API ImFont* ImFontAtlas_AddFontFromFileTTF(ImFontAtlas* self,const char* filename,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges) +{ + return self->AddFontFromFileTTF(filename,size_pixels,font_cfg,glyph_ranges); +} +CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* self,void* font_data,int font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges) +{ + return self->AddFontFromMemoryTTF(font_data,font_size,size_pixels,font_cfg,glyph_ranges); +} +CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self,const void* compressed_font_data,int compressed_font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges) +{ + return self->AddFontFromMemoryCompressedTTF(compressed_font_data,compressed_font_size,size_pixels,font_cfg,glyph_ranges); +} +CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self,const char* compressed_font_data_base85,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges) +{ + return self->AddFontFromMemoryCompressedBase85TTF(compressed_font_data_base85,size_pixels,font_cfg,glyph_ranges); +} +CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self) +{ + return self->ClearInputData(); +} +CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self) +{ + return self->ClearTexData(); +} +CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self) +{ + return self->ClearFonts(); +} +CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self) +{ + return self->Clear(); +} +CIMGUI_API bool ImFontAtlas_Build(ImFontAtlas* self) +{ + return self->Build(); +} +CIMGUI_API void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel) +{ + return self->GetTexDataAsAlpha8(out_pixels,out_width,out_height,out_bytes_per_pixel); +} +CIMGUI_API void ImFontAtlas_GetTexDataAsRGBA32(ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel) +{ + return self->GetTexDataAsRGBA32(out_pixels,out_width,out_height,out_bytes_per_pixel); +} +CIMGUI_API bool ImFontAtlas_IsBuilt(ImFontAtlas* self) +{ + return self->IsBuilt(); +} +CIMGUI_API void ImFontAtlas_SetTexID(ImFontAtlas* self,ImTextureID id) +{ + return self->SetTexID(id); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesDefault(ImFontAtlas* self) +{ + return self->GetGlyphRangesDefault(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesGreek(ImFontAtlas* self) +{ + return self->GetGlyphRangesGreek(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesKorean(ImFontAtlas* self) +{ + return self->GetGlyphRangesKorean(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesJapanese(ImFontAtlas* self) +{ + return self->GetGlyphRangesJapanese(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesChineseFull(ImFontAtlas* self) +{ + return self->GetGlyphRangesChineseFull(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon(ImFontAtlas* self) +{ + return self->GetGlyphRangesChineseSimplifiedCommon(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesCyrillic(ImFontAtlas* self) +{ + return self->GetGlyphRangesCyrillic(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesThai(ImFontAtlas* self) +{ + return self->GetGlyphRangesThai(); +} +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesVietnamese(ImFontAtlas* self) +{ + return self->GetGlyphRangesVietnamese(); +} +CIMGUI_API int ImFontAtlas_AddCustomRectRegular(ImFontAtlas* self,int width,int height) +{ + return self->AddCustomRectRegular(width,height); +} +CIMGUI_API int ImFontAtlas_AddCustomRectFontGlyph(ImFontAtlas* self,ImFont* font,ImWchar id,int width,int height,float advance_x,const ImVec2 offset) +{ + return self->AddCustomRectFontGlyph(font,id,width,height,advance_x,offset); +} +CIMGUI_API ImFontAtlasCustomRect* ImFontAtlas_GetCustomRectByIndex(ImFontAtlas* self,int index) +{ + return self->GetCustomRectByIndex(index); +} +CIMGUI_API void ImFontAtlas_CalcCustomRectUV(ImFontAtlas* self,const ImFontAtlasCustomRect* rect,ImVec2* out_uv_min,ImVec2* out_uv_max) +{ + return self->CalcCustomRectUV(rect,out_uv_min,out_uv_max); +} +CIMGUI_API bool ImFontAtlas_GetMouseCursorTexData(ImFontAtlas* self,ImGuiMouseCursor cursor,ImVec2* out_offset,ImVec2* out_size,ImVec2 out_uv_border[2],ImVec2 out_uv_fill[2]) +{ + return self->GetMouseCursorTexData(cursor,out_offset,out_size,out_uv_border,out_uv_fill); +} +CIMGUI_API ImFont* ImFont_ImFont(void) +{ + return IM_NEW(ImFont)(); +} +CIMGUI_API void ImFont_destroy(ImFont* self) +{ + IM_DELETE(self); +} +CIMGUI_API const ImFontGlyph* ImFont_FindGlyph(ImFont* self,ImWchar c) +{ + return self->FindGlyph(c); +} +CIMGUI_API const ImFontGlyph* ImFont_FindGlyphNoFallback(ImFont* self,ImWchar c) +{ + return self->FindGlyphNoFallback(c); +} +CIMGUI_API float ImFont_GetCharAdvance(ImFont* self,ImWchar c) +{ + return self->GetCharAdvance(c); +} +CIMGUI_API bool ImFont_IsLoaded(ImFont* self) +{ + return self->IsLoaded(); +} +CIMGUI_API const char* ImFont_GetDebugName(ImFont* self) +{ + return self->GetDebugName(); +} +CIMGUI_API void ImFont_CalcTextSizeA(ImVec2 *pOut,ImFont* self,float size,float max_width,float wrap_width,const char* text_begin,const char* text_end,const char** remaining) +{ + *pOut = self->CalcTextSizeA(size,max_width,wrap_width,text_begin,text_end,remaining); +} +CIMGUI_API const char* ImFont_CalcWordWrapPositionA(ImFont* self,float scale,const char* text,const char* text_end,float wrap_width) +{ + return self->CalcWordWrapPositionA(scale,text,text_end,wrap_width); +} +CIMGUI_API void ImFont_RenderChar(ImFont* self,ImDrawList* draw_list,float size,const ImVec2 pos,ImU32 col,ImWchar c) +{ + return self->RenderChar(draw_list,size,pos,col,c); +} +CIMGUI_API void ImFont_RenderText(ImFont* self,ImDrawList* draw_list,float size,const ImVec2 pos,ImU32 col,const ImVec4 clip_rect,const char* text_begin,const char* text_end,float wrap_width,bool cpu_fine_clip) +{ + return self->RenderText(draw_list,size,pos,col,clip_rect,text_begin,text_end,wrap_width,cpu_fine_clip); +} +CIMGUI_API void ImFont_BuildLookupTable(ImFont* self) +{ + return self->BuildLookupTable(); +} +CIMGUI_API void ImFont_ClearOutputData(ImFont* self) +{ + return self->ClearOutputData(); +} +CIMGUI_API void ImFont_GrowIndex(ImFont* self,int new_size) +{ + return self->GrowIndex(new_size); +} +CIMGUI_API void ImFont_AddGlyph(ImFont* self,const ImFontConfig* src_cfg,ImWchar c,float x0,float y0,float x1,float y1,float u0,float v0,float u1,float v1,float advance_x) +{ + return self->AddGlyph(src_cfg,c,x0,y0,x1,y1,u0,v0,u1,v1,advance_x); +} +CIMGUI_API void ImFont_AddRemapChar(ImFont* self,ImWchar dst,ImWchar src,bool overwrite_dst) +{ + return self->AddRemapChar(dst,src,overwrite_dst); +} +CIMGUI_API void ImFont_SetGlyphVisible(ImFont* self,ImWchar c,bool visible) +{ + return self->SetGlyphVisible(c,visible); +} +CIMGUI_API bool ImFont_IsGlyphRangeUnused(ImFont* self,unsigned int c_begin,unsigned int c_last) +{ + return self->IsGlyphRangeUnused(c_begin,c_last); +} +CIMGUI_API ImGuiViewport* ImGuiViewport_ImGuiViewport(void) +{ + return IM_NEW(ImGuiViewport)(); +} +CIMGUI_API void ImGuiViewport_destroy(ImGuiViewport* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiViewport_GetCenter(ImVec2 *pOut,ImGuiViewport* self) +{ + *pOut = self->GetCenter(); +} +CIMGUI_API void ImGuiViewport_GetWorkCenter(ImVec2 *pOut,ImGuiViewport* self) +{ + *pOut = self->GetWorkCenter(); +} +CIMGUI_API ImGuiPlatformIO* ImGuiPlatformIO_ImGuiPlatformIO(void) +{ + return IM_NEW(ImGuiPlatformIO)(); +} +CIMGUI_API void ImGuiPlatformIO_destroy(ImGuiPlatformIO* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiPlatformMonitor* ImGuiPlatformMonitor_ImGuiPlatformMonitor(void) +{ + return IM_NEW(ImGuiPlatformMonitor)(); +} +CIMGUI_API void ImGuiPlatformMonitor_destroy(ImGuiPlatformMonitor* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiPlatformImeData* ImGuiPlatformImeData_ImGuiPlatformImeData(void) +{ + return IM_NEW(ImGuiPlatformImeData)(); +} +CIMGUI_API void ImGuiPlatformImeData_destroy(ImGuiPlatformImeData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiKey igGetKeyIndex(ImGuiKey key) +{ + return ImGui::GetKeyIndex(key); +} +CIMGUI_API ImGuiID igImHashData(const void* data,size_t data_size,ImGuiID seed) +{ + return ImHashData(data,data_size,seed); +} +CIMGUI_API ImGuiID igImHashStr(const char* data,size_t data_size,ImGuiID seed) +{ + return ImHashStr(data,data_size,seed); +} +CIMGUI_API void igImQsort(void* base,size_t count,size_t size_of_element,int(*compare_func)(void const*,void const*)) +{ + return ImQsort(base,count,size_of_element,compare_func); +} +CIMGUI_API ImU32 igImAlphaBlendColors(ImU32 col_a,ImU32 col_b) +{ + return ImAlphaBlendColors(col_a,col_b); +} +CIMGUI_API bool igImIsPowerOfTwo_Int(int v) +{ + return ImIsPowerOfTwo(v); +} +CIMGUI_API bool igImIsPowerOfTwo_U64(ImU64 v) +{ + return ImIsPowerOfTwo(v); +} +CIMGUI_API int igImUpperPowerOfTwo(int v) +{ + return ImUpperPowerOfTwo(v); +} +CIMGUI_API int igImStricmp(const char* str1,const char* str2) +{ + return ImStricmp(str1,str2); +} +CIMGUI_API int igImStrnicmp(const char* str1,const char* str2,size_t count) +{ + return ImStrnicmp(str1,str2,count); +} +CIMGUI_API void igImStrncpy(char* dst,const char* src,size_t count) +{ + return ImStrncpy(dst,src,count); +} +CIMGUI_API char* igImStrdup(const char* str) +{ + return ImStrdup(str); +} +CIMGUI_API char* igImStrdupcpy(char* dst,size_t* p_dst_size,const char* str) +{ + return ImStrdupcpy(dst,p_dst_size,str); +} +CIMGUI_API const char* igImStrchrRange(const char* str_begin,const char* str_end,char c) +{ + return ImStrchrRange(str_begin,str_end,c); +} +CIMGUI_API int igImStrlenW(const ImWchar* str) +{ + return ImStrlenW(str); +} +CIMGUI_API const char* igImStreolRange(const char* str,const char* str_end) +{ + return ImStreolRange(str,str_end); +} +CIMGUI_API const ImWchar* igImStrbolW(const ImWchar* buf_mid_line,const ImWchar* buf_begin) +{ + return ImStrbolW(buf_mid_line,buf_begin); +} +CIMGUI_API const char* igImStristr(const char* haystack,const char* haystack_end,const char* needle,const char* needle_end) +{ + return ImStristr(haystack,haystack_end,needle,needle_end); +} +CIMGUI_API void igImStrTrimBlanks(char* str) +{ + return ImStrTrimBlanks(str); +} +CIMGUI_API const char* igImStrSkipBlank(const char* str) +{ + return ImStrSkipBlank(str); +} +CIMGUI_API char igImToUpper(char c) +{ + return ImToUpper(c); +} +CIMGUI_API bool igImCharIsBlankA(char c) +{ + return ImCharIsBlankA(c); +} +CIMGUI_API bool igImCharIsBlankW(unsigned int c) +{ + return ImCharIsBlankW(c); +} +CIMGUI_API int igImFormatString(char* buf,size_t buf_size,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + int ret = ImFormatStringV(buf,buf_size,fmt,args); + va_end(args); + return ret; +} +CIMGUI_API int igImFormatStringV(char* buf,size_t buf_size,const char* fmt,va_list args) +{ + return ImFormatStringV(buf,buf_size,fmt,args); +} +CIMGUI_API void igImFormatStringToTempBuffer(const char** out_buf,const char** out_buf_end,const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImFormatStringToTempBufferV(out_buf,out_buf_end,fmt,args); + va_end(args); +} +CIMGUI_API void igImFormatStringToTempBufferV(const char** out_buf,const char** out_buf_end,const char* fmt,va_list args) +{ + return ImFormatStringToTempBufferV(out_buf,out_buf_end,fmt,args); +} +CIMGUI_API const char* igImParseFormatFindStart(const char* format) +{ + return ImParseFormatFindStart(format); +} +CIMGUI_API const char* igImParseFormatFindEnd(const char* format) +{ + return ImParseFormatFindEnd(format); +} +CIMGUI_API const char* igImParseFormatTrimDecorations(const char* format,char* buf,size_t buf_size) +{ + return ImParseFormatTrimDecorations(format,buf,buf_size); +} +CIMGUI_API void igImParseFormatSanitizeForPrinting(const char* fmt_in,char* fmt_out,size_t fmt_out_size) +{ + return ImParseFormatSanitizeForPrinting(fmt_in,fmt_out,fmt_out_size); +} +CIMGUI_API const char* igImParseFormatSanitizeForScanning(const char* fmt_in,char* fmt_out,size_t fmt_out_size) +{ + return ImParseFormatSanitizeForScanning(fmt_in,fmt_out,fmt_out_size); +} +CIMGUI_API int igImParseFormatPrecision(const char* format,int default_value) +{ + return ImParseFormatPrecision(format,default_value); +} +CIMGUI_API const char* igImTextCharToUtf8(char out_buf[5],unsigned int c) +{ + return ImTextCharToUtf8(out_buf,c); +} +CIMGUI_API int igImTextStrToUtf8(char* out_buf,int out_buf_size,const ImWchar* in_text,const ImWchar* in_text_end) +{ + return ImTextStrToUtf8(out_buf,out_buf_size,in_text,in_text_end); +} +CIMGUI_API int igImTextCharFromUtf8(unsigned int* out_char,const char* in_text,const char* in_text_end) +{ + return ImTextCharFromUtf8(out_char,in_text,in_text_end); +} +CIMGUI_API int igImTextStrFromUtf8(ImWchar* out_buf,int out_buf_size,const char* in_text,const char* in_text_end,const char** in_remaining) +{ + return ImTextStrFromUtf8(out_buf,out_buf_size,in_text,in_text_end,in_remaining); +} +CIMGUI_API int igImTextCountCharsFromUtf8(const char* in_text,const char* in_text_end) +{ + return ImTextCountCharsFromUtf8(in_text,in_text_end); +} +CIMGUI_API int igImTextCountUtf8BytesFromChar(const char* in_text,const char* in_text_end) +{ + return ImTextCountUtf8BytesFromChar(in_text,in_text_end); +} +CIMGUI_API int igImTextCountUtf8BytesFromStr(const ImWchar* in_text,const ImWchar* in_text_end) +{ + return ImTextCountUtf8BytesFromStr(in_text,in_text_end); +} +CIMGUI_API ImFileHandle igImFileOpen(const char* filename,const char* mode) +{ + return ImFileOpen(filename,mode); +} +CIMGUI_API bool igImFileClose(ImFileHandle file) +{ + return ImFileClose(file); +} +CIMGUI_API ImU64 igImFileGetSize(ImFileHandle file) +{ + return ImFileGetSize(file); +} +CIMGUI_API ImU64 igImFileRead(void* data,ImU64 size,ImU64 count,ImFileHandle file) +{ + return ImFileRead(data,size,count,file); +} +CIMGUI_API ImU64 igImFileWrite(const void* data,ImU64 size,ImU64 count,ImFileHandle file) +{ + return ImFileWrite(data,size,count,file); +} +CIMGUI_API void* igImFileLoadToMemory(const char* filename,const char* mode,size_t* out_file_size,int padding_bytes) +{ + return ImFileLoadToMemory(filename,mode,out_file_size,padding_bytes); +} +CIMGUI_API float igImPow_Float(float x,float y) +{ + return ImPow(x,y); +} +CIMGUI_API double igImPow_double(double x,double y) +{ + return ImPow(x,y); +} +CIMGUI_API float igImLog_Float(float x) +{ + return ImLog(x); +} +CIMGUI_API double igImLog_double(double x) +{ + return ImLog(x); +} +CIMGUI_API int igImAbs_Int(int x) +{ + return ImAbs(x); +} +CIMGUI_API float igImAbs_Float(float x) +{ + return ImAbs(x); +} +CIMGUI_API double igImAbs_double(double x) +{ + return ImAbs(x); +} +CIMGUI_API float igImSign_Float(float x) +{ + return ImSign(x); +} +CIMGUI_API double igImSign_double(double x) +{ + return ImSign(x); +} +CIMGUI_API float igImRsqrt_Float(float x) +{ + return ImRsqrt(x); +} +CIMGUI_API double igImRsqrt_double(double x) +{ + return ImRsqrt(x); +} +CIMGUI_API void igImMin(ImVec2 *pOut,const ImVec2 lhs,const ImVec2 rhs) +{ + *pOut = ImMin(lhs,rhs); +} +CIMGUI_API void igImMax(ImVec2 *pOut,const ImVec2 lhs,const ImVec2 rhs) +{ + *pOut = ImMax(lhs,rhs); +} +CIMGUI_API void igImClamp(ImVec2 *pOut,const ImVec2 v,const ImVec2 mn,ImVec2 mx) +{ + *pOut = ImClamp(v,mn,mx); +} +CIMGUI_API void igImLerp_Vec2Float(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,float t) +{ + *pOut = ImLerp(a,b,t); +} +CIMGUI_API void igImLerp_Vec2Vec2(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,const ImVec2 t) +{ + *pOut = ImLerp(a,b,t); +} +CIMGUI_API void igImLerp_Vec4(ImVec4 *pOut,const ImVec4 a,const ImVec4 b,float t) +{ + *pOut = ImLerp(a,b,t); +} +CIMGUI_API float igImSaturate(float f) +{ + return ImSaturate(f); +} +CIMGUI_API float igImLengthSqr_Vec2(const ImVec2 lhs) +{ + return ImLengthSqr(lhs); +} +CIMGUI_API float igImLengthSqr_Vec4(const ImVec4 lhs) +{ + return ImLengthSqr(lhs); +} +CIMGUI_API float igImInvLength(const ImVec2 lhs,float fail_value) +{ + return ImInvLength(lhs,fail_value); +} +CIMGUI_API float igImFloor_Float(float f) +{ + return ImFloor(f); +} +CIMGUI_API float igImFloorSigned_Float(float f) +{ + return ImFloorSigned(f); +} +CIMGUI_API void igImFloor_Vec2(ImVec2 *pOut,const ImVec2 v) +{ + *pOut = ImFloor(v); +} +CIMGUI_API void igImFloorSigned_Vec2(ImVec2 *pOut,const ImVec2 v) +{ + *pOut = ImFloorSigned(v); +} +CIMGUI_API int igImModPositive(int a,int b) +{ + return ImModPositive(a,b); +} +CIMGUI_API float igImDot(const ImVec2 a,const ImVec2 b) +{ + return ImDot(a,b); +} +CIMGUI_API void igImRotate(ImVec2 *pOut,const ImVec2 v,float cos_a,float sin_a) +{ + *pOut = ImRotate(v,cos_a,sin_a); +} +CIMGUI_API float igImLinearSweep(float current,float target,float speed) +{ + return ImLinearSweep(current,target,speed); +} +CIMGUI_API void igImMul(ImVec2 *pOut,const ImVec2 lhs,const ImVec2 rhs) +{ + *pOut = ImMul(lhs,rhs); +} +CIMGUI_API bool igImIsFloatAboveGuaranteedIntegerPrecision(float f) +{ + return ImIsFloatAboveGuaranteedIntegerPrecision(f); +} +CIMGUI_API float igImExponentialMovingAverage(float avg,float sample,int n) +{ + return ImExponentialMovingAverage(avg,sample,n); +} +CIMGUI_API void igImBezierCubicCalc(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,float t) +{ + *pOut = ImBezierCubicCalc(p1,p2,p3,p4,t); +} +CIMGUI_API void igImBezierCubicClosestPoint(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,int num_segments) +{ + *pOut = ImBezierCubicClosestPoint(p1,p2,p3,p4,p,num_segments); +} +CIMGUI_API void igImBezierCubicClosestPointCasteljau(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,float tess_tol) +{ + *pOut = ImBezierCubicClosestPointCasteljau(p1,p2,p3,p4,p,tess_tol); +} +CIMGUI_API void igImBezierQuadraticCalc(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,float t) +{ + *pOut = ImBezierQuadraticCalc(p1,p2,p3,t); +} +CIMGUI_API void igImLineClosestPoint(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,const ImVec2 p) +{ + *pOut = ImLineClosestPoint(a,b,p); +} +CIMGUI_API bool igImTriangleContainsPoint(const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 p) +{ + return ImTriangleContainsPoint(a,b,c,p); +} +CIMGUI_API void igImTriangleClosestPoint(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 p) +{ + *pOut = ImTriangleClosestPoint(a,b,c,p); +} +CIMGUI_API void igImTriangleBarycentricCoords(const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 p,float* out_u,float* out_v,float* out_w) +{ + return ImTriangleBarycentricCoords(a,b,c,p,*out_u,*out_v,*out_w); +} +CIMGUI_API float igImTriangleArea(const ImVec2 a,const ImVec2 b,const ImVec2 c) +{ + return ImTriangleArea(a,b,c); +} +CIMGUI_API ImVec1* ImVec1_ImVec1_Nil(void) +{ + return IM_NEW(ImVec1)(); +} +CIMGUI_API void ImVec1_destroy(ImVec1* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImVec1* ImVec1_ImVec1_Float(float _x) +{ + return IM_NEW(ImVec1)(_x); +} +CIMGUI_API ImVec2ih* ImVec2ih_ImVec2ih_Nil(void) +{ + return IM_NEW(ImVec2ih)(); +} +CIMGUI_API void ImVec2ih_destroy(ImVec2ih* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImVec2ih* ImVec2ih_ImVec2ih_short(short _x,short _y) +{ + return IM_NEW(ImVec2ih)(_x,_y); +} +CIMGUI_API ImVec2ih* ImVec2ih_ImVec2ih_Vec2(const ImVec2 rhs) +{ + return IM_NEW(ImVec2ih)(rhs); +} +CIMGUI_API ImRect* ImRect_ImRect_Nil(void) +{ + return IM_NEW(ImRect)(); +} +CIMGUI_API void ImRect_destroy(ImRect* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImRect* ImRect_ImRect_Vec2(const ImVec2 min,const ImVec2 max) +{ + return IM_NEW(ImRect)(min,max); +} +CIMGUI_API ImRect* ImRect_ImRect_Vec4(const ImVec4 v) +{ + return IM_NEW(ImRect)(v); +} +CIMGUI_API ImRect* ImRect_ImRect_Float(float x1,float y1,float x2,float y2) +{ + return IM_NEW(ImRect)(x1,y1,x2,y2); +} +CIMGUI_API void ImRect_GetCenter(ImVec2 *pOut,ImRect* self) +{ + *pOut = self->GetCenter(); +} +CIMGUI_API void ImRect_GetSize(ImVec2 *pOut,ImRect* self) +{ + *pOut = self->GetSize(); +} +CIMGUI_API float ImRect_GetWidth(ImRect* self) +{ + return self->GetWidth(); +} +CIMGUI_API float ImRect_GetHeight(ImRect* self) +{ + return self->GetHeight(); +} +CIMGUI_API float ImRect_GetArea(ImRect* self) +{ + return self->GetArea(); +} +CIMGUI_API void ImRect_GetTL(ImVec2 *pOut,ImRect* self) +{ + *pOut = self->GetTL(); +} +CIMGUI_API void ImRect_GetTR(ImVec2 *pOut,ImRect* self) +{ + *pOut = self->GetTR(); +} +CIMGUI_API void ImRect_GetBL(ImVec2 *pOut,ImRect* self) +{ + *pOut = self->GetBL(); +} +CIMGUI_API void ImRect_GetBR(ImVec2 *pOut,ImRect* self) +{ + *pOut = self->GetBR(); +} +CIMGUI_API bool ImRect_Contains_Vec2(ImRect* self,const ImVec2 p) +{ + return self->Contains(p); +} +CIMGUI_API bool ImRect_Contains_Rect(ImRect* self,const ImRect r) +{ + return self->Contains(r); +} +CIMGUI_API bool ImRect_Overlaps(ImRect* self,const ImRect r) +{ + return self->Overlaps(r); +} +CIMGUI_API void ImRect_Add_Vec2(ImRect* self,const ImVec2 p) +{ + return self->Add(p); +} +CIMGUI_API void ImRect_Add_Rect(ImRect* self,const ImRect r) +{ + return self->Add(r); +} +CIMGUI_API void ImRect_Expand_Float(ImRect* self,const float amount) +{ + return self->Expand(amount); +} +CIMGUI_API void ImRect_Expand_Vec2(ImRect* self,const ImVec2 amount) +{ + return self->Expand(amount); +} +CIMGUI_API void ImRect_Translate(ImRect* self,const ImVec2 d) +{ + return self->Translate(d); +} +CIMGUI_API void ImRect_TranslateX(ImRect* self,float dx) +{ + return self->TranslateX(dx); +} +CIMGUI_API void ImRect_TranslateY(ImRect* self,float dy) +{ + return self->TranslateY(dy); +} +CIMGUI_API void ImRect_ClipWith(ImRect* self,const ImRect r) +{ + return self->ClipWith(r); +} +CIMGUI_API void ImRect_ClipWithFull(ImRect* self,const ImRect r) +{ + return self->ClipWithFull(r); +} +CIMGUI_API void ImRect_Floor(ImRect* self) +{ + return self->Floor(); +} +CIMGUI_API bool ImRect_IsInverted(ImRect* self) +{ + return self->IsInverted(); +} +CIMGUI_API void ImRect_ToVec4(ImVec4 *pOut,ImRect* self) +{ + *pOut = self->ToVec4(); +} +CIMGUI_API size_t igImBitArrayGetStorageSizeInBytes(int bitcount) +{ + return ImBitArrayGetStorageSizeInBytes(bitcount); +} +CIMGUI_API void igImBitArrayClearAllBits(ImU32* arr,int bitcount) +{ + return ImBitArrayClearAllBits(arr,bitcount); +} +CIMGUI_API bool igImBitArrayTestBit(const ImU32* arr,int n) +{ + return ImBitArrayTestBit(arr,n); +} +CIMGUI_API void igImBitArrayClearBit(ImU32* arr,int n) +{ + return ImBitArrayClearBit(arr,n); +} +CIMGUI_API void igImBitArraySetBit(ImU32* arr,int n) +{ + return ImBitArraySetBit(arr,n); +} +CIMGUI_API void igImBitArraySetBitRange(ImU32* arr,int n,int n2) +{ + return ImBitArraySetBitRange(arr,n,n2); +} +CIMGUI_API void ImBitVector_Create(ImBitVector* self,int sz) +{ + return self->Create(sz); +} +CIMGUI_API void ImBitVector_Clear(ImBitVector* self) +{ + return self->Clear(); +} +CIMGUI_API bool ImBitVector_TestBit(ImBitVector* self,int n) +{ + return self->TestBit(n); +} +CIMGUI_API void ImBitVector_SetBit(ImBitVector* self,int n) +{ + return self->SetBit(n); +} +CIMGUI_API void ImBitVector_ClearBit(ImBitVector* self,int n) +{ + return self->ClearBit(n); +} +CIMGUI_API void ImGuiTextIndex_clear(ImGuiTextIndex* self) +{ + return self->clear(); +} +CIMGUI_API int ImGuiTextIndex_size(ImGuiTextIndex* self) +{ + return self->size(); +} +CIMGUI_API const char* ImGuiTextIndex_get_line_begin(ImGuiTextIndex* self,const char* base,int n) +{ + return self->get_line_begin(base,n); +} +CIMGUI_API const char* ImGuiTextIndex_get_line_end(ImGuiTextIndex* self,const char* base,int n) +{ + return self->get_line_end(base,n); +} +CIMGUI_API void ImGuiTextIndex_append(ImGuiTextIndex* self,const char* base,int old_size,int new_size) +{ + return self->append(base,old_size,new_size); +} +CIMGUI_API ImDrawListSharedData* ImDrawListSharedData_ImDrawListSharedData(void) +{ + return IM_NEW(ImDrawListSharedData)(); +} +CIMGUI_API void ImDrawListSharedData_destroy(ImDrawListSharedData* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImDrawListSharedData_SetCircleTessellationMaxError(ImDrawListSharedData* self,float max_error) +{ + return self->SetCircleTessellationMaxError(max_error); +} +CIMGUI_API ImDrawDataBuilder* ImDrawDataBuilder_ImDrawDataBuilder(void) +{ + return IM_NEW(ImDrawDataBuilder)(); +} +CIMGUI_API void ImDrawDataBuilder_destroy(ImDrawDataBuilder* self) +{ + IM_DELETE(self); +} +CIMGUI_API void* ImGuiDataVarInfo_GetVarPtr(ImGuiDataVarInfo* self,void* parent) +{ + return self->GetVarPtr(parent); +} +CIMGUI_API ImGuiStyleMod* ImGuiStyleMod_ImGuiStyleMod_Int(ImGuiStyleVar idx,int v) +{ + return IM_NEW(ImGuiStyleMod)(idx,v); +} +CIMGUI_API void ImGuiStyleMod_destroy(ImGuiStyleMod* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiStyleMod* ImGuiStyleMod_ImGuiStyleMod_Float(ImGuiStyleVar idx,float v) +{ + return IM_NEW(ImGuiStyleMod)(idx,v); +} +CIMGUI_API ImGuiStyleMod* ImGuiStyleMod_ImGuiStyleMod_Vec2(ImGuiStyleVar idx,ImVec2 v) +{ + return IM_NEW(ImGuiStyleMod)(idx,v); +} +CIMGUI_API ImGuiComboPreviewData* ImGuiComboPreviewData_ImGuiComboPreviewData(void) +{ + return IM_NEW(ImGuiComboPreviewData)(); +} +CIMGUI_API void ImGuiComboPreviewData_destroy(ImGuiComboPreviewData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiMenuColumns* ImGuiMenuColumns_ImGuiMenuColumns(void) +{ + return IM_NEW(ImGuiMenuColumns)(); +} +CIMGUI_API void ImGuiMenuColumns_destroy(ImGuiMenuColumns* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiMenuColumns_Update(ImGuiMenuColumns* self,float spacing,bool window_reappearing) +{ + return self->Update(spacing,window_reappearing); +} +CIMGUI_API float ImGuiMenuColumns_DeclColumns(ImGuiMenuColumns* self,float w_icon,float w_label,float w_shortcut,float w_mark) +{ + return self->DeclColumns(w_icon,w_label,w_shortcut,w_mark); +} +CIMGUI_API void ImGuiMenuColumns_CalcNextTotalWidth(ImGuiMenuColumns* self,bool update_offsets) +{ + return self->CalcNextTotalWidth(update_offsets); +} +CIMGUI_API ImGuiInputTextDeactivatedState* ImGuiInputTextDeactivatedState_ImGuiInputTextDeactivatedState(void) +{ + return IM_NEW(ImGuiInputTextDeactivatedState)(); +} +CIMGUI_API void ImGuiInputTextDeactivatedState_destroy(ImGuiInputTextDeactivatedState* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiInputTextDeactivatedState_ClearFreeMemory(ImGuiInputTextDeactivatedState* self) +{ + return self->ClearFreeMemory(); +} +CIMGUI_API ImGuiInputTextState* ImGuiInputTextState_ImGuiInputTextState(void) +{ + return IM_NEW(ImGuiInputTextState)(); +} +CIMGUI_API void ImGuiInputTextState_destroy(ImGuiInputTextState* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiInputTextState_ClearText(ImGuiInputTextState* self) +{ + return self->ClearText(); +} +CIMGUI_API void ImGuiInputTextState_ClearFreeMemory(ImGuiInputTextState* self) +{ + return self->ClearFreeMemory(); +} +CIMGUI_API int ImGuiInputTextState_GetUndoAvailCount(ImGuiInputTextState* self) +{ + return self->GetUndoAvailCount(); +} +CIMGUI_API int ImGuiInputTextState_GetRedoAvailCount(ImGuiInputTextState* self) +{ + return self->GetRedoAvailCount(); +} +CIMGUI_API void ImGuiInputTextState_OnKeyPressed(ImGuiInputTextState* self,int key) +{ + return self->OnKeyPressed(key); +} +CIMGUI_API void ImGuiInputTextState_CursorAnimReset(ImGuiInputTextState* self) +{ + return self->CursorAnimReset(); +} +CIMGUI_API void ImGuiInputTextState_CursorClamp(ImGuiInputTextState* self) +{ + return self->CursorClamp(); +} +CIMGUI_API bool ImGuiInputTextState_HasSelection(ImGuiInputTextState* self) +{ + return self->HasSelection(); +} +CIMGUI_API void ImGuiInputTextState_ClearSelection(ImGuiInputTextState* self) +{ + return self->ClearSelection(); +} +CIMGUI_API int ImGuiInputTextState_GetCursorPos(ImGuiInputTextState* self) +{ + return self->GetCursorPos(); +} +CIMGUI_API int ImGuiInputTextState_GetSelectionStart(ImGuiInputTextState* self) +{ + return self->GetSelectionStart(); +} +CIMGUI_API int ImGuiInputTextState_GetSelectionEnd(ImGuiInputTextState* self) +{ + return self->GetSelectionEnd(); +} +CIMGUI_API void ImGuiInputTextState_SelectAll(ImGuiInputTextState* self) +{ + return self->SelectAll(); +} +CIMGUI_API ImGuiPopupData* ImGuiPopupData_ImGuiPopupData(void) +{ + return IM_NEW(ImGuiPopupData)(); +} +CIMGUI_API void ImGuiPopupData_destroy(ImGuiPopupData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiNextWindowData* ImGuiNextWindowData_ImGuiNextWindowData(void) +{ + return IM_NEW(ImGuiNextWindowData)(); +} +CIMGUI_API void ImGuiNextWindowData_destroy(ImGuiNextWindowData* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiNextWindowData_ClearFlags(ImGuiNextWindowData* self) +{ + return self->ClearFlags(); +} +CIMGUI_API ImGuiNextItemData* ImGuiNextItemData_ImGuiNextItemData(void) +{ + return IM_NEW(ImGuiNextItemData)(); +} +CIMGUI_API void ImGuiNextItemData_destroy(ImGuiNextItemData* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiNextItemData_ClearFlags(ImGuiNextItemData* self) +{ + return self->ClearFlags(); +} +CIMGUI_API ImGuiLastItemData* ImGuiLastItemData_ImGuiLastItemData(void) +{ + return IM_NEW(ImGuiLastItemData)(); +} +CIMGUI_API void ImGuiLastItemData_destroy(ImGuiLastItemData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiStackSizes* ImGuiStackSizes_ImGuiStackSizes(void) +{ + return IM_NEW(ImGuiStackSizes)(); +} +CIMGUI_API void ImGuiStackSizes_destroy(ImGuiStackSizes* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiStackSizes_SetToContextState(ImGuiStackSizes* self,ImGuiContext* ctx) +{ + return self->SetToContextState(ctx); +} +CIMGUI_API void ImGuiStackSizes_CompareWithContextState(ImGuiStackSizes* self,ImGuiContext* ctx) +{ + return self->CompareWithContextState(ctx); +} +CIMGUI_API ImGuiPtrOrIndex* ImGuiPtrOrIndex_ImGuiPtrOrIndex_Ptr(void* ptr) +{ + return IM_NEW(ImGuiPtrOrIndex)(ptr); +} +CIMGUI_API void ImGuiPtrOrIndex_destroy(ImGuiPtrOrIndex* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiPtrOrIndex* ImGuiPtrOrIndex_ImGuiPtrOrIndex_Int(int index) +{ + return IM_NEW(ImGuiPtrOrIndex)(index); +} +CIMGUI_API ImGuiInputEvent* ImGuiInputEvent_ImGuiInputEvent(void) +{ + return IM_NEW(ImGuiInputEvent)(); +} +CIMGUI_API void ImGuiInputEvent_destroy(ImGuiInputEvent* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiKeyRoutingData* ImGuiKeyRoutingData_ImGuiKeyRoutingData(void) +{ + return IM_NEW(ImGuiKeyRoutingData)(); +} +CIMGUI_API void ImGuiKeyRoutingData_destroy(ImGuiKeyRoutingData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiKeyRoutingTable* ImGuiKeyRoutingTable_ImGuiKeyRoutingTable(void) +{ + return IM_NEW(ImGuiKeyRoutingTable)(); +} +CIMGUI_API void ImGuiKeyRoutingTable_destroy(ImGuiKeyRoutingTable* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiKeyRoutingTable_Clear(ImGuiKeyRoutingTable* self) +{ + return self->Clear(); +} +CIMGUI_API ImGuiKeyOwnerData* ImGuiKeyOwnerData_ImGuiKeyOwnerData(void) +{ + return IM_NEW(ImGuiKeyOwnerData)(); +} +CIMGUI_API void ImGuiKeyOwnerData_destroy(ImGuiKeyOwnerData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiListClipperRange ImGuiListClipperRange_FromIndices(int min,int max) +{ + return ImGuiListClipperRange::FromIndices(min,max); +} +CIMGUI_API ImGuiListClipperRange ImGuiListClipperRange_FromPositions(float y1,float y2,int off_min,int off_max) +{ + return ImGuiListClipperRange::FromPositions(y1,y2,off_min,off_max); +} +CIMGUI_API ImGuiListClipperData* ImGuiListClipperData_ImGuiListClipperData(void) +{ + return IM_NEW(ImGuiListClipperData)(); +} +CIMGUI_API void ImGuiListClipperData_destroy(ImGuiListClipperData* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiListClipperData_Reset(ImGuiListClipperData* self,ImGuiListClipper* clipper) +{ + return self->Reset(clipper); +} +CIMGUI_API ImGuiNavItemData* ImGuiNavItemData_ImGuiNavItemData(void) +{ + return IM_NEW(ImGuiNavItemData)(); +} +CIMGUI_API void ImGuiNavItemData_destroy(ImGuiNavItemData* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiNavItemData_Clear(ImGuiNavItemData* self) +{ + return self->Clear(); +} +CIMGUI_API ImGuiOldColumnData* ImGuiOldColumnData_ImGuiOldColumnData(void) +{ + return IM_NEW(ImGuiOldColumnData)(); +} +CIMGUI_API void ImGuiOldColumnData_destroy(ImGuiOldColumnData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiOldColumns* ImGuiOldColumns_ImGuiOldColumns(void) +{ + return IM_NEW(ImGuiOldColumns)(); +} +CIMGUI_API void ImGuiOldColumns_destroy(ImGuiOldColumns* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiDockNode* ImGuiDockNode_ImGuiDockNode(ImGuiID id) +{ + return IM_NEW(ImGuiDockNode)(id); +} +CIMGUI_API void ImGuiDockNode_destroy(ImGuiDockNode* self) +{ + IM_DELETE(self); +} +CIMGUI_API bool ImGuiDockNode_IsRootNode(ImGuiDockNode* self) +{ + return self->IsRootNode(); +} +CIMGUI_API bool ImGuiDockNode_IsDockSpace(ImGuiDockNode* self) +{ + return self->IsDockSpace(); +} +CIMGUI_API bool ImGuiDockNode_IsFloatingNode(ImGuiDockNode* self) +{ + return self->IsFloatingNode(); +} +CIMGUI_API bool ImGuiDockNode_IsCentralNode(ImGuiDockNode* self) +{ + return self->IsCentralNode(); +} +CIMGUI_API bool ImGuiDockNode_IsHiddenTabBar(ImGuiDockNode* self) +{ + return self->IsHiddenTabBar(); +} +CIMGUI_API bool ImGuiDockNode_IsNoTabBar(ImGuiDockNode* self) +{ + return self->IsNoTabBar(); +} +CIMGUI_API bool ImGuiDockNode_IsSplitNode(ImGuiDockNode* self) +{ + return self->IsSplitNode(); +} +CIMGUI_API bool ImGuiDockNode_IsLeafNode(ImGuiDockNode* self) +{ + return self->IsLeafNode(); +} +CIMGUI_API bool ImGuiDockNode_IsEmpty(ImGuiDockNode* self) +{ + return self->IsEmpty(); +} +CIMGUI_API void ImGuiDockNode_Rect(ImRect *pOut,ImGuiDockNode* self) +{ + *pOut = self->Rect(); +} +CIMGUI_API void ImGuiDockNode_SetLocalFlags(ImGuiDockNode* self,ImGuiDockNodeFlags flags) +{ + return self->SetLocalFlags(flags); +} +CIMGUI_API void ImGuiDockNode_UpdateMergedFlags(ImGuiDockNode* self) +{ + return self->UpdateMergedFlags(); +} +CIMGUI_API ImGuiDockContext* ImGuiDockContext_ImGuiDockContext(void) +{ + return IM_NEW(ImGuiDockContext)(); +} +CIMGUI_API void ImGuiDockContext_destroy(ImGuiDockContext* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiViewportP* ImGuiViewportP_ImGuiViewportP(void) +{ + return IM_NEW(ImGuiViewportP)(); +} +CIMGUI_API void ImGuiViewportP_destroy(ImGuiViewportP* self) +{ + IM_DELETE(self); +} +CIMGUI_API void ImGuiViewportP_ClearRequestFlags(ImGuiViewportP* self) +{ + return self->ClearRequestFlags(); +} +CIMGUI_API void ImGuiViewportP_CalcWorkRectPos(ImVec2 *pOut,ImGuiViewportP* self,const ImVec2 off_min) +{ + *pOut = self->CalcWorkRectPos(off_min); +} +CIMGUI_API void ImGuiViewportP_CalcWorkRectSize(ImVec2 *pOut,ImGuiViewportP* self,const ImVec2 off_min,const ImVec2 off_max) +{ + *pOut = self->CalcWorkRectSize(off_min,off_max); +} +CIMGUI_API void ImGuiViewportP_UpdateWorkRect(ImGuiViewportP* self) +{ + return self->UpdateWorkRect(); +} +CIMGUI_API void ImGuiViewportP_GetMainRect(ImRect *pOut,ImGuiViewportP* self) +{ + *pOut = self->GetMainRect(); +} +CIMGUI_API void ImGuiViewportP_GetWorkRect(ImRect *pOut,ImGuiViewportP* self) +{ + *pOut = self->GetWorkRect(); +} +CIMGUI_API void ImGuiViewportP_GetBuildWorkRect(ImRect *pOut,ImGuiViewportP* self) +{ + *pOut = self->GetBuildWorkRect(); +} +CIMGUI_API ImGuiWindowSettings* ImGuiWindowSettings_ImGuiWindowSettings(void) +{ + return IM_NEW(ImGuiWindowSettings)(); +} +CIMGUI_API void ImGuiWindowSettings_destroy(ImGuiWindowSettings* self) +{ + IM_DELETE(self); +} +CIMGUI_API char* ImGuiWindowSettings_GetName(ImGuiWindowSettings* self) +{ + return self->GetName(); +} +CIMGUI_API ImGuiSettingsHandler* ImGuiSettingsHandler_ImGuiSettingsHandler(void) +{ + return IM_NEW(ImGuiSettingsHandler)(); +} +CIMGUI_API void ImGuiSettingsHandler_destroy(ImGuiSettingsHandler* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiStackLevelInfo* ImGuiStackLevelInfo_ImGuiStackLevelInfo(void) +{ + return IM_NEW(ImGuiStackLevelInfo)(); +} +CIMGUI_API void ImGuiStackLevelInfo_destroy(ImGuiStackLevelInfo* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiStackTool* ImGuiStackTool_ImGuiStackTool(void) +{ + return IM_NEW(ImGuiStackTool)(); +} +CIMGUI_API void ImGuiStackTool_destroy(ImGuiStackTool* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiContextHook* ImGuiContextHook_ImGuiContextHook(void) +{ + return IM_NEW(ImGuiContextHook)(); +} +CIMGUI_API void ImGuiContextHook_destroy(ImGuiContextHook* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiContext* ImGuiContext_ImGuiContext(ImFontAtlas* shared_font_atlas) +{ + return IM_NEW(ImGuiContext)(shared_font_atlas); +} +CIMGUI_API void ImGuiContext_destroy(ImGuiContext* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiWindow* ImGuiWindow_ImGuiWindow(ImGuiContext* context,const char* name) +{ + return IM_NEW(ImGuiWindow)(context,name); +} +CIMGUI_API void ImGuiWindow_destroy(ImGuiWindow* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiID ImGuiWindow_GetID_Str(ImGuiWindow* self,const char* str,const char* str_end) +{ + return self->GetID(str,str_end); +} +CIMGUI_API ImGuiID ImGuiWindow_GetID_Ptr(ImGuiWindow* self,const void* ptr) +{ + return self->GetID(ptr); +} +CIMGUI_API ImGuiID ImGuiWindow_GetID_Int(ImGuiWindow* self,int n) +{ + return self->GetID(n); +} +CIMGUI_API ImGuiID ImGuiWindow_GetIDFromRectangle(ImGuiWindow* self,const ImRect r_abs) +{ + return self->GetIDFromRectangle(r_abs); +} +CIMGUI_API void ImGuiWindow_Rect(ImRect *pOut,ImGuiWindow* self) +{ + *pOut = self->Rect(); +} +CIMGUI_API float ImGuiWindow_CalcFontSize(ImGuiWindow* self) +{ + return self->CalcFontSize(); +} +CIMGUI_API float ImGuiWindow_TitleBarHeight(ImGuiWindow* self) +{ + return self->TitleBarHeight(); +} +CIMGUI_API void ImGuiWindow_TitleBarRect(ImRect *pOut,ImGuiWindow* self) +{ + *pOut = self->TitleBarRect(); +} +CIMGUI_API float ImGuiWindow_MenuBarHeight(ImGuiWindow* self) +{ + return self->MenuBarHeight(); +} +CIMGUI_API void ImGuiWindow_MenuBarRect(ImRect *pOut,ImGuiWindow* self) +{ + *pOut = self->MenuBarRect(); +} +CIMGUI_API ImGuiTabItem* ImGuiTabItem_ImGuiTabItem(void) +{ + return IM_NEW(ImGuiTabItem)(); +} +CIMGUI_API void ImGuiTabItem_destroy(ImGuiTabItem* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTabBar* ImGuiTabBar_ImGuiTabBar(void) +{ + return IM_NEW(ImGuiTabBar)(); +} +CIMGUI_API void ImGuiTabBar_destroy(ImGuiTabBar* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTableColumn* ImGuiTableColumn_ImGuiTableColumn(void) +{ + return IM_NEW(ImGuiTableColumn)(); +} +CIMGUI_API void ImGuiTableColumn_destroy(ImGuiTableColumn* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTableInstanceData* ImGuiTableInstanceData_ImGuiTableInstanceData(void) +{ + return IM_NEW(ImGuiTableInstanceData)(); +} +CIMGUI_API void ImGuiTableInstanceData_destroy(ImGuiTableInstanceData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTable* ImGuiTable_ImGuiTable(void) +{ + return IM_NEW(ImGuiTable)(); +} +CIMGUI_API void ImGuiTable_destroy(ImGuiTable* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTableTempData* ImGuiTableTempData_ImGuiTableTempData(void) +{ + return IM_NEW(ImGuiTableTempData)(); +} +CIMGUI_API void ImGuiTableTempData_destroy(ImGuiTableTempData* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTableColumnSettings* ImGuiTableColumnSettings_ImGuiTableColumnSettings(void) +{ + return IM_NEW(ImGuiTableColumnSettings)(); +} +CIMGUI_API void ImGuiTableColumnSettings_destroy(ImGuiTableColumnSettings* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTableSettings* ImGuiTableSettings_ImGuiTableSettings(void) +{ + return IM_NEW(ImGuiTableSettings)(); +} +CIMGUI_API void ImGuiTableSettings_destroy(ImGuiTableSettings* self) +{ + IM_DELETE(self); +} +CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiTableSettings* self) +{ + return self->GetColumnSettings(); +} +CIMGUI_API ImGuiWindow* igGetCurrentWindowRead() +{ + return ImGui::GetCurrentWindowRead(); +} +CIMGUI_API ImGuiWindow* igGetCurrentWindow() +{ + return ImGui::GetCurrentWindow(); +} +CIMGUI_API ImGuiWindow* igFindWindowByID(ImGuiID id) +{ + return ImGui::FindWindowByID(id); +} +CIMGUI_API ImGuiWindow* igFindWindowByName(const char* name) +{ + return ImGui::FindWindowByName(name); +} +CIMGUI_API void igUpdateWindowParentAndRootLinks(ImGuiWindow* window,ImGuiWindowFlags flags,ImGuiWindow* parent_window) +{ + return ImGui::UpdateWindowParentAndRootLinks(window,flags,parent_window); +} +CIMGUI_API void igCalcWindowNextAutoFitSize(ImVec2 *pOut,ImGuiWindow* window) +{ + *pOut = ImGui::CalcWindowNextAutoFitSize(window); +} +CIMGUI_API bool igIsWindowChildOf(ImGuiWindow* window,ImGuiWindow* potential_parent,bool popup_hierarchy,bool dock_hierarchy) +{ + return ImGui::IsWindowChildOf(window,potential_parent,popup_hierarchy,dock_hierarchy); +} +CIMGUI_API bool igIsWindowWithinBeginStackOf(ImGuiWindow* window,ImGuiWindow* potential_parent) +{ + return ImGui::IsWindowWithinBeginStackOf(window,potential_parent); +} +CIMGUI_API bool igIsWindowAbove(ImGuiWindow* potential_above,ImGuiWindow* potential_below) +{ + return ImGui::IsWindowAbove(potential_above,potential_below); +} +CIMGUI_API bool igIsWindowNavFocusable(ImGuiWindow* window) +{ + return ImGui::IsWindowNavFocusable(window); +} +CIMGUI_API void igSetWindowPos_WindowPtr(ImGuiWindow* window,const ImVec2 pos,ImGuiCond cond) +{ + return ImGui::SetWindowPos(window,pos,cond); +} +CIMGUI_API void igSetWindowSize_WindowPtr(ImGuiWindow* window,const ImVec2 size,ImGuiCond cond) +{ + return ImGui::SetWindowSize(window,size,cond); +} +CIMGUI_API void igSetWindowCollapsed_WindowPtr(ImGuiWindow* window,bool collapsed,ImGuiCond cond) +{ + return ImGui::SetWindowCollapsed(window,collapsed,cond); +} +CIMGUI_API void igSetWindowHitTestHole(ImGuiWindow* window,const ImVec2 pos,const ImVec2 size) +{ + return ImGui::SetWindowHitTestHole(window,pos,size); +} +CIMGUI_API void igSetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow* window) +{ + return ImGui::SetWindowHiddendAndSkipItemsForCurrentFrame(window); +} +CIMGUI_API void igWindowRectAbsToRel(ImRect *pOut,ImGuiWindow* window,const ImRect r) +{ + *pOut = ImGui::WindowRectAbsToRel(window,r); +} +CIMGUI_API void igWindowRectRelToAbs(ImRect *pOut,ImGuiWindow* window,const ImRect r) +{ + *pOut = ImGui::WindowRectRelToAbs(window,r); +} +CIMGUI_API void igWindowPosRelToAbs(ImVec2 *pOut,ImGuiWindow* window,const ImVec2 p) +{ + *pOut = ImGui::WindowPosRelToAbs(window,p); +} +CIMGUI_API void igFocusWindow(ImGuiWindow* window,ImGuiFocusRequestFlags flags) +{ + return ImGui::FocusWindow(window,flags); +} +CIMGUI_API void igFocusTopMostWindowUnderOne(ImGuiWindow* under_this_window,ImGuiWindow* ignore_window,ImGuiViewport* filter_viewport,ImGuiFocusRequestFlags flags) +{ + return ImGui::FocusTopMostWindowUnderOne(under_this_window,ignore_window,filter_viewport,flags); +} +CIMGUI_API void igBringWindowToFocusFront(ImGuiWindow* window) +{ + return ImGui::BringWindowToFocusFront(window); +} +CIMGUI_API void igBringWindowToDisplayFront(ImGuiWindow* window) +{ + return ImGui::BringWindowToDisplayFront(window); +} +CIMGUI_API void igBringWindowToDisplayBack(ImGuiWindow* window) +{ + return ImGui::BringWindowToDisplayBack(window); +} +CIMGUI_API void igBringWindowToDisplayBehind(ImGuiWindow* window,ImGuiWindow* above_window) +{ + return ImGui::BringWindowToDisplayBehind(window,above_window); +} +CIMGUI_API int igFindWindowDisplayIndex(ImGuiWindow* window) +{ + return ImGui::FindWindowDisplayIndex(window); +} +CIMGUI_API ImGuiWindow* igFindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window) +{ + return ImGui::FindBottomMostVisibleWindowWithinBeginStack(window); +} +CIMGUI_API void igSetCurrentFont(ImFont* font) +{ + return ImGui::SetCurrentFont(font); +} +CIMGUI_API ImFont* igGetDefaultFont() +{ + return ImGui::GetDefaultFont(); +} +CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window) +{ + return ImGui::GetForegroundDrawList(window); +} +CIMGUI_API void igAddDrawListToDrawDataEx(ImDrawData* draw_data,ImVector_ImDrawListPtr* out_list,ImDrawList* draw_list) +{ + return ImGui::AddDrawListToDrawDataEx(draw_data,out_list,draw_list); +} +CIMGUI_API void igInitialize() +{ + return ImGui::Initialize(); +} +CIMGUI_API void igShutdown() +{ + return ImGui::Shutdown(); +} +CIMGUI_API void igUpdateInputEvents(bool trickle_fast_inputs) +{ + return ImGui::UpdateInputEvents(trickle_fast_inputs); +} +CIMGUI_API void igUpdateHoveredWindowAndCaptureFlags() +{ + return ImGui::UpdateHoveredWindowAndCaptureFlags(); +} +CIMGUI_API void igStartMouseMovingWindow(ImGuiWindow* window) +{ + return ImGui::StartMouseMovingWindow(window); +} +CIMGUI_API void igStartMouseMovingWindowOrNode(ImGuiWindow* window,ImGuiDockNode* node,bool undock_floating_node) +{ + return ImGui::StartMouseMovingWindowOrNode(window,node,undock_floating_node); +} +CIMGUI_API void igUpdateMouseMovingWindowNewFrame() +{ + return ImGui::UpdateMouseMovingWindowNewFrame(); +} +CIMGUI_API void igUpdateMouseMovingWindowEndFrame() +{ + return ImGui::UpdateMouseMovingWindowEndFrame(); +} +CIMGUI_API ImGuiID igAddContextHook(ImGuiContext* context,const ImGuiContextHook* hook) +{ + return ImGui::AddContextHook(context,hook); +} +CIMGUI_API void igRemoveContextHook(ImGuiContext* context,ImGuiID hook_to_remove) +{ + return ImGui::RemoveContextHook(context,hook_to_remove); +} +CIMGUI_API void igCallContextHooks(ImGuiContext* context,ImGuiContextHookType type) +{ + return ImGui::CallContextHooks(context,type); +} +CIMGUI_API void igTranslateWindowsInViewport(ImGuiViewportP* viewport,const ImVec2 old_pos,const ImVec2 new_pos) +{ + return ImGui::TranslateWindowsInViewport(viewport,old_pos,new_pos); +} +CIMGUI_API void igScaleWindowsInViewport(ImGuiViewportP* viewport,float scale) +{ + return ImGui::ScaleWindowsInViewport(viewport,scale); +} +CIMGUI_API void igDestroyPlatformWindow(ImGuiViewportP* viewport) +{ + return ImGui::DestroyPlatformWindow(viewport); +} +CIMGUI_API void igSetWindowViewport(ImGuiWindow* window,ImGuiViewportP* viewport) +{ + return ImGui::SetWindowViewport(window,viewport); +} +CIMGUI_API void igSetCurrentViewport(ImGuiWindow* window,ImGuiViewportP* viewport) +{ + return ImGui::SetCurrentViewport(window,viewport); +} +CIMGUI_API const ImGuiPlatformMonitor* igGetViewportPlatformMonitor(ImGuiViewport* viewport) +{ + return ImGui::GetViewportPlatformMonitor(viewport); +} +CIMGUI_API ImGuiViewportP* igFindHoveredViewportFromPlatformWindowStack(const ImVec2 mouse_platform_pos) +{ + return ImGui::FindHoveredViewportFromPlatformWindowStack(mouse_platform_pos); +} +CIMGUI_API void igMarkIniSettingsDirty_Nil() +{ + return ImGui::MarkIniSettingsDirty(); +} +CIMGUI_API void igMarkIniSettingsDirty_WindowPtr(ImGuiWindow* window) +{ + return ImGui::MarkIniSettingsDirty(window); +} +CIMGUI_API void igClearIniSettings() +{ + return ImGui::ClearIniSettings(); +} +CIMGUI_API void igAddSettingsHandler(const ImGuiSettingsHandler* handler) +{ + return ImGui::AddSettingsHandler(handler); +} +CIMGUI_API void igRemoveSettingsHandler(const char* type_name) +{ + return ImGui::RemoveSettingsHandler(type_name); +} +CIMGUI_API ImGuiSettingsHandler* igFindSettingsHandler(const char* type_name) +{ + return ImGui::FindSettingsHandler(type_name); +} +CIMGUI_API ImGuiWindowSettings* igCreateNewWindowSettings(const char* name) +{ + return ImGui::CreateNewWindowSettings(name); +} +CIMGUI_API ImGuiWindowSettings* igFindWindowSettingsByID(ImGuiID id) +{ + return ImGui::FindWindowSettingsByID(id); +} +CIMGUI_API ImGuiWindowSettings* igFindWindowSettingsByWindow(ImGuiWindow* window) +{ + return ImGui::FindWindowSettingsByWindow(window); +} +CIMGUI_API void igClearWindowSettings(const char* name) +{ + return ImGui::ClearWindowSettings(name); +} +CIMGUI_API void igLocalizeRegisterEntries(const ImGuiLocEntry* entries,int count) +{ + return ImGui::LocalizeRegisterEntries(entries,count); +} +CIMGUI_API const char* igLocalizeGetMsg(ImGuiLocKey key) +{ + return ImGui::LocalizeGetMsg(key); +} +CIMGUI_API void igSetScrollX_WindowPtr(ImGuiWindow* window,float scroll_x) +{ + return ImGui::SetScrollX(window,scroll_x); +} +CIMGUI_API void igSetScrollY_WindowPtr(ImGuiWindow* window,float scroll_y) +{ + return ImGui::SetScrollY(window,scroll_y); +} +CIMGUI_API void igSetScrollFromPosX_WindowPtr(ImGuiWindow* window,float local_x,float center_x_ratio) +{ + return ImGui::SetScrollFromPosX(window,local_x,center_x_ratio); +} +CIMGUI_API void igSetScrollFromPosY_WindowPtr(ImGuiWindow* window,float local_y,float center_y_ratio) +{ + return ImGui::SetScrollFromPosY(window,local_y,center_y_ratio); +} +CIMGUI_API void igScrollToItem(ImGuiScrollFlags flags) +{ + return ImGui::ScrollToItem(flags); +} +CIMGUI_API void igScrollToRect(ImGuiWindow* window,const ImRect rect,ImGuiScrollFlags flags) +{ + return ImGui::ScrollToRect(window,rect,flags); +} +CIMGUI_API void igScrollToRectEx(ImVec2 *pOut,ImGuiWindow* window,const ImRect rect,ImGuiScrollFlags flags) +{ + *pOut = ImGui::ScrollToRectEx(window,rect,flags); +} +CIMGUI_API void igScrollToBringRectIntoView(ImGuiWindow* window,const ImRect rect) +{ + return ImGui::ScrollToBringRectIntoView(window,rect); +} +CIMGUI_API ImGuiItemStatusFlags igGetItemStatusFlags() +{ + return ImGui::GetItemStatusFlags(); +} +CIMGUI_API ImGuiItemFlags igGetItemFlags() +{ + return ImGui::GetItemFlags(); +} +CIMGUI_API ImGuiID igGetActiveID() +{ + return ImGui::GetActiveID(); +} +CIMGUI_API ImGuiID igGetFocusID() +{ + return ImGui::GetFocusID(); +} +CIMGUI_API void igSetActiveID(ImGuiID id,ImGuiWindow* window) +{ + return ImGui::SetActiveID(id,window); +} +CIMGUI_API void igSetFocusID(ImGuiID id,ImGuiWindow* window) +{ + return ImGui::SetFocusID(id,window); +} +CIMGUI_API void igClearActiveID() +{ + return ImGui::ClearActiveID(); +} +CIMGUI_API ImGuiID igGetHoveredID() +{ + return ImGui::GetHoveredID(); +} +CIMGUI_API void igSetHoveredID(ImGuiID id) +{ + return ImGui::SetHoveredID(id); +} +CIMGUI_API void igKeepAliveID(ImGuiID id) +{ + return ImGui::KeepAliveID(id); +} +CIMGUI_API void igMarkItemEdited(ImGuiID id) +{ + return ImGui::MarkItemEdited(id); +} +CIMGUI_API void igPushOverrideID(ImGuiID id) +{ + return ImGui::PushOverrideID(id); +} +CIMGUI_API ImGuiID igGetIDWithSeed_Str(const char* str_id_begin,const char* str_id_end,ImGuiID seed) +{ + return ImGui::GetIDWithSeed(str_id_begin,str_id_end,seed); +} +CIMGUI_API ImGuiID igGetIDWithSeed_Int(int n,ImGuiID seed) +{ + return ImGui::GetIDWithSeed(n,seed); +} +CIMGUI_API void igItemSize_Vec2(const ImVec2 size,float text_baseline_y) +{ + return ImGui::ItemSize(size,text_baseline_y); +} +CIMGUI_API void igItemSize_Rect(const ImRect bb,float text_baseline_y) +{ + return ImGui::ItemSize(bb,text_baseline_y); +} +CIMGUI_API bool igItemAdd(const ImRect bb,ImGuiID id,const ImRect* nav_bb,ImGuiItemFlags extra_flags) +{ + return ImGui::ItemAdd(bb,id,nav_bb,extra_flags); +} +CIMGUI_API bool igItemHoverable(const ImRect bb,ImGuiID id,ImGuiItemFlags item_flags) +{ + return ImGui::ItemHoverable(bb,id,item_flags); +} +CIMGUI_API bool igIsWindowContentHoverable(ImGuiWindow* window,ImGuiHoveredFlags flags) +{ + return ImGui::IsWindowContentHoverable(window,flags); +} +CIMGUI_API bool igIsClippedEx(const ImRect bb,ImGuiID id) +{ + return ImGui::IsClippedEx(bb,id); +} +CIMGUI_API void igSetLastItemData(ImGuiID item_id,ImGuiItemFlags in_flags,ImGuiItemStatusFlags status_flags,const ImRect item_rect) +{ + return ImGui::SetLastItemData(item_id,in_flags,status_flags,item_rect); +} +CIMGUI_API void igCalcItemSize(ImVec2 *pOut,ImVec2 size,float default_w,float default_h) +{ + *pOut = ImGui::CalcItemSize(size,default_w,default_h); +} +CIMGUI_API float igCalcWrapWidthForPos(const ImVec2 pos,float wrap_pos_x) +{ + return ImGui::CalcWrapWidthForPos(pos,wrap_pos_x); +} +CIMGUI_API void igPushMultiItemsWidths(int components,float width_full) +{ + return ImGui::PushMultiItemsWidths(components,width_full); +} +CIMGUI_API bool igIsItemToggledSelection() +{ + return ImGui::IsItemToggledSelection(); +} +CIMGUI_API void igGetContentRegionMaxAbs(ImVec2 *pOut) +{ + *pOut = ImGui::GetContentRegionMaxAbs(); +} +CIMGUI_API void igShrinkWidths(ImGuiShrinkWidthItem* items,int count,float width_excess) +{ + return ImGui::ShrinkWidths(items,count,width_excess); +} +CIMGUI_API void igPushItemFlag(ImGuiItemFlags option,bool enabled) +{ + return ImGui::PushItemFlag(option,enabled); +} +CIMGUI_API void igPopItemFlag() +{ + return ImGui::PopItemFlag(); +} +CIMGUI_API const ImGuiDataVarInfo* igGetStyleVarInfo(ImGuiStyleVar idx) +{ + return ImGui::GetStyleVarInfo(idx); +} +CIMGUI_API void igLogBegin(ImGuiLogType type,int auto_open_depth) +{ + return ImGui::LogBegin(type,auto_open_depth); +} +CIMGUI_API void igLogToBuffer(int auto_open_depth) +{ + return ImGui::LogToBuffer(auto_open_depth); +} +CIMGUI_API void igLogRenderedText(const ImVec2* ref_pos,const char* text,const char* text_end) +{ + return ImGui::LogRenderedText(ref_pos,text,text_end); +} +CIMGUI_API void igLogSetNextTextDecoration(const char* prefix,const char* suffix) +{ + return ImGui::LogSetNextTextDecoration(prefix,suffix); +} +CIMGUI_API bool igBeginChildEx(const char* name,ImGuiID id,const ImVec2 size_arg,bool border,ImGuiWindowFlags flags) +{ + return ImGui::BeginChildEx(name,id,size_arg,border,flags); +} +CIMGUI_API void igOpenPopupEx(ImGuiID id,ImGuiPopupFlags popup_flags) +{ + return ImGui::OpenPopupEx(id,popup_flags); +} +CIMGUI_API void igClosePopupToLevel(int remaining,bool restore_focus_to_window_under_popup) +{ + return ImGui::ClosePopupToLevel(remaining,restore_focus_to_window_under_popup); +} +CIMGUI_API void igClosePopupsOverWindow(ImGuiWindow* ref_window,bool restore_focus_to_window_under_popup) +{ + return ImGui::ClosePopupsOverWindow(ref_window,restore_focus_to_window_under_popup); +} +CIMGUI_API void igClosePopupsExceptModals() +{ + return ImGui::ClosePopupsExceptModals(); +} +CIMGUI_API bool igIsPopupOpen_ID(ImGuiID id,ImGuiPopupFlags popup_flags) +{ + return ImGui::IsPopupOpen(id,popup_flags); +} +CIMGUI_API bool igBeginPopupEx(ImGuiID id,ImGuiWindowFlags extra_flags) +{ + return ImGui::BeginPopupEx(id,extra_flags); +} +CIMGUI_API bool igBeginTooltipEx(ImGuiTooltipFlags tooltip_flags,ImGuiWindowFlags extra_window_flags) +{ + return ImGui::BeginTooltipEx(tooltip_flags,extra_window_flags); +} +CIMGUI_API void igGetPopupAllowedExtentRect(ImRect *pOut,ImGuiWindow* window) +{ + *pOut = ImGui::GetPopupAllowedExtentRect(window); +} +CIMGUI_API ImGuiWindow* igGetTopMostPopupModal() +{ + return ImGui::GetTopMostPopupModal(); +} +CIMGUI_API ImGuiWindow* igGetTopMostAndVisiblePopupModal() +{ + return ImGui::GetTopMostAndVisiblePopupModal(); +} +CIMGUI_API ImGuiWindow* igFindBlockingModal(ImGuiWindow* window) +{ + return ImGui::FindBlockingModal(window); +} +CIMGUI_API void igFindBestWindowPosForPopup(ImVec2 *pOut,ImGuiWindow* window) +{ + *pOut = ImGui::FindBestWindowPosForPopup(window); +} +CIMGUI_API void igFindBestWindowPosForPopupEx(ImVec2 *pOut,const ImVec2 ref_pos,const ImVec2 size,ImGuiDir* last_dir,const ImRect r_outer,const ImRect r_avoid,ImGuiPopupPositionPolicy policy) +{ + *pOut = ImGui::FindBestWindowPosForPopupEx(ref_pos,size,last_dir,r_outer,r_avoid,policy); +} +CIMGUI_API bool igBeginViewportSideBar(const char* name,ImGuiViewport* viewport,ImGuiDir dir,float size,ImGuiWindowFlags window_flags) +{ + return ImGui::BeginViewportSideBar(name,viewport,dir,size,window_flags); +} +CIMGUI_API bool igBeginMenuEx(const char* label,const char* icon,bool enabled) +{ + return ImGui::BeginMenuEx(label,icon,enabled); +} +CIMGUI_API bool igMenuItemEx(const char* label,const char* icon,const char* shortcut,bool selected,bool enabled) +{ + return ImGui::MenuItemEx(label,icon,shortcut,selected,enabled); +} +CIMGUI_API bool igBeginComboPopup(ImGuiID popup_id,const ImRect bb,ImGuiComboFlags flags) +{ + return ImGui::BeginComboPopup(popup_id,bb,flags); +} +CIMGUI_API bool igBeginComboPreview() +{ + return ImGui::BeginComboPreview(); +} +CIMGUI_API void igEndComboPreview() +{ + return ImGui::EndComboPreview(); +} +CIMGUI_API void igNavInitWindow(ImGuiWindow* window,bool force_reinit) +{ + return ImGui::NavInitWindow(window,force_reinit); +} +CIMGUI_API void igNavInitRequestApplyResult() +{ + return ImGui::NavInitRequestApplyResult(); +} +CIMGUI_API bool igNavMoveRequestButNoResultYet() +{ + return ImGui::NavMoveRequestButNoResultYet(); +} +CIMGUI_API void igNavMoveRequestSubmit(ImGuiDir move_dir,ImGuiDir clip_dir,ImGuiNavMoveFlags move_flags,ImGuiScrollFlags scroll_flags) +{ + return ImGui::NavMoveRequestSubmit(move_dir,clip_dir,move_flags,scroll_flags); +} +CIMGUI_API void igNavMoveRequestForward(ImGuiDir move_dir,ImGuiDir clip_dir,ImGuiNavMoveFlags move_flags,ImGuiScrollFlags scroll_flags) +{ + return ImGui::NavMoveRequestForward(move_dir,clip_dir,move_flags,scroll_flags); +} +CIMGUI_API void igNavMoveRequestResolveWithLastItem(ImGuiNavItemData* result) +{ + return ImGui::NavMoveRequestResolveWithLastItem(result); +} +CIMGUI_API void igNavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result,ImGuiNavTreeNodeData* tree_node_data) +{ + return ImGui::NavMoveRequestResolveWithPastTreeNode(result,tree_node_data); +} +CIMGUI_API void igNavMoveRequestCancel() +{ + return ImGui::NavMoveRequestCancel(); +} +CIMGUI_API void igNavMoveRequestApplyResult() +{ + return ImGui::NavMoveRequestApplyResult(); +} +CIMGUI_API void igNavMoveRequestTryWrapping(ImGuiWindow* window,ImGuiNavMoveFlags move_flags) +{ + return ImGui::NavMoveRequestTryWrapping(window,move_flags); +} +CIMGUI_API void igNavClearPreferredPosForAxis(ImGuiAxis axis) +{ + return ImGui::NavClearPreferredPosForAxis(axis); +} +CIMGUI_API void igNavUpdateCurrentWindowIsScrollPushableX() +{ + return ImGui::NavUpdateCurrentWindowIsScrollPushableX(); +} +CIMGUI_API void igSetNavWindow(ImGuiWindow* window) +{ + return ImGui::SetNavWindow(window); +} +CIMGUI_API void igSetNavID(ImGuiID id,ImGuiNavLayer nav_layer,ImGuiID focus_scope_id,const ImRect rect_rel) +{ + return ImGui::SetNavID(id,nav_layer,focus_scope_id,rect_rel); +} +CIMGUI_API void igFocusItem() +{ + return ImGui::FocusItem(); +} +CIMGUI_API void igActivateItemByID(ImGuiID id) +{ + return ImGui::ActivateItemByID(id); +} +CIMGUI_API bool igIsNamedKey(ImGuiKey key) +{ + return ImGui::IsNamedKey(key); +} +CIMGUI_API bool igIsNamedKeyOrModKey(ImGuiKey key) +{ + return ImGui::IsNamedKeyOrModKey(key); +} +CIMGUI_API bool igIsLegacyKey(ImGuiKey key) +{ + return ImGui::IsLegacyKey(key); +} +CIMGUI_API bool igIsKeyboardKey(ImGuiKey key) +{ + return ImGui::IsKeyboardKey(key); +} +CIMGUI_API bool igIsGamepadKey(ImGuiKey key) +{ + return ImGui::IsGamepadKey(key); +} +CIMGUI_API bool igIsMouseKey(ImGuiKey key) +{ + return ImGui::IsMouseKey(key); +} +CIMGUI_API bool igIsAliasKey(ImGuiKey key) +{ + return ImGui::IsAliasKey(key); +} +CIMGUI_API ImGuiKeyChord igConvertShortcutMod(ImGuiKeyChord key_chord) +{ + return ImGui::ConvertShortcutMod(key_chord); +} +CIMGUI_API ImGuiKey igConvertSingleModFlagToKey(ImGuiContext* ctx,ImGuiKey key) +{ + return ImGui::ConvertSingleModFlagToKey(ctx,key); +} +CIMGUI_API ImGuiKeyData* igGetKeyData_ContextPtr(ImGuiContext* ctx,ImGuiKey key) +{ + return ImGui::GetKeyData(ctx,key); +} +CIMGUI_API ImGuiKeyData* igGetKeyData_Key(ImGuiKey key) +{ + return ImGui::GetKeyData(key); +} +CIMGUI_API void igGetKeyChordName(ImGuiKeyChord key_chord,char* out_buf,int out_buf_size) +{ + return ImGui::GetKeyChordName(key_chord,out_buf,out_buf_size); +} +CIMGUI_API ImGuiKey igMouseButtonToKey(ImGuiMouseButton button) +{ + return ImGui::MouseButtonToKey(button); +} +CIMGUI_API bool igIsMouseDragPastThreshold(ImGuiMouseButton button,float lock_threshold) +{ + return ImGui::IsMouseDragPastThreshold(button,lock_threshold); +} +CIMGUI_API void igGetKeyMagnitude2d(ImVec2 *pOut,ImGuiKey key_left,ImGuiKey key_right,ImGuiKey key_up,ImGuiKey key_down) +{ + *pOut = ImGui::GetKeyMagnitude2d(key_left,key_right,key_up,key_down); +} +CIMGUI_API float igGetNavTweakPressedAmount(ImGuiAxis axis) +{ + return ImGui::GetNavTweakPressedAmount(axis); +} +CIMGUI_API int igCalcTypematicRepeatAmount(float t0,float t1,float repeat_delay,float repeat_rate) +{ + return ImGui::CalcTypematicRepeatAmount(t0,t1,repeat_delay,repeat_rate); +} +CIMGUI_API void igGetTypematicRepeatRate(ImGuiInputFlags flags,float* repeat_delay,float* repeat_rate) +{ + return ImGui::GetTypematicRepeatRate(flags,repeat_delay,repeat_rate); +} +CIMGUI_API void igSetActiveIdUsingAllKeyboardKeys() +{ + return ImGui::SetActiveIdUsingAllKeyboardKeys(); +} +CIMGUI_API bool igIsActiveIdUsingNavDir(ImGuiDir dir) +{ + return ImGui::IsActiveIdUsingNavDir(dir); +} +CIMGUI_API ImGuiID igGetKeyOwner(ImGuiKey key) +{ + return ImGui::GetKeyOwner(key); +} +CIMGUI_API void igSetKeyOwner(ImGuiKey key,ImGuiID owner_id,ImGuiInputFlags flags) +{ + return ImGui::SetKeyOwner(key,owner_id,flags); +} +CIMGUI_API void igSetKeyOwnersForKeyChord(ImGuiKeyChord key,ImGuiID owner_id,ImGuiInputFlags flags) +{ + return ImGui::SetKeyOwnersForKeyChord(key,owner_id,flags); +} +CIMGUI_API void igSetItemKeyOwner(ImGuiKey key,ImGuiInputFlags flags) +{ + return ImGui::SetItemKeyOwner(key,flags); +} +CIMGUI_API bool igTestKeyOwner(ImGuiKey key,ImGuiID owner_id) +{ + return ImGui::TestKeyOwner(key,owner_id); +} +CIMGUI_API ImGuiKeyOwnerData* igGetKeyOwnerData(ImGuiContext* ctx,ImGuiKey key) +{ + return ImGui::GetKeyOwnerData(ctx,key); +} +CIMGUI_API bool igIsKeyDown_ID(ImGuiKey key,ImGuiID owner_id) +{ + return ImGui::IsKeyDown(key,owner_id); +} +CIMGUI_API bool igIsKeyPressed_ID(ImGuiKey key,ImGuiID owner_id,ImGuiInputFlags flags) +{ + return ImGui::IsKeyPressed(key,owner_id,flags); +} +CIMGUI_API bool igIsKeyReleased_ID(ImGuiKey key,ImGuiID owner_id) +{ + return ImGui::IsKeyReleased(key,owner_id); +} +CIMGUI_API bool igIsMouseDown_ID(ImGuiMouseButton button,ImGuiID owner_id) +{ + return ImGui::IsMouseDown(button,owner_id); +} +CIMGUI_API bool igIsMouseClicked_ID(ImGuiMouseButton button,ImGuiID owner_id,ImGuiInputFlags flags) +{ + return ImGui::IsMouseClicked(button,owner_id,flags); +} +CIMGUI_API bool igIsMouseReleased_ID(ImGuiMouseButton button,ImGuiID owner_id) +{ + return ImGui::IsMouseReleased(button,owner_id); +} +CIMGUI_API bool igShortcut(ImGuiKeyChord key_chord,ImGuiID owner_id,ImGuiInputFlags flags) +{ + return ImGui::Shortcut(key_chord,owner_id,flags); +} +CIMGUI_API bool igSetShortcutRouting(ImGuiKeyChord key_chord,ImGuiID owner_id,ImGuiInputFlags flags) +{ + return ImGui::SetShortcutRouting(key_chord,owner_id,flags); +} +CIMGUI_API bool igTestShortcutRouting(ImGuiKeyChord key_chord,ImGuiID owner_id) +{ + return ImGui::TestShortcutRouting(key_chord,owner_id); +} +CIMGUI_API ImGuiKeyRoutingData* igGetShortcutRoutingData(ImGuiKeyChord key_chord) +{ + return ImGui::GetShortcutRoutingData(key_chord); +} +CIMGUI_API void igDockContextInitialize(ImGuiContext* ctx) +{ + return ImGui::DockContextInitialize(ctx); +} +CIMGUI_API void igDockContextShutdown(ImGuiContext* ctx) +{ + return ImGui::DockContextShutdown(ctx); +} +CIMGUI_API void igDockContextClearNodes(ImGuiContext* ctx,ImGuiID root_id,bool clear_settings_refs) +{ + return ImGui::DockContextClearNodes(ctx,root_id,clear_settings_refs); +} +CIMGUI_API void igDockContextRebuildNodes(ImGuiContext* ctx) +{ + return ImGui::DockContextRebuildNodes(ctx); +} +CIMGUI_API void igDockContextNewFrameUpdateUndocking(ImGuiContext* ctx) +{ + return ImGui::DockContextNewFrameUpdateUndocking(ctx); +} +CIMGUI_API void igDockContextNewFrameUpdateDocking(ImGuiContext* ctx) +{ + return ImGui::DockContextNewFrameUpdateDocking(ctx); +} +CIMGUI_API void igDockContextEndFrame(ImGuiContext* ctx) +{ + return ImGui::DockContextEndFrame(ctx); +} +CIMGUI_API ImGuiID igDockContextGenNodeID(ImGuiContext* ctx) +{ + return ImGui::DockContextGenNodeID(ctx); +} +CIMGUI_API void igDockContextQueueDock(ImGuiContext* ctx,ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload,ImGuiDir split_dir,float split_ratio,bool split_outer) +{ + return ImGui::DockContextQueueDock(ctx,target,target_node,payload,split_dir,split_ratio,split_outer); +} +CIMGUI_API void igDockContextQueueUndockWindow(ImGuiContext* ctx,ImGuiWindow* window) +{ + return ImGui::DockContextQueueUndockWindow(ctx,window); +} +CIMGUI_API void igDockContextQueueUndockNode(ImGuiContext* ctx,ImGuiDockNode* node) +{ + return ImGui::DockContextQueueUndockNode(ctx,node); +} +CIMGUI_API void igDockContextProcessUndockWindow(ImGuiContext* ctx,ImGuiWindow* window,bool clear_persistent_docking_ref) +{ + return ImGui::DockContextProcessUndockWindow(ctx,window,clear_persistent_docking_ref); +} +CIMGUI_API void igDockContextProcessUndockNode(ImGuiContext* ctx,ImGuiDockNode* node) +{ + return ImGui::DockContextProcessUndockNode(ctx,node); +} +CIMGUI_API bool igDockContextCalcDropPosForDocking(ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload_window,ImGuiDockNode* payload_node,ImGuiDir split_dir,bool split_outer,ImVec2* out_pos) +{ + return ImGui::DockContextCalcDropPosForDocking(target,target_node,payload_window,payload_node,split_dir,split_outer,out_pos); +} +CIMGUI_API ImGuiDockNode* igDockContextFindNodeByID(ImGuiContext* ctx,ImGuiID id) +{ + return ImGui::DockContextFindNodeByID(ctx,id); +} +CIMGUI_API void igDockNodeWindowMenuHandler_Default(ImGuiContext* ctx,ImGuiDockNode* node,ImGuiTabBar* tab_bar) +{ + return ImGui::DockNodeWindowMenuHandler_Default(ctx,node,tab_bar); +} +CIMGUI_API bool igDockNodeBeginAmendTabBar(ImGuiDockNode* node) +{ + return ImGui::DockNodeBeginAmendTabBar(node); +} +CIMGUI_API void igDockNodeEndAmendTabBar() +{ + return ImGui::DockNodeEndAmendTabBar(); +} +CIMGUI_API ImGuiDockNode* igDockNodeGetRootNode(ImGuiDockNode* node) +{ + return ImGui::DockNodeGetRootNode(node); +} +CIMGUI_API bool igDockNodeIsInHierarchyOf(ImGuiDockNode* node,ImGuiDockNode* parent) +{ + return ImGui::DockNodeIsInHierarchyOf(node,parent); +} +CIMGUI_API int igDockNodeGetDepth(const ImGuiDockNode* node) +{ + return ImGui::DockNodeGetDepth(node); +} +CIMGUI_API ImGuiID igDockNodeGetWindowMenuButtonId(const ImGuiDockNode* node) +{ + return ImGui::DockNodeGetWindowMenuButtonId(node); +} +CIMGUI_API ImGuiDockNode* igGetWindowDockNode() +{ + return ImGui::GetWindowDockNode(); +} +CIMGUI_API bool igGetWindowAlwaysWantOwnTabBar(ImGuiWindow* window) +{ + return ImGui::GetWindowAlwaysWantOwnTabBar(window); +} +CIMGUI_API void igBeginDocked(ImGuiWindow* window,bool* p_open) +{ + return ImGui::BeginDocked(window,p_open); +} +CIMGUI_API void igBeginDockableDragDropSource(ImGuiWindow* window) +{ + return ImGui::BeginDockableDragDropSource(window); +} +CIMGUI_API void igBeginDockableDragDropTarget(ImGuiWindow* window) +{ + return ImGui::BeginDockableDragDropTarget(window); +} +CIMGUI_API void igSetWindowDock(ImGuiWindow* window,ImGuiID dock_id,ImGuiCond cond) +{ + return ImGui::SetWindowDock(window,dock_id,cond); +} +CIMGUI_API void igDockBuilderDockWindow(const char* window_name,ImGuiID node_id) +{ + return ImGui::DockBuilderDockWindow(window_name,node_id); +} +CIMGUI_API ImGuiDockNode* igDockBuilderGetNode(ImGuiID node_id) +{ + return ImGui::DockBuilderGetNode(node_id); +} +CIMGUI_API ImGuiDockNode* igDockBuilderGetCentralNode(ImGuiID node_id) +{ + return ImGui::DockBuilderGetCentralNode(node_id); +} +CIMGUI_API ImGuiID igDockBuilderAddNode(ImGuiID node_id,ImGuiDockNodeFlags flags) +{ + return ImGui::DockBuilderAddNode(node_id,flags); +} +CIMGUI_API void igDockBuilderRemoveNode(ImGuiID node_id) +{ + return ImGui::DockBuilderRemoveNode(node_id); +} +CIMGUI_API void igDockBuilderRemoveNodeDockedWindows(ImGuiID node_id,bool clear_settings_refs) +{ + return ImGui::DockBuilderRemoveNodeDockedWindows(node_id,clear_settings_refs); +} +CIMGUI_API void igDockBuilderRemoveNodeChildNodes(ImGuiID node_id) +{ + return ImGui::DockBuilderRemoveNodeChildNodes(node_id); +} +CIMGUI_API void igDockBuilderSetNodePos(ImGuiID node_id,ImVec2 pos) +{ + return ImGui::DockBuilderSetNodePos(node_id,pos); +} +CIMGUI_API void igDockBuilderSetNodeSize(ImGuiID node_id,ImVec2 size) +{ + return ImGui::DockBuilderSetNodeSize(node_id,size); +} +CIMGUI_API ImGuiID igDockBuilderSplitNode(ImGuiID node_id,ImGuiDir split_dir,float size_ratio_for_node_at_dir,ImGuiID* out_id_at_dir,ImGuiID* out_id_at_opposite_dir) +{ + return ImGui::DockBuilderSplitNode(node_id,split_dir,size_ratio_for_node_at_dir,out_id_at_dir,out_id_at_opposite_dir); +} +CIMGUI_API void igDockBuilderCopyDockSpace(ImGuiID src_dockspace_id,ImGuiID dst_dockspace_id,ImVector_const_charPtr* in_window_remap_pairs) +{ + return ImGui::DockBuilderCopyDockSpace(src_dockspace_id,dst_dockspace_id,in_window_remap_pairs); +} +CIMGUI_API void igDockBuilderCopyNode(ImGuiID src_node_id,ImGuiID dst_node_id,ImVector_ImGuiID* out_node_remap_pairs) +{ + return ImGui::DockBuilderCopyNode(src_node_id,dst_node_id,out_node_remap_pairs); +} +CIMGUI_API void igDockBuilderCopyWindowSettings(const char* src_name,const char* dst_name) +{ + return ImGui::DockBuilderCopyWindowSettings(src_name,dst_name); +} +CIMGUI_API void igDockBuilderFinish(ImGuiID node_id) +{ + return ImGui::DockBuilderFinish(node_id); +} +CIMGUI_API void igPushFocusScope(ImGuiID id) +{ + return ImGui::PushFocusScope(id); +} +CIMGUI_API void igPopFocusScope() +{ + return ImGui::PopFocusScope(); +} +CIMGUI_API ImGuiID igGetCurrentFocusScope() +{ + return ImGui::GetCurrentFocusScope(); +} +CIMGUI_API bool igIsDragDropActive() +{ + return ImGui::IsDragDropActive(); +} +CIMGUI_API bool igBeginDragDropTargetCustom(const ImRect bb,ImGuiID id) +{ + return ImGui::BeginDragDropTargetCustom(bb,id); +} +CIMGUI_API void igClearDragDrop() +{ + return ImGui::ClearDragDrop(); +} +CIMGUI_API bool igIsDragDropPayloadBeingAccepted() +{ + return ImGui::IsDragDropPayloadBeingAccepted(); +} +CIMGUI_API void igRenderDragDropTargetRect(const ImRect bb) +{ + return ImGui::RenderDragDropTargetRect(bb); +} +CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const ImRect clip_rect) +{ + return ImGui::SetWindowClipRectBeforeSetChannel(window,clip_rect); +} +CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiOldColumnFlags flags) +{ + return ImGui::BeginColumns(str_id,count,flags); +} +CIMGUI_API void igEndColumns() +{ + return ImGui::EndColumns(); +} +CIMGUI_API void igPushColumnClipRect(int column_index) +{ + return ImGui::PushColumnClipRect(column_index); +} +CIMGUI_API void igPushColumnsBackground() +{ + return ImGui::PushColumnsBackground(); +} +CIMGUI_API void igPopColumnsBackground() +{ + return ImGui::PopColumnsBackground(); +} +CIMGUI_API ImGuiID igGetColumnsID(const char* str_id,int count) +{ + return ImGui::GetColumnsID(str_id,count); +} +CIMGUI_API ImGuiOldColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id) +{ + return ImGui::FindOrCreateColumns(window,id); +} +CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiOldColumns* columns,float offset_norm) +{ + return ImGui::GetColumnOffsetFromNorm(columns,offset_norm); +} +CIMGUI_API float igGetColumnNormFromOffset(const ImGuiOldColumns* columns,float offset) +{ + return ImGui::GetColumnNormFromOffset(columns,offset); +} +CIMGUI_API void igTableOpenContextMenu(int column_n) +{ + return ImGui::TableOpenContextMenu(column_n); +} +CIMGUI_API void igTableSetColumnWidth(int column_n,float width) +{ + return ImGui::TableSetColumnWidth(column_n,width); +} +CIMGUI_API void igTableSetColumnSortDirection(int column_n,ImGuiSortDirection sort_direction,bool append_to_sort_specs) +{ + return ImGui::TableSetColumnSortDirection(column_n,sort_direction,append_to_sort_specs); +} +CIMGUI_API int igTableGetHoveredColumn() +{ + return ImGui::TableGetHoveredColumn(); +} +CIMGUI_API int igTableGetHoveredRow() +{ + return ImGui::TableGetHoveredRow(); +} +CIMGUI_API float igTableGetHeaderRowHeight() +{ + return ImGui::TableGetHeaderRowHeight(); +} +CIMGUI_API void igTablePushBackgroundChannel() +{ + return ImGui::TablePushBackgroundChannel(); +} +CIMGUI_API void igTablePopBackgroundChannel() +{ + return ImGui::TablePopBackgroundChannel(); +} +CIMGUI_API ImGuiTable* igGetCurrentTable() +{ + return ImGui::GetCurrentTable(); +} +CIMGUI_API ImGuiTable* igTableFindByID(ImGuiID id) +{ + return ImGui::TableFindByID(id); +} +CIMGUI_API bool igBeginTableEx(const char* name,ImGuiID id,int columns_count,ImGuiTableFlags flags,const ImVec2 outer_size,float inner_width) +{ + return ImGui::BeginTableEx(name,id,columns_count,flags,outer_size,inner_width); +} +CIMGUI_API void igTableBeginInitMemory(ImGuiTable* table,int columns_count) +{ + return ImGui::TableBeginInitMemory(table,columns_count); +} +CIMGUI_API void igTableBeginApplyRequests(ImGuiTable* table) +{ + return ImGui::TableBeginApplyRequests(table); +} +CIMGUI_API void igTableSetupDrawChannels(ImGuiTable* table) +{ + return ImGui::TableSetupDrawChannels(table); +} +CIMGUI_API void igTableUpdateLayout(ImGuiTable* table) +{ + return ImGui::TableUpdateLayout(table); +} +CIMGUI_API void igTableUpdateBorders(ImGuiTable* table) +{ + return ImGui::TableUpdateBorders(table); +} +CIMGUI_API void igTableUpdateColumnsWeightFromWidth(ImGuiTable* table) +{ + return ImGui::TableUpdateColumnsWeightFromWidth(table); +} +CIMGUI_API void igTableDrawBorders(ImGuiTable* table) +{ + return ImGui::TableDrawBorders(table); +} +CIMGUI_API void igTableDrawContextMenu(ImGuiTable* table) +{ + return ImGui::TableDrawContextMenu(table); +} +CIMGUI_API bool igTableBeginContextMenuPopup(ImGuiTable* table) +{ + return ImGui::TableBeginContextMenuPopup(table); +} +CIMGUI_API void igTableMergeDrawChannels(ImGuiTable* table) +{ + return ImGui::TableMergeDrawChannels(table); +} +CIMGUI_API ImGuiTableInstanceData* igTableGetInstanceData(ImGuiTable* table,int instance_no) +{ + return ImGui::TableGetInstanceData(table,instance_no); +} +CIMGUI_API ImGuiID igTableGetInstanceID(ImGuiTable* table,int instance_no) +{ + return ImGui::TableGetInstanceID(table,instance_no); +} +CIMGUI_API void igTableSortSpecsSanitize(ImGuiTable* table) +{ + return ImGui::TableSortSpecsSanitize(table); +} +CIMGUI_API void igTableSortSpecsBuild(ImGuiTable* table) +{ + return ImGui::TableSortSpecsBuild(table); +} +CIMGUI_API ImGuiSortDirection igTableGetColumnNextSortDirection(ImGuiTableColumn* column) +{ + return ImGui::TableGetColumnNextSortDirection(column); +} +CIMGUI_API void igTableFixColumnSortDirection(ImGuiTable* table,ImGuiTableColumn* column) +{ + return ImGui::TableFixColumnSortDirection(table,column); +} +CIMGUI_API float igTableGetColumnWidthAuto(ImGuiTable* table,ImGuiTableColumn* column) +{ + return ImGui::TableGetColumnWidthAuto(table,column); +} +CIMGUI_API void igTableBeginRow(ImGuiTable* table) +{ + return ImGui::TableBeginRow(table); +} +CIMGUI_API void igTableEndRow(ImGuiTable* table) +{ + return ImGui::TableEndRow(table); +} +CIMGUI_API void igTableBeginCell(ImGuiTable* table,int column_n) +{ + return ImGui::TableBeginCell(table,column_n); +} +CIMGUI_API void igTableEndCell(ImGuiTable* table) +{ + return ImGui::TableEndCell(table); +} +CIMGUI_API void igTableGetCellBgRect(ImRect *pOut,const ImGuiTable* table,int column_n) +{ + *pOut = ImGui::TableGetCellBgRect(table,column_n); +} +CIMGUI_API const char* igTableGetColumnName_TablePtr(const ImGuiTable* table,int column_n) +{ + return ImGui::TableGetColumnName(table,column_n); +} +CIMGUI_API ImGuiID igTableGetColumnResizeID(ImGuiTable* table,int column_n,int instance_no) +{ + return ImGui::TableGetColumnResizeID(table,column_n,instance_no); +} +CIMGUI_API float igTableGetMaxColumnWidth(const ImGuiTable* table,int column_n) +{ + return ImGui::TableGetMaxColumnWidth(table,column_n); +} +CIMGUI_API void igTableSetColumnWidthAutoSingle(ImGuiTable* table,int column_n) +{ + return ImGui::TableSetColumnWidthAutoSingle(table,column_n); +} +CIMGUI_API void igTableSetColumnWidthAutoAll(ImGuiTable* table) +{ + return ImGui::TableSetColumnWidthAutoAll(table); +} +CIMGUI_API void igTableRemove(ImGuiTable* table) +{ + return ImGui::TableRemove(table); +} +CIMGUI_API void igTableGcCompactTransientBuffers_TablePtr(ImGuiTable* table) +{ + return ImGui::TableGcCompactTransientBuffers(table); +} +CIMGUI_API void igTableGcCompactTransientBuffers_TableTempDataPtr(ImGuiTableTempData* table) +{ + return ImGui::TableGcCompactTransientBuffers(table); +} +CIMGUI_API void igTableGcCompactSettings() +{ + return ImGui::TableGcCompactSettings(); +} +CIMGUI_API void igTableLoadSettings(ImGuiTable* table) +{ + return ImGui::TableLoadSettings(table); +} +CIMGUI_API void igTableSaveSettings(ImGuiTable* table) +{ + return ImGui::TableSaveSettings(table); +} +CIMGUI_API void igTableResetSettings(ImGuiTable* table) +{ + return ImGui::TableResetSettings(table); +} +CIMGUI_API ImGuiTableSettings* igTableGetBoundSettings(ImGuiTable* table) +{ + return ImGui::TableGetBoundSettings(table); +} +CIMGUI_API void igTableSettingsAddSettingsHandler() +{ + return ImGui::TableSettingsAddSettingsHandler(); +} +CIMGUI_API ImGuiTableSettings* igTableSettingsCreate(ImGuiID id,int columns_count) +{ + return ImGui::TableSettingsCreate(id,columns_count); +} +CIMGUI_API ImGuiTableSettings* igTableSettingsFindByID(ImGuiID id) +{ + return ImGui::TableSettingsFindByID(id); +} +CIMGUI_API ImGuiTabBar* igGetCurrentTabBar() +{ + return ImGui::GetCurrentTabBar(); +} +CIMGUI_API bool igBeginTabBarEx(ImGuiTabBar* tab_bar,const ImRect bb,ImGuiTabBarFlags flags,ImGuiDockNode* dock_node) +{ + return ImGui::BeginTabBarEx(tab_bar,bb,flags,dock_node); +} +CIMGUI_API ImGuiTabItem* igTabBarFindTabByID(ImGuiTabBar* tab_bar,ImGuiID tab_id) +{ + return ImGui::TabBarFindTabByID(tab_bar,tab_id); +} +CIMGUI_API ImGuiTabItem* igTabBarFindTabByOrder(ImGuiTabBar* tab_bar,int order) +{ + return ImGui::TabBarFindTabByOrder(tab_bar,order); +} +CIMGUI_API ImGuiTabItem* igTabBarFindMostRecentlySelectedTabForActiveWindow(ImGuiTabBar* tab_bar) +{ + return ImGui::TabBarFindMostRecentlySelectedTabForActiveWindow(tab_bar); +} +CIMGUI_API ImGuiTabItem* igTabBarGetCurrentTab(ImGuiTabBar* tab_bar) +{ + return ImGui::TabBarGetCurrentTab(tab_bar); +} +CIMGUI_API int igTabBarGetTabOrder(ImGuiTabBar* tab_bar,ImGuiTabItem* tab) +{ + return ImGui::TabBarGetTabOrder(tab_bar,tab); +} +CIMGUI_API const char* igTabBarGetTabName(ImGuiTabBar* tab_bar,ImGuiTabItem* tab) +{ + return ImGui::TabBarGetTabName(tab_bar,tab); +} +CIMGUI_API void igTabBarAddTab(ImGuiTabBar* tab_bar,ImGuiTabItemFlags tab_flags,ImGuiWindow* window) +{ + return ImGui::TabBarAddTab(tab_bar,tab_flags,window); +} +CIMGUI_API void igTabBarRemoveTab(ImGuiTabBar* tab_bar,ImGuiID tab_id) +{ + return ImGui::TabBarRemoveTab(tab_bar,tab_id); +} +CIMGUI_API void igTabBarCloseTab(ImGuiTabBar* tab_bar,ImGuiTabItem* tab) +{ + return ImGui::TabBarCloseTab(tab_bar,tab); +} +CIMGUI_API void igTabBarQueueFocus(ImGuiTabBar* tab_bar,ImGuiTabItem* tab) +{ + return ImGui::TabBarQueueFocus(tab_bar,tab); +} +CIMGUI_API void igTabBarQueueReorder(ImGuiTabBar* tab_bar,ImGuiTabItem* tab,int offset) +{ + return ImGui::TabBarQueueReorder(tab_bar,tab,offset); +} +CIMGUI_API void igTabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar,ImGuiTabItem* tab,ImVec2 mouse_pos) +{ + return ImGui::TabBarQueueReorderFromMousePos(tab_bar,tab,mouse_pos); +} +CIMGUI_API bool igTabBarProcessReorder(ImGuiTabBar* tab_bar) +{ + return ImGui::TabBarProcessReorder(tab_bar); +} +CIMGUI_API bool igTabItemEx(ImGuiTabBar* tab_bar,const char* label,bool* p_open,ImGuiTabItemFlags flags,ImGuiWindow* docked_window) +{ + return ImGui::TabItemEx(tab_bar,label,p_open,flags,docked_window); +} +CIMGUI_API void igTabItemCalcSize_Str(ImVec2 *pOut,const char* label,bool has_close_button_or_unsaved_marker) +{ + *pOut = ImGui::TabItemCalcSize(label,has_close_button_or_unsaved_marker); +} +CIMGUI_API void igTabItemCalcSize_WindowPtr(ImVec2 *pOut,ImGuiWindow* window) +{ + *pOut = ImGui::TabItemCalcSize(window); +} +CIMGUI_API void igTabItemBackground(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImU32 col) +{ + return ImGui::TabItemBackground(draw_list,bb,flags,col); +} +CIMGUI_API void igTabItemLabelAndCloseButton(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImVec2 frame_padding,const char* label,ImGuiID tab_id,ImGuiID close_button_id,bool is_contents_visible,bool* out_just_closed,bool* out_text_clipped) +{ + return ImGui::TabItemLabelAndCloseButton(draw_list,bb,flags,frame_padding,label,tab_id,close_button_id,is_contents_visible,out_just_closed,out_text_clipped); +} +CIMGUI_API void igRenderText(ImVec2 pos,const char* text,const char* text_end,bool hide_text_after_hash) +{ + return ImGui::RenderText(pos,text,text_end,hide_text_after_hash); +} +CIMGUI_API void igRenderTextWrapped(ImVec2 pos,const char* text,const char* text_end,float wrap_width) +{ + return ImGui::RenderTextWrapped(pos,text,text_end,wrap_width); +} +CIMGUI_API void igRenderTextClipped(const ImVec2 pos_min,const ImVec2 pos_max,const char* text,const char* text_end,const ImVec2* text_size_if_known,const ImVec2 align,const ImRect* clip_rect) +{ + return ImGui::RenderTextClipped(pos_min,pos_max,text,text_end,text_size_if_known,align,clip_rect); +} +CIMGUI_API void igRenderTextClippedEx(ImDrawList* draw_list,const ImVec2 pos_min,const ImVec2 pos_max,const char* text,const char* text_end,const ImVec2* text_size_if_known,const ImVec2 align,const ImRect* clip_rect) +{ + return ImGui::RenderTextClippedEx(draw_list,pos_min,pos_max,text,text_end,text_size_if_known,align,clip_rect); +} +CIMGUI_API void igRenderTextEllipsis(ImDrawList* draw_list,const ImVec2 pos_min,const ImVec2 pos_max,float clip_max_x,float ellipsis_max_x,const char* text,const char* text_end,const ImVec2* text_size_if_known) +{ + return ImGui::RenderTextEllipsis(draw_list,pos_min,pos_max,clip_max_x,ellipsis_max_x,text,text_end,text_size_if_known); +} +CIMGUI_API void igRenderFrame(ImVec2 p_min,ImVec2 p_max,ImU32 fill_col,bool border,float rounding) +{ + return ImGui::RenderFrame(p_min,p_max,fill_col,border,rounding); +} +CIMGUI_API void igRenderFrameBorder(ImVec2 p_min,ImVec2 p_max,float rounding) +{ + return ImGui::RenderFrameBorder(p_min,p_max,rounding); +} +CIMGUI_API void igRenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list,ImVec2 p_min,ImVec2 p_max,ImU32 fill_col,float grid_step,ImVec2 grid_off,float rounding,ImDrawFlags flags) +{ + return ImGui::RenderColorRectWithAlphaCheckerboard(draw_list,p_min,p_max,fill_col,grid_step,grid_off,rounding,flags); +} +CIMGUI_API void igRenderNavHighlight(const ImRect bb,ImGuiID id,ImGuiNavHighlightFlags flags) +{ + return ImGui::RenderNavHighlight(bb,id,flags); +} +CIMGUI_API const char* igFindRenderedTextEnd(const char* text,const char* text_end) +{ + return ImGui::FindRenderedTextEnd(text,text_end); +} +CIMGUI_API void igRenderMouseCursor(ImVec2 pos,float scale,ImGuiMouseCursor mouse_cursor,ImU32 col_fill,ImU32 col_border,ImU32 col_shadow) +{ + return ImGui::RenderMouseCursor(pos,scale,mouse_cursor,col_fill,col_border,col_shadow); +} +CIMGUI_API void igRenderArrow(ImDrawList* draw_list,ImVec2 pos,ImU32 col,ImGuiDir dir,float scale) +{ + return ImGui::RenderArrow(draw_list,pos,col,dir,scale); +} +CIMGUI_API void igRenderBullet(ImDrawList* draw_list,ImVec2 pos,ImU32 col) +{ + return ImGui::RenderBullet(draw_list,pos,col); +} +CIMGUI_API void igRenderCheckMark(ImDrawList* draw_list,ImVec2 pos,ImU32 col,float sz) +{ + return ImGui::RenderCheckMark(draw_list,pos,col,sz); +} +CIMGUI_API void igRenderArrowPointingAt(ImDrawList* draw_list,ImVec2 pos,ImVec2 half_sz,ImGuiDir direction,ImU32 col) +{ + return ImGui::RenderArrowPointingAt(draw_list,pos,half_sz,direction,col); +} +CIMGUI_API void igRenderArrowDockMenu(ImDrawList* draw_list,ImVec2 p_min,float sz,ImU32 col) +{ + return ImGui::RenderArrowDockMenu(draw_list,p_min,sz,col); +} +CIMGUI_API void igRenderRectFilledRangeH(ImDrawList* draw_list,const ImRect rect,ImU32 col,float x_start_norm,float x_end_norm,float rounding) +{ + return ImGui::RenderRectFilledRangeH(draw_list,rect,col,x_start_norm,x_end_norm,rounding); +} +CIMGUI_API void igRenderRectFilledWithHole(ImDrawList* draw_list,const ImRect outer,const ImRect inner,ImU32 col,float rounding) +{ + return ImGui::RenderRectFilledWithHole(draw_list,outer,inner,col,rounding); +} +CIMGUI_API ImDrawFlags igCalcRoundingFlagsForRectInRect(const ImRect r_in,const ImRect r_outer,float threshold) +{ + return ImGui::CalcRoundingFlagsForRectInRect(r_in,r_outer,threshold); +} +CIMGUI_API void igTextEx(const char* text,const char* text_end,ImGuiTextFlags flags) +{ + return ImGui::TextEx(text,text_end,flags); +} +CIMGUI_API bool igButtonEx(const char* label,const ImVec2 size_arg,ImGuiButtonFlags flags) +{ + return ImGui::ButtonEx(label,size_arg,flags); +} +CIMGUI_API bool igArrowButtonEx(const char* str_id,ImGuiDir dir,ImVec2 size_arg,ImGuiButtonFlags flags) +{ + return ImGui::ArrowButtonEx(str_id,dir,size_arg,flags); +} +CIMGUI_API bool igImageButtonEx(ImGuiID id,ImTextureID texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 bg_col,const ImVec4 tint_col,ImGuiButtonFlags flags) +{ + return ImGui::ImageButtonEx(id,texture_id,size,uv0,uv1,bg_col,tint_col,flags); +} +CIMGUI_API void igSeparatorEx(ImGuiSeparatorFlags flags,float thickness) +{ + return ImGui::SeparatorEx(flags,thickness); +} +CIMGUI_API void igSeparatorTextEx(ImGuiID id,const char* label,const char* label_end,float extra_width) +{ + return ImGui::SeparatorTextEx(id,label,label_end,extra_width); +} +CIMGUI_API bool igCheckboxFlags_S64Ptr(const char* label,ImS64* flags,ImS64 flags_value) +{ + return ImGui::CheckboxFlags(label,flags,flags_value); +} +CIMGUI_API bool igCheckboxFlags_U64Ptr(const char* label,ImU64* flags,ImU64 flags_value) +{ + return ImGui::CheckboxFlags(label,flags,flags_value); +} +CIMGUI_API bool igCloseButton(ImGuiID id,const ImVec2 pos) +{ + return ImGui::CloseButton(id,pos); +} +CIMGUI_API bool igCollapseButton(ImGuiID id,const ImVec2 pos,ImGuiDockNode* dock_node) +{ + return ImGui::CollapseButton(id,pos,dock_node); +} +CIMGUI_API void igScrollbar(ImGuiAxis axis) +{ + return ImGui::Scrollbar(axis); +} +CIMGUI_API bool igScrollbarEx(const ImRect bb,ImGuiID id,ImGuiAxis axis,ImS64* p_scroll_v,ImS64 avail_v,ImS64 contents_v,ImDrawFlags flags) +{ + return ImGui::ScrollbarEx(bb,id,axis,p_scroll_v,avail_v,contents_v,flags); +} +CIMGUI_API void igGetWindowScrollbarRect(ImRect *pOut,ImGuiWindow* window,ImGuiAxis axis) +{ + *pOut = ImGui::GetWindowScrollbarRect(window,axis); +} +CIMGUI_API ImGuiID igGetWindowScrollbarID(ImGuiWindow* window,ImGuiAxis axis) +{ + return ImGui::GetWindowScrollbarID(window,axis); +} +CIMGUI_API ImGuiID igGetWindowResizeCornerID(ImGuiWindow* window,int n) +{ + return ImGui::GetWindowResizeCornerID(window,n); +} +CIMGUI_API ImGuiID igGetWindowResizeBorderID(ImGuiWindow* window,ImGuiDir dir) +{ + return ImGui::GetWindowResizeBorderID(window,dir); +} +CIMGUI_API bool igButtonBehavior(const ImRect bb,ImGuiID id,bool* out_hovered,bool* out_held,ImGuiButtonFlags flags) +{ + return ImGui::ButtonBehavior(bb,id,out_hovered,out_held,flags); +} +CIMGUI_API bool igDragBehavior(ImGuiID id,ImGuiDataType data_type,void* p_v,float v_speed,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags) +{ + return ImGui::DragBehavior(id,data_type,p_v,v_speed,p_min,p_max,format,flags); +} +CIMGUI_API bool igSliderBehavior(const ImRect bb,ImGuiID id,ImGuiDataType data_type,void* p_v,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags,ImRect* out_grab_bb) +{ + return ImGui::SliderBehavior(bb,id,data_type,p_v,p_min,p_max,format,flags,out_grab_bb); +} +CIMGUI_API bool igSplitterBehavior(const ImRect bb,ImGuiID id,ImGuiAxis axis,float* size1,float* size2,float min_size1,float min_size2,float hover_extend,float hover_visibility_delay,ImU32 bg_col) +{ + return ImGui::SplitterBehavior(bb,id,axis,size1,size2,min_size1,min_size2,hover_extend,hover_visibility_delay,bg_col); +} +CIMGUI_API bool igTreeNodeBehavior(ImGuiID id,ImGuiTreeNodeFlags flags,const char* label,const char* label_end) +{ + return ImGui::TreeNodeBehavior(id,flags,label,label_end); +} +CIMGUI_API void igTreePushOverrideID(ImGuiID id) +{ + return ImGui::TreePushOverrideID(id); +} +CIMGUI_API void igTreeNodeSetOpen(ImGuiID id,bool open) +{ + return ImGui::TreeNodeSetOpen(id,open); +} +CIMGUI_API bool igTreeNodeUpdateNextOpen(ImGuiID id,ImGuiTreeNodeFlags flags) +{ + return ImGui::TreeNodeUpdateNextOpen(id,flags); +} +CIMGUI_API const ImGuiDataTypeInfo* igDataTypeGetInfo(ImGuiDataType data_type) +{ + return ImGui::DataTypeGetInfo(data_type); +} +CIMGUI_API int igDataTypeFormatString(char* buf,int buf_size,ImGuiDataType data_type,const void* p_data,const char* format) +{ + return ImGui::DataTypeFormatString(buf,buf_size,data_type,p_data,format); +} +CIMGUI_API void igDataTypeApplyOp(ImGuiDataType data_type,int op,void* output,const void* arg_1,const void* arg_2) +{ + return ImGui::DataTypeApplyOp(data_type,op,output,arg_1,arg_2); +} +CIMGUI_API bool igDataTypeApplyFromText(const char* buf,ImGuiDataType data_type,void* p_data,const char* format) +{ + return ImGui::DataTypeApplyFromText(buf,data_type,p_data,format); +} +CIMGUI_API int igDataTypeCompare(ImGuiDataType data_type,const void* arg_1,const void* arg_2) +{ + return ImGui::DataTypeCompare(data_type,arg_1,arg_2); +} +CIMGUI_API bool igDataTypeClamp(ImGuiDataType data_type,void* p_data,const void* p_min,const void* p_max) +{ + return ImGui::DataTypeClamp(data_type,p_data,p_min,p_max); +} +CIMGUI_API bool igInputTextEx(const char* label,const char* hint,char* buf,int buf_size,const ImVec2 size_arg,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data) +{ + return ImGui::InputTextEx(label,hint,buf,buf_size,size_arg,flags,callback,user_data); +} +CIMGUI_API void igInputTextDeactivateHook(ImGuiID id) +{ + return ImGui::InputTextDeactivateHook(id); +} +CIMGUI_API bool igTempInputText(const ImRect bb,ImGuiID id,const char* label,char* buf,int buf_size,ImGuiInputTextFlags flags) +{ + return ImGui::TempInputText(bb,id,label,buf,buf_size,flags); +} +CIMGUI_API bool igTempInputScalar(const ImRect bb,ImGuiID id,const char* label,ImGuiDataType data_type,void* p_data,const char* format,const void* p_clamp_min,const void* p_clamp_max) +{ + return ImGui::TempInputScalar(bb,id,label,data_type,p_data,format,p_clamp_min,p_clamp_max); +} +CIMGUI_API bool igTempInputIsActive(ImGuiID id) +{ + return ImGui::TempInputIsActive(id); +} +CIMGUI_API ImGuiInputTextState* igGetInputTextState(ImGuiID id) +{ + return ImGui::GetInputTextState(id); +} +CIMGUI_API void igColorTooltip(const char* text,const float* col,ImGuiColorEditFlags flags) +{ + return ImGui::ColorTooltip(text,col,flags); +} +CIMGUI_API void igColorEditOptionsPopup(const float* col,ImGuiColorEditFlags flags) +{ + return ImGui::ColorEditOptionsPopup(col,flags); +} +CIMGUI_API void igColorPickerOptionsPopup(const float* ref_col,ImGuiColorEditFlags flags) +{ + return ImGui::ColorPickerOptionsPopup(ref_col,flags); +} +CIMGUI_API int igPlotEx(ImGuiPlotType plot_type,const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,const ImVec2 size_arg) +{ + return ImGui::PlotEx(plot_type,label,values_getter,data,values_count,values_offset,overlay_text,scale_min,scale_max,size_arg); +} +CIMGUI_API void igShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list,int vert_start_idx,int vert_end_idx,ImVec2 gradient_p0,ImVec2 gradient_p1,ImU32 col0,ImU32 col1) +{ + return ImGui::ShadeVertsLinearColorGradientKeepAlpha(draw_list,vert_start_idx,vert_end_idx,gradient_p0,gradient_p1,col0,col1); +} +CIMGUI_API void igShadeVertsLinearUV(ImDrawList* draw_list,int vert_start_idx,int vert_end_idx,const ImVec2 a,const ImVec2 b,const ImVec2 uv_a,const ImVec2 uv_b,bool clamp) +{ + return ImGui::ShadeVertsLinearUV(draw_list,vert_start_idx,vert_end_idx,a,b,uv_a,uv_b,clamp); +} +CIMGUI_API void igGcCompactTransientMiscBuffers() +{ + return ImGui::GcCompactTransientMiscBuffers(); +} +CIMGUI_API void igGcCompactTransientWindowBuffers(ImGuiWindow* window) +{ + return ImGui::GcCompactTransientWindowBuffers(window); +} +CIMGUI_API void igGcAwakeTransientWindowBuffers(ImGuiWindow* window) +{ + return ImGui::GcAwakeTransientWindowBuffers(window); +} +CIMGUI_API void igDebugLog(const char* fmt,...) +{ + va_list args; + va_start(args, fmt); + ImGui::DebugLogV(fmt,args); + va_end(args); +} +CIMGUI_API void igDebugLogV(const char* fmt,va_list args) +{ + return ImGui::DebugLogV(fmt,args); +} +CIMGUI_API void igErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback,void* user_data) +{ + return ImGui::ErrorCheckEndFrameRecover(log_callback,user_data); +} +CIMGUI_API void igErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback,void* user_data) +{ + return ImGui::ErrorCheckEndWindowRecover(log_callback,user_data); +} +CIMGUI_API void igErrorCheckUsingSetCursorPosToExtendParentBoundaries() +{ + return ImGui::ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); +} +CIMGUI_API void igDebugDrawCursorPos(ImU32 col) +{ + return ImGui::DebugDrawCursorPos(col); +} +CIMGUI_API void igDebugDrawLineExtents(ImU32 col) +{ + return ImGui::DebugDrawLineExtents(col); +} +CIMGUI_API void igDebugDrawItemRect(ImU32 col) +{ + return ImGui::DebugDrawItemRect(col); +} +CIMGUI_API void igDebugLocateItem(ImGuiID target_id) +{ + return ImGui::DebugLocateItem(target_id); +} +CIMGUI_API void igDebugLocateItemOnHover(ImGuiID target_id) +{ + return ImGui::DebugLocateItemOnHover(target_id); +} +CIMGUI_API void igDebugLocateItemResolveWithLastItem() +{ + return ImGui::DebugLocateItemResolveWithLastItem(); +} +CIMGUI_API void igDebugStartItemPicker() +{ + return ImGui::DebugStartItemPicker(); +} +CIMGUI_API void igShowFontAtlas(ImFontAtlas* atlas) +{ + return ImGui::ShowFontAtlas(atlas); +} +CIMGUI_API void igDebugHookIdInfo(ImGuiID id,ImGuiDataType data_type,const void* data_id,const void* data_id_end) +{ + return ImGui::DebugHookIdInfo(id,data_type,data_id,data_id_end); +} +CIMGUI_API void igDebugNodeColumns(ImGuiOldColumns* columns) +{ + return ImGui::DebugNodeColumns(columns); +} +CIMGUI_API void igDebugNodeDockNode(ImGuiDockNode* node,const char* label) +{ + return ImGui::DebugNodeDockNode(node,label); +} +CIMGUI_API void igDebugNodeDrawList(ImGuiWindow* window,ImGuiViewportP* viewport,const ImDrawList* draw_list,const char* label) +{ + return ImGui::DebugNodeDrawList(window,viewport,draw_list,label); +} +CIMGUI_API void igDebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list,const ImDrawList* draw_list,const ImDrawCmd* draw_cmd,bool show_mesh,bool show_aabb) +{ + return ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(out_draw_list,draw_list,draw_cmd,show_mesh,show_aabb); +} +CIMGUI_API void igDebugNodeFont(ImFont* font) +{ + return ImGui::DebugNodeFont(font); +} +CIMGUI_API void igDebugNodeFontGlyph(ImFont* font,const ImFontGlyph* glyph) +{ + return ImGui::DebugNodeFontGlyph(font,glyph); +} +CIMGUI_API void igDebugNodeStorage(ImGuiStorage* storage,const char* label) +{ + return ImGui::DebugNodeStorage(storage,label); +} +CIMGUI_API void igDebugNodeTabBar(ImGuiTabBar* tab_bar,const char* label) +{ + return ImGui::DebugNodeTabBar(tab_bar,label); +} +CIMGUI_API void igDebugNodeTable(ImGuiTable* table) +{ + return ImGui::DebugNodeTable(table); +} +CIMGUI_API void igDebugNodeTableSettings(ImGuiTableSettings* settings) +{ + return ImGui::DebugNodeTableSettings(settings); +} +CIMGUI_API void igDebugNodeInputTextState(ImGuiInputTextState* state) +{ + return ImGui::DebugNodeInputTextState(state); +} +CIMGUI_API void igDebugNodeWindow(ImGuiWindow* window,const char* label) +{ + return ImGui::DebugNodeWindow(window,label); +} +CIMGUI_API void igDebugNodeWindowSettings(ImGuiWindowSettings* settings) +{ + return ImGui::DebugNodeWindowSettings(settings); +} +CIMGUI_API void igDebugNodeWindowsList(ImVector_ImGuiWindowPtr* windows,const char* label) +{ + return ImGui::DebugNodeWindowsList(windows,label); +} +CIMGUI_API void igDebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows,int windows_size,ImGuiWindow* parent_in_begin_stack) +{ + return ImGui::DebugNodeWindowsListByBeginStackParent(windows,windows_size,parent_in_begin_stack); +} +CIMGUI_API void igDebugNodeViewport(ImGuiViewportP* viewport) +{ + return ImGui::DebugNodeViewport(viewport); +} +CIMGUI_API void igDebugRenderKeyboardPreview(ImDrawList* draw_list) +{ + return ImGui::DebugRenderKeyboardPreview(draw_list); +} +CIMGUI_API void igDebugRenderViewportThumbnail(ImDrawList* draw_list,ImGuiViewportP* viewport,const ImRect bb) +{ + return ImGui::DebugRenderViewportThumbnail(draw_list,viewport,bb); +} +CIMGUI_API bool igIsKeyPressedMap(ImGuiKey key,bool repeat) +{ + return ImGui::IsKeyPressedMap(key,repeat); +} +CIMGUI_API void igImFontAtlasBuildInit(ImFontAtlas* atlas) +{ + return ImFontAtlasBuildInit(atlas); +} +CIMGUI_API void igImFontAtlasBuildSetupFont(ImFontAtlas* atlas,ImFont* font,ImFontConfig* font_config,float ascent,float descent) +{ + return ImFontAtlasBuildSetupFont(atlas,font,font_config,ascent,descent); +} +CIMGUI_API void igImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas,void* stbrp_context_opaque) +{ + return ImFontAtlasBuildPackCustomRects(atlas,stbrp_context_opaque); +} +CIMGUI_API void igImFontAtlasBuildFinish(ImFontAtlas* atlas) +{ + return ImFontAtlasBuildFinish(atlas); +} +CIMGUI_API void igImFontAtlasBuildRender8bppRectFromString(ImFontAtlas* atlas,int x,int y,int w,int h,const char* in_str,char in_marker_char,unsigned char in_marker_pixel_value) +{ + return ImFontAtlasBuildRender8bppRectFromString(atlas,x,y,w,h,in_str,in_marker_char,in_marker_pixel_value); +} +CIMGUI_API void igImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas,int x,int y,int w,int h,const char* in_str,char in_marker_char,unsigned int in_marker_pixel_value) +{ + return ImFontAtlasBuildRender32bppRectFromString(atlas,x,y,w,h,in_str,in_marker_char,in_marker_pixel_value); +} +CIMGUI_API void igImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256],float in_multiply_factor) +{ + return ImFontAtlasBuildMultiplyCalcLookupTable(out_table,in_multiply_factor); +} +CIMGUI_API void igImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256],unsigned char* pixels,int x,int y,int w,int h,int stride) +{ + return ImFontAtlasBuildMultiplyRectAlpha8(table,pixels,x,y,w,h,stride); +} +CIMGUI_API const ImFontBuilderIO* ImGuiFreeType_GetBuilderForFreeType() +{ + return ImGuiFreeType::GetBuilderForFreeType(); +} +CIMGUI_API void ImGuiFreeType_SetAllocatorFunctions(void*(*alloc_func)(size_t sz,void* user_data),void(*free_func)(void* ptr,void* user_data),void* user_data) +{ + return ImGuiFreeType::SetAllocatorFunctions(alloc_func,free_func,user_data); +} + + + +/////////////////////////////manual written functions +CIMGUI_API void igLogText(CONST char *fmt, ...) +{ + char buffer[256]; + va_list args; + va_start(args, fmt); + vsnprintf(buffer, 256, fmt, args); + va_end(args); + + ImGui::LogText("%s", buffer); +} +CIMGUI_API void ImGuiTextBuffer_appendf(struct ImGuiTextBuffer *buffer, const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + buffer->appendfv(fmt, args); + va_end(args); +} + +CIMGUI_API float igGET_FLT_MAX() +{ + return FLT_MAX; +} + +CIMGUI_API float igGET_FLT_MIN() +{ + return FLT_MIN; +} + + +CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create() +{ + return IM_NEW(ImVector) (); +} + +CIMGUI_API void ImVector_ImWchar_destroy(ImVector_ImWchar* self) +{ + IM_DELETE(self); +} + +CIMGUI_API void ImVector_ImWchar_Init(ImVector_ImWchar* p) +{ + IM_PLACEMENT_NEW(p) ImVector(); +} +CIMGUI_API void ImVector_ImWchar_UnInit(ImVector_ImWchar* p) +{ + p->~ImVector(); +} + + +#ifdef IMGUI_HAS_DOCK + +// NOTE: Some function pointers in the ImGuiPlatformIO structure are not C-compatible because of their +// use of a complex return type. To work around this, we store a custom CimguiStorage object inside +// ImGuiIO::BackendLanguageUserData, which contains C-compatible function pointer variants for these +// functions. When a user function pointer is provided, we hook up the underlying ImGuiPlatformIO +// function pointer to a thunk which accesses the user function pointer through CimguiStorage. + +struct CimguiStorage +{ + void(*Platform_GetWindowPos)(ImGuiViewport* vp, ImVec2* out_pos); + void(*Platform_GetWindowSize)(ImGuiViewport* vp, ImVec2* out_pos); +}; + +// Gets a reference to the CimguiStorage object stored in the current ImGui context's BackendLanguageUserData. +CimguiStorage& GetCimguiStorage() +{ + ImGuiIO& io = ImGui::GetIO(); + if (io.BackendLanguageUserData == NULL) + { + io.BackendLanguageUserData = new CimguiStorage(); + } + + return *(CimguiStorage*)io.BackendLanguageUserData; +} + +// Thunk satisfying the signature of ImGuiPlatformIO::Platform_GetWindowPos. +ImVec2 Platform_GetWindowPos_hook(ImGuiViewport* vp) +{ + ImVec2 pos; + GetCimguiStorage().Platform_GetWindowPos(vp, &pos); + return pos; +}; + +// Fully C-compatible function pointer setter for ImGuiPlatformIO::Platform_GetWindowPos. +CIMGUI_API void ImGuiPlatformIO_Set_Platform_GetWindowPos(ImGuiPlatformIO* platform_io, void(*user_callback)(ImGuiViewport* vp, ImVec2* out_pos)) +{ + CimguiStorage& storage = GetCimguiStorage(); + storage.Platform_GetWindowPos = user_callback; + platform_io->Platform_GetWindowPos = &Platform_GetWindowPos_hook; +} + +// Thunk satisfying the signature of ImGuiPlatformIO::Platform_GetWindowSize. +ImVec2 Platform_GetWindowSize_hook(ImGuiViewport* vp) +{ + ImVec2 size; + GetCimguiStorage().Platform_GetWindowSize(vp, &size); + return size; +}; + +// Fully C-compatible function pointer setter for ImGuiPlatformIO::Platform_GetWindowSize. +CIMGUI_API void ImGuiPlatformIO_Set_Platform_GetWindowSize(ImGuiPlatformIO* platform_io, void(*user_callback)(ImGuiViewport* vp, ImVec2* out_size)) +{ + CimguiStorage& storage = GetCimguiStorage(); + storage.Platform_GetWindowSize = user_callback; + platform_io->Platform_GetWindowSize = &Platform_GetWindowSize_hook; +} + +#endif diff --git a/pkg/cimgui/vendor/cimgui.h b/pkg/cimgui/vendor/cimgui.h new file mode 100644 index 000000000..395e338f3 --- /dev/null +++ b/pkg/cimgui/vendor/cimgui.h @@ -0,0 +1,4577 @@ +//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui +//based on imgui.h file version "1.89.9" 18990 from Dear ImGui https://github.com/ocornut/imgui +//with imgui_internal.h api +//with imgui_freetype.h api +//docking branch +#ifndef CIMGUI_INCLUDED +#define CIMGUI_INCLUDED +#include +#include +#if defined _WIN32 || defined __CYGWIN__ + #ifdef CIMGUI_NO_EXPORT + #define API + #else + #define API __declspec(dllexport) + #endif +#else + #ifdef __GNUC__ + #define API __attribute__((__visibility__("default"))) + #else + #define API + #endif +#endif + +#if defined __cplusplus + #define EXTERN extern "C" +#else + #include + #include + #define EXTERN extern +#endif + +#define CIMGUI_API EXTERN API +#define CONST const + + +#ifdef _MSC_VER +typedef unsigned __int64 ImU64; +#else +//typedef unsigned long long ImU64; +#endif + + +#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS + +typedef struct ImDrawChannel ImDrawChannel; +typedef struct ImDrawCmd ImDrawCmd; +typedef struct ImDrawData ImDrawData; +typedef struct ImDrawList ImDrawList; +typedef struct ImDrawListSharedData ImDrawListSharedData; +typedef struct ImDrawListSplitter ImDrawListSplitter; +typedef struct ImDrawVert ImDrawVert; +typedef struct ImFont ImFont; +typedef struct ImFontAtlas ImFontAtlas; +typedef struct ImFontBuilderIO ImFontBuilderIO; +typedef struct ImFontConfig ImFontConfig; +typedef struct ImFontGlyph ImFontGlyph; +typedef struct ImFontGlyphRangesBuilder ImFontGlyphRangesBuilder; +typedef struct ImColor ImColor; +typedef struct ImGuiContext ImGuiContext; +typedef struct ImGuiIO ImGuiIO; +typedef struct ImGuiInputTextCallbackData ImGuiInputTextCallbackData; +typedef struct ImGuiKeyData ImGuiKeyData; +typedef struct ImGuiListClipper ImGuiListClipper; +typedef struct ImGuiOnceUponAFrame ImGuiOnceUponAFrame; +typedef struct ImGuiPayload ImGuiPayload; +typedef struct ImGuiPlatformIO ImGuiPlatformIO; +typedef struct ImGuiPlatformMonitor ImGuiPlatformMonitor; +typedef struct ImGuiPlatformImeData ImGuiPlatformImeData; +typedef struct ImGuiSizeCallbackData ImGuiSizeCallbackData; +typedef struct ImGuiStorage ImGuiStorage; +typedef struct ImGuiStyle ImGuiStyle; +typedef struct ImGuiTableSortSpecs ImGuiTableSortSpecs; +typedef struct ImGuiTableColumnSortSpecs ImGuiTableColumnSortSpecs; +typedef struct ImGuiTextBuffer ImGuiTextBuffer; +typedef struct ImGuiTextFilter ImGuiTextFilter; +typedef struct ImGuiViewport ImGuiViewport; +typedef struct ImGuiWindowClass ImGuiWindowClass; +typedef struct ImBitVector ImBitVector; +typedef struct ImRect ImRect; +typedef struct ImDrawDataBuilder ImDrawDataBuilder; +typedef struct ImGuiColorMod ImGuiColorMod; +typedef struct ImGuiContextHook ImGuiContextHook; +typedef struct ImGuiDataVarInfo ImGuiDataVarInfo; +typedef struct ImGuiDataTypeInfo ImGuiDataTypeInfo; +typedef struct ImGuiDockContext ImGuiDockContext; +typedef struct ImGuiDockRequest ImGuiDockRequest; +typedef struct ImGuiDockNode ImGuiDockNode; +typedef struct ImGuiDockNodeSettings ImGuiDockNodeSettings; +typedef struct ImGuiGroupData ImGuiGroupData; +typedef struct ImGuiInputTextState ImGuiInputTextState; +typedef struct ImGuiInputTextDeactivateData ImGuiInputTextDeactivateData; +typedef struct ImGuiLastItemData ImGuiLastItemData; +typedef struct ImGuiLocEntry ImGuiLocEntry; +typedef struct ImGuiMenuColumns ImGuiMenuColumns; +typedef struct ImGuiNavItemData ImGuiNavItemData; +typedef struct ImGuiNavTreeNodeData ImGuiNavTreeNodeData; +typedef struct ImGuiMetricsConfig ImGuiMetricsConfig; +typedef struct ImGuiNextWindowData ImGuiNextWindowData; +typedef struct ImGuiNextItemData ImGuiNextItemData; +typedef struct ImGuiOldColumnData ImGuiOldColumnData; +typedef struct ImGuiOldColumns ImGuiOldColumns; +typedef struct ImGuiPopupData ImGuiPopupData; +typedef struct ImGuiSettingsHandler ImGuiSettingsHandler; +typedef struct ImGuiStackSizes ImGuiStackSizes; +typedef struct ImGuiStyleMod ImGuiStyleMod; +typedef struct ImGuiTabBar ImGuiTabBar; +typedef struct ImGuiTabItem ImGuiTabItem; +typedef struct ImGuiTable ImGuiTable; +typedef struct ImGuiTableColumn ImGuiTableColumn; +typedef struct ImGuiTableInstanceData ImGuiTableInstanceData; +typedef struct ImGuiTableTempData ImGuiTableTempData; +typedef struct ImGuiTableSettings ImGuiTableSettings; +typedef struct ImGuiTableColumnsSettings ImGuiTableColumnsSettings; +typedef struct ImGuiWindow ImGuiWindow; +typedef struct ImGuiWindowTempData ImGuiWindowTempData; +typedef struct ImGuiWindowSettings ImGuiWindowSettings; +typedef struct ImVector_const_charPtr {int Size;int Capacity;const char** Data;} ImVector_const_charPtr; + +struct ImDrawChannel; +struct ImDrawCmd; +struct ImDrawData; +struct ImDrawList; +struct ImDrawListSharedData; +struct ImDrawListSplitter; +struct ImDrawVert; +struct ImFont; +struct ImFontAtlas; +struct ImFontBuilderIO; +struct ImFontConfig; +struct ImFontGlyph; +struct ImFontGlyphRangesBuilder; +struct ImColor; +struct ImGuiContext; +struct ImGuiIO; +struct ImGuiInputTextCallbackData; +struct ImGuiKeyData; +struct ImGuiListClipper; +struct ImGuiOnceUponAFrame; +struct ImGuiPayload; +struct ImGuiPlatformIO; +struct ImGuiPlatformMonitor; +struct ImGuiPlatformImeData; +struct ImGuiSizeCallbackData; +struct ImGuiStorage; +struct ImGuiStyle; +struct ImGuiTableSortSpecs; +struct ImGuiTableColumnSortSpecs; +struct ImGuiTextBuffer; +struct ImGuiTextFilter; +struct ImGuiViewport; +struct ImGuiWindowClass; +typedef int ImGuiCol; +typedef int ImGuiCond; +typedef int ImGuiDataType; +typedef int ImGuiDir; +typedef int ImGuiMouseButton; +typedef int ImGuiMouseCursor; +typedef int ImGuiSortDirection; +typedef int ImGuiStyleVar; +typedef int ImGuiTableBgTarget; +typedef int ImDrawFlags; +typedef int ImDrawListFlags; +typedef int ImFontAtlasFlags; +typedef int ImGuiBackendFlags; +typedef int ImGuiButtonFlags; +typedef int ImGuiColorEditFlags; +typedef int ImGuiConfigFlags; +typedef int ImGuiComboFlags; +typedef int ImGuiDockNodeFlags; +typedef int ImGuiDragDropFlags; +typedef int ImGuiFocusedFlags; +typedef int ImGuiHoveredFlags; +typedef int ImGuiInputTextFlags; +typedef int ImGuiKeyChord; +typedef int ImGuiPopupFlags; +typedef int ImGuiSelectableFlags; +typedef int ImGuiSliderFlags; +typedef int ImGuiTabBarFlags; +typedef int ImGuiTabItemFlags; +typedef int ImGuiTableFlags; +typedef int ImGuiTableColumnFlags; +typedef int ImGuiTableRowFlags; +typedef int ImGuiTreeNodeFlags; +typedef int ImGuiViewportFlags; +typedef int ImGuiWindowFlags; +typedef void* ImTextureID; +typedef unsigned short ImDrawIdx; +typedef unsigned int ImGuiID; +typedef signed char ImS8; +typedef unsigned char ImU8; +typedef signed short ImS16; +typedef unsigned short ImU16; +typedef signed int ImS32; +typedef unsigned int ImU32; +typedef signed long long ImS64; +typedef unsigned long long ImU64; +typedef unsigned short ImWchar16; +typedef unsigned int ImWchar32; +typedef ImWchar16 ImWchar; +typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData* data); +typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); +typedef void* (*ImGuiMemAllocFunc)(size_t sz, void* user_data); +typedef void (*ImGuiMemFreeFunc)(void* ptr, void* user_data); +typedef struct ImVec2 ImVec2; +struct ImVec2 +{ + float x, y; +}; +typedef struct ImVec4 ImVec4; +struct ImVec4 +{ + float x, y, z, w; +}; +typedef enum { + ImGuiWindowFlags_None = 0, + ImGuiWindowFlags_NoTitleBar = 1 << 0, + ImGuiWindowFlags_NoResize = 1 << 1, + ImGuiWindowFlags_NoMove = 1 << 2, + ImGuiWindowFlags_NoScrollbar = 1 << 3, + ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, + ImGuiWindowFlags_NoCollapse = 1 << 5, + ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, + ImGuiWindowFlags_NoBackground = 1 << 7, + ImGuiWindowFlags_NoSavedSettings = 1 << 8, + ImGuiWindowFlags_NoMouseInputs = 1 << 9, + ImGuiWindowFlags_MenuBar = 1 << 10, + ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, + ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, + ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, + ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 14, + ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, + ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, + ImGuiWindowFlags_NoNavInputs = 1 << 18, + ImGuiWindowFlags_NoNavFocus = 1 << 19, + ImGuiWindowFlags_UnsavedDocument = 1 << 20, + ImGuiWindowFlags_NoDocking = 1 << 21, + ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, + ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse, + ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, + ImGuiWindowFlags_NavFlattened = 1 << 23, + ImGuiWindowFlags_ChildWindow = 1 << 24, + ImGuiWindowFlags_Tooltip = 1 << 25, + ImGuiWindowFlags_Popup = 1 << 26, + ImGuiWindowFlags_Modal = 1 << 27, + ImGuiWindowFlags_ChildMenu = 1 << 28, + ImGuiWindowFlags_DockNodeHost = 1 << 29, +}ImGuiWindowFlags_; +typedef enum { + ImGuiInputTextFlags_None = 0, + ImGuiInputTextFlags_CharsDecimal = 1 << 0, + ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, + ImGuiInputTextFlags_CharsUppercase = 1 << 2, + ImGuiInputTextFlags_CharsNoBlank = 1 << 3, + ImGuiInputTextFlags_AutoSelectAll = 1 << 4, + ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, + ImGuiInputTextFlags_CallbackCompletion = 1 << 6, + ImGuiInputTextFlags_CallbackHistory = 1 << 7, + ImGuiInputTextFlags_CallbackAlways = 1 << 8, + ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, + ImGuiInputTextFlags_AllowTabInput = 1 << 10, + ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, + ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, + ImGuiInputTextFlags_AlwaysOverwrite = 1 << 13, + ImGuiInputTextFlags_ReadOnly = 1 << 14, + ImGuiInputTextFlags_Password = 1 << 15, + ImGuiInputTextFlags_NoUndoRedo = 1 << 16, + ImGuiInputTextFlags_CharsScientific = 1 << 17, + ImGuiInputTextFlags_CallbackResize = 1 << 18, + ImGuiInputTextFlags_CallbackEdit = 1 << 19, + ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, +}ImGuiInputTextFlags_; +typedef enum { + ImGuiTreeNodeFlags_None = 0, + ImGuiTreeNodeFlags_Selected = 1 << 0, + ImGuiTreeNodeFlags_Framed = 1 << 1, + ImGuiTreeNodeFlags_AllowOverlap = 1 << 2, + ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, + ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, + ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, + ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, + ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, + ImGuiTreeNodeFlags_Leaf = 1 << 8, + ImGuiTreeNodeFlags_Bullet = 1 << 9, + ImGuiTreeNodeFlags_FramePadding = 1 << 10, + ImGuiTreeNodeFlags_SpanAvailWidth = 1 << 11, + ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, + ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, + ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog, +}ImGuiTreeNodeFlags_; +typedef enum { + ImGuiPopupFlags_None = 0, + ImGuiPopupFlags_MouseButtonLeft = 0, + ImGuiPopupFlags_MouseButtonRight = 1, + ImGuiPopupFlags_MouseButtonMiddle = 2, + ImGuiPopupFlags_MouseButtonMask_ = 0x1F, + ImGuiPopupFlags_MouseButtonDefault_ = 1, + ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 5, + ImGuiPopupFlags_NoOpenOverItems = 1 << 6, + ImGuiPopupFlags_AnyPopupId = 1 << 7, + ImGuiPopupFlags_AnyPopupLevel = 1 << 8, + ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel, +}ImGuiPopupFlags_; +typedef enum { + ImGuiSelectableFlags_None = 0, + ImGuiSelectableFlags_DontClosePopups = 1 << 0, + ImGuiSelectableFlags_SpanAllColumns = 1 << 1, + ImGuiSelectableFlags_AllowDoubleClick = 1 << 2, + ImGuiSelectableFlags_Disabled = 1 << 3, + ImGuiSelectableFlags_AllowOverlap = 1 << 4, +}ImGuiSelectableFlags_; +typedef enum { + ImGuiComboFlags_None = 0, + ImGuiComboFlags_PopupAlignLeft = 1 << 0, + ImGuiComboFlags_HeightSmall = 1 << 1, + ImGuiComboFlags_HeightRegular = 1 << 2, + ImGuiComboFlags_HeightLarge = 1 << 3, + ImGuiComboFlags_HeightLargest = 1 << 4, + ImGuiComboFlags_NoArrowButton = 1 << 5, + ImGuiComboFlags_NoPreview = 1 << 6, + ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest, +}ImGuiComboFlags_; +typedef enum { + ImGuiTabBarFlags_None = 0, + ImGuiTabBarFlags_Reorderable = 1 << 0, + ImGuiTabBarFlags_AutoSelectNewTabs = 1 << 1, + ImGuiTabBarFlags_TabListPopupButton = 1 << 2, + ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 3, + ImGuiTabBarFlags_NoTabListScrollingButtons = 1 << 4, + ImGuiTabBarFlags_NoTooltip = 1 << 5, + ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, + ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, + ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll, + ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown, +}ImGuiTabBarFlags_; +typedef enum { + ImGuiTabItemFlags_None = 0, + ImGuiTabItemFlags_UnsavedDocument = 1 << 0, + ImGuiTabItemFlags_SetSelected = 1 << 1, + ImGuiTabItemFlags_NoCloseWithMiddleMouseButton = 1 << 2, + ImGuiTabItemFlags_NoPushId = 1 << 3, + ImGuiTabItemFlags_NoTooltip = 1 << 4, + ImGuiTabItemFlags_NoReorder = 1 << 5, + ImGuiTabItemFlags_Leading = 1 << 6, + ImGuiTabItemFlags_Trailing = 1 << 7, +}ImGuiTabItemFlags_; +typedef enum { + ImGuiTableFlags_None = 0, + ImGuiTableFlags_Resizable = 1 << 0, + ImGuiTableFlags_Reorderable = 1 << 1, + ImGuiTableFlags_Hideable = 1 << 2, + ImGuiTableFlags_Sortable = 1 << 3, + ImGuiTableFlags_NoSavedSettings = 1 << 4, + ImGuiTableFlags_ContextMenuInBody = 1 << 5, + ImGuiTableFlags_RowBg = 1 << 6, + ImGuiTableFlags_BordersInnerH = 1 << 7, + ImGuiTableFlags_BordersOuterH = 1 << 8, + ImGuiTableFlags_BordersInnerV = 1 << 9, + ImGuiTableFlags_BordersOuterV = 1 << 10, + ImGuiTableFlags_BordersH = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH, + ImGuiTableFlags_BordersV = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV, + ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH, + ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH, + ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter, + ImGuiTableFlags_NoBordersInBody = 1 << 11, + ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, + ImGuiTableFlags_SizingFixedFit = 1 << 13, + ImGuiTableFlags_SizingFixedSame = 2 << 13, + ImGuiTableFlags_SizingStretchProp = 3 << 13, + ImGuiTableFlags_SizingStretchSame = 4 << 13, + ImGuiTableFlags_NoHostExtendX = 1 << 16, + ImGuiTableFlags_NoHostExtendY = 1 << 17, + ImGuiTableFlags_NoKeepColumnsVisible = 1 << 18, + ImGuiTableFlags_PreciseWidths = 1 << 19, + ImGuiTableFlags_NoClip = 1 << 20, + ImGuiTableFlags_PadOuterX = 1 << 21, + ImGuiTableFlags_NoPadOuterX = 1 << 22, + ImGuiTableFlags_NoPadInnerX = 1 << 23, + ImGuiTableFlags_ScrollX = 1 << 24, + ImGuiTableFlags_ScrollY = 1 << 25, + ImGuiTableFlags_SortMulti = 1 << 26, + ImGuiTableFlags_SortTristate = 1 << 27, + ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame, +}ImGuiTableFlags_; +typedef enum { + ImGuiTableColumnFlags_None = 0, + ImGuiTableColumnFlags_Disabled = 1 << 0, + ImGuiTableColumnFlags_DefaultHide = 1 << 1, + ImGuiTableColumnFlags_DefaultSort = 1 << 2, + ImGuiTableColumnFlags_WidthStretch = 1 << 3, + ImGuiTableColumnFlags_WidthFixed = 1 << 4, + ImGuiTableColumnFlags_NoResize = 1 << 5, + ImGuiTableColumnFlags_NoReorder = 1 << 6, + ImGuiTableColumnFlags_NoHide = 1 << 7, + ImGuiTableColumnFlags_NoClip = 1 << 8, + ImGuiTableColumnFlags_NoSort = 1 << 9, + ImGuiTableColumnFlags_NoSortAscending = 1 << 10, + ImGuiTableColumnFlags_NoSortDescending = 1 << 11, + ImGuiTableColumnFlags_NoHeaderLabel = 1 << 12, + ImGuiTableColumnFlags_NoHeaderWidth = 1 << 13, + ImGuiTableColumnFlags_PreferSortAscending = 1 << 14, + ImGuiTableColumnFlags_PreferSortDescending = 1 << 15, + ImGuiTableColumnFlags_IndentEnable = 1 << 16, + ImGuiTableColumnFlags_IndentDisable = 1 << 17, + ImGuiTableColumnFlags_IsEnabled = 1 << 24, + ImGuiTableColumnFlags_IsVisible = 1 << 25, + ImGuiTableColumnFlags_IsSorted = 1 << 26, + ImGuiTableColumnFlags_IsHovered = 1 << 27, + ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed, + ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable, + ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered, + ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30, +}ImGuiTableColumnFlags_; +typedef enum { + ImGuiTableRowFlags_None = 0, + ImGuiTableRowFlags_Headers = 1 << 0, +}ImGuiTableRowFlags_; +typedef enum { + ImGuiTableBgTarget_None = 0, + ImGuiTableBgTarget_RowBg0 = 1, + ImGuiTableBgTarget_RowBg1 = 2, + ImGuiTableBgTarget_CellBg = 3, +}ImGuiTableBgTarget_; +typedef enum { + ImGuiFocusedFlags_None = 0, + ImGuiFocusedFlags_ChildWindows = 1 << 0, + ImGuiFocusedFlags_RootWindow = 1 << 1, + ImGuiFocusedFlags_AnyWindow = 1 << 2, + ImGuiFocusedFlags_NoPopupHierarchy = 1 << 3, + ImGuiFocusedFlags_DockHierarchy = 1 << 4, + ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows, +}ImGuiFocusedFlags_; +typedef enum { + ImGuiHoveredFlags_None = 0, + ImGuiHoveredFlags_ChildWindows = 1 << 0, + ImGuiHoveredFlags_RootWindow = 1 << 1, + ImGuiHoveredFlags_AnyWindow = 1 << 2, + ImGuiHoveredFlags_NoPopupHierarchy = 1 << 3, + ImGuiHoveredFlags_DockHierarchy = 1 << 4, + ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 5, + ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 7, + ImGuiHoveredFlags_AllowWhenOverlappedByItem = 1 << 8, + ImGuiHoveredFlags_AllowWhenOverlappedByWindow = 1 << 9, + ImGuiHoveredFlags_AllowWhenDisabled = 1 << 10, + ImGuiHoveredFlags_NoNavOverride = 1 << 11, + ImGuiHoveredFlags_AllowWhenOverlapped = ImGuiHoveredFlags_AllowWhenOverlappedByItem | ImGuiHoveredFlags_AllowWhenOverlappedByWindow, + ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped, + ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows, + ImGuiHoveredFlags_ForTooltip = 1 << 12, + ImGuiHoveredFlags_Stationary = 1 << 13, + ImGuiHoveredFlags_DelayNone = 1 << 14, + ImGuiHoveredFlags_DelayShort = 1 << 15, + ImGuiHoveredFlags_DelayNormal = 1 << 16, + ImGuiHoveredFlags_NoSharedDelay = 1 << 17, +}ImGuiHoveredFlags_; +typedef enum { + ImGuiDockNodeFlags_None = 0, + ImGuiDockNodeFlags_KeepAliveOnly = 1 << 0, + ImGuiDockNodeFlags_NoDockingInCentralNode = 1 << 2, + ImGuiDockNodeFlags_PassthruCentralNode = 1 << 3, + ImGuiDockNodeFlags_NoSplit = 1 << 4, + ImGuiDockNodeFlags_NoResize = 1 << 5, + ImGuiDockNodeFlags_AutoHideTabBar = 1 << 6, +}ImGuiDockNodeFlags_; +typedef enum { + ImGuiDragDropFlags_None = 0, + ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, + ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, + ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, + ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, + ImGuiDragDropFlags_SourceExtern = 1 << 4, + ImGuiDragDropFlags_SourceAutoExpirePayload = 1 << 5, + ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, + ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, + ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, + ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, +}ImGuiDragDropFlags_; +typedef enum { + ImGuiDataType_S8, + ImGuiDataType_U8, + ImGuiDataType_S16, + ImGuiDataType_U16, + ImGuiDataType_S32, + ImGuiDataType_U32, + ImGuiDataType_S64, + ImGuiDataType_U64, + ImGuiDataType_Float, + ImGuiDataType_Double, + ImGuiDataType_COUNT +}ImGuiDataType_; +typedef enum { + ImGuiDir_None = -1, + ImGuiDir_Left = 0, + ImGuiDir_Right = 1, + ImGuiDir_Up = 2, + ImGuiDir_Down = 3, + ImGuiDir_COUNT +}ImGuiDir_; +typedef enum { + ImGuiSortDirection_None = 0, + ImGuiSortDirection_Ascending = 1, + ImGuiSortDirection_Descending = 2 +}ImGuiSortDirection_; +typedef enum { +ImGuiKey_None=0, +ImGuiKey_Tab=512, +ImGuiKey_LeftArrow=513, +ImGuiKey_RightArrow=514, +ImGuiKey_UpArrow=515, +ImGuiKey_DownArrow=516, +ImGuiKey_PageUp=517, +ImGuiKey_PageDown=518, +ImGuiKey_Home=519, +ImGuiKey_End=520, +ImGuiKey_Insert=521, +ImGuiKey_Delete=522, +ImGuiKey_Backspace=523, +ImGuiKey_Space=524, +ImGuiKey_Enter=525, +ImGuiKey_Escape=526, +ImGuiKey_LeftCtrl=527, +ImGuiKey_LeftShift=528, +ImGuiKey_LeftAlt=529, +ImGuiKey_LeftSuper=530, +ImGuiKey_RightCtrl=531, +ImGuiKey_RightShift=532, +ImGuiKey_RightAlt=533, +ImGuiKey_RightSuper=534, +ImGuiKey_Menu=535, +ImGuiKey_0=536, +ImGuiKey_1=537, +ImGuiKey_2=538, +ImGuiKey_3=539, +ImGuiKey_4=540, +ImGuiKey_5=541, +ImGuiKey_6=542, +ImGuiKey_7=543, +ImGuiKey_8=544, +ImGuiKey_9=545, +ImGuiKey_A=546, +ImGuiKey_B=547, +ImGuiKey_C=548, +ImGuiKey_D=549, +ImGuiKey_E=550, +ImGuiKey_F=551, +ImGuiKey_G=552, +ImGuiKey_H=553, +ImGuiKey_I=554, +ImGuiKey_J=555, +ImGuiKey_K=556, +ImGuiKey_L=557, +ImGuiKey_M=558, +ImGuiKey_N=559, +ImGuiKey_O=560, +ImGuiKey_P=561, +ImGuiKey_Q=562, +ImGuiKey_R=563, +ImGuiKey_S=564, +ImGuiKey_T=565, +ImGuiKey_U=566, +ImGuiKey_V=567, +ImGuiKey_W=568, +ImGuiKey_X=569, +ImGuiKey_Y=570, +ImGuiKey_Z=571, +ImGuiKey_F1=572, +ImGuiKey_F2=573, +ImGuiKey_F3=574, +ImGuiKey_F4=575, +ImGuiKey_F5=576, +ImGuiKey_F6=577, +ImGuiKey_F7=578, +ImGuiKey_F8=579, +ImGuiKey_F9=580, +ImGuiKey_F10=581, +ImGuiKey_F11=582, +ImGuiKey_F12=583, +ImGuiKey_Apostrophe=584, +ImGuiKey_Comma=585, +ImGuiKey_Minus=586, +ImGuiKey_Period=587, +ImGuiKey_Slash=588, +ImGuiKey_Semicolon=589, +ImGuiKey_Equal=590, +ImGuiKey_LeftBracket=591, +ImGuiKey_Backslash=592, +ImGuiKey_RightBracket=593, +ImGuiKey_GraveAccent=594, +ImGuiKey_CapsLock=595, +ImGuiKey_ScrollLock=596, +ImGuiKey_NumLock=597, +ImGuiKey_PrintScreen=598, +ImGuiKey_Pause=599, +ImGuiKey_Keypad0=600, +ImGuiKey_Keypad1=601, +ImGuiKey_Keypad2=602, +ImGuiKey_Keypad3=603, +ImGuiKey_Keypad4=604, +ImGuiKey_Keypad5=605, +ImGuiKey_Keypad6=606, +ImGuiKey_Keypad7=607, +ImGuiKey_Keypad8=608, +ImGuiKey_Keypad9=609, +ImGuiKey_KeypadDecimal=610, +ImGuiKey_KeypadDivide=611, +ImGuiKey_KeypadMultiply=612, +ImGuiKey_KeypadSubtract=613, +ImGuiKey_KeypadAdd=614, +ImGuiKey_KeypadEnter=615, +ImGuiKey_KeypadEqual=616, +ImGuiKey_GamepadStart=617, +ImGuiKey_GamepadBack=618, +ImGuiKey_GamepadFaceLeft=619, +ImGuiKey_GamepadFaceRight=620, +ImGuiKey_GamepadFaceUp=621, +ImGuiKey_GamepadFaceDown=622, +ImGuiKey_GamepadDpadLeft=623, +ImGuiKey_GamepadDpadRight=624, +ImGuiKey_GamepadDpadUp=625, +ImGuiKey_GamepadDpadDown=626, +ImGuiKey_GamepadL1=627, +ImGuiKey_GamepadR1=628, +ImGuiKey_GamepadL2=629, +ImGuiKey_GamepadR2=630, +ImGuiKey_GamepadL3=631, +ImGuiKey_GamepadR3=632, +ImGuiKey_GamepadLStickLeft=633, +ImGuiKey_GamepadLStickRight=634, +ImGuiKey_GamepadLStickUp=635, +ImGuiKey_GamepadLStickDown=636, +ImGuiKey_GamepadRStickLeft=637, +ImGuiKey_GamepadRStickRight=638, +ImGuiKey_GamepadRStickUp=639, +ImGuiKey_GamepadRStickDown=640, +ImGuiKey_MouseLeft=641, +ImGuiKey_MouseRight=642, +ImGuiKey_MouseMiddle=643, +ImGuiKey_MouseX1=644, +ImGuiKey_MouseX2=645, +ImGuiKey_MouseWheelX=646, +ImGuiKey_MouseWheelY=647, +ImGuiKey_ReservedForModCtrl=648, +ImGuiKey_ReservedForModShift=649, +ImGuiKey_ReservedForModAlt=650, +ImGuiKey_ReservedForModSuper=651, +ImGuiKey_COUNT=652, +ImGuiMod_None=0, +ImGuiMod_Ctrl=1 << 12, +ImGuiMod_Shift=1 << 13, +ImGuiMod_Alt=1 << 14, +ImGuiMod_Super=1 << 15, +ImGuiMod_Shortcut=1 << 11, +ImGuiMod_Mask_=0xF800, +ImGuiKey_NamedKey_BEGIN=512, +ImGuiKey_NamedKey_END=ImGuiKey_COUNT, +ImGuiKey_NamedKey_COUNT=ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN, +ImGuiKey_KeysData_SIZE=ImGuiKey_COUNT, +ImGuiKey_KeysData_OFFSET=0, +}ImGuiKey; +typedef enum { + ImGuiNavInput_Activate, ImGuiNavInput_Cancel, ImGuiNavInput_Input, ImGuiNavInput_Menu, ImGuiNavInput_DpadLeft, ImGuiNavInput_DpadRight, ImGuiNavInput_DpadUp, ImGuiNavInput_DpadDown, + ImGuiNavInput_LStickLeft, ImGuiNavInput_LStickRight, ImGuiNavInput_LStickUp, ImGuiNavInput_LStickDown, ImGuiNavInput_FocusPrev, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakSlow, ImGuiNavInput_TweakFast, + ImGuiNavInput_COUNT, +}ImGuiNavInput; +typedef enum { + ImGuiConfigFlags_None = 0, + ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, + ImGuiConfigFlags_NavEnableGamepad = 1 << 1, + ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, + ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, + ImGuiConfigFlags_NoMouse = 1 << 4, + ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, + ImGuiConfigFlags_DockingEnable = 1 << 6, + ImGuiConfigFlags_ViewportsEnable = 1 << 10, + ImGuiConfigFlags_DpiEnableScaleViewports= 1 << 14, + ImGuiConfigFlags_DpiEnableScaleFonts = 1 << 15, + ImGuiConfigFlags_IsSRGB = 1 << 20, + ImGuiConfigFlags_IsTouchScreen = 1 << 21, +}ImGuiConfigFlags_; +typedef enum { + ImGuiBackendFlags_None = 0, + ImGuiBackendFlags_HasGamepad = 1 << 0, + ImGuiBackendFlags_HasMouseCursors = 1 << 1, + ImGuiBackendFlags_HasSetMousePos = 1 << 2, + ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3, + ImGuiBackendFlags_PlatformHasViewports = 1 << 10, + ImGuiBackendFlags_HasMouseHoveredViewport=1 << 11, + ImGuiBackendFlags_RendererHasViewports = 1 << 12, +}ImGuiBackendFlags_; +typedef enum { + ImGuiCol_Text, + ImGuiCol_TextDisabled, + ImGuiCol_WindowBg, + ImGuiCol_ChildBg, + ImGuiCol_PopupBg, + ImGuiCol_Border, + ImGuiCol_BorderShadow, + ImGuiCol_FrameBg, + ImGuiCol_FrameBgHovered, + ImGuiCol_FrameBgActive, + ImGuiCol_TitleBg, + ImGuiCol_TitleBgActive, + ImGuiCol_TitleBgCollapsed, + ImGuiCol_MenuBarBg, + ImGuiCol_ScrollbarBg, + ImGuiCol_ScrollbarGrab, + ImGuiCol_ScrollbarGrabHovered, + ImGuiCol_ScrollbarGrabActive, + ImGuiCol_CheckMark, + ImGuiCol_SliderGrab, + ImGuiCol_SliderGrabActive, + ImGuiCol_Button, + ImGuiCol_ButtonHovered, + ImGuiCol_ButtonActive, + ImGuiCol_Header, + ImGuiCol_HeaderHovered, + ImGuiCol_HeaderActive, + ImGuiCol_Separator, + ImGuiCol_SeparatorHovered, + ImGuiCol_SeparatorActive, + ImGuiCol_ResizeGrip, + ImGuiCol_ResizeGripHovered, + ImGuiCol_ResizeGripActive, + ImGuiCol_Tab, + ImGuiCol_TabHovered, + ImGuiCol_TabActive, + ImGuiCol_TabUnfocused, + ImGuiCol_TabUnfocusedActive, + ImGuiCol_DockingPreview, + ImGuiCol_DockingEmptyBg, + ImGuiCol_PlotLines, + ImGuiCol_PlotLinesHovered, + ImGuiCol_PlotHistogram, + ImGuiCol_PlotHistogramHovered, + ImGuiCol_TableHeaderBg, + ImGuiCol_TableBorderStrong, + ImGuiCol_TableBorderLight, + ImGuiCol_TableRowBg, + ImGuiCol_TableRowBgAlt, + ImGuiCol_TextSelectedBg, + ImGuiCol_DragDropTarget, + ImGuiCol_NavHighlight, + ImGuiCol_NavWindowingHighlight, + ImGuiCol_NavWindowingDimBg, + ImGuiCol_ModalWindowDimBg, + ImGuiCol_COUNT +}ImGuiCol_; +typedef enum { + ImGuiStyleVar_Alpha, + ImGuiStyleVar_DisabledAlpha, + ImGuiStyleVar_WindowPadding, + ImGuiStyleVar_WindowRounding, + ImGuiStyleVar_WindowBorderSize, + ImGuiStyleVar_WindowMinSize, + ImGuiStyleVar_WindowTitleAlign, + ImGuiStyleVar_ChildRounding, + ImGuiStyleVar_ChildBorderSize, + ImGuiStyleVar_PopupRounding, + ImGuiStyleVar_PopupBorderSize, + ImGuiStyleVar_FramePadding, + ImGuiStyleVar_FrameRounding, + ImGuiStyleVar_FrameBorderSize, + ImGuiStyleVar_ItemSpacing, + ImGuiStyleVar_ItemInnerSpacing, + ImGuiStyleVar_IndentSpacing, + ImGuiStyleVar_CellPadding, + ImGuiStyleVar_ScrollbarSize, + ImGuiStyleVar_ScrollbarRounding, + ImGuiStyleVar_GrabMinSize, + ImGuiStyleVar_GrabRounding, + ImGuiStyleVar_TabRounding, + ImGuiStyleVar_ButtonTextAlign, + ImGuiStyleVar_SelectableTextAlign, + ImGuiStyleVar_SeparatorTextBorderSize, + ImGuiStyleVar_SeparatorTextAlign, + ImGuiStyleVar_SeparatorTextPadding, + ImGuiStyleVar_DockingSeparatorSize, + ImGuiStyleVar_COUNT +}ImGuiStyleVar_; +typedef enum { + ImGuiButtonFlags_None = 0, + ImGuiButtonFlags_MouseButtonLeft = 1 << 0, + ImGuiButtonFlags_MouseButtonRight = 1 << 1, + ImGuiButtonFlags_MouseButtonMiddle = 1 << 2, + ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle, + ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft, +}ImGuiButtonFlags_; +typedef enum { + ImGuiColorEditFlags_None = 0, + ImGuiColorEditFlags_NoAlpha = 1 << 1, + ImGuiColorEditFlags_NoPicker = 1 << 2, + ImGuiColorEditFlags_NoOptions = 1 << 3, + ImGuiColorEditFlags_NoSmallPreview = 1 << 4, + ImGuiColorEditFlags_NoInputs = 1 << 5, + ImGuiColorEditFlags_NoTooltip = 1 << 6, + ImGuiColorEditFlags_NoLabel = 1 << 7, + ImGuiColorEditFlags_NoSidePreview = 1 << 8, + ImGuiColorEditFlags_NoDragDrop = 1 << 9, + ImGuiColorEditFlags_NoBorder = 1 << 10, + ImGuiColorEditFlags_AlphaBar = 1 << 16, + ImGuiColorEditFlags_AlphaPreview = 1 << 17, + ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 18, + ImGuiColorEditFlags_HDR = 1 << 19, + ImGuiColorEditFlags_DisplayRGB = 1 << 20, + ImGuiColorEditFlags_DisplayHSV = 1 << 21, + ImGuiColorEditFlags_DisplayHex = 1 << 22, + ImGuiColorEditFlags_Uint8 = 1 << 23, + ImGuiColorEditFlags_Float = 1 << 24, + ImGuiColorEditFlags_PickerHueBar = 1 << 25, + ImGuiColorEditFlags_PickerHueWheel = 1 << 26, + ImGuiColorEditFlags_InputRGB = 1 << 27, + ImGuiColorEditFlags_InputHSV = 1 << 28, + ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar, + ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex, + ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float, + ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar, + ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV, +}ImGuiColorEditFlags_; +typedef enum { + ImGuiSliderFlags_None = 0, + ImGuiSliderFlags_AlwaysClamp = 1 << 4, + ImGuiSliderFlags_Logarithmic = 1 << 5, + ImGuiSliderFlags_NoRoundToFormat = 1 << 6, + ImGuiSliderFlags_NoInput = 1 << 7, + ImGuiSliderFlags_InvalidMask_ = 0x7000000F, +}ImGuiSliderFlags_; +typedef enum { + ImGuiMouseButton_Left = 0, + ImGuiMouseButton_Right = 1, + ImGuiMouseButton_Middle = 2, + ImGuiMouseButton_COUNT = 5 +}ImGuiMouseButton_; +typedef enum { + ImGuiMouseCursor_None = -1, + ImGuiMouseCursor_Arrow = 0, + ImGuiMouseCursor_TextInput, + ImGuiMouseCursor_ResizeAll, + ImGuiMouseCursor_ResizeNS, + ImGuiMouseCursor_ResizeEW, + ImGuiMouseCursor_ResizeNESW, + ImGuiMouseCursor_ResizeNWSE, + ImGuiMouseCursor_Hand, + ImGuiMouseCursor_NotAllowed, + ImGuiMouseCursor_COUNT +}ImGuiMouseCursor_; +typedef enum { +ImGuiMouseSource_Mouse=0, +ImGuiMouseSource_TouchScreen=1, +ImGuiMouseSource_Pen=2, +ImGuiMouseSource_COUNT=3, +}ImGuiMouseSource; +typedef enum { + ImGuiCond_None = 0, + ImGuiCond_Always = 1 << 0, + ImGuiCond_Once = 1 << 1, + ImGuiCond_FirstUseEver = 1 << 2, + ImGuiCond_Appearing = 1 << 3, +}ImGuiCond_; +struct ImGuiStyle +{ + float Alpha; + float DisabledAlpha; + ImVec2 WindowPadding; + float WindowRounding; + float WindowBorderSize; + ImVec2 WindowMinSize; + ImVec2 WindowTitleAlign; + ImGuiDir WindowMenuButtonPosition; + float ChildRounding; + float ChildBorderSize; + float PopupRounding; + float PopupBorderSize; + ImVec2 FramePadding; + float FrameRounding; + float FrameBorderSize; + ImVec2 ItemSpacing; + ImVec2 ItemInnerSpacing; + ImVec2 CellPadding; + ImVec2 TouchExtraPadding; + float IndentSpacing; + float ColumnsMinSpacing; + float ScrollbarSize; + float ScrollbarRounding; + float GrabMinSize; + float GrabRounding; + float LogSliderDeadzone; + float TabRounding; + float TabBorderSize; + float TabMinWidthForCloseButton; + ImGuiDir ColorButtonPosition; + ImVec2 ButtonTextAlign; + ImVec2 SelectableTextAlign; + float SeparatorTextBorderSize; + ImVec2 SeparatorTextAlign; + ImVec2 SeparatorTextPadding; + ImVec2 DisplayWindowPadding; + ImVec2 DisplaySafeAreaPadding; + float DockingSeparatorSize; + float MouseCursorScale; + bool AntiAliasedLines; + bool AntiAliasedLinesUseTex; + bool AntiAliasedFill; + float CurveTessellationTol; + float CircleTessellationMaxError; + ImVec4 Colors[ImGuiCol_COUNT]; + float HoverStationaryDelay; + float HoverDelayShort; + float HoverDelayNormal; + ImGuiHoveredFlags HoverFlagsForTooltipMouse; + ImGuiHoveredFlags HoverFlagsForTooltipNav; +}; +struct ImGuiKeyData +{ + bool Down; + float DownDuration; + float DownDurationPrev; + float AnalogValue; +}; +typedef struct ImVector_ImWchar {int Size;int Capacity;ImWchar* Data;} ImVector_ImWchar; + +struct ImGuiIO +{ + ImGuiConfigFlags ConfigFlags; + ImGuiBackendFlags BackendFlags; + ImVec2 DisplaySize; + float DeltaTime; + float IniSavingRate; + const char* IniFilename; + const char* LogFilename; + void* UserData; + ImFontAtlas*Fonts; + float FontGlobalScale; + bool FontAllowUserScaling; + ImFont* FontDefault; + ImVec2 DisplayFramebufferScale; + bool ConfigDockingNoSplit; + bool ConfigDockingWithShift; + bool ConfigDockingAlwaysTabBar; + bool ConfigDockingTransparentPayload; + bool ConfigViewportsNoAutoMerge; + bool ConfigViewportsNoTaskBarIcon; + bool ConfigViewportsNoDecoration; + bool ConfigViewportsNoDefaultParent; + bool MouseDrawCursor; + bool ConfigMacOSXBehaviors; + bool ConfigInputTrickleEventQueue; + bool ConfigInputTextCursorBlink; + bool ConfigInputTextEnterKeepActive; + bool ConfigDragClickToInputText; + bool ConfigWindowsResizeFromEdges; + bool ConfigWindowsMoveFromTitleBarOnly; + float ConfigMemoryCompactTimer; + float MouseDoubleClickTime; + float MouseDoubleClickMaxDist; + float MouseDragThreshold; + float KeyRepeatDelay; + float KeyRepeatRate; + bool ConfigDebugBeginReturnValueOnce; + bool ConfigDebugBeginReturnValueLoop; + bool ConfigDebugIgnoreFocusLoss; + bool ConfigDebugIniSettings; + const char* BackendPlatformName; + const char* BackendRendererName; + void* BackendPlatformUserData; + void* BackendRendererUserData; + void* BackendLanguageUserData; + const char* (*GetClipboardTextFn)(void* user_data); + void (*SetClipboardTextFn)(void* user_data, const char* text); + void* ClipboardUserData; + void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data); + void* _UnusedPadding; + ImWchar PlatformLocaleDecimalPoint; + bool WantCaptureMouse; + bool WantCaptureKeyboard; + bool WantTextInput; + bool WantSetMousePos; + bool WantSaveIniSettings; + bool NavActive; + bool NavVisible; + float Framerate; + int MetricsRenderVertices; + int MetricsRenderIndices; + int MetricsRenderWindows; + int MetricsActiveWindows; + int MetricsActiveAllocations; + ImVec2 MouseDelta; + int KeyMap[ImGuiKey_COUNT]; + bool KeysDown[ImGuiKey_COUNT]; + float NavInputs[ImGuiNavInput_COUNT]; + ImGuiContext* Ctx; + ImVec2 MousePos; + bool MouseDown[5]; + float MouseWheel; + float MouseWheelH; + ImGuiMouseSource MouseSource; + ImGuiID MouseHoveredViewport; + bool KeyCtrl; + bool KeyShift; + bool KeyAlt; + bool KeySuper; + ImGuiKeyChord KeyMods; + ImGuiKeyData KeysData[ImGuiKey_KeysData_SIZE]; + bool WantCaptureMouseUnlessPopupClose; + ImVec2 MousePosPrev; + ImVec2 MouseClickedPos[5]; + double MouseClickedTime[5]; + bool MouseClicked[5]; + bool MouseDoubleClicked[5]; + ImU16 MouseClickedCount[5]; + ImU16 MouseClickedLastCount[5]; + bool MouseReleased[5]; + bool MouseDownOwned[5]; + bool MouseDownOwnedUnlessPopupClose[5]; + bool MouseWheelRequestAxisSwap; + float MouseDownDuration[5]; + float MouseDownDurationPrev[5]; + ImVec2 MouseDragMaxDistanceAbs[5]; + float MouseDragMaxDistanceSqr[5]; + float PenPressure; + bool AppFocusLost; + bool AppAcceptingEvents; + ImS8 BackendUsingLegacyKeyArrays; + bool BackendUsingLegacyNavInputArray; + ImWchar16 InputQueueSurrogate; + ImVector_ImWchar InputQueueCharacters; +}; +struct ImGuiInputTextCallbackData +{ + ImGuiContext* Ctx; + ImGuiInputTextFlags EventFlag; + ImGuiInputTextFlags Flags; + void* UserData; + ImWchar EventChar; + ImGuiKey EventKey; + char* Buf; + int BufTextLen; + int BufSize; + bool BufDirty; + int CursorPos; + int SelectionStart; + int SelectionEnd; +}; +struct ImGuiSizeCallbackData +{ + void* UserData; + ImVec2 Pos; + ImVec2 CurrentSize; + ImVec2 DesiredSize; +}; +struct ImGuiWindowClass +{ + ImGuiID ClassId; + ImGuiID ParentViewportId; + ImGuiViewportFlags ViewportFlagsOverrideSet; + ImGuiViewportFlags ViewportFlagsOverrideClear; + ImGuiTabItemFlags TabItemFlagsOverrideSet; + ImGuiDockNodeFlags DockNodeFlagsOverrideSet; + bool DockingAlwaysTabBar; + bool DockingAllowUnclassed; +}; +struct ImGuiPayload +{ + void* Data; + int DataSize; + ImGuiID SourceId; + ImGuiID SourceParentId; + int DataFrameCount; + char DataType[32 + 1]; + bool Preview; + bool Delivery; +}; +struct ImGuiTableColumnSortSpecs +{ + ImGuiID ColumnUserID; + ImS16 ColumnIndex; + ImS16 SortOrder; + ImGuiSortDirection SortDirection : 8; +}; +struct ImGuiTableSortSpecs +{ + const ImGuiTableColumnSortSpecs* Specs; + int SpecsCount; + bool SpecsDirty; +}; +struct ImGuiOnceUponAFrame +{ + int RefFrame; +}; +struct ImGuiTextRange +{ + const char* b; + const char* e; +}; +typedef struct ImGuiTextRange ImGuiTextRange; + +typedef struct ImVector_ImGuiTextRange {int Size;int Capacity;ImGuiTextRange* Data;} ImVector_ImGuiTextRange; + +struct ImGuiTextFilter +{ + char InputBuf[256]; + ImVector_ImGuiTextRange Filters; + int CountGrep; +}; +typedef struct ImGuiTextRange ImGuiTextRange; +typedef struct ImVector_char {int Size;int Capacity;char* Data;} ImVector_char; + +struct ImGuiTextBuffer +{ + ImVector_char Buf; +}; +struct ImGuiStoragePair +{ + ImGuiID key; + union { int val_i; float val_f; void* val_p; }; +}; +typedef struct ImGuiStoragePair ImGuiStoragePair; + +typedef struct ImVector_ImGuiStoragePair {int Size;int Capacity;ImGuiStoragePair* Data;} ImVector_ImGuiStoragePair; + +struct ImGuiStorage +{ + ImVector_ImGuiStoragePair Data; +}; +typedef struct ImGuiStoragePair ImGuiStoragePair; +struct ImGuiListClipper +{ + ImGuiContext* Ctx; + int DisplayStart; + int DisplayEnd; + int ItemsCount; + float ItemsHeight; + float StartPosY; + void* TempData; +}; +struct ImColor +{ + ImVec4 Value; +}; +typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd); +struct ImDrawCmd +{ + ImVec4 ClipRect; + ImTextureID TextureId; + unsigned int VtxOffset; + unsigned int IdxOffset; + unsigned int ElemCount; + ImDrawCallback UserCallback; + void* UserCallbackData; +}; +struct ImDrawVert +{ + ImVec2 pos; + ImVec2 uv; + ImU32 col; +}; +typedef struct ImDrawCmdHeader ImDrawCmdHeader; +struct ImDrawCmdHeader +{ + ImVec4 ClipRect; + ImTextureID TextureId; + unsigned int VtxOffset; +}; +typedef struct ImVector_ImDrawCmd {int Size;int Capacity;ImDrawCmd* Data;} ImVector_ImDrawCmd; + +typedef struct ImVector_ImDrawIdx {int Size;int Capacity;ImDrawIdx* Data;} ImVector_ImDrawIdx; + +struct ImDrawChannel +{ + ImVector_ImDrawCmd _CmdBuffer; + ImVector_ImDrawIdx _IdxBuffer; +}; +typedef struct ImVector_ImDrawChannel {int Size;int Capacity;ImDrawChannel* Data;} ImVector_ImDrawChannel; + +struct ImDrawListSplitter +{ + int _Current; + int _Count; + ImVector_ImDrawChannel _Channels; +}; +typedef enum { + ImDrawFlags_None = 0, + ImDrawFlags_Closed = 1 << 0, + ImDrawFlags_RoundCornersTopLeft = 1 << 4, + ImDrawFlags_RoundCornersTopRight = 1 << 5, + ImDrawFlags_RoundCornersBottomLeft = 1 << 6, + ImDrawFlags_RoundCornersBottomRight = 1 << 7, + ImDrawFlags_RoundCornersNone = 1 << 8, + ImDrawFlags_RoundCornersTop = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight, + ImDrawFlags_RoundCornersBottom = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight, + ImDrawFlags_RoundCornersLeft = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersTopLeft, + ImDrawFlags_RoundCornersRight = ImDrawFlags_RoundCornersBottomRight | ImDrawFlags_RoundCornersTopRight, + ImDrawFlags_RoundCornersAll = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight, + ImDrawFlags_RoundCornersDefault_ = ImDrawFlags_RoundCornersAll, + ImDrawFlags_RoundCornersMask_ = ImDrawFlags_RoundCornersAll | ImDrawFlags_RoundCornersNone, +}ImDrawFlags_; +typedef enum { + ImDrawListFlags_None = 0, + ImDrawListFlags_AntiAliasedLines = 1 << 0, + ImDrawListFlags_AntiAliasedLinesUseTex = 1 << 1, + ImDrawListFlags_AntiAliasedFill = 1 << 2, + ImDrawListFlags_AllowVtxOffset = 1 << 3, +}ImDrawListFlags_; +typedef struct ImVector_ImDrawVert {int Size;int Capacity;ImDrawVert* Data;} ImVector_ImDrawVert; + +typedef struct ImVector_ImVec4 {int Size;int Capacity;ImVec4* Data;} ImVector_ImVec4; + +typedef struct ImVector_ImTextureID {int Size;int Capacity;ImTextureID* Data;} ImVector_ImTextureID; + +typedef struct ImVector_ImVec2 {int Size;int Capacity;ImVec2* Data;} ImVector_ImVec2; + +struct ImDrawList +{ + ImVector_ImDrawCmd CmdBuffer; + ImVector_ImDrawIdx IdxBuffer; + ImVector_ImDrawVert VtxBuffer; + ImDrawListFlags Flags; + unsigned int _VtxCurrentIdx; + ImDrawListSharedData* _Data; + const char* _OwnerName; + ImDrawVert* _VtxWritePtr; + ImDrawIdx* _IdxWritePtr; + ImVector_ImVec4 _ClipRectStack; + ImVector_ImTextureID _TextureIdStack; + ImVector_ImVec2 _Path; + ImDrawCmdHeader _CmdHeader; + ImDrawListSplitter _Splitter; + float _FringeScale; +}; +typedef struct ImVector_ImDrawListPtr {int Size;int Capacity;ImDrawList** Data;} ImVector_ImDrawListPtr; + +struct ImDrawData +{ + bool Valid; + int CmdListsCount; + int TotalIdxCount; + int TotalVtxCount; + ImVector_ImDrawListPtr CmdLists; + ImVec2 DisplayPos; + ImVec2 DisplaySize; + ImVec2 FramebufferScale; + ImGuiViewport* OwnerViewport; +}; +struct ImFontConfig +{ + void* FontData; + int FontDataSize; + bool FontDataOwnedByAtlas; + int FontNo; + float SizePixels; + int OversampleH; + int OversampleV; + bool PixelSnapH; + ImVec2 GlyphExtraSpacing; + ImVec2 GlyphOffset; + const ImWchar* GlyphRanges; + float GlyphMinAdvanceX; + float GlyphMaxAdvanceX; + bool MergeMode; + unsigned int FontBuilderFlags; + float RasterizerMultiply; + ImWchar EllipsisChar; + char Name[40]; + ImFont* DstFont; +}; +struct ImFontGlyph +{ + unsigned int Colored : 1; + unsigned int Visible : 1; + unsigned int Codepoint : 30; + float AdvanceX; + float X0, Y0, X1, Y1; + float U0, V0, U1, V1; +}; +typedef struct ImVector_ImU32 {int Size;int Capacity;ImU32* Data;} ImVector_ImU32; + +struct ImFontGlyphRangesBuilder +{ + ImVector_ImU32 UsedChars; +}; +typedef struct ImFontAtlasCustomRect ImFontAtlasCustomRect; +struct ImFontAtlasCustomRect +{ + unsigned short Width, Height; + unsigned short X, Y; + unsigned int GlyphID; + float GlyphAdvanceX; + ImVec2 GlyphOffset; + ImFont* Font; +}; +typedef enum { + ImFontAtlasFlags_None = 0, + ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 0, + ImFontAtlasFlags_NoMouseCursors = 1 << 1, + ImFontAtlasFlags_NoBakedLines = 1 << 2, +}ImFontAtlasFlags_; +typedef struct ImVector_ImFontPtr {int Size;int Capacity;ImFont** Data;} ImVector_ImFontPtr; + +typedef struct ImVector_ImFontAtlasCustomRect {int Size;int Capacity;ImFontAtlasCustomRect* Data;} ImVector_ImFontAtlasCustomRect; + +typedef struct ImVector_ImFontConfig {int Size;int Capacity;ImFontConfig* Data;} ImVector_ImFontConfig; + +struct ImFontAtlas +{ + ImFontAtlasFlags Flags; + ImTextureID TexID; + int TexDesiredWidth; + int TexGlyphPadding; + bool Locked; + void* UserData; + bool TexReady; + bool TexPixelsUseColors; + unsigned char* TexPixelsAlpha8; + unsigned int* TexPixelsRGBA32; + int TexWidth; + int TexHeight; + ImVec2 TexUvScale; + ImVec2 TexUvWhitePixel; + ImVector_ImFontPtr Fonts; + ImVector_ImFontAtlasCustomRect CustomRects; + ImVector_ImFontConfig ConfigData; + ImVec4 TexUvLines[(63) + 1]; + const ImFontBuilderIO* FontBuilderIO; + unsigned int FontBuilderFlags; + int PackIdMouseCursors; + int PackIdLines; +}; +typedef struct ImVector_float {int Size;int Capacity;float* Data;} ImVector_float; + +typedef struct ImVector_ImFontGlyph {int Size;int Capacity;ImFontGlyph* Data;} ImVector_ImFontGlyph; + +struct ImFont +{ + ImVector_float IndexAdvanceX; + float FallbackAdvanceX; + float FontSize; + ImVector_ImWchar IndexLookup; + ImVector_ImFontGlyph Glyphs; + const ImFontGlyph* FallbackGlyph; + ImFontAtlas* ContainerAtlas; + const ImFontConfig* ConfigData; + short ConfigDataCount; + ImWchar FallbackChar; + ImWchar EllipsisChar; + short EllipsisCharCount; + float EllipsisWidth; + float EllipsisCharStep; + bool DirtyLookupTables; + float Scale; + float Ascent, Descent; + int MetricsTotalSurface; + ImU8 Used4kPagesMap[(0xFFFF +1)/4096/8]; +}; +typedef enum { + ImGuiViewportFlags_None = 0, + ImGuiViewportFlags_IsPlatformWindow = 1 << 0, + ImGuiViewportFlags_IsPlatformMonitor = 1 << 1, + ImGuiViewportFlags_OwnedByApp = 1 << 2, + ImGuiViewportFlags_NoDecoration = 1 << 3, + ImGuiViewportFlags_NoTaskBarIcon = 1 << 4, + ImGuiViewportFlags_NoFocusOnAppearing = 1 << 5, + ImGuiViewportFlags_NoFocusOnClick = 1 << 6, + ImGuiViewportFlags_NoInputs = 1 << 7, + ImGuiViewportFlags_NoRendererClear = 1 << 8, + ImGuiViewportFlags_NoAutoMerge = 1 << 9, + ImGuiViewportFlags_TopMost = 1 << 10, + ImGuiViewportFlags_CanHostOtherWindows = 1 << 11, + ImGuiViewportFlags_IsMinimized = 1 << 12, + ImGuiViewportFlags_IsFocused = 1 << 13, +}ImGuiViewportFlags_; +struct ImGuiViewport +{ + ImGuiID ID; + ImGuiViewportFlags Flags; + ImVec2 Pos; + ImVec2 Size; + ImVec2 WorkPos; + ImVec2 WorkSize; + float DpiScale; + ImGuiID ParentViewportId; + ImDrawData* DrawData; + void* RendererUserData; + void* PlatformUserData; + void* PlatformHandle; + void* PlatformHandleRaw; + bool PlatformWindowCreated; + bool PlatformRequestMove; + bool PlatformRequestResize; + bool PlatformRequestClose; +}; +typedef struct ImVector_ImGuiPlatformMonitor {int Size;int Capacity;ImGuiPlatformMonitor* Data;} ImVector_ImGuiPlatformMonitor; + +typedef struct ImVector_ImGuiViewportPtr {int Size;int Capacity;ImGuiViewport** Data;} ImVector_ImGuiViewportPtr; + +struct ImGuiPlatformIO +{ + void (*Platform_CreateWindow)(ImGuiViewport* vp); + void (*Platform_DestroyWindow)(ImGuiViewport* vp); + void (*Platform_ShowWindow)(ImGuiViewport* vp); + void (*Platform_SetWindowPos)(ImGuiViewport* vp, ImVec2 pos); + ImVec2 (*Platform_GetWindowPos)(ImGuiViewport* vp); + void (*Platform_SetWindowSize)(ImGuiViewport* vp, ImVec2 size); + ImVec2 (*Platform_GetWindowSize)(ImGuiViewport* vp); + void (*Platform_SetWindowFocus)(ImGuiViewport* vp); + bool (*Platform_GetWindowFocus)(ImGuiViewport* vp); + bool (*Platform_GetWindowMinimized)(ImGuiViewport* vp); + void (*Platform_SetWindowTitle)(ImGuiViewport* vp, const char* str); + void (*Platform_SetWindowAlpha)(ImGuiViewport* vp, float alpha); + void (*Platform_UpdateWindow)(ImGuiViewport* vp); + void (*Platform_RenderWindow)(ImGuiViewport* vp, void* render_arg); + void (*Platform_SwapBuffers)(ImGuiViewport* vp, void* render_arg); + float (*Platform_GetWindowDpiScale)(ImGuiViewport* vp); + void (*Platform_OnChangedViewport)(ImGuiViewport* vp); + int (*Platform_CreateVkSurface)(ImGuiViewport* vp, ImU64 vk_inst, const void* vk_allocators, ImU64* out_vk_surface); + void (*Renderer_CreateWindow)(ImGuiViewport* vp); + void (*Renderer_DestroyWindow)(ImGuiViewport* vp); + void (*Renderer_SetWindowSize)(ImGuiViewport* vp, ImVec2 size); + void (*Renderer_RenderWindow)(ImGuiViewport* vp, void* render_arg); + void (*Renderer_SwapBuffers)(ImGuiViewport* vp, void* render_arg); + ImVector_ImGuiPlatformMonitor Monitors; + ImVector_ImGuiViewportPtr Viewports; +}; +struct ImGuiPlatformMonitor +{ + ImVec2 MainPos, MainSize; + ImVec2 WorkPos, WorkSize; + float DpiScale; + void* PlatformHandle; +}; +struct ImGuiPlatformImeData +{ + bool WantVisible; + ImVec2 InputPos; + float InputLineHeight; +}; +struct ImBitVector; +struct ImRect; +struct ImDrawDataBuilder; +struct ImDrawListSharedData; +struct ImGuiColorMod; +struct ImGuiContext; +struct ImGuiContextHook; +struct ImGuiDataVarInfo; +struct ImGuiDataTypeInfo; +struct ImGuiDockContext; +struct ImGuiDockRequest; +struct ImGuiDockNode; +struct ImGuiDockNodeSettings; +struct ImGuiGroupData; +struct ImGuiInputTextState; +struct ImGuiInputTextDeactivateData; +struct ImGuiLastItemData; +struct ImGuiLocEntry; +struct ImGuiMenuColumns; +struct ImGuiNavItemData; +struct ImGuiNavTreeNodeData; +struct ImGuiMetricsConfig; +struct ImGuiNextWindowData; +struct ImGuiNextItemData; +struct ImGuiOldColumnData; +struct ImGuiOldColumns; +struct ImGuiPopupData; +struct ImGuiSettingsHandler; +struct ImGuiStackSizes; +struct ImGuiStyleMod; +struct ImGuiTabBar; +struct ImGuiTabItem; +struct ImGuiTable; +struct ImGuiTableColumn; +struct ImGuiTableInstanceData; +struct ImGuiTableTempData; +struct ImGuiTableSettings; +struct ImGuiTableColumnsSettings; +struct ImGuiWindow; +struct ImGuiWindowTempData; +struct ImGuiWindowSettings; +typedef int ImGuiDataAuthority; +typedef int ImGuiLayoutType; +typedef int ImGuiActivateFlags; +typedef int ImGuiDebugLogFlags; +typedef int ImGuiFocusRequestFlags; +typedef int ImGuiInputFlags; +typedef int ImGuiItemFlags; +typedef int ImGuiItemStatusFlags; +typedef int ImGuiOldColumnFlags; +typedef int ImGuiNavHighlightFlags; +typedef int ImGuiNavMoveFlags; +typedef int ImGuiNextItemDataFlags; +typedef int ImGuiNextWindowDataFlags; +typedef int ImGuiScrollFlags; +typedef int ImGuiSeparatorFlags; +typedef int ImGuiTextFlags; +typedef int ImGuiTooltipFlags; +typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...); +extern ImGuiContext* GImGui; +typedef struct StbUndoRecord StbUndoRecord; +struct StbUndoRecord +{ + int where; + int insert_length; + int delete_length; + int char_storage; +}; +typedef struct StbUndoState StbUndoState; +struct StbUndoState +{ + StbUndoRecord undo_rec [99]; + ImWchar undo_char[999]; + short undo_point, redo_point; + int undo_char_point, redo_char_point; +}; +typedef struct STB_TexteditState STB_TexteditState; +struct STB_TexteditState +{ + int cursor; + int select_start; + int select_end; + unsigned char insert_mode; + int row_count_per_page; + unsigned char cursor_at_end_of_line; + unsigned char initialized; + unsigned char has_preferred_x; + unsigned char single_line; + unsigned char padding1, padding2, padding3; + float preferred_x; + StbUndoState undostate; +}; +typedef struct StbTexteditRow StbTexteditRow; +struct StbTexteditRow +{ + float x0,x1; + float baseline_y_delta; + float ymin,ymax; + int num_chars; +}; +typedef FILE* ImFileHandle; +typedef struct ImVec1 ImVec1; +struct ImVec1 +{ + float x; +}; +typedef struct ImVec2ih ImVec2ih; +struct ImVec2ih +{ + short x, y; +}; +struct ImRect +{ + ImVec2 Min; + ImVec2 Max; +}; +typedef ImU32* ImBitArrayPtr; +struct ImBitVector +{ + ImVector_ImU32 Storage; +}; +typedef int ImPoolIdx; +typedef struct ImGuiTextIndex ImGuiTextIndex; +typedef struct ImVector_int {int Size;int Capacity;int* Data;} ImVector_int; + +struct ImGuiTextIndex +{ + ImVector_int LineOffsets; + int EndOffset; +}; +struct ImDrawListSharedData +{ + ImVec2 TexUvWhitePixel; + ImFont* Font; + float FontSize; + float CurveTessellationTol; + float CircleSegmentMaxError; + ImVec4 ClipRectFullscreen; + ImDrawListFlags InitialFlags; + ImVector_ImVec2 TempBuffer; + ImVec2 ArcFastVtx[48]; + float ArcFastRadiusCutoff; + ImU8 CircleSegmentCounts[64]; + const ImVec4* TexUvLines; +}; +struct ImDrawDataBuilder +{ + ImVector_ImDrawListPtr* Layers[2]; + ImVector_ImDrawListPtr LayerData1; +}; +typedef enum { + ImGuiItemFlags_None = 0, + ImGuiItemFlags_NoTabStop = 1 << 0, + ImGuiItemFlags_ButtonRepeat = 1 << 1, + ImGuiItemFlags_Disabled = 1 << 2, + ImGuiItemFlags_NoNav = 1 << 3, + ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, + ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, + ImGuiItemFlags_MixedValue = 1 << 6, + ImGuiItemFlags_ReadOnly = 1 << 7, + ImGuiItemFlags_NoWindowHoverableCheck = 1 << 8, + ImGuiItemFlags_AllowOverlap = 1 << 9, + ImGuiItemFlags_Inputable = 1 << 10, +}ImGuiItemFlags_; +typedef enum { + ImGuiItemStatusFlags_None = 0, + ImGuiItemStatusFlags_HoveredRect = 1 << 0, + ImGuiItemStatusFlags_HasDisplayRect = 1 << 1, + ImGuiItemStatusFlags_Edited = 1 << 2, + ImGuiItemStatusFlags_ToggledSelection = 1 << 3, + ImGuiItemStatusFlags_ToggledOpen = 1 << 4, + ImGuiItemStatusFlags_HasDeactivated = 1 << 5, + ImGuiItemStatusFlags_Deactivated = 1 << 6, + ImGuiItemStatusFlags_HoveredWindow = 1 << 7, + ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, + ImGuiItemStatusFlags_Visible = 1 << 9, +}ImGuiItemStatusFlags_; +typedef enum { + ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay, + ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_DockHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary, + ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_, +}ImGuiHoveredFlagsPrivate_; +typedef enum { + ImGuiInputTextFlags_Multiline = 1 << 26, + ImGuiInputTextFlags_NoMarkEdited = 1 << 27, + ImGuiInputTextFlags_MergedItem = 1 << 28, +}ImGuiInputTextFlagsPrivate_; +typedef enum { + ImGuiButtonFlags_PressedOnClick = 1 << 4, + ImGuiButtonFlags_PressedOnClickRelease = 1 << 5, + ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6, + ImGuiButtonFlags_PressedOnRelease = 1 << 7, + ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8, + ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9, + ImGuiButtonFlags_Repeat = 1 << 10, + ImGuiButtonFlags_FlattenChildren = 1 << 11, + ImGuiButtonFlags_AllowOverlap = 1 << 12, + ImGuiButtonFlags_DontClosePopups = 1 << 13, + ImGuiButtonFlags_AlignTextBaseLine = 1 << 15, + ImGuiButtonFlags_NoKeyModifiers = 1 << 16, + ImGuiButtonFlags_NoHoldingActiveId = 1 << 17, + ImGuiButtonFlags_NoNavFocus = 1 << 18, + ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19, + ImGuiButtonFlags_NoSetKeyOwner = 1 << 20, + ImGuiButtonFlags_NoTestKeyOwner = 1 << 21, + ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold, + ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease, +}ImGuiButtonFlagsPrivate_; +typedef enum { + ImGuiComboFlags_CustomPreview = 1 << 20, +}ImGuiComboFlagsPrivate_; +typedef enum { + ImGuiSliderFlags_Vertical = 1 << 20, + ImGuiSliderFlags_ReadOnly = 1 << 21, +}ImGuiSliderFlagsPrivate_; +typedef enum { + ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20, + ImGuiSelectableFlags_SelectOnNav = 1 << 21, + ImGuiSelectableFlags_SelectOnClick = 1 << 22, + ImGuiSelectableFlags_SelectOnRelease = 1 << 23, + ImGuiSelectableFlags_SpanAvailWidth = 1 << 24, + ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25, + ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26, + ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27, +}ImGuiSelectableFlagsPrivate_; +typedef enum { + ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20, + ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 21, +}ImGuiTreeNodeFlagsPrivate_; +typedef enum { + ImGuiSeparatorFlags_None = 0, + ImGuiSeparatorFlags_Horizontal = 1 << 0, + ImGuiSeparatorFlags_Vertical = 1 << 1, + ImGuiSeparatorFlags_SpanAllColumns = 1 << 2, +}ImGuiSeparatorFlags_; +typedef enum { + ImGuiFocusRequestFlags_None = 0, + ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0, + ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1, +}ImGuiFocusRequestFlags_; +typedef enum { + ImGuiTextFlags_None = 0, + ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0, +}ImGuiTextFlags_; +typedef enum { + ImGuiTooltipFlags_None = 0, + ImGuiTooltipFlags_OverridePrevious = 1 << 1, +}ImGuiTooltipFlags_; +typedef enum { + ImGuiLayoutType_Horizontal = 0, + ImGuiLayoutType_Vertical = 1 +}ImGuiLayoutType_; +typedef enum { + ImGuiLogType_None = 0, + ImGuiLogType_TTY, + ImGuiLogType_File, + ImGuiLogType_Buffer, + ImGuiLogType_Clipboard, +}ImGuiLogType; +typedef enum { + ImGuiAxis_None = -1, + ImGuiAxis_X = 0, + ImGuiAxis_Y = 1 +}ImGuiAxis; +typedef enum { + ImGuiPlotType_Lines, + ImGuiPlotType_Histogram, +}ImGuiPlotType; +typedef enum { + ImGuiPopupPositionPolicy_Default, + ImGuiPopupPositionPolicy_ComboBox, + ImGuiPopupPositionPolicy_Tooltip, +}ImGuiPopupPositionPolicy; +struct ImGuiDataVarInfo +{ + ImGuiDataType Type; + ImU32 Count; + ImU32 Offset; +}; +typedef struct ImGuiDataTypeTempStorage ImGuiDataTypeTempStorage; +struct ImGuiDataTypeTempStorage +{ + ImU8 Data[8]; +}; +struct ImGuiDataTypeInfo +{ + size_t Size; + const char* Name; + const char* PrintFmt; + const char* ScanFmt; +}; +typedef enum { + ImGuiDataType_String = ImGuiDataType_COUNT + 1, + ImGuiDataType_Pointer, + ImGuiDataType_ID, +}ImGuiDataTypePrivate_; +struct ImGuiColorMod +{ + ImGuiCol Col; + ImVec4 BackupValue; +}; +struct ImGuiStyleMod +{ + ImGuiStyleVar VarIdx; + union { int BackupInt[2]; float BackupFloat[2]; }; +}; +typedef struct ImGuiComboPreviewData ImGuiComboPreviewData; +struct ImGuiComboPreviewData +{ + ImRect PreviewRect; + ImVec2 BackupCursorPos; + ImVec2 BackupCursorMaxPos; + ImVec2 BackupCursorPosPrevLine; + float BackupPrevLineTextBaseOffset; + ImGuiLayoutType BackupLayout; +}; +struct ImGuiGroupData +{ + ImGuiID WindowID; + ImVec2 BackupCursorPos; + ImVec2 BackupCursorMaxPos; + ImVec1 BackupIndent; + ImVec1 BackupGroupOffset; + ImVec2 BackupCurrLineSize; + float BackupCurrLineTextBaseOffset; + ImGuiID BackupActiveIdIsAlive; + bool BackupActiveIdPreviousFrameIsAlive; + bool BackupHoveredIdIsAlive; + bool EmitItem; +}; +struct ImGuiMenuColumns +{ + ImU32 TotalWidth; + ImU32 NextTotalWidth; + ImU16 Spacing; + ImU16 OffsetIcon; + ImU16 OffsetLabel; + ImU16 OffsetShortcut; + ImU16 OffsetMark; + ImU16 Widths[4]; +}; +typedef struct ImGuiInputTextDeactivatedState ImGuiInputTextDeactivatedState; +struct ImGuiInputTextDeactivatedState +{ + ImGuiID ID; + ImVector_char TextA; +}; +struct ImGuiInputTextState +{ + ImGuiContext* Ctx; + ImGuiID ID; + int CurLenW, CurLenA; + ImVector_ImWchar TextW; + ImVector_char TextA; + ImVector_char InitialTextA; + bool TextAIsValid; + int BufCapacityA; + float ScrollX; + STB_TexteditState Stb; + float CursorAnim; + bool CursorFollow; + bool SelectedAllMouseLock; + bool Edited; + ImGuiInputTextFlags Flags; +}; +struct ImGuiPopupData +{ + ImGuiID PopupId; + ImGuiWindow* Window; + ImGuiWindow* BackupNavWindow; + int ParentNavLayer; + int OpenFrameCount; + ImGuiID OpenParentId; + ImVec2 OpenPopupPos; + ImVec2 OpenMousePos; +}; +typedef enum { + ImGuiNextWindowDataFlags_None = 0, + ImGuiNextWindowDataFlags_HasPos = 1 << 0, + ImGuiNextWindowDataFlags_HasSize = 1 << 1, + ImGuiNextWindowDataFlags_HasContentSize = 1 << 2, + ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3, + ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4, + ImGuiNextWindowDataFlags_HasFocus = 1 << 5, + ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6, + ImGuiNextWindowDataFlags_HasScroll = 1 << 7, + ImGuiNextWindowDataFlags_HasViewport = 1 << 8, + ImGuiNextWindowDataFlags_HasDock = 1 << 9, + ImGuiNextWindowDataFlags_HasWindowClass = 1 << 10, +}ImGuiNextWindowDataFlags_; +struct ImGuiNextWindowData +{ + ImGuiNextWindowDataFlags Flags; + ImGuiCond PosCond; + ImGuiCond SizeCond; + ImGuiCond CollapsedCond; + ImGuiCond DockCond; + ImVec2 PosVal; + ImVec2 PosPivotVal; + ImVec2 SizeVal; + ImVec2 ContentSizeVal; + ImVec2 ScrollVal; + bool PosUndock; + bool CollapsedVal; + ImRect SizeConstraintRect; + ImGuiSizeCallback SizeCallback; + void* SizeCallbackUserData; + float BgAlphaVal; + ImGuiID ViewportId; + ImGuiID DockId; + ImGuiWindowClass WindowClass; + ImVec2 MenuBarOffsetMinVal; +}; +typedef enum { + ImGuiNextItemDataFlags_None = 0, + ImGuiNextItemDataFlags_HasWidth = 1 << 0, + ImGuiNextItemDataFlags_HasOpen = 1 << 1, +}ImGuiNextItemDataFlags_; +struct ImGuiNextItemData +{ + ImGuiNextItemDataFlags Flags; + ImGuiItemFlags ItemFlags; + float Width; + ImGuiID FocusScopeId; + ImGuiCond OpenCond; + bool OpenVal; +}; +struct ImGuiLastItemData +{ + ImGuiID ID; + ImGuiItemFlags InFlags; + ImGuiItemStatusFlags StatusFlags; + ImRect Rect; + ImRect NavRect; + ImRect DisplayRect; +}; +struct ImGuiNavTreeNodeData +{ + ImGuiID ID; + ImGuiItemFlags InFlags; + ImRect NavRect; +}; +struct ImGuiStackSizes +{ + short SizeOfIDStack; + short SizeOfColorStack; + short SizeOfStyleVarStack; + short SizeOfFontStack; + short SizeOfFocusScopeStack; + short SizeOfGroupStack; + short SizeOfItemFlagsStack; + short SizeOfBeginPopupStack; + short SizeOfDisabledStack; +}; +typedef struct ImGuiWindowStackData ImGuiWindowStackData; +struct ImGuiWindowStackData +{ + ImGuiWindow* Window; + ImGuiLastItemData ParentLastItemDataBackup; + ImGuiStackSizes StackSizesOnBegin; +}; +typedef struct ImGuiShrinkWidthItem ImGuiShrinkWidthItem; +struct ImGuiShrinkWidthItem +{ + int Index; + float Width; + float InitialWidth; +}; +typedef struct ImGuiPtrOrIndex ImGuiPtrOrIndex; +struct ImGuiPtrOrIndex +{ + void* Ptr; + int Index; +}; +typedef struct ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN {ImU32 Storage[(ImGuiKey_NamedKey_COUNT+31)>>5];} ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN; + +typedef ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN ImBitArrayForNamedKeys; +typedef enum { + ImGuiInputEventType_None = 0, + ImGuiInputEventType_MousePos, + ImGuiInputEventType_MouseWheel, + ImGuiInputEventType_MouseButton, + ImGuiInputEventType_MouseViewport, + ImGuiInputEventType_Key, + ImGuiInputEventType_Text, + ImGuiInputEventType_Focus, + ImGuiInputEventType_COUNT +}ImGuiInputEventType; +typedef enum { + ImGuiInputSource_None = 0, + ImGuiInputSource_Mouse, + ImGuiInputSource_Keyboard, + ImGuiInputSource_Gamepad, + ImGuiInputSource_Clipboard, + ImGuiInputSource_COUNT +}ImGuiInputSource; +typedef struct ImGuiInputEventMousePos ImGuiInputEventMousePos; +struct ImGuiInputEventMousePos +{ float PosX, PosY; ImGuiMouseSource MouseSource; +}; +typedef struct ImGuiInputEventMouseWheel ImGuiInputEventMouseWheel; +struct ImGuiInputEventMouseWheel +{ float WheelX, WheelY; ImGuiMouseSource MouseSource; +}; +typedef struct ImGuiInputEventMouseButton ImGuiInputEventMouseButton; +struct ImGuiInputEventMouseButton +{ int Button; bool Down; ImGuiMouseSource MouseSource; +}; +typedef struct ImGuiInputEventMouseViewport ImGuiInputEventMouseViewport; +struct ImGuiInputEventMouseViewport +{ ImGuiID HoveredViewportID; +}; +typedef struct ImGuiInputEventKey ImGuiInputEventKey; +struct ImGuiInputEventKey +{ ImGuiKey Key; bool Down; float AnalogValue; +}; +typedef struct ImGuiInputEventText ImGuiInputEventText; +struct ImGuiInputEventText +{ unsigned int Char; +}; +typedef struct ImGuiInputEventAppFocused ImGuiInputEventAppFocused; +struct ImGuiInputEventAppFocused +{ bool Focused; +}; +typedef struct ImGuiInputEvent ImGuiInputEvent; +struct ImGuiInputEvent +{ + ImGuiInputEventType Type; + ImGuiInputSource Source; + ImU32 EventId; + union + { + ImGuiInputEventMousePos MousePos; + ImGuiInputEventMouseWheel MouseWheel; + ImGuiInputEventMouseButton MouseButton; + ImGuiInputEventMouseViewport MouseViewport; + ImGuiInputEventKey Key; + ImGuiInputEventText Text; + ImGuiInputEventAppFocused AppFocused; + }; + bool AddedByTestEngine; +}; +typedef ImS16 ImGuiKeyRoutingIndex; +typedef struct ImGuiKeyRoutingData ImGuiKeyRoutingData; +struct ImGuiKeyRoutingData +{ + ImGuiKeyRoutingIndex NextEntryIndex; + ImU16 Mods; + ImU8 RoutingNextScore; + ImGuiID RoutingCurr; + ImGuiID RoutingNext; +}; +typedef struct ImGuiKeyRoutingTable ImGuiKeyRoutingTable; +typedef struct ImVector_ImGuiKeyRoutingData {int Size;int Capacity;ImGuiKeyRoutingData* Data;} ImVector_ImGuiKeyRoutingData; + +struct ImGuiKeyRoutingTable +{ + ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT]; + ImVector_ImGuiKeyRoutingData Entries; + ImVector_ImGuiKeyRoutingData EntriesNext; +}; +typedef struct ImGuiKeyOwnerData ImGuiKeyOwnerData; +struct ImGuiKeyOwnerData +{ + ImGuiID OwnerCurr; + ImGuiID OwnerNext; + bool LockThisFrame; + bool LockUntilRelease; +}; +typedef enum { + ImGuiInputFlags_None = 0, + ImGuiInputFlags_Repeat = 1 << 0, + ImGuiInputFlags_RepeatRateDefault = 1 << 1, + ImGuiInputFlags_RepeatRateNavMove = 1 << 2, + ImGuiInputFlags_RepeatRateNavTweak = 1 << 3, + ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak, + ImGuiInputFlags_CondHovered = 1 << 4, + ImGuiInputFlags_CondActive = 1 << 5, + ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive, + ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive, + ImGuiInputFlags_LockThisFrame = 1 << 6, + ImGuiInputFlags_LockUntilRelease = 1 << 7, + ImGuiInputFlags_RouteFocused = 1 << 8, + ImGuiInputFlags_RouteGlobalLow = 1 << 9, + ImGuiInputFlags_RouteGlobal = 1 << 10, + ImGuiInputFlags_RouteGlobalHigh = 1 << 11, + ImGuiInputFlags_RouteMask_ = ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteGlobalLow | ImGuiInputFlags_RouteGlobalHigh, + ImGuiInputFlags_RouteAlways = 1 << 12, + ImGuiInputFlags_RouteUnlessBgFocused= 1 << 13, + ImGuiInputFlags_RouteExtraMask_ = ImGuiInputFlags_RouteAlways | ImGuiInputFlags_RouteUnlessBgFocused, + ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_, + ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RouteMask_ | ImGuiInputFlags_RouteExtraMask_, + ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease, + ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_, +}ImGuiInputFlags_; +typedef struct ImGuiListClipperRange ImGuiListClipperRange; +struct ImGuiListClipperRange +{ + int Min; + int Max; + bool PosToIndexConvert; + ImS8 PosToIndexOffsetMin; + ImS8 PosToIndexOffsetMax; +}; +typedef struct ImGuiListClipperData ImGuiListClipperData; +typedef struct ImVector_ImGuiListClipperRange {int Size;int Capacity;ImGuiListClipperRange* Data;} ImVector_ImGuiListClipperRange; + +struct ImGuiListClipperData +{ + ImGuiListClipper* ListClipper; + float LossynessOffset; + int StepNo; + int ItemsFrozen; + ImVector_ImGuiListClipperRange Ranges; +}; +typedef enum { + ImGuiActivateFlags_None = 0, + ImGuiActivateFlags_PreferInput = 1 << 0, + ImGuiActivateFlags_PreferTweak = 1 << 1, + ImGuiActivateFlags_TryToPreserveState = 1 << 2, +}ImGuiActivateFlags_; +typedef enum { + ImGuiScrollFlags_None = 0, + ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0, + ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1, + ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2, + ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3, + ImGuiScrollFlags_AlwaysCenterX = 1 << 4, + ImGuiScrollFlags_AlwaysCenterY = 1 << 5, + ImGuiScrollFlags_NoScrollParent = 1 << 6, + ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX, + ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY, +}ImGuiScrollFlags_; +typedef enum { + ImGuiNavHighlightFlags_None = 0, + ImGuiNavHighlightFlags_TypeDefault = 1 << 0, + ImGuiNavHighlightFlags_TypeThin = 1 << 1, + ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, + ImGuiNavHighlightFlags_NoRounding = 1 << 3, +}ImGuiNavHighlightFlags_; +typedef enum { + ImGuiNavMoveFlags_None = 0, + ImGuiNavMoveFlags_LoopX = 1 << 0, + ImGuiNavMoveFlags_LoopY = 1 << 1, + ImGuiNavMoveFlags_WrapX = 1 << 2, + ImGuiNavMoveFlags_WrapY = 1 << 3, + ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY, + ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4, + ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5, + ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6, + ImGuiNavMoveFlags_Forwarded = 1 << 7, + ImGuiNavMoveFlags_DebugNoResult = 1 << 8, + ImGuiNavMoveFlags_FocusApi = 1 << 9, + ImGuiNavMoveFlags_IsTabbing = 1 << 10, + ImGuiNavMoveFlags_IsPageMove = 1 << 11, + ImGuiNavMoveFlags_Activate = 1 << 12, + ImGuiNavMoveFlags_NoSelect = 1 << 13, + ImGuiNavMoveFlags_NoSetNavHighlight = 1 << 14, +}ImGuiNavMoveFlags_; +typedef enum { + ImGuiNavLayer_Main = 0, + ImGuiNavLayer_Menu = 1, + ImGuiNavLayer_COUNT +}ImGuiNavLayer; +struct ImGuiNavItemData +{ + ImGuiWindow* Window; + ImGuiID ID; + ImGuiID FocusScopeId; + ImRect RectRel; + ImGuiItemFlags InFlags; + float DistBox; + float DistCenter; + float DistAxial; +}; +typedef enum { + ImGuiOldColumnFlags_None = 0, + ImGuiOldColumnFlags_NoBorder = 1 << 0, + ImGuiOldColumnFlags_NoResize = 1 << 1, + ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2, + ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3, + ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4, +}ImGuiOldColumnFlags_; +struct ImGuiOldColumnData +{ + float OffsetNorm; + float OffsetNormBeforeResize; + ImGuiOldColumnFlags Flags; + ImRect ClipRect; +}; +typedef struct ImVector_ImGuiOldColumnData {int Size;int Capacity;ImGuiOldColumnData* Data;} ImVector_ImGuiOldColumnData; + +struct ImGuiOldColumns +{ + ImGuiID ID; + ImGuiOldColumnFlags Flags; + bool IsFirstFrame; + bool IsBeingResized; + int Current; + int Count; + float OffMinX, OffMaxX; + float LineMinY, LineMaxY; + float HostCursorPosY; + float HostCursorMaxPosX; + ImRect HostInitialClipRect; + ImRect HostBackupClipRect; + ImRect HostBackupParentWorkRect; + ImVector_ImGuiOldColumnData Columns; + ImDrawListSplitter Splitter; +}; +typedef enum { + ImGuiDockNodeFlags_DockSpace = 1 << 10, + ImGuiDockNodeFlags_CentralNode = 1 << 11, + ImGuiDockNodeFlags_NoTabBar = 1 << 12, + ImGuiDockNodeFlags_HiddenTabBar = 1 << 13, + ImGuiDockNodeFlags_NoWindowMenuButton = 1 << 14, + ImGuiDockNodeFlags_NoCloseButton = 1 << 15, + ImGuiDockNodeFlags_NoDocking = 1 << 16, + ImGuiDockNodeFlags_NoDockingSplitMe = 1 << 17, + ImGuiDockNodeFlags_NoDockingSplitOther = 1 << 18, + ImGuiDockNodeFlags_NoDockingOverMe = 1 << 19, + ImGuiDockNodeFlags_NoDockingOverOther = 1 << 20, + ImGuiDockNodeFlags_NoDockingOverEmpty = 1 << 21, + ImGuiDockNodeFlags_NoResizeX = 1 << 22, + ImGuiDockNodeFlags_NoResizeY = 1 << 23, + ImGuiDockNodeFlags_SharedFlagsInheritMask_ = ~0, + ImGuiDockNodeFlags_NoResizeFlagsMask_ = ImGuiDockNodeFlags_NoResize | ImGuiDockNodeFlags_NoResizeX | ImGuiDockNodeFlags_NoResizeY, + ImGuiDockNodeFlags_LocalFlagsMask_ = ImGuiDockNodeFlags_NoSplit | ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_AutoHideTabBar | ImGuiDockNodeFlags_DockSpace | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton | ImGuiDockNodeFlags_NoDocking, + ImGuiDockNodeFlags_LocalFlagsTransferMask_ = ImGuiDockNodeFlags_LocalFlagsMask_ & ~ImGuiDockNodeFlags_DockSpace, + ImGuiDockNodeFlags_SavedFlagsMask_ = ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_DockSpace | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton | ImGuiDockNodeFlags_NoDocking +}ImGuiDockNodeFlagsPrivate_; +typedef enum { + ImGuiDataAuthority_Auto, + ImGuiDataAuthority_DockNode, + ImGuiDataAuthority_Window, +}ImGuiDataAuthority_; +typedef enum { + ImGuiDockNodeState_Unknown, + ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow, + ImGuiDockNodeState_HostWindowHiddenBecauseWindowsAreResizing, + ImGuiDockNodeState_HostWindowVisible, +}ImGuiDockNodeState; +typedef struct ImVector_ImGuiWindowPtr {int Size;int Capacity;ImGuiWindow** Data;} ImVector_ImGuiWindowPtr; + +struct ImGuiDockNode +{ + ImGuiID ID; + ImGuiDockNodeFlags SharedFlags; + ImGuiDockNodeFlags LocalFlags; + ImGuiDockNodeFlags LocalFlagsInWindows; + ImGuiDockNodeFlags MergedFlags; + ImGuiDockNodeState State; + ImGuiDockNode* ParentNode; + ImGuiDockNode* ChildNodes[2]; + ImVector_ImGuiWindowPtr Windows; + ImGuiTabBar* TabBar; + ImVec2 Pos; + ImVec2 Size; + ImVec2 SizeRef; + ImGuiAxis SplitAxis; + ImGuiWindowClass WindowClass; + ImU32 LastBgColor; + ImGuiWindow* HostWindow; + ImGuiWindow* VisibleWindow; + ImGuiDockNode* CentralNode; + ImGuiDockNode* OnlyNodeWithWindows; + int CountNodeWithWindows; + int LastFrameAlive; + int LastFrameActive; + int LastFrameFocused; + ImGuiID LastFocusedNodeId; + ImGuiID SelectedTabId; + ImGuiID WantCloseTabId; + ImGuiID RefViewportId; + ImGuiDataAuthority AuthorityForPos :3; + ImGuiDataAuthority AuthorityForSize :3; + ImGuiDataAuthority AuthorityForViewport :3; + bool IsVisible :1; + bool IsFocused :1; + bool IsBgDrawnThisFrame :1; + bool HasCloseButton :1; + bool HasWindowMenuButton :1; + bool HasCentralNodeChild :1; + bool WantCloseAll :1; + bool WantLockSizeOnce :1; + bool WantMouseMove :1; + bool WantHiddenTabBarUpdate :1; + bool WantHiddenTabBarToggle :1; +}; +typedef enum { + ImGuiWindowDockStyleCol_Text, + ImGuiWindowDockStyleCol_Tab, + ImGuiWindowDockStyleCol_TabHovered, + ImGuiWindowDockStyleCol_TabActive, + ImGuiWindowDockStyleCol_TabUnfocused, + ImGuiWindowDockStyleCol_TabUnfocusedActive, + ImGuiWindowDockStyleCol_COUNT +}ImGuiWindowDockStyleCol; +typedef struct ImGuiWindowDockStyle ImGuiWindowDockStyle; +struct ImGuiWindowDockStyle +{ + ImU32 Colors[ImGuiWindowDockStyleCol_COUNT]; +}; +typedef struct ImVector_ImGuiDockRequest {int Size;int Capacity;ImGuiDockRequest* Data;} ImVector_ImGuiDockRequest; + +typedef struct ImVector_ImGuiDockNodeSettings {int Size;int Capacity;ImGuiDockNodeSettings* Data;} ImVector_ImGuiDockNodeSettings; + +struct ImGuiDockContext +{ + ImGuiStorage Nodes; + ImVector_ImGuiDockRequest Requests; + ImVector_ImGuiDockNodeSettings NodesSettings; + bool WantFullRebuild; +}; +typedef struct ImGuiViewportP ImGuiViewportP; +struct ImGuiViewportP +{ + ImGuiViewport _ImGuiViewport; + ImGuiWindow* Window; + int Idx; + int LastFrameActive; + int LastFocusedStampCount; + ImGuiID LastNameHash; + ImVec2 LastPos; + float Alpha; + float LastAlpha; + bool LastFocusedHadNavWindow; + short PlatformMonitor; + int BgFgDrawListsLastFrame[2]; + ImDrawList* BgFgDrawLists[2]; + ImDrawData DrawDataP; + ImDrawDataBuilder DrawDataBuilder; + ImVec2 LastPlatformPos; + ImVec2 LastPlatformSize; + ImVec2 LastRendererSize; + ImVec2 WorkOffsetMin; + ImVec2 WorkOffsetMax; + ImVec2 BuildWorkOffsetMin; + ImVec2 BuildWorkOffsetMax; +}; +struct ImGuiWindowSettings +{ + ImGuiID ID; + ImVec2ih Pos; + ImVec2ih Size; + ImVec2ih ViewportPos; + ImGuiID ViewportId; + ImGuiID DockId; + ImGuiID ClassId; + short DockOrder; + bool Collapsed; + bool WantApply; + bool WantDelete; +}; +struct ImGuiSettingsHandler +{ + const char* TypeName; + ImGuiID TypeHash; + void (*ClearAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler); + void (*ReadInitFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler); + void* (*ReadOpenFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, const char* name); + void (*ReadLineFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, void* entry, const char* line); + void (*ApplyAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler); + void (*WriteAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf); + void* UserData; +}; +typedef enum { +ImGuiLocKey_VersionStr=0, +ImGuiLocKey_TableSizeOne=1, +ImGuiLocKey_TableSizeAllFit=2, +ImGuiLocKey_TableSizeAllDefault=3, +ImGuiLocKey_TableResetOrder=4, +ImGuiLocKey_WindowingMainMenuBar=5, +ImGuiLocKey_WindowingPopup=6, +ImGuiLocKey_WindowingUntitled=7, +ImGuiLocKey_DockingHideTabBar=8, +ImGuiLocKey_DockingHoldShiftToDock=9, +ImGuiLocKey_COUNT=10, +}ImGuiLocKey; +struct ImGuiLocEntry +{ + ImGuiLocKey Key; + const char* Text; +}; +typedef enum { + ImGuiDebugLogFlags_None = 0, + ImGuiDebugLogFlags_EventActiveId = 1 << 0, + ImGuiDebugLogFlags_EventFocus = 1 << 1, + ImGuiDebugLogFlags_EventPopup = 1 << 2, + ImGuiDebugLogFlags_EventNav = 1 << 3, + ImGuiDebugLogFlags_EventClipper = 1 << 4, + ImGuiDebugLogFlags_EventSelection = 1 << 5, + ImGuiDebugLogFlags_EventIO = 1 << 6, + ImGuiDebugLogFlags_EventDocking = 1 << 7, + ImGuiDebugLogFlags_EventViewport = 1 << 8, + ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport, + ImGuiDebugLogFlags_OutputToTTY = 1 << 10, +}ImGuiDebugLogFlags_; +struct ImGuiMetricsConfig +{ + bool ShowDebugLog; + bool ShowStackTool; + bool ShowWindowsRects; + bool ShowWindowsBeginOrder; + bool ShowTablesRects; + bool ShowDrawCmdMesh; + bool ShowDrawCmdBoundingBoxes; + bool ShowAtlasTintedWithTextColor; + bool ShowDockingNodes; + int ShowWindowsRectsType; + int ShowTablesRectsType; +}; +typedef struct ImGuiStackLevelInfo ImGuiStackLevelInfo; +struct ImGuiStackLevelInfo +{ + ImGuiID ID; + ImS8 QueryFrameCount; + bool QuerySuccess; + ImGuiDataType DataType : 8; + char Desc[57]; +}; +typedef struct ImGuiStackTool ImGuiStackTool; +typedef struct ImVector_ImGuiStackLevelInfo {int Size;int Capacity;ImGuiStackLevelInfo* Data;} ImVector_ImGuiStackLevelInfo; + +struct ImGuiStackTool +{ + int LastActiveFrame; + int StackLevel; + ImGuiID QueryId; + ImVector_ImGuiStackLevelInfo Results; + bool CopyToClipboardOnCtrlC; + float CopyToClipboardLastTime; +}; +typedef void (*ImGuiContextHookCallback)(ImGuiContext* ctx, ImGuiContextHook* hook); +typedef enum { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ }ImGuiContextHookType; +struct ImGuiContextHook +{ + ImGuiID HookId; + ImGuiContextHookType Type; + ImGuiID Owner; + ImGuiContextHookCallback Callback; + void* UserData; +}; +typedef struct ImVector_ImGuiInputEvent {int Size;int Capacity;ImGuiInputEvent* Data;} ImVector_ImGuiInputEvent; + +typedef struct ImVector_ImGuiWindowStackData {int Size;int Capacity;ImGuiWindowStackData* Data;} ImVector_ImGuiWindowStackData; + +typedef struct ImVector_ImGuiColorMod {int Size;int Capacity;ImGuiColorMod* Data;} ImVector_ImGuiColorMod; + +typedef struct ImVector_ImGuiStyleMod {int Size;int Capacity;ImGuiStyleMod* Data;} ImVector_ImGuiStyleMod; + +typedef struct ImVector_ImGuiID {int Size;int Capacity;ImGuiID* Data;} ImVector_ImGuiID; + +typedef struct ImVector_ImGuiItemFlags {int Size;int Capacity;ImGuiItemFlags* Data;} ImVector_ImGuiItemFlags; + +typedef struct ImVector_ImGuiGroupData {int Size;int Capacity;ImGuiGroupData* Data;} ImVector_ImGuiGroupData; + +typedef struct ImVector_ImGuiPopupData {int Size;int Capacity;ImGuiPopupData* Data;} ImVector_ImGuiPopupData; + +typedef struct ImVector_ImGuiNavTreeNodeData {int Size;int Capacity;ImGuiNavTreeNodeData* Data;} ImVector_ImGuiNavTreeNodeData; + +typedef struct ImVector_ImGuiViewportPPtr {int Size;int Capacity;ImGuiViewportP** Data;} ImVector_ImGuiViewportPPtr; + +typedef struct ImVector_unsigned_char {int Size;int Capacity;unsigned char* Data;} ImVector_unsigned_char; + +typedef struct ImVector_ImGuiListClipperData {int Size;int Capacity;ImGuiListClipperData* Data;} ImVector_ImGuiListClipperData; + +typedef struct ImVector_ImGuiTableTempData {int Size;int Capacity;ImGuiTableTempData* Data;} ImVector_ImGuiTableTempData; + +typedef struct ImVector_ImGuiTable {int Size;int Capacity;ImGuiTable* Data;} ImVector_ImGuiTable; + +typedef struct ImPool_ImGuiTable {ImVector_ImGuiTable Buf;ImGuiStorage Map;ImPoolIdx FreeIdx;ImPoolIdx AliveCount;} ImPool_ImGuiTable; + +typedef struct ImVector_ImGuiTabBar {int Size;int Capacity;ImGuiTabBar* Data;} ImVector_ImGuiTabBar; + +typedef struct ImPool_ImGuiTabBar {ImVector_ImGuiTabBar Buf;ImGuiStorage Map;ImPoolIdx FreeIdx;ImPoolIdx AliveCount;} ImPool_ImGuiTabBar; + +typedef struct ImVector_ImGuiPtrOrIndex {int Size;int Capacity;ImGuiPtrOrIndex* Data;} ImVector_ImGuiPtrOrIndex; + +typedef struct ImVector_ImGuiShrinkWidthItem {int Size;int Capacity;ImGuiShrinkWidthItem* Data;} ImVector_ImGuiShrinkWidthItem; + +typedef struct ImVector_ImGuiSettingsHandler {int Size;int Capacity;ImGuiSettingsHandler* Data;} ImVector_ImGuiSettingsHandler; + +typedef struct ImChunkStream_ImGuiWindowSettings {ImVector_char Buf;} ImChunkStream_ImGuiWindowSettings; + +typedef struct ImChunkStream_ImGuiTableSettings {ImVector_char Buf;} ImChunkStream_ImGuiTableSettings; + +typedef struct ImVector_ImGuiContextHook {int Size;int Capacity;ImGuiContextHook* Data;} ImVector_ImGuiContextHook; + +struct ImGuiContext +{ + bool Initialized; + bool FontAtlasOwnedByContext; + ImGuiIO IO; + ImGuiPlatformIO PlatformIO; + ImGuiStyle Style; + ImGuiConfigFlags ConfigFlagsCurrFrame; + ImGuiConfigFlags ConfigFlagsLastFrame; + ImFont* Font; + float FontSize; + float FontBaseSize; + ImDrawListSharedData DrawListSharedData; + double Time; + int FrameCount; + int FrameCountEnded; + int FrameCountPlatformEnded; + int FrameCountRendered; + bool WithinFrameScope; + bool WithinFrameScopeWithImplicitWindow; + bool WithinEndChild; + bool GcCompactAll; + bool TestEngineHookItems; + void* TestEngine; + ImVector_ImGuiInputEvent InputEventsQueue; + ImVector_ImGuiInputEvent InputEventsTrail; + ImGuiMouseSource InputEventsNextMouseSource; + ImU32 InputEventsNextEventId; + ImVector_ImGuiWindowPtr Windows; + ImVector_ImGuiWindowPtr WindowsFocusOrder; + ImVector_ImGuiWindowPtr WindowsTempSortBuffer; + ImVector_ImGuiWindowStackData CurrentWindowStack; + ImGuiStorage WindowsById; + int WindowsActiveCount; + ImVec2 WindowsHoverPadding; + ImGuiWindow* CurrentWindow; + ImGuiWindow* HoveredWindow; + ImGuiWindow* HoveredWindowUnderMovingWindow; + ImGuiWindow* MovingWindow; + ImGuiWindow* WheelingWindow; + ImVec2 WheelingWindowRefMousePos; + int WheelingWindowStartFrame; + float WheelingWindowReleaseTimer; + ImVec2 WheelingWindowWheelRemainder; + ImVec2 WheelingAxisAvg; + ImGuiID DebugHookIdInfo; + ImGuiID HoveredId; + ImGuiID HoveredIdPreviousFrame; + bool HoveredIdAllowOverlap; + bool HoveredIdDisabled; + float HoveredIdTimer; + float HoveredIdNotActiveTimer; + ImGuiID ActiveId; + ImGuiID ActiveIdIsAlive; + float ActiveIdTimer; + bool ActiveIdIsJustActivated; + bool ActiveIdAllowOverlap; + bool ActiveIdNoClearOnFocusLoss; + bool ActiveIdHasBeenPressedBefore; + bool ActiveIdHasBeenEditedBefore; + bool ActiveIdHasBeenEditedThisFrame; + ImVec2 ActiveIdClickOffset; + ImGuiWindow* ActiveIdWindow; + ImGuiInputSource ActiveIdSource; + int ActiveIdMouseButton; + ImGuiID ActiveIdPreviousFrame; + bool ActiveIdPreviousFrameIsAlive; + bool ActiveIdPreviousFrameHasBeenEditedBefore; + ImGuiWindow* ActiveIdPreviousFrameWindow; + ImGuiID LastActiveId; + float LastActiveIdTimer; + ImGuiKeyOwnerData KeysOwnerData[ImGuiKey_NamedKey_COUNT]; + ImGuiKeyRoutingTable KeysRoutingTable; + ImU32 ActiveIdUsingNavDirMask; + bool ActiveIdUsingAllKeyboardKeys; + ImU32 ActiveIdUsingNavInputMask; + ImGuiID CurrentFocusScopeId; + ImGuiItemFlags CurrentItemFlags; + ImGuiID DebugLocateId; + ImGuiNextItemData NextItemData; + ImGuiLastItemData LastItemData; + ImGuiNextWindowData NextWindowData; + ImVector_ImGuiColorMod ColorStack; + ImVector_ImGuiStyleMod StyleVarStack; + ImVector_ImFontPtr FontStack; + ImVector_ImGuiID FocusScopeStack; + ImVector_ImGuiItemFlags ItemFlagsStack; + ImVector_ImGuiGroupData GroupStack; + ImVector_ImGuiPopupData OpenPopupStack; + ImVector_ImGuiPopupData BeginPopupStack; + ImVector_ImGuiNavTreeNodeData NavTreeNodeStack; + int BeginMenuCount; + ImVector_ImGuiViewportPPtr Viewports; + float CurrentDpiScale; + ImGuiViewportP* CurrentViewport; + ImGuiViewportP* MouseViewport; + ImGuiViewportP* MouseLastHoveredViewport; + ImGuiID PlatformLastFocusedViewportId; + ImGuiPlatformMonitor FallbackMonitor; + int ViewportCreatedCount; + int PlatformWindowsCreatedCount; + int ViewportFocusedStampCount; + ImGuiWindow* NavWindow; + ImGuiID NavId; + ImGuiID NavFocusScopeId; + ImGuiID NavActivateId; + ImGuiID NavActivateDownId; + ImGuiID NavActivatePressedId; + ImGuiActivateFlags NavActivateFlags; + ImGuiID NavJustMovedToId; + ImGuiID NavJustMovedToFocusScopeId; + ImGuiKeyChord NavJustMovedToKeyMods; + ImGuiID NavNextActivateId; + ImGuiActivateFlags NavNextActivateFlags; + ImGuiInputSource NavInputSource; + ImGuiNavLayer NavLayer; + bool NavIdIsAlive; + bool NavMousePosDirty; + bool NavDisableHighlight; + bool NavDisableMouseHover; + bool NavAnyRequest; + bool NavInitRequest; + bool NavInitRequestFromMove; + ImGuiNavItemData NavInitResult; + bool NavMoveSubmitted; + bool NavMoveScoringItems; + bool NavMoveForwardToNextFrame; + ImGuiNavMoveFlags NavMoveFlags; + ImGuiScrollFlags NavMoveScrollFlags; + ImGuiKeyChord NavMoveKeyMods; + ImGuiDir NavMoveDir; + ImGuiDir NavMoveDirForDebug; + ImGuiDir NavMoveClipDir; + ImRect NavScoringRect; + ImRect NavScoringNoClipRect; + int NavScoringDebugCount; + int NavTabbingDir; + int NavTabbingCounter; + ImGuiNavItemData NavMoveResultLocal; + ImGuiNavItemData NavMoveResultLocalVisible; + ImGuiNavItemData NavMoveResultOther; + ImGuiNavItemData NavTabbingResultFirst; + ImGuiKeyChord ConfigNavWindowingKeyNext; + ImGuiKeyChord ConfigNavWindowingKeyPrev; + ImGuiWindow* NavWindowingTarget; + ImGuiWindow* NavWindowingTargetAnim; + ImGuiWindow* NavWindowingListWindow; + float NavWindowingTimer; + float NavWindowingHighlightAlpha; + bool NavWindowingToggleLayer; + ImVec2 NavWindowingAccumDeltaPos; + ImVec2 NavWindowingAccumDeltaSize; + float DimBgRatio; + bool DragDropActive; + bool DragDropWithinSource; + bool DragDropWithinTarget; + ImGuiDragDropFlags DragDropSourceFlags; + int DragDropSourceFrameCount; + int DragDropMouseButton; + ImGuiPayload DragDropPayload; + ImRect DragDropTargetRect; + ImGuiID DragDropTargetId; + ImGuiDragDropFlags DragDropAcceptFlags; + float DragDropAcceptIdCurrRectSurface; + ImGuiID DragDropAcceptIdCurr; + ImGuiID DragDropAcceptIdPrev; + int DragDropAcceptFrameCount; + ImGuiID DragDropHoldJustPressedId; + ImVector_unsigned_char DragDropPayloadBufHeap; + unsigned char DragDropPayloadBufLocal[16]; + int ClipperTempDataStacked; + ImVector_ImGuiListClipperData ClipperTempData; + ImGuiTable* CurrentTable; + int TablesTempDataStacked; + ImVector_ImGuiTableTempData TablesTempData; + ImPool_ImGuiTable Tables; + ImVector_float TablesLastTimeActive; + ImVector_ImDrawChannel DrawChannelsTempMergeBuffer; + ImGuiTabBar* CurrentTabBar; + ImPool_ImGuiTabBar TabBars; + ImVector_ImGuiPtrOrIndex CurrentTabBarStack; + ImVector_ImGuiShrinkWidthItem ShrinkWidthBuffer; + ImGuiID HoverItemDelayId; + ImGuiID HoverItemDelayIdPreviousFrame; + float HoverItemDelayTimer; + float HoverItemDelayClearTimer; + ImGuiID HoverItemUnlockedStationaryId; + ImGuiID HoverWindowUnlockedStationaryId; + ImGuiMouseCursor MouseCursor; + float MouseStationaryTimer; + ImVec2 MouseLastValidPos; + ImGuiInputTextState InputTextState; + ImGuiInputTextDeactivatedState InputTextDeactivatedState; + ImFont InputTextPasswordFont; + ImGuiID TempInputId; + ImGuiColorEditFlags ColorEditOptions; + ImGuiID ColorEditCurrentID; + ImGuiID ColorEditSavedID; + float ColorEditSavedHue; + float ColorEditSavedSat; + ImU32 ColorEditSavedColor; + ImVec4 ColorPickerRef; + ImGuiComboPreviewData ComboPreviewData; + float SliderGrabClickOffset; + float SliderCurrentAccum; + bool SliderCurrentAccumDirty; + bool DragCurrentAccumDirty; + float DragCurrentAccum; + float DragSpeedDefaultRatio; + float ScrollbarClickDeltaToGrabCenter; + float DisabledAlphaBackup; + short DisabledStackSize; + short LockMarkEdited; + short TooltipOverrideCount; + ImVector_char ClipboardHandlerData; + ImVector_ImGuiID MenusIdSubmittedThisFrame; + ImGuiPlatformImeData PlatformImeData; + ImGuiPlatformImeData PlatformImeDataPrev; + ImGuiID PlatformImeViewport; + ImGuiDockContext DockContext; + void (*DockNodeWindowMenuHandler)(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar); + bool SettingsLoaded; + float SettingsDirtyTimer; + ImGuiTextBuffer SettingsIniData; + ImVector_ImGuiSettingsHandler SettingsHandlers; + ImChunkStream_ImGuiWindowSettings SettingsWindows; + ImChunkStream_ImGuiTableSettings SettingsTables; + ImVector_ImGuiContextHook Hooks; + ImGuiID HookIdNext; + const char* LocalizationTable[ImGuiLocKey_COUNT]; + bool LogEnabled; + ImGuiLogType LogType; + ImFileHandle LogFile; + ImGuiTextBuffer LogBuffer; + const char* LogNextPrefix; + const char* LogNextSuffix; + float LogLinePosY; + bool LogLineFirstItem; + int LogDepthRef; + int LogDepthToExpand; + int LogDepthToExpandDefault; + ImGuiDebugLogFlags DebugLogFlags; + ImGuiTextBuffer DebugLogBuf; + ImGuiTextIndex DebugLogIndex; + ImU8 DebugLogClipperAutoDisableFrames; + ImU8 DebugLocateFrames; + ImS8 DebugBeginReturnValueCullDepth; + bool DebugItemPickerActive; + ImU8 DebugItemPickerMouseButton; + ImGuiID DebugItemPickerBreakId; + ImGuiMetricsConfig DebugMetricsConfig; + ImGuiStackTool DebugStackTool; + ImGuiDockNode* DebugHoveredDockNode; + float FramerateSecPerFrame[60]; + int FramerateSecPerFrameIdx; + int FramerateSecPerFrameCount; + float FramerateSecPerFrameAccum; + int WantCaptureMouseNextFrame; + int WantCaptureKeyboardNextFrame; + int WantTextInputNextFrame; + ImVector_char TempBuffer; +}; +struct ImGuiWindowTempData +{ + ImVec2 CursorPos; + ImVec2 CursorPosPrevLine; + ImVec2 CursorStartPos; + ImVec2 CursorMaxPos; + ImVec2 IdealMaxPos; + ImVec2 CurrLineSize; + ImVec2 PrevLineSize; + float CurrLineTextBaseOffset; + float PrevLineTextBaseOffset; + bool IsSameLine; + bool IsSetPos; + ImVec1 Indent; + ImVec1 ColumnsOffset; + ImVec1 GroupOffset; + ImVec2 CursorStartPosLossyness; + ImGuiNavLayer NavLayerCurrent; + short NavLayersActiveMask; + short NavLayersActiveMaskNext; + bool NavIsScrollPushableX; + bool NavHideHighlightOneFrame; + bool NavWindowHasScrollY; + bool MenuBarAppending; + ImVec2 MenuBarOffset; + ImGuiMenuColumns MenuColumns; + int TreeDepth; + ImU32 TreeJumpToParentOnPopMask; + ImVector_ImGuiWindowPtr ChildWindows; + ImGuiStorage* StateStorage; + ImGuiOldColumns* CurrentColumns; + int CurrentTableIdx; + ImGuiLayoutType LayoutType; + ImGuiLayoutType ParentLayoutType; + float ItemWidth; + float TextWrapPos; + ImVector_float ItemWidthStack; + ImVector_float TextWrapPosStack; +}; +typedef struct ImVector_ImGuiOldColumns {int Size;int Capacity;ImGuiOldColumns* Data;} ImVector_ImGuiOldColumns; + +struct ImGuiWindow +{ + ImGuiContext* Ctx; + char* Name; + ImGuiID ID; + ImGuiWindowFlags Flags, FlagsPreviousFrame; + ImGuiWindowClass WindowClass; + ImGuiViewportP* Viewport; + ImGuiID ViewportId; + ImVec2 ViewportPos; + int ViewportAllowPlatformMonitorExtend; + ImVec2 Pos; + ImVec2 Size; + ImVec2 SizeFull; + ImVec2 ContentSize; + ImVec2 ContentSizeIdeal; + ImVec2 ContentSizeExplicit; + ImVec2 WindowPadding; + float WindowRounding; + float WindowBorderSize; + float DecoOuterSizeX1, DecoOuterSizeY1; + float DecoOuterSizeX2, DecoOuterSizeY2; + float DecoInnerSizeX1, DecoInnerSizeY1; + int NameBufLen; + ImGuiID MoveId; + ImGuiID TabId; + ImGuiID ChildId; + ImVec2 Scroll; + ImVec2 ScrollMax; + ImVec2 ScrollTarget; + ImVec2 ScrollTargetCenterRatio; + ImVec2 ScrollTargetEdgeSnapDist; + ImVec2 ScrollbarSizes; + bool ScrollbarX, ScrollbarY; + bool ViewportOwned; + bool Active; + bool WasActive; + bool WriteAccessed; + bool Collapsed; + bool WantCollapseToggle; + bool SkipItems; + bool Appearing; + bool Hidden; + bool IsFallbackWindow; + bool IsExplicitChild; + bool HasCloseButton; + signed char ResizeBorderHeld; + short BeginCount; + short BeginCountPreviousFrame; + short BeginOrderWithinParent; + short BeginOrderWithinContext; + short FocusOrder; + ImGuiID PopupId; + ImS8 AutoFitFramesX, AutoFitFramesY; + ImS8 AutoFitChildAxises; + bool AutoFitOnlyGrows; + ImGuiDir AutoPosLastDirection; + ImS8 HiddenFramesCanSkipItems; + ImS8 HiddenFramesCannotSkipItems; + ImS8 HiddenFramesForRenderOnly; + ImS8 DisableInputsFrames; + ImGuiCond SetWindowPosAllowFlags : 8; + ImGuiCond SetWindowSizeAllowFlags : 8; + ImGuiCond SetWindowCollapsedAllowFlags : 8; + ImGuiCond SetWindowDockAllowFlags : 8; + ImVec2 SetWindowPosVal; + ImVec2 SetWindowPosPivot; + ImVector_ImGuiID IDStack; + ImGuiWindowTempData DC; + ImRect OuterRectClipped; + ImRect InnerRect; + ImRect InnerClipRect; + ImRect WorkRect; + ImRect ParentWorkRect; + ImRect ClipRect; + ImRect ContentRegionRect; + ImVec2ih HitTestHoleSize; + ImVec2ih HitTestHoleOffset; + int LastFrameActive; + int LastFrameJustFocused; + float LastTimeActive; + float ItemWidthDefault; + ImGuiStorage StateStorage; + ImVector_ImGuiOldColumns ColumnsStorage; + float FontWindowScale; + float FontDpiScale; + int SettingsOffset; + ImDrawList* DrawList; + ImDrawList DrawListInst; + ImGuiWindow* ParentWindow; + ImGuiWindow* ParentWindowInBeginStack; + ImGuiWindow* RootWindow; + ImGuiWindow* RootWindowPopupTree; + ImGuiWindow* RootWindowDockTree; + ImGuiWindow* RootWindowForTitleBarHighlight; + ImGuiWindow* RootWindowForNav; + ImGuiWindow* NavLastChildNavWindow; + ImGuiID NavLastIds[ImGuiNavLayer_COUNT]; + ImRect NavRectRel[ImGuiNavLayer_COUNT]; + ImVec2 NavPreferredScoringPosRel[ImGuiNavLayer_COUNT]; + ImGuiID NavRootFocusScopeId; + int MemoryDrawListIdxCapacity; + int MemoryDrawListVtxCapacity; + bool MemoryCompacted; + bool DockIsActive :1; + bool DockNodeIsVisible :1; + bool DockTabIsVisible :1; + bool DockTabWantClose :1; + short DockOrder; + ImGuiWindowDockStyle DockStyle; + ImGuiDockNode* DockNode; + ImGuiDockNode* DockNodeAsHost; + ImGuiID DockId; + ImGuiItemStatusFlags DockTabItemStatusFlags; + ImRect DockTabItemRect; +}; +typedef enum { + ImGuiTabBarFlags_DockNode = 1 << 20, + ImGuiTabBarFlags_IsFocused = 1 << 21, + ImGuiTabBarFlags_SaveSettings = 1 << 22, +}ImGuiTabBarFlagsPrivate_; +typedef enum { + ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing, + ImGuiTabItemFlags_NoCloseButton = 1 << 20, + ImGuiTabItemFlags_Button = 1 << 21, + ImGuiTabItemFlags_Unsorted = 1 << 22, + ImGuiTabItemFlags_Preview = 1 << 23, +}ImGuiTabItemFlagsPrivate_; +struct ImGuiTabItem +{ + ImGuiID ID; + ImGuiTabItemFlags Flags; + ImGuiWindow* Window; + int LastFrameVisible; + int LastFrameSelected; + float Offset; + float Width; + float ContentWidth; + float RequestedWidth; + ImS32 NameOffset; + ImS16 BeginOrder; + ImS16 IndexDuringLayout; + bool WantClose; +}; +typedef struct ImVector_ImGuiTabItem {int Size;int Capacity;ImGuiTabItem* Data;} ImVector_ImGuiTabItem; + +struct ImGuiTabBar +{ + ImVector_ImGuiTabItem Tabs; + ImGuiTabBarFlags Flags; + ImGuiID ID; + ImGuiID SelectedTabId; + ImGuiID NextSelectedTabId; + ImGuiID VisibleTabId; + int CurrFrameVisible; + int PrevFrameVisible; + ImRect BarRect; + float CurrTabsContentsHeight; + float PrevTabsContentsHeight; + float WidthAllTabs; + float WidthAllTabsIdeal; + float ScrollingAnim; + float ScrollingTarget; + float ScrollingTargetDistToVisibility; + float ScrollingSpeed; + float ScrollingRectMinX; + float ScrollingRectMaxX; + ImGuiID ReorderRequestTabId; + ImS16 ReorderRequestOffset; + ImS8 BeginCount; + bool WantLayout; + bool VisibleTabWasSubmitted; + bool TabsAddedNew; + ImS16 TabsActiveCount; + ImS16 LastTabItemIdx; + float ItemSpacingY; + ImVec2 FramePadding; + ImVec2 BackupCursorPos; + ImGuiTextBuffer TabsNames; +}; +typedef ImS16 ImGuiTableColumnIdx; +typedef ImU16 ImGuiTableDrawChannelIdx; +struct ImGuiTableColumn +{ + ImGuiTableColumnFlags Flags; + float WidthGiven; + float MinX; + float MaxX; + float WidthRequest; + float WidthAuto; + float StretchWeight; + float InitStretchWeightOrWidth; + ImRect ClipRect; + ImGuiID UserID; + float WorkMinX; + float WorkMaxX; + float ItemWidth; + float ContentMaxXFrozen; + float ContentMaxXUnfrozen; + float ContentMaxXHeadersUsed; + float ContentMaxXHeadersIdeal; + ImS16 NameOffset; + ImGuiTableColumnIdx DisplayOrder; + ImGuiTableColumnIdx IndexWithinEnabledSet; + ImGuiTableColumnIdx PrevEnabledColumn; + ImGuiTableColumnIdx NextEnabledColumn; + ImGuiTableColumnIdx SortOrder; + ImGuiTableDrawChannelIdx DrawChannelCurrent; + ImGuiTableDrawChannelIdx DrawChannelFrozen; + ImGuiTableDrawChannelIdx DrawChannelUnfrozen; + bool IsEnabled; + bool IsUserEnabled; + bool IsUserEnabledNextFrame; + bool IsVisibleX; + bool IsVisibleY; + bool IsRequestOutput; + bool IsSkipItems; + bool IsPreserveWidthAuto; + ImS8 NavLayerCurrent; + ImU8 AutoFitQueue; + ImU8 CannotSkipItemsQueue; + ImU8 SortDirection : 2; + ImU8 SortDirectionsAvailCount : 2; + ImU8 SortDirectionsAvailMask : 4; + ImU8 SortDirectionsAvailList; +}; +typedef struct ImGuiTableCellData ImGuiTableCellData; +struct ImGuiTableCellData +{ + ImU32 BgColor; + ImGuiTableColumnIdx Column; +}; +struct ImGuiTableInstanceData +{ + ImGuiID TableInstanceID; + float LastOuterHeight; + float LastFirstRowHeight; + float LastFrozenHeight; + int HoveredRowLast; + int HoveredRowNext; +}; +typedef struct ImSpan_ImGuiTableColumn {ImGuiTableColumn* Data;ImGuiTableColumn* DataEnd;} ImSpan_ImGuiTableColumn; + +typedef struct ImSpan_ImGuiTableColumnIdx {ImGuiTableColumnIdx* Data;ImGuiTableColumnIdx* DataEnd;} ImSpan_ImGuiTableColumnIdx; + +typedef struct ImSpan_ImGuiTableCellData {ImGuiTableCellData* Data;ImGuiTableCellData* DataEnd;} ImSpan_ImGuiTableCellData; + +typedef struct ImVector_ImGuiTableInstanceData {int Size;int Capacity;ImGuiTableInstanceData* Data;} ImVector_ImGuiTableInstanceData; + +typedef struct ImVector_ImGuiTableColumnSortSpecs {int Size;int Capacity;ImGuiTableColumnSortSpecs* Data;} ImVector_ImGuiTableColumnSortSpecs; + +struct ImGuiTable +{ + ImGuiID ID; + ImGuiTableFlags Flags; + void* RawData; + ImGuiTableTempData* TempData; + ImSpan_ImGuiTableColumn Columns; + ImSpan_ImGuiTableColumnIdx DisplayOrderToIndex; + ImSpan_ImGuiTableCellData RowCellData; + ImBitArrayPtr EnabledMaskByDisplayOrder; + ImBitArrayPtr EnabledMaskByIndex; + ImBitArrayPtr VisibleMaskByIndex; + ImGuiTableFlags SettingsLoadedFlags; + int SettingsOffset; + int LastFrameActive; + int ColumnsCount; + int CurrentRow; + int CurrentColumn; + ImS16 InstanceCurrent; + ImS16 InstanceInteracted; + float RowPosY1; + float RowPosY2; + float RowMinHeight; + float RowCellPaddingY; + float RowTextBaseline; + float RowIndentOffsetX; + ImGuiTableRowFlags RowFlags : 16; + ImGuiTableRowFlags LastRowFlags : 16; + int RowBgColorCounter; + ImU32 RowBgColor[2]; + ImU32 BorderColorStrong; + ImU32 BorderColorLight; + float BorderX1; + float BorderX2; + float HostIndentX; + float MinColumnWidth; + float OuterPaddingX; + float CellPaddingX; + float CellSpacingX1; + float CellSpacingX2; + float InnerWidth; + float ColumnsGivenWidth; + float ColumnsAutoFitWidth; + float ColumnsStretchSumWeights; + float ResizedColumnNextWidth; + float ResizeLockMinContentsX2; + float RefScale; + ImRect OuterRect; + ImRect InnerRect; + ImRect WorkRect; + ImRect InnerClipRect; + ImRect BgClipRect; + ImRect Bg0ClipRectForDrawCmd; + ImRect Bg2ClipRectForDrawCmd; + ImRect HostClipRect; + ImRect HostBackupInnerClipRect; + ImGuiWindow* OuterWindow; + ImGuiWindow* InnerWindow; + ImGuiTextBuffer ColumnsNames; + ImDrawListSplitter* DrawSplitter; + ImGuiTableInstanceData InstanceDataFirst; + ImVector_ImGuiTableInstanceData InstanceDataExtra; + ImGuiTableColumnSortSpecs SortSpecsSingle; + ImVector_ImGuiTableColumnSortSpecs SortSpecsMulti; + ImGuiTableSortSpecs SortSpecs; + ImGuiTableColumnIdx SortSpecsCount; + ImGuiTableColumnIdx ColumnsEnabledCount; + ImGuiTableColumnIdx ColumnsEnabledFixedCount; + ImGuiTableColumnIdx DeclColumnsCount; + ImGuiTableColumnIdx HoveredColumnBody; + ImGuiTableColumnIdx HoveredColumnBorder; + ImGuiTableColumnIdx AutoFitSingleColumn; + ImGuiTableColumnIdx ResizedColumn; + ImGuiTableColumnIdx LastResizedColumn; + ImGuiTableColumnIdx HeldHeaderColumn; + ImGuiTableColumnIdx ReorderColumn; + ImGuiTableColumnIdx ReorderColumnDir; + ImGuiTableColumnIdx LeftMostEnabledColumn; + ImGuiTableColumnIdx RightMostEnabledColumn; + ImGuiTableColumnIdx LeftMostStretchedColumn; + ImGuiTableColumnIdx RightMostStretchedColumn; + ImGuiTableColumnIdx ContextPopupColumn; + ImGuiTableColumnIdx FreezeRowsRequest; + ImGuiTableColumnIdx FreezeRowsCount; + ImGuiTableColumnIdx FreezeColumnsRequest; + ImGuiTableColumnIdx FreezeColumnsCount; + ImGuiTableColumnIdx RowCellDataCurrent; + ImGuiTableDrawChannelIdx DummyDrawChannel; + ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent; + ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen; + bool IsLayoutLocked; + bool IsInsideRow; + bool IsInitializing; + bool IsSortSpecsDirty; + bool IsUsingHeaders; + bool IsContextPopupOpen; + bool IsSettingsRequestLoad; + bool IsSettingsDirty; + bool IsDefaultDisplayOrder; + bool IsResetAllRequest; + bool IsResetDisplayOrderRequest; + bool IsUnfrozenRows; + bool IsDefaultSizingPolicy; + bool HasScrollbarYCurr; + bool HasScrollbarYPrev; + bool MemoryCompacted; + bool HostSkipItems; +}; +struct ImGuiTableTempData +{ + int TableIndex; + float LastTimeActive; + ImVec2 UserOuterSize; + ImDrawListSplitter DrawSplitter; + ImRect HostBackupWorkRect; + ImRect HostBackupParentWorkRect; + ImVec2 HostBackupPrevLineSize; + ImVec2 HostBackupCurrLineSize; + ImVec2 HostBackupCursorMaxPos; + ImVec1 HostBackupColumnsOffset; + float HostBackupItemWidth; + int HostBackupItemWidthStackSize; +}; +typedef struct ImGuiTableColumnSettings ImGuiTableColumnSettings; +struct ImGuiTableColumnSettings +{ + float WidthOrWeight; + ImGuiID UserID; + ImGuiTableColumnIdx Index; + ImGuiTableColumnIdx DisplayOrder; + ImGuiTableColumnIdx SortOrder; + ImU8 SortDirection : 2; + ImU8 IsEnabled : 1; + ImU8 IsStretch : 1; +}; +struct ImGuiTableSettings +{ + ImGuiID ID; + ImGuiTableFlags SaveFlags; + float RefScale; + ImGuiTableColumnIdx ColumnsCount; + ImGuiTableColumnIdx ColumnsCountMax; + bool WantApply; +}; +struct ImFontBuilderIO +{ + bool (*FontBuilder_Build)(ImFontAtlas* atlas); +}; +struct ImFontAtlas; +struct ImFontBuilderIO; +typedef enum { + ImGuiFreeTypeBuilderFlags_NoHinting = 1 << 0, + ImGuiFreeTypeBuilderFlags_NoAutoHint = 1 << 1, + ImGuiFreeTypeBuilderFlags_ForceAutoHint = 1 << 2, + ImGuiFreeTypeBuilderFlags_LightHinting = 1 << 3, + ImGuiFreeTypeBuilderFlags_MonoHinting = 1 << 4, + ImGuiFreeTypeBuilderFlags_Bold = 1 << 5, + ImGuiFreeTypeBuilderFlags_Oblique = 1 << 6, + ImGuiFreeTypeBuilderFlags_Monochrome = 1 << 7, + ImGuiFreeTypeBuilderFlags_LoadColor = 1 << 8, + ImGuiFreeTypeBuilderFlags_Bitmap = 1 << 9 +}ImGuiFreeTypeBuilderFlags; +#define IMGUI_HAS_DOCK 1 + +#else +struct GLFWwindow; +struct SDL_Window; +typedef union SDL_Event SDL_Event; +#endif // CIMGUI_DEFINE_ENUMS_AND_STRUCTS + +#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS +typedef struct ImGuiStorage::ImGuiStoragePair ImGuiStoragePair; +typedef struct ImGuiTextFilter::ImGuiTextRange ImGuiTextRange; +typedef ImStb::STB_TexteditState STB_TexteditState; +typedef ImStb::StbTexteditRow StbTexteditRow; +typedef ImStb::StbUndoRecord StbUndoRecord; +typedef ImStb::StbUndoState StbUndoState; +typedef ImChunkStream ImChunkStream_ImGuiTableSettings; +typedef ImChunkStream ImChunkStream_ImGuiWindowSettings; +typedef ImPool ImPool_ImGuiTabBar; +typedef ImPool ImPool_ImGuiTable; +typedef ImSpan ImSpan_ImGuiTableCellData; +typedef ImSpan ImSpan_ImGuiTableColumn; +typedef ImSpan ImSpan_ImGuiTableColumnIdx; +typedef ImVector ImVector_ImDrawChannel; +typedef ImVector ImVector_ImDrawCmd; +typedef ImVector ImVector_ImDrawIdx; +typedef ImVector ImVector_ImDrawListPtr; +typedef ImVector ImVector_ImDrawVert; +typedef ImVector ImVector_ImFontPtr; +typedef ImVector ImVector_ImFontAtlasCustomRect; +typedef ImVector ImVector_ImFontConfig; +typedef ImVector ImVector_ImFontGlyph; +typedef ImVector ImVector_ImGuiColorMod; +typedef ImVector ImVector_ImGuiContextHook; +typedef ImVector ImVector_ImGuiDockNodeSettings; +typedef ImVector ImVector_ImGuiDockRequest; +typedef ImVector ImVector_ImGuiGroupData; +typedef ImVector ImVector_ImGuiID; +typedef ImVector ImVector_ImGuiInputEvent; +typedef ImVector ImVector_ImGuiItemFlags; +typedef ImVector ImVector_ImGuiKeyRoutingData; +typedef ImVector ImVector_ImGuiListClipperData; +typedef ImVector ImVector_ImGuiListClipperRange; +typedef ImVector ImVector_ImGuiNavTreeNodeData; +typedef ImVector ImVector_ImGuiOldColumnData; +typedef ImVector ImVector_ImGuiOldColumns; +typedef ImVector ImVector_ImGuiPlatformMonitor; +typedef ImVector ImVector_ImGuiPopupData; +typedef ImVector ImVector_ImGuiPtrOrIndex; +typedef ImVector ImVector_ImGuiSettingsHandler; +typedef ImVector ImVector_ImGuiShrinkWidthItem; +typedef ImVector ImVector_ImGuiStackLevelInfo; +typedef ImVector ImVector_ImGuiStoragePair; +typedef ImVector ImVector_ImGuiStyleMod; +typedef ImVector ImVector_ImGuiTabItem; +typedef ImVector ImVector_ImGuiTableColumnSortSpecs; +typedef ImVector ImVector_ImGuiTableInstanceData; +typedef ImVector ImVector_ImGuiTableTempData; +typedef ImVector ImVector_ImGuiTextRange; +typedef ImVector ImVector_ImGuiViewportPtr; +typedef ImVector ImVector_ImGuiViewportPPtr; +typedef ImVector ImVector_ImGuiWindowPtr; +typedef ImVector ImVector_ImGuiWindowStackData; +typedef ImVector ImVector_ImTextureID; +typedef ImVector ImVector_ImU32; +typedef ImVector ImVector_ImVec2; +typedef ImVector ImVector_ImVec4; +typedef ImVector ImVector_ImWchar; +typedef ImVector ImVector_char; +typedef ImVector ImVector_const_charPtr; +typedef ImVector ImVector_float; +typedef ImVector ImVector_int; +typedef ImVector ImVector_unsigned_char; +#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS +CIMGUI_API ImVec2* ImVec2_ImVec2_Nil(void); +CIMGUI_API void ImVec2_destroy(ImVec2* self); +CIMGUI_API ImVec2* ImVec2_ImVec2_Float(float _x,float _y); +CIMGUI_API ImVec4* ImVec4_ImVec4_Nil(void); +CIMGUI_API void ImVec4_destroy(ImVec4* self); +CIMGUI_API ImVec4* ImVec4_ImVec4_Float(float _x,float _y,float _z,float _w); +CIMGUI_API ImGuiContext* igCreateContext(ImFontAtlas* shared_font_atlas); +CIMGUI_API void igDestroyContext(ImGuiContext* ctx); +CIMGUI_API ImGuiContext* igGetCurrentContext(void); +CIMGUI_API void igSetCurrentContext(ImGuiContext* ctx); +CIMGUI_API ImGuiIO* igGetIO(void); +CIMGUI_API ImGuiStyle* igGetStyle(void); +CIMGUI_API void igNewFrame(void); +CIMGUI_API void igEndFrame(void); +CIMGUI_API void igRender(void); +CIMGUI_API ImDrawData* igGetDrawData(void); +CIMGUI_API void igShowDemoWindow(bool* p_open); +CIMGUI_API void igShowMetricsWindow(bool* p_open); +CIMGUI_API void igShowDebugLogWindow(bool* p_open); +CIMGUI_API void igShowStackToolWindow(bool* p_open); +CIMGUI_API void igShowAboutWindow(bool* p_open); +CIMGUI_API void igShowStyleEditor(ImGuiStyle* ref); +CIMGUI_API bool igShowStyleSelector(const char* label); +CIMGUI_API void igShowFontSelector(const char* label); +CIMGUI_API void igShowUserGuide(void); +CIMGUI_API const char* igGetVersion(void); +CIMGUI_API void igStyleColorsDark(ImGuiStyle* dst); +CIMGUI_API void igStyleColorsLight(ImGuiStyle* dst); +CIMGUI_API void igStyleColorsClassic(ImGuiStyle* dst); +CIMGUI_API bool igBegin(const char* name,bool* p_open,ImGuiWindowFlags flags); +CIMGUI_API void igEnd(void); +CIMGUI_API bool igBeginChild_Str(const char* str_id,const ImVec2 size,bool border,ImGuiWindowFlags flags); +CIMGUI_API bool igBeginChild_ID(ImGuiID id,const ImVec2 size,bool border,ImGuiWindowFlags flags); +CIMGUI_API void igEndChild(void); +CIMGUI_API bool igIsWindowAppearing(void); +CIMGUI_API bool igIsWindowCollapsed(void); +CIMGUI_API bool igIsWindowFocused(ImGuiFocusedFlags flags); +CIMGUI_API bool igIsWindowHovered(ImGuiHoveredFlags flags); +CIMGUI_API ImDrawList* igGetWindowDrawList(void); +CIMGUI_API float igGetWindowDpiScale(void); +CIMGUI_API void igGetWindowPos(ImVec2 *pOut); +CIMGUI_API void igGetWindowSize(ImVec2 *pOut); +CIMGUI_API float igGetWindowWidth(void); +CIMGUI_API float igGetWindowHeight(void); +CIMGUI_API ImGuiViewport* igGetWindowViewport(void); +CIMGUI_API void igSetNextWindowPos(const ImVec2 pos,ImGuiCond cond,const ImVec2 pivot); +CIMGUI_API void igSetNextWindowSize(const ImVec2 size,ImGuiCond cond); +CIMGUI_API void igSetNextWindowSizeConstraints(const ImVec2 size_min,const ImVec2 size_max,ImGuiSizeCallback custom_callback,void* custom_callback_data); +CIMGUI_API void igSetNextWindowContentSize(const ImVec2 size); +CIMGUI_API void igSetNextWindowCollapsed(bool collapsed,ImGuiCond cond); +CIMGUI_API void igSetNextWindowFocus(void); +CIMGUI_API void igSetNextWindowScroll(const ImVec2 scroll); +CIMGUI_API void igSetNextWindowBgAlpha(float alpha); +CIMGUI_API void igSetNextWindowViewport(ImGuiID viewport_id); +CIMGUI_API void igSetWindowPos_Vec2(const ImVec2 pos,ImGuiCond cond); +CIMGUI_API void igSetWindowSize_Vec2(const ImVec2 size,ImGuiCond cond); +CIMGUI_API void igSetWindowCollapsed_Bool(bool collapsed,ImGuiCond cond); +CIMGUI_API void igSetWindowFocus_Nil(void); +CIMGUI_API void igSetWindowFontScale(float scale); +CIMGUI_API void igSetWindowPos_Str(const char* name,const ImVec2 pos,ImGuiCond cond); +CIMGUI_API void igSetWindowSize_Str(const char* name,const ImVec2 size,ImGuiCond cond); +CIMGUI_API void igSetWindowCollapsed_Str(const char* name,bool collapsed,ImGuiCond cond); +CIMGUI_API void igSetWindowFocus_Str(const char* name); +CIMGUI_API void igGetContentRegionAvail(ImVec2 *pOut); +CIMGUI_API void igGetContentRegionMax(ImVec2 *pOut); +CIMGUI_API void igGetWindowContentRegionMin(ImVec2 *pOut); +CIMGUI_API void igGetWindowContentRegionMax(ImVec2 *pOut); +CIMGUI_API float igGetScrollX(void); +CIMGUI_API float igGetScrollY(void); +CIMGUI_API void igSetScrollX_Float(float scroll_x); +CIMGUI_API void igSetScrollY_Float(float scroll_y); +CIMGUI_API float igGetScrollMaxX(void); +CIMGUI_API float igGetScrollMaxY(void); +CIMGUI_API void igSetScrollHereX(float center_x_ratio); +CIMGUI_API void igSetScrollHereY(float center_y_ratio); +CIMGUI_API void igSetScrollFromPosX_Float(float local_x,float center_x_ratio); +CIMGUI_API void igSetScrollFromPosY_Float(float local_y,float center_y_ratio); +CIMGUI_API void igPushFont(ImFont* font); +CIMGUI_API void igPopFont(void); +CIMGUI_API void igPushStyleColor_U32(ImGuiCol idx,ImU32 col); +CIMGUI_API void igPushStyleColor_Vec4(ImGuiCol idx,const ImVec4 col); +CIMGUI_API void igPopStyleColor(int count); +CIMGUI_API void igPushStyleVar_Float(ImGuiStyleVar idx,float val); +CIMGUI_API void igPushStyleVar_Vec2(ImGuiStyleVar idx,const ImVec2 val); +CIMGUI_API void igPopStyleVar(int count); +CIMGUI_API void igPushTabStop(bool tab_stop); +CIMGUI_API void igPopTabStop(void); +CIMGUI_API void igPushButtonRepeat(bool repeat); +CIMGUI_API void igPopButtonRepeat(void); +CIMGUI_API void igPushItemWidth(float item_width); +CIMGUI_API void igPopItemWidth(void); +CIMGUI_API void igSetNextItemWidth(float item_width); +CIMGUI_API float igCalcItemWidth(void); +CIMGUI_API void igPushTextWrapPos(float wrap_local_pos_x); +CIMGUI_API void igPopTextWrapPos(void); +CIMGUI_API ImFont* igGetFont(void); +CIMGUI_API float igGetFontSize(void); +CIMGUI_API void igGetFontTexUvWhitePixel(ImVec2 *pOut); +CIMGUI_API ImU32 igGetColorU32_Col(ImGuiCol idx,float alpha_mul); +CIMGUI_API ImU32 igGetColorU32_Vec4(const ImVec4 col); +CIMGUI_API ImU32 igGetColorU32_U32(ImU32 col); +CIMGUI_API const ImVec4* igGetStyleColorVec4(ImGuiCol idx); +CIMGUI_API void igSeparator(void); +CIMGUI_API void igSameLine(float offset_from_start_x,float spacing); +CIMGUI_API void igNewLine(void); +CIMGUI_API void igSpacing(void); +CIMGUI_API void igDummy(const ImVec2 size); +CIMGUI_API void igIndent(float indent_w); +CIMGUI_API void igUnindent(float indent_w); +CIMGUI_API void igBeginGroup(void); +CIMGUI_API void igEndGroup(void); +CIMGUI_API void igGetCursorPos(ImVec2 *pOut); +CIMGUI_API float igGetCursorPosX(void); +CIMGUI_API float igGetCursorPosY(void); +CIMGUI_API void igSetCursorPos(const ImVec2 local_pos); +CIMGUI_API void igSetCursorPosX(float local_x); +CIMGUI_API void igSetCursorPosY(float local_y); +CIMGUI_API void igGetCursorStartPos(ImVec2 *pOut); +CIMGUI_API void igGetCursorScreenPos(ImVec2 *pOut); +CIMGUI_API void igSetCursorScreenPos(const ImVec2 pos); +CIMGUI_API void igAlignTextToFramePadding(void); +CIMGUI_API float igGetTextLineHeight(void); +CIMGUI_API float igGetTextLineHeightWithSpacing(void); +CIMGUI_API float igGetFrameHeight(void); +CIMGUI_API float igGetFrameHeightWithSpacing(void); +CIMGUI_API void igPushID_Str(const char* str_id); +CIMGUI_API void igPushID_StrStr(const char* str_id_begin,const char* str_id_end); +CIMGUI_API void igPushID_Ptr(const void* ptr_id); +CIMGUI_API void igPushID_Int(int int_id); +CIMGUI_API void igPopID(void); +CIMGUI_API ImGuiID igGetID_Str(const char* str_id); +CIMGUI_API ImGuiID igGetID_StrStr(const char* str_id_begin,const char* str_id_end); +CIMGUI_API ImGuiID igGetID_Ptr(const void* ptr_id); +CIMGUI_API void igTextUnformatted(const char* text,const char* text_end); +CIMGUI_API void igText(const char* fmt,...); +CIMGUI_API void igTextV(const char* fmt,va_list args); +CIMGUI_API void igTextColored(const ImVec4 col,const char* fmt,...); +CIMGUI_API void igTextColoredV(const ImVec4 col,const char* fmt,va_list args); +CIMGUI_API void igTextDisabled(const char* fmt,...); +CIMGUI_API void igTextDisabledV(const char* fmt,va_list args); +CIMGUI_API void igTextWrapped(const char* fmt,...); +CIMGUI_API void igTextWrappedV(const char* fmt,va_list args); +CIMGUI_API void igLabelText(const char* label,const char* fmt,...); +CIMGUI_API void igLabelTextV(const char* label,const char* fmt,va_list args); +CIMGUI_API void igBulletText(const char* fmt,...); +CIMGUI_API void igBulletTextV(const char* fmt,va_list args); +CIMGUI_API void igSeparatorText(const char* label); +CIMGUI_API bool igButton(const char* label,const ImVec2 size); +CIMGUI_API bool igSmallButton(const char* label); +CIMGUI_API bool igInvisibleButton(const char* str_id,const ImVec2 size,ImGuiButtonFlags flags); +CIMGUI_API bool igArrowButton(const char* str_id,ImGuiDir dir); +CIMGUI_API bool igCheckbox(const char* label,bool* v); +CIMGUI_API bool igCheckboxFlags_IntPtr(const char* label,int* flags,int flags_value); +CIMGUI_API bool igCheckboxFlags_UintPtr(const char* label,unsigned int* flags,unsigned int flags_value); +CIMGUI_API bool igRadioButton_Bool(const char* label,bool active); +CIMGUI_API bool igRadioButton_IntPtr(const char* label,int* v,int v_button); +CIMGUI_API void igProgressBar(float fraction,const ImVec2 size_arg,const char* overlay); +CIMGUI_API void igBullet(void); +CIMGUI_API void igImage(ImTextureID user_texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 tint_col,const ImVec4 border_col); +CIMGUI_API bool igImageButton(const char* str_id,ImTextureID user_texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 bg_col,const ImVec4 tint_col); +CIMGUI_API bool igBeginCombo(const char* label,const char* preview_value,ImGuiComboFlags flags); +CIMGUI_API void igEndCombo(void); +CIMGUI_API bool igCombo_Str_arr(const char* label,int* current_item,const char* const items[],int items_count,int popup_max_height_in_items); +CIMGUI_API bool igCombo_Str(const char* label,int* current_item,const char* items_separated_by_zeros,int popup_max_height_in_items); +CIMGUI_API bool igCombo_FnBoolPtr(const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int popup_max_height_in_items); +CIMGUI_API bool igDragFloat(const char* label,float* v,float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragFloat2(const char* label,float v[2],float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragFloat3(const char* label,float v[3],float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragFloat4(const char* label,float v[4],float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragFloatRange2(const char* label,float* v_current_min,float* v_current_max,float v_speed,float v_min,float v_max,const char* format,const char* format_max,ImGuiSliderFlags flags); +CIMGUI_API bool igDragInt(const char* label,int* v,float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragInt2(const char* label,int v[2],float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragInt3(const char* label,int v[3],float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragInt4(const char* label,int v[4],float v_speed,int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragIntRange2(const char* label,int* v_current_min,int* v_current_max,float v_speed,int v_min,int v_max,const char* format,const char* format_max,ImGuiSliderFlags flags); +CIMGUI_API bool igDragScalar(const char* label,ImGuiDataType data_type,void* p_data,float v_speed,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igDragScalarN(const char* label,ImGuiDataType data_type,void* p_data,int components,float v_speed,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderFloat(const char* label,float* v,float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderFloat2(const char* label,float v[2],float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderFloat3(const char* label,float v[3],float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderFloat4(const char* label,float v[4],float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderAngle(const char* label,float* v_rad,float v_degrees_min,float v_degrees_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderInt(const char* label,int* v,int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderInt2(const char* label,int v[2],int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderInt3(const char* label,int v[3],int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderInt4(const char* label,int v[4],int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderScalar(const char* label,ImGuiDataType data_type,void* p_data,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderScalarN(const char* label,ImGuiDataType data_type,void* p_data,int components,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igVSliderFloat(const char* label,const ImVec2 size,float* v,float v_min,float v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igVSliderInt(const char* label,const ImVec2 size,int* v,int v_min,int v_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igVSliderScalar(const char* label,const ImVec2 size,ImGuiDataType data_type,void* p_data,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igInputText(const char* label,char* buf,size_t buf_size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data); +CIMGUI_API bool igInputTextMultiline(const char* label,char* buf,size_t buf_size,const ImVec2 size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data); +CIMGUI_API bool igInputTextWithHint(const char* label,const char* hint,char* buf,size_t buf_size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data); +CIMGUI_API bool igInputFloat(const char* label,float* v,float step,float step_fast,const char* format,ImGuiInputTextFlags flags); +CIMGUI_API bool igInputFloat2(const char* label,float v[2],const char* format,ImGuiInputTextFlags flags); +CIMGUI_API bool igInputFloat3(const char* label,float v[3],const char* format,ImGuiInputTextFlags flags); +CIMGUI_API bool igInputFloat4(const char* label,float v[4],const char* format,ImGuiInputTextFlags flags); +CIMGUI_API bool igInputInt(const char* label,int* v,int step,int step_fast,ImGuiInputTextFlags flags); +CIMGUI_API bool igInputInt2(const char* label,int v[2],ImGuiInputTextFlags flags); +CIMGUI_API bool igInputInt3(const char* label,int v[3],ImGuiInputTextFlags flags); +CIMGUI_API bool igInputInt4(const char* label,int v[4],ImGuiInputTextFlags flags); +CIMGUI_API bool igInputDouble(const char* label,double* v,double step,double step_fast,const char* format,ImGuiInputTextFlags flags); +CIMGUI_API bool igInputScalar(const char* label,ImGuiDataType data_type,void* p_data,const void* p_step,const void* p_step_fast,const char* format,ImGuiInputTextFlags flags); +CIMGUI_API bool igInputScalarN(const char* label,ImGuiDataType data_type,void* p_data,int components,const void* p_step,const void* p_step_fast,const char* format,ImGuiInputTextFlags flags); +CIMGUI_API bool igColorEdit3(const char* label,float col[3],ImGuiColorEditFlags flags); +CIMGUI_API bool igColorEdit4(const char* label,float col[4],ImGuiColorEditFlags flags); +CIMGUI_API bool igColorPicker3(const char* label,float col[3],ImGuiColorEditFlags flags); +CIMGUI_API bool igColorPicker4(const char* label,float col[4],ImGuiColorEditFlags flags,const float* ref_col); +CIMGUI_API bool igColorButton(const char* desc_id,const ImVec4 col,ImGuiColorEditFlags flags,const ImVec2 size); +CIMGUI_API void igSetColorEditOptions(ImGuiColorEditFlags flags); +CIMGUI_API bool igTreeNode_Str(const char* label); +CIMGUI_API bool igTreeNode_StrStr(const char* str_id,const char* fmt,...); +CIMGUI_API bool igTreeNode_Ptr(const void* ptr_id,const char* fmt,...); +CIMGUI_API bool igTreeNodeV_Str(const char* str_id,const char* fmt,va_list args); +CIMGUI_API bool igTreeNodeV_Ptr(const void* ptr_id,const char* fmt,va_list args); +CIMGUI_API bool igTreeNodeEx_Str(const char* label,ImGuiTreeNodeFlags flags); +CIMGUI_API bool igTreeNodeEx_StrStr(const char* str_id,ImGuiTreeNodeFlags flags,const char* fmt,...); +CIMGUI_API bool igTreeNodeEx_Ptr(const void* ptr_id,ImGuiTreeNodeFlags flags,const char* fmt,...); +CIMGUI_API bool igTreeNodeExV_Str(const char* str_id,ImGuiTreeNodeFlags flags,const char* fmt,va_list args); +CIMGUI_API bool igTreeNodeExV_Ptr(const void* ptr_id,ImGuiTreeNodeFlags flags,const char* fmt,va_list args); +CIMGUI_API void igTreePush_Str(const char* str_id); +CIMGUI_API void igTreePush_Ptr(const void* ptr_id); +CIMGUI_API void igTreePop(void); +CIMGUI_API float igGetTreeNodeToLabelSpacing(void); +CIMGUI_API bool igCollapsingHeader_TreeNodeFlags(const char* label,ImGuiTreeNodeFlags flags); +CIMGUI_API bool igCollapsingHeader_BoolPtr(const char* label,bool* p_visible,ImGuiTreeNodeFlags flags); +CIMGUI_API void igSetNextItemOpen(bool is_open,ImGuiCond cond); +CIMGUI_API bool igSelectable_Bool(const char* label,bool selected,ImGuiSelectableFlags flags,const ImVec2 size); +CIMGUI_API bool igSelectable_BoolPtr(const char* label,bool* p_selected,ImGuiSelectableFlags flags,const ImVec2 size); +CIMGUI_API bool igBeginListBox(const char* label,const ImVec2 size); +CIMGUI_API void igEndListBox(void); +CIMGUI_API bool igListBox_Str_arr(const char* label,int* current_item,const char* const items[],int items_count,int height_in_items); +CIMGUI_API bool igListBox_FnBoolPtr(const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int height_in_items); +CIMGUI_API void igPlotLines_FloatPtr(const char* label,const float* values,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride); +CIMGUI_API void igPlotLines_FnFloatPtr(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size); +CIMGUI_API void igPlotHistogram_FloatPtr(const char* label,const float* values,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride); +CIMGUI_API void igPlotHistogram_FnFloatPtr(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size); +CIMGUI_API void igValue_Bool(const char* prefix,bool b); +CIMGUI_API void igValue_Int(const char* prefix,int v); +CIMGUI_API void igValue_Uint(const char* prefix,unsigned int v); +CIMGUI_API void igValue_Float(const char* prefix,float v,const char* float_format); +CIMGUI_API bool igBeginMenuBar(void); +CIMGUI_API void igEndMenuBar(void); +CIMGUI_API bool igBeginMainMenuBar(void); +CIMGUI_API void igEndMainMenuBar(void); +CIMGUI_API bool igBeginMenu(const char* label,bool enabled); +CIMGUI_API void igEndMenu(void); +CIMGUI_API bool igMenuItem_Bool(const char* label,const char* shortcut,bool selected,bool enabled); +CIMGUI_API bool igMenuItem_BoolPtr(const char* label,const char* shortcut,bool* p_selected,bool enabled); +CIMGUI_API bool igBeginTooltip(void); +CIMGUI_API void igEndTooltip(void); +CIMGUI_API void igSetTooltip(const char* fmt,...); +CIMGUI_API void igSetTooltipV(const char* fmt,va_list args); +CIMGUI_API bool igBeginItemTooltip(void); +CIMGUI_API void igSetItemTooltip(const char* fmt,...); +CIMGUI_API void igSetItemTooltipV(const char* fmt,va_list args); +CIMGUI_API bool igBeginPopup(const char* str_id,ImGuiWindowFlags flags); +CIMGUI_API bool igBeginPopupModal(const char* name,bool* p_open,ImGuiWindowFlags flags); +CIMGUI_API void igEndPopup(void); +CIMGUI_API void igOpenPopup_Str(const char* str_id,ImGuiPopupFlags popup_flags); +CIMGUI_API void igOpenPopup_ID(ImGuiID id,ImGuiPopupFlags popup_flags); +CIMGUI_API void igOpenPopupOnItemClick(const char* str_id,ImGuiPopupFlags popup_flags); +CIMGUI_API void igCloseCurrentPopup(void); +CIMGUI_API bool igBeginPopupContextItem(const char* str_id,ImGuiPopupFlags popup_flags); +CIMGUI_API bool igBeginPopupContextWindow(const char* str_id,ImGuiPopupFlags popup_flags); +CIMGUI_API bool igBeginPopupContextVoid(const char* str_id,ImGuiPopupFlags popup_flags); +CIMGUI_API bool igIsPopupOpen_Str(const char* str_id,ImGuiPopupFlags flags); +CIMGUI_API bool igBeginTable(const char* str_id,int column,ImGuiTableFlags flags,const ImVec2 outer_size,float inner_width); +CIMGUI_API void igEndTable(void); +CIMGUI_API void igTableNextRow(ImGuiTableRowFlags row_flags,float min_row_height); +CIMGUI_API bool igTableNextColumn(void); +CIMGUI_API bool igTableSetColumnIndex(int column_n); +CIMGUI_API void igTableSetupColumn(const char* label,ImGuiTableColumnFlags flags,float init_width_or_weight,ImGuiID user_id); +CIMGUI_API void igTableSetupScrollFreeze(int cols,int rows); +CIMGUI_API void igTableHeadersRow(void); +CIMGUI_API void igTableHeader(const char* label); +CIMGUI_API ImGuiTableSortSpecs* igTableGetSortSpecs(void); +CIMGUI_API int igTableGetColumnCount(void); +CIMGUI_API int igTableGetColumnIndex(void); +CIMGUI_API int igTableGetRowIndex(void); +CIMGUI_API const char* igTableGetColumnName_Int(int column_n); +CIMGUI_API ImGuiTableColumnFlags igTableGetColumnFlags(int column_n); +CIMGUI_API void igTableSetColumnEnabled(int column_n,bool v); +CIMGUI_API void igTableSetBgColor(ImGuiTableBgTarget target,ImU32 color,int column_n); +CIMGUI_API void igColumns(int count,const char* id,bool border); +CIMGUI_API void igNextColumn(void); +CIMGUI_API int igGetColumnIndex(void); +CIMGUI_API float igGetColumnWidth(int column_index); +CIMGUI_API void igSetColumnWidth(int column_index,float width); +CIMGUI_API float igGetColumnOffset(int column_index); +CIMGUI_API void igSetColumnOffset(int column_index,float offset_x); +CIMGUI_API int igGetColumnsCount(void); +CIMGUI_API bool igBeginTabBar(const char* str_id,ImGuiTabBarFlags flags); +CIMGUI_API void igEndTabBar(void); +CIMGUI_API bool igBeginTabItem(const char* label,bool* p_open,ImGuiTabItemFlags flags); +CIMGUI_API void igEndTabItem(void); +CIMGUI_API bool igTabItemButton(const char* label,ImGuiTabItemFlags flags); +CIMGUI_API void igSetTabItemClosed(const char* tab_or_docked_window_label); +CIMGUI_API ImGuiID igDockSpace(ImGuiID id,const ImVec2 size,ImGuiDockNodeFlags flags,const ImGuiWindowClass* window_class); +CIMGUI_API ImGuiID igDockSpaceOverViewport(const ImGuiViewport* viewport,ImGuiDockNodeFlags flags,const ImGuiWindowClass* window_class); +CIMGUI_API void igSetNextWindowDockID(ImGuiID dock_id,ImGuiCond cond); +CIMGUI_API void igSetNextWindowClass(const ImGuiWindowClass* window_class); +CIMGUI_API ImGuiID igGetWindowDockID(void); +CIMGUI_API bool igIsWindowDocked(void); +CIMGUI_API void igLogToTTY(int auto_open_depth); +CIMGUI_API void igLogToFile(int auto_open_depth,const char* filename); +CIMGUI_API void igLogToClipboard(int auto_open_depth); +CIMGUI_API void igLogFinish(void); +CIMGUI_API void igLogButtons(void); +CIMGUI_API void igLogTextV(const char* fmt,va_list args); +CIMGUI_API bool igBeginDragDropSource(ImGuiDragDropFlags flags); +CIMGUI_API bool igSetDragDropPayload(const char* type,const void* data,size_t sz,ImGuiCond cond); +CIMGUI_API void igEndDragDropSource(void); +CIMGUI_API bool igBeginDragDropTarget(void); +CIMGUI_API const ImGuiPayload* igAcceptDragDropPayload(const char* type,ImGuiDragDropFlags flags); +CIMGUI_API void igEndDragDropTarget(void); +CIMGUI_API const ImGuiPayload* igGetDragDropPayload(void); +CIMGUI_API void igBeginDisabled(bool disabled); +CIMGUI_API void igEndDisabled(void); +CIMGUI_API void igPushClipRect(const ImVec2 clip_rect_min,const ImVec2 clip_rect_max,bool intersect_with_current_clip_rect); +CIMGUI_API void igPopClipRect(void); +CIMGUI_API void igSetItemDefaultFocus(void); +CIMGUI_API void igSetKeyboardFocusHere(int offset); +CIMGUI_API void igSetNextItemAllowOverlap(void); +CIMGUI_API bool igIsItemHovered(ImGuiHoveredFlags flags); +CIMGUI_API bool igIsItemActive(void); +CIMGUI_API bool igIsItemFocused(void); +CIMGUI_API bool igIsItemClicked(ImGuiMouseButton mouse_button); +CIMGUI_API bool igIsItemVisible(void); +CIMGUI_API bool igIsItemEdited(void); +CIMGUI_API bool igIsItemActivated(void); +CIMGUI_API bool igIsItemDeactivated(void); +CIMGUI_API bool igIsItemDeactivatedAfterEdit(void); +CIMGUI_API bool igIsItemToggledOpen(void); +CIMGUI_API bool igIsAnyItemHovered(void); +CIMGUI_API bool igIsAnyItemActive(void); +CIMGUI_API bool igIsAnyItemFocused(void); +CIMGUI_API ImGuiID igGetItemID(void); +CIMGUI_API void igGetItemRectMin(ImVec2 *pOut); +CIMGUI_API void igGetItemRectMax(ImVec2 *pOut); +CIMGUI_API void igGetItemRectSize(ImVec2 *pOut); +CIMGUI_API ImGuiViewport* igGetMainViewport(void); +CIMGUI_API ImDrawList* igGetBackgroundDrawList_Nil(void); +CIMGUI_API ImDrawList* igGetForegroundDrawList_Nil(void); +CIMGUI_API ImDrawList* igGetBackgroundDrawList_ViewportPtr(ImGuiViewport* viewport); +CIMGUI_API ImDrawList* igGetForegroundDrawList_ViewportPtr(ImGuiViewport* viewport); +CIMGUI_API bool igIsRectVisible_Nil(const ImVec2 size); +CIMGUI_API bool igIsRectVisible_Vec2(const ImVec2 rect_min,const ImVec2 rect_max); +CIMGUI_API double igGetTime(void); +CIMGUI_API int igGetFrameCount(void); +CIMGUI_API ImDrawListSharedData* igGetDrawListSharedData(void); +CIMGUI_API const char* igGetStyleColorName(ImGuiCol idx); +CIMGUI_API void igSetStateStorage(ImGuiStorage* storage); +CIMGUI_API ImGuiStorage* igGetStateStorage(void); +CIMGUI_API bool igBeginChildFrame(ImGuiID id,const ImVec2 size,ImGuiWindowFlags flags); +CIMGUI_API void igEndChildFrame(void); +CIMGUI_API void igCalcTextSize(ImVec2 *pOut,const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width); +CIMGUI_API void igColorConvertU32ToFloat4(ImVec4 *pOut,ImU32 in); +CIMGUI_API ImU32 igColorConvertFloat4ToU32(const ImVec4 in); +CIMGUI_API void igColorConvertRGBtoHSV(float r,float g,float b,float* out_h,float* out_s,float* out_v); +CIMGUI_API void igColorConvertHSVtoRGB(float h,float s,float v,float* out_r,float* out_g,float* out_b); +CIMGUI_API bool igIsKeyDown_Nil(ImGuiKey key); +CIMGUI_API bool igIsKeyPressed_Bool(ImGuiKey key,bool repeat); +CIMGUI_API bool igIsKeyReleased_Nil(ImGuiKey key); +CIMGUI_API int igGetKeyPressedAmount(ImGuiKey key,float repeat_delay,float rate); +CIMGUI_API const char* igGetKeyName(ImGuiKey key); +CIMGUI_API void igSetNextFrameWantCaptureKeyboard(bool want_capture_keyboard); +CIMGUI_API bool igIsMouseDown_Nil(ImGuiMouseButton button); +CIMGUI_API bool igIsMouseClicked_Bool(ImGuiMouseButton button,bool repeat); +CIMGUI_API bool igIsMouseReleased_Nil(ImGuiMouseButton button); +CIMGUI_API bool igIsMouseDoubleClicked(ImGuiMouseButton button); +CIMGUI_API int igGetMouseClickedCount(ImGuiMouseButton button); +CIMGUI_API bool igIsMouseHoveringRect(const ImVec2 r_min,const ImVec2 r_max,bool clip); +CIMGUI_API bool igIsMousePosValid(const ImVec2* mouse_pos); +CIMGUI_API bool igIsAnyMouseDown(void); +CIMGUI_API void igGetMousePos(ImVec2 *pOut); +CIMGUI_API void igGetMousePosOnOpeningCurrentPopup(ImVec2 *pOut); +CIMGUI_API bool igIsMouseDragging(ImGuiMouseButton button,float lock_threshold); +CIMGUI_API void igGetMouseDragDelta(ImVec2 *pOut,ImGuiMouseButton button,float lock_threshold); +CIMGUI_API void igResetMouseDragDelta(ImGuiMouseButton button); +CIMGUI_API ImGuiMouseCursor igGetMouseCursor(void); +CIMGUI_API void igSetMouseCursor(ImGuiMouseCursor cursor_type); +CIMGUI_API void igSetNextFrameWantCaptureMouse(bool want_capture_mouse); +CIMGUI_API const char* igGetClipboardText(void); +CIMGUI_API void igSetClipboardText(const char* text); +CIMGUI_API void igLoadIniSettingsFromDisk(const char* ini_filename); +CIMGUI_API void igLoadIniSettingsFromMemory(const char* ini_data,size_t ini_size); +CIMGUI_API void igSaveIniSettingsToDisk(const char* ini_filename); +CIMGUI_API const char* igSaveIniSettingsToMemory(size_t* out_ini_size); +CIMGUI_API void igDebugTextEncoding(const char* text); +CIMGUI_API bool igDebugCheckVersionAndDataLayout(const char* version_str,size_t sz_io,size_t sz_style,size_t sz_vec2,size_t sz_vec4,size_t sz_drawvert,size_t sz_drawidx); +CIMGUI_API void igSetAllocatorFunctions(ImGuiMemAllocFunc alloc_func,ImGuiMemFreeFunc free_func,void* user_data); +CIMGUI_API void igGetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func,ImGuiMemFreeFunc* p_free_func,void** p_user_data); +CIMGUI_API void* igMemAlloc(size_t size); +CIMGUI_API void igMemFree(void* ptr); +CIMGUI_API ImGuiPlatformIO* igGetPlatformIO(void); +CIMGUI_API void igUpdatePlatformWindows(void); +CIMGUI_API void igRenderPlatformWindowsDefault(void* platform_render_arg,void* renderer_render_arg); +CIMGUI_API void igDestroyPlatformWindows(void); +CIMGUI_API ImGuiViewport* igFindViewportByID(ImGuiID id); +CIMGUI_API ImGuiViewport* igFindViewportByPlatformHandle(void* platform_handle); +CIMGUI_API ImGuiStyle* ImGuiStyle_ImGuiStyle(void); +CIMGUI_API void ImGuiStyle_destroy(ImGuiStyle* self); +CIMGUI_API void ImGuiStyle_ScaleAllSizes(ImGuiStyle* self,float scale_factor); +CIMGUI_API void ImGuiIO_AddKeyEvent(ImGuiIO* self,ImGuiKey key,bool down); +CIMGUI_API void ImGuiIO_AddKeyAnalogEvent(ImGuiIO* self,ImGuiKey key,bool down,float v); +CIMGUI_API void ImGuiIO_AddMousePosEvent(ImGuiIO* self,float x,float y); +CIMGUI_API void ImGuiIO_AddMouseButtonEvent(ImGuiIO* self,int button,bool down); +CIMGUI_API void ImGuiIO_AddMouseWheelEvent(ImGuiIO* self,float wheel_x,float wheel_y); +CIMGUI_API void ImGuiIO_AddMouseSourceEvent(ImGuiIO* self,ImGuiMouseSource source); +CIMGUI_API void ImGuiIO_AddMouseViewportEvent(ImGuiIO* self,ImGuiID id); +CIMGUI_API void ImGuiIO_AddFocusEvent(ImGuiIO* self,bool focused); +CIMGUI_API void ImGuiIO_AddInputCharacter(ImGuiIO* self,unsigned int c); +CIMGUI_API void ImGuiIO_AddInputCharacterUTF16(ImGuiIO* self,ImWchar16 c); +CIMGUI_API void ImGuiIO_AddInputCharactersUTF8(ImGuiIO* self,const char* str); +CIMGUI_API void ImGuiIO_SetKeyEventNativeData(ImGuiIO* self,ImGuiKey key,int native_keycode,int native_scancode,int native_legacy_index); +CIMGUI_API void ImGuiIO_SetAppAcceptingEvents(ImGuiIO* self,bool accepting_events); +CIMGUI_API void ImGuiIO_ClearEventsQueue(ImGuiIO* self); +CIMGUI_API void ImGuiIO_ClearInputKeys(ImGuiIO* self); +CIMGUI_API ImGuiIO* ImGuiIO_ImGuiIO(void); +CIMGUI_API void ImGuiIO_destroy(ImGuiIO* self); +CIMGUI_API ImGuiInputTextCallbackData* ImGuiInputTextCallbackData_ImGuiInputTextCallbackData(void); +CIMGUI_API void ImGuiInputTextCallbackData_destroy(ImGuiInputTextCallbackData* self); +CIMGUI_API void ImGuiInputTextCallbackData_DeleteChars(ImGuiInputTextCallbackData* self,int pos,int bytes_count); +CIMGUI_API void ImGuiInputTextCallbackData_InsertChars(ImGuiInputTextCallbackData* self,int pos,const char* text,const char* text_end); +CIMGUI_API void ImGuiInputTextCallbackData_SelectAll(ImGuiInputTextCallbackData* self); +CIMGUI_API void ImGuiInputTextCallbackData_ClearSelection(ImGuiInputTextCallbackData* self); +CIMGUI_API bool ImGuiInputTextCallbackData_HasSelection(ImGuiInputTextCallbackData* self); +CIMGUI_API ImGuiWindowClass* ImGuiWindowClass_ImGuiWindowClass(void); +CIMGUI_API void ImGuiWindowClass_destroy(ImGuiWindowClass* self); +CIMGUI_API ImGuiPayload* ImGuiPayload_ImGuiPayload(void); +CIMGUI_API void ImGuiPayload_destroy(ImGuiPayload* self); +CIMGUI_API void ImGuiPayload_Clear(ImGuiPayload* self); +CIMGUI_API bool ImGuiPayload_IsDataType(ImGuiPayload* self,const char* type); +CIMGUI_API bool ImGuiPayload_IsPreview(ImGuiPayload* self); +CIMGUI_API bool ImGuiPayload_IsDelivery(ImGuiPayload* self); +CIMGUI_API ImGuiTableColumnSortSpecs* ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs(void); +CIMGUI_API void ImGuiTableColumnSortSpecs_destroy(ImGuiTableColumnSortSpecs* self); +CIMGUI_API ImGuiTableSortSpecs* ImGuiTableSortSpecs_ImGuiTableSortSpecs(void); +CIMGUI_API void ImGuiTableSortSpecs_destroy(ImGuiTableSortSpecs* self); +CIMGUI_API ImGuiOnceUponAFrame* ImGuiOnceUponAFrame_ImGuiOnceUponAFrame(void); +CIMGUI_API void ImGuiOnceUponAFrame_destroy(ImGuiOnceUponAFrame* self); +CIMGUI_API ImGuiTextFilter* ImGuiTextFilter_ImGuiTextFilter(const char* default_filter); +CIMGUI_API void ImGuiTextFilter_destroy(ImGuiTextFilter* self); +CIMGUI_API bool ImGuiTextFilter_Draw(ImGuiTextFilter* self,const char* label,float width); +CIMGUI_API bool ImGuiTextFilter_PassFilter(ImGuiTextFilter* self,const char* text,const char* text_end); +CIMGUI_API void ImGuiTextFilter_Build(ImGuiTextFilter* self); +CIMGUI_API void ImGuiTextFilter_Clear(ImGuiTextFilter* self); +CIMGUI_API bool ImGuiTextFilter_IsActive(ImGuiTextFilter* self); +CIMGUI_API ImGuiTextRange* ImGuiTextRange_ImGuiTextRange_Nil(void); +CIMGUI_API void ImGuiTextRange_destroy(ImGuiTextRange* self); +CIMGUI_API ImGuiTextRange* ImGuiTextRange_ImGuiTextRange_Str(const char* _b,const char* _e); +CIMGUI_API bool ImGuiTextRange_empty(ImGuiTextRange* self); +CIMGUI_API void ImGuiTextRange_split(ImGuiTextRange* self,char separator,ImVector_ImGuiTextRange* out); +CIMGUI_API ImGuiTextBuffer* ImGuiTextBuffer_ImGuiTextBuffer(void); +CIMGUI_API void ImGuiTextBuffer_destroy(ImGuiTextBuffer* self); +CIMGUI_API const char* ImGuiTextBuffer_begin(ImGuiTextBuffer* self); +CIMGUI_API const char* ImGuiTextBuffer_end(ImGuiTextBuffer* self); +CIMGUI_API int ImGuiTextBuffer_size(ImGuiTextBuffer* self); +CIMGUI_API bool ImGuiTextBuffer_empty(ImGuiTextBuffer* self); +CIMGUI_API void ImGuiTextBuffer_clear(ImGuiTextBuffer* self); +CIMGUI_API void ImGuiTextBuffer_reserve(ImGuiTextBuffer* self,int capacity); +CIMGUI_API const char* ImGuiTextBuffer_c_str(ImGuiTextBuffer* self); +CIMGUI_API void ImGuiTextBuffer_append(ImGuiTextBuffer* self,const char* str,const char* str_end); +CIMGUI_API void ImGuiTextBuffer_appendfv(ImGuiTextBuffer* self,const char* fmt,va_list args); +CIMGUI_API ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Int(ImGuiID _key,int _val_i); +CIMGUI_API void ImGuiStoragePair_destroy(ImGuiStoragePair* self); +CIMGUI_API ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Float(ImGuiID _key,float _val_f); +CIMGUI_API ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Ptr(ImGuiID _key,void* _val_p); +CIMGUI_API void ImGuiStorage_Clear(ImGuiStorage* self); +CIMGUI_API int ImGuiStorage_GetInt(ImGuiStorage* self,ImGuiID key,int default_val); +CIMGUI_API void ImGuiStorage_SetInt(ImGuiStorage* self,ImGuiID key,int val); +CIMGUI_API bool ImGuiStorage_GetBool(ImGuiStorage* self,ImGuiID key,bool default_val); +CIMGUI_API void ImGuiStorage_SetBool(ImGuiStorage* self,ImGuiID key,bool val); +CIMGUI_API float ImGuiStorage_GetFloat(ImGuiStorage* self,ImGuiID key,float default_val); +CIMGUI_API void ImGuiStorage_SetFloat(ImGuiStorage* self,ImGuiID key,float val); +CIMGUI_API void* ImGuiStorage_GetVoidPtr(ImGuiStorage* self,ImGuiID key); +CIMGUI_API void ImGuiStorage_SetVoidPtr(ImGuiStorage* self,ImGuiID key,void* val); +CIMGUI_API int* ImGuiStorage_GetIntRef(ImGuiStorage* self,ImGuiID key,int default_val); +CIMGUI_API bool* ImGuiStorage_GetBoolRef(ImGuiStorage* self,ImGuiID key,bool default_val); +CIMGUI_API float* ImGuiStorage_GetFloatRef(ImGuiStorage* self,ImGuiID key,float default_val); +CIMGUI_API void** ImGuiStorage_GetVoidPtrRef(ImGuiStorage* self,ImGuiID key,void* default_val); +CIMGUI_API void ImGuiStorage_SetAllInt(ImGuiStorage* self,int val); +CIMGUI_API void ImGuiStorage_BuildSortByKey(ImGuiStorage* self); +CIMGUI_API ImGuiListClipper* ImGuiListClipper_ImGuiListClipper(void); +CIMGUI_API void ImGuiListClipper_destroy(ImGuiListClipper* self); +CIMGUI_API void ImGuiListClipper_Begin(ImGuiListClipper* self,int items_count,float items_height); +CIMGUI_API void ImGuiListClipper_End(ImGuiListClipper* self); +CIMGUI_API bool ImGuiListClipper_Step(ImGuiListClipper* self); +CIMGUI_API void ImGuiListClipper_IncludeItemByIndex(ImGuiListClipper* self,int item_index); +CIMGUI_API void ImGuiListClipper_IncludeItemsByIndex(ImGuiListClipper* self,int item_begin,int item_end); +CIMGUI_API ImColor* ImColor_ImColor_Nil(void); +CIMGUI_API void ImColor_destroy(ImColor* self); +CIMGUI_API ImColor* ImColor_ImColor_Float(float r,float g,float b,float a); +CIMGUI_API ImColor* ImColor_ImColor_Vec4(const ImVec4 col); +CIMGUI_API ImColor* ImColor_ImColor_Int(int r,int g,int b,int a); +CIMGUI_API ImColor* ImColor_ImColor_U32(ImU32 rgba); +CIMGUI_API void ImColor_SetHSV(ImColor* self,float h,float s,float v,float a); +CIMGUI_API void ImColor_HSV(ImColor *pOut,float h,float s,float v,float a); +CIMGUI_API ImDrawCmd* ImDrawCmd_ImDrawCmd(void); +CIMGUI_API void ImDrawCmd_destroy(ImDrawCmd* self); +CIMGUI_API ImTextureID ImDrawCmd_GetTexID(ImDrawCmd* self); +CIMGUI_API ImDrawListSplitter* ImDrawListSplitter_ImDrawListSplitter(void); +CIMGUI_API void ImDrawListSplitter_destroy(ImDrawListSplitter* self); +CIMGUI_API void ImDrawListSplitter_Clear(ImDrawListSplitter* self); +CIMGUI_API void ImDrawListSplitter_ClearFreeMemory(ImDrawListSplitter* self); +CIMGUI_API void ImDrawListSplitter_Split(ImDrawListSplitter* self,ImDrawList* draw_list,int count); +CIMGUI_API void ImDrawListSplitter_Merge(ImDrawListSplitter* self,ImDrawList* draw_list); +CIMGUI_API void ImDrawListSplitter_SetCurrentChannel(ImDrawListSplitter* self,ImDrawList* draw_list,int channel_idx); +CIMGUI_API ImDrawList* ImDrawList_ImDrawList(ImDrawListSharedData* shared_data); +CIMGUI_API void ImDrawList_destroy(ImDrawList* self); +CIMGUI_API void ImDrawList_PushClipRect(ImDrawList* self,const ImVec2 clip_rect_min,const ImVec2 clip_rect_max,bool intersect_with_current_clip_rect); +CIMGUI_API void ImDrawList_PushClipRectFullScreen(ImDrawList* self); +CIMGUI_API void ImDrawList_PopClipRect(ImDrawList* self); +CIMGUI_API void ImDrawList_PushTextureID(ImDrawList* self,ImTextureID texture_id); +CIMGUI_API void ImDrawList_PopTextureID(ImDrawList* self); +CIMGUI_API void ImDrawList_GetClipRectMin(ImVec2 *pOut,ImDrawList* self); +CIMGUI_API void ImDrawList_GetClipRectMax(ImVec2 *pOut,ImDrawList* self); +CIMGUI_API void ImDrawList_AddLine(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,ImU32 col,float thickness); +CIMGUI_API void ImDrawList_AddRect(ImDrawList* self,const ImVec2 p_min,const ImVec2 p_max,ImU32 col,float rounding,ImDrawFlags flags,float thickness); +CIMGUI_API void ImDrawList_AddRectFilled(ImDrawList* self,const ImVec2 p_min,const ImVec2 p_max,ImU32 col,float rounding,ImDrawFlags flags); +CIMGUI_API void ImDrawList_AddRectFilledMultiColor(ImDrawList* self,const ImVec2 p_min,const ImVec2 p_max,ImU32 col_upr_left,ImU32 col_upr_right,ImU32 col_bot_right,ImU32 col_bot_left); +CIMGUI_API void ImDrawList_AddQuad(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col,float thickness); +CIMGUI_API void ImDrawList_AddQuadFilled(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col); +CIMGUI_API void ImDrawList_AddTriangle(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,ImU32 col,float thickness); +CIMGUI_API void ImDrawList_AddTriangleFilled(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,ImU32 col); +CIMGUI_API void ImDrawList_AddCircle(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments,float thickness); +CIMGUI_API void ImDrawList_AddCircleFilled(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments); +CIMGUI_API void ImDrawList_AddNgon(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments,float thickness); +CIMGUI_API void ImDrawList_AddNgonFilled(ImDrawList* self,const ImVec2 center,float radius,ImU32 col,int num_segments); +CIMGUI_API void ImDrawList_AddText_Vec2(ImDrawList* self,const ImVec2 pos,ImU32 col,const char* text_begin,const char* text_end); +CIMGUI_API void ImDrawList_AddText_FontPtr(ImDrawList* self,const ImFont* font,float font_size,const ImVec2 pos,ImU32 col,const char* text_begin,const char* text_end,float wrap_width,const ImVec4* cpu_fine_clip_rect); +CIMGUI_API void ImDrawList_AddPolyline(ImDrawList* self,const ImVec2* points,int num_points,ImU32 col,ImDrawFlags flags,float thickness); +CIMGUI_API void ImDrawList_AddConvexPolyFilled(ImDrawList* self,const ImVec2* points,int num_points,ImU32 col); +CIMGUI_API void ImDrawList_AddBezierCubic(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col,float thickness,int num_segments); +CIMGUI_API void ImDrawList_AddBezierQuadratic(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,ImU32 col,float thickness,int num_segments); +CIMGUI_API void ImDrawList_AddImage(ImDrawList* self,ImTextureID user_texture_id,const ImVec2 p_min,const ImVec2 p_max,const ImVec2 uv_min,const ImVec2 uv_max,ImU32 col); +CIMGUI_API void ImDrawList_AddImageQuad(ImDrawList* self,ImTextureID user_texture_id,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 uv1,const ImVec2 uv2,const ImVec2 uv3,const ImVec2 uv4,ImU32 col); +CIMGUI_API void ImDrawList_AddImageRounded(ImDrawList* self,ImTextureID user_texture_id,const ImVec2 p_min,const ImVec2 p_max,const ImVec2 uv_min,const ImVec2 uv_max,ImU32 col,float rounding,ImDrawFlags flags); +CIMGUI_API void ImDrawList_PathClear(ImDrawList* self); +CIMGUI_API void ImDrawList_PathLineTo(ImDrawList* self,const ImVec2 pos); +CIMGUI_API void ImDrawList_PathLineToMergeDuplicate(ImDrawList* self,const ImVec2 pos); +CIMGUI_API void ImDrawList_PathFillConvex(ImDrawList* self,ImU32 col); +CIMGUI_API void ImDrawList_PathStroke(ImDrawList* self,ImU32 col,ImDrawFlags flags,float thickness); +CIMGUI_API void ImDrawList_PathArcTo(ImDrawList* self,const ImVec2 center,float radius,float a_min,float a_max,int num_segments); +CIMGUI_API void ImDrawList_PathArcToFast(ImDrawList* self,const ImVec2 center,float radius,int a_min_of_12,int a_max_of_12); +CIMGUI_API void ImDrawList_PathBezierCubicCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,int num_segments); +CIMGUI_API void ImDrawList_PathBezierQuadraticCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,int num_segments); +CIMGUI_API void ImDrawList_PathRect(ImDrawList* self,const ImVec2 rect_min,const ImVec2 rect_max,float rounding,ImDrawFlags flags); +CIMGUI_API void ImDrawList_AddCallback(ImDrawList* self,ImDrawCallback callback,void* callback_data); +CIMGUI_API void ImDrawList_AddDrawCmd(ImDrawList* self); +CIMGUI_API ImDrawList* ImDrawList_CloneOutput(ImDrawList* self); +CIMGUI_API void ImDrawList_ChannelsSplit(ImDrawList* self,int count); +CIMGUI_API void ImDrawList_ChannelsMerge(ImDrawList* self); +CIMGUI_API void ImDrawList_ChannelsSetCurrent(ImDrawList* self,int n); +CIMGUI_API void ImDrawList_PrimReserve(ImDrawList* self,int idx_count,int vtx_count); +CIMGUI_API void ImDrawList_PrimUnreserve(ImDrawList* self,int idx_count,int vtx_count); +CIMGUI_API void ImDrawList_PrimRect(ImDrawList* self,const ImVec2 a,const ImVec2 b,ImU32 col); +CIMGUI_API void ImDrawList_PrimRectUV(ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 uv_a,const ImVec2 uv_b,ImU32 col); +CIMGUI_API void ImDrawList_PrimQuadUV(ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 d,const ImVec2 uv_a,const ImVec2 uv_b,const ImVec2 uv_c,const ImVec2 uv_d,ImU32 col); +CIMGUI_API void ImDrawList_PrimWriteVtx(ImDrawList* self,const ImVec2 pos,const ImVec2 uv,ImU32 col); +CIMGUI_API void ImDrawList_PrimWriteIdx(ImDrawList* self,ImDrawIdx idx); +CIMGUI_API void ImDrawList_PrimVtx(ImDrawList* self,const ImVec2 pos,const ImVec2 uv,ImU32 col); +CIMGUI_API void ImDrawList__ResetForNewFrame(ImDrawList* self); +CIMGUI_API void ImDrawList__ClearFreeMemory(ImDrawList* self); +CIMGUI_API void ImDrawList__PopUnusedDrawCmd(ImDrawList* self); +CIMGUI_API void ImDrawList__TryMergeDrawCmds(ImDrawList* self); +CIMGUI_API void ImDrawList__OnChangedClipRect(ImDrawList* self); +CIMGUI_API void ImDrawList__OnChangedTextureID(ImDrawList* self); +CIMGUI_API void ImDrawList__OnChangedVtxOffset(ImDrawList* self); +CIMGUI_API int ImDrawList__CalcCircleAutoSegmentCount(ImDrawList* self,float radius); +CIMGUI_API void ImDrawList__PathArcToFastEx(ImDrawList* self,const ImVec2 center,float radius,int a_min_sample,int a_max_sample,int a_step); +CIMGUI_API void ImDrawList__PathArcToN(ImDrawList* self,const ImVec2 center,float radius,float a_min,float a_max,int num_segments); +CIMGUI_API ImDrawData* ImDrawData_ImDrawData(void); +CIMGUI_API void ImDrawData_destroy(ImDrawData* self); +CIMGUI_API void ImDrawData_Clear(ImDrawData* self); +CIMGUI_API void ImDrawData_AddDrawList(ImDrawData* self,ImDrawList* draw_list); +CIMGUI_API void ImDrawData_DeIndexAllBuffers(ImDrawData* self); +CIMGUI_API void ImDrawData_ScaleClipRects(ImDrawData* self,const ImVec2 fb_scale); +CIMGUI_API ImFontConfig* ImFontConfig_ImFontConfig(void); +CIMGUI_API void ImFontConfig_destroy(ImFontConfig* self); +CIMGUI_API ImFontGlyphRangesBuilder* ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder(void); +CIMGUI_API void ImFontGlyphRangesBuilder_destroy(ImFontGlyphRangesBuilder* self); +CIMGUI_API void ImFontGlyphRangesBuilder_Clear(ImFontGlyphRangesBuilder* self); +CIMGUI_API bool ImFontGlyphRangesBuilder_GetBit(ImFontGlyphRangesBuilder* self,size_t n); +CIMGUI_API void ImFontGlyphRangesBuilder_SetBit(ImFontGlyphRangesBuilder* self,size_t n); +CIMGUI_API void ImFontGlyphRangesBuilder_AddChar(ImFontGlyphRangesBuilder* self,ImWchar c); +CIMGUI_API void ImFontGlyphRangesBuilder_AddText(ImFontGlyphRangesBuilder* self,const char* text,const char* text_end); +CIMGUI_API void ImFontGlyphRangesBuilder_AddRanges(ImFontGlyphRangesBuilder* self,const ImWchar* ranges); +CIMGUI_API void ImFontGlyphRangesBuilder_BuildRanges(ImFontGlyphRangesBuilder* self,ImVector_ImWchar* out_ranges); +CIMGUI_API ImFontAtlasCustomRect* ImFontAtlasCustomRect_ImFontAtlasCustomRect(void); +CIMGUI_API void ImFontAtlasCustomRect_destroy(ImFontAtlasCustomRect* self); +CIMGUI_API bool ImFontAtlasCustomRect_IsPacked(ImFontAtlasCustomRect* self); +CIMGUI_API ImFontAtlas* ImFontAtlas_ImFontAtlas(void); +CIMGUI_API void ImFontAtlas_destroy(ImFontAtlas* self); +CIMGUI_API ImFont* ImFontAtlas_AddFont(ImFontAtlas* self,const ImFontConfig* font_cfg); +CIMGUI_API ImFont* ImFontAtlas_AddFontDefault(ImFontAtlas* self,const ImFontConfig* font_cfg); +CIMGUI_API ImFont* ImFontAtlas_AddFontFromFileTTF(ImFontAtlas* self,const char* filename,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges); +CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* self,void* font_data,int font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges); +CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self,const void* compressed_font_data,int compressed_font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges); +CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self,const char* compressed_font_data_base85,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges); +CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self); +CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self); +CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self); +CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self); +CIMGUI_API bool ImFontAtlas_Build(ImFontAtlas* self); +CIMGUI_API void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel); +CIMGUI_API void ImFontAtlas_GetTexDataAsRGBA32(ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel); +CIMGUI_API bool ImFontAtlas_IsBuilt(ImFontAtlas* self); +CIMGUI_API void ImFontAtlas_SetTexID(ImFontAtlas* self,ImTextureID id); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesDefault(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesGreek(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesKorean(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesJapanese(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesChineseFull(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesCyrillic(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesThai(ImFontAtlas* self); +CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesVietnamese(ImFontAtlas* self); +CIMGUI_API int ImFontAtlas_AddCustomRectRegular(ImFontAtlas* self,int width,int height); +CIMGUI_API int ImFontAtlas_AddCustomRectFontGlyph(ImFontAtlas* self,ImFont* font,ImWchar id,int width,int height,float advance_x,const ImVec2 offset); +CIMGUI_API ImFontAtlasCustomRect* ImFontAtlas_GetCustomRectByIndex(ImFontAtlas* self,int index); +CIMGUI_API void ImFontAtlas_CalcCustomRectUV(ImFontAtlas* self,const ImFontAtlasCustomRect* rect,ImVec2* out_uv_min,ImVec2* out_uv_max); +CIMGUI_API bool ImFontAtlas_GetMouseCursorTexData(ImFontAtlas* self,ImGuiMouseCursor cursor,ImVec2* out_offset,ImVec2* out_size,ImVec2 out_uv_border[2],ImVec2 out_uv_fill[2]); +CIMGUI_API ImFont* ImFont_ImFont(void); +CIMGUI_API void ImFont_destroy(ImFont* self); +CIMGUI_API const ImFontGlyph* ImFont_FindGlyph(ImFont* self,ImWchar c); +CIMGUI_API const ImFontGlyph* ImFont_FindGlyphNoFallback(ImFont* self,ImWchar c); +CIMGUI_API float ImFont_GetCharAdvance(ImFont* self,ImWchar c); +CIMGUI_API bool ImFont_IsLoaded(ImFont* self); +CIMGUI_API const char* ImFont_GetDebugName(ImFont* self); +CIMGUI_API void ImFont_CalcTextSizeA(ImVec2 *pOut,ImFont* self,float size,float max_width,float wrap_width,const char* text_begin,const char* text_end,const char** remaining); +CIMGUI_API const char* ImFont_CalcWordWrapPositionA(ImFont* self,float scale,const char* text,const char* text_end,float wrap_width); +CIMGUI_API void ImFont_RenderChar(ImFont* self,ImDrawList* draw_list,float size,const ImVec2 pos,ImU32 col,ImWchar c); +CIMGUI_API void ImFont_RenderText(ImFont* self,ImDrawList* draw_list,float size,const ImVec2 pos,ImU32 col,const ImVec4 clip_rect,const char* text_begin,const char* text_end,float wrap_width,bool cpu_fine_clip); +CIMGUI_API void ImFont_BuildLookupTable(ImFont* self); +CIMGUI_API void ImFont_ClearOutputData(ImFont* self); +CIMGUI_API void ImFont_GrowIndex(ImFont* self,int new_size); +CIMGUI_API void ImFont_AddGlyph(ImFont* self,const ImFontConfig* src_cfg,ImWchar c,float x0,float y0,float x1,float y1,float u0,float v0,float u1,float v1,float advance_x); +CIMGUI_API void ImFont_AddRemapChar(ImFont* self,ImWchar dst,ImWchar src,bool overwrite_dst); +CIMGUI_API void ImFont_SetGlyphVisible(ImFont* self,ImWchar c,bool visible); +CIMGUI_API bool ImFont_IsGlyphRangeUnused(ImFont* self,unsigned int c_begin,unsigned int c_last); +CIMGUI_API ImGuiViewport* ImGuiViewport_ImGuiViewport(void); +CIMGUI_API void ImGuiViewport_destroy(ImGuiViewport* self); +CIMGUI_API void ImGuiViewport_GetCenter(ImVec2 *pOut,ImGuiViewport* self); +CIMGUI_API void ImGuiViewport_GetWorkCenter(ImVec2 *pOut,ImGuiViewport* self); +CIMGUI_API ImGuiPlatformIO* ImGuiPlatformIO_ImGuiPlatformIO(void); +CIMGUI_API void ImGuiPlatformIO_destroy(ImGuiPlatformIO* self); +CIMGUI_API ImGuiPlatformMonitor* ImGuiPlatformMonitor_ImGuiPlatformMonitor(void); +CIMGUI_API void ImGuiPlatformMonitor_destroy(ImGuiPlatformMonitor* self); +CIMGUI_API ImGuiPlatformImeData* ImGuiPlatformImeData_ImGuiPlatformImeData(void); +CIMGUI_API void ImGuiPlatformImeData_destroy(ImGuiPlatformImeData* self); +CIMGUI_API ImGuiKey igGetKeyIndex(ImGuiKey key); +CIMGUI_API ImGuiID igImHashData(const void* data,size_t data_size,ImGuiID seed); +CIMGUI_API ImGuiID igImHashStr(const char* data,size_t data_size,ImGuiID seed); +CIMGUI_API void igImQsort(void* base,size_t count,size_t size_of_element,int(*compare_func)(void const*,void const*)); +CIMGUI_API ImU32 igImAlphaBlendColors(ImU32 col_a,ImU32 col_b); +CIMGUI_API bool igImIsPowerOfTwo_Int(int v); +CIMGUI_API bool igImIsPowerOfTwo_U64(ImU64 v); +CIMGUI_API int igImUpperPowerOfTwo(int v); +CIMGUI_API int igImStricmp(const char* str1,const char* str2); +CIMGUI_API int igImStrnicmp(const char* str1,const char* str2,size_t count); +CIMGUI_API void igImStrncpy(char* dst,const char* src,size_t count); +CIMGUI_API char* igImStrdup(const char* str); +CIMGUI_API char* igImStrdupcpy(char* dst,size_t* p_dst_size,const char* str); +CIMGUI_API const char* igImStrchrRange(const char* str_begin,const char* str_end,char c); +CIMGUI_API int igImStrlenW(const ImWchar* str); +CIMGUI_API const char* igImStreolRange(const char* str,const char* str_end); +CIMGUI_API const ImWchar* igImStrbolW(const ImWchar* buf_mid_line,const ImWchar* buf_begin); +CIMGUI_API const char* igImStristr(const char* haystack,const char* haystack_end,const char* needle,const char* needle_end); +CIMGUI_API void igImStrTrimBlanks(char* str); +CIMGUI_API const char* igImStrSkipBlank(const char* str); +CIMGUI_API char igImToUpper(char c); +CIMGUI_API bool igImCharIsBlankA(char c); +CIMGUI_API bool igImCharIsBlankW(unsigned int c); +CIMGUI_API int igImFormatString(char* buf,size_t buf_size,const char* fmt,...); +CIMGUI_API int igImFormatStringV(char* buf,size_t buf_size,const char* fmt,va_list args); +CIMGUI_API void igImFormatStringToTempBuffer(const char** out_buf,const char** out_buf_end,const char* fmt,...); +CIMGUI_API void igImFormatStringToTempBufferV(const char** out_buf,const char** out_buf_end,const char* fmt,va_list args); +CIMGUI_API const char* igImParseFormatFindStart(const char* format); +CIMGUI_API const char* igImParseFormatFindEnd(const char* format); +CIMGUI_API const char* igImParseFormatTrimDecorations(const char* format,char* buf,size_t buf_size); +CIMGUI_API void igImParseFormatSanitizeForPrinting(const char* fmt_in,char* fmt_out,size_t fmt_out_size); +CIMGUI_API const char* igImParseFormatSanitizeForScanning(const char* fmt_in,char* fmt_out,size_t fmt_out_size); +CIMGUI_API int igImParseFormatPrecision(const char* format,int default_value); +CIMGUI_API const char* igImTextCharToUtf8(char out_buf[5],unsigned int c); +CIMGUI_API int igImTextStrToUtf8(char* out_buf,int out_buf_size,const ImWchar* in_text,const ImWchar* in_text_end); +CIMGUI_API int igImTextCharFromUtf8(unsigned int* out_char,const char* in_text,const char* in_text_end); +CIMGUI_API int igImTextStrFromUtf8(ImWchar* out_buf,int out_buf_size,const char* in_text,const char* in_text_end,const char** in_remaining); +CIMGUI_API int igImTextCountCharsFromUtf8(const char* in_text,const char* in_text_end); +CIMGUI_API int igImTextCountUtf8BytesFromChar(const char* in_text,const char* in_text_end); +CIMGUI_API int igImTextCountUtf8BytesFromStr(const ImWchar* in_text,const ImWchar* in_text_end); +CIMGUI_API ImFileHandle igImFileOpen(const char* filename,const char* mode); +CIMGUI_API bool igImFileClose(ImFileHandle file); +CIMGUI_API ImU64 igImFileGetSize(ImFileHandle file); +CIMGUI_API ImU64 igImFileRead(void* data,ImU64 size,ImU64 count,ImFileHandle file); +CIMGUI_API ImU64 igImFileWrite(const void* data,ImU64 size,ImU64 count,ImFileHandle file); +CIMGUI_API void* igImFileLoadToMemory(const char* filename,const char* mode,size_t* out_file_size,int padding_bytes); +CIMGUI_API float igImPow_Float(float x,float y); +CIMGUI_API double igImPow_double(double x,double y); +CIMGUI_API float igImLog_Float(float x); +CIMGUI_API double igImLog_double(double x); +CIMGUI_API int igImAbs_Int(int x); +CIMGUI_API float igImAbs_Float(float x); +CIMGUI_API double igImAbs_double(double x); +CIMGUI_API float igImSign_Float(float x); +CIMGUI_API double igImSign_double(double x); +CIMGUI_API float igImRsqrt_Float(float x); +CIMGUI_API double igImRsqrt_double(double x); +CIMGUI_API void igImMin(ImVec2 *pOut,const ImVec2 lhs,const ImVec2 rhs); +CIMGUI_API void igImMax(ImVec2 *pOut,const ImVec2 lhs,const ImVec2 rhs); +CIMGUI_API void igImClamp(ImVec2 *pOut,const ImVec2 v,const ImVec2 mn,ImVec2 mx); +CIMGUI_API void igImLerp_Vec2Float(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,float t); +CIMGUI_API void igImLerp_Vec2Vec2(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,const ImVec2 t); +CIMGUI_API void igImLerp_Vec4(ImVec4 *pOut,const ImVec4 a,const ImVec4 b,float t); +CIMGUI_API float igImSaturate(float f); +CIMGUI_API float igImLengthSqr_Vec2(const ImVec2 lhs); +CIMGUI_API float igImLengthSqr_Vec4(const ImVec4 lhs); +CIMGUI_API float igImInvLength(const ImVec2 lhs,float fail_value); +CIMGUI_API float igImFloor_Float(float f); +CIMGUI_API float igImFloorSigned_Float(float f); +CIMGUI_API void igImFloor_Vec2(ImVec2 *pOut,const ImVec2 v); +CIMGUI_API void igImFloorSigned_Vec2(ImVec2 *pOut,const ImVec2 v); +CIMGUI_API int igImModPositive(int a,int b); +CIMGUI_API float igImDot(const ImVec2 a,const ImVec2 b); +CIMGUI_API void igImRotate(ImVec2 *pOut,const ImVec2 v,float cos_a,float sin_a); +CIMGUI_API float igImLinearSweep(float current,float target,float speed); +CIMGUI_API void igImMul(ImVec2 *pOut,const ImVec2 lhs,const ImVec2 rhs); +CIMGUI_API bool igImIsFloatAboveGuaranteedIntegerPrecision(float f); +CIMGUI_API float igImExponentialMovingAverage(float avg,float sample,int n); +CIMGUI_API void igImBezierCubicCalc(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,float t); +CIMGUI_API void igImBezierCubicClosestPoint(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,int num_segments); +CIMGUI_API void igImBezierCubicClosestPointCasteljau(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,float tess_tol); +CIMGUI_API void igImBezierQuadraticCalc(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,float t); +CIMGUI_API void igImLineClosestPoint(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,const ImVec2 p); +CIMGUI_API bool igImTriangleContainsPoint(const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 p); +CIMGUI_API void igImTriangleClosestPoint(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 p); +CIMGUI_API void igImTriangleBarycentricCoords(const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 p,float* out_u,float* out_v,float* out_w); +CIMGUI_API float igImTriangleArea(const ImVec2 a,const ImVec2 b,const ImVec2 c); +CIMGUI_API ImVec1* ImVec1_ImVec1_Nil(void); +CIMGUI_API void ImVec1_destroy(ImVec1* self); +CIMGUI_API ImVec1* ImVec1_ImVec1_Float(float _x); +CIMGUI_API ImVec2ih* ImVec2ih_ImVec2ih_Nil(void); +CIMGUI_API void ImVec2ih_destroy(ImVec2ih* self); +CIMGUI_API ImVec2ih* ImVec2ih_ImVec2ih_short(short _x,short _y); +CIMGUI_API ImVec2ih* ImVec2ih_ImVec2ih_Vec2(const ImVec2 rhs); +CIMGUI_API ImRect* ImRect_ImRect_Nil(void); +CIMGUI_API void ImRect_destroy(ImRect* self); +CIMGUI_API ImRect* ImRect_ImRect_Vec2(const ImVec2 min,const ImVec2 max); +CIMGUI_API ImRect* ImRect_ImRect_Vec4(const ImVec4 v); +CIMGUI_API ImRect* ImRect_ImRect_Float(float x1,float y1,float x2,float y2); +CIMGUI_API void ImRect_GetCenter(ImVec2 *pOut,ImRect* self); +CIMGUI_API void ImRect_GetSize(ImVec2 *pOut,ImRect* self); +CIMGUI_API float ImRect_GetWidth(ImRect* self); +CIMGUI_API float ImRect_GetHeight(ImRect* self); +CIMGUI_API float ImRect_GetArea(ImRect* self); +CIMGUI_API void ImRect_GetTL(ImVec2 *pOut,ImRect* self); +CIMGUI_API void ImRect_GetTR(ImVec2 *pOut,ImRect* self); +CIMGUI_API void ImRect_GetBL(ImVec2 *pOut,ImRect* self); +CIMGUI_API void ImRect_GetBR(ImVec2 *pOut,ImRect* self); +CIMGUI_API bool ImRect_Contains_Vec2(ImRect* self,const ImVec2 p); +CIMGUI_API bool ImRect_Contains_Rect(ImRect* self,const ImRect r); +CIMGUI_API bool ImRect_Overlaps(ImRect* self,const ImRect r); +CIMGUI_API void ImRect_Add_Vec2(ImRect* self,const ImVec2 p); +CIMGUI_API void ImRect_Add_Rect(ImRect* self,const ImRect r); +CIMGUI_API void ImRect_Expand_Float(ImRect* self,const float amount); +CIMGUI_API void ImRect_Expand_Vec2(ImRect* self,const ImVec2 amount); +CIMGUI_API void ImRect_Translate(ImRect* self,const ImVec2 d); +CIMGUI_API void ImRect_TranslateX(ImRect* self,float dx); +CIMGUI_API void ImRect_TranslateY(ImRect* self,float dy); +CIMGUI_API void ImRect_ClipWith(ImRect* self,const ImRect r); +CIMGUI_API void ImRect_ClipWithFull(ImRect* self,const ImRect r); +CIMGUI_API void ImRect_Floor(ImRect* self); +CIMGUI_API bool ImRect_IsInverted(ImRect* self); +CIMGUI_API void ImRect_ToVec4(ImVec4 *pOut,ImRect* self); +CIMGUI_API size_t igImBitArrayGetStorageSizeInBytes(int bitcount); +CIMGUI_API void igImBitArrayClearAllBits(ImU32* arr,int bitcount); +CIMGUI_API bool igImBitArrayTestBit(const ImU32* arr,int n); +CIMGUI_API void igImBitArrayClearBit(ImU32* arr,int n); +CIMGUI_API void igImBitArraySetBit(ImU32* arr,int n); +CIMGUI_API void igImBitArraySetBitRange(ImU32* arr,int n,int n2); +CIMGUI_API void ImBitVector_Create(ImBitVector* self,int sz); +CIMGUI_API void ImBitVector_Clear(ImBitVector* self); +CIMGUI_API bool ImBitVector_TestBit(ImBitVector* self,int n); +CIMGUI_API void ImBitVector_SetBit(ImBitVector* self,int n); +CIMGUI_API void ImBitVector_ClearBit(ImBitVector* self,int n); +CIMGUI_API void ImGuiTextIndex_clear(ImGuiTextIndex* self); +CIMGUI_API int ImGuiTextIndex_size(ImGuiTextIndex* self); +CIMGUI_API const char* ImGuiTextIndex_get_line_begin(ImGuiTextIndex* self,const char* base,int n); +CIMGUI_API const char* ImGuiTextIndex_get_line_end(ImGuiTextIndex* self,const char* base,int n); +CIMGUI_API void ImGuiTextIndex_append(ImGuiTextIndex* self,const char* base,int old_size,int new_size); +CIMGUI_API ImDrawListSharedData* ImDrawListSharedData_ImDrawListSharedData(void); +CIMGUI_API void ImDrawListSharedData_destroy(ImDrawListSharedData* self); +CIMGUI_API void ImDrawListSharedData_SetCircleTessellationMaxError(ImDrawListSharedData* self,float max_error); +CIMGUI_API ImDrawDataBuilder* ImDrawDataBuilder_ImDrawDataBuilder(void); +CIMGUI_API void ImDrawDataBuilder_destroy(ImDrawDataBuilder* self); +CIMGUI_API void* ImGuiDataVarInfo_GetVarPtr(ImGuiDataVarInfo* self,void* parent); +CIMGUI_API ImGuiStyleMod* ImGuiStyleMod_ImGuiStyleMod_Int(ImGuiStyleVar idx,int v); +CIMGUI_API void ImGuiStyleMod_destroy(ImGuiStyleMod* self); +CIMGUI_API ImGuiStyleMod* ImGuiStyleMod_ImGuiStyleMod_Float(ImGuiStyleVar idx,float v); +CIMGUI_API ImGuiStyleMod* ImGuiStyleMod_ImGuiStyleMod_Vec2(ImGuiStyleVar idx,ImVec2 v); +CIMGUI_API ImGuiComboPreviewData* ImGuiComboPreviewData_ImGuiComboPreviewData(void); +CIMGUI_API void ImGuiComboPreviewData_destroy(ImGuiComboPreviewData* self); +CIMGUI_API ImGuiMenuColumns* ImGuiMenuColumns_ImGuiMenuColumns(void); +CIMGUI_API void ImGuiMenuColumns_destroy(ImGuiMenuColumns* self); +CIMGUI_API void ImGuiMenuColumns_Update(ImGuiMenuColumns* self,float spacing,bool window_reappearing); +CIMGUI_API float ImGuiMenuColumns_DeclColumns(ImGuiMenuColumns* self,float w_icon,float w_label,float w_shortcut,float w_mark); +CIMGUI_API void ImGuiMenuColumns_CalcNextTotalWidth(ImGuiMenuColumns* self,bool update_offsets); +CIMGUI_API ImGuiInputTextDeactivatedState* ImGuiInputTextDeactivatedState_ImGuiInputTextDeactivatedState(void); +CIMGUI_API void ImGuiInputTextDeactivatedState_destroy(ImGuiInputTextDeactivatedState* self); +CIMGUI_API void ImGuiInputTextDeactivatedState_ClearFreeMemory(ImGuiInputTextDeactivatedState* self); +CIMGUI_API ImGuiInputTextState* ImGuiInputTextState_ImGuiInputTextState(void); +CIMGUI_API void ImGuiInputTextState_destroy(ImGuiInputTextState* self); +CIMGUI_API void ImGuiInputTextState_ClearText(ImGuiInputTextState* self); +CIMGUI_API void ImGuiInputTextState_ClearFreeMemory(ImGuiInputTextState* self); +CIMGUI_API int ImGuiInputTextState_GetUndoAvailCount(ImGuiInputTextState* self); +CIMGUI_API int ImGuiInputTextState_GetRedoAvailCount(ImGuiInputTextState* self); +CIMGUI_API void ImGuiInputTextState_OnKeyPressed(ImGuiInputTextState* self,int key); +CIMGUI_API void ImGuiInputTextState_CursorAnimReset(ImGuiInputTextState* self); +CIMGUI_API void ImGuiInputTextState_CursorClamp(ImGuiInputTextState* self); +CIMGUI_API bool ImGuiInputTextState_HasSelection(ImGuiInputTextState* self); +CIMGUI_API void ImGuiInputTextState_ClearSelection(ImGuiInputTextState* self); +CIMGUI_API int ImGuiInputTextState_GetCursorPos(ImGuiInputTextState* self); +CIMGUI_API int ImGuiInputTextState_GetSelectionStart(ImGuiInputTextState* self); +CIMGUI_API int ImGuiInputTextState_GetSelectionEnd(ImGuiInputTextState* self); +CIMGUI_API void ImGuiInputTextState_SelectAll(ImGuiInputTextState* self); +CIMGUI_API ImGuiPopupData* ImGuiPopupData_ImGuiPopupData(void); +CIMGUI_API void ImGuiPopupData_destroy(ImGuiPopupData* self); +CIMGUI_API ImGuiNextWindowData* ImGuiNextWindowData_ImGuiNextWindowData(void); +CIMGUI_API void ImGuiNextWindowData_destroy(ImGuiNextWindowData* self); +CIMGUI_API void ImGuiNextWindowData_ClearFlags(ImGuiNextWindowData* self); +CIMGUI_API ImGuiNextItemData* ImGuiNextItemData_ImGuiNextItemData(void); +CIMGUI_API void ImGuiNextItemData_destroy(ImGuiNextItemData* self); +CIMGUI_API void ImGuiNextItemData_ClearFlags(ImGuiNextItemData* self); +CIMGUI_API ImGuiLastItemData* ImGuiLastItemData_ImGuiLastItemData(void); +CIMGUI_API void ImGuiLastItemData_destroy(ImGuiLastItemData* self); +CIMGUI_API ImGuiStackSizes* ImGuiStackSizes_ImGuiStackSizes(void); +CIMGUI_API void ImGuiStackSizes_destroy(ImGuiStackSizes* self); +CIMGUI_API void ImGuiStackSizes_SetToContextState(ImGuiStackSizes* self,ImGuiContext* ctx); +CIMGUI_API void ImGuiStackSizes_CompareWithContextState(ImGuiStackSizes* self,ImGuiContext* ctx); +CIMGUI_API ImGuiPtrOrIndex* ImGuiPtrOrIndex_ImGuiPtrOrIndex_Ptr(void* ptr); +CIMGUI_API void ImGuiPtrOrIndex_destroy(ImGuiPtrOrIndex* self); +CIMGUI_API ImGuiPtrOrIndex* ImGuiPtrOrIndex_ImGuiPtrOrIndex_Int(int index); +CIMGUI_API ImGuiInputEvent* ImGuiInputEvent_ImGuiInputEvent(void); +CIMGUI_API void ImGuiInputEvent_destroy(ImGuiInputEvent* self); +CIMGUI_API ImGuiKeyRoutingData* ImGuiKeyRoutingData_ImGuiKeyRoutingData(void); +CIMGUI_API void ImGuiKeyRoutingData_destroy(ImGuiKeyRoutingData* self); +CIMGUI_API ImGuiKeyRoutingTable* ImGuiKeyRoutingTable_ImGuiKeyRoutingTable(void); +CIMGUI_API void ImGuiKeyRoutingTable_destroy(ImGuiKeyRoutingTable* self); +CIMGUI_API void ImGuiKeyRoutingTable_Clear(ImGuiKeyRoutingTable* self); +CIMGUI_API ImGuiKeyOwnerData* ImGuiKeyOwnerData_ImGuiKeyOwnerData(void); +CIMGUI_API void ImGuiKeyOwnerData_destroy(ImGuiKeyOwnerData* self); +CIMGUI_API ImGuiListClipperRange ImGuiListClipperRange_FromIndices(int min,int max); +CIMGUI_API ImGuiListClipperRange ImGuiListClipperRange_FromPositions(float y1,float y2,int off_min,int off_max); +CIMGUI_API ImGuiListClipperData* ImGuiListClipperData_ImGuiListClipperData(void); +CIMGUI_API void ImGuiListClipperData_destroy(ImGuiListClipperData* self); +CIMGUI_API void ImGuiListClipperData_Reset(ImGuiListClipperData* self,ImGuiListClipper* clipper); +CIMGUI_API ImGuiNavItemData* ImGuiNavItemData_ImGuiNavItemData(void); +CIMGUI_API void ImGuiNavItemData_destroy(ImGuiNavItemData* self); +CIMGUI_API void ImGuiNavItemData_Clear(ImGuiNavItemData* self); +CIMGUI_API ImGuiOldColumnData* ImGuiOldColumnData_ImGuiOldColumnData(void); +CIMGUI_API void ImGuiOldColumnData_destroy(ImGuiOldColumnData* self); +CIMGUI_API ImGuiOldColumns* ImGuiOldColumns_ImGuiOldColumns(void); +CIMGUI_API void ImGuiOldColumns_destroy(ImGuiOldColumns* self); +CIMGUI_API ImGuiDockNode* ImGuiDockNode_ImGuiDockNode(ImGuiID id); +CIMGUI_API void ImGuiDockNode_destroy(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsRootNode(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsDockSpace(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsFloatingNode(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsCentralNode(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsHiddenTabBar(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsNoTabBar(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsSplitNode(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsLeafNode(ImGuiDockNode* self); +CIMGUI_API bool ImGuiDockNode_IsEmpty(ImGuiDockNode* self); +CIMGUI_API void ImGuiDockNode_Rect(ImRect *pOut,ImGuiDockNode* self); +CIMGUI_API void ImGuiDockNode_SetLocalFlags(ImGuiDockNode* self,ImGuiDockNodeFlags flags); +CIMGUI_API void ImGuiDockNode_UpdateMergedFlags(ImGuiDockNode* self); +CIMGUI_API ImGuiDockContext* ImGuiDockContext_ImGuiDockContext(void); +CIMGUI_API void ImGuiDockContext_destroy(ImGuiDockContext* self); +CIMGUI_API ImGuiViewportP* ImGuiViewportP_ImGuiViewportP(void); +CIMGUI_API void ImGuiViewportP_destroy(ImGuiViewportP* self); +CIMGUI_API void ImGuiViewportP_ClearRequestFlags(ImGuiViewportP* self); +CIMGUI_API void ImGuiViewportP_CalcWorkRectPos(ImVec2 *pOut,ImGuiViewportP* self,const ImVec2 off_min); +CIMGUI_API void ImGuiViewportP_CalcWorkRectSize(ImVec2 *pOut,ImGuiViewportP* self,const ImVec2 off_min,const ImVec2 off_max); +CIMGUI_API void ImGuiViewportP_UpdateWorkRect(ImGuiViewportP* self); +CIMGUI_API void ImGuiViewportP_GetMainRect(ImRect *pOut,ImGuiViewportP* self); +CIMGUI_API void ImGuiViewportP_GetWorkRect(ImRect *pOut,ImGuiViewportP* self); +CIMGUI_API void ImGuiViewportP_GetBuildWorkRect(ImRect *pOut,ImGuiViewportP* self); +CIMGUI_API ImGuiWindowSettings* ImGuiWindowSettings_ImGuiWindowSettings(void); +CIMGUI_API void ImGuiWindowSettings_destroy(ImGuiWindowSettings* self); +CIMGUI_API char* ImGuiWindowSettings_GetName(ImGuiWindowSettings* self); +CIMGUI_API ImGuiSettingsHandler* ImGuiSettingsHandler_ImGuiSettingsHandler(void); +CIMGUI_API void ImGuiSettingsHandler_destroy(ImGuiSettingsHandler* self); +CIMGUI_API ImGuiStackLevelInfo* ImGuiStackLevelInfo_ImGuiStackLevelInfo(void); +CIMGUI_API void ImGuiStackLevelInfo_destroy(ImGuiStackLevelInfo* self); +CIMGUI_API ImGuiStackTool* ImGuiStackTool_ImGuiStackTool(void); +CIMGUI_API void ImGuiStackTool_destroy(ImGuiStackTool* self); +CIMGUI_API ImGuiContextHook* ImGuiContextHook_ImGuiContextHook(void); +CIMGUI_API void ImGuiContextHook_destroy(ImGuiContextHook* self); +CIMGUI_API ImGuiContext* ImGuiContext_ImGuiContext(ImFontAtlas* shared_font_atlas); +CIMGUI_API void ImGuiContext_destroy(ImGuiContext* self); +CIMGUI_API ImGuiWindow* ImGuiWindow_ImGuiWindow(ImGuiContext* context,const char* name); +CIMGUI_API void ImGuiWindow_destroy(ImGuiWindow* self); +CIMGUI_API ImGuiID ImGuiWindow_GetID_Str(ImGuiWindow* self,const char* str,const char* str_end); +CIMGUI_API ImGuiID ImGuiWindow_GetID_Ptr(ImGuiWindow* self,const void* ptr); +CIMGUI_API ImGuiID ImGuiWindow_GetID_Int(ImGuiWindow* self,int n); +CIMGUI_API ImGuiID ImGuiWindow_GetIDFromRectangle(ImGuiWindow* self,const ImRect r_abs); +CIMGUI_API void ImGuiWindow_Rect(ImRect *pOut,ImGuiWindow* self); +CIMGUI_API float ImGuiWindow_CalcFontSize(ImGuiWindow* self); +CIMGUI_API float ImGuiWindow_TitleBarHeight(ImGuiWindow* self); +CIMGUI_API void ImGuiWindow_TitleBarRect(ImRect *pOut,ImGuiWindow* self); +CIMGUI_API float ImGuiWindow_MenuBarHeight(ImGuiWindow* self); +CIMGUI_API void ImGuiWindow_MenuBarRect(ImRect *pOut,ImGuiWindow* self); +CIMGUI_API ImGuiTabItem* ImGuiTabItem_ImGuiTabItem(void); +CIMGUI_API void ImGuiTabItem_destroy(ImGuiTabItem* self); +CIMGUI_API ImGuiTabBar* ImGuiTabBar_ImGuiTabBar(void); +CIMGUI_API void ImGuiTabBar_destroy(ImGuiTabBar* self); +CIMGUI_API ImGuiTableColumn* ImGuiTableColumn_ImGuiTableColumn(void); +CIMGUI_API void ImGuiTableColumn_destroy(ImGuiTableColumn* self); +CIMGUI_API ImGuiTableInstanceData* ImGuiTableInstanceData_ImGuiTableInstanceData(void); +CIMGUI_API void ImGuiTableInstanceData_destroy(ImGuiTableInstanceData* self); +CIMGUI_API ImGuiTable* ImGuiTable_ImGuiTable(void); +CIMGUI_API void ImGuiTable_destroy(ImGuiTable* self); +CIMGUI_API ImGuiTableTempData* ImGuiTableTempData_ImGuiTableTempData(void); +CIMGUI_API void ImGuiTableTempData_destroy(ImGuiTableTempData* self); +CIMGUI_API ImGuiTableColumnSettings* ImGuiTableColumnSettings_ImGuiTableColumnSettings(void); +CIMGUI_API void ImGuiTableColumnSettings_destroy(ImGuiTableColumnSettings* self); +CIMGUI_API ImGuiTableSettings* ImGuiTableSettings_ImGuiTableSettings(void); +CIMGUI_API void ImGuiTableSettings_destroy(ImGuiTableSettings* self); +CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiTableSettings* self); +CIMGUI_API ImGuiWindow* igGetCurrentWindowRead(void); +CIMGUI_API ImGuiWindow* igGetCurrentWindow(void); +CIMGUI_API ImGuiWindow* igFindWindowByID(ImGuiID id); +CIMGUI_API ImGuiWindow* igFindWindowByName(const char* name); +CIMGUI_API void igUpdateWindowParentAndRootLinks(ImGuiWindow* window,ImGuiWindowFlags flags,ImGuiWindow* parent_window); +CIMGUI_API void igCalcWindowNextAutoFitSize(ImVec2 *pOut,ImGuiWindow* window); +CIMGUI_API bool igIsWindowChildOf(ImGuiWindow* window,ImGuiWindow* potential_parent,bool popup_hierarchy,bool dock_hierarchy); +CIMGUI_API bool igIsWindowWithinBeginStackOf(ImGuiWindow* window,ImGuiWindow* potential_parent); +CIMGUI_API bool igIsWindowAbove(ImGuiWindow* potential_above,ImGuiWindow* potential_below); +CIMGUI_API bool igIsWindowNavFocusable(ImGuiWindow* window); +CIMGUI_API void igSetWindowPos_WindowPtr(ImGuiWindow* window,const ImVec2 pos,ImGuiCond cond); +CIMGUI_API void igSetWindowSize_WindowPtr(ImGuiWindow* window,const ImVec2 size,ImGuiCond cond); +CIMGUI_API void igSetWindowCollapsed_WindowPtr(ImGuiWindow* window,bool collapsed,ImGuiCond cond); +CIMGUI_API void igSetWindowHitTestHole(ImGuiWindow* window,const ImVec2 pos,const ImVec2 size); +CIMGUI_API void igSetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow* window); +CIMGUI_API void igWindowRectAbsToRel(ImRect *pOut,ImGuiWindow* window,const ImRect r); +CIMGUI_API void igWindowRectRelToAbs(ImRect *pOut,ImGuiWindow* window,const ImRect r); +CIMGUI_API void igWindowPosRelToAbs(ImVec2 *pOut,ImGuiWindow* window,const ImVec2 p); +CIMGUI_API void igFocusWindow(ImGuiWindow* window,ImGuiFocusRequestFlags flags); +CIMGUI_API void igFocusTopMostWindowUnderOne(ImGuiWindow* under_this_window,ImGuiWindow* ignore_window,ImGuiViewport* filter_viewport,ImGuiFocusRequestFlags flags); +CIMGUI_API void igBringWindowToFocusFront(ImGuiWindow* window); +CIMGUI_API void igBringWindowToDisplayFront(ImGuiWindow* window); +CIMGUI_API void igBringWindowToDisplayBack(ImGuiWindow* window); +CIMGUI_API void igBringWindowToDisplayBehind(ImGuiWindow* window,ImGuiWindow* above_window); +CIMGUI_API int igFindWindowDisplayIndex(ImGuiWindow* window); +CIMGUI_API ImGuiWindow* igFindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window); +CIMGUI_API void igSetCurrentFont(ImFont* font); +CIMGUI_API ImFont* igGetDefaultFont(void); +CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window); +CIMGUI_API void igAddDrawListToDrawDataEx(ImDrawData* draw_data,ImVector_ImDrawListPtr* out_list,ImDrawList* draw_list); +CIMGUI_API void igInitialize(void); +CIMGUI_API void igShutdown(void); +CIMGUI_API void igUpdateInputEvents(bool trickle_fast_inputs); +CIMGUI_API void igUpdateHoveredWindowAndCaptureFlags(void); +CIMGUI_API void igStartMouseMovingWindow(ImGuiWindow* window); +CIMGUI_API void igStartMouseMovingWindowOrNode(ImGuiWindow* window,ImGuiDockNode* node,bool undock_floating_node); +CIMGUI_API void igUpdateMouseMovingWindowNewFrame(void); +CIMGUI_API void igUpdateMouseMovingWindowEndFrame(void); +CIMGUI_API ImGuiID igAddContextHook(ImGuiContext* context,const ImGuiContextHook* hook); +CIMGUI_API void igRemoveContextHook(ImGuiContext* context,ImGuiID hook_to_remove); +CIMGUI_API void igCallContextHooks(ImGuiContext* context,ImGuiContextHookType type); +CIMGUI_API void igTranslateWindowsInViewport(ImGuiViewportP* viewport,const ImVec2 old_pos,const ImVec2 new_pos); +CIMGUI_API void igScaleWindowsInViewport(ImGuiViewportP* viewport,float scale); +CIMGUI_API void igDestroyPlatformWindow(ImGuiViewportP* viewport); +CIMGUI_API void igSetWindowViewport(ImGuiWindow* window,ImGuiViewportP* viewport); +CIMGUI_API void igSetCurrentViewport(ImGuiWindow* window,ImGuiViewportP* viewport); +CIMGUI_API const ImGuiPlatformMonitor* igGetViewportPlatformMonitor(ImGuiViewport* viewport); +CIMGUI_API ImGuiViewportP* igFindHoveredViewportFromPlatformWindowStack(const ImVec2 mouse_platform_pos); +CIMGUI_API void igMarkIniSettingsDirty_Nil(void); +CIMGUI_API void igMarkIniSettingsDirty_WindowPtr(ImGuiWindow* window); +CIMGUI_API void igClearIniSettings(void); +CIMGUI_API void igAddSettingsHandler(const ImGuiSettingsHandler* handler); +CIMGUI_API void igRemoveSettingsHandler(const char* type_name); +CIMGUI_API ImGuiSettingsHandler* igFindSettingsHandler(const char* type_name); +CIMGUI_API ImGuiWindowSettings* igCreateNewWindowSettings(const char* name); +CIMGUI_API ImGuiWindowSettings* igFindWindowSettingsByID(ImGuiID id); +CIMGUI_API ImGuiWindowSettings* igFindWindowSettingsByWindow(ImGuiWindow* window); +CIMGUI_API void igClearWindowSettings(const char* name); +CIMGUI_API void igLocalizeRegisterEntries(const ImGuiLocEntry* entries,int count); +CIMGUI_API const char* igLocalizeGetMsg(ImGuiLocKey key); +CIMGUI_API void igSetScrollX_WindowPtr(ImGuiWindow* window,float scroll_x); +CIMGUI_API void igSetScrollY_WindowPtr(ImGuiWindow* window,float scroll_y); +CIMGUI_API void igSetScrollFromPosX_WindowPtr(ImGuiWindow* window,float local_x,float center_x_ratio); +CIMGUI_API void igSetScrollFromPosY_WindowPtr(ImGuiWindow* window,float local_y,float center_y_ratio); +CIMGUI_API void igScrollToItem(ImGuiScrollFlags flags); +CIMGUI_API void igScrollToRect(ImGuiWindow* window,const ImRect rect,ImGuiScrollFlags flags); +CIMGUI_API void igScrollToRectEx(ImVec2 *pOut,ImGuiWindow* window,const ImRect rect,ImGuiScrollFlags flags); +CIMGUI_API void igScrollToBringRectIntoView(ImGuiWindow* window,const ImRect rect); +CIMGUI_API ImGuiItemStatusFlags igGetItemStatusFlags(void); +CIMGUI_API ImGuiItemFlags igGetItemFlags(void); +CIMGUI_API ImGuiID igGetActiveID(void); +CIMGUI_API ImGuiID igGetFocusID(void); +CIMGUI_API void igSetActiveID(ImGuiID id,ImGuiWindow* window); +CIMGUI_API void igSetFocusID(ImGuiID id,ImGuiWindow* window); +CIMGUI_API void igClearActiveID(void); +CIMGUI_API ImGuiID igGetHoveredID(void); +CIMGUI_API void igSetHoveredID(ImGuiID id); +CIMGUI_API void igKeepAliveID(ImGuiID id); +CIMGUI_API void igMarkItemEdited(ImGuiID id); +CIMGUI_API void igPushOverrideID(ImGuiID id); +CIMGUI_API ImGuiID igGetIDWithSeed_Str(const char* str_id_begin,const char* str_id_end,ImGuiID seed); +CIMGUI_API ImGuiID igGetIDWithSeed_Int(int n,ImGuiID seed); +CIMGUI_API void igItemSize_Vec2(const ImVec2 size,float text_baseline_y); +CIMGUI_API void igItemSize_Rect(const ImRect bb,float text_baseline_y); +CIMGUI_API bool igItemAdd(const ImRect bb,ImGuiID id,const ImRect* nav_bb,ImGuiItemFlags extra_flags); +CIMGUI_API bool igItemHoverable(const ImRect bb,ImGuiID id,ImGuiItemFlags item_flags); +CIMGUI_API bool igIsWindowContentHoverable(ImGuiWindow* window,ImGuiHoveredFlags flags); +CIMGUI_API bool igIsClippedEx(const ImRect bb,ImGuiID id); +CIMGUI_API void igSetLastItemData(ImGuiID item_id,ImGuiItemFlags in_flags,ImGuiItemStatusFlags status_flags,const ImRect item_rect); +CIMGUI_API void igCalcItemSize(ImVec2 *pOut,ImVec2 size,float default_w,float default_h); +CIMGUI_API float igCalcWrapWidthForPos(const ImVec2 pos,float wrap_pos_x); +CIMGUI_API void igPushMultiItemsWidths(int components,float width_full); +CIMGUI_API bool igIsItemToggledSelection(void); +CIMGUI_API void igGetContentRegionMaxAbs(ImVec2 *pOut); +CIMGUI_API void igShrinkWidths(ImGuiShrinkWidthItem* items,int count,float width_excess); +CIMGUI_API void igPushItemFlag(ImGuiItemFlags option,bool enabled); +CIMGUI_API void igPopItemFlag(void); +CIMGUI_API const ImGuiDataVarInfo* igGetStyleVarInfo(ImGuiStyleVar idx); +CIMGUI_API void igLogBegin(ImGuiLogType type,int auto_open_depth); +CIMGUI_API void igLogToBuffer(int auto_open_depth); +CIMGUI_API void igLogRenderedText(const ImVec2* ref_pos,const char* text,const char* text_end); +CIMGUI_API void igLogSetNextTextDecoration(const char* prefix,const char* suffix); +CIMGUI_API bool igBeginChildEx(const char* name,ImGuiID id,const ImVec2 size_arg,bool border,ImGuiWindowFlags flags); +CIMGUI_API void igOpenPopupEx(ImGuiID id,ImGuiPopupFlags popup_flags); +CIMGUI_API void igClosePopupToLevel(int remaining,bool restore_focus_to_window_under_popup); +CIMGUI_API void igClosePopupsOverWindow(ImGuiWindow* ref_window,bool restore_focus_to_window_under_popup); +CIMGUI_API void igClosePopupsExceptModals(void); +CIMGUI_API bool igIsPopupOpen_ID(ImGuiID id,ImGuiPopupFlags popup_flags); +CIMGUI_API bool igBeginPopupEx(ImGuiID id,ImGuiWindowFlags extra_flags); +CIMGUI_API bool igBeginTooltipEx(ImGuiTooltipFlags tooltip_flags,ImGuiWindowFlags extra_window_flags); +CIMGUI_API void igGetPopupAllowedExtentRect(ImRect *pOut,ImGuiWindow* window); +CIMGUI_API ImGuiWindow* igGetTopMostPopupModal(void); +CIMGUI_API ImGuiWindow* igGetTopMostAndVisiblePopupModal(void); +CIMGUI_API ImGuiWindow* igFindBlockingModal(ImGuiWindow* window); +CIMGUI_API void igFindBestWindowPosForPopup(ImVec2 *pOut,ImGuiWindow* window); +CIMGUI_API void igFindBestWindowPosForPopupEx(ImVec2 *pOut,const ImVec2 ref_pos,const ImVec2 size,ImGuiDir* last_dir,const ImRect r_outer,const ImRect r_avoid,ImGuiPopupPositionPolicy policy); +CIMGUI_API bool igBeginViewportSideBar(const char* name,ImGuiViewport* viewport,ImGuiDir dir,float size,ImGuiWindowFlags window_flags); +CIMGUI_API bool igBeginMenuEx(const char* label,const char* icon,bool enabled); +CIMGUI_API bool igMenuItemEx(const char* label,const char* icon,const char* shortcut,bool selected,bool enabled); +CIMGUI_API bool igBeginComboPopup(ImGuiID popup_id,const ImRect bb,ImGuiComboFlags flags); +CIMGUI_API bool igBeginComboPreview(void); +CIMGUI_API void igEndComboPreview(void); +CIMGUI_API void igNavInitWindow(ImGuiWindow* window,bool force_reinit); +CIMGUI_API void igNavInitRequestApplyResult(void); +CIMGUI_API bool igNavMoveRequestButNoResultYet(void); +CIMGUI_API void igNavMoveRequestSubmit(ImGuiDir move_dir,ImGuiDir clip_dir,ImGuiNavMoveFlags move_flags,ImGuiScrollFlags scroll_flags); +CIMGUI_API void igNavMoveRequestForward(ImGuiDir move_dir,ImGuiDir clip_dir,ImGuiNavMoveFlags move_flags,ImGuiScrollFlags scroll_flags); +CIMGUI_API void igNavMoveRequestResolveWithLastItem(ImGuiNavItemData* result); +CIMGUI_API void igNavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result,ImGuiNavTreeNodeData* tree_node_data); +CIMGUI_API void igNavMoveRequestCancel(void); +CIMGUI_API void igNavMoveRequestApplyResult(void); +CIMGUI_API void igNavMoveRequestTryWrapping(ImGuiWindow* window,ImGuiNavMoveFlags move_flags); +CIMGUI_API void igNavClearPreferredPosForAxis(ImGuiAxis axis); +CIMGUI_API void igNavUpdateCurrentWindowIsScrollPushableX(void); +CIMGUI_API void igSetNavWindow(ImGuiWindow* window); +CIMGUI_API void igSetNavID(ImGuiID id,ImGuiNavLayer nav_layer,ImGuiID focus_scope_id,const ImRect rect_rel); +CIMGUI_API void igFocusItem(void); +CIMGUI_API void igActivateItemByID(ImGuiID id); +CIMGUI_API bool igIsNamedKey(ImGuiKey key); +CIMGUI_API bool igIsNamedKeyOrModKey(ImGuiKey key); +CIMGUI_API bool igIsLegacyKey(ImGuiKey key); +CIMGUI_API bool igIsKeyboardKey(ImGuiKey key); +CIMGUI_API bool igIsGamepadKey(ImGuiKey key); +CIMGUI_API bool igIsMouseKey(ImGuiKey key); +CIMGUI_API bool igIsAliasKey(ImGuiKey key); +CIMGUI_API ImGuiKeyChord igConvertShortcutMod(ImGuiKeyChord key_chord); +CIMGUI_API ImGuiKey igConvertSingleModFlagToKey(ImGuiContext* ctx,ImGuiKey key); +CIMGUI_API ImGuiKeyData* igGetKeyData_ContextPtr(ImGuiContext* ctx,ImGuiKey key); +CIMGUI_API ImGuiKeyData* igGetKeyData_Key(ImGuiKey key); +CIMGUI_API void igGetKeyChordName(ImGuiKeyChord key_chord,char* out_buf,int out_buf_size); +CIMGUI_API ImGuiKey igMouseButtonToKey(ImGuiMouseButton button); +CIMGUI_API bool igIsMouseDragPastThreshold(ImGuiMouseButton button,float lock_threshold); +CIMGUI_API void igGetKeyMagnitude2d(ImVec2 *pOut,ImGuiKey key_left,ImGuiKey key_right,ImGuiKey key_up,ImGuiKey key_down); +CIMGUI_API float igGetNavTweakPressedAmount(ImGuiAxis axis); +CIMGUI_API int igCalcTypematicRepeatAmount(float t0,float t1,float repeat_delay,float repeat_rate); +CIMGUI_API void igGetTypematicRepeatRate(ImGuiInputFlags flags,float* repeat_delay,float* repeat_rate); +CIMGUI_API void igSetActiveIdUsingAllKeyboardKeys(void); +CIMGUI_API bool igIsActiveIdUsingNavDir(ImGuiDir dir); +CIMGUI_API ImGuiID igGetKeyOwner(ImGuiKey key); +CIMGUI_API void igSetKeyOwner(ImGuiKey key,ImGuiID owner_id,ImGuiInputFlags flags); +CIMGUI_API void igSetKeyOwnersForKeyChord(ImGuiKeyChord key,ImGuiID owner_id,ImGuiInputFlags flags); +CIMGUI_API void igSetItemKeyOwner(ImGuiKey key,ImGuiInputFlags flags); +CIMGUI_API bool igTestKeyOwner(ImGuiKey key,ImGuiID owner_id); +CIMGUI_API ImGuiKeyOwnerData* igGetKeyOwnerData(ImGuiContext* ctx,ImGuiKey key); +CIMGUI_API bool igIsKeyDown_ID(ImGuiKey key,ImGuiID owner_id); +CIMGUI_API bool igIsKeyPressed_ID(ImGuiKey key,ImGuiID owner_id,ImGuiInputFlags flags); +CIMGUI_API bool igIsKeyReleased_ID(ImGuiKey key,ImGuiID owner_id); +CIMGUI_API bool igIsMouseDown_ID(ImGuiMouseButton button,ImGuiID owner_id); +CIMGUI_API bool igIsMouseClicked_ID(ImGuiMouseButton button,ImGuiID owner_id,ImGuiInputFlags flags); +CIMGUI_API bool igIsMouseReleased_ID(ImGuiMouseButton button,ImGuiID owner_id); +CIMGUI_API bool igShortcut(ImGuiKeyChord key_chord,ImGuiID owner_id,ImGuiInputFlags flags); +CIMGUI_API bool igSetShortcutRouting(ImGuiKeyChord key_chord,ImGuiID owner_id,ImGuiInputFlags flags); +CIMGUI_API bool igTestShortcutRouting(ImGuiKeyChord key_chord,ImGuiID owner_id); +CIMGUI_API ImGuiKeyRoutingData* igGetShortcutRoutingData(ImGuiKeyChord key_chord); +CIMGUI_API void igDockContextInitialize(ImGuiContext* ctx); +CIMGUI_API void igDockContextShutdown(ImGuiContext* ctx); +CIMGUI_API void igDockContextClearNodes(ImGuiContext* ctx,ImGuiID root_id,bool clear_settings_refs); +CIMGUI_API void igDockContextRebuildNodes(ImGuiContext* ctx); +CIMGUI_API void igDockContextNewFrameUpdateUndocking(ImGuiContext* ctx); +CIMGUI_API void igDockContextNewFrameUpdateDocking(ImGuiContext* ctx); +CIMGUI_API void igDockContextEndFrame(ImGuiContext* ctx); +CIMGUI_API ImGuiID igDockContextGenNodeID(ImGuiContext* ctx); +CIMGUI_API void igDockContextQueueDock(ImGuiContext* ctx,ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload,ImGuiDir split_dir,float split_ratio,bool split_outer); +CIMGUI_API void igDockContextQueueUndockWindow(ImGuiContext* ctx,ImGuiWindow* window); +CIMGUI_API void igDockContextQueueUndockNode(ImGuiContext* ctx,ImGuiDockNode* node); +CIMGUI_API void igDockContextProcessUndockWindow(ImGuiContext* ctx,ImGuiWindow* window,bool clear_persistent_docking_ref); +CIMGUI_API void igDockContextProcessUndockNode(ImGuiContext* ctx,ImGuiDockNode* node); +CIMGUI_API bool igDockContextCalcDropPosForDocking(ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload_window,ImGuiDockNode* payload_node,ImGuiDir split_dir,bool split_outer,ImVec2* out_pos); +CIMGUI_API ImGuiDockNode* igDockContextFindNodeByID(ImGuiContext* ctx,ImGuiID id); +CIMGUI_API void igDockNodeWindowMenuHandler_Default(ImGuiContext* ctx,ImGuiDockNode* node,ImGuiTabBar* tab_bar); +CIMGUI_API bool igDockNodeBeginAmendTabBar(ImGuiDockNode* node); +CIMGUI_API void igDockNodeEndAmendTabBar(void); +CIMGUI_API ImGuiDockNode* igDockNodeGetRootNode(ImGuiDockNode* node); +CIMGUI_API bool igDockNodeIsInHierarchyOf(ImGuiDockNode* node,ImGuiDockNode* parent); +CIMGUI_API int igDockNodeGetDepth(const ImGuiDockNode* node); +CIMGUI_API ImGuiID igDockNodeGetWindowMenuButtonId(const ImGuiDockNode* node); +CIMGUI_API ImGuiDockNode* igGetWindowDockNode(void); +CIMGUI_API bool igGetWindowAlwaysWantOwnTabBar(ImGuiWindow* window); +CIMGUI_API void igBeginDocked(ImGuiWindow* window,bool* p_open); +CIMGUI_API void igBeginDockableDragDropSource(ImGuiWindow* window); +CIMGUI_API void igBeginDockableDragDropTarget(ImGuiWindow* window); +CIMGUI_API void igSetWindowDock(ImGuiWindow* window,ImGuiID dock_id,ImGuiCond cond); +CIMGUI_API void igDockBuilderDockWindow(const char* window_name,ImGuiID node_id); +CIMGUI_API ImGuiDockNode* igDockBuilderGetNode(ImGuiID node_id); +CIMGUI_API ImGuiDockNode* igDockBuilderGetCentralNode(ImGuiID node_id); +CIMGUI_API ImGuiID igDockBuilderAddNode(ImGuiID node_id,ImGuiDockNodeFlags flags); +CIMGUI_API void igDockBuilderRemoveNode(ImGuiID node_id); +CIMGUI_API void igDockBuilderRemoveNodeDockedWindows(ImGuiID node_id,bool clear_settings_refs); +CIMGUI_API void igDockBuilderRemoveNodeChildNodes(ImGuiID node_id); +CIMGUI_API void igDockBuilderSetNodePos(ImGuiID node_id,ImVec2 pos); +CIMGUI_API void igDockBuilderSetNodeSize(ImGuiID node_id,ImVec2 size); +CIMGUI_API ImGuiID igDockBuilderSplitNode(ImGuiID node_id,ImGuiDir split_dir,float size_ratio_for_node_at_dir,ImGuiID* out_id_at_dir,ImGuiID* out_id_at_opposite_dir); +CIMGUI_API void igDockBuilderCopyDockSpace(ImGuiID src_dockspace_id,ImGuiID dst_dockspace_id,ImVector_const_charPtr* in_window_remap_pairs); +CIMGUI_API void igDockBuilderCopyNode(ImGuiID src_node_id,ImGuiID dst_node_id,ImVector_ImGuiID* out_node_remap_pairs); +CIMGUI_API void igDockBuilderCopyWindowSettings(const char* src_name,const char* dst_name); +CIMGUI_API void igDockBuilderFinish(ImGuiID node_id); +CIMGUI_API void igPushFocusScope(ImGuiID id); +CIMGUI_API void igPopFocusScope(void); +CIMGUI_API ImGuiID igGetCurrentFocusScope(void); +CIMGUI_API bool igIsDragDropActive(void); +CIMGUI_API bool igBeginDragDropTargetCustom(const ImRect bb,ImGuiID id); +CIMGUI_API void igClearDragDrop(void); +CIMGUI_API bool igIsDragDropPayloadBeingAccepted(void); +CIMGUI_API void igRenderDragDropTargetRect(const ImRect bb); +CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const ImRect clip_rect); +CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiOldColumnFlags flags); +CIMGUI_API void igEndColumns(void); +CIMGUI_API void igPushColumnClipRect(int column_index); +CIMGUI_API void igPushColumnsBackground(void); +CIMGUI_API void igPopColumnsBackground(void); +CIMGUI_API ImGuiID igGetColumnsID(const char* str_id,int count); +CIMGUI_API ImGuiOldColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id); +CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiOldColumns* columns,float offset_norm); +CIMGUI_API float igGetColumnNormFromOffset(const ImGuiOldColumns* columns,float offset); +CIMGUI_API void igTableOpenContextMenu(int column_n); +CIMGUI_API void igTableSetColumnWidth(int column_n,float width); +CIMGUI_API void igTableSetColumnSortDirection(int column_n,ImGuiSortDirection sort_direction,bool append_to_sort_specs); +CIMGUI_API int igTableGetHoveredColumn(void); +CIMGUI_API int igTableGetHoveredRow(void); +CIMGUI_API float igTableGetHeaderRowHeight(void); +CIMGUI_API void igTablePushBackgroundChannel(void); +CIMGUI_API void igTablePopBackgroundChannel(void); +CIMGUI_API ImGuiTable* igGetCurrentTable(void); +CIMGUI_API ImGuiTable* igTableFindByID(ImGuiID id); +CIMGUI_API bool igBeginTableEx(const char* name,ImGuiID id,int columns_count,ImGuiTableFlags flags,const ImVec2 outer_size,float inner_width); +CIMGUI_API void igTableBeginInitMemory(ImGuiTable* table,int columns_count); +CIMGUI_API void igTableBeginApplyRequests(ImGuiTable* table); +CIMGUI_API void igTableSetupDrawChannels(ImGuiTable* table); +CIMGUI_API void igTableUpdateLayout(ImGuiTable* table); +CIMGUI_API void igTableUpdateBorders(ImGuiTable* table); +CIMGUI_API void igTableUpdateColumnsWeightFromWidth(ImGuiTable* table); +CIMGUI_API void igTableDrawBorders(ImGuiTable* table); +CIMGUI_API void igTableDrawContextMenu(ImGuiTable* table); +CIMGUI_API bool igTableBeginContextMenuPopup(ImGuiTable* table); +CIMGUI_API void igTableMergeDrawChannels(ImGuiTable* table); +CIMGUI_API ImGuiTableInstanceData* igTableGetInstanceData(ImGuiTable* table,int instance_no); +CIMGUI_API ImGuiID igTableGetInstanceID(ImGuiTable* table,int instance_no); +CIMGUI_API void igTableSortSpecsSanitize(ImGuiTable* table); +CIMGUI_API void igTableSortSpecsBuild(ImGuiTable* table); +CIMGUI_API ImGuiSortDirection igTableGetColumnNextSortDirection(ImGuiTableColumn* column); +CIMGUI_API void igTableFixColumnSortDirection(ImGuiTable* table,ImGuiTableColumn* column); +CIMGUI_API float igTableGetColumnWidthAuto(ImGuiTable* table,ImGuiTableColumn* column); +CIMGUI_API void igTableBeginRow(ImGuiTable* table); +CIMGUI_API void igTableEndRow(ImGuiTable* table); +CIMGUI_API void igTableBeginCell(ImGuiTable* table,int column_n); +CIMGUI_API void igTableEndCell(ImGuiTable* table); +CIMGUI_API void igTableGetCellBgRect(ImRect *pOut,const ImGuiTable* table,int column_n); +CIMGUI_API const char* igTableGetColumnName_TablePtr(const ImGuiTable* table,int column_n); +CIMGUI_API ImGuiID igTableGetColumnResizeID(ImGuiTable* table,int column_n,int instance_no); +CIMGUI_API float igTableGetMaxColumnWidth(const ImGuiTable* table,int column_n); +CIMGUI_API void igTableSetColumnWidthAutoSingle(ImGuiTable* table,int column_n); +CIMGUI_API void igTableSetColumnWidthAutoAll(ImGuiTable* table); +CIMGUI_API void igTableRemove(ImGuiTable* table); +CIMGUI_API void igTableGcCompactTransientBuffers_TablePtr(ImGuiTable* table); +CIMGUI_API void igTableGcCompactTransientBuffers_TableTempDataPtr(ImGuiTableTempData* table); +CIMGUI_API void igTableGcCompactSettings(void); +CIMGUI_API void igTableLoadSettings(ImGuiTable* table); +CIMGUI_API void igTableSaveSettings(ImGuiTable* table); +CIMGUI_API void igTableResetSettings(ImGuiTable* table); +CIMGUI_API ImGuiTableSettings* igTableGetBoundSettings(ImGuiTable* table); +CIMGUI_API void igTableSettingsAddSettingsHandler(void); +CIMGUI_API ImGuiTableSettings* igTableSettingsCreate(ImGuiID id,int columns_count); +CIMGUI_API ImGuiTableSettings* igTableSettingsFindByID(ImGuiID id); +CIMGUI_API ImGuiTabBar* igGetCurrentTabBar(void); +CIMGUI_API bool igBeginTabBarEx(ImGuiTabBar* tab_bar,const ImRect bb,ImGuiTabBarFlags flags,ImGuiDockNode* dock_node); +CIMGUI_API ImGuiTabItem* igTabBarFindTabByID(ImGuiTabBar* tab_bar,ImGuiID tab_id); +CIMGUI_API ImGuiTabItem* igTabBarFindTabByOrder(ImGuiTabBar* tab_bar,int order); +CIMGUI_API ImGuiTabItem* igTabBarFindMostRecentlySelectedTabForActiveWindow(ImGuiTabBar* tab_bar); +CIMGUI_API ImGuiTabItem* igTabBarGetCurrentTab(ImGuiTabBar* tab_bar); +CIMGUI_API int igTabBarGetTabOrder(ImGuiTabBar* tab_bar,ImGuiTabItem* tab); +CIMGUI_API const char* igTabBarGetTabName(ImGuiTabBar* tab_bar,ImGuiTabItem* tab); +CIMGUI_API void igTabBarAddTab(ImGuiTabBar* tab_bar,ImGuiTabItemFlags tab_flags,ImGuiWindow* window); +CIMGUI_API void igTabBarRemoveTab(ImGuiTabBar* tab_bar,ImGuiID tab_id); +CIMGUI_API void igTabBarCloseTab(ImGuiTabBar* tab_bar,ImGuiTabItem* tab); +CIMGUI_API void igTabBarQueueFocus(ImGuiTabBar* tab_bar,ImGuiTabItem* tab); +CIMGUI_API void igTabBarQueueReorder(ImGuiTabBar* tab_bar,ImGuiTabItem* tab,int offset); +CIMGUI_API void igTabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar,ImGuiTabItem* tab,ImVec2 mouse_pos); +CIMGUI_API bool igTabBarProcessReorder(ImGuiTabBar* tab_bar); +CIMGUI_API bool igTabItemEx(ImGuiTabBar* tab_bar,const char* label,bool* p_open,ImGuiTabItemFlags flags,ImGuiWindow* docked_window); +CIMGUI_API void igTabItemCalcSize_Str(ImVec2 *pOut,const char* label,bool has_close_button_or_unsaved_marker); +CIMGUI_API void igTabItemCalcSize_WindowPtr(ImVec2 *pOut,ImGuiWindow* window); +CIMGUI_API void igTabItemBackground(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImU32 col); +CIMGUI_API void igTabItemLabelAndCloseButton(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImVec2 frame_padding,const char* label,ImGuiID tab_id,ImGuiID close_button_id,bool is_contents_visible,bool* out_just_closed,bool* out_text_clipped); +CIMGUI_API void igRenderText(ImVec2 pos,const char* text,const char* text_end,bool hide_text_after_hash); +CIMGUI_API void igRenderTextWrapped(ImVec2 pos,const char* text,const char* text_end,float wrap_width); +CIMGUI_API void igRenderTextClipped(const ImVec2 pos_min,const ImVec2 pos_max,const char* text,const char* text_end,const ImVec2* text_size_if_known,const ImVec2 align,const ImRect* clip_rect); +CIMGUI_API void igRenderTextClippedEx(ImDrawList* draw_list,const ImVec2 pos_min,const ImVec2 pos_max,const char* text,const char* text_end,const ImVec2* text_size_if_known,const ImVec2 align,const ImRect* clip_rect); +CIMGUI_API void igRenderTextEllipsis(ImDrawList* draw_list,const ImVec2 pos_min,const ImVec2 pos_max,float clip_max_x,float ellipsis_max_x,const char* text,const char* text_end,const ImVec2* text_size_if_known); +CIMGUI_API void igRenderFrame(ImVec2 p_min,ImVec2 p_max,ImU32 fill_col,bool border,float rounding); +CIMGUI_API void igRenderFrameBorder(ImVec2 p_min,ImVec2 p_max,float rounding); +CIMGUI_API void igRenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list,ImVec2 p_min,ImVec2 p_max,ImU32 fill_col,float grid_step,ImVec2 grid_off,float rounding,ImDrawFlags flags); +CIMGUI_API void igRenderNavHighlight(const ImRect bb,ImGuiID id,ImGuiNavHighlightFlags flags); +CIMGUI_API const char* igFindRenderedTextEnd(const char* text,const char* text_end); +CIMGUI_API void igRenderMouseCursor(ImVec2 pos,float scale,ImGuiMouseCursor mouse_cursor,ImU32 col_fill,ImU32 col_border,ImU32 col_shadow); +CIMGUI_API void igRenderArrow(ImDrawList* draw_list,ImVec2 pos,ImU32 col,ImGuiDir dir,float scale); +CIMGUI_API void igRenderBullet(ImDrawList* draw_list,ImVec2 pos,ImU32 col); +CIMGUI_API void igRenderCheckMark(ImDrawList* draw_list,ImVec2 pos,ImU32 col,float sz); +CIMGUI_API void igRenderArrowPointingAt(ImDrawList* draw_list,ImVec2 pos,ImVec2 half_sz,ImGuiDir direction,ImU32 col); +CIMGUI_API void igRenderArrowDockMenu(ImDrawList* draw_list,ImVec2 p_min,float sz,ImU32 col); +CIMGUI_API void igRenderRectFilledRangeH(ImDrawList* draw_list,const ImRect rect,ImU32 col,float x_start_norm,float x_end_norm,float rounding); +CIMGUI_API void igRenderRectFilledWithHole(ImDrawList* draw_list,const ImRect outer,const ImRect inner,ImU32 col,float rounding); +CIMGUI_API ImDrawFlags igCalcRoundingFlagsForRectInRect(const ImRect r_in,const ImRect r_outer,float threshold); +CIMGUI_API void igTextEx(const char* text,const char* text_end,ImGuiTextFlags flags); +CIMGUI_API bool igButtonEx(const char* label,const ImVec2 size_arg,ImGuiButtonFlags flags); +CIMGUI_API bool igArrowButtonEx(const char* str_id,ImGuiDir dir,ImVec2 size_arg,ImGuiButtonFlags flags); +CIMGUI_API bool igImageButtonEx(ImGuiID id,ImTextureID texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 bg_col,const ImVec4 tint_col,ImGuiButtonFlags flags); +CIMGUI_API void igSeparatorEx(ImGuiSeparatorFlags flags,float thickness); +CIMGUI_API void igSeparatorTextEx(ImGuiID id,const char* label,const char* label_end,float extra_width); +CIMGUI_API bool igCheckboxFlags_S64Ptr(const char* label,ImS64* flags,ImS64 flags_value); +CIMGUI_API bool igCheckboxFlags_U64Ptr(const char* label,ImU64* flags,ImU64 flags_value); +CIMGUI_API bool igCloseButton(ImGuiID id,const ImVec2 pos); +CIMGUI_API bool igCollapseButton(ImGuiID id,const ImVec2 pos,ImGuiDockNode* dock_node); +CIMGUI_API void igScrollbar(ImGuiAxis axis); +CIMGUI_API bool igScrollbarEx(const ImRect bb,ImGuiID id,ImGuiAxis axis,ImS64* p_scroll_v,ImS64 avail_v,ImS64 contents_v,ImDrawFlags flags); +CIMGUI_API void igGetWindowScrollbarRect(ImRect *pOut,ImGuiWindow* window,ImGuiAxis axis); +CIMGUI_API ImGuiID igGetWindowScrollbarID(ImGuiWindow* window,ImGuiAxis axis); +CIMGUI_API ImGuiID igGetWindowResizeCornerID(ImGuiWindow* window,int n); +CIMGUI_API ImGuiID igGetWindowResizeBorderID(ImGuiWindow* window,ImGuiDir dir); +CIMGUI_API bool igButtonBehavior(const ImRect bb,ImGuiID id,bool* out_hovered,bool* out_held,ImGuiButtonFlags flags); +CIMGUI_API bool igDragBehavior(ImGuiID id,ImGuiDataType data_type,void* p_v,float v_speed,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags); +CIMGUI_API bool igSliderBehavior(const ImRect bb,ImGuiID id,ImGuiDataType data_type,void* p_v,const void* p_min,const void* p_max,const char* format,ImGuiSliderFlags flags,ImRect* out_grab_bb); +CIMGUI_API bool igSplitterBehavior(const ImRect bb,ImGuiID id,ImGuiAxis axis,float* size1,float* size2,float min_size1,float min_size2,float hover_extend,float hover_visibility_delay,ImU32 bg_col); +CIMGUI_API bool igTreeNodeBehavior(ImGuiID id,ImGuiTreeNodeFlags flags,const char* label,const char* label_end); +CIMGUI_API void igTreePushOverrideID(ImGuiID id); +CIMGUI_API void igTreeNodeSetOpen(ImGuiID id,bool open); +CIMGUI_API bool igTreeNodeUpdateNextOpen(ImGuiID id,ImGuiTreeNodeFlags flags); +CIMGUI_API const ImGuiDataTypeInfo* igDataTypeGetInfo(ImGuiDataType data_type); +CIMGUI_API int igDataTypeFormatString(char* buf,int buf_size,ImGuiDataType data_type,const void* p_data,const char* format); +CIMGUI_API void igDataTypeApplyOp(ImGuiDataType data_type,int op,void* output,const void* arg_1,const void* arg_2); +CIMGUI_API bool igDataTypeApplyFromText(const char* buf,ImGuiDataType data_type,void* p_data,const char* format); +CIMGUI_API int igDataTypeCompare(ImGuiDataType data_type,const void* arg_1,const void* arg_2); +CIMGUI_API bool igDataTypeClamp(ImGuiDataType data_type,void* p_data,const void* p_min,const void* p_max); +CIMGUI_API bool igInputTextEx(const char* label,const char* hint,char* buf,int buf_size,const ImVec2 size_arg,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data); +CIMGUI_API void igInputTextDeactivateHook(ImGuiID id); +CIMGUI_API bool igTempInputText(const ImRect bb,ImGuiID id,const char* label,char* buf,int buf_size,ImGuiInputTextFlags flags); +CIMGUI_API bool igTempInputScalar(const ImRect bb,ImGuiID id,const char* label,ImGuiDataType data_type,void* p_data,const char* format,const void* p_clamp_min,const void* p_clamp_max); +CIMGUI_API bool igTempInputIsActive(ImGuiID id); +CIMGUI_API ImGuiInputTextState* igGetInputTextState(ImGuiID id); +CIMGUI_API void igColorTooltip(const char* text,const float* col,ImGuiColorEditFlags flags); +CIMGUI_API void igColorEditOptionsPopup(const float* col,ImGuiColorEditFlags flags); +CIMGUI_API void igColorPickerOptionsPopup(const float* ref_col,ImGuiColorEditFlags flags); +CIMGUI_API int igPlotEx(ImGuiPlotType plot_type,const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,const ImVec2 size_arg); +CIMGUI_API void igShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list,int vert_start_idx,int vert_end_idx,ImVec2 gradient_p0,ImVec2 gradient_p1,ImU32 col0,ImU32 col1); +CIMGUI_API void igShadeVertsLinearUV(ImDrawList* draw_list,int vert_start_idx,int vert_end_idx,const ImVec2 a,const ImVec2 b,const ImVec2 uv_a,const ImVec2 uv_b,bool clamp); +CIMGUI_API void igGcCompactTransientMiscBuffers(void); +CIMGUI_API void igGcCompactTransientWindowBuffers(ImGuiWindow* window); +CIMGUI_API void igGcAwakeTransientWindowBuffers(ImGuiWindow* window); +CIMGUI_API void igDebugLog(const char* fmt,...); +CIMGUI_API void igDebugLogV(const char* fmt,va_list args); +CIMGUI_API void igErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback,void* user_data); +CIMGUI_API void igErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback,void* user_data); +CIMGUI_API void igErrorCheckUsingSetCursorPosToExtendParentBoundaries(void); +CIMGUI_API void igDebugDrawCursorPos(ImU32 col); +CIMGUI_API void igDebugDrawLineExtents(ImU32 col); +CIMGUI_API void igDebugDrawItemRect(ImU32 col); +CIMGUI_API void igDebugLocateItem(ImGuiID target_id); +CIMGUI_API void igDebugLocateItemOnHover(ImGuiID target_id); +CIMGUI_API void igDebugLocateItemResolveWithLastItem(void); +CIMGUI_API void igDebugStartItemPicker(void); +CIMGUI_API void igShowFontAtlas(ImFontAtlas* atlas); +CIMGUI_API void igDebugHookIdInfo(ImGuiID id,ImGuiDataType data_type,const void* data_id,const void* data_id_end); +CIMGUI_API void igDebugNodeColumns(ImGuiOldColumns* columns); +CIMGUI_API void igDebugNodeDockNode(ImGuiDockNode* node,const char* label); +CIMGUI_API void igDebugNodeDrawList(ImGuiWindow* window,ImGuiViewportP* viewport,const ImDrawList* draw_list,const char* label); +CIMGUI_API void igDebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list,const ImDrawList* draw_list,const ImDrawCmd* draw_cmd,bool show_mesh,bool show_aabb); +CIMGUI_API void igDebugNodeFont(ImFont* font); +CIMGUI_API void igDebugNodeFontGlyph(ImFont* font,const ImFontGlyph* glyph); +CIMGUI_API void igDebugNodeStorage(ImGuiStorage* storage,const char* label); +CIMGUI_API void igDebugNodeTabBar(ImGuiTabBar* tab_bar,const char* label); +CIMGUI_API void igDebugNodeTable(ImGuiTable* table); +CIMGUI_API void igDebugNodeTableSettings(ImGuiTableSettings* settings); +CIMGUI_API void igDebugNodeInputTextState(ImGuiInputTextState* state); +CIMGUI_API void igDebugNodeWindow(ImGuiWindow* window,const char* label); +CIMGUI_API void igDebugNodeWindowSettings(ImGuiWindowSettings* settings); +CIMGUI_API void igDebugNodeWindowsList(ImVector_ImGuiWindowPtr* windows,const char* label); +CIMGUI_API void igDebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows,int windows_size,ImGuiWindow* parent_in_begin_stack); +CIMGUI_API void igDebugNodeViewport(ImGuiViewportP* viewport); +CIMGUI_API void igDebugRenderKeyboardPreview(ImDrawList* draw_list); +CIMGUI_API void igDebugRenderViewportThumbnail(ImDrawList* draw_list,ImGuiViewportP* viewport,const ImRect bb); +CIMGUI_API bool igIsKeyPressedMap(ImGuiKey key,bool repeat); +CIMGUI_API void igImFontAtlasBuildInit(ImFontAtlas* atlas); +CIMGUI_API void igImFontAtlasBuildSetupFont(ImFontAtlas* atlas,ImFont* font,ImFontConfig* font_config,float ascent,float descent); +CIMGUI_API void igImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas,void* stbrp_context_opaque); +CIMGUI_API void igImFontAtlasBuildFinish(ImFontAtlas* atlas); +CIMGUI_API void igImFontAtlasBuildRender8bppRectFromString(ImFontAtlas* atlas,int x,int y,int w,int h,const char* in_str,char in_marker_char,unsigned char in_marker_pixel_value); +CIMGUI_API void igImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas,int x,int y,int w,int h,const char* in_str,char in_marker_char,unsigned int in_marker_pixel_value); +CIMGUI_API void igImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256],float in_multiply_factor); +CIMGUI_API void igImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256],unsigned char* pixels,int x,int y,int w,int h,int stride); +CIMGUI_API const ImFontBuilderIO* ImGuiFreeType_GetBuilderForFreeType(void); +CIMGUI_API void ImGuiFreeType_SetAllocatorFunctions(void*(*alloc_func)(size_t sz,void* user_data),void(*free_func)(void* ptr,void* user_data),void* user_data); + + +/////////////////////////hand written functions +//no LogTextV +CIMGUI_API void igLogText(CONST char *fmt, ...); +//no appendfV +CIMGUI_API void ImGuiTextBuffer_appendf(struct ImGuiTextBuffer *buffer, const char *fmt, ...); +//for getting FLT_MAX in bindings +CIMGUI_API float igGET_FLT_MAX(void); +//for getting FLT_MIN in bindings +CIMGUI_API float igGET_FLT_MIN(void); + + +CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create(void); +CIMGUI_API void ImVector_ImWchar_destroy(ImVector_ImWchar* self); +CIMGUI_API void ImVector_ImWchar_Init(ImVector_ImWchar* p); +CIMGUI_API void ImVector_ImWchar_UnInit(ImVector_ImWchar* p); + + +#endif //CIMGUI_INCLUDED + + + + diff --git a/src/App.zig b/src/App.zig index 12a4389c7..b9b9501eb 100644 --- a/src/App.zig +++ b/src/App.zig @@ -205,6 +205,7 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void { .quit => try self.setQuit(), .surface_message => |msg| try self.surfaceMessage(msg.surface, msg.message), .redraw_surface => |surface| try self.redrawSurface(rt_app, surface), + .redraw_inspector => |surface| try self.redrawInspector(rt_app, surface), } } } @@ -232,6 +233,11 @@ fn redrawSurface(self: *App, rt_app: *apprt.App, surface: *apprt.Surface) !void rt_app.redrawSurface(surface); } +fn redrawInspector(self: *App, rt_app: *apprt.App, surface: *apprt.Surface) !void { + if (!self.hasSurface(&surface.core_surface)) return; + rt_app.redrawInspector(surface); +} + /// Create a new window pub fn newWindow(self: *App, rt_app: *apprt.App, msg: Message.NewWindow) !void { if (!@hasDecl(apprt.App, "newWindow")) { @@ -304,6 +310,10 @@ pub const Message = union(enum) { /// message if it needs to. redraw_surface: *apprt.Surface, + /// Redraw the inspector. This is called whenever some non-OS event + /// causes the inspector to need to be redrawn. + redraw_inspector: *apprt.Surface, + const NewWindow = struct { /// The parent surface parent: ?*Surface = null, diff --git a/src/Surface.zig b/src/Surface.zig index 9a4860873..04bd2b4cd 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -33,6 +33,7 @@ const configpkg = @import("config.zig"); const input = @import("input.zig"); const App = @import("App.zig"); const internal_os = @import("os/main.zig"); +const inspector = @import("inspector/main.zig"); const log = std.log.scoped(.surface); @@ -74,6 +75,9 @@ io: termio.Impl, io_thread: termio.Thread, io_thr: std.Thread, +/// Terminal inspector +inspector: ?*inspector.Inspector = null, + /// All the cached sizes since we need them at various times. screen_size: renderer.ScreenSize, grid_size: renderer.GridSize, @@ -550,8 +554,14 @@ pub fn deinit(self: *Surface) void { self.font_lib.deinit(); self.alloc.destroy(self.font_group); + if (self.inspector) |v| { + v.deinit(); + self.alloc.destroy(v); + } + self.alloc.destroy(self.renderer_state.mutex); self.config.deinit(); + log.info("surface closed addr={x}", .{@intFromPtr(self)}); } @@ -561,6 +571,53 @@ pub fn close(self: *Surface) void { self.rt_surface.close(self.needsConfirmQuit()); } +/// Activate the inspector. This will begin collecting inspection data. +/// This will not affect the GUI. The GUI must use performAction to +/// show/hide the inspector UI. +pub fn activateInspector(self: *Surface) !void { + if (self.inspector != null) return; + + // Setup the inspector + var ptr = try self.alloc.create(inspector.Inspector); + errdefer self.alloc.destroy(ptr); + ptr.* = try inspector.Inspector.init(self); + self.inspector = ptr; + + // Put the inspector onto the render state + { + self.renderer_state.mutex.lock(); + defer self.renderer_state.mutex.unlock(); + assert(self.renderer_state.inspector == null); + self.renderer_state.inspector = self.inspector; + } + + // Notify our components we have an inspector active + _ = self.renderer_thread.mailbox.push(.{ .inspector = true }, .{ .forever = {} }); + _ = self.io_thread.mailbox.push(.{ .inspector = true }, .{ .forever = {} }); +} + +/// Deactivate the inspector and stop collecting any information. +pub fn deactivateInspector(self: *Surface) void { + const insp = self.inspector orelse return; + + // Remove the inspector from the render state + { + self.renderer_state.mutex.lock(); + defer self.renderer_state.mutex.unlock(); + assert(self.renderer_state.inspector != null); + self.renderer_state.inspector = null; + } + + // Notify our components we have deactivated inspector + _ = self.renderer_thread.mailbox.push(.{ .inspector = false }, .{ .forever = {} }); + _ = self.io_thread.mailbox.push(.{ .inspector = false }, .{ .forever = {} }); + + // Deinit the inspector + insp.deinit(); + self.alloc.destroy(insp); + self.inspector = null; +} + /// True if the surface requires confirmation to quit. This should be called /// by apprt to determine if the surface should confirm before quitting. pub fn needsConfirmQuit(self: *Surface) bool { @@ -947,6 +1004,24 @@ pub fn keyCallback( ) !bool { // log.debug("keyCallback event={}", .{event}); + // Setup our inspector event if we have an inspector. + var insp_ev: ?inspector.key.Event = if (self.inspector != null) ev: { + var copy = event; + copy.utf8 = ""; + if (event.utf8.len > 0) copy.utf8 = try self.alloc.dupe(u8, event.utf8); + break :ev .{ .event = copy }; + } else null; + + // When we're done processing, we always want to add the event to + // the inspector. + defer if (insp_ev) |ev| { + if (self.inspector.?.recordKeyEvent(ev)) { + self.queueRender() catch {}; + } else |err| { + log.warn("error adding key event to inspector err={}", .{err}); + } + }; + // Before encoding, we see if we have any keybindings for this // key. Those always intercept before any encoding tasks. binding: { @@ -984,7 +1059,10 @@ pub fn keyCallback( // If we consume this event, then we are done. If we don't consume // it, we processed the action but we still want to process our // encodings, too. - if (consumed and performed) return true; + if (consumed and performed) { + if (insp_ev) |*ev| ev.binding = binding_action; + return true; + } } // If we allow KAM and KAM is enabled then we do nothing. @@ -1030,6 +1108,12 @@ pub fn keyCallback( .len = @intCast(seq.len), }, }, .{ .forever = {} }); + if (insp_ev) |*ev| { + ev.pty = self.alloc.dupe(u8, seq) catch |err| err: { + log.warn("error copying pty data for inspector err={}", .{err}); + break :err ""; + }; + } try self.io_thread.wakeup.notify(); // If our event is any keypress that isn't a modifier and we generated @@ -1554,6 +1638,36 @@ pub fn mouseButtonCallback( const tracy = trace(@src()); defer tracy.end(); + // If we have an inspector, we always queue a render + if (self.inspector) |insp| { + defer self.queueRender() catch {}; + + self.renderer_state.mutex.lock(); + defer self.renderer_state.mutex.unlock(); + + // If the inspector is requesting a cell, then we intercept + // left mouse clicks and send them to the inspector. + if (insp.cell == .requested and + button == .left and + action == .press) + { + const pos = try self.rt_surface.getCursorPos(); + const point = self.posToViewport(pos.x, pos.y); + const cell = self.renderer_state.terminal.screen.getCell( + .viewport, + point.y, + point.x, + ); + + insp.cell = .{ .selected = .{ + .row = point.y, + .col = point.x, + .cell = cell, + } }; + return; + } + } + // Always record our latest mouse state self.mouse.click_state[@intCast(@intFromEnum(button))] = action; self.mouse.mods = @bitCast(mods); @@ -1731,6 +1845,17 @@ pub fn cursorPosCallback( self.renderer_state.mutex.lock(); defer self.renderer_state.mutex.unlock(); + // If we have an inspector, we need to always record position information + if (self.inspector) |insp| { + insp.mouse.last_xpos = pos.x; + insp.mouse.last_ypos = pos.y; + + const point = self.posToViewport(pos.x, pos.y); + insp.mouse.last_point = point.toScreen(&self.io.terminal.screen); + + try self.queueRender(); + } + // Do a mouse report if (self.io.terminal.flags.mouse_event != .none) report: { // Shift overrides mouse "grabbing" in the window, taken from Kitty. @@ -2278,6 +2403,12 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool } else log.warn("runtime doesn't implement toggleFullscreen", .{}); }, + .inspector => |mode| { + if (@hasDecl(apprt.Surface, "controlInspector")) { + self.rt_surface.controlInspector(mode); + } else log.warn("runtime doesn't implement controlInspector", .{}); + }, + .close_surface => self.close(), .close_window => try self.app.closeSurface(self), @@ -2413,7 +2544,7 @@ fn completeClipboardReadOSC52(self: *Surface, data: []const u8, kind: u8) !void self.io_thread.wakeup.notify() catch {}; } -const face_ttf = @embedFile("font/res/FiraCode-Regular.ttf"); -const face_bold_ttf = @embedFile("font/res/FiraCode-Bold.ttf"); -const face_emoji_ttf = @embedFile("font/res/NotoColorEmoji.ttf"); -const face_emoji_text_ttf = @embedFile("font/res/NotoEmoji-Regular.ttf"); +pub const face_ttf = @embedFile("font/res/FiraCode-Regular.ttf"); +pub const face_bold_ttf = @embedFile("font/res/FiraCode-Bold.ttf"); +pub const face_emoji_ttf = @embedFile("font/res/NotoColorEmoji.ttf"); +pub const face_emoji_text_ttf = @embedFile("font/res/NotoEmoji-Regular.ttf"); diff --git a/src/apprt.zig b/src/apprt.zig index 50e8a6ba7..a828e1a4c 100644 --- a/src/apprt.zig +++ b/src/apprt.zig @@ -15,6 +15,7 @@ const build_config = @import("build_config.zig"); pub usingnamespace @import("apprt/structs.zig"); pub const glfw = @import("apprt/glfw.zig"); pub const gtk = @import("apprt/gtk.zig"); +pub const none = @import("apprt/none.zig"); pub const browser = @import("apprt/browser.zig"); pub const embedded = @import("apprt/embedded.zig"); pub const surface = @import("apprt/surface.zig"); @@ -25,7 +26,7 @@ pub const surface = @import("apprt/surface.zig"); /// Window or something. pub const runtime = switch (build_config.artifact) { .exe => switch (build_config.app_runtime) { - .none => struct {}, + .none => none, .glfw => glfw, .gtk => gtk, }, diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index d8f6bf316..bb5826594 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -13,6 +13,7 @@ const apprt = @import("../apprt.zig"); const input = @import("../input.zig"); const terminal = @import("../terminal/main.zig"); const CoreApp = @import("../App.zig"); +const CoreInspector = @import("../inspector/main.zig").Inspector; const CoreSurface = @import("../Surface.zig"); const configpkg = @import("../config.zig"); const Config = configpkg.Config; @@ -73,6 +74,9 @@ pub const App = struct { /// New window with options. new_window: ?*const fn (SurfaceUD, apprt.Surface.Options) callconv(.C) void = null, + /// Control the inspector visibility + control_inspector: ?*const fn (SurfaceUD, input.InspectorMode) callconv(.C) void = null, + /// Close the current surface given by this function. close_surface: ?*const fn (SurfaceUD, bool) callconv(.C) void = null, @@ -91,6 +95,9 @@ pub const App = struct { /// Set the initial window size. It is up to the user of libghostty to /// determine if it is the initial window and set this appropriately. set_initial_window_size: ?*const fn (SurfaceUD, u32, u32) callconv(.C) void = null, + + /// Render the inspector for the given surface. + render_inspector: ?*const fn (SurfaceUD) callconv(.C) void = null, }; /// Special values for the goto_tab callback. @@ -174,6 +181,11 @@ pub const App = struct { // No-op, we use a threaded interface so we're constantly drawing. } + pub fn redrawInspector(self: *App, surface: *Surface) void { + _ = self; + surface.queueInspectorRender(); + } + pub fn newWindow(self: *App, parent: ?*CoreSurface) !void { _ = self; @@ -195,6 +207,7 @@ pub const Surface = struct { cursor_pos: apprt.CursorPos, opts: Options, keymap_state: input.Keymap.State, + inspector: ?*Inspector = null, pub const Options = extern struct { /// Userdata passed to some of the callbacks. @@ -290,6 +303,9 @@ pub const Surface = struct { } pub fn deinit(self: *Surface) void { + // Shut down our inspector + self.freeInspector(); + // Remove ourselves from the list of known surfaces in the app. self.app.core_app.deleteSurface(self); @@ -297,6 +313,37 @@ pub const Surface = struct { self.core_surface.deinit(); } + /// Initialize the inspector instance. A surface can only have one + /// inspector at any given time, so this will return the previous inspector + /// if it was already initialized. + pub fn initInspector(self: *Surface) !*Inspector { + if (self.inspector) |v| return v; + + const alloc = self.app.core_app.alloc; + var inspector = try alloc.create(Inspector); + errdefer alloc.destroy(inspector); + inspector.* = try Inspector.init(self); + self.inspector = inspector; + return inspector; + } + + pub fn freeInspector(self: *Surface) void { + if (self.inspector) |v| { + v.deinit(); + self.app.core_app.alloc.destroy(v); + self.inspector = null; + } + } + + pub fn controlInspector(self: *const Surface, mode: input.InspectorMode) void { + const func = self.app.opts.control_inspector orelse { + log.info("runtime embedder does not support the terminal inspector", .{}); + return; + }; + + func(self.opts.userdata, mode); + } + pub fn newSplit(self: *const Surface, direction: input.SplitDirection) !void { const func = self.app.opts.new_split orelse { log.info("runtime embedder does not support splits", .{}); @@ -762,6 +809,15 @@ pub const Surface = struct { func(self.opts.userdata, width, height); } + fn queueInspectorRender(self: *const Surface) void { + const func = self.app.opts.render_inspector orelse { + log.info("runtime embedder does not render_inspector", .{}); + return; + }; + + func(self.opts.userdata); + } + fn newSurfaceOptions(self: *const Surface) apprt.Surface.Options { const font_size: u16 = font_size: { if (!self.app.config.@"window-inherit-font-size") break :font_size 0; @@ -781,6 +837,252 @@ pub const Surface = struct { } }; +/// Inspector is the state required for the terminal inspector. A terminal +/// inspector is 1:1 with a Surface. +pub const Inspector = struct { + const cimgui = @import("cimgui"); + + surface: *Surface, + ig_ctx: *cimgui.c.ImGuiContext, + backend: ?Backend = null, + keymap_state: input.Keymap.State = .{}, + content_scale: f64 = 1, + + /// Our previous instant used to calculate delta time for animations. + instant: ?std.time.Instant = null, + + const Backend = enum { + metal, + + pub fn deinit(self: Backend) void { + switch (self) { + .metal => cimgui.c.ImGui_ImplMetal_Shutdown(), + } + } + }; + + pub fn init(surface: *Surface) !Inspector { + const ig_ctx = cimgui.c.igCreateContext(null); + errdefer cimgui.c.igDestroyContext(ig_ctx); + cimgui.c.igSetCurrentContext(ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + io.BackendPlatformName = "ghostty_embedded"; + + // Setup our core inspector + CoreInspector.setup(); + surface.core_surface.activateInspector() catch |err| { + log.err("failed to activate inspector err={}", .{err}); + }; + + return .{ + .surface = surface, + .ig_ctx = ig_ctx, + }; + } + + pub fn deinit(self: *Inspector) void { + self.surface.core_surface.deactivateInspector(); + cimgui.c.igSetCurrentContext(self.ig_ctx); + if (self.backend) |v| v.deinit(); + cimgui.c.igDestroyContext(self.ig_ctx); + } + + /// Queue a render for the next frame. + pub fn queueRender(self: *Inspector) void { + self.surface.queueInspectorRender(); + } + + /// Initialize the inspector for a metal backend. + pub fn initMetal(self: *Inspector, device: objc.Object) bool { + defer device.msgSend(void, objc.sel("release"), .{}); + cimgui.c.igSetCurrentContext(self.ig_ctx); + + if (self.backend) |v| { + v.deinit(); + self.backend = null; + } + + if (!cimgui.c.ImGui_ImplMetal_Init(device.value)) { + log.warn("failed to initialize metal backend", .{}); + return false; + } + self.backend = .metal; + + log.debug("initialized metal backend", .{}); + return true; + } + + pub fn renderMetal( + self: *Inspector, + command_buffer: objc.Object, + desc: objc.Object, + ) !void { + defer { + command_buffer.msgSend(void, objc.sel("release"), .{}); + desc.msgSend(void, objc.sel("release"), .{}); + } + assert(self.backend == .metal); + //log.debug("render", .{}); + + // Setup our imgui frame. We need to render multiple frames to ensure + // ImGui completes all its state processing. I don't know how to fix + // this. + for (0..2) |_| { + cimgui.c.ImGui_ImplMetal_NewFrame(desc.value); + try self.newFrame(); + cimgui.c.igNewFrame(); + + // Build our UI + render: { + const surface = &self.surface.core_surface; + const inspector = surface.inspector orelse break :render; + inspector.render(); + } + + // Render + cimgui.c.igRender(); + } + + // MTLRenderCommandEncoder + const encoder = command_buffer.msgSend( + objc.Object, + objc.sel("renderCommandEncoderWithDescriptor:"), + .{desc.value}, + ); + defer encoder.msgSend(void, objc.sel("endEncoding"), .{}); + cimgui.c.ImGui_ImplMetal_RenderDrawData( + cimgui.c.igGetDrawData(), + command_buffer.value, + encoder.value, + ); + } + + pub fn updateContentScale(self: *Inspector, x: f64, y: f64) void { + _ = y; + cimgui.c.igSetCurrentContext(self.ig_ctx); + + // Cache our scale because we use it for cursor position calculations. + self.content_scale = x; + + // Setup a new style and scale it appropriately. + const style = cimgui.c.ImGuiStyle_ImGuiStyle(); + defer cimgui.c.ImGuiStyle_destroy(style); + cimgui.c.ImGuiStyle_ScaleAllSizes(style, @floatCast(x)); + const active_style = cimgui.c.igGetStyle(); + active_style.* = style.*; + } + + pub fn updateSize(self: *Inspector, width: u32, height: u32) void { + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + io.DisplaySize = .{ .x = @floatFromInt(width), .y = @floatFromInt(height) }; + } + + pub fn mouseButtonCallback( + self: *Inspector, + action: input.MouseButtonState, + button: input.MouseButton, + mods: input.Mods, + ) void { + _ = mods; + + self.queueRender(); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + + const imgui_button = switch (button) { + .left => cimgui.c.ImGuiMouseButton_Left, + .middle => cimgui.c.ImGuiMouseButton_Middle, + .right => cimgui.c.ImGuiMouseButton_Right, + else => return, // unsupported + }; + + cimgui.c.ImGuiIO_AddMouseButtonEvent(io, imgui_button, action == .press); + } + + pub fn scrollCallback( + self: *Inspector, + xoff: f64, + yoff: f64, + mods: input.ScrollMods, + ) void { + _ = mods; + + self.queueRender(); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddMouseWheelEvent( + io, + @floatCast(xoff), + @floatCast(yoff), + ); + } + + pub fn cursorPosCallback(self: *Inspector, x: f64, y: f64) void { + self.queueRender(); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddMousePosEvent( + io, + @floatCast(x * self.content_scale), + @floatCast(y * self.content_scale), + ); + } + + pub fn focusCallback(self: *Inspector, focused: bool) void { + self.queueRender(); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddFocusEvent(io, focused); + } + + pub fn textCallback(self: *Inspector, text: [:0]const u8) void { + self.queueRender(); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddInputCharactersUTF8(io, text.ptr); + } + + pub fn keyCallback( + self: *Inspector, + action: input.Action, + key: input.Key, + mods: input.Mods, + ) !void { + self.queueRender(); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + + // Update all our modifiers + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftShift, mods.shift); + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftCtrl, mods.ctrl); + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftAlt, mods.alt); + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftSuper, mods.super); + + // Send our keypress + if (key.imguiKey()) |imgui_key| { + cimgui.c.ImGuiIO_AddKeyEvent( + io, + imgui_key, + action == .press or action == .repeat, + ); + } + } + + fn newFrame(self: *Inspector) !void { + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + + // Determine our delta time + const now = try std.time.Instant.now(); + io.DeltaTime = if (self.instant) |prev| delta: { + const since_ns = now.since(prev); + const since_s: f32 = @floatFromInt(since_ns / std.time.ns_per_s); + break :delta @max(0.00001, since_s); + } else (1 / 60); + self.instant = now; + } +}; + // C API pub const CAPI = struct { const global = &@import("../main.zig").state; @@ -1047,6 +1349,113 @@ pub const CAPI = struct { }; } + export fn ghostty_surface_inspector(ptr: *Surface) ?*Inspector { + return ptr.initInspector() catch |err| { + log.err("error initializing inspector err={}", .{err}); + return null; + }; + } + + export fn ghostty_inspector_free(ptr: *Surface) void { + ptr.freeInspector(); + } + + export fn ghostty_inspector_metal_init(ptr: *Inspector, device: objc.c.id) bool { + return ptr.initMetal(objc.Object.fromId(device)); + } + + export fn ghostty_inspector_metal_render( + ptr: *Inspector, + command_buffer: objc.c.id, + descriptor: objc.c.id, + ) void { + return ptr.renderMetal( + objc.Object.fromId(command_buffer), + objc.Object.fromId(descriptor), + ) catch |err| { + log.err("error rendering inspector err={}", .{err}); + return; + }; + } + + export fn ghostty_inspector_metal_shutdown(ptr: *Inspector) void { + if (ptr.backend) |v| { + v.deinit(); + ptr.backend = null; + } + } + + export fn ghostty_inspector_set_size(ptr: *Inspector, w: u32, h: u32) void { + ptr.updateSize(w, h); + } + + export fn ghostty_inspector_set_content_scale(ptr: *Inspector, x: f64, y: f64) void { + ptr.updateContentScale(x, y); + } + + export fn ghostty_inspector_mouse_button( + ptr: *Inspector, + action: input.MouseButtonState, + button: input.MouseButton, + mods: c_int, + ) void { + ptr.mouseButtonCallback( + action, + button, + @bitCast(@as( + input.Mods.Backing, + @truncate(@as(c_uint, @bitCast(mods))), + )), + ); + } + + export fn ghostty_inspector_mouse_pos(ptr: *Inspector, x: f64, y: f64) void { + ptr.cursorPosCallback(x, y); + } + + export fn ghostty_inspector_mouse_scroll( + ptr: *Inspector, + x: f64, + y: f64, + scroll_mods: c_int, + ) void { + ptr.scrollCallback( + x, + y, + @bitCast(@as(u8, @truncate(@as(c_uint, @bitCast(scroll_mods))))), + ); + } + + export fn ghostty_inspector_key( + ptr: *Inspector, + action: input.Action, + key: input.Key, + c_mods: c_int, + ) void { + ptr.keyCallback( + action, + key, + @bitCast(@as( + input.Mods.Backing, + @truncate(@as(c_uint, @bitCast(c_mods))), + )), + ) catch |err| { + log.err("error processing key event err={}", .{err}); + return; + }; + } + + export fn ghostty_inspector_text( + ptr: *Inspector, + str: [*:0]const u8, + ) void { + ptr.textCallback(std.mem.sliceTo(str, 0)); + } + + export fn ghostty_inspector_set_focus(ptr: *Inspector, focused: bool) void { + ptr.focusCallback(focused); + } + /// Sets the window background blur on macOS to the desired value. /// I do this in Zig as an extern function because I don't know how to /// call these functions in Swift. diff --git a/src/apprt/glfw.zig b/src/apprt/glfw.zig index 4a40ed22e..36367e20b 100644 --- a/src/apprt/glfw.zig +++ b/src/apprt/glfw.zig @@ -215,6 +215,13 @@ pub const App = struct { @panic("This should never be called for GLFW."); } + pub fn redrawInspector(self: *App, surface: *Surface) void { + _ = self; + _ = surface; + + // GLFW doesn't support the inspector + } + fn glfwErrorCallback(code: glfw.ErrorCode, desc: [:0]const u8) void { std.log.warn("glfw error={} message={s}", .{ code, desc }); diff --git a/src/apprt/gtk.zig b/src/apprt/gtk.zig index 268da2ee4..882448ed7 100644 --- a/src/apprt/gtk.zig +++ b/src/apprt/gtk.zig @@ -6,5 +6,6 @@ pub const Surface = @import("gtk/Surface.zig"); test { @import("std").testing.refAllDecls(@This()); + _ = @import("gtk/inspector.zig"); _ = @import("gtk/key.zig"); } diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 9a9c2fb41..74d3c6b76 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -25,6 +25,7 @@ const Surface = @import("Surface.zig"); const Window = @import("Window.zig"); const ConfigErrorsWindow = @import("ConfigErrorsWindow.zig"); const c = @import("c.zig"); +const inspector = @import("inspector.zig"); const key = @import("key.zig"); const log = std.log.scoped(.gtk); @@ -215,6 +216,7 @@ fn updateConfigErrors(self: *App) !void { fn syncActionAccelerators(self: *App) !void { try self.syncActionAccelerator("app.quit", .{ .quit = {} }); try self.syncActionAccelerator("app.reload_config", .{ .reload_config = {} }); + try self.syncActionAccelerator("app.toggle_inspector", .{ .inspector = .toggle }); try self.syncActionAccelerator("win.close", .{ .close_surface = {} }); try self.syncActionAccelerator("win.new_window", .{ .new_window = {} }); try self.syncActionAccelerator("win.new_tab", .{ .new_tab = {} }); @@ -277,6 +279,12 @@ pub fn redrawSurface(self: *App, surface: *Surface) void { surface.redraw(); } +/// Redraw the inspector for the given surface. +pub fn redrawInspector(self: *App, surface: *Surface) void { + _ = self; + surface.queueInspectorRender(); +} + /// Called by CoreApp to create a new window with a new surface. pub fn newWindow(self: *App, parent_: ?*CoreSurface) !void { const alloc = self.core_app.alloc; @@ -458,6 +466,7 @@ fn initMenu(self: *App) void { const section = c.g_menu_new(); defer c.g_object_unref(section); c.g_menu_append_section(menu, null, @ptrCast(@alignCast(section))); + c.g_menu_append(section, "Terminal Inspector", "win.toggle_inspector"); c.g_menu_append(section, "Reload Configuration", "app.reload_config"); c.g_menu_append(section, "About Ghostty", "win.about"); } diff --git a/src/apprt/gtk/ImguiWidget.zig b/src/apprt/gtk/ImguiWidget.zig new file mode 100644 index 000000000..eb9b97f06 --- /dev/null +++ b/src/apprt/gtk/ImguiWidget.zig @@ -0,0 +1,392 @@ +const ImguiWidget = @This(); + +const std = @import("std"); +const assert = std.debug.assert; + +const cimgui = @import("cimgui"); +const c = @import("c.zig"); +const key = @import("key.zig"); +const gl = @import("../../renderer/opengl/main.zig"); +const input = @import("../../input.zig"); + +const log = std.log.scoped(.gtk_imgui_widget); + +/// This is called every frame to populate the ImGui frame. +render_callback: ?*const fn (?*anyopaque) void = null, +render_userdata: ?*anyopaque = null, + +/// Our OpenGL widget +gl_area: *c.GtkGLArea, +im_context: *c.GtkIMContext, + +/// ImGui Context +ig_ctx: *cimgui.c.ImGuiContext, + +/// Our previous instant used to calculate delta time for animations. +instant: ?std.time.Instant = null, + +/// Initialize the widget. This must have a stable pointer for events. +pub fn init(self: *ImguiWidget) !void { + // Each widget gets its own imgui context so we can have multiple + // imgui views in the same application. + const ig_ctx = cimgui.c.igCreateContext(null); + errdefer cimgui.c.igDestroyContext(ig_ctx); + cimgui.c.igSetCurrentContext(ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + io.BackendPlatformName = "ghostty_gtk"; + + // Our OpenGL area for drawing + const gl_area = c.gtk_gl_area_new(); + c.gtk_gl_area_set_auto_render(@ptrCast(gl_area), 1); + + // The GL area has to be focusable so that it can receive events + c.gtk_widget_set_focusable(@ptrCast(gl_area), 1); + c.gtk_widget_set_focus_on_click(@ptrCast(gl_area), 1); + + // Clicks + const gesture_click = c.gtk_gesture_click_new(); + errdefer c.g_object_unref(gesture_click); + c.gtk_gesture_single_set_button(@ptrCast(gesture_click), 0); + c.gtk_widget_add_controller(@ptrCast(gl_area), @ptrCast(gesture_click)); + + // Mouse movement + const ec_motion = c.gtk_event_controller_motion_new(); + errdefer c.g_object_unref(ec_motion); + c.gtk_widget_add_controller(@ptrCast(gl_area), ec_motion); + + // Scroll events + const ec_scroll = c.gtk_event_controller_scroll_new( + c.GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES | + c.GTK_EVENT_CONTROLLER_SCROLL_DISCRETE, + ); + errdefer c.g_object_unref(ec_scroll); + c.gtk_widget_add_controller(@ptrCast(gl_area), ec_scroll); + + // Focus controller will tell us about focus enter/exit events + const ec_focus = c.gtk_event_controller_focus_new(); + errdefer c.g_object_unref(ec_focus); + c.gtk_widget_add_controller(@ptrCast(gl_area), ec_focus); + + // Key event controller will tell us about raw keypress events. + const ec_key = c.gtk_event_controller_key_new(); + errdefer c.g_object_unref(ec_key); + c.gtk_widget_add_controller(@ptrCast(gl_area), ec_key); + errdefer c.gtk_widget_remove_controller(@ptrCast(gl_area), ec_key); + + // The input method context that we use to translate key events into + // characters. This doesn't have an event key controller attached because + // we call it manually from our own key controller. + const im_context = c.gtk_im_multicontext_new(); + errdefer c.g_object_unref(im_context); + + // Signals + _ = c.g_signal_connect_data(gl_area, "destroy", c.G_CALLBACK(>kDestroy), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(gl_area, "realize", c.G_CALLBACK(>kRealize), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(gl_area, "unrealize", c.G_CALLBACK(>kUnrealize), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(gl_area, "render", c.G_CALLBACK(>kRender), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(gl_area, "resize", c.G_CALLBACK(>kResize), self, null, c.G_CONNECT_DEFAULT); + + _ = c.g_signal_connect_data(ec_focus, "enter", c.G_CALLBACK(>kFocusEnter), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(ec_focus, "leave", c.G_CALLBACK(>kFocusLeave), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(ec_key, "key-pressed", c.G_CALLBACK(>kKeyPressed), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(ec_key, "key-released", c.G_CALLBACK(>kKeyReleased), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(ec_motion, "motion", c.G_CALLBACK(>kMouseMotion), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(ec_scroll, "scroll", c.G_CALLBACK(>kMouseScroll), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(gesture_click, "pressed", c.G_CALLBACK(>kMouseDown), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(gesture_click, "released", c.G_CALLBACK(>kMouseUp), self, null, c.G_CONNECT_DEFAULT); + _ = c.g_signal_connect_data(im_context, "commit", c.G_CALLBACK(>kInputCommit), self, null, c.G_CONNECT_DEFAULT); + + self.* = .{ + .gl_area = @ptrCast(gl_area), + .im_context = @ptrCast(im_context), + .ig_ctx = ig_ctx, + }; +} + +/// Deinitialize the widget. This should ONLY be called if the widget gl_area +/// was never added to a parent. Otherwise, cleanup automatically happens +/// when the widget is destroyed and this should NOT be called. +pub fn deinit(self: *ImguiWidget) void { + cimgui.c.igDestroyContext(self.ig_ctx); +} + +/// This should be called anytime the underlying data for the UI changes +/// so that the UI can be refreshed. +pub fn queueRender(self: *const ImguiWidget) void { + c.gtk_gl_area_queue_render(self.gl_area); +} + +/// Initialize the frame. Expects that the context is already current. +fn newFrame(self: *ImguiWidget) !void { + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + + // Determine our delta time + const now = try std.time.Instant.now(); + io.DeltaTime = if (self.instant) |prev| delta: { + const since_ns = now.since(prev); + const since_s: f32 = @floatFromInt(since_ns / std.time.ns_per_s); + break :delta @max(0.00001, since_s); + } else (1 / 60); + self.instant = now; +} + +fn translateMouseButton(button: c.guint) ?c_int { + return switch (button) { + 1 => cimgui.c.ImGuiMouseButton_Left, + 2 => cimgui.c.ImGuiMouseButton_Middle, + 3 => cimgui.c.ImGuiMouseButton_Right, + else => null, + }; +} + +fn gtkDestroy(v: *c.GtkWidget, ud: ?*anyopaque) callconv(.C) void { + _ = v; + log.debug("imgui widget destroy", .{}); + + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.deinit(); +} + +fn gtkRealize(area: *c.GtkGLArea, ud: ?*anyopaque) callconv(.C) void { + log.debug("gl surface realized", .{}); + + // We need to make the context current so we can call GL functions. + c.gtk_gl_area_make_current(area); + if (c.gtk_gl_area_get_error(area)) |err| { + log.err("surface failed to realize: {s}", .{err.*.message}); + return; + } + + // realize means that our OpenGL context is ready, so we can now + // initialize the ImgUI OpenGL backend for our context. + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + cimgui.c.igSetCurrentContext(self.ig_ctx); + _ = cimgui.c.ImGui_ImplOpenGL3_Init(null); +} + +fn gtkUnrealize(area: *c.GtkGLArea, ud: ?*anyopaque) callconv(.C) void { + _ = area; + log.debug("gl surface unrealized", .{}); + + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + cimgui.c.igSetCurrentContext(self.ig_ctx); + cimgui.c.ImGui_ImplOpenGL3_Shutdown(); +} + +fn gtkResize(area: *c.GtkGLArea, width: c.gint, height: c.gint, ud: ?*anyopaque) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + const scale_factor = c.gtk_widget_get_scale_factor(@ptrCast(area)); + log.debug("gl resize width={} height={} scale={}", .{ + width, + height, + scale_factor, + }); + + // Our display size is always unscaled. We'll do the scaling in the + // style instead. This creates crisper looking fonts. + io.DisplaySize = .{ .x = @floatFromInt(width), .y = @floatFromInt(height) }; + io.DisplayFramebufferScale = .{ .x = 1, .y = 1 }; + + // Setup a new style and scale it appropriately. + const style = cimgui.c.ImGuiStyle_ImGuiStyle(); + defer cimgui.c.ImGuiStyle_destroy(style); + cimgui.c.ImGuiStyle_ScaleAllSizes(style, @floatFromInt(scale_factor)); + const active_style = cimgui.c.igGetStyle(); + active_style.* = style.*; +} + +fn gtkRender(area: *c.GtkGLArea, ctx: *c.GdkGLContext, ud: ?*anyopaque) callconv(.C) c.gboolean { + _ = area; + _ = ctx; + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + cimgui.c.igSetCurrentContext(self.ig_ctx); + + // Setup our frame. We render twice because some ImGui behaviors + // take multiple renders to process. I don't know how to make this + // more efficient. + for (0..2) |_| { + cimgui.c.ImGui_ImplOpenGL3_NewFrame(); + self.newFrame() catch |err| { + log.err("failed to setup frame: {}", .{err}); + return 0; + }; + cimgui.c.igNewFrame(); + + // Build our UI + if (self.render_callback) |cb| cb(self.render_userdata); + + // Render + cimgui.c.igRender(); + } + + // OpenGL final render + gl.clearColor(0x28 / 0xFF, 0x2C / 0xFF, 0x34 / 0xFF, 1.0); + gl.clear(gl.c.GL_COLOR_BUFFER_BIT); + cimgui.c.ImGui_ImplOpenGL3_RenderDrawData(cimgui.c.igGetDrawData()); + + return 1; +} + +fn gtkMouseMotion( + _: *c.GtkEventControllerMotion, + x: c.gdouble, + y: c.gdouble, + ud: ?*anyopaque, +) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + const scale_factor: f64 = @floatFromInt(c.gtk_widget_get_scale_factor( + @ptrCast(self.gl_area), + )); + cimgui.c.ImGuiIO_AddMousePosEvent( + io, + @floatCast(x * scale_factor), + @floatCast(y * scale_factor), + ); + self.queueRender(); +} + +fn gtkMouseDown( + gesture: *c.GtkGestureClick, + _: c.gint, + _: c.gdouble, + _: c.gdouble, + ud: ?*anyopaque, +) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.queueRender(); + + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + const gdk_button = c.gtk_gesture_single_get_current_button(@ptrCast(gesture)); + if (translateMouseButton(gdk_button)) |button| { + cimgui.c.ImGuiIO_AddMouseButtonEvent(io, button, true); + } +} + +fn gtkMouseUp( + gesture: *c.GtkGestureClick, + _: c.gint, + _: c.gdouble, + _: c.gdouble, + ud: ?*anyopaque, +) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.queueRender(); + + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + const gdk_button = c.gtk_gesture_single_get_current_button(@ptrCast(gesture)); + if (translateMouseButton(gdk_button)) |button| { + cimgui.c.ImGuiIO_AddMouseButtonEvent(io, button, false); + } +} + +fn gtkMouseScroll( + _: *c.GtkEventControllerScroll, + x: c.gdouble, + y: c.gdouble, + ud: ?*anyopaque, +) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.queueRender(); + + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddMouseWheelEvent( + io, + @floatCast(x), + @floatCast(-y), + ); +} + +fn gtkFocusEnter(_: *c.GtkEventControllerFocus, ud: ?*anyopaque) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.queueRender(); + + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddFocusEvent(io, true); +} + +fn gtkFocusLeave(_: *c.GtkEventControllerFocus, ud: ?*anyopaque) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.queueRender(); + + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddFocusEvent(io, false); +} + +fn gtkInputCommit( + _: *c.GtkIMContext, + bytes: [*:0]u8, + ud: ?*anyopaque, +) callconv(.C) void { + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.queueRender(); + + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + cimgui.c.ImGuiIO_AddInputCharactersUTF8(io, bytes); +} + +fn gtkKeyPressed( + ec_key: *c.GtkEventControllerKey, + keyval: c.guint, + keycode: c.guint, + gtk_mods: c.GdkModifierType, + ud: ?*anyopaque, +) callconv(.C) c.gboolean { + return if (keyEvent(.press, ec_key, keyval, keycode, gtk_mods, ud)) 1 else 0; +} + +fn gtkKeyReleased( + ec_key: *c.GtkEventControllerKey, + keyval: c.guint, + keycode: c.guint, + state: c.GdkModifierType, + ud: ?*anyopaque, +) callconv(.C) c.gboolean { + return if (keyEvent(.release, ec_key, keyval, keycode, state, ud)) 1 else 0; +} + +fn keyEvent( + action: input.Action, + ec_key: *c.GtkEventControllerKey, + keyval: c.guint, + keycode: c.guint, + gtk_mods: c.GdkModifierType, + ud: ?*anyopaque, +) bool { + _ = keycode; + + const self: *ImguiWidget = @ptrCast(@alignCast(ud.?)); + self.queueRender(); + + cimgui.c.igSetCurrentContext(self.ig_ctx); + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + + // Translate the GTK mods and update the modifiers on every keypress + const mods = key.translateMods(gtk_mods); + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftShift, mods.shift); + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftCtrl, mods.ctrl); + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftAlt, mods.alt); + cimgui.c.ImGuiIO_AddKeyEvent(io, cimgui.c.ImGuiKey_LeftSuper, mods.super); + + // If our keyval has a key, then we send that key event + if (key.keyFromKeyval(keyval)) |inputkey| { + if (inputkey.imguiKey()) |imgui_key| { + cimgui.c.ImGuiIO_AddKeyEvent(io, imgui_key, action == .press); + } + } + + // Try to process the event as text + const event = c.gtk_event_controller_get_current_event(@ptrCast(ec_key)); + _ = c.gtk_im_context_filter_keypress(self.im_context, event); + + return true; +} diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index 2638eca9d..c6403a0d5 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -14,6 +14,7 @@ const CoreSurface = @import("../../Surface.zig"); const App = @import("App.zig"); const Window = @import("Window.zig"); +const inspector = @import("inspector.zig"); const c = @import("c.zig"); const log = std.log.scoped(.gtk); @@ -76,6 +77,9 @@ font_size: ?font.face.DesiredSize = null, size: apprt.SurfaceSize, cursor_pos: apprt.CursorPos, +/// Inspector state. +inspector: ?*inspector.Inspector = null, + /// Key input states. See gtkKeyPressed for detailed descriptions. in_keypress: bool = false, im_context: *c.GtkIMContext, @@ -218,6 +222,9 @@ pub fn deinit(self: *Surface) void { // We don't allocate anything if we aren't realized. if (!self.realized) return; + // Delete our inspector if we have one + self.controlInspector(.hide); + // Remove ourselves from the list of known surfaces in the app. self.app.core_app.deleteSurface(self); @@ -235,6 +242,11 @@ fn render(self: *Surface) !void { try self.core_surface.renderer.draw(); } +/// Queue the inspector to render if we have one. +pub fn queueInspectorRender(self: *Surface) void { + if (self.inspector) |v| v.queueRender(); +} + /// Invalidate the surface so that it forces a redraw on the next tick. pub fn redraw(self: *Surface) void { c.gtk_gl_area_queue_render(self.gl_area); @@ -281,6 +293,33 @@ pub fn close(self: *Surface, processActive: bool) void { c.gtk_widget_show(alert); } +pub fn controlInspector(self: *Surface, mode: input.InspectorMode) void { + const show = switch (mode) { + .toggle => self.inspector == null, + .show => true, + .hide => false, + }; + + if (!show) { + if (self.inspector) |v| { + v.close(); + self.inspector = null; + } + + return; + } + + // If we already have an inspector, we don't need to show anything. + if (self.inspector != null) return; + self.inspector = inspector.Inspector.create( + self, + .{ .window = {} }, + ) catch |err| { + log.err("failed to control inspector err={}", .{err}); + return; + }; +} + pub fn toggleFullscreen(self: *Surface, mac_non_native: configpkg.NonNativeFullscreen) void { self.window.toggleFullscreen(mac_non_native); } diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index 3b5e8a17f..8dddfea56 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -12,6 +12,7 @@ const CoreSurface = @import("../../Surface.zig"); const App = @import("App.zig"); const Surface = @import("Surface.zig"); +const icon = @import("icon.zig"); const c = @import("c.zig"); const log = std.log.scoped(.gtk); @@ -28,7 +29,7 @@ notebook: *c.GtkNotebook, /// The resources directory for the icon (if any). We need to retain a /// pointer to this because GTK can use it at any time. -icon_search_dir: ?[:0]const u8 = null, +icon: icon.Icon, pub fn create(alloc: Allocator, app: *App) !*Window { // Allocate a fixed pointer for our window. We try to minimize @@ -48,6 +49,7 @@ pub fn init(self: *Window, app: *App) !void { // Set up our own state self.* = .{ .app = app, + .icon = undefined, .window = undefined, .notebook = undefined, }; @@ -62,28 +64,8 @@ pub fn init(self: *Window, app: *App) !void { // If we don't have the icon then we'll try to add our resources dir // to the search path and see if we can find it there. - const icon_name = "com.mitchellh.ghostty"; - const icon_theme = c.gtk_icon_theme_get_for_display(c.gtk_widget_get_display(window)); - if (c.gtk_icon_theme_has_icon(icon_theme, icon_name) == 0) icon: { - const base = self.app.core_app.resources_dir orelse { - log.info("gtk app missing Ghostty icon and no resources dir detected", .{}); - log.info("gtk app will not have Ghostty icon", .{}); - break :icon; - }; - - // Note that this method for adding the icon search path is - // a fallback mechanism. The recommended mechanism is the - // Freedesktop Icon Theme Specification. We distribute a ".desktop" - // file in zig-out/share that should be installed to the proper - // place. - const dir = try std.fmt.allocPrintZ(app.core_app.alloc, "{s}/icons", .{base}); - self.icon_search_dir = dir; - c.gtk_icon_theme_add_search_path(icon_theme, dir.ptr); - if (c.gtk_icon_theme_has_icon(icon_theme, icon_name) == 0) { - log.warn("Ghostty icon for gtk app not found", .{}); - } - } - c.gtk_window_set_icon_name(gtk_window, icon_name); + self.icon = try icon.appIcon(self.app, window); + c.gtk_window_set_icon_name(gtk_window, self.icon.name); // Apply background opacity if we have it if (app.config.@"background-opacity" < 1) { @@ -167,6 +149,7 @@ fn initActions(self: *Window) void { .{ "close", >kActionClose }, .{ "new_window", >kActionNewWindow }, .{ "new_tab", >kActionNewTab }, + .{ "toggle_inspector", >kActionToggleInspector }, }; inline for (actions) |entry| { @@ -185,7 +168,7 @@ fn initActions(self: *Window) void { } pub fn deinit(self: *Window) void { - if (self.icon_search_dir) |ptr| self.app.core_app.alloc.free(ptr); + self.icon.deinit(self.app); } /// Add a new tab to this window. @@ -564,6 +547,19 @@ fn gtkActionNewTab( }; } +fn gtkActionToggleInspector( + _: *c.GSimpleAction, + _: *c.GVariant, + ud: ?*anyopaque, +) callconv(.C) void { + const self: *Window = @ptrCast(@alignCast(ud orelse return)); + const surface = self.actionSurface() orelse return; + _ = surface.performBindingAction(.{ .inspector = .toggle }) catch |err| { + log.warn("error performing binding action error={}", .{err}); + return; + }; +} + /// Returns the surface to use for an action. fn actionSurface(self: *Window) ?*CoreSurface { const page_idx = c.gtk_notebook_get_current_page(self.notebook); diff --git a/src/apprt/gtk/icon.zig b/src/apprt/gtk/icon.zig new file mode 100644 index 000000000..30416d07b --- /dev/null +++ b/src/apprt/gtk/icon.zig @@ -0,0 +1,52 @@ +const std = @import("std"); + +const App = @import("App.zig"); +const c = @import("c.zig"); + +const log = std.log.scoped(.gtk_icon); + +/// An icon. The icon may be associated with some allocated state so when +/// the icon is no longer in use it should be deinitialized. +pub const Icon = struct { + name: [:0]const u8, + state: ?[:0]const u8 = null, + + pub fn deinit(self: *const Icon, app: *App) void { + if (self.state) |v| app.core_app.alloc.free(v); + } +}; + +/// Returns the application icon that can be used anywhere. This attempts to +/// find the icon in the theme and if it can't be found, it is loaded from +/// the resources dir. If the resources dir can't be found, we'll log a warning +/// and let GTK choose a fallback. +pub fn appIcon(app: *App, widget: *c.GtkWidget) !Icon { + const icon_name = "com.mitchellh.ghostty"; + var result: Icon = .{ .name = icon_name }; + + // If we don't have the icon then we'll try to add our resources dir + // to the search path and see if we can find it there. + const icon_theme = c.gtk_icon_theme_get_for_display(c.gtk_widget_get_display(widget)); + if (c.gtk_icon_theme_has_icon(icon_theme, icon_name) == 0) icon: { + const base = app.core_app.resources_dir orelse { + log.info("gtk app missing Ghostty icon and no resources dir detected", .{}); + log.info("gtk app will not have Ghostty icon", .{}); + break :icon; + }; + + // Note that this method for adding the icon search path is + // a fallback mechanism. The recommended mechanism is the + // Freedesktop Icon Theme Specification. We distribute a ".desktop" + // file in zig-out/share that should be installed to the proper + // place. + const dir = try std.fmt.allocPrintZ(app.core_app.alloc, "{s}/icons", .{base}); + errdefer app.core_app.alloc.free(dir); + result.state = dir; + c.gtk_icon_theme_add_search_path(icon_theme, dir.ptr); + if (c.gtk_icon_theme_has_icon(icon_theme, icon_name) == 0) { + log.warn("Ghostty icon for gtk app not found", .{}); + } + } + + return result; +} diff --git a/src/apprt/gtk/inspector.zig b/src/apprt/gtk/inspector.zig new file mode 100644 index 000000000..8eee7a540 --- /dev/null +++ b/src/apprt/gtk/inspector.zig @@ -0,0 +1,189 @@ +const std = @import("std"); +const Allocator = std.mem.Allocator; +const assert = std.debug.assert; + +const App = @import("App.zig"); +const Surface = @import("Surface.zig"); +const TerminalWindow = @import("Window.zig"); +const ImguiWidget = @import("ImguiWidget.zig"); +const c = @import("c.zig"); +const icon = @import("icon.zig"); +const CoreInspector = @import("../../inspector/main.zig").Inspector; + +const log = std.log.scoped(.inspector); + +/// Inspector is the primary stateful object that represents a terminal +/// inspector. An inspector is 1:1 with a Surface and is owned by a Surface. +/// Closing a surface must close its inspector. +pub const Inspector = struct { + /// The surface that owns this inspector. + surface: *Surface, + + /// The current state of where this inspector is rendered. The Inspector + /// is the state of the inspector but this is the state of the GUI. + location: LocationState, + + /// This is true if we want to destroy this inspector as soon as the + /// location is closed. For example: set this to true, request the + /// window be closed, let GTK do its cleanup, then note this to destroy + /// the inner state. + destroy_on_close: bool = true, + + /// Location where the inspector will be launched. + pub const Location = union(LocationKey) { + hidden: void, + window: void, + }; + + /// The internal state for each possible location. + const LocationState = union(LocationKey) { + hidden: void, + window: Window, + }; + + const LocationKey = enum { + /// No GUI, but load the inspector state. + hidden, + + /// A dedicated window for the inspector. + window, + }; + + /// Create an inspector for the given surface in the given location. + pub fn create(surface: *Surface, location: Location) !*Inspector { + const alloc = surface.app.core_app.alloc; + var ptr = try alloc.create(Inspector); + errdefer alloc.destroy(ptr); + try ptr.init(surface, location); + return ptr; + } + + /// Destroy all memory associated with this inspector. You generally + /// should NOT call this publicly and should call `close` instead to + /// use the GTK lifecycle. + pub fn destroy(self: *Inspector) void { + assert(self.location == .hidden); + const alloc = self.allocator(); + self.surface.inspector = null; + self.deinit(); + alloc.destroy(self); + } + + fn init(self: *Inspector, surface: *Surface, location: Location) !void { + self.* = .{ + .surface = surface, + .location = undefined, + }; + + // Activate the inspector. If it doesn't work we ignore the error + // because we can just show an error in the inspector window. + self.surface.core_surface.activateInspector() catch |err| { + log.err("failed to activate inspector err={}", .{err}); + }; + + switch (location) { + .hidden => self.location = .{ .hidden = {} }, + .window => try self.initWindow(), + } + } + + fn deinit(self: *Inspector) void { + self.surface.core_surface.deactivateInspector(); + } + + /// Request the inspector is closed. + pub fn close(self: *Inspector) void { + switch (self.location) { + .hidden => self.locationDidClose(), + .window => |v| v.close(), + } + } + + fn locationDidClose(self: *Inspector) void { + self.location = .{ .hidden = {} }; + if (self.destroy_on_close) self.destroy(); + } + + pub fn queueRender(self: *const Inspector) void { + switch (self.location) { + .hidden => {}, + .window => |v| v.imgui_widget.queueRender(), + } + } + + fn allocator(self: *const Inspector) Allocator { + return self.surface.app.core_app.alloc; + } + + fn initWindow(self: *Inspector) !void { + self.location = .{ .window = undefined }; + try self.location.window.init(self); + } +}; + +/// A dedicated window to hold an inspector instance. +const Window = struct { + inspector: *Inspector, + window: *c.GtkWindow, + icon: icon.Icon, + imgui_widget: ImguiWidget, + + pub fn init(self: *Window, inspector: *Inspector) !void { + // Initialize to undefined + self.* = .{ + .inspector = inspector, + .icon = undefined, + .window = undefined, + .imgui_widget = undefined, + }; + + // Create the window + const window = c.gtk_application_window_new(inspector.surface.app.app); + const gtk_window: *c.GtkWindow = @ptrCast(window); + errdefer c.gtk_window_destroy(gtk_window); + self.window = gtk_window; + c.gtk_window_set_title(gtk_window, "Ghostty: Terminal Inspector"); + c.gtk_window_set_default_size(gtk_window, 1000, 600); + self.icon = try icon.appIcon(self.inspector.surface.app, window); + c.gtk_window_set_icon_name(gtk_window, self.icon.name); + + // Initialize our imgui widget + try self.imgui_widget.init(); + errdefer self.imgui_widget.deinit(); + self.imgui_widget.render_callback = &imguiRender; + self.imgui_widget.render_userdata = self; + CoreInspector.setup(); + + // Signals + _ = c.g_signal_connect_data(window, "destroy", c.G_CALLBACK(>kDestroy), self, null, c.G_CONNECT_DEFAULT); + + // Show the window + c.gtk_window_set_child(gtk_window, @ptrCast(self.imgui_widget.gl_area)); + c.gtk_widget_show(window); + } + + pub fn deinit(self: *Window) void { + self.icon.deinit(self.inspector.surface.app); + self.inspector.locationDidClose(); + } + + pub fn close(self: *const Window) void { + c.gtk_window_destroy(self.window); + } + + fn imguiRender(ud: ?*anyopaque) void { + const self: *Window = @ptrCast(@alignCast(ud orelse return)); + const surface = &self.inspector.surface.core_surface; + const inspector = surface.inspector orelse return; + inspector.render(); + } + + /// "destroy" signal for the window + fn gtkDestroy(v: *c.GtkWidget, ud: ?*anyopaque) callconv(.C) void { + _ = v; + log.debug("window destroy", .{}); + + const self: *Window = @ptrCast(@alignCast(ud.?)); + self.deinit(); + } +}; diff --git a/src/apprt/none.zig b/src/apprt/none.zig new file mode 100644 index 000000000..76a0a8ecb --- /dev/null +++ b/src/apprt/none.zig @@ -0,0 +1,2 @@ +pub const App = struct {}; +pub const Surface = struct {}; diff --git a/src/terminal/circ_buf.zig b/src/circ_buf.zig similarity index 77% rename from src/terminal/circ_buf.zig rename to src/circ_buf.zig index b60f64b4b..b36a1bc08 100644 --- a/src/terminal/circ_buf.zig +++ b/src/circ_buf.zig @@ -1,8 +1,7 @@ const std = @import("std"); const assert = std.debug.assert; const Allocator = std.mem.Allocator; -const trace = @import("tracy").trace; -const fastmem = @import("../fastmem.zig"); +const fastmem = @import("fastmem.zig"); /// Returns a circular buffer containing type T. pub fn CircBuf(comptime T: type, comptime default: T) type { @@ -25,6 +24,29 @@ pub fn CircBuf(comptime T: type, comptime default: T) type { // this minor overhead is not worth optimizing out. full: bool, + pub const Iterator = struct { + buf: Self, + idx: usize, + direction: Direction, + + pub const Direction = enum { forward, reverse }; + + pub fn next(self: *Iterator) ?*T { + if (self.idx >= self.buf.len()) return null; + + // Get our index from the tail + const tail_idx = switch (self.direction) { + .forward => self.idx, + .reverse => self.buf.len() - self.idx - 1, + }; + + // Translate the tail index to a storage index + const storage_idx = (self.buf.tail + tail_idx) % self.buf.capacity(); + self.idx += 1; + return &self.buf.storage[storage_idx]; + } + }; + /// Initialize a new circular buffer that can store size elements. pub fn init(alloc: Allocator, size: usize) !Self { var buf = try alloc.alloc(T, size); @@ -43,12 +65,35 @@ pub fn CircBuf(comptime T: type, comptime default: T) type { self.* = undefined; } + /// Append a single value to the buffer. If the buffer is full, + /// an error will be returned. + pub fn append(self: *Self, v: T) !void { + if (self.full) return error.OutOfMemory; + self.storage[self.head] = v; + self.head += 1; + if (self.head >= self.storage.len) self.head = 0; + self.full = self.head == self.tail; + } + + /// Clear the buffer. + pub fn clear(self: *Self) void { + self.head = 0; + self.tail = 0; + self.full = false; + } + + /// Iterate over the circular buffer. + pub fn iterator(self: Self, direction: Iterator.Direction) Iterator { + return Iterator{ + .buf = self, + .idx = 0, + .direction = direction, + }; + } + /// Resize the buffer to the given size (larger or smaller). /// If larger, new values will be set to the default value. pub fn resize(self: *Self, alloc: Allocator, size: usize) !void { - const tracy = trace(@src()); - defer tracy.end(); - // Rotate to zero so it is aligned. try self.rotateToZero(alloc); @@ -72,9 +117,6 @@ pub fn CircBuf(comptime T: type, comptime default: T) type { /// Rotate the data so that it is zero-aligned. fn rotateToZero(self: *Self, alloc: Allocator) !void { - const tracy = trace(@src()); - defer tracy.end(); - // TODO: this does this in the worst possible way by allocating. // rewrite to not allocate, its possible, I'm just lazy right now. @@ -122,9 +164,6 @@ pub fn CircBuf(comptime T: type, comptime default: T) type { pub fn deleteOldest(self: *Self, n: usize) void { assert(n <= self.storage.len); - const tracy = trace(@src()); - defer tracy.end(); - // Clear the values back to default const slices = self.getPtrSlice(0, n); inline for (slices) |slice| @memset(slice, default); @@ -141,9 +180,6 @@ pub fn CircBuf(comptime T: type, comptime default: T) type { /// the end of our buffer. This never "rotates" the buffer because /// the offset can only be within the size of the buffer. pub fn getPtrSlice(self: *Self, offset: usize, slice_len: usize) [2][]T { - const tracy = trace(@src()); - defer tracy.end(); - // Note: this assertion is very important, it hints the compiler // which generates ~10% faster code than without it. assert(offset + slice_len <= self.capacity()); @@ -220,6 +256,115 @@ test { try testing.expectEqual(@as(usize, 0), buf.len()); } +test "append" { + const testing = std.testing; + const alloc = testing.allocator; + + const Buf = CircBuf(u8, 0); + var buf = try Buf.init(alloc, 3); + defer buf.deinit(alloc); + + try buf.append(1); + try buf.append(2); + try buf.append(3); + try testing.expectError(error.OutOfMemory, buf.append(4)); + buf.deleteOldest(1); + try buf.append(4); + try testing.expectError(error.OutOfMemory, buf.append(5)); +} + +test "forward iterator" { + const testing = std.testing; + const alloc = testing.allocator; + + const Buf = CircBuf(u8, 0); + var buf = try Buf.init(alloc, 3); + defer buf.deinit(alloc); + + // Empty + { + var it = buf.iterator(.forward); + try testing.expect(it.next() == null); + } + + // Partially full + try buf.append(1); + try buf.append(2); + { + var it = buf.iterator(.forward); + try testing.expect(it.next().?.* == 1); + try testing.expect(it.next().?.* == 2); + try testing.expect(it.next() == null); + } + + // Full + try buf.append(3); + { + var it = buf.iterator(.forward); + try testing.expect(it.next().?.* == 1); + try testing.expect(it.next().?.* == 2); + try testing.expect(it.next().?.* == 3); + try testing.expect(it.next() == null); + } + + // Delete and add + buf.deleteOldest(1); + try buf.append(4); + { + var it = buf.iterator(.forward); + try testing.expect(it.next().?.* == 2); + try testing.expect(it.next().?.* == 3); + try testing.expect(it.next().?.* == 4); + try testing.expect(it.next() == null); + } +} + +test "reverse iterator" { + const testing = std.testing; + const alloc = testing.allocator; + + const Buf = CircBuf(u8, 0); + var buf = try Buf.init(alloc, 3); + defer buf.deinit(alloc); + + // Empty + { + var it = buf.iterator(.reverse); + try testing.expect(it.next() == null); + } + + // Partially full + try buf.append(1); + try buf.append(2); + { + var it = buf.iterator(.reverse); + try testing.expect(it.next().?.* == 2); + try testing.expect(it.next().?.* == 1); + try testing.expect(it.next() == null); + } + + // Full + try buf.append(3); + { + var it = buf.iterator(.reverse); + try testing.expect(it.next().?.* == 3); + try testing.expect(it.next().?.* == 2); + try testing.expect(it.next().?.* == 1); + try testing.expect(it.next() == null); + } + + // Delete and add + buf.deleteOldest(1); + try buf.append(4); + { + var it = buf.iterator(.reverse); + try testing.expect(it.next().?.* == 4); + try testing.expect(it.next().?.* == 3); + try testing.expect(it.next().?.* == 2); + try testing.expect(it.next() == null); + } +} + test "getPtrSlice fits" { const testing = std.testing; const alloc = testing.allocator; diff --git a/src/input.zig b/src/input.zig index 21a8702d6..c90226b39 100644 --- a/src/input.zig +++ b/src/input.zig @@ -8,6 +8,7 @@ pub const keycodes = @import("input/keycodes.zig"); pub const kitty = @import("input/kitty.zig"); pub const Binding = @import("input/Binding.zig"); pub const KeyEncoder = @import("input/KeyEncoder.zig"); +pub const InspectorMode = Binding.Action.InspectorMode; pub const SplitDirection = Binding.Action.SplitDirection; pub const SplitFocusDirection = Binding.Action.SplitFocusDirection; diff --git a/src/input/Binding.zig b/src/input/Binding.zig index 9b11a640a..c326b21b0 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -176,6 +176,10 @@ pub const Action = union(enum) { /// zoom/unzoom the current split. toggle_split_zoom: void, + /// Show, hide, or toggle the terminal inspector for the currently + /// focused terminal. + inspector: InspectorMode, + /// Reload the configuration. The exact meaning depends on the app runtime /// in use but this usually involves re-reading the configuration file /// and applying any changes. Note that not all changes can be applied at @@ -220,6 +224,13 @@ pub const Action = union(enum) { right, }; + // Extern because it is used in the embedded runtime ABI. + pub const InspectorMode = enum(c_int) { + toggle, + show, + hide, + }; + /// Parse an action in the format of "key=value" where key is the /// action name and value is the action parameter. The parameter /// is optional depending on the action. diff --git a/src/input/key.zig b/src/input/key.zig index b49e524c5..c4aa9c3b7 100644 --- a/src/input/key.zig +++ b/src/input/key.zig @@ -1,5 +1,6 @@ const std = @import("std"); const Allocator = std.mem.Allocator; +const cimgui = @import("cimgui"); /// A generic key input event. This is the information that is necessary /// regardless of apprt in order to generate the proper terminal @@ -377,6 +378,137 @@ pub const Key = enum(c_int) { }; } + /// Returns the cimgui key constant for this key. + pub fn imguiKey(self: Key) ?c_uint { + return switch (self) { + .a => cimgui.c.ImGuiKey_A, + .b => cimgui.c.ImGuiKey_B, + .c => cimgui.c.ImGuiKey_C, + .d => cimgui.c.ImGuiKey_D, + .e => cimgui.c.ImGuiKey_E, + .f => cimgui.c.ImGuiKey_F, + .g => cimgui.c.ImGuiKey_G, + .h => cimgui.c.ImGuiKey_H, + .i => cimgui.c.ImGuiKey_I, + .j => cimgui.c.ImGuiKey_J, + .k => cimgui.c.ImGuiKey_K, + .l => cimgui.c.ImGuiKey_L, + .m => cimgui.c.ImGuiKey_M, + .n => cimgui.c.ImGuiKey_N, + .o => cimgui.c.ImGuiKey_O, + .p => cimgui.c.ImGuiKey_P, + .q => cimgui.c.ImGuiKey_Q, + .r => cimgui.c.ImGuiKey_R, + .s => cimgui.c.ImGuiKey_S, + .t => cimgui.c.ImGuiKey_T, + .u => cimgui.c.ImGuiKey_U, + .v => cimgui.c.ImGuiKey_V, + .w => cimgui.c.ImGuiKey_W, + .x => cimgui.c.ImGuiKey_X, + .y => cimgui.c.ImGuiKey_Y, + .z => cimgui.c.ImGuiKey_Z, + + .zero => cimgui.c.ImGuiKey_0, + .one => cimgui.c.ImGuiKey_1, + .two => cimgui.c.ImGuiKey_2, + .three => cimgui.c.ImGuiKey_3, + .four => cimgui.c.ImGuiKey_4, + .five => cimgui.c.ImGuiKey_5, + .six => cimgui.c.ImGuiKey_6, + .seven => cimgui.c.ImGuiKey_7, + .eight => cimgui.c.ImGuiKey_8, + .nine => cimgui.c.ImGuiKey_9, + + .semicolon => cimgui.c.ImGuiKey_Semicolon, + .space => cimgui.c.ImGuiKey_Space, + .apostrophe => cimgui.c.ImGuiKey_Apostrophe, + .comma => cimgui.c.ImGuiKey_Comma, + .grave_accent => cimgui.c.ImGuiKey_GraveAccent, + .period => cimgui.c.ImGuiKey_Period, + .slash => cimgui.c.ImGuiKey_Slash, + .minus => cimgui.c.ImGuiKey_Minus, + .equal => cimgui.c.ImGuiKey_Equal, + .left_bracket => cimgui.c.ImGuiKey_LeftBracket, + .right_bracket => cimgui.c.ImGuiKey_RightBracket, + .backslash => cimgui.c.ImGuiKey_Backslash, + + .up => cimgui.c.ImGuiKey_UpArrow, + .down => cimgui.c.ImGuiKey_DownArrow, + .left => cimgui.c.ImGuiKey_LeftArrow, + .right => cimgui.c.ImGuiKey_RightArrow, + .home => cimgui.c.ImGuiKey_Home, + .end => cimgui.c.ImGuiKey_End, + .insert => cimgui.c.ImGuiKey_Insert, + .delete => cimgui.c.ImGuiKey_Delete, + .caps_lock => cimgui.c.ImGuiKey_CapsLock, + .scroll_lock => cimgui.c.ImGuiKey_ScrollLock, + .num_lock => cimgui.c.ImGuiKey_NumLock, + .page_up => cimgui.c.ImGuiKey_PageUp, + .page_down => cimgui.c.ImGuiKey_PageDown, + .escape => cimgui.c.ImGuiKey_Escape, + .enter => cimgui.c.ImGuiKey_Enter, + .tab => cimgui.c.ImGuiKey_Tab, + .backspace => cimgui.c.ImGuiKey_Backspace, + .print_screen => cimgui.c.ImGuiKey_PrintScreen, + .pause => cimgui.c.ImGuiKey_Pause, + + .f1 => cimgui.c.ImGuiKey_F1, + .f2 => cimgui.c.ImGuiKey_F2, + .f3 => cimgui.c.ImGuiKey_F3, + .f4 => cimgui.c.ImGuiKey_F4, + .f5 => cimgui.c.ImGuiKey_F5, + .f6 => cimgui.c.ImGuiKey_F6, + .f7 => cimgui.c.ImGuiKey_F7, + .f8 => cimgui.c.ImGuiKey_F8, + .f9 => cimgui.c.ImGuiKey_F9, + .f10 => cimgui.c.ImGuiKey_F10, + .f11 => cimgui.c.ImGuiKey_F11, + .f12 => cimgui.c.ImGuiKey_F12, + + .kp_0 => cimgui.c.ImGuiKey_Keypad0, + .kp_1 => cimgui.c.ImGuiKey_Keypad1, + .kp_2 => cimgui.c.ImGuiKey_Keypad2, + .kp_3 => cimgui.c.ImGuiKey_Keypad3, + .kp_4 => cimgui.c.ImGuiKey_Keypad4, + .kp_5 => cimgui.c.ImGuiKey_Keypad5, + .kp_6 => cimgui.c.ImGuiKey_Keypad6, + .kp_7 => cimgui.c.ImGuiKey_Keypad7, + .kp_8 => cimgui.c.ImGuiKey_Keypad8, + .kp_9 => cimgui.c.ImGuiKey_Keypad9, + .kp_decimal => cimgui.c.ImGuiKey_KeypadDecimal, + .kp_divide => cimgui.c.ImGuiKey_KeypadDivide, + .kp_multiply => cimgui.c.ImGuiKey_KeypadMultiply, + .kp_subtract => cimgui.c.ImGuiKey_KeypadSubtract, + .kp_add => cimgui.c.ImGuiKey_KeypadAdd, + .kp_enter => cimgui.c.ImGuiKey_KeypadEnter, + .kp_equal => cimgui.c.ImGuiKey_KeypadEqual, + + .left_shift => cimgui.c.ImGuiKey_LeftShift, + .left_control => cimgui.c.ImGuiKey_LeftCtrl, + .left_alt => cimgui.c.ImGuiKey_LeftAlt, + .left_super => cimgui.c.ImGuiKey_LeftSuper, + .right_shift => cimgui.c.ImGuiKey_RightShift, + .right_control => cimgui.c.ImGuiKey_RightCtrl, + .right_alt => cimgui.c.ImGuiKey_RightAlt, + .right_super => cimgui.c.ImGuiKey_RightSuper, + + .invalid, + .f13, + .f14, + .f15, + .f16, + .f17, + .f18, + .f19, + .f20, + .f21, + .f22, + .f23, + .f24, + .f25, + => null, + }; + } test "fromASCII should not return keypad keys" { const testing = std.testing; try testing.expect(Key.fromASCII('0').? == .zero); diff --git a/src/inspector/Inspector.zig b/src/inspector/Inspector.zig new file mode 100644 index 000000000..36d362e4c --- /dev/null +++ b/src/inspector/Inspector.zig @@ -0,0 +1,1203 @@ +//! The Inspector is a development tool to debug the terminal. This is +//! useful for terminal application developers as well as people potentially +//! debugging issues in Ghostty itself. +const Inspector = @This(); + +const std = @import("std"); +const Allocator = std.mem.Allocator; +const builtin = @import("builtin"); +const cimgui = @import("cimgui"); +const Surface = @import("../Surface.zig"); +const input = @import("../input.zig"); +const terminal = @import("../terminal/main.zig"); +const inspector = @import("main.zig"); + +/// The window names. These are used with docking so we need to have access. +const window_cell = "Cell"; +const window_modes = "Modes"; +const window_keyboard = "Keyboard"; +const window_termio = "Terminal IO"; +const window_screen = "Screen"; +const window_size = "Surface Info"; +const window_imgui_demo = "Dear ImGui Demo"; + +/// The surface that we're inspecting. +surface: *Surface, + +/// This is used to track whether we're rendering for the first time. This +/// is used to set up the initial window positions. +first_render: bool = true, + +/// Mouse state that we track in addition to normal mouse states that +/// Ghostty always knows about. +mouse: struct { + /// Last hovered x/y + last_xpos: f64 = 0, + last_ypos: f64 = 0, + + /// Last hovered screen point + last_point: terminal.point.ScreenPoint = .{}, +} = .{}, + +/// A selected cell. +cell: CellInspect = .{ .idle = {} }, + +/// The list of keyboard events +key_events: inspector.key.EventRing, + +/// The VT stream +vt_events: inspector.termio.VTEventRing, +vt_stream: inspector.termio.Stream, + +const CellInspect = union(enum) { + /// Idle, no cell inspection is requested + idle: void, + + /// Requested, a cell is being picked. + requested: void, + + /// The cell has been picked and set to this. This is a copy so that + /// if the cell contents change we still have the original cell. + selected: Selected, + + const Selected = struct { + row: usize, + col: usize, + cell: terminal.Screen.Cell, + }; + + pub fn request(self: *CellInspect) void { + switch (self.*) { + .idle, .selected => self.* = .requested, + .requested => {}, + } + } +}; + +/// Setup the ImGui state. This requires an ImGui context to be set. +pub fn setup() void { + const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO(); + + // Enable docking, which we use heavily for the UI. + io.ConfigFlags |= cimgui.c.ImGuiConfigFlags_DockingEnable; + + // Our colorspace is sRGB. + io.ConfigFlags |= cimgui.c.ImGuiConfigFlags_IsSRGB; + + // Disable the ini file to save layout + io.IniFilename = null; + io.LogFilename = null; + + // Use our own embedded font + { + // TODO: This will have to be recalculated for different screen DPIs. + // This is currently hardcoded to a 2x content scale. + const font_size = 16 * 2; + + const font_config: *cimgui.c.ImFontConfig = cimgui.c.ImFontConfig_ImFontConfig(); + defer cimgui.c.ImFontConfig_destroy(font_config); + font_config.FontDataOwnedByAtlas = false; + _ = cimgui.c.ImFontAtlas_AddFontFromMemoryTTF( + io.Fonts, + @constCast(@ptrCast(Surface.face_ttf)), + Surface.face_ttf.len, + font_size, + font_config, + null, + ); + } +} + +pub fn init(surface: *Surface) !Inspector { + var key_buf = try inspector.key.EventRing.init(surface.alloc, 2); + errdefer key_buf.deinit(surface.alloc); + + var vt_events = try inspector.termio.VTEventRing.init(surface.alloc, 2); + errdefer vt_events.deinit(surface.alloc); + + var vt_handler = inspector.termio.VTHandler.init(surface); + errdefer vt_handler.deinit(); + + return .{ + .surface = surface, + .key_events = key_buf, + .vt_events = vt_events, + .vt_stream = .{ + .handler = vt_handler, + .parser = .{ + .osc_parser = .{ + .alloc = surface.alloc, + }, + }, + }, + }; +} + +pub fn deinit(self: *Inspector) void { + { + var it = self.key_events.iterator(.forward); + while (it.next()) |v| v.deinit(self.surface.alloc); + self.key_events.deinit(self.surface.alloc); + } + + { + var it = self.vt_events.iterator(.forward); + while (it.next()) |v| v.deinit(self.surface.alloc); + self.vt_events.deinit(self.surface.alloc); + + self.vt_stream.handler.deinit(); + self.vt_stream.deinit(); + } +} + +/// Record a keyboard event. +pub fn recordKeyEvent(self: *Inspector, ev: inspector.key.Event) !void { + const max_capacity = 50; + self.key_events.append(ev) catch |err| switch (err) { + error.OutOfMemory => if (self.key_events.capacity() < max_capacity) { + // We're out of memory, but we can allocate to our capacity. + const new_capacity = @min(self.key_events.capacity() * 2, max_capacity); + try self.key_events.resize(self.surface.alloc, new_capacity); + try self.key_events.append(ev); + } else { + var it = self.key_events.iterator(.forward); + if (it.next()) |old_ev| old_ev.deinit(self.surface.alloc); + self.key_events.deleteOldest(1); + try self.key_events.append(ev); + }, + + else => return err, + }; +} + +/// Record data read from the pty. +pub fn recordPtyRead(self: *Inspector, data: []const u8) !void { + try self.vt_stream.nextSlice(data); +} + +/// Render the frame. +pub fn render(self: *Inspector) void { + const dock_id = cimgui.c.igDockSpaceOverViewport( + cimgui.c.igGetMainViewport(), + cimgui.c.ImGuiDockNodeFlags_None, + null, + ); + + // Render all of our data. We hold the mutex for this duration. This is + // expensive but this is an initial implementation until it doesn't work + // anymore. + { + self.surface.renderer_state.mutex.lock(); + defer self.surface.renderer_state.mutex.unlock(); + self.renderScreenWindow(); + self.renderModesWindow(); + self.renderKeyboardWindow(); + self.renderTermioWindow(); + self.renderCellWindow(); + self.renderSizeWindow(); + } + + // In debug we show the ImGui demo window so we can easily view available + // widgets and such. + if (builtin.mode == .Debug) { + var show: bool = true; + cimgui.c.igShowDemoWindow(&show); + } + + // On first render we set up the layout. We can actually do this at + // the end of the frame, allowing the individual rendering to also + // observe the first render flag. + if (self.first_render) { + self.first_render = false; + self.setupLayout(dock_id); + } +} + +fn setupLayout(self: *Inspector, dock_id_main: cimgui.c.ImGuiID) void { + _ = self; + + // Our initial focus + cimgui.c.igSetWindowFocus_Str(window_screen); + + // Setup our initial layout. + const dock_id: struct { + left: cimgui.c.ImGuiID, + right: cimgui.c.ImGuiID, + } = dock_id: { + var dock_id_left: cimgui.c.ImGuiID = undefined; + var dock_id_right: cimgui.c.ImGuiID = undefined; + _ = cimgui.c.igDockBuilderSplitNode( + dock_id_main, + cimgui.c.ImGuiDir_Left, + 0.7, + &dock_id_left, + &dock_id_right, + ); + + break :dock_id .{ + .left = dock_id_left, + .right = dock_id_right, + }; + }; + + cimgui.c.igDockBuilderDockWindow(window_cell, dock_id.left); + cimgui.c.igDockBuilderDockWindow(window_modes, dock_id.left); + cimgui.c.igDockBuilderDockWindow(window_keyboard, dock_id.left); + cimgui.c.igDockBuilderDockWindow(window_termio, dock_id.left); + cimgui.c.igDockBuilderDockWindow(window_screen, dock_id.left); + cimgui.c.igDockBuilderDockWindow(window_imgui_demo, dock_id.left); + cimgui.c.igDockBuilderDockWindow(window_size, dock_id.right); + cimgui.c.igDockBuilderFinish(dock_id_main); +} + +fn renderScreenWindow(self: *Inspector) void { + // Start our window. If we're collapsed we do nothing. + defer cimgui.c.igEnd(); + if (!cimgui.c.igBegin( + window_screen, + null, + cimgui.c.ImGuiWindowFlags_NoFocusOnAppearing, + )) return; + + const t = self.surface.renderer_state.terminal; + const screen = &t.screen; + + { + _ = cimgui.c.igBeginTable( + "table_screen", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Active Screen"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%s", @tagName(t.active_screen).ptr); + } + } + } + + if (cimgui.c.igCollapsingHeader_TreeNodeFlags( + "Cursor", + cimgui.c.ImGuiTreeNodeFlags_DefaultOpen, + )) { + { + _ = cimgui.c.igBeginTable( + "table_cursor", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + inspector.cursor.renderInTable(&screen.cursor); + } // table + + cimgui.c.igTextDisabled("(Any styles not shown are not currently set)"); + } // cursor + + if (cimgui.c.igCollapsingHeader_TreeNodeFlags( + "Keyboard", + cimgui.c.ImGuiTreeNodeFlags_DefaultOpen, + )) { + { + _ = cimgui.c.igBeginTable( + "table_keyboard", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + const kitty_flags = screen.kitty_keyboard.current(); + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Mode"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + const mode = if (kitty_flags.int() != 0) "kitty" else "legacy"; + cimgui.c.igText("%s", mode.ptr); + } + } + + if (kitty_flags.int() != 0) { + const Flags = @TypeOf(kitty_flags); + inline for (@typeInfo(Flags).Struct.fields) |field| { + { + const value = @field(kitty_flags, field.name); + + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + const name = std.fmt.comptimePrint("{s}", .{field.name}); + cimgui.c.igText("%s", name.ptr); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%s", + if (value) "true".ptr else "false".ptr, + ); + } + } + } + } else { + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Xterm modify keys"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%s", + if (t.flags.modify_other_keys_2) "true".ptr else "false".ptr, + ); + } + } + } // keyboard mode info + } // table + } // keyboard + + if (cimgui.c.igCollapsingHeader_TreeNodeFlags( + "Kitty Graphics", + cimgui.c.ImGuiTreeNodeFlags_DefaultOpen, + )) kitty_gfx: { + if (!screen.kitty_images.enabled()) { + cimgui.c.igTextDisabled("(Kitty graphics are disabled)"); + break :kitty_gfx; + } + + { + _ = cimgui.c.igBeginTable( + "##kitty_graphics", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + const kitty_images = &screen.kitty_images; + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Memory Usage"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%d bytes", kitty_images.total_bytes); + } + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Memory Limit"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%d bytes", kitty_images.total_limit); + } + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Image Count"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%d", kitty_images.images.count()); + } + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Placement Count"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%d", kitty_images.placements.count()); + } + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Image Loading"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%s", if (kitty_images.loading != null) "true".ptr else "false".ptr); + } + } + } // table + } // kitty graphics +} + +/// The modes window shows the currently active terminal modes and allows +/// users to toggle them on and off. +fn renderModesWindow(self: *Inspector) void { + // Start our window. If we're collapsed we do nothing. + defer cimgui.c.igEnd(); + if (!cimgui.c.igBegin( + window_modes, + null, + cimgui.c.ImGuiWindowFlags_NoFocusOnAppearing, + )) return; + + _ = cimgui.c.igBeginTable( + "table_modes", + 3, + cimgui.c.ImGuiTableFlags_SizingFixedFit | + cimgui.c.ImGuiTableFlags_RowBg, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + { + _ = cimgui.c.igTableSetupColumn("", cimgui.c.ImGuiTableColumnFlags_NoResize, 0, 0); + _ = cimgui.c.igTableSetupColumn("Number", cimgui.c.ImGuiTableColumnFlags_PreferSortAscending, 0, 0); + _ = cimgui.c.igTableSetupColumn("Name", cimgui.c.ImGuiTableColumnFlags_WidthStretch, 0, 0); + cimgui.c.igTableHeadersRow(); + } + + const t = self.surface.renderer_state.terminal; + inline for (@typeInfo(terminal.Mode).Enum.fields) |field| { + const tag: terminal.modes.ModeTag = @bitCast(@as(terminal.modes.ModeTag.Backing, field.value)); + + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + var value: bool = t.modes.get(@field(terminal.Mode, field.name)); + _ = cimgui.c.igCheckbox("", &value); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%s%d", + if (tag.ansi) "?" else "", + @as(u32, @intCast(tag.value)), + ); + } + { + _ = cimgui.c.igTableSetColumnIndex(2); + const name = std.fmt.comptimePrint("{s}", .{field.name}); + cimgui.c.igText("%s", name.ptr); + } + } +} + +fn renderSizeWindow(self: *Inspector) void { + // Start our window. If we're collapsed we do nothing. + defer cimgui.c.igEnd(); + if (!cimgui.c.igBegin( + window_size, + null, + cimgui.c.ImGuiWindowFlags_NoFocusOnAppearing, + )) return; + + cimgui.c.igSeparatorText("Dimensions"); + + { + _ = cimgui.c.igBeginTable( + "table_size", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + // Screen Size + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Screen Size"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%dpx x %dpx", + self.surface.screen_size.width, + self.surface.screen_size.height, + ); + } + } + + // Grid Size + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Grid Size"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%dc x %dr", + self.surface.grid_size.columns, + self.surface.grid_size.rows, + ); + } + } + + // Cell Size + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Cell Size"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%dpx x %dpx", + self.surface.cell_size.width, + self.surface.cell_size.height, + ); + } + } + + // Padding + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Window Padding"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "T=%d B=%d L=%d R=%d px", + self.surface.padding.top, + self.surface.padding.bottom, + self.surface.padding.left, + self.surface.padding.right, + ); + } + } + } + + cimgui.c.igSeparatorText("Font"); + + { + _ = cimgui.c.igBeginTable( + "table_font", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Size (Points)"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%d pt", + self.surface.font_size.points, + ); + } + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Size (Pixels)"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "%d px", + self.surface.font_size.pixels(), + ); + } + } + } + + cimgui.c.igSeparatorText("Mouse"); + + { + _ = cimgui.c.igBeginTable( + "table_mouse", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + const mouse = &self.surface.mouse; + const t = self.surface.renderer_state.terminal; + + { + const hover_point = self.mouse.last_point.toViewport(&t.screen); + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Hover Grid"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "row=%d, col=%d", + hover_point.y, + hover_point.x, + ); + } + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Hover Point"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "(%dpx, %dpx)", + @as(u32, @intFromFloat(self.mouse.last_xpos)), + @as(u32, @intFromFloat(self.mouse.last_ypos)), + ); + } + } + + const any_click = for (mouse.click_state) |state| { + if (state == .press) break true; + } else false; + + click: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Click State"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + if (!any_click) { + cimgui.c.igText("none"); + break :click; + } + + for (mouse.click_state, 0..) |state, i| { + if (state != .press) continue; + const button: input.MouseButton = @enumFromInt(i); + cimgui.c.igSameLine(0, 0); + cimgui.c.igText("%s", (switch (button) { + .unknown => "?", + .left => "L", + .middle => "M", + .right => "R", + .four => "{4}", + .five => "{5}", + .six => "{6}", + .seven => "{7}", + .eight => "{8}", + .nine => "{9}", + .ten => "{10}", + .eleven => "{11}", + }).ptr); + } + } + } + + { + const left_click_point = mouse.left_click_point.toViewport(&t.screen); + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Click Grid"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "row=%d, col=%d", + left_click_point.y, + left_click_point.x, + ); + } + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Click Point"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "(%dpx, %dpx)", + @as(u32, @intFromFloat(mouse.left_click_xpos)), + @as(u32, @intFromFloat(mouse.left_click_ypos)), + ); + } + } + } +} + +fn renderCellWindow(self: *Inspector) void { + // Start our window. If we're collapsed we do nothing. + defer cimgui.c.igEnd(); + if (!cimgui.c.igBegin( + window_cell, + null, + cimgui.c.ImGuiWindowFlags_NoFocusOnAppearing, + )) return; + + // Our popup for the picker + const popup_picker = "Cell Picker"; + + if (cimgui.c.igButton("Picker", .{ .x = 0, .y = 0 })) { + // Request a cell + self.cell.request(); + + cimgui.c.igOpenPopup_Str( + popup_picker, + cimgui.c.ImGuiPopupFlags_None, + ); + } + + if (cimgui.c.igBeginPopupModal( + popup_picker, + null, + cimgui.c.ImGuiWindowFlags_AlwaysAutoResize, + )) popup: { + defer cimgui.c.igEndPopup(); + + // Once we select a cell, close this popup. + if (self.cell == .selected) { + cimgui.c.igCloseCurrentPopup(); + break :popup; + } + + cimgui.c.igText( + "Click on a cell in the terminal to inspect it.\n" ++ + "The click will be intercepted by the picker, \n" ++ + "so it won't be sent to the terminal.", + ); + cimgui.c.igSeparator(); + + if (cimgui.c.igButton("Cancel", .{ .x = 0, .y = 0 })) { + cimgui.c.igCloseCurrentPopup(); + } + } // cell pick popup + + cimgui.c.igSeparator(); + + if (self.cell != .selected) { + cimgui.c.igText("No cell selected."); + return; + } + + const selected = self.cell.selected; + + { + // We have a selected cell, show information about it. + _ = cimgui.c.igBeginTable( + "table_cursor", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Grid Position"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("row=%d col=%d", selected.row, selected.col); + } + } + + // NOTE: we don't currently write the character itself because + // we haven't hooked up imgui to our font system. That's hard! We + // can/should instead hook up our renderer to imgui and just render + // the single glyph in an image view so it looks _identical_ to the + // terminal. + codepoint: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Codepoint"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + if (selected.cell.char == 0) { + cimgui.c.igTextDisabled("(empty)"); + break :codepoint; + } + + cimgui.c.igText("U+%X", selected.cell.char); + } + } + + // If we have a color then we show the color + color: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Foreground Color"); + _ = cimgui.c.igTableSetColumnIndex(1); + if (!selected.cell.attrs.has_fg) { + cimgui.c.igText("default"); + break :color; + } + + var color: [3]f32 = .{ + @as(f32, @floatFromInt(selected.cell.fg.r)) / 255, + @as(f32, @floatFromInt(selected.cell.fg.g)) / 255, + @as(f32, @floatFromInt(selected.cell.fg.b)) / 255, + }; + _ = cimgui.c.igColorEdit3( + "color_fg", + &color, + cimgui.c.ImGuiColorEditFlags_NoPicker | + cimgui.c.ImGuiColorEditFlags_NoLabel, + ); + } + color: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Background Color"); + _ = cimgui.c.igTableSetColumnIndex(1); + if (!selected.cell.attrs.has_bg) { + cimgui.c.igText("default"); + break :color; + } + + var color: [3]f32 = .{ + @as(f32, @floatFromInt(selected.cell.bg.r)) / 255, + @as(f32, @floatFromInt(selected.cell.bg.g)) / 255, + @as(f32, @floatFromInt(selected.cell.bg.b)) / 255, + }; + _ = cimgui.c.igColorEdit3( + "color_bg", + &color, + cimgui.c.ImGuiColorEditFlags_NoPicker | + cimgui.c.ImGuiColorEditFlags_NoLabel, + ); + } + + // Boolean styles + const styles = .{ + "bold", "italic", "faint", "blink", + "inverse", "invisible", "protected", "strikethrough", + }; + inline for (styles) |style| style: { + if (!@field(selected.cell.attrs, style)) break :style; + + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText(style.ptr); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("true"); + } + } + } // table + + cimgui.c.igTextDisabled("(Any styles not shown are not currently set)"); +} + +fn renderKeyboardWindow(self: *Inspector) void { + // Start our window. If we're collapsed we do nothing. + defer cimgui.c.igEnd(); + if (!cimgui.c.igBegin( + window_keyboard, + null, + cimgui.c.ImGuiWindowFlags_NoFocusOnAppearing, + )) return; + + list: { + if (self.key_events.empty()) { + cimgui.c.igText("No recorded key events. Press a key with the " ++ + "terminal focused to record it."); + break :list; + } + + if (cimgui.c.igButton("Clear", .{ .x = 0, .y = 0 })) { + var it = self.key_events.iterator(.forward); + while (it.next()) |v| v.deinit(self.surface.alloc); + self.key_events.clear(); + self.vt_stream.handler.current_seq = 1; + } + + cimgui.c.igSeparator(); + + _ = cimgui.c.igBeginTable( + "table_key_events", + 1, + //cimgui.c.ImGuiTableFlags_ScrollY | + cimgui.c.ImGuiTableFlags_RowBg | + cimgui.c.ImGuiTableFlags_Borders, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + var it = self.key_events.iterator(.reverse); + while (it.next()) |ev| { + // Need to push an ID so that our selectable is unique. + cimgui.c.igPushID_Ptr(ev); + defer cimgui.c.igPopID(); + + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + + var buf: [1024]u8 = undefined; + const label = ev.label(&buf) catch "Key Event"; + _ = cimgui.c.igSelectable_BoolPtr( + label.ptr, + &ev.imgui_state.selected, + cimgui.c.ImGuiSelectableFlags_None, + .{ .x = 0, .y = 0 }, + ); + + if (!ev.imgui_state.selected) continue; + ev.render(); + } + } // table +} + +fn renderTermioWindow(self: *Inspector) void { + // Start our window. If we're collapsed we do nothing. + defer cimgui.c.igEnd(); + if (!cimgui.c.igBegin( + window_termio, + null, + cimgui.c.ImGuiWindowFlags_NoFocusOnAppearing, + )) return; + + const popup_filter = "Filter"; + + list: { + const pause_play: [:0]const u8 = if (self.vt_stream.handler.active) + "Pause##pause_play" + else + "Resume##pause_play"; + if (cimgui.c.igButton(pause_play.ptr, .{ .x = 0, .y = 0 })) { + self.vt_stream.handler.active = !self.vt_stream.handler.active; + } + + cimgui.c.igSameLine(0, cimgui.c.igGetStyle().*.ItemInnerSpacing.x); + if (cimgui.c.igButton("Filter", .{ .x = 0, .y = 0 })) { + cimgui.c.igOpenPopup_Str( + popup_filter, + cimgui.c.ImGuiPopupFlags_None, + ); + } + + if (!self.vt_events.empty()) { + cimgui.c.igSameLine(0, cimgui.c.igGetStyle().*.ItemInnerSpacing.x); + if (cimgui.c.igButton("Clear", .{ .x = 0, .y = 0 })) { + var it = self.vt_events.iterator(.forward); + while (it.next()) |v| v.deinit(self.surface.alloc); + self.vt_events.clear(); + + // We also reset the sequence number. + self.vt_stream.handler.current_seq = 1; + } + } + + cimgui.c.igSeparator(); + + if (self.vt_events.empty()) { + cimgui.c.igText("Waiting for events..."); + break :list; + } + + _ = cimgui.c.igBeginTable( + "table_vt_events", + 3, + cimgui.c.ImGuiTableFlags_RowBg | + cimgui.c.ImGuiTableFlags_Borders, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + cimgui.c.igTableSetupColumn( + "Seq", + cimgui.c.ImGuiTableColumnFlags_WidthFixed, + 0, + 0, + ); + cimgui.c.igTableSetupColumn( + "Kind", + cimgui.c.ImGuiTableColumnFlags_WidthFixed, + 0, + 0, + ); + cimgui.c.igTableSetupColumn( + "Description", + cimgui.c.ImGuiTableColumnFlags_WidthStretch, + 0, + 0, + ); + + var it = self.vt_events.iterator(.reverse); + while (it.next()) |ev| { + // Need to push an ID so that our selectable is unique. + cimgui.c.igPushID_Ptr(ev); + defer cimgui.c.igPopID(); + + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableNextColumn(); + _ = cimgui.c.igSelectable_BoolPtr( + "##select", + &ev.imgui_selected, + cimgui.c.ImGuiSelectableFlags_SpanAllColumns, + .{ .x = 0, .y = 0 }, + ); + cimgui.c.igSameLine(0, 0); + cimgui.c.igText("%d", ev.seq); + _ = cimgui.c.igTableNextColumn(); + cimgui.c.igText("%s", @tagName(ev.kind).ptr); + _ = cimgui.c.igTableNextColumn(); + cimgui.c.igText("%s", ev.str.ptr); + + // If the event is selected, we render info about it. For now + // we put this in the last column because thats the widest and + // imgui has no way to make a column span. + if (ev.imgui_selected) { + { + _ = cimgui.c.igBeginTable( + "details", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + inspector.cursor.renderInTable(&ev.cursor); + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Scroll Region"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText( + "T=%d B=%d L=%d R=%d", + ev.scrolling_region.top, + ev.scrolling_region.bottom, + ev.scrolling_region.left, + ev.scrolling_region.right, + ); + } + } + + var md_it = ev.metadata.iterator(); + while (md_it.next()) |entry| { + var buf: [256]u8 = undefined; + const key = std.fmt.bufPrintZ(&buf, "{s}", .{entry.key_ptr.*}) catch + ""; + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableNextColumn(); + cimgui.c.igText("%s", key.ptr); + _ = cimgui.c.igTableNextColumn(); + cimgui.c.igText("%s", entry.value_ptr.ptr); + } + } + } + } + } // table + + if (cimgui.c.igBeginPopupModal( + popup_filter, + null, + cimgui.c.ImGuiWindowFlags_AlwaysAutoResize, + )) { + defer cimgui.c.igEndPopup(); + + cimgui.c.igText("Changed filter settings will only affect future events."); + + cimgui.c.igSeparator(); + + { + _ = cimgui.c.igBeginTable( + "table_filter_kind", + 3, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + inline for (@typeInfo(terminal.Parser.Action.Tag).Enum.fields) |field| { + const tag = @field(terminal.Parser.Action.Tag, field.name); + if (tag == .apc_put or tag == .dcs_put) continue; + + _ = cimgui.c.igTableNextColumn(); + var value = !self.vt_stream.handler.filter_exclude.contains(tag); + if (cimgui.c.igCheckbox(@tagName(tag).ptr, &value)) { + if (value) { + self.vt_stream.handler.filter_exclude.remove(tag); + } else { + self.vt_stream.handler.filter_exclude.insert(tag); + } + } + } + } // Filter kind table + + cimgui.c.igSeparator(); + + cimgui.c.igText( + "Filter by string. Empty displays all, \"abc\" finds lines\n" ++ + "containing \"abc\", \"abc,xyz\" finds lines containing \"abc\"\n" ++ + "or \"xyz\", \"-abc\" excludes lines containing \"abc\".", + ); + _ = cimgui.c.ImGuiTextFilter_Draw( + self.vt_stream.handler.filter_text, + "##filter_text", + 0, + ); + + cimgui.c.igSeparator(); + if (cimgui.c.igButton("Close", .{ .x = 0, .y = 0 })) { + cimgui.c.igCloseCurrentPopup(); + } + } // filter popup +} diff --git a/src/inspector/cursor.zig b/src/inspector/cursor.zig new file mode 100644 index 000000000..6aeb55f10 --- /dev/null +++ b/src/inspector/cursor.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +const cimgui = @import("cimgui"); +const terminal = @import("../terminal/main.zig"); + +/// Render cursor information with a table already open. +pub fn renderInTable(cursor: *const terminal.Screen.Cursor) void { + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Position (x, y)"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("(%d, %d)", cursor.x, cursor.y); + } + } + + if (cursor.pending_wrap) { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Pending Wrap"); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%s", if (cursor.pending_wrap) "true".ptr else "false".ptr); + } + } + + // If we have a color then we show the color + if (cursor.pen.attrs.has_fg) color: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Foreground Color"); + _ = cimgui.c.igTableSetColumnIndex(1); + if (!cursor.pen.attrs.has_fg) { + cimgui.c.igText("default"); + break :color; + } + + var color: [3]f32 = .{ + @as(f32, @floatFromInt(cursor.pen.fg.r)) / 255, + @as(f32, @floatFromInt(cursor.pen.fg.g)) / 255, + @as(f32, @floatFromInt(cursor.pen.fg.b)) / 255, + }; + _ = cimgui.c.igColorEdit3( + "color_fg", + &color, + cimgui.c.ImGuiColorEditFlags_NoPicker | + cimgui.c.ImGuiColorEditFlags_NoLabel, + ); + } + if (cursor.pen.attrs.has_bg) color: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Background Color"); + _ = cimgui.c.igTableSetColumnIndex(1); + if (!cursor.pen.attrs.has_bg) { + cimgui.c.igText("default"); + break :color; + } + + var color: [3]f32 = .{ + @as(f32, @floatFromInt(cursor.pen.bg.r)) / 255, + @as(f32, @floatFromInt(cursor.pen.bg.g)) / 255, + @as(f32, @floatFromInt(cursor.pen.bg.b)) / 255, + }; + _ = cimgui.c.igColorEdit3( + "color_bg", + &color, + cimgui.c.ImGuiColorEditFlags_NoPicker | + cimgui.c.ImGuiColorEditFlags_NoLabel, + ); + } + + // Boolean styles + const styles = .{ + "bold", "italic", "faint", "blink", + "inverse", "invisible", "protected", "strikethrough", + }; + inline for (styles) |style| style: { + if (!@field(cursor.pen.attrs, style)) break :style; + + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + { + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText(style.ptr); + } + { + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("true"); + } + } +} diff --git a/src/inspector/key.zig b/src/inspector/key.zig new file mode 100644 index 000000000..0a44e2c9d --- /dev/null +++ b/src/inspector/key.zig @@ -0,0 +1,229 @@ +const std = @import("std"); +const Allocator = std.mem.Allocator; +const input = @import("../input.zig"); +const CircBuf = @import("../circ_buf.zig").CircBuf; +const cimgui = @import("cimgui"); + +/// Circular buffer of key events. +pub const EventRing = CircBuf(Event, undefined); + +/// Represents a recorded keyboard event. +pub const Event = struct { + /// The input event. + event: input.KeyEvent, + + /// The binding that was triggered as a result of this event. + binding: ?input.Binding.Action = null, + + /// The data sent to the pty as a result of this keyboard event. + /// This is allocated using the inspector allocator. + pty: []const u8 = "", + + /// State for the inspector GUI. Do not set this unless you're the inspector. + imgui_state: struct { + selected: bool = false, + } = .{}, + + pub fn init(alloc: Allocator, event: input.KeyEvent) !Event { + var copy = event; + copy.utf8 = ""; + if (event.utf8.len > 0) copy.utf8 = try alloc.dupe(u8, event.utf8); + return .{ .event = copy }; + } + + pub fn deinit(self: *const Event, alloc: Allocator) void { + if (self.event.utf8.len > 0) alloc.free(self.event.utf8); + if (self.pty.len > 0) alloc.free(self.pty); + } + + /// Returns a label that can be used for this event. This is null-terminated + /// so it can be easily used with C APIs. + pub fn label(self: *const Event, buf: []u8) ![:0]const u8 { + var buf_stream = std.io.fixedBufferStream(buf); + const writer = buf_stream.writer(); + + switch (self.event.action) { + .press => try writer.writeAll("Press: "), + .release => try writer.writeAll("Release: "), + .repeat => try writer.writeAll("Repeat: "), + } + + if (self.event.mods.shift) try writer.writeAll("Shift+"); + if (self.event.mods.ctrl) try writer.writeAll("Ctrl+"); + if (self.event.mods.alt) try writer.writeAll("Alt+"); + if (self.event.mods.super) try writer.writeAll("Super+"); + try writer.writeAll(@tagName(self.event.key)); + + // Deadkey + if (self.event.composing) try writer.writeAll(" (composing)"); + + // Null-terminator + try writer.writeByte(0); + return buf[0..(buf_stream.getWritten().len - 1) :0]; + } + + /// Render this event in the inspector GUI. + pub fn render(self: *const Event) void { + _ = cimgui.c.igBeginTable( + "##event", + 2, + cimgui.c.ImGuiTableFlags_None, + .{ .x = 0, .y = 0 }, + 0, + ); + defer cimgui.c.igEndTable(); + + if (self.binding) |binding| { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Triggered Binding"); + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%s", @tagName(binding).ptr); + } + + pty: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Encoding to Pty"); + _ = cimgui.c.igTableSetColumnIndex(1); + if (self.pty.len == 0) { + cimgui.c.igTextDisabled("(no data)"); + break :pty; + } + + self.renderPty() catch { + cimgui.c.igTextDisabled("(error rendering pty data)"); + break :pty; + }; + } + + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Action"); + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%s", @tagName(self.event.action).ptr); + } + { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Key"); + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%s", @tagName(self.event.key).ptr); + } + if (self.event.physical_key != self.event.key) { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Physical Key"); + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("%s", @tagName(self.event.physical_key).ptr); + } + if (!self.event.mods.empty()) { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Mods"); + _ = cimgui.c.igTableSetColumnIndex(1); + if (self.event.mods.shift) cimgui.c.igText("shift "); + if (self.event.mods.ctrl) cimgui.c.igText("ctrl "); + if (self.event.mods.alt) cimgui.c.igText("alt "); + if (self.event.mods.super) cimgui.c.igText("super "); + } + if (self.event.composing) { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("Composing"); + _ = cimgui.c.igTableSetColumnIndex(1); + cimgui.c.igText("true"); + } + utf8: { + cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); + _ = cimgui.c.igTableSetColumnIndex(0); + cimgui.c.igText("UTF-8"); + _ = cimgui.c.igTableSetColumnIndex(1); + if (self.event.utf8.len == 0) { + cimgui.c.igTextDisabled("(empty)"); + break :utf8; + } + + self.renderUtf8(self.event.utf8) catch { + cimgui.c.igTextDisabled("(error rendering utf-8)"); + break :utf8; + }; + } + } + + fn renderUtf8(self: *const Event, utf8: []const u8) !void { + _ = self; + + // Format the codepoint sequence + var buf: [1024]u8 = undefined; + var buf_stream = std.io.fixedBufferStream(&buf); + const writer = buf_stream.writer(); + if (std.unicode.Utf8View.init(utf8)) |view| { + var it = view.iterator(); + while (it.nextCodepoint()) |cp| { + try writer.print("U+{X} ", .{cp}); + } + } else |_| { + try writer.writeAll("(invalid utf-8)"); + } + try writer.writeByte(0); + + // Render as a textbox + _ = cimgui.c.igInputText( + "##utf8", + &buf, + buf_stream.getWritten().len - 1, + cimgui.c.ImGuiInputTextFlags_ReadOnly, + null, + null, + ); + } + + fn renderPty(self: *const Event) !void { + // Format the codepoint sequence + var buf: [1024]u8 = undefined; + var buf_stream = std.io.fixedBufferStream(&buf); + const writer = buf_stream.writer(); + + for (self.pty) |byte| { + // Print ESC special because its so common + if (byte == 0x1B) { + try writer.writeAll("ESC "); + continue; + } + + // Print ASCII as-is + if (byte > 0x20 and byte < 0x7F) { + try writer.writeByte(byte); + continue; + } + + // Everything else as a hex byte + try writer.print("0x{X} ", .{byte}); + } + + try writer.writeByte(0); + + // Render as a textbox + _ = cimgui.c.igInputText( + "##pty", + &buf, + buf_stream.getWritten().len - 1, + cimgui.c.ImGuiInputTextFlags_ReadOnly, + null, + null, + ); + } +}; + +test "event string" { + const testing = std.testing; + const alloc = testing.allocator; + + var event = try Event.init(alloc, .{ .key = .a }); + defer event.deinit(alloc); + + var buf: [1024]u8 = undefined; + try testing.expectEqualStrings("Press: a", try event.label(&buf)); +} diff --git a/src/inspector/main.zig b/src/inspector/main.zig new file mode 100644 index 000000000..57612ddee --- /dev/null +++ b/src/inspector/main.zig @@ -0,0 +1,8 @@ +pub const cursor = @import("cursor.zig"); +pub const key = @import("key.zig"); +pub const termio = @import("termio.zig"); +pub const Inspector = @import("Inspector.zig"); + +test { + @import("std").testing.refAllDecls(@This()); +} diff --git a/src/inspector/termio.zig b/src/inspector/termio.zig new file mode 100644 index 000000000..78a161069 --- /dev/null +++ b/src/inspector/termio.zig @@ -0,0 +1,343 @@ +const std = @import("std"); +const Allocator = std.mem.Allocator; +const cimgui = @import("cimgui"); +const terminal = @import("../terminal/main.zig"); +const CircBuf = @import("../circ_buf.zig").CircBuf; +const Surface = @import("../Surface.zig"); + +/// The stream handler for our inspector. +pub const Stream = terminal.Stream(VTHandler); + +/// VT event circular buffer. +pub const VTEventRing = CircBuf(VTEvent, undefined); + +/// VT event +pub const VTEvent = struct { + /// Sequence number, just monotonically increasing. + seq: usize = 1, + + /// Kind of event, for filtering + kind: Kind, + + /// The formatted string of the event. This is allocated. We format the + /// event for now because there is so much data to copy if we wanted to + /// store the raw event. + str: [:0]const u8, + + /// Various metadata at the time of the event (before processing). + cursor: terminal.Screen.Cursor, + scrolling_region: terminal.Terminal.ScrollingRegion, + metadata: Metadata.Unmanaged = .{}, + + /// imgui selection state + imgui_selected: bool = false, + + const Kind = enum { print, execute, csi, esc, osc, dcs, apc }; + const Metadata = std.StringHashMap([:0]const u8); + + /// Initiaze the event information for the given parser action. + pub fn init( + alloc: Allocator, + surface: *Surface, + action: terminal.Parser.Action, + ) !VTEvent { + var md = Metadata.init(alloc); + errdefer md.deinit(); + var buf = std.ArrayList(u8).init(alloc); + defer buf.deinit(); + try encodeAction(alloc, buf.writer(), &md, action); + const str = try buf.toOwnedSliceSentinel(0); + errdefer alloc.free(str); + + const kind: Kind = switch (action) { + .print => .print, + .execute => .execute, + .csi_dispatch => .csi, + .esc_dispatch => .esc, + .osc_dispatch => .osc, + .dcs_hook, .dcs_put, .dcs_unhook => .dcs, + .apc_start, .apc_put, .apc_end => .apc, + }; + + const t = surface.renderer_state.terminal; + + return .{ + .kind = kind, + .str = str, + .cursor = t.screen.cursor, + .scrolling_region = t.scrolling_region, + .metadata = md.unmanaged, + }; + } + + pub fn deinit(self: *VTEvent, alloc: Allocator) void { + { + var it = self.metadata.valueIterator(); + while (it.next()) |v| alloc.free(v.*); + self.metadata.deinit(alloc); + } + + alloc.free(self.str); + } + + /// Returns true if the event passes the given filter. + pub fn passFilter( + self: *const VTEvent, + filter: *cimgui.c.ImGuiTextFilter, + ) bool { + // Check our main string + if (cimgui.c.ImGuiTextFilter_PassFilter( + filter, + self.str.ptr, + null, + )) return true; + + // We also check all metadata keys and values + var it = self.metadata.iterator(); + while (it.next()) |entry| { + var buf: [256]u8 = undefined; + const key = std.fmt.bufPrintZ(&buf, "{s}", .{entry.key_ptr.*}) catch continue; + if (cimgui.c.ImGuiTextFilter_PassFilter( + filter, + key.ptr, + null, + )) return true; + if (cimgui.c.ImGuiTextFilter_PassFilter( + filter, + entry.value_ptr.ptr, + null, + )) return true; + } + + return false; + } + + /// Encode a parser action as a string that we show in the logs. + fn encodeAction( + alloc: Allocator, + writer: anytype, + md: *Metadata, + action: terminal.Parser.Action, + ) !void { + switch (action) { + .print => try encodePrint(writer, action), + .execute => try encodeExecute(writer, action), + .csi_dispatch => |v| try encodeCSI(writer, v), + .esc_dispatch => |v| try encodeEsc(writer, v), + .osc_dispatch => |v| try encodeOSC(alloc, writer, md, v), + else => try writer.print("{}", .{action}), + } + } + + fn encodePrint(writer: anytype, action: terminal.Parser.Action) !void { + const ch = action.print; + try writer.print("'{u}' (U+{X})", .{ ch, ch }); + } + + fn encodeExecute(writer: anytype, action: terminal.Parser.Action) !void { + const ch = action.execute; + switch (ch) { + 0x00 => try writer.writeAll("NUL"), + 0x01 => try writer.writeAll("SOH"), + 0x02 => try writer.writeAll("STX"), + 0x03 => try writer.writeAll("ETX"), + 0x04 => try writer.writeAll("EOT"), + 0x05 => try writer.writeAll("ENQ"), + 0x06 => try writer.writeAll("ACK"), + 0x07 => try writer.writeAll("BEL"), + 0x08 => try writer.writeAll("BS"), + 0x09 => try writer.writeAll("HT"), + 0x0A => try writer.writeAll("LF"), + 0x0B => try writer.writeAll("VT"), + 0x0C => try writer.writeAll("FF"), + 0x0D => try writer.writeAll("CR"), + 0x0E => try writer.writeAll("SO"), + 0x0F => try writer.writeAll("SI"), + else => try writer.writeAll("?"), + } + try writer.print(" (0x{X})", .{ch}); + } + + fn encodeCSI(writer: anytype, csi: terminal.Parser.Action.CSI) !void { + for (csi.intermediates) |v| try writer.print("{c} ", .{v}); + for (csi.params, 0..) |v, i| { + if (i != 0) try writer.writeByte(';'); + try writer.print("{d}", .{v}); + } + if (csi.intermediates.len > 0 or csi.params.len > 0) try writer.writeByte(' '); + try writer.writeByte(csi.final); + } + + fn encodeEsc(writer: anytype, esc: terminal.Parser.Action.ESC) !void { + for (esc.intermediates) |v| try writer.print("{c} ", .{v}); + try writer.writeByte(esc.final); + } + + fn encodeOSC( + alloc: Allocator, + writer: anytype, + md: *Metadata, + osc: terminal.osc.Command, + ) !void { + // The description is just the tag + try writer.print("{s} ", .{@tagName(osc)}); + + // Add additional fields to metadata + switch (osc) { + inline else => |v, tag| if (tag == osc) { + try encodeMetadata(alloc, md, v); + }, + } + } + + fn encodeMetadata( + alloc: Allocator, + md: *Metadata, + v: anytype, + ) !void { + switch (@TypeOf(v)) { + void => {}, + []const u8 => try md.put("data", try alloc.dupeZ(u8, v)), + else => |T| switch (@typeInfo(T)) { + .Struct => |info| inline for (info.fields) |field| { + try encodeMetadataSingle( + alloc, + md, + field.name, + @field(v, field.name), + ); + }, + + else => { + @compileLog(T); + @compileError("unsupported type, see log"); + }, + }, + } + } + + fn encodeMetadataSingle( + alloc: Allocator, + md: *Metadata, + key: []const u8, + value: anytype, + ) !void { + const Value = @TypeOf(value); + const info = @typeInfo(Value); + switch (info) { + .Optional => if (value) |unwrapped| { + try encodeMetadataSingle(alloc, md, key, unwrapped); + } else { + try md.put(key, try alloc.dupeZ(u8, "(unset)")); + }, + + .Bool => try md.put( + key, + try alloc.dupeZ(u8, if (value) "true" else "false"), + ), + + .Enum => try md.put( + key, + try alloc.dupeZ(u8, @tagName(value)), + ), + + else => switch (Value) { + u8 => try md.put( + key, + try std.fmt.allocPrintZ(alloc, "{}", .{value}), + ), + + []const u8 => try md.put(key, try alloc.dupeZ(u8, value)), + + else => |T| { + @compileLog(T); + @compileError("unsupported type, see log"); + }, + }, + } + } +}; + +/// Our VT stream handler. +pub const VTHandler = struct { + /// The surface that the inspector is attached to. We use this instead + /// of the inspector because this is pointer-stable. + surface: *Surface, + + /// True if the handler is currently recording. + active: bool = true, + + /// Current sequence number + current_seq: usize = 1, + + /// Exclude certain actions by tag. + filter_exclude: ActionTagSet = ActionTagSet.initMany(&.{.print}), + filter_text: *cimgui.c.ImGuiTextFilter, + + const ActionTagSet = std.EnumSet(terminal.Parser.Action.Tag); + + pub fn init(surface: *Surface) VTHandler { + return .{ + .surface = surface, + .filter_text = cimgui.c.ImGuiTextFilter_ImGuiTextFilter(""), + }; + } + + pub fn deinit(self: *VTHandler) void { + cimgui.c.ImGuiTextFilter_destroy(self.filter_text); + } + + /// This is called with every single terminal action. + pub fn handleManually(self: *VTHandler, action: terminal.Parser.Action) !bool { + const insp = self.surface.inspector orelse return false; + + // We always increment the sequence number, even if we're paused or + // filter out the event. This helps show the user that there is a gap + // between events and roughly how large that gap was. + defer self.current_seq +%= 1; + + // If we're pausing, then we ignore all events. + if (!self.active) return true; + + // We ignore certain action types that are too noisy. + switch (action) { + .dcs_put, .apc_put => return true, + else => {}, + } + + // If we requested a specific type to be ignored, ignore it. + // We return true because we did "handle" it by ignoring it. + if (self.filter_exclude.contains(std.meta.activeTag(action))) return true; + + // Build our event + const alloc = self.surface.alloc; + var ev = try VTEvent.init(alloc, self.surface, action); + ev.seq = self.current_seq; + errdefer ev.deinit(alloc); + + // Check if the event passes the filter + if (!ev.passFilter(self.filter_text)) { + ev.deinit(alloc); + return true; + } + + const max_capacity = 100; + insp.vt_events.append(ev) catch |err| switch (err) { + error.OutOfMemory => if (insp.vt_events.capacity() < max_capacity) { + // We're out of memory, but we can allocate to our capacity. + const new_capacity = @min(insp.vt_events.capacity() * 2, max_capacity); + try insp.vt_events.resize(insp.surface.alloc, new_capacity); + try insp.vt_events.append(ev); + } else { + var it = insp.vt_events.iterator(.forward); + if (it.next()) |old_ev| old_ev.deinit(insp.surface.alloc); + insp.vt_events.deleteOldest(1); + try insp.vt_events.append(ev); + }, + + else => return err, + }; + + return true; + } +}; diff --git a/src/main.zig b/src/main.zig index b697b05c1..af669de92 100644 --- a/src/main.zig +++ b/src/main.zig @@ -283,6 +283,7 @@ pub const GlobalState = struct { } }; test { + _ = @import("circ_buf.zig"); _ = @import("Pty.zig"); _ = @import("Command.zig"); _ = @import("font/main.zig"); @@ -294,6 +295,7 @@ test { // Libraries _ = @import("segmented_pool.zig"); + _ = @import("inspector/main.zig"); _ = @import("terminal/main.zig"); _ = @import("terminfo/main.zig"); diff --git a/src/renderer/State.zig b/src/renderer/State.zig index e791cfda4..aebc43fce 100644 --- a/src/renderer/State.zig +++ b/src/renderer/State.zig @@ -2,6 +2,7 @@ const std = @import("std"); const Allocator = std.mem.Allocator; +const Inspector = @import("../inspector/main.zig").Inspector; const terminal = @import("../terminal/main.zig"); const renderer = @import("../renderer.zig"); @@ -14,6 +15,10 @@ mutex: *std.Thread.Mutex, /// The terminal data. terminal: *terminal.Terminal, +/// The terminal inspector, if any. This will be null while the inspector +/// is not active and will be set when it is active. +inspector: ?*Inspector = null, + /// Dead key state. This will render the current dead key preedit text /// over the cursor. This currently only ever renders a single codepoint. /// Preedit can in theory be multiple codepoints long but that is left as diff --git a/src/renderer/Thread.zig b/src/renderer/Thread.zig index df3001b4e..f1c2280ca 100644 --- a/src/renderer/Thread.zig +++ b/src/renderer/Thread.zig @@ -48,11 +48,6 @@ cursor_h: xev.Timer, cursor_c: xev.Completion = .{}, cursor_c_cancel: xev.Completion = .{}, -/// This is true when a blinking cursor should be visible and false -/// when it should not be visible. This is toggled on a timer by the -/// thread automatically. -cursor_blink_visible: bool = false, - /// The surface we're rendering to. surface: *apprt.Surface, @@ -69,6 +64,16 @@ mailbox: *Mailbox, /// Mailbox to send messages to the app thread app_mailbox: App.Mailbox, +flags: packed struct { + /// This is true when a blinking cursor should be visible and false + /// when it should not be visible. This is toggled on a timer by the + /// thread automatically. + cursor_blink_visible: bool = false, + + /// This is true when the inspector is active. + has_inspector: bool = false, +} = .{}, + /// Initialize the thread. This does not START the thread. This only sets /// up all the internal state necessary prior to starting the thread. It /// is up to the caller to start the thread with the threadMain entrypoint. @@ -225,7 +230,7 @@ fn drainMailbox(self: *Thread) !void { // If we're focused, we immediately show the cursor again // and then restart the timer. if (self.cursor_c.state() != .active) { - self.cursor_blink_visible = true; + self.flags.cursor_blink_visible = true; self.cursor_h.run( &self.loop, &self.cursor_c, @@ -239,7 +244,7 @@ fn drainMailbox(self: *Thread) !void { }, .reset_cursor_blink => { - self.cursor_blink_visible = true; + self.flags.cursor_blink_visible = true; if (self.cursor_c.state() == .active) { self.cursor_h.reset( &self.loop, @@ -265,6 +270,8 @@ fn drainMailbox(self: *Thread) !void { defer config.alloc.destroy(config.ptr); try self.renderer.changeConfig(config.ptr); }, + + .inspector => |v| self.flags.has_inspector = v, } } } @@ -322,10 +329,15 @@ fn renderCallback( return .disarm; }; + // If we have an inspector, let the app know we want to rerender that. + if (t.flags.has_inspector) { + _ = t.app_mailbox.push(.{ .redraw_inspector = t.surface }, .{ .instant = {} }); + } + t.renderer.render( t.surface, t.state, - t.cursor_blink_visible, + t.flags.cursor_blink_visible, ) catch |err| log.warn("error rendering err={}", .{err}); @@ -365,7 +377,7 @@ fn cursorTimerCallback( return .disarm; }; - t.cursor_blink_visible = !t.cursor_blink_visible; + t.flags.cursor_blink_visible = !t.flags.cursor_blink_visible; t.wakeup.notify() catch {}; t.cursor_h.run(&t.loop, &t.cursor_c, CURSOR_BLINK_INTERVAL, Thread, t, cursorTimerCallback); diff --git a/src/renderer/message.zig b/src/renderer/message.zig index 19cde4385..d3fdc21de 100644 --- a/src/renderer/message.zig +++ b/src/renderer/message.zig @@ -34,4 +34,7 @@ pub const Message = union(enum) { alloc: Allocator, ptr: *renderer.Renderer.DerivedConfig, }, + + /// Activate or deactivate the inspector. + inspector: bool, }; diff --git a/src/terminal/Parser.zig b/src/terminal/Parser.zig index 785fd938e..3f427c6b5 100644 --- a/src/terminal/Parser.zig +++ b/src/terminal/Parser.zig @@ -54,6 +54,8 @@ pub const TransitionAction = enum { /// Action is the action that a caller of the parser is expected to /// take as a result of some input character. pub const Action = union(enum) { + pub const Tag = std.meta.FieldEnum(Action); + /// Draw character to the screen. This is a unicode codepoint. print: u21, diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index e349f6b90..0a3c524ee 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -62,7 +62,7 @@ const sgr = @import("sgr.zig"); const color = @import("color.zig"); const kitty = @import("kitty.zig"); const point = @import("point.zig"); -const CircBuf = @import("circ_buf.zig").CircBuf; +const CircBuf = @import("../circ_buf.zig").CircBuf; const Selection = @import("Selection.zig"); const fastmem = @import("../fastmem.zig"); const charsets = @import("charsets.zig"); diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index ebecc1479..4b3503072 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -136,7 +136,7 @@ pub const MouseFormat = enum(u3) { /// Scrolling region is the area of the screen designated where scrolling /// occurs. Wen scrolling the screen, only this viewport is scrolled. -const ScrollingRegion = struct { +pub const ScrollingRegion = struct { // Top and bottom of the scroll region (0-indexed) // Precondition: top < bottom top: usize, diff --git a/src/terminal/modes.zig b/src/terminal/modes.zig index ddce8c7f0..906b6f610 100644 --- a/src/terminal/modes.zig +++ b/src/terminal/modes.zig @@ -120,8 +120,8 @@ pub const Mode = mode_enum: { /// The tag type for our enum is a u16 but we use a packed struct /// in order to pack the ansi bit into the tag. -const ModeTag = packed struct(u16) { - const Backing = @typeInfo(@This()).Struct.backing_integer.?; +pub const ModeTag = packed struct(u16) { + pub const Backing = @typeInfo(@This()).Struct.backing_integer.?; value: u15, ansi: bool = false, diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index 4309db4f9..0f3c073d0 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -58,11 +58,29 @@ pub fn Stream(comptime Handler: type) type { // log.debug("char: {c}", .{c}); const actions = self.parser.next(c); for (actions) |action_opt| { + const action = action_opt orelse continue; + + // If this handler handles everything manually then we do nothing + // if it can be processed. + if (@hasDecl(T, "handleManually")) { + const processed = self.handler.handleManually(action) catch |err| err: { + log.warn("error handling action manually err={} action={}", .{ + err, + action, + }); + + break :err false; + }; + + if (processed) continue; + } + // if (action_opt) |action| { // if (action != .print) // log.info("action: {}", .{action}); // } - switch (action_opt orelse continue) { + + switch (action) { .print => |p| if (@hasDecl(T, "print")) try self.handler.print(p), .execute => |code| try self.execute(code), .csi_dispatch => |csi_action| try self.csiDispatch(csi_action), diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 242b2e574..d4d80d696 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -1133,43 +1133,58 @@ const ReadThread = struct { // Schedule a render ev.queueRender() catch unreachable; - // Process the terminal data. This is an extremely hot part of the - // terminal emulator, so we do some abstraction leakage to avoid - // function calls and unnecessary logic. - // - // The ground state is the only state that we can see and print/execute - // ASCII, so we only execute this hot path if we're already in the ground - // state. - // - // Empirically, this alone improved throughput of large text output by ~20%. - var i: usize = 0; - const end = buf.len; - if (ev.terminal_stream.parser.state == .ground) { - for (buf[i..end]) |ch| { - switch (terminal.parse_table.table[ch][@intFromEnum(terminal.Parser.State.ground)].action) { - // Print, call directly. - .print => ev.terminal_stream.handler.print(@intCast(ch)) catch |err| - log.err("error processing terminal data: {}", .{err}), + // If we have an inspector, we enter SLOW MODE because we need to + // process a byte at a time alternating between the inspector handler + // and the termio handler. This is very slow compared to our optimizations + // below but at least users only pay for it if they're using the inspector. + if (ev.renderer_state.inspector) |insp| { + for (buf, 0..) |byte, i| { + insp.recordPtyRead(buf[i .. i + 1]) catch |err| { + log.err("error recording pty read in inspector err={}", .{err}); + }; - // C0 execute, let our stream handle this one but otherwise - // continue since we're guaranteed to be back in ground. - .execute => ev.terminal_stream.execute(ch) catch |err| - log.err("error processing terminal data: {}", .{err}), - - // Otherwise, break out and go the slow path until we're - // back in ground. There is a slight optimization here where - // could try to find the next transition to ground but when - // I implemented that it didn't materially change performance. - else => break, - } - - i += 1; + ev.terminal_stream.next(byte) catch |err| + log.err("error processing terminal data: {}", .{err}); } - } + } else { + // Process the terminal data. This is an extremely hot part of the + // terminal emulator, so we do some abstraction leakage to avoid + // function calls and unnecessary logic. + // + // The ground state is the only state that we can see and print/execute + // ASCII, so we only execute this hot path if we're already in the ground + // state. + // + // Empirically, this alone improved throughput of large text output by ~20%. + var i: usize = 0; + const end = buf.len; + if (ev.terminal_stream.parser.state == .ground) { + for (buf[i..end]) |ch| { + switch (terminal.parse_table.table[ch][@intFromEnum(terminal.Parser.State.ground)].action) { + // Print, call directly. + .print => ev.terminal_stream.handler.print(@intCast(ch)) catch |err| + log.err("error processing terminal data: {}", .{err}), - if (i < end) { - ev.terminal_stream.nextSlice(buf[i..end]) catch |err| - log.err("error processing terminal data: {}", .{err}); + // C0 execute, let our stream handle this one but otherwise + // continue since we're guaranteed to be back in ground. + .execute => ev.terminal_stream.execute(ch) catch |err| + log.err("error processing terminal data: {}", .{err}), + + // Otherwise, break out and go the slow path until we're + // back in ground. There is a slight optimization here where + // could try to find the next transition to ground but when + // I implemented that it didn't materially change performance. + else => break, + } + + i += 1; + } + } + + if (i < end) { + ev.terminal_stream.nextSlice(buf[i..end]) catch |err| + log.err("error processing terminal data: {}", .{err}); + } } // If our stream handling caused messages to be sent to the writer diff --git a/src/termio/Thread.zig b/src/termio/Thread.zig index 459cec97c..93faa38d5 100644 --- a/src/termio/Thread.zig +++ b/src/termio/Thread.zig @@ -62,14 +62,19 @@ sync_reset_cancel_c: xev.Completion = .{}, /// The underlying IO implementation. impl: *termio.Impl, -/// True if linefeed mode is enabled. This is duplicated here so that the -/// write thread doesn't need to grab a lock to check this on every write. -linefeed_mode: bool = false, - /// The mailbox that can be used to send this thread messages. Note /// this is a blocking queue so if it is full you will get errors (or block). mailbox: *Mailbox, +flags: packed struct { + /// True if linefeed mode is enabled. This is duplicated here so that the + /// write thread doesn't need to grab a lock to check this on every write. + linefeed_mode: bool = false, + + /// This is true when the inspector is active. + has_inspector: bool = false, +} = .{}, + /// Initialize the thread. This does not START the thread. This only sets /// up all the internal state necessary prior to starting the thread. It /// is up to the caller to start the thread with the threadMain entrypoint. @@ -174,17 +179,18 @@ fn drainMailbox(self: *Thread) !void { defer config.alloc.destroy(config.ptr); try self.impl.changeConfig(config.ptr); }, + .inspector => |v| self.flags.has_inspector = v, .resize => |v| self.handleResize(v), .clear_screen => |v| try self.impl.clearScreen(v.history), .scroll_viewport => |v| try self.impl.scrollViewport(v), .jump_to_prompt => |v| try self.impl.jumpToPrompt(v), .start_synchronized_output => self.startSynchronizedOutput(), - .linefeed_mode => |v| self.linefeed_mode = v, - .write_small => |v| try self.impl.queueWrite(v.data[0..v.len], self.linefeed_mode), - .write_stable => |v| try self.impl.queueWrite(v, self.linefeed_mode), + .linefeed_mode => |v| self.flags.linefeed_mode = v, + .write_small => |v| try self.impl.queueWrite(v.data[0..v.len], self.flags.linefeed_mode), + .write_stable => |v| try self.impl.queueWrite(v, self.flags.linefeed_mode), .write_alloc => |v| { defer v.alloc.free(v.data); - try self.impl.queueWrite(v.data, self.linefeed_mode); + try self.impl.queueWrite(v.data, self.flags.linefeed_mode); }, } } diff --git a/src/termio/message.zig b/src/termio/message.zig index e2b98c4aa..25dbf0993 100644 --- a/src/termio/message.zig +++ b/src/termio/message.zig @@ -36,6 +36,9 @@ pub const Message = union(enum) { ptr: *termio.Impl.DerivedConfig, }, + /// Activate or deactivate the inspector. + inspector: bool, + /// Resize the window. resize: Resize,