1use std::ffi::c_void;
2
3#[cfg(windows)]
4pub type WChar = u16;
5#[cfg(not(windows))]
6pub type WChar = i32;
7
8#[repr(C)]
9#[derive(Debug, Default, Clone, Copy, PartialEq)]
10pub struct GeoKernelViewerExtent {
11 pub x_min: f64,
12 pub y_min: f64,
13 pub x_max: f64,
14 pub y_max: f64,
15}
16#[repr(C)]
17#[derive(Debug, Default, Clone, Copy, PartialEq)]
18pub struct GeoKernelViewerScreenRectangle {
19 pub left: i32,
20 pub top: i32,
21 pub right: i32,
22 pub bottom: i32,
23}
24#[repr(C)]
25#[derive(Debug, Default, Clone, Copy)]
26pub struct GeoKernelViewerEventData {
27 pub event_type: i32,
28 pub int_value: i32,
29 pub int_value2: i32,
30 pub double_value: f64,
31 pub extent: GeoKernelViewerExtent,
32 pub screen_rectangle: GeoKernelViewerScreenRectangle,
33}
34#[repr(C)]
35#[derive(Debug, Default, Clone, Copy)]
36pub struct GeoKernelViewerRouteSummary {
37 pub succeeded: bool,
38 pub total_distance: f64,
39 pub total_time: f64,
40 pub cost: f64,
41 pub from_snap_distance: f64,
42 pub to_snap_distance: f64,
43 pub route_layer_index: i32,
44}
45pub type GeoKernelWindowCommandCallback = Option<unsafe extern "C" fn(i32, *mut c_void)>;
46pub type GeoKernelWindowControlCallback =
47 Option<unsafe extern "C" fn(i32, f64, *const WChar, *mut c_void)>;
48pub type GeoKernelViewerEventCallback =
49 Option<unsafe extern "C" fn(*const GeoKernelViewerEventData, *const WChar, *mut c_void)>;
50pub type GeoKernelViewerLayerLoadProgressCallback =
51 Option<unsafe extern "C" fn(i32, *const WChar, *mut c_void)>;
52pub type GeoKernelViewerLayerLoadCancellationCallback =
53 Option<unsafe extern "C" fn(*mut c_void) -> bool>;
54pub type GeoKernelViewerSpatialIndexStateCallback = Option<unsafe extern "C" fn(i32, *mut c_void)>;
55pub type GeoKernelAIProgressCallback =
56 Option<unsafe extern "C" fn(i32, i32, i32, *const WChar, *mut c_void)>;
57pub type GeoKernelAnalysisProgressCallback =
58 Option<unsafe extern "C" fn(i32, *const WChar, *mut c_void)>;
59pub type GeoKernelOperationCancellationCallback = Option<unsafe extern "C" fn(*mut c_void) -> i32>;
60pub type GeoKernelOperationProgressCallback =
61 Option<unsafe extern "C" fn(*mut c_void, i32, i32, i64, i64, *const WChar)>;
62pub type GeoKernelOperationDiagnosticCallback =
63 Option<unsafe extern "C" fn(*mut c_void, i32, *const WChar, *const WChar, *const WChar)>;
64#[repr(C)]
65#[derive(Clone, Copy)]
66pub struct GeoKernelOperationContextV1 {
67 pub struct_size: u32,
68 pub version: u32,
69 pub user_data: *mut c_void,
70 pub cancellation: GeoKernelOperationCancellationCallback,
71 pub progress: GeoKernelOperationProgressCallback,
72 pub diagnostic: GeoKernelOperationDiagnosticCallback,
73 pub maximum_memory_bytes: i64,
74 pub maximum_output_rows: i64,
75 pub maximum_runtime_milliseconds: i64,
76 pub maximum_network_bytes: i64,
77 pub maximum_spatial_area: f64,
78}