Skip to content

Commit

Permalink
• Fixed memory leak with MacSpeechSynthesizer. (thank to Charles for …
Browse files Browse the repository at this point in the history
…finding the problem)

• Extended MDItem (CreateFromFile, AllAttributes)
• Added MacOSFolderItemExtension SpotlightMetadata which returns all the metadata for a file as a Dictionary
• Extended NSDictionary.Value and NSMutableDictionary.Value to accept a key as variant
• Added optional class checking in the NSObject Constructor
• Many improvements in NSAttributedString and its mutable counterpart, though there is still much work to be done

Signed-off-by: Stéphane Mons <st.mons.lists@free.fr>
  • Loading branch information
Smons committed Aug 23, 2012
1 parent b908422 commit f23c721
Show file tree
Hide file tree
Showing 20 changed files with 777 additions and 101 deletions.
10 changes: 9 additions & 1 deletion About.rbbas
Expand Up @@ -13,6 +13,14 @@ Protected Module About
These release notes were added as of version 100. Check the git history for previous release notes.
Add new notes above existing ones, and remember to increment the Version constant.

106: 2012-08-23
- Fixed memory leak with MacSpeechSynthesizer. (thank to Charles for finding the problem)
- Extended MDItem (CreateFromFile, AllAttributes)
- Added MacOSFolderItemExtension SpotlightMetadata which returns all the metadata for a file as a Dictionary
- Extended NSDictionary.Value and NSMutableDictionary.Value to accept a key as variant
- Added optional class checking in the NSObject Constructor
- Many improvements in NSAttributedString and its mutable counterpart, though there is still much work to be done

105:
- Moved M_PList module into "Convenience extensions and objects folder" within macoslib.

Expand Down Expand Up @@ -41,7 +49,7 @@ Protected Module About
#tag EndNote


#tag Constant, Name = Version, Type = Double, Dynamic = False, Default = \"105", Scope = Protected
#tag Constant, Name = Version, Type = Double, Dynamic = False, Default = \"106", Scope = Protected
#tag EndConstant


Expand Down
2 changes: 2 additions & 0 deletions Application/App.rbbas
Expand Up @@ -24,6 +24,8 @@ Inherits Application

Cocoa.Initialize

DebugLogWND.Show

End Sub
#tag EndEvent

Expand Down
30 changes: 1 addition & 29 deletions Examples/LabelExtensionExampleWindow.rbfrm
Expand Up @@ -51,7 +51,7 @@ Begin Window LabelExtensionExampleWindow
TextUnit = 0
Top = 7
Underline = ""
Value = 0
Value = 1
Visible = True
Width = 726
Begin Label Label1
Expand Down Expand Up @@ -245,36 +245,8 @@ End
dim RTFdata as NSData = new NSData( RTFStringIntroStyled )
dim nsas as NSAttributedString = NSAttributedString.CreateFromRTF( RTFdata )

'dim nsas as new NSMutableAttributedString
'nsas.AppendAttributedString NSAttributedString.CreateFromString_WithAttributes( "Hello", nsas.kNSFontAttributeName : "Lucida Grande", _
'nsas.kAttributeBold : true

me.SetAttributedString new AttributedString( nsas )




'declare function delegate_ lib CocoaLib selector "delegate" (id as Ptr) as Ptr
'declare function view_ lib CocoaLib selector "view" (id as Ptr) as Ptr
'
''dim myView as Ptr = view_( Ptr( me.Handle ))
''AssertPtr myView, "myview is nil"
''
''ReportObjCDetailsForNSObjectPtr myView
'
'
'dim nstv as NSTextField = new NSTextField( Ptr( me.Handle ))
'
'dim del as Ptr = delegate_( nstv )
'
'if del=nil then
'DReport "del is nil"
'return
'end if
'
''DebugReportModule.ReportObjCDetailsForClassPtr Cocoa.NSClassFromString( Cocoa.ClassNameForObjectPointer( Ptr( me.Handle )))
'
''ReportObjCDetailsForNSObjectPtr Ptr( me.handle )
End Sub
#tag EndEvent
#tag EndEvents
Expand Down
29 changes: 11 additions & 18 deletions Examples/MacSpeechSynthesizerExample.rbfrm
Expand Up @@ -216,7 +216,6 @@ Begin Window MacSpeechSynthesizerExample
Selectable = False
TabIndex = 6
TabPanelIndex = 0
TabStop = True
Text = "Voice attributes: (a Dictionary available for each voice)"
TextAlign = 0
TextColor = &h000000
Expand Down Expand Up @@ -341,7 +340,6 @@ Begin Window MacSpeechSynthesizerExample
Selectable = False
TabIndex = 10
TabPanelIndex = 0
TabStop = True
Text = "Volume:"
TextAlign = 0
TextColor = &h000000
Expand All @@ -355,18 +353,15 @@ Begin Window MacSpeechSynthesizerExample
Width = 67
End
Begin MacSpeechSynthesizer Speech
Enabled = True
Height = 32
Index = -2147483648
Left = 952
InitialParent = ""
Left = 948
LockedInPosition= False
Rate = ""
Scope = 0
TabIndex = 9
TabPanelIndex = 0
TabStop = True
Top = -16
Visible = True
Top = -4
Volume = ""
Width = 32
End
Expand All @@ -392,7 +387,6 @@ Begin Window MacSpeechSynthesizerExample
Selectable = False
TabIndex = 12
TabPanelIndex = 0
TabStop = True
Text = "Current voice:"
TextAlign = 0
TextColor = &h000000
Expand Down Expand Up @@ -427,7 +421,6 @@ Begin Window MacSpeechSynthesizerExample
Selectable = False
TabIndex = 13
TabPanelIndex = 0
TabStop = True
Text = "-"
TextAlign = 0
TextColor = &h000000
Expand Down Expand Up @@ -521,7 +514,6 @@ Begin Window MacSpeechSynthesizerExample
Selectable = False
TabIndex = 16
TabPanelIndex = 0
TabStop = True
Text = "Rate:"
TextAlign = 0
TextColor = &h000000
Expand Down Expand Up @@ -553,7 +545,6 @@ Begin Window MacSpeechSynthesizerExample
Scope = 0
TabIndex = 17
TabPanelIndex = 0
TabStop = True
TextFont = "SmallSystem"
TextSize = 0
TextUnit = 0
Expand Down Expand Up @@ -651,33 +642,35 @@ Begin Window MacSpeechSynthesizerExample
End
Begin Line Line1
BorderWidth = 1
Enabled = True
Height = 50
Index = -2147483648
InitialParent = ""
Left = ""
LineColor = ""
LockedInPosition= False
Scope = 0
TabIndex = 16
TabPanelIndex = 0
TabStop = True
Top = ""
Visible = True
Width = 100
X1 = 519
X2 = 519
Y1 = 144
Y2 = 193
End
Begin Line Line2
BorderWidth = 1
Enabled = True
Height = 50
Index = -2147483648
InitialParent = ""
Left = ""
LineColor = ""
LockedInPosition= False
Scope = 0
TabIndex = 17
TabPanelIndex = 0
TabStop = True
Top = ""
Visible = True
Width = 100
X1 = 519
X2 = 540
Y1 = 194
Expand Down
2 changes: 1 addition & 1 deletion macoslib.rbvcp
Expand Up @@ -469,7 +469,7 @@ Class=MacFSEventStream;macoslib/Convenience extensions and objects/MacFSEvents/M
Class=MacFSEvent;macoslib/Convenience extensions and objects/MacFSEvents/MacFSEvent.rbbas;&h2FB591;&h7F7254BF;false
Class=BadSystemException;macoslib/Exception Classes/BadSystemException.rbbas;&h73914445;&h1CC2A86E;false
Class=PropertyList;macoslib/DebugReport Cross-Platform/DebugReportModule/PropertyList.rbbas;&h4423F494;&h533B78C4;false
Class=PLArray;macoslib/DebugReport Cross-Platform/DebugReportModule/PLArray.rbbas;&h148E8525;&h533B78C4;false<<<<<<< HEAD
Class=PLArray;macoslib/DebugReport Cross-Platform/DebugReportModule/PLArray.rbbas;&h148E8525;&h533B78C4;false
Folder=KT's PList Stuff;Additional Modules/KT's PList Stuff;&h3D338A86;&h171E2973;false
Module=M_PList;Additional Modules/KT's PList Stuff/M_PList.rbbas;&h3144AB7A;&h3D338A86;false
Class=MacPListBrowser;Additional Modules/KT's PList Stuff/MacPListBrowser.rbbas;&h9DC53AC;&h3D338A86;false
Expand Down
2 changes: 2 additions & 0 deletions macoslib/Cocoa/Cocoa.rbbas
Expand Up @@ -639,6 +639,8 @@ Protected Module Cocoa
case Variant.TypeNil
return new NSNull

case Variant.TypeColor
return new NSColor( v.ColorValue )
else
raise new TypeMismatchException
end select
Expand Down

0 comments on commit f23c721

Please sign in to comment.