mirror of
https://github.com/jeremysrand/Apple2GSBuildPipeline.git
synced 2024-12-12 10:30:04 +00:00
Add templates for rez files and project templates for CDAs, NDAs and desktop applications
This commit is contained in:
parent
d7b389f2c5
commit
a86b9a5b5a
BIN
Apple2GSXcodeTemplate.pkg
Normal file
BIN
Apple2GSXcodeTemplate.pkg
Normal file
Binary file not shown.
2
Makefile
2
Makefile
@ -20,7 +20,7 @@ PGM=___PACKAGENAME___
|
||||
# nda - A new desk accessory
|
||||
# xcmd - A HyperCard XCMD or XCFN
|
||||
#
|
||||
TARGETTYPE=shell
|
||||
# TARGETTYPE=shell
|
||||
# TARGETTYPE=desktop
|
||||
# TARGETTYPE=cda
|
||||
# TARGETTYPE=cdev
|
||||
|
BIN
pkg/Templates/Apple IIgs/.DS_Store
vendored
BIN
pkg/Templates/Apple IIgs/.DS_Store
vendored
Binary file not shown.
112
pkg/Templates/Apple IIgs/Classic Desk Accessory in C.xctemplate/TemplateInfo.plist
vendored
Normal file
112
pkg/Templates/Apple IIgs/Classic Desk Accessory in C.xctemplate/TemplateInfo.plist
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Nodes</key>
|
||||
<array>
|
||||
<string>main.c</string>
|
||||
<string>Makefile</string>
|
||||
<string>make/head.mk</string>
|
||||
<string>make/orca-asm</string>
|
||||
<string>make/orca-cc</string>
|
||||
<string>make/orca-rez</string>
|
||||
<string>make/tail.mk</string>
|
||||
</array>
|
||||
<key>Definitions</key>
|
||||
<dict>
|
||||
<key>main.c</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>main.c</string>
|
||||
</dict>
|
||||
<key>make/head.mk</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/head.mk</string>
|
||||
</dict>
|
||||
<key>make/orca-asm</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-asm</string>
|
||||
</dict>
|
||||
<key>make/orca-cc</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-cc</string>
|
||||
</dict>
|
||||
<key>make/orca-rez</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-rez</string>
|
||||
</dict>
|
||||
<key>make/tail.mk</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/tail.mk</string>
|
||||
</dict>
|
||||
<key>Makefile</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>Makefile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Kind</key>
|
||||
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
||||
<key>Identifier</key>
|
||||
<string>com.halcyontouch.apple2gsCCDA</string>
|
||||
<key>Ancestors</key>
|
||||
<array>
|
||||
<string>com.apple.dt.unit.externalBuildSystem</string>
|
||||
</array>
|
||||
<key>Concrete</key>
|
||||
<true/>
|
||||
<key>Description</key>
|
||||
<string>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.</string>
|
||||
<key>Options</key>
|
||||
<array/>
|
||||
<key>Targets</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>TargetType</key>
|
||||
<string>Legacy</string>
|
||||
<key>TargetIdentifier</key>
|
||||
<string>com.apple.dt.cocoaLegacyTarget</string>
|
||||
<key>BuildToolPath</key>
|
||||
<string>___VARIABLE_buildToolPath___</string>
|
||||
<key>BuildToolArgsString</key>
|
||||
<string>-C ___PACKAGENAME___ $(ACTION)</string>
|
||||
<key>SharedSettings</key>
|
||||
<dict>
|
||||
<key>OTHER_CFLAGS</key>
|
||||
<string></string>
|
||||
<key>OTHER_LDFLAGS</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
<key>Configurations</key>
|
||||
<dict>
|
||||
<key>Debug</key>
|
||||
<dict>
|
||||
<key>DEBUGGING_SYMBOLS</key>
|
||||
<string>YES</string>
|
||||
<key>GCC_GENERATE_DEBUGGING_SYMBOLS</key>
|
||||
<string>YES</string>
|
||||
<key>GCC_OPTIMIZATION_LEVEL</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
<key>Release</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
32
pkg/Templates/Apple IIgs/Classic Desk Accessory in C.xctemplate/main.c
vendored
Normal file
32
pkg/Templates/Apple IIgs/Classic Desk Accessory in C.xctemplate/main.c
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* ___FILENAME___
|
||||
* ___PACKAGENAME___
|
||||
*
|
||||
* Created by ___FULLUSERNAME___ on ___DATE___.
|
||||
* Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#pragma cda "___PACKAGENAME___" start shutdown
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
124
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/TemplateInfo.plist
vendored
Normal file
124
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/TemplateInfo.plist
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Nodes</key>
|
||||
<array>
|
||||
<string>main.c</string>
|
||||
<string>main.h</string>
|
||||
<string>main.rez</string>
|
||||
<string>Makefile</string>
|
||||
<string>make/head.mk</string>
|
||||
<string>make/orca-asm</string>
|
||||
<string>make/orca-cc</string>
|
||||
<string>make/orca-rez</string>
|
||||
<string>make/tail.mk</string>
|
||||
</array>
|
||||
<key>Definitions</key>
|
||||
<dict>
|
||||
<key>main.c</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>main.c</string>
|
||||
</dict>
|
||||
<key>main.h</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>main.h</string>
|
||||
</dict>
|
||||
<key>main.rez</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>main.rez</string>
|
||||
</dict>
|
||||
<key>make/head.mk</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/head.mk</string>
|
||||
</dict>
|
||||
<key>make/orca-asm</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-asm</string>
|
||||
</dict>
|
||||
<key>make/orca-cc</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-cc</string>
|
||||
</dict>
|
||||
<key>make/orca-rez</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-rez</string>
|
||||
</dict>
|
||||
<key>make/tail.mk</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/tail.mk</string>
|
||||
</dict>
|
||||
<key>Makefile</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>Makefile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Kind</key>
|
||||
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
||||
<key>Identifier</key>
|
||||
<string>com.halcyontouch.apple2gsCDesktopApp</string>
|
||||
<key>Ancestors</key>
|
||||
<array>
|
||||
<string>com.apple.dt.unit.externalBuildSystem</string>
|
||||
</array>
|
||||
<key>Concrete</key>
|
||||
<true/>
|
||||
<key>Description</key>
|
||||
<string>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.</string>
|
||||
<key>Options</key>
|
||||
<array/>
|
||||
<key>Targets</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>TargetType</key>
|
||||
<string>Legacy</string>
|
||||
<key>TargetIdentifier</key>
|
||||
<string>com.apple.dt.cocoaLegacyTarget</string>
|
||||
<key>BuildToolPath</key>
|
||||
<string>___VARIABLE_buildToolPath___</string>
|
||||
<key>BuildToolArgsString</key>
|
||||
<string>-C ___PACKAGENAME___ $(ACTION)</string>
|
||||
<key>SharedSettings</key>
|
||||
<dict>
|
||||
<key>OTHER_CFLAGS</key>
|
||||
<string></string>
|
||||
<key>OTHER_LDFLAGS</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
<key>Configurations</key>
|
||||
<dict>
|
||||
<key>Debug</key>
|
||||
<dict>
|
||||
<key>DEBUGGING_SYMBOLS</key>
|
||||
<string>YES</string>
|
||||
<key>GCC_GENERATE_DEBUGGING_SYMBOLS</key>
|
||||
<string>YES</string>
|
||||
<key>GCC_OPTIMIZATION_LEVEL</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
<key>Release</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
123
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/main.c
vendored
Normal file
123
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/main.c
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
* ___FILENAME___
|
||||
* ___PACKAGENAME___
|
||||
*
|
||||
* Created by ___FULLUSERNAME___ on ___DATE___.
|
||||
* Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <orca.h>
|
||||
#include <Event.h>
|
||||
#include <Menu.h>
|
||||
#include <QuickDraw.h>
|
||||
#include <Window.h>
|
||||
#include <Desk.h>
|
||||
#include <Resources.h>
|
||||
|
||||
#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();
|
||||
}
|
||||
|
38
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/main.h
vendored
Normal file
38
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/main.h
vendored
Normal file
@ -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_____) */
|
207
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/main.rez
vendored
Normal file
207
pkg/Templates/Apple IIgs/Desktop Application in C.xctemplate/main.rez
vendored
Normal file
@ -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 */
|
||||
};
|
||||
|
124
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/TemplateInfo.plist
vendored
Normal file
124
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/TemplateInfo.plist
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Nodes</key>
|
||||
<array>
|
||||
<string>main.c</string>
|
||||
<string>main.h</string>
|
||||
<string>main.rez</string>
|
||||
<string>Makefile</string>
|
||||
<string>make/head.mk</string>
|
||||
<string>make/orca-asm</string>
|
||||
<string>make/orca-cc</string>
|
||||
<string>make/orca-rez</string>
|
||||
<string>make/tail.mk</string>
|
||||
</array>
|
||||
<key>Definitions</key>
|
||||
<dict>
|
||||
<key>main.c</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>main.c</string>
|
||||
</dict>
|
||||
<key>main.h</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>main.h</string>
|
||||
</dict>
|
||||
<key>main.rez</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>main.rez</string>
|
||||
</dict>
|
||||
<key>make/head.mk</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/head.mk</string>
|
||||
</dict>
|
||||
<key>make/orca-asm</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-asm</string>
|
||||
</dict>
|
||||
<key>make/orca-cc</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-cc</string>
|
||||
</dict>
|
||||
<key>make/orca-rez</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/orca-rez</string>
|
||||
</dict>
|
||||
<key>make/tail.mk</key>
|
||||
<dict>
|
||||
<key>Group</key>
|
||||
<string>make</string>
|
||||
<key>Path</key>
|
||||
<string>make/tail.mk</string>
|
||||
</dict>
|
||||
<key>Makefile</key>
|
||||
<dict>
|
||||
<key>Path</key>
|
||||
<string>Makefile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Kind</key>
|
||||
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
||||
<key>Identifier</key>
|
||||
<string>com.halcyontouch.apple2gsCNDA</string>
|
||||
<key>Ancestors</key>
|
||||
<array>
|
||||
<string>com.apple.dt.unit.externalBuildSystem</string>
|
||||
</array>
|
||||
<key>Concrete</key>
|
||||
<true/>
|
||||
<key>Description</key>
|
||||
<string>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.</string>
|
||||
<key>Options</key>
|
||||
<array/>
|
||||
<key>Targets</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>TargetType</key>
|
||||
<string>Legacy</string>
|
||||
<key>TargetIdentifier</key>
|
||||
<string>com.apple.dt.cocoaLegacyTarget</string>
|
||||
<key>BuildToolPath</key>
|
||||
<string>___VARIABLE_buildToolPath___</string>
|
||||
<key>BuildToolArgsString</key>
|
||||
<string>-C ___PACKAGENAME___ $(ACTION)</string>
|
||||
<key>SharedSettings</key>
|
||||
<dict>
|
||||
<key>OTHER_CFLAGS</key>
|
||||
<string></string>
|
||||
<key>OTHER_LDFLAGS</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
<key>Configurations</key>
|
||||
<dict>
|
||||
<key>Debug</key>
|
||||
<dict>
|
||||
<key>DEBUGGING_SYMBOLS</key>
|
||||
<string>YES</string>
|
||||
<key>GCC_GENERATE_DEBUGGING_SYMBOLS</key>
|
||||
<string>YES</string>
|
||||
<key>GCC_OPTIMIZATION_LEVEL</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
<key>Release</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
203
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/main.c
vendored
Normal file
203
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/main.c
vendored
Normal file
@ -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 <orca.h>
|
||||
#include <GSOS.h>
|
||||
#include <QuickDraw.h>
|
||||
#include <Window.h>
|
||||
#include <Desk.h>
|
||||
#include <Event.h>
|
||||
#include <Resources.h>
|
||||
#include <MiscTool.h>
|
||||
#include <Memory.h>
|
||||
#include <Loader.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
19
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/main.h
vendored
Normal file
19
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/main.h
vendored
Normal file
@ -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_____) */
|
41
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/main.rez
vendored
Normal file
41
pkg/Templates/Apple IIgs/New Desk Accessory in C.xctemplate/main.rez
vendored
Normal file
@ -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 */
|
||||
};
|
12
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/Default/___FILEBASENAME___.rez
vendored
Normal file
12
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/Default/___FILEBASENAME___.rez
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* ___FILENAME___
|
||||
* ___PROJECTNAME___
|
||||
*
|
||||
* Created by ___FULLUSERNAME___ on ___DATE___.
|
||||
* ___COPYRIGHT___
|
||||
*/
|
||||
|
||||
|
||||
#include "types.rez"
|
||||
|
||||
|
BIN
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/TemplateIcon.png
vendored
Normal file
BIN
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/TemplateIcon.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
BIN
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/TemplateIcon@2x.png
vendored
Normal file
BIN
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/TemplateIcon@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
53
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/TemplateInfo.plist
vendored
Normal file
53
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/TemplateInfo.plist
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AllowedTypes</key>
|
||||
<array>
|
||||
<string>com.apple.rez-source</string>
|
||||
</array>
|
||||
<key>DefaultCompletionName</key>
|
||||
<string>File</string>
|
||||
<key>Description</key>
|
||||
<string>An empty resource file.</string>
|
||||
<key>Kind</key>
|
||||
<string>Xcode.IDEKit.TextSubstitutionFileTemplateKind</string>
|
||||
<key>MainTemplateFile</key>
|
||||
<string>___FILEBASENAME___.rez</string>
|
||||
<key>Options</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>The name of the file to create</string>
|
||||
<key>Identifier</key>
|
||||
<string>productName</string>
|
||||
<key>Name</key>
|
||||
<string>Name:</string>
|
||||
<key>NotPersisted</key>
|
||||
<true/>
|
||||
<key>Required</key>
|
||||
<true/>
|
||||
<key>Type</key>
|
||||
<string>text</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Default</key>
|
||||
<string>true</string>
|
||||
<key>Description</key>
|
||||
<string>Whether to create a header file with the same name</string>
|
||||
<key>Identifier</key>
|
||||
<string>WithHeader</string>
|
||||
<key>Name</key>
|
||||
<string>Also create a header file</string>
|
||||
<key>NotPersisted</key>
|
||||
<true/>
|
||||
<key>Type</key>
|
||||
<string>checkbox</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>SortOrder</key>
|
||||
<string>2</string>
|
||||
<key>Summary</key>
|
||||
<string>An empty resource file.</string>
|
||||
</dict>
|
||||
</plist>
|
14
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.h
vendored
Normal file
14
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.h
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* ___FILENAME___
|
||||
* ___PROJECTNAME___
|
||||
*
|
||||
* Created by ___FULLUSERNAME___ on ___DATE___.
|
||||
* ___COPYRIGHT___
|
||||
*/
|
||||
|
||||
#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
|
||||
#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
|
||||
|
||||
|
||||
|
||||
#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */
|
14
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.rez
vendored
Normal file
14
pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.rez
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* ___FILENAME___
|
||||
* ___PROJECTNAME___
|
||||
*
|
||||
* Created by ___FULLUSERNAME___ on ___DATE___.
|
||||
* ___COPYRIGHT___
|
||||
*/
|
||||
|
||||
|
||||
#include "types.rez"
|
||||
|
||||
#include "___FILEBASENAME___.h"
|
||||
|
||||
|
@ -4,11 +4,24 @@ TMPDIR=/tmp/pkg.$$
|
||||
|
||||
cp -R pkg/Templates $TMPDIR
|
||||
|
||||
for PROJECT in "Apple IIgs C Shell Command" "Apple IIgs Asm Shell Command"
|
||||
PROJECTS=/tmp/projects.$$
|
||||
cat > $PROJECTS << EOF
|
||||
shell:Shell Command in C
|
||||
shell:Shell Command in Assembly
|
||||
cda:Classic Desk Accessory in C
|
||||
nda:New Desk Accessory in C
|
||||
desktop:Desktop Application in C
|
||||
EOF
|
||||
|
||||
while read PROJECT
|
||||
do
|
||||
echo cp -R Makefile make "${TMPDIR}/Apple IIgs/${PROJECT}.xctemplate/"
|
||||
cp -R Makefile make "${TMPDIR}/Apple IIgs/${PROJECT}.xctemplate/"
|
||||
done
|
||||
PROJECTTYPE=`echo $PROJECT | awk -F: '{print $1}'`
|
||||
PROJECTNAME=`echo $PROJECT | awk -F: '{print $2}'`
|
||||
sed "/^# TARGETTYPE=${PROJECTTYPE}/s/^# //" Makefile > "${TMPDIR}/Apple IIgs/${PROJECTNAME}.xctemplate/Makefile"
|
||||
cp -R make "${TMPDIR}/Apple IIgs/${PROJECTNAME}.xctemplate/"
|
||||
done < $PROJECTS
|
||||
|
||||
rm -f $PROJECTS
|
||||
|
||||
pkgbuild --root $TMPDIR --version 0.1 --identifier com.halcyontouch.Apple2gsTemplate.pkg --install-location /Library/Developer/Xcode/Templates/ --scripts pkg/scripts/ Apple2GSXcodeTemplate.pkg
|
||||
productbuild --distribution pkg/Distribution.xml --resource ./pkg temp.pkg
|
||||
|
Loading…
Reference in New Issue
Block a user