This application demonstrates use of the 'nine-slice' functionality of the CALayer Class. Also demonstrates the use of drag-n-drop to load images.
Standard app delegate generated by Xcode for a new project.
This is the main controller for the application and handles the setup of the layer hierarchy, connecting them up to the view, handling drag-n-drop, and updating the layers when the sliders move. An instance of this class resides in MainMenu.xib. That instance is the delegate of the application's main window (to facilitate drag-n-drop), and uses IBOutlet references for the views (which have been wired up through Interface Builder).
This method will be called when the AppController instance is 'defrosted' from the nib and will setup the layer hierarchy, register for drag-n-drop notifications, and load the placeholder image.
Update the layer with the new slider values.
Reset the slider values and update the layer.
-(NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender
Inform the pasteboard that we intend to link to the dragged file, used to implement the 'drag-n-drop' feature.
-(BOOL)performDragOperation:(id < NSDraggingInfo >)sender
If the dragged file is a valid image, update the views. Otherwise reject, used to implement the 'drag-n-drop' feature.
View to display the guidelines which show how the image will be sliced.
Called by the system to redraw the window, draws the image and slice guidelines according to the values 'southWest' and 'northEast'.
Given new dimensions for the center rect, redraw the guidelines.