From ab17540b0d03ee1c14db9d1c2490597577c48f30 Mon Sep 17 00:00:00 2001 From: "Boris D." Date: Wed, 11 Sep 2024 10:45:24 -0700 Subject: [PATCH] Add more type exceptions. --- bridgesupport/dune | 1 - generate/dune | 2 +- lib/dune | 3 ++- lib/util.ml | 19 +++++++++++++++---- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/bridgesupport/dune b/bridgesupport/dune index 7b8f48d..ec650fb 100644 --- a/bridgesupport/dune +++ b/bridgesupport/dune @@ -2,7 +2,6 @@ (name main) (public_name bs-to-ml) (libraries - camlkit-base.foundation markup lambdasoup lib)) diff --git a/generate/dune b/generate/dune index cb80ea6..a906714 100644 --- a/generate/dune +++ b/generate/dune @@ -1,4 +1,4 @@ (executable (name main) (public_name generate-ml) - (libraries camlkit-base.foundation lib)) + (libraries camlkit-base.runtime lib)) diff --git a/lib/dune b/lib/dune index 966e039..3cbaab7 100644 --- a/lib/dune +++ b/lib/dune @@ -9,8 +9,9 @@ util lib) (libraries + camlkit-base.runtime + camlkit-base.Foundation lambdasoup - camlkit-base.foundation str)) (menhir (modules enc_parser)) diff --git a/lib/util.ml b/lib/util.ml index 223f802..fe442d6 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -35,14 +35,25 @@ let apply_type_exceptions ?(allow_underscore = true) = function | "CCColorProfileContext" | "CCCharBox" | "CCBigBox" | "CCBox" | "FSRef" | "CCPulseWindowContext" | "rgbaColor" | "rgbMinMaxU8" | "rgbMinMaxFloat" | "CVBuffer" | "CGImageSource" | "CGImageMetadata" | "CGSRegionObject" -| "vImage_Buffer" | "SerialObjectPtrArray" | "filterShape" -> +| "vImage_Buffer" | "SerialObjectPtrArray" | "filterShape" | "CC_MD5state_st" +| "mapped_model_file" | "FastRegistration_Signatures" | "AuthorizationOpaqueRef" +| "OpaqueCUIRendererRef" | "SpeechChannelRecord" | "RXRecognitionSystem" +| "CGSnappingInfo" | "LSASN" | "OpaqueLSSharedFileListRef" | "CGLPBufferObject" +| "OpaqueWindowPtr" | "EventTypeSpec" | "OpaqueIconRef" | "OpaqueCoreDrag" +| "OpaqueEventRef" | "OpaqueMenuRef" | "TISInputSource" | "WorkspaceKVOData_t" +| "OpaqueHIPresentationInstanceRef" | "OpaqueATSUStyle" | "AXUIElement" +| "SLMPopUpMenuContext_t" | "RXRecognizer" | "GSEvent" | "GSKeyboard" +| "IOHIDEvent" | "UIWebTouchEvent" -> "void" | "va_list_tag" -> "(ptr void)" | "NLConstraintParameters" | "GLKMatrix2" | "GLKMatrix3" | "GLKMatrix4" | "GLKVector2" | "GLKVector3" | "GLKVector4" | "CCRange" -| "vec2" | "vec3" | "vec4" | "Texture" | "Rectangle" -| "CIPredictionModelImageFeatures" as ty -> +| "vec2" | "vec3" | "vec4" | "Texture" | "Rectangle" | "Options" | "Point" +| "NSKeyValueCodingControllerModeType" | "NSToolbarFullScreenContentViewLayout_t" +| "CIPredictionModelImageFeatures" | "Geometry2D_rect2D_" | "UIRectCornerRadii" +| "UITableConstantsBackgroundProperties" | "UIPeripheralAnimationGeometry" +| "ITColor" | "mach_right_send" as ty -> raise (Unsupported_type ty) | ty -> if not allow_underscore && String.contains ty '_' then @@ -134,7 +145,7 @@ let emit_prelude ~open_modules file = let load_framework fw = if not (String.equal fw "") then let bundle = - NSBundle._class_ |> NSBundle.C.bundleWithPath (new_string fw) in + NSBundle.self |> NSBundleClass.bundleWithPath (new_string fw) in if is_nil bundle then Printf.eprintf "Framework bundle not found!\n%!" else