home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / DOpus4-GPL / Config / data.c < prev    next >
C/C++ Source or Header  |  2000-01-27  |  21KB  |  643 lines

  1. /*
  2.  
  3. Directory Opus 4
  4. Original GPL release version 4.12
  5. Copyright 1993-2000 Jonathan Potter
  6.  
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. All users of Directory Opus 4 (including versions distributed
  22. under the GPL) are entitled to upgrade to the latest version of
  23. Directory Opus version 5 at a reduced price. Please see
  24. http://www.gpsoft.com.au for more information.
  25.  
  26. The release of Directory Opus 4 under the GPL in NO WAY affects
  27. the existing commercial status of Directory Opus 5.
  28.  
  29. */
  30.  
  31. #include "config.h"
  32.  
  33. char *version="$VER: ConfigOpus 4.12 (09 Sep 93) Copyright © 1993 Jonathan Potter";
  34.  
  35. UWORD drawinfo[]={
  36.     0, /* DETAILPEN */
  37.     1, /* BLOCKPEN */
  38.     1, /* TEXTPEN */
  39.     2, /* SHINEPEN */
  40.     1, /* SHADOWPEN */
  41.     3, /* FILLPEN */
  42.     1, /* FILLTEXTPEN */
  43.     0, /* BACKGROUNDPEN */
  44.     3, /* HIGHLIGHTTEXTPEN */
  45.     1, /* BARDETAILPEN */
  46.     2, /* BARBLOCKPEN */
  47.     1, /* BARTRIMPEN */
  48.     (UWORD)~0};
  49.  
  50. struct TagItem
  51.     taglist[]={
  52.         {SA_Pens,(ULONG)drawinfo},
  53.         {TAG_END,0}};
  54.  
  55. struct ExtNewScreen configscr={
  56.     0,0,640,210,0,0,1,
  57.     HIRES,CUSTOMSCREEN|SCREENBEHIND|NS_EXTENDED,
  58.     &sfont,"ConfigOpus 4.12",NULL,NULL,taglist};
  59.  
  60. struct NewWindow
  61.     configwin={
  62.         0,11,640,0,
  63.         255,255,
  64.         IDCMP_MOUSEBUTTONS|IDCMP_GADGETUP|IDCMP_GADGETDOWN|IDCMP_MENUPICK|
  65.             IDCMP_MOUSEMOVE|IDCMP_INACTIVEWINDOW|IDCMP_RAWKEY,
  66.         WFLG_ACTIVATE|WFLG_REPORTMOUSE|WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_NEWLOOKMENUS,
  67.         NULL,NULL,
  68.         NULL,
  69.         NULL,NULL,
  70.         0,0,0,0,
  71.         CUSTOMSCREEN};
  72.  
  73. struct DOpusBase *DOpusBase;
  74. struct GfxBase *GfxBase;
  75. struct Library *LayersBase;
  76. struct IntuitionBase *IntuitionBase;
  77. struct Library *DiskfontBase;
  78. struct Library *WorkbenchBase;
  79. struct Library *IconBase;
  80. struct Library *PPBase;
  81. struct Screen *Screen;
  82. struct Window *Window;
  83. struct ViewPort *vp;
  84. struct RastPort *rp;
  85. struct Process *myproc;
  86. struct IntuiMessage *IMsg;
  87. APTR wsave,realwsave;
  88. char *spacestring="                                                                                                                                                      ";
  89.  
  90. char fontbuf[50];
  91. struct TextAttr
  92.     sfont={(STRPTR)fontbuf,8,0,0},
  93.     bsfont={(STRPTR)fontbuf,8,FSF_BOLD,0};
  94. struct Config *config,*undoconfig;
  95. struct dopusfiletype *firsttype;
  96. struct dopushotkey *firsthotkey;
  97. struct dopusgadgetbanks *firstbank,*curbank;
  98. struct DOpusRemember *typekey,*fontkey;
  99.  
  100. char configname[256],loadnamebuf[256];
  101.  
  102. int version2;
  103.  
  104. struct MsgPort *conport,*cmdport,*appport;
  105. /*
  106. struct MsgPort **clip_port;
  107. struct IOClipReq *clip_io;
  108. */
  109. struct ConfigStuff cstuff;
  110. struct DOpusRemember *mainkey,*gadgetkey,*tickkey,*screenkey,*clipkey,*buttonkey;
  111. struct Gadget *maingad,*tickgad,*gadgads,*menugads,*drivegads;
  112. struct Clip *firstclip;
  113. int tickcount;
  114. struct dopusconfigmsg msg;
  115.  
  116. int lchanged,changed;
  117.  
  118. struct Image
  119.     *checkonimage,*checkoffimage,
  120.     *buttononimage,*buttonoffimage,
  121.     copy_checkonimage,copy_checkoffimage;
  122.  
  123. struct RMBGadget
  124.     insertbankrmb={
  125.         NULL,0,0,104,12,RGF_ALTTEXT,1,
  126.         {{NULL,2,1,100,10,1,0},{NULL,2,1,100,10,1,0}}},
  127.     nextbankrmb={
  128.         &insertbankrmb,0,0,104,12,RGF_ALTTEXT,0,
  129.         {{NULL,2,1,100,10,1,0},{NULL,2,1,100,10,1,0}}},
  130.     formatclearrmb={
  131.         NULL,465,137,104,12,RGF_ALTTEXT,0,
  132.         {{NULL,2,1,100,10,1,0},{NULL,2,1,100,10,1,0}}},
  133.     sampleclearrmb={
  134.         NULL,0,0,104,12,RGF_ALTTEXT,0,
  135.         {{NULL,2,1,100,10,1,0},{NULL,2,1,100,10,1,0}}};
  136.  
  137. char
  138.     *commandlist[95],
  139.     *arglist[18],
  140.     *classopslist[12];
  141.  
  142. int classopvals[]={
  143.     FTYC_AND,FTYC_MATCH,FTYC_MATCHBITS,FTYC_MATCHCOMMENT,FTYC_MATCHDATE,
  144.     FTYC_MATCHNAME,FTYC_MATCHSIZE,FTYC_MOVE,FTYC_MOVETO,FTYC_OR,FTYC_SEARCHFOR};
  145.  
  146. struct DOpusListView
  147.     cmdlist={
  148.         1,NULL,0,0,332,88,NULL,commandlist,NULL,DLVF_HIREC,8,
  149.         0,0,0,0,0,0,0,0,0,0,-1,NULL},
  150.     listlist={
  151.         1,NULL,0,0,0,0,NULL,NULL,NULL,DLVF_HIREC,8,
  152.         0,0,0,0,0,0,0,0,0,0,-1,NULL},
  153.     helplist={
  154.         1,NULL,0,0,516,131,NULL,NULL,NULL,DLVF_HIREC,8,
  155.         0,0,0,0,0,0,0,0,0,0,-1,NULL},
  156.     modulelist={
  157.         5,NULL,0,0,338,56,NULL,NULL,NULL,
  158.         DLVF_MULTI|DLVF_TTOP|DLVF_CHECK|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,&languagelist},
  159.     languagelist={
  160.         6,NULL,0,0,338,56,NULL,NULL,NULL,
  161.         DLVF_CHECK|DLVF_LEAVE|DLVF_TTOP|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,NULL};
  162.  
  163. char *external_module_list[]={
  164.     "ConfigOpus",
  165.     "Diskcopy, Format, Install",
  166.     "IconInfo",
  167.     "Print, Printdir",
  168.     NULL};
  169.  
  170. char *external_module_name[]={
  171.     "ConfigOpus",
  172.     "DOpus_Disk",
  173.     "DOpus_Icon",
  174.     "DOpus_Print",
  175.     NULL};
  176.  
  177. int external_module_map[]={
  178.     65536,
  179.     1,
  180.     4,
  181.     2};
  182.  
  183. struct Gadget
  184.     cmdcancelgad={
  185.         NULL,124,102,104,12,GFLG_GADGHCOMP,GACT_RELVERIFY,GTYP_BOOLGADGET,
  186.         NULL,NULL,NULL,0,NULL,0,NULL},
  187.     helpcancelgad={
  188.         NULL,226,147,104,12,GFLG_GADGHCOMP,GACT_RELVERIFY,GTYP_BOOLGADGET,
  189.         NULL,NULL,NULL,0,NULL,0,NULL},
  190.     listokaygad[3]={
  191.         {&listokaygad[1],10,0,104,12,GFLG_GADGHCOMP,GACT_RELVERIFY,GTYP_BOOLGADGET,
  192.         NULL,NULL,NULL,0,NULL,1,NULL},
  193.         {NULL,0,0,104,12,GFLG_GADGHCOMP,GACT_RELVERIFY,GTYP_BOOLGADGET,
  194.         NULL,NULL,NULL,0,NULL,0,NULL},
  195.         {NULL,0,0,104,12,GFLG_GADGHCOMP,GACT_RELVERIFY,GTYP_BOOLGADGET,
  196.         NULL,NULL,NULL,0,NULL,2,NULL}};
  197.  
  198. struct NewWindow
  199.     requestwin={
  200.         0,0,0,0,
  201.         255,255,
  202.         IDCMP_MOUSEBUTTONS|IDCMP_GADGETUP|IDCMP_GADGETDOWN|IDCMP_MOUSEMOVE|IDCMP_VANILLAKEY,
  203.         WFLG_ACTIVATE|WFLG_RMBTRAP|WFLG_DRAGBAR|WFLG_DEPTHGADGET,
  204.         NULL,NULL,NULL,NULL,NULL,0,0,0,0,CUSTOMSCREEN};
  205.  
  206. char filebuf[32],dirbuf[258];
  207. struct DOpusFileReq filereq={
  208.     NULL,dirbuf,filebuf,NULL,162,22,10,0,NULL,NULL};
  209.  
  210. char *defdir[5]={"","SYS:","SYS:","S:","REXX:"};
  211.  
  212. struct newdopusfunction *selgad;
  213. struct Gadget *seligad;
  214.  
  215. struct ColourSel coloursel[]={
  216.     {COLBIT_STATUS,149,57,598,76},
  217.     {COLBIT_SELDISKNAME,149,77,373,86},
  218.     {COLBIT_DISKNAME,374,75,598,86},
  219.     {COLBIT_SELDIRECTORY,151,88,353,95},
  220.     {COLBIT_DIRECTORY,151,96,353,103},
  221.     {COLBIT_SELFILE,151,104,353,111},
  222.     {COLBIT_FILE,151,112,353,128},
  223.     {COLBIT_FILE,394,88,596,128},
  224.     {COLBIT_SLIDERS,356,87,391,111},
  225.     {COLBIT_SLIDERS,149,130,319,140},
  226.     {COLBIT_SLIDERS,428,130,599,140},
  227.     {COLBIT_ARROWS,320,130,352,153},
  228.     {COLBIT_ARROWS,392,130,427,153},
  229.     {COLBIT_ARROWS,356,112,391,129},
  230.     {COLBIT_TINYGADS,356,130,391,153},
  231.     {COLBIT_TINYGADS,491,153,598,162},
  232.     {COLBIT_CLOCK,149,153,490,162},
  233.     {COLBIT_3DBOXES,160,167,371,178},
  234.     {COLBIT_REQUESTER,376,167,587,178},
  235.     {COLBIT_STRINGS,149,141,319,152},
  236.     {COLBIT_SELSTRINGS,428,141,599,152},
  237.     {-1,0,0,0,0}};
  238.  
  239. char **screenmodelist;
  240. struct ScreenMode *firstmode,*screenmode;
  241.  
  242. struct Image
  243.     open_barimage={0,0,0,0,0,NULL,0,0,NULL},
  244.     paste_barimage={0,0,0,0,0,NULL,0,0,NULL},
  245.     erase_barimage={0,0,0,0,0,NULL,0,0,NULL},
  246.     deleteclass_barimage={0,0,0,0,0,NULL,0,0,NULL};
  247.  
  248. struct IntuiText
  249.     newtext={0,0,JAM1,1,1,NULL,NULL,NULL},
  250.     opentext={0,0,JAM1,1,1,NULL,NULL,NULL},
  251.     savetext={0,0,JAM1,1,1,NULL,NULL,NULL},
  252.     saveastext={0,0,JAM1,1,1,NULL,NULL,NULL},
  253.  
  254.     cuttext={0,0,JAM1,1,1,NULL,NULL,NULL},
  255.     copytext={0,0,JAM1,1,1,NULL,NULL,NULL},
  256.     pastetext={0,0,JAM1,1,1,NULL,NULL,NULL},
  257.     erasetext={0,0,JAM1,1,1,NULL,NULL,NULL},
  258.     clearcliptext={0,0,JAM1,1,1,NULL,NULL,NULL},
  259.  
  260.     newclasstext={0,0,JAM1,1,1,NULL,NULL,NULL},
  261.     editclasstext={0,0,JAM1,1,1,NULL,NULL,NULL},
  262.     duplicateclasstext={0,0,JAM1,1,1,NULL,NULL,NULL},
  263.     deleteclasstext={0,0,JAM1,1,1,NULL,NULL,NULL},
  264.     clearclasstext={0,0,JAM1,1,1,NULL,NULL,NULL},
  265.  
  266.     gadrowstext[5],
  267.  
  268.     paintmodetext={0,0,JAM1,1,1,NULL,NULL,NULL};
  269.  
  270. struct MenuItem
  271.     projectitems[]={
  272.         {&projectitems[1],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ,0,
  273.         (APTR)&newtext,NULL,'D',NULL,0xffff},
  274.         {&projectitems[2],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ,0,
  275.         (APTR)&opentext,NULL,'O',NULL,0xffff},
  276.         {&projectitems[3],0,0,0,2,HIGHNONE,0,
  277.         (APTR)&open_barimage,NULL,0,NULL,0xffff},
  278.         {&projectitems[4],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ,0,
  279.         (APTR)&savetext,NULL,'S',NULL,0xffff},
  280.         {NULL,0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ,0,
  281.         (APTR)&saveastext,NULL,'A',NULL,0xffff}},
  282.     edititems[]={
  283.         {&edititems[1],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  284.         (APTR)&cuttext,NULL,0,NULL,0xffff},
  285.         {&edititems[2],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  286.         (APTR)©text,NULL,0,NULL,0xffff},
  287.         {&edititems[3],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  288.         (APTR)&pastetext,NULL,0,NULL,0xffff},
  289.         {&edititems[4],0,0,0,2,HIGHNONE,0,
  290.         (APTR)&paste_barimage,NULL,0,NULL,0xffff},
  291.         {&edititems[5],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  292.         (APTR)&erasetext,NULL,0,NULL,0xffff},
  293.         {&edititems[6],0,0,0,2,HIGHNONE,0,
  294.         (APTR)&erase_barimage,NULL,0,NULL,0xffff},
  295.         {NULL,0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  296.         (APTR)&clearcliptext,NULL,0,NULL,0xffff}},
  297.     classitems[]={
  298.         {&classitems[1],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  299.         (APTR)&newclasstext,NULL,0,NULL,0xffff},
  300.         {&classitems[2],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  301.         (APTR)&editclasstext,NULL,0,NULL,0xffff},
  302.         {&classitems[3],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  303.         (APTR)&duplicateclasstext,NULL,0,NULL,0xffff},
  304.         {&classitems[4],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  305.         (APTR)&deleteclasstext,NULL,0,NULL,0xffff},
  306.         {&classitems[5],0,0,0,2,HIGHNONE,0,
  307.         (APTR)&deleteclass_barimage,NULL,0,NULL,0xffff},
  308.         {&classitems[6],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  309.         (APTR)&opentext,NULL,0,NULL,0xffff},
  310.         {&classitems[7],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  311.         (APTR)&savetext,NULL,0,NULL,0xffff},
  312.         {&classitems[8],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  313.         (APTR)&saveastext,NULL,0,NULL,0xffff},
  314.         {NULL,0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP,0,
  315.         (APTR)&clearclasstext,NULL,0,NULL,0xffff}},
  316.     gadrowsitems[]={
  317.         {&gadrowsitems[1],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT,30,
  318.         (APTR)&gadrowstext[0],NULL,0,NULL,0xffff},
  319.         {&gadrowsitems[2],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT,29,
  320.         (APTR)&gadrowstext[1],NULL,0,NULL,0xffff},
  321.         {&gadrowsitems[3],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT,27,
  322.         (APTR)&gadrowstext[2],NULL,0,NULL,0xffff},
  323.         {&gadrowsitems[4],0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT,23,
  324.         (APTR)&gadrowstext[3],NULL,0,NULL,0xffff},
  325.         {NULL,0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT,15,
  326.         (APTR)&gadrowstext[4],NULL,0,NULL,0xffff}},
  327.     neatstuffitem={
  328.         NULL,0,0,0,0,ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT|MENUTOGGLE,0,
  329.         (APTR)&paintmodetext,NULL,0,NULL,0xffff};
  330.  
  331. struct Menu
  332.     projectmenu={NULL,8,0,0,0,MENUENABLED,NULL,projectitems},
  333.     gadrowsmenu={&neatstuffmenu,0,0,0,0,MENUENABLED,NULL,gadrowsitems},
  334.     editmenu={NULL,8,0,0,0,MENUENABLED,NULL,edititems},
  335.     classmenu={NULL,0,0,0,0,MENUENABLED,NULL,classitems},
  336.     neatstuffmenu={NULL,0,0,0,0,MENUENABLED,NULL,&neatstuffitem};
  337.  
  338. int changed,curoperation,clipcount;
  339.  
  340. USHORT
  341.     defpalettes[11][4]={
  342.         {0xaaa,0x000,0xfff,0x68b},
  343.         {0,0,0,0},
  344.         {0xba9,0x002,0xfff,0x68b},
  345.         {0x8ac,0x002,0xfff,0xfc9},
  346.         {0x8ac,0x002,0xfff,0xe97},
  347.         {0x5ba,0x002,0xeef,0x57a},
  348.         {0x9bd,0x002,0xfff,0x68b},
  349.         {0xa98,0x321,0xfee,0xfdb},
  350.         {0xccb,0x003,0xfff,0x9ab},
  351.         {0xc99,0x002,0xfee,0xb67},
  352.         {0xa96,0x002,0xfff,0x779}},
  353.  
  354.     def_dopus_palette[16]={
  355.         0xaaa,0x000,0xfff,0x05b,0xea4,0x707,0xff0,0xc20,
  356.         0xf80,0xf0f,0x963,0x0f9,0x4f3,0x000,0xfff,0x259};
  357.  
  358. char *palettenames[14];
  359.  
  360. char *fontplacenames[FONT_COUNT+1];
  361.  
  362. int fontplaceflags[]={
  363.     FFLAG_8ONLY,FFLAG_NOPROP,FFLAG_NOPROP,0,0,0,0,0,FFLAG_NOPROP,0,0,0};
  364.  
  365. int fontplacevals[]={
  366.     FONT_CLOCK,FONT_GADGETS,FONT_MENUS,FONT_NAMES,FONT_DIRS,    
  367.     FONT_GENERAL,FONT_ICONIFY,FONT_STRING,FONT_REQUEST,
  368.     FONT_SCREEN,FONT_STATUS,FONT_TEXT};
  369.  
  370. struct DOpusListView
  371.     palettelist={
  372.         2,NULL,0,0,250,56,NULL,palettenames,NULL,
  373.         DLVF_SLOW|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,NULL},
  374.     fontplacelist={
  375.         1,NULL,0,0,176,64,NULL,fontplacenames,NULL,
  376.         DLVF_SLOW|DLVF_LEAVE|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,&fontlistview},
  377.     fontlistview={
  378.         2,NULL,0,0,176,64,NULL,NULL,NULL,
  379.         DLVF_SLOW|DLVF_LEAVE|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,&fontsizelistview},
  380.     fontsizelistview={
  381.         3,NULL,0,0,32,64,NULL,NULL,NULL,
  382.         DLVF_SLOW|DLVF_LEAVE|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,NULL},
  383.     listformatlists[2]={
  384.         {1,NULL,0,0,196,56,NULL,formatnames,NULL,
  385.         DLVF_SLOW|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,&listformatlists[1]},
  386.         {2,NULL,0,0,196,56,NULL,selectedformatnames,NULL,
  387.         DLVF_SLOW|DLVF_LEAVE|DLVF_CHECK|DLVF_TOGGLE|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,NULL}},
  388.     iconlistview={
  389.         3,NULL,0,0,452,104,NULL,NULL,NULL,
  390.         DLVF_TTOP|DLVF_LEAVE|DLVF_HIREC,8,0,0,0,0,0,0,0,0,0,0,-1,NULL};
  391.  
  392. char
  393.     *formatnames[FORMAT_MAXNUM+1],
  394.     *selectedformatnames[FORMAT_MAXNUM+1];
  395.  
  396. int rowtrans[5]={0,1,2,3,6};
  397. struct TextFont *tfont;
  398. char
  399.     *fontdatabuf,**fontlist,*(**fontsizelist),
  400.     **noproplist,*(**nopropsizelist),
  401.     **only8list,*only8sizelist[]={"8",NULL};
  402. struct fileclass *firstclass;
  403. char classname[256];
  404. struct DOpusRemember *helpkey;
  405. char *helpbuffer;
  406. int helpsize;
  407. char currenthelpname[256];
  408.  
  409. char **fileclasslist;
  410.  
  411. char *fileclasstype[4];
  412.  
  413. char maxlength[5]={30,80,40,32,32};
  414.  
  415. #ifdef __SASC_60
  416. __chip USHORT
  417. #else
  418. USHORT __chip
  419. #endif
  420.     pageflip_data1[5]={0x4000,0xa000,0x9000,0x8800,0xfc00},
  421. #ifndef __SASC_60
  422. __chip
  423. #endif
  424.     pageflip_data2[3]={0x4000,0x6000,0x7000},
  425. #ifndef __SASC_60
  426. __chip
  427. #endif
  428.     dropbox_data[]={
  429.         0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  430.         0x0000,0x0000,0x0000,0x0000,0x3f3f,0x1f3f,0x0000,0x0000,
  431.         0x3f80,0x0000,0x31b1,0xb1b1,0x8000,0x0000,0x3f80,0x0000,
  432.         0x31b1,0xb1b1,0x8000,0x0003,0xf800,0x0000,0x31bf,0x31bf,
  433.         0x0000,0x0007,0xf800,0x0000,0x31b6,0x31b0,0x0000,0x0e0f,
  434.         0x8000,0x0000,0x31b3,0x31b0,0x0000,0x0e0f,0x0000,0x0000,
  435.         0x3f31,0x9f30,0x0000,0x1e0e,0x0000,0x0000,0x0000,0x0000,
  436.         0x0000,0x1e0e,0x0000,0x0000,0x0000,0x0000,0x00f0,0x1c06,
  437.         0x0f00,0x0000,0x0000,0x0000,0x00f0,0x1c06,0x0700,0x0000,
  438.         0x0000,0x0000,0x01e0,0x1c03,0x0000,0x0000,0x0000,0x000f,
  439.         0xe1e0,0x0c00,0x0010,0x0000,0x0000,0x01ff,0xf1c0,0x0c00,
  440.         0x0000,0x0000,0x0000,0x01fe,0x01c0,0x0e00,0x0000,0x0000,
  441.         0x0000,0x0fc0,0x00c0,0x0e00,0x00e0,0x0000,0x0000,0x0f80,
  442.         0x00c0,0x0207,0x83e0,0x0000,0x007e,0x0e00,0x3060,0x0207,
  443.         0xffe0,0x0000,0x007e,0x0e00,0x3860,0x0383,0x0f80,0x0000,
  444.         0x07f0,0x0e00,0x7860,0x0383,0x0000,0x0000,0x1ff0,0x0e03,
  445.         0xf060,0x0381,0x0000,0x0000,0x1f00,0x060f,0xf060,0x3f80,
  446.         0x0000,0x0000,0x3c00,0x0606,0x0070,0x7f80,0x0000,0x0000,
  447.         0x3c03,0x0300,0x0070,0x3800,0x0000,0x0000,0x3803,0x8300,
  448.         0x0030,0x0000,0x0000,0x0000,0x3801,0x8300,0x0000,0x0000,
  449.         0x0000,0x0000,0x3801,0x8100,0x0000,0x0000,0x0000,0x0000,
  450.         0x3801,0xc100,0x0000,0x0000,0x0000,0x0000,0x3801,0xc1c0,
  451.         0x0000,0x0000,0x0000,0x0000,0x3801,0xc1c0,0x0000,0x0000,
  452.         0x0000,0x0000,0x3801,0xc1c0,0x0000,0x0000,0x0000,0x0000,
  453.         0x3801,0xc1c0,0x0000,0x0000,0x0000,0x0000,0x1807,0xc0c0,
  454.         0x0000,0x007e,0x3e61,0x8000,0x181f,0xc000,0x0000,0x0063,
  455.         0x6333,0x0000,0x0c1f,0x0000,0x0000,0x0063,0x631e,0x0000,
  456.         0x0c00,0x0000,0x0000,0x007e,0x630c,0x0000,0x0000,0x0000,
  457.         0x0000,0x0063,0x631e,0x0000,0x0000,0x0000,0x0000,0x0063,
  458.         0x6333,0x0000,0x0000,0x0000,0x0000,0x007e,0x3e61,0x8000,
  459.         0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  460.         0x0000,0x0000,0x0000,0x0000,
  461.         0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  462.         0x0000,0x0000,0x0000,0x0000,0x3f3f,0x1f3f,0x0000,0x0000,
  463.         0x0000,0x0000,0x31b1,0xb1b1,0x8000,0x0000,0x0000,0x0000,
  464.         0x31b1,0xb1b1,0x8000,0x0000,0x07f0,0x0000,0x31bf,0x31bf,
  465.         0x0000,0x0000,0x07f0,0x0000,0x31b6,0x31b0,0x0000,0x0000,
  466.         0x7ffc,0x0000,0x31b3,0x31b0,0x0000,0x0000,0xfffe,0x0000,
  467.         0x3f31,0x9f30,0x0000,0x01c1,0xf03c,0x0000,0x0000,0x0000,
  468.         0x0000,0x01c1,0xf03c,0x0000,0x0000,0x0000,0x0000,0x03e1,
  469.         0xf000,0x0000,0x0000,0x0000,0x0000,0x03e1,0xf800,0x0000,
  470.         0x0000,0x0000,0x001e,0x03e0,0xffe0,0x0000,0x0000,0x0000,
  471.         0x001e,0x03e0,0xffe0,0x0000,0x0000,0x0000,0x003e,0x03f0,
  472.         0x7ffc,0x0000,0x0000,0x0001,0xfc3f,0x01f0,0x0ffe,0x0000,
  473.         0x0000,0x003f,0xfe3f,0x01f0,0x001f,0x0000,0x0000,0x003f,
  474.         0xfe3f,0x01f0,0x001f,0x0000,0x0000,0x01ff,0x8f9f,0x01f0,
  475.         0x001f,0x0000,0x0000,0x01f0,0x079f,0x007c,0xf07f,0x0000,
  476.         0x000f,0xc1f0,0x079f,0x807c,0xfffe,0x0000,0x000f,0xc1f0,
  477.         0x079f,0x807c,0xfffe,0x0000,0x00ff,0xf9f0,0x0f9f,0x807c,
  478.         0xfffc,0x0000,0x03ff,0xf9f8,0x7e0f,0x807c,0x3f80,0x0000,
  479.         0x03f0,0xfcff,0xfe0f,0xc7fc,0x0000,0x0000,0x07c0,0x7cff,
  480.         0xc00f,0xfff0,0x0000,0x0000,0x07c0,0x7cff,0xc00f,0xfff0,
  481.         0x0000,0x0000,0x07c0,0x7cf8,0x0007,0xffe0,0x0000,0x0000,
  482.         0x07c0,0x3cfe,0x0000,0xfc00,0x0000,0x0000,0x07c0,0x3e3e,
  483.         0x0000,0x0000,0x0000,0x0000,0x07c0,0x3e3e,0x0000,0x0000,
  484.         0x0000,0x0000,0x07c0,0x3e3e,0x0000,0x0000,0x0000,0x0000,
  485.         0x07c0,0x3e3f,0x0000,0x0000,0x0000,0x0000,0x07e0,0x3e3f,
  486.         0x0000,0x007e,0x3e61,0x8000,0x07e0,0x3e3f,0x0000,0x0063,
  487.         0x6333,0x0000,0x03e0,0xfe1e,0x0000,0x0063,0x631e,0x0000,
  488.         0x03ff,0xfc00,0x0000,0x007e,0x630c,0x0000,0x01ff,0xf800,
  489.         0x0000,0x0063,0x631e,0x0000,0x01ff,0xf800,0x0000,0x0063,
  490.         0x6333,0x0000,0x003f,0x0000,0x0000,0x007e,0x3e61,0x8000,
  491.         0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  492.         0x0000,0x0000,0x0000,0x0000};
  493.  
  494. struct StringExtend stringex={NULL,{0,0},{0,0},0,NULL,NULL,{0,0,0,0}};
  495. struct Image dropboximage={0,0,83,42,2,dropbox_data,3,0,NULL};
  496.  
  497. struct DiskObject dropboxobj={
  498.     0,0, /* WB_DISKMAGIC,WB_DISKVERSION, */
  499.         {NULL,0,0,83,42,0,0,0,
  500.         (APTR)&dropboximage,NULL,NULL,NULL,NULL,NULL,NULL},
  501.     0,NULL,NULL,NO_ICON_POSITION,NO_ICON_POSITION,NULL,NULL,NULL};
  502.  
  503. void *appobject;
  504. struct AppMessage *appmsg;
  505.  
  506. unsigned char *fileview_buf;
  507. int fileview_lines,fileview_size,fileview_topline,fileview_type,fileview_oldtop;
  508. int fileview_offset,fileview_position;
  509. char *fileview_types[2];
  510. char *icontypes[3];
  511.  
  512. struct StringData stringdata;
  513.  
  514. int network;
  515.  
  516. char *ftype_funcs[]={
  517.     "AnsiRead",
  518.     "HexRead",
  519.     "LoopPlay",
  520.     "Play",
  521.     "Read",
  522.     "Show",
  523.     "User1",
  524.     "User2",
  525.     "User3",
  526.     "User4"};
  527.  
  528. short func_list_items[]={
  529.     STR_FUNCTIONLIST_ABOUT,
  530.     STR_FUNCTIONLIST_ADDICON,
  531.     STR_FUNCTIONLIST_ALARM,
  532.     STR_FUNCTIONLIST_ALL,
  533.     STR_FUNCTIONLIST_ANSIREAD,
  534.     STR_FUNCTIONLIST_AREXX,
  535.     STR_FUNCTIONLIST_ASSIGN,
  536.     STR_FUNCTIONLIST_BEEP,
  537.     STR_FUNCTIONLIST_BUFFERLIST,
  538.     STR_FUNCTIONLIST_BUTTONICONIFY,
  539.     STR_FUNCTIONLIST_CD,
  540.     STR_FUNCTIONLIST_CHECKFIT,
  541.     STR_FUNCTIONLIST_CLEARBUFFERS,
  542.     STR_FUNCTIONLIST_CLEARSIZES,
  543.     STR_FUNCTIONLIST_CLEARWIN,
  544.     STR_FUNCTIONLIST_CLONE,
  545.     STR_FUNCTIONLIST_COMMENT,
  546.     STR_FUNCTIONLIST_CONFIGURE,
  547.     STR_FUNCTIONLIST_CONTST,
  548.     STR_FUNCTIONLIST_COPY,
  549.     STR_FUNCTIONLIST_COPYAS,
  550.     STR_FUNCTIONLIST_COPYWINDOW,
  551.     STR_FUNCTIONLIST_DATESTAMP,
  552.     STR_FUNCTIONLIST_DEFAULTS,
  553.     STR_FUNCTIONLIST_DELETE,
  554.     STR_FUNCTIONLIST_DIRTREE,
  555.     STR_FUNCTIONLIST_DISKCOPY,
  556.     STR_FUNCTIONLIST_DISKCOPYBG,
  557.     STR_FUNCTIONLIST_DISKINFO,
  558.     STR_FUNCTIONLIST_DISPLAYDIR,
  559.     STR_FUNCTIONLIST_DOPUSTOBACK,
  560.     STR_FUNCTIONLIST_DOPUSTOFRONT,
  561.     STR_FUNCTIONLIST_ENCRYPT,
  562.     STR_FUNCTIONLIST_ERRORHELP,
  563.     STR_FUNCTIONLIST_ENDFUNCTION,
  564.     STR_FUNCTIONLIST_FORMAT,
  565.     STR_FUNCTIONLIST_FORMATBG,
  566.     STR_FUNCTIONLIST_GETDEVICES,
  567.     STR_FUNCTIONLIST_GETSIZES,
  568.     STR_FUNCTIONLIST_HELP,
  569.     STR_FUNCTIONLIST_HEXREAD,
  570.     STR_FUNCTIONLIST_HUNT,
  571.     STR_FUNCTIONLIST_ICONIFY,
  572.     STR_FUNCTIONLIST_ICONINFO,
  573.     STR_FUNCTIONLIST_INSTALL,
  574.     STR_FUNCTIONLIST_INSTALLBG,
  575.     STR_FUNCTIONLIST_LASTSAVED,
  576.     STR_FUNCTIONLIST_LOADCONFIG,
  577.     STR_FUNCTIONLIST_LOADSTRINGS,
  578.     STR_FUNCTIONLIST_LOOPPLAY,
  579.     STR_FUNCTIONLIST_MAKEDIR,
  580.     STR_FUNCTIONLIST_MODIFY,
  581.     STR_FUNCTIONLIST_MOVE,
  582.     STR_FUNCTIONLIST_MOVEAS,
  583.     STR_FUNCTIONLIST_NEWCLI,
  584.     STR_FUNCTIONLIST_NONE,
  585.     STR_FUNCTIONLIST_NOTIFY,
  586.     STR_FUNCTIONLIST_OTHERWINDOW,
  587.     STR_FUNCTIONLIST_PARENT,
  588.     STR_FUNCTIONLIST_PARENTLIST,
  589.     STR_FUNCTIONLIST_PLAY,
  590.     STR_FUNCTIONLIST_PLAYST,
  591.     STR_FUNCTIONLIST_PRINT,
  592.     STR_FUNCTIONLIST_PRINTDIR,
  593.     STR_FUNCTIONLIST_PROTECT,
  594.     STR_FUNCTIONLIST_QUIT,
  595.     STR_FUNCTIONLIST_READ,
  596.     STR_FUNCTIONLIST_REDRAW,
  597.     STR_FUNCTIONLIST_RELABEL,
  598.     STR_FUNCTIONLIST_REMEMBER,
  599.     STR_FUNCTIONLIST_RENAME,
  600.     STR_FUNCTIONLIST_RESCAN,
  601.     STR_FUNCTIONLIST_RESELECT,
  602.     STR_FUNCTIONLIST_RESTORE,
  603.     STR_FUNCTIONLIST_ROOT,
  604.     STR_FUNCTIONLIST_RUN,
  605.     STR_FUNCTIONLIST_SAVECONFIG,
  606.     STR_FUNCTIONLIST_SCANDIR,
  607.     STR_FUNCTIONLIST_SEARCH,
  608.     STR_FUNCTIONLIST_SELECT,
  609.     STR_FUNCTIONLIST_SETVAR,
  610.     STR_FUNCTIONLIST_SHOW,
  611.     STR_FUNCTIONLIST_SMARTREAD,
  612.     STR_FUNCTIONLIST_STOPST,
  613.     STR_FUNCTIONLIST_SWAPWINDOW,
  614.     STR_FUNCTIONLIST_TOGGLE,
  615.     STR_FUNCTIONLIST_UNICONIFY,
  616.     STR_FUNCTIONLIST_USER_FTYPE1,
  617.     STR_FUNCTIONLIST_USER_FTYPE2,
  618.     STR_FUNCTIONLIST_USER_FTYPE3,
  619.     STR_FUNCTIONLIST_USER_FTYPE4,
  620.     STR_FUNCTIONLIST_VERIFY,
  621.     STR_FUNCTIONLIST_VERSION};
  622.  
  623. struct Border *gadget_dog_sel_border,*gadget_dog_unsel_border;
  624. struct Border *gadget_sel_border,*gadget_unsel_border;
  625.  
  626. int x_off,y_off,x_bot,y_bot;
  627. char help_ok;
  628. int paint_state,paint_fg=1,paint_bg=0;
  629.  
  630. int screen_depth;
  631.  
  632. struct ColourTable screen_pens[16];
  633.  
  634. short colour_box_xy[2][16][4],colour_box_num;
  635.  
  636. struct ScreenMode *curmode;
  637. ULONG palette_backup[48];
  638. struct DOpusRemember *borderkey;
  639. short palettegad_xy[16][4];
  640. int bpg;
  641.  
  642. char *left_right_cycle[3];
  643.