[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] findHelpFile patch
- To: "SuperCollider developers list" <sc-dev@xxxxxxxxxxxxxxxx>
- Subject: [sc-dev] findHelpFile patch
- From: "Dan Stowell" <danstowell@xxxxxxxxx>
- Date: Mon, 22 Dec 2008 15:06:11 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=4O030z8MK3bmnq7c7npVsYG/OhJzsSctT34/JyHVWxA=; b=R8XqZ7zMKQ7W+0dCzHmN0aTpHOtLwoZ6v0gWQ8MmoLqXiA7xQfPKbuQ9Dbm5Is8VHj bl29U32ftDkqEF8dsZ1uPQVjCAuHMii4g9C28d4wxJFyF0PGedMSBNvkYETZ+HFixXcc yVXKCuk30AvuiwPQWlkusll9wlZKKQeyr+oC4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=b1ImA4FCiUdv3/gY0z0h5EvisBJhlMrtyUl557tPpq3sMD2n9MweF/Pw3nnbxDRWs3 MT0iBrIX5QdXwZlhLAEo4NDtj9C0iw5FJZt5iZeXAqNFcRuXg1wYOUQDA6l4if8eNnF2 fEV23ULkfY6d9d/Y2JufPmApzavoAaE5kIAgc=
- List-id: SuperCollider developers mailing list <sc-devel.create.ucsb.edu>
- Reply-to: sc-dev@xxxxxxxxxxxxxxxx
- Sender: owner-sc-dev@xxxxxxxxxxxxxxxx
Hi -
The attached patch moves the responsibility for String:findHelpFile
into the CocoaDocument / Emacs classes, for a cleaner override on
non-Mac platforms.
I'm away from both svn and mac at the moment. Could someone please
verify that the patch doesn't break String:findHelpFile on osx, and if
seems OK, commit?
Thanks
Dan
--
http://www.mcld.co.uk
Index: build/SCClassLibrary/Platform/osx/CocoaDocument.sc
===================================================================
--- build/SCClassLibrary/Platform/osx/CocoaDocument.sc (revision 8198)
+++ build/SCClassLibrary/Platform/osx/CocoaDocument.sc (working copy)
@@ -195,5 +195,9 @@
*prGetIndexOfListener {
_TextWindow_GetIndexOfListener
}
+ *findHelpFile { |str|
+ _Cocoa_HelpFileForString_
+ ^this.primitiveFailed
+ }
+}
-}
\ No newline at end of file
Index: build/SCClassLibrary/Common/GUI/Document.sc
===================================================================
--- build/SCClassLibrary/Common/GUI/Document.sc (revision 8198)
+++ build/SCClassLibrary/Common/GUI/Document.sc (working copy)
@@ -655,7 +655,8 @@
}
-
+ *findHelpFile { |str|
+ ^this.subclassResponsibility
+ }
}
-
Index: build/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc
===================================================================
--- build/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc (revision 8198)
+++ build/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc (working copy)
@@ -77,10 +77,8 @@
}
- /// cocoa or at least foundation dependant
findHelpFile {
- _Cocoa_HelpFileForString_
- ^this.primitiveFailed
+ ^Document.implementationClass.findHelpFile(this)
}
openHelpFile {
(this.findHelpFile ? "Help/Help.html".standardizePath).openHTMLFile
Index: linux/scel/sc/extDocument.sc
===================================================================
--- linux/scel/sc/extDocument.sc (revision 8198)
+++ linux/scel/sc/extDocument.sc (working copy)
@@ -31,12 +31,6 @@
+ String{
- findHelpFile {
- if ( Emacs.initialized) {
- Emacs.evalLispExpression(['sclang-find-help', this].asLispString);
- }
- }
-
openHelpFile {
if ( Emacs.initialized) {
this.findHelpFile;
Index: linux/scel/sc/ScelDocument.sc
===================================================================
--- linux/scel/sc/ScelDocument.sc (revision 8198)
+++ linux/scel/sc/ScelDocument.sc (working copy)
@@ -314,4 +314,11 @@
prGetLastIndex {
^this.shouldNotImplement(thisMethod)
}
+
+ *findHelpFile { |str|
+ if ( Emacs.initialized) {
+ Emacs.evalLispExpression(['sclang-find-help', str].asLispString);
+ }
+ }
+
}
\ No newline at end of file
Index: Source/app/CocoaFilePrimitives.M
===================================================================
--- Source/app/CocoaFilePrimitives.M (revision 8198)
+++ Source/app/CocoaFilePrimitives.M (working copy)
@@ -163,10 +163,11 @@
{
if (!g->canCallOS) return errCantCallOS;
- PyrSlot *receiver = g->sp;
+ PyrSlot *a = g->sp;
+ PyrSlot *receiver = g->sp - 1;
// this function should be moved out of the MyDocument instance
- NSString *path = pathOfHelpFileFor( nsStringFromPyrSlot(receiver));
+ NSString *path = pathOfHelpFileFor( nsStringFromPyrSlot(a));
if(path) {
PyrString* pyrPathString = newPyrString(g->gc,[path fileSystemRepresentation],0,true);
@@ -282,7 +283,7 @@
//definePrimitive(base, index++, "_Cocoa_SaveAsPlist", prSaveAsPlist, 2, 0);
// definePrimitive(base, index++, "_Cocoa_StandardizePath", prStandardizePath, 1, 0);
definePrimitive(base, index++, "_Cocoa_GetPathsInDirectory", prGetPathsInDirectory, 4, 0);
- definePrimitive(base, index++, "_Cocoa_HelpFileForString_", prHelpFileForString, 1, 0);
+ definePrimitive(base, index++, "_Cocoa_HelpFileForString_", prHelpFileForString, 2, 0);
/* definePrimitive(base, index++, "_ObjC_AllocInit", prAllocInit, 4, 0);
definePrimitive(base, index++, "_ObjC_Dealloc", prDealloc, 2, 0);