Commit f8a78923 authored by Rusty Myers's avatar Rusty Myers

Updating code to use CFPrefs through TTsSmartPreferences and macoslib.

parent 67917cd3
#tag BuildAutomation Begin BuildStepList Linux Begin BuildProjectStep Build End End Begin BuildStepList Mac OS X Begin IDEScriptBuildStep SaveProject , AppliesTo = 0 DoCommand "SaveFile" End Begin BuildProjectStep Build End Begin IDEScriptBuildStep UnDock , AppliesTo = 0 Dim AppLocation as String = CurrentBuildAppName + ".app" AppLocation = AppLocation.ReplaceAll( " ", "\ " ) AppLocation = CurrentBuildLocation + "/" + AppLocation //@ More cocoa info.plist keys here: // https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html Call DoShellCommand("/usr/bin/defaults write " + AppLocation + "/Contents/Info ""LSBackgroundOnly"" -bool ""true""") End Begin IDEScriptBuildStep tarProject , AppliesTo = 0 /// Set Variables dim packageLoc, res, tarname as string tarname = "Idle-Logout.tar.bz2" packageLoc = "/Users/rzm102/Documents/_Programing/Git/IdleLogout/" print "Build Location: "+CurrentBuildLocation 'if CurrentBuildLocation="/Users/rzm102/Documents/_Programing/Git/IdleLogout/Builds\ \-\ psuIdleLogout.rbvcp/OS\ X\ 64\ bit" then ' '// Tar up folder 'res = DoShellCommand _ '("cd "+CurrentBuildLocation+"; /usr/bin/tar -c --exclude='.svn' -vjf "+tarname+" *") 'if res = "" then 'print "Results: "+res 'end '// Delete old tar '// print "rm "+packageLoc+tarname 'res = DoShellCommand _ '("rm "+packageLoc+tarname) ' '// Move tar to luggage folder '// print "mv "+CurrentBuildLocation+"/"+tarname+" "+packageLoc '// res = DoShellCommand _ '("mv "+CurrentBuildLocation+"/"+tarname+" "+packageLoc) ' '// Make package '// res = DoShellCommand _ '("cd "+packageLoc+"; make pkg; open "+packageLoc) '// print res 'else '// print "Not on rusty's mac. Skipping pkg creation" '//print CurrentBuildLocation//print "Build Location: "+CurrentBuildLocation 'end End End Begin BuildStepList Windows Begin BuildProjectStep Build End End #tag EndBuildAutomation
\ No newline at end of file
#tag BuildAutomation Begin BuildStepList Linux Begin BuildProjectStep Build End End Begin BuildStepList Mac OS X Begin IDEScriptBuildStep SaveProject , AppliesTo = 0 DoCommand "SaveFile" End Begin BuildProjectStep Build End Begin IDEScriptBuildStep UnDock , AppliesTo = 0 Dim AppLocation as String = CurrentBuildAppName + ".app" AppLocation = AppLocation.ReplaceAll( " ", "\ " ) AppLocation = CurrentBuildLocation + "/" + AppLocation //@ More cocoa info.plist keys here: // https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html Call DoShellCommand("/usr/bin/defaults write " + AppLocation + "/Contents/Info ""LSBackgroundOnly"" -bool ""true""") End Begin IDEScriptBuildStep tarProject , AppliesTo = 0 /// Set Variables dim packageLoc, res, tarname as string tarname = "Idle-Logout.tar.bz2" packageLoc = "/Users/rzm102/Documents/_Programing/Git/IdleLogout/" //print "Build Location: "+CurrentBuildLocation 'if CurrentBuildLocation="/Users/rzm102/Documents/_Programing/Git/IdleLogout/Builds\ \-\ psuIdleLogout.rbvcp/OS\ X\ 64\ bit" then ' '// Tar up folder 'res = DoShellCommand _ '("cd "+CurrentBuildLocation+"; /usr/bin/tar -c --exclude='.svn' -vjf "+tarname+" *") 'if res = "" then 'print "Results: "+res 'end '// Delete old tar '// print "rm "+packageLoc+tarname 'res = DoShellCommand _ '("rm "+packageLoc+tarname) ' '// Move tar to luggage folder '// print "mv "+CurrentBuildLocation+"/"+tarname+" "+packageLoc '// res = DoShellCommand _ '("mv "+CurrentBuildLocation+"/"+tarname+" "+packageLoc) ' '// Make package '// res = DoShellCommand _ '("cd "+packageLoc+"; make pkg; open "+packageLoc) '// print res 'else '// print "Not on rusty's mac. Skipping pkg creation" '//print CurrentBuildLocation//print "Build Location: "+CurrentBuildLocation 'end End End Begin BuildStepList Windows Begin BuildProjectStep Build End End #tag EndBuildAutomation
\ No newline at end of file
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#tag Module Protected Module ATSForFonts #tag Note, Name = About This is part of the open source "MacOSLib" Original sources are located here: https://github.com/macoslib/macoslib #tag EndNote #tag Constant, Name = kATSOptionFlagsComposeFontPostScriptName, Type = Double, Dynamic = False, Default = \"1", Scope = Public #tag EndConstant #tag Constant, Name = kATSOptionFlagsDefault, Type = Double, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Constant, Name = kATSOptionFlagsUseDataFork, Type = Double, Dynamic = False, Default = \"768", Scope = Public #tag EndConstant #tag Constant, Name = kATSOptionFlagsUseDataForkAsResourceFork, Type = Double, Dynamic = False, Default = \"256", Scope = Public #tag EndConstant #tag Constant, Name = kATSOptionFlagsUseResourceFork, Type = Double, Dynamic = False, Default = \"512", Scope = Public #tag EndConstant #tag Constant, Name = kInvalidFont, Type = Double, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Constant, Name = kInvalidFontFamily, Type = Double, Dynamic = False, Default = \"&hffffffff", Scope = Public #tag EndConstant #tag Constant, Name = kInvalidGeneration, Type = Double, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Structure, Name = ATSFontMetrics, Flags = &h0 version as UInt32 ascent as Single descent as Single leading as Single avgAdvanceWidth as Single maxAdvanceWidth as Single minLeftSideBearing as Single minRightSideBearing as Single stemWidth as Single stemHeight as Single capHeight as Single xHeight as Single italicAngle as Single underlinePosition as Single underlineThickness as Single #tag EndStructure #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
\ No newline at end of file
#tag Class Class ATSFont #tag Method, Flags = &h0 Function File() As FolderItem #if targetMacOS // Added a check the availability of ATSFontGetFileSpecification because // Apple's docs say this is all deprecated in 10.6 in favor of Core Text. static functionsNeedCheck as boolean = true static newFunctionIsAvailable as boolean static oldFunctionIsAvailable as boolean if functionsNeedCheck then newFunctionIsAvailable = System.IsFunctionAvailable( "ATSFontGetFileReference", CarbonLib ) oldFunctionIsAvailable = System.IsFunctionAvailable( "ATSFontGetFileSpecification", CarbonLib ) functionsNeedCheck = false end if if newFunctionIsAvailable then soft declare function ATSFontGetFileReference lib CarbonLib (iFont as UInt32, fsRef as Ptr) as Integer dim ref as new FSRef 'dim theSpec as FSSpec dim OSError as Integer = ATSFontGetFileReference(me, ref) if OSError <> noErr then return nil end if return FileManager.GetFolderItemFromFSRef(ref) elseif oldFunctionIsAvailable then //ATSFontGetFileSpecification is deprecated in Mac OS 10.5. soft declare function ATSFontGetFileSpecification lib CarbonLib (iFont as UInt32, ByRef oFile as FSSpec) as Integer dim theSpec as FSSpec dim OSError as Integer = ATSFontGetFileSpecification(me, theSpec) if OSError <> noErr then return nil end if return FileManager.GetFolderItemFromFSSpec(theSpec) end if return nil #endif End Function #tag EndMethod #tag Method, Flags = &h0 Shared Function FindFromName(name as String) As ATSFont #if targetMacOS soft declare function ATSFontFindFromName lib CarbonLib (iName as CFStringRef, iOptions as UInt32) as UInt32 dim theRef as UInt32 = ATSFontFindFromName(name, kATSOptionFlagsDefault) if theRef <> kInvalidFont then dim theFont as new ATSFont theFont.ATSFontRef = theRef return theFont else return nil end if #endif End Function #tag EndMethod #tag Method, Flags = &h0 Shared Function FindFromPostScriptName(name as String) As ATSFont #if targetMacOS soft declare function ATSFontFindFromPostScriptName lib CarbonLib (iName as CFStringRef, iOptions as UInt32) as UInt32 dim theRef as UInt32 = ATSFontFindFromPostScriptName(name, kATSOptionFlagsDefault) if theRef <> kInvalidFont then dim theFont as new ATSFont theFont.ATSFontRef = theRef return theFont else return nil end if #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function HorizontalMetrics() As ATSFontMetrics #if targetMacOS soft declare function ATSFontGetHorizontalMetrics lib CarbonLib (iFont as UInt32, iOptions as UInt32, ByRef oMetrics as ATSFontMetrics) as Integer dim metrics as ATSFontMetrics dim OSError as Integer = ATSFontGetHorizontalMetrics(me, kATSOptionFlagsDefault, metrics) return metrics // Keep the compiler from complaining #pragma unused OSError #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function Operator_Convert() As UInt32 return me.ATSFontRef End Function #tag EndMethod #tag Method, Flags = &h0 Function VerticalMetrics() As ATSFontMetrics #if targetMacOS soft declare function ATSFontGetVerticalMetrics lib CarbonLib (iFont as UInt32, iOptions as UInt32, ByRef oMetrics as ATSFontMetrics) as Integer dim metrics as ATSFontMetrics dim OSError as Integer = ATSFontGetVerticalMetrics(me, kATSOptionFlagsDefault, metrics) return metrics // Keep the compiler from complaining #pragma unused OSError #endif End Function #tag EndMethod #tag Property, Flags = &h21 Private ATSFontRef As UInt32 #tag EndProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get if me.ATSFontRef = kInvalidFont then return "" end if #if targetMacOS soft declare function ATSFontGetName lib CarbonLib (iFamily as UInt32, iOptions as UInt32, ByRef oName as CFStringRef) as Integer dim theName as CFStringRef dim OSError as Integer = ATSFontGetName(me, kATSOptionFlagsDefault, theName) if OSError = noErr then return theName else return "" end if #endif End Get #tag EndGetter Name As String #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get if me.ATSFontRef = kInvalidFont then return "" end if #if targetMacOS soft declare function ATSFontGetPostScriptName lib CarbonLib (iFamily as UInt32, iOptions as UInt32, ByRef oName as CFStringRef) as Integer dim theName as CFStringRef dim OSError as Integer = ATSFontGetPostScriptName(me, kATSOptionFlagsDefault, theName) if OSError = noErr then return theName else return "" end if #endif End Get #tag EndGetter PostScriptName As String #tag EndComputedProperty #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="PostScriptName" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class ATSFontFamily #tag Method, Flags = &h0 Shared Function FindFromName(name as String) As ATSFontFamily #if targetMacOS soft declare function ATSFontFamilyFindFromName lib CarbonLib (iName as CFStringRef, iOptions as UInt32) as UInt32 dim theRef as UInt32 = ATSFontFamilyFindFromName(name, kATSOptionFlagsDefault) if theRef <> kInvalidFontFamily then dim theFontFamily as new ATSFontFamily theFontFamily.ATSFontFamilyRef = theRef return theFontFamily else return nil end if #endif End Function #tag EndMethod #tag Method, Flags = &h21 Private Function Operator_Convert() As UInt32 return me.ATSFontFamilyRef End Function #tag EndMethod #tag Property, Flags = &h21 Private ATSFontFamilyRef As UInt32 #tag EndProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get if me.ATSFontFamilyRef = kInvalidFontFamily then return "" end if #if targetMacOS soft declare function ATSFontFamilyGetName lib CarbonLib (iFamily as UInt32, iOptions as UInt32, ByRef oName as CFStringRef) as Integer dim theName as CFStringRef dim OSError as Integer = ATSFontFamilyGetName(me.ATSFontFamilyRef, kATSOptionFlagsDefault, theName) if OSError = noErr then return theName else return "" end if #endif End Get #tag EndGetter Name As String #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS soft declare function ATSFontFamilyGetQuickDrawName lib CarbonLib (iFamily as UInt32, oName as Ptr) as Integer dim qdName as new MemoryBlock(256) dim OSError as Integer = ATSFontFamilyGetQuickDrawName(me.ATSFontFamilyRef, qdName) return DefineEncoding(qdName.PString(0), Encodings.MacRoman) // Keep the compiler from complaining #pragma unused OSError #endif End Get #tag EndGetter QuickDrawName As String #tag EndComputedProperty #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="QuickDrawName" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Module Protected Module AppearanceManager #tag Method, Flags = &h1 Protected Function ThemeColor(ID as integer) As Color #if targetMacOS then Const depth = 32 soft declare Function GetThemeBrushAsColor lib CarbonLib (inColor as Integer, inDepth as Short, inColorDev as Boolean, outColor as Ptr) as Integer dim colorPtr as New MemoryBlock(6) dim OSErr as Integer = GetThemeBrushAsColor(ID, depth, true, colorPtr) If OSErr = 0 then Return RGB(colorPtr.UShort(0)\255, colorPtr.UShort(2)\255, colorPtr.UShort(4)\255) else ' return RED in case of an error return &cFF0000 end #else #pragma unused ID #endif End Function #tag EndMethod #tag Note, Name = About This is part of the open source "MacOSLib" Original sources are located here: https://github.com/macoslib/macoslib #tag EndNote #tag Enum, Name = ThemeBrushConstants, Type = Integer, Flags = &h0 kDialogBackgroundActive = 1 kDialogBackgroundInactive = 2 kAlertBackgroundActive = 3 kAlertBackgroundInactive = 4 kModelessDialogBackgroundActive = 5 kModelessDialogBackgroundInactive = 6 kUtilityWindowBackgroundActive = 7 kUtilityWindowBackgroundInactive = 8 kListViewSortColumnBackground = 9 kListViewBackground = 10 kIconLabelBackground = 11 kListViewSeparator = 12 kChasingArrows = 13 kDragHilite = 14 kDocumentWindowBackground = 15 kFinderWindowBackground = 16 kScrollBarDelimiterActive = 17 kScrollBarDelimiterInactive = 18 kFocusHighlight = 19 kPopupArrowActive = 20 kPopupArrowPressed = 21 kPopupArrowInactive = 22 kAppleGuideCoachmark = 23 kIconLabelBackgroundSelected = 24 kStaticAreaFill = 25 kActiveAreaFill = 26 kButtonFrameActive = 27 kButtonFrameInactive = 28 kButtonFaceActive = 29 kButtonFaceInactive = 30 kButtonFacePressed = 31 kButtonActiveDarkShadow = 32 kButtonActiveDarkHighlight = 33 kButtonActiveLightShadow = 34 kButtonActiveLightHighlight = 35 kButtonInactiveDarkShadow = 36 kButtonInactiveDarkHighlight = 37 kButtonInactiveLightShadow = 38 kButtonInactiveLightHighlight = 39 kButtonPressedDarkShadow = 40 kButtonPressedDarkHighlight = 41 kButtonPressedLightShadow = 42 kButtonPressedLightHighlight = 43 kBevelActiveLight = 44 kBevelActiveDark = 45 kBevelInactiveLight = 46 kBevelInactiveDark = 47 kNotificationWindowBackground = 48 kMovableModalBackground = 49 kSheetBackgroundOpaque = 50 kDrawerBackground = 51 kToolbarBackground = 52 kSheetBackgroundTransparent = 53 kMenuBackground = 54 kMenuBackgroundSelected = 55 kListViewOddRowBackground = 56 kListViewEvenRowBackground = 57 kListViewColumnDivider = 58 kSheetBackground = 50 kBlack = -1 kWhite = -2 kPrimaryHighlightColor = -3 kSecondaryHighlightColor = -4 kAlternatePrimaryHighlightColor = -5 #tag EndEnum #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
\ No newline at end of file
#tag Module Protected Module AppleEvents #tag Method, Flags = &h0 Function PrintDesc(extends ae as AppleEvent, getReply as boolean = false) As string #if TargetMacOS Soft declare function AEPrintDescToHandle lib CarbonLib (theEvent as integer, hdl as Ptr) as integer Soft declare sub DisposeHandle lib CarbonLib (hdl as ptr) dim myHandle as MemoryBlock dim err as integer dim mb as MemoryBlock dim result as string //Will hold the pointer to the data myHandle = New MemoryBlock( 4 ) if getReply then err = AEPrintDescToHandle( ae.ReplyPtr, myHandle ) else err = AEPrintDescToHandle( ae.Ptr, myHandle ) end if if err<>0 then return "" //Check for error //Get the data mb = myHandle.Ptr( 0 ) mb = mb.Ptr( 0 ) result = mb.CString( 0 ) DisposeHandle myHandle.Ptr(0) //We must free the handle to get memory back return result #else #pragma unused ae #pragma unused getReply #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function RawData(extends ae as AppleEvent, param as string, byref type as string, inReply as boolean = false) As MemoryBlock //Get a binary data param in the reply AppleEvent #if TargetMacOS declare function AEGetParamPtr lib CarbonLib (AEPtr as integer, AEKeyword as OSType, inType as OSType, byref outType as OSType, data as Ptr, maxSize as integer, byref actSize as integer) as short dim data as MemoryBlock dim err as integer dim oType as OSType dim aSize as integer dim paramSize as integer dim paramType as string dim p as integer ae.SizeAndTypeOfParam( param, true, paramSize, paramType ) if paramType="" then //No parameter with this key return nil end if data = new MemoryBlock( paramSize ) //Get the data if inReply then p = ae.ReplyPtr else p = ae.Ptr end if err = AEGetParamPtr( p, param, type, oType, data, data.Size, aSize ) if err<>0 then return nil else //Update the actual type and return the data type = oType return data.StringValue( 0, aSize ) end if #else #pragma unused ae #pragma unused param #pragma unused type #pragma unused inReply #endif End Function #tag EndMethod #tag Method, Flags = &h0 Sub RawData(extends ae as AppleEvent, param as string, type as string, inReply as boolean = false, assigns data as MemoryBlock) //Add some binary data as a reply AppleEvent parameter #if TargetMacOS declare function AEPutParamPtr lib CarbonLib (AEPtr as integer, AEKey as OSType, dType as OSType, data as Ptr, dsize as integer) as short dim err as integer dim p as integer if inReply then p = ae.ReplyPtr else p = ae.Ptr end if err = AEPutParamPtr( p, param, type, data, data.size ) #else #pragma unused ae #pragma unused param #pragma unused type #pragma unused inReply #pragma unused data #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SizeAndTypeOfParam(extends ae as AppleEvent, param as string, inReply as boolean, byref size as integer, byref type as string) //Get the size and type of one parameter. Set inReply to true if you want to access the reply AppleEvent #if TargetMacOS declare function AESizeOfParam lib CarbonLib (evnt as integer, AEKeyword as OSType, byref oDesc as OSType, byref oSize as integer) as short dim err as integer dim oDesc as OSType dim oSize as integer if inReply then err = AESizeOfParam( ae.replyptr, param, oDesc, oSize ) else err = AESizeOfParam( ae.ptr, param, oDesc, oSize ) end if if err<>0 then //We get a -1701 error if there is no parameter with this keyword type = "" size = 0 else type = oDesc size = oSize end if #else #pragma unused ae #pragma unused param #pragma unused inReply #pragma unused size #pragma unused type #endif End Sub #tag EndMethod #tag Note, Name = About This is part of the open source "MacOSLib" Original sources are located here: https://github.com/macoslib/macoslib #tag EndNote #tag Constant, Name = typeFSRef, Type = String, Dynamic = False, Default = \"fsrf", Scope = Public #tag EndConstant #tag Constant, Name = typeStyledUnicodeText, Type = String, Dynamic = False, Default = \"sutx", Scope = Public #tag EndConstant #tag Structure, Name = AEDesc, Flags = &h0 descriptorType as OSType dataHandle as Ptr #tag EndStructure #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
\ No newline at end of file
#tag Module Protected Module AttachedPropertiesModule #tag Method, Flags = &h0 Function AttachedProperty(extends o as Object, key as String) As Variant //Get the stored value dim dict as Dictionary dict = FindDictionaryForObject( o, false ) if dict=nil OR NOT dict.HasKey( key ) then dim e as new KeyNotFoundException e.Message = "This AttachedProperty does not exist" raise e end if return dict.Value( key ) End Function #tag EndMethod #tag Method, Flags = &h0 Sub AttachedProperty(extends o as Object, key as string, assigns value as Variant) //Attach a key/value pair to the given object dim dict as Dictionary dict = FindDictionaryForObject( o, true ) dict.Value( key ) = value End Sub #tag EndMethod #tag Method, Flags = &h0 Function AttachedPropertyGetAll(extends o as Object, createIfNecessary as Boolean = false) As Dictionary //Get all the stored value as a Dictionary return FindDictionaryForObject( o, createIfNecessary ) End Function #tag EndMethod #tag Method, Flags = &h0 Function AttachedPropertyLookup(extends o as Object, key as String, defaultValue as variant, storeDefault as Boolean = false) As Variant //Get the stored value or default value (which is stored if storeDefault is true) dim dict as Dictionary dict = FindDictionaryForObject( o, storeDefault ) if dict=nil then return defaultValue end if if NOT dict.HasKey( key ) then if storeDefault then dict.Value( key ) = defaultValue end if return defaultValue else return dict.Value( key ) end if End Function #tag EndMethod #tag Method, Flags = &h0 Sub AttachedPropertyRemove(extends o as Object, key as String, raiseExceptionOnFailure as boolean = false) //Remove an AttachedProperty dim dict as Dictionary dict = FindDictionaryForObject( o, false ) if dict=nil OR NOT dict.HasKey( key ) then if raiseExceptionOnFailure then dim e as new KeyNotFoundException e.Message = "This AttachedProperty does not exist" raise e else return end if end if dict.Remove( key ) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub CleanUp() //Remove all keys/values which correspond to a destroyed object if Storage=nil then init return end if for i as integer = Storage.Count - 1 downto 0 if WeakRef( Storage.Key( i )).Value = nil then Storage.Remove Storage.Key( i ) end if next End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function FindDictionaryForNSObject(obj as NSObject, createIfNecessary as boolean = false) As Dictionary //Find an existing key CleanUp //Create Storage if necessary and remove AttachedProperties for destroyed objects for i as integer = 0 to NSStorage.Count - 1 if NSStorage.Key( i )=obj.id then return NSStorage.Value( NSStorage.Key( i )) end if next if createIfNecessary then dim dict as new Dictionary NSStorage.Value( obj.id ) = dict return dict else return nil end if End Function #tag EndMethod #tag Method, Flags = &h21 Private Function FindDictionaryForObject(obj as Object, createIfNecessary as boolean = false) As Dictionary //Find an existing key CleanUp //Create Storage if necessary and remove AttachedProperties for destroyed objects dim wr as WeakRef for i as integer = 0 to Storage.Count - 1 if WeakRef( Storage.Key( i )).Value=obj then return Storage.Value( Storage.Key( i )) exit end if next if createIfNecessary then dim dict as new Dictionary wr = new WeakRef( obj ) Storage.Value( wr ) = dict return dict else return nil end if End Function #tag EndMethod #tag Method, Flags = &h21 Private Sub Init() NSStorage = new Dictionary Storage = new Dictionary End Sub #tag EndMethod #tag Method, Flags = &h0 Function NSAttachedProperty(extends o as NSObject, key as String) As Variant //Get the stored value dim dict as Dictionary dict = FindDictionaryForNSObject( o, false ) if dict=nil OR NOT dict.HasKey( key ) then dim e as new KeyNotFoundException e.Message = "This AttachedProperty does not exist" raise e end if return dict.Value( key ) End Function #tag EndMethod #tag Method, Flags = &h0 Sub NSAttachedProperty(extends o as NSObject, key as string, assigns value as Variant) //Attach a key/value pair to the given object dim dict as Dictionary dict = FindDictionaryForNSObject( o, true ) dict.Value( key ) = value End Sub #tag EndMethod #tag Method, Flags = &h0 Function NSAttachedPropertyGetAll(extends o as NSObject, createIfNecessary as Boolean = false) As Dictionary //Get all the stored value as a Dictionary return FindDictionaryForNSObject( o, createIfNecessary ) End Function #tag EndMethod #tag Method, Flags = &h0 Function NSAttachedPropertyLookup(extends o as NSObject, key as String, defaultValue as variant, storeDefault as Boolean = false) As Variant //Get the stored value or default value (which is stored if storeDefault is true) dim dict as Dictionary dict = FindDictionaryForNSObject( o, storeDefault ) if dict=nil then return defaultValue end if if NOT dict.HasKey( key ) then if storeDefault then dict.Value( key ) = defaultValue end if return defaultValue else return dict.Value( key ) end if End Function #tag EndMethod #tag Method, Flags = &h0 Sub NSAttachedPropertyRemove(extends o as NSObject, key as String, raiseExceptionOnFailure as boolean = false) //Remove an AttachedProperty dim dict as Dictionary dict = FindDictionaryForNSObject( o, false ) if dict=nil OR NOT dict.HasKey( key ) then if raiseExceptionOnFailure then dim e as new KeyNotFoundException e.Message = "This AttachedProperty does not exist" raise e else return end if end if dict.Remove( key ) End Sub #tag EndMethod #tag Note, Name = Read Me AttachedProperties allow to attach named values to any object and are deleted when the object they are attached to is destroyed. Each AttachProperty requires a key (as string) to be got or set. Example: dim pict as Picture pict.AttachedProperty( "myProperty" ) = myNewValue NOTE: an AttachedProperty is completely independant of a real Property even if you use the same property name. #tag EndNote #tag Property, Flags = &h21 Private NSStorage As Dictionary #tag EndProperty #tag Property, Flags = &h21 Private Storage As Dictionary #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
\ No newline at end of file
#tag Module Protected Module BSD #tag Method, Flags = &h1 Protected Function ErrorCode() As Integer #if TargetMacOS declare function libcErrorCode lib libc alias "__error" () as Ptr dim p as Ptr = libcErrorCode() if p = nil then //something bad has happened return 0 end if return p.Int32(0) #endif End Function #tag EndMethod #tag Method, Flags = &h1 Protected Function lstat(path as String) As stat 'The lstat() system call is like stat() except in the case where the named 'file is a symbolic link, in which case lstat() returns information about 'the link, while stat() returns information about the file the link refer- 'ences. #if TargetMacOS declare function lstat lib libc (path as CString, byref buf as stat) as integer dim buf as stat dim result as integer = lstat(path, buf ) if result <> -1 then return buf else raise new BSD.Error(ErrorCode) end if #else #pragma unused path #endif End Function #tag EndMethod #tag Method, Flags = &h1 Protected Function stat(path as String) As stat #if TargetMacOS declare function stat lib libc (path as CString, byref buf as stat) as integer dim buf as stat dim result as integer = stat(path, buf ) if result <> -1 then return buf else raise new BSD.Error(ErrorCode) end if #else #pragma unused path #endif End Function #tag EndMethod #tag Constant, Name = libc, Type = String, Dynamic = False, Default = \"/usr/lib/libc.dylib", Scope = Private #tag EndConstant #tag Structure, Name = stat, Flags = &h1 st_dev as UInt32 st_ino as UInt32 st_mode as UInt16 st_nlink as UInt16 st_uid as UInt32 st_gid as UInt32 st_rdev as UInt32 st_atimespec as timespec st_mtimespec as timespec st_ctimespec as timespec st_size as Int64 st_blocks as Int64 st_blksize as UInt32 st_flags as UInt32 st_gen as UInt32 st_lspare_DONOTUSE as Int32 st_qspare_DONOTUSE(1) as Int64 #tag EndStructure #tag Structure, Name = timespec, Flags = &h1 tv_sec as Int32 tv_nsec as Int32 #tag EndStructure #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
\ No newline at end of file
#tag Class Protected Class Error Inherits RuntimeException #tag Method, Flags = &h1000 Sub Constructor(errno as Integer) self.ErrorNumber = errno self.Message = ErrorMessage(errno) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Shared Function ErrorMessage(errorCode as Integer) As String #if TargetMacOS declare function strerror lib libc (errcode as Integer) as Ptr dim errorMsg as MemoryBlock = strerror(errorCode) if errorMsg <> nil then return DefineEncoding(errorMsg.CString(0), Encodings.SystemDefault) else //something bad has happened return "" end if #else #pragma unused errorCode #endif End Function #tag EndMethod #tag ViewBehavior #tag ViewProperty Name="ErrorNumber" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Message" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Reason" Group="Behavior" Type="Text" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Module Protected Module CFArrayExtension #tag Method, Flags = &h0 Function CFStringRefValue(extends theArray as CFArray, index as Integer) As CFStringRef #if TargetMacOS declare function CFGetTypeID lib CarbonLib (cf as Ptr) as UInt32 declare function CFStringGetTypeID lib CarbonLib () as UInt32 declare function CFRetain lib CarbonLib (cf as Ptr) as CFStringRef static StringTypeID as UInt32 = CFStringGetTypeID dim p as Ptr = theArray.Value(index) if CFGetTypeID(p) = StringTypeID then return CFRetain(p) else dim e as new TypeMismatchException e.Message = "Value &h" + Hex(Integer(p)) + " at index " + Str(index) + " has unexpected type " + CFCopyTypeIDDescription(CFGetTypeID(p)) + "." raise e end if #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function CFValue(extends theArray as CFArray, index as Integer) As CFType #if TargetMacOS return CFType.NewObject(theArray.Value(index), not CFType.hasOwnership, kCFPropertyListImmutable) #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function StringValues(extends theArray as CFArray) As String() //New 75% faster implementation. Still sluggish, though. #if TargetMacOS declare sub CFArrayGetValues lib CarbonLib ( theArray as Ptr, range as CFRange, values as Ptr ) declare function CFGetTypeID lib CarbonLib (cf as Ptr) as UInt32 declare function CFStringGetTypeID lib CarbonLib () as UInt32 declare function CFRetain lib CarbonLib (cf as Ptr) as CFStringRef static StringTypeID as UInt32 = CFStringGetTypeID dim p as Ptr dim mb as MemoryBlock dim L() as String mb = new MemoryBlock( SizeOfPointer * theArray.Count ) CFArrayGetValues theArray.Reference, CFRangeMake( 0, theArray.Count ), mb dim lastIndex as Integer = theArray.Count - 1 for index as Integer = 0 to lastIndex p = mb.bsPtrValueFromCArray( index ) if CFGetTypeID( p )=StringTypeID then L.Append CFRetain( p ) else dim e as new TypeMismatchException e.Message = "At least one value is not a string" raise e end if next return L #endif End Function #tag EndMethod #tag Note, Name = location This module sits outside the CoreFoundation module because a nested module cannot have global visibility, which should be necessary for the extension methods to work. #tag EndNote #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
#tag Module Protected Module CarbonDragManager #tag DelegateDeclaration, Flags = &h0 Delegate Function DragSendDataProc(type as Integer, refCon as Integer, dragItem as Ptr, dragRef as Ptr) As Integer #tag EndDelegateDeclaration #tag Method, Flags = &h0 Function NewDragRefWithPasteboard(pb as CarbonPasteboard) As DragRef #if TargetMacOS declare function NewDragWithPasteboard lib CarbonLib (pbRef as Integer, ByRef dragRef as Integer) as Integer dim r as Integer if NewDragWithPasteboard (pb.Handle, r) = 0 then if r <> 0 then return new DragRef (r) end end #else #pragma unused pb #endif End Function #tag EndMethod #tag Note, Name = About Provides a replacement for RB's DragItem, which doesn't work fully in Cocoa yet (see <feedback://showreport?report_id=21991>) This is part of the open source "MacOSLib" Original sources are located here: https://github.com/macoslib/macoslib #tag EndNote #tag Constant, Name = kDragActionAlias, Type = Double, Dynamic = False, Default = \"2", Scope = Public #tag EndConstant #tag Constant, Name = kDragActionAll, Type = Double, Dynamic = False, Default = \"&hFFFFFFFF", Scope = Public #tag EndConstant #tag Constant, Name = kDragActionCopy, Type = Double, Dynamic = False, Default = \"1", Scope = Public #tag EndConstant #tag Constant, Name = kDragActionDelete, Type = Double, Dynamic = False, Default = \"32", Scope = Public #tag EndConstant #tag Constant, Name = kDragActionGeneric, Type = Double, Dynamic = False, Default = \"4", Scope = Public #tag EndConstant #tag Constant, Name = kDragActionMove, Type = Double, Dynamic = False, Default = \"16", Scope = Public #tag EndConstant #tag Constant, Name = kDragActionNothing, Type = Double, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Constant, Name = kDragActionPrivate, Type = Double, Dynamic = False, Default = \"8", Scope = Public #tag EndConstant #tag Structure, Name = CGPoint, Flags = &h1 x as Single y as Single #tag EndStructure #tag Structure, Name = EventRecord, Flags = &h1 what as Short message as Integer when as Integer where as Point modifiers as Short #tag EndStructure #tag Structure, Name = Point, Flags = &h1 v as Short h as Short #tag EndStructure #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
\ No newline at end of file
#tag Class Protected Class DragRef #tag Method, Flags = &h0 Function AllowableActions() As Integer #if TargetMacOS declare function GetDragAllowableActions lib CarbonLib (ref as Integer, ByRef act as Integer) as Integer dim actions as Integer dim res as Integer = GetDragAllowableActions (mRef, actions) if res <> 0 then break else return actions end #endif End Function #tag EndMethod #tag Method, Flags = &h0 Sub Constructor(ref as Integer) mRef = ref End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Destructor() #if TargetMacOS declare sub DisposeDrag lib CarbonLib (ref as Integer) if mRef <> 0 then DisposeDrag (mRef) end if #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Function DropDestination() As FolderItem #if TargetMacOS declare function GetDropLocation lib CarbonLib (dragHdl as Integer, outDropLocationAEDesc as Ptr) as Integer declare function AECoerceDesc lib CarbonLib (aeDesc as Ptr, type as OSType, descr_in as Ptr) as Integer declare function AEGetDescData lib CarbonLib (aeDesc as Ptr, data as Ptr, maxSize as Integer) as Integer dim aeDesc as new MemoryBlock(8) dim res as Integer = GetDropLocation (mRef, aeDesc) if res = 0 then dim fsrDesc as new MemoryBlock (8) res = AECoerceDesc (aeDesc, "fsrf", fsrDesc) if res = 0 then dim ref as new MemoryBlock (80) res = AEGetDescData (fsrDesc, ref, ref.Size) if res = 0 then dim r2 as new FSRef (ref) return r2.FolderItem end if end if end if #endif End Function #tag EndMethod #tag Method, Flags = &h0 Sub SetAllowableActions(actions as Integer, isLocal as Boolean) #if TargetMacOS declare function SetDragAllowableActions lib CarbonLib (ref as Integer, act as Integer, loc as Boolean) as Integer dim res as Integer = SetDragAllowableActions (mRef, actions, isLocal) if res <> 0 then break end #else #pragma unused actions #pragma unused isLocal #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetCGImage(img as CGImage, ofsx as Integer, ofsy as Integer, flags as Integer) #if TargetMacOS declare function SetDragImageWithCGImage lib CarbonLib (ref as Integer, imgRef as Ptr, ByRef ofs as CGPoint, fl as Integer) as Integer dim pt as CGPoint pt.x = ofsx pt.y = ofsy dim res as Integer = SetDragImageWithCGImage (mRef, img.Reference, pt, flags) if res <> 0 then break end #else #pragma unused img #pragma unused ofsx #pragma unused ofsy #pragma unused flags #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetDragSendProc(proc as DragSendDataProc, ref as Integer) #if TargetMacOS declare function SetDragSendProc lib CarbonLib (dragRef as Integer, proc as Ptr, refCon as Integer) as Integer dim res as Integer = SetDragSendProc (mRef, proc, ref) if res <> 0 then break end #else #pragma unused proc #pragma unused ref #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Function TrackDrag(eventRec as EventRecord, rgn as Ptr) As Integer #if TargetMacOS declare function TrackDrag lib CarbonLib (dragRef as Integer, ByRef ev as EventRecord, theRegion as Ptr) as Integer return TrackDrag (mRef, eventRec, rgn) #else #pragma unused eventRec #pragma unused rgn #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function WasDroppedToTrash() As Boolean #if TargetMacOS declare function GetStandardDropLocation lib CarbonLib (theDrag as Integer, byref outDropLocation as Integer) as Integer ' determine standard location drag item was dropped to dim outDropLocation as Integer call GetStandardDropLocation(mRef, outDropLocation) return outDropLocation = kDragStandardDropLocationTrash #endif End Function #tag EndMethod #tag Note, Name = About This is part of the open source "MacOSLib" Original sources are located here: https://github.com/macoslib/macoslib #tag EndNote #tag Property, Flags = &h21 Private mRef As Integer #tag EndProperty #tag Constant, Name = kDragStandardDropLocationTrash, Type = Double, Dynamic = False, Default = \"\'trsh\'", Scope = Private #tag EndConstant #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#tag Class Class AVAsset Inherits NSObject #tag Method, Flags = &h0 Shared Function AssetWithURL(URL As NSURL) As AVAsset dim r as AVAsset #if TargetCocoa declare function assetWithURL lib Framework selector "assetWithURL:" ( id As Ptr, URL As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim urlPtr as Ptr if URL <> nil then urlPtr = URL.id end if dim p as Ptr = assetWithURL( ClassRef, urlPtr ) if p <> nil then r = new AVAsset( p, not NSObject.hasOwnership ) end if #else #pragma unused URL #endif return r End Function #tag EndMethod #tag Method, Flags = &h0 Function AvailableMetadataFormats() As NSString() dim arr() as NSString #if TargetMacOS declare function availableMetadataFormats lib Framework selector "availableMetadataFormats" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = availableMetadataFormats( self.id ) if p <> nil then dim nsa as new NSArray( p, not NSObject.hasOwnership ) dim cnt as integer = nsa.Count for i as integer = 1 to cnt dim nss as new NSString( nsa.Value( i - 1 ) ) arr.Append nss next i end if #endif return arr End Function #tag EndMethod #tag Method, Flags = &h21 Private Shared Function ClassRef() As Ptr static ref as Ptr = Cocoa.NSClassFromString("AVAsset") return ref End Function #tag EndMethod #tag Method, Flags = &h0 Function CommonMetadata() As AVMetadataItem() dim arr() as AVMetadataItem #if TargetMacOS declare function commonMetadata lib Framework selector "commonMetadata" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = commonMetadata( self.id ) dim nsarr as NSArray if p <> nil then nsarr = new NSArray( p, not NSObject.HasOwnership ) dim cnt as integer = nsarr.Count for i as integer = 1 to cnt dim avitem as new AVMetadataItem( nsarr.Value( i - 1 ) ) arr.Append avitem next i end if #endif return arr End Function #tag EndMethod #tag Method, Flags = &h0 Function MetadataForFormat(theFormat As NSString) As AVMetadataItem() dim arr() as AVMetadataItem #if TargetMacOS declare function metadataForFormat lib Framework selector "metadataForFormat:" ( obj_id As Ptr, theFormat As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr if theFormat <> nil then p = metadataForFormat( self.id, theFormat.id ) else p = metadataForFormat( self.id, nil ) end if dim nsarr as NSArray if p <> nil then nsarr = new NSArray( p, not NSObject.HasOwnership ) dim cnt as integer = nsarr.Count for i as integer = 1 to cnt dim avitem as new AVMetadataItem( nsarr.Value( i - 1 ) ) arr.Append avitem next i end if #else #pragma unused theFormat #endif return arr End Function #tag EndMethod #tag Method, Flags = &h0 Function Tracks() As AVAssetTrack() dim arr() as AVAssetTrack #if TargetMacOS declare function tracks lib Framework selector "tracks" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = tracks( self.id ) dim nsarr as NSArray if p <> nil then nsarr = new NSArray( p, not NSObject.HasOwnership ) dim cnt as integer = nsarr.Count for i as integer = 1 to cnt dim t as new AVAssetTrack( nsarr.Value( i - 1 ) ) arr.Append t next i end if #endif return arr End Function #tag EndMethod #tag ComputedProperty, Flags = &h0 #tag Getter Get dim r as AVMetadataItem #if TargetMacOS if me.RespondsToSelector( "creationDate" ) then declare function creationDate lib Framework selector "creationDate" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.8. dim p as Ptr = creationDate( self.id ) if p <> nil then r = new AVMetadataItem( p, not NSObject.hasOwnership ) end if end if #endif return r End Get #tag EndGetter CreationDate As AVMetadataItem #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetCocoa declare function duration lib Framework selector "duration" ( obj_id As Ptr ) As CMTime // Introduced in MacOS X 10.7. dim time as CMTime = duration( me.id ) return time #endif End Get #tag EndGetter Duration As CMTime #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get return Cocoa.CMTimeGetSeconds( Duration ) End Get #tag EndGetter DurationInSeconds As Double #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function hasProtectedContent lib Framework selector "hasProtectedContent" ( obj_id As Ptr ) As Boolean // Introduced in MacOS X 10.7. return hasProtectedContent( self.id ) #endif End Get #tag EndGetter HasProtectedContent As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function lyrics lib Framework selector "lyrics" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = lyrics( self.id ) dim nss as NSString if p <> nil then nss = new NSString( p, not NSObject.hasOwnership ) end if return nss #endif End Get #tag EndGetter Lyrics As NSString #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetCocoa declare function preferredRate lib Framework selector "preferredRate" ( obj_id As Ptr ) As Single // Introduced in MacOS X 10.7. return preferredRate( self.id ) #endif End Get #tag EndGetter PreferredRate As Single #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetCocoa declare function preferredVolume lib Framework selector "preferredVolume" ( obj_id As Ptr ) As Single // Introduced in MacOS X 10.7. return preferredVolume( self.id ) #endif End Get #tag EndGetter PreferredVolume As Single #tag EndComputedProperty #tag Constant, Name = Framework, Type = String, Dynamic = False, Default = \"AppKit.framework", Scope = Private #tag EndConstant #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="DurationInSeconds" Group="Behavior" Type="Double" #tag EndViewProperty #tag ViewProperty Name="HasProtectedContent" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="PreferredRate" Group="Behavior" Type="Single" #tag EndViewProperty #tag ViewProperty Name="PreferredVolume" Group="Behavior" Type="Single" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class AVAssetTrack Inherits NSObject #tag Method, Flags = &h0 Function AvailableMetadataFormats() As NSString() dim arr() as NSString #if TargetMacOS declare function availableMetadataFormats lib Framework selector "availableMetadataFormats" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = availableMetadataFormats( self.id ) if p <> nil then dim nsa as new NSArray( p, not NSObject.hasOwnership ) dim cnt as integer = nsa.Count for i as integer = 1 to cnt dim nss as new NSString( nsa.Value( i - 1 ) ) arr.Append nss next i end if #endif return arr End Function #tag EndMethod #tag Method, Flags = &h0 Function AvailableTrackAssociationTypes() As NSString() dim arr() as NSString #if TargetMacOS if me.RespondsToSelector( "availableTrackAssociationTypes" ) then declare function availableTrackAssociationTypes lib Framework selector "availableTrackAssociationTypes" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.9. dim p as Ptr = availableTrackAssociationTypes( self.id ) if p <> nil then dim nsa as new NSArray( p, not NSObject.hasOwnership ) dim cnt as integer = nsa.Count for i as integer = 1 to cnt dim nss as new NSString( nsa.Value( i - 1 ) ) arr.Append nss next i end if end if #endif return arr End Function #tag EndMethod #tag Method, Flags = &h0 Function CommonMetadata() As AVMetadataItem() dim arr() as AVMetadataItem #if TargetMacOS declare function commonMetadata lib Framework selector "commonMetadata" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = commonMetadata( self.id ) dim nsarr as NSArray if p <> nil then nsarr = new NSArray( p, not NSObject.HasOwnership ) dim cnt as integer = nsarr.Count for i as integer = 1 to cnt dim avitem as new AVMetadataItem( nsarr.Value( i - 1 ) ) arr.Append avitem next i end if #endif return arr End Function #tag EndMethod #tag Method, Flags = &h0 Function MetadataForFormat(theFormat As NSString) As AVMetadataItem() dim arr() as AVMetadataItem #if TargetMacOS declare function metadataForFormat lib Framework selector "metadataForFormat:" ( obj_id As Ptr, theFormat As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr if theFormat <> nil then p = metadataForFormat( self.id, theFormat.id ) else p = metadataForFormat( self.id, nil ) end if dim nsarr as NSArray if p <> nil then nsarr = new NSArray( p, not NSObject.HasOwnership ) dim cnt as integer = nsarr.Count for i as integer = 1 to cnt dim avitem as new AVMetadataItem( nsarr.Value( i - 1 ) ) arr.Append avitem next i end if #else #pragma unused theFormat #endif return arr End Function #tag EndMethod #tag ComputedProperty, Flags = &h0 #tag Getter Get dim r as AVAsset #if TargetMacOS declare function getAsset lib Framework selector "asset" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = getAsset( self.id ) if p <> nil then r = new AVAsset( p, not NSObject.hasOwnership ) end if #endif return r End Get #tag EndGetter Asset As AVAsset #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function enabled lib Framework selector "enabled" ( obj_id As Ptr ) As Boolean // Introduced in MacOS X 10.7. return enabled( self.id ) #endif End Get #tag EndGetter Enabled As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function extendedLanguageTag lib Framework selector "extendedLanguageTag" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = extendedLanguageTag( self.id ) dim nss as NSString if p <> nil then nss = new NSString( p, not NSObject.hasOwnership ) end if return nss #endif End Get #tag EndGetter ExtendedLanguageTag As NSString #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function languageCode lib Framework selector "languageCode" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = languageCode( self.id ) dim nss as NSString if p <> nil then nss = new NSString( p, not NSObject.hasOwnership ) end if return nss #endif End Get #tag EndGetter LanguageCode As NSString #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function mediaType lib Framework selector "mediaType" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = mediaType( self.id ) dim nss as NSString if p <> nil then nss = new NSString( p, not NSObject.hasOwnership ) end if return nss #endif End Get #tag EndGetter MediaType As NSString #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetCocoa declare function preferredVolume lib Framework selector "preferredVolume" ( obj_id As Ptr ) As Single // Introduced in MacOS X 10.7. return preferredVolume( self.id ) #endif End Get #tag EndGetter PreferredVolume As Single #tag EndComputedProperty #tag Constant, Name = Framework, Type = String, Dynamic = False, Default = \"AppKit.framework", Scope = Private #tag EndConstant #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Enabled" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="PreferredVolume" Group="Behavior" Type="Single" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class AVMetadataItem Inherits NSObject #tag Method, Flags = &h21 Private Shared Function ClassRef() As Ptr static ref as Ptr = Cocoa.NSClassFromString("AVMetadataItem") return ref End Function #tag EndMethod #tag ComputedProperty, Flags = &h0 #tag Getter Get dim r as string #if TargetMacOS declare function commonKey lib Framework selector "commonKey" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = commonKey( self.id ) if p <> nil then dim nss as new NSString( p ) r = nss end if #endif return r End Get #tag EndGetter CommonKey As String #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function dataValue lib Framework selector "dataValue" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = dataValue( self.id ) dim nsd as NSData if p <> nil then nsd = new NSData( p ) end if return nsd #endif End Get #tag EndGetter DataValue As NSData #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function dateValue lib Framework selector "dateValue" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = dateValue( self.id ) dim nsd as NSDate if p <> nil then nsd = new NSDate( p ) end if return nsd #endif End Get #tag EndGetter DateValue As NSDate #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function duration lib Framework selector "duration" ( obj_id As Ptr ) As CMTime // Introduced in MacOS X 10.7. dim time as CMTime = duration( self.id ) return time #endif End Get #tag EndGetter Duration As CMTime #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get return Cocoa.CMTimeGetSeconds( Duration ) End Get #tag EndGetter DurationInSeconds As Double #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function extraAttributes lib Framework selector "extraAttributes" ( obj_id As Ptr ) As Ptr //Introduced in MacOS X 10.7. dim p as Ptr = extraAttributes( self.id ) dim nsd as NSDictionary if p <> nil then nsd = new NSDictionary( p ) end if return nsd #endif End Get #tag EndGetter ExtraAttributes As NSDictionary #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function key lib Framework selector "key" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = key( self.id ) dim obj as NSObject if p <> nil then obj = Cocoa.NSObjectFromNSPtr( p, not NSObject.hasOwnership ) end if return obj #endif End Get #tag EndGetter Key As NSObject #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get dim r as string #if TargetMacOS declare function keySpace lib Framework selector "keySpace" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = keySpace( self.id ) if p <> nil then dim nss as new NSString( p ) r = nss end if #endif return r End Get #tag EndGetter KeySpace As String #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function locale lib Framework selector "locale" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = locale( self.id ) dim nsl as NSLocale if p <> nil then nsl = new NSLocale( p, not NSObject.hasOwnership ) end if return nsl #endif End Get #tag EndGetter Locale As NSLocale #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function numberValue lib Framework selector "numberValue" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = numberValue( self.id ) dim nsn as NSNumber if p <> nil then nsn = new NSNumber( p, not NSObject.hasOwnership ) end if return nsn #endif End Get #tag EndGetter NumberValue As NSNumber #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get // Attempts to extract the data as a Picture. If it can't, will return nil. // If it's there, the picture will be in the DataValue either as image data or // as a plist with a data key. This will attempt both. dim p as Picture #if TargetMacOS try // First sign of error, we abort dim nsd as NSData = self.DataValue if nsd <> nil then dim rawString as string = nsd.StringValue if rawString <> "" then p = Picture.FromData( rawString ) if p is nil then // Did that work? // No, so attempt to get it from a plist dim plist as CFDictionary = CFDictionary.CreateFromPListString( rawString ) if plist <> nil then dim key as new CFString( "data" ) if plist.HasKey( key ) then dim dataValue as string = plist.Value( key ).VariantValue if dataValue <> "" then p = Picture.FromData( dataValue ) end if end if end if end if end if end if catch end try #endif return p End Get #tag EndGetter PictureValue As Picture #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get dim r as string #if TargetMacOS declare function stringValue lib Framework selector "stringValue" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = stringValue( self.id ) if p <> nil then dim nss as new NSString( p ) r = nss end if #endif return r End Get #tag EndGetter StringValue As String #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function time lib Framework selector "time" ( obj_id As Ptr ) As CMTime // Introduced in MacOS X 10.7. return time( self.id ) #endif End Get #tag EndGetter Time As CMTime #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if TargetMacOS declare function value lib Framework selector "value" ( obj_id As Ptr ) As Ptr // Introduced in MacOS X 10.7. dim p as Ptr = value( self.id ) dim obj as NSObject if p <> nil then obj = Cocoa.NSObjectFromNSPtr( p, not NSObject.hasOwnership ) end if return obj #endif End Get #tag EndGetter Value As NSObject #tag EndComputedProperty #tag Constant, Name = Framework, Type = String, Dynamic = False, Default = \"AppKit.framework", Scope = Private #tag EndConstant #tag ViewBehavior #tag ViewProperty Name="CommonKey" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="DurationInSeconds" Group="Behavior" Type="Double" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="KeySpace" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="PictureValue" Group="Behavior" Type="Picture" #tag EndViewProperty #tag ViewProperty Name="StringValue" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Protected Class AutoreleaseTimer Inherits Timer #tag Event Sub Action() me.Pool = nil me.Pool = new NSAutoreleasePool End Sub #tag EndEvent #tag Method, Flags = &h0 Sub Constructor() me.Pool = new NSAutoreleasePool me.Mode = Timer.ModeMultiple me.Period = 200 End Sub #tag EndMethod #tag Note, Name = About From: http://www.declaresub.com/ideclare/Cocoa/index.html This is only needed for RB versions released before July 2009, as later versions auto-create an autorelease pool for every Thread. #tag EndNote #tag Property, Flags = &h21 Private Pool As NSAutoreleasePool #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" Type="Integer" EditorType="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Mode" Visible=true Group="Behavior" InitialValue="2" Type="Integer" EditorType="Enum" #tag EnumValues "0 - Off" "1 - Single" "2 - Multiple" #tag EndEnumValues #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" EditorType="String" #tag EndViewProperty #tag ViewProperty Name="Period" Visible=true Group="Behavior" InitialValue="1000" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" EditorType="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class CIContext Inherits NSObject #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class CIImage Inherits NSObject #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
This diff is collapsed.
#tag Class Class CocoaDelegate Inherits NSObject #tag Method, Flags = &h1 Protected Shared Function CocoaDelegateMap() As Dictionary // a static dictionary for delegates static d as new Dictionary return d End Function #tag EndMethod #tag Method, Flags = &h1000 Sub Constructor() // This is an abstract class to construct Cocoa delegates. It must not be directly instantiated, instead it must be subclassed. // A subclass MUST implement the events to provide a name for the Cocoa class and delegate methods #if TargetMacOS mClassName = raiseEvent DelegateClassName // get the Class name and store it const superClassName = "NSObject" dim protocols() as String = raiseEvent DelegateProtocols declare function alloc lib CocoaLib selector "alloc" (class_id as Ptr) as Ptr // allocate the instance dim delegate_id as Ptr = Initialize(alloc(RegisterClass(ClassName, superClassName, protocols))) super.Constructor(delegate_id, NSObject.hasOwnership) // construct the super object (NSObject) // store the instance in a static map CocoaDelegateMap.Value(delegate_id) = new WeakRef(self) #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Destructor() #if TargetMacOS // if self is still present in the static map, remove it if CocoaDelegateMap.HasKey(self.id) then CocoaDelegateMap.Remove(self.id) end if #endif End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function RegisterClass(className as String, superclassName as String, protocolNames() as String) As Ptr // Register a new Cocoa class #if TargetMacOS declare function objc_allocateClassPair lib CocoaLib (superclass as Ptr, name as CString, extraBytes as Integer) as Ptr declare sub objc_registerClassPair lib CocoaLib (cls as Ptr) declare function class_addMethod lib CocoaLib (cls as Ptr, name as Ptr, imp as Ptr, types as CString) as Boolean declare function objc_lookUpClass lib CocoaLib (name as CString) as Ptr declare function objc_getProtocol lib CocoaLib (name as CString) as Ptr declare function class_addProtocol lib CocoaLib (Cls as Ptr, protocol as Ptr) as Boolean // allocate the new class dim newClassId as Ptr = objc_allocateClassPair(Cocoa.NSClassFromString(superclassName), className, 0) if newClassId = nil then // perhaps the class already exists. Check for this. newClassId = objc_lookUpClass(className) if newClassId <> nil then return newClassId // OK the class already exists, just return it else return nil // some other error occurred, perhaps we should raise an exception for this end if end if // get methods for this class dim methodList() as Tuple = raiseEvent DelegateMethods // add the methods dim methodsAdded as Boolean = true for each item as Tuple in methodList methodsAdded = methodsAdded and class_addMethod(newClassId, Cocoa.NSSelectorFromString(item(0)), item(1), item(2)) next // add optional protocols for each protocolName as String in protocolNames if not class_addProtocol (newClassId, objc_getProtocol(protocolName)) then break end if next // if no errors adding the methods register the class if methodsAdded then // register the new class objc_registerClassPair newClassId return newClassId else return nil // some error occurred adding the methods. perhaps one or more methods already exists... end if #else #pragma unused className #pragma unused superClassName #endif End Function #tag EndMethod #tag Hook, Flags = &h0 Event DelegateClassName() As String #tag EndHook #tag Hook, Flags = &h0 Event DelegateMethods() As Tuple() #tag EndHook #tag Hook, Flags = &h0 Event DelegateProtocols() As String() #tag EndHook #tag ComputedProperty, Flags = &h0 #tag Getter Get return mClassName End Get #tag EndGetter ClassName As String #tag EndComputedProperty #tag Property, Flags = &h21 Private mClassName As String #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="ClassName" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class CocoaUnregisteredClassException Inherits RuntimeException #tag Method, Flags = &h0 Sub Constructor(className as String) me.ClassName = className End Sub #tag EndMethod #tag Property, Flags = &h0 ClassName As String #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="ClassName" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="ErrorNumber" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Message" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Reason" Group="Behavior" Type="Text" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class CocoaUnregisteredSelectorException Inherits RuntimeException #tag Method, Flags = &h0 Sub Constructor(selectorName as String) me.SelectorName = selectorName End Sub #tag EndMethod #tag Property, Flags = &h0 SelectorName As String #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="ErrorNumber" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Message" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Reason" Group="Behavior" Type="Text" #tag EndViewProperty #tag ViewProperty Name="SelectorName" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class FieldEditor Inherits NSObject #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class NSActionCell Inherits NSCell #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class NSAffineTransform Inherits NSObject #tag Method, Flags = &h0 Sub Append(t as NSAffineTransform) #if targetMacOS if t = nil then return end if declare sub appendTransform lib CocoaLib selector "appendTransform:" (obj_id as Ptr, aTransform as Ptr) appendTransform(self, t) #else #pragma Unused t #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Concat() #if targetMacOS //from NSAffineTransform Additions declare sub concat lib CocoaLib selector "concat" (obj_id as Ptr) concat(self) #endif End Sub #tag EndMethod #tag Method, Flags = &h1000 Sub Constructor() #if targetMacOS declare function transform lib CocoaLib selector "transform" (class_id as Ptr) as Ptr super.Constructor(transform(Cocoa.NSClassFromString("NSAffineTransform"))) #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Shared Function Create() As NSAffineTransform #if TargetMacOS declare function transform lib CocoaLib selector "transform" (obj_id as Ptr) as Ptr dim transformRef as Ptr = transform(Cocoa.NSClassFromString("NSAffineTransform")) if transformRef <> nil then return new NSAffineTransform(transformRef) end if #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function InitWithTransform(aTransform as NSAffineTransform) As NSAffineTransform #if TargetMacOS declare function initWithTransform lib CocoaLib selector "initWithTransform:" (obj_id as Ptr, aTransform as Ptr) as Ptr dim objectRef as Ptr if aTransform <> nil then objectRef = initWithTransform(self, aTransform) else objectRef = initWithTransform(self, nil) end if if objectRef <> nil then return new NSAffineTransform(objectRef) else return nil end if #else #pragma unused aTransform #endif End Function #tag EndMethod #tag Method, Flags = &h0 Sub Invert() #if targetMacOS declare sub invert lib CocoaLib selector "invert" (obj_id as Ptr) invert(self) #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Function Matrix() As TransformMatrix #if targetMacOS declare function transformStruct lib CocoaLib selector "transformStruct" (obj_id as Ptr) as TransformMatrix return transformStruct(self) #endif End Function #tag EndMethod #tag Method, Flags = &h0 Sub Matrix(assigns value as TransformMatrix) #if targetMacOS declare sub setTransformStruct lib CocoaLib selector "setTransformStruct:" (obj_id as Ptr, aTransformStruct as TransformMatrix) setTransformStruct(self, value) #else #pragma Unused value #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Prepend(t as NSAffineTransform) #if targetMacOS if t = nil then return end if declare sub prependTransform lib CocoaLib selector "prependTransform:" (obj_id as Ptr, aTransform as Ptr) prependTransform(self, t) #else #pragma Unused t #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub RotateByDegrees(angle as Double) #if targetMacOS declare sub rotateByDegrees lib CocoaLib selector "rotateByDegrees:" (obj_id as Ptr, angle as Single) rotateByDegrees(self, CType(angle, Single)) #else #pragma Unused angle #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub RotateByRadians(angle as Double) #if targetMacOS declare sub rotateByRadians lib CocoaLib selector "rotateByRadians:" (obj_id as Ptr, angle as Single) rotateByRadians(self, CType(angle, Single)) #else #pragma Unused angle #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Scale(scaleFactor as Double) #if targetMacOS declare sub scaleBy lib CocoaLib selector "scaleBy:" (obj_id as Ptr, scale as Single) scaleBy(self, CType(scaleFactor, Single)) #else #pragma Unused scaleFactor #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Scale(scaleX as Double, scaleY as Double) #if targetMacOS declare sub scaleXBy lib CocoaLib selector "scaleXBy:yBy:" (obj_id as Ptr, scaleX as Single, scaleY as Single) scaleXBy(self, CType(scaleX, Single), CType(scaleY, Single)) #else #pragma Unused scaleX #pragma Unused scaleY #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Set() #if targetMacOS //from NSAffineTransform Additions declare sub set lib CocoaLib selector "set" (obj_id as Ptr) set(self) #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Function Transform(point as Cocoa.NSPoint) As Cocoa.NSPoint #if targetMacOS declare function transformPoint lib CocoaLib selector "transformPoint:" (obj_id as Ptr, aPoint as Cocoa.NSPoint) as Cocoa.NSPoint return transformPoint(self, point) #else #pragma Unused point #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function Transform(size as Cocoa.NSSize) As Cocoa.NSSize #if targetMacOS declare function transformSize lib CocoaLib selector "transformSize:" (obj_id as Ptr, aSize as Cocoa.NSSize) as Cocoa.NSSize return transformSize(self, size) #else #pragma Unused size #endif End Function #tag EndMethod #tag Method, Flags = &h0 Function Transform(Bezier as NSBezierPath) As NSBezierPath #if TargetMacOS declare function transformBezierPath lib CocoaLib selector "transformBezierPath:" (obj_id as Ptr, Bezier as Ptr) as Ptr dim BezierRef as Ptr if Bezier <> nil then BezierRef = Bezier end if dim returnPathRef as Ptr = transformBezierPath(self, BezierRef) if returnPathRef <> nil then return new NSBezierPath(returnPathRef) end if #else #pragma Unused Bezier #endif End Function #tag EndMethod #tag Method, Flags = &h0 Sub Translate(deltaX as Single, deltaY as Single) #if targetMacOS declare sub translateXBy lib CocoaLib selector "translateXBy:yBy:" (obj_id as Ptr, deltaX as Single, deltaY as Single) translateXBy(self, deltaX, deltaY) #else #pragma Unused deltaX #pragma Unused deltaY #endif End Sub #tag EndMethod #tag Structure, Name = TransformMatrix, Flags = &h0 m11 as Single m12 as Single m21 as Single m22 as Single tX as Single tY as Single #tag EndStructure #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#tag Class Class NSAutoreleasePool Inherits NSObject #tag Method, Flags = &h0 Shared Function ClassRef() As Ptr return Cocoa.NSClassFromString("NSAutoreleasePool") End Function #tag EndMethod #tag Method, Flags = &h0 Sub Constructor() super.Constructor (ClassRef) End Sub #tag EndMethod #tag Note, Name = About From: http://www.declaresub.com/ideclare/Cocoa/index.html #tag EndNote #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class NSBezierPath Inherits NSObject #tag Note, Name = To be implemented #tag EndNote #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#tag Class Class NSButtonCell Inherits NSActionCell #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
#tag Class Class NSByteCountFormatter Inherits NSFormatter #tag Method, Flags = &h0 Shared Function ByteCount(byteCount as Int64) As NSString #if targetMacOS declare function stringFromByteCount lib CocoaLib selector "stringFromByteCount:countStyle:" (obj_id as Ptr, byteCount as UInt64) as CFStringRef return stringFromByteCount(ClassRef, byteCount) #endif End Function #tag EndMethod #tag Method, Flags = &h0 Shared Function ByteCountWithStyle(byteCount as Int64, countStyle as CountStyle) As NSString #if targetMacOS declare function stringFromByteCount lib CocoaLib selector "stringFromByteCount:countStyle:" (obj_id as Ptr, byteCount as UInt64, countStyle as CountStyle) as CFStringRef return stringFromByteCount(ClassRef, byteCount, countStyle) #endif End Function #tag EndMethod #tag Method, Flags = &h21 Private Shared Function ClassRef() As Ptr static ref as Ptr = NSClassFromString("NSByteCountFormatter") return ref End Function #tag EndMethod #tag Method, Flags = &h1000 Sub Constructor() #if targetMacOS super.Constructor(Initialize(Allocate(Cocoa.NSClassFromString("NSByteCountFormatter")))) #endif End Sub #tag EndMethod #tag Method, Flags = &h0 Function StringValue(byteCount as Int64) As NSString #if targetMacOS declare function stringFromByteCount lib CocoaLib selector "stringFromByteCount:" (obj_id as Ptr, byteCount as Int64) as CFStringRef return stringFromByteCount(self, byteCount) #endif End Function #tag EndMethod #tag Note, Name = Availability NSByteCountFormatter was added in 10.8. The code should run in earlier versions, but do nothing. #tag EndNote #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function allowedUnits lib CocoaLib selector "allowedUnits" (obj_id as Ptr) as Integer return allowedUnits(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setAllowedUnits lib CocoaLib selector "setAllowedUnits:" (obj_id as Ptr, value as Integer) setAllowedUnits(self, value) #endif End Set #tag EndSetter AllowedUnits As Integer #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function allowsNonnumericFormatting lib CocoaLib selector "allowsNonnumericFormatting" (obj_id as Ptr) as Boolean return allowsNonnumericFormatting(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setAllowsNonnumericFormatting lib CocoaLib selector "setAllowsNonnumericFormatting:" (obj_id as Ptr, value as Boolean) setAllowsNonnumericFormatting(self, value) #endif End Set #tag EndSetter AllowsNonnumericFormatting As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function countStyle lib CocoaLib selector "countStyle" (obj_id as Ptr) as CountStyle return countStyle(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setCountStyle lib CocoaLib selector "setCountStyle:" (obj_id as Ptr, value as CountStyle) setCountStyle(self, value) #endif End Set #tag EndSetter CountStyle As CountStyle #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function includesActualByteCount lib CocoaLib selector "includesActualByteCount" (obj_id as Ptr) as Boolean return includesActualByteCount(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setIncludesActualByteCount lib CocoaLib selector "setIncludesActualByteCount:" (obj_id as Ptr, value as Boolean) setIncludesActualByteCount(self, value) #endif End Set #tag EndSetter includesActualByteCount As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function includesCount lib CocoaLib selector "includesCount" (obj_id as Ptr) as Boolean return includesCount(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setIncludesCount lib CocoaLib selector "setIncludesCount:" (obj_id as Ptr, value as Boolean) setIncludesCount(self, value) #endif End Set #tag EndSetter IncludesCount As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function includesUnit lib CocoaLib selector "includesUnit" (obj_id as Ptr) as Boolean return includesUnit(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setIncludesUnit lib CocoaLib selector "setIncludesUnit:" (obj_id as Ptr, value as Boolean) setIncludesUnit(self, value) #endif End Set #tag EndSetter IncludesUnit As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function isAdaptive lib CocoaLib selector "isAdaptive" (obj_id as Ptr) as Boolean return isAdaptive(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setIsAdaptive lib CocoaLib selector "setAdaptive:" (obj_id as Ptr, value as Boolean) setIsAdaptive(self, value) #endif End Set #tag EndSetter IsAdaptive As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get #if targetMacOS declare function zeroPadsFractionDigits lib CocoaLib selector "zeroPadsFractionDigits" (obj_id as Ptr) as Boolean return zeroPadsFractionDigits(self) #endif End Get #tag EndGetter #tag Setter Set #if targetMacOS declare sub setZeroPadsFractionDigits lib CocoaLib selector "setZeroPadsFractionDigits:" (obj_id as Ptr, value as Boolean) setZeroPadsFractionDigits(self, value) #endif End Set #tag EndSetter ZeroPadsFractionDigits As Boolean #tag EndComputedProperty #tag Constant, Name = UseAll, Type = Double, Dynamic = False, Default = \"&h0000FFFF", Scope = Public #tag EndConstant #tag Constant, Name = UseBytes, Type = Double, Dynamic = False, Default = \"1", Scope = Public #tag EndConstant #tag Constant, Name = UseDefault, Type = Double, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Constant, Name = UseEB, Type = Double, Dynamic = False, Default = \"64", Scope = Public #tag EndConstant #tag Constant, Name = UseGB, Type = Double, Dynamic = False, Default = \"8", Scope = Public #tag EndConstant #tag Constant, Name = UseKB, Type = Double, Dynamic = False, Default = \"2", Scope = Public #tag EndConstant #tag Constant, Name = UseMB, Type = Double, Dynamic = False, Default = \"4", Scope = Public #tag EndConstant #tag Constant, Name = UsePB, Type = Double, Dynamic = False, Default = \"32", Scope = Public #tag EndConstant #tag Constant, Name = UseTB, Type = Double, Dynamic = False, Default = \"16", Scope = Public #tag EndConstant #tag Constant, Name = UseYBOrHigher, Type = Double, Dynamic = False, Default = \"&h0000FF00", Scope = Public #tag EndConstant #tag Constant, Name = UseZB, Type = Double, Dynamic = False, Default = \"128", Scope = Public #tag EndConstant #tag Enum, Name = CountStyle, Type = Integer, Flags = &h0 File = 0 Memory = 1 Decimal = 2 Binary = 3 #tag EndEnum #tag ViewBehavior #tag ViewProperty Name="AllowedUnits" Group="Behavior" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="AllowsNonnumericFormatting" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="CountStyle" Group="Behavior" Type="CountStyle" EditorType="Enum" #tag EnumValues "0 - File" "1 - Memory" "2 - Decimal" "3 - Binary" #tag EndEnumValues #tag EndViewProperty #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="includesActualByteCount" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="IncludesCount" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="IncludesUnit" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="IsAdaptive" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" Type="String" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="ZeroPadsFractionDigits" Group="Behavior" Type="Boolean" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.