Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added GebePrinter binding

  • Loading branch information...
commit 2c51164ec9a6dac17c5448fa78e29a71ad9cc992 1 parent a91d384
Miguel de Icaza migueldeicaza authored
Showing with 246 additions and 0 deletions.
  1. +7 −0 GebePrinter/Makefile
  2. +59 −0 GebePrinter/defs.cs
  3. +180 −0 GebePrinter/gebe.cs
7 GebePrinter/Makefile
View
@@ -0,0 +1,7 @@
+all: gebe.dll
+
+gebe.dll: gebe.cs defs.cs
+ /Developer/MonoTouch/usr/bin/btouch gebe.cs defs.cs --out=gebe.dll
+
+clean:
+ -rm *dll
59 GebePrinter/defs.cs
View
@@ -0,0 +1,59 @@
+//
+// gebe.cs: bindings to the GeBe Printing Framework
+//
+// http://www.oem-printer.com/catalog/C15C9292167072600BIoMu5449C8/page2693.html
+//
+// Author:
+// Miguel de Icaza (miguel@xamarin.com)
+//
+// Copyright 2011 Xamarin Inc
+//
+using MonoTouch.Foundation;
+using MonoTouch.UIKit;
+
+namespace MonoTouch.GebePrinter {
+
+ public enum GBGraphicEncoding {
+ Unencoded,
+ TiffEncoding,
+ DeltaRowEncoding,
+ OptimalEncoding
+ }
+
+ public enum GBPrinterCategory {
+ Low, High
+ }
+
+ public enum GBPowerInput {
+ Minimal,
+ Low,
+ Standard,
+ Medium,
+ High
+ }
+
+ public enum GBPageSpacing {
+ GB2,
+ GB5,
+ GB10,
+ GB15,
+ GB20,
+ GB25,
+ GB30
+ }
+
+ public enum GBPaperDensity {
+ DEnity20,
+ DEnity25,
+ DEnity30,
+ DEnity35,
+ DEnity40,
+ DEnity45,
+ DEnity50
+ }
+
+ public enum GBStringEncoding {
+ Default, UTF8
+ }
+
+}
180 GebePrinter/gebe.cs
View
@@ -0,0 +1,180 @@
+//
+// gebe.cs: bindings to the GeBe Printing Framework
+//
+// http://www.oem-printer.com/catalog/C15C9292167072600BIoMu5449C8/page2693.html
+//
+// Author:
+// Miguel de Icaza (miguel@xamarin.com)
+//
+// Copyright 2011 Xamarin Inc
+//
+using System;
+using System.Drawing;
+using MonoTouch.Foundation;
+using MonoTouch.UIKit;
+using MonoTouch.ExternalAccessory;
+
+namespace MonoTouch.GebePrinter {
+ [BaseType (typeof (NSObject))]
+ interface GBPrinterManager {
+ [Export ("delegate"), NullAllowed]
+ NSObject WeakDelegate { get; set; }
+
+ [Export ("debugEnabled")]
+ bool DebugEnabled { get; set; }
+
+ [Export ("sharedManager")]
+ GBPrinterManager SharedManager { get; }
+
+ [Export ("selectPrinterWithSerialNumber:")]
+ bool SelectPrinter (string serialNumber);
+
+ [Export ("selectPrinter:")]
+ bool SelectPrinter (GBPrinterDevice printerDevice);
+
+ [Export ("currentPrinter")]
+ GBPrinterDevice CurrentPrinter { get; }
+
+ [Export ("arePrintersAvailable")]
+ bool ArePrintersAvailable { get; }
+
+ [Export ("connectedPrinters")]
+ GBPrinterDevice [] ConnectedPrinters { get; }
+
+ [Export ("isActivePrinter:")]
+ bool IsActivePrinter (GBPrinterDevice printer);
+
+ [Export ("disconnectCurrentPrinter")]
+ bool DisconnectCurrentPrinter ();
+
+ [Export ("autoReconnectPreviousPrinter")]
+ void AutoReconnectPreviousPrinter ();
+
+ [Export ("reconnectPreviousPrinter")]
+ bool ReconnectPreviousPrinter ();
+
+ [Export ("errorStringForMessage:")]
+ string ErrorStringForMessage (string msg);
+ }
+
+ [Model]
+ [BaseType (typeof (NSObject))]
+ interface GBPrinterManagerDelegate {
+ [Abstract]
+ [Export ("errorFromManager:")]
+ void Error (NSError error);
+
+ [Export ("printerMessageReceived:")]
+ void PrinterMessageReceived (string message);
+ }
+
+ [BaseType (typeof (NSObject))]
+ interface GBPrinterDevice {
+ [Export ("delegate")]
+ NSObject WeakDelegate { get; set; }
+
+ [Export ("printer")]
+ EAAccessory Printer { get; set; }
+
+ [Export ("connectionID")]
+ uint ConnectionID { get; }
+
+ [Export ("name")]
+ string Name { get; }
+
+ [Export ("manufacturer")]
+ string Manufacturer { get; }
+
+ [Export ("modelNumber")]
+ string ModelNumber { get; }
+
+ [Export ("serialNumber")]
+ string SerialNumber{ get; }
+
+ [Export ("firmwareRevision")]
+ string FirmwareRevision { get; }
+
+ [Export ("hardwareRevision")]
+ string HardwareRevision { get; }
+
+ [Export ("printerWidth")]
+ string PrinterWidth { get; }
+
+ [Export ("printHEXData:error:")]
+ void PrintHexDataerror (NSData inData, out NSError error);
+
+ [Export ("printHEXData:appendToFile:error:")]
+ void PrintHexDataappendToFileerror (NSData inData, NSUrl fileURL, out NSError error);
+
+ [Export ("printASCIIString:copies:encoding:error:")]
+ void PrintAsciiString (string aString, int inCopies, GBStringEncoding encoding, out NSError error);
+
+ [Export ("printASCIIString:appendToFile:encoding:error:")]
+ void PrintAsciiString (string aString, NSUrl appendTofileURL, GBStringEncoding encoding, out NSError error);
+
+ [Export ("printASCIIString:copies:withFont:ofFontWidth:ofFontHeight:encoding:error:")]
+ void PrintAsciiString (string aString, int inCopies, int withFont, uint fontWidth, uint fontHeight, GBStringEncoding encoding, out NSError error);
+
+ [Export ("printASCIIString:appendToFile:withFont:ofFontWidth:ofFontHeight:encoding:error:")]
+ void PrintAsciiString (string aString, NSUrl appendToFile, int withFont, int fontWidth, uint fontHeight, GBStringEncoding encoding, out NSError error);
+
+ [Export ("printUIView:copies:size:encoding:dithered:error:")]
+ void PrintUIView (UIView aView, int copies, SizeF aSize, GBGraphicEncoding encoding, bool dithered, out NSError error);
+
+ [Export ("printUIView:appendToFile:size:encoding:dithered:error:")]
+ void PrintUIView (UIView aView, NSUrl appendToFileURL, SizeF aSize, GBGraphicEncoding encoding, bool dithered, out NSError error);
+
+ [Export ("printImage:copies:encoding:dithered:error:")]
+ void PrintImage (UIImage source, int copies, GBGraphicEncoding encoding, bool dithered, out NSError error);
+
+ [Export ("printImage:appendToFile:encoding:dithered:error:")]
+ void PrintImage (UIImage source, NSUrl appendTofileURL, GBGraphicEncoding encoding, bool dithered, out NSError error);
+
+ [Export ("printPRNFile:error:")]
+ void PrintPrnFile (NSUrl fileURL, out NSError error);
+
+ [Export ("paperFeedLines:error:")]
+ void PaperFeedLines (int lines, out NSError error);
+
+ [Export ("paperFeedBackLines:error:")]
+ void PaperFeedBackLines (int lines, out NSError error);
+
+ [Export ("requestErrorStateWithError:")]
+ void RequestErrorState (out NSError error);
+
+ [Export ("setPaperDensity:")]
+ void SetPaperDensity (GBPaperDensity inDensity);
+
+ [Export ("setTopPageSpacing:")]
+ void SetTopPageSpacing (GBPageSpacing inSpacing);
+
+ [Export ("setBottomPageSpacing:")]
+ void SetBottomPageSpacing (GBPageSpacing inSpacing);
+
+ [Export ("setPrinterCategory:")]
+ void SetPrinterCategory (GBPrinterCategory inCategory);
+
+ [Export ("setPowerInput:")]
+ void SetPowerInput (GBPowerInput inInput);
+
+ [Export ("setUsePowerManagement:")]
+ void SetUsePowerManagement (bool inValue);
+
+ [Export ("setUsePaperDensity:")]
+ void SetUsePaperDensity (bool inValue);
+
+ [Export ("setUseTopPageSpacing:")]
+ void SetUseTopPageSpacing (bool inValue);
+
+ [Export ("setUseBottomPageSpacing:")]
+ void SetUseBottomPageSpacing (bool inValue);
+ }
+
+ [BaseType (typeof (NSObject))]
+ [Model]
+ interface GBPrinterDeviceDelegate {
+ [Abstract]
+ [Export ("printerFinishedPrinting")]
+ void PrinterFinishedPrinting ();
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.