Home | History | Annotate | Download | only in mac
      1 #include <Carbon/Carbon.h>
      2 #include "SkApplication.h"
      3 #include "SkWindow.h"
      4 
      5 int main(int argc, char* argv[])
      6 {
      7     WindowRef			window;
      8     OSStatus			err = noErr;
      9 
     10     Rect bounds = {100, 100, 500, 500};
     11     WindowAttributes attrs = kWindowStandardHandlerAttribute |
     12                              kWindowLiveResizeAttribute |
     13                              kWindowInWindowMenuAttribute |
     14                              kWindowCompositingAttribute |
     15                              kWindowAsyncDragAttribute |
     16                              kWindowFullZoomAttribute |
     17                              kWindowFrameworkScaledAttribute;
     18                              //kWindowDoesNotCycleAttribute;
     19     CreateNewWindow(kDocumentWindowClass, attrs, &bounds, &window);
     20 
     21     MenuRef menu;
     22     CreateNewMenu(0, 0, &menu);
     23 
     24     // if we get here, we can start our normal Skia sequence
     25     {
     26         application_init();
     27         (void)create_sk_window(window);
     28         SizeWindow(window, 640, 480, false);
     29     }
     30 
     31     // The window was created hidden so show it.
     32     ShowWindow( window );
     33 
     34     // Call the event loop
     35     RunApplicationEventLoop();
     36 
     37 	application_term();
     38 
     39 CantCreateWindow:
     40 CantGetNibRef:
     41 	return err;
     42 }
     43 
     44