# This is a description of the WIMP interface for SDCreate

tool_details_start
  name       "SDCreate";
  command_is "<SDCreate$Dir>.SDCreate";
  version    "1.27 (07-Oct-18)";
  wimpslot   256k;
  has_extended_cmdline;
tool_details_end


metaoptions_start
  has_auto_save "SDImage" from icn 4;
  has_text_window;
metaoptions_end


fileoutput_start
  output_option_is "file";
  output_dft_string "SDImage";
  output_dft_is produces_output;
fileoutput_end


dbox_start
  icons_start
    icn 4 maps_to string;
    icn 5 maps_to "MLO " string;
    icn 6 maps_to "U-BOOT/BIN " string;

    icn 8 maps_to "BOOT/SCR <SDCreate$Dir>.scripts.beagleboard/scr UENV/TXT <SDCreate$Dir>.scripts.uenv/txt RISCOS";
    icn 9 maps_to "BOOT/SCR <SDCreate$Dir>.scripts.beagleboard/scr UENV/TXT <SDCreate$Dir>.scripts.uenv/txt RISCOS";
    icn 10 maps_to "BOOT/SCR <SDCreate$Dir>.scripts.devkit8000/scr RISCOS";
    icn 11 maps_to "BOOT/INI <SDCreate$Dir>.scripts.igepv2/scr RISCOS";
    icn 12 maps_to "UIMAGE";
    icn 13 maps_to "BOOT/SCR <SDCreate$Dir>.scripts.pandora/scr RISCOS";
    icn 22 maps_to "README/TXT <SDCreate$Dir>.scripts.wandboard/txt RISCOS";
    icn 28 maps_to "BOOT/SCR <SDCreate$Dir>.scripts.pandaboard/scr RISCOS";

    icn 0 maps_to "";
    icn 14 maps_to "";
    icn 15 maps_to "";
    icn 16 on maps_to "disc " followed_by icn 17 produces_no_output;
    icn 17 maps_to string;
    icn 18 decreases icn 17 min 0;
    icn 19 increases icn 17 max 7;

    icn 21 on maps_to "" produces_output;
    icn 21 off maps_to "" produces_no_output;
    icn 29 maps_to "";
    icn 23 maps_to "";
    icn 24 maps_to "image " string;
    icn 25 maps_to "";
    icn 20 maps_to "";

    icn 27 maps_to "CMOS " string;
  icons_end

  defaults
    icn 21 on,
    icn 8 on,
    icn 16 on;

  imports_start
    drag_to icn 4   inserts icn 4;
    drag_to icn 5   inserts icn 5;
    drag_to icn 6   inserts icn 6;
    drag_to icn 24  inserts icn 24;
    drag_to icn 27  inserts icn 27;
  imports_end
dbox_end


rules_start
  # Enable/disable top-level 'create image' icons
  icn 21 off deselects icn 8, icn 9, icn 10, icn 11, icn 12, icn 13, icn 22, icn 28;
  icn 21 off excludes icn 8, icn 9, icn 10, icn 11, icn 12, icn 13, icn 22, icn 28, icn 4, icn 29, icn 20;
  icn 21 on includes icn 8, icn 9, icn 10, icn 11, icn 12, icn 13, icn 22, icn 28, icn 4, icn 29, icn 20;

  # Enable/disable 'SD image' icons
  icn 16 on includes icn 23, icn 24;
  icn 16 off excludes icn 23, icn 24;
  icn 21 on excludes icn 23, icn 24;
  icn 21 off includes icn 23, icn 24;

  # Machine type ESG
  icn 8  deselects icn 9, icn 10, icn 11, icn 12, icn 13, icn 22, icn 28;
  icn 9  deselects icn 8, icn 10, icn 11, icn 12, icn 13, icn 22, icn 28;
  icn 10 deselects icn 8, icn 9, icn 11, icn 12, icn 13, icn 22, icn 28;
  icn 11 deselects icn 8, icn 9, icn 10, icn 12, icn 13, icn 22, icn 28;
  icn 12 deselects icn 8, icn 9, icn 10, icn 11, icn 13, icn 22, icn 28;
  icn 13 deselects icn 8, icn 9, icn 10, icn 11, icn 12, icn 22, icn 28;
  icn 22 deselects icn 8, icn 9, icn 10, icn 11, icn 12, icn 13, icn 28;
  icn 28 deselects icn 8, icn 9, icn 10, icn 11, icn 12, icn 13, icn 22;

  # Machine type -> ROM/x-loader/U-Boot mapping (disable stuff)
  icn 9  off excludes icn 5, icn 6, icn 14, icn 15;
  icn 12 off excludes icn 5, icn 6, icn 14, icn 15;
  icn 8  on  excludes icn 5, icn 6, icn 14, icn 15;
  icn 10 on  excludes icn 5, icn 6, icn 14, icn 15;
  icn 11 on  excludes icn 5, icn 6, icn 14, icn 15;
  icn 13 on  excludes icn 5, icn 6, icn 14, icn 15;
  icn 22 on  excludes icn 5, icn 6, icn 14, icn 15;
  icn 8  off excludes icn 5, icn 6, icn 14, icn 15;
  icn 10 off excludes icn 5, icn 6, icn 14, icn 15;
  icn 11 off excludes icn 5, icn 6, icn 14, icn 15;
  icn 13 off excludes icn 5, icn 6, icn 14, icn 15;
  icn 22 off excludes icn 5, icn 6, icn 14, icn 15;
  icn 28 off excludes icn 5, icn 6, icn 14, icn 15;
  icn 28 on  excludes icn 5, icn 6, icn 14, icn 15;

  # Machine type -> ROM/x-loader/U-Boot mapping (enable stuff)
  icn 9  on includes icn 5, icn 6, icn 14, icn 15;
  icn 12 on includes icn 5, icn 6, icn 14, icn 15;
  icn 28 on includes icn 5, icn 6, icn 14, icn 15;

  # Enable/disable SCSI drive icons
  icn 16 off excludes icn 17, icn 18, icn 19, icn 25;
  icn 16 on includes icn 17, icn 18, icn 19, icn 25;

  # Enable/disable Run button
  # I have no idea how this works
  icn 21 on  excludes icn 0;
  icn 21 off includes icn 0;

  icn 16 on  includes icn 0;
  icn 16 off excludes icn 0;

  icn 8  off excludes icn 0, icn 0;
  icn 9  off excludes icn 0, icn 0;
  icn 10 off excludes icn 0, icn 0;
  icn 11 off excludes icn 0, icn 0;
  icn 12 off excludes icn 0, icn 0;
  icn 13 off excludes icn 0, icn 0;
  icn 22 off excludes icn 0, icn 0;
  icn 28 off excludes icn 0, icn 0;
  icn 8  on  includes icn 0, icn 0;
  icn 9  on  includes icn 0, icn 0;
  icn 10 on  includes icn 0, icn 0;
  icn 11 on  includes icn 0, icn 0;
  icn 12 on  includes icn 0, icn 0;
  icn 13 on  includes icn 0, icn 0;
  icn 22 on  includes icn 0, icn 0;
  icn 28 on  includes icn 0, icn 0;
rules_end


# This boils down to one of two formats:
#   [CMOS <name>] (disc <id> | file <name>) [MLO <name>] [U-BOOT/BIN <name>] ([BOOT/SCR|BOOT/INI] <name> RISCOS <name> | UIMAGE <name>)
#   [CMOS <name>] disc <id> image <name>
order_is
 icn 27, icn 16, icn 24, output, icn 5, icn 6, icn 8, icn 9, icn 10, icn 11, icn 12, icn 13, icn 22, icn 28, icn 4;
