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

Commit

Permalink
[iCarousel 1.8.1] Update iCarousel port to support unified api
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas VERINAUD committed Jan 8, 2015
1 parent 415753d commit 9d2989e
Show file tree
Hide file tree
Showing 23 changed files with 4,998 additions and 125 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ Kiip/binding/libKiip.a
/FlurryAnalytics/binding/libFlurry.a
CorePlot/binding/CorePlot_0.9/


*.a
*.a
build
xcuserdata
93 changes: 45 additions & 48 deletions iCarousel/binding/ApiDefinition.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
using System;
using System.Drawing;

using MonoTouch.ObjCRuntime;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.CoreAnimation;
using CoreAnimation;
using CoreGraphics;
using Foundation;
using ObjCRuntime;
using UIKit;

namespace iCarouselSDK
{

[BaseType (typeof (UIView))]
interface iCarousel {

interface iCarousel
{
[Export ("dataSource", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDataSource { get; set; }

Expand All @@ -28,16 +26,16 @@ interface iCarousel {
iCarouselType CarouselType { get; set; }

[Export ("perspective", ArgumentSemantic.Assign)]
float Perspective { get; set; }
nfloat Perspective { get; set; }

[Export ("decelerationRate", ArgumentSemantic.Assign)]
float DecelerationRate { get; set; }
nfloat DecelerationRate { get; set; }

[Export ("scrollSpeed", ArgumentSemantic.Assign)]
float ScrollSpeed { get; set; }
nfloat ScrollSpeed { get; set; }

[Export ("bounceDistance", ArgumentSemantic.Assign)]
float BounceDistance { get; set; }
nfloat BounceDistance { get; set; }

[Export ("scrollEnabled", ArgumentSemantic.Assign)]
bool ScrollEnabled { [Bind ("isScrollEnabled")] get; set; }
Expand All @@ -52,25 +50,25 @@ interface iCarousel {
bool Bounces { get; set; }

[Export ("scrollOffset", ArgumentSemantic.Assign)]
float ScrollOffset { get; set; }
nfloat ScrollOffset { get; set; }

[Export ("offsetMultiplier")]
float OffsetMultiplier { get; }
nfloat OffsetMultiplier { get; }

[Export ("contentOffset", ArgumentSemantic.Assign)]
SizeF ContentOffset { get; set; }
CGSize ContentOffset { get; set; }

[Export ("viewpointOffset", ArgumentSemantic.Assign)]
SizeF ViewpointOffset { get; set; }
CGSize ViewpointOffset { get; set; }

[Export ("numberOfItems")]
int NumberOfItems { get; }
nint NumberOfItems { get; }

[Export ("numberOfPlaceholders")]
int NumberOfPlaceholders { get; }
nint NumberOfPlaceholders { get; }

[Export ("currentItemIndex", ArgumentSemantic.Assign)]
int CurrentItemIndex { get; set; }
nint CurrentItemIndex { get; set; }

[Export ("currentItemView")]
UIView CurrentItemView { get; }
Expand All @@ -79,16 +77,16 @@ interface iCarousel {
NSNumber [] IndexesForVisibleItems { get; }

[Export ("numberOfVisibleItems")]
int NumberOfVisibleItems { get; }
nint NumberOfVisibleItems { get; }

[Export ("itemWidth")]
float ItemWidth { get; }
nfloat ItemWidth { get; }

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

[Export ("toggle")]
float Toggle { get; }
nfloat Toggle { get; }

[Export ("stopAtItemBoundary", ArgumentSemantic.Assign)]
bool StopAtItemBoundary { get; set; }
Expand All @@ -112,46 +110,46 @@ interface iCarousel {
bool Scrolling { [Bind ("isScrolling")] get; set; }

[Export ("scrollByOffset:duration:")]
void ScrollByOffset (float offset, double duration);
void ScrollByOffset (nfloat offset, double duration);

[Export ("scrollToOffset:duration:")]
void ScrollToOffset (float offset, double duration);
void ScrollToOffset (nfloat offset, double duration);

[Export ("scrollByNumberOfItems:duration:")]
void ScrollByNumberOfItems (int itemCount, double duration);
void ScrollByNumberOfItems (nint itemCount, double duration);

[Export ("scrollToItemAtIndex:duration:")]
void ScrollToItem (int index, double duration);
void ScrollToItem (nint index, double duration);

[Export ("scrollToItemAtIndex:animated:")]
void ScrollToItem (int index, bool animated);
void ScrollToItem (nint index, bool animated);

[Export ("itemViewAtIndex:")]
UIView GetItemView (int index);
UIView GetItemView (nint index);

[Export ("indexOfItemView:")]
int IndexOfItemView (UIView view);
nint IndexOfItemView (UIView view);

[Export ("indexOfItemViewOrSubview:")]
int IndexOfItemViewOrSubview (UIView view);
nint IndexOfItemViewOrSubview (UIView view);

[Export ("offsetForItemAtIndex:")]
float OffsetForItem (int index);

nfloat OffsetForItem (nint index);
[Export ("removeItemAtIndex:animated:")]
void RemoveItem (int index, bool animated);
void RemoveItem (nint index, bool animated);

[Export ("insertItemAtIndex:animated:")]
void InsertItem (int index, bool animated);
void InsertItem (nint index, bool animated);

[Export ("reloadItemAtIndex:animated:")]
void ReloadItem (int index, bool animated);
void ReloadItem (nint index, bool animated);

[Export ("reloadData")]
void ReloadData ();

[Export ("initWithFrame:")]
IntPtr Constructor (RectangleF frame);
IntPtr Constructor (CGRect frame);
}

[BaseType (typeof (NSObject))]
Expand All @@ -160,16 +158,16 @@ interface iCarousel {
interface iCarouselDataSource {

[Export ("numberOfItemsInCarousel:")] [Abstract]
uint NumberOfItems (iCarousel carousel);
nuint NumberOfItems (iCarousel carousel);

[Export ("carousel:viewForItemAtIndex:reusingView:")] [Abstract]
UIView ViewForItem (iCarousel carousel, uint index, UIView reusingView);
UIView ViewForItem (iCarousel carousel, nuint index, UIView reusingView);

[Export ("numberOfPlaceholdersInCarousel:")]
uint NumberOfPlaceholders (iCarousel carousel);
nuint NumberOfPlaceholders (iCarousel carousel);

[Export ("carousel:placeholderViewAtIndex:reusingView:")]
UIView PlaceholderViewAtIndex (iCarousel carousel, uint index, UIView reusingView);
UIView PlaceholderViewAtIndex (iCarousel carousel, nuint index, UIView reusingView);
}

[BaseType (typeof (NSObject))]
Expand Down Expand Up @@ -202,19 +200,18 @@ interface iCarouselDelegate {
void DidEndDecelerating (iCarousel carousel);

[Export ("carousel:shouldSelectItemAtIndex:")]
bool ShouldSelectItem (iCarousel carousel, int index);
bool ShouldSelectItem (iCarousel carousel, nint index);

[Export ("carousel:didSelectItemAtIndex:")]
void DidSelectItem (iCarousel carousel, int index);
void DidSelectItem (iCarousel carousel, nint index);

[Export ("carouselItemWidth:")]
float ItemWidth (iCarousel carousel);
nfloat ItemWidth (iCarousel carousel);

[Export ("carousel:itemTransformForOffset:baseTransform:")]
CATransform3D ItemTransform (iCarousel carousel, float offset, CATransform3D baseTransform);
CATransform3D ItemTransform (iCarousel carousel, nfloat offset, CATransform3D baseTransform);

[Export ("carousel:valueForOption:withDefault:")]
float ValueForOption (iCarousel carousel, iCarouselOption option, float aValue);
nfloat ValueForOption (iCarousel carousel, iCarouselOption option, nfloat aValue);
}
}

}
17 changes: 17 additions & 0 deletions iCarousel/binding/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Author:
// Nicolas VERINAUD <n.verinaud@gmail.com>
//
// Copyright (c) 2015 Nicolas Verinaud. All Rights Reserved.
//
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("iCarouselSDK")]
[assembly: AssemblyDescription("Mono port of iCarousel library https://github.com/nicklockwood/iCarousel")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyVersion("1.8.1")]
3 changes: 1 addition & 2 deletions iCarousel/binding/StructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ public enum iCarouselOption
FadeMax,
FadeRange
}
}

}
11 changes: 8 additions & 3 deletions iCarousel/binding/iCarouselSDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7FCFB195-20C9-41D2-99FC-B6CA70BF256D}</ProjectGuid>
<ProjectTypeGuids>{F5B4F3BC-B597-4E2B-B552-EF5D8A32436F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{8FFB629D-F513-41CE-95D2-7ECE97B6EEEC};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>iCarouselSDK</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>iCarouselSDK</AssemblyName>
<ReleaseVersion>1.8.1</ReleaseVersion>
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
Expand All @@ -34,7 +37,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
Expand All @@ -46,12 +49,14 @@
<ObjcBindingCoreSource Include="StructsAndEnums.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Xamarin.ObjcBinding.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" />
<ItemGroup>
<ObjcBindingNativeLibrary Include="libiCarousel.a" />
</ItemGroup>
<ItemGroup>
<Compile Include="libiCarousel.linkwith.cs">
<DependentUpon>libiCarousel.a</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
</Project>
20 changes: 20 additions & 0 deletions iCarousel/binding/iCarouselSDK.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iCarouselSDK", "iCarouselSDK.csproj", "{7FCFB195-20C9-41D2-99FC-B6CA70BF256D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7FCFB195-20C9-41D2-99FC-B6CA70BF256D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FCFB195-20C9-41D2-99FC-B6CA70BF256D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FCFB195-20C9-41D2-99FC-B6CA70BF256D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FCFB195-20C9-41D2-99FC-B6CA70BF256D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 1.8.1
EndGlobalSection
EndGlobal
Binary file modified iCarousel/binding/libiCarousel.a
Binary file not shown.
4 changes: 2 additions & 2 deletions iCarousel/binding/libiCarousel.linkwith.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using MonoTouch.ObjCRuntime;
using ObjCRuntime;

[assembly: LinkWith ("libiCarousel.a", LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator, Frameworks = "QuartzCore CoreGraphics", ForceLoad = true)]
[assembly: LinkWith ("libiCarousel.a", LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Arm64 | LinkTarget.Simulator, Frameworks = "QuartzCore CoreGraphics", ForceLoad = true)]
Loading

0 comments on commit 9d2989e

Please sign in to comment.