Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Features » Vocabulary/Source/icon_drag
Vocabulary/Source/icon_drag
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Features |
Filename: | Vocabulary/Source/icon_drag |
Read OK: | ✔ |
File size: | 0551 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
#include "inc.h" /* extern os_error *wimp_bordericon (mouse); extern os_error *wimp_borderwindow (redraw_box); extern os_error *wimp_claiminterface (void); extern os_error *wimp_releaseinterface (void); extern os_error *wimp_setworkareapointer (pointer); extern os_error *wimp_releaseworkareapointer (pointer); extern os_error *wimp_pollpointer (poll); extern os_error *wimp_sendhelp (message_block); */ extern dbox options; extern int now; extern char file_to_load[50]; extern int loader(void); void mload(void) { char *nearly_file_to_load; int filetype = xferrecv_checkinsert(&nearly_file_to_load); if(filetype == 0xdf1 || filetype == 0xfff) { strcpy(file_to_load,nearly_file_to_load); loader(); if (now==1) { dbox_setnumeric(options,2,1); dbox_setnumeric(options,1,0); dbox_setnumeric(options,4,1); dbox_setnumeric(options,6,1); now=0; } } } void mchkmsg(wimp_eventstr *e, void *handle) { handle=handle; switch (e->e) { case wimp_ESEND: case wimp_ESENDWANTACK: switch (e->data.msg.hdr.action) { case wimp_MDATALOAD: /* insert data */ mload(); break; default: break; /* ignore other messages */ } break; default: /* Ignore any other event */ break; } }
00000000 23 69 6e 63 6c 75 64 65 20 22 69 6e 63 2e 68 22 |#include "inc.h"| 00000010 0a 2f 2a 0a 65 78 74 65 72 6e 20 6f 73 5f 65 72 |./*.extern os_er| 00000020 72 6f 72 20 2a 77 69 6d 70 5f 62 6f 72 64 65 72 |ror *wimp_border| 00000030 69 63 6f 6e 20 28 6d 6f 75 73 65 29 3b 0a 65 78 |icon (mouse);.ex| 00000040 74 65 72 6e 20 6f 73 5f 65 72 72 6f 72 20 2a 77 |tern os_error *w| 00000050 69 6d 70 5f 62 6f 72 64 65 72 77 69 6e 64 6f 77 |imp_borderwindow| 00000060 20 28 72 65 64 72 61 77 5f 62 6f 78 29 3b 0a 65 | (redraw_box);.e| 00000070 78 74 65 72 6e 20 6f 73 5f 65 72 72 6f 72 20 2a |xtern os_error *| 00000080 77 69 6d 70 5f 63 6c 61 69 6d 69 6e 74 65 72 66 |wimp_claiminterf| 00000090 61 63 65 20 28 76 6f 69 64 29 3b 0a 65 78 74 65 |ace (void);.exte| 000000a0 72 6e 20 6f 73 5f 65 72 72 6f 72 20 2a 77 69 6d |rn os_error *wim| 000000b0 70 5f 72 65 6c 65 61 73 65 69 6e 74 65 72 66 61 |p_releaseinterfa| 000000c0 63 65 20 28 76 6f 69 64 29 3b 0a 65 78 74 65 72 |ce (void);.exter| 000000d0 6e 20 6f 73 5f 65 72 72 6f 72 20 2a 77 69 6d 70 |n os_error *wimp| 000000e0 5f 73 65 74 77 6f 72 6b 61 72 65 61 70 6f 69 6e |_setworkareapoin| 000000f0 74 65 72 20 28 70 6f 69 6e 74 65 72 29 3b 0a 65 |ter (pointer);.e| 00000100 78 74 65 72 6e 20 6f 73 5f 65 72 72 6f 72 20 2a |xtern os_error *| 00000110 77 69 6d 70 5f 72 65 6c 65 61 73 65 77 6f 72 6b |wimp_releasework| 00000120 61 72 65 61 70 6f 69 6e 74 65 72 20 28 70 6f 69 |areapointer (poi| 00000130 6e 74 65 72 29 3b 0a 65 78 74 65 72 6e 20 6f 73 |nter);.extern os| 00000140 5f 65 72 72 6f 72 20 2a 77 69 6d 70 5f 70 6f 6c |_error *wimp_pol| 00000150 6c 70 6f 69 6e 74 65 72 20 28 70 6f 6c 6c 29 3b |lpointer (poll);| 00000160 0a 65 78 74 65 72 6e 20 6f 73 5f 65 72 72 6f 72 |.extern os_error| 00000170 20 2a 77 69 6d 70 5f 73 65 6e 64 68 65 6c 70 20 | *wimp_sendhelp | 00000180 28 6d 65 73 73 61 67 65 5f 62 6c 6f 63 6b 29 3b |(message_block);| 00000190 0a 2a 2f 0a 65 78 74 65 72 6e 20 64 62 6f 78 20 |.*/.extern dbox | 000001a0 6f 70 74 69 6f 6e 73 3b 0a 65 78 74 65 72 6e 20 |options;.extern | 000001b0 69 6e 74 20 6e 6f 77 3b 0a 65 78 74 65 72 6e 20 |int now;.extern | 000001c0 63 68 61 72 20 66 69 6c 65 5f 74 6f 5f 6c 6f 61 |char file_to_loa| 000001d0 64 5b 35 30 5d 3b 0a 65 78 74 65 72 6e 20 69 6e |d[50];.extern in| 000001e0 74 20 6c 6f 61 64 65 72 28 76 6f 69 64 29 3b 0a |t loader(void);.| 000001f0 0a 0a 0a 76 6f 69 64 20 6d 6c 6f 61 64 28 76 6f |...void mload(vo| 00000200 69 64 29 0a 7b 0a 0a 63 68 61 72 20 2a 6e 65 61 |id).{..char *nea| 00000210 72 6c 79 5f 66 69 6c 65 5f 74 6f 5f 6c 6f 61 64 |rly_file_to_load| 00000220 3b 0a 0a 69 6e 74 20 66 69 6c 65 74 79 70 65 20 |;..int filetype | 00000230 3d 20 78 66 65 72 72 65 63 76 5f 63 68 65 63 6b |= xferrecv_check| 00000240 69 6e 73 65 72 74 28 26 6e 65 61 72 6c 79 5f 66 |insert(&nearly_f| 00000250 69 6c 65 5f 74 6f 5f 6c 6f 61 64 29 3b 0a 0a 0a |ile_to_load);...| 00000260 20 20 20 20 20 20 69 66 28 66 69 6c 65 74 79 70 | if(filetyp| 00000270 65 20 3d 3d 20 30 78 64 66 31 20 7c 7c 20 66 69 |e == 0xdf1 || fi| 00000280 6c 65 74 79 70 65 20 3d 3d 20 30 78 66 66 66 29 |letype == 0xfff)| 00000290 0a 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 73 |. {. s| 000002a0 74 72 63 70 79 28 66 69 6c 65 5f 74 6f 5f 6c 6f |trcpy(file_to_lo| 000002b0 61 64 2c 6e 65 61 72 6c 79 5f 66 69 6c 65 5f 74 |ad,nearly_file_t| 000002c0 6f 5f 6c 6f 61 64 29 3b 0a 0a 20 20 20 20 20 20 |o_load);.. | 000002d0 6c 6f 61 64 65 72 28 29 3b 0a 0a 69 66 20 28 6e |loader();..if (n| 000002e0 6f 77 3d 3d 31 29 0a 20 20 7b 0a 64 62 6f 78 5f |ow==1). {.dbox_| 000002f0 73 65 74 6e 75 6d 65 72 69 63 28 6f 70 74 69 6f |setnumeric(optio| 00000300 6e 73 2c 32 2c 31 29 3b 0a 64 62 6f 78 5f 73 65 |ns,2,1);.dbox_se| 00000310 74 6e 75 6d 65 72 69 63 28 6f 70 74 69 6f 6e 73 |tnumeric(options| 00000320 2c 31 2c 30 29 3b 0a 64 62 6f 78 5f 73 65 74 6e |,1,0);.dbox_setn| 00000330 75 6d 65 72 69 63 28 6f 70 74 69 6f 6e 73 2c 34 |umeric(options,4| 00000340 2c 31 29 3b 0a 64 62 6f 78 5f 73 65 74 6e 75 6d |,1);.dbox_setnum| 00000350 65 72 69 63 28 6f 70 74 69 6f 6e 73 2c 36 2c 31 |eric(options,6,1| 00000360 29 3b 20 0a 6e 6f 77 3d 30 3b 0a 20 20 7d 0a 20 |); .now=0;. }. | 00000370 20 20 20 20 20 7d 0a 0a 20 20 20 7d 0a 0a 0a 76 | }.. }...v| 00000380 6f 69 64 20 6d 63 68 6b 6d 73 67 28 77 69 6d 70 |oid mchkmsg(wimp| 00000390 5f 65 76 65 6e 74 73 74 72 20 2a 65 2c 20 76 6f |_eventstr *e, vo| 000003a0 69 64 20 2a 68 61 6e 64 6c 65 29 0a 7b 0a 20 68 |id *handle).{. h| 000003b0 61 6e 64 6c 65 3d 68 61 6e 64 6c 65 3b 0a 0a 20 |andle=handle;.. | 000003c0 73 77 69 74 63 68 20 28 65 2d 3e 65 29 0a 20 20 |switch (e->e). | 000003d0 7b 0a 20 20 20 20 63 61 73 65 20 77 69 6d 70 5f |{. case wimp_| 000003e0 45 53 45 4e 44 3a 0a 20 20 20 20 63 61 73 65 20 |ESEND:. case | 000003f0 77 69 6d 70 5f 45 53 45 4e 44 57 41 4e 54 41 43 |wimp_ESENDWANTAC| 00000400 4b 3a 0a 20 20 20 20 20 20 20 20 20 73 77 69 74 |K:. swit| 00000410 63 68 20 28 65 2d 3e 64 61 74 61 2e 6d 73 67 2e |ch (e->data.msg.| 00000420 68 64 72 2e 61 63 74 69 6f 6e 29 0a 20 20 20 20 |hdr.action). | 00000430 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 | {. | 00000440 20 20 20 20 63 61 73 65 20 77 69 6d 70 5f 4d 44 | case wimp_MD| 00000450 41 54 41 4c 4f 41 44 3a 20 20 20 2f 2a 20 69 6e |ATALOAD: /* in| 00000460 73 65 72 74 20 64 61 74 61 20 2a 2f 0a 20 20 20 |sert data */. | 00000470 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 6c 6f | mlo| 00000480 61 64 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 |ad();. | 00000490 20 20 20 20 20 20 62 72 65 61 6b 3b 0a 20 20 20 | break;. | 000004a0 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 3a | default:| 000004b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000004c0 20 62 72 65 61 6b 3b 20 20 20 20 20 20 20 20 2f | break; /| 000004d0 2a 20 69 67 6e 6f 72 65 20 6f 74 68 65 72 20 6d |* ignore other m| 000004e0 65 73 73 61 67 65 73 20 2a 2f 0a 20 20 20 20 20 |essages */. | 000004f0 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 | }. | 00000500 20 62 72 65 61 6b 3b 0a 0a 20 20 20 20 64 65 66 | break;.. def| 00000510 61 75 6c 74 3a 20 20 20 2f 2a 20 49 67 6e 6f 72 |ault: /* Ignor| 00000520 65 20 61 6e 79 20 6f 74 68 65 72 20 65 76 65 6e |e any other even| 00000530 74 20 2a 2f 0a 20 20 20 20 20 20 20 20 20 62 72 |t */. br| 00000540 65 61 6b 3b 0a 20 20 7d 0a 7d 0a 0a 0a 0a 0a 0a |eak;. }.}......| 00000550 0a |.| 00000551