├── .appcast.xml
├── .gitignore
├── LICENSE.md
├── README.md
├── assets
├── icon.png
└── screenshot.png
├── package-lock.json
├── package.json
└── src
├── command.js
├── constants.js
├── enums.js
├── framework
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Headers
│ │ ├── Private
│ │ │ └── NSLogger
│ │ │ │ ├── LoggerClient.h
│ │ │ │ ├── LoggerCommon.h
│ │ │ │ ├── NSLogger.h
│ │ │ │ └── NSLoggerSwift.h
│ │ └── Public
│ │ │ └── NSLogger
│ │ │ ├── LoggerClient.h
│ │ │ ├── LoggerCommon.h
│ │ │ ├── NSLogger.h
│ │ │ └── NSLoggerSwift.h
│ ├── Manifest.lock
│ ├── NSLogger
│ │ ├── Client
│ │ │ └── iOS
│ │ │ │ ├── LoggerClient.h
│ │ │ │ ├── LoggerClient.m
│ │ │ │ ├── LoggerCommon.h
│ │ │ │ ├── NSLogger.h
│ │ │ │ └── NSLoggerSwift.h
│ │ ├── LICENSE.txt
│ │ └── README.markdown
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ └── Target Support Files
│ │ ├── NSLogger
│ │ ├── NSLogger-dummy.m
│ │ ├── NSLogger-prefix.pch
│ │ └── NSLogger.xcconfig
│ │ └── Pods-print-export
│ │ ├── Pods-print-export-acknowledgements.markdown
│ │ ├── Pods-print-export-acknowledgements.plist
│ │ ├── Pods-print-export-dummy.m
│ │ ├── Pods-print-export-resources.sh
│ │ ├── Pods-print-export.debug.xcconfig
│ │ └── Pods-print-export.release.xcconfig
├── print-export.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── print-export.xcscheme
├── print-export.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── print-export
│ ├── Info.plist
│ ├── PEDecimalFormatter.h
│ ├── PEDecimalFormatter.m
│ ├── PEFlowConnection.h
│ ├── PEFlowConnection.m
│ ├── PEOptions.h
│ ├── PEOptions.m
│ ├── PEOptionsAccessoryView.xib
│ ├── PEPrintExport.h
│ ├── PEPrintExport.m
│ ├── PESketchMethods.h
│ ├── PESketchMethods.m
│ ├── PEUtils.h
│ ├── PEUtils.m
│ ├── Sketch
│ ├── MSColor-Protocol.h
│ ├── MSConstants.h
│ ├── MSConstants.m
│ ├── MSContentDrawViewController.h
│ ├── MSDocument.h
│ ├── MSDocumentData.h
│ ├── MSExportManager.h
│ ├── MSExportRequest.h
│ ├── MSFlashController.h
│ ├── MSImmutableArtboardGroup.h
│ ├── MSImmutableColor.h
│ ├── MSImmutableDocumentData.h
│ ├── MSImmutableFlowConnection.h
│ ├── MSImmutableHotspotLayer.h
│ ├── MSImmutableLayer.h
│ ├── MSImmutableLayerAncestry.h
│ ├── MSImmutableLayerGroup.h
│ ├── MSImmutableModelObject.h
│ ├── MSImmutablePage.h
│ ├── MSImmutableStyledLayer.h
│ ├── MSImmutableSymbolInstance.h
│ ├── MSLayer.h
│ ├── MSModelObject.h
│ └── MSPage.h
│ ├── print_export.h
│ ├── types.h
│ └── types.m
├── manifest.json
├── options-dialog.js
└── utils.js
/.appcast.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 | -
8 |
9 |
10 | -
11 |
12 |
13 | -
14 |
15 |
16 | -
17 |
18 |
19 | -
20 |
21 |
22 | -
23 |
24 |
25 | -
26 |
27 |
28 | -
29 |
30 |
31 | -
32 |
33 |
34 | -
35 |
36 |
37 | -
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # build artifacts
2 | print-export.sketchplugin
3 |
4 | # npm
5 | node_modules
6 | .npm
7 | npm-debug.log
8 |
9 | # mac
10 | .DS_Store
11 |
12 | # IDE
13 | .idea
14 | *.iml
15 | xcuserdata/
16 |
17 | api
18 | notarisation/
19 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2019 Bohemian Coding.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Print Export Plugin
2 |
3 | ⚠️ **This plugin is no longer maintained.**
4 | ---
5 |
6 | With this plugin you can export one Artboard per PDF page for printing, or export all Artboards on one Sketch page to a PDF to share User flows or prototyping overviews.
7 |
8 | You can choose to show Artboard names, shadows and prototyping links, export to a variety of standard paper sizes in landscape or portrait orientation, and even add bleed and crop marks.
9 |
10 | 
11 |
12 |
13 | ## Installation
14 |
15 | ### From a release (simplest)
16 |
17 | - Download the [latest release](https://github.com/sketch-hq/print-export-sketchplugin/releases/latest/download/print-export.sketchplugin.zip) of the plugin
18 | - Double-click the .zip archive to extract the plugin
19 | - Double-click `print-export.sketchplugin` to install the plugin
20 |
21 | ### From source
22 |
23 | You'll need [Xcode](https://itunes.apple.com/app/xcode/id497799835?mt=12) and Xcode Command Line Tools (`xcode-select --install`) installed.
24 |
25 | - Clone the repo
26 | - Install the dependencies with `npm install`
27 |
28 | ## Usage
29 |
30 | 1. Open the Sketch document you want to generate a PDF from
31 | 1. Go to _Plugins_ › _Print Export_
32 | 1. Choose your options and press _Export_
33 | 1. Choose a name for your PDF file and the location you want to save it and press _Export_
34 |
35 | In the options dialog you can specify bleed and slug. Bleed is the area that's trimmed off the page after printing, while the slug is the area beyond the bleed that contains crop marks. If you don't want to include either of these in your export, enter 0. If you do want crop marks in your export, be sure to check the "Include crop marks option" and enter a value greater than 0 for the slug. The size of the page specified is the size of the trimmed area.
36 |
--------------------------------------------------------------------------------
/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sketch-hq/print-export-sketchplugin/7ad4df2882013e02d9b50b52db05e9a51ec551ba/assets/icon.png
--------------------------------------------------------------------------------
/assets/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sketch-hq/print-export-sketchplugin/7ad4df2882013e02d9b50b52db05e9a51ec551ba/assets/screenshot.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "print-export",
3 | "version": "1.0.10",
4 | "description": "Export artboards or pages to a PDF for printing",
5 | "engines": {
6 | "sketch": ">=3.0"
7 | },
8 | "skpm": {
9 | "name": "Print Export",
10 | "manifest": "src/manifest.json",
11 | "main": "print-export.sketchplugin",
12 | "assets": [
13 | "assets/**/*"
14 | ]
15 | },
16 | "scripts": {
17 | "build": "skpm-build",
18 | "watch": "skpm-build --watch",
19 | "start": "skpm-build --watch --run",
20 | "postinstall": "npm run build && skpm-link"
21 | },
22 | "devDependencies": {
23 | "@skpm/builder": "^0.7.7"
24 | },
25 | "author": "Sketch",
26 | "license": "MIT",
27 | "repository": {
28 | "url": "https://github.com/sketch-hq/print-export-sketchplugin"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/command.js:
--------------------------------------------------------------------------------
1 | const { Orientation, Unit } = require('./enums')
2 | const { getFilename, valueWithPropertyPath } = require('./utils')
3 | const Settings = require('sketch/settings')
4 | const { ExportType, Scope } = require('./enums')
5 | const { paperSizeStandards } = require('./constants')
6 | const OptionsDialog = require('./options-dialog')
7 | const { getSelectedDocument } = require('sketch/dom')
8 | const path = require('path')
9 |
10 | const mainClassName = 'PEPrintExport'
11 | const pluginName = 'Print Export'
12 | const settingsKey = {
13 | exportType: 'exportType',
14 | scope: 'scope',
15 | showArtboardShadow: 'showArtboardShadow',
16 | showArtboardName: 'showArtboardName',
17 | showPrototypingLinks: 'showPrototypingLinks',
18 | pageSizeStandardName: 'paperSizeStandardName',
19 | pageSizeName: 'pageSizeName',
20 | orientation: 'orientation',
21 | pageWidth: 'pageWidth',
22 | pageHeight: 'pageHeight',
23 | includeCropMarks: 'includeCropMarks',
24 | bleed: 'bleed',
25 | slug: 'slug'
26 | }
27 | const defaultValues = {
28 | exportType: ExportType.SketchPagePerPage,
29 | scope: Scope.CurrentPage,
30 | showArtboardShadow: true,
31 | showArtboardName: true,
32 | showPrototypingLinks: true,
33 | paperSizeStandardIndex: 0,
34 | orientation: Orientation.Portrait,
35 | includeCropMarks: false,
36 | bleed: 0,
37 | slug: 0
38 | }
39 |
40 | export default function(context) {
41 | const document = getSelectedDocument()
42 | const optionsDialog = new OptionsDialog(pluginName, getSettings(document), context)
43 | if (optionsDialog.dialog.runModal() === NSAlertFirstButtonReturn) {
44 | setSettings(optionsDialog, document)
45 | const filePath = getFilePath(optionsDialog.scope, document)
46 | if (filePath != null) {
47 | const options = {
48 | exportType: optionsDialog.exportType,
49 | scope: optionsDialog.scope,
50 | showArtboardShadow: optionsDialog.showArtboardShadow,
51 | showArtboardName: optionsDialog.showArtboardName,
52 | showPrototypingLinks: optionsDialog.showPrototypingLinks,
53 | pageWidth: normalizeDimension(optionsDialog.pageWidth, optionsDialog.paperSizeStandard),
54 | pageHeight: normalizeDimension(optionsDialog.pageHeight, optionsDialog.paperSizeStandard),
55 | includeCropMarks: optionsDialog.includeCropMarks,
56 | bleed: normalizeDimension(optionsDialog.bleed, optionsDialog.paperSizeStandard),
57 | slug: normalizeDimension(optionsDialog.slug, optionsDialog.paperSizeStandard)
58 | }
59 | frameworkClass().generatePDFWithDocument_filePath_options_context(document.sketchObject, filePath, options, context)
60 | }
61 | }
62 | }
63 |
64 | export const onShutdown = function(context) {
65 | frameworkClass().onShutdown(context)
66 | }
67 |
68 | const frameworkClass = function() {
69 | return require('./framework/print-export.xcworkspace/contents.xcworkspacedata').getClass(mainClassName)
70 | }
71 |
72 | const getSettings = function(document) {
73 | const settings = {}
74 | settings.exportType = getSetting(settingsKey.exportType, document)
75 | settings.scope = getSetting(settingsKey.scope, document)
76 | settings.showArtboardShadow = getSetting(settingsKey.showArtboardShadow, document)
77 | settings.showArtboardName = getSetting(settingsKey.showArtboardName, document)
78 | settings.showPrototypingLinks = getSetting(settingsKey.showPrototypingLinks, document)
79 | settings.paperSizeStandardName = getSetting(settingsKey.pageSizeStandardName, document, paperSizeStandards[defaultValues.paperSizeStandardIndex].name)
80 | const paperSizeStandard = paperSizeStandards.find(paperSizeStandard => paperSizeStandard.name === settings.paperSizeStandardName)
81 | settings.pageSizeName = getSetting(settingsKey.pageSizeName, document, getDefaultPageSize(paperSizeStandard).name)
82 | const paperSize = paperSizeStandard.sizes.find(paperSize => paperSize.name === settings.pageSizeName)
83 | settings.orientation = getSetting(settingsKey.orientation, document)
84 | settings.pageWidth = getSetting(settingsKey.pageWidth, document, (settings.orientation === Orientation.Portrait ? paperSize.width : paperSize.height))
85 | settings.pageHeight = getSetting(settingsKey.pageHeight, document, (settings.orientation === Orientation.Portrait ? paperSize.height : paperSize.width))
86 | settings.includeCropMarks = getSetting(settingsKey.includeCropMarks, document)
87 | settings.bleed = getSetting(settingsKey.bleed, document)
88 | settings.slug = getSetting(settingsKey.slug, document)
89 | return settings
90 | }
91 |
92 | const getSetting = function(key, document, defaultValue = undefined) {
93 | let value = Settings.documentSettingForKey(document, key)
94 | if (value !== undefined) {
95 | return value;
96 | }
97 | value = Settings.settingForKey(key)
98 | if (value !== undefined) {
99 | return value;
100 | }
101 | if (defaultValue !== undefined) {
102 | return defaultValue
103 | }
104 | return defaultValues[key]
105 | }
106 |
107 | const setSettings = function(optionsDialog, document) {
108 | const properties = {
109 | [settingsKey.pageSizeStandardName]: 'paperSizeStandard.name',
110 | [settingsKey.pageSizeName]: 'pageSize.name'
111 | }
112 | for (let prop in settingsKey) {
113 | if (settingsKey.hasOwnProperty(prop)) {
114 | const key = settingsKey[prop]
115 | const optionsDialogProperty = properties[key] || key
116 | const value = valueWithPropertyPath(optionsDialog, optionsDialogProperty)
117 | Settings.setDocumentSettingForKey(document, key, value)
118 | Settings.setSettingForKey(key, value)
119 | }
120 | }
121 | }
122 |
123 | const getFilePath = function(scope, document) {
124 | const panel = NSSavePanel.savePanel()
125 | panel.canChooseFiles = true
126 | panel.canChooseDirectories = false
127 | panel.allowsMultipleSelection = false
128 | panel.message = 'Enter the filename of the PDF'
129 | panel.prompt = 'Export'
130 | panel.allowedFileTypes = ['pdf']
131 | switch (scope) {
132 | case Scope.CurrentPage:
133 | panel.nameFieldStringValue = Settings.documentSettingForKey(document, 'filename') || `${document.selectedPage.name}.pdf`
134 | break;
135 |
136 | case Scope.AllPages: {
137 | panel.nameFieldStringValue = Settings.documentSettingForKey(document, 'filename') || getFilename(decodeURIComponent(document.path), '.pdf') || 'Untitled.pdf'
138 | break;
139 | }
140 | }
141 | if (panel.runModal() === NSModalResponseOK) {
142 | const filePath = panel.URL().path()
143 | Settings.setDocumentSettingForKey(document, 'filename', path.basename(filePath))
144 | return filePath
145 | } else {
146 | return null
147 | }
148 | }
149 |
150 | const normalizeDimension = function(dimension, paperSizeStandard) {
151 | switch (paperSizeStandard.unit) {
152 | case Unit.Millimeter:
153 | return dimension
154 |
155 | case Unit.Inch:
156 | return dimension * 25.4
157 | }
158 | }
159 |
160 | const getDefaultPageSize = function(paperSizeStandard) {
161 | const pageSize = paperSizeStandard.sizes.find(pageSize => pageSize.default)
162 | if (pageSize) {
163 | return pageSize
164 | } else {
165 | return paperSizeStandard.sizes[0]
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/src/constants.js:
--------------------------------------------------------------------------------
1 | const { Unit } = require('./enums')
2 |
3 | export const paperSizeStandards = [
4 | {
5 | name: 'A',
6 | unit: Unit.Millimeter,
7 | sizes: [
8 | {
9 | name: 'A0',
10 | width: 841,
11 | height: 1189
12 | },
13 | {
14 | name: 'A1',
15 | width: 593,
16 | height: 841
17 | },
18 | {
19 | name: 'A2',
20 | width: 420,
21 | height: 594
22 | },
23 | {
24 | name: 'A3',
25 | width: 297,
26 | height: 420
27 | },
28 | {
29 | name: 'A4',
30 | width: 210,
31 | height: 297,
32 | default: true
33 | },
34 | {
35 | name: 'A5',
36 | width: 148,
37 | height: 210
38 | }
39 | ]
40 | },
41 | {
42 | name: 'US',
43 | unit: Unit.Inch,
44 | sizes: [
45 | {
46 | name: 'Letter',
47 | width: 8.5,
48 | height: 11
49 | },
50 | {
51 | name: 'Legal',
52 | width: 8.5,
53 | height: 14
54 | },
55 | {
56 | name: 'Tabloid',
57 | width: 11,
58 | height: 17
59 | },
60 | {
61 | name: 'Ledger',
62 | width: 17,
63 | height: 11
64 | },
65 | {
66 | name: 'Junior Legal',
67 | width: 5,
68 | height: 8
69 | },
70 | {
71 | name: 'Half Letter',
72 | width: 5.5,
73 | height: 8.5
74 | }
75 | ]
76 | }
77 | ]
--------------------------------------------------------------------------------
/src/enums.js:
--------------------------------------------------------------------------------
1 | export const Unit = {
2 | Millimeter: 0,
3 | Inch: 1
4 | }
5 |
6 | export const Orientation = {
7 | Portrait: 0,
8 | Landscape: 1
9 | }
10 |
11 | export const ExportType = {
12 | SketchPagePerPage: 0,
13 | ArtboardPerPage: 1
14 | }
15 |
16 | export const Scope = {
17 | CurrentPage: 0,
18 | AllPages: 1
19 | }
--------------------------------------------------------------------------------
/src/framework/Podfile:
--------------------------------------------------------------------------------
1 | platform :osx, :deployment_target => "10.12"
2 |
3 | target "print-export" do
4 | pod "NSLogger"
5 | end
--------------------------------------------------------------------------------
/src/framework/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - NSLogger (1.9.0):
3 | - NSLogger/ObjC (= 1.9.0)
4 | - NSLogger/ObjC (1.9.0)
5 |
6 | DEPENDENCIES:
7 | - NSLogger
8 |
9 | SPEC REPOS:
10 | https://github.com/cocoapods/specs.git:
11 | - NSLogger
12 |
13 | SPEC CHECKSUMS:
14 | NSLogger: 9f8f5ab017eb34d1a138f4905dc7fb8e9a0e3186
15 |
16 | PODFILE CHECKSUM: 9847fe983b1c62821639edf08d3b73cb2f5b3991
17 |
18 | COCOAPODS: 1.5.3
19 |
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Private/NSLogger/LoggerClient.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/LoggerClient.h
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Private/NSLogger/LoggerCommon.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/LoggerCommon.h
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Private/NSLogger/NSLogger.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/NSLogger.h
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Private/NSLogger/NSLoggerSwift.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/NSLoggerSwift.h
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Public/NSLogger/LoggerClient.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/LoggerClient.h
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Public/NSLogger/LoggerCommon.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/LoggerCommon.h
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Public/NSLogger/NSLogger.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/NSLogger.h
--------------------------------------------------------------------------------
/src/framework/Pods/Headers/Public/NSLogger/NSLoggerSwift.h:
--------------------------------------------------------------------------------
1 | ../../../NSLogger/Client/iOS/NSLoggerSwift.h
--------------------------------------------------------------------------------
/src/framework/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - NSLogger (1.9.0):
3 | - NSLogger/ObjC (= 1.9.0)
4 | - NSLogger/ObjC (1.9.0)
5 |
6 | DEPENDENCIES:
7 | - NSLogger
8 |
9 | SPEC REPOS:
10 | https://github.com/cocoapods/specs.git:
11 | - NSLogger
12 |
13 | SPEC CHECKSUMS:
14 | NSLogger: 9f8f5ab017eb34d1a138f4905dc7fb8e9a0e3186
15 |
16 | PODFILE CHECKSUM: 9847fe983b1c62821639edf08d3b73cb2f5b3991
17 |
18 | COCOAPODS: 1.5.3
19 |
--------------------------------------------------------------------------------
/src/framework/Pods/NSLogger/Client/iOS/LoggerClient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LoggerClient.h
3 | *
4 | * version 1.9.0 25-FEB-2018
5 | *
6 | * Part of NSLogger (client side)
7 | * https://github.com/fpillet/NSLogger
8 | *
9 | * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
10 | *
11 | * Copyright (c) 2010-2018 Florent Pillet All Rights Reserved.
12 | *
13 | * Redistribution and use in source and binary forms, with or without modification,
14 | * are permitted provided that the following conditions are met:
15 | *
16 | * Redistributions of source code must retain the above copyright notice,
17 | * this list of conditions and the following disclaimer. Redistributions in
18 | * binary form must reproduce the above copyright notice, this list of
19 | * conditions and the following disclaimer in the documentation and/or other
20 | * materials provided with the distribution. Neither the name of Florent
21 | * Pillet nor the names of its contributors may be used to endorse or promote
22 | * products derived from this software without specific prior written
23 | * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24 | * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
25 | * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | *
35 | */
36 | #import
37 | #import
38 | #import
39 | #import
40 | #import
41 | #import
42 | #import
43 | #if !TARGET_OS_IPHONE
44 | #import
45 | #endif
46 |
47 | // This define is here so that user application can test whether NSLogger Client is
48 | // being included in the project, and potentially configure their macros accordingly
49 | #define NSLOGGER_WAS_HERE 1
50 |
51 | /* -----------------------------------------------------------------
52 | * Logger option flags & default options
53 | * -----------------------------------------------------------------
54 | */
55 | enum {
56 | kLoggerOption_LogToConsole = 0x01,
57 | kLoggerOption_BufferLogsUntilConnection = 0x02,
58 | kLoggerOption_BrowseBonjour = 0x04,
59 | kLoggerOption_BrowseOnlyLocalDomain = 0x08,
60 | kLoggerOption_UseSSL = 0x10,
61 | kLoggerOption_CaptureSystemConsole = 0x20,
62 | kLoggerOption_BrowsePeerToPeer = 0x40
63 | };
64 |
65 | #define LOGGER_DEFAULT_OPTIONS (kLoggerOption_BufferLogsUntilConnection | \
66 | kLoggerOption_BrowseBonjour | \
67 | kLoggerOption_BrowsePeerToPeer | \
68 | kLoggerOption_BrowseOnlyLocalDomain | \
69 | kLoggerOption_UseSSL | \
70 | kLoggerOption_CaptureSystemConsole)
71 |
72 | // The Logger struct is no longer public, use the new LoggerGet[...] functions instead
73 | typedef struct Logger Logger;
74 |
75 | /* -----------------------------------------------------------------
76 | * LOGGING FUNCTIONS
77 | * -----------------------------------------------------------------
78 | */
79 |
80 | #ifdef __cplusplus
81 | extern "C" {
82 | #endif
83 |
84 | // Prevents the linker from stripping NSLogger functions
85 | // This is mainly for linked frameworks to be able to use NSLogger dynamically.
86 | // If you DO WANT this functionality, you need to define NSLOGGER_ALLOW_NOSTRIP
87 | // somewhere in the header files included before this one.
88 | #ifdef NSLOGGER_ALLOW_NOSTRIP
89 | #define NSLOGGER_NOSTRIP __attribute__((used))
90 | #else
91 | #define NSLOGGER_NOSTRIP
92 | #endif
93 |
94 | #define NSLOGGER_IGNORE_NULLABILITY_BEGIN \
95 | _Pragma("clang diagnostic push") \
96 | _Pragma("clang diagnostic ignored \"-Wnullability-completeness\"")
97 |
98 | #define NSLOGGER_IGNORE_NULLABILITY_END \
99 | _Pragma("clang diagnostic pop")
100 |
101 | NSLOGGER_IGNORE_NULLABILITY_BEGIN
102 |
103 | // Set the default logger which will be the one used when passing NULL for logge
104 | extern void LoggerSetDefaultLogger(Logger *aLogger) NSLOGGER_NOSTRIP;
105 |
106 | // Get the default logger, create one if it does not exist
107 | extern Logger *LoggerGetDefaultLogger(void) NSLOGGER_NOSTRIP;
108 |
109 | // Checks whether the default logger exists, returns it if YES, otherwise do NO create one
110 | extern Logger *LoggerCheckDefaultLogger(void) NSLOGGER_NOSTRIP;
111 |
112 | // Initialize a new logger, set as default logger if this is the first one
113 | // Options default to:
114 | // - logging to console = NO
115 | // - buffer until connection = YES
116 | // - browse Bonjour = YES
117 | // - browse only locally on Bonjour = YES
118 | extern Logger* LoggerInit(void) NSLOGGER_NOSTRIP;
119 |
120 | // Set logger options if you don't want the default options (see above)
121 | extern void LoggerSetOptions(Logger *logger, uint32_t options) NSLOGGER_NOSTRIP;
122 | extern uint32_t LoggerGetOptions(Logger *logger) NSLOGGER_NOSTRIP;
123 |
124 | // Set Bonjour logging names, so you can force the logger to use a specific service type
125 | // or direct logs to the machine on your network which publishes a specific name
126 | extern void LoggerSetupBonjour(Logger *logger, CFStringRef bonjourServiceType, CFStringRef bonjourServiceName) NSLOGGER_NOSTRIP;
127 | extern CFStringRef LoggerGetBonjourServiceType(Logger *logger) NSLOGGER_NOSTRIP;
128 | extern CFStringRef LoggerGetBonjourServiceName(Logger *logger) NSLOGGER_NOSTRIP;
129 |
130 | // Set Bonjour logging name to be the username who compiled the LoggerClient.m file.
131 | // This is useful when several NSLogger users are on the same network. This can only be
132 | // used when NSLogger is integrated as source code or via with CocoaPods.
133 | extern void LoggerSetupBonjourForBuildUser(void) NSLOGGER_NOSTRIP;
134 |
135 | // Directly set the viewer host (hostname or IP address) and port we want to connect to. If set, LoggerStart() will
136 | // try to connect there first before trying Bonjour
137 | extern void LoggerSetViewerHost(Logger *logger, CFStringRef hostName, UInt32 port) NSLOGGER_NOSTRIP;
138 | extern CFStringRef LoggerGetViewerHostName(Logger *logger) NSLOGGER_NOSTRIP;
139 | extern UInt32 LoggerGetViewerPort(Logger *logger) NSLOGGER_NOSTRIP;
140 |
141 | // Configure the logger to use a local file for buffering, instead of memory.
142 | // - If you initially set a buffer file after logging started but while a logger connection
143 | // has not been acquired, the contents of the log queue will be written to the buffer file
144 | // the next time a logging function is called, or when LoggerStop() is called.
145 | // - If you want to change the buffering file after logging started, you should first
146 | // call LoggerStop() the call LoggerSetBufferFile(). Note that all logs stored in the previous
147 | // buffer file WON'T be transferred to the new file in this case.
148 | extern void LoggerSetBufferFile(Logger *logger, CFStringRef absolutePath) NSLOGGER_NOSTRIP;
149 | extern CFStringRef LoggerGetBufferFile(Logger *logger) NSLOGGER_NOSTRIP;
150 |
151 | // Activate the logger, try connecting. You can pass NULL to start the default logger,
152 | // it will return a pointer to it.
153 | extern Logger* LoggerStart(Logger *logger) NSLOGGER_NOSTRIP;
154 |
155 | //extern void LoggerConnectToHost(CFDataRef address, int port);
156 |
157 | // Deactivate and free the logger.
158 | extern void LoggerStop(Logger *logger) NSLOGGER_NOSTRIP;
159 |
160 | // Pause the current thread until all messages from the logger have been transmitted
161 | // this is useful to use before an assert() aborts your program. If waitForConnection is YES,
162 | // LoggerFlush() will block even if the client is not currently connected to the desktop
163 | // viewer. You should be using NO most of the time, but in some cases it can be useful.
164 | extern void LoggerFlush(Logger *logger, BOOL waitForConnection) NSLOGGER_NOSTRIP;
165 |
166 | /* Logging functions. Each function exists in four versions:
167 | *
168 | * - one without a Logger instance (uses default logger) and without filename/line/function (no F suffix)
169 | * - one without a Logger instance but with filename/line/function (F suffix)
170 | * - one with a Logger instance (use a specific Logger) and without filename/line/function (no F suffix)
171 | * - one with a Logger instance (use a specific Logger) and with filename/line/function (F suffix)
172 | *
173 | * The exception being the single LogMessageCompat() function which is designed to be a drop-in replacement for NSLog()
174 | *
175 | */
176 |
177 | // Log a message, calling format compatible with NSLog
178 | extern void LogMessageCompat(NSString *format, ...) NSLOGGER_NOSTRIP;
179 |
180 | // Log a message without any formatting (just log the given string)
181 | extern void LogMessageRaw(NSString *message) NSLOGGER_NOSTRIP;
182 | extern void LogMessageRawF(const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSString *message) NSLOGGER_NOSTRIP;
183 | extern void LogMessageRawToF(Logger *logger, const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSString *message) NSLOGGER_NOSTRIP;
184 |
185 | // Log a message. domain can be nil if default domain.
186 | extern void LogMessage(NSString *domain, int level, NSString *format, ...) NS_FORMAT_FUNCTION(3,4) NSLOGGER_NOSTRIP;
187 | extern void LogMessageF(const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSString *format, ...) NS_FORMAT_FUNCTION(6,7) NSLOGGER_NOSTRIP;
188 | extern void LogMessageTo(Logger *logger, NSString *domain, int level, NSString *format, ...) NS_FORMAT_FUNCTION(4,5) NSLOGGER_NOSTRIP;
189 | extern void LogMessageToF(Logger *logger, const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSString *format, ...) NS_FORMAT_FUNCTION(7,8) NSLOGGER_NOSTRIP;
190 |
191 | // Log a message. domain can be nil if default domain (versions with va_list format args instead of ...)
192 | extern void LogMessage_va(NSString *domain, int level, NSString *format, va_list args) NS_FORMAT_FUNCTION(3,0) NSLOGGER_NOSTRIP;
193 | extern void LogMessageF_va(const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSString *format, va_list args) NS_FORMAT_FUNCTION(6,0) NSLOGGER_NOSTRIP;
194 | extern void LogMessageTo_va(Logger *logger, NSString *domain, int level, NSString *format, va_list args) NS_FORMAT_FUNCTION(4,0) NSLOGGER_NOSTRIP;
195 | extern void LogMessageToF_va(Logger *logger, const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSString *format, va_list args) NS_FORMAT_FUNCTION(7,0) NSLOGGER_NOSTRIP;
196 |
197 | // Send binary data to remote logger
198 | extern void LogData(NSString *domain, int level, NSData *data) NSLOGGER_NOSTRIP;
199 | extern void LogDataF(const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSData *data) NSLOGGER_NOSTRIP;
200 | extern void LogDataTo(Logger *logger, NSString *domain, int level, NSData *data) NSLOGGER_NOSTRIP;
201 | extern void LogDataToF(Logger *logger, const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, NSData *data) NSLOGGER_NOSTRIP;
202 |
203 | // Send image data to remote logger
204 | extern void LogImageData(NSString *domain, int level, int width, int height, NSData *data) NSLOGGER_NOSTRIP;
205 | extern void LogImageDataF(const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, int width, int height, NSData *data) NSLOGGER_NOSTRIP;
206 | extern void LogImageDataTo(Logger *logger, NSString *domain, int level, int width, int height, NSData *data) NSLOGGER_NOSTRIP;
207 | extern void LogImageDataToF(Logger *logger, const char *filename, int lineNumber, const char *functionName, NSString *domain, int level, int width, int height, NSData *data) NSLOGGER_NOSTRIP;
208 |
209 | // Mark the start of a block. This allows the remote logger to group blocks together
210 | extern void LogStartBlock(NSString *format, ...) NS_FORMAT_FUNCTION(1,2) NSLOGGER_NOSTRIP;
211 | extern void LogStartBlockTo(Logger *logger, NSString *format, ...) NS_FORMAT_FUNCTION(2,3) NSLOGGER_NOSTRIP;
212 |
213 | // Mark the end of a block
214 | extern void LogEndBlock(void) NSLOGGER_NOSTRIP;
215 | extern void LogEndBlockTo(Logger *logger) NSLOGGER_NOSTRIP;
216 |
217 | // Log a marker (text can be null)
218 | extern void LogMarker(NSString *text) NSLOGGER_NOSTRIP;
219 | extern void LogMarkerTo(Logger *logger, NSString *text) NSLOGGER_NOSTRIP;
220 |
221 | NSLOGGER_IGNORE_NULLABILITY_END
222 |
223 | // Swift fastpath logging functions
224 | extern void LogMessage_noFormat(NSString * _Nullable filename,
225 | NSInteger lineNumber,
226 | NSString * _Nullable functionName,
227 | NSString * _Nullable domain,
228 | NSInteger level,
229 | NSString * _Nonnull message) NSLOGGER_NOSTRIP;
230 |
231 | extern void LogImage_noFormat(NSString * _Nullable filename,
232 | NSInteger lineNumber,
233 | NSString * _Nullable functionName,
234 | NSString * _Nullable domain,
235 | NSInteger level,
236 | NSInteger width,
237 | NSInteger height,
238 | NSData * _Nonnull data) NSLOGGER_NOSTRIP;
239 |
240 | extern void LogData_noFormat(NSString * _Nullable filename,
241 | NSInteger lineNumber,
242 | NSString * _Nullable functionName,
243 | NSString * _Nullable domain,
244 | NSInteger level,
245 | NSData * _Nonnull data) NSLOGGER_NOSTRIP;
246 |
247 | #ifdef __cplusplus
248 | };
249 | #endif
250 |
--------------------------------------------------------------------------------
/src/framework/Pods/NSLogger/Client/iOS/LoggerCommon.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LoggerCommon.h
3 | *
4 | * version 1.9.0 25-FEB-2018
5 | *
6 | * Definitions common to NSLogger Viewer and NSLoggerClient
7 | * for the binary messages format
8 | * https://github.com/fpillet/NSLogger
9 | *
10 | * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
11 | *
12 | * Copyright (c) 2010-2018 Florent Pillet All Rights Reserved.
13 | *
14 | * Redistribution and use in source and binary forms, with or without modification,
15 | * are permitted provided that the following conditions are met:
16 | *
17 | * Redistributions of source code must retain the above copyright notice,
18 | * this list of conditions and the following disclaimer. Redistributions in
19 | * binary form must reproduce the above copyright notice, this list of
20 | * conditions and the following disclaimer in the documentation and/or other
21 | * materials provided with the distribution. Neither the name of Florent
22 | * Pillet nor the names of its contributors may be used to endorse or promote
23 | * products derived from this software without specific prior written
24 | * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
25 | * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
26 | * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
30 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /* NSLogger native binary message format:
39 | * Each message is a dictionary encoded in a compact format. All values are stored
40 | * in network order (big endian). A message is made of several "parts", which are
41 | * typed chunks of data, each with a specific purpose (partKey), data type (partType)
42 | * and data size (partSize).
43 | *
44 | * uint32_t totalSize (total size for the whole message excluding this 4-byte count)
45 | * uint16_t partCount (number of parts below)
46 | * [repeat partCount times]:
47 | * uint8_t partKey the part key
48 | * uint8_t partType (string, binary, image, int16, int32, int64)
49 | * uint32_t partSize (only for string, binary and image types, others are implicit)
50 | * .. `partSize' data bytes
51 | *
52 | * Complete message is usually made of:
53 | * - a PART_KEY_MESSAGE_TYPE (mandatory) which contains one of the LOGMSG_TYPE_* values
54 | * - a PART_KEY_TIMESTAMP_S (mandatory) which is the timestamp returned by gettimeofday() (seconds from 01.01.1970 00:00)
55 | * - a PART_KEY_TIMESTAMP_MS (optional) complement of the timestamp seconds, in milliseconds
56 | * - a PART_KEY_TIMESTAMP_US (optional) complement of the timestamp seconds and milliseconds, in microseconds
57 | * - a PART_KEY_THREAD_ID (mandatory) the ID of the user thread that produced the log entry
58 | * - a PART_KEY_TAG (optional) a tag that helps categorizing and filtering logs from your application, and shows up in viewer logs
59 | * - a PART_KEY_LEVEL (optional) a log level that helps filtering logs from your application (see as few or as much detail as you need)
60 | * - a PART_KEY_MESSAGE which is the message text, binary data or image
61 | * - a PART_KEY_MESSAGE_SEQ which is the message sequence number (message# sent by client)
62 | * - a PART_KEY_FILENAME (optional) with the filename from which the log was generated
63 | * - a PART_KEY_LINENUMBER (optional) the linenumber in the filename at which the log was generated
64 | * - a PART_KEY_FUNCTIONNAME (optional) the function / method / selector from which the log was generated
65 | * - if logging an image, PART_KEY_IMAGE_WIDTH and PART_KEY_IMAGE_HEIGHT let the desktop know the image size without having to actually decode it
66 | */
67 |
68 | // Constants for the "part key" field
69 | #define PART_KEY_MESSAGE_TYPE 0
70 | #define PART_KEY_TIMESTAMP_S 1 // "seconds" component of timestamp
71 | #define PART_KEY_TIMESTAMP_MS 2 // milliseconds component of timestamp (optional, mutually exclusive with PART_KEY_TIMESTAMP_US)
72 | #define PART_KEY_TIMESTAMP_US 3 // microseconds component of timestamp (optional, mutually exclusive with PART_KEY_TIMESTAMP_MS)
73 | #define PART_KEY_THREAD_ID 4
74 | #define PART_KEY_TAG 5
75 | #define PART_KEY_LEVEL 6
76 | #define PART_KEY_MESSAGE 7
77 | #define PART_KEY_IMAGE_WIDTH 8 // messages containing an image should also contain a part with the image size
78 | #define PART_KEY_IMAGE_HEIGHT 9 // (this is mainly for the desktop viewer to compute the cell size without having to immediately decode the image)
79 | #define PART_KEY_MESSAGE_SEQ 10 // the sequential number of this message which indicates the order in which messages are generated
80 | #define PART_KEY_FILENAME 11 // when logging, message can contain a file name
81 | #define PART_KEY_LINENUMBER 12 // as well as a line number
82 | #define PART_KEY_FUNCTIONNAME 13 // and a function or method name
83 |
84 | // Constants for parts in LOGMSG_TYPE_CLIENTINFO
85 | #define PART_KEY_CLIENT_NAME 20
86 | #define PART_KEY_CLIENT_VERSION 21
87 | #define PART_KEY_OS_NAME 22
88 | #define PART_KEY_OS_VERSION 23
89 | #define PART_KEY_CLIENT_MODEL 24 // For iPhone, device model (i.e 'iPhone', 'iPad', etc)
90 | #define PART_KEY_UNIQUEID 25 // for remote device identification, part of LOGMSG_TYPE_CLIENTINFO
91 |
92 | // Area starting at which you may define your own constants
93 | #define PART_KEY_USER_DEFINED 100
94 |
95 | // Constants for the "partType" field
96 | #define PART_TYPE_STRING 0 // Strings are stored as UTF-8 data
97 | #define PART_TYPE_BINARY 1 // A block of binary data
98 | #define PART_TYPE_INT16 2
99 | #define PART_TYPE_INT32 3
100 | #define PART_TYPE_INT64 4
101 | #define PART_TYPE_IMAGE 5 // An image, stored in PNG format
102 |
103 | // Data values for the PART_KEY_MESSAGE_TYPE parts
104 | #define LOGMSG_TYPE_LOG 0 // A standard log message
105 | #define LOGMSG_TYPE_BLOCKSTART 1 // The start of a "block" (a group of log entries)
106 | #define LOGMSG_TYPE_BLOCKEND 2 // The end of the last started "block"
107 | #define LOGMSG_TYPE_CLIENTINFO 3 // Information about the client app
108 | #define LOGMSG_TYPE_DISCONNECT 4 // Pseudo-message on the desktop side to identify client disconnects
109 | #define LOGMSG_TYPE_MARK 5 // Pseudo-message that defines a "mark" that users can place in the log flow
110 |
111 | // Default Bonjour service identifiers
112 | #define LOGGER_SERVICE_TYPE_SSL CFSTR("_nslogger-ssl._tcp")
113 | #define LOGGER_SERVICE_TYPE CFSTR("_nslogger._tcp")
114 |
--------------------------------------------------------------------------------
/src/framework/Pods/NSLogger/Client/iOS/NSLogger.h:
--------------------------------------------------------------------------------
1 | /*
2 | * NSLogger.h
3 | *
4 | * version 1.9.0 25-FEB-2018
5 | *
6 | * Part of NSLogger (client side)
7 | * https://github.com/fpillet/NSLogger
8 | *
9 | * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
10 | *
11 | * Copyright (c) 2010-2018 Florent Pillet All Rights Reserved.
12 | *
13 | * Redistribution and use in source and binary forms, with or without modification,
14 | * are permitted provided that the following conditions are met:
15 | *
16 | * Redistributions of source code must retain the above copyright notice,
17 | * this list of conditions and the following disclaimer. Redistributions in
18 | * binary form must reproduce the above copyright notice, this list of
19 | * conditions and the following disclaimer in the documentation and/or other
20 | * materials provided with the distribution. Neither the name of Florent
21 | * Pillet nor the names of its contributors may be used to endorse or promote
22 | * products derived from this software without specific prior written
23 | * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24 | * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
25 | * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | *
35 | */
36 |
37 | #import "LoggerClient.h"
38 |
39 |
40 | // Log level usual usage:
41 | // Level 0: errors only!
42 | // Level 1: important informations, app states…
43 | // Level 2: less important logs, network requests…
44 | // Level 3: network responses, datas and images…
45 | // Level 4: really not important stuff.
46 |
47 |
48 |
49 | #ifdef DEBUG
50 | #define NSLog(...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"NSLog", 0, __VA_ARGS__)
51 | #define LoggerError(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Error", level, __VA_ARGS__)
52 | #define LoggerApp(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"App", level, __VA_ARGS__)
53 | #define LoggerView(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"View", level, __VA_ARGS__)
54 | #define LoggerService(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Service", level, __VA_ARGS__)
55 | #define LoggerModel(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Model", level, __VA_ARGS__)
56 | #define LoggerData(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Data", level, __VA_ARGS__)
57 | #define LoggerNetwork(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Network", level, __VA_ARGS__)
58 | #define LoggerLocation(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Location", level, __VA_ARGS__)
59 | #define LoggerPush(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Push", level, __VA_ARGS__)
60 | #define LoggerFile(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"File", level, __VA_ARGS__)
61 | #define LoggerSharing(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Sharing", level, __VA_ARGS__)
62 | #define LoggerAd(level, ...) LogMessageF(__FILE__, __LINE__, __FUNCTION__, @"Ad and Stat", level, __VA_ARGS__)
63 |
64 | #else
65 | #define NSLog(...) LogMessageCompat(__VA_ARGS__)
66 | #define LoggerError(...) while(0) {}
67 | #define LoggerApp(level, ...) while(0) {}
68 | #define LoggerView(...) while(0) {}
69 | #define LoggerService(...) while(0) {}
70 | #define LoggerModel(...) while(0) {}
71 | #define LoggerData(...) while(0) {}
72 | #define LoggerNetwork(...) while(0) {}
73 | #define LoggerLocation(...) while(0) {}
74 | #define LoggerPush(...) while(0) {}
75 | #define LoggerFile(...) while(0) {}
76 | #define LoggerSharing(...) while(0) {}
77 | #define LoggerAd(...) while(0) {}
78 |
79 | #endif
80 |
81 |
82 |
83 | /// Stringification, see this:
84 | /// http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
85 | #define nslogger_xstr(s) nslogger_str(s)
86 | #define nslogger_str(s) #s
87 |
88 |
89 |
90 | // Starts the logger with the username defined in the build settings.
91 | // The build setting NSLOGGER_BUILD_USERNAME is automatically configured when NSLogger is
92 | // added to a project using CocoaPods. To use it, just add this macro call to your main() function.
93 | #define LoggerStartForBuildUser() LoggerSetupBonjour(LoggerGetDefaultLogger(), NULL, CFSTR(nslogger_xstr(NSLOGGER_BUILD_USERNAME)))
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/src/framework/Pods/NSLogger/Client/iOS/NSLoggerSwift.h:
--------------------------------------------------------------------------------
1 | /*
2 | * NSLoggerSwift.h
3 | *
4 | * version 1.9.0 25-FEB-2018
5 | *
6 | * Part of NSLogger (client side)
7 | * https://github.com/fpillet/NSLogger
8 | *
9 | * BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
10 | *
11 | * Copyright (c) 2010-2018 Florent Pillet All Rights Reserved.
12 | *
13 | * Redistribution and use in source and binary forms, with or without modification,
14 | * are permitted provided that the following conditions are met:
15 | *
16 | * Redistributions of source code must retain the above copyright notice,
17 | * this list of conditions and the following disclaimer. Redistributions in
18 | * binary form must reproduce the above copyright notice, this list of
19 | * conditions and the following disclaimer in the documentation and/or other
20 | * materials provided with the distribution. Neither the name of Florent
21 | * Pillet nor the names of its contributors may be used to endorse or promote
22 | * products derived from this software without specific prior written
23 | * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24 | * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
25 | * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | *
35 | */
36 |
37 | #import
38 | #import "NSLogger.h"
39 |
40 | //! Project version number for LoggerSwift.
41 | FOUNDATION_EXPORT double LoggerSwiftVersionNumber;
42 |
43 | //! Project version string for LoggerSwift.
44 | FOUNDATION_EXPORT const unsigned char LoggerSwiftVersionString[];
45 |
--------------------------------------------------------------------------------
/src/framework/Pods/NSLogger/LICENSE.txt:
--------------------------------------------------------------------------------
1 | BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
2 |
3 | Copyright (c) 2010-2013, Florent Pillet All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification, are
6 | permitted provided that the following conditions are met:
7 |
8 | Redistributions of source code must retain the above copyright notice, this list of
9 | conditions and the following disclaimer. Redistributions in binary form must
10 | reproduce the above copyright notice, this list of conditions and the following
11 | disclaimer in the documentation and/or other materials provided with the
12 | distribution. Neither the name of Florent Pillet nor the names of its
13 | contributors may be used to endorse or promote products derived from this software
14 | without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
15 | HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
16 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
17 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21 | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 |
--------------------------------------------------------------------------------
/src/framework/Pods/NSLogger/README.markdown:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # NSLogger
6 |
7 | [](https://dashboard.buddybuild.com/apps/5914439af77e0000015a7b82/build/latest?branch=master)
8 | [](http://cocoadocs.org/docsets/NSLogger/)
9 | [](https://github.com/Carthage/Carthage)
10 | [](http://cocoadocs.org/docsets/NSLogger/)
11 | [](http://opensource.org/licenses/BSD-3-Clause)
12 | [](https://www.versioneye.com/objective-c/nslogger/references)
13 |
14 | **NSLogger** is a high performance logging utility which displays traces emitted by client applications running on *macOS*, *iOS* and *Android*. It replaces traditional console logging traces (*NSLog()*, Java *Log*).
15 |
16 | The **NSLogger Viewer** runs on macOS and replaces *Xcode*, *Android Studio* or *Eclipse* consoles. It provides powerful additions like display filtering, defining log domain and level, image and binary logging, message coloring, traces buffering, timing information, link with source code, etc.
17 |
18 |
19 |
20 |
21 |
22 | **NSLogger** feature summary:
23 |
24 | * View logs using the desktop application
25 | * Logs can be sent from device or simulator
26 | * Accept connections from local network clients (using *Bonjour*) or remote clients connecting directly over the internet
27 | * Online (application running and connected to *NSLogger*) and offline (saved logs) log viewing
28 | * Buffer all traces in memory or in a file, send them over to viewer when a connection is acquired
29 | * Define a log domain (app, view, model, controller, network…) and an importance level (error, warning, debug, noise…)
30 | * Color the log messages using regexp
31 | * Log images or raw binary data
32 | * Secure logging (connections use SSL by default)
33 | * Advanced log filtering options
34 | * Save viewer logs to share them and/or review them later
35 | * Export logs to text files
36 | * Open raw buffered traces files that you brought back from client applications not directly connected to the log viewer
37 |
38 | Here is what it looks like in action:
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | # Basic Usage
47 |
48 | Without any change to your code, all the `NSLog()` logs from your application are redirected to the NSLogger desktop viewer. The viewer is found automatically on your network, using Bonjour.
49 |
50 | A rich API lets you log messages, binary data or images with a lot of detail. Simple wrappers are available for your convenience:
51 |
52 | **Swift** wrapper API:
53 |
54 | ```swift
55 | import NSLogger
56 |
57 | […]
58 |
59 | // logging some messages
60 | Log(.Network, .Info, "Checking paper level…")
61 |
62 | // logging image
63 | Log(.View, .Noise, myPrettyImage)
64 |
65 | // logging data
66 | Log(.Custom("My Domain"), .Noise, someDataObject)
67 |
68 | ```
69 |
70 | **Objective-C** wrapper API:
71 |
72 | ```objective-c
73 | #import
74 |
75 | […]
76 |
77 | LoggerApp(1, @"Hello world! Today is: %@", [self myDate]);
78 | LoggerNetwork(1, @"Hello world! Today is: %@", [self myDate]);
79 | ```
80 |
81 |
82 |
83 | # Installation
84 |
85 | - **Step 1.** Download the *NSLogger desktop app* on your Mac.
86 | - **Step 2.** Add the *NSLogger framework* to your project.
87 | - **Step 3.** There is no step 3…
88 |
89 | ## Desktop Viewer Download
90 |
91 | Download the pre-built, signed version of the [NSLogger desktop viewer](https://github.com/fpillet/NSLogger/releases) for macOS. Don't forget to launch the application on your Mac. It won't show a window until a client connects to it and starts logging.
92 |
93 | ## Client Framework Install
94 |
95 | ### CocoaPods Install
96 |
97 | If your project is configured to use [CocoaPods](https://cocoapods.org/), just add this line to your `Podfile`:
98 |
99 | ```ruby
100 | pod "NSLogger"
101 | ```
102 |
103 | The above only includes C and Obj-C APIs and is suitable for use in applications without any Swift code.
104 | Swift syntactic sugar APIs are added with the `Swift` subspec. If you're developing code in Swift or a mixed Swift / Obj-C environment, use:
105 |
106 | ```ruby
107 | pod "NSLogger/Swift"
108 | ```
109 |
110 | Note that you don't strictly need to include the `/Swift` variant for your Swift applications. You can perfectly develop your own extensions that call into NSLogger's C APIs without using the basic provided ones.
111 |
112 | Finally if you are using frameworks or libraries that may use NSLogger, then you can use the `NoStrip` variant which forces the linker to keep all NSLogger functions in the final build, even those that your code doesn't use. Since linked in frameworks may dynamically check for the presence of NSLogger functions, this is required as the linker wouldn't see this use.
113 |
114 | ```ruby
115 | pod "NSLogger/NoStrip"
116 | ```
117 |
118 | ### Carthage Install
119 |
120 | NSLogger is Carthage-compatible. It builds two frameworks: `NSLogger` and `NSLoggerSwift`. You'll need to pick either one (but not both) to use in your application. Both can be used with Swift, the `NSLoggerSwift` variant adds a simple Swift layer to make NSLogger easier to use from Swift code. You can perfectly develop your own extensions that call into NSLogger's C APIs without using the basic provided ones, and just use the `NSLogger` framework.
121 |
122 | Depending on the framework you choose, your code will need to `import NSLogger` or `import NSLoggerSwift`. This is a difference with Cocoapods support where you always `import NSLogger`.
123 |
124 | ```
125 | github "fpillet/NSLogger"
126 | ```
127 |
128 | **or**
129 |
130 | ```
131 | github "fpillet/NSLoggerSwift"
132 | ```
133 |
134 |
135 | Then run:
136 |
137 | ```shell
138 | $ carthage update
139 | ```
140 |
141 | Again, the `NSLogger.xcodeproj` top-level project offers two targets (`NSLogger` and `NSLoggerSwift`). Add the built framework that suits your needs.
142 |
143 | # Advanced Usage
144 |
145 | ## Using NSLogger on a Shared Network
146 |
147 | The first log sent by NSLogger will start the logger, by default on the first *Bonjour* service encountered. But when multiple NSLogger users share the same network, logger connections can get mixed.
148 |
149 | To avoid confusion between users, just add this when you app starts (for example, in the `applicationDidFinishLaunching` method:
150 |
151 | ```objc
152 | LoggerSetupBonjourForBuildUser();
153 | ```
154 |
155 | Then, in the *Preferences* pane of the NSLogger.app desktop viewer, go to the `Network` tab. Type your user name (i.e. `$USER`) in the "*Bonjour service name*" text field.
156 |
157 | This will allow the traces to be received only by the computer of the user who compiled the app.
158 |
159 | *This only work when NSLogger has been added to your project using CocoaPods*.
160 |
161 | ## Manual Framework Install
162 |
163 | When using NSLogger without CocoaPods, add `LoggerClient.h`, `LoggerClient.m` and `LoggerCommon.h` (as well as add the `CFNetwork.framework` and `SystemConfiguration.framework` frameworks) to your iOS or Mac OS X application, then replace your *NSLog()* calls with *LogMessageCompat()* calls. We recommend using a macro, so you can turn off logs when building the distribution version of your application.
164 |
165 | ## How Does the Connection Work?
166 |
167 | For automatic discovery of the desktop viewer, your application must run on a device that is on the same network as your Mac. When your app starts logging, the NSLogger framework automatically (by default) looks for the desktop viewer using *Bonjour*. As soon as traces start coming, a new window will open on your Mac.
168 |
169 | Advanced users can setup a Remote Host / Port to log from a client to a specific host), or specify a Bonjour name in case there are multiple viewers on the network.
170 |
171 | ## Advanced Desktop Viewer Features
172 |
173 | The desktop viewer application provides tools like:
174 |
175 | * Filters (with [regular expression matching](https://github.com/fpillet/NSLogger/wiki/Tips-and-tricks)) that let your perform data mining in your logs
176 | * Timing information: each message displays the time elapsed since the previous message in the filtered display, so you can get a sense of time between events in your application.
177 | * Image and binary data display directly in the log window
178 | * [Markers](https://github.com/fpillet/NSLogger/wiki/Tips-and-tricks) (when a client is connected, place a marker at the end of a log to clearly see what happens afterwards, for example place a marker before pressing a button in your application)
179 | * Fast navigation in your logs
180 | * Display and export all your logs as text
181 | * Optional display of file, line and function for uncluttered display
182 |
183 | Your logs can be saved to a `.nsloggerdata` file, and reloaded later. When logging to a file, name your log file with extension `.rawnsloggerdata` so NSLogger can reopen and process it. You can have clients remotely generating raw logger data files, then send them to you so you can investigate post-mortem.
184 |
185 | Note that the NSLogger Mac OS X viewer requires **Mac OS X 10.6 or later**.
186 |
187 |
188 |
189 |
190 |
191 | ## Advanced Colors Configuration
192 |
193 | Apply colors to tags and messages using regular expressions.
194 |
195 |
196 |
197 |
198 |
199 | To define the color, you can use:
200 | - A standard NSColor name, for example: `blue`
201 | - Hex colors, for example: `#DEAD88`
202 | - You can add the prefix `bold`, for example: `bold red`
203 |
204 | ## High Performance, Low Overhead
205 |
206 | The *NSLogger* framework runs in its own thread in your application. It tries hard to consume as few CPU and memory as possible. If the desktop viewer has not been found yet, your traces can be buffered in memory until a connection is acquired. This allows for tracing in difficult situations, for example device wakeup times when the network connection is not up and running.
207 |
208 |
209 | # Credits
210 |
211 | NSLogger is Copyright (c) 2010-2018 Florent Pillet, All Rights Reserved, All Wrongs Revenged. Released under the [New BSD Licence](http://opensource.org/licenses/bsd-license.php). NSLogger uses parts of [Brandon Walkin's BWToolkit](http://www.brandonwalkin.com/bwtoolkit/), for which source code is included with the NSLogger viewer application. The NSLogger icon is Copyright (c) [Louis Harboe](http://harboe.me/)
212 |
--------------------------------------------------------------------------------
/src/framework/Pods/Pods.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 09CD3815FD9156142D05D32ADE90C135 /* NSLoggerSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = C4A088FAB8678982EF89A51203631E57 /* NSLoggerSwift.h */; settings = {ATTRIBUTES = (Project, ); }; };
11 | 271081336E65901FC5F04FFC03D48671 /* LoggerCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D9080DC597B8DB0776CF0ACD701F76B /* LoggerCommon.h */; settings = {ATTRIBUTES = (Project, ); }; };
12 | 5644680B6C5FA876602E4F0E93F73722 /* Pods-print-export-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B0D18D348C433F4BA5CC7DF88C4982A4 /* Pods-print-export-dummy.m */; };
13 | 60F95215219732E4A039BD638E128C38 /* LoggerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B27E0D9628495B84BA0A9DDD4C72D19 /* LoggerClient.h */; settings = {ATTRIBUTES = (Project, ); }; };
14 | 643133FB3FA76D46A4873CEE0B42F573 /* NSLogger-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 099B7EA6B12EB54DDA9DE8BAF6D260EA /* NSLogger-dummy.m */; };
15 | 6D945D61BDE3A5D95C3CCE00B8B8AA0E /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0952D8F020E5DA9016EED114B914E3D8 /* CFNetwork.framework */; };
16 | 712282ECEA8B9AFBDADDB717A9A89410 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4201E88D77D6C3E68A23234485A81A71 /* CoreServices.framework */; };
17 | 740853AF6408466B225104CCC95B15AB /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB5592D02FFECC203E7F3E88B33AAFD0 /* SystemConfiguration.framework */; };
18 | 9485D048058F2571BAEE7B3FA3D60367 /* NSLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = E33F0971B363B5331512820B4F2F058B /* NSLogger.h */; settings = {ATTRIBUTES = (Project, ); }; };
19 | B07FA9A1B160CDEE45405B10C860FEC5 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 244AE836532981EBB6D8DE5ACD3F561D /* AppKit.framework */; };
20 | EAC8F2A2D3946954403C29FF04730841 /* LoggerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 28213DC103549FF68F784ECD895724CA /* LoggerClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXContainerItemProxy section */
24 | 7953A201D2E4D9CFDA04E342E3656387 /* PBXContainerItemProxy */ = {
25 | isa = PBXContainerItemProxy;
26 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
27 | proxyType = 1;
28 | remoteGlobalIDString = B16F2B66D8FCF7535BE2C547F63D74B8;
29 | remoteInfo = NSLogger;
30 | };
31 | /* End PBXContainerItemProxy section */
32 |
33 | /* Begin PBXFileReference section */
34 | 079C18C235012BDA6F3298179DA501B1 /* Pods-print-export.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-print-export.release.xcconfig"; sourceTree = ""; };
35 | 0952D8F020E5DA9016EED114B914E3D8 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
36 | 099B7EA6B12EB54DDA9DE8BAF6D260EA /* NSLogger-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSLogger-dummy.m"; sourceTree = ""; };
37 | 09D125C667B392353ECF7AFB75F85049 /* Pods-print-export-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-print-export-acknowledgements.markdown"; sourceTree = ""; };
38 | 0B27E0D9628495B84BA0A9DDD4C72D19 /* LoggerClient.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LoggerClient.h; path = Client/iOS/LoggerClient.h; sourceTree = ""; };
39 | 244AE836532981EBB6D8DE5ACD3F561D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = DEVELOPER_DIR; };
40 | 2634459D5FC6C6452BE02B2AF2893EF7 /* Pods-print-export-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-print-export-resources.sh"; sourceTree = ""; };
41 | 28213DC103549FF68F784ECD895724CA /* LoggerClient.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = LoggerClient.m; path = Client/iOS/LoggerClient.m; sourceTree = ""; };
42 | 4201E88D77D6C3E68A23234485A81A71 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = DEVELOPER_DIR; };
43 | 4EF5A64FC9641111CD1F26CA03C37B7C /* Pods-print-export.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-print-export.debug.xcconfig"; sourceTree = ""; };
44 | 5D9080DC597B8DB0776CF0ACD701F76B /* LoggerCommon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LoggerCommon.h; path = Client/iOS/LoggerCommon.h; sourceTree = ""; };
45 | 76B426CFD058F63611D494BF4AB606D6 /* NSLogger-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSLogger-prefix.pch"; sourceTree = ""; };
46 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
47 | 996B02800B385339489FBC13FF63E9F2 /* libPods-print-export.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-print-export.a"; path = "libPods-print-export.a"; sourceTree = BUILT_PRODUCTS_DIR; };
48 | 9F82BE603F6AA2FF9EFE2875FC372A2C /* NSLogger.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = NSLogger.xcconfig; sourceTree = ""; };
49 | A8EAEBF3957A2B843B1A4FEB708B1D97 /* libNSLogger.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libNSLogger.a; path = libNSLogger.a; sourceTree = BUILT_PRODUCTS_DIR; };
50 | AB5592D02FFECC203E7F3E88B33AAFD0 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; };
51 | B0D18D348C433F4BA5CC7DF88C4982A4 /* Pods-print-export-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-print-export-dummy.m"; sourceTree = ""; };
52 | C4A088FAB8678982EF89A51203631E57 /* NSLoggerSwift.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = NSLoggerSwift.h; path = Client/iOS/NSLoggerSwift.h; sourceTree = ""; };
53 | DD7131CED4EE7A1F2479C149D575988B /* Pods-print-export-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-print-export-acknowledgements.plist"; sourceTree = ""; };
54 | E33F0971B363B5331512820B4F2F058B /* NSLogger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = NSLogger.h; path = Client/iOS/NSLogger.h; sourceTree = ""; };
55 | /* End PBXFileReference section */
56 |
57 | /* Begin PBXFrameworksBuildPhase section */
58 | F9BF8743F7762CFF3767579723472ACF /* Frameworks */ = {
59 | isa = PBXFrameworksBuildPhase;
60 | buildActionMask = 2147483647;
61 | files = (
62 | B07FA9A1B160CDEE45405B10C860FEC5 /* AppKit.framework in Frameworks */,
63 | 6D945D61BDE3A5D95C3CCE00B8B8AA0E /* CFNetwork.framework in Frameworks */,
64 | 712282ECEA8B9AFBDADDB717A9A89410 /* CoreServices.framework in Frameworks */,
65 | 740853AF6408466B225104CCC95B15AB /* SystemConfiguration.framework in Frameworks */,
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | FB882708A2D64AE23D455EAD614DECF2 /* Frameworks */ = {
70 | isa = PBXFrameworksBuildPhase;
71 | buildActionMask = 2147483647;
72 | files = (
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | /* End PBXFrameworksBuildPhase section */
77 |
78 | /* Begin PBXGroup section */
79 | 0822C3151ABE61297DE9B8DDED0A17F7 /* Pods-print-export */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 09D125C667B392353ECF7AFB75F85049 /* Pods-print-export-acknowledgements.markdown */,
83 | DD7131CED4EE7A1F2479C149D575988B /* Pods-print-export-acknowledgements.plist */,
84 | B0D18D348C433F4BA5CC7DF88C4982A4 /* Pods-print-export-dummy.m */,
85 | 2634459D5FC6C6452BE02B2AF2893EF7 /* Pods-print-export-resources.sh */,
86 | 4EF5A64FC9641111CD1F26CA03C37B7C /* Pods-print-export.debug.xcconfig */,
87 | 079C18C235012BDA6F3298179DA501B1 /* Pods-print-export.release.xcconfig */,
88 | );
89 | name = "Pods-print-export";
90 | path = "Target Support Files/Pods-print-export";
91 | sourceTree = "";
92 | };
93 | 40091FA9475D2883CC1B05F687CB58A2 /* Products */ = {
94 | isa = PBXGroup;
95 | children = (
96 | A8EAEBF3957A2B843B1A4FEB708B1D97 /* libNSLogger.a */,
97 | 996B02800B385339489FBC13FF63E9F2 /* libPods-print-export.a */,
98 | );
99 | name = Products;
100 | sourceTree = "";
101 | };
102 | 4D5FF4DD4C2615E67342A3D28066B9FD /* Support Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 9F82BE603F6AA2FF9EFE2875FC372A2C /* NSLogger.xcconfig */,
106 | 099B7EA6B12EB54DDA9DE8BAF6D260EA /* NSLogger-dummy.m */,
107 | 76B426CFD058F63611D494BF4AB606D6 /* NSLogger-prefix.pch */,
108 | );
109 | name = "Support Files";
110 | path = "../Target Support Files/NSLogger";
111 | sourceTree = "";
112 | };
113 | 57A6F1F1C421A4798EC5EC74C8B50DBF /* OS X */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 244AE836532981EBB6D8DE5ACD3F561D /* AppKit.framework */,
117 | 0952D8F020E5DA9016EED114B914E3D8 /* CFNetwork.framework */,
118 | 4201E88D77D6C3E68A23234485A81A71 /* CoreServices.framework */,
119 | AB5592D02FFECC203E7F3E88B33AAFD0 /* SystemConfiguration.framework */,
120 | );
121 | name = "OS X";
122 | sourceTree = "";
123 | };
124 | 6CBC585C15AA7142E17830E7D044DD1C /* Targets Support Files */ = {
125 | isa = PBXGroup;
126 | children = (
127 | 0822C3151ABE61297DE9B8DDED0A17F7 /* Pods-print-export */,
128 | );
129 | name = "Targets Support Files";
130 | sourceTree = "";
131 | };
132 | 7DB346D0F39D3F0E887471402A8071AB = {
133 | isa = PBXGroup;
134 | children = (
135 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */,
136 | CD75D5B60FCA72FBF7F9C770460B2C26 /* Frameworks */,
137 | 9F5208F1E5613BDFA67AAE07CD8DC066 /* Pods */,
138 | 40091FA9475D2883CC1B05F687CB58A2 /* Products */,
139 | 6CBC585C15AA7142E17830E7D044DD1C /* Targets Support Files */,
140 | );
141 | sourceTree = "";
142 | };
143 | 9F5208F1E5613BDFA67AAE07CD8DC066 /* Pods */ = {
144 | isa = PBXGroup;
145 | children = (
146 | E6572A5FAC70D62F24416C1123DE6F27 /* NSLogger */,
147 | );
148 | name = Pods;
149 | sourceTree = "";
150 | };
151 | CD75D5B60FCA72FBF7F9C770460B2C26 /* Frameworks */ = {
152 | isa = PBXGroup;
153 | children = (
154 | 57A6F1F1C421A4798EC5EC74C8B50DBF /* OS X */,
155 | );
156 | name = Frameworks;
157 | sourceTree = "";
158 | };
159 | D6B1E8B738983952FDACF3ED8D89BFB7 /* ObjC */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 0B27E0D9628495B84BA0A9DDD4C72D19 /* LoggerClient.h */,
163 | 28213DC103549FF68F784ECD895724CA /* LoggerClient.m */,
164 | 5D9080DC597B8DB0776CF0ACD701F76B /* LoggerCommon.h */,
165 | E33F0971B363B5331512820B4F2F058B /* NSLogger.h */,
166 | C4A088FAB8678982EF89A51203631E57 /* NSLoggerSwift.h */,
167 | );
168 | name = ObjC;
169 | sourceTree = "";
170 | };
171 | E6572A5FAC70D62F24416C1123DE6F27 /* NSLogger */ = {
172 | isa = PBXGroup;
173 | children = (
174 | D6B1E8B738983952FDACF3ED8D89BFB7 /* ObjC */,
175 | 4D5FF4DD4C2615E67342A3D28066B9FD /* Support Files */,
176 | );
177 | name = NSLogger;
178 | path = NSLogger;
179 | sourceTree = "";
180 | };
181 | /* End PBXGroup section */
182 |
183 | /* Begin PBXHeadersBuildPhase section */
184 | 0FD89D1D7E8FD36298ACF0C37195E7F9 /* Headers */ = {
185 | isa = PBXHeadersBuildPhase;
186 | buildActionMask = 2147483647;
187 | files = (
188 | 60F95215219732E4A039BD638E128C38 /* LoggerClient.h in Headers */,
189 | 271081336E65901FC5F04FFC03D48671 /* LoggerCommon.h in Headers */,
190 | 9485D048058F2571BAEE7B3FA3D60367 /* NSLogger.h in Headers */,
191 | 09CD3815FD9156142D05D32ADE90C135 /* NSLoggerSwift.h in Headers */,
192 | );
193 | runOnlyForDeploymentPostprocessing = 0;
194 | };
195 | 113275577048F68E54EB35F9705AD70A /* Headers */ = {
196 | isa = PBXHeadersBuildPhase;
197 | buildActionMask = 2147483647;
198 | files = (
199 | );
200 | runOnlyForDeploymentPostprocessing = 0;
201 | };
202 | /* End PBXHeadersBuildPhase section */
203 |
204 | /* Begin PBXNativeTarget section */
205 | B16F2B66D8FCF7535BE2C547F63D74B8 /* NSLogger */ = {
206 | isa = PBXNativeTarget;
207 | buildConfigurationList = 7284B0E1A7D8E4D9372E903F5D07895A /* Build configuration list for PBXNativeTarget "NSLogger" */;
208 | buildPhases = (
209 | 0FD89D1D7E8FD36298ACF0C37195E7F9 /* Headers */,
210 | 9CC579A580F5371A15C05A2E4BCE31E3 /* Sources */,
211 | F9BF8743F7762CFF3767579723472ACF /* Frameworks */,
212 | );
213 | buildRules = (
214 | );
215 | dependencies = (
216 | );
217 | name = NSLogger;
218 | productName = NSLogger;
219 | productReference = A8EAEBF3957A2B843B1A4FEB708B1D97 /* libNSLogger.a */;
220 | productType = "com.apple.product-type.library.static";
221 | };
222 | C7EDE64AE816E8B80D3BAFD8FBA97276 /* Pods-print-export */ = {
223 | isa = PBXNativeTarget;
224 | buildConfigurationList = C4E0C145C5648F476010CD7614C2D3C6 /* Build configuration list for PBXNativeTarget "Pods-print-export" */;
225 | buildPhases = (
226 | 113275577048F68E54EB35F9705AD70A /* Headers */,
227 | 3D089CFAD0C25396B0C8813DE3AD0EB5 /* Sources */,
228 | FB882708A2D64AE23D455EAD614DECF2 /* Frameworks */,
229 | );
230 | buildRules = (
231 | );
232 | dependencies = (
233 | AD8BCAE8280742461BE2A6F724EA6C23 /* PBXTargetDependency */,
234 | );
235 | name = "Pods-print-export";
236 | productName = "Pods-print-export";
237 | productReference = 996B02800B385339489FBC13FF63E9F2 /* libPods-print-export.a */;
238 | productType = "com.apple.product-type.library.static";
239 | };
240 | /* End PBXNativeTarget section */
241 |
242 | /* Begin PBXProject section */
243 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = {
244 | isa = PBXProject;
245 | attributes = {
246 | LastSwiftUpdateCheck = 0930;
247 | LastUpgradeCheck = 0930;
248 | };
249 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
250 | compatibilityVersion = "Xcode 3.2";
251 | developmentRegion = English;
252 | hasScannedForEncodings = 0;
253 | knownRegions = (
254 | en,
255 | );
256 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB;
257 | productRefGroup = 40091FA9475D2883CC1B05F687CB58A2 /* Products */;
258 | projectDirPath = "";
259 | projectRoot = "";
260 | targets = (
261 | B16F2B66D8FCF7535BE2C547F63D74B8 /* NSLogger */,
262 | C7EDE64AE816E8B80D3BAFD8FBA97276 /* Pods-print-export */,
263 | );
264 | };
265 | /* End PBXProject section */
266 |
267 | /* Begin PBXSourcesBuildPhase section */
268 | 3D089CFAD0C25396B0C8813DE3AD0EB5 /* Sources */ = {
269 | isa = PBXSourcesBuildPhase;
270 | buildActionMask = 2147483647;
271 | files = (
272 | 5644680B6C5FA876602E4F0E93F73722 /* Pods-print-export-dummy.m in Sources */,
273 | );
274 | runOnlyForDeploymentPostprocessing = 0;
275 | };
276 | 9CC579A580F5371A15C05A2E4BCE31E3 /* Sources */ = {
277 | isa = PBXSourcesBuildPhase;
278 | buildActionMask = 2147483647;
279 | files = (
280 | EAC8F2A2D3946954403C29FF04730841 /* LoggerClient.m in Sources */,
281 | 643133FB3FA76D46A4873CEE0B42F573 /* NSLogger-dummy.m in Sources */,
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | };
285 | /* End PBXSourcesBuildPhase section */
286 |
287 | /* Begin PBXTargetDependency section */
288 | AD8BCAE8280742461BE2A6F724EA6C23 /* PBXTargetDependency */ = {
289 | isa = PBXTargetDependency;
290 | name = NSLogger;
291 | target = B16F2B66D8FCF7535BE2C547F63D74B8 /* NSLogger */;
292 | targetProxy = 7953A201D2E4D9CFDA04E342E3656387 /* PBXContainerItemProxy */;
293 | };
294 | /* End PBXTargetDependency section */
295 |
296 | /* Begin XCBuildConfiguration section */
297 | 02206A39950AB264474BF72228F5C23F /* Debug */ = {
298 | isa = XCBuildConfiguration;
299 | buildSettings = {
300 | ALWAYS_SEARCH_USER_PATHS = NO;
301 | CLANG_ANALYZER_NONNULL = YES;
302 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
303 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
304 | CLANG_CXX_LIBRARY = "libc++";
305 | CLANG_ENABLE_MODULES = YES;
306 | CLANG_ENABLE_OBJC_ARC = YES;
307 | CLANG_ENABLE_OBJC_WEAK = YES;
308 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
309 | CLANG_WARN_BOOL_CONVERSION = YES;
310 | CLANG_WARN_COMMA = YES;
311 | CLANG_WARN_CONSTANT_CONVERSION = YES;
312 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
313 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
314 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
315 | CLANG_WARN_EMPTY_BODY = YES;
316 | CLANG_WARN_ENUM_CONVERSION = YES;
317 | CLANG_WARN_INFINITE_RECURSION = YES;
318 | CLANG_WARN_INT_CONVERSION = YES;
319 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
320 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
321 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
322 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
323 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
324 | CLANG_WARN_STRICT_PROTOTYPES = YES;
325 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
326 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
327 | CLANG_WARN_UNREACHABLE_CODE = YES;
328 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
329 | CODE_SIGNING_ALLOWED = NO;
330 | CODE_SIGNING_REQUIRED = NO;
331 | COPY_PHASE_STRIP = NO;
332 | DEBUG_INFORMATION_FORMAT = dwarf;
333 | ENABLE_STRICT_OBJC_MSGSEND = YES;
334 | ENABLE_TESTABILITY = YES;
335 | GCC_C_LANGUAGE_STANDARD = gnu11;
336 | GCC_DYNAMIC_NO_PIC = NO;
337 | GCC_NO_COMMON_BLOCKS = YES;
338 | GCC_OPTIMIZATION_LEVEL = 0;
339 | GCC_PREPROCESSOR_DEFINITIONS = (
340 | "POD_CONFIGURATION_DEBUG=1",
341 | "DEBUG=1",
342 | "$(inherited)",
343 | );
344 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
345 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
346 | GCC_WARN_UNDECLARED_SELECTOR = YES;
347 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
348 | GCC_WARN_UNUSED_FUNCTION = YES;
349 | GCC_WARN_UNUSED_VARIABLE = YES;
350 | MACOSX_DEPLOYMENT_TARGET = 10.12;
351 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
352 | MTL_FAST_MATH = YES;
353 | ONLY_ACTIVE_ARCH = YES;
354 | PRODUCT_NAME = "$(TARGET_NAME)";
355 | STRIP_INSTALLED_PRODUCT = NO;
356 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
357 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
358 | SWIFT_VERSION = 4.2;
359 | SYMROOT = "${SRCROOT}/../build";
360 | };
361 | name = Debug;
362 | };
363 | 588F549914A1123B9D2302AA4BEB5F49 /* Release */ = {
364 | isa = XCBuildConfiguration;
365 | baseConfigurationReference = 9F82BE603F6AA2FF9EFE2875FC372A2C /* NSLogger.xcconfig */;
366 | buildSettings = {
367 | CLANG_ENABLE_OBJC_WEAK = NO;
368 | CODE_SIGN_IDENTITY = "-";
369 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
370 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
371 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
372 | EXECUTABLE_PREFIX = lib;
373 | GCC_PREFIX_HEADER = "Target Support Files/NSLogger/NSLogger-prefix.pch";
374 | MACOSX_DEPLOYMENT_TARGET = 10.10;
375 | OTHER_LDFLAGS = "";
376 | OTHER_LIBTOOLFLAGS = "";
377 | PRIVATE_HEADERS_FOLDER_PATH = "";
378 | PRODUCT_MODULE_NAME = NSLogger;
379 | PRODUCT_NAME = NSLogger;
380 | PUBLIC_HEADERS_FOLDER_PATH = "";
381 | SDKROOT = macosx;
382 | SKIP_INSTALL = YES;
383 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
384 | };
385 | name = Release;
386 | };
387 | 62FE7660C9BFFBB21FA80BED50834E37 /* Release */ = {
388 | isa = XCBuildConfiguration;
389 | buildSettings = {
390 | ALWAYS_SEARCH_USER_PATHS = NO;
391 | CLANG_ANALYZER_NONNULL = YES;
392 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
394 | CLANG_CXX_LIBRARY = "libc++";
395 | CLANG_ENABLE_MODULES = YES;
396 | CLANG_ENABLE_OBJC_ARC = YES;
397 | CLANG_ENABLE_OBJC_WEAK = YES;
398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
399 | CLANG_WARN_BOOL_CONVERSION = YES;
400 | CLANG_WARN_COMMA = YES;
401 | CLANG_WARN_CONSTANT_CONVERSION = YES;
402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
404 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
405 | CLANG_WARN_EMPTY_BODY = YES;
406 | CLANG_WARN_ENUM_CONVERSION = YES;
407 | CLANG_WARN_INFINITE_RECURSION = YES;
408 | CLANG_WARN_INT_CONVERSION = YES;
409 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
410 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
411 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
412 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
413 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
414 | CLANG_WARN_STRICT_PROTOTYPES = YES;
415 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
416 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
417 | CLANG_WARN_UNREACHABLE_CODE = YES;
418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
419 | CODE_SIGNING_ALLOWED = NO;
420 | CODE_SIGNING_REQUIRED = NO;
421 | COPY_PHASE_STRIP = NO;
422 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
423 | ENABLE_NS_ASSERTIONS = NO;
424 | ENABLE_STRICT_OBJC_MSGSEND = YES;
425 | GCC_C_LANGUAGE_STANDARD = gnu11;
426 | GCC_NO_COMMON_BLOCKS = YES;
427 | GCC_PREPROCESSOR_DEFINITIONS = (
428 | "POD_CONFIGURATION_RELEASE=1",
429 | "$(inherited)",
430 | );
431 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
432 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
433 | GCC_WARN_UNDECLARED_SELECTOR = YES;
434 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
435 | GCC_WARN_UNUSED_FUNCTION = YES;
436 | GCC_WARN_UNUSED_VARIABLE = YES;
437 | MACOSX_DEPLOYMENT_TARGET = 10.12;
438 | MTL_ENABLE_DEBUG_INFO = NO;
439 | MTL_FAST_MATH = YES;
440 | PRODUCT_NAME = "$(TARGET_NAME)";
441 | STRIP_INSTALLED_PRODUCT = NO;
442 | SWIFT_COMPILATION_MODE = wholemodule;
443 | SWIFT_OPTIMIZATION_LEVEL = "-O";
444 | SWIFT_VERSION = 4.2;
445 | SYMROOT = "${SRCROOT}/../build";
446 | };
447 | name = Release;
448 | };
449 | AE8625F7E7D661957EE1BE8313073F40 /* Debug */ = {
450 | isa = XCBuildConfiguration;
451 | baseConfigurationReference = 4EF5A64FC9641111CD1F26CA03C37B7C /* Pods-print-export.debug.xcconfig */;
452 | buildSettings = {
453 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
454 | CLANG_ENABLE_OBJC_WEAK = NO;
455 | CODE_SIGN_IDENTITY = "-";
456 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
458 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
459 | EXECUTABLE_PREFIX = lib;
460 | MACH_O_TYPE = staticlib;
461 | MACOSX_DEPLOYMENT_TARGET = 10.12;
462 | OTHER_LDFLAGS = "";
463 | OTHER_LIBTOOLFLAGS = "";
464 | PODS_ROOT = "$(SRCROOT)";
465 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
466 | SDKROOT = macosx;
467 | SKIP_INSTALL = YES;
468 | };
469 | name = Debug;
470 | };
471 | BE47733E4EE260D79B0A2DAE15B604EE /* Debug */ = {
472 | isa = XCBuildConfiguration;
473 | baseConfigurationReference = 9F82BE603F6AA2FF9EFE2875FC372A2C /* NSLogger.xcconfig */;
474 | buildSettings = {
475 | CLANG_ENABLE_OBJC_WEAK = NO;
476 | CODE_SIGN_IDENTITY = "-";
477 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
478 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
479 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
480 | EXECUTABLE_PREFIX = lib;
481 | GCC_PREFIX_HEADER = "Target Support Files/NSLogger/NSLogger-prefix.pch";
482 | MACOSX_DEPLOYMENT_TARGET = 10.10;
483 | OTHER_LDFLAGS = "";
484 | OTHER_LIBTOOLFLAGS = "";
485 | PRIVATE_HEADERS_FOLDER_PATH = "";
486 | PRODUCT_MODULE_NAME = NSLogger;
487 | PRODUCT_NAME = NSLogger;
488 | PUBLIC_HEADERS_FOLDER_PATH = "";
489 | SDKROOT = macosx;
490 | SKIP_INSTALL = YES;
491 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
492 | };
493 | name = Debug;
494 | };
495 | CDE0107B49DD98924FAD28961129325C /* Release */ = {
496 | isa = XCBuildConfiguration;
497 | baseConfigurationReference = 079C18C235012BDA6F3298179DA501B1 /* Pods-print-export.release.xcconfig */;
498 | buildSettings = {
499 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
500 | CLANG_ENABLE_OBJC_WEAK = NO;
501 | CODE_SIGN_IDENTITY = "-";
502 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
503 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
504 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
505 | EXECUTABLE_PREFIX = lib;
506 | MACH_O_TYPE = staticlib;
507 | MACOSX_DEPLOYMENT_TARGET = 10.12;
508 | OTHER_LDFLAGS = "";
509 | OTHER_LIBTOOLFLAGS = "";
510 | PODS_ROOT = "$(SRCROOT)";
511 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
512 | SDKROOT = macosx;
513 | SKIP_INSTALL = YES;
514 | };
515 | name = Release;
516 | };
517 | /* End XCBuildConfiguration section */
518 |
519 | /* Begin XCConfigurationList section */
520 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = {
521 | isa = XCConfigurationList;
522 | buildConfigurations = (
523 | 02206A39950AB264474BF72228F5C23F /* Debug */,
524 | 62FE7660C9BFFBB21FA80BED50834E37 /* Release */,
525 | );
526 | defaultConfigurationIsVisible = 0;
527 | defaultConfigurationName = Release;
528 | };
529 | 7284B0E1A7D8E4D9372E903F5D07895A /* Build configuration list for PBXNativeTarget "NSLogger" */ = {
530 | isa = XCConfigurationList;
531 | buildConfigurations = (
532 | BE47733E4EE260D79B0A2DAE15B604EE /* Debug */,
533 | 588F549914A1123B9D2302AA4BEB5F49 /* Release */,
534 | );
535 | defaultConfigurationIsVisible = 0;
536 | defaultConfigurationName = Release;
537 | };
538 | C4E0C145C5648F476010CD7614C2D3C6 /* Build configuration list for PBXNativeTarget "Pods-print-export" */ = {
539 | isa = XCConfigurationList;
540 | buildConfigurations = (
541 | AE8625F7E7D661957EE1BE8313073F40 /* Debug */,
542 | CDE0107B49DD98924FAD28961129325C /* Release */,
543 | );
544 | defaultConfigurationIsVisible = 0;
545 | defaultConfigurationName = Release;
546 | };
547 | /* End XCConfigurationList section */
548 | };
549 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
550 | }
551 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/NSLogger/NSLogger-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_NSLogger : NSObject
3 | @end
4 | @implementation PodsDummy_NSLogger
5 | @end
6 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/NSLogger/NSLogger-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/NSLogger/NSLogger.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/NSLogger
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 ${inherited} NSLOGGER_WAS_HERE=1 NSLOGGER_BUILD_USERNAME="${USER}"
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/NSLogger" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/NSLogger"
4 | OTHER_CFLAGS = $(inherited) -Wno-nullability-completeness
5 | OTHER_LDFLAGS = -framework "AppKit" -framework "CFNetwork" -framework "CoreServices" -framework "SystemConfiguration"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/NSLogger
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/Pods-print-export/Pods-print-export-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## NSLogger
5 |
6 | BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
7 |
8 | Copyright (c) 2010-2013, Florent Pillet All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification, are
11 | permitted provided that the following conditions are met:
12 |
13 | Redistributions of source code must retain the above copyright notice, this list of
14 | conditions and the following disclaimer. Redistributions in binary form must
15 | reproduce the above copyright notice, this list of conditions and the following
16 | disclaimer in the documentation and/or other materials provided with the
17 | distribution. Neither the name of Florent Pillet nor the names of its
18 | contributors may be used to endorse or promote products derived from this software
19 | without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
20 | HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
21 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 | Generated by CocoaPods - https://cocoapods.org
31 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/Pods-print-export/Pods-print-export-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
18 |
19 | Copyright (c) 2010-2013, Florent Pillet All rights reserved.
20 |
21 | Redistribution and use in source and binary forms, with or without modification, are
22 | permitted provided that the following conditions are met:
23 |
24 | Redistributions of source code must retain the above copyright notice, this list of
25 | conditions and the following disclaimer. Redistributions in binary form must
26 | reproduce the above copyright notice, this list of conditions and the following
27 | disclaimer in the documentation and/or other materials provided with the
28 | distribution. Neither the name of Florent Pillet nor the names of its
29 | contributors may be used to endorse or promote products derived from this software
30 | without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
31 | HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
32 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
33 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
34 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
37 | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 |
41 | License
42 | BSD
43 | Title
44 | NSLogger
45 | Type
46 | PSGroupSpecifier
47 |
48 |
49 | FooterText
50 | Generated by CocoaPods - https://cocoapods.org
51 | Title
52 |
53 | Type
54 | PSGroupSpecifier
55 |
56 |
57 | StringsTable
58 | Acknowledgements
59 | Title
60 | Acknowledgements
61 |
62 |
63 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/Pods-print-export/Pods-print-export-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_print_export : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_print_export
5 | @end
6 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/Pods-print-export/Pods-print-export-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/Pods-print-export/Pods-print-export.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 ${inherited} NSLOGGER_WAS_HERE=1 NSLOGGER_BUILD_USERNAME="${USER}"
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/NSLogger"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/NSLogger"
4 | OTHER_CFLAGS = $(inherited) -Wno-nullability-completeness -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/NSLogger"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"NSLogger" -framework "AppKit" -framework "CFNetwork" -framework "CoreServices" -framework "SystemConfiguration"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/src/framework/Pods/Target Support Files/Pods-print-export/Pods-print-export.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 ${inherited} NSLOGGER_WAS_HERE=1 NSLOGGER_BUILD_USERNAME="${USER}"
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/NSLogger"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/NSLogger"
4 | OTHER_CFLAGS = $(inherited) -Wno-nullability-completeness -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/NSLogger"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"NSLogger" -framework "AppKit" -framework "CFNetwork" -framework "CoreServices" -framework "SystemConfiguration"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/src/framework/print-export.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 07798987ADDE94D11AA3E58D /* libPods-print-export.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B214E39896F61EE9287DCC38 /* libPods-print-export.a */; };
11 | 4DA18CB4224399DE00D19222 /* PEOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA18CB2224399DE00D19222 /* PEOptions.h */; };
12 | 4DA18CB5224399DE00D19222 /* PEOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA18CB3224399DE00D19222 /* PEOptions.m */; };
13 | 4DA18CBC2243ABD100D19222 /* PEDecimalFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA18CBA2243ABD100D19222 /* PEDecimalFormatter.h */; };
14 | 4DA18CBD2243ABD100D19222 /* PEDecimalFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA18CBB2243ABD100D19222 /* PEDecimalFormatter.m */; };
15 | 4DA18CC62243EF5D00D19222 /* PEUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA18CC42243EF5D00D19222 /* PEUtils.h */; };
16 | 4DA18CC72243EF5D00D19222 /* PEUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA18CC52243EF5D00D19222 /* PEUtils.m */; };
17 | 4DA18CCF2243F0B600D19222 /* MSConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA18CCD2243F0B600D19222 /* MSConstants.h */; };
18 | 4DA18CD02243F0B600D19222 /* MSConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA18CCE2243F0B600D19222 /* MSConstants.m */; };
19 | 4DA8CB3B2241369D00FC9D2D /* print_export.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA8CB392241369D00FC9D2D /* print_export.h */; settings = {ATTRIBUTES = (Public, ); }; };
20 | 4DA8CB442241397F00FC9D2D /* PEPrintExport.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA8CB422241397F00FC9D2D /* PEPrintExport.h */; };
21 | 4DA8CB452241397F00FC9D2D /* PEPrintExport.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA8CB432241397F00FC9D2D /* PEPrintExport.m */; };
22 | 4DA8CB69224150DF00FC9D2D /* PEOptionsAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4DA8CB68224150DF00FC9D2D /* PEOptionsAccessoryView.xib */; };
23 | 4DB8D68F2244ED1100670BC0 /* MSImmutablePage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D6872244ED1000670BC0 /* MSImmutablePage.h */; };
24 | 4DB8D6912244ED1100670BC0 /* MSImmutableLayerGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D6892244ED1000670BC0 /* MSImmutableLayerGroup.h */; };
25 | 4DB8D6922244ED1100670BC0 /* MSImmutableDocumentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D68A2244ED1000670BC0 /* MSImmutableDocumentData.h */; };
26 | 4DB8D6932244ED1100670BC0 /* MSImmutableModelObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D68B2244ED1000670BC0 /* MSImmutableModelObject.h */; };
27 | 4DB8D6942244ED1100670BC0 /* MSImmutableStyledLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D68C2244ED1100670BC0 /* MSImmutableStyledLayer.h */; };
28 | 4DB8D6952244ED1100670BC0 /* MSImmutableArtboardGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D68D2244ED1100670BC0 /* MSImmutableArtboardGroup.h */; };
29 | 4DB8D6962244ED1100670BC0 /* MSImmutableLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D68E2244ED1100670BC0 /* MSImmutableLayer.h */; };
30 | 4DB8D6992244F4D700670BC0 /* MSModelObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D6982244F4D700670BC0 /* MSModelObject.h */; };
31 | 4DB8D69B2244F51D00670BC0 /* MSPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB8D69A2244F51D00670BC0 /* MSPage.h */; };
32 | 4DF78E702248DDC0004024B0 /* PEFlowConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF78E6E2248DDC0004024B0 /* PEFlowConnection.h */; };
33 | 4DF78E712248DDC0004024B0 /* PEFlowConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DF78E6F2248DDC0004024B0 /* PEFlowConnection.m */; };
34 | 4DF78E7A2248FB12004024B0 /* types.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DF78E792248FB12004024B0 /* types.m */; };
35 | 4DF78E85224BC8B8004024B0 /* PESketchMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF78E83224BC8B8004024B0 /* PESketchMethods.h */; };
36 | 4DF78E86224BC8B8004024B0 /* PESketchMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DF78E84224BC8B8004024B0 /* PESketchMethods.m */; };
37 | /* End PBXBuildFile section */
38 |
39 | /* Begin PBXFileReference section */
40 | 4DA18CB2224399DE00D19222 /* PEOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEOptions.h; sourceTree = ""; };
41 | 4DA18CB3224399DE00D19222 /* PEOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEOptions.m; sourceTree = ""; };
42 | 4DA18CBA2243ABD100D19222 /* PEDecimalFormatter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEDecimalFormatter.h; sourceTree = ""; };
43 | 4DA18CBB2243ABD100D19222 /* PEDecimalFormatter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEDecimalFormatter.m; sourceTree = ""; };
44 | 4DA18CC02243BB7F00D19222 /* MSDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSDocument.h; sourceTree = ""; };
45 | 4DA18CC12243BBB000D19222 /* MSDocumentData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSDocumentData.h; sourceTree = ""; };
46 | 4DA18CC42243EF5D00D19222 /* PEUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEUtils.h; sourceTree = ""; };
47 | 4DA18CC52243EF5D00D19222 /* PEUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEUtils.m; sourceTree = ""; };
48 | 4DA18CCD2243F0B600D19222 /* MSConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSConstants.h; sourceTree = ""; };
49 | 4DA18CCE2243F0B600D19222 /* MSConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSConstants.m; sourceTree = ""; };
50 | 4DA18CD12243F13400D19222 /* MSImmutableLayerAncestry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSImmutableLayerAncestry.h; sourceTree = ""; };
51 | 4DA18CD22243F16000D19222 /* MSExportRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSExportRequest.h; sourceTree = ""; };
52 | 4DA18CD42243F20300D19222 /* MSExportManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSExportManager.h; sourceTree = ""; };
53 | 4DA18CDA2244059B00D19222 /* MSColor-Protocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MSColor-Protocol.h"; sourceTree = ""; };
54 | 4DA8CB362241369D00FC9D2D /* print_export.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = print_export.framework; sourceTree = BUILT_PRODUCTS_DIR; };
55 | 4DA8CB392241369D00FC9D2D /* print_export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = print_export.h; sourceTree = ""; };
56 | 4DA8CB3A2241369D00FC9D2D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
57 | 4DA8CB422241397F00FC9D2D /* PEPrintExport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPrintExport.h; sourceTree = ""; };
58 | 4DA8CB432241397F00FC9D2D /* PEPrintExport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPrintExport.m; sourceTree = ""; };
59 | 4DA8CB68224150DF00FC9D2D /* PEOptionsAccessoryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PEOptionsAccessoryView.xib; sourceTree = ""; };
60 | 4DA8CB6A2242886500FC9D2D /* types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; };
61 | 4DB8D6872244ED1000670BC0 /* MSImmutablePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSImmutablePage.h; sourceTree = ""; };
62 | 4DB8D6892244ED1000670BC0 /* MSImmutableLayerGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSImmutableLayerGroup.h; sourceTree = ""; };
63 | 4DB8D68A2244ED1000670BC0 /* MSImmutableDocumentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSImmutableDocumentData.h; sourceTree = ""; };
64 | 4DB8D68B2244ED1000670BC0 /* MSImmutableModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSImmutableModelObject.h; sourceTree = ""; };
65 | 4DB8D68C2244ED1100670BC0 /* MSImmutableStyledLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSImmutableStyledLayer.h; sourceTree = ""; };
66 | 4DB8D68D2244ED1100670BC0 /* MSImmutableArtboardGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSImmutableArtboardGroup.h; sourceTree = ""; };
67 | 4DB8D68E2244ED1100670BC0 /* MSImmutableLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSImmutableLayer.h; sourceTree = ""; };
68 | 4DB8D6972244F40E00670BC0 /* MSImmutableColor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSImmutableColor.h; sourceTree = ""; };
69 | 4DB8D6982244F4D700670BC0 /* MSModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSModelObject.h; sourceTree = ""; };
70 | 4DB8D69A2244F51D00670BC0 /* MSPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSPage.h; sourceTree = ""; };
71 | 4DF78E6E2248DDC0004024B0 /* PEFlowConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEFlowConnection.h; sourceTree = ""; };
72 | 4DF78E6F2248DDC0004024B0 /* PEFlowConnection.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEFlowConnection.m; sourceTree = ""; };
73 | 4DF78E732248E2EF004024B0 /* MSImmutableHotspotLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSImmutableHotspotLayer.h; sourceTree = ""; };
74 | 4DF78E742248ED7E004024B0 /* MSImmutableFlowConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSImmutableFlowConnection.h; sourceTree = ""; };
75 | 4DF78E792248FB12004024B0 /* types.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = types.m; sourceTree = ""; };
76 | 4DF78E7F22492AA7004024B0 /* MSLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSLayer.h; sourceTree = ""; };
77 | 4DF78E81224BC761004024B0 /* MSContentDrawViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSContentDrawViewController.h; sourceTree = ""; };
78 | 4DF78E82224BC795004024B0 /* MSFlashController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSFlashController.h; sourceTree = ""; };
79 | 4DF78E83224BC8B8004024B0 /* PESketchMethods.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PESketchMethods.h; sourceTree = ""; };
80 | 4DF78E84224BC8B8004024B0 /* PESketchMethods.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PESketchMethods.m; sourceTree = ""; };
81 | 4DF78E87224E2738004024B0 /* MSImmutableSymbolInstance.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSImmutableSymbolInstance.h; sourceTree = ""; };
82 | 934C9379DCA27F4889B1A21D /* Pods-print-export.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-print-export.debug.xcconfig"; path = "Pods/Target Support Files/Pods-print-export/Pods-print-export.debug.xcconfig"; sourceTree = ""; };
83 | B214E39896F61EE9287DCC38 /* libPods-print-export.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-print-export.a"; sourceTree = BUILT_PRODUCTS_DIR; };
84 | F87F0855D9C588A6689F6891 /* Pods-print-export.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-print-export.release.xcconfig"; path = "Pods/Target Support Files/Pods-print-export/Pods-print-export.release.xcconfig"; sourceTree = ""; };
85 | /* End PBXFileReference section */
86 |
87 | /* Begin PBXFrameworksBuildPhase section */
88 | 4DA8CB332241369D00FC9D2D /* Frameworks */ = {
89 | isa = PBXFrameworksBuildPhase;
90 | buildActionMask = 2147483647;
91 | files = (
92 | 07798987ADDE94D11AA3E58D /* libPods-print-export.a in Frameworks */,
93 | );
94 | runOnlyForDeploymentPostprocessing = 0;
95 | };
96 | /* End PBXFrameworksBuildPhase section */
97 |
98 | /* Begin PBXGroup section */
99 | 4DA8CB2C2241369C00FC9D2D = {
100 | isa = PBXGroup;
101 | children = (
102 | 4DA8CB382241369D00FC9D2D /* print-export */,
103 | 4DA8CB372241369D00FC9D2D /* Products */,
104 | D23EC967961014BEFDEDA794 /* Pods */,
105 | 4EB2CB4465921F1AB2C069C0 /* Frameworks */,
106 | );
107 | sourceTree = "";
108 | };
109 | 4DA8CB372241369D00FC9D2D /* Products */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 4DA8CB362241369D00FC9D2D /* print_export.framework */,
113 | );
114 | name = Products;
115 | sourceTree = "";
116 | };
117 | 4DA8CB382241369D00FC9D2D /* print-export */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 4DA8CB3A2241369D00FC9D2D /* Info.plist */,
121 | 4DA18CBA2243ABD100D19222 /* PEDecimalFormatter.h */,
122 | 4DA18CBB2243ABD100D19222 /* PEDecimalFormatter.m */,
123 | 4DF78E6E2248DDC0004024B0 /* PEFlowConnection.h */,
124 | 4DF78E6F2248DDC0004024B0 /* PEFlowConnection.m */,
125 | 4DA18CB2224399DE00D19222 /* PEOptions.h */,
126 | 4DA18CB3224399DE00D19222 /* PEOptions.m */,
127 | 4DA8CB68224150DF00FC9D2D /* PEOptionsAccessoryView.xib */,
128 | 4DA8CB422241397F00FC9D2D /* PEPrintExport.h */,
129 | 4DA8CB432241397F00FC9D2D /* PEPrintExport.m */,
130 | 4DA18CC42243EF5D00D19222 /* PEUtils.h */,
131 | 4DA18CC52243EF5D00D19222 /* PEUtils.m */,
132 | 4DA8CB392241369D00FC9D2D /* print_export.h */,
133 | 4DA8CB492241441400FC9D2D /* Sketch */,
134 | 4DA8CB6A2242886500FC9D2D /* types.h */,
135 | 4DF78E792248FB12004024B0 /* types.m */,
136 | 4DF78E83224BC8B8004024B0 /* PESketchMethods.h */,
137 | 4DF78E84224BC8B8004024B0 /* PESketchMethods.m */,
138 | );
139 | path = "print-export";
140 | sourceTree = "";
141 | };
142 | 4DA8CB492241441400FC9D2D /* Sketch */ = {
143 | isa = PBXGroup;
144 | children = (
145 | 4DA18CDA2244059B00D19222 /* MSColor-Protocol.h */,
146 | 4DA18CCD2243F0B600D19222 /* MSConstants.h */,
147 | 4DA18CCE2243F0B600D19222 /* MSConstants.m */,
148 | 4DF78E81224BC761004024B0 /* MSContentDrawViewController.h */,
149 | 4DA18CC02243BB7F00D19222 /* MSDocument.h */,
150 | 4DA18CC12243BBB000D19222 /* MSDocumentData.h */,
151 | 4DA18CD42243F20300D19222 /* MSExportManager.h */,
152 | 4DA18CD22243F16000D19222 /* MSExportRequest.h */,
153 | 4DF78E82224BC795004024B0 /* MSFlashController.h */,
154 | 4DB8D68D2244ED1100670BC0 /* MSImmutableArtboardGroup.h */,
155 | 4DB8D6972244F40E00670BC0 /* MSImmutableColor.h */,
156 | 4DB8D68A2244ED1000670BC0 /* MSImmutableDocumentData.h */,
157 | 4DF78E742248ED7E004024B0 /* MSImmutableFlowConnection.h */,
158 | 4DF78E732248E2EF004024B0 /* MSImmutableHotspotLayer.h */,
159 | 4DB8D68E2244ED1100670BC0 /* MSImmutableLayer.h */,
160 | 4DA18CD12243F13400D19222 /* MSImmutableLayerAncestry.h */,
161 | 4DB8D6892244ED1000670BC0 /* MSImmutableLayerGroup.h */,
162 | 4DB8D68B2244ED1000670BC0 /* MSImmutableModelObject.h */,
163 | 4DB8D6872244ED1000670BC0 /* MSImmutablePage.h */,
164 | 4DB8D68C2244ED1100670BC0 /* MSImmutableStyledLayer.h */,
165 | 4DF78E87224E2738004024B0 /* MSImmutableSymbolInstance.h */,
166 | 4DF78E7F22492AA7004024B0 /* MSLayer.h */,
167 | 4DB8D6982244F4D700670BC0 /* MSModelObject.h */,
168 | 4DB8D69A2244F51D00670BC0 /* MSPage.h */,
169 | );
170 | path = Sketch;
171 | sourceTree = "";
172 | };
173 | 4EB2CB4465921F1AB2C069C0 /* Frameworks */ = {
174 | isa = PBXGroup;
175 | children = (
176 | B214E39896F61EE9287DCC38 /* libPods-print-export.a */,
177 | );
178 | name = Frameworks;
179 | sourceTree = "";
180 | };
181 | D23EC967961014BEFDEDA794 /* Pods */ = {
182 | isa = PBXGroup;
183 | children = (
184 | 934C9379DCA27F4889B1A21D /* Pods-print-export.debug.xcconfig */,
185 | F87F0855D9C588A6689F6891 /* Pods-print-export.release.xcconfig */,
186 | );
187 | name = Pods;
188 | sourceTree = "";
189 | };
190 | /* End PBXGroup section */
191 |
192 | /* Begin PBXHeadersBuildPhase section */
193 | 4DA8CB312241369D00FC9D2D /* Headers */ = {
194 | isa = PBXHeadersBuildPhase;
195 | buildActionMask = 2147483647;
196 | files = (
197 | 4DB8D6942244ED1100670BC0 /* MSImmutableStyledLayer.h in Headers */,
198 | 4DB8D6922244ED1100670BC0 /* MSImmutableDocumentData.h in Headers */,
199 | 4DF78E702248DDC0004024B0 /* PEFlowConnection.h in Headers */,
200 | 4DA18CCF2243F0B600D19222 /* MSConstants.h in Headers */,
201 | 4DA18CBC2243ABD100D19222 /* PEDecimalFormatter.h in Headers */,
202 | 4DB8D6962244ED1100670BC0 /* MSImmutableLayer.h in Headers */,
203 | 4DA18CB4224399DE00D19222 /* PEOptions.h in Headers */,
204 | 4DB8D6912244ED1100670BC0 /* MSImmutableLayerGroup.h in Headers */,
205 | 4DB8D68F2244ED1100670BC0 /* MSImmutablePage.h in Headers */,
206 | 4DA8CB3B2241369D00FC9D2D /* print_export.h in Headers */,
207 | 4DB8D6932244ED1100670BC0 /* MSImmutableModelObject.h in Headers */,
208 | 4DA18CC62243EF5D00D19222 /* PEUtils.h in Headers */,
209 | 4DB8D6992244F4D700670BC0 /* MSModelObject.h in Headers */,
210 | 4DB8D69B2244F51D00670BC0 /* MSPage.h in Headers */,
211 | 4DF78E85224BC8B8004024B0 /* PESketchMethods.h in Headers */,
212 | 4DA8CB442241397F00FC9D2D /* PEPrintExport.h in Headers */,
213 | 4DB8D6952244ED1100670BC0 /* MSImmutableArtboardGroup.h in Headers */,
214 | );
215 | runOnlyForDeploymentPostprocessing = 0;
216 | };
217 | /* End PBXHeadersBuildPhase section */
218 |
219 | /* Begin PBXNativeTarget section */
220 | 4DA8CB352241369D00FC9D2D /* print-export */ = {
221 | isa = PBXNativeTarget;
222 | buildConfigurationList = 4DA8CB3E2241369D00FC9D2D /* Build configuration list for PBXNativeTarget "print-export" */;
223 | buildPhases = (
224 | 8700C1F07C1BA4654B4A6F0A /* [CP] Check Pods Manifest.lock */,
225 | 4DA8CB312241369D00FC9D2D /* Headers */,
226 | 4DA8CB322241369D00FC9D2D /* Sources */,
227 | 4DA8CB332241369D00FC9D2D /* Frameworks */,
228 | 4DA8CB342241369D00FC9D2D /* Resources */,
229 | );
230 | buildRules = (
231 | );
232 | dependencies = (
233 | );
234 | name = "print-export";
235 | productName = "print-export";
236 | productReference = 4DA8CB362241369D00FC9D2D /* print_export.framework */;
237 | productType = "com.apple.product-type.framework";
238 | };
239 | /* End PBXNativeTarget section */
240 |
241 | /* Begin PBXProject section */
242 | 4DA8CB2D2241369C00FC9D2D /* Project object */ = {
243 | isa = PBXProject;
244 | attributes = {
245 | LastUpgradeCheck = 1010;
246 | ORGANIZATIONNAME = Sketch;
247 | TargetAttributes = {
248 | 4DA8CB352241369D00FC9D2D = {
249 | CreatedOnToolsVersion = 10.1;
250 | };
251 | };
252 | };
253 | buildConfigurationList = 4DA8CB302241369C00FC9D2D /* Build configuration list for PBXProject "print-export" */;
254 | compatibilityVersion = "Xcode 9.3";
255 | developmentRegion = en;
256 | hasScannedForEncodings = 0;
257 | knownRegions = (
258 | en,
259 | );
260 | mainGroup = 4DA8CB2C2241369C00FC9D2D;
261 | productRefGroup = 4DA8CB372241369D00FC9D2D /* Products */;
262 | projectDirPath = "";
263 | projectRoot = "";
264 | targets = (
265 | 4DA8CB352241369D00FC9D2D /* print-export */,
266 | );
267 | };
268 | /* End PBXProject section */
269 |
270 | /* Begin PBXResourcesBuildPhase section */
271 | 4DA8CB342241369D00FC9D2D /* Resources */ = {
272 | isa = PBXResourcesBuildPhase;
273 | buildActionMask = 2147483647;
274 | files = (
275 | 4DA8CB69224150DF00FC9D2D /* PEOptionsAccessoryView.xib in Resources */,
276 | );
277 | runOnlyForDeploymentPostprocessing = 0;
278 | };
279 | /* End PBXResourcesBuildPhase section */
280 |
281 | /* Begin PBXShellScriptBuildPhase section */
282 | 8700C1F07C1BA4654B4A6F0A /* [CP] Check Pods Manifest.lock */ = {
283 | isa = PBXShellScriptBuildPhase;
284 | buildActionMask = 2147483647;
285 | files = (
286 | );
287 | inputFileListPaths = (
288 | );
289 | inputPaths = (
290 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
291 | "${PODS_ROOT}/Manifest.lock",
292 | );
293 | name = "[CP] Check Pods Manifest.lock";
294 | outputFileListPaths = (
295 | );
296 | outputPaths = (
297 | "$(DERIVED_FILE_DIR)/Pods-print-export-checkManifestLockResult.txt",
298 | );
299 | runOnlyForDeploymentPostprocessing = 0;
300 | shellPath = /bin/sh;
301 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
302 | showEnvVarsInLog = 0;
303 | };
304 | /* End PBXShellScriptBuildPhase section */
305 |
306 | /* Begin PBXSourcesBuildPhase section */
307 | 4DA8CB322241369D00FC9D2D /* Sources */ = {
308 | isa = PBXSourcesBuildPhase;
309 | buildActionMask = 2147483647;
310 | files = (
311 | 4DA18CC72243EF5D00D19222 /* PEUtils.m in Sources */,
312 | 4DA8CB452241397F00FC9D2D /* PEPrintExport.m in Sources */,
313 | 4DA18CD02243F0B600D19222 /* MSConstants.m in Sources */,
314 | 4DF78E7A2248FB12004024B0 /* types.m in Sources */,
315 | 4DA18CB5224399DE00D19222 /* PEOptions.m in Sources */,
316 | 4DA18CBD2243ABD100D19222 /* PEDecimalFormatter.m in Sources */,
317 | 4DF78E712248DDC0004024B0 /* PEFlowConnection.m in Sources */,
318 | 4DF78E86224BC8B8004024B0 /* PESketchMethods.m in Sources */,
319 | );
320 | runOnlyForDeploymentPostprocessing = 0;
321 | };
322 | /* End PBXSourcesBuildPhase section */
323 |
324 | /* Begin XCBuildConfiguration section */
325 | 4DA8CB3C2241369D00FC9D2D /* Debug */ = {
326 | isa = XCBuildConfiguration;
327 | buildSettings = {
328 | ALWAYS_SEARCH_USER_PATHS = NO;
329 | CLANG_ANALYZER_NONNULL = YES;
330 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
332 | CLANG_CXX_LIBRARY = "libc++";
333 | CLANG_ENABLE_MODULES = YES;
334 | CLANG_ENABLE_OBJC_ARC = YES;
335 | CLANG_ENABLE_OBJC_WEAK = YES;
336 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
337 | CLANG_WARN_BOOL_CONVERSION = YES;
338 | CLANG_WARN_COMMA = YES;
339 | CLANG_WARN_CONSTANT_CONVERSION = YES;
340 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
342 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
343 | CLANG_WARN_EMPTY_BODY = YES;
344 | CLANG_WARN_ENUM_CONVERSION = YES;
345 | CLANG_WARN_INFINITE_RECURSION = YES;
346 | CLANG_WARN_INT_CONVERSION = YES;
347 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
348 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
349 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
351 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
352 | CLANG_WARN_STRICT_PROTOTYPES = YES;
353 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
354 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
355 | CLANG_WARN_UNREACHABLE_CODE = YES;
356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
357 | CODE_SIGN_IDENTITY = "-";
358 | COPY_PHASE_STRIP = NO;
359 | CURRENT_PROJECT_VERSION = 1;
360 | DEBUG_INFORMATION_FORMAT = dwarf;
361 | ENABLE_STRICT_OBJC_MSGSEND = YES;
362 | ENABLE_TESTABILITY = YES;
363 | GCC_C_LANGUAGE_STANDARD = gnu11;
364 | GCC_DYNAMIC_NO_PIC = NO;
365 | GCC_NO_COMMON_BLOCKS = YES;
366 | GCC_OPTIMIZATION_LEVEL = 0;
367 | GCC_PREPROCESSOR_DEFINITIONS = (
368 | "DEBUG=1",
369 | "$(inherited)",
370 | );
371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
372 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
373 | GCC_WARN_UNDECLARED_SELECTOR = YES;
374 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
375 | GCC_WARN_UNUSED_FUNCTION = YES;
376 | GCC_WARN_UNUSED_VARIABLE = YES;
377 | MACOSX_DEPLOYMENT_TARGET = 10.14;
378 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
379 | MTL_FAST_MATH = YES;
380 | ONLY_ACTIVE_ARCH = YES;
381 | SDKROOT = macosx;
382 | VERSIONING_SYSTEM = "apple-generic";
383 | VERSION_INFO_PREFIX = "";
384 | };
385 | name = Debug;
386 | };
387 | 4DA8CB3D2241369D00FC9D2D /* Release */ = {
388 | isa = XCBuildConfiguration;
389 | buildSettings = {
390 | ALWAYS_SEARCH_USER_PATHS = NO;
391 | CLANG_ANALYZER_NONNULL = YES;
392 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
394 | CLANG_CXX_LIBRARY = "libc++";
395 | CLANG_ENABLE_MODULES = YES;
396 | CLANG_ENABLE_OBJC_ARC = YES;
397 | CLANG_ENABLE_OBJC_WEAK = YES;
398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
399 | CLANG_WARN_BOOL_CONVERSION = YES;
400 | CLANG_WARN_COMMA = YES;
401 | CLANG_WARN_CONSTANT_CONVERSION = YES;
402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
404 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
405 | CLANG_WARN_EMPTY_BODY = YES;
406 | CLANG_WARN_ENUM_CONVERSION = YES;
407 | CLANG_WARN_INFINITE_RECURSION = YES;
408 | CLANG_WARN_INT_CONVERSION = YES;
409 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
410 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
411 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
412 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
413 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
414 | CLANG_WARN_STRICT_PROTOTYPES = YES;
415 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
416 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
417 | CLANG_WARN_UNREACHABLE_CODE = YES;
418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
419 | CODE_SIGN_IDENTITY = "-";
420 | COPY_PHASE_STRIP = NO;
421 | CURRENT_PROJECT_VERSION = 1;
422 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
423 | ENABLE_NS_ASSERTIONS = NO;
424 | ENABLE_STRICT_OBJC_MSGSEND = YES;
425 | GCC_C_LANGUAGE_STANDARD = gnu11;
426 | GCC_NO_COMMON_BLOCKS = YES;
427 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
428 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
429 | GCC_WARN_UNDECLARED_SELECTOR = YES;
430 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
431 | GCC_WARN_UNUSED_FUNCTION = YES;
432 | GCC_WARN_UNUSED_VARIABLE = YES;
433 | MACOSX_DEPLOYMENT_TARGET = 10.14;
434 | MTL_ENABLE_DEBUG_INFO = NO;
435 | MTL_FAST_MATH = YES;
436 | SDKROOT = macosx;
437 | VERSIONING_SYSTEM = "apple-generic";
438 | VERSION_INFO_PREFIX = "";
439 | };
440 | name = Release;
441 | };
442 | 4DA8CB3F2241369D00FC9D2D /* Debug */ = {
443 | isa = XCBuildConfiguration;
444 | baseConfigurationReference = 934C9379DCA27F4889B1A21D /* Pods-print-export.debug.xcconfig */;
445 | buildSettings = {
446 | CODE_SIGN_STYLE = Automatic;
447 | COMBINE_HIDPI_IMAGES = YES;
448 | COMMAND_LINE_BUILD = 0;
449 | DEFINES_MODULE = YES;
450 | DEVELOPMENT_TEAM = "";
451 | DYLIB_COMPATIBILITY_VERSION = 1;
452 | DYLIB_CURRENT_VERSION = 1;
453 | DYLIB_INSTALL_NAME_BASE = "@rpath";
454 | FRAMEWORK_VERSION = A;
455 | INFOPLIST_FILE = "print-export/Info.plist";
456 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
457 | LD_RUNPATH_SEARCH_PATHS = (
458 | "$(inherited)",
459 | "@executable_path/../Frameworks",
460 | "@loader_path/Frameworks",
461 | );
462 | PRODUCT_BUNDLE_IDENTIFIER = "com.sketch.print-export";
463 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
464 | PROVISIONING_PROFILE_SPECIFIER = "";
465 | SKIP_INSTALL = YES;
466 | };
467 | name = Debug;
468 | };
469 | 4DA8CB402241369D00FC9D2D /* Release */ = {
470 | isa = XCBuildConfiguration;
471 | baseConfigurationReference = F87F0855D9C588A6689F6891 /* Pods-print-export.release.xcconfig */;
472 | buildSettings = {
473 | CODE_SIGN_STYLE = Automatic;
474 | COMBINE_HIDPI_IMAGES = YES;
475 | COMMAND_LINE_BUILD = 0;
476 | DEFINES_MODULE = YES;
477 | DEVELOPMENT_TEAM = "";
478 | DYLIB_COMPATIBILITY_VERSION = 1;
479 | DYLIB_CURRENT_VERSION = 1;
480 | DYLIB_INSTALL_NAME_BASE = "@rpath";
481 | FRAMEWORK_VERSION = A;
482 | INFOPLIST_FILE = "print-export/Info.plist";
483 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
484 | LD_RUNPATH_SEARCH_PATHS = (
485 | "$(inherited)",
486 | "@executable_path/../Frameworks",
487 | "@loader_path/Frameworks",
488 | );
489 | PRODUCT_BUNDLE_IDENTIFIER = "com.sketch.print-export";
490 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
491 | PROVISIONING_PROFILE_SPECIFIER = "";
492 | SKIP_INSTALL = YES;
493 | };
494 | name = Release;
495 | };
496 | /* End XCBuildConfiguration section */
497 |
498 | /* Begin XCConfigurationList section */
499 | 4DA8CB302241369C00FC9D2D /* Build configuration list for PBXProject "print-export" */ = {
500 | isa = XCConfigurationList;
501 | buildConfigurations = (
502 | 4DA8CB3C2241369D00FC9D2D /* Debug */,
503 | 4DA8CB3D2241369D00FC9D2D /* Release */,
504 | );
505 | defaultConfigurationIsVisible = 0;
506 | defaultConfigurationName = Release;
507 | };
508 | 4DA8CB3E2241369D00FC9D2D /* Build configuration list for PBXNativeTarget "print-export" */ = {
509 | isa = XCConfigurationList;
510 | buildConfigurations = (
511 | 4DA8CB3F2241369D00FC9D2D /* Debug */,
512 | 4DA8CB402241369D00FC9D2D /* Release */,
513 | );
514 | defaultConfigurationIsVisible = 0;
515 | defaultConfigurationName = Release;
516 | };
517 | /* End XCConfigurationList section */
518 | };
519 | rootObject = 4DA8CB2D2241369C00FC9D2D /* Project object */;
520 | }
521 |
--------------------------------------------------------------------------------
/src/framework/print-export.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/framework/print-export.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/framework/print-export.xcodeproj/xcshareddata/xcschemes/print-export.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/src/framework/print-export.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/framework/print-export.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/framework/print-export/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSHumanReadableCopyright
22 | Copyright © 2019 Sketch. All rights reserved.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEDecimalFormatter.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSDecimalFormatter.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface PEDecimalFormatter : NSNumberFormatter
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEDecimalFormatter.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSDecimalFormatter.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "PEDecimalFormatter.h"
10 |
11 | static NSRegularExpression *regExp;
12 | static const NSUInteger kMinimumFractionDigits = 0;
13 | static const NSUInteger kMaximumFractionDigits = 2;
14 |
15 | @implementation PEDecimalFormatter
16 |
17 | - (instancetype)init {
18 | if (self = [super init]) {
19 | static dispatch_once_t onceToken;
20 | dispatch_once(&onceToken, ^ {
21 | NSError *error = nil;
22 | regExp = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"^\\d*(%@\\d{%lu,%lu})?$", [self.decimalSeparator isEqualToString:@"."] ? @"\\." : self.decimalSeparator, kMinimumFractionDigits, kMaximumFractionDigits] options:0 error:&error];
23 | if (error != nil) {
24 | NSLog(@"Invalid regular expression: %@", error.localizedDescription);
25 | }
26 | });
27 | self.numberStyle = NSNumberFormatterDecimalStyle;
28 | self.minimumFractionDigits = kMinimumFractionDigits;
29 | self.maximumFractionDigits = kMaximumFractionDigits;
30 | self.allowsFloats = YES;
31 | self.hasThousandSeparators = NO;
32 | }
33 | return self;
34 | }
35 |
36 | - (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error {
37 | if (partialString.length == 0) {
38 | return YES;
39 | }
40 |
41 | NSTextCheckingResult *result = [regExp firstMatchInString:partialString options:0 range:NSMakeRange(0, partialString.length)];
42 | NSString *otherDecimalSeperator = [self.decimalSeparator isEqualToString:@"."] ? @"," : @".";
43 | *newString = [partialString stringByReplacingOccurrencesOfString:otherDecimalSeperator withString:self.decimalSeparator];
44 | return result.range.location == 0 && result.range.length == partialString.length;
45 | }
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEFlowConnection.h:
--------------------------------------------------------------------------------
1 | //
2 | // PEFlowConnection.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 25/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "types.h"
11 |
12 | @interface PEFlowConnection : NSObject
13 |
14 | @property (readonly, nonatomic) PEFlowConnectionType type;
15 | // relative to the source artboard
16 | @property (readonly, nonatomic) CGRect frame;
17 | @property (readonly, nonatomic) NSString *destinationArtboardID;
18 | @property (readonly, nonatomic) BOOL isBackAction;
19 |
20 | - (instancetype)initWithType:(PEFlowConnectionType)type frame:(CGRect)frame destinationArtboardID:(NSString *)destinationArtboardID;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEFlowConnection.m:
--------------------------------------------------------------------------------
1 | //
2 | // PEFlowConnection.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 25/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "PEFlowConnection.h"
10 |
11 | @implementation PEFlowConnection
12 |
13 | - (instancetype)initWithType:(PEFlowConnectionType)type frame:(CGRect)frame destinationArtboardID:(NSString *)destinationArtboardID {
14 | if (self = [super init]) {
15 | _type = type;
16 | _frame = frame;
17 | _destinationArtboardID = destinationArtboardID;
18 | _isBackAction = destinationArtboardID == nil;
19 | }
20 | return self;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEOptions.h:
--------------------------------------------------------------------------------
1 | //
2 | // PEOptions.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "types.h"
11 |
12 | @interface PEOptions : NSObject
13 |
14 | @property (readonly, nonatomic) PEExportType exportType;
15 | @property (readonly, nonatomic) PEScope scope;
16 | @property (readonly, nonatomic) BOOL showArboardShadow;
17 | @property (readonly, nonatomic) BOOL showArboardName;
18 | @property (readonly, nonatomic) BOOL showPrototypingLinks;
19 | @property (readonly, nonatomic) CGSize pageSize;
20 | @property (readonly, nonatomic) BOOL includeCropMarks;
21 | @property (readonly, nonatomic) CGFloat bleed;
22 | @property (readonly, nonatomic) CGFloat slug;
23 | @property (readonly, nonatomic) BOOL hasCropMarks;
24 |
25 | - (instancetype)initWithOptions:(NSDictionary *)options;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEOptions.m:
--------------------------------------------------------------------------------
1 | //
2 | // PEOptions.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "PEOptions.h"
10 | #import "PEUtils.h"
11 |
12 | static NSString *const kOptionKeyExportType = @"exportType";
13 | static NSString *const kOptionKeyScope = @"scope";
14 | static NSString *const kOptionKeyShowArtboardShadow = @"showArtboardShadow";
15 | static NSString *const kOptionKeyShowArtboardName = @"showArtboardName";
16 | static NSString *const kOptionKeyShowPrototypingLinks = @"showPrototypingLinks";
17 | static NSString *const kOptionKeyPageWidth = @"pageWidth";
18 | static NSString *const kOptionKeyPageHeight = @"pageHeight";
19 | static NSString *const kOptionKeyIncludeCropMarks = @"includeCropMarks";
20 | static NSString *const kOptionKeyBleed = @"bleed";
21 | static NSString *const kOptionKeySlug = @"slug";
22 |
23 | @implementation PEOptions
24 |
25 | - (instancetype)initWithOptions:(NSDictionary *)options {
26 | if (self = [super init]) {
27 | NSArray *requiredOptionKeys = @[
28 | kOptionKeyExportType,
29 | kOptionKeyScope,
30 | kOptionKeyShowArtboardShadow,
31 | kOptionKeyShowArtboardName,
32 | kOptionKeyShowPrototypingLinks,
33 | kOptionKeyPageWidth,
34 | kOptionKeyPageHeight,
35 | kOptionKeyIncludeCropMarks,
36 | kOptionKeyBleed,
37 | kOptionKeySlug];
38 | for (NSString *key in requiredOptionKeys) {
39 | if (options[key] == nil) {
40 | [NSException raise:@"Invalid options" format:@"%@ is missing from options", key];
41 | }
42 | }
43 | _exportType = (PEExportType)((NSNumber *)options[kOptionKeyExportType]).unsignedIntegerValue;
44 | _scope = (PEScope)((NSNumber *)options[kOptionKeyScope]).unsignedIntegerValue;
45 | _showArboardShadow = ((NSNumber *)options[kOptionKeyShowArtboardShadow]).boolValue;
46 | _showArboardName = ((NSNumber *)options[kOptionKeyShowArtboardName]).boolValue;
47 | _showPrototypingLinks = ((NSNumber *)options[kOptionKeyShowPrototypingLinks]).boolValue;
48 | _pageSize = CGSizeMake(PEMMToUnit(((NSNumber *)options[kOptionKeyPageWidth]).doubleValue), PEMMToUnit(((NSNumber*)options[kOptionKeyPageHeight]).doubleValue));
49 | _includeCropMarks = ((NSNumber *)options[kOptionKeyIncludeCropMarks]).boolValue;
50 | _bleed = PEMMToUnit(((NSNumber *)options[kOptionKeyBleed]).doubleValue);
51 | _slug = PEMMToUnit(((NSNumber *)options[kOptionKeySlug]).doubleValue);
52 | }
53 | return self;
54 | }
55 |
56 | - (BOOL)hasCropMarks {
57 | return self.includeCropMarks && self.slug > 0;
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEPrintExport.h:
--------------------------------------------------------------------------------
1 | //
2 | // PEPrintExport.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 19/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "types.h"
11 | #import "MSDocument.h"
12 | #import "PEOptions.h"
13 |
14 | @interface PEPrintExport : NSObject
15 |
16 | + (void)onShutdown:(NSDictionary *)context;
17 | + (void)generatePDFWithDocument:(MSDocument *)document filePath:(NSString *)filePath options:(NSDictionary *)options context:(NSDictionary *)pluginContext;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEPrintExport.m:
--------------------------------------------------------------------------------
1 | //
2 | // PEPrintExport.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 19/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "PEPrintExport.h"
10 | #import
11 | #import
12 | #import "PEOptions.h"
13 | #import "PEUtils.h"
14 | #import "MSDocument.h"
15 | #import "MSImmutableDocumentData.h"
16 | #import "MSConstants.h"
17 | #import "MSImmutableLayer.h"
18 | #import "MSImmutableFlowConnection.h"
19 | #import "PEFlowConnection.h"
20 | #import "types.h"
21 | #import
22 | #import "PESketchMethods.h"
23 |
24 | static const CGFloat kCropMarkLength = 3; // millimeters
25 | static const CGFloat kPageMargin = 15; // millimeters, only applies to Sketch page per PDF page
26 | static const CGFloat kImageResolution = 300; // dpi
27 | static NSString *const kFontName = @"Helvetica Neue";
28 |
29 | static const CGFloat kWhiteColor[] = {0, 0, 0, 0, 1};
30 | static const CGFloat kCropMarkColor[] = {0, 0, 0, 1, 1};
31 | static const CGFloat kArtboardNameColor[] = {0, 0, 0, 0.4, 1};
32 | static const CGFloat kPrototypingLinkColor[] = {0, 0.38, 1, 0.04, 1};
33 | static const CGFloat kStartCircleFillColor[] = {0, 0, 0, 0, 1};
34 | static const CGFloat kArtboardShadowBlur = 4;
35 | static const CGFloat kArtboardMinShadowBlur = 1;
36 | static const CGFloat kArtboardShadowColor[] = {0, 0, 0, 1, 0.5};
37 | static const CGSize kArrowSize = {.width = 5, .height = 5};
38 | static const CGFloat kConnectingEndPointOffset = 2;
39 | static const CGFloat kStartCircleDiameter = 3;
40 | static const CGFloat kBackBoxOffset = 3;
41 | static const CGFloat kBackBoxSize = 7;
42 | static const CGFloat kBackBoxCornerRadius = 1.5;
43 | static const CGSize kBackArrowSize = {.width = 2, .height = 4};
44 | static const CGFloat kPrototypingLinkWidth = 0.5;
45 |
46 | @interface PEPrintExport()
47 |
48 | @property (readonly, nonatomic) NSString *symbolsPageID;
49 | @property (readonly, nonatomic) NSURL *fileURL;
50 | @property (readonly, nonatomic) PEOptions *options;
51 | @property (readonly, nonatomic) MSDocumentData *documentData;
52 | @property (readonly, nonatomic) MSImmutableDocumentData *immutableDocumentData;
53 | @property (readonly, nonatomic) CFDictionaryRef auxiliaryInfo;
54 | @property (readonly, nonatomic) CGRect mediaBox;
55 | @property (readonly, nonatomic) CGRect bleedBox;
56 | @property (readonly, nonatomic) CGRect trimBox;
57 | @property (readonly, nonatomic) CGFloat slugBleed;
58 | @property (readonly, nonatomic) CGFloat cropMarkLength;
59 | @property (readonly, nonatomic) CGFloat pageMargin;
60 | @property (readonly, nonatomic) CGColorSpaceRef colorSpace;
61 |
62 | @end
63 |
64 | @implementation PEPrintExport
65 |
66 | + (void)onShutdown:(NSDictionary *)context {
67 | NSString *scriptPath = context[@"scriptPath"];
68 | NSString *frameworkBasePath = [scriptPath.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent stringByAppendingPathComponent:@"Resources"];
69 | NSString *frameworkPath = [[frameworkBasePath stringByAppendingPathComponent:@"print_export.framework"] stringByAppendingPathComponent:@"print_export"];
70 | void *frameworkHandle = dlopen([frameworkPath UTF8String], RTLD_LAZY);
71 | if (frameworkHandle != nil) {
72 | int result;
73 | do {
74 | result = dlclose(frameworkHandle);
75 | } while (result != -1);
76 | } else {
77 | NSLog(@"Couldn't load framework: %@", frameworkPath);
78 | }
79 | }
80 |
81 | + (void)generatePDFWithDocument:(MSDocument *)document filePath:(NSString *)filePath options:(NSDictionary*)options context:(NSDictionary *)pluginContext {
82 | PEOptions *typedOptions = [[PEOptions alloc] initWithOptions:options];
83 | NSURL *fileURL = [NSURL fileURLWithPath:filePath];
84 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
85 | PEPrintExport *printExport = [[PEPrintExport alloc] initWithDocument:document fileURL:fileURL options:typedOptions];
86 | switch (typedOptions.exportType) {
87 | case PEExportTypeArtboardPerPage:
88 | [printExport generateArtboardPerPage];
89 | break;
90 |
91 | case PEExportTypeSketchPagePerPage:
92 | [printExport generateSketchPagePerPage];
93 | break;
94 | }
95 | dispatch_async(dispatch_get_main_queue(), ^{
96 | [PESketchMethods displayFlashMessage:@"The PDF has been exported" document:document];
97 | });
98 | });
99 | }
100 |
101 | # pragma mark - Private
102 |
103 | - (instancetype)initWithDocument:(MSDocument *)document fileURL:(NSURL *)fileURL options:(PEOptions *)options {
104 | if (self = [super init]) {
105 | _documentData = document.documentData;
106 | _immutableDocumentData = document.documentData.immutableModelObject;
107 | _fileURL = fileURL;
108 | _options = options;
109 | _symbolsPageID = [document.documentData symbolsPage].objectID;
110 | _auxiliaryInfo = [self createAuxiliaryInfoWithOptions:self.options];
111 | _pageMargin = PEMMToUnit(kPageMargin);
112 | _slugBleed = self.options.slug + self.options.bleed;
113 | _colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericCMYK);
114 | }
115 | return self;
116 | }
117 |
118 | - (void)dealloc {
119 | CFRelease(self.auxiliaryInfo);
120 | CGColorSpaceRelease(self.colorSpace);
121 | }
122 |
123 | - (CGContextRef)createContext {
124 | CGRect mediaBox = self.mediaBox;
125 | CGContextRef ctx = CGPDFContextCreateWithURL((__bridge CFURLRef)self.fileURL, &mediaBox, self.auxiliaryInfo);
126 | if (!ctx) {
127 | NSLog(@"Couldn't create PDF context");
128 | return NULL;
129 | }
130 | return ctx;
131 | }
132 |
133 | - (void)setColorSpaceWithContext:(CGContextRef)ctx {
134 | CGContextSetFillColorSpace(ctx, self.colorSpace);
135 | CGContextSetStrokeColorSpace(ctx, self.colorSpace);
136 | }
137 |
138 | - (void)generateArtboardPerPage {
139 | CGContextRef ctx = [self createContext];
140 | if (!ctx) {
141 | return;
142 | }
143 | switch (self.options.scope) {
144 | case PEScopeAllPages:
145 | for (MSImmutablePage *page in self.immutableDocumentData.pages) {
146 | if (![page.objectID isEqualToString:self.symbolsPageID]) {
147 | [self generateArtboardsWithPage:page context:ctx];
148 | }
149 | }
150 | break;
151 |
152 | case PEScopeCurrentPage:
153 | [self generateArtboardsWithPage:self.immutableDocumentData.currentPage context:ctx];
154 | break;
155 | }
156 | CGContextRelease(ctx);
157 | }
158 |
159 | - (void)generateSketchPagePerPage {
160 | CGContextRef ctx = [self createContext];
161 | if (!ctx) {
162 | return;
163 | }
164 | switch (self.options.scope) {
165 | case PEScopeAllPages:
166 | for (MSImmutablePage *page in self.immutableDocumentData.pages) {
167 | if (![page.objectID isEqualToString:self.symbolsPageID]) {
168 | [self generateSketchPageWithPage:page context:ctx];
169 | }
170 | }
171 | break;
172 |
173 | case PEScopeCurrentPage:
174 | [self generateSketchPageWithPage:self.immutableDocumentData.currentPage context:ctx];
175 | break;
176 | }
177 | CGContextRelease(ctx);
178 | }
179 |
180 | - (CGFloat)cropMarkLength {
181 | if (kCropMarkLength <= self.options.slug) {
182 | return PEMMToUnit(kCropMarkLength);
183 | } else {
184 | return self.options.slug;
185 | }
186 | }
187 |
188 | - (void)generateArtboardsWithPage:(MSImmutablePage *)page context:(CGContextRef)ctx {
189 | NSArray *sortedArtboards = [page.artboards sortedArrayUsingComparator:^(MSImmutableArtboardGroup *artboard1, MSImmutableArtboardGroup *artboard2) {
190 | if (artboard1.rect.origin.y < artboard2.rect.origin.y) {
191 | return NSOrderedAscending;
192 | } else if (artboard1.rect.origin.y > artboard2.rect.origin.y) {
193 | return NSOrderedDescending;
194 | } else {
195 | if (artboard1.rect.origin.x < artboard2.rect.origin.x) {
196 | return NSOrderedAscending;
197 | } else if (artboard1.rect.origin.x > artboard2.rect.origin.x) {
198 | return NSOrderedDescending;
199 | }
200 | }
201 | return NSOrderedSame;
202 | }];
203 | NSColorSpace *nsColorSpace = [[NSColorSpace alloc] initWithCGColorSpace:self.colorSpace];
204 | for (MSImmutableArtboardGroup *artboard in sortedArtboards) {
205 | CGContextBeginPage(ctx, NULL);
206 | [self setColorSpaceWithContext:ctx];
207 | CGContextSaveGState(ctx);
208 | if (self.options.hasCropMarks) {
209 | [self drawCropMarksWithContext:ctx];
210 | }
211 | CGSize targetSize = [PEUtils fitSize:artboard.rect.size inSize:self.options.pageSize];
212 | CGContextSaveGState(ctx);
213 | CGRect targetRect = CGRectMake((self.mediaBox.size.width - targetSize.width) / 2.0, (self.mediaBox.size.height - targetSize.height) / 2.0, targetSize.width, targetSize.height);
214 | CGContextTranslateCTM(ctx, targetRect.origin.x, targetRect.origin.y);
215 | double imageScale = (targetSize.width / 72 * kImageResolution) / artboard.rect.size.width;
216 | if (imageScale < 1) {
217 | imageScale = 1;
218 | }
219 | CGImageRef artboardImage = [PEUtils imageOfArtboard:artboard scale:imageScale targetColorSpace:nsColorSpace documentData:self.immutableDocumentData];
220 | CGContextDrawImage(ctx, CGRectMake(0, 0, targetSize.width, targetSize.height), artboardImage);
221 | CGContextRestoreGState(ctx);
222 | CGContextRestoreGState(ctx);
223 | CGContextEndPage(ctx);
224 | }
225 | }
226 |
227 | - (void)generateSketchPageWithPage:(MSImmutablePage *)page context:(CGContextRef)ctx {
228 | CGContextBeginPage(ctx, NULL);
229 | [self setColorSpaceWithContext:ctx];
230 | CGContextSaveGState(ctx);
231 | if (self.options.hasCropMarks) {
232 | [self drawCropMarksWithContext:ctx];
233 | }
234 | CGRect artboardsRect = [self boundsOfArtboardsInPage:page];
235 | CGSize maxPageSize = CGSizeMake(self.options.pageSize.width - (self.pageMargin * 2), self.options.pageSize.height - (self.pageMargin * 2));
236 | CGSize targetSize = [PEUtils fitSize:artboardsRect.size inSize:maxPageSize];
237 | CGPoint origin = CGPointMake((self.mediaBox.size.width - targetSize.width) / 2.0, (self.mediaBox.size.height - targetSize.height) / 2.0);
238 | CGContextTranslateCTM(ctx, origin.x, origin.y);
239 | CGFloat scale = targetSize.width / artboardsRect.size.width;
240 | NSColorSpace *nsColorSpace = [[NSColorSpace alloc] initWithCGColorSpace:self.colorSpace];
241 | for (MSImmutableArtboardGroup *artboard in page.artboards) {
242 | CGContextSaveGState(ctx);
243 | CGContextScaleCTM(ctx, scale, scale);
244 | CGContextTranslateCTM(ctx, artboard.rect.origin.x - artboardsRect.origin.x, artboardsRect.size.height - (artboard.rect.origin.y - artboardsRect.origin.y + artboard.rect.size.height));
245 | if (self.options.showArboardShadow) {
246 | [self drawArtboardShadowWithArtboard:artboard rect:CGRectMake(0, 0, artboard.rect.size.width, artboard.rect.size.height) scale:scale context:ctx];
247 | }
248 | double imageScale = ((((targetSize.width / 72) / artboardsRect.size.width) * artboard.rect.size.width) * kImageResolution) / artboard.rect.size.width;
249 | if (imageScale < 1) {
250 | imageScale = 1;
251 | }
252 | CGImageRef artboardImage = [PEUtils imageOfArtboard:artboard scale:imageScale targetColorSpace:nsColorSpace documentData:self.immutableDocumentData];
253 | CGContextDrawImage(ctx, CGRectMake(0, 0, artboard.rect.size.width, artboard.rect.size.height), artboardImage);
254 | CGContextRestoreGState(ctx);
255 | if (self.options.showPrototypingLinks) {
256 | [self drawPrototypingLinksWithArtboard:artboard artboards:page.artboards artboardsRect:artboardsRect scale:scale context:ctx];
257 | }
258 | if (self.options.showArboardName) {
259 | CGPoint position = [PEUtils PDFPointWithAbsPoint:CGPointMake(artboard.rect.origin.x + artboard.rect.size.width / 2.0, artboard.rect.origin.y + artboard.rect.size.height + 40)
260 | absBoundsRect:artboardsRect scale:scale];
261 | [self drawLabel:artboard.name position:position size:22 * scale context:ctx];
262 | }
263 | }
264 | CGContextRestoreGState(ctx);
265 | CGContextEndPage(ctx);
266 | }
267 |
268 | - (void)drawCropMarksWithContext:(CGContextRef)ctx {
269 | CGContextSaveGState(ctx);
270 | CGFloat x0 = self.options.slug;
271 | CGFloat x1 = self.options.slug + self.options.bleed;
272 | CGFloat x2 = x1 + self.options.pageSize.width;
273 | CGFloat x3 = x2 + self.options.bleed;
274 | CGFloat y0 = x0;
275 | CGFloat y1 = x1;
276 | CGFloat y2 = y1 + self.options.pageSize.height;
277 | CGFloat y3 = y2 + self.options.bleed;
278 | CGPoint points[] = {
279 | x1, y0,
280 | x1, y0 - self.cropMarkLength,
281 |
282 | x2, y0,
283 | x2, y0 - self.cropMarkLength,
284 |
285 | x0, y1,
286 | x0 - self.cropMarkLength, y1,
287 |
288 | x3, y1,
289 | x3 + self.cropMarkLength, y1,
290 |
291 | x0, y2,
292 | x0 - self.cropMarkLength, y2,
293 |
294 | x3, y2,
295 | x3 + self.cropMarkLength, y2,
296 |
297 | x1, y3,
298 | x1, y3 + self.cropMarkLength,
299 |
300 | x2, y3,
301 | x2, y3 + self.cropMarkLength
302 | };
303 | CGContextSetLineWidth(ctx, 0.5);
304 | CGContextSetStrokeColor(ctx, kCropMarkColor);
305 | CGContextStrokeLineSegments(ctx, points, 16);
306 | }
307 |
308 | - (void)drawArtboardShadowWithArtboard:(MSImmutableArtboardGroup *)artboard rect:(CGRect)artboardRect scale:(CGFloat)scale context:(CGContextRef)ctx {
309 | CGContextSaveGState(ctx);
310 | CGColorRef color = CGColorCreate(self.colorSpace, kArtboardShadowColor);
311 | CGFloat blur = scale < 0.1 ? kArtboardMinShadowBlur : kArtboardShadowBlur;
312 | CGContextSetShadowWithColor(ctx, CGSizeMake(0, 0), blur, color);
313 | CGColorRelease(color);
314 | CGContextSetFillColor(ctx, kWhiteColor);
315 | CGContextFillRect(ctx, artboardRect);
316 | CGContextRestoreGState(ctx);
317 | }
318 |
319 | - (void)drawLabel:(NSString *)label position:(CGPoint)position size:(CGFloat)size context:(CGContextRef)ctx {
320 | CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)kFontName, size, NULL);
321 | CGColorRef color = CGColorCreate(self.colorSpace, kArtboardNameColor);
322 | CFStringRef keys[] = {kCTFontAttributeName, kCTForegroundColorAttributeName};
323 | CFTypeRef values[] = {font, color};
324 | CFDictionaryRef attributes = CFDictionaryCreate(kCFAllocatorDefault, (const void**)&keys, (const void**)&values, sizeof(keys) / sizeof(keys[0]),
325 | &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
326 | CFAttributedStringRef attrString = CFAttributedStringCreate(kCFAllocatorDefault, (__bridge CFStringRef)label, attributes);
327 | CFRelease(attributes);
328 | CTLineRef line = CTLineCreateWithAttributedString(attrString);
329 | CFRelease(attrString);
330 | CGRect lineBounds = CTLineGetImageBounds(line, ctx);
331 | CGContextSetTextPosition(ctx, position.x - lineBounds.size.width / 2.0, position.y);
332 | CTLineDraw(line, ctx);
333 | CFRelease(line);
334 | CGColorRelease(color);
335 | CFRelease(font);
336 | }
337 |
338 | - (void)drawPrototypingLinksWithArtboard:(MSImmutableArtboardGroup *)artboard artboards:(NSArray *)artboards artboardsRect:(CGRect)artboardsRect
339 | scale:(CGFloat)scale context:(CGContextRef)ctx {
340 | NSArray *flowConnections = [self buildFlowConnectionsWithArtboard:artboard];
341 | if (flowConnections.count == 0) {
342 | return;
343 | }
344 | CGContextSaveGState(ctx);
345 |
346 | // artboards clipping area
347 | CGContextBeginPath(ctx);
348 | CGContextAddRect(ctx, CGRectInfinite);
349 | for (MSImmutableArtboardGroup *itArtboard in artboards) {
350 | if (itArtboard != artboard) {
351 | CGContextAddRect(ctx, [PEUtils PDFRectWithAbsRect:itArtboard.rect absBoundsRect:artboardsRect scale:scale]);
352 | }
353 | }
354 | CGContextEOClip(ctx);
355 |
356 | CGContextSetLineWidth(ctx, kPrototypingLinkWidth);
357 | CGContextSetStrokeColor(ctx, kPrototypingLinkColor);
358 |
359 | for (PEFlowConnection *flowConnection in flowConnections) {
360 | MSImmutableArtboardGroup *destinationArtboard = (MSImmutableArtboardGroup *)[self layerWithID:flowConnection.destinationArtboardID];
361 | CGRect sourceAbsRect = CGRectMake(artboard.rect.origin.x + flowConnection.frame.origin.x, artboard.rect.origin.y + flowConnection.frame.origin.y,
362 | flowConnection.frame.size.width, flowConnection.frame.size.height);
363 | CGRect sourceRect = [PEUtils PDFRectWithAbsRect:sourceAbsRect absBoundsRect:artboardsRect scale:scale];
364 | CGPoint startPoint;
365 | if (flowConnection.destinationArtboardID != nil) {
366 | PEConnectingLine connectingLine = [PEUtils connectingLineWithRect:sourceAbsRect withRect:destinationArtboard.rect];
367 | startPoint = [PEUtils PDFPointWithAbsPoint:connectingLine.startPoint.point absBoundsRect:artboardsRect scale:scale];
368 | PEConnectedPoint pdfConnectedPoint = [PEUtils PDFConnectedPointWithAbsConnectedPoint:connectingLine.endPoint absBoundsRect:artboardsRect scale:scale];
369 | CGPoint endPoint = [PEUtils offsetPDFPoint:pdfConnectedPoint.point side:connectingLine.endPoint.side offset:kConnectingEndPointOffset + kArrowSize.height];
370 |
371 | // curve
372 | CGContextBeginPath(ctx);
373 | CGContextMoveToPoint(ctx, startPoint.x, startPoint.y);
374 | CGFloat deltaX = fabs(startPoint.x - connectingLine.endPoint.point.x);
375 | CGFloat deltaY = fabs(startPoint.y - connectingLine.endPoint.point.y);
376 | if (deltaX == 0 || deltaY == 0) {
377 | CGContextAddLineToPoint(ctx, endPoint.x, endPoint.y);
378 | } else {
379 | CGFloat length = [PEUtils distanceBetweenPoint:startPoint andPoint:endPoint] / 3.0;
380 | CGPoint controlPoint1 = [self calculateControlPointWithPoint:startPoint side:connectingLine.startPoint.side length:length];
381 | CGPoint controlPoint2 = [self calculateControlPointWithPoint:endPoint side:connectingLine.endPoint.side length:length];
382 | CGContextAddCurveToPoint(ctx, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, endPoint.x, endPoint.y);
383 | }
384 | CGContextDrawPath(ctx, kCGPathStroke);
385 |
386 | // arrow
387 | [self createArrowPathWithPoint:endPoint side:connectingLine.endPoint.side size:kArrowSize context:ctx];
388 | CGContextSetFillColor(ctx, kPrototypingLinkColor);
389 | CGContextDrawPath(ctx, kCGPathFill);
390 | } else {
391 | // previous artboard
392 | startPoint = CGPointMake(sourceRect.origin.x, sourceRect.origin.y + sourceRect.size.height / 2.0);
393 |
394 | // line
395 | CGContextBeginPath(ctx);
396 | CGContextMoveToPoint(ctx, startPoint.x, startPoint.y);
397 | CGPoint endPoint = CGPointMake(((artboard.rect.origin.x - artboardsRect.origin.x) * scale) - kBackBoxOffset, startPoint.y);
398 | CGContextAddLineToPoint(ctx, endPoint.x, endPoint.y);
399 | CGContextDrawPath(ctx, kCGPathStroke);
400 |
401 | // box
402 | CGRect boxRect = CGRectMake(endPoint.x - kBackBoxSize, endPoint.y - (kBackBoxSize / 2.0), kBackBoxSize, kBackBoxSize);
403 | [self createRoundedRectanglePathWithRect:boxRect radius:kBackBoxCornerRadius context:ctx];
404 | CGContextSetFillColor(ctx, kPrototypingLinkColor);
405 | CGContextDrawPath(ctx, kCGPathFill);
406 |
407 | // arrow
408 | CGRect arrowRect = [PEUtils centerSize:kBackArrowSize inRect:boxRect];
409 | CGContextBeginPath(ctx);
410 | CGContextMoveToPoint(ctx, arrowRect.origin.x + arrowRect.size.width, arrowRect.origin.y);
411 | CGContextAddLineToPoint(ctx, arrowRect.origin.x, arrowRect.origin.y + arrowRect.size.height / 2.0);
412 | CGContextAddLineToPoint(ctx, arrowRect.origin.x + arrowRect.size.width, arrowRect.origin.y + arrowRect.size.height);
413 | CGContextSetStrokeColor(ctx, kWhiteColor);
414 | CGContextDrawPath(ctx, kCGPathStroke);
415 | }
416 |
417 | // start circle
418 | CGContextBeginPath(ctx);
419 | CGContextAddEllipseInRect(ctx, [PEUtils makeRectWithMidpoint:startPoint size:kStartCircleDiameter]);
420 | CGContextSetFillColor(ctx, kStartCircleFillColor);
421 | CGContextSetStrokeColor(ctx, kPrototypingLinkColor);
422 | CGContextDrawPath(ctx, kCGPathFillStroke);
423 | }
424 | CGContextRestoreGState(ctx);
425 | }
426 |
427 | // point is where the curve connects to the arrow i.e. opposite the apex
428 | - (void)createArrowPathWithPoint:(CGPoint)point side:(PESide)side size:(CGSize)size context:(CGContextRef)ctx {
429 | CGFloat angle = 0;
430 | switch (side) {
431 | case PESideTop:
432 | angle = -M_PI_2;
433 | break;
434 |
435 | case PESideRight:
436 | angle = M_PI;
437 | break;
438 |
439 | case PESideBottom:
440 | angle = M_PI_2;
441 | break;
442 |
443 | case PESideLeft:
444 | angle = 0;
445 | break;
446 | }
447 | [self createArrowPathWithPoint:point angle:angle size:size context:ctx];
448 | }
449 |
450 | - (void)createArrowPathWithPoint:(CGPoint)point angle:(CGFloat)angle size:(CGSize)size context:(CGContextRef)ctx {
451 | CGContextBeginPath(ctx);
452 | CGFloat halfWidth = size.width / 2.0;
453 | CGContextMoveToPoint(ctx, cos(angle + M_PI_2) * halfWidth + point.x, sin(angle + M_PI_2) * halfWidth + point.y);
454 | CGContextAddLineToPoint(ctx, cos(angle - M_PI_2) * halfWidth + point.x, sin(angle - M_PI_2) * halfWidth + point.y);
455 | CGContextAddLineToPoint(ctx, cos(angle) * size.height + point.x, sin(angle) * size.height + point.y);
456 | CGContextClosePath(ctx);
457 | }
458 |
459 | - (void)createRoundedRectanglePathWithRect:(CGRect)rect radius:(CGFloat)radius context:(CGContextRef)ctx {
460 | CGFloat minX = CGRectGetMinX(rect);
461 | CGFloat minY = CGRectGetMinY(rect);
462 | CGFloat midX = CGRectGetMidX(rect);
463 | CGFloat midY = CGRectGetMidY(rect);
464 | CGFloat maxX = CGRectGetMaxX(rect);
465 | CGFloat maxY = CGRectGetMaxY(rect);
466 |
467 | CGContextBeginPath(ctx);
468 | CGContextMoveToPoint(ctx, minX, midY);
469 | CGContextAddArcToPoint(ctx, minX, minY, midX, minY, radius);
470 | CGContextAddArcToPoint(ctx, maxX, minY, maxX, midY, radius);
471 | CGContextAddArcToPoint(ctx, maxX, maxY, midX, maxY, radius);
472 | CGContextAddArcToPoint(ctx, minX, maxY, minX, midY, radius);
473 | CGContextClosePath(ctx);
474 | }
475 |
476 | - (CGPoint)calculateControlPointWithPoint:(CGPoint)point side:(PESide)side length:(CGFloat)length {
477 | switch (side) {
478 | case PESideLeft:
479 | return CGPointMake(point.x - length, point.y);
480 |
481 | case PESideRight:
482 | return CGPointMake(point.x + length, point.y);
483 |
484 | case PESideTop:
485 | return CGPointMake(point.x, point.y + length);
486 |
487 | case PESideBottom:
488 | return CGPointMake(point.x, point.y - length);
489 | }
490 | }
491 |
492 | - (CFDictionaryRef)createAuxiliaryInfoWithOptions:(PEOptions *)options {
493 | _mediaBox = CGRectMake(0, 0, self.options.pageSize.width + ((self.options.slug + self.options.bleed) * 2), self.options.pageSize.height + ((self.options.slug + self.options.bleed) * 2));
494 | _bleedBox = CGRectMake(self.options.slug, self.options.slug, self.options.pageSize.width + (self.options.bleed * 2), self.options.pageSize.height + (self.options.bleed * 2));
495 | _trimBox = CGRectMake(self.options.slug + self.options.bleed, self.options.slug + self.options.bleed, self.options.pageSize.width, self.options.pageSize.height);
496 |
497 | CFMutableDictionaryRef info = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
498 |
499 | CGRect mediaBox = self.mediaBox;
500 | CFDataRef mediaBoxData = CFDataCreate(kCFAllocatorDefault, (UInt8 *)&mediaBox, sizeof(mediaBox));
501 | CFDictionarySetValue(info, kCGPDFContextMediaBox, mediaBoxData);
502 | CFRelease(mediaBoxData);
503 |
504 | CGRect bleedBox = self.bleedBox;
505 | CFDataRef bleedBoxData = CFDataCreate(kCFAllocatorDefault, (UInt8 *)&bleedBox, sizeof(bleedBox));
506 | CFDictionarySetValue(info, kCGPDFContextMediaBox, bleedBoxData);
507 | CFRelease(bleedBoxData);
508 |
509 | CGRect trimBox = self.trimBox;
510 | CFDataRef trimBoxData = CFDataCreate(kCFAllocatorDefault, (UInt8 *)&trimBox, sizeof(trimBox));
511 | CFDictionarySetValue(info, kCGPDFContextTrimBox, trimBoxData);
512 | CFRelease(trimBoxData);
513 |
514 | return info;
515 | }
516 |
517 | - (CGRect)boundsOfArtboardsInPage:(MSImmutablePage *)page {
518 | NSNumber *minX, *minY, *maxX, *maxY;
519 | for (MSImmutableArtboardGroup *artboard in page.artboards) {
520 | if (minX == nil || artboard.rect.origin.x < minX.doubleValue) {
521 | minX = [NSNumber numberWithDouble:artboard.rect.origin.x];
522 | }
523 | if (minY == nil || artboard.rect.origin.y < minY.doubleValue) {
524 | minY = [NSNumber numberWithDouble:artboard.rect.origin.y];
525 | }
526 | if (maxX == nil || artboard.rect.origin.x + artboard.rect.size.width > maxX.doubleValue) {
527 | maxX = [NSNumber numberWithDouble:artboard.rect.origin.x + artboard.rect.size.width];
528 | }
529 | if (maxY == nil || artboard.rect.origin.y + artboard.rect.size.height > maxY.doubleValue) {
530 | maxY = [NSNumber numberWithDouble:artboard.rect.origin.y + artboard.rect.size.height];
531 | }
532 | }
533 | return CGRectMake(minX.doubleValue, minY.doubleValue, maxX.doubleValue - minX.doubleValue, maxY.doubleValue - minY.doubleValue);
534 | }
535 |
536 | - (NSArray *)buildFlowConnectionsWithArtboard:(MSImmutableArtboardGroup *)artboard {
537 | NSMutableArray *flowConnections = [NSMutableArray new];
538 | for (MSImmutableLayer *layer in artboard.layers) {
539 | [self buildFlowConnections:flowConnections layer:layer parentOrigin:CGPointZero];
540 | }
541 | return [flowConnections copy];
542 | }
543 |
544 | - (void)buildFlowConnections:(NSMutableArray *)flowConnections layer:(MSImmutableLayer *)layer
545 | parentOrigin:(CGPoint)parentOrigin {
546 | if ([self hasFlowConnectionWithLayer:layer]) {
547 | PEFlowConnection *flowConnection = [self buildFlowConnectionWithLayer:layer parentOrigin:parentOrigin];
548 | [flowConnections addObject:flowConnection];
549 | }
550 |
551 | BOOL isSymbolInstance = [layer isMemberOfClass:NSClassFromString(kMSImmutableSymbolInstance)];
552 | if ([layer isKindOfClass:NSClassFromString(kMSImmutableLayerGroup)] || isSymbolInstance) {
553 | MSImmutableLayerGroup *layerGroup = nil;
554 | if (isSymbolInstance) {
555 | layerGroup = [PESketchMethods detachedLayerGroupRecursively:YES withDocument:self.immutableDocumentData symbolInstance:(MSImmutableSymbolInstance *)layer];
556 | } else {
557 | layerGroup = (MSImmutableLayerGroup *)layer;
558 | }
559 | for (MSImmutableLayer *childLayer in layerGroup.layers) {
560 | CGPoint tOrigin = CGPointMake(parentOrigin.x + layerGroup.rect.origin.x, parentOrigin.y + layerGroup.rect.origin.y);
561 | [self buildFlowConnections:flowConnections layer:childLayer parentOrigin:tOrigin];
562 | }
563 | }
564 | }
565 |
566 | - (PEFlowConnection *)buildFlowConnectionWithLayer:(MSImmutableLayer *)layer parentOrigin:(CGPoint)parentOrigin {
567 | CGRect frame = CGRectMake(parentOrigin.x + layer.rect.origin.x, parentOrigin.y + layer.rect.origin.y, layer.rect.size.width, layer.rect.size.height);
568 | PEFlowConnectionType type;
569 | if ([layer isMemberOfClass:NSClassFromString(kMSImmutableHotspotLayer)]) {
570 | type = PEFlowConnectionTypeHotspot;
571 | } else {
572 | type = PEFlowConnectionTypeLayer;
573 | }
574 | NSString *destinationArtboardID = layer.flow.isBackAction ? nil : layer.flow.destinationArtboardID;
575 | return [[PEFlowConnection alloc] initWithType:type frame:frame destinationArtboardID:destinationArtboardID];
576 | }
577 |
578 | - (BOOL)hasFlowConnectionWithLayer:(MSImmutableLayer *)layer {
579 | return layer.flow != nil && ![layer.flow.destinationArtboardID isEqualToString:@""];
580 | }
581 |
582 | - (MSImmutableLayer *)layerWithID:(NSString *)layerID {
583 | return [PESketchMethods immutableLayerWithID:layerID documentData:self.documentData];
584 | }
585 |
586 | @end
587 |
--------------------------------------------------------------------------------
/src/framework/print-export/PESketchMethods.h:
--------------------------------------------------------------------------------
1 | //
2 | // PESketchMethods.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 27/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MSImmutableLayer.h"
11 | #import "MSDocument.h"
12 | #import "MSImmutableDocumentData.h"
13 | #import "MSImmutableSymbolInstance.h"
14 |
15 | @interface PESketchMethods : NSObject
16 |
17 | + (NSData *)imageDataOfLayer:(MSImmutableLayer *)layer scale:(double)scale documentData:(MSImmutableDocumentData *)documentData;
18 | + (MSImmutableLayer *)immutableLayerWithID:(NSString *)layerID documentData:(MSDocumentData *)documentData;
19 | + (void)displayFlashMessage:(NSString *)message document:(MSDocument *)document;
20 | + (MSImmutableLayerGroup *)detachedLayerGroupRecursively:(BOOL)recursively withDocument:(MSImmutableDocumentData *)documentData symbolInstance:(MSImmutableSymbolInstance *)symbolInstance;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/src/framework/print-export/PESketchMethods.m:
--------------------------------------------------------------------------------
1 | //
2 | // PESketchMethods.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 27/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "PESketchMethods.h"
10 | #import "MSConstants.h"
11 | #import "MSImmutableLayerAncestry.h"
12 | #import "MSExportRequest.h"
13 | #import "MSExportManager.h"
14 | #import "MSLayer.h"
15 |
16 | @implementation PESketchMethods
17 |
18 | + (NSData *)imageDataOfLayer:(MSImmutableLayer *)layer scale:(double)scale documentData:(MSImmutableDocumentData *)documentData {
19 | Class cls = NSClassFromString(kMSImmutableLayerAncestry);
20 | SEL selector;
21 | MSImmutableLayerAncestry * layerAncestry;
22 | if (cls == nil) {
23 | // Sketch 66
24 | cls = NSClassFromString(kMSImmutableLayerAncestry66);
25 | layerAncestry = [cls alloc];
26 | selector = NSSelectorFromString(@"initWithLayer:ancestors:document:");
27 | typedef MSImmutableLayerAncestry* (*MethodType1)(MSImmutableLayerAncestry *, SEL, MSImmutableLayer *, NSArray *, MSImmutableDocumentData *);
28 | MethodType1 method1 = (MethodType1)[layerAncestry methodForSelector:selector];
29 | layerAncestry = method1(layerAncestry, selector, layer, @[], documentData);
30 | } else {
31 | layerAncestry = [cls alloc];
32 | selector = NSSelectorFromString(@"initWithLayer:document:");
33 | typedef MSImmutableLayerAncestry* (*MethodType1)(MSImmutableLayerAncestry *, SEL, MSImmutableLayer *, MSImmutableDocumentData *);
34 | MethodType1 method1 = (MethodType1)[layerAncestry methodForSelector:selector];
35 | layerAncestry = method1(layerAncestry, selector, layer, documentData);
36 | }
37 |
38 | selector = NSSelectorFromString(@"formatWithScale:name:fileFormat:");
39 | typedef id (*MethodType2)(Class, SEL, double, NSString *, NSString *);
40 | cls = NSClassFromString(kMSExportFormat);
41 | MethodType2 method2 = (MethodType2)[cls methodForSelector:selector];
42 | id exportFormat = method2(cls, selector, scale, @"", @"png");
43 |
44 | selector = NSSelectorFromString(@"exportRequestsFromLayerAncestry:exportFormats:");
45 | typedef NSArray * (*MethodType3)(Class, SEL, MSImmutableLayerAncestry *, NSArray *);
46 | cls = NSClassFromString(kMSExportRequest);
47 | MethodType3 method3 = (MethodType3)[cls methodForSelector:selector];
48 | NSArray *exportRequests = method3(cls, selector, layerAncestry, @[exportFormat]);
49 | MSExportRequest *exportRequest = exportRequests.firstObject;
50 | [exportRequest setValue:[NSNumber numberWithBool:YES] forKey:@"includeArtboardBackground"];
51 |
52 | cls = NSClassFromString(kMSExportManager);
53 | MSExportManager *exportManager = [cls alloc];
54 | selector = NSSelectorFromString(@"init");
55 | typedef MSExportManager* (*MethodType4)(MSExportManager *, SEL);
56 | MethodType4 method4 = (MethodType4)[exportManager methodForSelector:selector];
57 | exportManager = method4(exportManager, selector);
58 |
59 | selector = NSSelectorFromString(@"exportedDataForRequest:");
60 | typedef NSData * (*MethodType5)(MSExportManager *, SEL, MSExportRequest *);
61 | MethodType5 method5 = (MethodType5)[exportManager methodForSelector:selector];
62 | return method5(exportManager, selector, exportRequest);
63 | }
64 |
65 | + (MSImmutableLayer*)immutableLayerWithID:(NSString *)layerID documentData:(MSDocumentData *)documentData {
66 | if (layerID == nil) {
67 | return nil;
68 | }
69 | SEL selector = NSSelectorFromString(@"layerWithID:");
70 | typedef MSLayer * (*MethodType)(MSDocumentData *, SEL, NSString *);
71 | MethodType method = (MethodType)[documentData methodForSelector:selector];
72 | return ((MSLayer*)method(documentData, selector, layerID)).immutableModelObject;
73 | }
74 |
75 | + (void)displayFlashMessage:(NSString *)message document:(MSDocument *)document {
76 | if ([document respondsToSelector:NSSelectorFromString(@"currentContentViewController")]) {
77 | // >= 47
78 | MSFlashController *flashController = document.currentContentViewController.flashController;
79 | SEL selector = NSSelectorFromString(@"displayFlashMessage:");
80 | typedef id (*MethodType)(MSFlashController *, SEL, NSString*);
81 | MethodType method = (MethodType)[flashController methodForSelector:selector];
82 | method(flashController, selector, message);
83 | } else {
84 | // < 47
85 | SEL selector = NSSelectorFromString(@"displayMessage:");
86 | typedef void (*MethodType)(MSDocument*, SEL, NSString*);
87 | MethodType method = (MethodType)[document methodForSelector:selector];
88 | method(document, selector, message);
89 | }
90 | }
91 |
92 | + (MSImmutableLayerGroup *)detachedLayerGroupRecursively:(BOOL)recursively withDocument:(MSImmutableDocumentData *)documentData symbolInstance:(MSImmutableSymbolInstance *)symbolInstance {
93 | SEL selector = NSSelectorFromString(@"detachedLayerGroupRecursively:withDocument:visitedSymbols:");
94 | // This only exists in Sketch 55 and earlier
95 | if ([symbolInstance respondsToSelector:selector]) {
96 | typedef id (*MethodType)(MSImmutableSymbolInstance *, SEL, BOOL, MSImmutableDocumentData *, NSSet *);
97 | MethodType method = (MethodType)[symbolInstance methodForSelector:selector];
98 | return method(symbolInstance, selector, recursively, documentData, nil);
99 | }
100 | selector = NSSelectorFromString(@"detachedLayerGroupRecursively:withDocument:resizeToNaturalSizeOnAxes:desiredWidth:visitedSymbols:skipCache:");
101 | typedef id (*MethodType)(MSImmutableSymbolInstance *, SEL, BOOL, MSImmutableDocumentData *, int BCAxisMask, CGFloat, NSSet *, BOOL);
102 | MethodType method = (MethodType)[symbolInstance methodForSelector:selector];
103 | return method(symbolInstance, selector, recursively, documentData, 0, symbolInstance.rect.size.width, nil, NO);
104 | }
105 |
106 | @end
107 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEUtils.h:
--------------------------------------------------------------------------------
1 | //
2 | // PEUtils.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MSImmutableArtboardGroup.h"
11 | #import "MSImmutableDocumentData.h"
12 | #import "MSColor-Protocol.h"
13 | #import "types.h"
14 | #import "MSDocumentData.h"
15 | #import "MSDocument.h"
16 |
17 | extern CGFloat PEMMToUnit(CGFloat millimeter);
18 | extern CGRect PEMMRectToUnitRect(CGFloat x, CGFloat y, CGFloat width, CGFloat height);
19 |
20 | @interface PEUtils : NSObject
21 |
22 | + (CGImageRef)imageOfArtboard:(MSImmutableArtboardGroup *)artboard scale:(double)scale targetColorSpace:(NSColorSpace *)targetColorSpace
23 | documentData:(MSImmutableDocumentData *)documentData;
24 | + (CGSize)fitSize:(CGSize)sourceSize inSize:(CGSize)targetSize;
25 | + (PEConnectingLine)connectingLineWithRect:(CGRect)rect1 withRect:(CGRect)rect2;
26 | + (CGRect)makeRectWithMidpoint:(CGPoint)midpoint size:(CGFloat)size;
27 | + (CGRect)centerSize:(CGSize)size inRect:(CGRect)rect2;
28 | + (CGFloat)distanceBetweenPoint:(CGPoint)point1 andPoint:(CGPoint)point2;
29 | + (CGPoint)PDFPointWithAbsPoint:(CGPoint)absPoint absBoundsRect:(CGRect)absBoundsRect scale:(CGFloat)scale;
30 | + (PEConnectedPoint)PDFConnectedPointWithAbsConnectedPoint:(PEConnectedPoint)absConnectedPoint absBoundsRect:(CGRect)absBoundsRect scale:(CGFloat)scale;
31 | + (CGRect)PDFRectWithAbsRect:(CGRect)absRect absBoundsRect:(CGRect)absBoundsRect scale:(CGFloat)scale;
32 | + (CGPoint)offsetPDFPoint:(CGPoint)point side:(PESide)side offset:(CGFloat)offset;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/src/framework/print-export/PEUtils.m:
--------------------------------------------------------------------------------
1 | //
2 | // PEUtils.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "PEUtils.h"
10 | #import "MSConstants.h"
11 | #import "MSImmutableLayerAncestry.h"
12 | #import "MSExportRequest.h"
13 | #import "MSExportManager.h"
14 | #import "MSImmutableLayer.h"
15 | #import "MSLayer.h"
16 | #import "MSDocument.h"
17 | #import "PESketchMethods.h"
18 |
19 | CGFloat PEMMToUnit(CGFloat millimeter) {
20 | return (millimeter / 25.4) * 72;
21 | }
22 |
23 | CGRect PEMMRectToUnitRect(CGFloat x, CGFloat y, CGFloat width, CGFloat height) {
24 | return CGRectMake(PEMMToUnit(x), PEMMToUnit(y), PEMMToUnit(width), PEMMToUnit(height));
25 | }
26 |
27 | @implementation PEUtils
28 |
29 | + (CGImageRef)imageOfArtboard:(MSImmutableArtboardGroup *)artboard scale:(double)scale targetColorSpace:(NSColorSpace *)targetColorSpace
30 | documentData:(MSImmutableDocumentData *)documentData {
31 |
32 | NSData *data = [PESketchMethods imageDataOfLayer:artboard scale:scale documentData:documentData];
33 | NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:data];
34 | NSBitmapImageRep *convertedImageRep = [imageRep bitmapImageRepByConvertingToColorSpace:targetColorSpace renderingIntent:NSColorRenderingIntentDefault];
35 | return convertedImageRep.CGImage;
36 | }
37 |
38 | + (CGSize)fitSize:(CGSize)sourceSize inSize:(CGSize)targetSize {
39 | CGFloat sourceApsectRatio = sourceSize.width / sourceSize.height;
40 | CGFloat targetAspectRatio = targetSize.width / targetSize.height;
41 | CGFloat width = 0, height = 0;
42 | if (sourceApsectRatio > targetAspectRatio) {
43 | width = targetSize.width;
44 | height = sourceSize.height * (targetSize.width / sourceSize.width);
45 | } else {
46 | height = targetSize.height;
47 | width = sourceSize.width * (targetSize.height / sourceSize.height);
48 | }
49 | return CGSizeMake(width, height);
50 | }
51 |
52 | + (PEConnectingLine)connectingLineWithRect:(CGRect)rect1 withRect:(CGRect)rect2 {
53 | CGPoint midPoint1 = [self midPointOfRect:rect1];
54 | CGPoint midPoint2 = [self midPointOfRect:rect2];
55 | PESide side1, side2;
56 | if ([self intersectsVerticallyWithRect:rect1 andRect:rect2]) {
57 | if (midPoint1.y < midPoint2.y) {
58 | side1 = PESideBottom;
59 | side2 = PESideTop;
60 | } else {
61 | side1 = PESideTop;
62 | side2 = PESideBottom;
63 | }
64 | } else {
65 | if (midPoint1.x < midPoint2.x) {
66 | side1 = PESideRight;
67 | side2 = PESideLeft;
68 | } else {
69 | side1 = PESideLeft;
70 | side2 = PESideRight;
71 | }
72 | }
73 | PEConnectedPoint startConnectedPoint = [self connectedPointWithRect:rect1 side:side1];
74 | PEConnectedPoint endConnectedPoint = [self connectedPointWithRect:rect2 side:side2];
75 | return PEConnectingLineMake(startConnectedPoint, endConnectedPoint);
76 | }
77 |
78 | + (CGRect)makeRectWithMidpoint:(CGPoint)midpoint size:(CGFloat)size {
79 | CGFloat halfSize = size / 2.0;
80 | return CGRectMake(midpoint.x - halfSize, midpoint.y - halfSize, size, size);
81 | }
82 |
83 | + (CGRect)centerSize:(CGSize)size inRect:(CGRect)rect {
84 | return CGRectMake(rect.origin.x + (rect.size.width - size.width) / 2.0, rect.origin.y + (rect.size.height - size.height) / 2.0, size.width, size.height);
85 | }
86 |
87 | + (CGFloat)distanceBetweenPoint:(CGPoint)point1 andPoint:(CGPoint)point2 {
88 | return sqrt(pow(point1.x - point2.x, 2) + pow(point1.y - point2.y, 2));
89 | }
90 |
91 | + (CGPoint)PDFPointWithAbsPoint:(CGPoint)absPoint absBoundsRect:(CGRect)absBoundsRect scale:(CGFloat)scale {
92 | return CGPointMake((absPoint.x - absBoundsRect.origin.x) * scale, (absBoundsRect.size.height - (absPoint.y - absBoundsRect.origin.y)) * scale);
93 | }
94 |
95 | + (PEConnectedPoint)PDFConnectedPointWithAbsConnectedPoint:(PEConnectedPoint)absConnectedPoint absBoundsRect:(CGRect)absBoundsRect scale:(CGFloat)scale {
96 | return PEConnectedPointMake([self PDFPointWithAbsPoint:absConnectedPoint.point absBoundsRect:absBoundsRect scale:scale], absConnectedPoint.side);
97 | }
98 |
99 | + (CGRect)PDFRectWithAbsRect:(CGRect)absRect absBoundsRect:(CGRect)absBoundsRect scale:(CGFloat)scale {
100 | return CGRectMake((absRect.origin.x - absBoundsRect.origin.x) * scale, (absBoundsRect.size.height - (absRect.origin.y - absBoundsRect.origin.y)) * scale,
101 | absRect.size.width * scale, -absRect.size.height * scale);
102 | }
103 |
104 | + (CGPoint)offsetPDFPoint:(CGPoint)point side:(PESide)side offset:(CGFloat)offset {
105 | switch (side) {
106 | case PESideTop:
107 | return CGPointMake(point.x, point.y + offset);
108 |
109 | case PESideRight:
110 | return CGPointMake(point.x + offset, point.y);
111 |
112 | case PESideBottom:
113 | return CGPointMake(point.x, point.y - offset);
114 |
115 | case PESideLeft:
116 | return CGPointMake(point.x - offset, point.y);
117 | }
118 | }
119 |
120 | # pragma mark - Private
121 |
122 | + (CGPoint)midPointOfRect:(CGRect)rect {
123 | return CGPointMake(rect.origin.x + (rect.size.width / 2.0), rect.origin.y + (rect.size.height / 2.0));
124 | }
125 |
126 | + (BOOL)intersectsVerticallyWithRect:(CGRect)rect1 andRect:(CGRect)rect2 {
127 | CGFloat x1 = rect1.origin.x + rect1.size.width;
128 | CGFloat x2 = rect2.origin.x + rect2.size.width;
129 | return (rect1.origin.x >= rect2.origin.x && rect1.origin.x <= x2) || (x1 >= rect2.origin.x && x1 <= x2);
130 | }
131 |
132 | + (PEConnectedPoint)connectedPointWithRect:(CGRect)rect side:(PESide)side {
133 | CGPoint point = CGPointZero;
134 | switch (side) {
135 | case PESideTop:
136 | point = CGPointMake(rect.origin.x + rect.size.width / 2.0, rect.origin.y);
137 | break;
138 |
139 | case PESideRight:
140 | point = CGPointMake(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height / 2.0);
141 | break;
142 |
143 | case PESideBottom:
144 | point = CGPointMake(rect.origin.x + rect.size.width / 2.0, rect.origin.y + rect.size.height);
145 | break;
146 |
147 | case PESideLeft:
148 | point = CGPointMake(rect.origin.x, rect.origin.y + rect.size.height / 2.0);
149 | break;
150 | }
151 |
152 | return PEConnectedPointMake(point, side);
153 | }
154 |
155 | @end
156 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSColor-Protocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSColor-Protocol.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | @protocol MSColor
10 |
11 | @property(readonly, nonatomic) double red;
12 | @property(readonly, nonatomic) double green;
13 | @property(readonly, nonatomic) double blue;
14 | @property(readonly, nonatomic) double alpha;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSConstants.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSConstants.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | extern NSString *const kMSImmutableLayerAncestry;
12 | extern NSString *const kMSImmutableLayerAncestry66;
13 | extern NSString *const kMSExportFormat;
14 | extern NSString *const kMSExportRequest;
15 | extern NSString *const kMSExportManager;
16 | extern NSString *const kMSImmutableHotspotLayer;
17 | extern NSString *const kMSImmutableLayerGroup;
18 | extern NSString *const kMSImmutableSymbolInstance;
19 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSConstants.m:
--------------------------------------------------------------------------------
1 | //
2 | // MSConstants.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSConstants.h"
10 |
11 | NSString *const kMSImmutableLayerAncestry = @"MSImmutableLayerAncestry";
12 | NSString *const kMSImmutableLayerAncestry66 = @"SketchModel.MSImmutableLayerAncestry";
13 | NSString *const kMSExportFormat = @"MSExportFormat";
14 | NSString *const kMSExportRequest = @"MSExportRequest";
15 | NSString *const kMSExportManager = @"MSExportManager";
16 | NSString *const kMSImmutableHotspotLayer = @"MSImmutableHotspotLayer";
17 | NSString *const kMSImmutableLayerGroup = @"MSImmutableLayerGroup";
18 | NSString *const kMSImmutableSymbolInstance = @"MSImmutableSymbolInstance";
19 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSContentDrawViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSContentDrawViewController.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 27/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSFlashController.h"
10 |
11 | @interface MSContentDrawViewController : NSViewController
12 |
13 | @property(retain, nonatomic) MSFlashController *flashController;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSDocument.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSDocument.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MSDocumentData.h"
11 | #import "MSContentDrawViewController.h"
12 |
13 | @interface MSDocument: NSDocument
14 |
15 | @property (readonly, nonatomic) MSDocumentData *documentData;
16 | @property (readonly, nonatomic) MSContentDrawViewController *currentContentViewController;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSDocumentData.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSDocumentData.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSModelObject.h"
10 | #import "MSPage.h"
11 |
12 | @interface MSDocumentData: MSModelObject
13 |
14 | - (MSPage*)symbolsPage;
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSExportManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSExportManager.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MSExportManager : NSObject
12 |
13 | @property(readonly, nonatomic) NSColorSpace *colorSpace;
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSExportRequest.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSExportRequest.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | @interface MSExportRequest : NSObject
10 |
11 | @end
12 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSFlashController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSFlashController.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 27/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | @interface MSFlashController : NSObject
10 |
11 | @end
12 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableArtboardGroup.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSArtboardGroup.h
3 | // ProtoWire
4 | //
5 | // Created by Mark Horgan on 10/05/2017.
6 | // Copyright © 2017 Mark Horgan. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableLayerGroup.h"
10 | #import "MSImmutableColor.h"
11 |
12 | @interface MSImmutableArtboardGroup: MSImmutableLayerGroup
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableColor.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableColor.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 22/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableModelObject.h"
10 | #import "MSColor-Protocol.h"
11 |
12 | @interface MSImmutableColor: MSImmutableModelObject
13 |
14 | @property (readonly, nonatomic) double red;
15 | @property (readonly, nonatomic) double green;
16 | @property (readonly, nonatomic) double blue;
17 | @property (readonly, nonatomic) double alpha;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableDocumentData.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableDocumentData.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSImmutablePage.h"
10 |
11 | @interface MSImmutableDocumentData : MSImmutableModelObject
12 |
13 | @property (readonly, nonatomic) NSArray *pages;
14 | @property (readonly, nonatomic) MSImmutablePage *currentPage;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableFlowConnection.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableFlowConnection.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 25/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableModelObject.h"
10 |
11 | @interface MSImmutableFlowConnection: MSImmutableModelObject
12 |
13 | @property (readonly, nonatomic) BOOL isBackAction;
14 | @property (readonly, nonatomic) NSString *destinationArtboardID;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableHotspotLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableHotspotLayer.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 25/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableLayer.h"
10 |
11 | @interface MSImmutableHotspotLayer : MSImmutableLayer
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableLayer.h
3 | // ProtoWire
4 | //
5 | // Created by Mark Horgan on 30/04/2017.
6 | // Copyright © 2017 Mark Horgan. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableModelObject.h"
10 | #import "MSImmutableFlowConnection.h"
11 |
12 | @interface MSImmutableLayer : MSImmutableModelObject
13 |
14 | @property (readonly, nonatomic) CGRect rect;
15 | @property (readonly, copy, nonatomic) NSString *name;
16 | @property (readonly, nonatomic) MSImmutableFlowConnection *flow;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableLayerAncestry.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableLayerAncestry.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | @interface MSImmutableLayerAncestry : NSObject
10 |
11 | @end
12 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableLayerGroup.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSLayerGroup.h
3 | // ProtoWire
4 | //
5 | // Created by Mark Horgan on 28/05/2017.
6 | // Copyright © 2017 Mark Horgan. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableStyledLayer.h"
10 | #import "MSImmutableLayer.h"
11 |
12 | @interface MSImmutableLayerGroup: MSImmutableStyledLayer
13 |
14 | @property (readonly, nonatomic) NSArray *layers;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableModelObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableModelObject.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | @interface MSImmutableModelObject : NSObject
10 |
11 | @property (readonly, copy, nonatomic) NSString *objectID;
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutablePage.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSPage.h
3 | // ProtoWire
4 | //
5 | // Created by Mark Horgan on 28/05/2017.
6 | // Copyright © 2017 Mark Horgan. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableLayerGroup.h"
10 | #import "MSImmutableArtboardGroup.h"
11 |
12 | @interface MSImmutablePage: MSImmutableLayerGroup
13 |
14 | @property (readonly, nonatomic) NSArray *artboards;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableStyledLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSStyledLayer.h
3 | // ProtoWire
4 | //
5 | // Created by Mark Horgan on 28/05/2017.
6 | // Copyright © 2017 Mark Horgan. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableLayer.h"
10 |
11 | @interface MSImmutableStyledLayer: MSImmutableLayer
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSImmutableSymbolInstance.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSImmutableSymbolInstance.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 29/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSImmutableStyledLayer.h"
10 |
11 | @interface MSImmutableSymbolInstance : MSImmutableStyledLayer
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSLayer.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 25/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSModelObject.h"
10 |
11 | @interface MSLayer: MSModelObject
12 |
13 | @property (readonly, nonatomic) CGRect rect;
14 | @property (readonly, copy, nonatomic) NSString *name;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSModelObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSModelObject.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | @interface MSModelObject: NSObject
10 |
11 | @property (readonly, nonatomic) id immutableModelObject;
12 | @property (readonly, copy, nonatomic) NSString *objectID;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/src/framework/print-export/Sketch/MSPage.h:
--------------------------------------------------------------------------------
1 | //
2 | // MSPage.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 21/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "MSModelObject.h"
10 |
11 | @interface MSPage : MSModelObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/src/framework/print-export/print_export.h:
--------------------------------------------------------------------------------
1 | //
2 | // print_export.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 19/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for print_export.
12 | FOUNDATION_EXPORT double print_exportVersionNumber;
13 |
14 | //! Project version string for print_export.
15 | FOUNDATION_EXPORT const unsigned char print_exportVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/framework/print-export/types.h:
--------------------------------------------------------------------------------
1 | //
2 | // types.h
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 20/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, PEExportType) {
12 | PEExportTypeSketchPagePerPage,
13 | PEExportTypeArtboardPerPage
14 | };
15 |
16 | typedef NS_ENUM(NSUInteger, PEScope) {
17 | PEScopeCurrentPage,
18 | PEScopeAllPages
19 | };
20 |
21 | typedef NS_ENUM(NSUInteger, PEOrientation) {
22 | PEOrientationPortrait,
23 | PEOrrientationLandscape
24 | };
25 |
26 | typedef NS_ENUM(NSUInteger, PEUnitType) {
27 | PEUnitTypeMM,
28 | PEUnitTypeInch
29 | };
30 |
31 | typedef NS_ENUM(NSUInteger, PEFlowConnectionType) {
32 | PEFlowConnectionTypeHotspot,
33 | PEFlowConnectionTypeLayer
34 | };
35 |
36 | typedef NS_ENUM(NSUInteger, PESide) {
37 | PESideTop,
38 | PESideRight,
39 | PESideBottom,
40 | PESideLeft
41 | };
42 |
43 | typedef struct {
44 | CGPoint startPoint;
45 | CGPoint endPoint;
46 | } PELine;
47 |
48 | typedef struct {
49 | CGPoint point;
50 | PESide side;
51 | } PEConnectedPoint;
52 |
53 | typedef struct {
54 | PEConnectedPoint startPoint;
55 | PEConnectedPoint endPoint;
56 | } PEConnectingLine;
57 |
58 | extern PELine PELineMake(CGPoint startPoint, CGPoint endPoint);
59 | extern PEConnectedPoint PEConnectedPointMake(CGPoint point, PESide side);
60 | extern PEConnectingLine PEConnectingLineMake(PEConnectedPoint startConnectedPoint, PEConnectedPoint endConnectedPoint);
61 |
--------------------------------------------------------------------------------
/src/framework/print-export/types.m:
--------------------------------------------------------------------------------
1 | //
2 | // types.m
3 | // print-export
4 | //
5 | // Created by Mark Horgan on 25/03/2019.
6 | // Copyright © 2019 Sketch. All rights reserved.
7 | //
8 |
9 | #import "types.h"
10 |
11 | PELine PELineMake(CGPoint startPoint, CGPoint endPoint) {
12 | PELine line;
13 | line.startPoint = startPoint;
14 | line.endPoint = endPoint;
15 | return line;
16 | }
17 |
18 | PEConnectedPoint PEConnectedPointMake(CGPoint point, PESide side) {
19 | PEConnectedPoint connectedPoint;
20 | connectedPoint.point = point;
21 | connectedPoint.side = side;
22 | return connectedPoint;
23 | }
24 |
25 | PEConnectingLine PEConnectingLineMake(PEConnectedPoint startConnectedPoint, PEConnectedPoint endConnectedPoint) {
26 | PEConnectingLine connectingLine;
27 | connectingLine.startPoint = startConnectedPoint;
28 | connectingLine.endPoint = endConnectedPoint;
29 | return connectingLine;
30 | }
31 |
--------------------------------------------------------------------------------
/src/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "compatibleVersion": 3,
3 | "bundleVersion": 1,
4 | "icon": "icon.png",
5 | "identifier": "com.sketch.print-export",
6 | "description": "Exports a PDF for printing",
7 | "commands": [
8 | {
9 | "name": "Print Export",
10 | "identifier": "print-export",
11 | "script": "./command.js"
12 | }
13 | ],
14 | "menu": {
15 | "isRoot": true,
16 | "items": [
17 | "print-export"
18 | ]
19 | }
20 | }
--------------------------------------------------------------------------------
/src/options-dialog.js:
--------------------------------------------------------------------------------
1 | const { buildDialog } = require('./utils')
2 | const { ExportType, Scope, Orientation, Unit } = require('./enums')
3 | const { paperSizeStandards } = require('./constants')
4 |
5 | const UNIT_TEXTFIELD_INDENTIFIERS = ['pageWidthUnits', 'pageHeightUnits', 'bleedUnits', 'slugUnits'];
6 |
7 | module.exports = class OptionsDialog {
8 |
9 | constructor(pluginName, model, context) {
10 | this.nib = require('./framework/print-export.xcworkspace/contents.xcworkspacedata').getNib('PEOptionsAccessoryView')
11 |
12 | this.exportTypeChanged = this.exportTypeChanged.bind(this)
13 | this.nib.artboardPerPage.setCOSJSTargetFunction(this.exportTypeChanged)
14 | this.nib.sketchPagePerPage.setCOSJSTargetFunction(this.exportTypeChanged)
15 | switch (model.exportType) {
16 | case ExportType.ArtboardPerPage:
17 | this.nib.artboardPerPage.state = NSOnState
18 | break;
19 |
20 | case ExportType.SketchPagePerPage:
21 | this.nib.sketchPagePerPage.state = NSOnState
22 | break;
23 | }
24 | this.exportTypeChanged()
25 |
26 | const scopeHandler = function() {}
27 | this.nib.exportCurrentPage.setCOSJSTargetFunction(scopeHandler)
28 | this.nib.exportAllPages.setCOSJSTargetFunction(scopeHandler)
29 | switch (model.scope) {
30 | case Scope.CurrentPage:
31 | this.nib.exportCurrentPage.state = NSOnState
32 | break;
33 |
34 | case Scope.AllPages:
35 | this.nib.exportAllPages.state = NSOnState
36 | break;
37 | }
38 |
39 | this.nib.showArtboardShadow.state = model.showArtboardShadow ? NSOnState : NSOffState
40 | this.nib.showArtboardName.state = model.showArtboardName ? NSOnState : NSOffState
41 | this.nib.showPrototypingLinks.state = model.showPrototypingLinks ? NSOnState : NSOffState
42 |
43 | let currentPaperSizeStandard
44 | for (let [index, paperSizeStandard] of paperSizeStandards.entries()) {
45 | this.nib.paperSizeStandard.addItemWithTitle(paperSizeStandard.name)
46 | if (model.paperSizeStandardName === paperSizeStandard.name) {
47 | this.nib.paperSizeStandard.selectItemAtIndex(index)
48 | currentPaperSizeStandard = paperSizeStandard
49 | }
50 | }
51 | this.updateUnits(currentPaperSizeStandard)
52 | this.paperSizeStandardChanged = this.paperSizeStandardChanged.bind(this)
53 | this.nib.paperSizeStandard.setCOSJSTargetFunction(this.paperSizeStandardChanged)
54 |
55 | this.currentPageSizeIndices = []
56 | this.populatePageSizes(this.nib.pageSize, currentPaperSizeStandard, model.pageSizeName)
57 | this.pageSizeChanged = this.pageSizeChanged.bind(this)
58 | this.nib.pageSize.setCOSJSTargetFunction(this.pageSizeChanged)
59 |
60 | this.nib.pageWidth.doubleValue = model.pageWidth
61 | this.nib.pageHeight.doubleValue = model.pageHeight
62 |
63 | this.orientationChanged = this.orientationChanged.bind(this)
64 | this.nib.portrait.setCOSJSTargetFunction(this.orientationChanged)
65 | this.nib.landscape.setCOSJSTargetFunction(this.orientationChanged)
66 | switch (model.orientation) {
67 | case Orientation.Portrait:
68 | this.nib.portrait.state = NSOnState
69 | break;
70 |
71 | case Orientation.Landscape:
72 | this.nib.landscape.state = NSOnState
73 | break;
74 | }
75 |
76 | this.includeCropMarksChanged = this.includeCropMarksChanged.bind(this)
77 | this.nib.includeCropMarks.setCOSJSTargetFunction(this.includeCropMarksChanged)
78 | this.nib.includeCropMarks.state = model.includeCropMarks ? NSOnState : NSOffState
79 | this.includeCropMarksChanged()
80 |
81 | this.nib.bleed.doubleValue = model.bleed
82 | this.nib.bleed.toolTip = 'The area beyond the trimmed page'
83 | this.nib.slug.doubleValue = model.slug
84 | this.nib.slug.toolTip = 'The area beyond the bleed that contains the crop marks'
85 |
86 | this.dialog = buildDialog(pluginName, 'Export', this.nib.getRoot(), context)
87 | }
88 |
89 | exportTypeChanged() {
90 | const enabled = this.exportType === ExportType.SketchPagePerPage
91 | this.nib.showPrototypingLinks.enabled = enabled
92 | this.nib.showArtboardShadow.enabled = enabled
93 | this.nib.showArtboardName.enabled = enabled
94 | }
95 |
96 | paperSizeStandardChanged(sender) {
97 | const pageSizeStandard = paperSizeStandards[sender.indexOfSelectedItem()]
98 | this.populatePageSizes(this.nib.pageSize, pageSizeStandard)
99 | this.pageSizeChanged()
100 | this.updateUnits(pageSizeStandard)
101 | }
102 |
103 | pageSizeChanged() {
104 | const pageSize = this.pageSize
105 | let width, height
106 | switch (this.orientation) {
107 | case Orientation.Portrait:
108 | width = pageSize.width
109 | height = pageSize.height
110 | break
111 |
112 | case Orientation.Landscape:
113 | width = pageSize.height
114 | height = pageSize.width
115 | break
116 | }
117 | this.nib.pageWidth.doubleValue = width
118 | this.nib.pageHeight.doubleValue = height
119 | this.currentPageSizeIndices[this.nib.paperSizeStandard.indexOfSelectedItem()] = this.nib.pageSize.indexOfSelectedItem()
120 | }
121 |
122 | orientationChanged() {
123 | const width = this.nib.pageWidth.doubleValue()
124 | const height = this.nib.pageHeight.doubleValue()
125 | this.nib.pageWidth.doubleValue = height
126 | this.nib.pageHeight.doubleValue = width
127 | }
128 |
129 | includeCropMarksChanged() {
130 | if (self.includeCropMarks && this.nib.slug.doubleValue() === 0) {
131 | this.nib.slug.doubleValue = 5
132 | }
133 | }
134 |
135 | populatePageSizes(pageSizePopUpButton, paperSizeStandard, pageSizeName = undefined) {
136 | pageSizePopUpButton.removeAllItems()
137 | for (let [index, pageSize] of paperSizeStandard.sizes.entries()) {
138 | pageSizePopUpButton.addItemWithTitle(pageSize.name)
139 | if (pageSizeName === pageSize.name) {
140 | pageSizePopUpButton.selectItemAtIndex(index)
141 | this.currentPageSizeIndices[this.nib.paperSizeStandard.indexOfSelectedItem()] = index
142 | }
143 | }
144 | if (pageSizeName === undefined) {
145 | const index = this.currentPageSizeIndices[this.nib.paperSizeStandard.indexOfSelectedItem()];
146 | if (index !== undefined) {
147 | pageSizePopUpButton.selectItemAtIndex(index);
148 | }
149 | }
150 | }
151 |
152 | updateUnits(pageSizeStandard) {
153 | UNIT_TEXTFIELD_INDENTIFIERS.forEach(identifier => {
154 | const textField = this.nib[identifier]
155 | switch (pageSizeStandard.unit) {
156 | case Unit.Millimeter:
157 | textField.stringValue = 'mm'
158 | break;
159 |
160 | case Unit.Inch:
161 | textField.stringValue = 'inch'
162 | break;
163 | }
164 | })
165 | }
166 |
167 | get exportType() {
168 | return this.nib.artboardPerPage.state() === NSOnState ? ExportType.ArtboardPerPage : ExportType.SketchPagePerPage
169 | }
170 |
171 | get scope() {
172 | return this.nib.exportCurrentPage.state() === NSOnState ? Scope.CurrentPage : Scope.AllPages
173 | }
174 |
175 | get showArtboardShadow() {
176 | return this.nib.showArtboardShadow.state() === NSOnState
177 | }
178 |
179 | get showArtboardName() {
180 | return this.nib.showArtboardName.state() === NSOnState
181 | }
182 |
183 | get showPrototypingLinks() {
184 | return this.nib.showPrototypingLinks.state() === NSOnState
185 | }
186 |
187 | get paperSizeStandard() {
188 | return paperSizeStandards[this.nib.paperSizeStandard.indexOfSelectedItem()]
189 | }
190 |
191 | get pageSize() {
192 | return this.paperSizeStandard.sizes[this.nib.pageSize.indexOfSelectedItem()]
193 | }
194 |
195 | get orientation() {
196 | return this.nib.portrait.state() === NSOnState ? Orientation.Portrait : Orientation.Landscape
197 | }
198 |
199 | get pageWidth() {
200 | return this.nib.pageWidth.doubleValue()
201 | }
202 |
203 | get pageHeight() {
204 | return this.nib.pageHeight.doubleValue()
205 | }
206 |
207 | get includeCropMarks() {
208 | return this.nib.includeCropMarks.state() === NSOnState
209 | }
210 |
211 | get bleed() {
212 | return this.nib.bleed.doubleValue()
213 | }
214 |
215 | get slug() {
216 | return this.nib.slug.doubleValue()
217 | }
218 |
219 | }
220 |
--------------------------------------------------------------------------------
/src/utils.js:
--------------------------------------------------------------------------------
1 | const ObjClass = require('cocoascript-class').default;
2 | const manifest = require('./manifest.json')
3 | const path = require('path')
4 |
5 | export function buildDialog(dialogTitle, buttonTitle, accessoryView, context) {
6 | const dialog = NSAlert.new()
7 | dialog.messageText = dialogTitle
8 | dialog.icon = NSImage.alloc().initByReferencingFile(context.plugin.urlForResourceNamed('icon.png').path())
9 | dialog.accessoryView = accessoryView
10 | dialog.addButtonWithTitle(buttonTitle)
11 | dialog.addButtonWithTitle('Cancel')
12 | return dialog
13 | }
14 |
15 | export function getFilename(filePath, extension) {
16 | return `${path.basename(filePath, path.extname(filePath))}${extension}`
17 | }
18 |
19 | export function valueWithPropertyPath(object, keyPath) {
20 | const keys = keyPath.split('.')
21 | let currentObject = object
22 | keys.forEach(key => {
23 | currentObject = currentObject[key]
24 | })
25 | return currentObject
26 | }
27 |
--------------------------------------------------------------------------------