home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 19
/
AACD19.BIN
/
CDTools
/
IDer
/
Routines
/
WBHandler.s
< prev
Wrap
Text File
|
1997-02-18
|
3KB
|
137 lines
Lea pr_MsgPort(A4),A0
CALL WaitPort,EXEC
Lea pr_MsgPort(A4),A0
CALL GetMsg
Move.L D0,_WBMessage
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
OPENLIBRARY DOS,37
OPENLIBRARY ICON,0
OPENLIBRARY INTUI,0
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L _WBMessage(PC),A0
Move.L sm_ArgList(A0),A2
Cmp.L #0,A2
Beq CloseDown
Move.L sm_NumArgs(A0),D0
Cmp.L #1,D0
Ble.S .NoArgs
Move.L A2,_FileName
.NoArgs
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L (A2),D1 ;wa_Lock
CALL CurrentDir,DOS
Move.L D0,_OldDirectory
Move.L wa_Name(A2),A0
CALL GetDiskObject,ICON
Move.L D0,_IconObject
Bne.S .FoundIcon
Addq #8,A2 ;try the next icon
Move.L wa_Name(A2),A0
CALL GetDiskObject
Move.L D0,_IconObject
Beq .NoIcon
.FoundIcon Move.L _IconObject(PC),A1
Move.L do_ToolTypes(A1),A1
Move.L A1,_ToolTypes
Move.l A1,A4
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L A4,A0 ;list of tooltypes from icon
Lea CrunchedTT(PC),A1
Clr.B 10(A1)
CALL FindToolType
Tst.L D0
Sne _Crunched
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L A4,A0 ;list of tooltypes from icon
Lea ConfigTT(PC),A1
Clr.B 6(A1)
CALL FindToolType
Tst.L D0
Beq.S .NoConfigFile
Move.L D0,A0
Lea ConfigName,A1
Move.L A1,_Config
Bsr StripQuotes
.NoConfigFile
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L A4,A0 ;list of tooltypes from icon
Lea AppIconTT(PC),A1
CALL FindToolType
Tst.L D0
Beq.S .NoAppData
Not.B _UseAppIcon
Move.L D0,A0
Cmp.B #0,(A0)
Beq.S .NoAppIcon
Cmp.B #10,(A0)
Beq.S .NoAppIcon
Move.L A0,_AppIcon
.NoAppIcon
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L A4,A0 ;list of tooltypes from icon
Lea AppNameTT(PC),A1
CALL FindToolType
Tst.L D0
Beq.S .NoAppName
Move.L D0,A0
Lea AppIconName,A1
Move.L A1,_AppName
Bsr StripQuotes
.NoAppName
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lea AppIconTT(PC),A1
Move.B #'X',7(A1)
Move.L A4,A0 ;list of tooltypes from icon
CALL FindToolType
Tst.L D0
Beq.S .NoAppIconX
Move.L D0,D1
Move.L #_AppIconX,D2
CALL StrToLong,DOS ;convert a decimal string into a longword
.NoAppIconX
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lea AppIconTT(PC),A1
Move.B #'Y',7(A1)
Move.L A4,A0 ;list of tooltypes from icon
CALL FindToolType,ICON
Tst.L D0
Beq.S .NoAppIconY
Move.L D0,D1
Move.L #_AppIconY,D2
CALL StrToLong,DOS ;convert a decimal string into a longword
.NoAppIconY
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.NoAppData
Move.L _IconObject(PC),A0
Cmp.L #0,A0
Beq.S .NoIcon
CALL FreeDiskObject,ICON
Clr.L _IconObject
.NoIcon Move.L _OldDirectory(PC),D1
Tst.L D1
Beq.S .NoDir
CALL CurrentDir,DOS
.NoDir Clr.L _OldDirectory
Bra.S WBReEnter