Add file retrieval to GUI

GUI version 0.2 alpha.

You can now retrieve a file from PiStorm to save in your Amiga. Reqtools
now included to pick a destination drive / directory.

Also a reboot button was added and some other things fixed.
This commit is contained in:
Andrew Hutchings
2021-04-26 09:00:47 +01:00
parent cd53a538c7
commit 874c4732ab
19 changed files with 1754 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ all: PiSimple PiStorm
PiSimple: simple_interact.c pistorm_dev.c
$(CC) $(CFLAGS) $^ -o PiSimple
PiStorm: gui_interact.c pistorm_dev.c
$(CC) $(CFLAGS) $^ -o PiStorm
PiStorm: gui_interact.c pistorm_dev.c reqtoolsnb.lib
$(CC) $(CFLAGS) -Ireqtools $^ -o PiStorm

View File

@@ -6,6 +6,10 @@ Compiling the tool requires VBCC setup with the kickstart 1.3 libraries. For inf
Once you have the tooling setup, just run `make`.
## Installation
You will need `reqtools.library` in the `libs:` drive. Some Workbench builds come with this. If you don't have it use the version in libs13 for Workbench 1.3 and libs20 for Workbench 2.0 onwards.
## Tools
### PiSimple
@@ -23,3 +27,11 @@ You can enable / disable RTG on-the-fly with the "Enable/Disable RTG" button. Th
### Config file
It is possible to switch the configuration file PiStorm is using. You can either type a name for the config file relative to the PiStorm's execution directory and hit "Commit" or hit "Load Default". If the config file is valid the PiStorm will load it in and the Amiga will immediately reboot.
### Get file
You can copy a file from the PiStorm to the Amiga. First of all, type in the filename and path relative to the pistorm directory. Then optionally set the destination directory (can be left blank for the same directory PiStorm was executed in) and hit "Retrieve".
### Reboot
Reboots the Amiga (not PiStorm).

View File

@@ -7,16 +7,19 @@
#include <proto/dos.h>
#include <workbench/startup.h>
#include <clib/expansion_protos.h>
#include <libraries/reqtools.h>
#include <clib/reqtools_protos.h>
#include "pistorm_dev.h"
#include "../pistorm-dev-enums.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
extern unsigned int pistorm_base_addr;
struct ReqToolsBase *ReqToolsBase;
#define VERSION "v0.1"
#define VERSION "v0.2"
#define button1w 54
#define button1h 20
@@ -30,6 +33,9 @@ extern unsigned int pistorm_base_addr;
#define tbox1w 130
#define tbox1h 18
#define statusbarw 507
#define statusbarh 10
SHORT SharedBordersPairs0[] =
{
0, 0, 0, button1h - 1, 1, button1h - 2, 1, 0, button1w - 2, 0
@@ -67,6 +73,21 @@ SHORT SharedBordersPairs7[] =
-1, tbox1h - 1, tbox1w - 2, tbox1h - 1, tbox1w - 2, 0, tbox1w - 1, -1, tbox1w - 1, tbox1h - 1
};
SHORT SharedBordersPairs8[] =
{
0, 0, statusbarw - 2, 0, statusbarw - 2, 0, 0, 0, 0, 0
};
SHORT SharedBordersPairs9[] =
{
0, 0, 0, tbox1h - 1, 1, tbox1h - 2, 1, 0, tbox1w - 2, 0
};
SHORT SharedBordersPairs10[] =
{
1, tbox1h - 1, tbox1w - 2, tbox1h - 1, tbox1w - 2, 1, tbox1w - 1, 0, tbox1w - 1, tbox1h - 1
};
struct Border SharedBorders[] =
{
0, 0, 2, 0, JAM2, 5, (SHORT *) &SharedBordersPairs0[0], &SharedBorders[1], // Button 1
@@ -77,6 +98,9 @@ struct Border SharedBorders[] =
0, 0, 1, 0, JAM2, 5, (SHORT *) &SharedBordersPairs5[0], NULL,
0, 0, 1, 0, JAM2, 5, (SHORT *) &SharedBordersPairs6[0], &SharedBorders[7], // TBox
0, 0, 2, 0, JAM2, 5, (SHORT *) &SharedBordersPairs7[0], NULL,
0, 0, 1, 0, JAM2, 5, (SHORT *) &SharedBordersPairs8[0], NULL, // Statusbar
0, 0, 2, 0, JAM2, 5, (SHORT *) &SharedBordersPairs9[0], &SharedBorders[10], // TBox inverted
0, 0, 1, 0, JAM2, 5, (SHORT *) &SharedBordersPairs10[0], NULL,
};
struct Border SharedBordersInvert[] =
@@ -87,6 +111,107 @@ struct Border SharedBordersInvert[] =
0, 0, 2, 0, JAM2, 5, (SHORT *) &SharedBordersPairs3[0], NULL,
0, 0, 1, 0, JAM2, 5, (SHORT *) &SharedBordersPairs4[0], &SharedBordersInvert[5], // Button 2
0, 0, 2, 0, JAM2, 5, (SHORT *) &SharedBordersPairs5[0], NULL,
0, 0, 1, 0, JAM2, 5, (SHORT *) &SharedBordersPairs9[0], &SharedBordersInvert[7], // TBox inverted
0, 0, 2, 0, JAM2, 5, (SHORT *) &SharedBordersPairs10[0], NULL,
};
UBYTE DestinationValue_buf[255];
struct IntuiText Destination_text[] =
{
1, 0, JAM2, -98, 6, NULL, "Destination:", &Destination_text[1],
1, 0, JAM2, 4, 4, NULL, DestinationValue_buf, NULL,
};
#define GADGETDESTINATION 11
struct Gadget GetDestination =
{
NULL, 108, 117, tbox1w, tbox1h,
GADGHIMAGE,
RELVERIFY,
BOOLGADGET,
(APTR) &SharedBorders[9], (APTR) &SharedBordersInvert[6],
Destination_text, 0, NULL, GADGETDESTINATION, NULL
};
struct IntuiText RebootButton_text =
{
1, 0, JAM2, 2, 6, NULL, (UBYTE *)"Reboot", NULL
};
#define GADREBOOT 10
struct Gadget RebootButton =
{
&GetDestination, 4, 166, button1w, button1h,
GADGHIMAGE,
RELVERIFY,
BOOLGADGET,
(APTR) &SharedBorders[0], (APTR) &SharedBordersInvert[0],
&RebootButton_text, 0, NULL, GADREBOOT, NULL
};
UBYTE StatusBar_buf[128] = "PiStorm...";
struct IntuiText StatusBar_text =
{
1, 0, JAM2, 4, 2, NULL, (UBYTE *)StatusBar_buf, NULL
};
#define GADSTATUSBAR 9
struct Gadget StatusBar =
{
&RebootButton, 3, 188, 508, 10,
GADGHIMAGE,
0,
BOOLGADGET,
(APTR) &SharedBorders[8], NULL,
&StatusBar_text, 0, NULL, GADSTATUSBAR, NULL
};
struct IntuiText RetrieveButton_text =
{
1, 0, JAM2, 10, 6, NULL, (UBYTE *)"Retrieve", NULL
};
#define GADRETRIEVEBUTTON 8
struct Gadget RetrieveButton =
{
&StatusBar, 244, 117, button2w, button2h,
GADGHIMAGE,
RELVERIFY,
BOOLGADGET,
(APTR) &SharedBorders[4], (APTR) &SharedBordersInvert[4],
&RetrieveButton_text, 0, NULL, GADRETRIEVEBUTTON, NULL
};
UBYTE GetFileValue_buf[255];
struct StringInfo GetFileValue =
{
GetFileValue_buf, NULL, 0, 255, 0, 0, 0, 0, 4, 4, NULL, 0, NULL
};
struct IntuiText GetFile_text[] =
{
1, 0, JAM2, -98, -15, NULL, "Get file", &GetFile_text[1],
1, 0, JAM2, -98, 4, NULL, "Source:", NULL,
};
#define GADGETFILE 7
struct Gadget GetFile =
{
&RetrieveButton, 108, 93, tbox1w, tbox1h,
GADGHIMAGE,
0,
STRGADGET,
(APTR) &SharedBorders[6], NULL,
GetFile_text, 0, (APTR)&GetFileValue, GADGETFILE, NULL
};
struct IntuiText ConfigDefault_text =
@@ -98,7 +223,7 @@ struct IntuiText ConfigDefault_text =
struct Gadget ConfigDefault =
{
NULL, 304, 39, button3w, button3h,
&GetFile, 304, 39, button3w, button3h,
GADGHIMAGE,
RELVERIFY,
BOOLGADGET,
@@ -195,7 +320,7 @@ struct IntuiText AboutButton_text =
struct Gadget AboutButton =
{
&RTGButton, 356, 170, button1w, button1h,
&RTGButton, 356, 166, button1w, button1h,
GADGHIMAGE,
RELVERIFY,
BOOLGADGET,
@@ -213,7 +338,7 @@ struct IntuiText QuitButton_text =
struct Gadget QuitButton =
{
&AboutButton, 438, 170, button1w, button1h,
&AboutButton, 438, 166, button1w, button1h,
GADGHIMAGE,
RELVERIFY,
BOOLGADGET,
@@ -278,6 +403,35 @@ static void updateRTG(struct Window *window)
}
}
static char *GetSavePath()
{
struct rtFileRequester *filereq;
char filename[128];
char *fullpath = malloc(256 * sizeof(char));
UBYTE *buf = NULL;
if ((filereq = (struct rtFileRequester*)rtAllocRequestA (RT_FILEREQ, NULL)))
{
filename[0] = 0;
if (!rtFileRequest(filereq, filename, "Pick a destination directory",
RTFI_Flags, FREQF_NOFILES, TAG_END))
{
free(fullpath);
return NULL;
}
}
else
{
rtEZRequest("Out of memory!", "Oh no!", NULL, NULL);
}
strncpy(fullpath, (char*)filereq->Dir, 256);
return fullpath;
}
int main()
{
struct Window *myWindow;
@@ -288,6 +442,19 @@ int main()
return RETURN_FAIL;
}
if (!(ReqToolsBase = (struct ReqToolsBase *)
OpenLibrary (REQTOOLSNAME, REQTOOLSVERSION)))
{
static struct IntuiText pos;
struct IntuiText msg[] =
{
1, 0, JAM2, 0, 0, NULL, "You need reqtools.library V38 or higher!.", &msg[1],
1, 0, JAM2, 0, 10, NULL, "Please install it in your Libs: drirectory.", NULL,
};
AutoRequest(NULL, msg, NULL, &pos, 0, 0, 0, 0);
return RETURN_FAIL;
}
pistorm_base_addr = pi_find_pistorm();
myWindow = OpenWindow(&winlayout);
BOOL no_board = FALSE;
@@ -299,6 +466,7 @@ int main()
pos.IText = "OK";
AutoRequest(myWindow, &msg, NULL, &pos, 0, 0, 0, 0);
no_board = TRUE;
WriteGadgetText("PiStorm not found", StatusBar_buf, myWindow, &StatusBar);
}
if (!no_board)
{
@@ -373,7 +541,7 @@ int main()
if (ret == PI_RES_FILENOTFOUND)
{
static struct IntuiText msg, pos;
msg.IText = "PiStorm says \"file not found\"";
msg.IText = "PiStorm says: \"file not found\"";
pos.IText = "OK";
AutoRequest(myWindow, &msg, NULL, &pos, 0, 0, 0, 0);
}
@@ -384,6 +552,100 @@ int main()
pi_handle_config(PICFG_DEFAULT, NULL);
break;
}
case GADRETRIEVEBUTTON:
{
unsigned int filesize = 0;
char outpath[128];
unsigned char *buf;
if (pi_get_filesize(GetFileValue_buf, &filesize) == PI_RES_FILENOTFOUND)
{
static struct IntuiText msg, pos;
msg.IText = "PiStorm says: \"file not found\"";
pos.IText = "OK";
AutoRequest(myWindow, &msg, NULL, &pos, 0, 0, 0, 0);
break;
}
buf = malloc(filesize);
if (buf == NULL)
{
static struct IntuiText msg, pos;
msg.IText = "Could not allocate enough memory to transfer file";
pos.IText = "OK";
AutoRequest(myWindow, &msg, NULL, &pos, 0, 0, 0, 0);
break;
}
WriteGadgetText("Retrieving file...", StatusBar_buf, myWindow, &StatusBar);
if (pi_transfer_file(GetFileValue_buf, buf) != PI_RES_OK)
{
static struct IntuiText msg, pos;
msg.IText = "PiStorm says: \"something went wrong with the file transfer\"";
pos.IText = "OK";
AutoRequest(myWindow, &msg, NULL, &pos, 0, 0, 0, 0);
WriteGadgetText("File transfer failed", StatusBar_buf, myWindow, &StatusBar);
free(buf);
break;
}
char *fname = strrchr(GetFileValue_buf, '/');
if (!fname)
{
fname = GetFileValue_buf;
}
char *destfile = malloc(256);
// Turns out WB doesn't like DF0:/filename.ext
if (DestinationValue_buf[(strlen(DestinationValue_buf) - 1)] == ':')
{
snprintf(destfile, 255, "%s%s", DestinationValue_buf, GetFileValue_buf);
}
else if (!strlen(DestinationValue_buf))
{
snprintf(destfile, 255, "%s", GetFileValue_buf);
}
else
{
snprintf(destfile, 255, "%s/%s", DestinationValue_buf, GetFileValue_buf);
}
BPTR fh = Open(destfile, MODE_NEWFILE);
if (!fh)
{
char errbuf[64];
snprintf(errbuf, 64, "Error code: %ld", IoErr());
struct IntuiText msg[] =
{
1, 0, JAM2, 0, 0, NULL, "Could not open file for writing", &msg[1],
1, 0, JAM2, 0, 10, NULL, destfile, &msg[2],
1, 0, JAM2, 0, 20, NULL, (UBYTE*)errbuf, NULL,
};
static struct IntuiText pos;
pos.IText = "OK";
AutoRequest(myWindow, msg, NULL, &pos, 0, 0, 0, 0);
WriteGadgetText("File transfer failed", StatusBar_buf, myWindow, &StatusBar);
free(buf);
free(destfile);
break;
}
Write(fh, buf, filesize);
Close(fh);
free(destfile);
WriteGadgetText("File transfer complete", StatusBar_buf, myWindow, &StatusBar);
free(buf);
break;
}
case GADREBOOT:
{
WriteGadgetText("Rebooting PiStorm", StatusBar_buf, myWindow, &StatusBar);
pi_reset_amiga(0);
break;
}
case GADGETDESTINATION:
{
char *fileName = GetSavePath();
if (fileName)
{
WriteGadgetText(fileName, DestinationValue_buf, myWindow, &GetDestination);
free(fileName);
}
}
}
}
if (closewin)
@@ -397,5 +659,6 @@ int main()
}
};
if (myWindow) CloseWindow(myWindow);
CloseLibrary((struct Library*)ReqToolsBase);
return 0;
}

View File

@@ -0,0 +1,61 @@
#ifndef CLIB_REQTOOLS_PROTOS_H
#define CLIB_REQTOOLS_PROTOS_H
/*
** $Filename: clib/reqtools_protos.h $
** $Release: 2.2 $
** $Revision: 38.11 $
**
** C prototypes. For use with 32 bit integers only.
**
** (C) Copyright 1991-1994 Nico François
** All Rights Reserved
*/
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif /* UTILITY_TAGITEM_H */
APTR rtAllocRequestA (ULONG, struct TagItem *);
void rtFreeRequest (APTR);
void rtFreeReqBuffer (APTR);
LONG rtChangeReqAttrA (APTR, struct TagItem *);
APTR rtFileRequestA(struct rtFileRequester *,char *,char *,struct TagItem *);
void rtFreeFileList (struct rtFileList *);
ULONG rtEZRequestA (char *,char *,struct rtReqInfo *,APTR,struct TagItem *);
ULONG rtGetStringA (UBYTE *,ULONG,char *,struct rtReqInfo *,struct TagItem *);
ULONG rtGetLongA (ULONG *, char *, struct rtReqInfo *, struct TagItem *);
ULONG rtFontRequestA (struct rtFontRequester *, char *, struct TagItem *);
LONG rtPaletteRequestA (char *, struct rtReqInfo *, struct TagItem *);
ULONG rtReqHandlerA (struct rtHandlerInfo *, ULONG, struct TagItem *);
void rtSetWaitPointer (struct Window *);
ULONG rtGetVScreenSize (struct Screen *, ULONG *, ULONG *);
void rtSetReqPosition (ULONG, struct NewWindow *,
struct Screen *, struct Window *);
void rtSpread (ULONG *, ULONG *, ULONG, ULONG, ULONG, ULONG);
void rtScreenToFrontSafely (struct Screen *);
ULONG rtScreenModeRequestA (struct rtScreenModeRequester *,
char *, struct TagItem *);
void rtCloseWindowSafely (struct Window *);
APTR rtLockWindow (struct Window *);
void rtUnlockWindow (struct Window *, APTR);
/* private functions */
struct ReqToolsPrefs *rtLockPrefs (void);
void rtUnlockPrefs (void);
/* functions with varargs in reqtools.lib and reqtoolsnb.lib */
APTR rtAllocRequest (ULONG, Tag,...);
LONG rtChangeReqAttr (APTR, Tag,...);
APTR rtFileRequest (struct rtFileRequester *, char *, char *, Tag,...);
ULONG rtEZRequest (char *, char *, struct rtReqInfo *, struct TagItem *,...);
ULONG rtEZRequestTags (char *, char *, struct rtReqInfo *, APTR, Tag,...);
ULONG rtGetString (UBYTE *, ULONG, char *, struct rtReqInfo *, Tag,...);
ULONG rtGetLong (ULONG *, char *, struct rtReqInfo *, Tag,...);
ULONG rtFontRequest (struct rtFontRequester *, char *, Tag,...);
LONG rtPaletteRequest (char *, struct rtReqInfo *, Tag,...);
ULONG rtReqHandler (struct rtHandlerInfo *, ULONG, Tag,...);
ULONG rtScreenModeRequest (struct rtScreenModeRequester *, char *, Tag,...);
#endif /* CLIB_REQTOOLS_PROTOS_H */

View File

@@ -0,0 +1,635 @@
#ifndef LIBRARIES_REQTOOLS_H
#define LIBRARIES_REQTOOLS_H
/*
** $Filename: libraries/reqtools.h $
** $Release: 2.2 $
** $Revision: 38.11 $
**
** reqtools.library definitions
**
** (C) Copyright 1991-1994 Nico François
** All Rights Reserved
*/
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif /* EXEC_TYPES_H */
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif /* EXEC_LISTS_H */
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
#ifndef EXEC_SEMAPHORES_H
#include <exec/semaphores.h>
#endif /* EXEC_SEMAPHORES_H */
#ifndef LIBRARIES_DOS_H
#include <libraries/dos.h>
#endif /* LIBRARIES_DOS_H */
#ifndef LIBRARIES_DOSEXTENS_H
#include <libraries/dosextens.h>
#endif /* LIBRARIES_DOSEXTENS_H */
#ifndef LIBRARIES_DISKFONT_H
#include <libraries/diskfont.h>
#endif /* LIBRARIES_DISKFONT_H */
#ifndef GRAPHICS_TEXT_H
#include <graphics/text.h>
#endif /* GRAPHICS_TEXT_H */
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif /* UTILITY_TAGITEM_H */
#define REQTOOLSNAME "reqtools.library"
#define REQTOOLSVERSION 38L
/***********************
* *
* Preferences *
* *
***********************/
#define RTPREF_FILEREQ 0L
#define RTPREF_FONTREQ 1L
#define RTPREF_PALETTEREQ 2L
#define RTPREF_SCREENMODEREQ 3L
#define RTPREF_VOLUMEREQ 4L
#define RTPREF_OTHERREQ 5L
#define RTPREF_NR_OF_REQ 6L
struct ReqDefaults {
ULONG Size;
ULONG ReqPos;
UWORD LeftOffset;
UWORD TopOffset;
UWORD MinEntries;
UWORD MaxEntries;
};
struct ReqToolsPrefs {
/* Size of preferences (_without_ this field and the semaphore) */
ULONG PrefsSize;
struct SignalSemaphore PrefsSemaphore;
/* Start of real preferences */
ULONG Flags;
struct ReqDefaults ReqDefaults[RTPREF_NR_OF_REQ];
};
#define RTPREFS_SIZE \
(sizeof (struct ReqToolsPrefs) - sizeof (struct SignalSemaphore) - 4)
/* Flags */
#define RTPRB_DIRSFIRST 0L
#define RTPRF_DIRSFIRST (1L<<RTPRB_DIRSFIRST)
#define RTPRB_DIRSMIXED 1L
#define RTPRF_DIRSMIXED (1L<<RTPRB_DIRSMIXED)
#define RTPRB_IMMSORT 2L
#define RTPRF_IMMSORT (1L<<RTPRB_IMMSORT)
#define RTPRB_NOSCRTOFRONT 3L
#define RTPRF_NOSCRTOFRONT (1L<<RTPRB_NOSCRTOFRONT)
#define RTPRB_NOLED 4L
#define RTPRF_NOLED (1L<<RTPRB_NOLED)
/***********************
* *
* Library Base *
* *
***********************/
struct ReqToolsBase {
struct Library LibNode;
UBYTE RTFlags;
UBYTE pad[3];
BPTR SegList;
/* PUBLIC FIELDS */
/* NOTE: Some versions of the Manx C compiler contain a bug so it gets
confused by the library bases below. Add the rt_ prefix to the
library names to fix the problem (e.g. rt_IntuitionBase). */
/* The following library bases may be read and used by your program */
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
struct DosLibrary *DOSBase;
/* Next two library bases are only (and always) valid on Kickstart 2.0!
(1.3 version of reqtools also initializes these when run on 2.0) */
struct Library *GadToolsBase;
struct Library *UtilityBase;
/* PRIVATE FIELDS, THESE WILL CHANGE FROM RELEASE TO RELEASE! */
/* The RealOpenCnt is for the buffered AvailFonts feature. Since
Kickstart 3.0 offers low memory handlers a release of ReqTools for 3.0
will not use this field and start using the normal OpenCnt again. */
UWORD RealOpenCnt;
UWORD AvailFontsLock;
struct AvailFontsHeader *AvailFontsHeader;
ULONG FontsAssignType;
BPTR FontsAssignLock;
struct AssignList *FontsAssignList;
struct ReqToolsPrefs ReqToolsPrefs;
UWORD prefspad;
};
/* types of requesters, for rtAllocRequestA() */
#define RT_FILEREQ 0L
#define RT_REQINFO 1L
#define RT_FONTREQ 2L
/* (V38) */
#define RT_SCREENMODEREQ 3L
/***********************
* *
* File requester *
* *
***********************/
/* structure _MUST_ be allocated with rtAllocRequest() */
struct rtFileRequester {
ULONG ReqPos;
UWORD LeftOffset;
UWORD TopOffset;
ULONG Flags;
/* OBSOLETE IN V38! DON'T USE! */ struct Hook *Hook;
/* */
char *Dir; /* READ ONLY! Change with rtChangeReqAttrA()! */
char *MatchPat; /* READ ONLY! Change with rtChangeReqAttrA()! */
/* */
struct TextFont *DefaultFont;
ULONG WaitPointer;
/* (V38) */
ULONG LockWindow;
ULONG ShareIDCMP;
struct Hook *IntuiMsgFunc;
UWORD reserved1;
UWORD reserved2;
UWORD reserved3;
UWORD ReqHeight; /* READ ONLY! Use RTFI_Height tag! */
/* Private data follows! HANDS OFF :-) */
};
/* returned by rtFileRequestA() if multiselect is enabled,
free list with rtFreeFileList() */
struct rtFileList {
struct rtFileList *Next;
ULONG StrLen; /* -1 for directories */
char *Name;
};
/* structure passed to RTFI_FilterFunc callback hook by
volume requester (see RTFI_VolumeRequest tag) */
struct rtVolumeEntry {
ULONG Type; /* DLT_DEVICE or DLT_DIRECTORY */
char *Name;
};
/***********************
* *
* Font requester *
* *
***********************/
/* structure _MUST_ be allocated with rtAllocRequest() */
struct rtFontRequester {
ULONG ReqPos;
UWORD LeftOffset;
UWORD TopOffset;
ULONG Flags;
/* OBSOLETE IN V38! DON'T USE! */ struct Hook *Hook;
/* */
struct TextAttr Attr; /* READ ONLY! */
/* */
struct TextFont *DefaultFont;
ULONG WaitPointer;
/* (V38) */
ULONG LockWindow;
ULONG ShareIDCMP;
struct Hook *IntuiMsgFunc;
UWORD reserved1;
UWORD reserved2;
UWORD reserved3;
UWORD ReqHeight; /* READ ONLY! Use RTFO_Height tag! */
/* Private data follows! HANDS OFF :-) */
};
/*************************
* *
* ScreenMode requester *
* *
*************************/
/* structure _MUST_ be allocated with rtAllocRequest() */
struct rtScreenModeRequester {
ULONG ReqPos;
UWORD LeftOffset;
UWORD TopOffset;
ULONG Flags;
ULONG private1;
/* */
ULONG DisplayID; /* READ ONLY! */
UWORD DisplayWidth; /* READ ONLY! */
UWORD DisplayHeight; /* READ ONLY! */
/* */
struct TextFont *DefaultFont;
ULONG WaitPointer;
ULONG LockWindow;
ULONG ShareIDCMP;
struct Hook *IntuiMsgFunc;
UWORD reserved1;
UWORD reserved2;
UWORD reserved3;
UWORD ReqHeight; /* READ ONLY! Use RTSC_Height tag! */
/* */
UWORD DisplayDepth; /* READ ONLY! */
UWORD OverscanType; /* READ ONLY! */
ULONG AutoScroll; /* READ ONLY! */
/* Private data follows! HANDS OFF :-) */
};
/***********************
* *
* Requester Info *
* *
***********************/
/* for rtEZRequestA(), rtGetLongA(), rtGetStringA() and rtPaletteRequestA(),
_MUST_ be allocated with rtAllocRequest() */
struct rtReqInfo {
ULONG ReqPos;
UWORD LeftOffset;
UWORD TopOffset;
ULONG Width; /* not for rtEZRequestA() */
char *ReqTitle; /* currently only for rtEZRequestA() */
ULONG Flags;
struct TextFont *DefaultFont; /* currently only for rtPaletteRequestA() */
ULONG WaitPointer;
/* (V38) */
ULONG LockWindow;
ULONG ShareIDCMP;
struct Hook *IntuiMsgFunc;
/* structure may be extended in future */
};
/***********************
* *
* Handler Info *
* *
***********************/
/* for rtReqHandlerA(), will be allocated for you when you use
the RT_ReqHandler tag, never try to allocate this yourself! */
struct rtHandlerInfo {
ULONG private1;
ULONG WaitMask;
ULONG DoNotWait;
/* Private data follows, HANDS OFF :-) */
};
/* possible return codes from rtReqHandlerA() */
#define CALL_HANDLER (ULONG)0x80000000
/*************************************
* *
* TAGS *
* *
*************************************/
#define RT_TagBase TAG_USER
/*** tags understood by most requester functions ***
*/
/* optional pointer to window */
#define RT_Window (RT_TagBase+1)
/* idcmp flags requester should abort on (useful for IDCMP_DISKINSERTED) */
#define RT_IDCMPFlags (RT_TagBase+2)
/* position of requester window (see below) - default REQPOS_POINTER */
#define RT_ReqPos (RT_TagBase+3)
/* leftedge offset of requester relative to position specified by RT_ReqPos */
#define RT_LeftOffset (RT_TagBase+4)
/* topedge offset of requester relative to position specified by RT_ReqPos */
#define RT_TopOffset (RT_TagBase+5)
/* name of public screen to put requester on (Kickstart 2.0 only!) */
#define RT_PubScrName (RT_TagBase+6)
/* address of screen to put requester on */
#define RT_Screen (RT_TagBase+7)
/* tagdata must hold the address of (!) an APTR variable */
#define RT_ReqHandler (RT_TagBase+8)
/* font to use when screen font is rejected, _MUST_ be fixed-width font!
(struct TextFont *, not struct TextAttr *!)
- default GfxBase->DefaultFont */
#define RT_DefaultFont (RT_TagBase+9)
/* boolean to set the standard wait pointer in window - default FALSE */
#define RT_WaitPointer (RT_TagBase+10)
/* (V38) char preceding keyboard shortcut characters (will be underlined) */
#define RT_Underscore (RT_TagBase+11)
/* (V38) share IDCMP port with window - default FALSE */
#define RT_ShareIDCMP (RT_TagBase+12)
/* (V38) lock window and set standard wait pointer - default FALSE */
#define RT_LockWindow (RT_TagBase+13)
/* (V38) boolean to make requester's screen pop to front - default TRUE */
#define RT_ScreenToFront (RT_TagBase+14)
/* (V38) Requester should use this font - default: screen font */
#define RT_TextAttr (RT_TagBase+15)
/* (V38) call this hook for every IDCMP message not for requester */
#define RT_IntuiMsgFunc (RT_TagBase+16)
/* (V38) Locale ReqTools should use for text */
#define RT_Locale (RT_TagBase+17)
/*** tags specific to rtEZRequestA ***
*/
/* title of requester window - english default "Request" or "Information" */
#define RTEZ_ReqTitle (RT_TagBase+20)
/* (RT_TagBase+21) reserved */
/* various flags (see below) */
#define RTEZ_Flags (RT_TagBase+22)
/* default response (activated by pressing RETURN) - default TRUE */
#define RTEZ_DefaultResponse (RT_TagBase+23)
/*** tags specific to rtGetLongA ***
*/
/* minimum allowed value - default MININT */
#define RTGL_Min (RT_TagBase+30)
/* maximum allowed value - default MAXINT */
#define RTGL_Max (RT_TagBase+31)
/* suggested width of requester window (in pixels) */
#define RTGL_Width (RT_TagBase+32)
/* boolean to show the default value - default TRUE */
#define RTGL_ShowDefault (RT_TagBase+33)
/* (V38) string with possible responses - english default " _Ok |_Cancel" */
#define RTGL_GadFmt (RT_TagBase+34)
/* (V38) optional arguments for RTGL_GadFmt */
#define RTGL_GadFmtArgs (RT_TagBase+35)
/* (V38) invisible typing - default FALSE */
#define RTGL_Invisible (RT_TagBase+36)
/* (V38) window backfill - default TRUE */
#define RTGL_BackFill (RT_TagBase+37)
/* (V38) optional text above gadget */
#define RTGL_TextFmt (RT_TagBase+38)
/* (V38) optional arguments for RTGS_TextFmt */
#define RTGL_TextFmtArgs (RT_TagBase+39)
/* (V38) various flags (see below) */
#define RTGL_Flags RTEZ_Flags
/*** tags specific to rtGetStringA ***
*/
/* suggested width of requester window (in pixels) */
#define RTGS_Width RTGL_Width
/* allow empty string to be accepted - default FALSE */
#define RTGS_AllowEmpty (RT_TagBase+80)
/* (V38) string with possible responses - english default " _Ok |_Cancel" */
#define RTGS_GadFmt RTGL_GadFmt
/* (V38) optional arguments for RTGS_GadFmt */
#define RTGS_GadFmtArgs RTGL_GadFmtArgs
/* (V38) invisible typing - default FALSE */
#define RTGS_Invisible RTGL_Invisible
/* (V38) window backfill - default TRUE */
#define RTGS_BackFill RTGL_BackFill
/* (V38) optional text above gadget */
#define RTGS_TextFmt RTGL_TextFmt
/* (V38) optional arguments for RTGS_TextFmt */
#define RTGS_TextFmtArgs RTGL_TextFmtArgs
/* (V38) various flags (see below) */
#define RTGS_Flags RTEZ_Flags
/*** tags specific to rtFileRequestA ***
*/
/* various flags (see below) */
#define RTFI_Flags (RT_TagBase+40)
/* suggested height of file requester */
#define RTFI_Height (RT_TagBase+41)
/* replacement text for 'Ok' gadget (max 6 chars) */
#define RTFI_OkText (RT_TagBase+42)
/* (V38) bring up volume requester, tag data holds flags (see below) */
#define RTFI_VolumeRequest (RT_TagBase+43)
/* (V38) call this hook for every file in the directory */
#define RTFI_FilterFunc (RT_TagBase+44)
/* (V38) allow empty file to be accepted - default FALSE */
#define RTFI_AllowEmpty (RT_TagBase+45)
/*** tags specific to rtFontRequestA ***
*/
/* various flags (see below) */
#define RTFO_Flags RTFI_Flags
/* suggested height of font requester */
#define RTFO_Height RTFI_Height
/* replacement text for 'Ok' gadget (max 6 chars) */
#define RTFO_OkText RTFI_OkText
/* suggested height of font sample display - default 24 */
#define RTFO_SampleHeight (RT_TagBase+60)
/* minimum height of font displayed */
#define RTFO_MinHeight (RT_TagBase+61)
/* maximum height of font displayed */
#define RTFO_MaxHeight (RT_TagBase+62)
/* [(RT_TagBase+63) to (RT_TagBase+66) used below] */
/* (V38) call this hook for every font */
#define RTFO_FilterFunc RTFI_FilterFunc
/*** (V38) tags for rtScreenModeRequestA ***
*/
/* various flags (see below) */
#define RTSC_Flags RTFI_Flags
/* suggested height of screenmode requester */
#define RTSC_Height RTFI_Height
/* replacement text for 'Ok' gadget (max 6 chars) */
#define RTSC_OkText RTFI_OkText
/* property flags (see also RTSC_PropertyMask) */
#define RTSC_PropertyFlags (RT_TagBase+90)
/* property mask - default all bits in RTSC_PropertyFlags considered */
#define RTSC_PropertyMask (RT_TagBase+91)
/* minimum display width allowed */
#define RTSC_MinWidth (RT_TagBase+92)
/* maximum display width allowed */
#define RTSC_MaxWidth (RT_TagBase+93)
/* minimum display height allowed */
#define RTSC_MinHeight (RT_TagBase+94)
/* maximum display height allowed */
#define RTSC_MaxHeight (RT_TagBase+95)
/* minimum display depth allowed */
#define RTSC_MinDepth (RT_TagBase+96)
/* maximum display depth allowed */
#define RTSC_MaxDepth (RT_TagBase+97)
/* call this hook for every display mode id */
#define RTSC_FilterFunc RTFI_FilterFunc
/*** tags for rtChangeReqAttrA ***
*/
/* file requester - set directory */
#define RTFI_Dir (RT_TagBase+50)
/* file requester - set wildcard pattern */
#define RTFI_MatchPat (RT_TagBase+51)
/* file requester - add a file or directory to the buffer */
#define RTFI_AddEntry (RT_TagBase+52)
/* file requester - remove a file or directory from the buffer */
#define RTFI_RemoveEntry (RT_TagBase+53)
/* font requester - set font name of selected font */
#define RTFO_FontName (RT_TagBase+63)
/* font requester - set font size */
#define RTFO_FontHeight (RT_TagBase+64)
/* font requester - set font style */
#define RTFO_FontStyle (RT_TagBase+65)
/* font requester - set font flags */
#define RTFO_FontFlags (RT_TagBase+66)
/* (V38) screenmode requester - get display attributes from screen */
#define RTSC_ModeFromScreen (RT_TagBase+80)
/* (V38) screenmode requester - set display mode id (32-bit extended) */
#define RTSC_DisplayID (RT_TagBase+81)
/* (V38) screenmode requester - set display width */
#define RTSC_DisplayWidth (RT_TagBase+82)
/* (V38) screenmode requester - set display height */
#define RTSC_DisplayHeight (RT_TagBase+83)
/* (V38) screenmode requester - set display depth */
#define RTSC_DisplayDepth (RT_TagBase+84)
/* (V38) screenmode requester - set overscan type, 0 for regular size */
#define RTSC_OverscanType (RT_TagBase+85)
/* (V38) screenmode requester - set autoscroll */
#define RTSC_AutoScroll (RT_TagBase+86)
/*** tags for rtPaletteRequestA ***
*/
/* initially selected color - default 1 */
#define RTPA_Color (RT_TagBase+70)
/*** tags for rtReqHandlerA ***
*/
/* end requester by software control, set tagdata to REQ_CANCEL, REQ_OK or
in case of rtEZRequest to the return value */
#define RTRH_EndRequest (RT_TagBase+60)
/*** tags for rtAllocRequestA ***/
/* no tags defined yet */
/************
* RT_ReqPos *
************/
#define REQPOS_POINTER 0L
#define REQPOS_CENTERWIN 1L
#define REQPOS_CENTERSCR 2L
#define REQPOS_TOPLEFTWIN 3L
#define REQPOS_TOPLEFTSCR 4L
/******************
* RTRH_EndRequest *
******************/
#define REQ_CANCEL 0L
#define REQ_OK 1L
/***************************************
* flags for RTFI_Flags and RTFO_Flags *
* or filereq->Flags and fontreq->Flags *
***************************************/
#define FREQB_NOBUFFER 2L
#define FREQF_NOBUFFER (1L<<FREQB_NOBUFFER)
/*****************************************
* flags for RTFI_Flags or filereq->Flags *
*****************************************/
#define FREQB_MULTISELECT 0L
#define FREQF_MULTISELECT (1L<<FREQB_MULTISELECT)
#define FREQB_SAVE 1L
#define FREQF_SAVE (1L<<FREQB_SAVE)
#define FREQB_NOFILES 3L
#define FREQF_NOFILES (1L<<FREQB_NOFILES)
#define FREQB_PATGAD 4L
#define FREQF_PATGAD (1L<<FREQB_PATGAD)
#define FREQB_SELECTDIRS 12L
#define FREQF_SELECTDIRS (1L<<FREQB_SELECTDIRS)
/*****************************************
* flags for RTFO_Flags or fontreq->Flags *
*****************************************/
#define FREQB_FIXEDWIDTH 5L
#define FREQF_FIXEDWIDTH (1L<<FREQB_FIXEDWIDTH)
#define FREQB_COLORFONTS 6L
#define FREQF_COLORFONTS (1L<<FREQB_COLORFONTS)
#define FREQB_CHANGEPALETTE 7L
#define FREQF_CHANGEPALETTE (1L<<FREQB_CHANGEPALETTE)
#define FREQB_LEAVEPALETTE 8L
#define FREQF_LEAVEPALETTE (1L<<FREQB_LEAVEPALETTE)
#define FREQB_SCALE 9L
#define FREQF_SCALE (1L<<FREQB_SCALE)
#define FREQB_STYLE 10L
#define FREQF_STYLE (1L<<FREQB_STYLE)
/*****************************************************
* (V38) flags for RTSC_Flags or screenmodereq->Flags *
*****************************************************/
#define SCREQB_SIZEGADS 13L
#define SCREQF_SIZEGADS (1L<<SCREQB_SIZEGADS)
#define SCREQB_DEPTHGAD 14L
#define SCREQF_DEPTHGAD (1L<<SCREQB_DEPTHGAD)
#define SCREQB_NONSTDMODES 15L
#define SCREQF_NONSTDMODES (1L<<SCREQB_NONSTDMODES)
#define SCREQB_GUIMODES 16L
#define SCREQF_GUIMODES (1L<<SCREQB_GUIMODES)
#define SCREQB_AUTOSCROLLGAD 18L
#define SCREQF_AUTOSCROLLGAD (1L<<SCREQB_AUTOSCROLLGAD)
#define SCREQB_OVERSCANGAD 19L
#define SCREQF_OVERSCANGAD (1L<<SCREQB_OVERSCANGAD)
/*****************************************
* flags for RTEZ_Flags or reqinfo->Flags *
*****************************************/
#define EZREQB_NORETURNKEY 0L
#define EZREQF_NORETURNKEY (1L<<EZREQB_NORETURNKEY)
#define EZREQB_LAMIGAQUAL 1L
#define EZREQF_LAMIGAQUAL (1L<<EZREQB_LAMIGAQUAL)
#define EZREQB_CENTERTEXT 2L
#define EZREQF_CENTERTEXT (1L<<EZREQB_CENTERTEXT)
/***********************************************
* (V38) flags for RTGL_Flags or reqinfo->Flags *
***********************************************/
#define GLREQB_CENTERTEXT EZREQB_CENTERTEXT
#define GLREQF_CENTERTEXT EZREQF_CENTERTEXT
#define GLREQB_HIGHLIGHTTEXT 3L
#define GLREQF_HIGHLIGHTTEXT (1L<<GLREQB_HIGHLIGHTTEXT)
/***********************************************
* (V38) flags for RTGS_Flags or reqinfo->Flags *
***********************************************/
#define GSREQB_CENTERTEXT EZREQB_CENTERTEXT
#define GSREQF_CENTERTEXT EZREQF_CENTERTEXT
#define GSREQB_HIGHLIGHTTEXT GLREQB_HIGHLIGHTTEXT
#define GSREQF_HIGHLIGHTTEXT GLREQF_HIGHLIGHTTEXT
/*****************************************
* (V38) flags for RTFI_VolumeRequest tag *
*****************************************/
#define VREQB_NOASSIGNS 0L
#define VREQF_NOASSIGNS (1L<<VREQB_NOASSIGNS)
#define VREQB_NODISKS 1L
#define VREQF_NODISKS (1L<<VREQB_NODISKS)
#define VREQB_ALLDISKS 2L
#define VREQF_ALLDISKS (1L<<VREQB_ALLDISKS)
/*
Following things are obsolete in ReqTools V38.
DON'T USE THESE IN NEW CODE!
*/
#ifndef NO_REQTOOLS_OBSOLETE
#define REQHOOK_WILDFILE 0L
#define REQHOOK_WILDFONT 1L
#define FREQB_DOWILDFUNC 11L
#define FREQF_DOWILDFUNC (1L<<FREQB_DOWILDFUNC)
#endif
#endif /* LIBRARIES_REQTOOLS_H */

View File

@@ -0,0 +1,585 @@
IFND LIBRARIES_REQTOOLS_I
LIBRARIES_REQTOOLS_I SET 1
**
** $Filename: libraries/reqtools.i $
** $Release: 2.2 $
** $Revision: 38.11 $
**
** reqtools.library definitions
**
** (C) Copyright 1991-1994 Nico François
** All Rights Reserved
**
IFND EXEC_LISTS_I
include "exec/lists.i"
ENDC
IFND EXEC_LIBRARIES_I
include "exec/libraries.i"
ENDC
IFND EXEC_SEMAPHORES_I
include "exec/semaphores.i"
ENDC
IFND LIBRARIES_DOS_I
include "libraries/dos.i"
ENDC
IFND LIBRARIES_DOSEXTENS_I
include "libraries/dosextens.i"
ENDC
IFND GRAPHICS_TEXT_I
include "graphics/text.i"
ENDC
IFND UTILITY_TAGITEM_I
include "utility/tagitem.i"
ENDC
REQTOOLSNAME MACRO
dc.b "reqtools.library",0
ENDM
REQTOOLSVERSION equ 38
************************
* *
* Preferences *
* *
************************
RTPREF_FILEREQ equ 0
RTPREF_FONTREQ equ 1
RTPREF_PALETTEREQ equ 2
RTPREF_SCREENMODEREQ equ 3
RTPREF_VOLUMEREQ equ 4
RTPREF_OTHERREQ equ 5
RTPREF_NR_OF_REQ equ 6
STRUCTURE ReqDefaults,0
ULONG rtrd_Size
ULONG rtrd_ReqPos
UWORD rtrd_LeftOffset
UWORD rtrd_TopOffset
UWORD rtrd_MinEntries
UWORD rtrd_MaxEntries
LABEL ReqDefaults_SIZE
STRUCTURE ReqToolsPrefs,0
* Size of preferences (_without_ this field and the semaphore)
ULONG rtpr_PrefsSize
STRUCT rtpr_PrefsSemaphore,SS_SIZE
* Start of real preferences
ULONG rtpr_Flags
STRUCT rtpr_ReqDefaults,RTPREF_NR_OF_REQ*ReqDefaults_SIZE
LABEL ReqToolsPrefs_SIZE
RTPREFS_SIZE equ (ReqToolsPrefs_SIZE-SS_SIZE-4)
* Flags
BITDEF RTPR,DIRSFIRST,0
BITDEF RTPR,DIRSMIXED,1
BITDEF RTPR,IMMSORT,2
BITDEF RTPR,NOSCRTOFRONT,3
BITDEF RTPR,NOLED,4
************************
* *
* Library Base *
* *
************************
STRUCTURE ReqToolsBase,LIB_SIZE
UBYTE rt_RTFlags
STRUCT rt_pad,3
ULONG rt_SegList
* PUBLIC FIELDS *
* The following library bases may be read and used by your program
APTR rt_IntuitionBase
APTR rt_GfxBase
APTR rt_DOSBase
* Next two library bases are only (and always) valid on Kickstart 2.0!
* (1.3 version of reqtools also initializes these when run on 2.0)
APTR rt_GadToolsBase
APTR rt_UtilityBase
* PRIVATE FIELDS, THESE WILL CHANGE FROM RELEASE TO RELEASE!
* The RealOpenCnt is for the buffered AvailFonts feature. Since
* Kickstart 3.0 offers low memory handlers a release of ReqTools for
* 3.0 will not use this field and start using the normal OpenCnt again.
UWORD rt_RealOpenCnt
UWORD rt_AvailFontsLock
APTR rt_AvailFontsHeader
ULONG rt_FontsAssignType
BPTR rt_FontsAssignLock
APTR rt_FontsAssignList
STRUCT rt_ReqToolsPrefs,ReqToolsPrefs_SIZE
UWORD rt_prefspad
LABEL ReqToolsBase_SIZE
* types of requesters, for rtAllocRequestA()
RT_FILEREQ equ 0
RT_REQINFO equ 1
RT_FONTREQ equ 2
* (V38) *
RT_SCREENMODEREQ equ 3
************************
* *
* File requester *
* *
************************
* structure _MUST_ be allocated with rtAllocRequest()
STRUCTURE rtFileRequester,0
ULONG rtfi_ReqPos
UWORD rtfi_LeftOffset
UWORD rtfi_TopOffset
ULONG rtfi_Flags
ULONG rtfi_private1
APTR rtfi_Dir * READ ONLY! Change with rtChangeReqAttrA()!
APTR rtfi_MatchPat * READ ONLY! Change with rtChangeReqAttrA()!
APTR rtfi_DefaultFont
ULONG rtfi_WaitPointer
* (V38) *
ULONG rtfi_LockWindow
ULONG rtfi_ShareIDCMP
APTR rtfi_IntuiMsgFunc
UWORD rtfi_reserved1
UWORD rtfi_reserved2
UWORD rtfi_reserved3
UWORD rtfi_ReqHeight * READ ONLY! Use RTFI_Height tag!
* Lots of private data follows! HANDS OFF :-)
* returned by rtFileRequestA() if multiselect is enabled,
* free list with rtFreeFileList()
STRUCTURE rtFileList,0
APTR rtfl_Next
ULONG rtfl_StrLen
APTR rtfl_Name
LABEL rtFileList_SIZE
* structure passed to RTFI_FilterFunc callback hook by
* volume requester (see RTFI_VolumeRequest tag)
STRUCTURE rtVolumeEntry,0
ULONG rtve_Type * DLT_DEVICE or DLT_DIRECTORY
APTR rtve_Name
LABEL rtVolumeEntry_SIZE
************************
* *
* Font requester *
* *
************************
* structure _MUST_ be allocated with rtAllocRequest()
STRUCTURE rtFontRequester,0
ULONG rtfo_ReqPos
UWORD rtfo_LeftOffset
UWORD rtfo_TopOffset
ULONG rtfo_Flags
APTR rtfo_private1
STRUCT rtfo_Attr,ta_SIZEOF * READ ONLY!
APTR rtfo_DefaultFont
ULONG rtfo_WaitPointer
* (V38) *
ULONG rtfo_LockWindow
ULONG rtfo_ShareIDCMP
APTR rtfo_IntuiMsgFunc
UWORD rtfo_reserved1
UWORD rtfo_reserved2
UWORD rtfo_reserved3
UWORD rtfo_ReqHeight * READ ONLY! Use RTFO_Height tag!
* Lots of private data follows! HANDS OFF :-)
**************************
* *
* ScreenMode requester *
* *
**************************
* structure _MUST_ be allocated with rtAllocRequest()
STRUCTURE rtScreenModeRequester,0
ULONG rtsc_ReqPos
UWORD rtsc_LeftOffset
UWORD rtsc_TopOffset
ULONG rtsc_Flags
APTR rtsc_private1
*
ULONG rtsc_DisplayID * READ ONLY!
UWORD rtsc_DisplayWidth * READ ONLY!
UWORD rtsc_DisplayHeight * READ ONLY!
*
APTR rtsc_DefaultFont
ULONG rtsc_WaitPointer
ULONG rtsc_LockWindow
ULONG rtsc_ShareIDCMP
APTR rtsc_IntuiMsgFunc
UWORD rtsc_reserved1
UWORD rtsc_reserved2
UWORD rtsc_reserved3
UWORD rtsc_ReqHeight * READ ONLY! Use RTSC_Height tag!
*
UWORD rtsc_DisplayDepth * READ ONLY!
UWORD rtsc_OverscanType * READ ONLY!
ULONG rtsc_AutoScroll * READ ONLY!
* Lots of private data follows! HANDS OFF :-)
************************
* *
* Requester Info *
* *
************************
* for rtEZRequestA(), rtGetLongA(), rtGetStringA() and rtPaletteRequestA(),
* _MUST_ be allocated with rtAllocRequest()
STRUCTURE rtReqInfo,0
ULONG rtri_ReqPos
UWORD rtri_LeftOffset
UWORD rtri_TopOffset
ULONG rtri_Width * not for rtEZRequestA()
APTR rtri_ReqTitle * currently only for rtEZRequestA()
ULONG rtri_Flags
APTR rtri_DefaultFont * currently only for rtPaletteRequestA()
ULONG rtri_WaitPointer
* (V38) *
ULONG rtri_LockWindow
ULONG rtri_ShareIDCMP
ULONG rtri_IntuiMsgFunc
* structure may be extended in future
************************
* *
* Handler Info *
* *
************************
* for rtReqHandlerA(), will be allocated for you when you use
* the RT_ReqHandler tag, never try to allocate this yourself!
STRUCTURE rtHandlerInfo,4 * first longword is private!
ULONG rthi_WaitMask
ULONG rthi_DoNotWait
* Private data follows, HANDS OFF :-)
* possible return codes from rtReqHandlerA()
CALL_HANDLER equ $80000000
**************************************
* *
* TAGS *
* *
**************************************
RT_TagBase equ TAG_USER
*** tags understood by most requester functions ***
*
* optional pointer to window
RT_Window equ (RT_TagBase+1)
* idcmp flags requester should abort on (useful for IDCMP_DISKINSERTED)
RT_IDCMPFlags equ (RT_TagBase+2)
* position of requester window (see below) - default REQPOS_POINTER
RT_ReqPos equ (RT_TagBase+3)
* leftedge offset of requester relative to position specified by RT_ReqPos
RT_LeftOffset equ (RT_TagBase+4)
* topedge offset of requester relative to position specified by RT_ReqPos
RT_TopOffset equ (RT_TagBase+5)
* name of public screen to put requester on (use on Kickstart 2.0 only!)
RT_PubScrName equ (RT_TagBase+6)
* address of screen to put requester on
RT_Screen equ (RT_TagBase+7)
* additional signal mask to wait on
RT_ReqHandler equ (RT_TagBase+8)
* font to use when screen font is rejected, _MUST_ be fixed-width font!
* (struct TextFont *, not struct TextAttr *!)
* - default GfxBase->DefaultFont
RT_DefaultFont equ (RT_TagBase+9)
* boolean to set the standard wait pointer in window - default FALSE
RT_WaitPointer equ (RT_TagBase+10)
* (V38) char preceding keyboard shortcut characters (will be underlined)
RT_Underscore equ (RT_TagBase+11)
* (V38) share IDCMP port with window - default FALSE
RT_ShareIDCMP equ (RT_TagBase+12)
* (V38) lock window and set standard wait pointer - default FALSE
RT_LockWindow equ (RT_TagBase+13)
* (V38) boolean to make requester's screen pop to front - default TRUE
RT_ScreenToFront equ (RT_TagBase+14)
* (V38) Requester should use this font - default: screen font
RT_TextAttr equ (RT_TagBase+15)
* (V38) call this hook for every IDCMP message not for requester
RT_IntuiMsgFunc equ (RT_TagBase+16)
* (V38) Locale ReqTools should use for text
RT_Locale equ (RT_TagBase+17)
*** tags specific to rtEZRequestA ***
*
* title of requester window - english default "Request" or "Information"
RTEZ_ReqTitle equ (RT_TagBase+20)
* (RT_TagBase+21) reserved
* various flags (see below)
RTEZ_Flags equ (RT_TagBase+22)
* default response (activated by pressing RETURN) - default TRUE
RTEZ_DefaultResponse equ (RT_TagBase+23)
*** tags specific to rtGetLongA ***
*
* minimum allowed value - default MININT
RTGL_Min equ (RT_TagBase+30)
* maximum allowed value - default MAXINT
RTGL_Max equ (RT_TagBase+31)
* suggested width of requester window (in pixels)
RTGL_Width equ (RT_TagBase+32)
* boolean to show the default value - default TRUE
RTGL_ShowDefault equ (RT_TagBase+33)
* (V38) string with possible responses - english default " _Ok |_Cancel"
RTGL_GadFmt equ (RT_TagBase+34)
* (V38) optional arguments for RTGL_GadFmt
RTGL_GadFmtArgs equ (RT_TagBase+35)
* (V38) invisible typing - default FALSE
RTGL_Invisible equ (RT_TagBase+36)
* (V38) window backfill - default TRUE
RTGL_BackFill equ (RT_TagBase+37)
* (V38) optional text above gadget
RTGL_TextFmt equ (RT_TagBase+38)
* (V38) optional arguments for RTGS_TextFmt
RTGL_TextFmtArgs equ (RT_TagBase+39)
* (V38) Center text - default FALSE
RTGL_CenterText equ (RT_TagBase+100)
* (V38) various flags (see below)
RTGL_Flags equ RTEZ_Flags
*** tags specific to rtGetStringA ***
*
* suggested width of requester window (in pixels)
RTGS_Width equ RTGL_Width
* allow empty string to be accepted - default FALSE
RTGS_AllowEmpty equ (RT_TagBase+80)
* (V38) string with possible responses - english default " _Ok |_Cancel"
RTGS_GadFmt equ RTGL_GadFmt
* (V38) optional arguments for RTGS_GadFmt
RTGS_GadFmtArgs equ RTGL_GadFmtArgs
* (V38) invisible typing - default FALSE
RTGS_Invisible equ RTGL_Invisible
* (V38) window backfill - default TRUE
RTGS_BackFill equ RTGL_BackFill
* (V38) optional text above gadget
RTGS_TextFmt equ RTGL_TextFmt
* (V38) optional arguments for RTGS_TextFmt
RTGS_TextFmtArgs equ RTGL_TextFmtArgs
* (V38) Center text - default FALSE
RTGS_CenterText equ RTGL_CenterText
* (V38) various flags (see below)
RTGS_Flags equ RTEZ_Flags
*** tags specific to rtFileRequestA ***
*
* various flags (see below)
RTFI_Flags equ (RT_TagBase+40)
* suggested height of file requester
RTFI_Height equ (RT_TagBase+41)
* replacement text for 'Ok' gadget (max 6 chars)
RTFI_OkText equ (RT_TagBase+42)
* (V38) bring up volume requester, tag data holds flags (see below)
RTFI_VolumeRequest equ (RT_TagBase+43)
* (V38) call this hook for every file in the directory
RTFI_FilterFunc equ (RT_TagBase+44)
* (V38) allow empty file to be accepted - default FALSE
RTFI_AllowEmpty equ (RT_TagBase+45)
*** tags specific to rtFontRequestA ***
*
* various flags (see below)
RTFO_Flags equ RTFI_Flags
* suggested height of font requester
RTFO_Height equ RTFI_Height
* replacement text for 'Ok' gadget (max 6 chars)
RTFO_OkText equ RTFI_OkText
* suggested height of font sample display - default 24
RTFO_SampleHeight equ (RT_TagBase+60)
* minimum height of font displayed
RTFO_MinHeight equ (RT_TagBase+61)
* maximum height of font displayed
RTFO_MaxHeight equ (RT_TagBase+62)
* [(RT_TagBase+63) to (RT_TagBase+66) used below]
* (V38) call this hook for every font
RTFO_FilterFunc equ RTFI_FilterFunc
*** (V38) tags for rtScreenModeRequestA ***
* various flags (see below)
RTSC_Flags equ RTFI_Flags
* suggested height of screenmode requester
RTSC_Height equ RTFI_Height
* replacement text for 'Ok' gadget (max 6 chars)
RTSC_OkText equ RTFI_OkText
* property flags (see also RTSC_PropertyMask)
RTSC_PropertyFlags equ (RT_TagBase+90)
* property mask - default all bits in RTSC_PropertyFlags considered
RTSC_PropertyMask equ (RT_TagBase+91)
* minimum display width allowed
RTSC_MinWidth equ (RT_TagBase+92)
* maximum display width allowed
RTSC_MaxWidth equ (RT_TagBase+93)
* minimum display height allowed
RTSC_MinHeight equ (RT_TagBase+94)
* maximum display height allowed
RTSC_MaxHeight equ (RT_TagBase+95)
* minimum display depth allowed
RTSC_MinDepth equ (RT_TagBase+96)
* maximum display depth allowed
RTSC_MaxDepth equ (RT_TagBase+97)
* call this hook for every display mode id
RTSC_FilterFunc equ RTFI_FilterFunc
*** tags for rtChangeReqAttrA ***
*
* file requester - set directory
RTFI_Dir equ (RT_TagBase+50)
* file requester - set wildcard pattern
RTFI_MatchPat equ (RT_TagBase+51)
* file requester - add a file or directory to the buffer
RTFI_AddEntry equ (RT_TagBase+52)
* file requester - remove a file or directory from the buffer
RTFI_RemoveEntry equ (RT_TagBase+53)
* font requester - set font name of selected font
RTFO_FontName equ (RT_TagBase+63)
* font requester - set font size
RTFO_FontHeight equ (RT_TagBase+64)
* font requester - set font style
RTFO_FontStyle equ (RT_TagBase+65)
* font requester - set font flags
RTFO_FontFlags equ (RT_TagBase+66)
* (V38) screenmode requester - get display attributes from screen
RTSC_ModeFromScreen equ (RT_TagBase+80)
* (V38) screenmode requester - set display mode id (32-bit extended)
RTSC_DisplayID equ (RT_TagBase+81)
* (V38) screenmode requester - set display width
RTSC_DisplayWidth equ (RT_TagBase+82)
* (V38) screenmode requester - set display height
RTSC_DisplayHeight equ (RT_TagBase+83)
* (V38) screenmode requester - set display depth
RTSC_DisplayDepth equ (RT_TagBase+84)
* (V38) screenmode requester - set overscan type, 0 for regular size
RTSC_OverscanType equ (RT_TagBase+85)
* (V38) screenmode requester - set autoscroll
RTSC_AutoScroll equ (RT_TagBase+86)
*** tags for rtPaletteRequestA ***
*
* initially selected color - default 1
RTPA_Color equ (RT_TagBase+70)
*** tags for rtReqHandlerA ***
*
* end requester by software control, set tagdata to REQ_CANCEL, REQ_OK or
* in case of rtEZRequest to the return value
RTRH_EndRequest equ (RT_TagBase+60)
*** tags for rtAllocRequestA ***
* no tags defined yet
*************
* RT_ReqPos *
*************
REQPOS_POINTER equ 0
REQPOS_CENTERWIN equ 1
REQPOS_CENTERSCR equ 2
REQPOS_TOPLEFTWIN equ 3
REQPOS_TOPLEFTSCR equ 4
*******************
* RTRH_EndRequest *
*******************
REQ_CANCEL equ 0
REQ_OK equ 1
****************************************
* flags for RTFI_Flags and RTFO_Flags *
* or filereq->Flags and fontreq->Flags *
****************************************
BITDEF FREQ,NOBUFFER,2
******************************************
* flags for RTFI_Flags or filereq->Flags *
******************************************
BITDEF FREQ,MULTISELECT,0
BITDEF FREQ,SAVE,1
BITDEF FREQ,NOFILES,3
BITDEF FREQ,PATGAD,4
BITDEF FREQ,SELECTDIRS,12
******************************************
* flags for RTFO_Flags or fontreq->Flags *
******************************************
BITDEF FREQ,FIXEDWIDTH,5
BITDEF FREQ,COLORFONTS,6
BITDEF FREQ,CHANGEPALETTE,7
BITDEF FREQ,LEAVEPALETTE,8
BITDEF FREQ,SCALE,9
BITDEF FREQ,STYLE,10
******************************************************
* (V38) flags for RTSC_Flags or screenmodereq->Flags *
******************************************************
BITDEF SCREQ,SIZEGADS,13
BITDEF SCREQ,DEPTHGAD,14
BITDEF SCREQ,NONSTDMODES,15
BITDEF SCREQ,GUIMODES,16
BITDEF SCREQ,AUTOSCROLLGAD,18
BITDEF SCREQ,OVERSCANGAD,19
******************************************
* flags for RTEZ_Flags or reqinfo->Flags *
******************************************
BITDEF EZREQ,NORETURNKEY,0
BITDEF EZREQ,LAMIGAQUAL,1
BITDEF EZREQ,CENTERTEXT,2
************************************************
* (V38) flags for RTGL_Flags or reqinfo->Flags *
************************************************
BITDEF GLREQ,CENTERTEXT,EZREQB_CENTERTEXT
BITDEF GLREQ,HIGHLIGHTTEXT,3
************************************************
* (V38) flags for RTGS_Flags or reqinfo->Flags *
************************************************
BITDEF GSREQ,CENTERTEXT,EZREQB_CENTERTEXT
BITDEF GSREQ,HIGHLIGHTTEXT,GLREQB_HIGHLIGHTTEXT
******************************************
* (V38) flags for RTFI_VolumeRequest tag *
******************************************
BITDEF VREQ,NOASSIGNS,0
BITDEF VREQ,NODISKS,1
BITDEF VREQ,ALLDISKS,2
*
* Following things are obsolete in ReqTools V38.
* DON'T USE THESE IN NEW CODE!
*
IFND NO_REQTOOLS_OBSOLETE
rtfi_Hook equ rtfi_private1
rtfo_Hook equ rtfo_private1
REQHOOK_WILDFILE equ 0
REQHOOK_WILDFONT equ 1
BITDEF FREQ,DOWILDFUNC,11
ENDC
ENDC ; LIBRARIES_REQTOOLS_I

View File

@@ -0,0 +1,52 @@
IFND LIBRARIES_REQTOOLS_LIB_I
LIBRARIES_REQTOOLS_LIB_I SET 1
**
** $Filename: libraries/reqtools_lib.i $
** $Release: 2.2 $
**
** (C) Copyright 1991-1994 Nico François
** All Rights Reserved
**
IFND EXEC_TYPES_I
include "exec/types.i"
ENDC
IFND EXEC_NODES_I
include "exec/nodes.i"
ENDC
IFND EXEC_LISTS_I
include "exec/lists.i"
ENDC
IFND EXEC_LIBRARIES_I
include "exec/libraries.i"
ENDC
LIBINIT
LIBDEF _LVOrtAllocRequestA
LIBDEF _LVOrtFreeRequest
LIBDEF _LVOrtFreeReqBuffer
LIBDEF _LVOrtChangeReqAttrA
LIBDEF _LVOrtFileRequestA
LIBDEF _LVOrtFreeFileList
LIBDEF _LVOrtEZRequestA
LIBDEF _LVOrtGetStringA
LIBDEF _LVOrtGetLongA
LIBDEF _LVOrtInternalGetPasswordA ; private!
LIBDEF _LVOrtInternalEnterPasswordA ; private!
LIBDEF _LVOrtFontRequestA
LIBDEF _LVOrtPaletteRequestA
LIBDEF _LVOrtReqHandlerA
LIBDEF _LVOrtSetWaitPointer
LIBDEF _LVOrtGetVScreenSize
LIBDEF _LVOrtSetReqPosition
LIBDEF _LVOrtSpread
LIBDEF _LVOrtScreenToFrontSafely
LIBDEF _LVOrtScreenModeRequestA
LIBDEF _LVOrtCloseWindowSafely
LIBDEF _LVOrtLockWindow
LIBDEF _LVOrtUnlockWindow
LIBDEF _LVOrtLockPrefs
LIBDEF _LVOrtUnlockPrefs
ENDC ; LIBRARIES_REQTOOLS_LIB_I

View File

@@ -0,0 +1,33 @@
/*
* reqtools.library © 1991-1994 Nico François
*
*/
#pragma libcall ReqToolsBase rtAllocRequestA 1E 8002
#pragma libcall ReqToolsBase rtFreeRequest 24 901
#pragma libcall ReqToolsBase rtFreeReqBuffer 2A 901
#pragma libcall ReqToolsBase rtChangeReqAttrA 30 8902
#pragma libcall ReqToolsBase rtFileRequestA 36 8BA904
#pragma libcall ReqToolsBase rtFreeFileList 3C 801
#pragma libcall ReqToolsBase rtEZRequestA 42 8CBA905
#pragma libcall ReqToolsBase rtGetStringA 48 8BA0905
#pragma libcall ReqToolsBase rtGetLongA 4E 8BA904
#pragma libcall ReqToolsBase rtFontRequestA 60 8B903
#pragma libcall ReqToolsBase rtPaletteRequestA 66 8BA03
#pragma libcall ReqToolsBase rtReqHandlerA 6C 80903
#pragma libcall ReqToolsBase rtSetWaitPointer 72 801
#pragma libcall ReqToolsBase rtGetVScreenSize 78 A9803
#pragma libcall ReqToolsBase rtSetReqPosition 7E A98004
#pragma libcall ReqToolsBase rtSpread 84 32109806
#pragma libcall ReqToolsBase rtScreenToFrontSafely 8A 801
#pragma libcall ReqToolsBase rtScreenModeRequestA 90 8B903
#pragma libcall ReqToolsBase rtCloseWindowSafely 96 801
#pragma libcall ReqToolsBase rtLockWindow 9C 801
#pragma libcall ReqToolsBase rtUnlockWindow A2 9802
/**/
/* Private function only to be used by the ReqTools Preference editor.*/
/* Only present in library versions _above_ 38.362 [1.3] and 38.810 [2.0]!*/
/**/
#pragma libcall ReqToolsBase rtLockPrefs A8 0
#pragma libcall ReqToolsBase rtUnlockPrefs AE 0

View File

@@ -0,0 +1,4 @@
#include <exec/types.h>
extern struct ReqToolsBase *ReqToolsBase;
#include <clib/reqtools_protos.h>
#include <pragmas/reqtools.h>

View File

@@ -0,0 +1,25 @@
#ifndef UTILITY_HOOKS_H
#define UTILITY_HOOKS_H
/*
** $Filename: utility/tagitem.i $
** $Release: 1.0 $
**
** Clone of 2.0 include file 'utility/hooks.h'
*/
#ifndef EXEC_TYPES_H
#include "exec/types.h"
#endif /* EXEC_TYPES_H */
#ifndef EXEC_NODES_H
#include "exec/nodes.h"
#endif /* EXEC_NODES_H */
struct Hook {
struct MinNode h_MinNode;
ULONG (*h_Entry)();
ULONG (*h_SubEntry)();
APTR h_Data;
};
#endif /* UTILITY_HOOKS_H */

View File

@@ -0,0 +1,24 @@
IFND UTILITY_HOOKS_I
UTILITY_HOOKS_I SET 1
**
** $Filename: utility/tagitem.i $
** $Release: 1.0 $
**
** Clone of 2.0 include file 'utility/hools.i'
**
IFND EXEC_TYPES_I
INCLUDE "exec/types.i"
ENDC
IFND EXEC_NODES_I
INCLUDE "exec/nodes.i"
ENDC
STRUCTURE HOOK,MLN_SIZE
APTR h_Entry
APTR h_SubEntry
APTR h_Data
LABEL h_SIZEOF
ENDC ; UTILITY_HOOKS_I

View File

@@ -0,0 +1,30 @@
#ifndef UTILITY_TAGITEM_H
#define UTILITY_TAGITEM_H
/*
** $Filename: utility/tagitem.i $
** $Release: 1.0 $
**
** Clone of 2.0 include file 'utility/tagitem.h'
*/
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif /* EXEC_TYPES_H */
typedef ULONG Tag;
struct TagItem {
Tag ti_Tag;
ULONG ti_Data;
};
#define TAG_DONE 0L
#define TAG_END 0L
#define TAG_IGNORE 1L
#define TAG_MORE 2L
#define TAG_SKIP 3L
#define TAG_USER 0x80000000
#define TAGFILTER_AND 0
#define TAGFILTER_NOT 1
#endif /* UTILITY_TAGITEM_H */

View File

@@ -0,0 +1,22 @@
IFND UTILITY_TAGITEM_I
UTILITY_TAGITEM_I SET 1
**
** $Filename: utility/tagitem.i $
** $Release: 1.0 $
**
** Clone of 2.0 include file 'utility/tagitem.i'
**
STRUCTURE TagItem,0
ULONG ti_Tag
ULONG ti_Data
LABEL ti_SIZEOF
TAG_END equ 0
TAG_DONE equ 0
TAG_IGNORE equ 1
TAG_MORE equ 2
TAG_SKIP equ 3
TAG_USER equ $80000000
ENDC ; UTILITY_TAGITEM_I