Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[WEPopover] Renamed sample into samples, added binding project, added…
Browse files Browse the repository at this point in the history
… sample buildscript
  • Loading branch information
dalexsoto committed Nov 5, 2013
1 parent 74f7368 commit cf231e5
Show file tree
Hide file tree
Showing 16 changed files with 126 additions and 49 deletions.
Expand Up @@ -11,80 +11,80 @@ interface WEPopoverController
{
[Export("contentViewController")]
UIViewController ContentViewController { get; set; }

[Export("view")]
UIView View { get; }

[Export("popoverVisible")]
bool IsPopoverVisible { [Bind("isPopoverVisible")] get; }

[Export("popoverArrowDirection")]
UIPopoverArrowDirection ArrowDirection { get; }

[NullAllowed]
[Export ("delegate", ArgumentSemantic.Assign)]
NSObject WeakDelegate { get; set; }

[NullAllowed]
[Wrap ("WeakDelegate")]
WEPopoverControllerDelegate Delegate { get; set; }

[Export("popoverContentSize", ArgumentSemantic.Assign)]
SizeF ContentSize { get; set; }

[Export("containerViewProperties")]
WEPopoverContainerViewProperties Properties { get; set; }

[Export("context")]
NSObject Context { get; set; }

[Export("passthroughViews", ArgumentSemantic.Copy)]
NSArray PassthroughViews { get; set; }

[Export("initWithContentViewController:")]
IntPtr Constructor(UIViewController contentController);

[Export("dismissPopoverAnimated:")]
void DismissAnimated(bool animated);

[Export("presentPopoverFromBarButtonItem:permittedArrowDirections:animated:")]
void PresentFromBarButtonItem(UIBarButtonItem item, UIPopoverArrowDirection direction, bool animated);

[Export("presentPopoverFromRect:inView:permittedArrowDirections:animated:")]
void PresentFromRect(RectangleF rect, UIView view, UIPopoverArrowDirection direction, bool animated);

[Export("repositionPopoverFromRect:inView:permittedArrowDirections:")]
void RepositionFromRect(RectangleF rect, UIView view, UIPopoverArrowDirection direction);

}

[BaseType(typeof(NSObject))]
[Model]
[Protocol]
interface WEPopoverControllerDelegate
{
[Export("popoverControllerDidDismissPopover:")]
void DidDismissPopover(WEPopoverController popover);

[Export("popoverControllerShouldDismissPopover:")]
bool ShouldDismissPopover(WEPopoverController popover);
}

[BaseType(typeof(UIView))]
interface WETouchableView
{
[Export("touchForwardingDisabled", ArgumentSemantic.Assign)]
bool TouchForwardingDisabled { get; set; }


[NullAllowed]
[Export("delegate", ArgumentSemantic.Assign)]
WETouchableViewDelegate Delegate { get; set; }

[Export("passthroughViews", ArgumentSemantic.Copy)]
NSArray PassThroughViews { get; set; }
}

[Model]
[Protocol]
[BaseType(typeof(NSObject))]
Expand All @@ -95,7 +95,7 @@ interface WETouchableViewDelegate


}

[Model]
[Protocol]
[BaseType(typeof(NSObject))]
Expand All @@ -104,71 +104,71 @@ interface WEPopoverParentView
[Export("displayAreaForPopover")]
RectangleF GetDisplayArea();
}

[BaseType(typeof(UIView))]
interface WEPopoverContainerView
{
[Export("initWithSize:anchorRect:displayArea:permittedArrowDirections:properties:")]
IntPtr Constructor(SizeF size, RectangleF anchorRect, RectangleF displayArea, UIPopoverArrowDirection direction, WEPopoverContainerViewProperties properties);

[Export("arrowDirection")]
UIPopoverArrowDirection ArrowDirection { get; set; }

[Export("contentView")]
UIView ContentView { get; set; }

[Export("updatePositionWithAnchorRect:displayArea:permittedArrowDirections:")]
void UpdatePosition(RectangleF anchorRect, Rectangle area, UIPopoverArrowDirection direction);
}

[BaseType(typeof(NSObject))]
interface WEPopoverContainerViewProperties
{
[Export("bgImageName")]
string BackgroundImageName { get; set; }

[Export("upArrowImageName")]
string UpArrowImageName { get; set; }

[Export("downArrowImageName")]
string DownArrowImageName { get; set; }

[Export("leftArrowImageName")]
string LeftArrowImageName { get; set; }

[Export("rightArrowImageName")]
string RightArrowImageName { get; set; }

[Export("leftBgMargin", ArgumentSemantic.Assign)]
float LeftBackgroundMargin { get; set; }

[Export("rightBgMargin", ArgumentSemantic.Assign)]
float RightBackgroundMargin { get; set; }

[Export("topBgMargin", ArgumentSemantic.Assign)]
float TopBackgroundMargin { get; set; }

[Export("bottomBgMargin", ArgumentSemantic.Assign)]
float BottomBackgroundMargin { get; set; }

[Export("leftContentMargin", ArgumentSemantic.Assign)]
float LeftContentMargin { get; set; }

[Export("rightContentMargin", ArgumentSemantic.Assign)]
float RightContentMargin { get; set; }

[Export("topContentMargin", ArgumentSemantic.Assign)]
float TopContentMargin { get; set; }

[Export("bottomContentMargin", ArgumentSemantic.Assign)]
float BottomContentMargin { get; set; }

[Export("topBgCapSize", ArgumentSemantic.Assign)]
int TopBackgroundCapSize { get; set; }

[Export("leftBgCapSize", ArgumentSemantic.Assign)]
int LeftBackgroundCapSize { get; set; }

[Export("arrowMargin", ArgumentSemantic.Assign)]
float ArrowMargin { get; set; }
}
Expand Down
10 changes: 6 additions & 4 deletions WEPopover/binding/Makefile
@@ -1,9 +1,11 @@
BTOUCH=/Developer/MonoTouch/usr/bin/btouch
MONOXBUILD=/Library/Frameworks/Mono.framework/Commands/xbuild

all: WEPopover.dll

WEPopover.dll: Makefile AssemblyInfo.cs WEPopover.cs libWEPopoverUniversal.a
$(BTOUCH) WEPopover.cs AssemblyInfo.cs --out=$@ --link-with=libWEPopoverUniversal.a,libWEPopoverUniversal.a -x=Extras.cs

WEPopover.dll: Makefile libWEPopoverUniversal.a
$(MONOXBUILD) /p:Configuration=Release WEPopover.csproj
cp bin/Release/WEPopover.dll WEPopover.dll

clean:
-rm -f *.a *.dll
-rm -rf *.dll bin/ obj/
6 changes: 6 additions & 0 deletions WEPopover/binding/StructsAndEnums.cs
@@ -0,0 +1,6 @@
using System;

namespace WEPopover
{
}

58 changes: 58 additions & 0 deletions WEPopover/binding/WEPopover.csproj
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EAFB21D7-C6B2-430F-9A1C-9A00AD10BE15}</ProjectGuid>
<ProjectTypeGuids>{F5B4F3BC-B597-4E2B-B552-EF5D8A32436F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>WEPopover</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>WEPopover</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="monotouch" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<ObjcBindingApiDefinition Include="ApiDefinition.cs" />
</ItemGroup>
<ItemGroup>
<ObjcBindingCoreSource Include="StructsAndEnums.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Xamarin.ObjcBinding.CSharp.targets" />
<ItemGroup>
<Compile Include="Extras.cs" />
<Compile Include="libWEPopoverUniversal.linkwith.cs">
<DependentUpon>libWEPopoverUniversal.a</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ObjcBindingNativeLibrary Include="libWEPopoverUniversal.a" />
</ItemGroup>
</Project>
Expand Up @@ -12,8 +12,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using MonoTouch.ObjCRuntime;

[assembly: LinkWith("libWEPopoverUniversal.a", LinkTarget.Simulator | LinkTarget.ArmV6 | LinkTarget.ArmV7, ForceLoad = true, Frameworks = "Foundation UIKit CoreGraphics")]

[assembly: LinkWith ("libWEPopoverUniversal.a", LinkTarget.Simulator | LinkTarget.ArmV7, ForceLoad = true, Frameworks = "Foundation UIKit CoreGraphics")]
11 changes: 11 additions & 0 deletions WEPopover/samples/Makefile
@@ -0,0 +1,11 @@
#### Sample Builder
#### Author: Alex Soto alex.soto@xamarin.com

MDTOOL=/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool
PROJECTS=WEPopoverSample/WEPopoverSample.sln

all:
for i in $(PROJECTS); do ($(MDTOOL) build -c:"Release|iPhone" $$i); done

clean:
for i in $(PROJECTS); do ($(MDTOOL) build -c:"Release|iPhone" -t:Clean $$i); done

0 comments on commit cf231e5

Please sign in to comment.