Finder Hook Points in OS X

Contextual Menu

[TContextMenu +addViewSpecificStuffToMenu:browserViewController:context:] is for handling selected items cached in [TContextMenu +handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:] (10.6 & 10.7) or [TContextMenu +handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:] (10.8)

10.6 & 10.7

  • [TContextMenu +handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:]: cached selected items for later use. Because only at this point we can really know what those items are.
  • [TContextMenu -configureWithNodes:windowController:container:]: at this point, we can know the selected items and directly append additional menu.

10.8

Same as in 10.6 & 10.7 but different names of hook points

  • [TContextMenu +handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:]
  • [TContextMenu -configureWithNodes:browserController:container:]

10.9

In Mavericks, Finder has massive changes. The previous hook points are no longer available. But new hook point makes me easier to do things.

  • [TContextMenu -configureFromMenuNeedsUpdate:clickedView:container:event:selectedNodes:]: at this point, thank god we got selected items finally. I've been wondering why not Apple put this until 10.9.

Icon Overlay

Icon View

  • [IKImageBrowserCell -drawImage:]: this can be used for 10.6 ~ 10.9.

List View & Column View

  • [TListViewIconAndTextCell -drawIconWithFrame:]: both list view and column view for 10.6 ~ 10.8, but column view for 10.9.
  • [TListNameCellView -updateTagsImageForNode:selected:]: list view for 10.9. This hook point is great enough if you wanna know the node path and can tolerate slight delay of first-time icon replacement. Otherwise, [TDimmableIconImageView -drawRect] would be a better solution showing overlayed icons without delay. I'm still finding a better hook point for getting the node path and fixing the delay issue.