Leopard and You

October 26th, 2007 by Joe Ranieri

Finally, Leopard’s been released and we can talk about the various things that are new. Leopard adds a bunch of fun new things for developers:

  • FSEvents: All file system events are now logged. You can monitor events in real time, or get a list of changes for a certain period of time after the fact. In order to have a minimal overhead, only the directory in which the change occurred is logged.
  • Core Animation: Animating Cocoa views can’t get much easier. Simply send the message to the view’s animator and it’ll handle all the animation for you. Here’s an example that’ll fade the view out:
    [[myView animator] setHidden:YES];
  • Objective-C 2.0: Finally Objective-C plays a bit of catch up. New are properties (handier than you’d think), garbage collection, and for each loops.
  • QuickLook: Now your application can display previews in Finder too.
  • Scripting Bridge: Use Cocoa objects to control scriptable apps, with the native Objective-C syntax.
  • CoreText: No more messing with ancient APIs to draw text at a lower level. I’m looking at you ATSUI.
  • Cocoa Bridges: Use $language to write native Mac OS X apps. Ruby and Python are supported for now (through enhanced versions PyObjC and RubyCocoa) but there may be more in the future.
  • Calendar Store: You can now access iCal’s to-dos, calendars, events and more.
  • Instruments: Find out what your application is really doing. Instruments is built around DTrace and allows you to monitor many things (network use, disk activity, spins, object leakages, etc) at once and compare them between multiple runs.

The list could go on a lot more, but that’s most of the major things, excluding private frameworks. We’ll be blogging about some of them in the following weeks :-).


Safari32

June 21st, 2007 by Joe Ranieri

This post is being restored from our old blog. It has been modified slightly from its original form. Comments have been lost.

Apple recently released the Windows version of Safari, spurring rumors about the return of Yellow Box (Cocoa for Windows). So, let’s take a look at the Safari directory (C:\Program Files\Safari\).

Apple libraries:

  • CFNetwork.dll: The networking library Safari depends on.
  • CoreFoundation.dll: A port of the OS X Foundation library. It’s partially open source in the form of CFLite.
  • CoreGraphics.dll: A partial port of OS X’s graphics engine (Quartz). It sits on top of Windows’ GDI and is handles all of Safari’s drawing needs.
  • PubSub.dll: A port of the OS X framework for handling RSS feeds. This framework isn’t public in 10.4, but will be in 10.5.
  • SafariTheme.dll: This takes care of rendering the OS X looking UI elements Safari and the WebKit use. If you were to replace this with something decent (upcoming blog post?) you’d almost have a decent UI.

Open source libraries:

You’ll notice that all of these APIs are C++ or C. Yes, even the WebKit, which exposes a COM interface almost identical to the OS X Objective-C API. I’ll be blogging about this later.

So, does YellowBox live on? Sadly, no. You’ll notice no signs of Cocoa or Objective-C (strings or functions). Sure, Apple could have obfuscated everything, but it’d still show signs of being Objective-C. Objective-C messages have to go through objc_msgSend first, which involves putting the self object onto the stack, then the selector, and then your arguments. Everything in Safari is just called directly, without the layer of indirection.

Anyways, it appears they wrote it in Microsoft Visual Studio.


Safari for Windows: Command line arguments

June 12th, 2007 by Joe Ranieri

This post is being restored from our old blog. It has been modified slightly from its original form. Comments have been lost.

/frameworkPath:
The directory with all of the DLLs (CFNetwork.dll, etc). The webkit nightly launcher uses this flag so it can just pass the new WebKit.dll to the existing Safari 3 install.

/showIcons
/hideIcons

Disables/enables site favicons.

/debug
Haven’t seen any changes yet with this enabled. One difference is that it’ll try to load “Webkit_debug.dll” instead of “WebKit.dll”.

/reinstall
I would assume it re-associates file extensions and re-registers DLLs.

/console
Opens up a console window when launching Safari. I haven’t seen anything be output to this window yet.

/enableDebugMenu
/disableDebugMenu

Enable and disable the debug menu. On my Windows Vista machine this disables the menubar completely… oops.

/printLaunchTime
Shows the time it took to launch in the console window opened with /console.

/quitAfterLaunch
Quits Safari after it’s launched.

-url
Specifies a URL to open on launch.

-stress
Rapidly opens different websites on launch.