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
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
// This file is auto-generated by rute_gen. DO NOT EDIT.
use std::cell::Cell;
use std::rc::Rc;

#[allow(unused_imports)]
use std::marker::PhantomData;

#[allow(unused_imports)]
use std::os::raw::c_void;

#[allow(unused_imports)]
use std::mem::transmute;

#[allow(unused_imports)]
use std::ffi::{CStr, CString};

use rute_ffi_base::*;

#[allow(unused_imports)]
use auto::*;

pub(crate) unsafe extern "C" fn core_application_about_to_quit_trampoline_ud<T>(
    self_c: *const c_void,
    func: *const c_void,
) {
    let f: &&(Fn(&T) + 'static) = transmute(func);

    let data = self_c as *const T;
    f(&*data);
}

#[allow(unused_variables)]
pub(crate) unsafe extern "C" fn core_application_about_to_quit_trampoline(
    self_c: *const c_void,
    func: *const c_void,
) {
    let f: &&(Fn() + 'static) = transmute(func);

    f();
}

/// **Notice these docs are heavy WIP and not very relevent yet**
///
/// This class is used by non-GUI applications to provide their event
/// loop. For non-GUI application that uses Qt, there should be exactly
/// one QCoreApplication object. For GUI applications, see
/// QGuiApplication. For applications that use the Qt Widgets module,
/// see QApplication.
///
/// QCoreApplication contains the main event loop, where all events
/// from the operating system (e.g., timer and network events) and
/// other sources are processed and dispatched. It also handles the
/// application's initialization and finalization, as well as
/// system-wide and application-wide settings.
///
/// # The Event Loop and Event Handling
///
/// The event loop is started with a call to exec(). Long-running
/// operations can call processEvents() to keep the application
/// responsive.
///
/// In general, we recommend that you create a QCoreApplication,
/// QGuiApplication or a QApplication object in your `main()`
/// function as early as possible. exec() will not return until
/// the event loop exits; e.g., when quit() is called.
///
/// Several static convenience functions are also provided. The
/// QCoreApplication object is available from instance(). Events can
/// be sent with sendEvent() or posted to an event queue with postEvent().
/// Pending events can be removed with removePostedEvents() or dispatched
/// with sendPostedEvents().
///
/// The class provides a quit() slot and an aboutToQuit() signal.
///
/// # Application and Library Paths
///
/// An application has an applicationDirPath() and an
/// applicationFilePath(). Library paths (see QLibrary) can be retrieved
/// with libraryPaths() and manipulated by setLibraryPaths(), addLibraryPath(),
/// and removeLibraryPath().
///
/// # Internationalization and Translations
///
/// Translation files can be added or removed
/// using installTranslator() and removeTranslator(). Application
/// strings can be translated using translate(). The QObject::tr()
/// and QObject::trUtf8() functions are implemented in terms of
/// translate().
///
/// # Accessing Command Line Arguments
///
/// The command line arguments which are passed to QCoreApplication's
/// constructor should be accessed using the arguments() function.
///
/// **Note**: QCoreApplication removes option `-qmljsdebugger="...".` It parses the
/// argument of `qmljsdebugger,` and then removes this option plus its argument.
///
/// For more advanced command line option handling, create a QCommandLineParser.
///
/// # Locale Settings
///
/// On Unix/Linux Qt is configured to use the system locale settings by
/// default. This can cause a conflict when using POSIX functions, for
/// instance, when converting between data types such as floats and
/// strings, since the notation may differ between locales. To get
/// around this problem, call the POSIX function `setlocale(LC_NUMERIC,"C")`
/// right after initializing QApplication, QGuiApplication or QCoreApplication
/// to reset the locale that is used for number formatting to -locale.
///
/// **See also:** [`GuiApplication`]
/// [`AbstractEventDispatcher`]
/// [`EventLoop`]
/// {Semaphores Example}
/// {Wait Conditions Example}
/// # Licence
///
/// The documentation is an adoption of the original [Qt Documentation](http://doc.qt.io/) and provided herein is licensed under the terms of the [GNU Free Documentation License version 1.3](http://www.gnu.org/licenses/fdl.html) as published by the Free Software Foundation.
#[derive(Clone)]
pub struct CoreApplication<'a> {
    #[doc(hidden)]
    pub data: Rc<Cell<Option<*const RUBase>>>,
    #[doc(hidden)]
    pub all_funcs: *const RUCoreApplicationAllFuncs,
    #[doc(hidden)]
    pub owned: bool,
    #[doc(hidden)]
    pub _marker: PhantomData<::std::cell::Cell<&'a ()>>,
}

impl<'a> CoreApplication<'a> {
    #[allow(dead_code)]
    pub(crate) fn new_from_rc(ffi_data: RUCoreApplication) -> CoreApplication<'a> {
        CoreApplication {
            data: unsafe { Rc::from_raw(ffi_data.host_data as *const Cell<Option<*const RUBase>>) },
            all_funcs: ffi_data.all_funcs,
            owned: false,
            _marker: PhantomData,
        }
    }

    #[allow(dead_code)]
    pub(crate) fn new_from_owned(ffi_data: RUCoreApplication) -> CoreApplication<'a> {
        CoreApplication {
            data: Rc::new(Cell::new(Some(ffi_data.qt_data as *const RUBase))),
            all_funcs: ffi_data.all_funcs,
            owned: true,
            _marker: PhantomData,
        }
    }

    #[allow(dead_code)]
    pub(crate) fn new_from_temporary(ffi_data: RUCoreApplication) -> CoreApplication<'a> {
        CoreApplication {
            data: Rc::new(Cell::new(Some(ffi_data.qt_data as *const RUBase))),
            all_funcs: ffi_data.all_funcs,
            owned: false,
            _marker: PhantomData,
        }
    }
    ///
    /// Returns the list of command-line arguments.
    ///
    /// Usually arguments().at(0) is the program name, arguments().at(1)
    /// is the first argument, and arguments().last() is the last
    /// argument. See the note below about Windows.
    ///
    /// Calling this function is slow - you should store the result in a variable
    /// when parsing the command line.
    ///
    /// **Warning**: On Unix, this list is built from the argc and argv parameters passed
    /// to the constructor in the main() function. The string-data in argv is
    /// interpreted using QString::fromLocal8Bit(); hence it is not possible to
    /// pass, for example, Japanese command line arguments on a system that runs in a
    /// Latin1 locale. Most modern Unix systems do not have this limitation, as they are
    /// Unicode-based.
    ///
    /// On Windows, the list is built from the argc and argv parameters only if
    /// modified argv/argc parameters are passed to the constructor. In that case,
    /// encoding problems might occur.
    ///
    /// Otherwise, the arguments() are constructed from the return value of
    /// [GetCommandLine()](http://msdn2.microsoft.com/en-us/library/ms683156(VS.85).aspx)
    ///
    /// As a result of this, the string given by arguments().at(0) might not be
    /// the program name on Windows, depending on how the application was started.
    ///
    /// **See also:** [`application_file_path()`]
    /// [`CommandLineParser`]
    pub fn set_organization_domain(org_domain: &str) {
        let str_in_org_domain_1 = CString::new(org_domain).unwrap();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).set_organization_domain)(obj_data, str_in_org_domain_1.as_ptr());
        }
    }
    ///
    /// The value is used by the QSettings class when it is constructed
    /// using the empty constructor. This saves having to repeat this
    /// information each time a QSettings object is created.
    ///
    /// On Mac, QSettings uses organizationDomain() as the organization
    /// if it's not an empty string; otherwise it uses organizationName().
    /// On all other platforms, QSettings uses organizationName() as the
    /// organization.
    ///
    /// **See also:** organizationName
    /// applicationName
    /// applicationVersion
    pub fn organization_domain() -> String {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).organization_domain)(obj_data);
            let ret_val = CStr::from_ptr(ret_val).to_string_lossy().into_owned();
            ret_val
        }
    }
    pub fn set_organization_name(org_name: &str) {
        let str_in_org_name_1 = CString::new(org_name).unwrap();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).set_organization_name)(obj_data, str_in_org_name_1.as_ptr());
        }
    }
    ///
    /// The value is used by the QSettings class when it is constructed
    /// using the empty constructor. This saves having to repeat this
    /// information each time a QSettings object is created.
    ///
    /// On Mac, QSettings uses [organizationDomain()](QCoreApplication::)
    /// as the organization
    /// if it's not an empty string; otherwise it uses
    /// organizationName(). On all other platforms, QSettings uses
    /// organizationName() as the organization.
    ///
    /// **See also:** organizationDomain
    /// applicationName
    pub fn organization_name() -> String {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).organization_name)(obj_data);
            let ret_val = CStr::from_ptr(ret_val).to_string_lossy().into_owned();
            ret_val
        }
    }
    pub fn set_application_name(application: &str) {
        let str_in_application_1 = CString::new(application).unwrap();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).set_application_name)(obj_data, str_in_application_1.as_ptr());
        }
    }
    ///
    /// The value is used by the QSettings class when it is constructed
    /// using the empty constructor. This saves having to repeat this
    /// information each time a QSettings object is created.
    ///
    /// If not set, the application name defaults to the executable name (since 5.0).
    ///
    /// **See also:** organizationName
    /// organizationDomain
    /// applicationVersion
    /// [`application_file_path()`]
    pub fn application_name() -> String {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).application_name)(obj_data);
            let ret_val = CStr::from_ptr(ret_val).to_string_lossy().into_owned();
            ret_val
        }
    }
    pub fn set_application_version(version: &str) {
        let str_in_version_1 = CString::new(version).unwrap();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).set_application_version)(obj_data, str_in_version_1.as_ptr());
        }
    }
    ///
    /// If not set, the application version defaults to a platform-specific value
    /// determined from the main application executable or package (since Qt 5.9):
    ///
    /// * Platform
    /// * Source
    ///
    /// * Windows (classic desktop)
    /// * PRODUCTVERSION parameter of the VERSIONINFO resource
    ///
    /// * Universal Windows Platform
    /// * version attribute of the application package manifest
    ///
    /// * macOS, iOS, tvOS, watchOS
    /// * CFBundleVersion property of the information property list
    ///
    /// * Android
    /// * android:versionName property of the AndroidManifest.xml manifest element
    ///
    /// On other platforms, the default is the empty string.
    ///
    /// **See also:** applicationName
    /// organizationName
    /// organizationDomain
    pub fn application_version() -> String {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).application_version)(obj_data);
            let ret_val = CStr::from_ptr(ret_val).to_string_lossy().into_owned();
            ret_val
        }
    }
    ///
    /// Allows the application to run setuid on UNIX platforms if *allow*
    /// is true.
    ///
    /// If *allow* is false (the default) and Qt detects the application is
    /// running with an effective user id different than the real user id,
    /// the application will be aborted when a QCoreApplication instance is
    /// created.
    ///
    /// Qt is not an appropriate solution for setuid programs due to its
    /// large attack surface. However some applications may be required
    /// to run in this manner for historical reasons. This flag will
    /// prevent Qt from aborting the application when this is detected,
    /// and must be set before a QCoreApplication instance is created.
    ///
    /// **Note**: It is strongly recommended not to enable this option since
    /// it introduces security risks.
    pub fn set_setuid_allowed(allow: bool) {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).set_setuid_allowed)(obj_data, allow);
        }
    }
    ///
    /// Returns true if the application is allowed to run setuid on UNIX
    /// platforms.
    ///
    /// **See also:** [`CoreApplication::set_setuid_allowed`]
    pub fn is_setuid_allowed() -> bool {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).is_setuid_allowed)(obj_data);
            ret_val
        }
    }
    ///
    /// Returns a pointer to the application's QCoreApplication (or
    /// QGuiApplication/QApplication) instance.
    ///
    /// If no instance has been allocated, `null` is returned.
    pub fn instance() -> Option<CoreApplication<'a>> {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).instance)(obj_data);
            if ret_val.qt_data == ::std::ptr::null() {
                return None;
            }
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = CoreApplication::new_from_rc(t);
            } else {
                ret_val = CoreApplication::new_from_owned(t);
            }
            Some(ret_val)
        }
    }
    ///
    /// Enters the main event loop and waits until exit() is called. Returns
    /// the value that was passed to exit() (which is 0 if exit() is called via
    /// quit()).
    ///
    /// It is necessary to call this function to start event handling. The
    /// main event loop receives events from the window system and
    /// dispatches these to the application widgets.
    ///
    /// To make your application perform idle processing (by executing a
    /// special function whenever there are no pending events), use a
    /// QTimer with 0 timeout. More advanced idle processing schemes can
    /// be achieved using processEvents().
    ///
    /// We recommend that you connect clean-up code to the
    /// [aboutToQuit()](QCoreApplication::)
    /// signal, instead of putting it in
    /// your application's `main()` function because on some platforms the
    /// exec() call may not return. For example, on Windows
    /// when the user logs off, the system terminates the process after Qt
    /// closes all top-level windows. Hence, there is no guarantee that the
    /// application will have time to exit its event loop and execute code at
    /// the end of the `main()` function after the exec()
    /// call.
    ///
    /// **See also:** [`quit()`]
    /// [`exit()`]
    /// [`process_events()`]
    /// [`Application::exec`]
    pub fn exec() -> i32 {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).exec)(obj_data);
            ret_val
        }
    }
    ///
    /// Processes all pending events for the calling thread according to
    /// the specified *flags* until there are no more events to process.
    ///
    /// You can call this function occasionally when your program is busy
    /// performing a long operation (e.g. copying a file).
    ///
    /// In the event that you are running a local loop which calls this function
    /// continuously, without an event loop, the
    /// [DeferredDelete](QEvent::DeferredDelete)
    /// events will
    /// not be processed. This can affect the behaviour of widgets,
    /// e.g. QToolTip, that rely on [DeferredDelete](QEvent::DeferredDelete)
    ///
    /// events to function properly. An alternative would be to call
    /// [sendPostedEvents()](QCoreApplication::sendPostedEvents())
    /// from
    /// within that local loop.
    ///
    /// Calling this function processes events only for the calling thread.
    ///
    /// **See also:** [`exec()`]
    /// [`Timer`]
    /// [`EventLoop::process_events`]
    /// [`flush()`]
    /// [`send_posted_events()`]
    ///
    /// **Overloads** processEvents()
    /// Processes pending events for the calling thread for *maxtime*
    /// milliseconds or until there are no more events to process,
    /// whichever is shorter.
    ///
    /// You can call this function occasionally when your program is busy
    /// doing a long operation (e.g. copying a file).
    ///
    /// Calling this function processes events only for the calling thread.
    ///
    /// **See also:** [`exec()`]
    /// [`Timer`]
    /// [`EventLoop::process_events`]
    ///
    /// Processes all pending events for the calling thread according to
    /// the specified *flags* until there are no more events to process.
    ///
    /// You can call this function occasionally when your program is busy
    /// performing a long operation (e.g. copying a file).
    ///
    /// In the event that you are running a local loop which calls this function
    /// continuously, without an event loop, the
    /// [DeferredDelete](QEvent::DeferredDelete)
    /// events will
    /// not be processed. This can affect the behaviour of widgets,
    /// e.g. QToolTip, that rely on [DeferredDelete](QEvent::DeferredDelete)
    ///
    /// events to function properly. An alternative would be to call
    /// [sendPostedEvents()](QCoreApplication::sendPostedEvents())
    /// from
    /// within that local loop.
    ///
    /// Calling this function processes events only for the calling thread.
    ///
    /// **See also:** [`exec()`]
    /// [`Timer`]
    /// [`EventLoop::process_events`]
    /// [`flush()`]
    /// [`send_posted_events()`]
    ///
    /// **Overloads** processEvents()
    /// Processes pending events for the calling thread for *maxtime*
    /// milliseconds or until there are no more events to process,
    /// whichever is shorter.
    ///
    /// You can call this function occasionally when your program is busy
    /// doing a long operation (e.g. copying a file).
    ///
    /// Calling this function processes events only for the calling thread.
    ///
    /// **See also:** [`exec()`]
    /// [`Timer`]
    /// [`EventLoop::process_events`]
    ///
    /// Tells the application to exit with a return code.
    ///
    /// After this function has been called, the application leaves the
    /// main event loop and returns from the call to exec(). The exec()
    /// function returns *returnCode.* If the event loop is not running,
    /// this function does nothing.
    ///
    /// By convention, a *returnCode* of 0 means success, and any non-zero
    /// value indicates an error.
    ///
    /// It's good practice to always connect signals to this slot using a
    /// [QueuedConnection](Qt::)
    /// . If a signal connected (non-queued) to this slot
    /// is emitted before control enters the main event loop (such as before
    /// calls [exec()](QCoreApplication::)
    /// ), the slot has no effect
    /// and the application never exits. Using a queued connection ensures that the
    /// slot will not be invoked until after control enters the main event loop.
    ///
    /// Note that unlike the C library function of the same name, this
    /// function *does* return to the caller -- it is event processing that
    /// stops.
    ///
    /// **See also:** [`quit()`]
    /// [`exec()`]
    pub fn exit(retcode: i32) {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).exit)(obj_data, retcode);
        }
    }
    ///
    /// Sends event *event* directly to receiver *receiver,* using the
    /// notify() function. Returns the value that was returned from the
    /// event handler.
    ///
    /// The event is *not* deleted when the event has been sent. The normal
    /// approach is to create the event on the stack, for example:
    ///
    /// **See also:** [`post_event()`]
    /// [`notify()`]
    pub fn send_event<E: EventTrait<'a>, O: ObjectTrait<'a>>(receiver: &O, event: &E) -> bool {
        let (obj_receiver_1, _funcs) = receiver.get_object_obj_funcs();
        let (obj_event_2, _funcs) = event.get_event_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).send_event)(obj_data, obj_receiver_1, obj_event_2);
            ret_val
        }
    }
    ///
    /// Adds the event *event,* with the object *receiver* as the
    /// receiver of the event, to an event queue and returns immediately.
    ///
    /// The event must be allocated on the heap since the post event queue
    /// will take ownership of the event and delete it once it has been
    /// posted. It is *not safe* to access the event after
    /// it has been posted.
    ///
    /// When control returns to the main event loop, all events that are
    /// stored in the queue will be sent using the notify() function.
    ///
    /// Events are sorted in descending *priority* order, i.e. events
    /// with a high *priority* are queued before events with a lower *priority.* The *priority* can be any integer value, i.e. between
    /// INT_MAX and INT_MIN, inclusive; see Qt::EventPriority for more
    /// details. Events with equal *priority* will be processed in the
    /// order posted.
    ///
    /// **See also:** [`send_event()`]
    /// [`notify()`]
    /// [`send_posted_events()`]
    /// [`t::event_priority()`]
    pub fn post_event<E: EventTrait<'a>, O: ObjectTrait<'a>>(
        receiver: &O,
        event: &E,
        priority: i32,
    ) {
        let (obj_receiver_1, _funcs) = receiver.get_object_obj_funcs();
        let (obj_event_2, _funcs) = event.get_event_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).post_event)(obj_data, obj_receiver_1, obj_event_2, priority);
        }
    }
    ///
    /// Immediately dispatches all events which have been previously queued
    /// with QCoreApplication::postEvent() and which are for the object *receiver*
    /// and have the event type *event_type.*
    ///
    /// Events from the window system are *not* dispatched by this
    /// function, but by processEvents().
    ///
    /// If *receiver* is null, the events of *event_type* are sent for all
    /// objects. If *event_type* is 0, all the events are sent for *receiver.*
    ///
    /// **Note**: This method must be called from the thread in which its QObject
    /// parameter, *receiver,* lives.
    ///
    /// **See also:** [`flush()`]
    /// [`post_event()`]
    pub fn send_posted_events<O: ObjectTrait<'a>>(receiver: &O, event_type: i32) {
        let (obj_receiver_1, _funcs) = receiver.get_object_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).send_posted_events)(obj_data, obj_receiver_1, event_type);
        }
    }
    ///
    /// Removes all events of the given *eventType* that were posted
    /// using postEvent() for *receiver.*
    ///
    /// The events are *not* dispatched, instead they are removed from
    /// the queue. You should never need to call this function. If you do
    /// call it, be aware that killing events may cause *receiver* to
    /// break one or more invariants.
    ///
    /// If *receiver* is null, the events of *eventType* are removed for
    /// all objects. If *eventType* is 0, all the events are removed for
    /// *receiver.* You should never call this function with *eventType*
    /// of 0. If you do call it in this way, be aware that killing events
    /// may cause *receiver* to break one or more invariants.
    ///
    pub fn remove_posted_events<O: ObjectTrait<'a>>(receiver: &O, event_type: i32) {
        let (obj_receiver_1, _funcs) = receiver.get_object_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).remove_posted_events)(obj_data, obj_receiver_1, event_type);
        }
    }
    pub fn has_pending_events() -> bool {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).has_pending_events)(obj_data);
            ret_val
        }
    }
    ///
    /// Sends *event* to *receiver:* *receiver* ->event( *event).*
    /// Returns the value that is returned from the receiver's event
    /// handler. Note that this function is called for all events sent to
    /// any object in any thread.
    ///
    /// For certain types of events (e.g. mouse and key events),
    /// the event will be propagated to the receiver's parent and so on up to
    /// the top-level object if the receiver is not interested in the event
    /// (i.e., it returns `false).`
    ///
    /// There are five different ways that events can be processed;
    /// reimplementing this virtual function is just one of them. All five
    /// approaches are listed below:
    /// * Reimplementing [paintEvent()](QWidget::)
    /// , [mousePressEvent()](QWidget::)
    /// and so on. This is the most common, easiest, and least powerful way.
    /// * Reimplementing this function. This is very powerful, providing complete control; but only one subclass can be active at a time.
    /// * Installing an event filter on QCoreApplication::instance(). Such an event filter is able to process all events for all widgets, so it's just as powerful as reimplementing notify(); furthermore, it's possible to have more than one application-global event filter. Global event filters even see mouse events for [disabled widgets](QWidget::isEnabled())
    /// . Note that application event filters are only called for objects that live in the main thread.
    /// * Reimplementing QObject::event() (as QWidget does). If you do this you get Tab key presses, and you get to see the events before any widget-specific event filters.
    /// * Installing an event filter on the object. Such an event filter gets all the events, including Tab and Shift+Tab key press events, as long as they do not change the focus widget.
    ///
    /// **Future direction:** This function will not be called for objects that live
    /// outside the main thread in Qt 6. Applications that need that functionality
    /// should find other solutions for their event inspection needs in the meantime.
    /// The change may be extended to the main thread, causing this function to be
    /// deprecated.
    ///
    /// **Warning**: If you override this function, you must ensure all threads that
    /// process events stop doing so before your application object begins
    /// destruction. This includes threads started by other libraries that you may be
    /// using, but does not apply to Qt's own threads.
    ///
    /// **See also:** [`Object::event`]
    /// [`install_native_event_filter()`]
    ///
    /// Returns `true` if an application object has not been created yet;
    /// otherwise returns `false.`
    ///
    /// **See also:** [`closing_down()`]
    pub fn starting_up() -> bool {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).starting_up)(obj_data);
            ret_val
        }
    }
    /// X11
    ///
    /// Returns `true` if the application objects are being destroyed;
    /// otherwise returns `false.`
    ///
    /// **See also:** [`starting_up()`]
    pub fn closing_down() -> bool {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).closing_down)(obj_data);
            ret_val
        }
    }
    ///
    /// Returns the directory that contains the application executable.
    ///
    /// For example, if you have installed Qt in the `C:\Qt`
    /// directory, and you run the `regexp` example, this function will
    /// return .
    ///
    /// On MacOS and iOS this will point to the directory actually containing
    /// the executable, which may be inside an application bundle (if the
    /// application is bundled).
    ///
    /// **Warning**: On Linux, this function will try to get the path from the
    /// `/proc` file system. If that fails, it assumes that `argv[0]` contains the absolute file name of the executable. The
    /// function also assumes that the current directory has not been
    /// changed by the application.
    ///
    /// **See also:** [`application_file_path()`]
    pub fn application_dir_path() -> String {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).application_dir_path)(obj_data);
            let ret_val = CStr::from_ptr(ret_val).to_string_lossy().into_owned();
            ret_val
        }
    }
    ///
    /// Returns the file path of the application executable.
    ///
    /// For example, if you have installed Qt in the `/usr/local/qt`
    /// directory, and you run the `regexp` example, this function will
    /// return .
    ///
    /// **Warning**: On Linux, this function will try to get the path from the
    /// `/proc` file system. If that fails, it assumes that `argv[0]` contains the absolute file name of the executable. The
    /// function also assumes that the current directory has not been
    /// changed by the application.
    ///
    /// **See also:** [`application_dir_path()`]
    pub fn application_file_path() -> String {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).application_file_path)(obj_data);
            let ret_val = CStr::from_ptr(ret_val).to_string_lossy().into_owned();
            ret_val
        }
    }
    ///
    /// Returns the current process ID for the application.
    pub fn application_pid() -> i64 {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).application_pid)(obj_data);
            ret_val
        }
    }
    ///
    /// Returns a list of paths that the application will search when
    /// dynamically loading libraries.
    ///
    /// The return value of this function may change when a QCoreApplication
    /// is created. It is not recommended to call it before creating a
    /// QCoreApplication. The directory of the application executable ( **not**
    /// the working directory) is part of the list if it is known. In order
    /// to make it known a QCoreApplication has to be constructed as it will
    /// use `argv[0]` to find it.
    ///
    /// Qt provides default library paths, but they can also be set using
    /// a [qt.conf](Using%20qt.conf)
    /// file. Paths specified in this file
    /// will override default values. Note that if the qt.conf file is in
    /// the directory of the application executable, it may not be found
    /// until a QCoreApplication is created. If it is not found when calling
    /// this function, the default library paths will be used.
    ///
    /// The list will include the installation directory for plugins if
    /// it exists (the default installation directory for plugins is `INSTALL/plugins,` where `INSTALL` is the directory where Qt was
    /// installed). The colon separated entries of the `QT_PLUGIN_PATH`
    /// environment variable are always added. The plugin installation
    /// directory (and its existence) may change when the directory of
    /// the application executable becomes known.
    ///
    /// If you want to iterate over the list, you can use the [foreach](foreach)
    ///
    /// pseudo-keyword:
    ///
    /// **See also:** [`set_library_paths()`]
    /// [`add_library_path()`]
    /// [`remove_library_path()`]
    /// [`Library`]
    /// {How to Create Qt Plugins}
    ///
    /// Prepends *path* to the beginning of the library path list, ensuring that
    /// it is searched for libraries first. If *path* is empty or already in the
    /// path list, the path list is not changed.
    ///
    /// The default path list consists of a single entry, the installation
    /// directory for plugins. The default installation directory for plugins
    /// is `INSTALL/plugins,` where `INSTALL` is the directory where Qt was
    /// installed.
    ///
    /// The library paths are reset to the default when an instance of
    /// QCoreApplication is destructed.
    ///
    /// **See also:** [`remove_library_path()`]
    /// [`library_paths()`]
    /// [`set_library_paths()`]
    pub fn add_library_path(arg0: &str) {
        let str_in_arg0_1 = CString::new(arg0).unwrap();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).add_library_path)(obj_data, str_in_arg0_1.as_ptr());
        }
    }
    ///
    /// Removes *path* from the library path list. If *path* is empty or not
    /// in the path list, the list is not changed.
    ///
    /// The library paths are reset to the default when an instance of
    /// QCoreApplication is destructed.
    ///
    /// **See also:** [`add_library_path()`]
    /// [`library_paths()`]
    /// [`set_library_paths()`]
    pub fn remove_library_path(arg0: &str) {
        let str_in_arg0_1 = CString::new(arg0).unwrap();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).remove_library_path)(obj_data, str_in_arg0_1.as_ptr());
        }
    }
    pub fn flush() {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).flush)(obj_data);
        }
    }
    pub fn is_quit_lock_enabled() -> bool {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).is_quit_lock_enabled)(obj_data);
            ret_val
        }
    }
    pub fn set_quit_lock_enabled(enabled: bool) {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).set_quit_lock_enabled)(obj_data, enabled);
        }
    }
    ///
    /// The default is `true.`
    ///
    /// **See also:** [`EventLoopLocker`]
    ///
    /// Tells the application to exit with return code 0 (success).
    /// Equivalent to calling QCoreApplication::exit(0).
    ///
    /// It's common to connect the QGuiApplication::lastWindowClosed() signal
    /// to quit(), and you also often connect e.g. QAbstractButton::clicked() or
    /// signals in QAction, QMenu, or QMenuBar to it.
    ///
    /// It's good practice to always connect signals to this slot using a
    /// [QueuedConnection](Qt::)
    /// . If a signal connected (non-queued) to this slot
    /// is emitted before control enters the main event loop (such as before
    /// calls [exec()](QCoreApplication::)
    /// ), the slot has no effect
    /// and the application never exits. Using a queued connection ensures that the
    /// slot will not be invoked until after control enters the main event loop.
    ///
    /// Example:
    ///
    /// **See also:** [`exit()`]
    /// [`about_to_quit()`]
    /// [`GuiApplication::last_window_closed`]
    pub fn quit() {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_core_application)(::std::ptr::null()).all_funcs)
                    .core_application_funcs,
            )
        };
        unsafe {
            ((*funcs).quit)(obj_data);
        }
    }
    ///
    /// This signal is emitted when the application is about to quit the
    /// main event loop, e.g. when the event loop level drops to zero.
    /// This may happen either after a call to quit() from inside the
    /// application or when the user shuts down the entire desktop session.
    ///
    /// The signal is particularly useful if your application has to do some
    /// last-second cleanup. Note that no user interaction is possible in
    /// this state.
    ///
    /// **See also:** [`quit()`]
    pub fn set_about_to_quit_event_ud<F, T>(&self, data: &'a T, func: F) -> &Self
    where
        F: Fn(&T) + 'a,
        T: 'a,
    {
        let (obj_data, funcs) = self.get_core_application_obj_funcs();

        let f: Box<Box<Fn(&T) + 'a>> = Box::new(Box::new(func));
        let user_data = data as *const _ as *const c_void;

        unsafe {
            ((*funcs).set_about_to_quit_event)(
                obj_data,
                user_data,
                Box::into_raw(f) as *const _,
                transmute(core_application_about_to_quit_trampoline_ud::<T> as usize),
            );
        }

        self
    }

    pub fn set_about_to_quit_event<F>(&self, func: F) -> &Self
    where
        F: Fn() + 'a,
    {
        let (obj_data, funcs) = self.get_core_application_obj_funcs();
        let f: Box<Box<Fn() + 'a>> = Box::new(Box::new(func));

        unsafe {
            ((*funcs).set_about_to_quit_event)(
                obj_data,
                ::std::ptr::null(),
                Box::into_raw(f) as *const _,
                transmute(core_application_about_to_quit_trampoline as usize),
            );
        }

        self
    }
    #[doc(hidden)]
    pub fn object_name(&self) -> String {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).object_name)(obj_data);
            let ret_val = CStr::from_ptr(ret_val).to_string_lossy().into_owned();
            ret_val
        }
    }
    #[doc(hidden)]
    pub fn set_object_name(&self, name: &str) -> &Self {
        let str_in_name_1 = CString::new(name).unwrap();

        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).set_object_name)(obj_data, str_in_name_1.as_ptr());
        }
        self
    }
    #[doc(hidden)]
    pub fn is_widget_type(&self) -> bool {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).is_widget_type)(obj_data);
            ret_val
        }
    }
    #[doc(hidden)]
    pub fn is_window_type(&self) -> bool {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).is_window_type)(obj_data);
            ret_val
        }
    }
    #[doc(hidden)]
    pub fn signals_blocked(&self) -> bool {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).signals_blocked)(obj_data);
            ret_val
        }
    }
    #[doc(hidden)]
    pub fn block_signals(&self, b: bool) -> bool {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).block_signals)(obj_data, b);
            ret_val
        }
    }
    #[doc(hidden)]
    pub fn start_timer(&self, interval: i32, timer_type: TimerType) -> i32 {
        let enum_timer_type_2 = timer_type as u32;

        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).start_timer)(obj_data, interval, enum_timer_type_2);
            ret_val
        }
    }
    #[doc(hidden)]
    pub fn start_timer_2(&self, time: u32, timer_type: TimerType) -> i32 {
        let enum_timer_type_2 = timer_type as u32;

        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).start_timer_2)(obj_data, time, enum_timer_type_2);
            ret_val
        }
    }
    #[doc(hidden)]
    pub fn kill_timer(&self, id: i32) -> &Self {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).kill_timer)(obj_data, id);
        }
        self
    }
    #[doc(hidden)]
    pub fn set_parent<O: ObjectTrait<'a>>(&self, parent: &O) -> &Self {
        let (obj_parent_1, _funcs) = parent.get_object_obj_funcs();

        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).set_parent)(obj_data, obj_parent_1);
        }
        self
    }
    #[doc(hidden)]
    pub fn install_event_filter<O: ObjectTrait<'a>>(&self, filter_obj: &O) -> &Self {
        let (obj_filter_obj_1, _funcs) = filter_obj.get_object_obj_funcs();

        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).install_event_filter)(obj_data, obj_filter_obj_1);
        }
        self
    }
    #[doc(hidden)]
    pub fn dump_object_tree(&self) -> &Self {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).dump_object_tree)(obj_data);
        }
        self
    }
    #[doc(hidden)]
    pub fn dump_object_info(&self) -> &Self {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).dump_object_info)(obj_data);
        }
        self
    }
    #[doc(hidden)]
    pub fn dump_object_tree_2(&self) -> &Self {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).dump_object_tree_2)(obj_data);
        }
        self
    }
    #[doc(hidden)]
    pub fn dump_object_info_2(&self) -> &Self {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).dump_object_info_2)(obj_data);
        }
        self
    }
    #[doc(hidden)]
    pub fn parent(&self) -> Option<Object> {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).parent)(obj_data);
            if ret_val.qt_data == ::std::ptr::null() {
                return None;
            }
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = Object::new_from_rc(t);
            } else {
                ret_val = Object::new_from_owned(t);
            }
            Some(ret_val)
        }
    }
    #[doc(hidden)]
    pub fn delete_later(&self) -> &Self {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        unsafe {
            ((*funcs).delete_later)(obj_data);
        }
        self
    }
    #[doc(hidden)]
    pub fn set_custom_event_ud<F, T>(&self, data: &'a T, func: F) -> &Self
    where
        F: Fn(&T, &Event) + 'a,
        T: 'a,
    {
        let (obj_data, funcs) = self.get_object_obj_funcs();

        let f: Box<Box<Fn(&T, &Event) + 'a>> = Box::new(Box::new(func));
        let user_data = data as *const _ as *const c_void;

        unsafe {
            ((*funcs).set_custom_event)(
                obj_data,
                user_data,
                Box::into_raw(f) as *const _,
                transmute(object_custom_trampoline_ud::<T> as usize),
            );
        }

        self
    }

    pub fn set_custom_event<F>(&self, func: F) -> &Self
    where
        F: Fn(&Event) + 'a,
    {
        let (obj_data, funcs) = self.get_object_obj_funcs();
        let f: Box<Box<Fn(&Event) + 'a>> = Box::new(Box::new(func));

        unsafe {
            ((*funcs).set_custom_event)(
                obj_data,
                ::std::ptr::null(),
                Box::into_raw(f) as *const _,
                transmute(object_custom_trampoline as usize),
            );
        }

        self
    }

    pub fn build(&self) -> Self {
        self.clone()
    }
}
pub trait CoreApplicationTrait<'a> {
    #[inline]
    #[doc(hidden)]
    fn get_core_application_obj_funcs(&self) -> (*const RUBase, *const RUCoreApplicationFuncs);
}

impl<'a> ObjectTrait<'a> for CoreApplication<'a> {
    #[doc(hidden)]
    fn get_object_obj_funcs(&self) -> (*const RUBase, *const RUObjectFuncs) {
        let obj = self.data.get().unwrap();
        unsafe { (obj, (*self.all_funcs).object_funcs) }
    }
}

impl<'a> CoreApplicationTrait<'a> for CoreApplication<'a> {
    #[doc(hidden)]
    fn get_core_application_obj_funcs(&self) -> (*const RUBase, *const RUCoreApplicationFuncs) {
        let obj = self.data.get().unwrap();
        unsafe { (obj, (*self.all_funcs).core_application_funcs) }
    }
}
#[repr(u32)]
pub enum CoreApplicationFixMeEnums {
    ApplicationFlags = 330498,
}