--- /dev/null
+filesel
+hello1
+hello2
+rmvprot
+yesno
+*.map
+*.s
+*.lbl
--- /dev/null
+
+; this is resource file for filesel.c, a GEOS application example
+
+HEADER APPLICATION "filesel" "FileSel" "V1.0" {
+dostype USR
+author "Maciej Witkowiak"
+info "This is C prog compiled with cc65 and GEOSLib."
+}
--- /dev/null
+
+; this is resource file for hello1.c, a GEOS application example
+
+HEADER APPLICATION "hello1" "Hello 1" "V1.0" {
+dostype USR
+author "Maciej Witkowiak"
+info "This is C prog compiled with cc65 and GEOSLib."
+}
--- /dev/null
+
+; this is resource file for hello2.c, a GEOS application example
+
+HEADER APPLICATION "hello2" "Hello 2" "V1.0" {
+dostype USR
+author "Maciej Witkowiak"
+info "This is C prog compiled with cc65 and GEOSLib."
+}
--- /dev/null
+
+; this is resource file for rmvprot.c, a GEOS application example
+
+HEADER APPLICATION "rmvprot" "RmvProt" "V1.0" {
+dostype USR
+author "Maciej Witkowiak"
+;info "This is C prog compiled with cc65 and GEOSLib."
+info "This will remove write protection from your bootdisk."
+}
--- /dev/null
+
+; this is resource file for yesno.c, a GEOS application example
+
+HEADER APPLICATION "yesno" "YesNo" "V1.0" {
+dostype USR
+author "Maciej Witkowiak"
+info "This is C prog compiled with cc65 and GEOSLib."
+}
--- /dev/null
+
+/*
+
+ GEOSLib example
+
+ using DlgBoxFileSelect
+
+ Maciej 'YTM/Alliance' Witkowiak
+ <ytm@friko.onet.pl>
+
+ 26.12.1999
+*/
+
+#include <geos.h>
+
+char fName[17]="";
+
+void main (void)
+{
+
+ r0=(int)fName;
+
+ DlgBoxOk(CBOLDON "You now will be presented","with apps list" CPLAINTEXT);
+ DlgBoxFileSelect("",APPLICATION,fName);
+ DlgBoxOk("You've chosen:" CBOLDON, fName);
+
+ EnterDeskTop();
+}
--- /dev/null
+
+/*
+
+ GEOSLib example
+
+ Hello, world example - with DBox
+
+ Maciej 'YTM/Alliance' Witkowiak
+ <ytm@friko.onet.pl>
+
+ 26.12.1999
+*/
+
+#include <geos.h>
+
+void main (void)
+{
+
+/* Let's show what we've got... */
+
+ DlgBoxOk(CBOLDON "Hello, world" CPLAINTEXT,
+ "This is written in C!");
+
+/* Normal apps exit from main into system's mainloop, and app finish
+ when user selects it from icons or menu, but here we want to exit
+ immediately.
+*/
+ EnterDeskTop();
+}
--- /dev/null
+
+/*
+
+ GEOSLib example
+
+ Hello, world example - using graphic functions
+
+ Maciej 'YTM/Alliance' Witkowiak
+ <ytm@friko.onet.pl>
+
+ 26.12.1999
+*/
+
+#include <geos.h>
+
+/* Let's define the window we're operating */
+struct window wholeScreen = {0, 199, 0, 319};
+
+
+void main (void)
+{
+
+/* Let's show what we've got... */
+
+/* Let's clear the screen - with different pattern, because apps have cleared screen upon
+ start */
+
+ SetPattern(0);
+ InitDrawWindow(&wholeScreen);
+ Rectangle();
+
+/* Now some texts */
+
+ PutString(COUTLINEON "This is compiled using cc65!" CPLAINTEXT, 20, 10);
+ PutString(CBOLDON "This is bold", 30, 10);
+ PutString(CULINEON "and this is bold and underline!", 40, 10);
+ PutString(CPLAINTEXT "This is plain text", 50, 10);
+
+/* Wait for 5 secs... */
+/* Note that this is multitasking sleep, and if there are any icons/menus onscreen,
+ they would be usable, in this case you have only pointer usable */
+
+ Sleep(5*50);
+
+/* Normal apps exit from main into system's mainloop, and app finish
+ when user selects it from icons or menu, but here we want to exit
+ immediately.
+*/
+ EnterDeskTop();
+}
--- /dev/null
+
+/*
+
+ GEOSLib example
+
+ This small application removes GEOS disk write protection tag.
+ e.g. boot disk is always protected after boot-up
+
+ Maciej 'YTM/Alliance' Witkowiak
+ <ytm@friko.onet.pl>
+
+ 21.03.2000
+*/
+
+#include <geos.h>
+
+char diskName[17] = "";
+
+static const graphicStr clearScreen = {
+ MOVEPENTO(0, 0),
+ NEWPATTERN(2),
+ RECTANGLETO(319, 199),
+ GSTR_END
+};
+
+static const dlgBoxStr mainDialog = {
+ DB_DEFPOS(1),
+ DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y,
+ CBOLDON "Remove protection on:" CPLAINTEXT),
+ DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, diskName),
+ DB_ICON(OK, DBI_X_0, DBI_Y_2),
+ DB_ICON(DISK, DBI_X_1, DBI_Y_2),
+ DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
+ DB_END
+};
+
+static const dlgBoxStr changeDiskDlg = {
+ DB_DEFPOS(1),
+ DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y, CBOLDON "Insert new disk"),
+ DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, "into drive." CPLAINTEXT),
+ DB_ICON(OK, DBI_X_0, DBI_Y_2),
+ DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
+ DB_END
+};
+
+static const dlgBoxStr errorDialog = {
+ DB_DEFPOS(1),
+ DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y, CBOLDON "Error happened..."),
+ DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, "exiting..." CPLAINTEXT),
+ DB_ICON(OK, DBI_X_0, DBI_Y_2),
+ DB_END
+};
+
+void Error(void)
+{
+ DoDlgBox(&errorDialog);
+ EnterDeskTop();
+}
+
+void main(void)
+{
+
+ /* Here we clear the screen. Not really needed anyway... */
+ GraphicsString(&clearScreen);
+
+ /* Get the name of current disk to show it in dialog box */
+ GetPtrCurDkNm(diskName);
+
+ while (1) {
+ switch (DoDlgBox(&mainDialog)) {
+ /* What's the result of dialog box? which icon was pressed? */
+ case OK:
+ if (GetDirHead())
+ Error();
+ curDirHead[OFF_GS_DTYPE] = 0;
+ if (PutDirHead())
+ Error();
+ break;
+ case DISK:
+ DoDlgBox(&changeDiskDlg);
+ GetPtrCurDkNm(diskName);
+ break;
+ default: /* CANCEL is the third option */
+ EnterDeskTop();
+ break;
+ }
+ }
+}
--- /dev/null
+
+/*
+
+ GEOSLib example
+
+ example of using DlgBoxYesNo, DlgBoxOkCancel and DlgBoxOk functions
+
+ Maciej 'YTM/Alliance' Witkowiak
+ <ytm@friko.onet.pl>
+
+ 26.12.1999
+ */
+
+#include <geos.h>
+
+void main(void)
+{
+ do {
+ if (DlgBoxYesNo("Are you female?", "(don't lie ;-)") == YES) {
+ DlgBoxOk("You claim to be woman!", "You wanna dance?");
+ } else {
+ DlgBoxOk("Ergh, another man...", "Let's go for a beer.");
+ };
+ } while (DlgBoxOkCancel("Do you want to try again?", "") == OK);
+
+ EnterDeskTop();
+}