From eff04b5ec287e0fee0d44207c10d2d11f7eade8a Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 21 Nov 2017 13:18:02 -0500 Subject: Remove SampleApp and convert HelloWorld to sk_app There is still a large amount of views code that could be trimmed down, but which is used to implement samples (in viewer). Seemed simpler to remove some of this code in pieces. Bug: skia: Change-Id: Ia3415060d03c8de604a154e3dc38379b754daab6 Reviewed-on: https://skia-review.googlesource.com/72801 Commit-Queue: Brian Osman Reviewed-by: Jim Van Verth Reviewed-by: Brian Salomon --- example/HelloWorld.cpp | 155 +- example/HelloWorld.h | 74 +- example/mac/HelloWorld-Info.plist | 32 - example/mac/HelloWorld.xib | 3661 ------------------------------------- example/mac/HelloWorldDelegate.h | 27 - example/mac/HelloWorldDelegate.mm | 27 - example/mac/HelloWorldNSView.h | 13 - example/mac/HelloWorldNSView.mm | 27 - 8 files changed, 82 insertions(+), 3934 deletions(-) delete mode 100644 example/mac/HelloWorld-Info.plist delete mode 100644 example/mac/HelloWorld.xib delete mode 100644 example/mac/HelloWorldDelegate.h delete mode 100644 example/mac/HelloWorldDelegate.mm delete mode 100644 example/mac/HelloWorldNSView.h delete mode 100644 example/mac/HelloWorldNSView.mm (limited to 'example') diff --git a/example/HelloWorld.cpp b/example/HelloWorld.cpp index 83bc4ecf44..fba7f7e5a0 100644 --- a/example/HelloWorld.cpp +++ b/example/HelloWorld.cpp @@ -1,81 +1,78 @@ /* - * Copyright 2015 Google Inc. - * - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - */ +* Copyright 2017 Google Inc. +* +* Use of this source code is governed by a BSD-style license that can be +* found in the LICENSE file. +*/ #include "HelloWorld.h" -#include "gl/GrGLInterface.h" #include "GrContext.h" -#include "SkApplication.h" #include "SkCanvas.h" #include "SkGradientShader.h" #include "SkGraphics.h" -#include "SkGr.h" -void application_init() { - SkGraphics::Init(); - SkEvent::Init(); -} +using namespace sk_app; -void application_term() { - SkEvent::Term(); +Application* Application::Create(int argc, char** argv, void* platformData) { + return new HelloWorld(argc, argv, platformData); } -HelloWorldWindow::HelloWorldWindow(void* hwnd) - : INHERITED(hwnd) { - fType = kGPU_DeviceType; - fRotationAngle = 0; - this->setTitle(); - this->setUpBackend(); +static void on_backend_created_func(void* userData) { + HelloWorld* hw = reinterpret_cast(userData); + return hw->onBackendCreated(); } -HelloWorldWindow::~HelloWorldWindow() { - tearDownBackend(); +static void on_paint_handler(SkCanvas* canvas, void* userData) { + HelloWorld* hw = reinterpret_cast(userData); + return hw->onPaint(canvas); } -void HelloWorldWindow::tearDownBackend() { - INHERITED::release(); +static bool on_char_handler(SkUnichar c, uint32_t modifiers, void* userData) { + HelloWorld* hw = reinterpret_cast(userData); + return hw->onChar(c, modifiers); } -void HelloWorldWindow::setTitle() { - SkString title("Hello World "); - title.appendf(fType == kRaster_DeviceType ? "raster" : "opengl"); - INHERITED::setTitle(title.c_str()); -} +HelloWorld::HelloWorld(int argc, char** argv, void* platformData) + : fBackendType(Window::kNativeGL_BackendType) + , fRotationAngle(0) { + SkGraphics::Init(); -bool HelloWorldWindow::setUpBackend() { - this->setVisibleP(true); - this->setClipToBounds(false); + fWindow = Window::CreateNativeWindow(platformData); + fWindow->setRequestedDisplayParams(DisplayParams()); - bool result = attach(kNativeGL_BackEndType, 0 /*msaa*/, false, &fAttachmentInfo); - if (false == result) { - SkDebugf("Not possible to create backend.\n"); - release(); - return false; - } + // register callbacks + fWindow->registerBackendCreatedFunc(on_backend_created_func, this); + fWindow->registerPaintFunc(on_paint_handler, this); + fWindow->registerCharFunc(on_char_handler, this); - fInterface.reset(GrGLCreateNativeInterface()); - SkASSERT(NULL != fInterface); + fWindow->attach(fBackendType); +} - fContext = GrContext::MakeGL(fInterface.get()); - SkASSERT(NULL != fContext); +HelloWorld::~HelloWorld() { + fWindow->detach(); + delete fWindow; +} - this->setUpGpuBackedSurface(); - return true; +void HelloWorld::updateTitle() { + if (!fWindow || fWindow->sampleCount() < 0) { + return; + } + + SkString title("Hello World "); + title.append(Window::kRaster_BackendType == fBackendType ? "Raster" : "OpenGL"); + fWindow->setTitle(title.c_str()); } -void HelloWorldWindow::setUpGpuBackedSurface() { - fGpuSurface = this->makeGpuBackedSurface(fAttachmentInfo, fInterface.get(), fContext.get()); +void HelloWorld::onBackendCreated() { + this->updateTitle(); + fWindow->show(); + fWindow->inval(); } -void HelloWorldWindow::drawContents(SkCanvas* canvas) { +void HelloWorld::onPaint(SkCanvas* canvas) { // Clear background - canvas->drawColor(SK_ColorWHITE); + canvas->clear(SK_ColorWHITE); SkPaint paint; paint.setColor(SK_ColorRED); @@ -86,16 +83,11 @@ void HelloWorldWindow::drawContents(SkCanvas* canvas) { // Set up a linear gradient and draw a circle { - SkPoint linearPoints[] = { - {0, 0}, - {300, 300} - }; - SkColor linearColors[] = {SK_ColorGREEN, SK_ColorBLACK}; - - paint.setShader(SkGradientShader::MakeLinear( - linearPoints, linearColors, nullptr, 2, - SkShader::kMirror_TileMode)); - paint.setFlags(SkPaint::kAntiAlias_Flag); + SkPoint linearPoints[] = { { 0, 0 }, { 300, 300 } }; + SkColor linearColors[] = { SK_ColorGREEN, SK_ColorBLACK }; + paint.setShader(SkGradientShader::MakeLinear(linearPoints, linearColors, nullptr, 2, + SkShader::kMirror_TileMode)); + paint.setAntiAlias(true); canvas->drawCircle(200, 200, 64, paint); @@ -103,15 +95,12 @@ void HelloWorldWindow::drawContents(SkCanvas* canvas) { paint.setShader(nullptr); } - // Draw a message with a nice black paint. - paint.setFlags( - SkPaint::kAntiAlias_Flag | - SkPaint::kSubpixelText_Flag); // ... avoid waggly text when rotating. + // Draw a message with a nice black paint + paint.setSubpixelText(true); paint.setColor(SK_ColorBLACK); paint.setTextSize(20); canvas->save(); - static const char message[] = "Hello World"; // Translate and rotate @@ -122,39 +111,23 @@ void HelloWorldWindow::drawContents(SkCanvas* canvas) { } canvas->rotate(fRotationAngle); - // Draw the text: + // Draw the text canvas->drawText(message, strlen(message), 0, 0, paint); canvas->restore(); } -void HelloWorldWindow::draw(SkCanvas* canvas) { - this->drawContents(canvas); - // Invalidate the window to force a redraw. Poor man's animation mechanism. - this->inval(NULL); - - if (kRaster_DeviceType == fType) { - fRasterSurface->draw(fGpuSurface->getCanvas(), 0, 0, nullptr); - } - fGpuSurface->getCanvas()->flush(); - INHERITED::present(); -} - -void HelloWorldWindow::onSizeChange() { - this->setUpGpuBackedSurface(); +void HelloWorld::onIdle() { + // Just re-paint continously + fWindow->inval(); } -bool HelloWorldWindow::onHandleChar(SkUnichar unichar) { - if (' ' == unichar) { - fType = fType == kRaster_DeviceType ? kGPU_DeviceType: kRaster_DeviceType; - tearDownBackend(); - setUpBackend(); - this->setTitle(); - this->inval(NULL); +bool HelloWorld::onChar(SkUnichar c, uint32_t modifiers) { + if (' ' == c) { + fBackendType = Window::kRaster_BackendType == fBackendType ? Window::kNativeGL_BackendType + : Window::kRaster_BackendType; + fWindow->detach(); + fWindow->attach(fBackendType); } return true; } - -SkOSWindow* create_sk_window(void* hwnd, int , char** ) { - return new HelloWorldWindow(hwnd); -} diff --git a/example/HelloWorld.h b/example/HelloWorld.h index 05d9b81e82..44f1321d6b 100644 --- a/example/HelloWorld.h +++ b/example/HelloWorld.h @@ -1,73 +1,35 @@ /* - * Copyright 2015 Google Inc. - * - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - */ +* Copyright 2017 Google Inc. +* +* Use of this source code is governed by a BSD-style license that can be +* found in the LICENSE file. +*/ #ifndef HelloWorld_DEFINED #define HelloWorld_DEFINED -#include "SkSurface.h" -#include "SkWindow.h" +#include "sk_app/Application.h" +#include "sk_app/Window.h" -class GrContext; -struct GrGLInterface; -class GrRenderTarget; class SkCanvas; -class HelloWorldWindow : public SkOSWindow { +class HelloWorld : public sk_app::Application { public: - enum DeviceType { - kRaster_DeviceType, - kGPU_DeviceType, - }; - HelloWorldWindow(void* hwnd); - virtual ~HelloWorldWindow() override; + HelloWorld(int argc, char** argv, void* platformData); + ~HelloWorld() override; - // Changes the device type of the object. - bool setUpBackend(); - - DeviceType getDeviceType() const { return fType; } - -protected: - sk_sp makeSurface() override { - SkSurfaceProps props(INHERITED::getSurfaceProps()); - if (kGPU_DeviceType == fType) { - return fGpuSurface; - } - const SkImageInfo info = SkImageInfo::MakeN32Premul(SkScalarRoundToInt(this->width()), - SkScalarRoundToInt(this->height())); - fRasterSurface = SkSurface::MakeRaster(info, &props); - return fRasterSurface; - } - - void draw(SkCanvas* canvas) override; - void drawContents(SkCanvas* canvas); - - void onSizeChange() override; + void onBackendCreated(); + void onPaint(SkCanvas* canvas); + void onIdle() override; + bool onChar(SkUnichar c, uint32_t modifiers); private: - bool findNextMatch(); // Set example to the first one that matches FLAGS_match. - void setTitle(); - void setUpGpuBackedSurface(); - bool onHandleChar(SkUnichar unichar) override; - void tearDownBackend(); + void updateTitle(); - // draw contents - SkScalar fRotationAngle; - - // support framework - DeviceType fType; - sk_sp fRasterSurface; - sk_sp fContext; - sk_sp fGpuSurface; - AttachmentInfo fAttachmentInfo; - sk_sp fInterface; + sk_app::Window* fWindow; + sk_app::Window::BackendType fBackendType; - typedef SkOSWindow INHERITED; + SkScalar fRotationAngle; }; #endif diff --git a/example/mac/HelloWorld-Info.plist b/example/mac/HelloWorld-Info.plist deleted file mode 100644 index e9a9aa4979..0000000000 --- a/example/mac/HelloWorld-Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.googlecode.skia.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSMainNibFile - HelloWorld - NSPrincipalClass - NSApplication - - diff --git a/example/mac/HelloWorld.xib b/example/mac/HelloWorld.xib deleted file mode 100644 index 8ff60a244b..0000000000 --- a/example/mac/HelloWorld.xib +++ /dev/null @@ -1,3661 +0,0 @@ - - - - 1070 - 12D78 - 3084 - 1187.37 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - NSCustomObject - NSCustomView - NSDrawer - NSMenu - NSMenuItem - NSScrollView - NSScroller - NSTableColumn - NSTableView - NSTextFieldCell - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - HelloWorldDelegate - - - NSWindowController - - - 15 - 2 - {{335, 288}, {640, 480}} - 1417150464 - Hello World - NSWindow - - - - - 256 - {640, 480} - - - - {{0, 0}, {1280, 778}} - {10000000000000, 10000000000000} - YES - - - - 4352 - - - - 274 - - - - 2304 - - - - 256 - {339, 319} - - YES - NO - YES - - - -2147483392 - {{224, 0}, {16, 17}} - - - - Labels - 100 - 40 - 1000 - - 75497536 - 2048 - - - LucidaGrande - 11 - 3100 - - - 3 - MC4zMzMzMzI5ODU2AA - - - 6 - System - headerTextColor - - 3 - MAA - - - - - 68157504 - 67241216 - Text Cell - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 3 - YES - YES - - - - Controls - 233 - 40 - 1000 - - 75497536 - 2048 - - - - - - - 67108928 - 272630784 - Text - - LucidaGrande - 13 - 1044 - - - - 6 - System - controlColor - - - - - 3 - YES - YES - - - - 3 - 2 - - 6 - System - _sourceListBackgroundColor - - 6 - System - alternateSelectedControlColor - - 1 - MCAwIDEAA - - - - - 6 - System - gridColor - - 3 - MC41AA - - - 35 - 1665138688 - - - 2 - 4 - 15 - 0 - NO - 1 - 1 - 1 - - - {{1, 1}, {339, 319}} - - - - - 4 - - - - -2147483392 - {{317, 1}, {15, 574}} - - NO - - _doScroller: - 0.99687498807907104 - - - - -2147483392 - {{1, 263}, {157, 15}} - - NO - 1 - - _doScroller: - 0.99705880880355835 - - - {341, 321} - - - 133682 - - - - QSAAAEEgAABCFAAAQhQAAA - 0.25 - 4 - 1 - - - {341, 321} - YES - NSView - - - - {300, 100} - {0, 0} - {10000, 10000} - 2 - 0.0 - 15 - - - - - AMainMenu - - - - SimpleCocoaApp - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - SimpleCocoaApp - - - - About SimpleCocoaApp - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Show Options - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide SimpleCocoaApp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit SimpleCocoaApp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 1048576 - 2147483647 - - - submenuAction: - - File - - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 1048576 - 2147483647 - - - submenuAction: - - Open Recent - - - - Clear Menu - - 1048576 - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 1048576 - 2147483647 - - - submenuAction: - - Edit - - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Paste and Match Style - V - 1572864 - 2147483647 - - - - - - Delete - - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Find - - 1048576 - 2147483647 - - - submenuAction: - - Find - - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 1048576 - 2147483647 - - - submenuAction: - - Spelling and Grammar - - - - Show Spelling and Grammar - : - 1048576 - 2147483647 - - - - - - Check Document Now - ; - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Check Spelling While Typing - - 1048576 - 2147483647 - - - - - - Check Grammar With Spelling - - 1048576 - 2147483647 - - - - - - Correct Spelling Automatically - - 2147483647 - - - - - - - - - Substitutions - - 1048576 - 2147483647 - - - submenuAction: - - Substitutions - - - - Show Substitutions - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Dashes - - 2147483647 - - - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - Text Replacement - - 2147483647 - - - - - - - - - Transformations - - 2147483647 - - - submenuAction: - - Transformations - - - - Make Upper Case - - 2147483647 - - - - - - Make Lower Case - - 2147483647 - - - - - - Capitalize - - 2147483647 - - - - - - - - - Speech - - 1048576 - 2147483647 - - - submenuAction: - - Speech - - - - Start Speaking - - 1048576 - 2147483647 - - - - - - Stop Speaking - - 1048576 - 2147483647 - - - - - - - - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - - - Show Menu Key Equivalents - - 2147483647 - 1 - - - - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 1048576 - 2147483647 - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - - - Font - - 2147483647 - - - submenuAction: - - Font - - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Writing Direction - - 2147483647 - - - submenuAction: - - Writing Direction - - - - YES - Paragraph - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - YES - Selection - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - 768 x 1024 - = - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - - - SimpleCocoaApp Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - NSFontManager - - - - - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 656 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - newDocument: - - - - 373 - - - - openDocument: - - - - 374 - - - - raiseBaseline: - - - - 426 - - - - lowerBaseline: - - - - 427 - - - - copyFont: - - - - 428 - - - - subscript: - - - - 429 - - - - superscript: - - - - 430 - - - - tightenKerning: - - - - 431 - - - - underline: - - - - 432 - - - - orderFrontColorPanel: - - - - 433 - - - - useAllLigatures: - - - - 434 - - - - loosenKerning: - - - - 435 - - - - pasteFont: - - - - 436 - - - - unscript: - - - - 437 - - - - useStandardKerning: - - - - 438 - - - - useStandardLigatures: - - - - 439 - - - - turnOffLigatures: - - - - 440 - - - - turnOffKerning: - - - - 441 - - - - toggleAutomaticSpellingCorrection: - - - - 456 - - - - orderFrontSubstitutionsPanel: - - - - 458 - - - - toggleAutomaticDashSubstitution: - - - - 461 - - - - toggleAutomaticTextReplacement: - - - - 463 - - - - uppercaseWord: - - - - 464 - - - - capitalizeWord: - - - - 467 - - - - lowercaseWord: - - - - 468 - - - - pasteAsPlainText: - - - - 486 - - - - performFindPanelAction: - - - - 487 - - - - performFindPanelAction: - - - - 488 - - - - performFindPanelAction: - - - - 489 - - - - showHelp: - - - - 493 - - - - alignCenter: - - - - 518 - - - - pasteRuler: - - - - 519 - - - - toggleRuler: - - - - 520 - - - - alignRight: - - - - 521 - - - - copyRuler: - - - - 522 - - - - alignJustified: - - - - 523 - - - - alignLeft: - - - - 524 - - - - makeBaseWritingDirectionNatural: - - - - 525 - - - - makeBaseWritingDirectionLeftToRight: - - - - 526 - - - - makeBaseWritingDirectionRightToLeft: - - - - 527 - - - - makeTextWritingDirectionNatural: - - - - 528 - - - - makeTextWritingDirectionLeftToRight: - - - - 529 - - - - makeTextWritingDirectionRightToLeft: - - - - 530 - - - - fOptionsDelegate - - - - 667 - - - - addFontTrait: - - - - 421 - - - - addFontTrait: - - - - 422 - - - - modifyFont: - - - - 423 - - - - orderFrontFontPanel: - - - - 424 - - - - modifyFont: - - - - 425 - - - - fWindow - - - - 673 - - - - fOptions - - - - 674 - - - - fView - - - - 682 - - - - toiPadSize: - - - - 721 - - - - contentView - - - - 542 - - - - parentWindow - - - - 651 - - - - toggle: - - - - 707 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - - - - - - 19 - - - - - - - - 56 - - - - - - - - 217 - - - - - - - - 83 - - - - - - - - 81 - - - - - - - - - - - - - - - - - - 75 - - - - - 80 - - - - - 78 - - - - - 72 - - - - - 82 - - - - - 124 - - - - - - - - 77 - - - - - 73 - - - - - 79 - - - - - 112 - - - - - 74 - - - - - 125 - - - - - - - - 126 - - - - - 205 - - - - - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - - - - - - 216 - - - - - - - - 200 - - - - - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 57 - - - - - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - - - - - - 296 - - - - - - - - - - 297 - - - - - 298 - - - - - 211 - - - - - - - - 212 - - - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - - - - - - 349 - - - - - - - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 371 - - - - - - - - 372 - - - - - - 375 - - - - - - - - 376 - - - - - - - - - 377 - - - - - - - - 388 - - - - - - - - - - - - - - - - - - - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - - - 396 - - - - - 397 - - - - - - - - 398 - - - - - - - - 399 - - - - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - - - 404 - - - - - 405 - - - - - - - - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - - - 410 - - - - - 411 - - - - - - - - - - 412 - - - - - 413 - - - - - 414 - - - - - 415 - - - - - - - - - - - 416 - - - - - 417 - - - - - 418 - - - - - 419 - - - - - 420 - - - - - 450 - - - - - - - - 451 - - - - - - - - - - 452 - - - - - 453 - - - - - 454 - - - - - 457 - - - - - 459 - - - - - 460 - - - - - 462 - - - - - 465 - - - - - 466 - - - - - 485 - - - - - 490 - - - - - - - - 491 - - - - - - - - 492 - - - - - 496 - - - - - - - - 497 - - - - - - - - - - - - - - - - - 498 - - - - - 499 - - - - - 500 - - - - - 501 - - - - - 502 - - - - - 503 - - - - - - - - 504 - - - - - 505 - - - - - 506 - - - - - 507 - - - - - 508 - - - - - - - - - - - - - - - - 509 - - - - - 510 - - - - - 511 - - - - - 512 - - - - - 513 - - - - - 514 - - - - - 515 - - - - - 516 - - - - - 517 - - - - - 538 - - - - - - Drawer Content View - - - 539 - - - - - 629 - - - - - - - - - - 630 - - - - - 631 - - - - - 632 - - - - - - - - - 634 - - - - - - - - 637 - - - - - 494 - - - - - 661 - - - - - 635 - - - - - - - - 698 - - - - - 705 - - - - - 706 - - - - - 718 - - - - - 720 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{254, 23}, {640, 480}} - - HelloWorldNSView - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 721 - - - - - HelloWorldDelegate - NSObject - - toiPadSize: - id - - - toiPadSize: - - toiPadSize: - id - - - - SkSampleNSView - NSWindow - - - - fView - SkSampleNSView - - - fWindow - NSWindow - - - - IBProjectSource - ./Classes/HelloWorldDelegate.h - - - - HelloWorldNSView - SkNSView - - IBProjectSource - ./Classes/HelloWorldNSView.h - - - - SkNSView - NSView - - IBProjectSource - ./Classes/SkNSView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - YES - 3 - - {11, 11} - {10, 3} - - - diff --git a/example/mac/HelloWorldDelegate.h b/example/mac/HelloWorldDelegate.h deleted file mode 100644 index 40e910b770..0000000000 --- a/example/mac/HelloWorldDelegate.h +++ /dev/null @@ -1,27 +0,0 @@ - -/* - * Copyright 2011 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#import -#import "SkSampleNSView.h" -#import "SkOptionsTableView.h" -@interface HelloWorldDelegate : NSObject { - NSWindow* fWindow; - SkSampleNSView* fView; - SkOptionsTableView* fOptions; -} - -@property (assign) IBOutlet NSWindow* fWindow; -@property (assign) IBOutlet SkSampleNSView* fView; -@property (assign) IBOutlet SkOptionsTableView* fOptions; - -- (IBAction)toiPadSize:(id)sender; - -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; - -@end diff --git a/example/mac/HelloWorldDelegate.mm b/example/mac/HelloWorldDelegate.mm deleted file mode 100644 index f3c08107a2..0000000000 --- a/example/mac/HelloWorldDelegate.mm +++ /dev/null @@ -1,27 +0,0 @@ -#import "HelloWorldDelegate.h" - -#include "SkApplication.h" - -@implementation HelloWorldDelegate -@synthesize fWindow, fView, fOptions; - -// for iOS --(void) applicationDidFinishLaunching:(NSNotification *)aNotification { - //Load specified skia views after launching - fView.fOptionsDelegate = fOptions; - [fWindow setAcceptsMouseMovedEvents:YES]; - // [fOptions registerMenus:fView.fWind->getMenus()]; -} - -- (IBAction)toiPadSize:(id)sender { - NSRect frame = NSMakeRect(fWindow.frame.origin.x, fWindow.frame.origin.y, 768, 1024); - [fWindow setFrame:frame display:YES animate:YES]; -} - -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { - [fView freeNativeWind]; - application_term(); - return NSTerminateNow; -} - -@end diff --git a/example/mac/HelloWorldNSView.h b/example/mac/HelloWorldNSView.h deleted file mode 100644 index 3de780feee..0000000000 --- a/example/mac/HelloWorldNSView.h +++ /dev/null @@ -1,13 +0,0 @@ - -/* - * Copyright 2013 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#import "SkNSView.h" - -@interface HelloWorldNSView : SkNSView - -@end diff --git a/example/mac/HelloWorldNSView.mm b/example/mac/HelloWorldNSView.mm deleted file mode 100644 index 63852e5250..0000000000 --- a/example/mac/HelloWorldNSView.mm +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2015 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#import "HelloWorldNSView.h" - -#include "SkApplication.h" -#include - -@implementation HelloWorldNSView - -- (id)initWithDefaults { - if ((self = [super initWithDefaults])) { - fWind = create_sk_window(self, *_NSGetArgc(), *_NSGetArgv()); - } - return self; -} - -- (void)dealloc { - delete fWind; - [super dealloc]; -} - -@end -- cgit v1.2.3