From cbd76ae138c4f34cd272ee9c0ac4facbe90fed90 Mon Sep 17 00:00:00 2001 From: "bungeman@google.com" Date: Wed, 21 Mar 2012 20:59:49 +0000 Subject: [PATCH] Utils must not depend on Views. http://codereview.appspot.com/5867051/ git-svn-id: http://skia.googlecode.com/svn/trunk@3459 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gyp/SampleApp.gyp | 36 +++++++++---------- gyp/SimpleCocoaApp.gyp | 20 +++++------ gyp/iOSSampleApp.gyp | 5 +-- gyp/utils.gyp | 16 --------- gyp/views.gyp | 35 ++++++++++++++++++ .../android/AndroidKeyToSkKey.h | 0 include/{utils => views}/unix/XkeysToSkKeys.h | 0 include/{utils => views}/unix/keysym2ucs.h | 0 src/{utils => views}/ios/SkOSWindow_iOS.mm | 0 src/{utils => views}/mac/SampleApp-Info.plist | 0 src/{utils => views}/mac/SampleApp.xib | 0 src/{utils => views}/mac/SampleAppDelegate.h | 0 src/{utils => views}/mac/SampleAppDelegate.mm | 0 src/{utils => views}/mac/SkEventNotifier.h | 0 src/{utils => views}/mac/SkEventNotifier.mm | 0 src/{utils => views}/mac/SkNSView.h | 0 src/{utils => views}/mac/SkNSView.mm | 0 src/{utils => views}/mac/SkOSWindow_Mac.cpp | 0 src/{utils => views}/mac/SkOSWindow_Mac.mm | 0 src/{utils => views}/mac/SkOptionsTableView.h | 0 .../mac/SkOptionsTableView.mm | 0 src/{utils => views}/mac/SkSampleNSView.h | 0 src/{utils => views}/mac/SkSampleNSView.mm | 0 src/{utils => views}/mac/SkTextFieldCell.h | 0 src/{utils => views}/mac/SkTextFieldCell.m | 0 src/{utils => views}/mac/skia_mac.mm | 0 .../SDL => views/sdl}/SkOSWindow_SDL.cpp | 0 src/{utils => views}/unix/SkOSWindow_Unix.cpp | 0 src/{utils => views}/unix/keysym2ucs.c | 0 src/{utils => views}/win/SkOSWindow_win.cpp | 0 src/{utils => views}/win/skia_win.cpp | 0 31 files changed, 64 insertions(+), 48 deletions(-) rename include/{utils => views}/android/AndroidKeyToSkKey.h (100%) rename include/{utils => views}/unix/XkeysToSkKeys.h (100%) rename include/{utils => views}/unix/keysym2ucs.h (100%) rename src/{utils => views}/ios/SkOSWindow_iOS.mm (100%) rename src/{utils => views}/mac/SampleApp-Info.plist (100%) rename src/{utils => views}/mac/SampleApp.xib (100%) rename src/{utils => views}/mac/SampleAppDelegate.h (100%) rename src/{utils => views}/mac/SampleAppDelegate.mm (100%) rename src/{utils => views}/mac/SkEventNotifier.h (100%) rename src/{utils => views}/mac/SkEventNotifier.mm (100%) rename src/{utils => views}/mac/SkNSView.h (100%) rename src/{utils => views}/mac/SkNSView.mm (100%) rename src/{utils => views}/mac/SkOSWindow_Mac.cpp (100%) rename src/{utils => views}/mac/SkOSWindow_Mac.mm (100%) rename src/{utils => views}/mac/SkOptionsTableView.h (100%) rename src/{utils => views}/mac/SkOptionsTableView.mm (100%) rename src/{utils => views}/mac/SkSampleNSView.h (100%) rename src/{utils => views}/mac/SkSampleNSView.mm (100%) rename src/{utils => views}/mac/SkTextFieldCell.h (100%) rename src/{utils => views}/mac/SkTextFieldCell.m (100%) rename src/{utils => views}/mac/skia_mac.mm (100%) rename src/{utils/SDL => views/sdl}/SkOSWindow_SDL.cpp (100%) rename src/{utils => views}/unix/SkOSWindow_Unix.cpp (100%) rename src/{utils => views}/unix/keysym2ucs.c (100%) rename src/{utils => views}/win/SkOSWindow_win.cpp (100%) rename src/{utils => views}/win/skia_win.cpp (100%) diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp index b9158219fe..2a38add318 100644 --- a/gyp/SampleApp.gyp +++ b/gyp/SampleApp.gyp @@ -174,33 +174,33 @@ ], 'sources': [ # Sample App specific files - '../src/utils/mac/SampleApp-Info.plist', - '../src/utils/mac/SampleAppDelegate.h', - '../src/utils/mac/SampleAppDelegate.mm', - '../src/utils/mac/SkSampleNSView.h', - '../src/utils/mac/SkSampleNSView.mm', + '../src/views/mac/SampleApp-Info.plist', + '../src/views/mac/SampleAppDelegate.h', + '../src/views/mac/SampleAppDelegate.mm', + '../src/views/mac/SkSampleNSView.h', + '../src/views/mac/SkSampleNSView.mm', # Mac files - '../src/utils/mac/SkEventNotifier.h', - '../src/utils/mac/SkEventNotifier.mm', - '../src/utils/mac/skia_mac.mm', - '../src/utils/mac/SkNSView.h', - '../src/utils/mac/SkNSView.mm', - '../src/utils/mac/SkOptionsTableView.h', - '../src/utils/mac/SkOptionsTableView.mm', - '../src/utils/mac/SkOSWindow_Mac.mm', - '../src/utils/mac/SkTextFieldCell.h', - '../src/utils/mac/SkTextFieldCell.m', + '../src/views/mac/SkEventNotifier.h', + '../src/views/mac/SkEventNotifier.mm', + '../src/views/mac/skia_mac.mm', + '../src/views/mac/SkNSView.h', + '../src/views/mac/SkNSView.mm', + '../src/views/mac/SkOptionsTableView.h', + '../src/views/mac/SkOptionsTableView.mm', + '../src/views/mac/SkOSWindow_Mac.mm', + '../src/views/mac/SkTextFieldCell.h', + '../src/views/mac/SkTextFieldCell.m', ], 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', ], 'xcode_settings' : { - 'INFOPLIST_FILE' : '../src/utils/mac/SampleApp-Info.plist', + 'INFOPLIST_FILE' : '../src/views/mac/SampleApp-Info.plist', }, 'mac_bundle_resources' : [ - '../src/utils/mac/SampleApp.xib', + '../src/views/mac/SampleApp.xib', ], }], [ 'skia_os == "ios"', { @@ -222,7 +222,7 @@ '../experimental/iOSSampleApp/iPhone/AppDelegate_iPhone.mm', '../experimental/iOSSampleApp/iPhone/SkUINavigationController.mm', - '../src/utils/ios/SkOSWindow_iOS.mm', + '../src/views/ios/SkOSWindow_iOS.mm', '../src/utils/ios/SkImageDecoder_iOS.mm', '../src/utils/ios/SkStream_NSData.mm', '../src/utils/ios/SkOSFile_iOS.mm', diff --git a/gyp/SimpleCocoaApp.gyp b/gyp/SimpleCocoaApp.gyp index f5e41c49f7..13f05dcaac 100644 --- a/gyp/SimpleCocoaApp.gyp +++ b/gyp/SimpleCocoaApp.gyp @@ -8,16 +8,16 @@ '../experimental/SimpleCocoaApp/', ], 'sources': [ - '../src/utils/mac/SkEventNotifier.h', - '../src/utils/mac/SkEventNotifier.mm', - '../src/utils/mac/skia_mac.mm', - '../src/utils/mac/SkNSView.h', - '../src/utils/mac/SkNSView.mm', - '../src/utils/mac/SkOptionsTableView.h', - '../src/utils/mac/SkOptionsTableView.mm', - '../src/utils/mac/SkOSWindow_Mac.mm', - '../src/utils/mac/SkTextFieldCell.h', - '../src/utils/mac/SkTextFieldCell.m', + '../src/views/mac/SkEventNotifier.h', + '../src/views/mac/SkEventNotifier.mm', + '../src/views/mac/skia_mac.mm', + '../src/views/mac/SkNSView.h', + '../src/views/mac/SkNSView.mm', + '../src/views/mac/SkOptionsTableView.h', + '../src/views/mac/SkOptionsTableView.mm', + '../src/views/mac/SkOSWindow_Mac.mm', + '../src/views/mac/SkTextFieldCell.h', + '../src/views/mac/SkTextFieldCell.m', '../experimental/SimpleCocoaApp/SimpleApp-Info.plist', '../experimental/SimpleCocoaApp/SimpleApp.h', diff --git a/gyp/iOSSampleApp.gyp b/gyp/iOSSampleApp.gyp index b864ca687f..f504594ee9 100644 --- a/gyp/iOSSampleApp.gyp +++ b/gyp/iOSSampleApp.gyp @@ -1,7 +1,4 @@ { - 'includes': [ - 'target_defaults.gypi', - ], 'defines!': [ 'SK_BUILD_FOR_MAC', ], @@ -212,7 +209,7 @@ '../experimental/iOSSampleApp/iPhone/SkUINavigationController.mm', '../experimental/iOSSampleApp/iPhone/MainWindow_iPhone.xib', - '../src/utils/ios/SkOSWindow_iOS.mm', + '../src/views/ios/SkOSWindow_iOS.mm', '../src/utils/ios/SkImageDecoder_iOS.mm', '../src/utils/ios/SkStream_NSData.mm', '../src/utils/ios/SkOSFile_iOS.mm', diff --git a/gyp/utils.gyp b/gyp/utils.gyp index 87d6e973ad..1847e95842 100644 --- a/gyp/utils.gyp +++ b/gyp/utils.gyp @@ -10,7 +10,6 @@ '../include/utils/mac', '../include/utils/unix', '../include/utils/win', - '../include/views', '../include/effects', '../include/xml', ], @@ -62,13 +61,6 @@ #mac '../include/utils/mac/SkCGUtils.h', '../src/utils/mac/SkCreateCGImageRef.cpp', - - #sdl - '../src/utils/SDL/SkOSWindow_SDL.cpp', - - #*nix - '../src/utils/unix/keysym2ucs.c', - '../src/utils/unix/SkOSWindow_Unix.cpp', #windows '../include/utils/win/SkAutoCoInitialize.h', @@ -76,10 +68,8 @@ '../include/utils/win/SkIStream.h', '../include/utils/win/SkTScopedComPtr.h', '../src/utils/win/SkAutoCoInitialize.cpp', - '../src/utils/win/skia_win.cpp', '../src/utils/win/SkHRESULT.cpp', '../src/utils/win/SkIStream.cpp', - '../src/utils/win/SkOSWindow_win.cpp', '../src/utils/win/SkWGL_win.cpp', ], 'sources!': [ @@ -104,8 +94,6 @@ 'sources!': [ '../include/utils/mac/SkCGUtils.h', '../src/utils/mac/SkCreateCGImageRef.cpp', - '../src/utils/mac/skia_mac.mm', - '../src/utils/mac/SkOSWindow_Mac.mm', ], }], [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { @@ -119,10 +107,6 @@ 'include_dirs!': [ '../include/utils/unix', ], - 'sources!': [ - '../src/utils/unix/keysym2ucs.c', - '../src/utils/unix/SkOSWindow_Unix.cpp', - ], }], [ 'skia_os == "win"', { 'direct_dependent_settings': { diff --git a/gyp/views.gyp b/gyp/views.gyp index e997573418..832c1803bf 100644 --- a/gyp/views.gyp +++ b/gyp/views.gyp @@ -12,6 +12,7 @@ '../include/images', '../include/animator', '../include/effects', + '../include/views/unix', ], 'sources': [ '../include/views/SkApplication.h', @@ -64,10 +65,27 @@ '../src/views/SkWidgets.cpp', '../src/views/SkWidgetViews.cpp', '../src/views/SkWindow.cpp', + + #mac + '../src/views/mac/SkOSWindow_Mac.mm', + '../src/views/mac/skia_mac.mm', + + #sdl + '../src/views/SDL/SkOSWindow_SDL.cpp', + + #*nix + '../src/views/unix/SkOSWindow_Unix.cpp', + '../src/views/unix/keysym2ucs.c', + + #windows + '../src/views/win/SkOSWindow_win.cpp', + '../src/views/win/skia_win.cpp', + ], 'sources!' : [ '../src/views/SkListView.cpp', #depends on missing SkListSource implementation '../src/views/SkListWidget.cpp', #depends on missing SkListSource implementation + '../src/views/SDL/SkOSWindow_SDL.cpp', ], 'conditions': [ [ 'skia_os == "mac"', { @@ -77,11 +95,28 @@ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', ], }, + },{ + 'sources!': [ + '../src/views/mac/SkOSWindow_Mac.mm', + '../src/views/mac/skia_mac.mm', + ], }], [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { 'sources': [ '../unix_test_app/main.cpp', ], + },{ + 'sources!': [ + '../src/views/unix/SkOSWindow_Unix.cpp', + '../src/views/unix/keysym2ucs.c', + ], + }], + [ 'skia_os == "win"', { + },{ + 'sources!': [ + '../src/views/win/SkOSWindow_win.cpp', + '../src/views/win/skia_win.cpp', + ], }], [ 'skia_os == "android"', { # Android does not support animator so we need to remove all files diff --git a/include/utils/android/AndroidKeyToSkKey.h b/include/views/android/AndroidKeyToSkKey.h similarity index 100% rename from include/utils/android/AndroidKeyToSkKey.h rename to include/views/android/AndroidKeyToSkKey.h diff --git a/include/utils/unix/XkeysToSkKeys.h b/include/views/unix/XkeysToSkKeys.h similarity index 100% rename from include/utils/unix/XkeysToSkKeys.h rename to include/views/unix/XkeysToSkKeys.h diff --git a/include/utils/unix/keysym2ucs.h b/include/views/unix/keysym2ucs.h similarity index 100% rename from include/utils/unix/keysym2ucs.h rename to include/views/unix/keysym2ucs.h diff --git a/src/utils/ios/SkOSWindow_iOS.mm b/src/views/ios/SkOSWindow_iOS.mm similarity index 100% rename from src/utils/ios/SkOSWindow_iOS.mm rename to src/views/ios/SkOSWindow_iOS.mm diff --git a/src/utils/mac/SampleApp-Info.plist b/src/views/mac/SampleApp-Info.plist similarity index 100% rename from src/utils/mac/SampleApp-Info.plist rename to src/views/mac/SampleApp-Info.plist diff --git a/src/utils/mac/SampleApp.xib b/src/views/mac/SampleApp.xib similarity index 100% rename from src/utils/mac/SampleApp.xib rename to src/views/mac/SampleApp.xib diff --git a/src/utils/mac/SampleAppDelegate.h b/src/views/mac/SampleAppDelegate.h similarity index 100% rename from src/utils/mac/SampleAppDelegate.h rename to src/views/mac/SampleAppDelegate.h diff --git a/src/utils/mac/SampleAppDelegate.mm b/src/views/mac/SampleAppDelegate.mm similarity index 100% rename from src/utils/mac/SampleAppDelegate.mm rename to src/views/mac/SampleAppDelegate.mm diff --git a/src/utils/mac/SkEventNotifier.h b/src/views/mac/SkEventNotifier.h similarity index 100% rename from src/utils/mac/SkEventNotifier.h rename to src/views/mac/SkEventNotifier.h diff --git a/src/utils/mac/SkEventNotifier.mm b/src/views/mac/SkEventNotifier.mm similarity index 100% rename from src/utils/mac/SkEventNotifier.mm rename to src/views/mac/SkEventNotifier.mm diff --git a/src/utils/mac/SkNSView.h b/src/views/mac/SkNSView.h similarity index 100% rename from src/utils/mac/SkNSView.h rename to src/views/mac/SkNSView.h diff --git a/src/utils/mac/SkNSView.mm b/src/views/mac/SkNSView.mm similarity index 100% rename from src/utils/mac/SkNSView.mm rename to src/views/mac/SkNSView.mm diff --git a/src/utils/mac/SkOSWindow_Mac.cpp b/src/views/mac/SkOSWindow_Mac.cpp similarity index 100% rename from src/utils/mac/SkOSWindow_Mac.cpp rename to src/views/mac/SkOSWindow_Mac.cpp diff --git a/src/utils/mac/SkOSWindow_Mac.mm b/src/views/mac/SkOSWindow_Mac.mm similarity index 100% rename from src/utils/mac/SkOSWindow_Mac.mm rename to src/views/mac/SkOSWindow_Mac.mm diff --git a/src/utils/mac/SkOptionsTableView.h b/src/views/mac/SkOptionsTableView.h similarity index 100% rename from src/utils/mac/SkOptionsTableView.h rename to src/views/mac/SkOptionsTableView.h diff --git a/src/utils/mac/SkOptionsTableView.mm b/src/views/mac/SkOptionsTableView.mm similarity index 100% rename from src/utils/mac/SkOptionsTableView.mm rename to src/views/mac/SkOptionsTableView.mm diff --git a/src/utils/mac/SkSampleNSView.h b/src/views/mac/SkSampleNSView.h similarity index 100% rename from src/utils/mac/SkSampleNSView.h rename to src/views/mac/SkSampleNSView.h diff --git a/src/utils/mac/SkSampleNSView.mm b/src/views/mac/SkSampleNSView.mm similarity index 100% rename from src/utils/mac/SkSampleNSView.mm rename to src/views/mac/SkSampleNSView.mm diff --git a/src/utils/mac/SkTextFieldCell.h b/src/views/mac/SkTextFieldCell.h similarity index 100% rename from src/utils/mac/SkTextFieldCell.h rename to src/views/mac/SkTextFieldCell.h diff --git a/src/utils/mac/SkTextFieldCell.m b/src/views/mac/SkTextFieldCell.m similarity index 100% rename from src/utils/mac/SkTextFieldCell.m rename to src/views/mac/SkTextFieldCell.m diff --git a/src/utils/mac/skia_mac.mm b/src/views/mac/skia_mac.mm similarity index 100% rename from src/utils/mac/skia_mac.mm rename to src/views/mac/skia_mac.mm diff --git a/src/utils/SDL/SkOSWindow_SDL.cpp b/src/views/sdl/SkOSWindow_SDL.cpp similarity index 100% rename from src/utils/SDL/SkOSWindow_SDL.cpp rename to src/views/sdl/SkOSWindow_SDL.cpp diff --git a/src/utils/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp similarity index 100% rename from src/utils/unix/SkOSWindow_Unix.cpp rename to src/views/unix/SkOSWindow_Unix.cpp diff --git a/src/utils/unix/keysym2ucs.c b/src/views/unix/keysym2ucs.c similarity index 100% rename from src/utils/unix/keysym2ucs.c rename to src/views/unix/keysym2ucs.c diff --git a/src/utils/win/SkOSWindow_win.cpp b/src/views/win/SkOSWindow_win.cpp similarity index 100% rename from src/utils/win/SkOSWindow_win.cpp rename to src/views/win/SkOSWindow_win.cpp diff --git a/src/utils/win/skia_win.cpp b/src/views/win/skia_win.cpp similarity index 100% rename from src/utils/win/skia_win.cpp rename to src/views/win/skia_win.cpp -- 2.34.1