diff options
Diffstat (limited to 'examples')
148 files changed, 12713 insertions, 421 deletions
diff --git a/examples/app-and-lib/app_and_lib.qbs b/examples/app-and-lib/app-and-lib.qbs index baa42307f..8170f37a2 100644 --- a/examples/app-and-lib/app_and_lib.qbs +++ b/examples/app-and-lib/app-and-lib.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs 1.0 - Project { references: [ "app/app.qbs", diff --git a/examples/app-and-lib/app/app.qbs b/examples/app-and-lib/app/app.qbs index 26f9774af..1cdb95c39 100644 --- a/examples/app-and-lib/app/app.qbs +++ b/examples/app-and-lib/app/app.qbs @@ -48,13 +48,11 @@ ** ****************************************************************************/ -import qbs 1.0 - -Product { - type: "application" +Application { consoleApplication: true files : [ "main.cpp" ] Depends { name: "cpp" } Depends { name: "mylib" } + install: true } diff --git a/examples/app-and-lib/app/main.cpp b/examples/app-and-lib/app/main.cpp index 17f4226f3..dc02fa8ef 100644 --- a/examples/app-and-lib/app/main.cpp +++ b/examples/app-and-lib/app/main.cpp @@ -53,6 +53,6 @@ int main() { - puts("Now calling a function from mylib:"); + std::puts("Now calling a function from mylib:"); return bla(); } diff --git a/examples/app-and-lib/lib/lib.cpp b/examples/app-and-lib/lib/lib.cpp index bfa62ecf7..a1b30a0d2 100644 --- a/examples/app-and-lib/lib/lib.cpp +++ b/examples/app-and-lib/lib/lib.cpp @@ -56,6 +56,6 @@ int bla() { - puts("Hello World!"); + std::puts("Hello World!"); return 2; } diff --git a/examples/app-and-lib/lib/lib.qbs b/examples/app-and-lib/lib/lib.qbs index 5c0098dae..a5fbc6fb8 100644 --- a/examples/app-and-lib/lib/lib.qbs +++ b/examples/app-and-lib/lib/lib.qbs @@ -48,10 +48,7 @@ ** ****************************************************************************/ -import qbs 1.0 - -Product { - type: "staticlibrary" +StaticLibrary { name: "mylib" files: [ "lib.cpp", @@ -62,7 +59,7 @@ Product { Export { Depends { name: "cpp" } - cpp.includePaths: [product.sourceDirectory] + cpp.includePaths: [exportingProduct.sourceDirectory] } } diff --git a/examples/baremetal/at90can128olimex/at90can128olimex.qbs b/examples/baremetal/at90can128olimex/at90can128olimex.qbs index dc1760fe9..2c206f7cc 100644 --- a/examples/baremetal/at90can128olimex/at90can128olimex.qbs +++ b/examples/baremetal/at90can128olimex/at90can128olimex.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - Project { name: "Examples for Olimex AVR-CAN board" references: [ diff --git a/examples/baremetal/at90can128olimex/redblink/README.md b/examples/baremetal/at90can128olimex/redblink/README.md index 0e9710e57..cbf51898d 100644 --- a/examples/baremetal/at90can128olimex/redblink/README.md +++ b/examples/baremetal/at90can128olimex/redblink/README.md @@ -1,4 +1,4 @@ -This examples demonstrates how to build a bare-metal application using +This example demonstrates how to build a bare-metal application using different AVR toolchains. It is designed for the OLIMEX AVR-CAN target board (based on at90can128 chip) and simply flashes the red LED on the board. diff --git a/examples/baremetal/at90can128olimex/redblink/redblink.qbs b/examples/baremetal/at90can128olimex/redblink/redblink.qbs index 84323e3c1..afdbe46f7 100644 --- a/examples/baremetal/at90can128olimex/redblink/redblink.qbs +++ b/examples/baremetal/at90can128olimex/redblink/redblink.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { condition: { if (!qbs.architecture.contains("avr")) diff --git a/examples/baremetal/baremetal.qbs b/examples/baremetal/baremetal.qbs index eba504512..0d71968b6 100644 --- a/examples/baremetal/baremetal.qbs +++ b/examples/baremetal/baremetal.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - Project { name: "BareMetal" references: [ @@ -58,6 +56,10 @@ Project { "cc2540usbdongle/cc2540usbdongle.qbs", "stm8s103f3/stm8s103f3.qbs", "msp430f5529/msp430f5529.qbs", - "cy7c68013a/cy7c68013a.qbs" + "cy7c68013a/cy7c68013a.qbs", + "stm32f103/stm32f103.qbs", + "pca10040/pca10040.qbs", + "pca10001/pca10001.qbs", + "esp8266/esp8266.qbs", ] } diff --git a/examples/baremetal/cc2540usbdongle/cc2540usbdongle.qbs b/examples/baremetal/cc2540usbdongle/cc2540usbdongle.qbs index 52e1948eb..6cb99e6a4 100644 --- a/examples/baremetal/cc2540usbdongle/cc2540usbdongle.qbs +++ b/examples/baremetal/cc2540usbdongle/cc2540usbdongle.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - Project { name: "Examples for cc2540usbdongle board" references: [ diff --git a/examples/baremetal/cc2540usbdongle/greenblink/greenblink.qbs b/examples/baremetal/cc2540usbdongle/greenblink/greenblink.qbs index e8aa3d1fd..d1d3281a9 100644 --- a/examples/baremetal/cc2540usbdongle/greenblink/greenblink.qbs +++ b/examples/baremetal/cc2540usbdongle/greenblink/greenblink.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { condition: { if (!qbs.architecture.contains("mcs51")) diff --git a/examples/baremetal/cc2540usbdongle/greenblink/system.h b/examples/baremetal/cc2540usbdongle/greenblink/system.h index cdc6302d4..4f105dbd0 100644 --- a/examples/baremetal/cc2540usbdongle/greenblink/system.h +++ b/examples/baremetal/cc2540usbdongle/greenblink/system.h @@ -66,6 +66,9 @@ extern "C" { #elif defined (__SDCC_mcs51) #include <mcs51/compiler.h> # define DEFINE_SFR(name, addr) __sfr __at(addr) name; +# ifndef NOP +# define NOP() __asm NOP __endasm +# endif # define system_nop() NOP() #else #error "Unsupported toolchain" diff --git a/examples/baremetal/cy7c68013a/cy7c68013a.qbs b/examples/baremetal/cy7c68013a/cy7c68013a.qbs index 370844725..dca261d70 100644 --- a/examples/baremetal/cy7c68013a/cy7c68013a.qbs +++ b/examples/baremetal/cy7c68013a/cy7c68013a.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - Project { name: "Examples for cy7c68013a board" references: [ diff --git a/examples/baremetal/cy7c68013a/nes-gamepads/nes-gamepads.qbs b/examples/baremetal/cy7c68013a/nes-gamepads/nes-gamepads.qbs index 0d7994033..81566ff96 100644 --- a/examples/baremetal/cy7c68013a/nes-gamepads/nes-gamepads.qbs +++ b/examples/baremetal/cy7c68013a/nes-gamepads/nes-gamepads.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { condition: { if (!qbs.architecture.contains("mcs51")) diff --git a/examples/baremetal/esp8266/README.md b/examples/baremetal/esp8266/README.md new file mode 100644 index 000000000..a9b4ef92d --- /dev/null +++ b/examples/baremetal/esp8266/README.md @@ -0,0 +1,34 @@ +This example demonstrates how to build a bare-metal application using +GCC toolchain for Espressif ESP8266-WROOM02 MCU. + +An application is designed to be flashed on the external SPI FLASH +with the following parameters: + + * SPI FLASH size: 16 MBit (2048 + 2048 KBytes) + * SPI FLASH mode: DIO + * SPI FLASH clock: 40 MHz + * SPI FLASH map type: 5 + +An application is running as WiFi access point that discards all +connection attempts, and has the following WiFi parameters: + * SSID: "HELLO FROM QBS" + * Authentication mode: "open" + * Beacon interval: 1000 milliseconds + * Channel number: 3 + +An application requires the ESP8266 NON-OS SDK: + + * https://github.com/espressif/ESP8266_NONOS_SDK + +the path to which should be set via the ESP8266_NON_OS_SDK_ROOT +environment variable. + +To convert the ELF application to the final binary image (and also for +re-program the ESP8266 MCU), you can use the open source 'esptool' +utility (using the SPI FLASH parameters, provided above): + + * https://github.com/espressif/esptool + +The following toolchains are supported: + + * GNU ESP8266 Toolchain diff --git a/examples/baremetal/esp8266/access-point/access-point.qbs b/examples/baremetal/esp8266/access-point/access-point.qbs new file mode 100644 index 000000000..e9b06c340 --- /dev/null +++ b/examples/baremetal/esp8266/access-point/access-point.qbs @@ -0,0 +1,28 @@ +CppApplication { + condition: qbs.toolchain.contains("gcc") && qbs.architecture === "xtensa" + + Depends { name: "esp8266_sdk" } + + cpp.cLanguageVersion: "c99" + cpp.positionIndependentCode: false + + // This required because ESP8266 SDK includes this 'user_config.h' internally. + cpp.includePaths: ["."] + + cpp.staticLibraries: [ + "c", + "crypto", + "gcc", + "lwip", + "main", + "net80211", + "phy", + "pp", + "wpa" + ] + + files: [ + "user_config.h", + "user_main.c" + ] +} diff --git a/examples/baremetal/esp8266/access-point/user_config.h b/examples/baremetal/esp8266/access-point/user_config.h new file mode 100644 index 000000000..307f93dd5 --- /dev/null +++ b/examples/baremetal/esp8266/access-point/user_config.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ESP8266_USER_CONFIG_H +#define ESP8266_USER_CONFIG_H + +// From ESP8266 SDK. +#include <user_interface.h> + +#define ESP_SSID_CFG "HELLO FROM QBS\0" +#define ESP_AUTO_MODE_CFG (AUTH_OPEN) +#define ESP_BEACON_INTERVAL_MS_CFG (1000) +#define ESP_CHANNEL_NO_CFG (3) + +#endif // ESP8266_USER_CONFIG_H diff --git a/examples/baremetal/esp8266/access-point/user_main.c b/examples/baremetal/esp8266/access-point/user_main.c new file mode 100644 index 000000000..be2a8e92d --- /dev/null +++ b/examples/baremetal/esp8266/access-point/user_main.c @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "user_config.h" + +// From ESP8266 SDK. +#include <osapi.h> + +static const partition_item_t esp_partitions[] = { + {SYSTEM_PARTITION_BOOTLOADER, ESP_PART_BL_ADDR, ESP_PART_BOOTLOADER_SIZE}, + {SYSTEM_PARTITION_OTA_1, ESP_PART_APP1_ADDR, ESP_PART_APPLICATION_SIZE}, + {SYSTEM_PARTITION_OTA_2, ESP_PART_APP2_ADDR, ESP_PART_APPLICATION_SIZE}, + {SYSTEM_PARTITION_RF_CAL, ESP_PART_RF_CAL_ADDR, ESP_PART_RF_CAL_SIZE}, + {SYSTEM_PARTITION_PHY_DATA, ESP_PART_PHY_DATA_ADDR, ESP_PART_PHY_DATA_SIZE}, + {SYSTEM_PARTITION_SYSTEM_PARAMETER, ESP_PART_SYS_PARAM_ADDR, ESP_PART_SYS_PARAM_SIZE} +}; + +enum { + ESP_PART_COUNT = sizeof(esp_partitions) / sizeof(esp_partitions[0]) +}; + +LOCAL void ICACHE_FLASH_ATTR user_init_done(void) +{ + os_printf("esp: initialization completed\n"); +} + +void ICACHE_FLASH_ATTR user_pre_init(void) +{ + const bool ok = system_partition_table_regist(esp_partitions, ESP_PART_COUNT, SPI_FLASH_SIZE_MAP); + if (!ok) { + os_printf("esp: partitions registration failed\n"); + while (true); + } +} + +void ICACHE_FLASH_ATTR user_init(void) +{ + os_printf("esp: SDK version: %s\n", system_get_sdk_version()); + os_printf("esp: reset reason: %u\n", system_get_rst_info()->reason); + + const bool ok = wifi_set_opmode(SOFTAP_MODE); + if (!ok) { + os_printf("esp: set softap mode failed\n"); + } else { + struct softap_config ap_cfg = {0}; + ap_cfg.authmode = ESP_AUTO_MODE_CFG; + ap_cfg.beacon_interval = ESP_BEACON_INTERVAL_MS_CFG; + ap_cfg.channel = ESP_CHANNEL_NO_CFG; + ap_cfg.max_connection = 0; + ap_cfg.ssid_hidden = false; + os_memcpy(&ap_cfg.ssid, ESP_SSID_CFG, sizeof(ESP_SSID_CFG)); + const bool ok = wifi_softap_set_config(&ap_cfg); + if (!ok) + os_printf("esp: set softap configuration failed\n"); + } + + system_init_done_cb(user_init_done); +} diff --git a/examples/baremetal/esp8266/esp8266.qbs b/examples/baremetal/esp8266/esp8266.qbs new file mode 100644 index 000000000..faa74434e --- /dev/null +++ b/examples/baremetal/esp8266/esp8266.qbs @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +Project { + name: "Examples for esp8266-wroom-02 board" + qbsSearchPaths: "qbs" + references: [ + "access-point/access-point.qbs" + ] +} diff --git a/examples/baremetal/esp8266/qbs/imports/Esp8266SdkProbe.qbs b/examples/baremetal/esp8266/qbs/imports/Esp8266SdkProbe.qbs new file mode 100644 index 000000000..faa8b1efd --- /dev/null +++ b/examples/baremetal/esp8266/qbs/imports/Esp8266SdkProbe.qbs @@ -0,0 +1,25 @@ +import qbs.Environment +import qbs.File +import qbs.FileInfo +import qbs.Probes + +Probes.PathProbe { + // Inputs. + environmentPaths: Environment.getEnv("ESP8266_NON_OS_SDK_ROOT") + // Outputs. + property string includesPath; + property string libsPath; + property string linkerScriptsPath; + configure: { + for (var i in environmentPaths) { + var rootPath = environmentPaths[i]; + if (!File.exists(rootPath)) + continue; + includesPath = FileInfo.joinPaths(rootPath, "include"); + libsPath = FileInfo.joinPaths(rootPath, "lib"); + linkerScriptsPath = FileInfo.joinPaths(rootPath, "ld"); + found = true; + return; + } + } +} diff --git a/examples/baremetal/esp8266/qbs/modules/esp8266_sdk/Esp8266SdkModule.qbs b/examples/baremetal/esp8266/qbs/modules/esp8266_sdk/Esp8266SdkModule.qbs new file mode 100644 index 000000000..57e1f8572 --- /dev/null +++ b/examples/baremetal/esp8266/qbs/modules/esp8266_sdk/Esp8266SdkModule.qbs @@ -0,0 +1,66 @@ +Module { + Depends { name: "cpp" } + + Esp8266SdkProbe { id: esp_sdk_probe } + + validate: { + if (!esp_sdk_probe.found) + throw "ESP8266 NON OS SDK not found. Please set the ESP8266_NON_OS_SDK_ROOT env variable." + } + + cpp.systemIncludePaths: [esp_sdk_probe.includesPath] + cpp.libraryPaths: [esp_sdk_probe.libsPath] + cpp.driverFlags: ["-nostdlib"] + + cpp.cFlags: [ + "-Wpointer-arith", + "-Wundef", + "-fno-inline-functions", + "-mlongcalls", + "-mtext-section-literals", + "-ffunction-sections", + "-fdata-sections", + "-fno-builtin-printf", + "-fno-guess-branch-probability", + "-freorder-blocks-and-partition", + "-fno-cse-follow-jumps" + ] + + cpp.linkerFlags: [ + "--no-check-sections", + "--gc-sections", + "--start-group" + ] + + cpp.defines: [ + "ICACHE_FLASH", + "USE_OPTIMIZE_PRINTF", + + // Target specific defines for the external 40MHz DIO + // SPI 16 Mbit FLASH (2048 KByte + 2048 KByte) FOTA. + "SPI_FLASH_SIZE_MAP=5", + "ESP_PART_BL_ADDR=0x000000", + "ESP_PART_APP1_ADDR=0x001000", + "ESP_PART_APP2_ADDR=0x101000", + "ESP_PART_RF_CAL_ADDR=0x1FB000", + "ESP_PART_PHY_DATA_ADDR=0x1FC000", + "ESP_PART_SYS_PARAM_ADDR=0x1FD000", + "ESP_PART_BOOTLOADER_SIZE=0x001000", + "ESP_PART_APPLICATION_SIZE=0x0E0000", + "ESP_PART_RF_CAL_SIZE=0x001000", + "ESP_PART_PHY_DATA_SIZE=0x001000", + "ESP_PART_SYS_PARAM_SIZE=0x003000" + ] + + property string _linker_scripts_path: esp_sdk_probe.linkerScriptsPath + "/" + + Group { + name: "ESP8266 Linker Scripts" + prefix: esp8266_sdk._linker_scripts_path + "/" + fileTags: ["linkerscript"] + files: [ + "eagle.rom.addr.v6.ld", + "eagle.app.v6.new.2048.ld" + ] + } +} diff --git a/examples/baremetal/msp430f5529/msp430f5529.qbs b/examples/baremetal/msp430f5529/msp430f5529.qbs index f4a6f95b9..64e62dd57 100644 --- a/examples/baremetal/msp430f5529/msp430f5529.qbs +++ b/examples/baremetal/msp430f5529/msp430f5529.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - Project { name: "Examples for msp430f5529 board" references: [ diff --git a/examples/baremetal/msp430f5529/nes-gamepads/nes-gamepads.qbs b/examples/baremetal/msp430f5529/nes-gamepads/nes-gamepads.qbs index 37dfe8ca6..a06cfc6a2 100644 --- a/examples/baremetal/msp430f5529/nes-gamepads/nes-gamepads.qbs +++ b/examples/baremetal/msp430f5529/nes-gamepads/nes-gamepads.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { condition: { if (!qbs.architecture.contains("msp430")) diff --git a/examples/baremetal/msp430f5529/redblink/README.md b/examples/baremetal/msp430f5529/redblink/README.md index 3affbaf7e..2f63b2349 100644 --- a/examples/baremetal/msp430f5529/redblink/README.md +++ b/examples/baremetal/msp430f5529/redblink/README.md @@ -1,4 +1,4 @@ -This examples demonstrates how to build a bare-metal application using +This example demonstrates how to build a bare-metal application using different MSP430 toolchains. It is designed for the MSP-EXP430F5529LP target board (based on msp430f5529 chip) and simply flashes the red LED on the board. diff --git a/examples/baremetal/msp430f5529/redblink/redblink.qbs b/examples/baremetal/msp430f5529/redblink/redblink.qbs index 0f056e101..d89d307a9 100644 --- a/examples/baremetal/msp430f5529/redblink/redblink.qbs +++ b/examples/baremetal/msp430f5529/redblink/redblink.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { condition: { if (!qbs.architecture.contains("msp430")) diff --git a/examples/baremetal/pca10001/greenblink/README.md b/examples/baremetal/pca10001/greenblink/README.md new file mode 100644 index 000000000..0abfa46e6 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/README.md @@ -0,0 +1,10 @@ +This example demonstrates how to build a bare-metal application using +different ARM toolchains. It is designed for the Nordic pca100001/pca100024 +evaluation kit (based on nRF51822 MCU) and simply flashes the green +LED on the board. + +The following toolchains are supported: + + * GNU Arm Embedded Toolchain + * IAR Embedded Workbench + * KEIL Microcontroller Development Kit diff --git a/examples/baremetal/pca10001/greenblink/gcc/flash.ld b/examples/baremetal/pca10001/greenblink/gcc/flash.ld new file mode 100644 index 000000000..d65ee1464 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/gcc/flash.ld @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +ENTRY(reset_handler) + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x40000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000 +} + +SECTIONS { + .text : { + KEEP(*(.isr_vector)) + *(.text*) + KEEP(*(.init)) + KEEP(*(.fini)) + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + *(.rodata*) + *(.eh_frame*) + . = ALIGN(4); + } > FLASH + + .ARM.extab : { + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } > FLASH + + _start_of_exidx_section = .; + .ARM.exidx : { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + . = ALIGN(4); + } > FLASH + _end_of_exidx_section = .; + + _end_of_code_section = .; + + .data : AT (_end_of_code_section) { + _start_of_data_section = .; + *(vtable) + *(.data*) + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN(__preinit_array_start = .); + *(.preinit_array) + PROVIDE_HIDDEN(__preinit_array_end = .); + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN(__init_array_start = .); + *(SORT(.init_array.*)) + *(.init_array) + PROVIDE_HIDDEN(__init_array_end = .); + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN(__fini_array_start = .); + *(SORT(.fini_array.*)) + *(.fini_array) + PROVIDE_HIDDEN(__fini_array_end = .); + *(.jcr) + . = ALIGN(4); + /* All data end */ + _end_of_data_section = .; + } > RAM + + .bss : { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): { + __end__ = .; + end = __end__; + *(.heap*) + _heap_limit = .; + } > RAM + + .stack_dummy (COPY): { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by size of stack_dummy section. */ + _end_of_stack = ORIGIN(RAM) + LENGTH(RAM); + _stack_limit = _end_of_stack - SIZEOF(.stack_dummy); + PROVIDE(__stack = _end_of_stack); + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(_stack_limit >= _heap_limit, "region RAM overflowed with stack") +} diff --git a/examples/baremetal/pca10001/greenblink/gcc/startup.s b/examples/baremetal/pca10001/greenblink/gcc/startup.s new file mode 100644 index 000000000..ec433ac03 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/gcc/startup.s @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +.syntax unified +.arch armv7e-m +.thumb + +// Define the stack. +.section .stack +.align 3 +.equ _size_of_stack, 2048 +.globl _end_of_stack +.globl _stack_limit +_stack_limit: +.space _size_of_stack +.size _stack_limit, . - _stack_limit +_end_of_stack: +.size _end_of_stack, . - _end_of_stack + +// Define the heap. +.section .heap +.align 3 +.equ _size_of_heap, 2048 +.globl _end_of_heap +.globl _heap_limit +_end_of_heap: +.space _size_of_heap +.size _end_of_heap, . - _end_of_heap +_heap_limit: +.size _heap_limit, . - _heap_limit + +// Define the empty vectors table. +.section .isr_vector, "ax" +.align 2 +.globl _vectors_table +_vectors_table: + // Generic interrupts offset. + .word _end_of_stack // Initial stack pointer value. + .word reset_handler // Reset. + .word 0 // NMI. + .word 0 // Hard fault. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // SVC. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // PendSV. + .word 0 // SysTick. + + // External interrupts offset. + .word 0 // POWER CLOCK. + .word 0 // RADIO. + .word 0 // UART0 + .word 0 // SPI0/TWI0. + .word 0 // SPI1/TWI1. + .word 0 // Reserved. + .word 0 // GPIOTE. + .word 0 // ADC. + .word 0 // TIMER0. + .word 0 // TIMER1. + .word 0 // TIMER2. + .word 0 // RTC0. + .word 0 // TEMP. + .word 0 // RNG. + .word 0 // ECB. + .word 0 // CCM_AAR. + .word 0 // WDT. + .word 0 // RTC1. + .word 0 // QDEC. + .word 0 // LPCOMP. + .word 0 // SWI0. + .word 0 // SWI1. + .word 0 // SWI2. + .word 0 // SWI3. + .word 0 // SWI4. + .word 0 // SWI5. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. +.size _vectors_table, . - _vectors_table + +// Define the 'reset_handler' function, which is an entry point. +.text +.thumb +.thumb_func +.align 1 +.globl reset_handler +.type reset_handler, %function +reset_handler: + // Loop to copy data from read only memory to RAM. + ldr r1, =_end_of_code_section + ldr r2, =_start_of_data_section + ldr r3, =__bss_start__ + subs r3, r3, r2 + ble _copy_data_init_done +_copy_data_init: + subs r3, r3, #4 + ldr r0, [r1,r3] + str r0, [r2,r3] + bgt _copy_data_init +_copy_data_init_done: + // Zero fill the bss segment. + ldr r1, =__bss_start__ + ldr r2, =__bss_end__ + movs r0, 0 + subs r2, r2, r1 + ble _loop_fill_zero_bss_done + +_loop_fill_zero_bss: + subs r2, r2, #4 + str r0, [r1, r2] + bgt _loop_fill_zero_bss + +_loop_fill_zero_bss_done: + // Call the application's entry point. + bl main + bx lr +.size reset_handler, . - reset_handler diff --git a/examples/baremetal/pca10001/greenblink/gpio.c b/examples/baremetal/pca10001/greenblink/gpio.c new file mode 100644 index 000000000..5fc910e58 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/gpio.c @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "gpio.h" +#include "system.h" + +#define GPIO_GREEN_LED_PIN_POS (18u) +#define GPIO_GREEN_LED_PIN (1u << GPIO_GREEN_LED_PIN_POS) + +// Pin direction attributes. +#define GPIO_PIN_CNF_DIR_POS (0u) // Position of DIR field. +#define GPIO_PIN_CNF_DIR_OUT (1u) // Configure pin as an output pin. +#define GPIO_PIN_CNF_DIR_MSK (GPIO_PIN_CNF_DIR_OUT << GPIO_PIN_CNF_DIR_POS) + +// Pin input buffer attributes. +#define GPIO_PIN_CNF_INPUT_POS (1u) // Position of INPUT field. +#define GPIO_PIN_CNF_INPUT_OFF (1u) // Disconnect input buffer. +#define GPIO_PIN_CNF_INPUT_MSK (GPIO_PIN_CNF_INPUT_OFF << GPIO_PIN_CNF_INPUT_POS) + +// Pin pull attributes. +#define GPIO_PIN_CNF_PULL_POS (2u) // Position of PULL field. +#define GPIO_PIN_CNF_PULL_OFF (0u) // No pull. +#define GPIO_PIN_CNF_PULL_MSK (GPIO_PIN_CNF_PULL_OFF << GPIO_PIN_CNF_PULL_POS) + +// Pin drive attributes. +#define GPIO_PIN_CNF_DRIVE_POS (8u) // Position of DRIVE field. +#define GPIO_PIN_CNF_DRIVE_S0S1 (0u) // Standard '0', standard '1'. +#define GPIO_PIN_CNF_DRIVE_MSK (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_POS) + +// Pin sense attributes. +#define GPIO_PIN_CNF_SENSE_POS (16u) // Position of SENSE field. +#define GPIO_PIN_CNF_SENSE_OFF (0u) // Disabled. +#define GPIO_PIN_CNF_SENSE_MSK (GPIO_PIN_CNF_SENSE_OFF << GPIO_PIN_CNF_SENSE_POS) + +void gpio_init_green_led(void) +{ + GPIOD_REGS_MAP->PIN_CNF[GPIO_GREEN_LED_PIN_POS] = (GPIO_PIN_CNF_DIR_MSK + | GPIO_PIN_CNF_INPUT_MSK + | GPIO_PIN_CNF_PULL_MSK + | GPIO_PIN_CNF_DRIVE_MSK + | GPIO_PIN_CNF_SENSE_MSK); +} + +void gpio_toggle_green_led(void) +{ + const uint32_t gpio_state = GPIOD_REGS_MAP->OUT; + GPIOD_REGS_MAP->OUTSET = (GPIO_GREEN_LED_PIN & ~gpio_state); + GPIOD_REGS_MAP->OUTCLR = (GPIO_GREEN_LED_PIN & gpio_state); +} diff --git a/examples/baremetal/pca10001/greenblink/gpio.h b/examples/baremetal/pca10001/greenblink/gpio.h new file mode 100644 index 000000000..9e931b715 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/gpio.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GPIO_H +#define GPIO_H + +#ifdef __cplusplus +extern "C" { +#endif + +void gpio_init_green_led(void); +void gpio_toggle_green_led(void); + +#ifdef __cplusplus +} +#endif + +#endif // GPIO_H diff --git a/examples/baremetal/pca10001/greenblink/greenblink.qbs b/examples/baremetal/pca10001/greenblink/greenblink.qbs new file mode 100644 index 000000000..1a4dabde7 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/greenblink.qbs @@ -0,0 +1,170 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +CppApplication { + condition: { + if (!qbs.architecture.startsWith("arm")) + return false; + return (qbs.toolchain.contains("gcc") + || qbs.toolchain.contains("iar") + || qbs.toolchain.contains("keil")) + && !qbs.toolchain.contains("xcode") + } + name: "pca10001-greenblink" + cpp.cLanguageVersion: "c99" + cpp.positionIndependentCode: false + + // + // GCC-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("gcc") + cpp.assemblerFlags: [ + "-mcpu=cortex-m0", + ] + cpp.driverFlags: [ + "-mcpu=cortex-m0", + "-specs=nosys.specs" + ] + } + + Group { + condition: qbs.toolchain.contains("gcc") + name: "GCC" + prefix: "gcc/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.ld"] + } + } + + // + // IAR-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("iar") + cpp.assemblerFlags: [ + "--cpu", "cortex-m0" + ] + cpp.driverFlags: [ + "--cpu", "cortex-m0" + ] + } + + Group { + condition: qbs.toolchain.contains("iar") + name: "IAR" + prefix: "iar/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.icf"] + } + } + + // + // KEIL-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("keil") + cpp.assemblerFlags: [ + "--cpu", "cortex-m0" + ] + cpp.driverFlags: [ + "--cpu", "cortex-m0" + ] + } + + Group { + condition: qbs.toolchain.contains("keil") + name: "KEIL" + prefix: "keil/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.sct"] + } + } + + // + // Common code. + // + + Group { + name: "Gpio" + files: ["gpio.c", "gpio.h"] + } + + Group { + name: "System" + files: ["system.h"] + } + + files: ["main.c"] +} diff --git a/examples/baremetal/pca10001/greenblink/iar/flash.icf b/examples/baremetal/pca10001/greenblink/iar/flash.icf new file mode 100644 index 000000000..8d1ef63f4 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/iar/flash.icf @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +define symbol _start_of_intvec_section = 0x00000000; + +define symbol _start_of_ram_section = 0x20000000; +define symbol _end_of_ram_section = 0x20003FFF; +define symbol _start_of_flash_section = 0x00000000; +define symbol _end_of_flash_section = 0x0003FFFF; + +define symbol _min_stack_size = 0x800; +define symbol _min_heap_size = 0x800; + +define memory mem with size = 4G; +define region flash_section = mem:[from _start_of_flash_section to _end_of_flash_section]; +define region ram_section = mem:[from _start_of_ram_section to _end_of_ram_section]; + +define block CSTACK with alignment = 8, size = _min_stack_size { }; +define block HEAP with alignment = 8, size = _min_heap_size { }; + +initialize by copy { readwrite }; + +place at address mem:_start_of_intvec_section { readonly section .intvec }; + +place in flash_section { readonly }; +place in ram_section { readwrite, block CSTACK, block HEAP }; diff --git a/examples/baremetal/pca10001/greenblink/iar/startup.s b/examples/baremetal/pca10001/greenblink/iar/startup.s new file mode 100644 index 000000000..d8041c5c1 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/iar/startup.s @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + MODULE ?cstartup + + SECTION CSTACK:DATA:NOROOT(3) + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + + PUBLIC _vectors_table + DATA + +_vectors_table + ;; Generic interrupts offset. + DCD sfe(CSTACK) ; Initial stack pointer value. + DCD reset_handler ; Reset. + DCD 0 ; NMI. + DCD 0 ; Hard fault. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; SVC. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; PendSV. + DCD 0 ; SysTick. + ;; External interrupts offset. + DCD 0 ; Power clock. + DCD 0 ; Radio. + DCD 0 ; UART0. + DCD 0 ; SPI0/TWI0 + DCD 0 ; SPI1/TWI1 + DCD 0 ; Reserved + DCD 0 ; GPIOTE + DCD 0 ; ADC + DCD 0 ; TIMER0 + DCD 0 ; TIMER1 + DCD 0 ; TIMER2 + DCD 0 ; RTC0 + DCD 0 ; TEMP + DCD 0 ; RNG + DCD 0 ; ECB + DCD 0 ; CCM/AAR + DCD 0 ; WDT + DCD 0 ; RTC1 + DCD 0 ; QDEC + DCD 0 ; LPCOMP + DCD 0 ; SWI0 + DCD 0 ; SWI1 + DCD 0 ; SWI2 + DCD 0 ; SWI3 + DCD 0 ; SWI4 + DCD 0 ; SWI5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + + ;; Reset handler. + THUMB + PUBWEAK reset_handler + SECTION .text:CODE:REORDER:NOROOT(2) +reset_handler + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + END + + diff --git a/examples/baremetal/pca10001/greenblink/keil/flash.sct b/examples/baremetal/pca10001/greenblink/keil/flash.sct new file mode 100644 index 000000000..6d5a1e42d --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/keil/flash.sct @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +;; Load region size_region. +LR_IROM1 0x00000000 0x00040000 { + ;; Load address = execution address. + ER_IROM1 0x00000000 0x00040000 { + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + .ANY (+XO) + } + + ; RW data. + RW_IRAM1 0x20000000 0x00004000 { + .ANY (+RW +ZI) + } +} diff --git a/examples/baremetal/pca10001/greenblink/keil/startup.s b/examples/baremetal/pca10001/greenblink/keil/startup.s new file mode 100644 index 000000000..4b63519db --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/keil/startup.s @@ -0,0 +1,134 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +;; Contact: https://www.qt.io/licensing/ +;; +;; This file is part of the examples of Qbs. +;; +;; $QT_BEGIN_LICENSE:BSD$ +;; Commercial License Usage +;; Licensees holding valid commercial Qt licenses may use this file in +;; accordance with the commercial license agreement provided with the +;; Software or, alternatively, in accordance with the terms contained in +;; a written agreement between you and The Qt Company. For licensing terms +;; and conditions see https://www.qt.io/terms-conditions. For further +;; information use the contact form at https://www.qt.io/contact-us. +;; +;; BSD License Usage +;; Alternatively, you may use this file under the terms of the BSD license +;; as follows: +;; +;; "Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are +;; met: +;; * Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; * Neither the name of The Qt Company Ltd nor the names of its +;; contributors may be used to endorse or promote products derived +;; from this software without specific prior written permission. +;; +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +;; +;; $QT_END_LICENSE$ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +_size_of_stack EQU 0x800 +_size_of_heap EQU 0x800 + +;; Stack configuration. + AREA STACK, NOINIT, READWRITE, ALIGN=3 +_start_of_stack SPACE _size_of_stack +_end_of_stack + +;; Heap configuration. + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +_start_of_heap SPACE _size_of_heap +_end_of_heap + + PRESERVE8 + THUMB + +;; Define the empty vectors table. + AREA RESET, DATA, READONLY +_vectors_table + ;; Generic interrupts offset. + DCD _end_of_stack ; Initial stack pointer value. + DCD reset_handler ; Reset. + DCD 0 ; NMI. + DCD 0 ; Hard fault. + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; SVC. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; PendSV. + DCD 0 ; SysTick. + ;; External interrupts offset. + DCD 0 ; Power clock. + DCD 0 ; Radio. + DCD 0 ; UART0. + DCD 0 ; SPI0/TWI0 + DCD 0 ; SPI1/TWI1 + DCD 0 ; Reserved + DCD 0 ; GPIOTE + DCD 0 ; ADC + DCD 0 ; TIMER0 + DCD 0 ; TIMER1 + DCD 0 ; TIMER2 + DCD 0 ; RTC0 + DCD 0 ; TEMP + DCD 0 ; RNG + DCD 0 ; ECB + DCD 0 ; CCM/AAR + DCD 0 ; WDT + DCD 0 ; RTC1 + DCD 0 ; QDEC + DCD 0 ; LPCOMP + DCD 0 ; SWI0 + DCD 0 ; SWI1 + DCD 0 ; SWI2 + DCD 0 ; SWI3 + DCD 0 ; SWI4 + DCD 0 ; SWI5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved +_end_of_vectors_table + +_size_of_vectors_table EQU _end_of_vectors_table - _vectors_table + + AREA |.text|, CODE, READONLY +;; Reset handler. +reset_handler PROC + EXPORT reset_handler [WEAK] + IMPORT main + LDR R0, =main + BX R0 + ENDP + ALIGN + + END diff --git a/examples/baremetal/pca10001/greenblink/main.c b/examples/baremetal/pca10001/greenblink/main.c new file mode 100644 index 000000000..89d3daeb6 --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/main.c @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "gpio.h" + +#include <stdint.h> + +static void some_delay(uint32_t counts) +{ + for (uint32_t index = 0u; index < counts; ++index) + __asm("nop"); +} + +int main(void) +{ + gpio_init_green_led(); + + while (1) { + gpio_toggle_green_led(); + some_delay(1000000u); + } +} diff --git a/examples/baremetal/pca10001/greenblink/system.h b/examples/baremetal/pca10001/greenblink/system.h new file mode 100644 index 000000000..37e6ad8ea --- /dev/null +++ b/examples/baremetal/pca10001/greenblink/system.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SYSTEM_H +#define SYSTEM_H + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define __IO volatile + +struct gpio_regs_map { + uint32_t RESERVED0[321u]; + __IO uint32_t OUT; + __IO uint32_t OUTSET; + __IO uint32_t OUTCLR; + __IO uint32_t IN; + __IO uint32_t DIR; + __IO uint32_t DIRSET; + __IO uint32_t DIRCLR; + uint32_t RESERVED1[120u]; + __IO uint32_t PIN_CNF[32u]; +}; + +#define GPIO_REGS_ADDRESS (0x50000000u) +#define GPIOD_REGS_MAP ((struct gpio_regs_map *)GPIO_REGS_ADDRESS) + +#ifdef __cplusplus +} +#endif + +#endif // SYSTEM_H diff --git a/examples/baremetal/pca10001/pca10001.qbs b/examples/baremetal/pca10001/pca10001.qbs new file mode 100644 index 000000000..db1303268 --- /dev/null +++ b/examples/baremetal/pca10001/pca10001.qbs @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +Project { + name: "Examples for pca10001/pca10024 boards" + references: [ + "greenblink/greenblink.qbs" + ] +} diff --git a/examples/baremetal/pca10040/greenblink/README.md b/examples/baremetal/pca10040/greenblink/README.md new file mode 100644 index 000000000..7d759839b --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/README.md @@ -0,0 +1,10 @@ +This example demonstrates how to build a bare-metal application using +different ARM toolchains. It is designed for the Nordic pca10040 +evaluation kit (based on nRF52832 MCU) and simply flashes the green +LED on the board. + +The following toolchains are supported: + + * GNU Arm Embedded Toolchain + * IAR Embedded Workbench + * KEIL Microcontroller Development Kit diff --git a/examples/baremetal/pca10040/greenblink/gcc/flash.ld b/examples/baremetal/pca10040/greenblink/gcc/flash.ld new file mode 100644 index 000000000..b998618ae --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/gcc/flash.ld @@ -0,0 +1,151 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +ENTRY(reset_handler) + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x10000 + CODE_RAM (rwx) : ORIGIN = 0x800000, LENGTH = 0x10000 +} + +SECTIONS { + .text : { + KEEP(*(.isr_vector)) + *(.text*) + KEEP(*(.init)) + KEEP(*(.fini)) + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + *(.rodata*) + *(.eh_frame*) + . = ALIGN(4); + } > FLASH + + .ARM.extab : { + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } > FLASH + + _start_of_exidx_section = .; + .ARM.exidx : { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + . = ALIGN(4); + } > FLASH + _end_of_exidx_section = .; + + _end_of_code_section = .; + + .data : AT (_end_of_code_section) { + _start_of_data_section = .; + *(vtable) + *(.data*) + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN(__preinit_array_start = .); + *(.preinit_array) + PROVIDE_HIDDEN(__preinit_array_end = .); + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN(__init_array_start = .); + *(SORT(.init_array.*)) + *(.init_array) + PROVIDE_HIDDEN(__init_array_end = .); + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN(__fini_array_start = .); + *(SORT(.fini_array.*)) + *(.fini_array) + PROVIDE_HIDDEN(__fini_array_end = .); + *(.jcr) + . = ALIGN(4); + /* All data end */ + _end_of_data_section = .; + } > RAM + + .bss : { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): { + __end__ = .; + end = __end__; + *(.heap*) + _heap_limit = .; + } > RAM + + .stack_dummy (COPY): { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by size of stack_dummy section. */ + _end_of_stack = ORIGIN(RAM) + LENGTH(RAM); + _stack_limit = _end_of_stack - SIZEOF(.stack_dummy); + PROVIDE(__stack = _end_of_stack); + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(_stack_limit >= _heap_limit, "region RAM overflowed with stack") +} diff --git a/examples/baremetal/pca10040/greenblink/gcc/startup.s b/examples/baremetal/pca10040/greenblink/gcc/startup.s new file mode 100644 index 000000000..d1fe7e9de --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/gcc/startup.s @@ -0,0 +1,253 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +.syntax unified +.arch armv7e-m +.thumb + +// Define the stack. +.section .stack +.align 3 +.equ _size_of_stack, 8192 +.globl _end_of_stack +.globl _stack_limit +_stack_limit: +.space _size_of_stack +.size _stack_limit, . - _stack_limit +_end_of_stack: +.size _end_of_stack, . - _end_of_stack + +// Define the heap. +.section .heap +.align 3 +.equ _size_of_heap, 8192 +.globl _end_of_heap +.globl _heap_limit +_end_of_heap: +.space _size_of_heap +.size _end_of_heap, . - _end_of_heap +_heap_limit: +.size _heap_limit, . - _heap_limit + +// Define the empty vectors table. +.section .isr_vector, "ax" +.align 2 +.globl _vectors_table +_vectors_table: + // Generic interrupts offset. + .word _end_of_stack // Initial stack pointer value. + .word reset_handler // Reset. + .word 0 // NMI. + .word 0 // Hard fault. + .word 0 // Memory management fault. + .word 0 // Bus fault. + .word 0 // Usage fault. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // SVC. + .word 0 // Debug monitor. + .word 0 // Reserved. + .word 0 // PendSV. + .word 0 // SysTick. + + // External interrupts offset. + .word 0 // POWER CLOCK. + .word 0 // RADIO. + .word 0 // UARTE0/UART0 + .word 0 // SPIM0/SPIS0/TWIM0/TWIS0/SPI0/TWI0. + .word 0 // SPIM1/SPIS1/TWIM1/TWIS1/SPI1/TWI1. + .word 0 // NFCT. + .word 0 // GPIOTE. + .word 0 // SAADC. + .word 0 // TIMER0. + .word 0 // TIMER1. + .word 0 // TIMER2. + .word 0 // RTC0. + .word 0 // TEMP. + .word 0 // RNG. + .word 0 // ECB. + .word 0 // CCM_AAR. + .word 0 // WDT. + .word 0 // RTC1. + .word 0 // QDEC. + .word 0 // COMP_LPCOMP. + .word 0 // SWI0_EGU0. + .word 0 // SWI1_EGU1. + .word 0 // SWI2_EGU2. + .word 0 // SWI3_EGU3. + .word 0 // SWI4_EGU4. + .word 0 // SWI5_EGU5. + .word 0 // TIMER3. + .word 0 // TIMER4. + .word 0 // PWM0. + .word 0 // PDM. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // MWU. + .word 0 // PWM1. + .word 0 // PWM2. + .word 0 // SPIM2/SPIS2/SPI2. + .word 0 // RTC2. + .word 0 // I2S. + .word 0 // FPU. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. +.size _vectors_table, . - _vectors_table + +// Define the 'reset_handler' function, which is an entry point. +.text +.thumb +.thumb_func +.align 1 +.globl reset_handler +.type reset_handler, %function +reset_handler: + // Loop to copy data from read only memory to RAM. + ldr r1, =_end_of_code_section + ldr r2, =_start_of_data_section + ldr r3, =__bss_start__ + subs r3, r3, r2 + ble _copy_data_init_done +_copy_data_init: + subs r3, r3, #4 + ldr r0, [r1,r3] + str r0, [r2,r3] + bgt _copy_data_init +_copy_data_init_done: + // Zero fill the bss segment. + ldr r1, =__bss_start__ + ldr r2, =__bss_end__ + movs r0, 0 + subs r2, r2, r1 + ble _loop_fill_zero_bss_done + +_loop_fill_zero_bss: + subs r2, r2, #4 + str r0, [r1, r2] + bgt _loop_fill_zero_bss + +_loop_fill_zero_bss_done: + // Call the application's entry point. + bl main + bx lr +.size reset_handler, . - reset_handler diff --git a/examples/baremetal/pca10040/greenblink/gpio.c b/examples/baremetal/pca10040/greenblink/gpio.c new file mode 100644 index 000000000..c86f6ac5e --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/gpio.c @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "gpio.h" +#include "system.h" + +#define GPIO_GREEN_LED_PIN_POS (17u) +#define GPIO_GREEN_LED_PIN (1u << GPIO_GREEN_LED_PIN_POS) + +// Pin direction attributes. +#define GPIO_PIN_CNF_DIR_POS (0u) // Position of DIR field. +#define GPIO_PIN_CNF_DIR_OUT (1u) // Configure pin as an output pin. +#define GPIO_PIN_CNF_DIR_MSK (GPIO_PIN_CNF_DIR_OUT << GPIO_PIN_CNF_DIR_POS) + +// Pin input buffer attributes. +#define GPIO_PIN_CNF_INPUT_POS (1u) // Position of INPUT field. +#define GPIO_PIN_CNF_INPUT_OFF (1u) // Disconnect input buffer. +#define GPIO_PIN_CNF_INPUT_MSK (GPIO_PIN_CNF_INPUT_OFF << GPIO_PIN_CNF_INPUT_POS) + +// Pin pull attributes. +#define GPIO_PIN_CNF_PULL_POS (2u) // Position of PULL field. +#define GPIO_PIN_CNF_PULL_OFF (0u) // No pull. +#define GPIO_PIN_CNF_PULL_MSK (GPIO_PIN_CNF_PULL_OFF << GPIO_PIN_CNF_PULL_POS) + +// Pin drive attributes. +#define GPIO_PIN_CNF_DRIVE_POS (8u) // Position of DRIVE field. +#define GPIO_PIN_CNF_DRIVE_S0S1 (0u) // Standard '0', standard '1'. +#define GPIO_PIN_CNF_DRIVE_MSK (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_POS) + +// Pin sense attributes. +#define GPIO_PIN_CNF_SENSE_POS (16u) // Position of SENSE field. +#define GPIO_PIN_CNF_SENSE_OFF (0u) // Disabled. +#define GPIO_PIN_CNF_SENSE_MSK (GPIO_PIN_CNF_SENSE_OFF << GPIO_PIN_CNF_SENSE_POS) + +void gpio_init_green_led(void) +{ + GPIOD_REGS_MAP->PIN_CNF[GPIO_GREEN_LED_PIN_POS] = (GPIO_PIN_CNF_DIR_MSK + | GPIO_PIN_CNF_INPUT_MSK + | GPIO_PIN_CNF_PULL_MSK + | GPIO_PIN_CNF_DRIVE_MSK + | GPIO_PIN_CNF_SENSE_MSK); +} + +void gpio_toggle_green_led(void) +{ + const uint32_t gpio_state = GPIOD_REGS_MAP->OUT; + GPIOD_REGS_MAP->OUTSET = (GPIO_GREEN_LED_PIN & ~gpio_state); + GPIOD_REGS_MAP->OUTCLR = (GPIO_GREEN_LED_PIN & gpio_state); +} diff --git a/examples/baremetal/pca10040/greenblink/gpio.h b/examples/baremetal/pca10040/greenblink/gpio.h new file mode 100644 index 000000000..9e931b715 --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/gpio.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GPIO_H +#define GPIO_H + +#ifdef __cplusplus +extern "C" { +#endif + +void gpio_init_green_led(void); +void gpio_toggle_green_led(void); + +#ifdef __cplusplus +} +#endif + +#endif // GPIO_H diff --git a/examples/baremetal/pca10040/greenblink/greenblink.qbs b/examples/baremetal/pca10040/greenblink/greenblink.qbs new file mode 100644 index 000000000..2ae3dc2a1 --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/greenblink.qbs @@ -0,0 +1,176 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +CppApplication { + condition: { + if (!qbs.architecture.startsWith("arm")) + return false; + return (qbs.toolchain.contains("gcc") + || qbs.toolchain.contains("iar") + || qbs.toolchain.contains("keil")) + && !qbs.toolchain.contains("xcode") + } + name: "pca10040-greenblink" + cpp.cLanguageVersion: "c99" + cpp.positionIndependentCode: false + + // + // GCC-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("gcc") + cpp.assemblerFlags: [ + "-mcpu=cortex-m4", + "-mfloat-abi=hard", + "-mfpu=fpv4-sp-d16", + ] + cpp.driverFlags: [ + "-mcpu=cortex-m4", + "-mfloat-abi=hard", + "-mfpu=fpv4-sp-d16", + "-specs=nosys.specs" + ] + } + + Group { + condition: qbs.toolchain.contains("gcc") + name: "GCC" + prefix: "gcc/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.ld"] + } + } + + // + // IAR-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("iar") + cpp.assemblerFlags: [ + "--cpu", "cortex-m4", + "--fpu", "vfpv4_sp" + ] + cpp.driverFlags: [ + "--cpu", "cortex-m4", + "--fpu", "vfpv4_sp" + ] + } + + Group { + condition: qbs.toolchain.contains("iar") + name: "IAR" + prefix: "iar/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.icf"] + } + } + + // + // KEIL-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("keil") + cpp.assemblerFlags: [ + "--cpu", "cortex-m4.fp.sp" + ] + cpp.driverFlags: [ + "--cpu", "cortex-m4.fp.sp" + ] + } + + Group { + condition: qbs.toolchain.contains("keil") + name: "KEIL" + prefix: "keil/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.sct"] + } + } + + // + // Common code. + // + + Group { + name: "Gpio" + files: ["gpio.c", "gpio.h"] + } + + Group { + name: "System" + files: ["system.h"] + } + + files: ["main.c"] +} diff --git a/examples/baremetal/pca10040/greenblink/iar/flash.icf b/examples/baremetal/pca10040/greenblink/iar/flash.icf new file mode 100644 index 000000000..d19640293 --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/iar/flash.icf @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +define symbol _start_of_intvec_section = 0x00000000; + +define symbol _start_of_irom1_section = 0x00000000; +define symbol _end_of_irom1_section = 0x0007FFFF; +define symbol _start_of_irom2_section = 0x0; +define symbol _end_of_irom2_section = 0x0; +define symbol _start_of_erom1_section = 0x0; +define symbol _end_of_erom1_section = 0x0; +define symbol _start_of_erom2_section = 0x0; +define symbol _end_of_erom2_section = 0x0; +define symbol _start_of_erom3_section = 0x0; +define symbol _end_of_erom3_section = 0x0; +define symbol _start_of_iram1_section = 0x20000000; +define symbol _end_of_iram1_section = 0x2000FFFF; +define symbol _start_of_iram2_section = 0x0; +define symbol _end_of_iram2_section = 0x0; +define symbol _start_of_eram1_section = 0x0; +define symbol _end_of_eram1_section = 0x0; +define symbol _start_of_eram2_section = 0x0; +define symbol _end_of_eram2_section = 0x0; +define symbol _start_of_eram3_section = 0x0; +define symbol _end_of_eram3_section = 0x0; + +define symbol _min_stack_size = 0x2000; +define symbol _min_proc_stack_size = 0x0; +define symbol _min_heap_size = 0x2000; + +define memory mem with size = 4G; +define region irom_section = mem:[from _start_of_irom1_section to _end_of_irom1_section] + | mem:[from _start_of_irom2_section to _end_of_irom2_section]; +define region erom_section = mem:[from _start_of_erom1_section to _end_of_erom1_section] + | mem:[from _start_of_erom2_section to _end_of_erom2_section] + | mem:[from _start_of_erom3_section to _end_of_erom3_section]; +define region iram_section = mem:[from _start_of_iram1_section to _end_of_iram1_section] + | mem:[from _start_of_iram2_section to _end_of_iram2_section]; +define region eram_section = mem:[from _start_of_eram1_section to _end_of_eram1_section] + | mem:[from _start_of_eram2_section to _end_of_eram2_section] + | mem:[from _start_of_eram3_section to _end_of_eram3_section]; + + +define block CSTACK with alignment = 8, size = _min_stack_size { }; +define block PROC_STACK with alignment = 8, size = _min_proc_stack_size { }; +define block HEAP with alignment = 8, size = _min_heap_size { }; + +initialize by copy { readwrite }; + +place at address mem:_start_of_intvec_section { readonly section .intvec }; + +place in irom_section { readonly }; +place in erom_section { readonly section application_specific_ro }; +place in iram_section { readwrite, block CSTACK, block HEAP, block PROC_STACK }; +place in eram_section { readwrite section application_specific_rw }; diff --git a/examples/baremetal/pca10040/greenblink/iar/startup.s b/examples/baremetal/pca10040/greenblink/iar/startup.s new file mode 100644 index 000000000..209322ac0 --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/iar/startup.s @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + MODULE ?cstartup + + SECTION CSTACK:DATA:NOROOT(3) + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + + PUBLIC _vectors_table + DATA + +_vectors_table + ;; Generic interrupts offset. + DCD sfe(CSTACK) ; Initial stack pointer value. + DCD reset_handler ; Reset. + DCD 0 ; NMI. + DCD 0 ; Hard fault. + DCD 0 ; Memory management fault. + DCD 0 ; Bus fault. + DCD 0 ; Usage fault. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; SVC. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; PendSV. + DCD 0 ; SysTick. + ;; External interrupts offset. + DCD 0 ; POWER CLOCK. + DCD 0 ; RADIO. + DCD 0 ; UARTE0/UART0 + DCD 0 ; SPIM0/SPIS0/TWIM0/TWIS0/SPI0/TWI0. + DCD 0 ; SPIM1/SPIS1/TWIM1/TWIS1/SPI1/TWI1. + DCD 0 ; NFCT. + DCD 0 ; GPIOTE. + DCD 0 ; SAADC. + DCD 0 ; TIMER0. + DCD 0 ; TIMER1. + DCD 0 ; TIMER2. + DCD 0 ; RTC0. + DCD 0 ; TEMP. + DCD 0 ; RNG. + DCD 0 ; ECB. + DCD 0 ; CCM_AAR. + DCD 0 ; WDT. + DCD 0 ; RTC1. + DCD 0 ; QDEC. + DCD 0 ; COMP_LPCOMP. + DCD 0 ; SWI0_EGU0. + DCD 0 ; SWI1_EGU1. + DCD 0 ; SWI2_EGU2. + DCD 0 ; SWI3_EGU3. + DCD 0 ; SWI4_EGU4. + DCD 0 ; SWI5_EGU5. + DCD 0 ; TIMER3. + DCD 0 ; TIMER4. + DCD 0 ; PWM0. + DCD 0 ; PDM. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; MWU. + DCD 0 ; PWM1. + DCD 0 ; PWM2. + DCD 0 ; SPIM2/SPIS2/SPI2. + DCD 0 ; RTC2. + DCD 0 ; I2S. + DCD 0 ; FPU. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + + ;; Reset handler. + THUMB + PUBWEAK reset_handler + SECTION .text:CODE:REORDER:NOROOT(2) +reset_handler + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + END diff --git a/examples/baremetal/pca10040/greenblink/keil/flash.sct b/examples/baremetal/pca10040/greenblink/keil/flash.sct new file mode 100644 index 000000000..29843331a --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/keil/flash.sct @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +;; Load region size_region. +LR_IROM1 0x00000000 0x00080000 { + ;; Load address = execution address. + ER_IROM1 0x00000000 0x00080000 { + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + .ANY (+XO) + } + + ; RW data. + RW_IRAM1 0x20000000 0x00008000 { + .ANY (+RW +ZI) + } +} diff --git a/examples/baremetal/pca10040/greenblink/keil/startup.s b/examples/baremetal/pca10040/greenblink/keil/startup.s new file mode 100644 index 000000000..369ca96f8 --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/keil/startup.s @@ -0,0 +1,215 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +;; Contact: https://www.qt.io/licensing/ +;; +;; This file is part of the examples of Qbs. +;; +;; $QT_BEGIN_LICENSE:BSD$ +;; Commercial License Usage +;; Licensees holding valid commercial Qt licenses may use this file in +;; accordance with the commercial license agreement provided with the +;; Software or, alternatively, in accordance with the terms contained in +;; a written agreement between you and The Qt Company. For licensing terms +;; and conditions see https://www.qt.io/terms-conditions. For further +;; information use the contact form at https://www.qt.io/contact-us. +;; +;; BSD License Usage +;; Alternatively, you may use this file under the terms of the BSD license +;; as follows: +;; +;; "Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are +;; met: +;; * Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; * Neither the name of The Qt Company Ltd nor the names of its +;; contributors may be used to endorse or promote products derived +;; from this software without specific prior written permission. +;; +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +;; +;; $QT_END_LICENSE$ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +_size_of_stack EQU 0x2000 +_size_of_heap EQU 0x2000 + +;; Stack configuration. + AREA STACK, NOINIT, READWRITE, ALIGN=3 +_start_of_stack SPACE _size_of_stack +_end_of_stack + +;; Heap configuration. + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +_start_of_heap SPACE _size_of_heap +_end_of_heap + + PRESERVE8 + THUMB + +;; Define the empty vectors table. + AREA RESET, DATA, READONLY +_vectors_table + ;; Generic interrupts offset. + DCD _end_of_stack ; Initial stack pointer value. + DCD reset_handler ; Reset. + DCD 0 ; NMI. + DCD 0 ; Hard fault. + DCD 0 ; Memory management fault. + DCD 0 ; Bus fault. + DCD 0 ; Usage fault. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; SVC. + DCD 0 ; Debug monitor. + DCD 0 ; Reserved. + DCD 0 ; PendSV. + DCD 0 ; SysTick. + ;; External interrupts offset. + DCD 0 ; Power clock. + DCD 0 ; Radio. + DCD 0 ; UARTE0/UART0. + DCD 0 ; SPIM0/SPIS0/TWIM0/TWIS0/SPI0/TWI0. + DCD 0 ; SPIM1/SPIS1/TWIM1/TWIS1/SPI1/TWI1. + DCD 0 ; NFCT. + DCD 0 ; GPIOTE. + DCD 0 ; SAADC. + DCD 0 ; TIMER0. + DCD 0 ; TIMER1. + DCD 0 ; TIMER2. + DCD 0 ; RTC0. + DCD 0 ; TEMP. + DCD 0 ; RNG. + DCD 0 ; ECB. + DCD 0 ; CCM/AAR. + DCD 0 ; WDT. + DCD 0 ; RTC1. + DCD 0 ; QDEC. + DCD 0 ; COMP/LPCOMP. + DCD 0 ; SWI0/EGU0. + DCD 0 ; SWI1/EGU1. + DCD 0 ; SWI2/EGU2. + DCD 0 ; SWI3/EGU3. + DCD 0 ; SWI4/EGU4. + DCD 0 ; SWI5/EGU5. + DCD 0 ; TIMER3. + DCD 0 ; TIMER4. + DCD 0 ; PWM0. + DCD 0 ; PDM. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; MWU. + DCD 0 ; PWM1. + DCD 0 ; PWM2. + DCD 0 ; SPIM2/SPIS2/SPI2. + DCD 0 ; RTC2. + DCD 0 ; I2S. + DCD 0 ; FPU. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + +_end_of_vectors_table + +_size_of_vectors_table EQU _end_of_vectors_table - _vectors_table + + AREA |.text|, CODE, READONLY +;; Reset handler. +reset_handler PROC + EXPORT reset_handler [WEAK] + IMPORT main + LDR R0, =main + BX R0 + ENDP + ALIGN + + END diff --git a/examples/baremetal/pca10040/greenblink/main.c b/examples/baremetal/pca10040/greenblink/main.c new file mode 100644 index 000000000..89d3daeb6 --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/main.c @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "gpio.h" + +#include <stdint.h> + +static void some_delay(uint32_t counts) +{ + for (uint32_t index = 0u; index < counts; ++index) + __asm("nop"); +} + +int main(void) +{ + gpio_init_green_led(); + + while (1) { + gpio_toggle_green_led(); + some_delay(1000000u); + } +} diff --git a/examples/baremetal/pca10040/greenblink/system.h b/examples/baremetal/pca10040/greenblink/system.h new file mode 100644 index 000000000..bf9e4b352 --- /dev/null +++ b/examples/baremetal/pca10040/greenblink/system.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SYSTEM_H +#define SYSTEM_H + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define __IO volatile + +struct gpio_regs_map { + uint32_t RESERVED0[321u]; + __IO uint32_t OUT; + __IO uint32_t OUTSET; + __IO uint32_t OUTCLR; + __IO uint32_t IN; + __IO uint32_t DIR; + __IO uint32_t DIRSET; + __IO uint32_t DIRCLR; + __IO uint32_t LATCH; + __IO uint32_t DETECTMODE; + uint32_t RESERVED1[118u]; + __IO uint32_t PIN_CNF[32u]; +}; + +#define GPIO_REGS_ADDRESS (0x50000000u) +#define GPIOD_REGS_MAP ((struct gpio_regs_map *)GPIO_REGS_ADDRESS) + +#ifdef __cplusplus +} +#endif + +#endif // SYSTEM_H diff --git a/examples/baremetal/pca10040/pca10040.qbs b/examples/baremetal/pca10040/pca10040.qbs new file mode 100644 index 000000000..e5e516c3f --- /dev/null +++ b/examples/baremetal/pca10040/pca10040.qbs @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +Project { + name: "Examples for pca10040 board" + references: [ + "greenblink/greenblink.qbs" + ] +} diff --git a/examples/baremetal/stm32f103/greenblink/README.md b/examples/baremetal/stm32f103/greenblink/README.md new file mode 100644 index 000000000..8d19ac73a --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/README.md @@ -0,0 +1,10 @@ +This example demonstrates how to build a bare-metal application using +different ARM toolchains. It is designed for the stm32f103 "Blue Pill" +evaluation kit (based on stm32f103c8 MCU) and simply flashes the green +LED on the board. + +The following toolchains are supported: + + * GNU Arm Embedded Toolchain + * IAR Embedded Workbench + * KEIL Microcontroller Development Kit diff --git a/examples/baremetal/stm32f103/greenblink/gcc/flash.ld b/examples/baremetal/stm32f103/greenblink/gcc/flash.ld new file mode 100644 index 000000000..3fe5c1563 --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/gcc/flash.ld @@ -0,0 +1,172 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Entry point (defined in assembled file). */ +ENTRY(reset_handler) + +/* End of RAM, it is the user mode stack pointer address. */ +_end_of_stack = 0x20005000; + +/* Generate a link error if heap and stack don't fit into RAM. */ +_size_of_heap = 0x200; /* Required amount of heap. */ +_size_of_stack = 0x400; /* Required amount of stack. */ + +MEMORY { + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K + FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 64K +} + +SECTIONS { + /* The vectors table goes into FLASH. */ + .isr_vector : { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code. */ + . = ALIGN(4); + } > FLASH + + /* The program code and other data goes into FLASH. */ + .text : { + . = ALIGN(4); + *(.text) + *(.text*) + *(.glue_7) /* Glue arm to thumb code. */ + *(.glue_7t) /* Glue thumb to arm code. */ + *(.eh_frame) + KEEP(*(.init)) + KEEP(*(.fini)) + . = ALIGN(4); + _end_of_text_section = .; /* Export global symbol at end of code. */ + } > FLASH + + /* Constant data goes into FLASH. */ + .rodata : { + . = ALIGN(4); + *(.rodata) + *(.rodata*) + . = ALIGN(4); + } > FLASH + + .ARM.extab : { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } > FLASH + + .preinit_array : { + PROVIDE_HIDDEN(__preinit_array_start = .); + KEEP(*(.preinit_array*)) + PROVIDE_HIDDEN(__preinit_array_end = .); + } > FLASH + + .init_array : { + PROVIDE_HIDDEN(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array*)) + PROVIDE_HIDDEN(__init_array_end = .); + } > FLASH + + .fini_array : { + PROVIDE_HIDDEN(__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array*)) + PROVIDE_HIDDEN(__fini_array_end = .); + } > FLASH + + _start_of_init_data_section = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code. */ + .data : { + . = ALIGN(4); + _start_of_data_section = .; /* Export global symbol at data start. */ + *(.data) + *(.data*) + . = ALIGN(4); + _end_of_data_section = .; /* Export global symbol at data end. */ + } > RAM AT > FLASH + + /* Uninitialized data section. */ + . = ALIGN(4); + .bss : { + /* This is used by the startup in order to initialize the .bss secion. */ + _start_of_bss_section = .; /* Export global symbol at bss start. */ + __bss_start__ = _start_of_bss_section; + *(.bss) + *(.bss*) + *(COMMON) + . = ALIGN(4); + _end_of_bss_section = .; /* Export global symbol at bss end. */ + __bss_end__ = _end_of_bss_section; + } > RAM + + /* Used to check that there is enough RAM left. */ + ._user_heap_stack : { + . = ALIGN(4); + PROVIDE(end = .); + PROVIDE(_end = .); + . = . + _size_of_heap; + . = . + _size_of_stack; + . = ALIGN(4); + } > RAM + + /* Remove information from the standard libraries. */ + /DISCARD/ : { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { + *(.ARM.attributes) + } +} diff --git a/examples/baremetal/stm32f103/greenblink/gcc/startup.s b/examples/baremetal/stm32f103/greenblink/gcc/startup.s new file mode 100644 index 000000000..5bb262f16 --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/gcc/startup.s @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +.syntax unified +.cpu cortex-m3 +.fpu softvfp +.thumb + +// These symbols are exported from the linker script. +.word _start_of_init_data_section +.word _start_of_data_section +.word _end_of_data_section +.word _start_of_bss_section +.word _end_of_bss_section + +.equ _boot_ram, 0xF108F85F + +.section .text.reset_handler +.weak reset_handler +.type reset_handler, %function +reset_handler: + // Copy the data segment initializers from flash to SRAM. + movs r1, #0 + b _loop_copy_data_init +_copy_data_init: + ldr r3, =_start_of_init_data_section + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 +_loop_copy_data_init: + ldr r0, =_start_of_data_section + ldr r3, =_end_of_data_section + adds r2, r0, r1 + cmp r2, r3 + bcc _copy_data_init + ldr r2, =_start_of_bss_section + b _loop_fill_zero_bss + + // Zero fill the bss segment. +_fill_zero_bss: + movs r3, #0 + str r3, [r2], #4 +_loop_fill_zero_bss: + ldr r3, = _end_of_bss_section + cmp r2, r3 + bcc _fill_zero_bss + + // Call the static constructors. + bl __libc_init_array + + // Call the application entry point. + bl main + bx lr +.size reset_handler, .-reset_handler + +// Define the empty vectors table. +.section .isr_vector,"a",%progbits +.type _vectors_table, %object +.size _vectors_table, .-_vectors_table +_vectors_table: + // Generic interrupts offset. + .word _end_of_stack // Initial stack pointer value. + .word reset_handler // Reset. + .word 0 // NMI. + .word 0 // Hard fault. + .word 0 // Memory management fault. + .word 0 // Bus fault. + .word 0 // Usage fault. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // Reserved. + .word 0 // SVC. + .word 0 // Debug monitor. + .word 0 // Reserved. + .word 0 // PendSV. + .word 0 // SysTick. + + // External interrupts offset. + .word 0 // Window watchdog. + .word 0 // PVD through EXTI Line detection. + .word 0 // Tamper and timestamps through the EXTI line. + .word 0 // RTC wakeup through the EXTI line. + .word 0 // FLASH. + .word 0 // RCC. + .word 0 // EXTI line0. + .word 0 // EXTI line1. + .word 0 // EXTI line2. + .word 0 // EXTI line3. + .word 0 // EXTI line4. + .word 0 // DMA1 stream 0. + .word 0 // DMA1 stream 1. + .word 0 // DMA1 stream 2. + .word 0 // DMA1 stream 3. + .word 0 // DMA1 stream 4. + .word 0 // DMA1 stream 5. + .word 0 // DMA1 stream 6. + .word 0 // ADC1/2. + .word 0 // USB HP/CAN1 TX. + .word 0 // USB LP / CAN1 RX0. + .word 0 // CAN1 RX1. + .word 0 // CAN1 SCE. + .word 0 // EXTI line [9:5]s. + .word 0 // TIM1 break. + .word 0 // TIM1 update. + .word 0 // TIM1 trigger and communication. + .word 0 // TIM1 capture compare. + .word 0 // TIM2. + .word 0 // TIM3. + .word 0 // TIM4. + .word 0 // I2C1 event. + .word 0 // I2C1 error. + .word 0 // I2C2 event. + .word 0 // I2C2 error. + .word 0 // SPI1. + .word 0 // SPI2. + .word 0 // USART1. + .word 0 // USART2. + .word 0 // USART3. + .word 0 // EXTI line [15:10]s. + .word 0 // RTC alarm. + .word 0 // USB wakeup. + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word _boot_ram // Boot RAM mode for stm32f10x medium density devices. diff --git a/examples/baremetal/stm32f103/greenblink/gpio.c b/examples/baremetal/stm32f103/greenblink/gpio.c new file mode 100644 index 000000000..84c87a2b9 --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/gpio.c @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "gpio.h" +#include "system.h" + +#define GPIO_GREEN_LED_PIN_POS (13u) +#define GPIO_GREEN_LED_PIN (1u << GPIO_GREEN_LED_PIN_POS) + +// Bit definition for RCC_APB2ENR register. +#define RCC_APB2ENR_IOPCEN_POS (4u) +#define RCC_APB2ENR_IOPCEN (0x1u << RCC_APB2ENR_IOPCEN_POS) + +// Bit definition for GPIO_CRL register. +#define GPIO_CRL_MODE_POS (0u) // MODE field position. +#define GPIO_CRL_MODE_MSK (0x3u << GPIO_CRL_MODE_POS) // MODE field mask. +#define GPIO_CRL_MODE_OUT_FREQ_LOW (0x2u << GPIO_CRL_MODE_POS) // As output with low frequency. + +#define GPIO_CRL_CNF_POS (2u) // CNF field position. +#define GPIO_CRL_CNF_MSK (0x3u << GPIO_CRL_CNF_POS) // CNF field mask. +#define GPIO_CRL_CNF_OUTPUT_PP (0x00000000u) // General purpose output push-pull. + +void gpio_init_green_led(void) +{ + // Enable RCC clock on GPIOC port. + RCC_REGS_MAP->APB2ENR |= RCC_APB2ENR_IOPCEN; + // Configure GPIOC pin #13. + const uint32_t offset = ((GPIO_GREEN_LED_PIN_POS - 8u) << 2u); + GPIOC_REGS_MAP->CRH &= ~((GPIO_CRL_MODE_MSK | GPIO_CRL_CNF_MSK) << offset); + GPIOC_REGS_MAP->CRH |= ((GPIO_CRL_MODE_OUT_FREQ_LOW | GPIO_CRL_CNF_OUTPUT_PP) << offset); +} + +void gpio_toggle_green_led(void) +{ + GPIOC_REGS_MAP->ODR ^= GPIO_GREEN_LED_PIN; +} diff --git a/examples/baremetal/stm32f103/greenblink/gpio.h b/examples/baremetal/stm32f103/greenblink/gpio.h new file mode 100644 index 000000000..9e931b715 --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/gpio.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GPIO_H +#define GPIO_H + +#ifdef __cplusplus +extern "C" { +#endif + +void gpio_init_green_led(void); +void gpio_toggle_green_led(void); + +#ifdef __cplusplus +} +#endif + +#endif // GPIO_H diff --git a/examples/baremetal/stm32f103/greenblink/greenblink.qbs b/examples/baremetal/stm32f103/greenblink/greenblink.qbs new file mode 100644 index 000000000..18fe8e536 --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/greenblink.qbs @@ -0,0 +1,172 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +CppApplication { + condition: { + if (!qbs.architecture.startsWith("arm")) + return false; + return (qbs.toolchain.contains("gcc") + || qbs.toolchain.contains("iar") + || qbs.toolchain.contains("keil")) + && !qbs.toolchain.contains("xcode") + } + name: "stm32f103-greenblink" + cpp.cLanguageVersion: "c99" + cpp.positionIndependentCode: false + + // + // GCC-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("gcc") + cpp.assemblerFlags: [ + "-mcpu=cortex-m3" + ] + cpp.driverFlags: [ + "-mcpu=cortex-m3", + "-specs=nosys.specs" + ] + } + + Group { + condition: qbs.toolchain.contains("gcc") + name: "GCC" + prefix: "gcc/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.ld"] + } + } + + // + // IAR-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("iar") + cpp.assemblerFlags: [ + "--cpu", "cortex-m3", + "--fpu", "none" + ] + cpp.driverFlags: [ + "--cpu", "cortex-m3", + "--fpu", "none" + ] + } + + Group { + condition: qbs.toolchain.contains("iar") + name: "IAR" + prefix: "iar/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.icf"] + } + } + + // + // KEIL-specific properties and sources. + // + + Properties { + condition: qbs.toolchain.contains("keil") + cpp.assemblerFlags: [ + "--cpu", "cortex-m3" + ] + cpp.driverFlags: [ + "--cpu", "cortex-m3" + ] + } + + Group { + condition: qbs.toolchain.contains("keil") + name: "KEIL" + prefix: "keil/" + Group { + name: "Startup" + fileTags: ["asm"] + files: ["startup.s"] + } + Group { + name: "Linker Script" + fileTags: ["linkerscript"] + files: ["flash.sct"] + } + } + + // + // Common code. + // + + Group { + name: "Gpio" + files: ["gpio.c", "gpio.h"] + } + + Group { + name: "System" + files: ["system.h"] + } + + files: ["main.c"] +} diff --git a/examples/baremetal/stm32f103/greenblink/iar/flash.icf b/examples/baremetal/stm32f103/greenblink/iar/flash.icf new file mode 100644 index 000000000..1b424d29f --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/iar/flash.icf @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +define symbol _start_of_intvec_section = 0x08000000; + +define symbol _start_of_flash_section = 0x08000000; +define symbol _end_of_flash_section = 0x0801FFFF; +define symbol _start_of_ram_section = 0x20000000; +define symbol _end_of_ram_section = 0x20004FFF; + +define symbol _min_stack_size = 0x400; +define symbol _min_heap_size = 0x200; + +define memory mem with size = 4G; +define region flash_section = mem:[from _start_of_flash_section to _end_of_flash_section]; +define region ram_section = mem:[from _start_of_ram_section to _end_of_ram_section]; + +define block CSTACK with alignment = 8, size = _min_stack_size { }; +define block HEAP with alignment = 8, size = _min_heap_size { }; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:_start_of_intvec_section { readonly section .intvec }; + +place in flash_section { readonly }; +place in ram_section { readwrite, block CSTACK, block HEAP }; diff --git a/examples/baremetal/stm32f103/greenblink/iar/startup.s b/examples/baremetal/stm32f103/greenblink/iar/startup.s new file mode 100644 index 000000000..cda2a4e7b --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/iar/startup.s @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + MODULE ?cstartup + + SECTION CSTACK:DATA:NOROOT(3) + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + + PUBLIC _vectors_table + DATA +_vectors_table + ;; Generic interrupts offset. + DCD sfe(CSTACK) ; Initial stack pointer value. + DCD reset_handler ; Reset. + DCD 0 ; NMI. + DCD 0 ; Hard fault. + DCD 0 ; MPU fault. + DCD 0 ; Bus fault. + DCD 0 ; Usage fault. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; SVC. + DCD 0 ; Debug monitor. + DCD 0 ; Reserved. + DCD 0 ; PendSV. + DCD 0 ; SysTick. + ;; External interrupts offset. + DCD 0 ; Window watchdog. + DCD 0 ; PVD through EXTI line detection. + DCD 0 ; Tamper. + DCD 0 ; RTC. + DCD 0 ; Flash. + DCD 0 ; RCC. + DCD 0 ; EXTI line 0. + DCD 0 ; EXTI line 1. + DCD 0 ; EXTI line 2. + DCD 0 ; EXTI line 3. + DCD 0 ; EXTI line 4. + DCD 0 ; DMA1 channel 1. + DCD 0 ; DMA1 channel 2. + DCD 0 ; DMA1 channel 3. + DCD 0 ; DMA1 channel 4. + DCD 0 ; DMA1 channel 5. + DCD 0 ; DMA1 channel 6. + DCD 0 ; DMA1 channel 7. + DCD 0 ; ADC1/2. + DCD 0 ; USB high priority or CAN1 TX. + DCD 0 ; USB low priority or CAN1 RX0. + DCD 0 ; CAN1 RX1. + DCD 0 ; CAN1 SCE. + DCD 0 ; EXTI line 9..5. + DCD 0 ; TIM1 break. + DCD 0 ; TIM1 update. + DCD 0 ; TIM1 trigger and commutation. + DCD 0 ; TIM1 capture compare. + DCD 0 ; TIM2. + DCD 0 ; TIM3. + DCD 0 ; TIM4. + DCD 0 ; I2C1 event. + DCD 0 ; I2C1 error. + DCD 0 ; I2C2 event. + DCD 0 ; I2C2 error. + DCD 0 ; SPI1. + DCD 0 ; SPI2. + DCD 0 ; USART1. + DCD 0 ; USART2. + DCD 0 ; USART3. + DCD 0 ; EXTI line 15..10. + DCD 0 ; RTC alarm through EXTI line. + DCD 0 ; USB wakeup from suspend. + + ;; Reset handler. + THUMB + PUBWEAK reset_handler + SECTION .text:CODE:REORDER:NOROOT(2) +reset_handler + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + END diff --git a/examples/baremetal/stm32f103/greenblink/keil/flash.sct b/examples/baremetal/stm32f103/greenblink/keil/flash.sct new file mode 100644 index 000000000..3547ca2c0 --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/keil/flash.sct @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +;; Load region size_region. +LR_IROM1 0x08000000 0x00010000 { + ;; Load address = execution address. + ER_IROM1 0x08000000 0x00010000 { + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + .ANY (+XO) + } + + ; RW data. + RW_IRAM1 0x20000000 0x00005000 { + .ANY (+RW +ZI) + } +} diff --git a/examples/baremetal/stm32f103/greenblink/keil/startup.s b/examples/baremetal/stm32f103/greenblink/keil/startup.s new file mode 100644 index 000000000..d80de94c6 --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/keil/startup.s @@ -0,0 +1,145 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +;; Contact: https://www.qt.io/licensing/ +;; +;; This file is part of the examples of Qbs. +;; +;; $QT_BEGIN_LICENSE:BSD$ +;; Commercial License Usage +;; Licensees holding valid commercial Qt licenses may use this file in +;; accordance with the commercial license agreement provided with the +;; Software or, alternatively, in accordance with the terms contained in +;; a written agreement between you and The Qt Company. For licensing terms +;; and conditions see https://www.qt.io/terms-conditions. For further +;; information use the contact form at https://www.qt.io/contact-us. +;; +;; BSD License Usage +;; Alternatively, you may use this file under the terms of the BSD license +;; as follows: +;; +;; "Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are +;; met: +;; * Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; * Neither the name of The Qt Company Ltd nor the names of its +;; contributors may be used to endorse or promote products derived +;; from this software without specific prior written permission. +;; +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +;; +;; $QT_END_LICENSE$ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +_size_of_stack EQU 0x400 +_size_of_heap EQU 0x200 + +;; Stack configuration. + AREA STACK, NOINIT, READWRITE, ALIGN=3 +_start_of_stack SPACE _size_of_stack +_end_of_stack + +;; Heap configuration. + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +_start_of_heap SPACE _size_of_heap +_end_of_heap + + PRESERVE8 + THUMB + +;; Define the empty vectors table. + AREA RESET, DATA, READONLY +_vectors_table + ;; Generic interrupts offset. + DCD _end_of_stack ; Initial stack pointer value. + DCD reset_handler ; Reset. + DCD 0 ; NMI. + DCD 0 ; Hard fault. + DCD 0 ; Memory management fault. + DCD 0 ; Bus fault. + DCD 0 ; Usage fault. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; Reserved. + DCD 0 ; SVC. + DCD 0 ; Debug monitor. + DCD 0 ; Reserved. + DCD 0 ; PendSV. + DCD 0 ; SysTick. + ;; External interrupts offset. + DCD 0 ; Window watchdog. + DCD 0 ; PVD through EXTI line detection. + DCD 0 ; Tamper and TimeStamps through the EXTI line. + DCD 0 ; RTC wakeup through the EXTI line. + DCD 0 ; FLASH. + DCD 0 ; RCC. + DCD 0 ; EXTI line0. + DCD 0 ; EXTI line1. + DCD 0 ; EXTI line2. + DCD 0 ; EXTI line3. + DCD 0 ; EXTI line4. + DCD 0 ; DMA1 channel 1. + DCD 0 ; DMA1 channel 2. + DCD 0 ; DMA1 channel 3. + DCD 0 ; DMA1 channel 4. + DCD 0 ; DMA1 channel 5. + DCD 0 ; DMA1 channel 6. + DCD 0 ; DMA1 channel 7. + DCD 0 ; ADC1/2. + DCD 0 ; USB high priority or CAN1 TX. + DCD 0 ; USB low priority or CAN1 RX0. + DCD 0 ; CAN1 RX1. + DCD 0 ; CAN1 SCE. + DCD 0 ; EXTI line 9..5. + DCD 0 ; TIM1 break. + DCD 0 ; TIM1 update. + DCD 0 ; TIM1 trigger and commutation. + DCD 0 ; IM1 capture compare. + DCD 0 ; TIM2. + DCD 0 ; TIM3. + DCD 0 ; TIM4. + DCD 0 ; I2C1 event. + DCD 0 ; I2C1 error. + DCD 0 ; I2C2 event. + DCD 0 ; I2C2 error. + DCD 0 ; SPI1. + DCD 0 ; SPI2. + DCD 0 ; USART1. + DCD 0 ; USART2. + DCD 0 ; USART3. + DCD 0 ; EXTI line 15..10. + DCD 0 ; RTC alarm through EXTI line. + DCD 0 ; USB wakeup from suspend. +_end_of_vectors_table + +_size_of_vectors_table EQU _end_of_vectors_table - _vectors_table + + AREA |.text|, CODE, READONLY +;; Reset handler. +reset_handler PROC + EXPORT reset_handler [WEAK] + IMPORT main + LDR R0, =main + BX R0 + ENDP + ALIGN + + END diff --git a/examples/baremetal/stm32f103/greenblink/main.c b/examples/baremetal/stm32f103/greenblink/main.c new file mode 100644 index 000000000..21bc5badc --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/main.c @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "gpio.h" + +#include <stdint.h> + +static void some_delay(uint32_t counts) +{ + for (uint32_t index = 0u; index < counts; ++index) + __asm("nop"); +} + +int main(void) +{ + gpio_init_green_led(); + + while (1) { + gpio_toggle_green_led(); + some_delay(100000u); + } +} diff --git a/examples/baremetal/stm32f103/greenblink/system.h b/examples/baremetal/stm32f103/greenblink/system.h new file mode 100644 index 000000000..d18854bea --- /dev/null +++ b/examples/baremetal/stm32f103/greenblink/system.h @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SYSTEM_H +#define SYSTEM_H + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define __IO volatile + +// General purpose input/output registers map. +struct gpio_regs_map { + __IO uint32_t CRL; + __IO uint32_t CRH; + __IO uint32_t IDR; + __IO uint32_t ODR; + __IO uint32_t BSRR; + __IO uint32_t BRR; + __IO uint32_t LCKR; +}; + +// Reset and clock control registers map. +struct rcc_regs_map { + __IO uint32_t CR; + __IO uint32_t CFGR; + __IO uint32_t CIR; + __IO uint32_t APB2RSTR; + __IO uint32_t APB1RSTR; + __IO uint32_t AHBENR; + __IO uint32_t APB2ENR; + __IO uint32_t APB1ENR; + __IO uint32_t BDCR; + __IO uint32_t CSR; +}; + +#define PERIPH_ADDRESS (0x40000000u) + +#define APB2PERIPH_ADDRESS (PERIPH_ADDRESS + 0x00010000u) +#define AHBPERIPH_ADDRESS (PERIPH_ADDRESS + 0x00020000u) + +#define GPIOC_REGS_ADDRESS (APB2PERIPH_ADDRESS + 0x00001000u) +#define RCC_REGS_ADDRESS (AHBPERIPH_ADDRESS + 0x00001000u) + +#define GPIOC_REGS_MAP ((struct gpio_regs_map *)GPIOC_REGS_ADDRESS) +#define RCC_REGS_MAP ((struct rcc_regs_map *)RCC_REGS_ADDRESS) + +#ifdef __cplusplus +} +#endif + +#endif // SYSTEM_H diff --git a/examples/baremetal/stm32f103/stm32f103.qbs b/examples/baremetal/stm32f103/stm32f103.qbs new file mode 100644 index 000000000..705502c52 --- /dev/null +++ b/examples/baremetal/stm32f103/stm32f103.qbs @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +Project { + name: "Examples for stm32f103 board" + references: [ + "greenblink/greenblink.qbs" + ] +} diff --git a/examples/baremetal/stm32f4discovery/blueblink/blueblink.qbs b/examples/baremetal/stm32f4discovery/blueblink/blueblink.qbs index 5ccf8b3b0..f2e1dfcc9 100644 --- a/examples/baremetal/stm32f4discovery/blueblink/blueblink.qbs +++ b/examples/baremetal/stm32f4discovery/blueblink/blueblink.qbs @@ -48,15 +48,14 @@ ** ****************************************************************************/ -import qbs - CppApplication { condition: { - if (!qbs.architecture.contains("arm")) + if (!qbs.architecture.startsWith("arm")) return false; - return qbs.toolchain.contains("gcc") - || qbs.toolchain.contains("iar") - || qbs.toolchain.contains("keil") + return (qbs.toolchain.contains("gcc") + || qbs.toolchain.contains("iar") + || qbs.toolchain.contains("keil")) + && !qbs.toolchain.contains("xcode") } name: "stm32f4discovery-blueblink" cpp.cLanguageVersion: "c99" @@ -68,6 +67,11 @@ CppApplication { Properties { condition: qbs.toolchain.contains("gcc") + cpp.assemblerFlags: [ + "-mcpu=cortex-m4", + "-mfloat-abi=hard", + "-mfpu=fpv4-sp-d16", + ] cpp.driverFlags: [ "-mcpu=cortex-m4", "-mfloat-abi=hard", @@ -98,6 +102,10 @@ CppApplication { Properties { condition: qbs.toolchain.contains("iar") + cpp.assemblerFlags: [ + "--cpu", "cortex-m4", + "--fpu", "vfpv4_sp" + ] cpp.driverFlags: [ "--cpu", "cortex-m4", "--fpu", "vfpv4_sp" @@ -126,6 +134,9 @@ CppApplication { Properties { condition: qbs.toolchain.contains("keil") + cpp.assemblerFlags: [ + "--cpu", "cortex-m4.fp" + ] cpp.driverFlags: [ "--cpu", "cortex-m4.fp" ] diff --git a/examples/baremetal/stm32f4discovery/stm32f4discovery.qbs b/examples/baremetal/stm32f4discovery/stm32f4discovery.qbs index a402848ca..cbb3bdc3a 100644 --- a/examples/baremetal/stm32f4discovery/stm32f4discovery.qbs +++ b/examples/baremetal/stm32f4discovery/stm32f4discovery.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - Project { name: "Examples for stm32f4discovery board" references: [ diff --git a/examples/baremetal/stm8s103f3/redblink/redblink.qbs b/examples/baremetal/stm8s103f3/redblink/redblink.qbs index 197bae8ae..c01f323cd 100644 --- a/examples/baremetal/stm8s103f3/redblink/redblink.qbs +++ b/examples/baremetal/stm8s103f3/redblink/redblink.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { condition: { if (!qbs.architecture.contains("stm8")) diff --git a/examples/baremetal/stm8s103f3/stm8s103f3.qbs b/examples/baremetal/stm8s103f3/stm8s103f3.qbs index 922c4c1f0..cfbfc87a8 100644 --- a/examples/baremetal/stm8s103f3/stm8s103f3.qbs +++ b/examples/baremetal/stm8s103f3/stm8s103f3.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - Project { name: "Examples for stm8s103f3 board" references: [ diff --git a/examples/capnproto/addressbook_cpp/addressbook.capnp b/examples/capnproto/addressbook_cpp/addressbook.capnp new file mode 100644 index 000000000..1a6c60937 --- /dev/null +++ b/examples/capnproto/addressbook_cpp/addressbook.capnp @@ -0,0 +1,55 @@ +# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +# Licensed under the MIT License: +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +@0x9eb32e19f86ee174; + +using Cxx = import "/capnp/c++.capnp"; +$Cxx.namespace("addressbook"); + +struct Person { + id @0 :UInt32; + name @1 :Text; + email @2 :Text; + phones @3 :List(PhoneNumber); + + struct PhoneNumber { + number @0 :Text; + type @1 :Type; + + enum Type { + mobile @0; + home @1; + work @2; + } + } + + employment :union { + unemployed @4 :Void; + employer @5 :Text; + school @6 :Text; + selfEmployed @7 :Void; + # We assume that a person is only one of these. + } +} + +struct AddressBook { + people @0 :List(Person); +} diff --git a/examples/capnproto/addressbook_cpp/addressbook.cpp b/examples/capnproto/addressbook_cpp/addressbook.cpp new file mode 100644 index 000000000..b2bece947 --- /dev/null +++ b/examples/capnproto/addressbook_cpp/addressbook.cpp @@ -0,0 +1,288 @@ +// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// This sample code appears in the documentation for the C++ implementation. +// +// If Cap'n Proto is installed, build the sample like: +// capnp compile -oc++ addressbook.capnp +// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ `pkg-config --cflags --libs capnp` -o addressbook +// +// If Cap'n Proto is not installed, but the source is located at $SRC and has been +// compiled in $BUILD (often both are simply ".." from here), you can do: +// $BUILD/capnp compile -I$SRC/src -o$BUILD/capnpc-c++ addressbook.capnp +// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ -I$SRC/src -L$BUILD/.libs -lcapnp -lkj -o addressbook +// +// Run like: +// ./addressbook write | ./addressbook read +// Use "dwrite" and "dread" to use dynamic code instead. + +// TODO(test): Needs cleanup. + +#include "addressbook.capnp.h" +#include <capnp/message.h> +#include <capnp/serialize-packed.h> +#include <iostream> + +using addressbook::Person; +using addressbook::AddressBook; + +void writeAddressBook(int fd) { + ::capnp::MallocMessageBuilder message; + + AddressBook::Builder addressBook = message.initRoot<AddressBook>(); + ::capnp::List<Person>::Builder people = addressBook.initPeople(2); + + Person::Builder alice = people[0]; + alice.setId(123); + alice.setName("Alice"); + alice.setEmail("alice@example.com"); + // Type shown for explanation purposes; normally you'd use auto. + ::capnp::List<Person::PhoneNumber>::Builder alicePhones = + alice.initPhones(1); + alicePhones[0].setNumber("555-1212"); + alicePhones[0].setType(Person::PhoneNumber::Type::MOBILE); + alice.getEmployment().setSchool("MIT"); + + Person::Builder bob = people[1]; + bob.setId(456); + bob.setName("Bob"); + bob.setEmail("bob@example.com"); + auto bobPhones = bob.initPhones(2); + bobPhones[0].setNumber("555-4567"); + bobPhones[0].setType(Person::PhoneNumber::Type::HOME); + bobPhones[1].setNumber("555-7654"); + bobPhones[1].setType(Person::PhoneNumber::Type::WORK); + bob.getEmployment().setUnemployed(); + + writePackedMessageToFd(fd, message); +} + +void printAddressBook(int fd) { + ::capnp::PackedFdMessageReader message(fd); + + AddressBook::Reader addressBook = message.getRoot<AddressBook>(); + + for (Person::Reader person : addressBook.getPeople()) { + std::cout << person.getName().cStr() << ": " + << person.getEmail().cStr() << std::endl; + for (Person::PhoneNumber::Reader phone: person.getPhones()) { + const char* typeName = "UNKNOWN"; + switch (phone.getType()) { + case Person::PhoneNumber::Type::MOBILE: typeName = "mobile"; break; + case Person::PhoneNumber::Type::HOME: typeName = "home"; break; + case Person::PhoneNumber::Type::WORK: typeName = "work"; break; + } + std::cout << " " << typeName << " phone: " + << phone.getNumber().cStr() << std::endl; + } + Person::Employment::Reader employment = person.getEmployment(); + switch (employment.which()) { + case Person::Employment::UNEMPLOYED: + std::cout << " unemployed" << std::endl; + break; + case Person::Employment::EMPLOYER: + std::cout << " employer: " + << employment.getEmployer().cStr() << std::endl; + break; + case Person::Employment::SCHOOL: + std::cout << " student at: " + << employment.getSchool().cStr() << std::endl; + break; + case Person::Employment::SELF_EMPLOYED: + std::cout << " self-employed" << std::endl; + break; + } + } +} + +#if !CAPNP_LITE + +#include "addressbook.capnp.h" +#include <capnp/message.h> +#include <capnp/serialize-packed.h> +#include <iostream> +#include <capnp/schema.h> +#include <capnp/dynamic.h> + +using ::capnp::DynamicValue; +using ::capnp::DynamicStruct; +using ::capnp::DynamicEnum; +using ::capnp::DynamicList; +using ::capnp::List; +using ::capnp::Schema; +using ::capnp::StructSchema; +using ::capnp::EnumSchema; + +using ::capnp::Void; +using ::capnp::Text; +using ::capnp::MallocMessageBuilder; +using ::capnp::PackedFdMessageReader; + +void dynamicWriteAddressBook(int fd, StructSchema schema) { + // Write a message using the dynamic API to set each + // field by text name. This isn't something you'd + // normally want to do; it's just for illustration. + + MallocMessageBuilder message; + + // Types shown for explanation purposes; normally you'd + // use auto. + DynamicStruct::Builder addressBook = + message.initRoot<DynamicStruct>(schema); + + DynamicList::Builder people = + addressBook.init("people", 2).as<DynamicList>(); + + DynamicStruct::Builder alice = + people[0].as<DynamicStruct>(); + alice.set("id", 123); + alice.set("name", "Alice"); + alice.set("email", "alice@example.com"); + auto alicePhones = alice.init("phones", 1).as<DynamicList>(); + auto phone0 = alicePhones[0].as<DynamicStruct>(); + phone0.set("number", "555-1212"); + phone0.set("type", "mobile"); + alice.get("employment").as<DynamicStruct>() + .set("school", "MIT"); + + auto bob = people[1].as<DynamicStruct>(); + bob.set("id", 456); + bob.set("name", "Bob"); + bob.set("email", "bob@example.com"); + + // Some magic: We can convert a dynamic sub-value back to + // the native type with as<T>()! + List<Person::PhoneNumber>::Builder bobPhones = + bob.init("phones", 2).as<List<Person::PhoneNumber>>(); + bobPhones[0].setNumber("555-4567"); + bobPhones[0].setType(Person::PhoneNumber::Type::HOME); + bobPhones[1].setNumber("555-7654"); + bobPhones[1].setType(Person::PhoneNumber::Type::WORK); + bob.get("employment").as<DynamicStruct>() + .set("unemployed", ::capnp::VOID); + + writePackedMessageToFd(fd, message); +} + +void dynamicPrintValue(DynamicValue::Reader value) { + // Print an arbitrary message via the dynamic API by + // iterating over the schema. Look at the handling + // of STRUCT in particular. + + switch (value.getType()) { + case DynamicValue::VOID: + std::cout << ""; + break; + case DynamicValue::BOOL: + std::cout << (value.as<bool>() ? "true" : "false"); + break; + case DynamicValue::INT: + std::cout << value.as<int64_t>(); + break; + case DynamicValue::UINT: + std::cout << value.as<uint64_t>(); + break; + case DynamicValue::FLOAT: + std::cout << value.as<double>(); + break; + case DynamicValue::TEXT: + std::cout << '\"' << value.as<Text>().cStr() << '\"'; + break; + case DynamicValue::LIST: { + std::cout << "["; + bool first = true; + for (auto element: value.as<DynamicList>()) { + if (first) { + first = false; + } else { + std::cout << ", "; + } + dynamicPrintValue(element); + } + std::cout << "]"; + break; + } + case DynamicValue::ENUM: { + auto enumValue = value.as<DynamicEnum>(); + KJ_IF_MAYBE(enumerant, enumValue.getEnumerant()) { + std::cout << + enumerant->getProto().getName().cStr(); + } else { + // Unknown enum value; output raw number. + std::cout << enumValue.getRaw(); + } + break; + } + case DynamicValue::STRUCT: { + std::cout << "("; + auto structValue = value.as<DynamicStruct>(); + bool first = true; + for (auto field: structValue.getSchema().getFields()) { + if (!structValue.has(field)) continue; + if (first) { + first = false; + } else { + std::cout << ", "; + } + std::cout << field.getProto().getName().cStr() + << " = "; + dynamicPrintValue(structValue.get(field)); + } + std::cout << ")"; + break; + } + default: + // There are other types, we aren't handling them. + std::cout << "?"; + break; + } +} + +void dynamicPrintMessage(int fd, StructSchema schema) { + PackedFdMessageReader message(fd); + dynamicPrintValue(message.getRoot<DynamicStruct>(schema)); + std::cout << std::endl; +} + +#endif // !CAPNP_LITE + +int main(int argc, char* argv[]) { + if (argc != 2) { + std::cerr << "Missing arg." << std::endl; + return 1; + } else if (strcmp(argv[1], "write") == 0) { + writeAddressBook(1); + } else if (strcmp(argv[1], "read") == 0) { + printAddressBook(0); +#if !CAPNP_LITE + } else if (strcmp(argv[1], "dwrite") == 0) { + StructSchema schema = Schema::from<AddressBook>(); + dynamicWriteAddressBook(1, schema); + } else if (strcmp(argv[1], "dread") == 0) { + StructSchema schema = Schema::from<AddressBook>(); + dynamicPrintMessage(0, schema); +#endif + } else { + std::cerr << "Invalid arg: " << argv[1] << std::endl; + return 1; + } + return 0; +} diff --git a/examples/capnproto/addressbook_cpp/addressbook_cpp.qbs b/examples/capnproto/addressbook_cpp/addressbook_cpp.qbs new file mode 100644 index 000000000..33f78d5a5 --- /dev/null +++ b/examples/capnproto/addressbook_cpp/addressbook_cpp.qbs @@ -0,0 +1,11 @@ +CppApplication { + Depends { name: "capnproto.cpp"; required: false } + condition: capnproto.cpp.present && qbs.targetPlatform === qbs.hostPlatform + consoleApplication: true + cpp.minimumMacosVersion: "10.8" + + files: [ + "addressbook.capnp", + "addressbook.cpp" + ] +} diff --git a/examples/capnproto/calculator_cpp/calculator-client.cpp b/examples/capnproto/calculator_cpp/calculator-client.cpp new file mode 100644 index 000000000..5d8452921 --- /dev/null +++ b/examples/capnproto/calculator_cpp/calculator-client.cpp @@ -0,0 +1,367 @@ +// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include "calculator.capnp.h" +#include <capnp/ez-rpc.h> +#include <kj/debug.h> +#include <math.h> +#include <iostream> + +class PowerFunction final: public Calculator::Function::Server { + // An implementation of the Function interface wrapping pow(). Note that + // we're implementing this on the client side and will pass a reference to + // the server. The server will then be able to make calls back to the client. + +public: + kj::Promise<void> call(CallContext context) { + auto params = context.getParams().getParams(); + KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); + context.getResults().setValue(pow(params[0], params[1])); + return kj::READY_NOW; + } +}; + +int main(int argc, const char* argv[]) { + if (argc != 2) { + std::cerr << "usage: " << argv[0] << " HOST:PORT\n" + "Connects to the Calculator server at the given address and " + "does some RPCs." << std::endl; + return 1; + } + + capnp::EzRpcClient client(argv[1]); + Calculator::Client calculator = client.getMain<Calculator>(); + + // Keep an eye on `waitScope`. Whenever you see it used is a place where we + // stop and wait for the server to respond. If a line of code does not use + // `waitScope`, then it does not block! + auto& waitScope = client.getWaitScope(); + + { + // Make a request that just evaluates the literal value 123. + // + // What's interesting here is that evaluate() returns a "Value", which is + // another interface and therefore points back to an object living on the + // server. We then have to call read() on that object to read it. + // However, even though we are making two RPC's, this block executes in + // *one* network round trip because of promise pipelining: we do not wait + // for the first call to complete before we send the second call to the + // server. + + std::cout << "Evaluating a literal... "; + std::cout.flush(); + + // Set up the request. + auto request = calculator.evaluateRequest(); + request.getExpression().setLiteral(123); + + // Send it, which returns a promise for the result (without blocking). + auto evalPromise = request.send(); + + // Using the promise, create a pipelined request to call read() on the + // returned object, and then send that. + auto readPromise = evalPromise.getValue().readRequest().send(); + + // Now that we've sent all the requests, wait for the response. Until this + // point, we haven't waited at all! + auto response = readPromise.wait(waitScope); + KJ_ASSERT(response.getValue() == 123); + + std::cout << "PASS" << std::endl; + } + + { + // Make a request to evaluate 123 + 45 - 67. + // + // The Calculator interface requires that we first call getOperator() to + // get the addition and subtraction functions, then call evaluate() to use + // them. But, once again, we can get both functions, call evaluate(), and + // then read() the result -- four RPCs -- in the time of *one* network + // round trip, because of promise pipelining. + + std::cout << "Using add and subtract... "; + std::cout.flush(); + + Calculator::Function::Client add = nullptr; + Calculator::Function::Client subtract = nullptr; + + { + // Get the "add" function from the server. + auto request = calculator.getOperatorRequest(); + request.setOp(Calculator::Operator::ADD); + add = request.send().getFunc(); + } + + { + // Get the "subtract" function from the server. + auto request = calculator.getOperatorRequest(); + request.setOp(Calculator::Operator::SUBTRACT); + subtract = request.send().getFunc(); + } + + // Build the request to evaluate 123 + 45 - 67. + auto request = calculator.evaluateRequest(); + + auto subtractCall = request.getExpression().initCall(); + subtractCall.setFunction(subtract); + auto subtractParams = subtractCall.initParams(2); + subtractParams[1].setLiteral(67); + + auto addCall = subtractParams[0].initCall(); + addCall.setFunction(add); + auto addParams = addCall.initParams(2); + addParams[0].setLiteral(123); + addParams[1].setLiteral(45); + + // Send the evaluate() request, read() the result, and wait for read() to + // finish. + auto evalPromise = request.send(); + auto readPromise = evalPromise.getValue().readRequest().send(); + + auto response = readPromise.wait(waitScope); + KJ_ASSERT(response.getValue() == 101); + + std::cout << "PASS" << std::endl; + } + + { + // Make a request to evaluate 4 * 6, then use the result in two more + // requests that add 3 and 5. + // + // Since evaluate() returns its result wrapped in a `Value`, we can pass + // that `Value` back to the server in subsequent requests before the first + // `evaluate()` has actually returned. Thus, this example again does only + // one network round trip. + + std::cout << "Pipelining eval() calls... "; + std::cout.flush(); + + Calculator::Function::Client add = nullptr; + Calculator::Function::Client multiply = nullptr; + + { + // Get the "add" function from the server. + auto request = calculator.getOperatorRequest(); + request.setOp(Calculator::Operator::ADD); + add = request.send().getFunc(); + } + + { + // Get the "multiply" function from the server. + auto request = calculator.getOperatorRequest(); + request.setOp(Calculator::Operator::MULTIPLY); + multiply = request.send().getFunc(); + } + + // Build the request to evaluate 4 * 6 + auto request = calculator.evaluateRequest(); + + auto multiplyCall = request.getExpression().initCall(); + multiplyCall.setFunction(multiply); + auto multiplyParams = multiplyCall.initParams(2); + multiplyParams[0].setLiteral(4); + multiplyParams[1].setLiteral(6); + + auto multiplyResult = request.send().getValue(); + + // Use the result in two calls that add 3 and add 5. + + auto add3Request = calculator.evaluateRequest(); + auto add3Call = add3Request.getExpression().initCall(); + add3Call.setFunction(add); + auto add3Params = add3Call.initParams(2); + add3Params[0].setPreviousResult(multiplyResult); + add3Params[1].setLiteral(3); + auto add3Promise = add3Request.send().getValue().readRequest().send(); + + auto add5Request = calculator.evaluateRequest(); + auto add5Call = add5Request.getExpression().initCall(); + add5Call.setFunction(add); + auto add5Params = add5Call.initParams(2); + add5Params[0].setPreviousResult(multiplyResult); + add5Params[1].setLiteral(5); + auto add5Promise = add5Request.send().getValue().readRequest().send(); + + // Now wait for the results. + KJ_ASSERT(add3Promise.wait(waitScope).getValue() == 27); + KJ_ASSERT(add5Promise.wait(waitScope).getValue() == 29); + + std::cout << "PASS" << std::endl; + } + + { + // Our calculator interface supports defining functions. Here we use it + // to define two functions and then make calls to them as follows: + // + // f(x, y) = x * 100 + y + // g(x) = f(x, x + 1) * 2; + // f(12, 34) + // g(21) + // + // Once again, the whole thing takes only one network round trip. + + std::cout << "Defining functions... "; + std::cout.flush(); + + Calculator::Function::Client add = nullptr; + Calculator::Function::Client multiply = nullptr; + Calculator::Function::Client f = nullptr; + Calculator::Function::Client g = nullptr; + + { + // Get the "add" function from the server. + auto request = calculator.getOperatorRequest(); + request.setOp(Calculator::Operator::ADD); + add = request.send().getFunc(); + } + + { + // Get the "multiply" function from the server. + auto request = calculator.getOperatorRequest(); + request.setOp(Calculator::Operator::MULTIPLY); + multiply = request.send().getFunc(); + } + + { + // Define f. + auto request = calculator.defFunctionRequest(); + request.setParamCount(2); + + { + // Build the function body. + auto addCall = request.getBody().initCall(); + addCall.setFunction(add); + auto addParams = addCall.initParams(2); + addParams[1].setParameter(1); // y + + auto multiplyCall = addParams[0].initCall(); + multiplyCall.setFunction(multiply); + auto multiplyParams = multiplyCall.initParams(2); + multiplyParams[0].setParameter(0); // x + multiplyParams[1].setLiteral(100); + } + + f = request.send().getFunc(); + } + + { + // Define g. + auto request = calculator.defFunctionRequest(); + request.setParamCount(1); + + { + // Build the function body. + auto multiplyCall = request.getBody().initCall(); + multiplyCall.setFunction(multiply); + auto multiplyParams = multiplyCall.initParams(2); + multiplyParams[1].setLiteral(2); + + auto fCall = multiplyParams[0].initCall(); + fCall.setFunction(f); + auto fParams = fCall.initParams(2); + fParams[0].setParameter(0); + + auto addCall = fParams[1].initCall(); + addCall.setFunction(add); + auto addParams = addCall.initParams(2); + addParams[0].setParameter(0); + addParams[1].setLiteral(1); + } + + g = request.send().getFunc(); + } + + // OK, we've defined all our functions. Now create our eval requests. + + // f(12, 34) + auto fEvalRequest = calculator.evaluateRequest(); + auto fCall = fEvalRequest.initExpression().initCall(); + fCall.setFunction(f); + auto fParams = fCall.initParams(2); + fParams[0].setLiteral(12); + fParams[1].setLiteral(34); + auto fEvalPromise = fEvalRequest.send().getValue().readRequest().send(); + + // g(21) + auto gEvalRequest = calculator.evaluateRequest(); + auto gCall = gEvalRequest.initExpression().initCall(); + gCall.setFunction(g); + gCall.initParams(1)[0].setLiteral(21); + auto gEvalPromise = gEvalRequest.send().getValue().readRequest().send(); + + // Wait for the results. + KJ_ASSERT(fEvalPromise.wait(waitScope).getValue() == 1234); + KJ_ASSERT(gEvalPromise.wait(waitScope).getValue() == 4244); + + std::cout << "PASS" << std::endl; + } + + { + // Make a request that will call back to a function defined locally. + // + // Specifically, we will compute 2^(4 + 5). However, exponent is not + // defined by the Calculator server. So, we'll implement the Function + // interface locally and pass it to the server for it to use when + // evaluating the expression. + // + // This example requires two network round trips to complete, because the + // server calls back to the client once before finishing. In this + // particular case, this could potentially be optimized by using a tail + // call on the server side -- see CallContext::tailCall(). However, to + // keep the example simpler, we haven't implemented this optimization in + // the sample server. + + std::cout << "Using a callback... "; + std::cout.flush(); + + Calculator::Function::Client add = nullptr; + + { + // Get the "add" function from the server. + auto request = calculator.getOperatorRequest(); + request.setOp(Calculator::Operator::ADD); + add = request.send().getFunc(); + } + + // Build the eval request for 2^(4+5). + auto request = calculator.evaluateRequest(); + + auto powCall = request.getExpression().initCall(); + powCall.setFunction(kj::heap<PowerFunction>()); + auto powParams = powCall.initParams(2); + powParams[0].setLiteral(2); + + auto addCall = powParams[1].initCall(); + addCall.setFunction(add); + auto addParams = addCall.initParams(2); + addParams[0].setLiteral(4); + addParams[1].setLiteral(5); + + // Send the request and wait. + auto response = request.send().getValue().readRequest() + .send().wait(waitScope); + KJ_ASSERT(response.getValue() == 512); + + std::cout << "PASS" << std::endl; + } + + return 0; +} diff --git a/examples/capnproto/calculator_cpp/calculator-server.cpp b/examples/capnproto/calculator_cpp/calculator-server.cpp new file mode 100644 index 000000000..c2593be3a --- /dev/null +++ b/examples/capnproto/calculator_cpp/calculator-server.cpp @@ -0,0 +1,215 @@ +// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include "calculator.capnp.h" +#include <kj/debug.h> +#include <capnp/ez-rpc.h> +#include <capnp/message.h> +#include <iostream> + +typedef unsigned int uint; + +kj::Promise<double> readValue(Calculator::Value::Client value) { + // Helper function to asynchronously call read() on a Calculator::Value and + // return a promise for the result. (In the future, the generated code might + // include something like this automatically.) + + return value.readRequest().send() + .then([](capnp::Response<Calculator::Value::ReadResults> result) { + return result.getValue(); + }); +} + +kj::Promise<double> evaluateImpl( + Calculator::Expression::Reader expression, + capnp::List<double>::Reader params = capnp::List<double>::Reader()) { + // Implementation of CalculatorImpl::evaluate(), also shared by + // FunctionImpl::call(). In the latter case, `params` are the parameter + // values passed to the function; in the former case, `params` is just an + // empty list. + + switch (expression.which()) { + case Calculator::Expression::LITERAL: + return expression.getLiteral(); + + case Calculator::Expression::PREVIOUS_RESULT: + return readValue(expression.getPreviousResult()); + + case Calculator::Expression::PARAMETER: { + KJ_REQUIRE(expression.getParameter() < params.size(), + "Parameter index out-of-range."); + return params[expression.getParameter()]; + } + + case Calculator::Expression::CALL: { + auto call = expression.getCall(); + auto func = call.getFunction(); + + // Evaluate each parameter. + kj::Array<kj::Promise<double>> paramPromises = + KJ_MAP(param, call.getParams()) { + return evaluateImpl(param, params); + }; + + // Join the array of promises into a promise for an array. + kj::Promise<kj::Array<double>> joinedParams = + kj::joinPromises(kj::mv(paramPromises)); + + // When the parameters are complete, call the function. + return joinedParams.then([KJ_CPCAP(func)](kj::Array<double>&& paramValues) mutable { + auto request = func.callRequest(); + request.setParams(paramValues); + return request.send().then( + [](capnp::Response<Calculator::Function::CallResults>&& result) { + return result.getValue(); + }); + }); + } + + default: + // Throw an exception. + KJ_FAIL_REQUIRE("Unknown expression type."); + } +} + +class ValueImpl final: public Calculator::Value::Server { + // Simple implementation of the Calculator.Value Cap'n Proto interface. + +public: + ValueImpl(double value): value(value) {} + + kj::Promise<void> read(ReadContext context) { + context.getResults().setValue(value); + return kj::READY_NOW; + } + +private: + double value; +}; + +class FunctionImpl final: public Calculator::Function::Server { + // Implementation of the Calculator.Function Cap'n Proto interface, where the + // function is defined by a Calculator.Expression. + +public: + FunctionImpl(uint paramCount, Calculator::Expression::Reader body) + : paramCount(paramCount) { + this->body.setRoot(body); + } + + kj::Promise<void> call(CallContext context) { + auto params = context.getParams().getParams(); + KJ_REQUIRE(params.size() == paramCount, "Wrong number of parameters."); + + return evaluateImpl(body.getRoot<Calculator::Expression>(), params) + .then([KJ_CPCAP(context)](double value) mutable { + context.getResults().setValue(value); + }); + } + +private: + uint paramCount; + // The function's arity. + + capnp::MallocMessageBuilder body; + // Stores a permanent copy of the function body. +}; + +class OperatorImpl final: public Calculator::Function::Server { + // Implementation of the Calculator.Function Cap'n Proto interface, wrapping + // basic binary arithmetic operators. + +public: + OperatorImpl(Calculator::Operator op): op(op) {} + + kj::Promise<void> call(CallContext context) { + auto params = context.getParams().getParams(); + KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); + + double result; + switch (op) { + case Calculator::Operator::ADD: result = params[0] + params[1]; break; + case Calculator::Operator::SUBTRACT:result = params[0] - params[1]; break; + case Calculator::Operator::MULTIPLY:result = params[0] * params[1]; break; + case Calculator::Operator::DIVIDE: result = params[0] / params[1]; break; + default: + KJ_FAIL_REQUIRE("Unknown operator."); + } + + context.getResults().setValue(result); + return kj::READY_NOW; + } + +private: + Calculator::Operator op; +}; + +class CalculatorImpl final: public Calculator::Server { + // Implementation of the Calculator Cap'n Proto interface. + +public: + kj::Promise<void> evaluate(EvaluateContext context) override { + return evaluateImpl(context.getParams().getExpression()) + .then([KJ_CPCAP(context)](double value) mutable { + context.getResults().setValue(kj::heap<ValueImpl>(value)); + }); + } + + kj::Promise<void> defFunction(DefFunctionContext context) override { + auto params = context.getParams(); + context.getResults().setFunc(kj::heap<FunctionImpl>( + params.getParamCount(), params.getBody())); + return kj::READY_NOW; + } + + kj::Promise<void> getOperator(GetOperatorContext context) override { + context.getResults().setFunc(kj::heap<OperatorImpl>( + context.getParams().getOp())); + return kj::READY_NOW; + } +}; + +int main(int argc, const char* argv[]) { + if (argc != 2) { + std::cerr << "usage: " << argv[0] << " ADDRESS[:PORT]\n" + "Runs the server bound to the given address/port.\n" + "ADDRESS may be '*' to bind to all local addresses.\n" + ":PORT may be omitted to choose a port automatically." << std::endl; + return 1; + } + + // Set up a server. + capnp::EzRpcServer server(kj::heap<CalculatorImpl>(), argv[1]); + + // Write the port number to stdout, in case it was chosen automatically. + auto& waitScope = server.getWaitScope(); + uint port = server.getPort().wait(waitScope); + if (port == 0) { + // The address format "unix:/path/to/socket" opens a unix domain socket, + // in which case the port will be zero. + std::cout << "Listening on Unix socket..." << std::endl; + } else { + std::cout << "Listening on port " << port << "..." << std::endl; + } + + // Run forever, accepting connections and handling requests. + kj::NEVER_DONE.wait(waitScope); +} diff --git a/examples/capnproto/calculator_cpp/calculator.capnp b/examples/capnproto/calculator_cpp/calculator.capnp new file mode 100644 index 000000000..adc8294e5 --- /dev/null +++ b/examples/capnproto/calculator_cpp/calculator.capnp @@ -0,0 +1,118 @@ +# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +# Licensed under the MIT License: +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +@0x85150b117366d14b; + +interface Calculator { + # A "simple" mathematical calculator, callable via RPC. + # + # But, to show off Cap'n Proto, we add some twists: + # + # - You can use the result from one call as the input to the next + # without a network round trip. To accomplish this, evaluate() + # returns a `Value` object wrapping the actual numeric value. + # This object may be used in a subsequent expression. With + # promise pipelining, the Value can actually be used before + # the evaluate() call that creates it returns! + # + # - You can define new functions, and then call them. This again + # shows off pipelining, but it also gives the client the + # opportunity to define a function on the client side and have + # the server call back to it. + # + # - The basic arithmetic operators are exposed as Functions, and + # you have to call getOperator() to obtain them from the server. + # This again demonstrates pipelining -- using getOperator() to + # get each operator and then using them in evaluate() still + # only takes one network round trip. + + evaluate @0 (expression :Expression) -> (value :Value); + # Evaluate the given expression and return the result. The + # result is returned wrapped in a Value interface so that you + # may pass it back to the server in a pipelined request. To + # actually get the numeric value, you must call read() on the + # Value -- but again, this can be pipelined so that it incurs + # no additional latency. + + struct Expression { + # A numeric expression. + + union { + literal @0 :Float64; + # A literal numeric value. + + previousResult @1 :Value; + # A value that was (or, will be) returned by a previous + # evaluate(). + + parameter @2 :UInt32; + # A parameter to the function (only valid in function bodies; + # see defFunction). + + call :group { + # Call a function on a list of parameters. + function @3 :Function; + params @4 :List(Expression); + } + } + } + + interface Value { + # Wraps a numeric value in an RPC object. This allows the value + # to be used in subsequent evaluate() requests without the client + # waiting for the evaluate() that returns the Value to finish. + + read @0 () -> (value :Float64); + # Read back the raw numeric value. + } + + defFunction @1 (paramCount :Int32, body :Expression) + -> (func :Function); + # Define a function that takes `paramCount` parameters and returns the + # evaluation of `body` after substituting these parameters. + + interface Function { + # An algebraic function. Can be called directly, or can be used inside + # an Expression. + # + # A client can create a Function that runs on the server side using + # `defFunction()` or `getOperator()`. Alternatively, a client can + # implement a Function on the client side and the server will call back + # to it. However, a function defined on the client side will require a + # network round trip whenever the server needs to call it, whereas + # functions defined on the server and then passed back to it are called + # locally. + + call @0 (params :List(Float64)) -> (value :Float64); + # Call the function on the given parameters. + } + + getOperator @2 (op :Operator) -> (func :Function); + # Get a Function representing an arithmetic operator, which can then be + # used in Expressions. + + enum Operator { + add @0; + subtract @1; + multiply @2; + divide @3; + } +} diff --git a/examples/capnproto/calculator_cpp/calculator_cpp.qbs b/examples/capnproto/calculator_cpp/calculator_cpp.qbs new file mode 100644 index 000000000..a884117b2 --- /dev/null +++ b/examples/capnproto/calculator_cpp/calculator_cpp.qbs @@ -0,0 +1,28 @@ +import qbs.Host + +Project { + CppApplication { + Depends { name: "capnproto.cpp"; required: false } + name: "server" + condition: capnproto.cpp.present && qbs.targetPlatform === Host.platform() + consoleApplication: true + capnproto.cpp.useRpc: true + + files: [ + "calculator.capnp", + "calculator-server.cpp" + ] + } + CppApplication { + Depends { name: "capnproto.cpp"; required: false } + name: "client" + condition: capnproto.cpp.present && qbs.targetPlatform === Host.platform() + consoleApplication: true + capnproto.cpp.useRpc: true + + files: [ + "calculator.capnp", + "calculator-client.cpp" + ] + } +} diff --git a/examples/cocoa-application/CocoaApplication/en_US.lproj b/examples/cocoa-application/CocoaApplication/en_US.lproj deleted file mode 120000 index 545e7ac76..000000000 --- a/examples/cocoa-application/CocoaApplication/en_US.lproj +++ /dev/null @@ -1 +0,0 @@ -en.lproj
\ No newline at end of file diff --git a/examples/cocoa-application/CocoaApplication/en_US.lproj/Credits.rtf b/examples/cocoa-application/CocoaApplication/en_US.lproj/Credits.rtf new file mode 100644 index 000000000..9caf316e0 --- /dev/null +++ b/examples/cocoa-application/CocoaApplication/en_US.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/examples/cocoa-application/CocoaApplication/en_US.lproj/InfoPlist.strings b/examples/cocoa-application/CocoaApplication/en_US.lproj/InfoPlist.strings new file mode 100644 index 000000000..b92732c79 --- /dev/null +++ b/examples/cocoa-application/CocoaApplication/en_US.lproj/InfoPlist.strings @@ -0,0 +1 @@ +/* Localized versions of Info.plist keys */ diff --git a/examples/cocoa-application/CocoaApplication/en_US.lproj/LICENSE b/examples/cocoa-application/CocoaApplication/en_US.lproj/LICENSE new file mode 100644 index 000000000..44650fe73 --- /dev/null +++ b/examples/cocoa-application/CocoaApplication/en_US.lproj/LICENSE @@ -0,0 +1,27 @@ +Copyright (C) 2017 The Qt Company Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of The Qt Company Ltd and its Subsidiary(-ies) nor the names + of its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/examples/cocoa-application/CocoaApplication/en_US.lproj/MainMenu.xib b/examples/cocoa-application/CocoaApplication/en_US.lproj/MainMenu.xib new file mode 100644 index 000000000..faedd4637 --- /dev/null +++ b/examples/cocoa-application/CocoaApplication/en_US.lproj/MainMenu.xib @@ -0,0 +1,4666 @@ +<?xml version="1.0" encoding="UTF-8"?> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00"> + <data> + <int key="IBDocument.SystemTarget">1080</int> + <string key="IBDocument.SystemVersion">11D50</string> + <string key="IBDocument.InterfaceBuilderVersion">2457</string> + <string key="IBDocument.AppKitVersion">1138.32</string> + <string key="IBDocument.HIToolboxVersion">568.00</string> + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="NS.object.0">2457</string> + </object> + <array key="IBDocument.IntegratedClassDependencies"> + <string>NSWindowTemplate</string> + <string>NSView</string> + <string>NSMenu</string> + <string>NSMenuItem</string> + <string>NSCustomObject</string> + </array> + <array key="IBDocument.PluginDependencies"> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + </array> + <object class="NSMutableDictionary" key="IBDocument.Metadata"> + <string key="NS.key.0">PluginDependencyRecalculationVersion</string> + <integer value="1" key="NS.object.0"/> + </object> + <array class="NSMutableArray" key="IBDocument.RootObjects" id="1048"> + <object class="NSCustomObject" id="1021"> + <string key="NSClassName">NSApplication</string> + </object> + <object class="NSCustomObject" id="1014"> + <string key="NSClassName">FirstResponder</string> + </object> + <object class="NSCustomObject" id="1050"> + <string key="NSClassName">NSApplication</string> + </object> + <object class="NSMenu" id="649796088"> + <string key="NSTitle">AMainMenu</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="694149608"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">CocoaApplication</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <object class="NSCustomResource" key="NSOnImage" id="35465992"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuCheckmark</string> + </object> + <object class="NSCustomResource" key="NSMixedImage" id="502551668"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuMixedState</string> + </object> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="110575045"> + <string key="NSTitle">CocoaApplication</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="238522557"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">About CocoaApplication</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="304266470"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="609285721"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Preferences…</string> + <string key="NSKeyEquiv">,</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="481834944"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1046388886"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Services</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="752062318"> + <string key="NSTitle">Services</string> + <array class="NSMutableArray" key="NSMenuItems"/> + <string key="NSName">_NSServicesMenu</string> + </object> + </object> + <object class="NSMenuItem" id="646227648"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="755159360"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Hide CocoaApplication</string> + <string key="NSKeyEquiv">h</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="342932134"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Hide Others</string> + <string key="NSKeyEquiv">h</string> + <int key="NSKeyEquivModMask">1572864</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="908899353"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Show All</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1056857174"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="632727374"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Quit CocoaApplication</string> + <string key="NSKeyEquiv">q</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + <string key="NSName">_NSAppleMenu</string> + </object> + </object> + <object class="NSMenuItem" id="379814623"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">File</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="720053764"> + <string key="NSTitle">File</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="705341025"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">New</string> + <string key="NSKeyEquiv">n</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="722745758"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">Open…</string> + <string key="NSKeyEquiv">o</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1025936716"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">Open Recent</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="1065607017"> + <string key="NSTitle">Open Recent</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="759406840"> + <reference key="NSMenu" ref="1065607017"/> + <string key="NSTitle">Clear Menu</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + <string key="NSName">_NSRecentDocumentsMenu</string> + </object> + </object> + <object class="NSMenuItem" id="425164168"> + <reference key="NSMenu" ref="720053764"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="776162233"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">Close</string> + <string key="NSKeyEquiv">w</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1023925487"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">Save…</string> + <string key="NSKeyEquiv">s</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="579971712"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">Revert to Saved</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1010469920"> + <reference key="NSMenu" ref="720053764"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="294629803"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">Page Setup...</string> + <string key="NSKeyEquiv">P</string> + <int key="NSKeyEquivModMask">1179648</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSToolTip"/> + </object> + <object class="NSMenuItem" id="49223823"> + <reference key="NSMenu" ref="720053764"/> + <string key="NSTitle">Print…</string> + <string key="NSKeyEquiv">p</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="952259628"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Edit</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="789758025"> + <string key="NSTitle">Edit</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="1058277027"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Undo</string> + <string key="NSKeyEquiv">z</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="790794224"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Redo</string> + <string key="NSKeyEquiv">Z</string> + <int key="NSKeyEquivModMask">1179648</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1040322652"> + <reference key="NSMenu" ref="789758025"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="296257095"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Cut</string> + <string key="NSKeyEquiv">x</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="860595796"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Copy</string> + <string key="NSKeyEquiv">c</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="29853731"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Paste</string> + <string key="NSKeyEquiv">v</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="82994268"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Paste and Match Style</string> + <string key="NSKeyEquiv">V</string> + <int key="NSKeyEquivModMask">1572864</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="437104165"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Delete</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="583158037"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Select All</string> + <string key="NSKeyEquiv">a</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="212016141"> + <reference key="NSMenu" ref="789758025"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="892235320"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Find</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="963351320"> + <string key="NSTitle">Find</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="447796847"> + <reference key="NSMenu" ref="963351320"/> + <string key="NSTitle">Find…</string> + <string key="NSKeyEquiv">f</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">1</int> + </object> + <object class="NSMenuItem" id="738670835"> + <reference key="NSMenu" ref="963351320"/> + <string key="NSTitle">Find and Replace…</string> + <string key="NSKeyEquiv">f</string> + <int key="NSKeyEquivModMask">1572864</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">12</int> + </object> + <object class="NSMenuItem" id="326711663"> + <reference key="NSMenu" ref="963351320"/> + <string key="NSTitle">Find Next</string> + <string key="NSKeyEquiv">g</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">2</int> + </object> + <object class="NSMenuItem" id="270902937"> + <reference key="NSMenu" ref="963351320"/> + <string key="NSTitle">Find Previous</string> + <string key="NSKeyEquiv">G</string> + <int key="NSKeyEquivModMask">1179648</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">3</int> + </object> + <object class="NSMenuItem" id="159080638"> + <reference key="NSMenu" ref="963351320"/> + <string key="NSTitle">Use Selection for Find</string> + <string key="NSKeyEquiv">e</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">7</int> + </object> + <object class="NSMenuItem" id="88285865"> + <reference key="NSMenu" ref="963351320"/> + <string key="NSTitle">Jump to Selection</string> + <string key="NSKeyEquiv">j</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="972420730"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Spelling and Grammar</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="769623530"> + <string key="NSTitle">Spelling and Grammar</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="679648819"> + <reference key="NSMenu" ref="769623530"/> + <string key="NSTitle">Show Spelling and Grammar</string> + <string key="NSKeyEquiv">:</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="96193923"> + <reference key="NSMenu" ref="769623530"/> + <string key="NSTitle">Check Document Now</string> + <string key="NSKeyEquiv">;</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="859480356"> + <reference key="NSMenu" ref="769623530"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="948374510"> + <reference key="NSMenu" ref="769623530"/> + <string key="NSTitle">Check Spelling While Typing</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="967646866"> + <reference key="NSMenu" ref="769623530"/> + <string key="NSTitle">Check Grammar With Spelling</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="795346622"> + <reference key="NSMenu" ref="769623530"/> + <string key="NSTitle">Correct Spelling Automatically</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="507821607"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Substitutions</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="698887838"> + <string key="NSTitle">Substitutions</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="65139061"> + <reference key="NSMenu" ref="698887838"/> + <string key="NSTitle">Show Substitutions</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="19036812"> + <reference key="NSMenu" ref="698887838"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="605118523"> + <reference key="NSMenu" ref="698887838"/> + <string key="NSTitle">Smart Copy/Paste</string> + <string key="NSKeyEquiv">f</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">1</int> + </object> + <object class="NSMenuItem" id="197661976"> + <reference key="NSMenu" ref="698887838"/> + <string key="NSTitle">Smart Quotes</string> + <string key="NSKeyEquiv">g</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">2</int> + </object> + <object class="NSMenuItem" id="672708820"> + <reference key="NSMenu" ref="698887838"/> + <string key="NSTitle">Smart Dashes</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="708854459"> + <reference key="NSMenu" ref="698887838"/> + <string key="NSTitle">Smart Links</string> + <string key="NSKeyEquiv">G</string> + <int key="NSKeyEquivModMask">1179648</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">3</int> + </object> + <object class="NSMenuItem" id="537092702"> + <reference key="NSMenu" ref="698887838"/> + <string key="NSTitle">Text Replacement</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="288088188"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Transformations</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="579392910"> + <string key="NSTitle">Transformations</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="1060694897"> + <reference key="NSMenu" ref="579392910"/> + <string key="NSTitle">Make Upper Case</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="879586729"> + <reference key="NSMenu" ref="579392910"/> + <string key="NSTitle">Make Lower Case</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="56570060"> + <reference key="NSMenu" ref="579392910"/> + <string key="NSTitle">Capitalize</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="676164635"> + <reference key="NSMenu" ref="789758025"/> + <string key="NSTitle">Speech</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="785027613"> + <string key="NSTitle">Speech</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="731782645"> + <reference key="NSMenu" ref="785027613"/> + <string key="NSTitle">Start Speaking</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="680220178"> + <reference key="NSMenu" ref="785027613"/> + <string key="NSTitle">Stop Speaking</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="302598603"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Format</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="941447902"> + <string key="NSTitle">Format</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="792887677"> + <reference key="NSMenu" ref="941447902"/> + <string key="NSTitle">Font</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="786677654"> + <string key="NSTitle">Font</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="159677712"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Show Fonts</string> + <string key="NSKeyEquiv">t</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="305399458"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Bold</string> + <string key="NSKeyEquiv">b</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">2</int> + </object> + <object class="NSMenuItem" id="814362025"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Italic</string> + <string key="NSKeyEquiv">i</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">1</int> + </object> + <object class="NSMenuItem" id="330926929"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Underline</string> + <string key="NSKeyEquiv">u</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="533507878"> + <reference key="NSMenu" ref="786677654"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="158063935"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Bigger</string> + <string key="NSKeyEquiv">+</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">3</int> + </object> + <object class="NSMenuItem" id="885547335"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Smaller</string> + <string key="NSKeyEquiv">-</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <int key="NSTag">4</int> + </object> + <object class="NSMenuItem" id="901062459"> + <reference key="NSMenu" ref="786677654"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="767671776"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Kern</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="175441468"> + <string key="NSTitle">Kern</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="252969304"> + <reference key="NSMenu" ref="175441468"/> + <string key="NSTitle">Use Default</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="766922938"> + <reference key="NSMenu" ref="175441468"/> + <string key="NSTitle">Use None</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="677519740"> + <reference key="NSMenu" ref="175441468"/> + <string key="NSTitle">Tighten</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="238351151"> + <reference key="NSMenu" ref="175441468"/> + <string key="NSTitle">Loosen</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="691570813"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Ligatures</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="1058217995"> + <string key="NSTitle">Ligatures</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="706297211"> + <reference key="NSMenu" ref="1058217995"/> + <string key="NSTitle">Use Default</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="568384683"> + <reference key="NSMenu" ref="1058217995"/> + <string key="NSTitle">Use None</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="663508465"> + <reference key="NSMenu" ref="1058217995"/> + <string key="NSTitle">Use All</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="769124883"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Baseline</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="18263474"> + <string key="NSTitle">Baseline</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="257962622"> + <reference key="NSMenu" ref="18263474"/> + <string key="NSTitle">Use Default</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="644725453"> + <reference key="NSMenu" ref="18263474"/> + <string key="NSTitle">Superscript</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1037576581"> + <reference key="NSMenu" ref="18263474"/> + <string key="NSTitle">Subscript</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="941806246"> + <reference key="NSMenu" ref="18263474"/> + <string key="NSTitle">Raise</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1045724900"> + <reference key="NSMenu" ref="18263474"/> + <string key="NSTitle">Lower</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="739652853"> + <reference key="NSMenu" ref="786677654"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="1012600125"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Show Colors</string> + <string key="NSKeyEquiv">C</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="214559597"> + <reference key="NSMenu" ref="786677654"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="596732606"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Copy Style</string> + <string key="NSKeyEquiv">c</string> + <int key="NSKeyEquivModMask">1572864</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="393423671"> + <reference key="NSMenu" ref="786677654"/> + <string key="NSTitle">Paste Style</string> + <string key="NSKeyEquiv">v</string> + <int key="NSKeyEquivModMask">1572864</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + <string key="NSName">_NSFontMenu</string> + </object> + </object> + <object class="NSMenuItem" id="215659978"> + <reference key="NSMenu" ref="941447902"/> + <string key="NSTitle">Text</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="446991534"> + <string key="NSTitle">Text</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="875092757"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Align Left</string> + <string key="NSKeyEquiv">{</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="630155264"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Center</string> + <string key="NSKeyEquiv">|</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="945678886"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Justify</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="512868991"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Align Right</string> + <string key="NSKeyEquiv">}</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="163117631"> + <reference key="NSMenu" ref="446991534"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="31516759"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Writing Direction</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="956096989"> + <string key="NSTitle">Writing Direction</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="257099033"> + <reference key="NSMenu" ref="956096989"/> + <bool key="NSIsDisabled">YES</bool> + <string key="NSTitle">Paragraph</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="551969625"> + <reference key="NSMenu" ref="956096989"/> + <string type="base64-UTF8" key="NSTitle">CURlZmF1bHQ</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="249532473"> + <reference key="NSMenu" ref="956096989"/> + <string type="base64-UTF8" key="NSTitle">CUxlZnQgdG8gUmlnaHQ</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="607364498"> + <reference key="NSMenu" ref="956096989"/> + <string type="base64-UTF8" key="NSTitle">CVJpZ2h0IHRvIExlZnQ</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="508151438"> + <reference key="NSMenu" ref="956096989"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="981751889"> + <reference key="NSMenu" ref="956096989"/> + <bool key="NSIsDisabled">YES</bool> + <string key="NSTitle">Selection</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="380031999"> + <reference key="NSMenu" ref="956096989"/> + <string type="base64-UTF8" key="NSTitle">CURlZmF1bHQ</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="825984362"> + <reference key="NSMenu" ref="956096989"/> + <string type="base64-UTF8" key="NSTitle">CUxlZnQgdG8gUmlnaHQ</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="560145579"> + <reference key="NSMenu" ref="956096989"/> + <string type="base64-UTF8" key="NSTitle">CVJpZ2h0IHRvIExlZnQ</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="908105787"> + <reference key="NSMenu" ref="446991534"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="644046920"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Show Ruler</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="231811626"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Copy Ruler</string> + <string key="NSKeyEquiv">c</string> + <int key="NSKeyEquivModMask">1310720</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="883618387"> + <reference key="NSMenu" ref="446991534"/> + <string key="NSTitle">Paste Ruler</string> + <string key="NSKeyEquiv">v</string> + <int key="NSKeyEquivModMask">1310720</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="586577488"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">View</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="466310130"> + <string key="NSTitle">View</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="102151532"> + <reference key="NSMenu" ref="466310130"/> + <string key="NSTitle">Show Toolbar</string> + <string key="NSKeyEquiv">t</string> + <int key="NSKeyEquivModMask">1572864</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="237841660"> + <reference key="NSMenu" ref="466310130"/> + <string key="NSTitle">Customize Toolbar…</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="713487014"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Window</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="835318025"> + <string key="NSTitle">Window</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="1011231497"> + <reference key="NSMenu" ref="835318025"/> + <string key="NSTitle">Minimize</string> + <string key="NSKeyEquiv">m</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="575023229"> + <reference key="NSMenu" ref="835318025"/> + <string key="NSTitle">Zoom</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="299356726"> + <reference key="NSMenu" ref="835318025"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + <object class="NSMenuItem" id="625202149"> + <reference key="NSMenu" ref="835318025"/> + <string key="NSTitle">Bring All to Front</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + <string key="NSName">_NSWindowsMenu</string> + </object> + </object> + <object class="NSMenuItem" id="448692316"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Help</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="992780483"> + <string key="NSTitle">Help</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="105068016"> + <reference key="NSMenu" ref="992780483"/> + <string key="NSTitle">CocoaApplication Help</string> + <string key="NSKeyEquiv">?</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="35465992"/> + <reference key="NSMixedImage" ref="502551668"/> + </object> + </array> + <string key="NSName">_NSHelpMenu</string> + </object> + </object> + </array> + <string key="NSName">_NSMainMenu</string> + </object> + <object class="NSWindowTemplate" id="972006081"> + <int key="NSWindowStyleMask">15</int> + <int key="NSWindowBacking">2</int> + <string key="NSWindowRect">{{335, 390}, {480, 360}}</string> + <int key="NSWTFlags">1954021376</int> + <string key="NSWindowTitle">CocoaApplication</string> + <string key="NSWindowClass">NSWindow</string> + <nil key="NSViewClass"/> + <nil key="NSUserInterfaceItemIdentifier"/> + <object class="NSView" key="NSWindowView" id="439893737"> + <nil key="NSNextResponder"/> + <int key="NSvFlags">256</int> + <string key="NSFrameSize">{480, 360}</string> + </object> + <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> + <string key="NSMaxSize">{10000000000000, 10000000000000}</string> + <bool key="NSWindowIsRestorable">YES</bool> + </object> + <object class="NSCustomObject" id="976324537"> + <string key="NSClassName">AppDelegate</string> + </object> + <object class="NSCustomObject" id="755631768"> + <string key="NSClassName">NSFontManager</string> + </object> + </array> + <object class="IBObjectContainer" key="IBDocument.Objects"> + <array class="NSMutableArray" key="connectionRecords"> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">terminate:</string> + <reference key="source" ref="1050"/> + <reference key="destination" ref="632727374"/> + </object> + <int key="connectionID">449</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">orderFrontStandardAboutPanel:</string> + <reference key="source" ref="1021"/> + <reference key="destination" ref="238522557"/> + </object> + <int key="connectionID">142</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="1021"/> + <reference key="destination" ref="976324537"/> + </object> + <int key="connectionID">495</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performMiniaturize:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1011231497"/> + </object> + <int key="connectionID">37</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">arrangeInFront:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="625202149"/> + </object> + <int key="connectionID">39</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">print:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="49223823"/> + </object> + <int key="connectionID">86</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">runPageLayout:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="294629803"/> + </object> + <int key="connectionID">87</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">clearRecentDocuments:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="759406840"/> + </object> + <int key="connectionID">127</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performClose:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="776162233"/> + </object> + <int key="connectionID">193</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleContinuousSpellChecking:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="948374510"/> + </object> + <int key="connectionID">222</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">undo:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1058277027"/> + </object> + <int key="connectionID">223</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">copy:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="860595796"/> + </object> + <int key="connectionID">224</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">checkSpelling:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="96193923"/> + </object> + <int key="connectionID">225</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">paste:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="29853731"/> + </object> + <int key="connectionID">226</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">stopSpeaking:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="680220178"/> + </object> + <int key="connectionID">227</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">cut:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="296257095"/> + </object> + <int key="connectionID">228</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">showGuessPanel:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="679648819"/> + </object> + <int key="connectionID">230</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">redo:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="790794224"/> + </object> + <int key="connectionID">231</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">selectAll:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="583158037"/> + </object> + <int key="connectionID">232</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">startSpeaking:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="731782645"/> + </object> + <int key="connectionID">233</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">delete:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="437104165"/> + </object> + <int key="connectionID">235</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performZoom:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="575023229"/> + </object> + <int key="connectionID">240</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performFindPanelAction:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="447796847"/> + </object> + <int key="connectionID">241</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">centerSelectionInVisibleArea:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="88285865"/> + </object> + <int key="connectionID">245</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleGrammarChecking:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="967646866"/> + </object> + <int key="connectionID">347</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleSmartInsertDelete:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="605118523"/> + </object> + <int key="connectionID">355</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleAutomaticQuoteSubstitution:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="197661976"/> + </object> + <int key="connectionID">356</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleAutomaticLinkDetection:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="708854459"/> + </object> + <int key="connectionID">357</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">saveDocument:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1023925487"/> + </object> + <int key="connectionID">362</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">revertDocumentToSaved:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="579971712"/> + </object> + <int key="connectionID">364</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">runToolbarCustomizationPalette:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="237841660"/> + </object> + <int key="connectionID">365</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleToolbarShown:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="102151532"/> + </object> + <int key="connectionID">366</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">hide:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="755159360"/> + </object> + <int key="connectionID">367</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">hideOtherApplications:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="342932134"/> + </object> + <int key="connectionID">368</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">unhideAllApplications:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="908899353"/> + </object> + <int key="connectionID">370</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">newDocument:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="705341025"/> + </object> + <int key="connectionID">373</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">openDocument:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="722745758"/> + </object> + <int key="connectionID">374</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">raiseBaseline:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="941806246"/> + </object> + <int key="connectionID">426</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">lowerBaseline:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1045724900"/> + </object> + <int key="connectionID">427</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">copyFont:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="596732606"/> + </object> + <int key="connectionID">428</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">subscript:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1037576581"/> + </object> + <int key="connectionID">429</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">superscript:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="644725453"/> + </object> + <int key="connectionID">430</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">tightenKerning:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="677519740"/> + </object> + <int key="connectionID">431</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">underline:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="330926929"/> + </object> + <int key="connectionID">432</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">orderFrontColorPanel:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1012600125"/> + </object> + <int key="connectionID">433</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">useAllLigatures:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="663508465"/> + </object> + <int key="connectionID">434</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">loosenKerning:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="238351151"/> + </object> + <int key="connectionID">435</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">pasteFont:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="393423671"/> + </object> + <int key="connectionID">436</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">unscript:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="257962622"/> + </object> + <int key="connectionID">437</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">useStandardKerning:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="252969304"/> + </object> + <int key="connectionID">438</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">useStandardLigatures:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="706297211"/> + </object> + <int key="connectionID">439</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">turnOffLigatures:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="568384683"/> + </object> + <int key="connectionID">440</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">turnOffKerning:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="766922938"/> + </object> + <int key="connectionID">441</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleAutomaticSpellingCorrection:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="795346622"/> + </object> + <int key="connectionID">456</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">orderFrontSubstitutionsPanel:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="65139061"/> + </object> + <int key="connectionID">458</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleAutomaticDashSubstitution:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="672708820"/> + </object> + <int key="connectionID">461</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleAutomaticTextReplacement:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="537092702"/> + </object> + <int key="connectionID">463</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">uppercaseWord:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1060694897"/> + </object> + <int key="connectionID">464</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">capitalizeWord:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="56570060"/> + </object> + <int key="connectionID">467</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">lowercaseWord:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="879586729"/> + </object> + <int key="connectionID">468</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">pasteAsPlainText:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="82994268"/> + </object> + <int key="connectionID">486</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performFindPanelAction:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="326711663"/> + </object> + <int key="connectionID">487</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performFindPanelAction:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="270902937"/> + </object> + <int key="connectionID">488</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performFindPanelAction:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="159080638"/> + </object> + <int key="connectionID">489</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">showHelp:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="105068016"/> + </object> + <int key="connectionID">493</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">alignCenter:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="630155264"/> + </object> + <int key="connectionID">518</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">pasteRuler:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="883618387"/> + </object> + <int key="connectionID">519</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleRuler:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="644046920"/> + </object> + <int key="connectionID">520</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">alignRight:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="512868991"/> + </object> + <int key="connectionID">521</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">copyRuler:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="231811626"/> + </object> + <int key="connectionID">522</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">alignJustified:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="945678886"/> + </object> + <int key="connectionID">523</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">alignLeft:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="875092757"/> + </object> + <int key="connectionID">524</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">makeBaseWritingDirectionNatural:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="551969625"/> + </object> + <int key="connectionID">525</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">makeBaseWritingDirectionLeftToRight:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="249532473"/> + </object> + <int key="connectionID">526</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">makeBaseWritingDirectionRightToLeft:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="607364498"/> + </object> + <int key="connectionID">527</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">makeTextWritingDirectionNatural:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="380031999"/> + </object> + <int key="connectionID">528</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">makeTextWritingDirectionLeftToRight:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="825984362"/> + </object> + <int key="connectionID">529</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">makeTextWritingDirectionRightToLeft:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="560145579"/> + </object> + <int key="connectionID">530</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performFindPanelAction:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="738670835"/> + </object> + <int key="connectionID">535</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">addFontTrait:</string> + <reference key="source" ref="755631768"/> + <reference key="destination" ref="305399458"/> + </object> + <int key="connectionID">421</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">addFontTrait:</string> + <reference key="source" ref="755631768"/> + <reference key="destination" ref="814362025"/> + </object> + <int key="connectionID">422</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">modifyFont:</string> + <reference key="source" ref="755631768"/> + <reference key="destination" ref="885547335"/> + </object> + <int key="connectionID">423</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">orderFrontFontPanel:</string> + <reference key="source" ref="755631768"/> + <reference key="destination" ref="159677712"/> + </object> + <int key="connectionID">424</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">modifyFont:</string> + <reference key="source" ref="755631768"/> + <reference key="destination" ref="158063935"/> + </object> + <int key="connectionID">425</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">window</string> + <reference key="source" ref="976324537"/> + <reference key="destination" ref="972006081"/> + </object> + <int key="connectionID">532</int> + </object> + </array> + <object class="IBMutableOrderedSet" key="objectRecords"> + <array key="orderedObjects"> + <object class="IBObjectRecord"> + <int key="objectID">0</int> + <array key="object" id="0"/> + <reference key="children" ref="1048"/> + <nil key="parent"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-2</int> + <reference key="object" ref="1021"/> + <reference key="parent" ref="0"/> + <string key="objectName">File's Owner</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-1</int> + <reference key="object" ref="1014"/> + <reference key="parent" ref="0"/> + <string key="objectName">First Responder</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-3</int> + <reference key="object" ref="1050"/> + <reference key="parent" ref="0"/> + <string key="objectName">Application</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">29</int> + <reference key="object" ref="649796088"/> + <array class="NSMutableArray" key="children"> + <reference ref="713487014"/> + <reference ref="694149608"/> + <reference ref="952259628"/> + <reference ref="379814623"/> + <reference ref="586577488"/> + <reference ref="302598603"/> + <reference ref="448692316"/> + </array> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">19</int> + <reference key="object" ref="713487014"/> + <array class="NSMutableArray" key="children"> + <reference ref="835318025"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">56</int> + <reference key="object" ref="694149608"/> + <array class="NSMutableArray" key="children"> + <reference ref="110575045"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">217</int> + <reference key="object" ref="952259628"/> + <array class="NSMutableArray" key="children"> + <reference ref="789758025"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">83</int> + <reference key="object" ref="379814623"/> + <array class="NSMutableArray" key="children"> + <reference ref="720053764"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">81</int> + <reference key="object" ref="720053764"/> + <array class="NSMutableArray" key="children"> + <reference ref="1023925487"/> + <reference ref="49223823"/> + <reference ref="722745758"/> + <reference ref="705341025"/> + <reference ref="1025936716"/> + <reference ref="294629803"/> + <reference ref="776162233"/> + <reference ref="425164168"/> + <reference ref="579971712"/> + <reference ref="1010469920"/> + </array> + <reference key="parent" ref="379814623"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">75</int> + <reference key="object" ref="1023925487"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">78</int> + <reference key="object" ref="49223823"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">72</int> + <reference key="object" ref="722745758"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">82</int> + <reference key="object" ref="705341025"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">124</int> + <reference key="object" ref="1025936716"/> + <array class="NSMutableArray" key="children"> + <reference ref="1065607017"/> + </array> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">77</int> + <reference key="object" ref="294629803"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">73</int> + <reference key="object" ref="776162233"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">79</int> + <reference key="object" ref="425164168"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">112</int> + <reference key="object" ref="579971712"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">74</int> + <reference key="object" ref="1010469920"/> + <reference key="parent" ref="720053764"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">125</int> + <reference key="object" ref="1065607017"/> + <array class="NSMutableArray" key="children"> + <reference ref="759406840"/> + </array> + <reference key="parent" ref="1025936716"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">126</int> + <reference key="object" ref="759406840"/> + <reference key="parent" ref="1065607017"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">205</int> + <reference key="object" ref="789758025"/> + <array class="NSMutableArray" key="children"> + <reference ref="437104165"/> + <reference ref="583158037"/> + <reference ref="1058277027"/> + <reference ref="212016141"/> + <reference ref="296257095"/> + <reference ref="29853731"/> + <reference ref="860595796"/> + <reference ref="1040322652"/> + <reference ref="790794224"/> + <reference ref="892235320"/> + <reference ref="972420730"/> + <reference ref="676164635"/> + <reference ref="507821607"/> + <reference ref="288088188"/> + <reference ref="82994268"/> + </array> + <reference key="parent" ref="952259628"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">202</int> + <reference key="object" ref="437104165"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">198</int> + <reference key="object" ref="583158037"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">207</int> + <reference key="object" ref="1058277027"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">214</int> + <reference key="object" ref="212016141"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">199</int> + <reference key="object" ref="296257095"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">203</int> + <reference key="object" ref="29853731"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">197</int> + <reference key="object" ref="860595796"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">206</int> + <reference key="object" ref="1040322652"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">215</int> + <reference key="object" ref="790794224"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">218</int> + <reference key="object" ref="892235320"/> + <array class="NSMutableArray" key="children"> + <reference ref="963351320"/> + </array> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">216</int> + <reference key="object" ref="972420730"/> + <array class="NSMutableArray" key="children"> + <reference ref="769623530"/> + </array> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">200</int> + <reference key="object" ref="769623530"/> + <array class="NSMutableArray" key="children"> + <reference ref="948374510"/> + <reference ref="96193923"/> + <reference ref="679648819"/> + <reference ref="967646866"/> + <reference ref="859480356"/> + <reference ref="795346622"/> + </array> + <reference key="parent" ref="972420730"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">219</int> + <reference key="object" ref="948374510"/> + <reference key="parent" ref="769623530"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">201</int> + <reference key="object" ref="96193923"/> + <reference key="parent" ref="769623530"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">204</int> + <reference key="object" ref="679648819"/> + <reference key="parent" ref="769623530"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">220</int> + <reference key="object" ref="963351320"/> + <array class="NSMutableArray" key="children"> + <reference ref="270902937"/> + <reference ref="88285865"/> + <reference ref="159080638"/> + <reference ref="326711663"/> + <reference ref="447796847"/> + <reference ref="738670835"/> + </array> + <reference key="parent" ref="892235320"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">213</int> + <reference key="object" ref="270902937"/> + <reference key="parent" ref="963351320"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">210</int> + <reference key="object" ref="88285865"/> + <reference key="parent" ref="963351320"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">221</int> + <reference key="object" ref="159080638"/> + <reference key="parent" ref="963351320"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">208</int> + <reference key="object" ref="326711663"/> + <reference key="parent" ref="963351320"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">209</int> + <reference key="object" ref="447796847"/> + <reference key="parent" ref="963351320"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">57</int> + <reference key="object" ref="110575045"/> + <array class="NSMutableArray" key="children"> + <reference ref="238522557"/> + <reference ref="755159360"/> + <reference ref="908899353"/> + <reference ref="632727374"/> + <reference ref="646227648"/> + <reference ref="609285721"/> + <reference ref="481834944"/> + <reference ref="304266470"/> + <reference ref="1046388886"/> + <reference ref="1056857174"/> + <reference ref="342932134"/> + </array> + <reference key="parent" ref="694149608"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">58</int> + <reference key="object" ref="238522557"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">134</int> + <reference key="object" ref="755159360"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">150</int> + <reference key="object" ref="908899353"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">136</int> + <reference key="object" ref="632727374"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">144</int> + <reference key="object" ref="646227648"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">129</int> + <reference key="object" ref="609285721"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">143</int> + <reference key="object" ref="481834944"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">236</int> + <reference key="object" ref="304266470"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">131</int> + <reference key="object" ref="1046388886"/> + <array class="NSMutableArray" key="children"> + <reference ref="752062318"/> + </array> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">149</int> + <reference key="object" ref="1056857174"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">145</int> + <reference key="object" ref="342932134"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">130</int> + <reference key="object" ref="752062318"/> + <reference key="parent" ref="1046388886"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">24</int> + <reference key="object" ref="835318025"/> + <array class="NSMutableArray" key="children"> + <reference ref="299356726"/> + <reference ref="625202149"/> + <reference ref="575023229"/> + <reference ref="1011231497"/> + </array> + <reference key="parent" ref="713487014"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">92</int> + <reference key="object" ref="299356726"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">5</int> + <reference key="object" ref="625202149"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">239</int> + <reference key="object" ref="575023229"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">23</int> + <reference key="object" ref="1011231497"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">295</int> + <reference key="object" ref="586577488"/> + <array class="NSMutableArray" key="children"> + <reference ref="466310130"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">296</int> + <reference key="object" ref="466310130"/> + <array class="NSMutableArray" key="children"> + <reference ref="102151532"/> + <reference ref="237841660"/> + </array> + <reference key="parent" ref="586577488"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">297</int> + <reference key="object" ref="102151532"/> + <reference key="parent" ref="466310130"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">298</int> + <reference key="object" ref="237841660"/> + <reference key="parent" ref="466310130"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">211</int> + <reference key="object" ref="676164635"/> + <array class="NSMutableArray" key="children"> + <reference ref="785027613"/> + </array> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">212</int> + <reference key="object" ref="785027613"/> + <array class="NSMutableArray" key="children"> + <reference ref="680220178"/> + <reference ref="731782645"/> + </array> + <reference key="parent" ref="676164635"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">195</int> + <reference key="object" ref="680220178"/> + <reference key="parent" ref="785027613"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">196</int> + <reference key="object" ref="731782645"/> + <reference key="parent" ref="785027613"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">346</int> + <reference key="object" ref="967646866"/> + <reference key="parent" ref="769623530"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">348</int> + <reference key="object" ref="507821607"/> + <array class="NSMutableArray" key="children"> + <reference ref="698887838"/> + </array> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">349</int> + <reference key="object" ref="698887838"/> + <array class="NSMutableArray" key="children"> + <reference ref="605118523"/> + <reference ref="197661976"/> + <reference ref="708854459"/> + <reference ref="65139061"/> + <reference ref="19036812"/> + <reference ref="672708820"/> + <reference ref="537092702"/> + </array> + <reference key="parent" ref="507821607"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">350</int> + <reference key="object" ref="605118523"/> + <reference key="parent" ref="698887838"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">351</int> + <reference key="object" ref="197661976"/> + <reference key="parent" ref="698887838"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">354</int> + <reference key="object" ref="708854459"/> + <reference key="parent" ref="698887838"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">371</int> + <reference key="object" ref="972006081"/> + <array class="NSMutableArray" key="children"> + <reference ref="439893737"/> + </array> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">372</int> + <reference key="object" ref="439893737"/> + <reference key="parent" ref="972006081"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">375</int> + <reference key="object" ref="302598603"/> + <array class="NSMutableArray" key="children"> + <reference ref="941447902"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">376</int> + <reference key="object" ref="941447902"/> + <array class="NSMutableArray" key="children"> + <reference ref="792887677"/> + <reference ref="215659978"/> + </array> + <reference key="parent" ref="302598603"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">377</int> + <reference key="object" ref="792887677"/> + <array class="NSMutableArray" key="children"> + <reference ref="786677654"/> + </array> + <reference key="parent" ref="941447902"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">388</int> + <reference key="object" ref="786677654"/> + <array class="NSMutableArray" key="children"> + <reference ref="159677712"/> + <reference ref="305399458"/> + <reference ref="814362025"/> + <reference ref="330926929"/> + <reference ref="533507878"/> + <reference ref="158063935"/> + <reference ref="885547335"/> + <reference ref="901062459"/> + <reference ref="767671776"/> + <reference ref="691570813"/> + <reference ref="769124883"/> + <reference ref="739652853"/> + <reference ref="1012600125"/> + <reference ref="214559597"/> + <reference ref="596732606"/> + <reference ref="393423671"/> + </array> + <reference key="parent" ref="792887677"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">389</int> + <reference key="object" ref="159677712"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">390</int> + <reference key="object" ref="305399458"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">391</int> + <reference key="object" ref="814362025"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">392</int> + <reference key="object" ref="330926929"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">393</int> + <reference key="object" ref="533507878"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">394</int> + <reference key="object" ref="158063935"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">395</int> + <reference key="object" ref="885547335"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">396</int> + <reference key="object" ref="901062459"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">397</int> + <reference key="object" ref="767671776"/> + <array class="NSMutableArray" key="children"> + <reference ref="175441468"/> + </array> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">398</int> + <reference key="object" ref="691570813"/> + <array class="NSMutableArray" key="children"> + <reference ref="1058217995"/> + </array> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">399</int> + <reference key="object" ref="769124883"/> + <array class="NSMutableArray" key="children"> + <reference ref="18263474"/> + </array> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">400</int> + <reference key="object" ref="739652853"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">401</int> + <reference key="object" ref="1012600125"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">402</int> + <reference key="object" ref="214559597"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">403</int> + <reference key="object" ref="596732606"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">404</int> + <reference key="object" ref="393423671"/> + <reference key="parent" ref="786677654"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">405</int> + <reference key="object" ref="18263474"/> + <array class="NSMutableArray" key="children"> + <reference ref="257962622"/> + <reference ref="644725453"/> + <reference ref="1037576581"/> + <reference ref="941806246"/> + <reference ref="1045724900"/> + </array> + <reference key="parent" ref="769124883"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">406</int> + <reference key="object" ref="257962622"/> + <reference key="parent" ref="18263474"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">407</int> + <reference key="object" ref="644725453"/> + <reference key="parent" ref="18263474"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">408</int> + <reference key="object" ref="1037576581"/> + <reference key="parent" ref="18263474"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">409</int> + <reference key="object" ref="941806246"/> + <reference key="parent" ref="18263474"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">410</int> + <reference key="object" ref="1045724900"/> + <reference key="parent" ref="18263474"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">411</int> + <reference key="object" ref="1058217995"/> + <array class="NSMutableArray" key="children"> + <reference ref="706297211"/> + <reference ref="568384683"/> + <reference ref="663508465"/> + </array> + <reference key="parent" ref="691570813"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">412</int> + <reference key="object" ref="706297211"/> + <reference key="parent" ref="1058217995"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">413</int> + <reference key="object" ref="568384683"/> + <reference key="parent" ref="1058217995"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">414</int> + <reference key="object" ref="663508465"/> + <reference key="parent" ref="1058217995"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">415</int> + <reference key="object" ref="175441468"/> + <array class="NSMutableArray" key="children"> + <reference ref="252969304"/> + <reference ref="766922938"/> + <reference ref="677519740"/> + <reference ref="238351151"/> + </array> + <reference key="parent" ref="767671776"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">416</int> + <reference key="object" ref="252969304"/> + <reference key="parent" ref="175441468"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">417</int> + <reference key="object" ref="766922938"/> + <reference key="parent" ref="175441468"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">418</int> + <reference key="object" ref="677519740"/> + <reference key="parent" ref="175441468"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">419</int> + <reference key="object" ref="238351151"/> + <reference key="parent" ref="175441468"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">420</int> + <reference key="object" ref="755631768"/> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">450</int> + <reference key="object" ref="288088188"/> + <array class="NSMutableArray" key="children"> + <reference ref="579392910"/> + </array> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">451</int> + <reference key="object" ref="579392910"/> + <array class="NSMutableArray" key="children"> + <reference ref="1060694897"/> + <reference ref="879586729"/> + <reference ref="56570060"/> + </array> + <reference key="parent" ref="288088188"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">452</int> + <reference key="object" ref="1060694897"/> + <reference key="parent" ref="579392910"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">453</int> + <reference key="object" ref="859480356"/> + <reference key="parent" ref="769623530"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">454</int> + <reference key="object" ref="795346622"/> + <reference key="parent" ref="769623530"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">457</int> + <reference key="object" ref="65139061"/> + <reference key="parent" ref="698887838"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">459</int> + <reference key="object" ref="19036812"/> + <reference key="parent" ref="698887838"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">460</int> + <reference key="object" ref="672708820"/> + <reference key="parent" ref="698887838"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">462</int> + <reference key="object" ref="537092702"/> + <reference key="parent" ref="698887838"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">465</int> + <reference key="object" ref="879586729"/> + <reference key="parent" ref="579392910"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">466</int> + <reference key="object" ref="56570060"/> + <reference key="parent" ref="579392910"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">485</int> + <reference key="object" ref="82994268"/> + <reference key="parent" ref="789758025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">490</int> + <reference key="object" ref="448692316"/> + <array class="NSMutableArray" key="children"> + <reference ref="992780483"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">491</int> + <reference key="object" ref="992780483"/> + <array class="NSMutableArray" key="children"> + <reference ref="105068016"/> + </array> + <reference key="parent" ref="448692316"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">492</int> + <reference key="object" ref="105068016"/> + <reference key="parent" ref="992780483"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">494</int> + <reference key="object" ref="976324537"/> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">496</int> + <reference key="object" ref="215659978"/> + <array class="NSMutableArray" key="children"> + <reference ref="446991534"/> + </array> + <reference key="parent" ref="941447902"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">497</int> + <reference key="object" ref="446991534"/> + <array class="NSMutableArray" key="children"> + <reference ref="875092757"/> + <reference ref="630155264"/> + <reference ref="945678886"/> + <reference ref="512868991"/> + <reference ref="163117631"/> + <reference ref="31516759"/> + <reference ref="908105787"/> + <reference ref="644046920"/> + <reference ref="231811626"/> + <reference ref="883618387"/> + </array> + <reference key="parent" ref="215659978"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">498</int> + <reference key="object" ref="875092757"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">499</int> + <reference key="object" ref="630155264"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">500</int> + <reference key="object" ref="945678886"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">501</int> + <reference key="object" ref="512868991"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">502</int> + <reference key="object" ref="163117631"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">503</int> + <reference key="object" ref="31516759"/> + <array class="NSMutableArray" key="children"> + <reference ref="956096989"/> + </array> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">504</int> + <reference key="object" ref="908105787"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">505</int> + <reference key="object" ref="644046920"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">506</int> + <reference key="object" ref="231811626"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">507</int> + <reference key="object" ref="883618387"/> + <reference key="parent" ref="446991534"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">508</int> + <reference key="object" ref="956096989"/> + <array class="NSMutableArray" key="children"> + <reference ref="257099033"/> + <reference ref="551969625"/> + <reference ref="249532473"/> + <reference ref="607364498"/> + <reference ref="508151438"/> + <reference ref="981751889"/> + <reference ref="380031999"/> + <reference ref="825984362"/> + <reference ref="560145579"/> + </array> + <reference key="parent" ref="31516759"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">509</int> + <reference key="object" ref="257099033"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">510</int> + <reference key="object" ref="551969625"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">511</int> + <reference key="object" ref="249532473"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">512</int> + <reference key="object" ref="607364498"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">513</int> + <reference key="object" ref="508151438"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">514</int> + <reference key="object" ref="981751889"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">515</int> + <reference key="object" ref="380031999"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">516</int> + <reference key="object" ref="825984362"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">517</int> + <reference key="object" ref="560145579"/> + <reference key="parent" ref="956096989"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">534</int> + <reference key="object" ref="738670835"/> + <reference key="parent" ref="963351320"/> + </object> + </array> + </object> + <dictionary class="NSMutableDictionary" key="flattenedProperties"> + <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="112.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="124.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="125.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="126.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="129.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="130.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="131.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="134.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="136.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="143.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="144.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="145.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="149.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="150.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="19.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="195.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="196.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="197.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="198.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="199.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="200.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="201.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="202.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="203.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="204.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="205.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="206.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="207.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="208.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="209.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="210.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="211.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="212.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="213.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="214.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="215.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="216.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="217.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="218.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="219.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="220.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="221.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="236.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="239.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="24.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="295.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="296.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="297.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="298.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="346.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="348.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="349.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="350.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="351.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="354.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="371.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="371.IBWindowTemplateEditedContentRect">{{380, 496}, {480, 360}}</string> + <integer value="1" key="371.NSWindowTemplate.visibleAtLaunch"/> + <string key="372.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="375.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="376.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="377.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="388.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="389.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="390.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="391.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="392.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="393.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="394.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="395.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="396.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="397.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="398.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="399.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="400.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="401.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="402.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="403.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="404.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="405.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="406.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="407.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="408.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="409.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="410.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="411.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="412.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="413.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="414.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="415.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="416.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="417.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="418.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="419.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="420.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="450.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="451.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="452.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="453.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="454.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="457.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="459.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="460.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="462.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="465.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="466.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="485.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="490.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="491.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="492.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="494.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="496.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="497.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="498.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="499.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="500.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="501.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="502.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="503.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="504.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="505.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="506.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="507.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="508.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="509.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="510.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="511.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="512.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="513.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="514.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="515.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="516.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="517.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="534.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="72.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="73.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="74.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="75.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="77.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="78.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="79.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="81.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="82.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="83.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="92.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/> + <nil key="activeLocalization"/> + <dictionary class="NSMutableDictionary" key="localizations"/> + <nil key="sourceID"/> + <int key="maxID">535</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"> + <array class="NSMutableArray" key="referencedPartialClassDescriptions"> + <object class="IBPartialClassDescription"> + <string key="className">ABCardController</string> + <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="addCardViewField:">id</string> + <string key="copy:">id</string> + <string key="cut:">id</string> + <string key="doDelete:">id</string> + <string key="find:">id</string> + <string key="paste:">id</string> + <string key="saveChanges:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="addCardViewField:"> + <string key="name">addCardViewField:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="copy:"> + <string key="name">copy:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="cut:"> + <string key="name">cut:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="doDelete:"> + <string key="name">doDelete:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="find:"> + <string key="name">find:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="paste:"> + <string key="name">paste:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="saveChanges:"> + <string key="name">saveChanges:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="mCardView">ABCardView</string> + <string key="mEditButton">NSButton</string> + <string key="mManagedObjectContext">NSManagedObjectContext</string> + <string key="mSearchField">NSSearchField</string> + <string key="mStatusTextField">NSTextField</string> + <string key="mWindow">NSWindow</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="mCardView"> + <string key="name">mCardView</string> + <string key="candidateClassName">ABCardView</string> + </object> + <object class="IBToOneOutletInfo" key="mEditButton"> + <string key="name">mEditButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo" key="mManagedObjectContext"> + <string key="name">mManagedObjectContext</string> + <string key="candidateClassName">NSManagedObjectContext</string> + </object> + <object class="IBToOneOutletInfo" key="mSearchField"> + <string key="name">mSearchField</string> + <string key="candidateClassName">NSSearchField</string> + </object> + <object class="IBToOneOutletInfo" key="mStatusTextField"> + <string key="name">mStatusTextField</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo" key="mWindow"> + <string key="name">mWindow</string> + <string key="candidateClassName">NSWindow</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/ABCardController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">ABCardView</string> + <string key="superclassName">NSView</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="commitAndSave:">id</string> + <string key="statusImageClicked:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="commitAndSave:"> + <string key="name">commitAndSave:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="statusImageClicked:"> + <string key="name">statusImageClicked:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="mBindingsController">NSObjectController</string> + <string key="mBuddyStatusImage">NSImageView</string> + <string key="mHeaderView">NSView</string> + <string key="mNameView">ABNameFrameView</string> + <string key="mNextKeyView">NSView</string> + <string key="mUserImage">NSImage</string> + <string key="mUserImageView">ABImageView</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="mBindingsController"> + <string key="name">mBindingsController</string> + <string key="candidateClassName">NSObjectController</string> + </object> + <object class="IBToOneOutletInfo" key="mBuddyStatusImage"> + <string key="name">mBuddyStatusImage</string> + <string key="candidateClassName">NSImageView</string> + </object> + <object class="IBToOneOutletInfo" key="mHeaderView"> + <string key="name">mHeaderView</string> + <string key="candidateClassName">NSView</string> + </object> + <object class="IBToOneOutletInfo" key="mNameView"> + <string key="name">mNameView</string> + <string key="candidateClassName">ABNameFrameView</string> + </object> + <object class="IBToOneOutletInfo" key="mNextKeyView"> + <string key="name">mNextKeyView</string> + <string key="candidateClassName">NSView</string> + </object> + <object class="IBToOneOutletInfo" key="mUserImage"> + <string key="name">mUserImage</string> + <string key="candidateClassName">NSImage</string> + </object> + <object class="IBToOneOutletInfo" key="mUserImageView"> + <string key="name">mUserImageView</string> + <string key="candidateClassName">ABImageView</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/ABCardView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">ABImageView</string> + <string key="superclassName">NSImageView</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="copy:">id</string> + <string key="cut:">id</string> + <string key="delete:">id</string> + <string key="paste:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="copy:"> + <string key="name">copy:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="cut:"> + <string key="name">cut:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="delete:"> + <string key="name">delete:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="paste:"> + <string key="name">paste:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/ABImageView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTBorderedView</string> + <string key="superclassName">DVTLayoutView_ML</string> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">contentView</string> + <string key="NS.object.0">NSView</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">contentView</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">contentView</string> + <string key="candidateClassName">NSView</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTBorderedView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTDelayedMenuButton</string> + <string key="superclassName">NSButton</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTDelayedMenuButton.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTGradientImageButton</string> + <string key="superclassName">NSButton</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTGradientImageButton.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTImageAndTextCell</string> + <string key="superclassName">NSTextFieldCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTImageAndTextCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTImageAndTextColumn</string> + <string key="superclassName">NSTableColumn</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTImageAndTextColumn.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTLayoutView_ML</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTLayoutView_ML.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTOutlineView</string> + <string key="superclassName">NSOutlineView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTOutlineView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTSplitView</string> + <string key="superclassName">NSSplitView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTSplitView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTStackView_ML</string> + <string key="superclassName">DVTLayoutView_ML</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTStackView_ML.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTTableView</string> + <string key="superclassName">NSTableView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTTableView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">DVTViewController</string> + <string key="superclassName">NSViewController</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/DVTViewController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">HFController</string> + <string key="superclassName">NSObject</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">selectAll:</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">selectAll:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">selectAll:</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/HFController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">HFRepresenterTextView</string> + <string key="superclassName">NSView</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">selectAll:</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">selectAll:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">selectAll:</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/HFRepresenterTextView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IBEditor</string> + <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="changeFont:">id</string> + <string key="performCopy:">id</string> + <string key="performCut:">id</string> + <string key="selectAll:">id</string> + <string key="sizeSelectionToFit:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="changeFont:"> + <string key="name">changeFont:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="performCopy:"> + <string key="name">performCopy:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="performCut:"> + <string key="name">performCut:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="selectAll:"> + <string key="name">selectAll:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="sizeSelectionToFit:"> + <string key="name">sizeSelectionToFit:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IBEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDECapsuleListView</string> + <string key="superclassName">DVTStackView_ML</string> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">dataSource</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">dataSource</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">dataSource</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDECapsuleListView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDMArrayController</string> + <string key="superclassName">NSArrayController</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDMArrayController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDMEditor</string> + <string key="superclassName">IDEEditor</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="bottomToolbarBorderView">DVTBorderedView</string> + <string key="sourceListSplitViewPane">NSView</string> + <string key="sourceListViewController">IDEDMEditorSourceListController</string> + <string key="splitView">DVTSplitView</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="bottomToolbarBorderView"> + <string key="name">bottomToolbarBorderView</string> + <string key="candidateClassName">DVTBorderedView</string> + </object> + <object class="IBToOneOutletInfo" key="sourceListSplitViewPane"> + <string key="name">sourceListSplitViewPane</string> + <string key="candidateClassName">NSView</string> + </object> + <object class="IBToOneOutletInfo" key="sourceListViewController"> + <string key="name">sourceListViewController</string> + <string key="candidateClassName">IDEDMEditorSourceListController</string> + </object> + <object class="IBToOneOutletInfo" key="splitView"> + <string key="name">splitView</string> + <string key="candidateClassName">DVTSplitView</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDMEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDMEditorController</string> + <string key="superclassName">IDEViewController</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDMEditorController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDMEditorSourceListController</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="borderedView">DVTBorderedView</string> + <string key="parentEditor">IDEDMEditor</string> + <string key="primaryColumn">DVTImageAndTextColumn</string> + <string key="sourceListOutlineView">DVTOutlineView</string> + <string key="sourceListTreeController">NSTreeController</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="borderedView"> + <string key="name">borderedView</string> + <string key="candidateClassName">DVTBorderedView</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDMEditor</string> + </object> + <object class="IBToOneOutletInfo" key="primaryColumn"> + <string key="name">primaryColumn</string> + <string key="candidateClassName">DVTImageAndTextColumn</string> + </object> + <object class="IBToOneOutletInfo" key="sourceListOutlineView"> + <string key="name">sourceListOutlineView</string> + <string key="candidateClassName">DVTOutlineView</string> + </object> + <object class="IBToOneOutletInfo" key="sourceListTreeController"> + <string key="name">sourceListTreeController</string> + <string key="candidateClassName">NSTreeController</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDMEditorSourceListController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDMHighlightImageAndTextCell</string> + <string key="superclassName">DVTImageAndTextCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDMHighlightImageAndTextCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelBrowserEditor</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="attributesTableViewController">IDEDataModelPropertiesTableController</string> + <string key="capsuleView">IDECapsuleListView</string> + <string key="entityArrayController">NSArrayController</string> + <string key="fetchedPropertiesTableViewController">IDEDataModelPropertiesTableController</string> + <string key="parentEditor">IDEDataModelEntityContentsEditor</string> + <string key="relationshipsTableViewController">IDEDataModelPropertiesTableController</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="attributesTableViewController"> + <string key="name">attributesTableViewController</string> + <string key="candidateClassName">IDEDataModelPropertiesTableController</string> + </object> + <object class="IBToOneOutletInfo" key="capsuleView"> + <string key="name">capsuleView</string> + <string key="candidateClassName">IDECapsuleListView</string> + </object> + <object class="IBToOneOutletInfo" key="entityArrayController"> + <string key="name">entityArrayController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo" key="fetchedPropertiesTableViewController"> + <string key="name">fetchedPropertiesTableViewController</string> + <string key="candidateClassName">IDEDataModelPropertiesTableController</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDataModelEntityContentsEditor</string> + </object> + <object class="IBToOneOutletInfo" key="relationshipsTableViewController"> + <string key="name">relationshipsTableViewController</string> + <string key="candidateClassName">IDEDataModelPropertiesTableController</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelBrowserEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelConfigurationEditor</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="capsuleListView">IDECapsuleListView</string> + <string key="parentEditor">IDEDataModelEditor</string> + <string key="tableController">IDEDataModelConfigurationTableController</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="capsuleListView"> + <string key="name">capsuleListView</string> + <string key="candidateClassName">IDECapsuleListView</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDataModelEditor</string> + </object> + <object class="IBToOneOutletInfo" key="tableController"> + <string key="name">tableController</string> + <string key="candidateClassName">IDEDataModelConfigurationTableController</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelConfigurationEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelConfigurationTableController</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="configurationsArrayController">NSArrayController</string> + <string key="entitiesArrayController">NSArrayController</string> + <string key="parentEditor">IDEDataModelConfigurationEditor</string> + <string key="tableView">XDTableView</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="configurationsArrayController"> + <string key="name">configurationsArrayController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo" key="entitiesArrayController"> + <string key="name">entitiesArrayController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDataModelConfigurationEditor</string> + </object> + <object class="IBToOneOutletInfo" key="tableView"> + <string key="name">tableView</string> + <string key="candidateClassName">XDTableView</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelConfigurationTableController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelDiagramEditor</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="diagramView">XDDiagramView</string> + <string key="parentEditor">IDEDataModelEntityContentsEditor</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="diagramView"> + <string key="name">diagramView</string> + <string key="candidateClassName">XDDiagramView</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDataModelEntityContentsEditor</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelDiagramEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelEditor</string> + <string key="superclassName">IDEDMEditor</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="addEntityButton">DVTDelayedMenuButton</string> + <string key="addPropertyButton">DVTDelayedMenuButton</string> + <string key="browserDiagramSegmentControl">NSSegmentedControl</string> + <string key="configurationViewController">IDEDataModelConfigurationEditor</string> + <string key="entityContentsViewController">IDEDataModelEntityContentsEditor</string> + <string key="fetchRequestViewController">IDEDataModelFetchRequestEditor</string> + <string key="hierarchySegmentControl">NSSegmentedControl</string> + <string key="tabView">NSTabView</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="addEntityButton"> + <string key="name">addEntityButton</string> + <string key="candidateClassName">DVTDelayedMenuButton</string> + </object> + <object class="IBToOneOutletInfo" key="addPropertyButton"> + <string key="name">addPropertyButton</string> + <string key="candidateClassName">DVTDelayedMenuButton</string> + </object> + <object class="IBToOneOutletInfo" key="browserDiagramSegmentControl"> + <string key="name">browserDiagramSegmentControl</string> + <string key="candidateClassName">NSSegmentedControl</string> + </object> + <object class="IBToOneOutletInfo" key="configurationViewController"> + <string key="name">configurationViewController</string> + <string key="candidateClassName">IDEDataModelConfigurationEditor</string> + </object> + <object class="IBToOneOutletInfo" key="entityContentsViewController"> + <string key="name">entityContentsViewController</string> + <string key="candidateClassName">IDEDataModelEntityContentsEditor</string> + </object> + <object class="IBToOneOutletInfo" key="fetchRequestViewController"> + <string key="name">fetchRequestViewController</string> + <string key="candidateClassName">IDEDataModelFetchRequestEditor</string> + </object> + <object class="IBToOneOutletInfo" key="hierarchySegmentControl"> + <string key="name">hierarchySegmentControl</string> + <string key="candidateClassName">NSSegmentedControl</string> + </object> + <object class="IBToOneOutletInfo" key="tabView"> + <string key="name">tabView</string> + <string key="candidateClassName">NSTabView</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelEntityContentsEditor</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="browserViewController">IDEDataModelBrowserEditor</string> + <string key="diagramViewController">IDEDataModelDiagramEditor</string> + <string key="parentEditor">IDEDataModelEditor</string> + <string key="tabView">NSTabView</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="browserViewController"> + <string key="name">browserViewController</string> + <string key="candidateClassName">IDEDataModelBrowserEditor</string> + </object> + <object class="IBToOneOutletInfo" key="diagramViewController"> + <string key="name">diagramViewController</string> + <string key="candidateClassName">IDEDataModelDiagramEditor</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDataModelEditor</string> + </object> + <object class="IBToOneOutletInfo" key="tabView"> + <string key="name">tabView</string> + <string key="candidateClassName">NSTabView</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelEntityContentsEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelFetchRequestEditor</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="entityController">NSArrayController</string> + <string key="parentEditor">IDEDataModelEditor</string> + <string key="tableView">IDECapsuleListView</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="entityController"> + <string key="name">entityController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDataModelEditor</string> + </object> + <object class="IBToOneOutletInfo" key="tableView"> + <string key="name">tableView</string> + <string key="candidateClassName">IDECapsuleListView</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelFetchRequestEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDataModelPropertiesTableController</string> + <string key="superclassName">IDEDMEditorController</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="arrayController">IDEDMArrayController</string> + <string key="entitiesColumn">NSTableColumn</string> + <string key="entityArrayController">NSArrayController</string> + <string key="parentEditor">IDEDataModelBrowserEditor</string> + <string key="propertyNameAndImageCell">IDEDMHighlightImageAndTextCell</string> + <string key="tableView">XDTableView</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="arrayController"> + <string key="name">arrayController</string> + <string key="candidateClassName">IDEDMArrayController</string> + </object> + <object class="IBToOneOutletInfo" key="entitiesColumn"> + <string key="name">entitiesColumn</string> + <string key="candidateClassName">NSTableColumn</string> + </object> + <object class="IBToOneOutletInfo" key="entityArrayController"> + <string key="name">entityArrayController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo" key="parentEditor"> + <string key="name">parentEditor</string> + <string key="candidateClassName">IDEDataModelBrowserEditor</string> + </object> + <object class="IBToOneOutletInfo" key="propertyNameAndImageCell"> + <string key="name">propertyNameAndImageCell</string> + <string key="candidateClassName">IDEDMHighlightImageAndTextCell</string> + </object> + <object class="IBToOneOutletInfo" key="tableView"> + <string key="name">tableView</string> + <string key="candidateClassName">XDTableView</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDataModelPropertiesTableController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDocDownloadsTableViewController</string> + <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="_downloadButtonCell">NSButtonCell</string> + <string key="_tableView">DVTTableView</string> + <string key="prefPaneController">IDEDocViewingPrefPaneController</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="_downloadButtonCell"> + <string key="name">_downloadButtonCell</string> + <string key="candidateClassName">NSButtonCell</string> + </object> + <object class="IBToOneOutletInfo" key="_tableView"> + <string key="name">_tableView</string> + <string key="candidateClassName">DVTTableView</string> + </object> + <object class="IBToOneOutletInfo" key="prefPaneController"> + <string key="name">prefPaneController</string> + <string key="candidateClassName">IDEDocViewingPrefPaneController</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDocDownloadsTableViewController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDocSetOutlineView</string> + <string key="superclassName">NSOutlineView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDocSetOutlineView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDocSetOutlineViewController</string> + <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="getDocSetAction:">id</string> + <string key="showProblemInfoForUpdate:">id</string> + <string key="subscribeToPublisherAction:">id</string> + <string key="unsubscribeFromPublisher:">id</string> + <string key="updateDocSetAction:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="getDocSetAction:"> + <string key="name">getDocSetAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="showProblemInfoForUpdate:"> + <string key="name">showProblemInfoForUpdate:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="subscribeToPublisherAction:"> + <string key="name">subscribeToPublisherAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="unsubscribeFromPublisher:"> + <string key="name">unsubscribeFromPublisher:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="updateDocSetAction:"> + <string key="name">updateDocSetAction:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">docSetOutlineView</string> + <string key="NS.object.0">IDEDocSetOutlineView</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">docSetOutlineView</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">docSetOutlineView</string> + <string key="candidateClassName">IDEDocSetOutlineView</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDocSetOutlineViewController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEDocViewingPrefPaneController</string> + <string key="superclassName">IDEViewController</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="addSubscription:">id</string> + <string key="checkForAndInstallUpdatesNow:">id</string> + <string key="deleteDocSet:">id</string> + <string key="downloadAction:">id</string> + <string key="minimumFontSizeComboBoxAction:">id</string> + <string key="minimumFontSizeEnabledAction:">id</string> + <string key="showHelp:">id</string> + <string key="showSubscriptionSheet:">id</string> + <string key="subscriptionCancelAction:">id</string> + <string key="toggleAutoCheckForAndInstallUpdates:">id</string> + <string key="toggleDocSetInfo:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="addSubscription:"> + <string key="name">addSubscription:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="checkForAndInstallUpdatesNow:"> + <string key="name">checkForAndInstallUpdatesNow:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="deleteDocSet:"> + <string key="name">deleteDocSet:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="downloadAction:"> + <string key="name">downloadAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="minimumFontSizeComboBoxAction:"> + <string key="name">minimumFontSizeComboBoxAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="minimumFontSizeEnabledAction:"> + <string key="name">minimumFontSizeEnabledAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="showHelp:"> + <string key="name">showHelp:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="showSubscriptionSheet:"> + <string key="name">showSubscriptionSheet:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="subscriptionCancelAction:"> + <string key="name">subscriptionCancelAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleAutoCheckForAndInstallUpdates:"> + <string key="name">toggleAutoCheckForAndInstallUpdates:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleDocSetInfo:"> + <string key="name">toggleDocSetInfo:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="_addButton">DVTGradientImageButton</string> + <string key="_deleteButton">DVTGradientImageButton</string> + <string key="_showInfoAreaButton">DVTGradientImageButton</string> + <string key="_splitView">NSSplitView</string> + <string key="_splitViewDocSetInfoSubview">NSView</string> + <string key="_splitViewDocSetsListSubview">NSView</string> + <string key="borderedViewAroundSplitView">DVTBorderedView</string> + <string key="borderedViewBelowTable">DVTBorderedView</string> + <string key="checkAndInstallNowButton">NSButton</string> + <string key="docSetInfoTextView">NSTextView</string> + <string key="docSetOutlineViewController">IDEDocSetOutlineViewController</string> + <string key="downloadsTableViewController">IDEDocDownloadsTableViewController</string> + <string key="minimumFontSizeControl">NSComboBox</string> + <string key="noUpdatesAvailableMessage">NSTextField</string> + <string key="showInfoButton">NSButton</string> + <string key="subscriptionTextField">NSTextField</string> + <string key="subscriptionWindow">NSWindow</string> + <string key="validateAddSubscriptionButton">NSButton</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="_addButton"> + <string key="name">_addButton</string> + <string key="candidateClassName">DVTGradientImageButton</string> + </object> + <object class="IBToOneOutletInfo" key="_deleteButton"> + <string key="name">_deleteButton</string> + <string key="candidateClassName">DVTGradientImageButton</string> + </object> + <object class="IBToOneOutletInfo" key="_showInfoAreaButton"> + <string key="name">_showInfoAreaButton</string> + <string key="candidateClassName">DVTGradientImageButton</string> + </object> + <object class="IBToOneOutletInfo" key="_splitView"> + <string key="name">_splitView</string> + <string key="candidateClassName">NSSplitView</string> + </object> + <object class="IBToOneOutletInfo" key="_splitViewDocSetInfoSubview"> + <string key="name">_splitViewDocSetInfoSubview</string> + <string key="candidateClassName">NSView</string> + </object> + <object class="IBToOneOutletInfo" key="_splitViewDocSetsListSubview"> + <string key="name">_splitViewDocSetsListSubview</string> + <string key="candidateClassName">NSView</string> + </object> + <object class="IBToOneOutletInfo" key="borderedViewAroundSplitView"> + <string key="name">borderedViewAroundSplitView</string> + <string key="candidateClassName">DVTBorderedView</string> + </object> + <object class="IBToOneOutletInfo" key="borderedViewBelowTable"> + <string key="name">borderedViewBelowTable</string> + <string key="candidateClassName">DVTBorderedView</string> + </object> + <object class="IBToOneOutletInfo" key="checkAndInstallNowButton"> + <string key="name">checkAndInstallNowButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo" key="docSetInfoTextView"> + <string key="name">docSetInfoTextView</string> + <string key="candidateClassName">NSTextView</string> + </object> + <object class="IBToOneOutletInfo" key="docSetOutlineViewController"> + <string key="name">docSetOutlineViewController</string> + <string key="candidateClassName">IDEDocSetOutlineViewController</string> + </object> + <object class="IBToOneOutletInfo" key="downloadsTableViewController"> + <string key="name">downloadsTableViewController</string> + <string key="candidateClassName">IDEDocDownloadsTableViewController</string> + </object> + <object class="IBToOneOutletInfo" key="minimumFontSizeControl"> + <string key="name">minimumFontSizeControl</string> + <string key="candidateClassName">NSComboBox</string> + </object> + <object class="IBToOneOutletInfo" key="noUpdatesAvailableMessage"> + <string key="name">noUpdatesAvailableMessage</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo" key="showInfoButton"> + <string key="name">showInfoButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo" key="subscriptionTextField"> + <string key="name">subscriptionTextField</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo" key="subscriptionWindow"> + <string key="name">subscriptionWindow</string> + <string key="candidateClassName">NSWindow</string> + </object> + <object class="IBToOneOutletInfo" key="validateAddSubscriptionButton"> + <string key="name">validateAddSubscriptionButton</string> + <string key="candidateClassName">NSButton</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEDocViewingPrefPaneController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEEditor</string> + <string key="superclassName">IDEViewController</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IDEViewController</string> + <string key="superclassName">DVTViewController</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IDEViewController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">IKImageView</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="copy:">id</string> + <string key="crop:">id</string> + <string key="cut:">id</string> + <string key="paste:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="copy:"> + <string key="name">copy:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="crop:"> + <string key="name">crop:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="cut:"> + <string key="name">cut:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="paste:"> + <string key="name">paste:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/IKImageView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSDocument</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="printDocument:">id</string> + <string key="revertDocumentToSaved:">id</string> + <string key="runPageLayout:">id</string> + <string key="saveDocument:">id</string> + <string key="saveDocumentAs:">id</string> + <string key="saveDocumentTo:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="printDocument:"> + <string key="name">printDocument:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="revertDocumentToSaved:"> + <string key="name">revertDocumentToSaved:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="runPageLayout:"> + <string key="name">runPageLayout:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="saveDocument:"> + <string key="name">saveDocument:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="saveDocumentAs:"> + <string key="name">saveDocumentAs:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="saveDocumentTo:"> + <string key="name">saveDocumentTo:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/NSDocument.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSResponder</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">_insertFindPattern:</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">_insertFindPattern:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">_insertFindPattern:</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/NSResponder.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">QLPreviewBubble</string> + <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="hide:">id</string> + <string key="show:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="hide:"> + <string key="name">hide:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="show:"> + <string key="name">show:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">parentWindow</string> + <string key="NS.object.0">NSWindow</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">parentWindow</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">parentWindow</string> + <string key="candidateClassName">NSWindow</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/QLPreviewBubble.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">QTMovieView</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="showAll:">id</string> + <string key="showCustomButton:">id</string> + <string key="toggleLoops:">id</string> + <string key="zoomIn:">id</string> + <string key="zoomOut:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="showAll:"> + <string key="name">showAll:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="showCustomButton:"> + <string key="name">showCustomButton:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleLoops:"> + <string key="name">toggleLoops:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="zoomIn:"> + <string key="name">zoomIn:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="zoomOut:"> + <string key="name">zoomOut:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/QTMovieView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">WebView</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="reloadFromOrigin:">id</string> + <string key="resetPageZoom:">id</string> + <string key="zoomPageIn:">id</string> + <string key="zoomPageOut:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="reloadFromOrigin:"> + <string key="name">reloadFromOrigin:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="resetPageZoom:"> + <string key="name">resetPageZoom:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="zoomPageIn:"> + <string key="name">zoomPageIn:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="zoomPageOut:"> + <string key="name">zoomPageOut:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/WebView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">XDDiagramView</string> + <string key="superclassName">NSView</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="_graphLayouterMenuItemAction:">id</string> + <string key="_zoomPopUpButtonAction:">id</string> + <string key="alignBottomEdges:">id</string> + <string key="alignCentersHorizontallyInContainer:">id</string> + <string key="alignCentersVerticallyInContainer:">id</string> + <string key="alignHorizontalCenters:">id</string> + <string key="alignLeftEdges:">id</string> + <string key="alignRightEdges:">id</string> + <string key="alignTopEdges:">id</string> + <string key="alignVerticalCenters:">id</string> + <string key="bringToFront:">id</string> + <string key="collapseAllCompartments:">id</string> + <string key="copy:">id</string> + <string key="cut:">id</string> + <string key="delete:">id</string> + <string key="deleteBackward:">id</string> + <string key="deleteForward:">id</string> + <string key="deselectAll:">id</string> + <string key="diagramZoomIn:">id</string> + <string key="diagramZoomOut:">id</string> + <string key="expandAllCompartments:">id</string> + <string key="flipHorizontally:">id</string> + <string key="flipVertically:">id</string> + <string key="layoutGraphicsConcentrically:">id</string> + <string key="layoutGraphicsHierarchically:">id</string> + <string key="lock:">id</string> + <string key="makeSameHeight:">id</string> + <string key="makeSameWidth:">id</string> + <string key="moveDown:">id</string> + <string key="moveDownAndModifySelection:">id</string> + <string key="moveLeft:">id</string> + <string key="moveLeftAndModifySelection:">id</string> + <string key="moveRight:">id</string> + <string key="moveRightAndModifySelection:">id</string> + <string key="moveUp:">id</string> + <string key="moveUpAndModifySelection:">id</string> + <string key="paste:">id</string> + <string key="rollDownAllCompartments:">id</string> + <string key="rollUpAllCompartments:">id</string> + <string key="selectAll:">id</string> + <string key="sendToBack:">id</string> + <string key="sizeToFit:">id</string> + <string key="toggleGridShown:">id</string> + <string key="toggleHiddenGraphicsShown:">id</string> + <string key="togglePageBreaksShown:">id</string> + <string key="toggleRuler:">id</string> + <string key="toggleSnapsToGrid:">id</string> + <string key="unlock:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="_graphLayouterMenuItemAction:"> + <string key="name">_graphLayouterMenuItemAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="_zoomPopUpButtonAction:"> + <string key="name">_zoomPopUpButtonAction:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignBottomEdges:"> + <string key="name">alignBottomEdges:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignCentersHorizontallyInContainer:"> + <string key="name">alignCentersHorizontallyInContainer:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignCentersVerticallyInContainer:"> + <string key="name">alignCentersVerticallyInContainer:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignHorizontalCenters:"> + <string key="name">alignHorizontalCenters:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignLeftEdges:"> + <string key="name">alignLeftEdges:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignRightEdges:"> + <string key="name">alignRightEdges:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignTopEdges:"> + <string key="name">alignTopEdges:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="alignVerticalCenters:"> + <string key="name">alignVerticalCenters:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="bringToFront:"> + <string key="name">bringToFront:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="collapseAllCompartments:"> + <string key="name">collapseAllCompartments:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="copy:"> + <string key="name">copy:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="cut:"> + <string key="name">cut:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="delete:"> + <string key="name">delete:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="deleteBackward:"> + <string key="name">deleteBackward:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="deleteForward:"> + <string key="name">deleteForward:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="deselectAll:"> + <string key="name">deselectAll:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="diagramZoomIn:"> + <string key="name">diagramZoomIn:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="diagramZoomOut:"> + <string key="name">diagramZoomOut:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="expandAllCompartments:"> + <string key="name">expandAllCompartments:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="flipHorizontally:"> + <string key="name">flipHorizontally:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="flipVertically:"> + <string key="name">flipVertically:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="layoutGraphicsConcentrically:"> + <string key="name">layoutGraphicsConcentrically:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="layoutGraphicsHierarchically:"> + <string key="name">layoutGraphicsHierarchically:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="lock:"> + <string key="name">lock:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="makeSameHeight:"> + <string key="name">makeSameHeight:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="makeSameWidth:"> + <string key="name">makeSameWidth:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveDown:"> + <string key="name">moveDown:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveDownAndModifySelection:"> + <string key="name">moveDownAndModifySelection:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveLeft:"> + <string key="name">moveLeft:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveLeftAndModifySelection:"> + <string key="name">moveLeftAndModifySelection:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveRight:"> + <string key="name">moveRight:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveRightAndModifySelection:"> + <string key="name">moveRightAndModifySelection:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveUp:"> + <string key="name">moveUp:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="moveUpAndModifySelection:"> + <string key="name">moveUpAndModifySelection:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="paste:"> + <string key="name">paste:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="rollDownAllCompartments:"> + <string key="name">rollDownAllCompartments:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="rollUpAllCompartments:"> + <string key="name">rollUpAllCompartments:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="selectAll:"> + <string key="name">selectAll:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="sendToBack:"> + <string key="name">sendToBack:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="sizeToFit:"> + <string key="name">sizeToFit:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleGridShown:"> + <string key="name">toggleGridShown:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleHiddenGraphicsShown:"> + <string key="name">toggleHiddenGraphicsShown:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="togglePageBreaksShown:"> + <string key="name">togglePageBreaksShown:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleRuler:"> + <string key="name">toggleRuler:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleSnapsToGrid:"> + <string key="name">toggleSnapsToGrid:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="unlock:"> + <string key="name">unlock:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">_diagramController</string> + <string key="NS.object.0">IDEDataModelDiagramEditor</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">_diagramController</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">_diagramController</string> + <string key="candidateClassName">IDEDataModelDiagramEditor</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/XDDiagramView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">XDTableView</string> + <string key="superclassName">NSTableView</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">showAllTableColumns:</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">showAllTableColumns:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">showAllTableColumns:</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/XDTableView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">AppDelegate</string> + <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="applicationShouldTerminate:">id</string> + <string key="applicationWillFinishLaunching:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="applicationShouldTerminate:"> + <string key="name">applicationShouldTerminate:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="applicationWillFinishLaunching:"> + <string key="name">applicationWillFinishLaunching:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/AppDelegate.h</string> + </object> + </object> + </array> + </object> + <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> + <int key="IBDocument.defaultPropertyAccessControl">3</int> + <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> + <string key="NSMenuCheckmark">{11, 11}</string> + <string key="NSMenuMixedState">{10, 3}</string> + </dictionary> + <bool key="IBDocument.UseAutolayout">YES</bool> + </data> +</archive> diff --git a/examples/cocoa-application/app.qbs b/examples/cocoa-application/app.qbs index f684786ad..67558e8a5 100644 --- a/examples/cocoa-application/app.qbs +++ b/examples/cocoa-application/app.qbs @@ -48,11 +48,11 @@ ** ****************************************************************************/ -import qbs +import qbs.Utilities CppApplication { Depends { condition: product.condition; name: "ib" } - condition: qbs.hostOS.contains("macos") + condition: qbs.targetOS.contains("macos") name: "Cocoa Application" cpp.useObjcPrecompiledHeader: true @@ -100,4 +100,11 @@ CppApplication { } ib.appIconName: "AppIcon" + + Properties { + // codesign module only present starting from 1.19 + condition: Utilities.versionCompare(qbs.version, "1.19") >= 0 + codesign.enableCodeSigning: true + codesign.signingType: "ad-hoc" + } } diff --git a/examples/cocoa-application/CocoaApplication.qbs b/examples/cocoa-application/cocoa-application.qbs index 472758764..9c1ad1370 100644 --- a/examples/cocoa-application/CocoaApplication.qbs +++ b/examples/cocoa-application/cocoa-application.qbs @@ -49,7 +49,6 @@ ** ****************************************************************************/ -import qbs import qbs.Utilities Project { diff --git a/examples/cocoa-application/dmg.qbs b/examples/cocoa-application/dmg.qbs index 610c5d2a3..0ae68b297 100644 --- a/examples/cocoa-application/dmg.qbs +++ b/examples/cocoa-application/dmg.qbs @@ -48,13 +48,12 @@ ** ****************************************************************************/ -import qbs - AppleApplicationDiskImage { condition: qbs.targetOS.contains("macos") name: "Cocoa Application DMG" targetName: "cocoa-application-" + version version: "1.0" + builtByDefault: false Depends { name: "Cocoa Application" } Depends { name: "ib" } diff --git a/examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj b/examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj index 07f3a1a46..62d4425c9 100644 --- a/examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj +++ b/examples/cocoa-touch-application/CocoaTouchApplication.xcodeproj/project.pbxproj @@ -13,15 +13,13 @@ 14E3FEB4175FB2E800C857C6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEB2175FB2E800C857C6 /* InfoPlist.strings */; }; 14E3FEB6175FB2E800C857C6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEB5175FB2E800C857C6 /* main.m */; }; 14E3FEBA175FB2E800C857C6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEB9175FB2E800C857C6 /* AppDelegate.m */; }; - 14E3FEBC175FB2E800C857C6 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEBB175FB2E800C857C6 /* Default.png */; }; - 14E3FEBE175FB2E800C857C6 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEBD175FB2E800C857C6 /* Default@2x.png */; }; - 14E3FEC0175FB2E800C857C6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEBF175FB2E800C857C6 /* Default-568h@2x.png */; }; 14E3FEC3175FB2E800C857C6 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEC2175FB2E800C857C6 /* MasterViewController.m */; }; 14E3FEC6175FB2E900C857C6 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E3FEC5175FB2E900C857C6 /* DetailViewController.m */; }; 14E3FEC9175FB2E900C857C6 /* MasterViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FEC7175FB2E900C857C6 /* MasterViewController_iPhone.xib */; }; 14E3FECC175FB2E900C857C6 /* MasterViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FECA175FB2E900C857C6 /* MasterViewController_iPad.xib */; }; 14E3FECF175FB2E900C857C6 /* DetailViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FECD175FB2E900C857C6 /* DetailViewController_iPhone.xib */; }; 14E3FED2175FB2E900C857C6 /* DetailViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14E3FED0175FB2E900C857C6 /* DetailViewController_iPad.xib */; }; + AC83486F258674C900A9CBBB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AC83486E258674C900A9CBBB /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -35,9 +33,6 @@ 14E3FEB7175FB2E800C857C6 /* CocoaTouchApplication-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CocoaTouchApplication-Prefix.pch"; sourceTree = "<group>"; }; 14E3FEB8175FB2E800C857C6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 14E3FEB9175FB2E800C857C6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; - 14E3FEBB175FB2E800C857C6 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; }; - 14E3FEBD175FB2E800C857C6 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; }; - 14E3FEBF175FB2E800C857C6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; }; 14E3FEC1175FB2E800C857C6 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = "<group>"; }; 14E3FEC2175FB2E800C857C6 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = "<group>"; }; 14E3FEC4175FB2E800C857C6 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = "<group>"; }; @@ -46,6 +41,7 @@ 14E3FECB175FB2E900C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MasterViewController_iPad.xib; sourceTree = "<group>"; }; 14E3FECE175FB2E900C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController_iPhone.xib; sourceTree = "<group>"; }; 14E3FED1175FB2E900C857C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController_iPad.xib; sourceTree = "<group>"; }; + AC83486E258674C900A9CBBB /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -103,6 +99,7 @@ 14E3FECD175FB2E900C857C6 /* DetailViewController_iPhone.xib */, 14E3FED0175FB2E900C857C6 /* DetailViewController_iPad.xib */, 14E3FEB0175FB2E800C857C6 /* Supporting Files */, + AC83486E258674C900A9CBBB /* LaunchScreen.storyboard */, ); path = CocoaTouchApplication; sourceTree = "<group>"; @@ -114,9 +111,6 @@ 14E3FEB2175FB2E800C857C6 /* InfoPlist.strings */, 14E3FEB5175FB2E800C857C6 /* main.m */, 14E3FEB7175FB2E800C857C6 /* CocoaTouchApplication-Prefix.pch */, - 14E3FEBB175FB2E800C857C6 /* Default.png */, - 14E3FEBD175FB2E800C857C6 /* Default@2x.png */, - 14E3FEBF175FB2E800C857C6 /* Default-568h@2x.png */, ); name = "Supporting Files"; sourceTree = "<group>"; @@ -147,14 +141,15 @@ 14E3FE9E175FB2E800C857C6 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = "Petroules Corporation"; + LastUpgradeCheck = 1220; + ORGANIZATIONNAME = io.qbs; }; buildConfigurationList = 14E3FEA1175FB2E800C857C6 /* Build configuration list for PBXProject "CocoaTouchApplication" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 14E3FE9D175FB2E800C857C6; @@ -172,10 +167,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + AC83486F258674C900A9CBBB /* LaunchScreen.storyboard in Resources */, 14E3FEB4175FB2E800C857C6 /* InfoPlist.strings in Resources */, - 14E3FEBC175FB2E800C857C6 /* Default.png in Resources */, - 14E3FEBE175FB2E800C857C6 /* Default@2x.png in Resources */, - 14E3FEC0175FB2E800C857C6 /* Default-568h@2x.png in Resources */, 14E3FEC9175FB2E900C857C6 /* MasterViewController_iPhone.xib in Resources */, 14E3FECC175FB2E900C857C6 /* MasterViewController_iPad.xib in Resources */, 14E3FECF175FB2E900C857C6 /* DetailViewController_iPhone.xib in Resources */, @@ -247,27 +240,48 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -278,20 +292,40 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -305,6 +339,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "CocoaTouchApplication/CocoaTouchApplication-Prefix.pch"; INFOPLIST_FILE = "CocoaTouchApplication/CocoaTouchApplication-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "io.qbs.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -316,6 +351,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "CocoaTouchApplication/CocoaTouchApplication-Prefix.pch"; INFOPLIST_FILE = "CocoaTouchApplication/CocoaTouchApplication-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "io.qbs.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m b/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m index ed4d9f310..b93bcf2c7 100644 --- a/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m +++ b/examples/cocoa-touch-application/CocoaTouchApplication/AppDelegate.m @@ -40,32 +40,24 @@ @synthesize navigationController = _navigationController; @synthesize splitViewController = _splitViewController; -- (void)dealloc -{ - [_window release]; - [_navigationController release]; - [_splitViewController release]; - [super dealloc]; -} - - (BOOL)application:(UIApplication *) __unused application didFinishLaunchingWithOptions:(NSDictionary *) __unused launchOptions { - self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { - MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil] autorelease]; - self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; + MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil]; + self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; self.window.rootViewController = self.navigationController; } else { - MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPad" bundle:nil] autorelease]; - UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; + MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPad" bundle:nil]; + UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; - DetailViewController *detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController_iPad" bundle:nil] autorelease]; - UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease]; + DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPad" bundle:nil]; + UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController]; masterViewController.detailViewController = detailViewController; - self.splitViewController = [[[UISplitViewController alloc] init] autorelease]; + self.splitViewController = [[UISplitViewController alloc] init]; self.splitViewController.delegate = detailViewController; self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil]; diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist b/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist index f95cb4555..8075a9d96 100644 --- a/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist +++ b/examples/cocoa-touch-application/CocoaTouchApplication/CocoaTouchApplication-Info.plist @@ -9,7 +9,7 @@ <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIdentifier</key> - <string>org.example.${PRODUCT_NAME:rfc1034identifier}</string> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> @@ -24,6 +24,8 @@ <string>1.0</string> <key>LSRequiresIPhoneOS</key> <true/> + <key>UILaunchStoryboardName</key> + <string>LaunchScreen</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/Default-568h@2x.png b/examples/cocoa-touch-application/CocoaTouchApplication/Default-568h@2x.png Binary files differdeleted file mode 100644 index 0891b7aab..000000000 --- a/examples/cocoa-touch-application/CocoaTouchApplication/Default-568h@2x.png +++ /dev/null diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/Default.png b/examples/cocoa-touch-application/CocoaTouchApplication/Default.png Binary files differdeleted file mode 100644 index 4c8ca6f69..000000000 --- a/examples/cocoa-touch-application/CocoaTouchApplication/Default.png +++ /dev/null diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/Default@2x.png b/examples/cocoa-touch-application/CocoaTouchApplication/Default@2x.png Binary files differdeleted file mode 100644 index 35b84cffe..000000000 --- a/examples/cocoa-touch-application/CocoaTouchApplication/Default@2x.png +++ /dev/null diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m b/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m index 85a5d6ddb..dbe821650 100644 --- a/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m +++ b/examples/cocoa-touch-application/CocoaTouchApplication/DetailViewController.m @@ -41,21 +41,12 @@ @synthesize detailDescriptionLabel = _detailDescriptionLabel; @synthesize masterPopoverController = _masterPopoverController; -- (void)dealloc -{ - [_detailItem release]; - [_detailDescriptionLabel release]; - [_masterPopoverController release]; - [super dealloc]; -} - #pragma mark - Managing the detail item - (void)setDetailItem:(id)newDetailItem { if (_detailItem != newDetailItem) { - [_detailItem release]; - _detailItem = [newDetailItem retain]; + _detailItem = newDetailItem; // Update the view. [self configureView]; diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/LaunchScreen.storyboard b/examples/cocoa-touch-application/CocoaTouchApplication/LaunchScreen.storyboard new file mode 100644 index 000000000..344bbca5c --- /dev/null +++ b/examples/cocoa-touch-application/CocoaTouchApplication/LaunchScreen.storyboard @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> + <device id="retina3_5" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <scenes> + <!--View Controller--> + <scene sceneID="EHf-IW-A2E"> + <objects> + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2020 io.qbs. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd"> + <rect key="frame" x="0.0" y="439.5" width="320" height="20.5"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cocoa Touch Application" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb"> + <rect key="frame" x="0.0" y="139.5" width="320" height="43"/> + <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + </subviews> + <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/> + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <constraints> + <constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/> + <constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/> + <constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/> + <constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/> + <constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/> + <constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/> + </constraints> + </view> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="53" y="375"/> + </scene> + </scenes> +</document> diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m index ebac52dcd..fe8afba09 100644 --- a/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m +++ b/examples/cocoa-touch-application/CocoaTouchApplication/MasterViewController.m @@ -49,20 +49,13 @@ return self; } -- (void)dealloc -{ - [_detailViewController release]; - [_objects release]; - [super dealloc]; -} - - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.navigationItem.leftBarButtonItem = self.editButtonItem; - UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)] autorelease]; + UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)]; self.navigationItem.rightBarButtonItem = addButton; } @@ -101,7 +94,7 @@ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } @@ -150,7 +143,7 @@ NSDate *object = [_objects objectAtIndex:indexPath.row]; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { if (!self.detailViewController) { - self.detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController_iPhone" bundle:nil] autorelease]; + self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPhone" bundle:nil]; } self.detailViewController.detailItem = object; [self.navigationController pushViewController:self.detailViewController animated:YES]; diff --git a/examples/cocoa-touch-application/CocoaTouchApplication/main.m b/examples/cocoa-touch-application/CocoaTouchApplication/main.m index 7665efcf1..0d92018b6 100644 --- a/examples/cocoa-touch-application/CocoaTouchApplication/main.m +++ b/examples/cocoa-touch-application/CocoaTouchApplication/main.m @@ -33,8 +33,8 @@ int main(int argc, char *argv[]) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - [pool release]; - return retVal; + @autoreleasepool + { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } } diff --git a/examples/cocoa-touch-application/CocoaTouchApplication.qbs b/examples/cocoa-touch-application/cocoa-touch-application.qbs index cf0a273d5..c837cacf1 100644 --- a/examples/cocoa-touch-application/CocoaTouchApplication.qbs +++ b/examples/cocoa-touch-application/cocoa-touch-application.qbs @@ -49,30 +49,32 @@ ** ****************************************************************************/ -import qbs 1.0 - CppApplication { Depends { name: "xcode"; required: false } Depends { condition: product.condition; name: "ib" } - condition: qbs.hostOS.contains("macos") && xcode.present + condition: qbs.hostOS.contains("macos") && xcode.present && qbs.targetPlatform.contains("ios") name: "Cocoa Touch Application" + install: true - qbs.targetPlatform: "ios" - qbs.architecture: "arm64" + bundle.identifierPrefix: "io.qbs" + bundle.infoPlist: ({"UILaunchStoryboardName": "LaunchScreen"}) cpp.useObjcPrecompiledHeader: true - cpp.minimumIosVersion: "8.0" + cpp.minimumIosVersion: "9.0" + cpp.automaticReferenceCounting: true cpp.frameworks: [ "UIKit", "Foundation", "CoreGraphics" ] + // sample code signing settings: + // codesign.enableCodeSigning: true + // codesign.provisioningProfile: "my provisioning profile name" + // codesign.signingIdentity: "Apple Development: My Team Name" + Group { prefix: "CocoaTouchApplication/" files: [ "AppDelegate.h", "AppDelegate.m", "CocoaTouchApplication-Info.plist", - "Default-568h@2x.png", - "Default.png", - "Default@2x.png", "DetailViewController.h", "DetailViewController.m", "MasterViewController.h", @@ -87,13 +89,22 @@ CppApplication { files: [ "DetailViewController_iPad.xib", "DetailViewController_iPhone.xib", - "InfoPlist.strings", "MasterViewController_iPad.xib", "MasterViewController_iPhone.xib" ] } Group { + id: bundle_resources + files: [ + "CocoaTouchApplication/LaunchScreen.storyboard", + "CocoaTouchApplication/en.lproj/InfoPlist.strings" + ] + } + + bundle.resources: bundle_resources.files + + Group { name: "Xcode Project" files: [ "CocoaTouchApplication.xcodeproj/project.pbxproj" diff --git a/examples/code-generator/code-generator.qbs b/examples/code-generator/code-generator.qbs index df15dec5e..fdb0e1aac 100644 --- a/examples/code-generator/code-generator.qbs +++ b/examples/code-generator/code-generator.qbs @@ -47,7 +47,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import qbs Project { // A code generator that outputs a "Hello World" C++ program. @@ -55,10 +54,15 @@ Project { name: "hwgen" consoleApplication: true files: ["hwgen.cpp"] + Properties { + condition: qbs.toolchain.contains("gcc") || qbs.toolchain.contains("clang-cl") + cpp.cxxFlags: ["-Wno-deprecated-declarations"] + } } // Generate and build a hello-world application. CppApplication { + condition: qbs.targetPlatform === qbs.hostPlatform name: "hello-world" Depends { name: "hwgen" } Rule { diff --git a/examples/code-generator/hwgen.cpp b/examples/code-generator/hwgen.cpp index 1e2556648..90f2eadf4 100644 --- a/examples/code-generator/hwgen.cpp +++ b/examples/code-generator/hwgen.cpp @@ -54,12 +54,12 @@ int main(int argc, char **argv) { if (argc < 2) return 1; - FILE *f = fopen(argv[1], "w"); + std::FILE *f = std::fopen(argv[1], "w"); if (!f) return 2; - fprintf(f, "#include <cstdio>\n\n" - "int main()\n" - "{\n printf(\"Hello World!\\n\");\n return 0;\n}\n"); - fclose(f); + std::fprintf(f, "#include <cstdio>\n\n" + "int main()\n" + "{\n std::printf(\"Hello World!\\n\");\n return 0;\n}\n"); + std::fclose(f); return 0; } diff --git a/examples/collidingmice/collidingmice.qbs b/examples/collidingmice/collidingmice.qbs index 52231882e..8f93a3230 100644 --- a/examples/collidingmice/collidingmice.qbs +++ b/examples/collidingmice/collidingmice.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs 1.0 - CppApplication { name : "CollidingMice" Depends { name: "Qt.widgets" } diff --git a/examples/collidingmice/main.cpp b/examples/collidingmice/main.cpp index ffddf4c81..2d0514427 100644 --- a/examples/collidingmice/main.cpp +++ b/examples/collidingmice/main.cpp @@ -64,7 +64,6 @@ static const int MouseCount = 7; int main(int argc, char **argv) { QApplication app(argc, argv); - qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); //! [0] //! [1] diff --git a/examples/collidingmice/mouse.cpp b/examples/collidingmice/mouse.cpp index 7075ada38..bbc718649 100644 --- a/examples/collidingmice/mouse.cpp +++ b/examples/collidingmice/mouse.cpp @@ -71,9 +71,9 @@ static qreal normalizeAngle(qreal angle) //! [0] Mouse::Mouse() : angle(0), speed(0), mouseEyeDirection(0), - color(qrand() % 256, qrand() % 256, qrand() % 256) + color(m_rand.generate() % 256, m_rand.generate() % 256, m_rand.generate() % 256) { - setRotation(qrand() % (360 * 16)); + setRotation(m_rand.generate() % (360 * 16)); } //! [0] @@ -189,16 +189,16 @@ void Mouse::advance(int step) // Add some random movement //! [10] - if (dangerMice.size() > 1 && (qrand() % 10) == 0) { - if (qrand() % 1) - angle += (qrand() % 100) / 500.0; + if (dangerMice.size() > 1 && (m_rand.generate() % 10) == 0) { + if (m_rand.generate() % 1) + angle += (m_rand.generate() % 100) / 500.0; else - angle -= (qrand() % 100) / 500.0; + angle -= (m_rand.generate() % 100) / 500.0; } //! [10] //! [11] - speed += (-50 + qrand() % 100) / 100.0; + speed += (-50 + m_rand.generate() % 100) / 100.0; qreal dx = ::sin(angle) * 10; mouseEyeDirection = (qAbs(dx / 5) < 1) ? 0 : dx / 5; diff --git a/examples/collidingmice/mouse.h b/examples/collidingmice/mouse.h index a98618ea5..23b9faad5 100644 --- a/examples/collidingmice/mouse.h +++ b/examples/collidingmice/mouse.h @@ -52,6 +52,7 @@ #define MOUSE_H #include <QGraphicsItem> +#include <QRandomGenerator> //! [0] class Mouse : public QGraphicsItem @@ -68,6 +69,7 @@ protected: void advance(int step) override; private: + QRandomGenerator m_rand = QRandomGenerator::securelySeeded(); qreal angle; qreal speed; qreal mouseEyeDirection; diff --git a/examples/compiled-qml/myapp.qbs b/examples/compiled-qml/compiled-qml.qbs index 3a900fac9..5d5dd3a8c 100644 --- a/examples/compiled-qml/myapp.qbs +++ b/examples/compiled-qml/compiled-qml.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { Depends { name: "Qt.quick" } diff --git a/examples/examples.qbs b/examples/examples.qbs index ff6e7a191..fa8ed0f5c 100644 --- a/examples/examples.qbs +++ b/examples/examples.qbs @@ -48,24 +48,6 @@ ** ****************************************************************************/ -import qbs - -Project { - references: [ - "app-and-lib/app_and_lib.qbs", - "cocoa-application/CocoaApplication.qbs", - "cocoa-touch-application/CocoaTouchApplication.qbs", - "code-generator/code-generator.qbs", - "collidingmice/collidingmice.qbs", - "compiled-qml/myapp.qbs", - "grpc/ping-pong-grpc.qbs", - "helloworld-complex/hello.qbs", - "helloworld-minimal/hello.qbs", - "helloworld-qt/hello.qbs", - "install-bundle/install-bundle.qbs", - "protobuf/cpp/addressbook.qbs", - "protobuf/objc/addressbook.qbs", - "baremetal/baremetal.qbs", - "rule/rule.qbs", - ] +Product { + files: "**/*" } diff --git a/examples/exporters/exporters.qbs b/examples/exporters/exporters.qbs new file mode 100644 index 000000000..bae62e17c --- /dev/null +++ b/examples/exporters/exporters.qbs @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +Project { + references: [ + "lib_a/lib_a.qbs", + "lib_b/lib_b.qbs" + ] + qbsSearchPaths: "qbs" +} + diff --git a/examples/exporters/lib_a/lib_a.cpp b/examples/exporters/lib_a/lib_a.cpp new file mode 100644 index 000000000..e3e7f17d9 --- /dev/null +++ b/examples/exporters/lib_a/lib_a.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "lib_a.h" + +const char *bla() +{ + return "Hello World!"; +} diff --git a/examples/exporters/lib_a/lib_a.h b/examples/exporters/lib_a/lib_a.h new file mode 100644 index 000000000..f583421b9 --- /dev/null +++ b/examples/exporters/lib_a/lib_a.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LIB_A_H +#define LIB_A_H + +const char *bla(); + +#endif // LIB_A_H diff --git a/examples/exporters/lib_a/lib_a.qbs b/examples/exporters/lib_a/lib_a.qbs new file mode 100644 index 000000000..fedbb7074 --- /dev/null +++ b/examples/exporters/lib_a/lib_a.qbs @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +MyLibrary { + name: "lib_a" + files: ["lib_a.cpp"] + + Group { + name: "API headers" + files: ["lib_a.h"] + qbs.install: true + qbs.installDir: headersInstallDir + } + Export { + Depends { name: "cpp" } + cpp.dynamicLibraries: "z" + cpp.libraryPaths: "/opt/local/lib" + } +} + diff --git a/examples/exporters/lib_b/lib_b.cpp b/examples/exporters/lib_b/lib_b.cpp new file mode 100644 index 000000000..b29dc57b6 --- /dev/null +++ b/examples/exporters/lib_b/lib_b.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "lib_b.h" + +#include <lib_a.h> + +#include <cstdio> + +int foo() +{ + std::puts(bla()); + return 2; +} diff --git a/examples/exporters/lib_b/lib_b.h b/examples/exporters/lib_b/lib_b.h new file mode 100644 index 000000000..a3d3e3aee --- /dev/null +++ b/examples/exporters/lib_b/lib_b.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LIB_B_H +#define LIB_B_H + +int foo(); + +#endif // LIB_B_H diff --git a/examples/exporters/lib_b/lib_b.qbs b/examples/exporters/lib_b/lib_b.qbs new file mode 100644 index 000000000..0c680f3e0 --- /dev/null +++ b/examples/exporters/lib_b/lib_b.qbs @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +MyLibrary { + Depends { name: "lib_a" } + name: "lib_b" + files: ["lib_b.cpp"] + Group { + name: "API headers" + files: ["lib_b.h"] + qbs.install: true + qbs.installDir: headersInstallDir + } + Export { + Depends { name: 'lib_a' } + } +} diff --git a/examples/exporters/qbs/imports/MyLibrary.qbs b/examples/exporters/qbs/imports/MyLibrary.qbs new file mode 100644 index 000000000..4607776b3 --- /dev/null +++ b/examples/exporters/qbs/imports/MyLibrary.qbs @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import qbs.FileInfo + +StaticLibrary { + Depends { name: 'cpp' } + + property string headersInstallDir: "include" + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + prefixMapping: [{ + prefix: exportingProduct.sourceDirectory, + replacement: FileInfo.joinPaths(exportingProduct.qbs.installPrefix, + exportingProduct.headersInstallDir) + }] + } + install: true + + Depends { name: "Exporter.qbs" } + + Group { + fileTagsFilter: "Exporter.qbs.module" + qbs.install: install + qbs.installDir: FileInfo.joinPaths(installDir, "qbs", "modules", product.name) + } + + Depends { name: "Exporter.pkgconfig" } + Exporter.pkgconfig.versionEntry: "1.0" + + Group { + fileTagsFilter: ["Exporter.pkgconfig.pc"] + qbs.install: install + qbs.installDir: FileInfo.joinPaths(installDir, "pkgconfig") + } + + Depends { name: "Exporter.cmake" } + Group { + fileTagsFilter: ["Exporter.cmake.package"] + qbs.install: install + qbs.installDir: FileInfo.joinPaths(installDir, "cmake", product.name) + } + + Depends { name: 'bundle' } + bundle.isBundle: false +} + diff --git a/examples/flatbuffers/.clang-format b/examples/flatbuffers/.clang-format new file mode 100644 index 000000000..47a38a93f --- /dev/null +++ b/examples/flatbuffers/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: Never diff --git a/examples/flatbuffers/monster-c/conanfile.txt b/examples/flatbuffers/monster-c/conanfile.txt new file mode 100644 index 000000000..613119ec2 --- /dev/null +++ b/examples/flatbuffers/monster-c/conanfile.txt @@ -0,0 +1,6 @@ +[requires] +flatcc/0.6.1 +[tool_requires] +flatcc/0.6.1 +[generators] +QbsDeps diff --git a/examples/flatbuffers/monster-c/monster-c.qbs b/examples/flatbuffers/monster-c/monster-c.qbs new file mode 100644 index 000000000..e6abe749e --- /dev/null +++ b/examples/flatbuffers/monster-c/monster-c.qbs @@ -0,0 +1,12 @@ +CppApplication { + Depends { name: "flatbuf.c"; required: false } + + name: "monster_c" + consoleApplication: true + condition: flatbuf.c.present && qbs.targetPlatform === qbs.hostPlatform + + files: [ + "monster.c", + "../shared/monster.fbs" + ] +} diff --git a/examples/flatbuffers/monster-c/monster.c b/examples/flatbuffers/monster-c/monster.c new file mode 100644 index 000000000..6bf49d628 --- /dev/null +++ b/examples/flatbuffers/monster-c/monster.c @@ -0,0 +1,367 @@ +/* + * Copyright 2019 dvidelabs. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Example on how to build a Monster FlatBuffer. + + +// Note: while some older C89 compilers are supported when +// -DFLATCC_PORTABLE is defined, this particular sample is known not to +// not work with MSVC 2010 (MSVC 2013 is OK) due to inline variable +// declarations. These are easily move to the start of code blocks, but +// since we follow the step-wise tutorial, it isn't really practical +// in this case. The comment style is technically also in violation of C89. + + +#include "monster_builder.h" +// <string.h> and <assert.h> already included. + +// Convenient namespace macro to manage long namespace prefix. +// The ns macro makes it possible to write `ns(Monster_create(...))` +// instead of `MyGame_Sample_Monster_create(...)` +#undef ns +#define ns(x) FLATBUFFERS_WRAP_NAMESPACE(MyGame_Sample, x) // Specified in the schema. + +// A helper to simplify creating vectors from C-arrays. +#define c_vec_len(V) (sizeof(V)/sizeof((V)[0])) + +// This allows us to verify result in optimized builds. +#define test_assert(x) do { if (!(x)) { assert(0); return -1; }} while (0) + +// Bottom-up approach where we create child objects and store these +// in temporary references before a parent object is created with +// these references. +int create_monster_bottom_up(flatcc_builder_t *B, int flexible) +{ + flatbuffers_string_ref_t weapon_one_name = flatbuffers_string_create_str(B, "Sword"); + uint16_t weapon_one_damage = 3; + + flatbuffers_string_ref_t weapon_two_name = flatbuffers_string_create_str(B, "Axe"); + uint16_t weapon_two_damage = 5; + + // Use the `MyGame_Sample_Weapon_create` shortcut to create Weapons + // with all the fields set. + // + // In the C-API, verbs (here create) always follow the type name + // (here Weapon), prefixed by the namespace (here MyGame_Sample_): + // MyGame_Sample_Weapon_create(...), or ns(Weapone_create(...)). + ns(Weapon_ref_t) sword = ns(Weapon_create(B, weapon_one_name, weapon_one_damage)); + ns(Weapon_ref_t) axe = ns(Weapon_create(B, weapon_two_name, weapon_two_damage)); + + // Serialize a name for our monster, called "Orc". + // The _str suffix indicates the source is an ascii-z string. + flatbuffers_string_ref_t name = flatbuffers_string_create_str(B, "Orc"); + + // Create a `vector` representing the inventory of the Orc. Each number + // could correspond to an item that can be claimed after he is slain. + uint8_t treasure[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + flatbuffers_uint8_vec_ref_t inventory; + // `c_vec_len` is the convenience macro we defined earlier. + inventory = flatbuffers_uint8_vec_create(B, treasure, c_vec_len(treasure)); + + // Here we use a top-down approach locally to build a Weapons vector + // in-place instead of creating a temporary external vector to use + // as argument like we did with the `inventory` earlier on, but the + // overall approach is still bottom-up. + ns(Weapon_vec_start(B)); + ns(Weapon_vec_push(B, sword)); + ns(Weapon_vec_push(B, axe)); + ns(Weapon_vec_ref_t) weapons = ns(Weapon_vec_end(B)); + + + // Create a `Vec3`, representing the Orc's position in 3-D space. + ns(Vec3_t) pos = { 1.0f, 2.0f, 3.0f }; + + + // Set his hit points to 300 and his mana to 150. + uint16_t hp = 300; + // The default value is 150, so we will never store this field. + uint16_t mana = 150; + + // Create the equipment union. In the C++ language API this is given + // as two arguments to the create call, or as two separate add + // operations for the type and the table reference. Here we create + // a single union value that carries both the type and reference. + ns(Equipment_union_ref_t) equipped = ns(Equipment_as_Weapon(axe)); + + if (!flexible) { + // Finally, create the monster using the `Monster_create` helper function + // to set all fields. + // + // Note that the Equipment union only take up one argument in C, where + // C++ takes a type and an object argument. + ns(Monster_create_as_root(B, &pos, mana, hp, name, inventory, ns(Color_Red), + weapons, equipped)); + + // Unlike C++ we do not use a Finish call. Instead we use the + // `create_as_root` action which has better type safety and + // simplicity. + // + // However, we can also express this as: + // + // ns(Monster_ref_t) orc = ns(Monster_create(B, ...)); + // flatcc_builder_buffer_create(orc); + // + // In this approach the function should return the orc and + // let a calling function handle the flatcc_buffer_create call + // for a more composable setup that is also able to create child + // monsters. In general, `flatcc_builder` calls are best isolated + // in a containing driver function. + + } else { + + // A more flexible approach where we mix bottom-up and top-down + // style. We still create child objects first, but then create + // a top-down style monster object that we can manipulate in more + // detail. + + // It is important to pair `start_as_root` with `end_as_root`. + ns(Monster_start_as_root(B)); + ns(Monster_pos_create(B, 1.0f, 2.0f, 3.0f)); + // or alternatively + //ns(Monster_pos_add(&pos); + + ns(Monster_hp_add(B, hp)); + // Notice that `Monser_name_add` adds a string reference unlike the + // add_str and add_strn variants. + ns(Monster_name_add(B, name)); + ns(Monster_inventory_add(B, inventory)); + ns(Monster_color_add(B, ns(Color_Red))); + ns(Monster_weapons_add(B, weapons)); + ns(Monster_equipped_add(B, equipped)); + // Complete the monster object and make it the buffer root object. + ns(Monster_end_as_root(B)); + + // We could also drop the `as_root` suffix from Monster_start/end(B) + // and add the table as buffer root later: + // + // ns(Monster_ref_t) orc = ns(Monster_start(B)); + // ... + // ns(Monster_ref_t) orc = ns(Monster_end(B)); + // flatcc_builder_buffer_create(orc); + // + // It is best to keep the `flatcc_builder` calls in a containing + // driver function for modularity. + } + return 0; +} + +// Alternative top-down approach where parent objects are created before +// their children. We only need to save one reference because the `axe` +// object is used in two places effectively making the buffer object +// graph a DAG. +int create_monster_top_down(flatcc_builder_t *B) +{ + uint8_t treasure[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + size_t treasure_count = c_vec_len(treasure); + ns(Weapon_ref_t) axe; + + // NOTE: if we use end_as_root, we MUST also start as root. + ns(Monster_start_as_root(B)); + ns(Monster_pos_create(B, 1.0f, 2.0f, 3.0f)); + ns(Monster_hp_add(B, 300)); + //ns(Monster_mana_add(B, 150)); + // We use create_str instead of add because we have no existing string reference. + ns(Monster_name_create_str(B, "Orc")); + // Again we use create because we no existing vector object, only a C-array. + ns(Monster_inventory_create(B, treasure, treasure_count)); + ns(Monster_color_add(B, ns(Color_Red))); + if (1) { + ns(Monster_weapons_start(B)); + ns(Monster_weapons_push_create(B, flatbuffers_string_create_str(B, "Sword"), 3)); + // We reuse the axe object later. Note that we dereference a pointer + // because push always returns a short-term pointer to the stored element. + // We could also have created the axe object first and simply pushed it. + axe = *ns(Monster_weapons_push_create(B, flatbuffers_string_create_str(B, "Axe"), 5)); + ns(Monster_weapons_end(B)); + } else { + // We can have more control with the table elements added to a vector: + // + ns(Monster_weapons_start(B)); + ns(Monster_weapons_push_start(B)); + ns(Weapon_name_create_str(B, "Sword")); + ns(Weapon_damage_add(B, 3)); + ns(Monster_weapons_push_end(B)); + ns(Monster_weapons_push_start(B)); + ns(Weapon_name_create_str(B, "Axe")); + ns(Weapon_damage_add(B, 5)); + axe = *ns(Monster_weapons_push_end(B)); + ns(Monster_weapons_end(B)); + } + // Unions can get their type by using a type-specific add/create/start method. + ns(Monster_equipped_Weapon_add(B, axe)); + + ns(Monster_end_as_root(B)); + return 0; +} + +// This isn't strictly needed because the builder already included the reader, +// but we would need it if our reader were in a separate file. +#include "monster_reader.h" + +#undef ns +#define ns(x) FLATBUFFERS_WRAP_NAMESPACE(MyGame_Sample, x) // Specified in the schema. + +int access_monster_buffer(const void *buffer) +{ + // Note that we use the `table_t` suffix when reading a table object + // as opposed to the `ref_t` suffix used during the construction of + // the buffer. + ns(Monster_table_t) monster = ns(Monster_as_root(buffer)); + + // Note: root object pointers are NOT the same as the `buffer` pointer. + + // Make sure the buffer is accessible. + test_assert(monster != 0); + + uint16_t hp = ns(Monster_hp(monster)); + uint16_t mana = ns(Monster_mana(monster)); + // This is just a const char *, but it also supports a fast length operation. + flatbuffers_string_t name = ns(Monster_name(monster)); + size_t name_len = flatbuffers_string_len(name); + + test_assert(hp == 300); + // Since 150 is the default, we are reading a value that wasn't stored. + test_assert(mana == 150); + test_assert(0 == strcmp(name, "Orc")); + test_assert(name_len == strlen("Orc")); + + int hp_present = ns(Monster_hp_is_present(monster)); // 1 + int mana_present = ns(Monster_mana_is_present(monster)); // 0 + test_assert(hp_present); + test_assert(!mana_present); + + ns(Vec3_struct_t) pos = ns(Monster_pos(monster)); + // Make sure pos has been set. + test_assert(pos != 0); + float x = ns(Vec3_x(pos)); + float y = ns(Vec3_y(pos)); + float z = ns(Vec3_z(pos)); + + // The literal `f` suffix is important because double literals does + // not always map cleanly to 32-bit represention even with only a few digits: + // `1.0 == 1.0f`, but `3.2 != 3.2f`. + test_assert(x == 1.0f); + test_assert(y == 2.0f); + test_assert(z == 3.0f); + + // We can also read the position into a C-struct. We have to copy + // because we generally do not know if the native endian format + // matches the one stored in the buffer (pe: protocol endian). + ns(Vec3_t) pos_vec; + // `pe` indicates endian conversion from protocol to native. + ns(Vec3_copy_from_pe(&pos_vec, pos)); + test_assert(pos_vec.x == 1.0f); + test_assert(pos_vec.y == 2.0f); + test_assert(pos_vec.z == 3.0f); + + // This is a const uint8_t *, but it shouldn't be accessed directly + // to ensure proper endian conversion. However, uint8 (ubyte) are + // not sensitive endianness, so we *could* have accessed it directly. + // The compiler likely optimizes this so that it doesn't matter. + flatbuffers_uint8_vec_t inv = ns(Monster_inventory(monster)); + size_t inv_len = flatbuffers_uint8_vec_len(inv); + // Make sure the inventory has been set. + test_assert(inv != 0); + // If `inv` were absent, the length would 0, so the above test is redundant. + test_assert(inv_len == 10); + // Index 0 is the first, index 2 is the third. + // NOTE: C++ uses the `Get` terminology for vector elemetns, C use `at`. + uint8_t third_item = flatbuffers_uint8_vec_at(inv, 2); + test_assert(third_item == 2); + + ns(Weapon_vec_t) weapons = ns(Monster_weapons(monster)); + size_t weapons_len = ns(Weapon_vec_len(weapons)); + test_assert(weapons_len == 2); + // We can use `const char *` instead of `flatbuffers_string_t`. + const char *second_weapon_name = ns(Weapon_name(ns(Weapon_vec_at(weapons, 1)))); + uint16_t second_weapon_damage = ns(Weapon_damage(ns(Weapon_vec_at(weapons, 1)))); + test_assert(second_weapon_name != 0 && strcmp(second_weapon_name, "Axe") == 0); + test_assert(second_weapon_damage == 5); + + // Access union type field. + if (ns(Monster_equipped_type(monster)) == ns(Equipment_Weapon)) { + // Cast to appropriate type: + // C does not require the cast to Weapon_table_t, but C++ does. + ns(Weapon_table_t) weapon = (ns(Weapon_table_t)) ns(Monster_equipped(monster)); + const char *weapon_name = ns(Weapon_name(weapon)); + uint16_t weapon_damage = ns(Weapon_damage(weapon)); + + test_assert(0 == strcmp(weapon_name, "Axe")); + test_assert(weapon_damage == 5); + } + return 0; +} + +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + // Create a `FlatBufferBuilder`, which will be used to create our + // monsters' FlatBuffers. + flatcc_builder_t builder; + void *buf; + size_t size; + + // Silence warnings. + (void)argc; + (void)argv; + + // Initialize the builder object. + flatcc_builder_init(&builder); + test_assert(0 == create_monster_bottom_up(&builder, 0)); + + // Allocate and extract a readable buffer from internal builder heap. + // The returned buffer must be deallocated using `free`. + // NOTE: Finalizing the buffer does NOT change the builder, it + // just creates a snapshot of the builder content. + // NOTE2: finalize_buffer uses malloc while finalize_aligned_buffer + // uses a portable aligned allocation method. Often the malloc + // version is sufficient, but won't work for all schema on all + // systems. If the buffer is written to disk or network, but not + // accessed in memory, `finalize_buffer` is also sufficient. + buf = flatcc_builder_finalize_aligned_buffer(&builder, &size); + //buf = flatcc_builder_finalize_buffer(&builder, &size); + + // We now have a FlatBuffer we can store on disk or send over a network. + // ** file/network code goes here :) ** + // Instead, we're going to access it right away (as if we just received it). + //access_monster_buffer(buf); + + // prior to v0.5.0, use `aligned_free` + flatcc_builder_aligned_free(buf); + //free(buf); + // + // The builder object can optionally be reused after a reset which + // is faster than creating a new builder. Subsequent use might + // entirely avoid temporary allocations until finalizing the buffer. + flatcc_builder_reset(&builder); + test_assert(0 == create_monster_bottom_up(&builder, 1)); + buf = flatcc_builder_finalize_aligned_buffer(&builder, &size); + access_monster_buffer(buf); + flatcc_builder_aligned_free(buf); + flatcc_builder_reset(&builder); + create_monster_top_down(&builder); + buf = flatcc_builder_finalize_buffer(&builder, &size); + test_assert(0 == access_monster_buffer(buf)); + free(buf); + // Eventually the builder must be cleaned up: + flatcc_builder_clear(&builder); + + printf("The FlatBuffer was successfully created and accessed!\n"); + + return 0; +} + diff --git a/examples/flatbuffers/monster-cpp/conanfile.txt b/examples/flatbuffers/monster-cpp/conanfile.txt new file mode 100644 index 000000000..188da5897 --- /dev/null +++ b/examples/flatbuffers/monster-cpp/conanfile.txt @@ -0,0 +1,6 @@ +[requires] +flatbuffers/24.3.25 +[tool_requires] +flatbuffers/24.3.25 +[generators] +QbsDeps diff --git a/examples/flatbuffers/monster-cpp/monster-cpp.qbs b/examples/flatbuffers/monster-cpp/monster-cpp.qbs new file mode 100644 index 000000000..fdcc3fcfd --- /dev/null +++ b/examples/flatbuffers/monster-cpp/monster-cpp.qbs @@ -0,0 +1,12 @@ +CppApplication { + Depends { name: "flatbuf.cpp"; required: false } + + name: "monster_cpp" + consoleApplication: true + condition: flatbuf.cpp.present && qbs.targetPlatform === qbs.hostPlatform + + files: [ + "monster.cpp", + "../shared/monster.fbs" + ] +} diff --git a/examples/flatbuffers/monster-cpp/monster.cpp b/examples/flatbuffers/monster-cpp/monster.cpp new file mode 100644 index 000000000..d2348c820 --- /dev/null +++ b/examples/flatbuffers/monster-cpp/monster.cpp @@ -0,0 +1,104 @@ +/* + * Copyright 2015 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "monster_generated.h" // Already includes "flatbuffers/flatbuffers.h". + +using namespace MyGame::Sample; + +// Example how to use FlatBuffers to create and read binary buffers. + +int main(int /*argc*/, const char * /*argv*/ []) { + // Build up a serialized buffer algorithmically: + flatbuffers::FlatBufferBuilder builder; + + // First, lets serialize some weapons for the Monster: A 'sword' and an 'axe'. + auto weapon_one_name = builder.CreateString("Sword"); + short weapon_one_damage = 3; + + auto weapon_two_name = builder.CreateString("Axe"); + short weapon_two_damage = 5; + + // Use the `CreateWeapon` shortcut to create Weapons with all fields set. + auto sword = CreateWeapon(builder, weapon_one_name, weapon_one_damage); + auto axe = CreateWeapon(builder, weapon_two_name, weapon_two_damage); + + // Create a FlatBuffer's `vector` from the `std::vector`. + std::vector<flatbuffers::Offset<Weapon>> weapons_vector; + weapons_vector.push_back(sword); + weapons_vector.push_back(axe); + auto weapons = builder.CreateVector(weapons_vector); + + // Second, serialize the rest of the objects needed by the Monster. + auto position = Vec3(1.0f, 2.0f, 3.0f); + + auto name = builder.CreateString("MyMonster"); + + unsigned char inv_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + auto inventory = builder.CreateVector(inv_data, 10); + + // Shortcut for creating monster with all fields set: + auto orc = CreateMonster(builder, &position, 150, 80, name, inventory, + Color_Red, weapons, Equipment_Weapon, axe.Union()); + + builder.Finish(orc); // Serialize the root of the object. + + // We now have a FlatBuffer we can store on disk or send over a network. + + // ** file/network code goes here :) ** + // access builder.GetBufferPointer() for builder.GetSize() bytes + + // Instead, we're going to access it right away (as if we just received it). + + // Get access to the root: + auto monster = GetMonster(builder.GetBufferPointer()); + + // Get and test some scalar types from the FlatBuffer. + assert(monster->hp() == 80); + assert(monster->mana() == 150); // default + assert(monster->name()->str() == "MyMonster"); + + // Get and test a field of the FlatBuffer's `struct`. + auto pos = monster->pos(); + assert(pos); + assert(pos->z() == 3.0f); + (void)pos; + + // Get a test an element from the `inventory` FlatBuffer's `vector`. + auto inv = monster->inventory(); + assert(inv); + assert(inv->Get(9) == 9); + (void)inv; + + // Get and test the `weapons` FlatBuffers's `vector`. + std::string expected_weapon_names[] = { "Sword", "Axe" }; + short expected_weapon_damages[] = { 3, 5 }; + auto weps = monster->weapons(); + for (unsigned int i = 0; i < weps->size(); i++) { + assert(weps->Get(i)->name()->str() == expected_weapon_names[i]); + assert(weps->Get(i)->damage() == expected_weapon_damages[i]); + } + (void)expected_weapon_names; + (void)expected_weapon_damages; + + // Get and test the `Equipment` union (`equipped` field). + assert(monster->equipped_type() == Equipment_Weapon); + auto equipped = static_cast<const Weapon *>(monster->equipped()); + assert(equipped->name()->str() == "Axe"); + assert(equipped->damage() == 5); + (void)equipped; + + printf("The FlatBuffer was successfully created and verified!\n"); +} diff --git a/examples/flatbuffers/shared/monster.fbs b/examples/flatbuffers/shared/monster.fbs new file mode 100644 index 000000000..247b81771 --- /dev/null +++ b/examples/flatbuffers/shared/monster.fbs @@ -0,0 +1,32 @@ +// Example IDL file for our monster's schema. + +namespace MyGame.Sample; + +enum Color:byte { Red = 0, Green, Blue = 2 } + +union Equipment { Weapon } // Optionally add more tables. + +struct Vec3 { + x:float; + y:float; + z:float; +} + +table Monster { + pos:Vec3; + mana:short = 150; + hp:short = 100; + name:string; + friendly:bool = false (deprecated); + inventory:[ubyte]; + color:Color = Blue; + weapons:[Weapon]; + equipped:Equipment; +} + +table Weapon { + name:string; + damage:short; +} + +root_type Monster; diff --git a/examples/grpc/client.cpp b/examples/grpc/client.cpp index 55bcd866d..e6af8e5ec 100644 --- a/examples/grpc/client.cpp +++ b/examples/grpc/client.cpp @@ -1,30 +1,50 @@ /**************************************************************************** ** -** Copyright (C) 2019 Ivan Komissarov -** Contact: abbapoh@gmail.com +** Copyright (C) 2019 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ ** -** This file is part of Qbs. +** This file is part of the examples of Qbs. ** +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -51,7 +71,7 @@ class Client { public: - Client(std::shared_ptr<grpc::Channel> channel) + Client(const std::shared_ptr<grpc::Channel> &channel) : m_stub(PP::MyApi::NewStub(channel)) {} int ping(int count) { diff --git a/examples/grpc/ping-pong-grpc.qbs b/examples/grpc/grpc.qbs index 8d8909350..b6d169508 100644 --- a/examples/grpc/ping-pong-grpc.qbs +++ b/examples/grpc/grpc.qbs @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2019 Ivan Komissarov -** Contact: abbapoh@gmail.com +** Copyright (C) 2019 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qbs. ** @@ -32,16 +32,22 @@ import qbs.Utilities Project { condition: Utilities.versionCompare(qbs.version, "1.14") >= 0 + qbsModuleProviders: "qbspkgconfig" Application { Depends { name: "cpp" } Depends { name: "protobuf.cpp"; required: false } - condition: protobuf.cpp.present + condition: protobuf.cpp.present && qbs.targetPlatform === qbs.hostPlatform protobuf.cpp.useGrpc: true consoleApplication: true cpp.cxxLanguageVersion: "c++17" + cpp.minimumMacosVersion: "10.15" name: "client" files: "client.cpp" + Properties { + condition: qbs.toolchain.contains("gcc") + cpp.cxxFlags: "-Wno-deprecated-declarations" + } Group { files: "ping-pong-grpc.proto" fileTags: "protobuf.grpc" @@ -51,12 +57,17 @@ Project { Application { Depends { name: "cpp" } Depends { name: "protobuf.cpp"; required: false } - condition: protobuf.cpp.present + condition: protobuf.cpp.present && qbs.targetPlatform === qbs.hostPlatform protobuf.cpp.useGrpc: true consoleApplication: true cpp.cxxLanguageVersion: "c++17" + cpp.minimumMacosVersion: "10.15" name: "server" - files: "client.cpp" + files: "server.cpp" + Properties { + condition: qbs.toolchain.contains("gcc") + cpp.cxxFlags: "-Wno-deprecated-declarations" + } Group { files: "ping-pong-grpc.proto" fileTags: "protobuf.grpc" diff --git a/examples/grpc/server.cpp b/examples/grpc/server.cpp index 89d6f0096..74460d29d 100644 --- a/examples/grpc/server.cpp +++ b/examples/grpc/server.cpp @@ -1,30 +1,50 @@ /**************************************************************************** ** -** Copyright (C) 2019 Ivan Komissarov -** Contact: abbapoh@gmail.com +** Copyright (C) 2019 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ ** -** This file is part of Qbs. +** This file is part of the examples of Qbs. ** +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/helloworld-complex/hello.qbs b/examples/helloworld-complex/helloworld-complex.qbs index 725424e49..fab3fd516 100644 --- a/examples/helloworld-complex/hello.qbs +++ b/examples/helloworld-complex/helloworld-complex.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs 1.0 - Project { property bool hasSpecialFeature: true Application { @@ -74,7 +72,7 @@ Project { cpp.defines: { var defines = outer.concat([ 'HAVE_MAIN_CPP', - cpp.debugInformation ? '_DEBUG' : '_RELEASE' + cpp.debugInformation ? 'HAS_DEBUG' : 'HAS_RELEASE' ]); if (project.hasSpecialFeature) defines.push("HAS_SPECIAL_FEATURE"); diff --git a/examples/helloworld-complex/src/main.cpp b/examples/helloworld-complex/src/main.cpp index 691c401e5..54e215d13 100644 --- a/examples/helloworld-complex/src/main.cpp +++ b/examples/helloworld-complex/src/main.cpp @@ -67,10 +67,10 @@ int main() { someUsefulFunction(); -#ifdef _DEBUG - puts("Hello World! (debug version)"); -#else - puts("Hello World! (release version)"); +#if defined(HAS_DEBUG) + std::puts("Hello World! (debug version)"); +#elif defined(HAS_RELEASE) + std::puts("Hello World! (release version)"); #endif #ifdef HAS_SPECIAL_FEATURE bragAboutSpecialFeature(); diff --git a/examples/helloworld-minimal/hello.qbs b/examples/helloworld-minimal/helloworld-minimal.qbs index 5cad9f4bf..40149d01f 100644 --- a/examples/helloworld-minimal/hello.qbs +++ b/examples/helloworld-minimal/helloworld-minimal.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - CppApplication { name: "HelloWorld-minimal" files: "main.cpp" diff --git a/examples/helloworld-qt/hello.qbs b/examples/helloworld-qt/helloworld-qt.qbs index 4c6e070af..8d8b6e493 100644 --- a/examples/helloworld-qt/hello.qbs +++ b/examples/helloworld-qt/helloworld-qt.qbs @@ -48,8 +48,6 @@ ** ****************************************************************************/ -import qbs - QtApplication { name: "HelloWorld-Qt" files: "main.cpp" diff --git a/examples/helloworld-qt/main.cpp b/examples/helloworld-qt/main.cpp index 217fc12d0..e1e822591 100644 --- a/examples/helloworld-qt/main.cpp +++ b/examples/helloworld-qt/main.cpp @@ -55,5 +55,7 @@ int main() { - QTextStream(stdout) << QCoreApplication::translate("hello", "Hello, World!") << endl; + QTextStream ts(stdout); + ts << QCoreApplication::translate("hello", "Hello, World!\n"); + ts.flush(); } diff --git a/examples/install-bundle/install-bundle.qbs b/examples/install-bundle/install-bundle.qbs index ac5a6c255..cedfc2105 100644 --- a/examples/install-bundle/install-bundle.qbs +++ b/examples/install-bundle/install-bundle.qbs @@ -1,14 +1,17 @@ -import qbs import qbs.FileInfo Project { CppApplication { + Depends { name: "bundle" } Depends { name: "windowutils" } Depends { name: "ib"; condition: qbs.targetOS.contains("darwin") } Depends { name: "Qt"; submodules: ["core", "gui", "widgets"] } + condition: qbs.targetOS.contains("macos") + || qbs.targetOS.contains("linux") + || qbs.targetOS.contains("windows") name: "window" - property bool isBundle: qbs.targetOS.contains("darwin") && bundle.isBundle + property bool isBundle: bundle.isBundle targetName: isBundle ? "Window" : "window" files: [ "main.cpp", @@ -22,7 +25,7 @@ Project { cpp.minimumMacosVersion: "10.10" Group { - fileTagsFilter: isBundle ? ["bundle.content"] : ["application"] + fileTagsFilter: qbs.targetOS.contains("darwin") && isBundle ? ["bundle.content"] : ["application"] qbs.install: true qbs.installDir: isBundle ? "Applications" : (qbs.targetOS.contains("windows") ? "" : "bin") qbs.installSourceBase: product.buildDirectory @@ -30,6 +33,7 @@ Project { } DynamicLibrary { + Depends { name: "bundle" } Depends { name: "cpp" } name: "windowutils" diff --git a/examples/pkgconfig-provider/main.c b/examples/pkgconfig-provider/main.c new file mode 100644 index 000000000..398b06842 --- /dev/null +++ b/examples/pkgconfig-provider/main.c @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** MIT License + +** Copyright (c) 2017 Aleksander Alekseev + +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and associated documentation files (the "Software"), to deal +** in the Software without restriction, including without limitation the rights +** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +** copies of the Software, and to permit persons to whom the Software is +** furnished to do so, subject to the following conditions: + +** The above copyright notice and this permission notice shall be included in all +** copies or substantial portions of the Software. + +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +** SOFTWARE. +** +****************************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +#include <stdint.h> +#include <errno.h> +#include <limits.h> +#include <zlib.h> + +int main(int argc, char* argv[]) +{ + int res; + + if (argc < 2) + { + fprintf(stderr, "Usage: %s <fname>\n", argv[0]); + return 1; + } + + char* fname = argv[1]; + + struct stat file_stat; + res = stat(fname, &file_stat); + if (res == -1) + { + fprintf(stderr, "stat(...) failed, errno = %d\n", errno); + return 1; + } + + size_t temp_file_size = (size_t)file_stat.st_size; + if (temp_file_size >= INT_MAX) + { + fprintf(stderr, "Error: filze_size >= INT_MAX (%d)\n", INT_MAX); + return 1; + } + + int file_size = (int)temp_file_size; + int buff_size = file_size + 1; + void* file_buff = malloc(buff_size); + if (file_buff == NULL) + { + fprintf(stderr, "malloc(buff_size) failed, buff_size = %d\n", + file_size); + return 1; + } + + int fid = open(fname, O_RDONLY); + if (fid == -1) + { + fprintf(stderr, "open(...) failed, errno = %d\n", errno); + free(file_buff); + return 1; + } + + if (read(fid, file_buff, file_size) != file_size) + { + fprintf(stderr, "read(...) failed, errno = %d\n", errno); + free(file_buff); + close(fid); + return 1; + } + + close(fid); + + uLongf compress_buff_size = compressBound(file_size); + void* compress_buff = malloc(compress_buff_size); + if (compress_buff == NULL) + { + fprintf(stderr, + "malloc(compress_buff_size) failed, " + "compress_buff_size = %lu\n", + compress_buff_size); + free(file_buff); + return 1; + } + + uLongf compressed_size = compress_buff_size; + res = compress(compress_buff, &compressed_size, file_buff, file_size); + if (res != Z_OK) + { + fprintf(stderr, "compress(...) failed, res = %d\n", res); + free(compress_buff); + free(file_buff); + return 1; + } + + memset(file_buff, 0, buff_size); + uLongf decompressed_size = (uLongf)file_size; + res = uncompress(file_buff, &decompressed_size, + compress_buff, compressed_size); + if (res != Z_OK) + { + fprintf(stderr, "uncompress(...) failed, res = %d\n", res); + free(compress_buff); + free(file_buff); + return 1; + } + + printf( + "%s\n----------------\n" + "File size: %d, compress_buff_size: %lu, compressed_size: %lu, " + "decompressed_size: %lu\n", + (char*)file_buff, file_size, compress_buff_size, compressed_size, + decompressed_size); + + free(compress_buff); + free(file_buff); +} diff --git a/examples/pkgconfig-provider/pkgconfig-provider.qbs b/examples/pkgconfig-provider/pkgconfig-provider.qbs new file mode 100644 index 000000000..34ba32d03 --- /dev/null +++ b/examples/pkgconfig-provider/pkgconfig-provider.qbs @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2021 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +CppApplication { + consoleApplication: true + Depends { name: "zlib"; required: false } + condition: zlib.present + name: "PkgConfigProviderExample" + files: "main.c" + qbsModuleProviders: ["qbspkgconfig"] +} +//! [0] diff --git a/examples/protobuf/addressbook_conan/addressbook_conan.qbs b/examples/protobuf/addressbook_conan/addressbook_conan.qbs new file mode 100644 index 000000000..c496d14bd --- /dev/null +++ b/examples/protobuf/addressbook_conan/addressbook_conan.qbs @@ -0,0 +1,20 @@ +//![0] + +import qbs.Host + +CppApplication { + consoleApplication: true + condition: protobuf.cpp.present && qbs.targetPlatform === Host.platform() + + Depends { name: "cpp" } + cpp.minimumMacosVersion: "11.0" + + Depends { name: "protobuf.cpp"; required: false } + + files: [ + "../shared/addressbook.proto", + "main.cpp", + ] + qbsModuleProviders: "conan" +} +//![0] diff --git a/examples/protobuf/addressbook_conan/conanfile.txt b/examples/protobuf/addressbook_conan/conanfile.txt new file mode 100644 index 000000000..e7d849b1a --- /dev/null +++ b/examples/protobuf/addressbook_conan/conanfile.txt @@ -0,0 +1,6 @@ +[requires] +protobuf/3.21.12 +[tool_requires] +protobuf/3.21.12 +[generators] +QbsDeps diff --git a/examples/protobuf/addressbook_conan/main.cpp b/examples/protobuf/addressbook_conan/main.cpp new file mode 100644 index 000000000..76e1e0d74 --- /dev/null +++ b/examples/protobuf/addressbook_conan/main.cpp @@ -0,0 +1,180 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include <ctime> +#include <fstream> +#include <iostream> +#include <string> + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#include <google/protobuf/util/time_util.h> +#pragma GCC diagnostic pop +#else +#include <google/protobuf/util/time_util.h> +#endif // __GNUC__ + +#include "addressbook.pb.h" + +using google::protobuf::util::TimeUtil; + +int printUsage(char *argv0) +{ + std::cerr << "Usage: " << argv0 << "add|list ADDRESS_BOOK_FILE" << std::endl; + return -1; +} + +std::string readString(const std::string &promt) +{ + std::string result; + std::cout << promt; + std::getline(std::cin, result); + return result; +} + +// This function fills in a Person message based on user input. +void promptForAddress(tutorial::Person *person) +{ + std::cout << "Enter person ID number: "; + int id; + std::cin >> id; + person->set_id(id); + std::cin.ignore(256, '\n'); + + *person->mutable_name() = readString("Enter name: "); + + const auto email = readString("Enter email address (blank for none): "); + if (!email.empty()) + person->set_email(email); + + while (true) { + const auto number = readString("Enter a phone number (or leave blank to finish): "); + if (number.empty()) + break; + + tutorial::Person::PhoneNumber *phone_number = person->add_phones(); + phone_number->set_number(number); + + const auto type = readString("Is this a mobile, home, or work phone? "); + if (type == "mobile") + phone_number->set_type(tutorial::Person::MOBILE); + else if (type == "home") + phone_number->set_type(tutorial::Person::HOME); + else if (type == "work") + phone_number->set_type(tutorial::Person::WORK); + else + std::cout << "Unknown phone type. Using default." << std::endl; + } + *person->mutable_last_updated() = TimeUtil::SecondsToTimestamp(time(NULL)); +} + +// Iterates though all people in the AddressBook and prints info about them. +void listPeople(const tutorial::AddressBook &address_book) +{ + for (int i = 0; i < address_book.people_size(); i++) { + const tutorial::Person &person = address_book.people(i); + + std::cout << "Person ID: " << person.id() << std::endl; + std::cout << " Name: " << person.name() << std::endl; + if (!person.email().empty()) { + std::cout << " E-mail address: " << person.email() << std::endl; + } + + for (int j = 0; j < person.phones_size(); j++) { + const tutorial::Person::PhoneNumber &phone_number = person.phones(j); + + switch (phone_number.type()) { + case tutorial::Person::MOBILE: + std::cout << " Mobile phone #: "; + break; + case tutorial::Person::HOME: + std::cout << " Home phone #: "; + break; + case tutorial::Person::WORK: + std::cout << " Work phone #: "; + break; + default: + std::cout << " Unknown phone #: "; + break; + } + std::cout << phone_number.number() << std::endl; + } + if (person.has_last_updated()) { + std::cout << " Updated: " << TimeUtil::ToString(person.last_updated()) << std::endl; + } + } +} + +int main(int argc, char *argv[]) +{ + // Verify that the version of the library that we linked against is + // compatible with the version of the headers we compiled against. + GOOGLE_PROTOBUF_VERIFY_VERSION; + + if (argc != 3) + return printUsage(argv[0]); + + tutorial::AddressBook address_book; + + // Read the existing address book. + std::fstream input(argv[2], std::ios::in | std::ios::binary); + if (!input) { + std::cout << argv[2] << ": File not found." << std::endl; + } else if (!address_book.ParseFromIstream(&input)) { + std::cerr << "Failed to parse address book." << std::endl; + return -1; + } + + const std::string mode(argv[1]); + if (mode == "add") { + // Add an address. + promptForAddress(address_book.add_people()); + + if (!input) + std::cout << "Creating a new file." << std::endl; + + // Write the new address book back to disk. + std::fstream output(argv[2], std::ios::out | std::ios::trunc | std::ios::binary); + if (!address_book.SerializeToOstream(&output)) { + std::cerr << "Failed to write address book." << std::endl; + return -1; + } + } else if (mode == "list") { + listPeople(address_book); + } else { + return printUsage(argv[0]); + } + + // Optional: Delete all global objects allocated by libprotobuf. + google::protobuf::ShutdownProtobufLibrary(); + + return 0; +} diff --git a/examples/protobuf/cpp/README.md b/examples/protobuf/addressbook_cpp/README.md index f0e1b1a93..f0e1b1a93 100644 --- a/examples/protobuf/cpp/README.md +++ b/examples/protobuf/addressbook_cpp/README.md diff --git a/examples/protobuf/addressbook_cpp/addressbook_cpp.qbs b/examples/protobuf/addressbook_cpp/addressbook_cpp.qbs new file mode 100644 index 000000000..5a3b27652 --- /dev/null +++ b/examples/protobuf/addressbook_cpp/addressbook_cpp.qbs @@ -0,0 +1,18 @@ +import qbs.Host + +CppApplication { + consoleApplication: true + condition: protobuf.cpp.present && qbs.targetPlatform === Host.platform() + + Depends { name: "cpp" } + cpp.minimumMacosVersion: "10.15" + + Depends { name: "protobuf.cpp"; required: false } + + files: [ + "../shared/addressbook.proto", + "main.cpp", + "README.md", + ] + qbsModuleProviders: "qbspkgconfig" +} diff --git a/examples/protobuf/cpp/main.cpp b/examples/protobuf/addressbook_cpp/main.cpp index 8d2ca9763..31baba3d1 100644 --- a/examples/protobuf/cpp/main.cpp +++ b/examples/protobuf/addressbook_cpp/main.cpp @@ -30,10 +30,18 @@ #include <ctime> #include <fstream> -#include <google/protobuf/util/time_util.h> #include <iostream> #include <string> +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-parameter" +# include <google/protobuf/util/time_util.h> +# pragma GCC diagnostic pop +#else +# include <google/protobuf/util/time_util.h> +#endif // __GNUC__ + #include "addressbook.pb.h" using google::protobuf::util::TimeUtil; diff --git a/examples/protobuf/objc/README.md b/examples/protobuf/addressbook_objc/README.md index c0fc7c0e5..c0fc7c0e5 100644 --- a/examples/protobuf/objc/README.md +++ b/examples/protobuf/addressbook_objc/README.md diff --git a/examples/protobuf/addressbook_objc/addressbook_objc.qbs b/examples/protobuf/addressbook_objc/addressbook_objc.qbs new file mode 100644 index 000000000..a573b9015 --- /dev/null +++ b/examples/protobuf/addressbook_objc/addressbook_objc.qbs @@ -0,0 +1,13 @@ +CppApplication { + consoleApplication: true + condition: protobuf.objc.present && qbs.targetOS.contains("macos") + + Depends { name: "cpp" } + Depends { name: "protobuf.objc"; required: false } + + Group { + cpp.automaticReferenceCounting: true + files: "main.m" + } + files: "../shared/addressbook.proto" +} diff --git a/examples/protobuf/addressbook_objc/main.m b/examples/protobuf/addressbook_objc/main.m new file mode 100644 index 000000000..5e21fa060 --- /dev/null +++ b/examples/protobuf/addressbook_objc/main.m @@ -0,0 +1,183 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#import "Addressbook.pbobjc.h" + +#import <Foundation/Foundation.h> + +int printUsage(char *argv0) +{ + NSString *programName = [[NSString alloc] initWithUTF8String:argv0]; + NSLog(@"Usage: %@ add|list ADDRESS_BOOK_FILE", programName); + return -1; +} + +NSString *readString(NSString *promt) +{ + NSLog(@"%@", promt); + NSFileHandle *inputFile = [NSFileHandle fileHandleWithStandardInput]; + NSData *inputData = [inputFile availableData]; + NSString *result = [[NSString alloc] initWithData:inputData encoding:NSUTF8StringEncoding]; + result = [result stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + return result; +} + +// This function fills in a Person message based on user input. +void promptForAddress(Person* person) +{ + person.id_p = [readString(@"Enter person ID number:") intValue]; + person.name = readString(@"Enter name:"); + + NSString *email = readString(@"Enter email address (blank for none):"); + if ([email length] != 0) + person.email = email; + + while (true) { + NSString *number = readString(@"Enter a phone number (or leave blank to finish):"); + if ([number length] == 0) + break; + + Person_PhoneNumber* phoneNumber = [[Person_PhoneNumber alloc] init]; + phoneNumber.number = number; + + NSString *type = readString(@"Is this a mobile, home, or work phone?:"); + NSLog(@"\"%@\"", type); + if ([type compare:@"mobile"] == NSOrderedSame) + phoneNumber.type = Person_PhoneType_Mobile; + else if ([type compare:@"home"] == NSOrderedSame) + phoneNumber.type = Person_PhoneType_Home; + else if ([type compare:@"work"] == NSOrderedSame) + phoneNumber.type = Person_PhoneType_Work; + else + NSLog(@"Unknown phone type. Using default."); + + [person.phonesArray addObject:phoneNumber]; + } +} + +// Iterates though all people in the AddressBook and prints info about them. +void listPeople(AddressBook *addressBook) +{ + for (Person *person in addressBook.peopleArray) { + NSLog(@"Person ID: %d", person.id_p); + NSLog(@"Person name: %@", person.name); + + if ([person.email length] != 0) { + NSLog(@"E-mail address: %@", person.email); + } + + for (Person_PhoneNumber *phoneNumber in person.phonesArray) { + NSString *phonePrefix; + + switch (phoneNumber.type) { + case Person_PhoneType_Mobile: + phonePrefix = @"Mobile phone"; + break; + case Person_PhoneType_Home: + phonePrefix = @"Home phone"; + break; + case Person_PhoneType_Work: + phonePrefix = @"Work phone"; + break; + default: + phonePrefix = @"Unknown phone"; + break; + } + + NSLog(@" %@ #: %@", phonePrefix, phoneNumber.number); + } + printf("\n"); + } +} + +int main(int argc, char *argv[]) +{ + if (argc != 3) + return printUsage(argv[0]); + + @autoreleasepool + { + AddressBook *addressBook; + NSString *filePath = [[NSString alloc] initWithUTF8String:argv[2]]; + + // Read the existing address book. + NSData *data = [NSData dataWithContentsOfFile:filePath]; + if (!data) { + NSLog(@"%@ : File not found.", filePath); + addressBook = [[AddressBook alloc] init]; + } else { + NSError *error; + addressBook = [AddressBook parseFromData:data error:&error]; + if (!addressBook) { + NSLog(@"Failed to parse address book."); + return -1; + } + } + + if (strcmp(argv[1], "add") == 0) { + // Add an address. + Person *person = [[Person alloc] init]; + promptForAddress(person); + [addressBook.peopleArray addObject:person]; + + if (!data) { + NSLog(@"Creating a new file."); + } + [[addressBook data] writeToFile:filePath atomically:YES]; + } else if (strcmp(argv[1], "list") == 0) { + listPeople(addressBook); + } else { + return printUsage(argv[0]); + } + + return 0; + } +} diff --git a/examples/protobuf/cpp/addressbook.qbs b/examples/protobuf/cpp/addressbook.qbs deleted file mode 100644 index 35f8ee7fb..000000000 --- a/examples/protobuf/cpp/addressbook.qbs +++ /dev/null @@ -1,19 +0,0 @@ -import qbs - -CppApplication { - name: "addressbook_cpp" - consoleApplication: true - condition: protobuf.present - - Depends { name: "cpp" } - cpp.cxxLanguageVersion: "c++11" - cpp.warningLevel: "none" - - Depends { id: protobuf; name: "protobuf.cpp"; required: false } - - files: [ - "../shared/addressbook.proto", - "main.cpp", - "README.md", - ] -} diff --git a/examples/protobuf/objc/addressbook.qbs b/examples/protobuf/objc/addressbook.qbs deleted file mode 100644 index f087113d9..000000000 --- a/examples/protobuf/objc/addressbook.qbs +++ /dev/null @@ -1,15 +0,0 @@ -import qbs - -CppApplication { - name: "addressbook_objc" - consoleApplication: true - condition: protobuf.present && qbs.targetOS.contains("darwin") - - Depends { name: "cpp" } - Depends { id: protobuf; name: "protobuf.objc"; required: false } - - files: [ - "../shared/addressbook.proto", - "main.m", - ] -} diff --git a/examples/protobuf/objc/main.m b/examples/protobuf/objc/main.m deleted file mode 100644 index 903799fca..000000000 --- a/examples/protobuf/objc/main.m +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Ivan Komissarov -** Contact: abbapoh@gmail.com -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#import "Addressbook.pbobjc.h" - -#import <Foundation/Foundation.h> - -int printUsage(char *argv0) -{ - NSString *programName = [[NSString alloc] initWithUTF8String:argv0]; - NSLog(@"%@", [[NSString alloc] initWithFormat:@"Usage: %@ add|list ADDRESS_BOOK_FILE", programName]); - [programName release]; - return -1; -} - -NSString *readString(NSString *promt) -{ - NSLog(@"%@", promt); - NSFileHandle *inputFile = [NSFileHandle fileHandleWithStandardInput]; - NSData *inputData = [inputFile availableData]; - NSString *result = [[[NSString alloc]initWithData:inputData encoding:NSUTF8StringEncoding] autorelease]; - result = [[result stringByTrimmingCharactersInSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet]] autorelease]; - return result; -} - -// This function fills in a Person message based on user input. -void promptForAddress(Person* person) -{ - person.id_p = [readString(@"Enter person ID number:") intValue]; - person.name = readString(@"Enter name:"); - - NSString *email = readString(@"Enter email address (blank for none):"); - if ([email length] != 0) - person.email = email; - - while (true) { - NSString *number = readString(@"Enter a phone number (or leave blank to finish):"); - if ([number length] == 0) - break; - - Person_PhoneNumber* phoneNumber = [[Person_PhoneNumber alloc] init]; - phoneNumber.number = number; - - NSString *type = readString(@"Is this a mobile, home, or work phone?:"); - NSLog(@"\"%@\"", type); - if ([type compare:@"mobile"] == NSOrderedSame) - phoneNumber.type = Person_PhoneType_Mobile; - else if ([type compare:@"home"] == NSOrderedSame) - phoneNumber.type = Person_PhoneType_Home; - else if ([type compare:@"work"] == NSOrderedSame) - phoneNumber.type = Person_PhoneType_Work; - else - NSLog(@"%@", @"Unknown phone type. Using default."); - - [person.phonesArray addObject:phoneNumber]; - } -} - -// Iterates though all people in the AddressBook and prints info about them. -void listPeople(AddressBook *addressBook) -{ - NSArray *people = addressBook.peopleArray; - for (unsigned i = 0; i < [people count]; i++) { - Person *person = [people objectAtIndex:i]; - - NSLog(@"%@", [[[NSString alloc] initWithFormat:@"Person ID: %d", person.id_p] autorelease]); - NSLog(@"%@", [[[NSString alloc] initWithFormat:@"Person name: %@", person.name] autorelease]); - - if ([person.email length] != 0) { - NSLog(@"%@", [[[NSString alloc] initWithFormat:@"E-mail address: %@", person.email] autorelease]); - } - - NSArray *phones = person.phonesArray; - for (unsigned j = 0; j < [phones count]; j++) { - Person_PhoneNumber *phoneNumber = [phones objectAtIndex:j]; - NSString *phonePrefix; - - switch (phoneNumber.type) { - case Person_PhoneType_Mobile: - phonePrefix = @"Mobile phone"; - break; - case Person_PhoneType_Home: - phonePrefix = @"Home phone"; - break; - case Person_PhoneType_Work: - phonePrefix = @"Work phone"; - break; - default: - phonePrefix = @"Unknown phone"; - break; - } - - NSLog(@"%@", [[[NSString alloc] initWithFormat:@" %@ #: %@", phonePrefix, phoneNumber.number] autorelease]); - } - printf("\n"); - } -} - -int main(int argc, char *argv[]) -{ - if (argc != 3) - return printUsage(argv[0]); - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - AddressBook *addressBook;// = [AddressBook alloc]; - NSString *filePath = [[[NSString alloc] initWithUTF8String:argv[2]] autorelease]; - - // Read the existing address book. - NSData *data = [NSData dataWithContentsOfFile:filePath]; - if (!data) { - NSLog(@"%@", [[NSString alloc] initWithFormat:@"%@ : File not found.", filePath]); - addressBook = [[[AddressBook alloc] init] autorelease]; - } else { - NSError *error; - addressBook = [AddressBook parseFromData:data error:&error]; - if (!addressBook) { - NSLog(@"%@", @"Failed to parse address book."); - [pool drain]; - return -1; - } - } - - if (strcmp(argv[1], "add") == 0) { - // Add an address. - Person *person = [[Person alloc] init]; - promptForAddress(person); - [addressBook.peopleArray addObject:person]; - - if (!data) { - NSLog(@"%@", @"Creating a new file."); - } - [[addressBook data] writeToFile:filePath atomically:YES]; - } else if (strcmp(argv[1], "list") == 0) { - listPeople(addressBook); - } else { - [pool drain]; - return printUsage(argv[0]); - } - - [pool drain]; - return 0; -} diff --git a/examples/rpaths/main.cpp b/examples/rpaths/main.cpp new file mode 100644 index 000000000..b1b9a6d2b --- /dev/null +++ b/examples/rpaths/main.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "objecta.h" +#include "objectb.h" + +#include <iostream> + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + std::cout << ObjectA::className() << std::endl; + std::cout << ObjectB::className() << std::endl; + + ObjectB b; + std::cout << b.getA().name() << std::endl; + + return 0; +} diff --git a/examples/rpaths/objecta.cpp b/examples/rpaths/objecta.cpp new file mode 100644 index 000000000..7fbce6d70 --- /dev/null +++ b/examples/rpaths/objecta.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "objecta.h" + +ObjectA::ObjectA(std::string name) : + m_name(std::move(name)) +{ +} + +std::string ObjectA::className() +{ + return "ObjectA"; +} + +const std::string &ObjectA::name() const +{ + return m_name; +} + +void ObjectA::setName(std::string name) +{ + m_name = std::move(name); +} diff --git a/examples/rpaths/objecta.h b/examples/rpaths/objecta.h new file mode 100644 index 000000000..e2bf145e5 --- /dev/null +++ b/examples/rpaths/objecta.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OBJECTA_H +#define OBJECTA_H + +#include <string> + +class ObjectA +{ +public: + explicit ObjectA(std::string name); + + static std::string className(); + + const std::string &name() const; + void setName(std::string name); + +private: + std::string m_name; +}; + +#endif // OBJECTA_H diff --git a/examples/rpaths/objectb.cpp b/examples/rpaths/objectb.cpp new file mode 100644 index 000000000..228a68b0e --- /dev/null +++ b/examples/rpaths/objectb.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "objectb.h" + +ObjectB::ObjectB() = default; + +std::string ObjectB::className() +{ + return "ObjectB"; +} + +const ObjectA &ObjectB::getA() const +{ + return objectA; +} + diff --git a/examples/rpaths/objectb.h b/examples/rpaths/objectb.h new file mode 100644 index 000000000..7c0602a1b --- /dev/null +++ b/examples/rpaths/objectb.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Ivan Komissarov (abbapoh@gmail.com) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of Qbs. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OBJECTB_H +#define OBJECTB_H + +#include <string> + +#include "objecta.h" + +class ObjectB +{ +public: + ObjectB(); + + static std::string className(); + + const ObjectA &getA() const; + +private: + ObjectA objectA{"A"}; +}; + +#endif // OBJECTB_H diff --git a/examples/rpaths/rpaths.qbs b/examples/rpaths/rpaths.qbs new file mode 100644 index 000000000..59d48174a --- /dev/null +++ b/examples/rpaths/rpaths.qbs @@ -0,0 +1,61 @@ +import qbs.FileInfo + +Project { + condition: qbs.targetOS.contains("unix") + + //! [0] + DynamicLibrary { + Depends { name: "cpp" } + Depends { name: "bundle" } + name: "LibraryA" + bundle.isBundle: false + cpp.sonamePrefix: qbs.targetOS.contains("macos") ? "@rpath" : undefined + cpp.rpaths: cpp.rpathOrigin + cpp.cxxLanguageVersion: "c++11" + cpp.minimumMacosVersion: "10.8" + files: [ + "objecta.cpp", + "objecta.h", + ] + install: true + installDir: "examples/lib" + } + //! [0] + + //! [1] + DynamicLibrary { + Depends { name: "cpp" } + Depends { name: "bundle" } + Depends { name: "LibraryA" } + name: "LibraryB" + bundle.isBundle: false + cpp.cxxLanguageVersion: "c++11" + cpp.minimumMacosVersion: "10.8" + cpp.sonamePrefix: qbs.targetOS.contains("macos") ? "@rpath" : undefined + cpp.rpaths: cpp.rpathOrigin + files: [ + "objectb.cpp", + "objectb.h", + ] + install: true + installDir: "examples/lib" + } + //! [1] + + //! [2] + CppApplication { + Depends { name: "bundle" } + Depends { name: "LibraryA" } + Depends { name: "LibraryB" } + name: "rpaths-app" + files: "main.cpp" + consoleApplication: true + bundle.isBundle: false + cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin, "..", "lib") + cpp.cxxLanguageVersion: "c++11" + cpp.minimumMacosVersion: "10.8" + install: true + installDir: "examples/bin" + } + //! [2] +} diff --git a/examples/rule/rule.qbs b/examples/rule/rule.qbs index 8ec14ee40..f462a3708 100644 --- a/examples/rule/rule.qbs +++ b/examples/rule/rule.qbs @@ -19,7 +19,7 @@ Product { } prepare: { var cmd = new JavaScriptCommand(); - cmd.description = input.fileName + "->" + output.fileName; + cmd.description = "generating" + output.fileName + " from " + input.fileName; cmd.highlight = "codegen"; cmd.sourceCode = function() { var file = new TextFile(input.filePath); |