Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 73 additions & 9 deletions src/browserenginekit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,20 @@ interface BELayerHierarchyHandle : NSSecureCoding {

[Export ("createXPCRepresentation")]
OS_xpc_object CreateXpcRepresentation ();

[MacCatalyst (26, 0), NoTV, NoMac, iOS (26, 0)]
[Static]
[Export ("handleWithPort:data:error:")]
[return: NullAllowed]
BELayerHierarchyHandle Create (uint port, NSData data, [NullAllowed] out NSError error);

[MacCatalyst (26, 0), NoTV, NoMac, iOS (26, 0)]
[Export ("encodeWithBlock:")]
void Encode (BELayerHierarchyHandleEncodeCallback block);
}

delegate void BELayerHierarchyHandleEncodeCallback (uint copiedPort, NSData data);

[NoTV, NoMac, iOS (17, 4), MacCatalyst (17, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -115,8 +127,20 @@ interface BELayerHierarchyHostingTransactionCoordinator : NSSecureCoding {

[Export ("commit")]
void Commit ();

[MacCatalyst (26, 0), NoTV, NoMac, iOS (26, 0)]
[Static]
[Export ("coordinatorWithPort:data:error:")]
[return: NullAllowed]
BELayerHierarchyHostingTransactionCoordinator Create (uint port, NSData data, [NullAllowed] out NSError error);

[MacCatalyst (26, 0), NoTV, NoMac, iOS (26, 0)]
[Export ("encodeWithBlock:")]
void Encode (BELayerHierarchyHostingTransactionCoordinatorEncodeCallback block);
}

delegate void BELayerHierarchyHostingTransactionCoordinatorEncodeCallback (uint copiedPort, NSData data);

[NoTV, NoMac, iOS (17, 4), MacCatalyst (17, 4)]
[BaseType (typeof (UIContextMenuConfiguration))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -215,7 +239,7 @@ interface BEScrollViewScrollUpdate {
[NoTV, Mac (14, 3), iOS (17, 4), MacCatalyst (17, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface BEWebContentProcess {
interface BEWebContentProcess : BEExtensionProcess {
[Static]
[Export ("webContentProcessWithInterruptionHandler:completion:")]
[Async]
Expand All @@ -227,11 +251,11 @@ interface BEWebContentProcess {
void Create (string bundleId, Action interruptionHandler, BEWebContentProcessCreateCallback completion);

[Export ("invalidate")]
void Invalidate ();
new void Invalidate ();

[Export ("makeLibXPCConnectionError:")]
[return: NullAllowed]
OS_xpc_object MakeLibXpcConnection ([NullAllowed] out NSError error);
new OS_xpc_object MakeLibXpcConnection ([NullAllowed] out NSError error);

[NoMac]
[Export ("createVisibilityPropagationInteraction")]
Expand All @@ -254,7 +278,7 @@ interface BEWebContentProcess {
[NoTV, Mac (14, 3), iOS (17, 4), MacCatalyst (17, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface BENetworkingProcess {
interface BENetworkingProcess : BEExtensionProcess {
[Static]
[Export ("networkProcessWithInterruptionHandler:completion:")]
[Async]
Expand All @@ -266,11 +290,11 @@ interface BENetworkingProcess {
void Create (string bundleId, Action interruptionHandler, BENetworkingProcessCreateCallback completion);

[Export ("invalidate")]
void Invalidate ();
new void Invalidate ();

[Export ("makeLibXPCConnectionError:")]
[return: NullAllowed]
OS_xpc_object MakeLibXpcConnection ([NullAllowed] out NSError error);
new OS_xpc_object MakeLibXpcConnection ([NullAllowed] out NSError error);


// Inlined from the Capability (BENetworkingProcess) category
Expand All @@ -290,7 +314,7 @@ interface BENetworkingProcess {
[NoTV, Mac (14, 3), iOS (17, 4), MacCatalyst (17, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface BERenderingProcess {
interface BERenderingProcess : BEExtensionProcess {
[Static]
[Export ("renderingProcessWithInterruptionHandler:completion:")]
[Async]
Expand All @@ -302,11 +326,11 @@ interface BERenderingProcess {
void Create (string bundleId, Action interruptionHandler, BERenderingProcessCreateCallback completion);

[Export ("invalidate")]
void Invalidate ();
new void Invalidate ();

[Export ("makeLibXPCConnectionError:")]
[return: NullAllowed]
OS_xpc_object MakeLibXpcConnection ([NullAllowed] out NSError error);
new OS_xpc_object MakeLibXpcConnection ([NullAllowed] out NSError error);

[NoMac]
[Export ("createVisibilityPropagationInteraction")]
Expand Down Expand Up @@ -798,6 +822,14 @@ interface BETextInput : UIKeyInput, BETextSelectionDirectionNavigation, BERespon
[iOS (18, 0), MacCatalyst (18, 0), TV (18, 0)]
[Export ("keyboardWillDismiss")]
void KeyboardWillDismiss ();

[iOS (26, 0), TV (26, 0), NoMacCatalyst]
[Export ("selectionContainerViewBelowText")]
UIView SelectionContainerViewBelowText { get; }

[iOS (26, 0), TV (26, 0), NoMacCatalyst]
[Export ("selectionContainerViewAboveText")]
UIView SelectionContainerViewAboveText { get; }
}

interface IBETextInput { }
Expand Down Expand Up @@ -1302,4 +1334,36 @@ interface BEDownloadMonitor {
[Export ("createAccessToken")]
NSData CreateAccessToken ();
}

[MacCatalyst (26, 0), NoTV, Mac (26, 0), iOS (26, 0)]
[Protocol (BackwardsCompatibleCodeGeneration = false)]
interface BEExtensionProcess {
[Abstract]
[Export ("invalidate")]
void Invalidate ();

[Abstract]
[Export ("makeLibXPCConnectionError:")]
[return: NullAllowed]
OS_xpc_object MakeLibXpcConnection ([NullAllowed] out NSError error);
}

[iOS (26, 0), MacCatalyst (26, 0), NoTV, NoMac]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface BEAccessibilityRemoteHostElement {
[Export ("initWithIdentifier:remotePid:")]
NativeHandle Constructor (string identifier, int remotePid);

[NullAllowed, Export ("accessibilityContainer", ArgumentSemantic.Weak)]
NSObject AccessibilityContainer { get; set; }
}

[iOS (26, 0), MacCatalyst (26, 0), NoTV, NoMac]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface BEAccessibilityRemoteElement {
[Export ("initWithIdentifier:hostPid:")]
NativeHandle Constructor (string identifier, int hostPid);
}
}
10 changes: 9 additions & 1 deletion tests/introspection/ApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,14 @@ protected virtual bool Skip (Type type, string protocolName)
return true;
}
break;
case "BEExtensionProcess":
switch (type.Name) {
case "BENetworkingProcess": // conforming using a categeory in headers
case "BERenderingProcess": // conforming using a categeory in headers
case "BEWebContentProcess": // conforming using a categeory in headers
return true;
}
break;
}
return false;
}
Expand Down Expand Up @@ -1109,7 +1117,7 @@ public void GeneralCase ()

if (t.IsPublic && !ConformTo (klass.Handle, protocol)) {
// note: some internal types, e.g. like UIAppearance subclasses, return false (and there's not much value in changing this)
var msg = $"Type {t.FullName} (native: {klass.Name}) does not conform {protocolName}";
var msg = $"Type {t.FullName} (native: {klass.Name}) does not conform to {protocolName}";
list.Add (msg);
ReportError (msg);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# We're not exposing BrowserEngineKit on Mac Catalyst for now, because introspection complains
# about pretty much everything, which makes me question whether it's supposed to be available
# on Mac Catalyst or not. So for now leave it out of Mac Catalyst.
!missing-enum! BEGestureType not bound
!missing-enum! BEKeyModifierFlags not bound
!missing-enum! BEKeyPressState not bound
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading