1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
#![allow(non_upper_case_globals)]

use libc::size_t;
use std::convert::From;
use std::os::raw::{c_char, c_double, c_float, c_int, c_uint, c_ushort, c_void};

pub use self::enums::*;
pub use self::flags::*;
pub use self::structs::*;

mod enums;
mod flags;
mod structs;

#[cfg(feature = "gfx")]
mod gfx_support;

#[cfg(feature = "glium")]
mod glium_support;

/// Vertex index
pub type ImDrawIdx = c_ushort;

/// ImGui context (opaque)
pub enum ImGuiContext {}

/// Unique ID used by widgets (typically hashed from a stack of string)
pub type ImGuiID = ImU32;

/// User data to identify a texture
pub type ImTextureID = *mut c_void;

/// 32-bit unsigned integer (typically used to store packed colors)
pub type ImU32 = c_uint;

/// Character for keyboard input/display
pub type ImWchar = c_ushort;

/// Draw callback for advanced use
pub type ImDrawCallback =
    Option<extern "C" fn(parent_list: *const ImDrawList, cmd: *const ImDrawCmd)>;

/// Input text callback for advanced use
pub type ImGuiInputTextCallback =
    Option<extern "C" fn(data: *mut ImGuiInputTextCallbackData) -> c_int>;

/// Size constraint callback for advanced use
pub type ImGuiSizeCallback = Option<extern "C" fn(data: *mut ImGuiSizeCallbackData)>;

/// A tuple of 2 floating-point values
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, PartialEq)]
pub struct ImVec2 {
    pub x: c_float,
    pub y: c_float,
}

impl ImVec2 {
    pub fn new(x: f32, y: f32) -> ImVec2 {
        ImVec2 {
            x: x as c_float,
            y: y as c_float,
        }
    }
    pub fn zero() -> ImVec2 {
        ImVec2 {
            x: 0.0 as c_float,
            y: 0.0 as c_float,
        }
    }
}

impl From<[f32; 2]> for ImVec2 {
    fn from(array: [f32; 2]) -> ImVec2 {
        ImVec2::new(array[0], array[1])
    }
}

impl From<(f32, f32)> for ImVec2 {
    fn from((x, y): (f32, f32)) -> ImVec2 {
        ImVec2::new(x, y)
    }
}

impl Into<[f32; 2]> for ImVec2 {
    fn into(self) -> [f32; 2] {
        [self.x, self.y]
    }
}

impl Into<(f32, f32)> for ImVec2 {
    fn into(self) -> (f32, f32) {
        (self.x, self.y)
    }
}

/// A tuple of 4 floating-point values
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, PartialEq)]
pub struct ImVec4 {
    pub x: c_float,
    pub y: c_float,
    pub z: c_float,
    pub w: c_float,
}

impl ImVec4 {
    pub fn new(x: f32, y: f32, z: f32, w: f32) -> ImVec4 {
        ImVec4 {
            x: x as c_float,
            y: y as c_float,
            z: z as c_float,
            w: w as c_float,
        }
    }
    pub fn zero() -> ImVec4 {
        ImVec4 {
            x: 0.0 as c_float,
            y: 0.0 as c_float,
            z: 0.0 as c_float,
            w: 0.0 as c_float,
        }
    }
}

impl From<[f32; 4]> for ImVec4 {
    fn from(array: [f32; 4]) -> ImVec4 {
        ImVec4::new(array[0], array[1], array[2], array[3])
    }
}

impl From<(f32, f32, f32, f32)> for ImVec4 {
    fn from((x, y, z, w): (f32, f32, f32, f32)) -> ImVec4 {
        ImVec4::new(x, y, z, w)
    }
}

impl Into<[f32; 4]> for ImVec4 {
    fn into(self) -> [f32; 4] {
        [self.x, self.y, self.z, self.w]
    }
}

impl Into<(f32, f32, f32, f32)> for ImVec4 {
    fn into(self) -> (f32, f32, f32, f32) {
        (self.x, self.y, self.z, self.w)
    }
}

// Context creation and access
extern "C" {
    pub fn igCreateContext(shared_font_atlas: *mut ImFontAtlas) -> *mut ImGuiContext;
    pub fn igDestroyContext(ctx: *mut ImGuiContext);
    pub fn igGetCurrentContext() -> *mut ImGuiContext;
    pub fn igSetCurrentContext(ctx: *mut ImGuiContext);
    pub fn igDebugCheckVersionAndDataLayout(
        version_str: *const c_char,
        sz_io: size_t,
        sz_style: size_t,
        sz_vec2: size_t,
        sz_vec4: size_t,
        sz_drawvert: size_t,
    ) -> bool;
}

// Main
extern "C" {
    pub fn igGetIO() -> *mut ImGuiIO;
    pub fn igGetStyle() -> *mut ImGuiStyle;
    pub fn igNewFrame();
    pub fn igEndFrame();
    pub fn igRender();
    pub fn igGetDrawData() -> *mut ImDrawData;
}

// Demo, Debug, Information
extern "C" {
    pub fn igShowAboutWindow(opened: *mut bool);
    pub fn igShowDemoWindow(opened: *mut bool);
    pub fn igShowMetricsWindow(opened: *mut bool);
    pub fn igShowStyleEditor(style: *mut ImGuiStyle);
    pub fn igShowStyleSelector(label: *const c_char) -> bool;
    pub fn igShowFontSelector(label: *const c_char);
    pub fn igShowUserGuide();
    pub fn igGetVersion() -> *const c_char;
}

// Styles
extern "C" {
    pub fn igStyleColorsDark(dst: *mut ImGuiStyle);
    pub fn igStyleColorsClassic(dst: *mut ImGuiStyle);
    pub fn igStyleColorsLight(dst: *mut ImGuiStyle);
}

// Windows
extern "C" {
    pub fn igBegin(name: *const c_char, open: *mut bool, flags: ImGuiWindowFlags) -> bool;
    pub fn igEnd();
    pub fn igBeginChild(
        str_id: *const c_char,
        size: ImVec2,
        border: bool,
        flags: ImGuiWindowFlags,
    ) -> bool;
    pub fn igBeginChildID(id: ImGuiID, size: ImVec2, border: bool, flags: ImGuiWindowFlags)
        -> bool;
    pub fn igEndChild();
}

// Windows Utilities
extern "C" {
    pub fn igIsWindowAppearing() -> bool;
    pub fn igIsWindowCollapsed() -> bool;
    pub fn igIsWindowFocused(flags: ImGuiFocusedFlags) -> bool;
    pub fn igIsWindowHovered(flags: ImGuiHoveredFlags) -> bool;
    pub fn igGetWindowDrawList() -> *mut ImDrawList;
    pub fn igGetWindowPos_nonUDT2() -> ImVec2;
    pub fn igGetWindowSize_nonUDT2() -> ImVec2;
    pub fn igGetWindowWidth() -> c_float;
    pub fn igGetWindowHeight() -> c_float;
    pub fn igGetContentRegionMax_nonUDT2() -> ImVec2;
    pub fn igGetContentRegionAvail_nonUDT2() -> ImVec2;
    pub fn igGetContentRegionAvailWidth() -> c_float;
    pub fn igGetWindowContentRegionMin_nonUDT2() -> ImVec2;
    pub fn igGetWindowContentRegionMax_nonUDT2() -> ImVec2;
    pub fn igGetWindowContentRegionWidth() -> c_float;

    pub fn igSetNextWindowPos(pos: ImVec2, cond: ImGuiCond, pivot: ImVec2);
    pub fn igSetNextWindowSize(size: ImVec2, cond: ImGuiCond);
    pub fn igSetNextWindowSizeConstraints(
        size_min: ImVec2,
        size_max: ImVec2,
        custom_callback: ImGuiSizeCallback,
        custom_callback_data: *mut c_void,
    );
    pub fn igSetNextWindowContentSize(size: ImVec2);
    pub fn igSetNextWindowCollapsed(collapsed: bool, cond: ImGuiCond);
    pub fn igSetNextWindowFocus();
    pub fn igSetNextWindowBgAlpha(alpha: c_float);
    pub fn igSetWindowPosVec2(pos: ImVec2, cond: ImGuiCond);
    pub fn igSetWindowSizeVec2(size: ImVec2, cond: ImGuiCond);
    pub fn igSetWindowCollapsedBool(collapsed: bool, cond: ImGuiCond);
    pub fn igSetWindowFocus();
    pub fn igSetWindowFontScale(scale: c_float);
    pub fn igSetWindowPosStr(name: *const c_char, pos: ImVec2, cond: ImGuiCond);
    pub fn igSetWindowSizeStr(name: *const c_char, size: ImVec2, cond: ImGuiCond);
    pub fn igSetWindowCollapsedStr(name: *const c_char, collapsed: bool, cond: ImGuiCond);
    pub fn igSetWindowFocusStr(name: *const c_char);
}

#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetWindowPos() -> ImVec2 {
    igGetWindowPos_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetWindowSize() -> ImVec2 {
    igGetWindowSize_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetContentRegionMax() -> ImVec2 {
    igGetContentRegionMax_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetContentRegionAvail() -> ImVec2 {
    igGetContentRegionAvail_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetWindowContentRegionMin() -> ImVec2 {
    igGetWindowContentRegionMin_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetWindowContentRegionMax() -> ImVec2 {
    igGetWindowContentRegionMax_nonUDT2()
}

// Windows scrolling
extern "C" {
    pub fn igGetScrollX() -> c_float;
    pub fn igGetScrollY() -> c_float;
    pub fn igGetScrollMaxX() -> c_float;
    pub fn igGetScrollMaxY() -> c_float;
    pub fn igSetScrollX(scroll_x: c_float);
    pub fn igSetScrollY(scroll_y: c_float);
    pub fn igSetScrollHereY(center_y_ratio: c_float);
    pub fn igSetScrollFromPosY(pos_y: c_float, center_y_ratio: c_float);
}

#[deprecated(since = "0.0.22", note = "please use igSetScrollHereY instead")]
#[allow(non_snake_case)]
pub unsafe fn igSetScrollHere(center_y_ratio: c_float) {
    igSetScrollHereY(center_y_ratio)
}

// Parameter stacks (shared)
extern "C" {
    pub fn igPushFont(font: *mut ImFont);
    pub fn igPopFont();
    pub fn igPushStyleColorU32(idx: ImGuiCol, col: ImU32);
    pub fn igPushStyleColor(idx: ImGuiCol, col: ImVec4);
    pub fn igPopStyleColor(count: c_int);
    pub fn igPushStyleVarFloat(idx: ImGuiStyleVar, val: c_float);
    pub fn igPushStyleVarVec2(idx: ImGuiStyleVar, val: ImVec2);
    pub fn igPopStyleVar(count: c_int);
    pub fn igGetStyleColorVec4(idx: ImGuiCol) -> *const ImVec4;
    pub fn igGetFont() -> *mut ImFont;
    pub fn igGetFontSize() -> c_float;
    pub fn igGetFontTexUvWhitePixel_nonUDT2() -> ImVec2;
    pub fn igGetColorU32(idx: ImGuiCol, alpha_mul: c_float) -> ImU32;
    pub fn igGetColorU32Vec(col: ImVec4) -> ImU32;
    pub fn igGetColorU32U32(col: ImU32) -> ImU32;
}

#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetFontTexUvWhitePixel() -> ImVec2 {
    igGetFontTexUvWhitePixel_nonUDT2()
}

// Parameter stack (current window)
extern "C" {
    pub fn igPushItemWidth(item_width: c_float);
    pub fn igPopItemWidth();
    pub fn igCalcItemWidth() -> c_float;
    pub fn igPushTextWrapPos(wrap_pos_x: c_float);
    pub fn igPopTextWrapPos();
    pub fn igPushAllowKeyboardFocus(allow_keyboard_focus: bool);
    pub fn igPopAllowKeyboardFocus();
    pub fn igPushButtonRepeat(repeat: bool);
    pub fn igPopButtonRepeat();
}

// Cursor / Layout
extern "C" {
    pub fn igSeparator();
    pub fn igSameLine(pos_x: c_float, spacing_w: c_float);
    pub fn igNewLine();
    pub fn igSpacing();
    pub fn igDummy(size: ImVec2);
    pub fn igIndent(indent_w: c_float);
    pub fn igUnindent(indent_w: c_float);
    pub fn igBeginGroup();
    pub fn igEndGroup();
    pub fn igGetCursorPos_nonUDT2() -> ImVec2;
    pub fn igGetCursorPosX() -> c_float;
    pub fn igGetCursorPosY() -> c_float;
    pub fn igSetCursorPos(local_pos: ImVec2);
    pub fn igSetCursorPosX(x: c_float);
    pub fn igSetCursorPosY(y: c_float);
    pub fn igGetCursorStartPos_nonUDT2() -> ImVec2;
    pub fn igGetCursorScreenPos_nonUDT2() -> ImVec2;
    pub fn igSetCursorScreenPos(screen_pos: ImVec2);
    pub fn igAlignTextToFramePadding();
    pub fn igGetTextLineHeight() -> c_float;
    pub fn igGetTextLineHeightWithSpacing() -> c_float;
    pub fn igGetFrameHeight() -> c_float;
    pub fn igGetFrameHeightWithSpacing() -> c_float;
}

#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetCursorPos() -> ImVec2 {
    igGetCursorPos_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetCursorStartPos() -> ImVec2 {
    igGetCursorStartPos_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetCursorScreenPos() -> ImVec2 {
    igGetCursorScreenPos_nonUDT2()
}

// ID stack/scopes
extern "C" {
    pub fn igPushIDStr(str_id: *const c_char);
    pub fn igPushIDRange(str_id_begin: *const c_char, str_id_end: *const c_char);
    pub fn igPushIDPtr(ptr_id: *const c_void);
    pub fn igPushIDInt(int_id: c_int);
    pub fn igPopID();
    pub fn igGetIDStr(str_id: *const c_char) -> ImGuiID;
    pub fn igGetIDStrStr(str_id_begin: *const c_char, str_id_end: *const c_char) -> ImGuiID;
    pub fn igGetIDPtr(ptr_id: *const c_void) -> ImGuiID;
}

// Widgets: Text
extern "C" {
    pub fn igTextUnformatted(text: *const c_char, text_end: *const c_char);
    pub fn igText(fmt: *const c_char, ...);
    pub fn igTextColored(col: ImVec4, fmt: *const c_char, ...);
    pub fn igTextDisabled(fmt: *const c_char, ...);
    pub fn igTextWrapped(fmt: *const c_char, ...);
    pub fn igLabelText(label: *const c_char, fmt: *const c_char, ...);
    pub fn igBulletText(fmt: *const c_char, ...);
}

// Widgets: Main
extern "C" {
    pub fn igButton(label: *const c_char, size: ImVec2) -> bool;
    pub fn igSmallButton(label: *const c_char) -> bool;
    pub fn igInvisibleButton(str_id: *const c_char, size: ImVec2) -> bool;
    pub fn igArrowButton(str_id: *const c_char, dir: ImGuiDir) -> bool;
    pub fn igImage(
        user_texture_id: ImTextureID,
        size: ImVec2,
        uv0: ImVec2,
        uv1: ImVec2,
        tint_col: ImVec4,
        border_col: ImVec4,
    );
    pub fn igImageButton(
        user_texture_id: ImTextureID,
        size: ImVec2,
        uv0: ImVec2,
        uv1: ImVec2,
        frame_padding: c_int,
        bg_col: ImVec4,
        tint_col: ImVec4,
    ) -> bool;
    pub fn igCheckbox(label: *const c_char, v: *mut bool) -> bool;
    pub fn igCheckboxFlags(label: *const c_char, flags: *mut c_uint, flags_value: c_uint) -> bool;
    pub fn igRadioButtonBool(label: *const c_char, active: bool) -> bool;
    pub fn igRadioButtonIntPtr(label: *const c_char, v: *mut c_int, v_button: c_int) -> bool;
    pub fn igProgressBar(fraction: c_float, size_arg: ImVec2, overlay: *const c_char);
    pub fn igBullet();
}

// Widgets: Combo Box
extern "C" {
    pub fn igBeginCombo(
        label: *const c_char,
        preview_value: *const c_char,
        flags: ImGuiComboFlags,
    ) -> bool;
    pub fn igEndCombo();
    pub fn igCombo(
        label: *const c_char,
        current_item: *mut c_int,
        items: *const *const c_char,
        items_count: c_int,
        popup_max_height_in_items: c_int,
    ) -> bool;
    pub fn igComboStr(
        label: *const c_char,
        current_item: *mut c_int,
        items_separated_by_zeros: *const c_char,
        popup_max_height_in_items: c_int,
    ) -> bool;
    pub fn igComboFnPtr(
        label: *const c_char,
        current_item: *mut c_int,
        items_getter: extern "C" fn(
            data: *mut c_void,
            idx: c_int,
            out_text: *mut *const c_char,
        ) -> bool,
        data: *mut c_void,
        items_count: c_int,
        popup_max_height_in_items: c_int,
    ) -> bool;
}

// Widgets: Drags
extern "C" {
    pub fn igDragFloat(
        label: *const c_char,
        v: *mut c_float,
        v_speed: c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igDragFloat2(
        label: *const c_char,
        v: *mut c_float,
        v_speed: c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igDragFloat3(
        label: *const c_char,
        v: *mut c_float,
        v_speed: c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igDragFloat4(
        label: *const c_char,
        v: *mut c_float,
        v_speed: c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igDragFloatRange2(
        label: *const c_char,
        v_current_min: *mut c_float,
        v_current_max: *mut c_float,
        v_speed: c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        format_max: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igDragInt(
        label: *const c_char,
        v: *mut c_int,
        v_speed: c_float,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igDragInt2(
        label: *const c_char,
        v: *mut c_int,
        v_speed: c_float,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igDragInt3(
        label: *const c_char,
        v: *mut c_int,
        v_speed: c_float,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igDragInt4(
        label: *const c_char,
        v: *mut c_int,
        v_speed: c_float,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igDragIntRange2(
        label: *const c_char,
        v_current_min: *mut c_int,
        v_current_max: *mut c_int,
        v_speed: c_float,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
        format_max: *const c_char,
    ) -> bool;
    pub fn igDragScalar(
        label: *const c_char,
        data_type: ImGuiDataType,
        v: *mut c_void,
        v_speed: c_float,
        v_min: *const c_void,
        v_max: *const c_void,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igDragScalarN(
        label: *const c_char,
        data_type: ImGuiDataType,
        v: *mut c_void,
        components: c_int,
        v_speed: c_float,
        v_min: *const c_void,
        v_max: *const c_void,
        format: *const c_char,
        power: c_float,
    ) -> bool;
}

// Widgets: Sliders
extern "C" {
    pub fn igSliderFloat(
        label: *const c_char,
        v: *mut c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igSliderFloat2(
        label: *const c_char,
        v: *mut c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igSliderFloat3(
        label: *const c_char,
        v: *mut c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igSliderFloat4(
        label: *const c_char,
        v: *mut c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igSliderAngle(
        label: *const c_char,
        v_rad: *mut c_float,
        v_degrees_min: c_float,
        v_degrees_max: c_float,
        format: *const c_char,
    ) -> bool;
    pub fn igSliderInt(
        label: *const c_char,
        v: *mut c_int,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igSliderInt2(
        label: *const c_char,
        v: *mut c_int,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igSliderInt3(
        label: *const c_char,
        v: *mut c_int,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igSliderInt4(
        label: *const c_char,
        v: *mut c_int,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igSliderScalar(
        label: *const c_char,
        data_type: ImGuiDataType,
        v: *mut c_void,
        v_min: *const c_void,
        v_max: *const c_void,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igSliderScalarN(
        label: *const c_char,
        data_type: ImGuiDataType,
        v: *mut c_void,
        components: c_int,
        v_min: *const c_void,
        v_max: *const c_void,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igVSliderFloat(
        label: *const c_char,
        size: ImVec2,
        v: *mut c_float,
        v_min: c_float,
        v_max: c_float,
        format: *const c_char,
        power: c_float,
    ) -> bool;
    pub fn igVSliderInt(
        label: *const c_char,
        size: ImVec2,
        v: *mut c_int,
        v_min: c_int,
        v_max: c_int,
        format: *const c_char,
    ) -> bool;
    pub fn igVSliderScalar(
        label: *const c_char,
        size: ImVec2,
        data_type: ImGuiDataType,
        v: *mut c_void,
        v_min: *const c_void,
        v_max: *const c_void,
        format: *const c_char,
        power: c_float,
    ) -> bool;
}

// Widgets: Input with Keyboard
extern "C" {
    pub fn igInputText(
        label: *const c_char,
        buf: *mut c_char,
        buf_size: usize,
        flags: ImGuiInputTextFlags,
        callback: ImGuiInputTextCallback,
        user_data: *mut c_void,
    ) -> bool;
    pub fn igInputTextMultiline(
        label: *const c_char,
        buf: *mut c_char,
        buf_size: usize,
        size: ImVec2,
        flags: ImGuiInputTextFlags,
        callback: ImGuiInputTextCallback,
        user_data: *mut c_void,
    ) -> bool;
    pub fn igInputFloat(
        label: *const c_char,
        v: *mut c_float,
        step: c_float,
        step_fast: c_float,
        format: *const c_char,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputFloat2(
        label: *const c_char,
        v: *mut c_float,
        format: *const c_char,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputFloat3(
        label: *const c_char,
        v: *mut c_float,
        format: *const c_char,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputFloat4(
        label: *const c_char,
        v: *mut c_float,
        format: *const c_char,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputInt(
        label: *const c_char,
        v: *mut c_int,
        step: c_int,
        step_fast: c_int,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputInt2(
        label: *const c_char,
        v: *mut c_int,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputInt3(
        label: *const c_char,
        v: *mut c_int,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputInt4(
        label: *const c_char,
        v: *mut c_int,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputDouble(
        label: *const c_char,
        v: *mut c_double,
        step: c_double,
        step_fast: c_double,
        format: *const c_char,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputScalar(
        label: *const c_char,
        data_type: ImGuiDataType,
        v: *mut c_void,
        step: *const c_void,
        step_fast: *const c_void,
        format: *const c_char,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
    pub fn igInputScalarN(
        label: *const c_char,
        data_type: ImGuiDataType,
        v: *mut c_void,
        components: c_int,
        step: *const c_void,
        step_fast: *const c_void,
        format: *const c_char,
        extra_flags: ImGuiInputTextFlags,
    ) -> bool;
}

// Widgets: Color Editor/Picker
extern "C" {
    pub fn igColorEdit3(
        label: *const c_char,
        col: *mut c_float,
        flags: ImGuiColorEditFlags,
    ) -> bool;
    pub fn igColorEdit4(
        label: *const c_char,
        col: *mut c_float,
        flags: ImGuiColorEditFlags,
    ) -> bool;
    pub fn igColorPicker3(
        label: *const c_char,
        col: *mut c_float,
        flags: ImGuiColorEditFlags,
    ) -> bool;
    pub fn igColorPicker4(
        label: *const c_char,
        col: *mut c_float,
        flags: ImGuiColorEditFlags,
        ref_col: *const c_float,
    ) -> bool;
    pub fn igColorButton(
        desc_id: *const c_char,
        col: ImVec4,
        flags: ImGuiColorEditFlags,
        size: ImVec2,
    ) -> bool;
    pub fn igSetColorEditOptions(flags: ImGuiColorEditFlags);
}

// Widgets: Trees
extern "C" {
    pub fn igTreeNodeStr(label: *const c_char) -> bool;
    pub fn igTreeNodeStrStr(str_id: *const c_char, fmt: *const c_char, ...) -> bool;
    pub fn igTreeNodePtr(ptr_id: *const c_void, fmt: *const c_char, ...) -> bool;
    pub fn igTreeNodeExStr(label: *const c_char, flags: ImGuiTreeNodeFlags) -> bool;
    pub fn igTreeNodeExStrStr(
        str_id: *const c_char,
        flags: ImGuiTreeNodeFlags,
        fmt: *const c_char,
        ...
    ) -> bool;
    pub fn igTreeNodeExPtr(
        ptr_id: *const c_void,
        flags: ImGuiTreeNodeFlags,
        fmt: *const c_char,
        ...
    ) -> bool;
    pub fn igTreePushStr(str_id: *const c_char);
    pub fn igTreePushPtr(ptr_id: *const c_void);
    pub fn igTreePop();
    pub fn igTreeAdvanceToLabelPos();
    pub fn igGetTreeNodeToLabelSpacing() -> c_float;
    pub fn igSetNextTreeNodeOpen(opened: bool, cond: ImGuiCond);
    pub fn igCollapsingHeader(label: *const c_char, flags: ImGuiTreeNodeFlags) -> bool;
    pub fn igCollapsingHeaderBoolPtr(
        label: *const c_char,
        open: *mut bool,
        flags: ImGuiTreeNodeFlags,
    ) -> bool;
}

// Widgets: Selectables
extern "C" {
    pub fn igSelectable(
        label: *const c_char,
        selected: bool,
        flags: ImGuiSelectableFlags,
        size: ImVec2,
    ) -> bool;
    pub fn igSelectableBoolPtr(
        label: *const c_char,
        p_selected: *mut bool,
        flags: ImGuiSelectableFlags,
        size: ImVec2,
    ) -> bool;
}

// Widgets: List Boxes
extern "C" {
    pub fn igListBoxStr_arr(
        label: *const c_char,
        current_item: *mut c_int,
        items: *const *const c_char,
        items_count: c_int,
        height_in_items: c_int,
    ) -> bool;
    pub fn igListBoxFnPtr(
        label: *const c_char,
        current_item: *mut c_int,
        items_getter: extern "C" fn(
            data: *mut c_void,
            idx: c_int,
            out_text: *mut *const c_char,
        ) -> bool,
        data: *mut c_void,
        items_count: c_int,
        height_in_items: c_int,
    ) -> bool;
    pub fn igListBoxHeaderVec2(label: *const c_char, size: ImVec2) -> bool;
    pub fn igListBoxHeaderInt(
        label: *const c_char,
        items_count: c_int,
        height_in_items: c_int,
    ) -> bool;
    pub fn igListBoxFooter();
}

// Widgets: Data Plotting
extern "C" {
    pub fn igPlotLines(
        label: *const c_char,
        values: *const c_float,
        values_count: c_int,
        values_offset: c_int,
        overlay_text: *const c_char,
        scale_min: c_float,
        scale_max: c_float,
        graph_size: ImVec2,
        stride: c_int,
    );
    pub fn igPlotLinesFnPtr(
        label: *const c_char,
        values_getter: extern "C" fn(data: *mut c_void, idx: c_int) -> c_float,
        data: *mut c_void,
        values_count: c_int,
        values_offset: c_int,
        overlay_text: *const c_char,
        scale_min: c_float,
        scale_max: c_float,
        graph_size: ImVec2,
    );
    pub fn igPlotHistogramFloatPtr(
        label: *const c_char,
        values: *const c_float,
        values_count: c_int,
        values_offset: c_int,
        overlay_text: *const c_char,
        scale_min: c_float,
        scale_max: c_float,
        graph_size: ImVec2,
        stride: c_int,
    );
    pub fn igPlotHistogramFnPtr(
        label: *const c_char,
        values_getter: extern "C" fn(data: *mut c_void, idx: c_int) -> c_float,
        data: *mut c_void,
        values_count: c_int,
        values_offset: c_int,
        overlay_text: *const c_char,
        scale_min: c_float,
        scale_max: c_float,
        graph_size: ImVec2,
    );
}

// Widgets: Value() Helpers
extern "C" {
    pub fn igValueBool(prefix: *const c_char, b: bool);
    pub fn igValueInt(prefix: *const c_char, v: c_int);
    pub fn igValueUInt(prefix: *const c_char, v: c_uint);
    pub fn igValueFloat(prefix: *const c_char, v: c_float, float_format: *const c_char);
}

// Widgets: Menus
extern "C" {
    pub fn igBeginMainMenuBar() -> bool;
    pub fn igEndMainMenuBar();
    pub fn igBeginMenuBar() -> bool;
    pub fn igEndMenuBar();
    pub fn igBeginMenu(label: *const c_char, enabled: bool) -> bool;
    pub fn igEndMenu();
    pub fn igMenuItemBool(
        label: *const c_char,
        shortcut: *const c_char,
        selected: bool,
        enabled: bool,
    ) -> bool;
    pub fn igMenuItemBoolPtr(
        label: *const c_char,
        shortcut: *const c_char,
        p_selected: *mut bool,
        enabled: bool,
    ) -> bool;
}

// Tooltips
extern "C" {
    pub fn igBeginTooltip();
    pub fn igEndTooltip();
    pub fn igSetTooltip(fmt: *const c_char, ...);
}

// Popups
extern "C" {
    pub fn igOpenPopup(str_id: *const c_char);
    pub fn igBeginPopup(str_id: *const c_char, flags: ImGuiWindowFlags) -> bool;
    pub fn igBeginPopupContextItem(str_id: *const c_char, mouse_button: c_int) -> bool;
    pub fn igBeginPopupContextWindow(
        str_id: *const c_char,
        mouse_button: c_int,
        also_over_items: bool,
    ) -> bool;
    pub fn igBeginPopupContextVoid(str_id: *const c_char, mouse_button: c_int) -> bool;
    pub fn igBeginPopupModal(name: *const c_char, open: *mut bool, flags: ImGuiWindowFlags)
        -> bool;
    pub fn igEndPopup();
    pub fn igOpenPopupOnItemClick(str_id: *const c_char, mouse_button: c_int) -> bool;
    pub fn igIsPopupOpen(str_id: *const c_char) -> bool;
    pub fn igCloseCurrentPopup();
}

// Columns
extern "C" {
    pub fn igColumns(count: c_int, id: *const c_char, border: bool);
    pub fn igNextColumn();
    pub fn igGetColumnIndex() -> c_int;
    pub fn igGetColumnWidth(column_index: c_int) -> c_float;
    pub fn igSetColumnWidth(column_index: c_int, width: c_float);
    pub fn igGetColumnOffset(column_index: c_int) -> c_float;
    pub fn igSetColumnOffset(column_index: c_int, offset_x: c_float);
    pub fn igGetColumnsCount() -> c_int;
}

// Logging/Capture
extern "C" {
    pub fn igLogToTTY(max_depth: c_int);
    pub fn igLogToFile(max_depth: c_int, filename: *const c_char);
    pub fn igLogToClipboard(max_depth: c_int);
    pub fn igLogFinish();
    pub fn igLogButtons();
    pub fn igLogText(fmt: *const c_char, ...);
}

// Drag and Drop
extern "C" {
    /// Call when current ID is active.
    ///
    /// When this returns true you need to:
    ///
    /// 1. call [`igSetDragDropPayload`] exactly once,
    /// 2. you may render the payload visual/description,
    /// 3. pcall [`igEndDragDropSource`]
    pub fn igBeginDragDropSource(flags: ImGuiDragDropFlags) -> bool;
    /// Use 'cond' to choose to submit payload on drag start or every frame
    pub fn igSetDragDropPayload(
        type_: *const c_char,
        data: *const c_void,
        size: size_t,
        cond: ImGuiCond,
    ) -> bool;
    pub fn igEndDragDropSource();
    pub fn igBeginDragDropTarget() -> bool;
    pub fn igAcceptDragDropPayload(
        type_: *const c_char,
        flags: ImGuiDragDropFlags,
    ) -> *const ImGuiPayload;
    pub fn igEndDragDropTarget();
    pub fn igGetDragDropPayload() -> *const ImGuiPayload;
}

// Clipping
extern "C" {
    pub fn igPushClipRect(
        clip_rect_min: ImVec2,
        clip_rect_max: ImVec2,
        intersect_with_current_clip_rect: bool,
    );
    pub fn igPopClipRect();
}

// Focus
extern "C" {
    pub fn igSetItemDefaultFocus();
    pub fn igSetKeyboardFocusHere(offset: c_int);
}

// Utilities
extern "C" {
    pub fn igIsItemHovered(flags: ImGuiHoveredFlags) -> bool;
    pub fn igIsItemActive() -> bool;
    pub fn igIsItemFocused() -> bool;
    pub fn igIsItemClicked(mouse_button: c_int) -> bool;
    pub fn igIsItemVisible() -> bool;
    pub fn igIsItemEdited() -> bool;
    pub fn igIsItemDeactivated() -> bool;
    pub fn igIsItemDeactivatedAfterEdit() -> bool;
    pub fn igIsAnyItemHovered() -> bool;
    pub fn igIsAnyItemActive() -> bool;
    pub fn igIsAnyItemFocused() -> bool;
    pub fn igGetItemRectMin_nonUDT2() -> ImVec2;
    pub fn igGetItemRectMax_nonUDT2() -> ImVec2;
    pub fn igGetItemRectSize_nonUDT2() -> ImVec2;
    pub fn igSetItemAllowOverlap();
    pub fn igIsRectVisible(size: ImVec2) -> bool;
    pub fn igIsRectVisibleVec2(rect_min: ImVec2, rect_max: ImVec2) -> bool;
    pub fn igGetTime() -> c_float;
    pub fn igGetFrameCount() -> c_int;
    pub fn igGetOverlayDrawList() -> *mut ImDrawList;
    pub fn igGetDrawListSharedData() -> *mut ImDrawListSharedData;
    pub fn igGetStyleColorName(idx: ImGuiCol) -> *const c_char;
    pub fn igSetStateStorage(storage: *mut ImGuiStorage);
    pub fn igGetStateStorage() -> *mut ImGuiStorage;
    pub fn igCalcTextSize_nonUDT2(
        text: *const c_char,
        text_end: *const c_char,
        hide_text_after_double_hash: bool,
        wrap_width: c_float,
    ) -> ImVec2;
    pub fn igCalcListClipping(
        items_count: c_int,
        items_height: c_float,
        out_items_display_start: *mut c_int,
        out_items_display_end: *mut c_int,
    );

    pub fn igBeginChildFrame(id: ImGuiID, size: ImVec2, flags: ImGuiWindowFlags) -> bool;
    pub fn igEndChildFrame();

    pub fn igColorConvertU32ToFloat4_nonUDT2(color: ImU32) -> ImVec4;
    pub fn igColorConvertFloat4ToU32(color: ImVec4) -> ImU32;
    pub fn igColorConvertRGBtoHSV(
        r: c_float,
        g: c_float,
        b: c_float,
        out_h: *mut c_float,
        out_s: *mut c_float,
        out_v: *mut c_float,
    );
    pub fn igColorConvertHSVtoRGB(
        h: c_float,
        s: c_float,
        v: c_float,
        out_r: *mut c_float,
        out_g: *mut c_float,
        out_b: *mut c_float,
    );
}

#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetItemRectMin() -> ImVec2 {
    igGetItemRectMin_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetItemRectMax() -> ImVec2 {
    igGetItemRectMax_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetItemRectSize() -> ImVec2 {
    igGetItemRectSize_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igCalcTextSize(
    text: *const c_char,
    text_end: *const c_char,
    hide_text_after_double_hash: bool,
    wrap_width: c_float,
) -> ImVec2 {
    igCalcTextSize_nonUDT2(text, text_end, hide_text_after_double_hash, wrap_width)
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igColorConvertU32ToFloat4(color: ImU32) -> ImVec4 {
    igColorConvertU32ToFloat4_nonUDT2(color)
}

// Inputs
extern "C" {
    pub fn igGetKeyIndex(imgui_key: ImGuiKey) -> c_int;
    pub fn igIsKeyDown(user_key_index: c_int) -> bool;
    pub fn igIsKeyPressed(user_key_index: c_int, repeat: bool) -> bool;
    pub fn igIsKeyReleased(user_key_index: c_int) -> bool;
    pub fn igGetKeyPressedAmount(key_index: c_int, repeat_delay: c_float, rate: c_float) -> c_int;
    pub fn igIsMouseDown(button: c_int) -> bool;
    pub fn igIsAnyMouseDown() -> bool;
    pub fn igIsMouseClicked(button: c_int, repeat: bool) -> bool;
    pub fn igIsMouseDoubleClicked(button: c_int) -> bool;
    pub fn igIsMouseReleased(button: c_int) -> bool;
    pub fn igIsMouseDragging(button: c_int, lock_threshold: c_float) -> bool;
    pub fn igIsMouseHoveringRect(r_min: ImVec2, r_max: ImVec2, clip: bool) -> bool;
    pub fn igIsMousePosValid(mouse_pos: *const ImVec2) -> bool;
    pub fn igGetMousePos_nonUDT2() -> ImVec2;
    pub fn igGetMousePosOnOpeningCurrentPopup_nonUDT2() -> ImVec2;
    pub fn igGetMouseDragDelta_nonUDT2(button: c_int, lock_threshold: c_float) -> ImVec2;
    pub fn igResetMouseDragDelta(button: c_int);
    pub fn igGetMouseCursor() -> ImGuiMouseCursor;
    pub fn igSetMouseCursor(cursor: ImGuiMouseCursor);
    pub fn igCaptureKeyboardFromApp(capture: bool);
    pub fn igCaptureMouseFromApp(capture: bool);
}

#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetMousePos() -> ImVec2 {
    igGetMousePos_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetMousePosOnOpeningCurrentPopup() -> ImVec2 {
    igGetMousePosOnOpeningCurrentPopup_nonUDT2()
}
#[deprecated(
    since = "0.0.22",
    note = "please use the _nonUDT2 suffixed version of this function"
)]
#[allow(non_snake_case)]
pub unsafe fn igGetMouseDragDelta(button: c_int, lock_threshold: c_float) -> ImVec2 {
    igGetMouseDragDelta_nonUDT2(button, lock_threshold)
}

// Clipboard utilities
extern "C" {
    pub fn igGetClipboardText() -> *const c_char;
    pub fn igSetClipboardText(text: *const c_char);
}

// Settings/.Ini Utilities
extern "C" {
    pub fn igLoadIniSettingsFromDisk(ini_filename: *const c_char);
    pub fn igLoadIniSettingsFromMemory(ini_data: *const c_char, ini_size: usize);
    pub fn igSaveIniSettingsToDisk(ini_filename: *const c_char);
    pub fn igSaveIniSettingsToMemory(out_ini_size: *const usize) -> *const c_char;
}

// Memory Utilities
extern "C" {
    pub fn igSetAllocatorFunctions(
        alloc_func: Option<extern "C" fn(sz: usize, user_data: *mut c_void) -> *mut c_void>,
        free_func: Option<extern "C" fn(ptr: *mut c_void, user_data: *mut c_void)>,
        user_data: *mut c_void,
    );
    pub fn igMemAlloc(size: usize) -> *mut c_void;
    pub fn igMemFree(ptr: *mut c_void);
}