home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
rramdisk_451.lzh
/
'Liner
/
Source
/
Globals.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-06
|
8KB
|
306 lines
#include <exec/types.h>
#include <exec/exec.h>
#include <intuition/intuition.h>
#include <intuition/intuitionbase.h>
#include <devices/console.h>
#include <devices/clipboard.h>
#include <libraries/dos.h>
#include <libraries/dosextens.h>
#include <devices/inputevent.h>
#include <devices/keymap.h>
#include <math.h>
#include <workbench/startup.h>
#include <libraries/asl.h>
#include <libraries/gadtools.h>
#include <graphics/displayinfo.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/asl.h>
#include <proto/gadtools.h>
#include <proto/dos.h>
#include <clib/wb_protos.h>
#include <pragmas/wb.h>
#include <proto/console.h>
#include <string.h>
#include "proto.h"
struct LineItem /*'Liner structure definition*/
{
struct LineItem *NextItem,*PrevItem;
UBYTE Level,ItemNumber;
char Text[80];
BYTE Highlighted,cont,Future[10];
};
struct Old_LineItem /*Old (pre V1.5) 'Liner structure definition*/
{
struct LineItem *NextItem,*PrevItem;
UBYTE Level,ItemNumber;
char Text[80];
};
struct StrStrings
{
char *String;
UWORD Length;
};
struct WhichOne
{
struct LineItem *Start,*End;
};
struct LinerPrefs /*'Liner preferences structure*/
{
ULONG ScreenType;
BYTE DS,Icons,Level;
UBYTE Color[4][3];
char Macro[4][80],Name[4][80];
char DefaultDir[150],DefPrintDir[150];
BOOL Exists;
char Future[64];
};
extern struct TagItem beveltag[2];
#define WORDROUND(xxx) (((long)xxx+3)>>2)<<2) /* Round to word boundary */
#define D_S(name, type) char c_##name[sizeof(type)+3]; \
type *name = (type *)WORDROUND(c_##name);
#define Rp Window->RPort
#define CSI 0x09b
#define SEMI 0x03b
#define NEWPAGE 0x0c
#define CLOSECHAR 0x05c
#define SCRNHEIGHT RowsInScreen
#define REQUESTERCHARS 57
#define UP 0
#define DOWN 1
#define NOINV 0
#define LINE_PENDING 1
#define LINE_FWD 2
#define LINE_BACK 3
#define BLOCK_PENDING -1
#define BLOCK_DOWN -2
#define BLOCK_UP -3
#define MINMEMORY 20000
extern char SaveHail[25],OpenHail[25],PrintHail[26];
extern struct TextAttr Topaz,Topaz11;
extern LONG ARexxSigBit;
extern struct IntuitionBase *IntuitionBase;
extern struct GfxBase *GfxBase;
extern struct DosBase *DosBase;
extern struct IconBase *IconBase;
extern struct AslBase *AslBase;
extern struct GadToolsBase *GadToolsBase;
extern struct WBStartup *WBenchMsg;
extern struct IOStdReq *consoleWriteMsg,*consoleReadMsg;
extern struct Port *consoleWritePort,*consoleReadPort;
extern struct IOClipReq ClipboardIO;
extern struct MsgPort clipboardMsgPort;
extern struct Process *ThisProc;
extern struct Screen *Screen;
extern struct Window *Window,*AboutWindow;
extern struct KeyMap keymap;
extern APTR VisInfo;
extern UBYTE FontWidth;
extern struct LineItem *CharItem,*StartIItem,*EndIItem,*ClipStart,*ClipEnd;
extern int ButtonState,PtrX,PtrY,LastX,LastY,InvsMode,StartChar,EndChar,InvY,EndIY;
extern int BLastX,ClipMode,ErrorInTitle;
extern UBYTE Laced,RowsInScreen,StartingLevel,Modified,Odd;
extern char Indent;
extern char FileName[LONG_FSIZE+LONG_DSIZE],SDirName[LONG_DSIZE];
extern char PDName[LONG_FSIZE+LONG_DSIZE],PDirName[LONG_DSIZE];
extern char SFileName[LONG_FSIZE],PFileName[LONG_FSIZE];
extern BYTE TopInv,BtmInv;
extern char ScreenTitle[17];
extern struct LineItem *FirstItem,*LastItem,*CurrentItem,*FirstScrnItem,*ScrnBtm;
extern int CurX,CurY,DispRows;
extern struct LinerPrefs prefs;
extern struct FileRequester *MainReq,*PTDReq;
extern UBYTE OLCPos[6][6];
extern UBYTE MaxNumOnLevel[6];
/*Some macros*/
#define PERPOS(x) OLCPos[StartingLevel][x]-3
#define MinX(LI) OLCPos[StartingLevel][(LI->Level)-1]
#define MaxX(LI) OLCPos[StartingLevel][(LI->Level)-1]+strlen(LI->Text)
#define MaxLen(Level) 79-OLCPos[StartingLevel][Level-1]
#define PosInText(Level) CurX-OLCPos[StartingLevel][Level-1]
#define RealLevel(LI) (LI->Level+StartingLevel > 6) ? (LI->Level+StartingLevel-7) : (LI->Level+StartingLevel)
/* ^^^ == get level when StartingLevel != 0 */
/*Function definitions*/
/*liner.c functions*/
extern void GetOutlineChars();
extern void RedrawOutlineChars();
extern void AddItem();
extern void WriteConsole();
extern HandleIDCMP();
extern void HandleBS();
extern HandleReturn();
extern void CloseStuff();
extern void Leave();
extern PushIn();
extern Push();
extern PullOutBlock();
extern void JumpToTop();
extern void JumpToBottom();
extern void PrintItemList();
extern void PrintItem();
extern void PlotCursor();
extern CursorUp();
extern CursorDown();
extern void InsertChar();
extern void DeleteChar();
extern struct LineItem *InsertItem();
extern struct LineItem *FindPrev();
extern struct LineItem *FindNext();
extern void InsertLineAtTop();
extern WholeScreenDown();
extern WholeScreenUp();
extern IsOnScreen();
extern IsBefore();
extern IsAfter();
extern struct LineItem *FindNextNonCont();
extern struct LineItem *FindPrevNonCont();
/*console.c */
extern HandleTAB();
extern void CursorRight();
extern void CursorLeft();
/*windows.c functions*/
extern void MakeMenus();
extern void OpenGraphics();
extern void CloseGraphics();
extern void GetMenuPointers();
extern BOOL SetupFileRequestor();
extern void ChangeDisplay();
extern void PutScreenTypeInMenu();
extern BOOL ChangeScreenSize();
extern BOOL HandleStartingLevel();
extern BOOL DoubleSpacing();
extern void InterpretPrefs();
extern void ModifyMenus();
extern void ModifyIconMenu();
extern void GetLinerPrefs();
extern void InterpretPrefs();
extern PutPrefs();
extern void CopyPrefsToMenus();
extern struct MenuItem *GetFirstItemAddress();
extern void SaveColors();
extern void LoadColors();
extern void ClearMenus();
extern void SetRowsInScreen();
extern NewAll();
extern HandleAbout();
/*mouse.c functions*/
extern void NormBlock();
extern void MovedMouse();
extern HandleButton();
extern void HandleInvs();
extern HandleBlockInvs();
extern void RvsBlock();
extern void EndBlockInvs();
extern HandleLineInvs();
extern MoveForward();
extern void EndLineInvs();
extern void NormText();
extern HandleDelBlock();
extern void FindStartEnd();
extern void DelBlock();
extern void FreeListMem();
extern void DelTextBlock();
extern CancelInvs();
extern DelInvs();
extern void TitleError();
extern void TitleErrorCancel();
extern void BackSearchRefresh();
extern void RvsText();
extern CancelLineInvs();
extern void NormIt();
/*sure.c functions*/
extern BOOL AreYouSure();
/*disk.c functions*/
extern WriteItemList();
extern ReadItemList();
extern struct LineItem *BreakLineApart();
extern void CreatePrefsIcon();
/*clip.c functions*/
extern void SetupClipboard();
extern void WriteInvsTextToClip();
extern void WriteStringClip();
extern ReadString();
extern ReadClip();
extern void AddBlock();
extern void WriteClip();
extern SnagBlock();
/*menu.c functions*/
extern NewAll();
extern void HandleNew();
extern void MakeFilename();
extern HandleOpen();
extern void Save();
extern void HandleSaveAs();
extern HandlePrintDisk();
extern HandlePrintPrinter();
extern void HandleQuit();
extern HandleCut();
extern HandleCopy();
extern void HandlePaste();
extern HandleErase();
extern void Refresh();
extern void CheckModified();
extern void MakeTextLine();
extern void HandleIcons();
extern void HandlePalette();
extern void HandleReloadPrefs();
/*From PopColours.c*/
extern void PopColours();
/*From Search.c*/
extern struct LineItem *SearchText();
extern DoSearch();
extern void ModifyParams();
extern void ReplaceAll();
extern BYTE AskChange();
/*From ARexx.c*/
extern void OpenARexx();
extern void CloseARexx();
extern void CheckRexxPort();
extern void GetWord();
extern void EngageMacro();
extern void GetMacroInfo();
extern void SplitFilename();
/*~~~End of Globals.h*/