Procházet zdrojové kódy

update binding ios OpenCV

jaelys před 4 roky
rodič
revize
4603e08c84

binární
AndroidBindingOpenCV/obj/Debug/AndroidBindingOpenCV.csprojAssemblyReference.cache


+ 4 - 0
HiTA.iOS/AppDelegate.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 
 
 using Foundation;
 using Foundation;
+using iOSBindingOpenCV;
 using UIKit;
 using UIKit;
 
 
 namespace HiTA.iOS
 namespace HiTA.iOS
@@ -23,6 +24,9 @@ namespace HiTA.iOS
         public override bool FinishedLaunching(UIApplication app, NSDictionary options)
         public override bool FinishedLaunching(UIApplication app, NSDictionary options)
         {
         {
             global::Xamarin.Forms.Forms.Init();
             global::Xamarin.Forms.Forms.Init();
+            var proxy = new OpenCVSwiftFrameworkProxy();
+            var version = proxy.Version;
+            System.Diagnostics.Debug.WriteLine(version);
             LoadApplication(new App());
             LoadApplication(new App());
 
 
             return base.FinishedLaunching(app, options);
             return base.FinishedLaunching(app, options);

+ 11 - 1
HiTA.iOS/HiTA.iOS.csproj

@@ -51,7 +51,7 @@
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
     <MtouchLink>None</MtouchLink>
     <MtouchLink>None</MtouchLink>
     <MtouchInterpreter>-all</MtouchInterpreter>
     <MtouchInterpreter>-all</MtouchInterpreter>
-    <CodesignProvision>VS: WildCard Development</CodesignProvision>
+    <CodesignProvision>HiTA5 for China</CodesignProvision>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
     <DebugType>none</DebugType>
     <DebugType>none</DebugType>
@@ -62,6 +62,7 @@
     <MtouchArch>ARM64</MtouchArch>
     <MtouchArch>ARM64</MtouchArch>
     <CodesignKey>iPhone Developer</CodesignKey>
     <CodesignKey>iPhone Developer</CodesignKey>
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
+    <MtouchLink>SdkOnly</MtouchLink>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
   <PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
     <AppExtensionDebugBundleId />
     <AppExtensionDebugBundleId />
@@ -72,6 +73,10 @@
     <None Include="Entitlements.plist" />
     <None Include="Entitlements.plist" />
     <None Include="Info.plist" />
     <None Include="Info.plist" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ViewController.cs" />
+    <Compile Include="ViewController.designer.cs">
+      <DependentUpon>ViewController.cs</DependentUpon>
+    </Compile>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
     <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
@@ -126,6 +131,7 @@
     <BundleResource Include="Resources\xamarin_logo%402x.png" />
     <BundleResource Include="Resources\xamarin_logo%402x.png" />
     <BundleResource Include="Resources\xamarin_logo%403x.png" />
     <BundleResource Include="Resources\xamarin_logo%403x.png" />
     <InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
     <InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
+    <InterfaceDefinition Include="ViewController.xib" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System" />
@@ -145,5 +151,9 @@
       <Project>{80E56974-9E79-4225-B45F-CE8FBE1822C1}</Project>
       <Project>{80E56974-9E79-4225-B45F-CE8FBE1822C1}</Project>
       <Name>HiTA</Name>
       <Name>HiTA</Name>
     </ProjectReference>
     </ProjectReference>
+    <ProjectReference Include="..\iOSBindingOpenCV\iOSBindingOpenCV.csproj">
+      <Project>{40EDE8CD-C879-4D0B-834F-CCE8AF4F23A7}</Project>
+      <Name>iOSBindingOpenCV</Name>
+    </ProjectReference>
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 26 - 0
HiTA.iOS/ViewController.cs

@@ -0,0 +1,26 @@
+using UIKit;
+using iOSBindingOpenCV;
+namespace HiTA.iOS
+{
+    public partial class ViewController : UIViewController
+    {
+        public ViewController() : base("ViewController", null)
+        {
+        }
+
+        public override void ViewDidLoad()
+        {
+            base.ViewDidLoad();
+            var proxy = new OpenCVSwiftFrameworkProxy();
+            var version = proxy.Version;
+            System.Diagnostics.Debug.WriteLine(version);
+        }
+
+        public override void DidReceiveMemoryWarning()
+        {
+            base.DidReceiveMemoryWarning();
+            // Release any cached data, images, etc that aren't in use.
+        }
+    }
+}
+

+ 21 - 0
HiTA.iOS/ViewController.designer.cs

@@ -0,0 +1,21 @@
+// WARNING
+//
+// This file has been generated automatically by Xamarin Studio from the outlets and
+// actions declared in your storyboard file.
+// Manual changes to this file will not be maintained.
+//
+using Foundation;
+using System;
+using System.CodeDom.Compiler;
+using UIKit;
+
+namespace HiTA.iOS
+{
+    [Register("ViewController")]
+    partial class ViewController
+    {
+        void ReleaseDesignerOutlets()
+        {
+        }
+    }
+}

+ 21 - 0
HiTA.iOS/ViewController.xib

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
+
+
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ViewController">
+            <connections>
+                <outlet property="view" destination="2" id="RRd-Eg-VrN"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="2">
+            <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+        </view>
+    </objects>
+</document>

+ 11 - 60
iOSBindingOpenCV/ApiDefinition.cs

@@ -1,66 +1,17 @@
-using System;
-
+using Foundation;
 using ObjCRuntime;
 using ObjCRuntime;
-using Foundation;
 using UIKit;
 using UIKit;
 
 
-namespace NativeLibrary
+namespace iOSBindingOpenCV
 {
 {
-    // The first step to creating a binding is to add your native library ("libNativeLibrary.a")
-    // to the project by right-clicking (or Control-clicking) the folder containing this source
-    // file and clicking "Add files..." and then simply select the native library (or libraries)
-    // that you want to bind.
-    //
-    // When you do that, you'll notice that MonoDevelop generates a code-behind file for each
-    // native library which will contain a [LinkWith] attribute. VisualStudio auto-detects the
-    // architectures that the native library supports and fills in that information for you,
-    // however, it cannot auto-detect any Frameworks or other system libraries that the
-    // native library may depend on, so you'll need to fill in that information yourself.
-    //
-    // Once you've done that, you're ready to move on to binding the API...
-    //
-    //
-    // Here is where you'd define your API definition for the native Objective-C library.
-    //
-    // For example, to bind the following Objective-C class:
-    //
-    //     @interface Widget : NSObject {
-    //     }
-    //
-    // The C# binding would look like this:
-    //
-    //     [BaseType (typeof (NSObject))]
-    //     interface Widget {
-    //     }
-    //
-    // To bind Objective-C properties, such as:
-    //
-    //     @property (nonatomic, readwrite, assign) CGPoint center;
-    //
-    // You would add a property definition in the C# interface like so:
-    //
-    //     [Export ("center")]
-    //     CGPoint Center { get; set; }
-    //
-    // To bind an Objective-C method, such as:
-    //
-    //     -(void) doSomething:(NSObject *)object atIndex:(NSInteger)index;
-    //
-    // You would add a method definition to the C# interface like so:
-    //
-    //     [Export ("doSomething:atIndex:")]
-    //     void DoSomething (NSObject object, int index);
-    //
-    // Objective-C "constructors" such as:
-    //
-    //     -(id)initWithElmo:(ElmoMuppet *)elmo;
-    //
-    // Can be bound as:
-    //
-    //     [Export ("initWithElmo:")]
-    //     IntPtr Constructor (ElmoMuppet elmo);
-    //
-    // For more information, see https://aka.ms/ios-binding
-    //
+	// @interface OpenCVSwiftFrameworkProxy : NSObject
+	[BaseType(typeof(NSObject))]
+	interface OpenCVSwiftFrameworkProxy
+	{
+		// -(NSString * _Nonnull)getVersion __attribute__((warn_unused_result("")));
+		[Export("getVersion")]		
+		string Version { get; }
+	}
+
 }
 }
 
 

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 15309
iOSBindingOpenCV/ApiDefinitions.cs


+ 3 - 3
iOSBindingOpenCV/Properties/AssemblyInfo.cs

@@ -1,6 +1,6 @@
 using System.Reflection;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.CompilerServices;
-
+using ObjCRuntime;
 using Foundation;
 using Foundation;
 
 
 // This attribute allows you to mark your assemblies as “safe to link”.
 // This attribute allows you to mark your assemblies as “safe to link”.
@@ -12,11 +12,11 @@ using Foundation;
 // Information about this assembly is defined by the following attributes.
 // Information about this assembly is defined by the following attributes.
 // Change them to the values specific to your project.
 // Change them to the values specific to your project.
 
 
-[assembly: AssemblyTitle("NativeLibrary")]
+[assembly: AssemblyTitle("iOSBindingOpenCV")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("NativeLibrary")]
+[assembly: AssemblyProduct("iOSBindingOpenCV")]
 [assembly: AssemblyCopyright("Copyright ©  2017")]
 [assembly: AssemblyCopyright("Copyright ©  2017")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: AssemblyCulture("")]

+ 6 - 1
iOSBindingOpenCV/Structs.cs

@@ -1,6 +1,11 @@
 using System;
 using System;
+using System.Runtime.InteropServices;
+using Foundation;
 
 
-namespace NativeLibrary
+namespace iOSBindingOpenCV
 {
 {
+	
+	
+
 }
 }
 
 

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1136
iOSBindingOpenCV/StructsAndEnums.cs


+ 11 - 2
iOSBindingOpenCV/iOSBindingOpenCV.csproj

@@ -7,9 +7,9 @@
     <ProjectGuid>{40EDE8CD-C879-4D0B-834F-CCE8AF4F23A7}</ProjectGuid>
     <ProjectGuid>{40EDE8CD-C879-4D0B-834F-CCE8AF4F23A7}</ProjectGuid>
     <TemplateGuid>{b6f3ff35-79b2-4f25-a2fc-60a7cf61013b}</TemplateGuid>
     <TemplateGuid>{b6f3ff35-79b2-4f25-a2fc-60a7cf61013b}</TemplateGuid>
     <OutputType>Library</OutputType>
     <OutputType>Library</OutputType>
-    <RootNamespace>NativeLibrary</RootNamespace>
+    <RootNamespace>iOSBindingOpenCV</RootNamespace>
     <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
     <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
-    <AssemblyName>NativeLibrary</AssemblyName>
+    <AssemblyName>iOSBindingOpenCV</AssemblyName>
     <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
     <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -46,5 +46,14 @@
   <ItemGroup>
   <ItemGroup>
     <ObjcBindingCoreSource Include="Structs.cs" />
     <ObjcBindingCoreSource Include="Structs.cs" />
   </ItemGroup>
   </ItemGroup>
+  <ItemGroup>
+    <NativeReference Include="..\..\..\Desktop\OpenCVSwiftFrameworkProxy\build\Release-iphoneos\OpenCVSwiftFrameworkProxy.framework">
+      <Kind>Framework</Kind>
+      <Frameworks>Foundation</Frameworks>
+    </NativeReference>
+    <NativeReference Include="..\..\..\Desktop\opencv2.framework">
+      <Kind>Framework</Kind>
+    </NativeReference>
+  </ItemGroup>
   <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" />
   <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" />
 </Project>
 </Project>