Skip to content

Commit

Permalink
Add more type exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboris committed Sep 11, 2024
1 parent da79b99 commit ab17540
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 0 additions & 1 deletion bridgesupport/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(name main)
(public_name bs-to-ml)
(libraries
camlkit-base.foundation
markup
lambdasoup
lib))
2 changes: 1 addition & 1 deletion generate/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(executable
(name main)
(public_name generate-ml)
(libraries camlkit-base.foundation lib))
(libraries camlkit-base.runtime lib))
3 changes: 2 additions & 1 deletion lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
util
lib)
(libraries
camlkit-base.runtime
camlkit-base.Foundation
lambdasoup
camlkit-base.foundation
str))

(menhir (modules enc_parser))
Expand Down
19 changes: 15 additions & 4 deletions lib/util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ab17540

Please sign in to comment.