| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #import "SkSampleNSView.h" | 9 #import "SkSampleNSView.h" |
| 10 #include "SampleApp.h" | 10 |
| 11 #include "SkApplication.h" |
| 12 |
| 11 #include <crt_externs.h> | 13 #include <crt_externs.h> |
| 12 @implementation SkSampleNSView | 14 @implementation SkSampleNSView |
| 13 | 15 |
| 14 - (id)initWithDefaults { | 16 - (id)initWithDefaults { |
| 15 if ((self = [super initWithDefaults])) { | 17 if ((self = [super initWithDefaults])) { |
| 16 fWind = new SampleWindow(self, *_NSGetArgc(), *_NSGetArgv(), NULL); | 18 fWind = create_sk_window(self, *_NSGetArgc(), *_NSGetArgv()); |
| 17 } | 19 } |
| 18 return self; | 20 return self; |
| 19 } | 21 } |
| 20 | 22 |
| 21 - (void)dealloc { | 23 - (void)dealloc { |
| 22 delete fWind; | 24 delete fWind; |
| 23 [super dealloc]; | 25 [super dealloc]; |
| 24 } | 26 } |
| 25 | |
| 26 - (void)swipeWithEvent:(NSEvent *)event { | |
| 27 CGFloat x = [event deltaX]; | |
| 28 if (x < 0) | |
| 29 ((SampleWindow*)fWind)->previousSample(); | |
| 30 else if (x > 0) | |
| 31 ((SampleWindow*)fWind)->nextSample(); | |
| 32 else | |
| 33 ((SampleWindow*)fWind)->showOverview(); | |
| 34 } | |
| 35 | |
| 36 @end | 27 @end |
| OLD | NEW |