Skip to content

Allow dragging icon onto system files to launch as interpreter #903

Description

@inexorabletash

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 abusekIconEntryFlagsDropTarget 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeskTopDeskTop bugs or feature requestsGood First BugApproachable project for a new contributorfeature requestUser-facing feature additions/enhancements

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions