From ccd44240c0f370bb92feac4d24666b9266cfd4b6 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Sun, 10 Sep 2017 00:24:13 -0400 Subject: [PATCH] Add syntax highlight support for resource files. Add a file detector for assembly and resource files. Make the disk image smaller to save default project space. Add a GNO shell target. Rename project templates to be clearer --- pkg/Specifications/OrcaRez.xclangspec | 126 ++++++++++ .../TemplateInfo.plist | 172 ++++++++++++++ .../___PACKAGENAME___.xcscheme | 90 ++++++++ .../Asm ORCA Shell Command.xctemplate/main.s | 22 ++ .../TemplateInfo.plist | 204 +++++++++++++++++ .../___PACKAGENAME___.xcscheme | 98 ++++++++ .../main.c | 32 +++ .../TemplateInfo.plist | 216 ++++++++++++++++++ .../___PACKAGENAME___.xcscheme | 98 ++++++++ .../C Control Panel.xctemplate/main.c | 177 ++++++++++++++ .../C Control Panel.xctemplate/main.h | 19 ++ .../C Control Panel.xctemplate/main.rez | 130 +++++++++++ .../TemplateInfo.plist | 216 ++++++++++++++++++ .../___PACKAGENAME___.xcscheme | 98 ++++++++ .../C Desktop Application.xctemplate/main.c | 123 ++++++++++ .../C Desktop Application.xctemplate/main.h | 38 +++ .../C Desktop Application.xctemplate/main.rez | 207 +++++++++++++++++ .../TemplateInfo.plist | 172 ++++++++++++++ .../___PACKAGENAME___.xcscheme | 90 ++++++++ .../C GNO Shell Command.xctemplate/main.c | 18 ++ .../TemplateInfo.plist | 216 ++++++++++++++++++ .../___PACKAGENAME___.xcscheme | 98 ++++++++ .../C New Desk Accessory.xctemplate/main.c | 203 ++++++++++++++++ .../C New Desk Accessory.xctemplate/main.h | 19 ++ .../C New Desk Accessory.xctemplate/main.rez | 41 ++++ .../TemplateInfo.plist | 172 ++++++++++++++ .../___PACKAGENAME___.xcscheme | 90 ++++++++ .../C ORCA Shell Command.xctemplate/main.c | 18 ++ 28 files changed, 3203 insertions(+) create mode 100644 pkg/Specifications/OrcaRez.xclangspec create mode 100644 pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/TemplateInfo.plist create mode 100644 pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme create mode 100644 pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/main.s create mode 100644 pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/TemplateInfo.plist create mode 100644 pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme create mode 100644 pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/main.c create mode 100644 pkg/Templates/Apple IIgs/C Control Panel.xctemplate/TemplateInfo.plist create mode 100644 pkg/Templates/Apple IIgs/C Control Panel.xctemplate/___PACKAGENAME___.xcscheme create mode 100644 pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.c create mode 100644 pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.h create mode 100644 pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.rez create mode 100644 pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/TemplateInfo.plist create mode 100644 pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/___PACKAGENAME___.xcscheme create mode 100644 pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.c create mode 100644 pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.h create mode 100644 pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.rez create mode 100644 pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/TemplateInfo.plist create mode 100644 pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/___PACKAGENAME___.xcscheme create mode 100644 pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/main.c create mode 100644 pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/TemplateInfo.plist create mode 100644 pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme create mode 100644 pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.c create mode 100644 pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.h create mode 100644 pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.rez create mode 100644 pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/TemplateInfo.plist create mode 100644 pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme create mode 100644 pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/main.c diff --git a/pkg/Specifications/OrcaRez.xclangspec b/pkg/Specifications/OrcaRez.xclangspec new file mode 100644 index 0000000..69e37a9 --- /dev/null +++ b/pkg/Specifications/OrcaRez.xclangspec @@ -0,0 +1,126 @@ +// Orca/M Resource language specs +( + +/****************************************************************************/ +// MARK: Keywords +/****************************************************************************/ + + { + Identifier = "xcode.lang.orca.rez.identifier"; + Syntax = { + CaseSensitive = NO; + StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_~"; + Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_~"; + Type = "xcode.syntax.identifier"; + }; + }, + + { + Identifier = "xcode.lang.orca.rez.keyword"; + Syntax = { + CaseSensitive = NO; + StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_~"; + Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_~"; + Words = ( + "include", + "read", + "data", + "type", + "delete", + "change", + "resource", + + "unlocked", + "locked", + "moveable", + "fixed", + "nonconvert", + "convert", + "handleload", + "absoluteload", + "nonpurgeable", + "purgeable1", + "purgeable2", + "purgeable3", + "unprotected", + "protected", + "nonpreload", + "preload", + "crossbank", + "nocrossbank", + "specialmemory", + "nospecialmemory", + "notpagealigned", + "pagealigned", + + "array", + "bitstring", + "boolean", + "byte", + "char", + "cstring", + "fill", + "integer", + "longint", + "point", + "pstring", + "rect", + "string", + "switch", + "wstring", + ); + Type = "xcode.syntax.keyword"; + AltType = "xcode.syntax.identifier"; + }; + }, + +/****************************************************************************/ +// MARK: Simple Syntax Coloring +/****************************************************************************/ + + { + Identifier = "xcode.lang.orca.rez"; + Description = "ORCA Resource Coloring"; + BasedOn = "xcode.lang.simpleColoring"; + UsesCLikeIndentation = YES; + IncludeInMenu = YES; + Name = "Resources (ORCA)"; + Syntax = { + Tokenizer = "xcode.lang.orca.rez.lexer"; + IncludeRules = ( + "xcode.lang.orca.rez.codeblock", + ); + Type = "xcode.syntax.plain"; + }; + }, + { + Identifier = "xcode.lang.orca.rez.lexer"; + Syntax = { + IncludeRules = ( + "xcode.lang.comment", + "xcode.lang.comment.singleline", + "xcode.lang.c.preprocessor", + "xcode.lang.string", + "xcode.lang.character", + "xcode.lang.number", + "xcode.lang.orca.rez.keyword", + "xcode.lang.orca.rez.identifier", + ); + }; + }, + + { + Identifier = "xcode.lang.orca.rez.codeblock"; + Syntax = { + Tokenizer = "xcode.lang.orca.rez.lexer"; + Start = "{"; + End = "}"; + Recursive = YES; + Foldable = YES; + Type = "xcode.syntax.definition.function"; + IncludeRules = ( + ); + }; + }, + +) diff --git a/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..d4d23eb --- /dev/null +++ b/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/TemplateInfo.plist @@ -0,0 +1,172 @@ + + + + + Nodes + + main.s + Makefile + make/head.mk + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/tail.mk + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + main.s + + Path + main.s + + make/head.mk + + Group + make + Path + make/head.mk + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsOrcaAsmShellCommand + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs assembly code project to build an ORCA shell command. The project starts with a single assembly file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + inline(X,Y)="" + pascal="" + HEADER_SEARCH_PATHS + $GOLDEN_GATE/Libraries/ORCACDefs + ~/Library/GoldenGate/Libraries/ORCACDefs + /Library/GoldenGate/Libraries/ORCACDefs + ~/GoldenGate/Libraries/ORCACDefs + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..7e96971 --- /dev/null +++ b/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/main.s b/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/main.s new file mode 100644 index 0000000..9d7047f --- /dev/null +++ b/pkg/Templates/Apple IIgs/Asm ORCA Shell Command.xctemplate/main.s @@ -0,0 +1,22 @@ +; +; ___FILENAME___ +; ___PROJECTNAME___ +; +; Created by ___FULLUSERNAME___ on ___DATE___. +;___COPYRIGHT___ +; + + mcopy main.macros + keep main + +Main start + phk + plb + jsl SystemEnvironmentInit + jsl SysIOStartup + puts #'Hello, world!',cr=t + jsl SysIOShutdown + lda #0 + rtl + end + diff --git a/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..e47722c --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/TemplateInfo.plist @@ -0,0 +1,204 @@ + + + + + Nodes + + main.c + Makefile + make/config.txt + make/createDiskImage + make/head.mk + make/launchEmulator + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/system601.2mg + make/tail.mk + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + main.c + + Path + main.c + + make/config.txt + + Group + make + Path + make/config.txt + + make/createDiskImage + + Group + make + Path + make/createDiskImage + + make/head.mk + + Group + make + Path + make/head.mk + + make/launchEmulator + + Group + make + Path + make/launchEmulator + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/system601.2mg + + Group + make + Path + make/system601.2mg + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsCCDA + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build a classic desk accessory. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + inline(X,Y)="" + pascal="" + HEADER_SEARCH_PATHS + $GOLDEN_GATE/Libraries/ORCACDefs + ~/Library/GoldenGate/Libraries/ORCACDefs + /Library/GoldenGate/Libraries/ORCACDefs + ~/GoldenGate/Libraries/ORCACDefs + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..61815a2 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/main.c b/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/main.c new file mode 100644 index 0000000..27df588 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Classic Desk Accessory.xctemplate/main.c @@ -0,0 +1,32 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + + +#pragma cda "___PACKAGENAME___" start shutdown + + +#include + + +char str[256]; + +void start(void) +{ + printf("Hello, world!\n"); + printf("\n\n Press ENTER to quit..."); + + fgets(str, sizeof(str), stdin); +} + + +void shutdown(void) +{ +} + diff --git a/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..4d1815e --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/TemplateInfo.plist @@ -0,0 +1,216 @@ + + + + + Nodes + + main.c + main.h + main.rez + Makefile + make/config.txt + make/createDiskImage + make/head.mk + make/launchEmulator + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/system601.2mg + make/tail.mk + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + main.c + + Path + main.c + + main.h + + Path + main.h + + main.rez + + Path + main.rez + + make/config.txt + + Group + make + Path + make/config.txt + + make/createDiskImage + + Group + make + Path + make/createDiskImage + + make/head.mk + + Group + make + Path + make/head.mk + + make/launchEmulator + + Group + make + Path + make/launchEmulator + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/system601.2mg + + Group + make + Path + make/system601.2mg + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsCCDev + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build a control panel. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + inline(X,Y)="" + pascal="" + HEADER_SEARCH_PATHS + $GOLDEN_GATE/Libraries/ORCACDefs + ~/Library/GoldenGate/Libraries/ORCACDefs + /Library/GoldenGate/Libraries/ORCACDefs + ~/GoldenGate/Libraries/ORCACDefs + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..61815a2 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.c b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.c new file mode 100644 index 0000000..139d50a --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.c @@ -0,0 +1,177 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + +#pragma cdev entry + +#include +#include +#include +#include + +#include "main.h" + + +/* CDev Message Numbers + * (Why aren't these in an include file somewhere?) + * Check out FTN.C7.XXXX in the file type tech notes for + * more information about CDevs. + */ +#define machineCDev 1 +#define bootCDev 2 +#define reservedCDev 3 +#define initCDev 4 +#define closeCDev 5 +#define eventsCDev 6 +#define createCDev 7 +#define aboutCDev 8 +#define rectCDev 9 +#define hitCDev 10 +#define runCDev 11 +#define editCDev 12 + + + +long doMachine(void) +{ + /* Return non-zero if you cannot be opened on this machine + * (and maybe display an alert explaining why). + */ + return 1; +} + + +void doBoot(int *flag) +{ + /* Set bit 0 to 1 in flag if you want to draw at X through + * the icon at boot time to indicate that this CDev will not + * load. + */ + +#if 0 + /* Enable this line to set bit 0 to 1. */ + *flag |= 1; +#endif +} + + +void doInit(GrafPortPtr windowPtr) +{ +} + + +void doClose(GrafPortPtr windowPtr) +{ +} + + +void doEvents(GrafPortPtr windowPtr, EventRecord *eventPtr) +{ +} + + +void doAbout(GrafPortPtr windowPtr) +{ + NewControl2(windowPtr, resourceToResource, HELP_RESOURCE); +} + + +void doCreate(GrafPortPtr windowPtr) +{ + NewControl2(windowPtr, resourceToResource, MAIN_RESOURCE); +} + + +void doRect(Rect *rectPtr) +{ +} + + +void doHit(Handle controlHandle, long controlID) +{ +} + + +void doRun(GrafPortPtr windowPtr) +{ +} + + +void doEdit(GrafPortPtr windowPtr, int action) +{ + switch (action) { + case undoAction: + break; + + case cutAction: + break; + + case copyAction: + break; + + case pasteAction: + break; + + case clearAction: + break; + } +} + + +long entry(long data2, long data1, int message) + +{ + GrafPortPtr windowPtr = (void *) data1; + + switch (message) { + case machineCDev: + return doMachine(); + + case bootCDev: + doBoot((int *)data1); + break; + + case initCDev: + doInit((GrafPortPtr)data1); + break; + + case closeCDev: + doClose((GrafPortPtr)data1); + break; + + case eventsCDev: + doEvents((GrafPortPtr)data2, (EventRecord *)data1); + break; + + case createCDev: + doCreate((GrafPortPtr)data1); + break; + + case aboutCDev: + doAbout((GrafPortPtr)data1); + break; + + case rectCDev: + doRect((Rect *)data1); + break; + + case hitCDev: + doHit((Handle)data1, data2); + break; + + case runCDev: + doRun((GrafPortPtr)data1); + break; + + case editCDev: + doEdit((GrafPortPtr)data2, (int)(data1 & 0xffff)); + break; + } + return 1; +} diff --git a/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.h b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.h new file mode 100644 index 0000000..0ba70f5 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.h @@ -0,0 +1,19 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + +#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ +#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ + + +#define CDEV_RESOURCE 0x1 +#define MAIN_RESOURCE 0x100 +#define HELP_RESOURCE 0x101 + + +#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */ diff --git a/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.rez b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.rez new file mode 100644 index 0000000..3bf09c5 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Control Panel.xctemplate/main.rez @@ -0,0 +1,130 @@ +/* + * ___FILENAME___ + * ___PROJECTNAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * ___COPYRIGHT___ + */ + + +#include "types.rez" + +#include "___FILEBASENAME___.h" + + +/* This is the required resource to tell the control panel about the CDev */ +resource rCDEVFlags (CDEV_RESOURCE) { + 0x00C0, /* This sets the wantCreate and wantAbout bits */ + /* Set more bits if you want other messages */ + 1, + 1, + 1, + 0, + {0, 0, 110, 200}, + "___PROJECTNAME___", + "___FULLUSERNAME___", + "1.0" +}; + + +/* Code resource; the executable part of the CDev */ +read rCDevCode (CDEV_RESOURCE,convert) "___PROJECTNAME___.bin"; + + +/* This is the icon displayed by the control panel */ +resource rIcon (CDEV_RESOURCE) { + 0x8000, /* color icon */ + 20, /* height in pixels */ + 28, /* width in pixels */ + $"FFFFFFFFFFFFFFFFFFFFFFFFFFFF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FFFFFFFFFFFFFFFFFFFFFFFFFFFF", + + $"0000000000000000000000000000" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"0000000000000000000000000000" +}; + + +/* The following resources define the various controls in the main display */ +resource rControlList (MAIN_RESOURCE) { + { + MAIN_RESOURCE, + }; +}; + +resource rControlTemplate (MAIN_RESOURCE) { + 0x00000001, /* control id */ + {38,5,49,205}, /* control rectangle */ + statTextControl {{ /* control type */ + 0x0000, /* flags */ + 0x1002, /* more flags */ + 0, /* ref con */ + MAIN_RESOURCE, /* text reference */ + 13 /* text length */ + }}; +}; + + +resource rTextForLETextBox2 (MAIN_RESOURCE) { + "Hello, world!" +}; + +/* The following resources define the controls for the help screen */ +resource rControlList (HELP_RESOURCE) { + { + HELP_RESOURCE, + }; +}; + +resource rControlTemplate (HELP_RESOURCE) { + 0x00000002, /* control id */ + {38,5,49,205}, /* control rectangle */ + statTextControl {{ /* control type */ + 0x0000, /* flags */ + 0x1002, /* more flags */ + 0, /* ref con */ + HELP_RESOURCE, /* text reference */ + 19 /* text length */ + }}; +}; + +resource rTextForLETextBox2 (HELP_RESOURCE) { + "Put help info here." +}; + diff --git a/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..bc5009c --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/TemplateInfo.plist @@ -0,0 +1,216 @@ + + + + + Nodes + + main.c + main.h + main.rez + Makefile + make/config.txt + make/createDiskImage + make/head.mk + make/launchEmulator + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/system601.2mg + make/tail.mk + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + main.c + + Path + main.c + + main.h + + Path + main.h + + main.rez + + Path + main.rez + + make/config.txt + + Group + make + Path + make/config.txt + + make/createDiskImage + + Group + make + Path + make/createDiskImage + + make/head.mk + + Group + make + Path + make/head.mk + + make/launchEmulator + + Group + make + Path + make/launchEmulator + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/system601.2mg + + Group + make + Path + make/system601.2mg + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsCDesktopApp + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build desktop application. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + inline(X,Y)="" + pascal="" + HEADER_SEARCH_PATHS + $GOLDEN_GATE/Libraries/ORCACDefs + ~/Library/GoldenGate/Libraries/ORCACDefs + /Library/GoldenGate/Libraries/ORCACDefs + ~/GoldenGate/Libraries/ORCACDefs + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..61815a2 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.c b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.c new file mode 100644 index 0000000..2c8685e --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.c @@ -0,0 +1,123 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include "___FILEBASENAME___.h" + + +BOOLEAN done; +EventRecord myEvent; + + +void DoAbout(void) +{ + AlertWindow(awCString + awResource, NULL, aboutAlertString); +} + + +GrafPortPtr NewDocument(void) +{ + return(NewWindow2("\pMyWindow", 0, NULL, NULL, 0x02, windowRes, rWindParam1)); +} + + +void CloseDocument(GrafPortPtr wPtr) +{ + if (wPtr != NULL) { + CloseWindow(wPtr); + } +} + + +void HandleMenu(void) +{ + int menuNum; + int menuItemNum; + + menuNum = myEvent.wmTaskData >> 16; + menuItemNum = myEvent.wmTaskData; + + switch (menuItemNum) { + case appleAbout: + DoAbout(); + break; + case fileNew: + NewDocument(); + break; + case fileOpen: + NewDocument(); + break; + case fileClose: + CloseDocument(FrontWindow()); + break; + case fileQuit: + done = TRUE; + break; + case editUndo: + break; + case editCut: + break; + case editCopy: + break; + case editPaste: + break; + case editClear: + break; + } + HiliteMenu(FALSE, menuNum); +} + + +void InitMenus(void) +{ + int height; + MenuBarRecHndl menuBarHand; + + menuBarHand = NewMenuBar2(refIsResource, menuBar, NULL); + SetSysBar(menuBarHand); + SetMenuBar(NULL); + FixAppleMenu(appleMenu); + height = FixMenuBar(); + DrawMenuBar(); +} + + +int main(void) +{ + int event; + + startdesk(640); + InitMenus(); + InitCursor(); + + done = FALSE; + myEvent.wmTaskMask = 0x001F7FFF; + while (!done) { + event = TaskMaster(everyEvent, &myEvent); + switch (event) { + case wInSpecial: + case wInMenuBar: + HandleMenu(); + break; + case wInGoAway: + CloseDocument((GrafPortPtr)myEvent.wmTaskData); + break; + } + } + enddesk(); +} + diff --git a/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.h b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.h new file mode 100644 index 0000000..a7b42f9 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.h @@ -0,0 +1,38 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + +#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ +#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ + + +#define menuBar 1 + +#define appleMenu 3 +#define fileMenu 4 +#define editMenu 5 + +#define editUndo 250 +#define editCut 251 +#define editCopy 252 +#define editPaste 253 +#define editClear 254 + +#define fileNew 401 +#define fileOpen 402 +#define fileClose 255 +#define fileQuit 256 + +#define appleAbout 301 + +#define aboutAlertString 1 + +#define windowRes 1001 + + +#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */ diff --git a/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.rez b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.rez new file mode 100644 index 0000000..46be5fd --- /dev/null +++ b/pkg/Templates/Apple IIgs/C Desktop Application.xctemplate/main.rez @@ -0,0 +1,207 @@ +/* + * ___FILENAME___ + * ___PROJECTNAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * ___COPYRIGHT___ + */ + + +#include "types.rez" +#include "___FILEBASENAME___.h" + + +resource rMenuBar (menuBar) { + { + appleMenu, + fileMenu, + editMenu + }; +}; + + +resource rMenu (appleMenu) { + appleMenu, + refIsResource * menuTitleRefShift + + refIsResource * itemRefShift + + fAllowCache, + appleMenu, + { + appleAbout + }; +}; + + +resource rMenu (fileMenu) { + fileMenu, + refIsResource * menuTitleRefShift + + refIsResource * itemRefShift + + fAllowCache, + fileMenu, + { + fileNew, + fileOpen, + fileClose, + fileQuit + }; +}; + + +resource rMenu (editMenu) { + editMenu, + refIsResource * menuTitleRefShift + + refIsResource * itemRefShift + + fAllowCache, + editMenu, + { + editUndo, + editCut, + editCopy, + editPaste, + editClear + }; +}; + + +resource rMenuItem (editUndo) { + editUndo, + "Z", "z", + 0, + refIsResource * itemTitleRefShift + + fDivider, + editUndo +}; + + +resource rMenuItem (editCut) { + editCut, + "X", "x", + 0, + refIsResource * itemTitleRefShift, + editCut +}; + + +resource rMenuItem (editCopy) { + editCopy, + "C", "c", + 0, + refIsResource * itemTitleRefShift, + editCopy +}; + + +resource rMenuItem (editPaste) { + editPaste, + "V", "v", + 0, + refIsResource * itemTitleRefShift, + editPaste +}; + + +resource rMenuItem (editClear) { + editClear, + "", "", + 0, + refIsResource * itemTitleRefShift, + editClear +}; + + +resource rMenuItem (fileNew) { + fileNew, + "N", "n", + 0, + refIsResource * itemTitleRefShift, + fileNew +}; + + +resource rMenuItem (fileOpen) { + fileOpen, + "O", "o", + 0, + refIsResource * itemTitleRefShift + + fDivider, + fileOpen +}; + + +resource rMenuItem (fileClose) { + fileClose, + "W", "w", + 0, + refIsResource * itemTitleRefShift + + fDivider, + fileClose +}; + + +resource rMenuItem (fileQuit) { + fileQuit, + "Q", "q", + 0, + refIsResource * itemTitleRefShift, + fileQuit +}; + + +resource rMenuItem (appleAbout) { + appleAbout, + "", "", + 0, + refIsResource * itemTitleRefShift + + fDivider, + appleAbout +}; + + +resource rPString (appleMenu, noCrossBank) {"@"}; +resource rPString (fileMenu, noCrossBank) {" File "}; +resource rPString (editMenu, noCrossBank) {" Edit "}; + +resource rPString (editUndo, noCrossBank) {"Undo"}; +resource rPString (editCut, noCrossBank) {"Cut"}; +resource rPString (editCopy, noCrossBank) {"Copy"}; +resource rPString (editPaste, noCrossBank) {"Paste"}; +resource rPString (editClear, noCrossBank) {"Clear"}; + +resource rPString (fileNew, noCrossBank) {"New"}; +resource rPString (fileOpen, noCrossBank) {"Open"}; +resource rPString (fileClose, noCrossBank) {"Close"}; +resource rPString (fileQuit, noCrossBank) {"Quit"}; + +resource rPString (appleAbout, noCrossBank) {"About ___PROJECTNAME___..."}; + + +resource rAlertString (aboutAlertString) { + "43/" + "___PROJECTNAME___\n" + " by ___FULLUSERNAME___\n" + "\n" + "Contains libraries from ORCA C,\n" + "Copyright 1991, Byte Works Inc." + "/^#0\$00"; +}; + + +resource rWindParam1 (windowRes) { + $DDA5, /* wFrameBits */ + nil, /* wTitle */ + 0, /* wRefCon */ + {0, 0, 0, 0}, /* ZoomRect */ + nil, /* wColor ID */ + {0, 0}, /* Origin */ + {1, 1}, /* data size */ + {0, 0}, /* max height-width */ + {8, 8}, /* scroll ver hors */ + {0, 0}, /* page ver horiz */ + 0, /* winfoRefCon */ + 10, /* wInfoHeight */ + {30, 10, 183, 602}, /* wposition */ + infront, /* wPlane */ + nil, /* wStorage */ + $0000 /* wInVerb */ +}; + diff --git a/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..2744f21 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/TemplateInfo.plist @@ -0,0 +1,172 @@ + + + + + Nodes + + main.c + Makefile + make/head.mk + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/tail.mk + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + main.c + + Path + main.c + + make/head.mk + + Group + make + Path + make/head.mk + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsGNOCShellCommand + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build an GNO shell command. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + inline(X,Y)="" + pascal="" + HEADER_SEARCH_PATHS + $GOLDEN_GATE/Libraries/ORCACDefs + ~/Library/GoldenGate/Libraries/ORCACDefs + /Library/GoldenGate/Libraries/ORCACDefs + ~/GoldenGate/Libraries/ORCACDefs + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..e45537e --- /dev/null +++ b/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/main.c b/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/main.c new file mode 100644 index 0000000..170279a --- /dev/null +++ b/pkg/Templates/Apple IIgs/C GNO Shell Command.xctemplate/main.c @@ -0,0 +1,18 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + +#include + + +int main(void) +{ + printf("Hello, world!\n"); + return 0; +} diff --git a/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..54f3b18 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/TemplateInfo.plist @@ -0,0 +1,216 @@ + + + + + Nodes + + main.c + main.h + main.rez + Makefile + make/config.txt + make/createDiskImage + make/head.mk + make/launchEmulator + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/system601.2mg + make/tail.mk + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + main.c + + Path + main.c + + main.h + + Path + main.h + + main.rez + + Path + main.rez + + make/config.txt + + Group + make + Path + make/config.txt + + make/createDiskImage + + Group + make + Path + make/createDiskImage + + make/head.mk + + Group + make + Path + make/head.mk + + make/launchEmulator + + Group + make + Path + make/launchEmulator + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/system601.2mg + + Group + make + Path + make/system601.2mg + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsCNDA + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build a new desktop accessory. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + inline(X,Y)="" + pascal="" + HEADER_SEARCH_PATHS + $GOLDEN_GATE/Libraries/ORCACDefs + ~/Library/GoldenGate/Libraries/ORCACDefs + /Library/GoldenGate/Libraries/ORCACDefs + ~/GoldenGate/Libraries/ORCACDefs + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..61815a2 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.c b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.c new file mode 100644 index 0000000..ddeb85d --- /dev/null +++ b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.c @@ -0,0 +1,203 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + +#pragma nda NDAOpen NDAClose NDAAction NDAInit -1 0x03FF " ___PACKAGENAME___\\H**" + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "___FILEBASENAME___.h" + + +static BOOLEAN ndaActive; +static GrafPortPtr winPtr; +static unsigned int userId; +static unsigned int resourceId; +static Str255 gStrBuf; + + +BOOLEAN OpenResourceFork(void) +{ + GSString255Ptr fPtr; + unsigned id; + + id = SetHandleID(0, FindHandle((Pointer) OpenResourceFork)); + fPtr = (GSString255Ptr) LGetPathname2(id, 1); + if (toolerror() == 0) + resourceId = OpenResourceFile(1, NULL, (Pointer) fPtr); + return toolerror() == 0; +} + + +void NDAClose(void) +{ + if (ndaActive) { + CloseWindow(winPtr); + winPtr = NULL; + ndaActive = FALSE; + } + + CloseResourceFile(resourceId); + ResourceShutDown(); +} + + +void NDAInit(int code) +{ + /* When code is 1, this is tool startup, otherwise tool + * shutdown. + */ + + if (code) { + ndaActive = FALSE; + userId = MMStartUp(); + } else { + if (ndaActive) + NDAClose(); + } +} + + +#pragma databank 1 +void DrawContents(void) +{ + PenNormal(); + MoveTo(7,10); + DrawCString("Hello, world!"); +} +#pragma databank 0 + + +GrafPortPtr NDAOpen(void) +{ + Pointer pathToSelf; + unsigned int oldResourceApp; + LevelRecGS levelDCB; + unsigned int oldLevel; + SysPrefsRecGS prefsDCB; + unsigned int oldPrefs; + + if (ndaActive) + return NULL; + + oldResourceApp = GetCurResourceApp(); + ResourceStartUp(userId); + pathToSelf = LGetPathname2(userId, 1); + + levelDCB.pCount = 2; + GetLevelGS(&levelDCB); + oldLevel = levelDCB.level; + levelDCB.level = 0; + SetLevelGS(&levelDCB); + + prefsDCB.pCount = 1; + GetSysPrefsGS(&prefsDCB); + oldPrefs = prefsDCB.preferences; + prefsDCB.preferences = (prefsDCB.preferences & 0x1fff) | 0x8000; + SetSysPrefsGS(&prefsDCB); + + resourceId = OpenResourceFile(readEnable, NULL, pathToSelf); + + winPtr = NewWindow2("\p ___PACKAGENAME___ ", 0, DrawContents, NULL, 0x02, windowRes, rWindParam1); + + SetSysWindow(winPtr); + ShowWindow(winPtr); + SelectWindow(winPtr); + SetPort(winPtr); + + ndaActive = TRUE; + + prefsDCB.preferences = oldPrefs; + SetSysPrefsGS(&prefsDCB); + + levelDCB.level = oldLevel; + SetLevelGS(&levelDCB); + + SetCurResourceApp(oldResourceApp); + + return winPtr; +} + + +void HandleAction(void) +{ +} + + +void HandleControl(EventRecord *event) +{ +} + + +void HandleKey(EventRecord *event) +{ +} + + +void HandleMenu(int menuItem) +{ +} + + +BOOLEAN NDAAction(EventRecord *sysEvent, int code) +{ + int event; + static EventRecord localEvent; + unsigned int eventCode; + BOOLEAN result = FALSE; + + switch (code) { + case runAction: + HandleAction(); + break; + + case eventAction: + BlockMove((Pointer)sysEvent, (Pointer)&localEvent, 16); + localEvent.wmTaskMask = 0x001FFFFF; + eventCode = TaskMasterDA(0, &localEvent); + switch(eventCode) { + case updateEvt: + BeginUpdate(winPtr); + DrawContents(); + EndUpdate(winPtr); + break; + + case wInControl: + HandleControl(&localEvent); + break; + + case keyDownEvt: + case autoKeyEvt: + HandleKey(&localEvent); + break; + } + break; + + case cutAction: + case copyAction: + case pasteAction: + case clearAction: + result = TRUE; + HandleMenu(code); + break; + } + + return result; +} + diff --git a/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.h b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.h new file mode 100644 index 0000000..1d030cf --- /dev/null +++ b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.h @@ -0,0 +1,19 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + +#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ +#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ + + +#define linedColors 1 + +#define windowRes 1001 + + +#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */ diff --git a/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.rez b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.rez new file mode 100644 index 0000000..fdbdb0e --- /dev/null +++ b/pkg/Templates/Apple IIgs/C New Desk Accessory.xctemplate/main.rez @@ -0,0 +1,41 @@ +/* + * ___FILENAME___ + * ___PROJECTNAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * ___COPYRIGHT___ + */ + + +#include "types.rez" + +#include "___FILEBASENAME___.h" + + +resource rWindParam1 (windowRes) { + $C0A5, /* wFrameBits */ + nil, /* wTitle */ + 0, /* wRefCon */ + {0,0,0,0}, /* ZoomRect */ + linedColors, /* wColor ID */ + {0,0}, /* Origin */ + {0,0}, /* data size */ + {0,0}, /* max height-width */ + {0,0}, /* scroll ver hors */ + {0,0}, /* page ver horiz */ + 0, /* winfoRefcon */ + 0, /* wInfoHeight */ + {50,50,62,200}, /* wposition */ + infront, /* wPlane */ + nil, /* wStorage */ + $0800 /* wInVerb */ +}; + + +resource rWindColor (linedColors) { + 0x0000, /* frameColor */ + 0x0F00, /* titleColor */ + 0x020F, /* tbarColor */ + 0xF0F0, /* growColor */ + 0x00F0, /* infoColor */ +}; diff --git a/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..a01b368 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/TemplateInfo.plist @@ -0,0 +1,172 @@ + + + + + Nodes + + main.c + Makefile + make/head.mk + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/tail.mk + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + main.c + + Path + main.c + + make/head.mk + + Group + make + Path + make/head.mk + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsOrcaCShellCommand + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build an ORCA shell command. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + inline(X,Y)="" + pascal="" + HEADER_SEARCH_PATHS + $GOLDEN_GATE/Libraries/ORCACDefs + ~/Library/GoldenGate/Libraries/ORCACDefs + /Library/GoldenGate/Libraries/ORCACDefs + ~/GoldenGate/Libraries/ORCACDefs + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..7e96971 --- /dev/null +++ b/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/main.c b/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/main.c new file mode 100644 index 0000000..170279a --- /dev/null +++ b/pkg/Templates/Apple IIgs/C ORCA Shell Command.xctemplate/main.c @@ -0,0 +1,18 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + +#include + + +int main(void) +{ + printf("Hello, world!\n"); + return 0; +}