Use case: Allow launching "interpreters" (system files that follow the ProDOS interpreter protocol) with a target file, without hard-coding an association in DeskTop or introducing more UI surface. For example, dragging text files onto EDIT.SYSTEM.
What's required:
- Modify
icontype_iconentryflags_table entries for system and application to have kIconEntryFlagsDropTarget
- Fix any places that abuse
kIconEntryFlagsDropTarget as "is this a directory type?" there's at least one
- In
HandleClick::_IconClick, after a successful drag onto a target icon, if the target is a SYS file then:
- If any modifier is down then fail (reserve for future)
- If
GetSingleSelectedIcon is 0 or trash_icon_num then fail
- Call
GetIconPath; if Z=0 then fail
- Call
SetOperationDstPathFromDragDropResult; if C=1 then fail
OPEN file at path operation_dst_path; if C=1 then fail
READ 5 bytes and CLOSE; fail if C=1 or trans_count < 5
- If bytes are not $4C x x $EE $EE then fail
- Copy
operation_src_path to src_path_buf
- Copy
operation_dst_path to INVOKER_INTERPRETER
- Tail call
LaunchFileByPathImpl::launch
This is an alternative to #192 that involves less UI creation.
Use case: Allow launching "interpreters" (system files that follow the ProDOS interpreter protocol) with a target file, without hard-coding an association in DeskTop or introducing more UI surface. For example, dragging text files onto
EDIT.SYSTEM.What's required:
icontype_iconentryflags_tableentries for system and application to havekIconEntryFlagsDropTargetkIconEntryFlagsDropTargetas "is this a directory type?" there's at least oneHandleClick::_IconClick, after a successful drag onto a target icon, if the target is a SYS file then:GetSingleSelectedIconis 0 ortrash_icon_numthen failGetIconPath; if Z=0 then failSetOperationDstPathFromDragDropResult; if C=1 then failOPENfile at pathoperation_dst_path; if C=1 then failREAD5 bytes andCLOSE; fail if C=1 ortrans_count< 5operation_src_pathtosrc_path_bufoperation_dst_pathtoINVOKER_INTERPRETERLaunchFileByPathImpl::launchThis is an alternative to #192 that involves less UI creation.