;========================================================= ; ; DROPIT Auto exec AppIcon. v2.16 ; ; By Aaron Koolen ; ; Last modification: 13-May-94 ; ;========================================================= #FINAL=1   "mystructs.bb"  Ć Ģ Ė   #FINAL:Ó:  3.Screen *s 3.w sh,sw  #EVT_HOTKEY=1               ; Id for hotkey message  #MAX_ENTRIES=100            ; Maximum number of entries available #MAX_EXECUTES=20            ; Number of executes per entry #READ_BUF_LEN=160           ; Read buffer lenght for signature matching  #FB_ASYNC=0                 ; Flag bit for asynchronous execution #FB_CLI=1                   ; Flag bit for a shell output #FB_WAITAFTER=2             ; Wait for return char after executed #FB_SIGFIRST=3              ; Check signature first  ; Tags for the execution of programs #TAG_USER=1 | 31  #SYS_Dummy=#TAG_USER+32 #SYS_Input=#SYS_Dummy+1 #SYS_Output=#SYS_Dummy+2 #SYS_Asynch=#SYS_Dummy+3 #SYS_UserShell=#SYS_Dummy+4  ; Define maxlens for strings we use so we don't get yukky ; out of memory errors, when doing string operations 3.l 2 name$=108 2 t$=108 2 d$=108 2 a$=108 2 arg$=256 2 op$=100  .tt   a.l    ; Structure for our entries .Entry   *nextEntry.Entry   oldExec.w   curExec.w   numExec.w   exec.l[#MAX_EXECUTES]   execFlags.w[#MAX_EXECUTES]   nPat.b[82]   sPat.b[82]   mess.b[82]   simpName.b[82]   flags.w    .MyDiskObject do_Magic.w ;/* a magic number at the start of the file */ do_Version.w ;/* a version number, so we can change it */ do_Gadget.Gadget;/* a copy of in core gadget */ do_Type.b do_AARONPAD.b *do_DefaultTool.b *do_ToolTypes.do_ToolTypes do_CurrentX.l do_CurrentY.l *do_DrawerData.DrawerData *do_ToolWindow.b ;/* only applies to tools */ do_StackSize.l ;/* only applies to tools */    3.Entry *fEntry,*cEntry  .tags   a.l:b:c:d:e:f:g:h:i:j:k:l    3.MyDiskObject *diskOb 3.FileInfoBlock *fib 3.tags tags 3.w w,count,popup,curExec,opExec 3.AARONWindow *win 3.l curCon,cxSig 3.Entry dummyEntry 3.NewBroker newBroker 3.MsgPort *msgPort,*brokerMsgPort 3.Screen *s    ;============================================== ; Statements and functions ;==============================================  ; Checks the signature of a file to see if it matches  	.w CheckSig{patTokenBuf.l,sigBuff.l}  t$,*cEntry ; Check signature    ¾(0,t$)     l.l=¾
(0) ; Read 20 bytes in for match      l>20 ! l=20     ¾ 0,sigBuff,l     ¾ 0 ; Remove null characters, so as not to fool system into thinking ; it's at the end of the string      p=0  #READ_BUF_LEN-1        Ś.b(sigBuff+p)=0 ! Ś.b sigBuff+p,1          Ś.b (sigBuff)+l,0 ; Tokenise pattern for matching     p=ü(&*cEntry\sPat,patTokenBuf,100) ; Check to see if signature matches      ü(patTokenBuf,sigBuff)>0 ! 	  -1   Ą   	  0  	  ;============================================== ; Remove all messages from a message port  FlushMessages{*m.MsgPort}   *msg.Message=ž“(*m)    *msg     žµ(*msg)     *msg=ž“(*m)   Į    ;============================================== ; Shows a requester  Message{a$}   dummy=¢("Listen up!",a$,"I HAVE READ AND UNDERSTOOD!")    ;============================================== ; Frees an execute entry  FreeExec{*e.Entry,n.w}    *e\exec[n]     ž *e\exec[n],Ü(Ś$(*e\exec[n]))+1     *e\exec[n]=0   Ą    ;============================================== ; Sets execute # n in entry pointed to by *e to string 	.l SetExec{*e.Entry,n.w,string.l}   mem.l=ž(Ü(Ś$(string))+1,#MEMF_PUBLIC|#MEMF_CLEAR)    mem     FreeExec{*e,n}     *e\exec[n]=mem     Ś$ mem,Ś$(string)   Ą   	  mem  	  ;============================================== ; GADTOOLS GADGETS FOR THE CONFIG WINDOW ;==============================================  .GTSTUFF  ; Listview structure .lv   dumm.w   l$    ; Gadtools constants and stuff #CW_WIDTH=458  #GTG_LV=0 #GTG_NAME=1 #GTG_MESS=2 #GTG_EXEC=3 #GTG_PAT=4 #GTG_SIG=5  #GTG_SYNC=6 #GTG_CLI=7  #GTG_QUIT=10 #GTG_HIDE=9 #GTG_SAVE=8  #GTG_ADD=11 #GTG_DEL=13 #GTG_UP=14 #GTG_DOWN=15 #GTG_ABOUT=12  #GTG_ELV=16 #GTG_ENAME=3 ;17 #GTG_EADD=17 #GTG_EDEL=18  #GTG_SIGFIRST=19 #GTG_WAITAFTER=20  #GTG_RELOAD=21  #GTG_SAVEICON=22  #LV_X=5  #LV_Y=5 #LV_HEIGHT=196-60-4 #LV_WIDTH=195  #ELV_Y=5 #ELV_X=#LV_X+#LV_WIDTH+5 #ELV_HEIGHT=#LV_HEIGHT/2-6 #ELV_WIDTH=#CW_WIDTH-#ELV_X-12  #ENAME_Y=#ELV_Y+#ELV_HEIGHT  #EAD_Y=#ELV_Y+#ELV_HEIGHT+14 #EAD_HEIGHT=12 #EAD_WIDTH=#ELV_WIDTH/2 #EAD_GAP=#ELV_WIDTH/2+1   #AD_Y=#LV_HEIGHT+#LV_Y+14 #AD_HEIGHT=12 #AD_WIDTH=45 #AD_GAP=50  #SQ_Y=#AD_Y+#AD_HEIGHT+10 #SQ_HEIGHT=12 #SQ_X=5 #SQ_WIDTH=80 #SQ_GAP=90  #NAME_Y=#LV_Y+#LV_HEIGHT  #NUM_STRINGS=3  #STRING_Y=#EAD_Y+#EAD_HEIGHT+4 #STRING_HEIGHT=13 #STRING_GAP=#STRING_HEIGHT+1  #F_Y=#NUM_STRINGS*#STRING_GAP+#STRING_Y #F_GAP=100   #CW_HEIGHT=#SQ_HEIGHT+#SQ_Y+5   ; START OF CODE     ³ lv.lv(#MAX_ENTRIES)        ; Our listviews    ³ elv.lv(#MAX_EXECUTES)     ą<36 !     ; Make sure we are using the correct OS    ver$=Ś$(?vers+13)    out.l=ž                 ; Set default output     GetWBInfo      ReadConfig     InitCommodity     InitAppIcon   ;============================================== ; MAINLOOP ;============================================== .    active.w=1                          ; Set our active flag     popup=1 !  OpenWindow    ; Should we popup?  .MainLoop   go.w=1    go  ; Wait for a signal from anywhere     signal.l=ž«(cxSig | msgPortSig | winPortSig)  ;---------------------------------- ; Was this a commodities message?? ;----------------------------------      signal & cxSig  ; Get message information       *cxMsg.Message=ž“(*brokerMsgPort)       msgID.l=ų(*cxMsg)       msgType.l=ų(*cxMsg)         msgType          #CXM_COMMAND            msgID              #CXCMD_KILL:go=0              #CXCMD_DISABLE: CloseConfigWin:active.w=0              #CXCMD_ENABLE:active.w=1              #CXCMD_APPEAR: OpenWindow: NewCon              #CXCMD_DISAPPEAR: CloseConfigWin              #CXCMD_UNIQUE: OpenWindow: NewCon                      #CXM_IEVENT          msgID            #EVT_HOTKEY              OpenWindow              NewCon                         žµ *cxMsg     Ą  .IconMessage ;------------------------------------- ; Was this a message for our AppIcon? ;-------------------------------------      (signal & msgPortSig)  ; If we aren't active we don't do anything         active=1         *msg.AppMessage=ž“(*msgPort)           *msg\am_Type=8 ; If no args passed to us, it was a double-click message            *msg\am_NumArgs=0              OpenWindow              NewCon           "  ; Args were passed to us, so it was an icon drop             dirLock=0:retval=0             d$="" ; Loop through all the arguments and fetch there complete ; pathnames              whatArg=0  *msg\am_NumArgs-1                GetIconName                 good ; If we got the name ok.............                  -1  ; Find the command associated with this type if icon                    FindCommand  ; If we found a type, then do something to it!                    *cEntry>0                      OpenWin                      RunFile                      CloseWin                   Ą                 1: ;This was a directory, so do nothing                :;DisplayBeep_0                                        Ą         Ą         žµ(*msg)       Ą     Ą  .WindowMsg ;---------------------------------- ; A window message? ;----------------------------------      signal & winPortSig       »         ev.l=Å          ev            #IDCMP_CLOSEWINDOW: CloseConfigWin            #GADGETUP              Å ; User clicked on the main listview                #GTG_LV:                 oldCon=curCon                 curCon.l=Å@                  oldCon<>curCon !  NewCon                 Ę 1,#GTG_NAME  ; User clicked on the execute listview                #GTG_ELV                  GetCurEntry                 *cEntry\oldExec=*cEntry\curExec                 *cEntry\curExec=Å@                  *cEntry\oldExec<>*cEntry\curExec !  NewCon                 Ę 1,#GTG_ENAME  ; Add an execution                #GTG_EADD: AddExec                 Ę 1,#GTG_ENAME  ; Delete an execution                #GTG_EDEL: DelExec                  *cEntry !  *cEntry\numExec>0 ! Ę 1,#GTG_ENAME  ; Move a type up in the list                #GTG_UP: UpEntry  ; Move a type down in the list                #GTG_DOWN: DownEntry  ; Delete a type in the list                #GTG_DEL: DelEntry                  count ! Ę 1,#GTG_NAME  ; About                #GTG_ABOUT: About                 #GTG_RELOAD                  FreeConfig                  ReadConfig                  NewCon  ; Hide the window                #GTG_HIDE: CloseConfigWin  ; BYE BYE!                #GTG_QUIT:go=0  ; Add a type to the list                #GTG_ADD: AddEntry                 Ę 1,#GTG_NAME  ; Save the config!                #GTG_SAVE: GetStrings: SaveConfig  ; Toggle wait after flag                #GTG_WAITAFTER                  GetCurEntry ;                *cEntry\flags BitChg #FB_WAITAFTER                 *cEntry\execFlags[*cEntry\curExec] Š #FB_WAITAFTER  ; Toggle sig first flag                #GTG_SIGFIRST                  GetCurEntry                 *cEntry\flags Š #FB_SIGFIRST  ; Toggle sync flag                #GTG_SYNC                  GetCurEntry                 *cEntry\execFlags[*cEntry\curExec] Š #FB_ASYNC  ; If asynch was toggled, then en/disable the wait after gadget                 f=*cEntry\execFlags[*cEntry\curExec]                 Ę 0,#GTG_WAITAFTER,#GA_Disabled,(f Ķ #FB_ASYNC)  (f Ķ #FB_CLI)=0  ; Toggle shell flag                #GTG_CLI                  GetCurEntry                 *cEntry\execFlags[*cEntry\curExec] Š #FB_CLI  ; If shell was toggled, then en/disable the wait after gadget                 f=*cEntry\execFlags[*cEntry\curExec]                 Ę 0,#GTG_WAITAFTER,#GA_Disabled,(f Ķ #FB_ASYNC)  (f Ķ #FB_CLI)=0  ; Changed the message string                #GTG_MESS:                  GetStrings  ; Change the signature match string                #GTG_SIG:                  GetStrings  ; Change the filename pattern match string                #GTG_PAT:                  GetStrings  ; Change the name of the entry                #GTG_NAME:                  GetStrings  ; Change the name of the current execute string                #GTG_EXEC:                  GetStrings                  MakeELV                               ¼ ev=0     Ą   Į .EndIt  ; Cleanup everything we have allocated     *broker ! ų(*broker)     *brokerMsgPort     FlushMessages{*brokerMsgPort}     žć(*brokerMsgPort)   Ą     *msgPort ! FlushMessages{*msgPort}     CloseConfigWin     FreeConfig      *fib ! ž *fib,/.FileInfoBlock    appIcon ! ī(appIcon)    *diskOb ! õ(*diskOb)    *msgPort ! žć(*msgPort)    .FreeConfig    *fEntry     *cEntry=*fEntry\nextEntry      t=1  *fEntry\numExec       FreeExec{*fEntry,t-1}          ž*fEntry,/.Entry     *fEntry=*cEntry   Į   *fEntry=0   *cEntry=0   curCon=0   count=0    DelLV    DelELV    ; ============================================================== . .GetIconName  ; PRE whatArg holds the number of the argument we need to process ; POST t$ holds the complete pathname of the icon dropped ;     *fib is the file info block of the icon name    t$=""   args.l=*msg\am_ArgList+(whatArg*/.WBArg)   lock.l=Ś.l(args)               ; Lock of parent!   name$=Ś$(Ś.l(args+4))       ; Name of icon  ; Get info about the file   good.l=ž(lock,*fib)   gotLock.w=0    good<>0       t$=Ś$(&*fib\fib_FileName)  ; Make the entire pathname for the file       »         lock=ž(lock)          lock           gotLock=1            ž(lock,*fib)             t$=t$+"/"+name$             name$=t$             t$=Ś$(&*fib\fib_FileName)           Ą         Ą       ¼ lock=0      t$=t$+":"+name$  ; Examine this name to check if it's a directory or not!     lock.l=ž
(t$,-2)      lock        ž(lock,*fib)            *fib\fib_DirEntryType>0             good=1:dirLock.l=lock             d$=t$           Ą       Ą       ž lock       lock=0     Ą   Ą   ; ==============================================================  .FindCommand  ; PRE t$ holds the name of the icon dropped ;     An initialised entry list exists ; POST Returns the pointer to command to execute or NULL if ;      None exists (Returned in *cEntry)    c=-1:*cEntry=*fEntry    *cEntry  ; Tokenise pattern for matching     p=ü(&*cEntry\nPat,?patTokenBuf,#READ_BUF_LEN)       *cEntry\flags Ķ #FB_SIGFIRST ; Need to check the signature first        CheckSig{?patTokenBuf,?sigBuff} ! ¾ : jjj ; Check to see if name matches        ü(?patTokenBuf,t$)>0 ! ¾ : jjj     " ; Check to see if name matches        ü(?patTokenBuf,t$)>0 ! ¾ : jjj        CheckSig{?patTokenBuf,?sigBuff}=1 ! ¾ : jjj     Ą     *cEntry=*cEntry\nextEntry   Į jjj:   ; ============================================================== ; Show the message for this file type  .OpenWin ; PRE: *cEntry points to a legal entry ; POST: Message window is opened if it's needed     *cEntry\mess[0]<>0     a$=Ü(Ś$(&*cEntry\mess),"{f}",t$)      GetWBInfo     l.l=’(*s\_RastPort,a$,Ü(a$))+10      l>sw-10 ! l=sw-10     w.w=0  #FINAL     “: blob: “      Å 0,(sw-l)/2,(sh-30)/2,l,*s\BarHeight,#WFLG_DRAGBAR,a$,0,1     w=1 blob:  #FINAL     “: EndIt: “      Ņ   Ą   ; ==============================================================  .OpenOutput ; PRE: *cEntry points to a legal entry ;      opExec is the number of the execute we are running ; POST: Output window is opened if it's needed   out=0:openedOut=1    *cEntry\execFlags[opExec] Ķ #FB_CLI     out.l=ž("con:0/0/"+Ż(sw)+"/"+Ż(sh/4)+"/DROPIT Output",1004)      out=0 ! ’0:openedOut=0   Ą   ; ==============================================================  .RunFile ; PRE: *cEntry points to valid entry ; POST: File has been run  ; Check for multiple options, and if more than one, request ; from user the input   Ź *cEntry  ; Make sure there is something to execute!    *cEntry\numExec<=0 ! Message{"No execution command(s)"}:  ; If there is more than one execution option.  We need to ; go through them, and collect the options, and present them ; to the user for selection.     *cEntry\numExec>1     op$="":numOps.w=0      t=1  \numExec        \exec[t-1]         numOps+1          t>1 ! op$+"|"         a$=Ś$(\exec[t-1])         i=Ü(a$,"=")          i>1           op$+Ü(a$,i-1)         "           Message{"Illegal execute string! ("+a$+")"}           ¾ :         Ą       Ą           t=¢("Select time..","Select an Option.",op$)-1       t=-1 ! t=numOps-1      a$=Ś$(\exec[t])     i=Ü(a$,"=")     a$=Ü(Ś$(\exec[t]),i)   "     t=0     a$=Ś$(\exec[0])   Ą  ; Replace the auto insert strings   a$=Ü(a$,"{f}",Ü(34)+t$+Ü(34))    a$=Ü(a$,"{d}",Ü(34)+d$+Ü(34))     opExec.w=t ; NOTE: At this point, 'opExec' holds the number of the execute ; that is being called  ; Run it now!     *cEntry\execFlags[opExec] Ķ *FB_ASYNC      OpenOutput  ; If openedOut =0 then OpenOutput couldn't open the output ; window so we shall quit      openedOut=0 !       tags\a=#SYS_Asynch,1,#SYS_Input,out,#SYS_Output,0,0      ž^(a$,&tags)        -1          out ! ž(out)         ’0        0: ; OK       : ; Some error         "  ; Synchronous execution      OpenOutput  ; If openedOut =0 then OpenOutput couldn't open the output ; window so we shall quit      openedOut=0 !       tags\a=#SYS_Asynch,0,#SYS_Output,out,0     ž^ a$,&tags  ; If we wanted a shell, and also wanted to wait after execution ; we now print the prompt and wait.     f=*cEntry\execFlags[opExec]      (f Ķ #FB_WAITAFTER) B (f Ķ #FB_CLI)       ž out,"Press RETURN to exit.",21       ž out,&a,1     Ą       out ! ž out   Ą    ; ==============================================================  ; Close the message window if it is open CloseWin    w ! + Å 0:w=0     ; ============================================================== ; Get information about the current public screen .GetWBInfo ;  FindScreen 0   Ļ 0   *s.Screen=Ś.l(ø Ļ(0))   sh.w=*s\Height   sw.w=*s\Width    ; ============================================================== ; Open the config window!  .OpenWindow ; Open the config window!    *win !      GetWBInfo     InitGadTools   #FINAL   “:: “    Å5 #IDCMP_INTUITICKS|#IDCMP_MOUSEMOVE   screenTitleHeight.w=*s\BarHeight  #CFW_FLAGS=#WFLG_ACTIVATE|#WFLG_DRAGBAR|#WFLG_CLOSEGADGET|#WFLG_DEPTHGADGET    Å 1,0,0,#CW_WIDTH,screenTitleHeight+#CW_HEIGHT,#CFW_FLAGS,"DROPIT Config",0,1    Ę 0,1   #FINAL   “: EndIt: “    *win=Ś.l(ø Å(1))   winPortSig=1 | *win\UserPort\mp_SigBit    ; ==============================================================  .CloseConfigWin    *win=0 !    Å< 1   winPortSig=0   *win=0   + Ę 0   ; ============================================================== ; Return a pointer to the current entry  .GetCurEntry   *pEntry.Entry=0   *cEntry=*fEntry    t=1  curCon     *pEntry=*cEntry     *cEntry=*cEntry\nextEntry      ; ============================================================== ; Deletes an execute entry .DelExec    GetCurEntry    *cEntry      *cEntry\numExec       FreeExec{*cEntry,*cEntry\curExec}       *cEntry\numExec-1        SetGads        t=*cEntry\curExec+1  #MAX_EXECUTES-1         *cEntry\exec[t-1]=*cEntry\exec[t]              *cEntry\exec[#MAX_EXECUTES-1]=0       *cEntry\curExec-1        NewCon ;MakeELV     Ą   Ą   ; ============================================================== ; We have changed the current entry, so we now have to update ; all the gadgets and things..........  .NewCon ; PRE: 'curCon' should hold the # of the listview entry that is to be configured ;      'curExec' should hold the current exec number     GetCurEntry    Ź *cEntry    *cEntry      MakeELV      Ę 0,0,#GTLV_Selected,curCon     Ę 0,#GTG_ELV,#GTLV_Selected,*cEntry\curExec     Ę 0,#GTG_NAME,Ś$(&\simpName)       \numExec       Ę 0,#GTG_ENAME,Ś$(\exec[\curExec])     "       Ę 0,#GTG_ENAME,""     Ą       Ę 0,#GTG_PAT,Ś$(&\nPat)     Ę 0,#GTG_SIG,Ü(Ś$(&\sPat),2)     Ę 0,#GTG_MESS,Ś$(&\mess)     Ę 0,#GTG_SYNC,#GTCB_Checked,\execFlags[*cEntry\curExec] Ķ #FB_ASYNC ;f     Ę 0,#GTG_CLI,#GTCB_Checked,\execFlags[*cEntry\curExec] Ķ #FB_CLI ;f       Ę 0,#GTG_WAITAFTER,#GTCB_Checked,\execFlags[*cEntry\curExec] Ķ #FB_WAITAFTER ;f     Ę 0,#GTG_SIGFIRST,#GTCB_Checked,\flags Ķ #FB_SIGFIRST ;f        SetGads    "     Ę 0,#GTG_NAME,""     Ę 0,#GTG_EXEC,""     Ę 0,#GTG_PAT,""     Ę 0,#GTG_SIG,""     Ę 0,#GTG_MESS,""     Ę 0,#GTG_SYNC,#GTCB_Checked,0     Ę 0,#GTG_CLI,#GTCB_Checked,0   Ą   ; ==============================================================  .AddExec   Ź *cEntry    GetCurEntry    *cEntry      \numExec < #MAX_EXECUTES       a$="NEW EXECUTE"        SetExec{*cEntry,\numExec,&a$}         \curExec=\numExec         \numExec+1          SetGads       Ą        NewCon     Ą   Ą   ; ==============================================================  .AddEntry   mem.l=ž(/.Entry,#MEMF_PUBLIC|#MEMF_CLEAR)    mem     oldCon=curCon     curCon=count-1      GetCurEntry     curCon=count     count+1      *cEntry ! *cEntry\nextEntry=mem     *cEntry=mem      *fEntry=0 ! *fEntry=mem     Ź *cEntry     Ś$ &\simpName,"NEW ENTRY"      SetGads      MakeLV      NewCon   Ą   ; ==============================================================  .DelELV   Ą elv()    Ą(elv()):Ą elv():Į   ; ============================================================== ; Makes the list view for the execute options  .MakeELV    DelELV    Ę 0,#GTG_ELV    GetCurEntry    *cEntry      t=1  *cEntry\numExec        Ą(elv())         elv()\l=Ś$(*cEntry\exec[t-1])       Ą        Ą   Ę 0,#GTG_ELV,elv()   ; ==============================================================  .DelLV   Ą lv()    Ą(lv()):Ą lv():Į   ; ============================================================== ; Makes the main listview  .MakeLV    DelLV   Ę 0,#GTG_LV   *cEntry=*fEntry    *cEntry      Ą(lv())       lv()\l=Ś$(&*cEntry\simpName)       *cEntry=*cEntry\nextEntry     "       ¾ : JumpOut     Ą   Į JumpOut   Ę 0,#GTG_LV,lv()   ; ============================================================== ; Get the values of the strings (pattern,sig etc) and ; then save them  .GetStrings    GetCurEntry    *cEntry     Ś$ &*cEntry\mess,Ę(0,#GTG_MESS)     Ś$ &*cEntry\sPat,Ę( 0,#GTG_SIG)+"#?"     Ś$ &*cEntry\nPat,Ę( 0,#GTG_PAT)     Ś$ &*cEntry\simpName,Ę( 0,#GTG_NAME)       *cEntry\numExec       a$=Ę(0,#GTG_ENAME)        SetExec{*cEntry,\curExec,&a$}=0 ! ’0     Ą      Ę 0,#GTG_LV       GetCurLv     lv()\l=Ę(0,#GTG_NAME)     Ę 0,#GTG_LV,lv()   Ą   ; ============================================================== ; Sets the current element of lv() based on our current ; entry  GetCurLv   Ą lv()    t=0  curCon:f=Ą(lv()):   ; ==============================================================  .SaveConfig    ¶("envarc:dropit/dropit.config","envarc:dropit/dropit.config.bak")=0      ¢("OOPS!","Can't create backup of config!","SAVE ANYWAY|DON'T SAVE")=0 !    Ą  ; Open the file for writing..........    ¾(0,"envarc:dropit/dropit.config")  #FINAL   “:¾ 0: BADWRITE: “      ¾ 0     *cEntry=*fEntry     Ź *cEntry      *cEntry       f=0        Ż \flags        Ż Ś$(&\simpName)       Ż \numExec        t=1  \numExec         Ż Ś$(\exec[t-1])         Ż \execFlags[t-1]              Ż Ś$(&\nPat)       Ż Ü(Ś$(&\sPat),2)       Ż Ś$(&\mess)       Ż "======== DROPIT SEPARATOR ========"        *cEntry=*cEntry\nextEntry     Į     ¾ 0      ¶("envarc:dropit/dropit.config","env:dropit/dropit.config")=0       dummy=¢("YO DUDE!","Can't copy ENVARC: config to ENV:","CHEERS!")     Ą   " BADWRITE:     ¢ "HEY!","Can't save config!","THANKS!"      ¶("envarc:dropit/dropit.config.bak","envarc:dropit/dropit.config")=0       dummy=¢("OH NO!","Can't restore old config! (envarc:dropit/dropit.config.bak)","OKEE DOKES!")     Ą   Ą   #FINAL   “: EndIt: “    ; ==============================================================  .ReadConfig    ¾(0,"env:dropit/dropit.config")     ¾ 0:count.w=0:Ą lv()     Ę 0,#GTG_LV      ¾(0)=0       mem.l=ž(/.Entry,#MEMF_PUBLIC|#MEMF_CLEAR)        mem          *cEntry ! *cEntry\nextEntry=mem         *cEntry=mem          *fEntry=0 ! *fEntry=mem          *cEntry\flags=Ż(20)          a$=Ż(255)            ; SIMPLE NAME         Ś$ &*cEntry\simpName,a$          Ą(lv())           lv()\l=a$         Ą          *cEntry\numExec=Ż(50)  ; Read in the executes          t=1  *cEntry\numExec           a$=Ż(255)            ; execute           *cEntry\execFlags[t-1]=Ż(20)            SetExec{*cEntry,t-1,&a$}=0             Message{"Can't load entire config!"}             ¾ :¾              *cEntry\numExec=t-1              EndReadConfig ;            Goto EndIt           Ą                   a$=Ż(255)            ; Name pattern         Ś$ &*cEntry\nPat,a$         a$=Ż(255)            ; Signature pattern          a$<>"" ! a$+"#?"         Ś$ &*cEntry\sPat,a$         a$=Ż(255)            ; Message         Ś$ &*cEntry\mess,a$         a$=Ż(255)           ; Skip a line       "          GetWBInfo         ’*s: EndIt       Ą       count+1     Į EndReadConfig     Ę 0,#GTG_LV,lv()     ¾ 0     Ņ   "     Message{"Can't find ENV:DROPIT/DROPIT.CONFIG"}      OpenWindow: NewCon   Ą   ; ==============================================================  .About   a$="A most wonderful auto execute AppIcon written in BLITZ Basic 2 by Aaron Koolen (13-May-1994)."   a$+Ü(10)+Ü(10)+"THANKS TO:"+Ü(10)+"    Twilight for testing and ideas."   a$+Ü(10)+"    The Amiga soft/hardware creators for a groovy machine."   a$+Ü(10)+"    The A.L.F and all other animal freedom fighters."    a$+Ü(10)+Ü(10)+"BIG SOD OFFS TO:"   a$+Ü(10)+"    Racial supremists &  Religious dogmatists."   a$+Ü(10)+"    Governments who spend billions on warfare while millions of people die from starvation and poverty."   a$+Ü(10)+"    B.R.T and other mega capatilists."    a$+Ü(10)+Ü(10)+"Take control, dont be controlled."   a$+Ü(10)+Ü(10)+"Anarchy and Peace."+Ü(0)    dummy=¢("About DROPIT "+ver$,a$,"ENOUGH, I'D RATHER WATCH TV!")   ; ==============================================================  .DelEntry    GetCurEntry ;  Gosub GetCurLv    *cEntry     *nEntry.Entry=*cEntry\nextEntry  ; If there is one previous to the one we are to delete, ; join the previous one to the one after the one to delete      *pEntry ! *pEntry\nextEntry=*nEntry  ; If deleting the first one, then set the first one to ; the one after the one we are deleting      curCon=0 ! *fEntry=*nEntry       t=1  *cEntry\numExec       FreeExec{*cEntry,t-1}           ž *cEntry,/.Entry      MakeLV      MakeELV     count-1      curCon=count ! curCon-1      count<=0 !  DelELV      SetGads      NewCon   Ą    ; ==============================================================  .UpEntry    curCon>0 B count>1      GetCurEntry     žŪ *pEntry,&dummyEntry,/.Entry     žŪ *cEntry+4,*pEntry+4,(/.Entry)-4     žŪ &dummyEntry+4,*cEntry+4,(/.Entry)-4      MakeLV     curCon-1      NewCon   Ą   ; ==============================================================  .DownEntry    curCon<count-1 B count>1      GetCurEntry     žŪ *cEntry,&dummyEntry,/.Entry     žŪ (*cEntry\nextEntry)+4,*cEntry+4,(/.Entry)-4     žŪ &dummyEntry+4,(*cEntry\nextEntry)+4,(/.Entry)-4      MakeLV     curCon+1      NewCon   Ą   ; ==============================================================  .InitAppIcon   *msgPort.MsgPort=žā()    *msgPort=0 !  EndIt   *diskOb=õ("env:dropit/dropiticon")     *diskOb=0 ! Message{"Can't load icon."}: EndIt    appIcon.l=ī(0,0,"Drop Icons Here",*msgPort,0,*diskOb,0)     appIcon=0 ! Message{"Can't initialise AppIcon."}: EndIt    *fib=ž(/.FileInfoBlock,#MEMF_PUBLIC|#MEMF_CLEAR)    *fib=0 !  EndIt    msgPortSig.l=1 | *msgPort\mp_SigBit   winPortSig.l=0   ; ==============================================================  .InitCommodity    raw$="lalt d"+Ü(0)               ; Set default hotkey    brokertitle$="DropIt "+ver$+" Aaron Koolen"+Ü(0)   brokername$="DROPIT"+Ü(0)   brokerdesc$="Auto execute AppIcon"+Ü(0)  ;Create Broker-port   *brokerMsgPort.MsgPort=žā()   newBroker\nb_Port=*brokerMsgPort     *brokerMsgPort=0 ! Message{"Error initialising DropIt (*brokerMsgPort)"}: EndIt ;<>0    ;Fill in Broker-data    newBroker\nb_Version=#NB_VERSION   newBroker\nb_Name=&brokername$   newBroker\nb_Title=&brokertitle$   newBroker\nb_Descr=&brokerdesc$    ;We want to be unique and informed about 2nd attempt to start   newBroker\nb_Unique=#NBU_NOTIFY|#NBU_UNIQUE    ;We have a window   newBroker\nb_Flags=#COF_SHOW_HIDE    ;Create Broker   *broker=ų(&newBroker,0)     *broker=0 !  EndIt: ;Message{"Error initialising DropIt (*broker)"}:Goto EndIt    cxSig=1|*brokerMsgPort\mp_SigBit    ;This is our popkey   *cxfilter=ų(#CX_FILTER,&raw$,0)    *cxfilter=0 ! Message{"Error initialising DropIt (*filter)"}: EndIt   ų
 *broker,*cxfilter    *cxsender=ų(#CX_SEND,*brokerMsgPort,#EVT_HOTKEY)    *cxsender=0 ! Message{"Error initialising DropIt (*sender)"}: EndIt   ų
 *cxfilter,*cxsender    ;Activate all   ų *broker,1    ; ==============================================================  .InitGadTools  #FINAL   “:: “   Ę 0,#GTG_LV,#LV_X,5,#LV_WIDTH,#LV_HEIGHT,"",0,lv() Ę 0,1,#LV_X,#NAME_Y,#LV_WIDTH,14,"",2,80  Ę 0,#GTG_ELV,#ELV_X,#ELV_Y,#ELV_WIDTH,#ELV_HEIGHT,"",0,elv() Ę 0,#GTG_ENAME,#ELV_X,#ENAME_Y,#ELV_WIDTH,14,"",0,80  ;GTSetAttrs 0,#GTG_ELV,#GTLV_ShowSelected,0 ;GTSetAttrs 0,0,#GTLV_ShowSelected,0  Ę 0,2,#ELV_X,#STRING_Y,160,#STRING_HEIGHT,"Message",2,80 Ę 0,4,#ELV_X,#STRING_Y+#STRING_GAP,160,#STRING_HEIGHT,"Pattern",2,80 Ę 0,5,#ELV_X,#STRING_Y+#STRING_GAP*2,160,#STRING_HEIGHT,"Signature",2,80  Ę 0,6,#ELV_X,#F_Y,10,10,"ASync",2 Ę 0,7,#ELV_X+#F_GAP,#F_Y,10,10,"Shell",2 Ę 0,#GTG_SIGFIRST,#ELV_X,#F_Y+11,10,10,"Sig 1st",2 Ę 0,#GTG_WAITAFTER,#ELV_X+#F_GAP,#F_Y+11,10,10,"Wait After",2  Ę 0,#GTG_SAVE,#SQ_X,#SQ_Y,#SQ_WIDTH,#SQ_HEIGHT,"Save",16 ;GTButton 0,#GTG_SAVEICON,#SQ_X+#SQ_WIDTH-12,#SQ_Y,12,#SQ_HEIGHT,"I",16 Ę 0,#GTG_HIDE,#SQ_X+#SQ_GAP,#SQ_Y,#SQ_WIDTH,#SQ_HEIGHT,"Hide",16  Ę 0,#GTG_RELOAD,#SQ_X+#SQ_GAP*2,#SQ_Y,#SQ_WIDTH,#SQ_HEIGHT,"Reload",16  Ę 0,#GTG_QUIT,#SQ_X+#SQ_GAP*4,#SQ_Y,#SQ_WIDTH,#SQ_HEIGHT,"Quit",16 Ę 0,#GTG_ABOUT,#SQ_X+#SQ_GAP*3,#SQ_Y,#SQ_WIDTH,#SQ_HEIGHT,"About",16  ; Add Del Up Down for main list view Ę 0,#GTG_ADD,#LV_X,#AD_Y,#AD_WIDTH,#AD_HEIGHT,"Add",16 Ę 0,#GTG_DEL,#LV_X+#AD_GAP,#AD_Y,#AD_WIDTH,#AD_HEIGHT,"Del",16 Ę 0,#GTG_UP,#LV_X+#AD_GAP*2,#AD_Y,#AD_WIDTH,#AD_HEIGHT,"Up",16 Ę 0,#GTG_DOWN,#LV_X+#AD_GAP*3,#AD_Y,#AD_WIDTH,#AD_HEIGHT,"Down",16  ; Add Del for execute lsit view Ę 0,#GTG_EADD,#ELV_X,#EAD_Y,#EAD_WIDTH,#EAD_HEIGHT,"Add",16 Ę 0,#GTG_EDEL,#ELV_X+#EAD_GAP,#EAD_Y,#EAD_WIDTH,#EAD_HEIGHT,"Del",16   #FINAL   “: EndIt: “     ; ============================================================== ; Turns gadgets on and off based on other status of config  .SetGads   Ź *cEntry    GetCurEntry    *cEntry     Ę 0,#GTG_ENAME,#GA_Disabled,\numExec<=0   "     Ę 0,#GTG_ENAME,#GA_Disabled,*cEntry=0   Ą    Ę 0,#GTG_NAME,#GA_Disabled,count<=0   Ę 0,#GTG_EADD,#GA_Disabled,count<=0   Ę 0,#GTG_EDEL,#GA_Disabled,(count<=0)  \numExec<=0    Ę 0,#GTG_SIG,#GA_Disabled,count<=0   Ę 0,#GTG_PAT,#GA_Disabled,count<=0   Ę 0,#GTG_MESS,#GA_Disabled,count<=0   Ę 0,#GTG_SYNC,#GA_Disabled,count<=0   Ę 0,#GTG_CLI,#GA_Disabled,count<=0   Ę 0,#GTG_UP,#GA_Disabled,count<=0   Ę 0,#GTG_DOWN,#GA_Disabled,count<=0   Ę 0,#GTG_DEL,#GA_Disabled,count<=0    f=\execFlags[\curExec]   Ę 0,#GTG_WAITAFTER,#GA_Disabled,(count<=0)  (f Ķ #FB_ASYNC)  (f Ķ #FB_CLI)=0   Ę 0,#GTG_SIGFIRST,#GA_Disabled,count<=0    patTokenBuf:  (.b #READ_BUF_LEN,0 sigBuff: (.b #READ_BUF_LEN,0 vers:     %.b "$VER: DropIt 2.16 (13-May-94)",0 ' 