Add suport for system events

This commit is contained in:
Mihai Dinculescu
2022-10-29 13:48:00 +01:00
parent ad52d7f050
commit 2809917a93
16 changed files with 554 additions and 116 deletions

View File

@@ -21,37 +21,46 @@ fn main() {
let bindings = builder
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.clang_args(&["-x", "c++"])
.allowlist_function("SimConnect_Open")
.allowlist_function("SimConnect_Close")
.allowlist_function("SimConnect_MapClientEventToSimEvent")
.allowlist_function("SimConnect_AddClientEventToNotificationGroup")
.allowlist_function("SimConnect_SetNotificationGroupPriority")
.allowlist_function("SimConnect_CallDispatch")
.allowlist_function("SimConnect_GetNextDispatch")
.allowlist_function("SimConnect_AddToDataDefinition")
.allowlist_function("SimConnect_RequestDataOnSimObject")
.allowlist_function("SimConnect_CallDispatch")
.allowlist_function("SimConnect_ClearDataDefinition")
.allowlist_function("SimConnect_SubscribeToFacilities")
.allowlist_function("SimConnect_UnsubscribeToFacilities")
.allowlist_function("SimConnect_Close")
.allowlist_function("SimConnect_GetNextDispatch")
.allowlist_function("SimConnect_MapClientEventToSimEvent")
.allowlist_function("SimConnect_Open")
.allowlist_function("SimConnect_RequestDataOnSimObject")
.allowlist_function("SimConnect_RequestFacilitiesList")
.allowlist_type("SIMCONNECT_RECV")
.allowlist_type("SIMCONNECT_RECV_ID")
.allowlist_type("SIMCONNECT_RECV_EVENT")
.allowlist_type("SIMCONNECT_RECV_SIMOBJECT_DATA")
.allowlist_type("SIMCONNECT_RECV_FACILITIES_LIST")
.allowlist_type("SIMCONNECT_RECV_AIRPORT_LIST")
.allowlist_type("SIMCONNECT_RECV_WAYPOINT_LIST")
.allowlist_type("SIMCONNECT_RECV_NDB_LIST")
.allowlist_type("SIMCONNECT_RECV_VOR_LIST")
.allowlist_function("SimConnect_SetNotificationGroupPriority")
.allowlist_function("SimConnect_SubscribeToFacilities")
.allowlist_function("SimConnect_SubscribeToSystemEvent")
.allowlist_function("SimConnect_UnsubscribeFromSystemEvent")
.allowlist_function("SimConnect_UnsubscribeToFacilities")
.allowlist_type("SIMCONNECT_CLIENT_DATA_PERIOD")
.allowlist_type("SIMCONNECT_RECV_OPEN")
.allowlist_type("SIMCONNECT_EXCEPTION")
.allowlist_type("SIMCONNECT_RECV_AIRPORT_LIST")
.allowlist_type("SIMCONNECT_RECV_EVENT_FILENAME")
.allowlist_type("SIMCONNECT_RECV_EVENT_FRAME")
.allowlist_type("SIMCONNECT_RECV_EVENT")
.allowlist_type("SIMCONNECT_RECV_EXCEPTION")
.allowlist_type("SIMCONNECT_RECV_FACILITIES_LIST")
.allowlist_type("SIMCONNECT_RECV_ID")
.allowlist_type("SIMCONNECT_RECV_NDB_LIST")
.allowlist_type("SIMCONNECT_RECV_OPEN")
.allowlist_type("SIMCONNECT_RECV_SIMOBJECT_DATA")
.allowlist_type("SIMCONNECT_RECV_VOR_LIST")
.allowlist_type("SIMCONNECT_RECV_WAYPOINT_LIST")
.allowlist_type("SIMCONNECT_RECV")
.allowlist_var("SIMCONNECT_DATA_REQUEST_FLAG_CHANGED")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME")
.allowlist_var("SIMCONNECT_OBJECT_ID_USER")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER")
.allowlist_var("SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL")
.allowlist_var("SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER")
.allowlist_var("SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D")
.allowlist_var("SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL")
.allowlist_var("SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL")
.generate()
.expect("Unable to generate bindings");