From 76aa34bf8e6f25ff7bd59b63e63ebb754d09105e Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Tue, 23 Dec 2008 01:27:39 +0000 Subject: add text to hostapp sample rename duplicate of SkSVGPath.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@45 2bbb7eff-a529-9590-31e7-b0007b416f81 --- .../CICarbonSample.xcodeproj/project.pbxproj | 12 +- xcode/hostapp/English.lproj/main.nib/classes.nib | 12 +- xcode/hostapp/English.lproj/main.nib/info.nib | 21 +- xcode/hostapp/English.lproj/main.nib/objects.xib | 261 +++++++++------------ xcode/hostapp/test.cpp | 11 + 5 files changed, 151 insertions(+), 166 deletions(-) (limited to 'xcode/hostapp') diff --git a/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj b/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj index 7c7c0cdb6d..556818de5d 100644 --- a/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj +++ b/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj @@ -10,8 +10,8 @@ 002884150EFA97F80083E387 /* test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002884140EFA97F80083E387 /* test.cpp */; }; 0028847B0EFAB46A0083E387 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 002884510EFAA35C0083E387 /* libcore.a */; }; 002884BD0EFAB6A30083E387 /* libmaccore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 002884BC0EFAB69F0083E387 /* libmaccore.a */; }; - 002884D90EFABFE60083E387 /* SkFontHost_none.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002884D80EFABFE60083E387 /* SkFontHost_none.cpp */; }; 004447A20EFC1DB400116F7C /* SkCreateCGImageRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 004447A10EFC1DB400116F7C /* SkCreateCGImageRef.cpp */; }; + 008D39120F0043260032662A /* SkFontHost_mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 008D39110F0043260032662A /* SkFontHost_mac.cpp */; }; 0156F80407C56A3000C6122B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0156F80307C56A3000C6122B /* Foundation.framework */; }; 01FC44D507BD3BB800D228F4 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01FC44D407BD3BB800D228F4 /* Quartz.framework */; }; 8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; }; @@ -55,8 +55,8 @@ 002884140EFA97F80083E387 /* test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test.cpp; sourceTree = ""; }; 002884490EFAA35C0083E387 /* core.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = core.xcodeproj; path = ../core/core.xcodeproj; sourceTree = SOURCE_ROOT; }; 002884B40EFAB69F0083E387 /* maccore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = maccore.xcodeproj; path = ../maccore/maccore.xcodeproj; sourceTree = SOURCE_ROOT; }; - 002884D80EFABFE60083E387 /* SkFontHost_none.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkFontHost_none.cpp; path = ../../src/ports/SkFontHost_none.cpp; sourceTree = SOURCE_ROOT; }; 004447A10EFC1DB400116F7C /* SkCreateCGImageRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkCreateCGImageRef.cpp; path = ../../src/utils/mac/SkCreateCGImageRef.cpp; sourceTree = SOURCE_ROOT; }; + 008D39110F0043260032662A /* SkFontHost_mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkFontHost_mac.cpp; path = ../../src/ports/SkFontHost_mac.cpp; sourceTree = SOURCE_ROOT; }; 0156F80307C56A3000C6122B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 01FC44D407BD3BB800D228F4 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = ""; }; 0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -113,8 +113,8 @@ 20286C29FDCF999611CA2CEA /* CICarbonSample */ = { isa = PBXGroup; children = ( + 008D39110F0043260032662A /* SkFontHost_mac.cpp */, 004447A10EFC1DB400116F7C /* SkCreateCGImageRef.cpp */, - 002884D80EFABFE60083E387 /* SkFontHost_none.cpp */, 20286C2AFDCF999611CA2CEA /* Sources */, 20286C2CFDCF999611CA2CEA /* Resources */, 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */, @@ -243,8 +243,8 @@ files = ( 8D0C4E900486CD37000505A6 /* main.c in Sources */, 002884150EFA97F80083E387 /* test.cpp in Sources */, - 002884D90EFABFE60083E387 /* SkFontHost_none.cpp in Sources */, 004447A20EFC1DB400116F7C /* SkCreateCGImageRef.cpp in Sources */, + 008D39120F0043260032662A /* SkFontHost_mac.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -344,6 +344,8 @@ 01E2163E09EDAC6600E66AF8 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; GCC_PREPROCESSOR_DEFINITIONS = ( SK_BUILD_FOR_MAC, SK_DEBUG, @@ -355,6 +357,8 @@ 01E2163F09EDAC6600E66AF8 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; GCC_PREPROCESSOR_DEFINITIONS = ( SK_BUILD_FOR_MAC, SK_RELEASE, diff --git a/xcode/hostapp/English.lproj/main.nib/classes.nib b/xcode/hostapp/English.lproj/main.nib/classes.nib index ea58db1189..c4b887e72b 100644 --- a/xcode/hostapp/English.lproj/main.nib/classes.nib +++ b/xcode/hostapp/English.lproj/main.nib/classes.nib @@ -1,4 +1,8 @@ -{ -IBClasses = (); -IBVersion = 1; -} + + + + + IBVersion + 1 + + diff --git a/xcode/hostapp/English.lproj/main.nib/info.nib b/xcode/hostapp/English.lproj/main.nib/info.nib index 63627e9ece..848f03c06b 100644 --- a/xcode/hostapp/English.lproj/main.nib/info.nib +++ b/xcode/hostapp/English.lproj/main.nib/info.nib @@ -1,24 +1,17 @@ - + - IBDocumentLocation - 117 84 356 240 0 0 1920 1178 - IBEditorPositions - - 29 - 110 302 204 44 0 0 1920 1178 - IBFramework Version - 430.0 + 629 + IBLastKnownRelativeProjectPath + ../../CICarbonSample.xcodeproj IBOldestOS - 3 + 5 IBOpenObjects - - 166 - + IBSystem Version - 8A376 + 9F33 targetFramework IBCarbonFramework diff --git a/xcode/hostapp/English.lproj/main.nib/objects.xib b/xcode/hostapp/English.lproj/main.nib/objects.xib index 8f115b75b9..289202a9f2 100644 --- a/xcode/hostapp/English.lproj/main.nib/objects.xib +++ b/xcode/hostapp/English.lproj/main.nib/objects.xib @@ -1,193 +1,166 @@ - IBCarbonFramework - NSApplication - + + + Print… + p + prnt + + + About Foo + 0 + abou + + + Zoom + zoom + + + Minimize All + m + TRUE + 1572864 + mina + + + File + + + Page Setup… + P + page + + + + + + Minimize + m + TRUE + mini + + + Bring All to Front + TRUE + bfrt + + + TRUE + + + Arrange in Front + TRUE + 1572864 + frnt + + + FALSE + FALSE + TRUE + TRUE + TRUE + FALSE + TRUE + TRUE + 1 + 1048576 + Window + + 0 0 480 360 + + + ciHV + 128 + + 1 + 1 + 2 + 2 + + 0 0 480 360 + 0 0 360 480 + + + 0 0 360 480 + + 504 338 864 818 + 0 0 768 1024 + main + _NSMainMenu Foo Foo + _NSAppleMenu - - About Foo - 0 - abou - + - _NSAppleMenu File - - File - - - Page Setup… - P - page - - - Print… - p - prnt - - - + Window Window + _NSWindowsMenu - - TRUE - Minimize - m - mini - - - TRUE - Minimize All - m - 1572864 - mina - - - Zoom - zoom - - - TRUE - - - TRUE - Bring All to Front - bfrt - - - TRUE - Arrange in Front - 1572864 - frnt - + + + + + + - _NSWindowsMenu - _NSMainMenu + + - - - - - 504 338 864 818 - Window - - 0 0 360 480 - 0 0 480 360 - - - 0 0 360 480 - 0 0 480 360 - ciHV - 128 - - 1 - 1 - 2 - 2 - - - - 329 16 341 460 - 16 329 444 12 - gSLD - 128 - TRUE - 1 - gama - Set the gamma of the background image - - 1 - 2 - 2 - - TRUE - 100 - 2 - 75 - 10 - - - - FALSE - FALSE - TRUE - TRUE - 1 - TRUE - FALSE - TRUE - TRUE - TRUE - 1048576 - TRUE - TRUE - - - - - - + - - - - - - - + + - - - - + - - - - - - + - + + + - + + + + + + - - Files Owner + + File's Owner MainWindow MenuBar - View1 - - 202 + IBCarbonFramework + 204 diff --git a/xcode/hostapp/test.cpp b/xcode/hostapp/test.cpp index 67f833261f..4f66a826bf 100644 --- a/xcode/hostapp/test.cpp +++ b/xcode/hostapp/test.cpp @@ -13,6 +13,17 @@ static void sampleDraw(SkCanvas* canvas) { canvas->drawCircle(SkIntToScalar(100), SkIntToScalar(100), SkIntToScalar(90), paint); + + const char text[] = "fry42"; + const size_t len = strlen(text); + + paint.setColor(SK_ColorWHITE); + paint.setTextSize(SkIntToScalar(50)); + canvas->drawText(text, len, SkIntToScalar(100), SkIntToScalar(50), paint); + paint.setTextAlign(SkPaint::kCenter_Align); + canvas->drawText(text, len, SkIntToScalar(100), SkIntToScalar(100), paint); + paint.setTextAlign(SkPaint::kRight_Align); + canvas->drawText(text, len, SkIntToScalar(100), SkIntToScalar(150), paint); } static CGImageRef gImage; -- cgit v1.2.3