Skip to content

Instantly share code, notes, and snippets.

@anujb
Created February 17, 2012 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anujb/a62179321620afc38c9f to your computer and use it in GitHub Desktop.
Save anujb/a62179321620afc38c9f to your computer and use it in GitHub Desktop.
kal binding
Error:
/Developer/MonoTouch/usr/bin/btouch kal.cs AssemblyInfo.cs Enums.cs --out=Kal.dll --link-with=libKalUniversal.a,libKalUniversal.a -x=extras.cs
kal.cs(23,31): error CS0527: Type `MonoTouch.UIKit.UITableViewDataSource' in interface list is not an interface
=================================================
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.CoreFoundation;
using MonoTouch.UIKit;
using MonoTouch.ObjCRuntime;
using MonoTouch.CoreGraphics;
using MonoTouch.MapKit;
using MonoTouch.CoreLocation;
using MonoTouch.CoreAnimation;
namespace Kal
{
[BaseType(typeof(NSObject))]
[Model]
interface KalDataSourceCallbacks {
[Export("loadedDataSource:")]
void LoadedDataSource(KalDataSource dataSource);
}
[BaseType(typeof(NSObject))]
[Model]
interface KalDataSource : UITableViewDataSource {
[Export("presentingDatesFrom:to:delegate:")]
void PresentingDates(NSDate from, NSDate to, KalDataSourceCallbacks callback);
[Export("markedDatesFrom:to:")]
void MarkedDates(NSDate from, NSDate to);
[Export("loadItemsFromDate:toDate:")]
void LoadItems(NSDate from, NSDate to);
[Export("removeAllItems")]
void RemoveAllItems();
}
[BaseType(typeof(NSObject))]
interface KalDate {
[Static, Export("dateForDay:month:year:")]
KalDate GetDate(uint day, uint month, uint year);
[Static, Export("dateFromNSDate:")]
KalDate GetDate(DateTime date);
[Export("initForDay:month:year:")]
IntPtr Constructor(uint day, uint month, uint year);
[Export("day")]
uint GetDay();
[Export("month")]
uint GetMonth();
[Export("year")]
uint GetYear();
[Export("NSDate")]
NSDate GetDate();
[Export("compare:")]
NSComparisonResult Compare(KalDate otherDate);
[Export("isToday")]
bool IsToday();
}
[BaseType(typeof(NSObject))]
[Model]
interface KalViewDelegate {
[Export("showPreviousMonth")]
void ShowPreviousMonth();
[Export("showFollowingMonth")]
void ShowFollowingMonth();
[Export("didSelectDate:")]
void DidSelectDate(KalDate date);
}
[BaseType(typeof(UIView))]
interface KalView {
[Export("delegate", ArgumentSemantic.Assign)]
NSObject WeakDelegate { get; set; }
[Wrap("WeakDelegate")]
KalViewDelegate Delegate { get; set; }
[Export("tableView")]
UITableView TableView { get; set; }
//[Export("shadowView")]
//UIImageView ShadowView { get; set; }
[Export("selectedDate")]
KalDate SelectedDate { get; }
//[Export("gridView")]
//KalGridView GridView { get; }
[Export("initWithFrame:delegate:logic:")]
IntPtr Constructor(RectangleF frame, KalViewDelegate del, KalLogic logic);
[Export("isSliding")]
bool IsSliding();
[Export("selectDate:")]
void SelectDate(KalDate date);
[Export("markTilesForDates:")]
void MarkTiles(NSArray dates);
[Export("redrawEntireMonth")]
void RedrawMonth();
[Export("slideDown")]
void SlideDown();
[Export("slideUp")]
void SlideUp();
[Export("jumpToSelectedMonth")]
void JumpToSelectedMonth();
}
[BaseType(typeof(UIView))]
interface KalTileView {
[Export("date")]
KalDate Date { get; set; }
[Export("highlighted")]
bool IsHighlighted { [Bind("isHighlighted")] get; set; }
[Export("selected")]
bool IsSelected { [Bind("isSelected")] get; set; }
[Export("isMarked")]
bool IsMarked { [Bind("isMarked")] get; set; }
[Export("type")]
KalTileType TileType { get; set; }
[Export("resetState")]
void ResetState();
[Export("isToday")]
bool IsToday();
[Export("belongsToAdjacentMonth")]
bool BelongsToAdjacentMonth();
}
[BaseType(typeof(UIView))]
interface KalMonthView {
[Export("numWeeks")]
uint NumberOfWeeks { get; set; }
[Export("initWithFrame:")]
IntPtr Constructor(RectangleF frame);
[Export("showDates:leadingAdjacentDates:trailingAdjacentDates")]
void ShowDates(NSArray main, NSArray leading, NSArray trailing);
[Export("firstTileOfMonth")]
KalTileView GetFirstTileOfMonth();
[Export("tileForDate:")]
KalTileView GetTile(KalDate date);
[Export("markTilesForDates:")]
void MarkTiles(NSArray dates);
}
[BaseType(typeof(UIView))]
interface KalGridView {
[Static, Export("tileSize")]
SizeF GetTileSize();
[Static, Export("setGridViewTileSize:")]
void SetTileSize(SizeF size);
}
[BaseType(typeof(UIViewController))]
interface KalViewController {
[Export("delegate", ArgumentSemantic.Assign)]
NSObject WeakDelegate { get; set; }
[Wrap("WeakDelegate")]
UITableViewDelegate Delegate { get; set; }
[Export("dataSource")]
KalDataSource DataSource { get; set; }
//[Export("calendarView", ArgumentSemantic.Assign)]
//KalView CalendarView { get; set; }
[Export("initWithSelectedDate:")]
IntPtr Constructor(NSDate selectedDate);
[Export("reloadData")]
void ReloadData();
[Export("showAndSelectDate")]
void ShowAndSelectDate(NSDate Date);
[Export("selectedDate")]
NSDate SelectedDate();
}
[BaseType(typeof(NSObject))]
interface KalLogic {
[Export("baseDate")]
NSDate BaseDate { get; set; }
[Export("fromDate")]
NSDate FromDate { get; }
[Export("daysInSelectedMonth")]
NSArray DaysInSelectedMonth { get; }
[Export("daysInFinalWeekOfPreviousMonth")]
NSArray DaysInFinalWeekOfPreviousMonth { get; }
[Export("daysInFirstWeekOfFollowingMonth")]
NSArray DaysInFirstWeekOfFollowingMonth { get; }
[Export("selectedMonthNameAndYear")]
string SelectedMonthNameAndYear { get; }
[Export("initForDate:")]
IntPtr Constructor(NSDate date);
[Export("retreatToPreviousMonth")]
void RetreatToPreviousMonth();
[Export("advanceToFollowingMonth")]
void AdvanceToFollowingMonth();
[Export("moveToMonthForDate:")]
void MoveToMonthForDate(NSDate date);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment