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 >
C/C++ Source or Header  |  2000-04-22  |  4KB  |  205 lines

  1. #include <Pilot.h>
  2.  
  3. #define VERSION 0070
  4.  
  5. #define MAPAREAHEIGHT 147
  6. #define MAPAREAWIDTH 160
  7. #define SCROLLBORDERHEIGHT 10
  8.  
  9. #define LOCATION 0
  10. #define CONNECTION 1
  11. #define TEXT 2
  12.  
  13. #define RESIZEWIDTH 5
  14.  
  15. #define SELECTED 0x1
  16. #define ARROW 0x2
  17. #define CIRCLE 0x2
  18. #define FONTSHIFT 0x2
  19. #define FONTMASK (0x3<<FONTSHIFT)
  20. #define FONT0 0x0
  21. #define FONT1 0x1
  22. #define FONT2 0x2
  23. #define FONT3 0x3
  24.  
  25. #define TEXTANCHOR_XSHIFT 0x4
  26. #define TEXTANCHOR_XMASK (0x3<<TEXTANCHOR_XSHIFT)
  27. #define TEXTANCHOR_LEFT 0x0
  28. #define TEXTANCHOR_CENTER 0x1
  29. #define TEXTANCHOR_RIGHT 0x2
  30.  
  31. #define TEXTANCHOR_YSHIFT 0x6
  32. #define TEXTANCHOR_YMASK (0x3<<TEXTANCHOR_YSHIFT)
  33. #define TEXTANCHOR_TOP 0x0
  34. #define TEXTANCHOR_BOTTOM 0x2
  35.  
  36. #define TEXTALIGN_SHIFT 0x8
  37. #define TEXTALIGN_MASK (0x3<<TEXTALIGN_SHIFT)
  38. #define TEXTALIGN_LEFT 0x0
  39. #define TEXTALIGN_CENTER 0x1
  40. #define TEXTALIGN_RIGHT 0x2
  41.  
  42. #define LINE0 0
  43. #define LINE1 1
  44. #define LINE2 2
  45. #define LINE3 3
  46.  
  47. #define GetObjectPtr(frm,id) FrmGetObjectPtr(frm,FrmGetObjectIndex(frm,id))
  48.  
  49. #define MapDBType 'IFmp'
  50. #define DumpDBType 'IFdp'
  51. #define APPID 'IFmr'
  52.  
  53. #define MAX(x,y) ((x)>(y)?(x):(y))
  54. #define MIN(x,y) ((x)<(y)?(x):(y))
  55. #define ABS(x) ((x)<0?(-(x)):(x))
  56.  
  57. #define MOVE_ITEM 0
  58. #define RESIZE_LOC 1
  59. #define EDIT_ITEM 2
  60. #define NEW_LOC 3
  61. #define DEL_ITEM 4
  62. #define PARAMS 5
  63.  
  64. #define MOVE_VERTEX 10
  65. #define INSERT_VERTEX 11
  66. #define NEW_CONNECTION 12
  67. #define DEL_VERTEX 13
  68. #define ADD_TEXT 14
  69.  
  70.  
  71. typedef struct _MapDesc {
  72.   char name[32];
  73.   int sections;
  74.   int objects;
  75. } MapDesc;
  76.  
  77. typedef struct _NameListMem {
  78.   MapDesc *entries;
  79.   int numEntries;
  80. } NameListMem;
  81.  
  82. typedef struct _ScreenInfo {
  83.   int xoffset,yoffset;
  84.   int scale;
  85.   int gridsize;
  86. } ScreenInfo;
  87.  
  88. typedef struct _Vertex {
  89.   UInt x,y;
  90. } Vertex;
  91.  
  92. typedef struct _Connection {
  93.   Word flags;
  94.   char linetype;
  95.   UInt vertexnum;
  96.   Vertex *vertices;
  97. } Connection;
  98.  
  99. typedef struct _Location {
  100.   char *Name;
  101.   char *Desc;
  102.   Word flags;
  103. } Location;
  104.  
  105. typedef struct _Text {
  106.   char *text;
  107.   Word flags;
  108.   Byte minscale;
  109.   PointType anchor;
  110.   Byte lines;
  111.   short xoffset,yoffset;
  112. } Text;
  113.  
  114. typedef struct _Item {
  115.   Byte type;
  116.   RectangleType bounds;
  117.   union itemdata {
  118.     Location loc;
  119.     Connection con;
  120.     Text text;
  121.   } itemdata;
  122. } Item;
  123.  
  124. typedef struct _Section {
  125.   char *Name;
  126.   Item *items;
  127.   UInt itemNum;
  128.   ScreenInfo si;
  129.   Boolean loaded;
  130. } Section;
  131.  
  132. typedef struct _Map {
  133.   char *Name;
  134.   Section *sections;
  135.   UInt sectionNum;
  136.   UInt version;
  137. } Map;
  138.  
  139. typedef struct _SelectedVertexSet {
  140.   struct _SelectedVertexSet *next;
  141.   Boolean begin;
  142.   Boolean end;
  143.   Item *c;
  144. } SelectedVertexSet;
  145.  
  146. typedef struct _prefs {
  147.   Boolean verbose;
  148.   Boolean fastdraw;
  149.   Boolean overwriteFrame;
  150.   Boolean deselect;
  151.   Boolean copyHalf;
  152.   int gridsize;
  153. } Prefs;
  154.  
  155. char *realloc(void *, int, int);
  156. int euklid(int, int);
  157. void Redraw(Boolean);
  158. UInt DistLocation(Item *,int, int);
  159. UInt DistText(Item *,int, int);
  160. UInt DistConnection(Item *,int, int);
  161. UInt Dist(Item *,int, int);
  162. Item *NewItem(Section *);
  163. void DeleteItem(Section *,Item *);
  164. void DeleteLocation(Section *,Item *);
  165. void DeleteText(Section *,Item *);
  166. void DeleteConnection(Section *,Item *);
  167. void InitLocation(Item *);
  168. void InitText(Item *);
  169. void InitConnection(Item *);
  170. void DeleteVertex(Section *,Item *, int);
  171. void InsertVertex(Item *, int, int, int);
  172. void FreeNameListMem(NameListMem *);
  173. void AllocNameListMem(NameListMem *);
  174. Boolean saveMap(Map *);
  175. Boolean isSelected(Item *);
  176. void selectItem(Item *,Boolean);
  177. Map *import(char *);
  178. void SetTextFont(Item *);
  179. void RecalcTextBox(Section *,Item *);
  180. void RecalcTextExtents(Section *);
  181. Item *FindItem(Section *,int,char *);
  182. void CopyItemTo(Item *,Item *);
  183. Map *LoadMap(char *);
  184. void  WriteItem(Item *,DmOpenRef,UInt);
  185. void  ReadItem(Item *,DmOpenRef,UInt);
  186. void MoveItem(Item *,int,int);
  187. void ScanDumps();
  188. void ScanMaps();
  189. void LoadSection(DmOpenRef,Section *,UInt);
  190. void saveSection(Section *,DmOpenRef,UInt);
  191.  
  192. void WriteText(Item *,DmOpenRef,UInt);
  193. void WriteConnection(Item *,DmOpenRef,UInt);
  194. void WriteLocation(Item *,DmOpenRef,UInt);
  195. void FreeMap(Map *);
  196. void FreeSection(Section *);
  197. void doOptions();
  198. void ensureSectionLoaded(Map *, UInt);
  199. #ifdef DEBUG
  200. void Log(char *);
  201. #endif
  202.  
  203.  
  204.  
  205.