home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
linuxmafia.com 2016
/
linuxmafia.com.tar
/
linuxmafia.com
/
pub
/
palmos
/
ifmapper-src-0.7.tar.gz
/
ifmapper-src-0.7.tar
/
ifmapper-0.7
/
mapper.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-04-22
|
4KB
|
205 lines
#include <Pilot.h>
#define VERSION 0070
#define MAPAREAHEIGHT 147
#define MAPAREAWIDTH 160
#define SCROLLBORDERHEIGHT 10
#define LOCATION 0
#define CONNECTION 1
#define TEXT 2
#define RESIZEWIDTH 5
#define SELECTED 0x1
#define ARROW 0x2
#define CIRCLE 0x2
#define FONTSHIFT 0x2
#define FONTMASK (0x3<<FONTSHIFT)
#define FONT0 0x0
#define FONT1 0x1
#define FONT2 0x2
#define FONT3 0x3
#define TEXTANCHOR_XSHIFT 0x4
#define TEXTANCHOR_XMASK (0x3<<TEXTANCHOR_XSHIFT)
#define TEXTANCHOR_LEFT 0x0
#define TEXTANCHOR_CENTER 0x1
#define TEXTANCHOR_RIGHT 0x2
#define TEXTANCHOR_YSHIFT 0x6
#define TEXTANCHOR_YMASK (0x3<<TEXTANCHOR_YSHIFT)
#define TEXTANCHOR_TOP 0x0
#define TEXTANCHOR_BOTTOM 0x2
#define TEXTALIGN_SHIFT 0x8
#define TEXTALIGN_MASK (0x3<<TEXTALIGN_SHIFT)
#define TEXTALIGN_LEFT 0x0
#define TEXTALIGN_CENTER 0x1
#define TEXTALIGN_RIGHT 0x2
#define LINE0 0
#define LINE1 1
#define LINE2 2
#define LINE3 3
#define GetObjectPtr(frm,id) FrmGetObjectPtr(frm,FrmGetObjectIndex(frm,id))
#define MapDBType 'IFmp'
#define DumpDBType 'IFdp'
#define APPID 'IFmr'
#define MAX(x,y) ((x)>(y)?(x):(y))
#define MIN(x,y) ((x)<(y)?(x):(y))
#define ABS(x) ((x)<0?(-(x)):(x))
#define MOVE_ITEM 0
#define RESIZE_LOC 1
#define EDIT_ITEM 2
#define NEW_LOC 3
#define DEL_ITEM 4
#define PARAMS 5
#define MOVE_VERTEX 10
#define INSERT_VERTEX 11
#define NEW_CONNECTION 12
#define DEL_VERTEX 13
#define ADD_TEXT 14
typedef struct _MapDesc {
char name[32];
int sections;
int objects;
} MapDesc;
typedef struct _NameListMem {
MapDesc *entries;
int numEntries;
} NameListMem;
typedef struct _ScreenInfo {
int xoffset,yoffset;
int scale;
int gridsize;
} ScreenInfo;
typedef struct _Vertex {
UInt x,y;
} Vertex;
typedef struct _Connection {
Word flags;
char linetype;
UInt vertexnum;
Vertex *vertices;
} Connection;
typedef struct _Location {
char *Name;
char *Desc;
Word flags;
} Location;
typedef struct _Text {
char *text;
Word flags;
Byte minscale;
PointType anchor;
Byte lines;
short xoffset,yoffset;
} Text;
typedef struct _Item {
Byte type;
RectangleType bounds;
union itemdata {
Location loc;
Connection con;
Text text;
} itemdata;
} Item;
typedef struct _Section {
char *Name;
Item *items;
UInt itemNum;
ScreenInfo si;
Boolean loaded;
} Section;
typedef struct _Map {
char *Name;
Section *sections;
UInt sectionNum;
UInt version;
} Map;
typedef struct _SelectedVertexSet {
struct _SelectedVertexSet *next;
Boolean begin;
Boolean end;
Item *c;
} SelectedVertexSet;
typedef struct _prefs {
Boolean verbose;
Boolean fastdraw;
Boolean overwriteFrame;
Boolean deselect;
Boolean copyHalf;
int gridsize;
} Prefs;
char *realloc(void *, int, int);
int euklid(int, int);
void Redraw(Boolean);
UInt DistLocation(Item *,int, int);
UInt DistText(Item *,int, int);
UInt DistConnection(Item *,int, int);
UInt Dist(Item *,int, int);
Item *NewItem(Section *);
void DeleteItem(Section *,Item *);
void DeleteLocation(Section *,Item *);
void DeleteText(Section *,Item *);
void DeleteConnection(Section *,Item *);
void InitLocation(Item *);
void InitText(Item *);
void InitConnection(Item *);
void DeleteVertex(Section *,Item *, int);
void InsertVertex(Item *, int, int, int);
void FreeNameListMem(NameListMem *);
void AllocNameListMem(NameListMem *);
Boolean saveMap(Map *);
Boolean isSelected(Item *);
void selectItem(Item *,Boolean);
Map *import(char *);
void SetTextFont(Item *);
void RecalcTextBox(Section *,Item *);
void RecalcTextExtents(Section *);
Item *FindItem(Section *,int,char *);
void CopyItemTo(Item *,Item *);
Map *LoadMap(char *);
void WriteItem(Item *,DmOpenRef,UInt);
void ReadItem(Item *,DmOpenRef,UInt);
void MoveItem(Item *,int,int);
void ScanDumps();
void ScanMaps();
void LoadSection(DmOpenRef,Section *,UInt);
void saveSection(Section *,DmOpenRef,UInt);
void WriteText(Item *,DmOpenRef,UInt);
void WriteConnection(Item *,DmOpenRef,UInt);
void WriteLocation(Item *,DmOpenRef,UInt);
void FreeMap(Map *);
void FreeSection(Section *);
void doOptions();
void ensureSectionLoaded(Map *, UInt);
#ifdef DEBUG
void Log(char *);
#endif