Jeff Dlouhy Peter JarosI Love Camino!

About Jeff

I am a 19 year old sophomore at Northeastern University in Boston. This summer I am responsible for bringing Tabsposé to Camino. Outside of Camino I also work on my own projects such as Corripio located at nClassSoftware.com.

Contact

email:
Jeff.Dlouhy@gmail.com
camino irc:
jeff
aim:
fanta stine
facebook:
Jeff Dlouhy

About Peter

Peter is a senior at Bard College. He's spending his summer making Camino scriptable. When he's not doing that, he's probably writing dirty, dirty hacks that he's too embarrassed to show the world. That, or working on his own website. (coming soon)

Contact

email:
peter.a.jaros@gmail.com
camino irc:
peeja

 Subscribe in a reader

Camino Blogs

Recent Posts

Archives

Bookmarks: Check (almost)

Peter Jaros - Thursday, July 19, 2007 at 07:47 AM

Man, is this only my second post here?  I’m not too good at this, am I?

Luckily, I’ve got nothing but good news to report.  The bookmark code is now feature-complete!  It’s also pretty much at zarro boogs.  (Can you be almost at zarro boogs?).  All that’s left is a little code clean up.  About half the existing bookmark code was unused scripting support which I’ve partly used and partly overridden.  I’m going to weed out what’s not being used and move what is being used into my ScriptingSupport.mm silo.  I’m implementing scripting as a series of categories on various classes, which seems like the cleanest, most encapsulated way to do it.  They all reside in one file, ScriptingSupport.mm.  Someday that file may have to split, but at least the scripting support will remain separated from the ordinary implementation of the classes, which I think is important.

Nitty gritty under the fold:


Here’s a little note, mostly for the sake of Googlers who come across it.  The “make” command.  Very useful, in theory.  This is the command in AppleScript that lets you create a new object.  Wanna know how it works?  Say you’ve got a scripting class “bookmark” implemented in Objective-C by the class Bookmark.  If you say “make new bookmark”, Cocoa Scripting turns to the app and says [[Bookmark alloc] init].  Now, if you’re not familiar with Objective-C, you might not realize what’s so odd here.  What’s weird is that lots of objects don’t use -init.  Plenty of objects can’t be initialized without some parameters, something like [[FancyClass alloc] initWithThis:foo that:bar theOtherThing:baz]NSCreateCommand (which implements “make”) doesn’t care about these initializers.  It will blithely use plain ol’ -init, and then set properties using -setScriptingProperties:.

How much do you think BrowserWindow loves getting the call [[BrowserWindow alloc] init]?  Or better yet, the class that implements tabs, BrowserWrapper?

(Hint: Not a whole freakin’ lot.)

The solution, it would seem, would be to wrap BrowserWindow and BrowserWrapper (what’s that, BrowserWrapperWrapperBrowserMetaWrapper?) in classes that pass everything through, but can be created using +alloc/-init, and know how to do the right thing when they are.  That, however, is a massive pain, and I’m not going to have it block landing what I’ve written.

So: bookmarks and bookmark folders can be “make”ed, windows and tabs can’t yet, but it’s a future possibility.  Next up: Toolbar Items.  I’ll post about it soon, so stay tuned.


Commenting is not available in this weblog entry.
© 2007 Jeff Dlouhy. All rights reserved.