From 2ee739cc47516446b7eaf8b2e718cf5dea6cf61d Mon Sep 17 00:00:00 2001 From: mdw Date: Wed, 17 Jun 1998 19:07:45 +0000 Subject: [PATCH] Initial revision --- StraySrc/!DLLs/!Boot,feb | 9 + StraySrc/!DLLs/!Run,feb | 23 + StraySrc/!DLLs/!Sprites,ff9 | Bin 0 -> 736 bytes StraySrc/!DLLs/!Sprites22,ff9 | Bin 0 -> 1416 bytes StraySrc/Announce | 152 + StraySrc/BuildTools | 49 + StraySrc/COPYING | 339 ++ StraySrc/Dynamite/Makefile,fe1 | 100 + StraySrc/Dynamite/apcs/Makefile,fe1 | 105 + StraySrc/Dynamite/apcs/h/dynamite | 377 +++ StraySrc/Dynamite/apcs/s/dyn_apcs | 282 ++ StraySrc/Dynamite/dynamite/Makefile,fe1 | 183 ++ StraySrc/Dynamite/dynamite/rsc/messages | 82 + StraySrc/Dynamite/dynamite/s/dynAnchor | 146 + StraySrc/Dynamite/dynamite/s/dynArea | 325 ++ StraySrc/Dynamite/dynamite/s/dynHeap | 1198 ++++++++ StraySrc/Dynamite/dynamite/s/dynTask | 305 ++ StraySrc/Dynamite/dynamite/s/dynamite | 608 ++++ StraySrc/Dynamite/dynamite/s/fastMove | 1 + StraySrc/Dynamite/dynamite/sh/dynAnchor | 51 + StraySrc/Dynamite/dynamite/sh/dynArea | 79 + StraySrc/Dynamite/dynamite/sh/dynHeap | 226 ++ StraySrc/Dynamite/dynamite/sh/dynTask | 63 + StraySrc/Dynamite/dynamite/sh/messages | 38 + StraySrc/Dynamite/dynamite/sh/wSpace | 66 + StraySrc/Glass/!Glass/!Boot,feb | 12 + StraySrc/Glass/!Glass/!Help | 132 + StraySrc/Glass/!Glass/!Run,feb | 62 + StraySrc/Glass/!Glass/!Sprites,ff9 | Bin 0 -> 1860 bytes StraySrc/Glass/!Glass/Choices | 70 + StraySrc/Glass/!Glass/Defaults/Templates,fec | Bin 0 -> 842 bytes StraySrc/Glass/!Glass/Makefile,fe1 | 1188 ++++++++ StraySrc/Glass/!Glass/Resources/LoadSpr,ff9 | Bin 0 -> 11732 bytes StraySrc/Glass/!Glass/Resources/LoadTpl,fec | Bin 0 -> 645 bytes StraySrc/Glass/!Glass/Resources/Messages | 269 ++ StraySrc/Glass/!Glass/Resources/Sprites,ff9 | Bin 0 -> 20420 bytes StraySrc/Glass/!Glass/Resources/Templates,fec | Bin 0 -> 35326 bytes StraySrc/Glass/!Glass/c/align | 810 +++++ StraySrc/Glass/!Glass/c/colSelect | 347 +++ StraySrc/Glass/!Glass/c/editIcon | 1690 ++++++++++ StraySrc/Glass/!Glass/c/editWin | 1934 ++++++++++++ StraySrc/Glass/!Glass/c/gPrefs | 1703 +++++++++++ StraySrc/Glass/!Glass/c/gSprite | 1786 +++++++++++ StraySrc/Glass/!Glass/c/glass | 601 ++++ StraySrc/Glass/!Glass/c/iconData | 265 ++ StraySrc/Glass/!Glass/c/indir | 304 ++ StraySrc/Glass/!Glass/c/intMsgs | 111 + StraySrc/Glass/!Glass/c/tearEdit | 1387 +++++++++ StraySrc/Glass/!Glass/c/tfile | 3006 ++++++++++++++++++ StraySrc/Glass/!Glass/c/toolbox | 277 ++ StraySrc/Glass/!Glass/c/wDragging | 742 +++++ StraySrc/Glass/!Glass/c/wGrab | 286 ++ StraySrc/Glass/!Glass/c/wGraph | 217 ++ StraySrc/Glass/!Glass/c/wIcons | 672 ++++ StraySrc/Glass/!Glass/c/wMenus | 1250 ++++++++ StraySrc/Glass/!Glass/c/wMousePtr | 380 +++ StraySrc/Glass/!Glass/c/wPalette | 198 ++ StraySrc/Glass/!Glass/c/wRedraw | 678 ++++ StraySrc/Glass/!Glass/c/wSelect | 335 ++ StraySrc/Glass/!Glass/c/wToolbars | 778 +++++ StraySrc/Glass/!Glass/c/wWinEvent | 930 ++++++ StraySrc/Glass/!Glass/c/wWindows | 407 +++ StraySrc/Glass/!Glass/c/window | 58 + StraySrc/Glass/!Glass/h/_window | 869 ++++++ StraySrc/Glass/!Glass/h/align | 43 + StraySrc/Glass/!Glass/h/colSelect | 99 + StraySrc/Glass/!Glass/h/editIcon | 105 + StraySrc/Glass/!Glass/h/editWin | 87 + StraySrc/Glass/!Glass/h/gIcons | 544 ++++ StraySrc/Glass/!Glass/h/gMenus | 185 ++ StraySrc/Glass/!Glass/h/gPrefs | 182 ++ StraySrc/Glass/!Glass/h/gSprite | 123 + StraySrc/Glass/!Glass/h/gStruct | 220 ++ StraySrc/Glass/!Glass/h/glass | 49 + StraySrc/Glass/!Glass/h/iconData | 101 + StraySrc/Glass/!Glass/h/indir | 98 + StraySrc/Glass/!Glass/h/intMsgs | 139 + StraySrc/Glass/!Glass/h/tearEdit | 75 + StraySrc/Glass/!Glass/h/tfile | 234 ++ StraySrc/Glass/!Glass/h/toolbox | 52 + StraySrc/Glass/!Glass/h/window | 221 ++ StraySrc/Glass/!Glass/s/toolSupprt | 110 + StraySrc/Hammer/Makefile,fe1 | 167 + StraySrc/Hammer/s/armEmul | 1170 +++++++ StraySrc/Hammer/s/asm | 1923 ++++++++++++ StraySrc/Hammer/s/brkpt | 522 ++++ StraySrc/Hammer/s/diss | 1780 +++++++++++ StraySrc/Hammer/s/driver | 582 ++++ StraySrc/Hammer/s/hammer | 188 ++ StraySrc/Hammer/sh/armEmul | 46 + StraySrc/Hammer/sh/asm | 61 + StraySrc/Hammer/sh/brkpt | 105 + StraySrc/Hammer/sh/diss | 92 + StraySrc/Hammer/sh/driver | 45 + StraySrc/Hammer/sh/hammer | 57 + StraySrc/Libraries/BAS/Makefile,fe1 | 100 + StraySrc/Libraries/BAS/exports | 56 + StraySrc/Libraries/BAS/src/Makefile,fe1 | 247 ++ StraySrc/Libraries/BAS/src/README | 330 ++ StraySrc/Libraries/BAS/src/b/bas,ffb | Bin 0 -> 10540 bytes StraySrc/Libraries/BAS/src/rsc/messages | 26 + StraySrc/Libraries/BAS/src/s/aofGen | 1170 +++++++ StraySrc/Libraries/BAS/src/s/bas | 260 ++ StraySrc/Libraries/BAS/src/s/basTalk | 285 ++ StraySrc/Libraries/BAS/src/s/fastMove | 1 + StraySrc/Libraries/BAS/src/s/flex | 21 + StraySrc/Libraries/BAS/src/s/get | 648 ++++ StraySrc/Libraries/BAS/src/s/insert | 152 + StraySrc/Libraries/BAS/src/s/lit | 242 ++ StraySrc/Libraries/BAS/src/s/string | 338 ++ StraySrc/Libraries/BAS/src/s/vars | 151 + StraySrc/Libraries/BAS/src/scripts/crunchit,feb | 38 + StraySrc/Libraries/BAS/src/scripts/execit,ffe | 13 + StraySrc/Libraries/BAS/src/scripts/exports | 56 + StraySrc/Libraries/BAS/src/scripts/preproc | 25 + StraySrc/Libraries/BAS/src/sh/aofGen | 202 ++ StraySrc/Libraries/BAS/src/sh/bas | 73 + StraySrc/Libraries/BAS/src/sh/basTalk | 115 + StraySrc/Libraries/BAS/src/sh/basicEnv | 150 + StraySrc/Libraries/BAS/src/sh/fastMove | 1 + StraySrc/Libraries/BAS/src/sh/flex | 10 + StraySrc/Libraries/BAS/src/sh/get | 54 + StraySrc/Libraries/BAS/src/sh/insert | 58 + StraySrc/Libraries/BAS/src/sh/lit | 82 + StraySrc/Libraries/BAS/src/sh/messages | 23 + StraySrc/Libraries/BAS/src/sh/string | 164 + StraySrc/Libraries/BAS/src/sh/vars | 46 + StraySrc/Libraries/BAS/src/sh/workspace | 76 + StraySrc/Libraries/Core/AOF/Makefile,fe1 | 106 + StraySrc/Libraries/Core/AOF/README | 8 + StraySrc/Libraries/Core/AOF/c/aof | 115 + StraySrc/Libraries/Core/AOF/h/alf | 40 + StraySrc/Libraries/Core/AOF/h/aof | 178 ++ StraySrc/Libraries/Core/AOF/h/chunk | 57 + StraySrc/Libraries/Core/EmbTemp/Makefile,fe1 | 98 + StraySrc/Libraries/Core/EmbTemp/README | 49 + StraySrc/Libraries/Core/EmbTemp/s/embTemp | 126 + StraySrc/Libraries/Core/EmbTemp/sh/embTemp | 38 + StraySrc/Libraries/Core/Makefile,fe1 | 163 + StraySrc/Libraries/Core/TearSupt/Makefile,fe1 | 102 + StraySrc/Libraries/Core/TearSupt/README | 92 + StraySrc/Libraries/Core/TearSupt/UnLoad,ffb | Bin 0 -> 356 bytes StraySrc/Libraries/Core/TearSupt/bs/tearSupt,ffb | Bin 0 -> 35906 bytes StraySrc/Libraries/Core/TearSupt/h/tearSupt | 81 + StraySrc/Libraries/Core/TearSupt/s/tt | 22 + StraySrc/Libraries/Core/TearSupt/sh/tearSupt | 75 + StraySrc/Libraries/Core/dump | 167 + StraySrc/Libraries/Core/h/_time | 5 + StraySrc/Libraries/Core/h/swis | 2724 +++++++++++++++++ StraySrc/Libraries/Core/h/swiv | 122 + StraySrc/Libraries/Core/header | 195 ++ StraySrc/Libraries/Core/s/fastMove | 475 +++ StraySrc/Libraries/Core/s/flex | 1480 +++++++++ StraySrc/Libraries/Core/s/heap | 840 +++++ StraySrc/Libraries/Core/s/oxswi | 163 + StraySrc/Libraries/Core/s/rdump | 165 + StraySrc/Libraries/Core/s/swihack | 80 + StraySrc/Libraries/Core/s/swiv | 5 + StraySrc/Libraries/Core/s/xapp | 133 + StraySrc/Libraries/Core/s/xcommon | 129 + StraySrc/Libraries/Core/s/xdata | 138 + StraySrc/Libraries/Core/s/xdll | 55 + StraySrc/Libraries/Core/s/xentry | 324 ++ StraySrc/Libraries/Core/s/xentry_swi | 2 + StraySrc/Libraries/Core/s/xmodule | 190 ++ StraySrc/Libraries/Core/s/xsmall | 2 + StraySrc/Libraries/Core/s/xsmall_swi | 3 + StraySrc/Libraries/Core/s/xswi | 347 +++ StraySrc/Libraries/Core/sh/fastMove | 49 + StraySrc/Libraries/Core/sh/flex | 232 ++ StraySrc/Libraries/Core/sh/flexws | 51 + StraySrc/Libraries/Core/sh/heapws | 35 + StraySrc/Libraries/Core/stream | 227 ++ StraySrc/Libraries/Core/swis | 1521 +++++++++ StraySrc/Libraries/DLLLib/Makefile,fe1 | 139 + StraySrc/Libraries/DLLLib/h/ctype | 112 + StraySrc/Libraries/DLLLib/h/dll | 192 ++ StraySrc/Libraries/DLLLib/h/errno | 72 + StraySrc/Libraries/DLLLib/h/math | 167 + StraySrc/Libraries/DLLLib/h/stdio | 695 +++++ StraySrc/Libraries/DLLLib/h/swiv | 103 + StraySrc/Libraries/DLLLib/s/appEntry | 35 + StraySrc/Libraries/DLLLib/s/clib | 51 + StraySrc/Libraries/DLLLib/s/dpoll | 145 + StraySrc/Libraries/DLLLib/s/dsetjmp | 43 + StraySrc/Libraries/DLLLib/s/extEntry | 35 + StraySrc/Libraries/DLLLib/s/findAll | 71 + StraySrc/Libraries/DLLLib/s/iface | 230 ++ StraySrc/Libraries/DLLLib/s/loadLocal | 118 + StraySrc/Libraries/DLLLib/s/oscli | 147 + StraySrc/Libraries/DLLLib/s/wSpace | 71 + StraySrc/Libraries/DLLLib/sh/dllswis | 51 + StraySrc/Libraries/Makefile,fe1 | 100 + StraySrc/Libraries/Quartz/Makefile,fe1 | 123 + StraySrc/Libraries/Quartz/s/fastMove | 1 + StraySrc/Libraries/Quartz/s/kernel | 262 ++ StraySrc/Libraries/Quartz/s/screen | 177 ++ StraySrc/Libraries/Quartz/s/string | 473 +++ StraySrc/Libraries/Quartz/sh/!FilerConf,050 | 1 + StraySrc/Libraries/Quartz/sh/fastMove | 49 + StraySrc/Libraries/Quartz/sh/quartz | 45 + StraySrc/Libraries/Quartz/sh/screen | 71 + StraySrc/Libraries/Quartz/sh/string | 170 ++ StraySrc/Libraries/Sapphire/Makefile,fe1 | 1041 +++++++ StraySrc/Libraries/Sapphire/Modules/Docs/Sprinkle | 138 + StraySrc/Libraries/Sapphire/Modules/Makefile,fe1 | 124 + StraySrc/Libraries/Sapphire/Modules/s/constrain | 654 ++++ StraySrc/Libraries/Sapphire/Modules/s/sprinkle | 157 + StraySrc/Libraries/Sapphire/README | 1039 +++++++ StraySrc/Libraries/Sapphire/bs/fixedPt,ffb | Bin 0 -> 17582 bytes StraySrc/Libraries/Sapphire/bsh/banner,ffb | Bin 0 -> 685 bytes StraySrc/Libraries/Sapphire/bsh/dbx,ffb | Bin 0 -> 1163 bytes StraySrc/Libraries/Sapphire/bsh/flex,ffb | Bin 0 -> 1196 bytes StraySrc/Libraries/Sapphire/bsh/libOpts,ffb | Bin 0 -> 324 bytes StraySrc/Libraries/Sapphire/bsh/menuDefs,ffb | Bin 0 -> 2367 bytes StraySrc/Libraries/Sapphire/bsh/options,ffb | Bin 0 -> 998 bytes StraySrc/Libraries/Sapphire/bsh/stdDbox,ffb | Bin 0 -> 591 bytes StraySrc/Libraries/Sapphire/choices/s/choices | 215 ++ StraySrc/Libraries/Sapphire/choices/s/options | 883 ++++++ StraySrc/Libraries/Sapphire/choices/s/prefs | 130 + StraySrc/Libraries/Sapphire/colSelect/s/colSelect | 437 +++ StraySrc/Libraries/Sapphire/colSelect/s/hsv | 958 ++++++ StraySrc/Libraries/Sapphire/colSelect/s/rgb | 1602 ++++++++++ StraySrc/Libraries/Sapphire/csapph/h/akbd | 76 + StraySrc/Libraries/Sapphire/csapph/h/alloc | 124 + StraySrc/Libraries/Sapphire/csapph/h/banner | 138 + StraySrc/Libraries/Sapphire/csapph/h/buttons | 111 + .../Libraries/Sapphire/csapph/h/choices/choices | 68 + .../Libraries/Sapphire/csapph/h/choices/options | 201 ++ StraySrc/Libraries/Sapphire/csapph/h/choices/prefs | 47 + StraySrc/Libraries/Sapphire/csapph/h/chunk | 147 + StraySrc/Libraries/Sapphire/csapph/h/cmdLine | 70 + StraySrc/Libraries/Sapphire/csapph/h/coRoutine | 87 + StraySrc/Libraries/Sapphire/csapph/h/colSelect | 63 + StraySrc/Libraries/Sapphire/csapph/h/colourBox | 52 + StraySrc/Libraries/Sapphire/csapph/h/dbox | 539 ++++ StraySrc/Libraries/Sapphire/csapph/h/dbx/arrow | 46 + StraySrc/Libraries/Sapphire/csapph/h/dbx/colourPot | 52 + StraySrc/Libraries/Sapphire/csapph/h/dbx/dbx | 191 ++ StraySrc/Libraries/Sapphire/csapph/h/dbx/fileIcon | 87 + StraySrc/Libraries/Sapphire/csapph/h/dbx/numWrite | 122 + StraySrc/Libraries/Sapphire/csapph/h/dbx/slider | 62 + StraySrc/Libraries/Sapphire/csapph/h/dbx/stringSet | 66 + StraySrc/Libraries/Sapphire/csapph/h/defHandler | 45 + StraySrc/Libraries/Sapphire/csapph/h/divide | 125 + StraySrc/Libraries/Sapphire/csapph/h/drag | 142 + StraySrc/Libraries/Sapphire/csapph/h/draw | 70 + StraySrc/Libraries/Sapphire/csapph/h/dynPtr | 44 + StraySrc/Libraries/Sapphire/csapph/h/errorBox | 89 + StraySrc/Libraries/Sapphire/csapph/h/event | 117 + StraySrc/Libraries/Sapphire/csapph/h/except | 103 + StraySrc/Libraries/Sapphire/csapph/h/fastMove | 45 + StraySrc/Libraries/Sapphire/csapph/h/fixedPt | 92 + StraySrc/Libraries/Sapphire/csapph/h/flex | 222 ++ StraySrc/Libraries/Sapphire/csapph/h/fontmenu | 87 + StraySrc/Libraries/Sapphire/csapph/h/gallery | 85 + StraySrc/Libraries/Sapphire/csapph/h/heap | 116 + StraySrc/Libraries/Sapphire/csapph/h/help | 83 + StraySrc/Libraries/Sapphire/csapph/h/hour | 156 + StraySrc/Libraries/Sapphire/csapph/h/ibicon | 111 + StraySrc/Libraries/Sapphire/csapph/h/idle | 119 + StraySrc/Libraries/Sapphire/csapph/h/intKeys | 139 + StraySrc/Libraries/Sapphire/csapph/h/keyMap | 314 ++ StraySrc/Libraries/Sapphire/csapph/h/keyString | 48 + StraySrc/Libraries/Sapphire/csapph/h/libOpts | 81 + StraySrc/Libraries/Sapphire/csapph/h/listbox | 271 ++ StraySrc/Libraries/Sapphire/csapph/h/llistMan | 226 ++ StraySrc/Libraries/Sapphire/csapph/h/mbox | 51 + StraySrc/Libraries/Sapphire/csapph/h/mem | 45 + StraySrc/Libraries/Sapphire/csapph/h/menu | 75 + StraySrc/Libraries/Sapphire/csapph/h/menuDefs | 335 ++ StraySrc/Libraries/Sapphire/csapph/h/msgs | 103 + StraySrc/Libraries/Sapphire/csapph/h/nopoll | 102 + StraySrc/Libraries/Sapphire/csapph/h/note | 41 + StraySrc/Libraries/Sapphire/csapph/h/pane | 136 + StraySrc/Libraries/Sapphire/csapph/h/progInfo | 43 + StraySrc/Libraries/Sapphire/csapph/h/ptr | 93 + StraySrc/Libraries/Sapphire/csapph/h/rand | 86 + StraySrc/Libraries/Sapphire/csapph/h/repeater | 66 + StraySrc/Libraries/Sapphire/csapph/h/report | 73 + StraySrc/Libraries/Sapphire/csapph/h/res | 93 + StraySrc/Libraries/Sapphire/csapph/h/resources | 66 + StraySrc/Libraries/Sapphire/csapph/h/resspr | 73 + StraySrc/Libraries/Sapphire/csapph/h/roVersion | 53 + StraySrc/Libraries/Sapphire/csapph/h/sapphire | 613 ++++ StraySrc/Libraries/Sapphire/csapph/h/saveWarn | 91 + StraySrc/Libraries/Sapphire/csapph/h/screen | 91 + StraySrc/Libraries/Sapphire/csapph/h/seh | 129 + StraySrc/Libraries/Sapphire/csapph/h/sprite | 81 + StraySrc/Libraries/Sapphire/csapph/h/sqrt | 43 + StraySrc/Libraries/Sapphire/csapph/h/string | 202 ++ StraySrc/Libraries/Sapphire/csapph/h/subAlloc | 72 + StraySrc/Libraries/Sapphire/csapph/h/template | 118 + StraySrc/Libraries/Sapphire/csapph/h/thread | 323 ++ StraySrc/Libraries/Sapphire/csapph/h/tms | 380 +++ StraySrc/Libraries/Sapphire/csapph/h/transWin | 90 + StraySrc/Libraries/Sapphire/csapph/h/tspr | 72 + StraySrc/Libraries/Sapphire/csapph/h/viewer | 308 ++ StraySrc/Libraries/Sapphire/csapph/h/warning | 61 + StraySrc/Libraries/Sapphire/csapph/h/wimp | 87 + StraySrc/Libraries/Sapphire/csapph/h/win | 139 + StraySrc/Libraries/Sapphire/csapph/h/winUtils | 106 + StraySrc/Libraries/Sapphire/csapph/h/writable | 112 + StraySrc/Libraries/Sapphire/csapph/h/xfer/load | 131 + StraySrc/Libraries/Sapphire/csapph/h/xfer/save | 56 + StraySrc/Libraries/Sapphire/csapph/h/xfer/saveAs | 54 + StraySrc/Libraries/Sapphire/csapph/h/xfer/xload | 170 ++ StraySrc/Libraries/Sapphire/csapph/h/xfer/xsave | 133 + StraySrc/Libraries/Sapphire/csapph/s/cmath | 292 ++ StraySrc/Libraries/Sapphire/csapph/s/crout | 185 ++ StraySrc/Libraries/Sapphire/csapph/s/crts | 158 + StraySrc/Libraries/Sapphire/csapph/s/csapph | 125 + StraySrc/Libraries/Sapphire/csapph/s/csetjmp | 71 + StraySrc/Libraries/Sapphire/csapph/s/cstart | 39 + StraySrc/Libraries/Sapphire/csapph/s/ctype | 214 ++ StraySrc/Libraries/Sapphire/dbx/s/arrow | 140 + StraySrc/Libraries/Sapphire/dbx/s/colourPot | 277 ++ StraySrc/Libraries/Sapphire/dbx/s/dbx | 877 ++++++ StraySrc/Libraries/Sapphire/dbx/s/fileIcon | 390 +++ StraySrc/Libraries/Sapphire/dbx/s/numWrite | 337 ++ StraySrc/Libraries/Sapphire/dbx/s/slider | 395 +++ StraySrc/Libraries/Sapphire/dbx/s/stringSet | 157 + StraySrc/Libraries/Sapphire/def/csapph | 99 + StraySrc/Libraries/Sapphire/def/list | 80 + StraySrc/Libraries/Sapphire/def/resources | 19 + StraySrc/Libraries/Sapphire/def/tearoff | 29 + StraySrc/Libraries/Sapphire/def/thread | 41 + StraySrc/Libraries/Sapphire/rsc/ColourSel,fec | Bin 0 -> 4201 bytes StraySrc/Libraries/Sapphire/rsc/Messages | 105 + StraySrc/Libraries/Sapphire/rsc/Sprites,ff9 | Bin 0 -> 8316 bytes StraySrc/Libraries/Sapphire/rsc/Templates,fec | Bin 0 -> 2807 bytes StraySrc/Libraries/Sapphire/s/akbd | 444 +++ StraySrc/Libraries/Sapphire/s/alloc | 326 ++ StraySrc/Libraries/Sapphire/s/banner | 485 +++ StraySrc/Libraries/Sapphire/s/bnrStub | 72 + StraySrc/Libraries/Sapphire/s/buttons | 155 + StraySrc/Libraries/Sapphire/s/chunk | 508 +++ StraySrc/Libraries/Sapphire/s/cmdLine | 196 ++ StraySrc/Libraries/Sapphire/s/coRoutine | 297 ++ StraySrc/Libraries/Sapphire/s/colourBox | 451 +++ StraySrc/Libraries/Sapphire/s/dBanner | 31 + StraySrc/Libraries/Sapphire/s/dKernel | 37 + StraySrc/Libraries/Sapphire/s/dbox | 2278 ++++++++++++++ StraySrc/Libraries/Sapphire/s/defHandler | 121 + StraySrc/Libraries/Sapphire/s/divide | 313 ++ StraySrc/Libraries/Sapphire/s/drag | 728 +++++ StraySrc/Libraries/Sapphire/s/draw | 924 ++++++ StraySrc/Libraries/Sapphire/s/dynPtr | 198 ++ StraySrc/Libraries/Sapphire/s/errorBox | 303 ++ StraySrc/Libraries/Sapphire/s/event | 401 +++ StraySrc/Libraries/Sapphire/s/except | 458 +++ StraySrc/Libraries/Sapphire/s/fastMove | 1 + StraySrc/Libraries/Sapphire/s/flex | 4 + StraySrc/Libraries/Sapphire/s/fontMenu | 940 ++++++ StraySrc/Libraries/Sapphire/s/gallery | 399 +++ StraySrc/Libraries/Sapphire/s/heap | 2 + StraySrc/Libraries/Sapphire/s/help | 432 +++ StraySrc/Libraries/Sapphire/s/hour | 335 ++ StraySrc/Libraries/Sapphire/s/ibicon | 610 ++++ StraySrc/Libraries/Sapphire/s/idle | 598 ++++ StraySrc/Libraries/Sapphire/s/kernel | 644 ++++ StraySrc/Libraries/Sapphire/s/keyString | 603 ++++ StraySrc/Libraries/Sapphire/s/libOpts | 142 + StraySrc/Libraries/Sapphire/s/listbox | 1672 ++++++++++ StraySrc/Libraries/Sapphire/s/llistMan | 673 ++++ StraySrc/Libraries/Sapphire/s/llistStub | 53 + StraySrc/Libraries/Sapphire/s/mbox | 120 + StraySrc/Libraries/Sapphire/s/mem | 86 + StraySrc/Libraries/Sapphire/s/menu | 1249 ++++++++ StraySrc/Libraries/Sapphire/s/msgs | 466 +++ StraySrc/Libraries/Sapphire/s/nopoll | 434 +++ StraySrc/Libraries/Sapphire/s/note | 147 + StraySrc/Libraries/Sapphire/s/pane | 590 ++++ StraySrc/Libraries/Sapphire/s/progInfo | 107 + StraySrc/Libraries/Sapphire/s/ptr | 663 ++++ StraySrc/Libraries/Sapphire/s/rand | 200 ++ StraySrc/Libraries/Sapphire/s/repeater | 319 ++ StraySrc/Libraries/Sapphire/s/report | 219 ++ StraySrc/Libraries/Sapphire/s/res | 314 ++ StraySrc/Libraries/Sapphire/s/resources | 172 ++ StraySrc/Libraries/Sapphire/s/resspr | 232 ++ StraySrc/Libraries/Sapphire/s/roVersion | 122 + StraySrc/Libraries/Sapphire/s/sapphRes | 199 ++ StraySrc/Libraries/Sapphire/s/saveWarn | 232 ++ StraySrc/Libraries/Sapphire/s/screen | 261 ++ StraySrc/Libraries/Sapphire/s/seh | 274 ++ StraySrc/Libraries/Sapphire/s/sprite | 263 ++ StraySrc/Libraries/Sapphire/s/sqrt | 87 + StraySrc/Libraries/Sapphire/s/string | 466 +++ StraySrc/Libraries/Sapphire/s/stub | 186 ++ StraySrc/Libraries/Sapphire/s/subAlloc | 217 ++ StraySrc/Libraries/Sapphire/s/template | 979 ++++++ StraySrc/Libraries/Sapphire/s/thread | 1418 +++++++++ StraySrc/Libraries/Sapphire/s/transWin | 343 +++ StraySrc/Libraries/Sapphire/s/tspr | 330 ++ StraySrc/Libraries/Sapphire/s/viewer | 2316 ++++++++++++++ StraySrc/Libraries/Sapphire/s/warning | 244 ++ StraySrc/Libraries/Sapphire/s/wimp | 281 ++ StraySrc/Libraries/Sapphire/s/win | 526 ++++ StraySrc/Libraries/Sapphire/s/winUtils | 292 ++ StraySrc/Libraries/Sapphire/s/writable | 398 +++ StraySrc/Libraries/Sapphire/sail/Changes | 14 + StraySrc/Libraries/Sapphire/sail/Makefile,fe1 | 243 ++ StraySrc/Libraries/Sapphire/sail/SAILInfo | 261 ++ StraySrc/Libraries/Sapphire/sail/_s/ctrl | 3222 ++++++++++++++++++++ StraySrc/Libraries/Sapphire/sail/_s/driver | 262 ++ StraySrc/Libraries/Sapphire/sail/_s/error | 127 + StraySrc/Libraries/Sapphire/sail/_s/express | 2461 +++++++++++++++ StraySrc/Libraries/Sapphire/sail/_s/getToken | 67 + StraySrc/Libraries/Sapphire/sail/_s/interp | 255 ++ StraySrc/Libraries/Sapphire/sail/_s/strBucket | 155 + StraySrc/Libraries/Sapphire/sail/_s/stracc | 116 + StraySrc/Libraries/Sapphire/sail/_s/termScript | 512 ++++ StraySrc/Libraries/Sapphire/sail/_s/termite | 1590 ++++++++++ StraySrc/Libraries/Sapphire/sail/_s/tokenise | 563 ++++ StraySrc/Libraries/Sapphire/sail/_s/tree | 215 ++ StraySrc/Libraries/Sapphire/sail/_s/value | 294 ++ StraySrc/Libraries/Sapphire/sail/_s/var | 189 ++ StraySrc/Libraries/Sapphire/sail/_sh/anchor | 99 + StraySrc/Libraries/Sapphire/sail/_sh/ctrl | 289 ++ StraySrc/Libraries/Sapphire/sail/_sh/divide | 57 + StraySrc/Libraries/Sapphire/sail/_sh/errNum | 78 + StraySrc/Libraries/Sapphire/sail/_sh/errTable | 141 + StraySrc/Libraries/Sapphire/sail/_sh/error | 45 + StraySrc/Libraries/Sapphire/sail/_sh/express | 84 + StraySrc/Libraries/Sapphire/sail/_sh/getToken | 39 + StraySrc/Libraries/Sapphire/sail/_sh/interp | 65 + StraySrc/Libraries/Sapphire/sail/_sh/mem | 60 + StraySrc/Libraries/Sapphire/sail/_sh/strBucket | 55 + StraySrc/Libraries/Sapphire/sail/_sh/stracc | 56 + StraySrc/Libraries/Sapphire/sail/_sh/termScript | 68 + StraySrc/Libraries/Sapphire/sail/_sh/termite | 219 ++ StraySrc/Libraries/Sapphire/sail/_sh/tokClasses | 272 ++ StraySrc/Libraries/Sapphire/sail/_sh/tokNames | 262 ++ StraySrc/Libraries/Sapphire/sail/_sh/tokTable | 943 ++++++ StraySrc/Libraries/Sapphire/sail/_sh/tokenise | 33 + StraySrc/Libraries/Sapphire/sail/_sh/tokens | 156 + StraySrc/Libraries/Sapphire/sail/_sh/tree | 66 + StraySrc/Libraries/Sapphire/sail/_sh/upcalls | 112 + StraySrc/Libraries/Sapphire/sail/_sh/value | 74 + StraySrc/Libraries/Sapphire/sail/_sh/var | 76 + StraySrc/Libraries/Sapphire/sail/errgen,ffb | Bin 0 -> 4612 bytes StraySrc/Libraries/Sapphire/sail/s/ctrl | 3222 ++++++++++++++++++++ StraySrc/Libraries/Sapphire/sail/s/driver | 262 ++ StraySrc/Libraries/Sapphire/sail/s/env | 127 + StraySrc/Libraries/Sapphire/sail/s/error | 127 + StraySrc/Libraries/Sapphire/sail/s/express | 2461 +++++++++++++++ StraySrc/Libraries/Sapphire/sail/s/getToken | 67 + StraySrc/Libraries/Sapphire/sail/s/interp | 259 ++ StraySrc/Libraries/Sapphire/sail/s/mem | 97 + StraySrc/Libraries/Sapphire/sail/s/sail | 342 +++ StraySrc/Libraries/Sapphire/sail/s/strBucket | 155 + StraySrc/Libraries/Sapphire/sail/s/stracc | 118 + StraySrc/Libraries/Sapphire/sail/s/termScript | 512 ++++ StraySrc/Libraries/Sapphire/sail/s/termite | 1590 ++++++++++ StraySrc/Libraries/Sapphire/sail/s/tokenise | 563 ++++ StraySrc/Libraries/Sapphire/sail/s/tree | 215 ++ StraySrc/Libraries/Sapphire/sail/s/value | 294 ++ StraySrc/Libraries/Sapphire/sail/s/var | 189 ++ StraySrc/Libraries/Sapphire/sail/sh/anchor | 80 + StraySrc/Libraries/Sapphire/sail/sh/ctrl | 289 ++ StraySrc/Libraries/Sapphire/sail/sh/divide | 57 + StraySrc/Libraries/Sapphire/sail/sh/errNum | 78 + StraySrc/Libraries/Sapphire/sail/sh/errTable | 141 + StraySrc/Libraries/Sapphire/sail/sh/error | 45 + StraySrc/Libraries/Sapphire/sail/sh/express | 84 + StraySrc/Libraries/Sapphire/sail/sh/getToken | 39 + StraySrc/Libraries/Sapphire/sail/sh/interp | 65 + StraySrc/Libraries/Sapphire/sail/sh/mem | 60 + StraySrc/Libraries/Sapphire/sail/sh/strBucket | 55 + StraySrc/Libraries/Sapphire/sail/sh/stracc | 56 + StraySrc/Libraries/Sapphire/sail/sh/termScript | 68 + StraySrc/Libraries/Sapphire/sail/sh/termite | 219 ++ StraySrc/Libraries/Sapphire/sail/sh/tokClasses | 272 ++ StraySrc/Libraries/Sapphire/sail/sh/tokNames | 262 ++ StraySrc/Libraries/Sapphire/sail/sh/tokTable | 943 ++++++ StraySrc/Libraries/Sapphire/sail/sh/tokenise | 33 + StraySrc/Libraries/Sapphire/sail/sh/tokens | 156 + StraySrc/Libraries/Sapphire/sail/sh/tree | 66 + StraySrc/Libraries/Sapphire/sail/sh/upcalls | 112 + StraySrc/Libraries/Sapphire/sail/sh/value | 74 + StraySrc/Libraries/Sapphire/sail/sh/var | 76 + StraySrc/Libraries/Sapphire/sail/tableGen,ffb | Bin 0 -> 7091 bytes StraySrc/Libraries/Sapphire/sh/_colSelect/kernel | 70 + StraySrc/Libraries/Sapphire/sh/_colSelect/models | 42 + StraySrc/Libraries/Sapphire/sh/_colSelect/vars | 86 + StraySrc/Libraries/Sapphire/sh/_tms/tmsCreate | 84 + StraySrc/Libraries/Sapphire/sh/_tms/tmsGlobal | 231 ++ StraySrc/Libraries/Sapphire/sh/_tms/tmsGlue | 60 + StraySrc/Libraries/Sapphire/sh/_tms/tmsMain | 133 + StraySrc/Libraries/Sapphire/sh/akbd | 83 + StraySrc/Libraries/Sapphire/sh/alloc | 128 + StraySrc/Libraries/Sapphire/sh/banner | 200 ++ StraySrc/Libraries/Sapphire/sh/buttons | 185 ++ StraySrc/Libraries/Sapphire/sh/choices/choices | 84 + StraySrc/Libraries/Sapphire/sh/choices/options | 367 +++ StraySrc/Libraries/Sapphire/sh/choices/prefs | 63 + StraySrc/Libraries/Sapphire/sh/chunk | 150 + StraySrc/Libraries/Sapphire/sh/cmdLine | 79 + StraySrc/Libraries/Sapphire/sh/coRoutine | 93 + StraySrc/Libraries/Sapphire/sh/colSelect | 76 + StraySrc/Libraries/Sapphire/sh/colourBox | 63 + StraySrc/Libraries/Sapphire/sh/dbox | 542 ++++ StraySrc/Libraries/Sapphire/sh/dbx/_dbxMacs | 52 + StraySrc/Libraries/Sapphire/sh/dbx/arrow | 76 + StraySrc/Libraries/Sapphire/sh/dbx/colourPot | 83 + StraySrc/Libraries/Sapphire/sh/dbx/dbx | 270 ++ StraySrc/Libraries/Sapphire/sh/dbx/fileIcon | 114 + StraySrc/Libraries/Sapphire/sh/dbx/numWrite | 146 + StraySrc/Libraries/Sapphire/sh/dbx/slider | 94 + StraySrc/Libraries/Sapphire/sh/dbx/stringSet | 94 + StraySrc/Libraries/Sapphire/sh/defHandler | 54 + StraySrc/Libraries/Sapphire/sh/divide | 130 + StraySrc/Libraries/Sapphire/sh/drag | 178 ++ StraySrc/Libraries/Sapphire/sh/draw | 78 + StraySrc/Libraries/Sapphire/sh/dynPtr | 48 + StraySrc/Libraries/Sapphire/sh/errorBox | 96 + StraySrc/Libraries/Sapphire/sh/event | 121 + StraySrc/Libraries/Sapphire/sh/except | 109 + StraySrc/Libraries/Sapphire/sh/fastMove | 54 + StraySrc/Libraries/Sapphire/sh/fixedPt | 98 + StraySrc/Libraries/Sapphire/sh/flex | 237 ++ StraySrc/Libraries/Sapphire/sh/fontmenu | 96 + StraySrc/Libraries/Sapphire/sh/gallery | 91 + StraySrc/Libraries/Sapphire/sh/heap | 120 + StraySrc/Libraries/Sapphire/sh/help | 84 + StraySrc/Libraries/Sapphire/sh/hour | 157 + StraySrc/Libraries/Sapphire/sh/ibicon | 117 + StraySrc/Libraries/Sapphire/sh/idle | 124 + StraySrc/Libraries/Sapphire/sh/intKeys | 150 + StraySrc/Libraries/Sapphire/sh/keyMap | 325 ++ StraySrc/Libraries/Sapphire/sh/keyString | 57 + StraySrc/Libraries/Sapphire/sh/libOpts | 125 + StraySrc/Libraries/Sapphire/sh/listbox | 283 ++ StraySrc/Libraries/Sapphire/sh/llistMan | 223 ++ StraySrc/Libraries/Sapphire/sh/mbox | 60 + StraySrc/Libraries/Sapphire/sh/mem | 54 + StraySrc/Libraries/Sapphire/sh/menu | 82 + StraySrc/Libraries/Sapphire/sh/menuDefs | 544 ++++ StraySrc/Libraries/Sapphire/sh/msgs | 108 + StraySrc/Libraries/Sapphire/sh/ncs | 125 + StraySrc/Libraries/Sapphire/sh/nopoll | 108 + StraySrc/Libraries/Sapphire/sh/note | 50 + StraySrc/Libraries/Sapphire/sh/pane | 139 + StraySrc/Libraries/Sapphire/sh/progInfo | 52 + StraySrc/Libraries/Sapphire/sh/ptr | 98 + StraySrc/Libraries/Sapphire/sh/rand | 92 + StraySrc/Libraries/Sapphire/sh/repeater | 74 + StraySrc/Libraries/Sapphire/sh/report | 80 + StraySrc/Libraries/Sapphire/sh/res | 99 + StraySrc/Libraries/Sapphire/sh/resources | 75 + StraySrc/Libraries/Sapphire/sh/resspr | 80 + StraySrc/Libraries/Sapphire/sh/roVersion | 61 + StraySrc/Libraries/Sapphire/sh/sapphire | 238 ++ StraySrc/Libraries/Sapphire/sh/saveWarn | 93 + StraySrc/Libraries/Sapphire/sh/screen | 98 + StraySrc/Libraries/Sapphire/sh/seh | 133 + StraySrc/Libraries/Sapphire/sh/sprite | 88 + StraySrc/Libraries/Sapphire/sh/sqrt | 52 + StraySrc/Libraries/Sapphire/sh/string | 203 ++ StraySrc/Libraries/Sapphire/sh/subAlloc | 79 + StraySrc/Libraries/Sapphire/sh/template | 122 + StraySrc/Libraries/Sapphire/sh/thread | 317 ++ StraySrc/Libraries/Sapphire/sh/tms | 87 + StraySrc/Libraries/Sapphire/sh/transWin | 95 + StraySrc/Libraries/Sapphire/sh/tspr | 79 + StraySrc/Libraries/Sapphire/sh/viewer | 357 +++ StraySrc/Libraries/Sapphire/sh/warning | 69 + StraySrc/Libraries/Sapphire/sh/wimp | 93 + StraySrc/Libraries/Sapphire/sh/win | 142 + StraySrc/Libraries/Sapphire/sh/winUtils | 115 + StraySrc/Libraries/Sapphire/sh/writable | 130 + StraySrc/Libraries/Sapphire/sh/xfer/load | 188 ++ StraySrc/Libraries/Sapphire/sh/xfer/save | 99 + StraySrc/Libraries/Sapphire/sh/xfer/saveAs | 96 + StraySrc/Libraries/Sapphire/sh/xfer/xload | 178 ++ StraySrc/Libraries/Sapphire/sh/xfer/xsave | 143 + StraySrc/Libraries/Sapphire/tms/s/tmsCreate | 861 ++++++ StraySrc/Libraries/Sapphire/tms/s/tmsGlue | 480 +++ StraySrc/Libraries/Sapphire/tms/s/tmsMain | 2438 +++++++++++++++ StraySrc/Libraries/Sapphire/xfer/s/load | 790 +++++ StraySrc/Libraries/Sapphire/xfer/s/save | 470 +++ StraySrc/Libraries/Sapphire/xfer/s/saveAs | 383 +++ StraySrc/Libraries/Sapphire/xfer/s/xload | 760 +++++ StraySrc/Libraries/Sapphire/xfer/s/xsave | 628 ++++ StraySrc/Libraries/Steel/Makefile,fe1 | 1853 +++++++++++ StraySrc/Libraries/Steel/Messages | 260 ++ StraySrc/Libraries/Steel/c/akbd | 354 +++ StraySrc/Libraries/Steel/c/alarm | 240 ++ StraySrc/Libraries/Steel/c/baricon | 125 + StraySrc/Libraries/Steel/c/blinkC | 211 ++ StraySrc/Libraries/Steel/c/buffer | 44 + StraySrc/Libraries/Steel/c/buttons | 808 +++++ StraySrc/Libraries/Steel/c/caretptr | 246 ++ StraySrc/Libraries/Steel/c/choices | 116 + StraySrc/Libraries/Steel/c/crc | 156 + StraySrc/Libraries/Steel/c/creator | 456 +++ StraySrc/Libraries/Steel/c/dbox | 1664 ++++++++++ StraySrc/Libraries/Steel/c/event | 621 ++++ StraySrc/Libraries/Steel/c/exception | 128 + StraySrc/Libraries/Steel/c/fileicon | 108 + StraySrc/Libraries/Steel/c/font | 584 ++++ StraySrc/Libraries/Steel/c/fontMenu | 610 ++++ StraySrc/Libraries/Steel/c/help | 253 ++ StraySrc/Libraries/Steel/c/ibicon | 690 +++++ StraySrc/Libraries/Steel/c/interface | 102 + StraySrc/Libraries/Steel/c/keyString | 534 ++++ StraySrc/Libraries/Steel/c/listbox | 1741 +++++++++++ StraySrc/Libraries/Steel/c/mem | 569 ++++ StraySrc/Libraries/Steel/c/menu | 945 ++++++ StraySrc/Libraries/Steel/c/msgs | 380 +++ StraySrc/Libraries/Steel/c/nopoll | 301 ++ StraySrc/Libraries/Steel/c/pane | 357 +++ StraySrc/Libraries/Steel/c/pointer | 181 ++ StraySrc/Libraries/Steel/c/prefs | 326 ++ StraySrc/Libraries/Steel/c/print | 269 ++ StraySrc/Libraries/Steel/c/res | 232 ++ StraySrc/Libraries/Steel/c/resspr | 90 + StraySrc/Libraries/Steel/c/saveas | 261 ++ StraySrc/Libraries/Steel/c/scroller | 279 ++ StraySrc/Libraries/Steel/c/sprite | 916 ++++++ StraySrc/Libraries/Steel/c/stddbox | 471 +++ StraySrc/Libraries/Steel/c/tcol | 383 +++ StraySrc/Libraries/Steel/c/tearoff | 1828 +++++++++++ StraySrc/Libraries/Steel/c/template | 616 ++++ StraySrc/Libraries/Steel/c/utils | 164 + StraySrc/Libraries/Steel/c/viewer | 2030 ++++++++++++ StraySrc/Libraries/Steel/c/visdelay | 151 + StraySrc/Libraries/Steel/c/vsscanf | 387 +++ StraySrc/Libraries/Steel/c/werr | 308 ++ StraySrc/Libraries/Steel/c/wimpt | 561 ++++ StraySrc/Libraries/Steel/c/win | 653 ++++ StraySrc/Libraries/Steel/c/xferrecv | 394 +++ StraySrc/Libraries/Steel/c/xfersend | 531 ++++ StraySrc/Libraries/Steel/c/xproginfo | 121 + StraySrc/Libraries/Steel/def/steel | 875 ++++++ StraySrc/Libraries/Steel/h/akbd | 424 +++ StraySrc/Libraries/Steel/h/alarm | 129 + StraySrc/Libraries/Steel/h/baricon | 57 + StraySrc/Libraries/Steel/h/bbc | 590 ++++ StraySrc/Libraries/Steel/h/blinkC | 60 + StraySrc/Libraries/Steel/h/buffer | 41 + StraySrc/Libraries/Steel/h/buttons | 285 ++ StraySrc/Libraries/Steel/h/calltrace | 33 + StraySrc/Libraries/Steel/h/caretptr | 63 + StraySrc/Libraries/Steel/h/choices | 70 + StraySrc/Libraries/Steel/h/colourtran | 343 +++ StraySrc/Libraries/Steel/h/coords | 182 ++ StraySrc/Libraries/Steel/h/crc | 74 + StraySrc/Libraries/Steel/h/crc32 | 57 + StraySrc/Libraries/Steel/h/dbox | 519 ++++ StraySrc/Libraries/Steel/h/event | 180 ++ StraySrc/Libraries/Steel/h/exception | 94 + StraySrc/Libraries/Steel/h/fileicon | 80 + StraySrc/Libraries/Steel/h/flex | 339 ++ StraySrc/Libraries/Steel/h/font | 475 +++ StraySrc/Libraries/Steel/h/fontMenu | 159 + StraySrc/Libraries/Steel/h/heap | 119 + StraySrc/Libraries/Steel/h/help | 107 + StraySrc/Libraries/Steel/h/ibicon | 305 ++ StraySrc/Libraries/Steel/h/interface | 74 + StraySrc/Libraries/Steel/h/keyString | 69 + StraySrc/Libraries/Steel/h/listbox | 628 ++++ StraySrc/Libraries/Steel/h/mem | 213 ++ StraySrc/Libraries/Steel/h/menu | 374 +++ StraySrc/Libraries/Steel/h/menuExt | 38 + StraySrc/Libraries/Steel/h/msgs | 89 + StraySrc/Libraries/Steel/h/nopoll | 113 + StraySrc/Libraries/Steel/h/os | 225 ++ StraySrc/Libraries/Steel/h/pane | 161 + StraySrc/Libraries/Steel/h/pointer | 65 + StraySrc/Libraries/Steel/h/prefs | 188 ++ StraySrc/Libraries/Steel/h/res | 139 + StraySrc/Libraries/Steel/h/resspr | 53 + StraySrc/Libraries/Steel/h/saveas | 89 + StraySrc/Libraries/Steel/h/scroller | 55 + StraySrc/Libraries/Steel/h/sculptrix | 62 + StraySrc/Libraries/Steel/h/sprite | 536 ++++ StraySrc/Libraries/Steel/h/stddbox | 193 ++ StraySrc/Libraries/Steel/h/steel | 155 + StraySrc/Libraries/Steel/h/tcol | 82 + StraySrc/Libraries/Steel/h/tearoff | 263 ++ StraySrc/Libraries/Steel/h/template | 133 + StraySrc/Libraries/Steel/h/utils | 119 + StraySrc/Libraries/Steel/h/viewer | 784 +++++ StraySrc/Libraries/Steel/h/visdelay | 110 + StraySrc/Libraries/Steel/h/vsscanf | 57 + StraySrc/Libraries/Steel/h/werr | 82 + StraySrc/Libraries/Steel/h/wimp | 201 ++ StraySrc/Libraries/Steel/h/wimpext | 466 +++ StraySrc/Libraries/Steel/h/wimpstruct | 914 ++++++ StraySrc/Libraries/Steel/h/wimpt | 395 +++ StraySrc/Libraries/Steel/h/win | 470 +++ StraySrc/Libraries/Steel/h/xferrecv | 211 ++ StraySrc/Libraries/Steel/h/xfersend | 234 ++ StraySrc/Libraries/Steel/h/xproginfo | 40 + StraySrc/Libraries/Steel/h/xtearoff | 95 + StraySrc/Libraries/Steel/s/bbc | 746 +++++ StraySrc/Libraries/Steel/s/calltrace | 103 + StraySrc/Libraries/Steel/s/colourtran | 421 +++ StraySrc/Libraries/Steel/s/coords | 270 ++ StraySrc/Libraries/Steel/s/crc32 | 166 + StraySrc/Libraries/Steel/s/fastMove | 1 + StraySrc/Libraries/Steel/s/flex_dll | 4 + StraySrc/Libraries/Steel/s/flex_stat | 3 + StraySrc/Libraries/Steel/s/heap_dll | 3 + StraySrc/Libraries/Steel/s/heap_stat | 2 + StraySrc/Libraries/Steel/s/os | 449 +++ StraySrc/Libraries/Steel/s/sculptrix | 112 + StraySrc/Libraries/Steel/s/wimpExt | 203 ++ StraySrc/Libraries/Steel/s/wimp_dll | 148 + StraySrc/Libraries/Steel/s/wimp_main | 818 +++++ StraySrc/Libraries/Steel/s/wimp_stat | 246 ++ StraySrc/Makefile,fe1 | 100 + StraySrc/MiscToys/CheckSD/Makefile,fe1 | 115 + StraySrc/MiscToys/CheckSD/README | 15 + StraySrc/MiscToys/CheckSD/rsc/Templates,fec | Bin 0 -> 387 bytes StraySrc/MiscToys/CheckSD/s/CheckSD | 403 +++ StraySrc/MiscToys/CurrDir/Makefile,fe1 | 108 + StraySrc/MiscToys/CurrDir/README | 100 + StraySrc/MiscToys/CurrDir/s/currDir | 267 ++ StraySrc/MiscToys/Makefile,fe1 | 100 + StraySrc/MiscToys/PlainError/Makefile,fe1 | 102 + StraySrc/MiscToys/PlainError/ReadMe | 15 + StraySrc/MiscToys/PlainError/b/plainError,ffb | Bin 0 -> 2152 bytes StraySrc/MiscToys/PlainError/testit,ffb | Bin 0 -> 9 bytes StraySrc/README | 101 + StraySrc/SDLS/!DLLMerge/!Help | 74 + StraySrc/SDLS/!DLLMerge/!Run,feb | 20 + StraySrc/SDLS/!DLLMerge/!Sprites,ff9 | Bin 0 -> 736 bytes StraySrc/SDLS/!DLLMerge/Makefile,fe1 | 126 + StraySrc/SDLS/!DLLMerge/rsc/messages | 49 + StraySrc/SDLS/!DLLMerge/rsc/templates,fec | Bin 0 -> 884 bytes StraySrc/SDLS/!DLLMerge/s/dllmerge | 1103 +++++++ StraySrc/SDLS/!DLLMerge/sh/messages | 23 + StraySrc/SDLS/!DLLMerge/sh/templates | 13 + StraySrc/SDLS/DLLManager/Makefile,fe1 | 171 ++ StraySrc/SDLS/DLLManager/rsc/messages | 141 + StraySrc/SDLS/DLLManager/s/app | 1515 +++++++++ StraySrc/SDLS/DLLManager/s/dheader | 302 ++ StraySrc/SDLS/DLLManager/s/dll | 1350 ++++++++ StraySrc/SDLS/DLLManager/s/dllmdump | 211 ++ StraySrc/SDLS/DLLManager/s/misc | 393 +++ StraySrc/SDLS/DLLManager/s/suballoc | 150 + StraySrc/SDLS/DLLManager/sh/app | 55 + StraySrc/SDLS/DLLManager/sh/appblock | 45 + StraySrc/SDLS/DLLManager/sh/dll | 51 + StraySrc/SDLS/DLLManager/sh/dllblock | 76 + StraySrc/SDLS/DLLManager/sh/linkblock | 39 + StraySrc/SDLS/DLLManager/sh/messages | 60 + StraySrc/SDLS/DLLManager/sh/misc | 36 + StraySrc/SDLS/DLLManager/sh/suballoc | 31 + StraySrc/SDLS/DLLManager/sh/wSpace | 59 + StraySrc/SDLS/Makefile,fe1 | 100 + StraySrc/SDLS/cdll/Makefile,fe1 | 184 ++ StraySrc/SDLS/cdll/c/binding | 417 +++ StraySrc/SDLS/cdll/c/cstub | 344 +++ StraySrc/SDLS/cdll/c/decode | 231 ++ StraySrc/SDLS/cdll/c/dissect | 265 ++ StraySrc/SDLS/cdll/c/dllbinder | 328 ++ StraySrc/SDLS/cdll/c/error | 102 + StraySrc/SDLS/cdll/c/extentry | 180 ++ StraySrc/SDLS/cdll/c/hashtable | 220 ++ StraySrc/SDLS/cdll/c/readdef | 455 +++ StraySrc/SDLS/cdll/h/binding | 41 + StraySrc/SDLS/cdll/h/crc32 | 57 + StraySrc/SDLS/cdll/h/cstub | 41 + StraySrc/SDLS/cdll/h/decode | 38 + StraySrc/SDLS/cdll/h/error | 149 + StraySrc/SDLS/cdll/h/extentry | 41 + StraySrc/SDLS/cdll/h/hashtable | 52 + StraySrc/SDLS/cdll/h/readdef | 66 + StraySrc/SDLS/cdll/ordinal | 24 + StraySrc/SDLS/cdll/s/crc32 | 168 + StraySrc/SapphToys/!CApp/!Run,feb | 14 + StraySrc/SapphToys/!CApp/Makefile,fe1 | 115 + StraySrc/SapphToys/!CApp/UK | 9 + StraySrc/SapphToys/!CApp/c/capp | 173 ++ StraySrc/SapphToys/!ColDemo/!Run,feb | 32 + StraySrc/SapphToys/!ColDemo/Resources/Messages | 104 + StraySrc/SapphToys/!ColDemo/Resources/Sprites,ff9 | Bin 0 -> 6724 bytes .../SapphToys/!ColDemo/Resources/Templates,fec | Bin 0 -> 4859 bytes StraySrc/SapphToys/!ColDemo/_Makefile,fe1 | 118 + StraySrc/SapphToys/!ColDemo/s/colSelect | 461 +++ StraySrc/SapphToys/!ColDemo/s/hsv | 958 ++++++ StraySrc/SapphToys/!ColDemo/s/rgb | 1602 ++++++++++ StraySrc/SapphToys/!DrawX/!Boot,feb | 12 + StraySrc/SapphToys/!DrawX/!Help | 74 + StraySrc/SapphToys/!DrawX/!Run,feb | 34 + StraySrc/SapphToys/!DrawX/!Sprites,ff9 | Bin 0 -> 1892 bytes StraySrc/SapphToys/!DrawX/Choices | 7 + StraySrc/SapphToys/!DrawX/Makefile,fe1 | 373 +++ StraySrc/SapphToys/!DrawX/Resources/Messages | 74 + StraySrc/SapphToys/!DrawX/Resources/Sprites,ff9 | Bin 0 -> 444 bytes StraySrc/SapphToys/!DrawX/Resources/Templates,fec | Bin 0 -> 1494 bytes StraySrc/SapphToys/!DrawX/s/drawX | 2192 +++++++++++++ StraySrc/SapphToys/!SWIlist/!Help | 191 ++ StraySrc/SapphToys/!SWIlist/!Run,feb | 30 + StraySrc/SapphToys/!SWIlist/!Sprites,ff9 | Bin 0 -> 736 bytes StraySrc/SapphToys/!SWIlist/Format | 76 + StraySrc/SapphToys/!SWIlist/Makefile,fe1 | 107 + StraySrc/SapphToys/!SWIlist/UK | 64 + StraySrc/SapphToys/!SWIlist/bs/swiList,ffb | Bin 0 -> 93964 bytes StraySrc/SapphToys/Makefile,fe1 | 100 + StraySrc/Sculptrix/!SConfig/!Run,feb | 2 + StraySrc/Sculptrix/!SConfig/Makefile,fe1 | 109 + StraySrc/Sculptrix/!SConfig/s/loadConfig | 269 ++ StraySrc/Sculptrix/!Setrix/!Help | 41 + StraySrc/Sculptrix/!Setrix/!Run,feb | 30 + StraySrc/Sculptrix/!Setrix/!Sprites,ff9 | Bin 0 -> 1144 bytes StraySrc/Sculptrix/!Setrix/Makefile,fe1 | 282 ++ StraySrc/Sculptrix/!Setrix/Resources/Messages | 114 + StraySrc/Sculptrix/!Setrix/Resources/Sprites,ff9 | Bin 0 -> 2972 bytes StraySrc/Sculptrix/!Setrix/Resources/Templates,fec | Bin 0 -> 1583 bytes StraySrc/Sculptrix/!Setrix/s/setrix | 1150 +++++++ StraySrc/Sculptrix/Changes | 76 + StraySrc/Sculptrix/Makefile,fe1 | 100 + StraySrc/Sculptrix/NewVersion | 177 ++ StraySrc/Sculptrix/README | 115 + StraySrc/Sculptrix/apcs/Makefile,fe1 | 104 + StraySrc/Sculptrix/apcs/h/sculptrix | 309 ++ StraySrc/Sculptrix/apcs/s/scp_apcs | 161 + StraySrc/Sculptrix/old-vsn/README | 14 + StraySrc/Sculptrix/old-vsn/s/sculptrix | 2250 ++++++++++++++ StraySrc/Sculptrix/sculptrix/Makefile,fe1 | 192 ++ StraySrc/Sculptrix/sculptrix/rsc/messages | 21 + StraySrc/Sculptrix/sculptrix/s/bbox | 106 + StraySrc/Sculptrix/sculptrix/s/border | 330 ++ StraySrc/Sculptrix/sculptrix/s/colours | 138 + StraySrc/Sculptrix/sculptrix/s/config | 215 ++ StraySrc/Sculptrix/sculptrix/s/plot | 616 ++++ StraySrc/Sculptrix/sculptrix/s/redraw | 362 +++ StraySrc/Sculptrix/sculptrix/s/rules | 365 +++ StraySrc/Sculptrix/sculptrix/s/sculptrix | 280 ++ StraySrc/Sculptrix/sculptrix/s/slab | 278 ++ StraySrc/Sculptrix/sculptrix/s/utils | 107 + StraySrc/Sculptrix/sculptrix/s/vString | 389 +++ StraySrc/Sculptrix/sculptrix/sh/bbox | 50 + StraySrc/Sculptrix/sculptrix/sh/border | 283 ++ StraySrc/Sculptrix/sculptrix/sh/colours | 64 + StraySrc/Sculptrix/sculptrix/sh/config | 72 + StraySrc/Sculptrix/sculptrix/sh/messages | 17 + StraySrc/Sculptrix/sculptrix/sh/plot | 82 + StraySrc/Sculptrix/sculptrix/sh/redraw | 88 + StraySrc/Sculptrix/sculptrix/sh/rules | 161 + StraySrc/Sculptrix/sculptrix/sh/slab | 87 + StraySrc/Sculptrix/sculptrix/sh/utils | 58 + StraySrc/Sculptrix/sculptrix/sh/vString | 107 + StraySrc/Sculptrix/sculptrix/sh/wSpace | 69 + StraySrc/Utilities/Makefile,fe1 | 311 ++ StraySrc/Utilities/b/buildstub,ffb | Bin 0 -> 3564 bytes StraySrc/Utilities/b/fixlink,ffb | Bin 0 -> 1681 bytes StraySrc/Utilities/b/msgaof,ffb | Bin 0 -> 4915 bytes StraySrc/Utilities/b/resgen,ffb | Bin 0 -> 9201 bytes StraySrc/Utilities/b/templaof,ffb | Bin 0 -> 7648 bytes StraySrc/Utilities/buildstub,ffb | Bin 0 -> 1508 bytes StraySrc/Utilities/c/alloc | 94 + StraySrc/Utilities/c/chdrgen | 303 ++ StraySrc/Utilities/c/cmdr | 126 + StraySrc/Utilities/c/each | 118 + StraySrc/Utilities/c/gf | 102 + StraySrc/Utilities/c/glob | 227 ++ StraySrc/Utilities/c/headerGen | 217 ++ StraySrc/Utilities/c/inst | 130 + StraySrc/Utilities/c/setdate | 316 ++ StraySrc/Utilities/c/ssrclean | 98 + StraySrc/Utilities/c/submake | 161 + StraySrc/Utilities/ex/buildstub | 61 + StraySrc/Utilities/ex/msgaof | 59 + StraySrc/Utilities/ex/resgen | 62 + StraySrc/Utilities/ex/templaof | 57 + StraySrc/Utilities/fixlink,ffb | Bin 0 -> 424 bytes StraySrc/Utilities/h/alloc | 81 + StraySrc/Utilities/h/cmdr | 55 + StraySrc/Utilities/h/gf | 80 + StraySrc/Utilities/h/glob | 58 + StraySrc/Utilities/msgaof,ffb | Bin 0 -> 2059 bytes StraySrc/Utilities/resgen,ffb | Bin 0 -> 4028 bytes StraySrc/Utilities/s/enumerate | 208 ++ StraySrc/Utilities/s/hour | 166 + StraySrc/Utilities/s/pathUtil | 282 ++ StraySrc/Utilities/s/path_util | 178 ++ StraySrc/Utilities/s/setSlot | 355 +++ StraySrc/Utilities/s/test | 612 ++++ StraySrc/Utilities/sh/pathUtil | 64 + StraySrc/Utilities/templaof,ffb | Bin 0 -> 3505 bytes StraySrc/dist/Core | 208 ++ StraySrc/dist/Dynamite | 34 + StraySrc/dist/Hammer | 20 + StraySrc/dist/MiscToys | 28 + StraySrc/dist/Quartz | 19 + StraySrc/dist/SDLS | 107 + StraySrc/dist/Sapphire | 416 +++ StraySrc/dist/Sculptrix | 77 + StraySrc/dist/dist | 1069 +++++++ StraySrc/dist/makeDist,feb | 8 + StraySrc/gplnote/Makefile,fe1 | 99 + StraySrc/gplnote/asm | 18 + StraySrc/gplnote/basic,ffb | Bin 0 -> 838 bytes StraySrc/gplnote/c | 19 + StraySrc/ssr-init,feb | 40 + StraySrc/ssr-order | 85 + dist/README | 104 + 903 files changed, 235471 insertions(+) create mode 100644 StraySrc/!DLLs/!Boot,feb create mode 100644 StraySrc/!DLLs/!Run,feb create mode 100644 StraySrc/!DLLs/!Sprites,ff9 create mode 100644 StraySrc/!DLLs/!Sprites22,ff9 create mode 100644 StraySrc/Announce create mode 100644 StraySrc/BuildTools create mode 100644 StraySrc/COPYING create mode 100644 StraySrc/Dynamite/Makefile,fe1 create mode 100644 StraySrc/Dynamite/apcs/Makefile,fe1 create mode 100644 StraySrc/Dynamite/apcs/h/dynamite create mode 100644 StraySrc/Dynamite/apcs/s/dyn_apcs create mode 100644 StraySrc/Dynamite/dynamite/Makefile,fe1 create mode 100644 StraySrc/Dynamite/dynamite/rsc/messages create mode 100644 StraySrc/Dynamite/dynamite/s/dynAnchor create mode 100644 StraySrc/Dynamite/dynamite/s/dynArea create mode 100644 StraySrc/Dynamite/dynamite/s/dynHeap create mode 100644 StraySrc/Dynamite/dynamite/s/dynTask create mode 100644 StraySrc/Dynamite/dynamite/s/dynamite create mode 100644 StraySrc/Dynamite/dynamite/s/fastMove create mode 100644 StraySrc/Dynamite/dynamite/sh/dynAnchor create mode 100644 StraySrc/Dynamite/dynamite/sh/dynArea create mode 100644 StraySrc/Dynamite/dynamite/sh/dynHeap create mode 100644 StraySrc/Dynamite/dynamite/sh/dynTask create mode 100644 StraySrc/Dynamite/dynamite/sh/messages create mode 100644 StraySrc/Dynamite/dynamite/sh/wSpace create mode 100644 StraySrc/Glass/!Glass/!Boot,feb create mode 100644 StraySrc/Glass/!Glass/!Help create mode 100644 StraySrc/Glass/!Glass/!Run,feb create mode 100644 StraySrc/Glass/!Glass/!Sprites,ff9 create mode 100644 StraySrc/Glass/!Glass/Choices create mode 100644 StraySrc/Glass/!Glass/Defaults/Templates,fec create mode 100644 StraySrc/Glass/!Glass/Makefile,fe1 create mode 100644 StraySrc/Glass/!Glass/Resources/LoadSpr,ff9 create mode 100644 StraySrc/Glass/!Glass/Resources/LoadTpl,fec create mode 100644 StraySrc/Glass/!Glass/Resources/Messages create mode 100644 StraySrc/Glass/!Glass/Resources/Sprites,ff9 create mode 100644 StraySrc/Glass/!Glass/Resources/Templates,fec create mode 100644 StraySrc/Glass/!Glass/c/align create mode 100644 StraySrc/Glass/!Glass/c/colSelect create mode 100644 StraySrc/Glass/!Glass/c/editIcon create mode 100644 StraySrc/Glass/!Glass/c/editWin create mode 100644 StraySrc/Glass/!Glass/c/gPrefs create mode 100644 StraySrc/Glass/!Glass/c/gSprite create mode 100644 StraySrc/Glass/!Glass/c/glass create mode 100644 StraySrc/Glass/!Glass/c/iconData create mode 100644 StraySrc/Glass/!Glass/c/indir create mode 100644 StraySrc/Glass/!Glass/c/intMsgs create mode 100644 StraySrc/Glass/!Glass/c/tearEdit create mode 100644 StraySrc/Glass/!Glass/c/tfile create mode 100644 StraySrc/Glass/!Glass/c/toolbox create mode 100644 StraySrc/Glass/!Glass/c/wDragging create mode 100644 StraySrc/Glass/!Glass/c/wGrab create mode 100644 StraySrc/Glass/!Glass/c/wGraph create mode 100644 StraySrc/Glass/!Glass/c/wIcons create mode 100644 StraySrc/Glass/!Glass/c/wMenus create mode 100644 StraySrc/Glass/!Glass/c/wMousePtr create mode 100644 StraySrc/Glass/!Glass/c/wPalette create mode 100644 StraySrc/Glass/!Glass/c/wRedraw create mode 100644 StraySrc/Glass/!Glass/c/wSelect create mode 100644 StraySrc/Glass/!Glass/c/wToolbars create mode 100644 StraySrc/Glass/!Glass/c/wWinEvent create mode 100644 StraySrc/Glass/!Glass/c/wWindows create mode 100644 StraySrc/Glass/!Glass/c/window create mode 100644 StraySrc/Glass/!Glass/h/_window create mode 100644 StraySrc/Glass/!Glass/h/align create mode 100644 StraySrc/Glass/!Glass/h/colSelect create mode 100644 StraySrc/Glass/!Glass/h/editIcon create mode 100644 StraySrc/Glass/!Glass/h/editWin create mode 100644 StraySrc/Glass/!Glass/h/gIcons create mode 100644 StraySrc/Glass/!Glass/h/gMenus create mode 100644 StraySrc/Glass/!Glass/h/gPrefs create mode 100644 StraySrc/Glass/!Glass/h/gSprite create mode 100644 StraySrc/Glass/!Glass/h/gStruct create mode 100644 StraySrc/Glass/!Glass/h/glass create mode 100644 StraySrc/Glass/!Glass/h/iconData create mode 100644 StraySrc/Glass/!Glass/h/indir create mode 100644 StraySrc/Glass/!Glass/h/intMsgs create mode 100644 StraySrc/Glass/!Glass/h/tearEdit create mode 100644 StraySrc/Glass/!Glass/h/tfile create mode 100644 StraySrc/Glass/!Glass/h/toolbox create mode 100644 StraySrc/Glass/!Glass/h/window create mode 100644 StraySrc/Glass/!Glass/s/toolSupprt create mode 100644 StraySrc/Hammer/Makefile,fe1 create mode 100644 StraySrc/Hammer/s/armEmul create mode 100644 StraySrc/Hammer/s/asm create mode 100644 StraySrc/Hammer/s/brkpt create mode 100644 StraySrc/Hammer/s/diss create mode 100644 StraySrc/Hammer/s/driver create mode 100644 StraySrc/Hammer/s/hammer create mode 100644 StraySrc/Hammer/sh/armEmul create mode 100644 StraySrc/Hammer/sh/asm create mode 100644 StraySrc/Hammer/sh/brkpt create mode 100644 StraySrc/Hammer/sh/diss create mode 100644 StraySrc/Hammer/sh/driver create mode 100644 StraySrc/Hammer/sh/hammer create mode 100644 StraySrc/Libraries/BAS/Makefile,fe1 create mode 100644 StraySrc/Libraries/BAS/exports create mode 100644 StraySrc/Libraries/BAS/src/Makefile,fe1 create mode 100644 StraySrc/Libraries/BAS/src/README create mode 100644 StraySrc/Libraries/BAS/src/b/bas,ffb create mode 100644 StraySrc/Libraries/BAS/src/rsc/messages create mode 100644 StraySrc/Libraries/BAS/src/s/aofGen create mode 100644 StraySrc/Libraries/BAS/src/s/bas create mode 100644 StraySrc/Libraries/BAS/src/s/basTalk create mode 100644 StraySrc/Libraries/BAS/src/s/fastMove create mode 100644 StraySrc/Libraries/BAS/src/s/flex create mode 100644 StraySrc/Libraries/BAS/src/s/get create mode 100644 StraySrc/Libraries/BAS/src/s/insert create mode 100644 StraySrc/Libraries/BAS/src/s/lit create mode 100644 StraySrc/Libraries/BAS/src/s/string create mode 100644 StraySrc/Libraries/BAS/src/s/vars create mode 100644 StraySrc/Libraries/BAS/src/scripts/crunchit,feb create mode 100644 StraySrc/Libraries/BAS/src/scripts/execit,ffe create mode 100644 StraySrc/Libraries/BAS/src/scripts/exports create mode 100644 StraySrc/Libraries/BAS/src/scripts/preproc create mode 100644 StraySrc/Libraries/BAS/src/sh/aofGen create mode 100644 StraySrc/Libraries/BAS/src/sh/bas create mode 100644 StraySrc/Libraries/BAS/src/sh/basTalk create mode 100644 StraySrc/Libraries/BAS/src/sh/basicEnv create mode 100644 StraySrc/Libraries/BAS/src/sh/fastMove create mode 100644 StraySrc/Libraries/BAS/src/sh/flex create mode 100644 StraySrc/Libraries/BAS/src/sh/get create mode 100644 StraySrc/Libraries/BAS/src/sh/insert create mode 100644 StraySrc/Libraries/BAS/src/sh/lit create mode 100644 StraySrc/Libraries/BAS/src/sh/messages create mode 100644 StraySrc/Libraries/BAS/src/sh/string create mode 100644 StraySrc/Libraries/BAS/src/sh/vars create mode 100644 StraySrc/Libraries/BAS/src/sh/workspace create mode 100644 StraySrc/Libraries/Core/AOF/Makefile,fe1 create mode 100644 StraySrc/Libraries/Core/AOF/README create mode 100644 StraySrc/Libraries/Core/AOF/c/aof create mode 100644 StraySrc/Libraries/Core/AOF/h/alf create mode 100644 StraySrc/Libraries/Core/AOF/h/aof create mode 100644 StraySrc/Libraries/Core/AOF/h/chunk create mode 100644 StraySrc/Libraries/Core/EmbTemp/Makefile,fe1 create mode 100644 StraySrc/Libraries/Core/EmbTemp/README create mode 100644 StraySrc/Libraries/Core/EmbTemp/s/embTemp create mode 100644 StraySrc/Libraries/Core/EmbTemp/sh/embTemp create mode 100644 StraySrc/Libraries/Core/Makefile,fe1 create mode 100644 StraySrc/Libraries/Core/TearSupt/Makefile,fe1 create mode 100644 StraySrc/Libraries/Core/TearSupt/README create mode 100644 StraySrc/Libraries/Core/TearSupt/UnLoad,ffb create mode 100644 StraySrc/Libraries/Core/TearSupt/bs/tearSupt,ffb create mode 100644 StraySrc/Libraries/Core/TearSupt/h/tearSupt create mode 100644 StraySrc/Libraries/Core/TearSupt/s/tt create mode 100644 StraySrc/Libraries/Core/TearSupt/sh/tearSupt create mode 100644 StraySrc/Libraries/Core/dump create mode 100644 StraySrc/Libraries/Core/h/_time create mode 100644 StraySrc/Libraries/Core/h/swis create mode 100644 StraySrc/Libraries/Core/h/swiv create mode 100644 StraySrc/Libraries/Core/header create mode 100644 StraySrc/Libraries/Core/s/fastMove create mode 100644 StraySrc/Libraries/Core/s/flex create mode 100644 StraySrc/Libraries/Core/s/heap create mode 100644 StraySrc/Libraries/Core/s/oxswi create mode 100644 StraySrc/Libraries/Core/s/rdump create mode 100644 StraySrc/Libraries/Core/s/swihack create mode 100644 StraySrc/Libraries/Core/s/swiv create mode 100644 StraySrc/Libraries/Core/s/xapp create mode 100644 StraySrc/Libraries/Core/s/xcommon create mode 100644 StraySrc/Libraries/Core/s/xdata create mode 100644 StraySrc/Libraries/Core/s/xdll create mode 100644 StraySrc/Libraries/Core/s/xentry create mode 100644 StraySrc/Libraries/Core/s/xentry_swi create mode 100644 StraySrc/Libraries/Core/s/xmodule create mode 100644 StraySrc/Libraries/Core/s/xsmall create mode 100644 StraySrc/Libraries/Core/s/xsmall_swi create mode 100644 StraySrc/Libraries/Core/s/xswi create mode 100644 StraySrc/Libraries/Core/sh/fastMove create mode 100644 StraySrc/Libraries/Core/sh/flex create mode 100644 StraySrc/Libraries/Core/sh/flexws create mode 100644 StraySrc/Libraries/Core/sh/heapws create mode 100644 StraySrc/Libraries/Core/stream create mode 100644 StraySrc/Libraries/Core/swis create mode 100644 StraySrc/Libraries/DLLLib/Makefile,fe1 create mode 100644 StraySrc/Libraries/DLLLib/h/ctype create mode 100644 StraySrc/Libraries/DLLLib/h/dll create mode 100644 StraySrc/Libraries/DLLLib/h/errno create mode 100644 StraySrc/Libraries/DLLLib/h/math create mode 100644 StraySrc/Libraries/DLLLib/h/stdio create mode 100644 StraySrc/Libraries/DLLLib/h/swiv create mode 100644 StraySrc/Libraries/DLLLib/s/appEntry create mode 100644 StraySrc/Libraries/DLLLib/s/clib create mode 100644 StraySrc/Libraries/DLLLib/s/dpoll create mode 100644 StraySrc/Libraries/DLLLib/s/dsetjmp create mode 100644 StraySrc/Libraries/DLLLib/s/extEntry create mode 100644 StraySrc/Libraries/DLLLib/s/findAll create mode 100644 StraySrc/Libraries/DLLLib/s/iface create mode 100644 StraySrc/Libraries/DLLLib/s/loadLocal create mode 100644 StraySrc/Libraries/DLLLib/s/oscli create mode 100644 StraySrc/Libraries/DLLLib/s/wSpace create mode 100644 StraySrc/Libraries/DLLLib/sh/dllswis create mode 100644 StraySrc/Libraries/Makefile,fe1 create mode 100644 StraySrc/Libraries/Quartz/Makefile,fe1 create mode 100644 StraySrc/Libraries/Quartz/s/fastMove create mode 100644 StraySrc/Libraries/Quartz/s/kernel create mode 100644 StraySrc/Libraries/Quartz/s/screen create mode 100644 StraySrc/Libraries/Quartz/s/string create mode 100644 StraySrc/Libraries/Quartz/sh/!FilerConf,050 create mode 100644 StraySrc/Libraries/Quartz/sh/fastMove create mode 100644 StraySrc/Libraries/Quartz/sh/quartz create mode 100644 StraySrc/Libraries/Quartz/sh/screen create mode 100644 StraySrc/Libraries/Quartz/sh/string create mode 100644 StraySrc/Libraries/Sapphire/Makefile,fe1 create mode 100644 StraySrc/Libraries/Sapphire/Modules/Docs/Sprinkle create mode 100644 StraySrc/Libraries/Sapphire/Modules/Makefile,fe1 create mode 100644 StraySrc/Libraries/Sapphire/Modules/s/constrain create mode 100644 StraySrc/Libraries/Sapphire/Modules/s/sprinkle create mode 100644 StraySrc/Libraries/Sapphire/README create mode 100644 StraySrc/Libraries/Sapphire/bs/fixedPt,ffb create mode 100644 StraySrc/Libraries/Sapphire/bsh/banner,ffb create mode 100644 StraySrc/Libraries/Sapphire/bsh/dbx,ffb create mode 100644 StraySrc/Libraries/Sapphire/bsh/flex,ffb create mode 100644 StraySrc/Libraries/Sapphire/bsh/libOpts,ffb create mode 100644 StraySrc/Libraries/Sapphire/bsh/menuDefs,ffb create mode 100644 StraySrc/Libraries/Sapphire/bsh/options,ffb create mode 100644 StraySrc/Libraries/Sapphire/bsh/stdDbox,ffb create mode 100644 StraySrc/Libraries/Sapphire/choices/s/choices create mode 100644 StraySrc/Libraries/Sapphire/choices/s/options create mode 100644 StraySrc/Libraries/Sapphire/choices/s/prefs create mode 100644 StraySrc/Libraries/Sapphire/colSelect/s/colSelect create mode 100644 StraySrc/Libraries/Sapphire/colSelect/s/hsv create mode 100644 StraySrc/Libraries/Sapphire/colSelect/s/rgb create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/akbd create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/alloc create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/banner create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/buttons create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/choices/choices create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/choices/options create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/choices/prefs create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/chunk create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/cmdLine create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/coRoutine create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/colSelect create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/colourBox create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbox create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbx/arrow create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbx/colourPot create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbx/dbx create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbx/fileIcon create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbx/numWrite create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbx/slider create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dbx/stringSet create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/defHandler create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/divide create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/drag create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/draw create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/dynPtr create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/errorBox create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/event create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/except create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/fastMove create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/fixedPt create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/flex create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/fontmenu create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/gallery create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/heap create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/help create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/hour create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/ibicon create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/idle create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/intKeys create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/keyMap create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/keyString create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/libOpts create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/listbox create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/llistMan create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/mbox create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/mem create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/menu create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/menuDefs create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/msgs create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/nopoll create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/note create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/pane create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/progInfo create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/ptr create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/rand create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/repeater create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/report create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/res create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/resources create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/resspr create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/roVersion create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/sapphire create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/saveWarn create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/screen create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/seh create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/sprite create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/sqrt create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/string create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/subAlloc create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/template create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/thread create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/tms create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/transWin create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/tspr create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/viewer create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/warning create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/wimp create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/win create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/winUtils create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/writable create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/xfer/load create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/xfer/save create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/xfer/saveAs create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/xfer/xload create mode 100644 StraySrc/Libraries/Sapphire/csapph/h/xfer/xsave create mode 100644 StraySrc/Libraries/Sapphire/csapph/s/cmath create mode 100644 StraySrc/Libraries/Sapphire/csapph/s/crout create mode 100644 StraySrc/Libraries/Sapphire/csapph/s/crts create mode 100644 StraySrc/Libraries/Sapphire/csapph/s/csapph create mode 100644 StraySrc/Libraries/Sapphire/csapph/s/csetjmp create mode 100644 StraySrc/Libraries/Sapphire/csapph/s/cstart create mode 100644 StraySrc/Libraries/Sapphire/csapph/s/ctype create mode 100644 StraySrc/Libraries/Sapphire/dbx/s/arrow create mode 100644 StraySrc/Libraries/Sapphire/dbx/s/colourPot create mode 100644 StraySrc/Libraries/Sapphire/dbx/s/dbx create mode 100644 StraySrc/Libraries/Sapphire/dbx/s/fileIcon create mode 100644 StraySrc/Libraries/Sapphire/dbx/s/numWrite create mode 100644 StraySrc/Libraries/Sapphire/dbx/s/slider create mode 100644 StraySrc/Libraries/Sapphire/dbx/s/stringSet create mode 100644 StraySrc/Libraries/Sapphire/def/csapph create mode 100644 StraySrc/Libraries/Sapphire/def/list create mode 100644 StraySrc/Libraries/Sapphire/def/resources create mode 100644 StraySrc/Libraries/Sapphire/def/tearoff create mode 100644 StraySrc/Libraries/Sapphire/def/thread create mode 100644 StraySrc/Libraries/Sapphire/rsc/ColourSel,fec create mode 100644 StraySrc/Libraries/Sapphire/rsc/Messages create mode 100644 StraySrc/Libraries/Sapphire/rsc/Sprites,ff9 create mode 100644 StraySrc/Libraries/Sapphire/rsc/Templates,fec create mode 100644 StraySrc/Libraries/Sapphire/s/akbd create mode 100644 StraySrc/Libraries/Sapphire/s/alloc create mode 100644 StraySrc/Libraries/Sapphire/s/banner create mode 100644 StraySrc/Libraries/Sapphire/s/bnrStub create mode 100644 StraySrc/Libraries/Sapphire/s/buttons create mode 100644 StraySrc/Libraries/Sapphire/s/chunk create mode 100644 StraySrc/Libraries/Sapphire/s/cmdLine create mode 100644 StraySrc/Libraries/Sapphire/s/coRoutine create mode 100644 StraySrc/Libraries/Sapphire/s/colourBox create mode 100644 StraySrc/Libraries/Sapphire/s/dBanner create mode 100644 StraySrc/Libraries/Sapphire/s/dKernel create mode 100644 StraySrc/Libraries/Sapphire/s/dbox create mode 100644 StraySrc/Libraries/Sapphire/s/defHandler create mode 100644 StraySrc/Libraries/Sapphire/s/divide create mode 100644 StraySrc/Libraries/Sapphire/s/drag create mode 100644 StraySrc/Libraries/Sapphire/s/draw create mode 100644 StraySrc/Libraries/Sapphire/s/dynPtr create mode 100644 StraySrc/Libraries/Sapphire/s/errorBox create mode 100644 StraySrc/Libraries/Sapphire/s/event create mode 100644 StraySrc/Libraries/Sapphire/s/except create mode 100644 StraySrc/Libraries/Sapphire/s/fastMove create mode 100644 StraySrc/Libraries/Sapphire/s/flex create mode 100644 StraySrc/Libraries/Sapphire/s/fontMenu create mode 100644 StraySrc/Libraries/Sapphire/s/gallery create mode 100644 StraySrc/Libraries/Sapphire/s/heap create mode 100644 StraySrc/Libraries/Sapphire/s/help create mode 100644 StraySrc/Libraries/Sapphire/s/hour create mode 100644 StraySrc/Libraries/Sapphire/s/ibicon create mode 100644 StraySrc/Libraries/Sapphire/s/idle create mode 100644 StraySrc/Libraries/Sapphire/s/kernel create mode 100644 StraySrc/Libraries/Sapphire/s/keyString create mode 100644 StraySrc/Libraries/Sapphire/s/libOpts create mode 100644 StraySrc/Libraries/Sapphire/s/listbox create mode 100644 StraySrc/Libraries/Sapphire/s/llistMan create mode 100644 StraySrc/Libraries/Sapphire/s/llistStub create mode 100644 StraySrc/Libraries/Sapphire/s/mbox create mode 100644 StraySrc/Libraries/Sapphire/s/mem create mode 100644 StraySrc/Libraries/Sapphire/s/menu create mode 100644 StraySrc/Libraries/Sapphire/s/msgs create mode 100644 StraySrc/Libraries/Sapphire/s/nopoll create mode 100644 StraySrc/Libraries/Sapphire/s/note create mode 100644 StraySrc/Libraries/Sapphire/s/pane create mode 100644 StraySrc/Libraries/Sapphire/s/progInfo create mode 100644 StraySrc/Libraries/Sapphire/s/ptr create mode 100644 StraySrc/Libraries/Sapphire/s/rand create mode 100644 StraySrc/Libraries/Sapphire/s/repeater create mode 100644 StraySrc/Libraries/Sapphire/s/report create mode 100644 StraySrc/Libraries/Sapphire/s/res create mode 100644 StraySrc/Libraries/Sapphire/s/resources create mode 100644 StraySrc/Libraries/Sapphire/s/resspr create mode 100644 StraySrc/Libraries/Sapphire/s/roVersion create mode 100644 StraySrc/Libraries/Sapphire/s/sapphRes create mode 100644 StraySrc/Libraries/Sapphire/s/saveWarn create mode 100644 StraySrc/Libraries/Sapphire/s/screen create mode 100644 StraySrc/Libraries/Sapphire/s/seh create mode 100644 StraySrc/Libraries/Sapphire/s/sprite create mode 100644 StraySrc/Libraries/Sapphire/s/sqrt create mode 100644 StraySrc/Libraries/Sapphire/s/string create mode 100644 StraySrc/Libraries/Sapphire/s/stub create mode 100644 StraySrc/Libraries/Sapphire/s/subAlloc create mode 100644 StraySrc/Libraries/Sapphire/s/template create mode 100644 StraySrc/Libraries/Sapphire/s/thread create mode 100644 StraySrc/Libraries/Sapphire/s/transWin create mode 100644 StraySrc/Libraries/Sapphire/s/tspr create mode 100644 StraySrc/Libraries/Sapphire/s/viewer create mode 100644 StraySrc/Libraries/Sapphire/s/warning create mode 100644 StraySrc/Libraries/Sapphire/s/wimp create mode 100644 StraySrc/Libraries/Sapphire/s/win create mode 100644 StraySrc/Libraries/Sapphire/s/winUtils create mode 100644 StraySrc/Libraries/Sapphire/s/writable create mode 100644 StraySrc/Libraries/Sapphire/sail/Changes create mode 100644 StraySrc/Libraries/Sapphire/sail/Makefile,fe1 create mode 100644 StraySrc/Libraries/Sapphire/sail/SAILInfo create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/ctrl create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/driver create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/error create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/express create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/getToken create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/interp create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/strBucket create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/stracc create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/termScript create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/termite create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/tokenise create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/tree create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/value create mode 100644 StraySrc/Libraries/Sapphire/sail/_s/var create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/anchor create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/ctrl create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/divide create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/errNum create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/errTable create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/error create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/express create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/getToken create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/interp create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/mem create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/strBucket create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/stracc create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/termScript create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/termite create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/tokClasses create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/tokNames create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/tokTable create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/tokenise create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/tokens create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/tree create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/upcalls create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/value create mode 100644 StraySrc/Libraries/Sapphire/sail/_sh/var create mode 100644 StraySrc/Libraries/Sapphire/sail/errgen,ffb create mode 100644 StraySrc/Libraries/Sapphire/sail/s/ctrl create mode 100644 StraySrc/Libraries/Sapphire/sail/s/driver create mode 100644 StraySrc/Libraries/Sapphire/sail/s/env create mode 100644 StraySrc/Libraries/Sapphire/sail/s/error create mode 100644 StraySrc/Libraries/Sapphire/sail/s/express create mode 100644 StraySrc/Libraries/Sapphire/sail/s/getToken create mode 100644 StraySrc/Libraries/Sapphire/sail/s/interp create mode 100644 StraySrc/Libraries/Sapphire/sail/s/mem create mode 100644 StraySrc/Libraries/Sapphire/sail/s/sail create mode 100644 StraySrc/Libraries/Sapphire/sail/s/strBucket create mode 100644 StraySrc/Libraries/Sapphire/sail/s/stracc create mode 100644 StraySrc/Libraries/Sapphire/sail/s/termScript create mode 100644 StraySrc/Libraries/Sapphire/sail/s/termite create mode 100644 StraySrc/Libraries/Sapphire/sail/s/tokenise create mode 100644 StraySrc/Libraries/Sapphire/sail/s/tree create mode 100644 StraySrc/Libraries/Sapphire/sail/s/value create mode 100644 StraySrc/Libraries/Sapphire/sail/s/var create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/anchor create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/ctrl create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/divide create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/errNum create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/errTable create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/error create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/express create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/getToken create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/interp create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/mem create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/strBucket create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/stracc create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/termScript create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/termite create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/tokClasses create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/tokNames create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/tokTable create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/tokenise create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/tokens create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/tree create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/upcalls create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/value create mode 100644 StraySrc/Libraries/Sapphire/sail/sh/var create mode 100644 StraySrc/Libraries/Sapphire/sail/tableGen,ffb create mode 100644 StraySrc/Libraries/Sapphire/sh/_colSelect/kernel create mode 100644 StraySrc/Libraries/Sapphire/sh/_colSelect/models create mode 100644 StraySrc/Libraries/Sapphire/sh/_colSelect/vars create mode 100644 StraySrc/Libraries/Sapphire/sh/_tms/tmsCreate create mode 100644 StraySrc/Libraries/Sapphire/sh/_tms/tmsGlobal create mode 100644 StraySrc/Libraries/Sapphire/sh/_tms/tmsGlue create mode 100644 StraySrc/Libraries/Sapphire/sh/_tms/tmsMain create mode 100644 StraySrc/Libraries/Sapphire/sh/akbd create mode 100644 StraySrc/Libraries/Sapphire/sh/alloc create mode 100644 StraySrc/Libraries/Sapphire/sh/banner create mode 100644 StraySrc/Libraries/Sapphire/sh/buttons create mode 100644 StraySrc/Libraries/Sapphire/sh/choices/choices create mode 100644 StraySrc/Libraries/Sapphire/sh/choices/options create mode 100644 StraySrc/Libraries/Sapphire/sh/choices/prefs create mode 100644 StraySrc/Libraries/Sapphire/sh/chunk create mode 100644 StraySrc/Libraries/Sapphire/sh/cmdLine create mode 100644 StraySrc/Libraries/Sapphire/sh/coRoutine create mode 100644 StraySrc/Libraries/Sapphire/sh/colSelect create mode 100644 StraySrc/Libraries/Sapphire/sh/colourBox create mode 100644 StraySrc/Libraries/Sapphire/sh/dbox create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/_dbxMacs create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/arrow create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/colourPot create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/dbx create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/fileIcon create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/numWrite create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/slider create mode 100644 StraySrc/Libraries/Sapphire/sh/dbx/stringSet create mode 100644 StraySrc/Libraries/Sapphire/sh/defHandler create mode 100644 StraySrc/Libraries/Sapphire/sh/divide create mode 100644 StraySrc/Libraries/Sapphire/sh/drag create mode 100644 StraySrc/Libraries/Sapphire/sh/draw create mode 100644 StraySrc/Libraries/Sapphire/sh/dynPtr create mode 100644 StraySrc/Libraries/Sapphire/sh/errorBox create mode 100644 StraySrc/Libraries/Sapphire/sh/event create mode 100644 StraySrc/Libraries/Sapphire/sh/except create mode 100644 StraySrc/Libraries/Sapphire/sh/fastMove create mode 100644 StraySrc/Libraries/Sapphire/sh/fixedPt create mode 100644 StraySrc/Libraries/Sapphire/sh/flex create mode 100644 StraySrc/Libraries/Sapphire/sh/fontmenu create mode 100644 StraySrc/Libraries/Sapphire/sh/gallery create mode 100644 StraySrc/Libraries/Sapphire/sh/heap create mode 100644 StraySrc/Libraries/Sapphire/sh/help create mode 100644 StraySrc/Libraries/Sapphire/sh/hour create mode 100644 StraySrc/Libraries/Sapphire/sh/ibicon create mode 100644 StraySrc/Libraries/Sapphire/sh/idle create mode 100644 StraySrc/Libraries/Sapphire/sh/intKeys create mode 100644 StraySrc/Libraries/Sapphire/sh/keyMap create mode 100644 StraySrc/Libraries/Sapphire/sh/keyString create mode 100644 StraySrc/Libraries/Sapphire/sh/libOpts create mode 100644 StraySrc/Libraries/Sapphire/sh/listbox create mode 100644 StraySrc/Libraries/Sapphire/sh/llistMan create mode 100644 StraySrc/Libraries/Sapphire/sh/mbox create mode 100644 StraySrc/Libraries/Sapphire/sh/mem create mode 100644 StraySrc/Libraries/Sapphire/sh/menu create mode 100644 StraySrc/Libraries/Sapphire/sh/menuDefs create mode 100644 StraySrc/Libraries/Sapphire/sh/msgs create mode 100644 StraySrc/Libraries/Sapphire/sh/ncs create mode 100644 StraySrc/Libraries/Sapphire/sh/nopoll create mode 100644 StraySrc/Libraries/Sapphire/sh/note create mode 100644 StraySrc/Libraries/Sapphire/sh/pane create mode 100644 StraySrc/Libraries/Sapphire/sh/progInfo create mode 100644 StraySrc/Libraries/Sapphire/sh/ptr create mode 100644 StraySrc/Libraries/Sapphire/sh/rand create mode 100644 StraySrc/Libraries/Sapphire/sh/repeater create mode 100644 StraySrc/Libraries/Sapphire/sh/report create mode 100644 StraySrc/Libraries/Sapphire/sh/res create mode 100644 StraySrc/Libraries/Sapphire/sh/resources create mode 100644 StraySrc/Libraries/Sapphire/sh/resspr create mode 100644 StraySrc/Libraries/Sapphire/sh/roVersion create mode 100644 StraySrc/Libraries/Sapphire/sh/sapphire create mode 100644 StraySrc/Libraries/Sapphire/sh/saveWarn create mode 100644 StraySrc/Libraries/Sapphire/sh/screen create mode 100644 StraySrc/Libraries/Sapphire/sh/seh create mode 100644 StraySrc/Libraries/Sapphire/sh/sprite create mode 100644 StraySrc/Libraries/Sapphire/sh/sqrt create mode 100644 StraySrc/Libraries/Sapphire/sh/string create mode 100644 StraySrc/Libraries/Sapphire/sh/subAlloc create mode 100644 StraySrc/Libraries/Sapphire/sh/template create mode 100644 StraySrc/Libraries/Sapphire/sh/thread create mode 100644 StraySrc/Libraries/Sapphire/sh/tms create mode 100644 StraySrc/Libraries/Sapphire/sh/transWin create mode 100644 StraySrc/Libraries/Sapphire/sh/tspr create mode 100644 StraySrc/Libraries/Sapphire/sh/viewer create mode 100644 StraySrc/Libraries/Sapphire/sh/warning create mode 100644 StraySrc/Libraries/Sapphire/sh/wimp create mode 100644 StraySrc/Libraries/Sapphire/sh/win create mode 100644 StraySrc/Libraries/Sapphire/sh/winUtils create mode 100644 StraySrc/Libraries/Sapphire/sh/writable create mode 100644 StraySrc/Libraries/Sapphire/sh/xfer/load create mode 100644 StraySrc/Libraries/Sapphire/sh/xfer/save create mode 100644 StraySrc/Libraries/Sapphire/sh/xfer/saveAs create mode 100644 StraySrc/Libraries/Sapphire/sh/xfer/xload create mode 100644 StraySrc/Libraries/Sapphire/sh/xfer/xsave create mode 100644 StraySrc/Libraries/Sapphire/tms/s/tmsCreate create mode 100644 StraySrc/Libraries/Sapphire/tms/s/tmsGlue create mode 100644 StraySrc/Libraries/Sapphire/tms/s/tmsMain create mode 100644 StraySrc/Libraries/Sapphire/xfer/s/load create mode 100644 StraySrc/Libraries/Sapphire/xfer/s/save create mode 100644 StraySrc/Libraries/Sapphire/xfer/s/saveAs create mode 100644 StraySrc/Libraries/Sapphire/xfer/s/xload create mode 100644 StraySrc/Libraries/Sapphire/xfer/s/xsave create mode 100644 StraySrc/Libraries/Steel/Makefile,fe1 create mode 100644 StraySrc/Libraries/Steel/Messages create mode 100644 StraySrc/Libraries/Steel/c/akbd create mode 100644 StraySrc/Libraries/Steel/c/alarm create mode 100644 StraySrc/Libraries/Steel/c/baricon create mode 100644 StraySrc/Libraries/Steel/c/blinkC create mode 100644 StraySrc/Libraries/Steel/c/buffer create mode 100644 StraySrc/Libraries/Steel/c/buttons create mode 100644 StraySrc/Libraries/Steel/c/caretptr create mode 100644 StraySrc/Libraries/Steel/c/choices create mode 100644 StraySrc/Libraries/Steel/c/crc create mode 100644 StraySrc/Libraries/Steel/c/creator create mode 100644 StraySrc/Libraries/Steel/c/dbox create mode 100644 StraySrc/Libraries/Steel/c/event create mode 100644 StraySrc/Libraries/Steel/c/exception create mode 100644 StraySrc/Libraries/Steel/c/fileicon create mode 100644 StraySrc/Libraries/Steel/c/font create mode 100644 StraySrc/Libraries/Steel/c/fontMenu create mode 100644 StraySrc/Libraries/Steel/c/help create mode 100644 StraySrc/Libraries/Steel/c/ibicon create mode 100644 StraySrc/Libraries/Steel/c/interface create mode 100644 StraySrc/Libraries/Steel/c/keyString create mode 100644 StraySrc/Libraries/Steel/c/listbox create mode 100644 StraySrc/Libraries/Steel/c/mem create mode 100644 StraySrc/Libraries/Steel/c/menu create mode 100644 StraySrc/Libraries/Steel/c/msgs create mode 100644 StraySrc/Libraries/Steel/c/nopoll create mode 100644 StraySrc/Libraries/Steel/c/pane create mode 100644 StraySrc/Libraries/Steel/c/pointer create mode 100644 StraySrc/Libraries/Steel/c/prefs create mode 100644 StraySrc/Libraries/Steel/c/print create mode 100644 StraySrc/Libraries/Steel/c/res create mode 100644 StraySrc/Libraries/Steel/c/resspr create mode 100644 StraySrc/Libraries/Steel/c/saveas create mode 100644 StraySrc/Libraries/Steel/c/scroller create mode 100644 StraySrc/Libraries/Steel/c/sprite create mode 100644 StraySrc/Libraries/Steel/c/stddbox create mode 100644 StraySrc/Libraries/Steel/c/tcol create mode 100644 StraySrc/Libraries/Steel/c/tearoff create mode 100644 StraySrc/Libraries/Steel/c/template create mode 100644 StraySrc/Libraries/Steel/c/utils create mode 100644 StraySrc/Libraries/Steel/c/viewer create mode 100644 StraySrc/Libraries/Steel/c/visdelay create mode 100644 StraySrc/Libraries/Steel/c/vsscanf create mode 100644 StraySrc/Libraries/Steel/c/werr create mode 100644 StraySrc/Libraries/Steel/c/wimpt create mode 100644 StraySrc/Libraries/Steel/c/win create mode 100644 StraySrc/Libraries/Steel/c/xferrecv create mode 100644 StraySrc/Libraries/Steel/c/xfersend create mode 100644 StraySrc/Libraries/Steel/c/xproginfo create mode 100644 StraySrc/Libraries/Steel/def/steel create mode 100644 StraySrc/Libraries/Steel/h/akbd create mode 100644 StraySrc/Libraries/Steel/h/alarm create mode 100644 StraySrc/Libraries/Steel/h/baricon create mode 100644 StraySrc/Libraries/Steel/h/bbc create mode 100644 StraySrc/Libraries/Steel/h/blinkC create mode 100644 StraySrc/Libraries/Steel/h/buffer create mode 100644 StraySrc/Libraries/Steel/h/buttons create mode 100644 StraySrc/Libraries/Steel/h/calltrace create mode 100644 StraySrc/Libraries/Steel/h/caretptr create mode 100644 StraySrc/Libraries/Steel/h/choices create mode 100644 StraySrc/Libraries/Steel/h/colourtran create mode 100644 StraySrc/Libraries/Steel/h/coords create mode 100644 StraySrc/Libraries/Steel/h/crc create mode 100644 StraySrc/Libraries/Steel/h/crc32 create mode 100644 StraySrc/Libraries/Steel/h/dbox create mode 100644 StraySrc/Libraries/Steel/h/event create mode 100644 StraySrc/Libraries/Steel/h/exception create mode 100644 StraySrc/Libraries/Steel/h/fileicon create mode 100644 StraySrc/Libraries/Steel/h/flex create mode 100644 StraySrc/Libraries/Steel/h/font create mode 100644 StraySrc/Libraries/Steel/h/fontMenu create mode 100644 StraySrc/Libraries/Steel/h/heap create mode 100644 StraySrc/Libraries/Steel/h/help create mode 100644 StraySrc/Libraries/Steel/h/ibicon create mode 100644 StraySrc/Libraries/Steel/h/interface create mode 100644 StraySrc/Libraries/Steel/h/keyString create mode 100644 StraySrc/Libraries/Steel/h/listbox create mode 100644 StraySrc/Libraries/Steel/h/mem create mode 100644 StraySrc/Libraries/Steel/h/menu create mode 100644 StraySrc/Libraries/Steel/h/menuExt create mode 100644 StraySrc/Libraries/Steel/h/msgs create mode 100644 StraySrc/Libraries/Steel/h/nopoll create mode 100644 StraySrc/Libraries/Steel/h/os create mode 100644 StraySrc/Libraries/Steel/h/pane create mode 100644 StraySrc/Libraries/Steel/h/pointer create mode 100644 StraySrc/Libraries/Steel/h/prefs create mode 100644 StraySrc/Libraries/Steel/h/res create mode 100644 StraySrc/Libraries/Steel/h/resspr create mode 100644 StraySrc/Libraries/Steel/h/saveas create mode 100644 StraySrc/Libraries/Steel/h/scroller create mode 100644 StraySrc/Libraries/Steel/h/sculptrix create mode 100644 StraySrc/Libraries/Steel/h/sprite create mode 100644 StraySrc/Libraries/Steel/h/stddbox create mode 100644 StraySrc/Libraries/Steel/h/steel create mode 100644 StraySrc/Libraries/Steel/h/tcol create mode 100644 StraySrc/Libraries/Steel/h/tearoff create mode 100644 StraySrc/Libraries/Steel/h/template create mode 100644 StraySrc/Libraries/Steel/h/utils create mode 100644 StraySrc/Libraries/Steel/h/viewer create mode 100644 StraySrc/Libraries/Steel/h/visdelay create mode 100644 StraySrc/Libraries/Steel/h/vsscanf create mode 100644 StraySrc/Libraries/Steel/h/werr create mode 100644 StraySrc/Libraries/Steel/h/wimp create mode 100644 StraySrc/Libraries/Steel/h/wimpext create mode 100644 StraySrc/Libraries/Steel/h/wimpstruct create mode 100644 StraySrc/Libraries/Steel/h/wimpt create mode 100644 StraySrc/Libraries/Steel/h/win create mode 100644 StraySrc/Libraries/Steel/h/xferrecv create mode 100644 StraySrc/Libraries/Steel/h/xfersend create mode 100644 StraySrc/Libraries/Steel/h/xproginfo create mode 100644 StraySrc/Libraries/Steel/h/xtearoff create mode 100644 StraySrc/Libraries/Steel/s/bbc create mode 100644 StraySrc/Libraries/Steel/s/calltrace create mode 100644 StraySrc/Libraries/Steel/s/colourtran create mode 100644 StraySrc/Libraries/Steel/s/coords create mode 100644 StraySrc/Libraries/Steel/s/crc32 create mode 100644 StraySrc/Libraries/Steel/s/fastMove create mode 100644 StraySrc/Libraries/Steel/s/flex_dll create mode 100644 StraySrc/Libraries/Steel/s/flex_stat create mode 100644 StraySrc/Libraries/Steel/s/heap_dll create mode 100644 StraySrc/Libraries/Steel/s/heap_stat create mode 100644 StraySrc/Libraries/Steel/s/os create mode 100644 StraySrc/Libraries/Steel/s/sculptrix create mode 100644 StraySrc/Libraries/Steel/s/wimpExt create mode 100644 StraySrc/Libraries/Steel/s/wimp_dll create mode 100644 StraySrc/Libraries/Steel/s/wimp_main create mode 100644 StraySrc/Libraries/Steel/s/wimp_stat create mode 100644 StraySrc/Makefile,fe1 create mode 100644 StraySrc/MiscToys/CheckSD/Makefile,fe1 create mode 100644 StraySrc/MiscToys/CheckSD/README create mode 100644 StraySrc/MiscToys/CheckSD/rsc/Templates,fec create mode 100644 StraySrc/MiscToys/CheckSD/s/CheckSD create mode 100644 StraySrc/MiscToys/CurrDir/Makefile,fe1 create mode 100644 StraySrc/MiscToys/CurrDir/README create mode 100644 StraySrc/MiscToys/CurrDir/s/currDir create mode 100644 StraySrc/MiscToys/Makefile,fe1 create mode 100644 StraySrc/MiscToys/PlainError/Makefile,fe1 create mode 100644 StraySrc/MiscToys/PlainError/ReadMe create mode 100644 StraySrc/MiscToys/PlainError/b/plainError,ffb create mode 100644 StraySrc/MiscToys/PlainError/testit,ffb create mode 100644 StraySrc/README create mode 100644 StraySrc/SDLS/!DLLMerge/!Help create mode 100644 StraySrc/SDLS/!DLLMerge/!Run,feb create mode 100644 StraySrc/SDLS/!DLLMerge/!Sprites,ff9 create mode 100644 StraySrc/SDLS/!DLLMerge/Makefile,fe1 create mode 100644 StraySrc/SDLS/!DLLMerge/rsc/messages create mode 100644 StraySrc/SDLS/!DLLMerge/rsc/templates,fec create mode 100644 StraySrc/SDLS/!DLLMerge/s/dllmerge create mode 100644 StraySrc/SDLS/!DLLMerge/sh/messages create mode 100644 StraySrc/SDLS/!DLLMerge/sh/templates create mode 100644 StraySrc/SDLS/DLLManager/Makefile,fe1 create mode 100644 StraySrc/SDLS/DLLManager/rsc/messages create mode 100644 StraySrc/SDLS/DLLManager/s/app create mode 100644 StraySrc/SDLS/DLLManager/s/dheader create mode 100644 StraySrc/SDLS/DLLManager/s/dll create mode 100644 StraySrc/SDLS/DLLManager/s/dllmdump create mode 100644 StraySrc/SDLS/DLLManager/s/misc create mode 100644 StraySrc/SDLS/DLLManager/s/suballoc create mode 100644 StraySrc/SDLS/DLLManager/sh/app create mode 100644 StraySrc/SDLS/DLLManager/sh/appblock create mode 100644 StraySrc/SDLS/DLLManager/sh/dll create mode 100644 StraySrc/SDLS/DLLManager/sh/dllblock create mode 100644 StraySrc/SDLS/DLLManager/sh/linkblock create mode 100644 StraySrc/SDLS/DLLManager/sh/messages create mode 100644 StraySrc/SDLS/DLLManager/sh/misc create mode 100644 StraySrc/SDLS/DLLManager/sh/suballoc create mode 100644 StraySrc/SDLS/DLLManager/sh/wSpace create mode 100644 StraySrc/SDLS/Makefile,fe1 create mode 100644 StraySrc/SDLS/cdll/Makefile,fe1 create mode 100644 StraySrc/SDLS/cdll/c/binding create mode 100644 StraySrc/SDLS/cdll/c/cstub create mode 100644 StraySrc/SDLS/cdll/c/decode create mode 100644 StraySrc/SDLS/cdll/c/dissect create mode 100644 StraySrc/SDLS/cdll/c/dllbinder create mode 100644 StraySrc/SDLS/cdll/c/error create mode 100644 StraySrc/SDLS/cdll/c/extentry create mode 100644 StraySrc/SDLS/cdll/c/hashtable create mode 100644 StraySrc/SDLS/cdll/c/readdef create mode 100644 StraySrc/SDLS/cdll/h/binding create mode 100644 StraySrc/SDLS/cdll/h/crc32 create mode 100644 StraySrc/SDLS/cdll/h/cstub create mode 100644 StraySrc/SDLS/cdll/h/decode create mode 100644 StraySrc/SDLS/cdll/h/error create mode 100644 StraySrc/SDLS/cdll/h/extentry create mode 100644 StraySrc/SDLS/cdll/h/hashtable create mode 100644 StraySrc/SDLS/cdll/h/readdef create mode 100644 StraySrc/SDLS/cdll/ordinal create mode 100644 StraySrc/SDLS/cdll/s/crc32 create mode 100644 StraySrc/SapphToys/!CApp/!Run,feb create mode 100644 StraySrc/SapphToys/!CApp/Makefile,fe1 create mode 100644 StraySrc/SapphToys/!CApp/UK create mode 100644 StraySrc/SapphToys/!CApp/c/capp create mode 100644 StraySrc/SapphToys/!ColDemo/!Run,feb create mode 100644 StraySrc/SapphToys/!ColDemo/Resources/Messages create mode 100644 StraySrc/SapphToys/!ColDemo/Resources/Sprites,ff9 create mode 100644 StraySrc/SapphToys/!ColDemo/Resources/Templates,fec create mode 100644 StraySrc/SapphToys/!ColDemo/_Makefile,fe1 create mode 100644 StraySrc/SapphToys/!ColDemo/s/colSelect create mode 100644 StraySrc/SapphToys/!ColDemo/s/hsv create mode 100644 StraySrc/SapphToys/!ColDemo/s/rgb create mode 100644 StraySrc/SapphToys/!DrawX/!Boot,feb create mode 100644 StraySrc/SapphToys/!DrawX/!Help create mode 100644 StraySrc/SapphToys/!DrawX/!Run,feb create mode 100644 StraySrc/SapphToys/!DrawX/!Sprites,ff9 create mode 100644 StraySrc/SapphToys/!DrawX/Choices create mode 100644 StraySrc/SapphToys/!DrawX/Makefile,fe1 create mode 100644 StraySrc/SapphToys/!DrawX/Resources/Messages create mode 100644 StraySrc/SapphToys/!DrawX/Resources/Sprites,ff9 create mode 100644 StraySrc/SapphToys/!DrawX/Resources/Templates,fec create mode 100644 StraySrc/SapphToys/!DrawX/s/drawX create mode 100644 StraySrc/SapphToys/!SWIlist/!Help create mode 100644 StraySrc/SapphToys/!SWIlist/!Run,feb create mode 100644 StraySrc/SapphToys/!SWIlist/!Sprites,ff9 create mode 100644 StraySrc/SapphToys/!SWIlist/Format create mode 100644 StraySrc/SapphToys/!SWIlist/Makefile,fe1 create mode 100644 StraySrc/SapphToys/!SWIlist/UK create mode 100644 StraySrc/SapphToys/!SWIlist/bs/swiList,ffb create mode 100644 StraySrc/SapphToys/Makefile,fe1 create mode 100644 StraySrc/Sculptrix/!SConfig/!Run,feb create mode 100644 StraySrc/Sculptrix/!SConfig/Makefile,fe1 create mode 100644 StraySrc/Sculptrix/!SConfig/s/loadConfig create mode 100644 StraySrc/Sculptrix/!Setrix/!Help create mode 100644 StraySrc/Sculptrix/!Setrix/!Run,feb create mode 100644 StraySrc/Sculptrix/!Setrix/!Sprites,ff9 create mode 100644 StraySrc/Sculptrix/!Setrix/Makefile,fe1 create mode 100644 StraySrc/Sculptrix/!Setrix/Resources/Messages create mode 100644 StraySrc/Sculptrix/!Setrix/Resources/Sprites,ff9 create mode 100644 StraySrc/Sculptrix/!Setrix/Resources/Templates,fec create mode 100644 StraySrc/Sculptrix/!Setrix/s/setrix create mode 100644 StraySrc/Sculptrix/Changes create mode 100644 StraySrc/Sculptrix/Makefile,fe1 create mode 100644 StraySrc/Sculptrix/NewVersion create mode 100644 StraySrc/Sculptrix/README create mode 100644 StraySrc/Sculptrix/apcs/Makefile,fe1 create mode 100644 StraySrc/Sculptrix/apcs/h/sculptrix create mode 100644 StraySrc/Sculptrix/apcs/s/scp_apcs create mode 100644 StraySrc/Sculptrix/old-vsn/README create mode 100644 StraySrc/Sculptrix/old-vsn/s/sculptrix create mode 100644 StraySrc/Sculptrix/sculptrix/Makefile,fe1 create mode 100644 StraySrc/Sculptrix/sculptrix/rsc/messages create mode 100644 StraySrc/Sculptrix/sculptrix/s/bbox create mode 100644 StraySrc/Sculptrix/sculptrix/s/border create mode 100644 StraySrc/Sculptrix/sculptrix/s/colours create mode 100644 StraySrc/Sculptrix/sculptrix/s/config create mode 100644 StraySrc/Sculptrix/sculptrix/s/plot create mode 100644 StraySrc/Sculptrix/sculptrix/s/redraw create mode 100644 StraySrc/Sculptrix/sculptrix/s/rules create mode 100644 StraySrc/Sculptrix/sculptrix/s/sculptrix create mode 100644 StraySrc/Sculptrix/sculptrix/s/slab create mode 100644 StraySrc/Sculptrix/sculptrix/s/utils create mode 100644 StraySrc/Sculptrix/sculptrix/s/vString create mode 100644 StraySrc/Sculptrix/sculptrix/sh/bbox create mode 100644 StraySrc/Sculptrix/sculptrix/sh/border create mode 100644 StraySrc/Sculptrix/sculptrix/sh/colours create mode 100644 StraySrc/Sculptrix/sculptrix/sh/config create mode 100644 StraySrc/Sculptrix/sculptrix/sh/messages create mode 100644 StraySrc/Sculptrix/sculptrix/sh/plot create mode 100644 StraySrc/Sculptrix/sculptrix/sh/redraw create mode 100644 StraySrc/Sculptrix/sculptrix/sh/rules create mode 100644 StraySrc/Sculptrix/sculptrix/sh/slab create mode 100644 StraySrc/Sculptrix/sculptrix/sh/utils create mode 100644 StraySrc/Sculptrix/sculptrix/sh/vString create mode 100644 StraySrc/Sculptrix/sculptrix/sh/wSpace create mode 100644 StraySrc/Utilities/Makefile,fe1 create mode 100644 StraySrc/Utilities/b/buildstub,ffb create mode 100644 StraySrc/Utilities/b/fixlink,ffb create mode 100644 StraySrc/Utilities/b/msgaof,ffb create mode 100644 StraySrc/Utilities/b/resgen,ffb create mode 100644 StraySrc/Utilities/b/templaof,ffb create mode 100644 StraySrc/Utilities/buildstub,ffb create mode 100644 StraySrc/Utilities/c/alloc create mode 100644 StraySrc/Utilities/c/chdrgen create mode 100644 StraySrc/Utilities/c/cmdr create mode 100644 StraySrc/Utilities/c/each create mode 100644 StraySrc/Utilities/c/gf create mode 100644 StraySrc/Utilities/c/glob create mode 100644 StraySrc/Utilities/c/headerGen create mode 100644 StraySrc/Utilities/c/inst create mode 100644 StraySrc/Utilities/c/setdate create mode 100644 StraySrc/Utilities/c/ssrclean create mode 100644 StraySrc/Utilities/c/submake create mode 100644 StraySrc/Utilities/ex/buildstub create mode 100644 StraySrc/Utilities/ex/msgaof create mode 100644 StraySrc/Utilities/ex/resgen create mode 100644 StraySrc/Utilities/ex/templaof create mode 100644 StraySrc/Utilities/fixlink,ffb create mode 100644 StraySrc/Utilities/h/alloc create mode 100644 StraySrc/Utilities/h/cmdr create mode 100644 StraySrc/Utilities/h/gf create mode 100644 StraySrc/Utilities/h/glob create mode 100644 StraySrc/Utilities/msgaof,ffb create mode 100644 StraySrc/Utilities/resgen,ffb create mode 100644 StraySrc/Utilities/s/enumerate create mode 100644 StraySrc/Utilities/s/hour create mode 100644 StraySrc/Utilities/s/pathUtil create mode 100644 StraySrc/Utilities/s/path_util create mode 100644 StraySrc/Utilities/s/setSlot create mode 100644 StraySrc/Utilities/s/test create mode 100644 StraySrc/Utilities/sh/pathUtil create mode 100644 StraySrc/Utilities/templaof,ffb create mode 100644 StraySrc/dist/Core create mode 100644 StraySrc/dist/Dynamite create mode 100644 StraySrc/dist/Hammer create mode 100644 StraySrc/dist/MiscToys create mode 100644 StraySrc/dist/Quartz create mode 100644 StraySrc/dist/SDLS create mode 100644 StraySrc/dist/Sapphire create mode 100644 StraySrc/dist/Sculptrix create mode 100644 StraySrc/dist/dist create mode 100644 StraySrc/dist/makeDist,feb create mode 100644 StraySrc/gplnote/Makefile,fe1 create mode 100644 StraySrc/gplnote/asm create mode 100644 StraySrc/gplnote/basic,ffb create mode 100644 StraySrc/gplnote/c create mode 100644 StraySrc/ssr-init,feb create mode 100644 StraySrc/ssr-order create mode 100644 dist/README diff --git a/StraySrc/!DLLs/!Boot,feb b/StraySrc/!DLLs/!Boot,feb new file mode 100644 index 0000000..68c2aac --- /dev/null +++ b/StraySrc/!DLLs/!Boot,feb @@ -0,0 +1,9 @@ +| +| DLL repository !Boot file +| +| © 1994 Straylight +| Distribute as required +| + +IconSprites .!Sprites +If ""="" Then Run .!Run \ No newline at end of file diff --git a/StraySrc/!DLLs/!Run,feb b/StraySrc/!DLLs/!Run,feb new file mode 100644 index 0000000..7aa2c6a --- /dev/null +++ b/StraySrc/!DLLs/!Run,feb @@ -0,0 +1,23 @@ +| +| DLL repository !Run file +| +| © 1994 Straylight +| Distribute as required +| + +| --- Allow slightly nicer access to our utilities --- + +Set DLL$Dir +Set Alias$_util /.%%0 %%*1 + +| --- Add the directories to our path --- + +_util hour -on +IconSprites .!Sprites +Unset DLL$Path +_util enumerate -nofiles "_util pathUtil -create DLL$Path %%0." +_util hour -off + +| --- Clear alias now we've finished --- + +Unset Alias$_util diff --git a/StraySrc/!DLLs/!Sprites,ff9 b/StraySrc/!DLLs/!Sprites,ff9 new file mode 100644 index 0000000000000000000000000000000000000000..e3cb75bb310bff6e01c393375902230656b335e5 GIT binary patch literal 736 zcmd6jJr2S!3`SFg#8|F?SUDDBHwH^x%55TL$z@pCH~?EEFXpr3R8@a=ELlljUy?6v zLI`K{=McgReYtnt18c1#TEA(X&^Pq63E`?>S+oRL@36#)v|{#x$ElB;n2Ei>dLk1B zv*CjgHp9>s77{X64Hu0qOl6r;y;4Wp%k-X?u}m2!#sL8}fqRUE)Q@^Ax}2BcQ1OH( zk7z{p5owC&@6bDib7eKGj~o9_L{@a4;fqLHH<Z*=*Qi($0i`m~Q08 HGuO#}#L}!n literal 0 HcmV?d00001 diff --git a/StraySrc/!DLLs/!Sprites22,ff9 b/StraySrc/!DLLs/!Sprites22,ff9 new file mode 100644 index 0000000000000000000000000000000000000000..8ff2ea0659bf20f007d87c1130398f096c9a180f GIT binary patch literal 1416 zcmeHFJ5Iwu5FHSR(iB`EJ)I9g#| zcoQ2TMRbhyyt8lLycvH^i0Be{IVXAo77y$7278M$U=cH-3#`|`?v&`NxdYFy*SG7LYfd&}Z^R;RIX&~*LK_mTNSE7eei(9c)NO(PY? zGj#JoatB>7eCuR0p{un*+sto57j&8Y#(m{B^J|^1%H?NRm1RWt99zB@*)qQxjB~Dk zQkZpq%7^b6gYU(}KZ*JS_IU0c7RBJ3{BR%jn&qr?RE#_^k+vJrkPb=lOD+^c$$#?K QZ(#4c#dZ_lDbR%Q3+phB!vFvP literal 0 HcmV?d00001 diff --git a/StraySrc/Announce b/StraySrc/Announce new file mode 100644 index 0000000..fe3c4a2 --- /dev/null +++ b/StraySrc/Announce @@ -0,0 +1,152 @@ +The Straylight Source Distribution +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +For a long while now, I've been pontificating in comp.sys.acorn.programmer +about how clever I am, and how I know how to do things properly. Most +of the regular readers should now be thinking something along the lines +of `This [mdw] chap seems to know what he's doing, although I've never +seen any of his work. He's been going on about these libraries and +things but we've never seen them or seen any software which uses them. +It all seems a bit fishy.' Well, now's my time to put my money where my +mouth is. Straylight is releasing all of its source code. Well, the +interesting bits. + +The next question ought to be `why?' Why am I doing this? Well, there +are two reasons, although they're both associated with Linux. The first +reason is that I've `seen the light' of Free software, and want to do +something about my heretical past as a Software Hoarder. I want to give +my small contribution to the world, as Freely as the GNU and Linux teams +are doing. And I want to show off a bit, too. The second reason is +that I'm not doing much Acorn work at all any more. Akasha (my RiscPC) +spends most of her time turned off now, in favour of Excessus (my Linux +PC), and I don't have the time or the inclination to maintain this +rather large chunk of source code any more, so I'm giving it all to the +community which inspired it. It feels slightly like a sort of a swan +song as I leave the Acorn world. + +I'll be releasing the code in dribs and drabs over the coming weeks, +hopefully in a sensible order, so that all the software can be built +with the parts already available. Unfortunately, most of it was never +designed to be source distributed, so there's no guarantees against +mutual dependencies. We'll work it out as we go along, hopefully. The +main components are: + + * Some simple header files and libraries for assembling the code, and + some trivial utilities used in the build processes. + + * BAS -- the Basic Assembler Supplement, which allows Basic programs + to generate AOF object code. This is required for some of the other + build tools. + + * SDLS -- the Straylight Dynamic Linking System. This is already well + known, but not well used, I think. Maybe the sources will be + interesting to someone. + + * Dynamite -- our dynamic-area heap manager module. Again, well known + software, so maybe the sources will provide some interest. + + * Sculptrix -- Straylight's 3D border rendering module. I'm very + proud of this code. Provided also is the source to version 1, which + was a horrible hack made worse by poor modifications. Version 2 + does more, at the same speed, in less space, and more maintainably. + + * STEEL -- the Straylight Extensive Event-driven Library. This is a + grandiose name for a RISC_OSLib more-or-less rewrite. There are + Issues involved here, which I'll try to resolve -- some of the + source files aren't `pure' Straylight code, which could cause + problems. I recommend against anyone using STEEL -- it's just + needed by Glass, which is a jolly good piece of software. + + * Glass -- Straylight's template editor. It's actually the second + template editor I've written, although I'm thoroughly ashamed of the + first one. It's been around for ages, quietly circulating around a + slowly increasing coterie of friends. I suspect many readers + already have copies of Glass they shouldn't have. Well, as of this + announcement, those copies become legal. I'd be interested in + hearing how far this informal distribution had reached. + + * A pile of silly utilities. There's a mouse speed changer which + tries to read the current speed using underhand methods (i.e., + peeking around OS workspace). There's a rudimentary debugger Tim + wrote which might be the start of something useful. + + * Sprinkle -- a little module exactly 256 bytes long which supports + linked lists of sprite areas. + + * Constrain -- constrain the mouse pointer to a circle. This is used + in one of Sapphire's custom controls. + + * Sapphire -- not an acronym, but a weak pun on STEEL. This is + STEEL's successor. It's a comprehensive (I think) run-time support + system and RISC OS library for applications written in assembler. + + There are a number of bits of Sapphire which are incomplete: + + -- There's a scripting language, SAIL, which is based on the work + Straylight did on the Termite language. There may be + complications on this code. + + -- There's an interface for C programs, but it's very messy. Many + bits of Sapphire require more expressive syntax for declaring + data structures than C provides. + + -- There was going to be a wonderful colour selector, but it never + really got finished. The good bits in the current version are + the RGB selector window (which is fully functional -- the + RGB colour square custom control is my favourite bit) and the + HSV colour circle, with its circular mouse constraint. + + -- The threading code needs to be rewritten, and the rest of the + library ought to be properly multithreaded or locked. + + My favourite innovations are: + + -- The way filters work in the event manager. We never needed to + change the way events got dispatched, because we got it right + the first time. + + -- Custom controls in the dialogue box system. This one was my + idea. + + -- The menu system. I like the way the same menu blocks can be + used for normal and tearoff menus. (We designed the system + together over a pub lunch, but Tim did all the implementation + so lots of kudos for him.) + + -- The viewer code, and the background-redrawing gallery stuff. + This was mine, although Tim had already done the listbox code + on which it was based. + + There are a lot of good ideas in here (in my expert opinion) and + some clever tricks too. I think that anyone maintaining a RISC OS + library should look in here. It is, I hope, like Glass: an example + of the benefits of the Second System Effect. + + * Sapphire example programs. There's a small number of these, to show + how we expected people to write Sapphire programs. They're all + lovingly crafted and perfectly formed. Oh, yes. + +Documentation for all of these is going to be patchy at best. The +libraries are sort-of documented by their header files, and by the +examples provided. + +That's all there'll be. + +On the matter of licensing: I'll apply the GNU Library General Public +License to as much as I can, and the full General Public License to +everything else. Software which is already OFFICIALLY available under a +different licence may continue to be licenced under those terms; +however, the existing licences only cover unmodified binaries, so if you +make modifications to the software, you're bound by all the restrictions +of the GPL. + +Well, thanks for taking the time to read all of this. It's been great +working with RISC OS, but I think I've been doing it for too long. I'll +still hang around Acorn newsgroups and flame people whom I think are +being stupid. I will keep porting to RISC OS in mind as I continue to +write, but as far as developing specifically for Acorn is concerned, +that's all you get. + +It's 10:30 at night, I'm cold, and I've been typing this for too long. +Goodbye. It's been great. diff --git a/StraySrc/BuildTools b/StraySrc/BuildTools new file mode 100644 index 0000000..43c09eb --- /dev/null +++ b/StraySrc/BuildTools @@ -0,0 +1,49 @@ +Build tools +~~~~~~~~~~~ + +Apart from the tools provided, you'll need the following programs to +build the Straylight Source Release: + +cc Acorn's C compiler +objasm Acorn's ARM assembler +link Acorn's linker +libfile Acorn's archiver +squeeze Acorn's executable compresser +amu Acorn's rather nasty make utility +ccrunch A BASIC cruncher +sed GNU's stream editor + +I recommend using the C5 versions of these tools; some of the source +files may require C5 versions, but I'm not sure. + +A few pieces of code were deliberately built using the C4 versions of +various tools, to ensure compatibility with people developing for RISC +OS 2. For this reason, some of the Makefiles assume the presence of +programs `o-cc', `o-objasm', `o-link' and `o-libfile'; these are assumed +to be the earlier versions. If you only have one version of the +compiler, assembler and tools, you can set aliases to make the +`o-'-prefixed versions run the non-prefixed ones. + +The STEEL library may require bits of RISC_OSLib. You won't be able to +build STEEL or the programs which use it without RISC_OSLib. + +Everything else ought to be provided in the package. There are a +collection of strange tools we've created to help build our programs, +and a few more written specially for this source release: + +buildstub Builds Sapphire extension stubs +enumerate Run a *command for each file in a directory +fixlink Patches partially linked AOF files because link 4.00 is + buggy +hour Hourglass control from Obey files +inst Install programs once they've been built +msgaof Compile a message file to linkable AOF +pathutil Manipulate path variables properly +resgen Tool for building DLLs containing shared resources +setdate Stamp the current date into an AOF file +setslot A replacement for *WimpSlot which understands flex +ssrclean Delete a lot of files at once +submake Tool for making recursive makes work +templaof Convert a template file into an embedded templates +test Test conditions in Obey files + diff --git a/StraySrc/COPYING b/StraySrc/COPYING new file mode 100644 index 0000000..916d1f0 --- /dev/null +++ b/StraySrc/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/StraySrc/Dynamite/Makefile,fe1 b/StraySrc/Dynamite/Makefile,fe1 new file mode 100644 index 0000000..e362d22 --- /dev/null +++ b/StraySrc/Dynamite/Makefile,fe1 @@ -0,0 +1,100 @@ +# +# Makefile +# +# © 1998 Straylight/Edgeware +# + +#----- Licensing note ------------------------------------------------------- +# +# This makefile is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This makefile is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this makefile. If not, write to the Free Software Foundation, +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#----- Compilation flags ---------------------------------------------------- + +# --- Uncomment to use the C4 tools --- + +# OLD = o- + +# --- C compilation --- + +CC = $(OLD)cc -c -o $@ +CFLAGS = -depend !Depend -throwback -ffah -Ilibs: -IC: +COMPILE = $(CC) $(CFLAGS) + +# --- Assembling --- + +AS = $(OLD)objasm -quit -to $@ +ASFLAGS = -stamp -depend !Depend -throwback +ASSEMBLE = $(AS) $(ASFLAGS) -from + +BAS = basasm + +# --- Linking --- + +LD = $(OLD)link -o $@ +LD_APP = $(LD) -aif +LD_UTIL = $(LD) -bin -base 0 +LD_MOD = $(LD) -bin -base 0 +LD_BIN = $(LD) -bin -base 0 +LD_DLL = $(LD) -rmf +LD_AOF = $(LD) -aof + +# --- Making libraries --- + +AR = $(OLD)libfile -o + +CDLL = cdll + +# --- Setting file types --- + +SET_APP = SetType $@ FF8 +SET_MOD = SetType $@ FFA +SET_UTIL = SetType $@ FFC +SET_DLL = SetType $@ FFD + +# --- Other maintenance things --- + +RM = ssrclean +INSTALL = inst +SETDATE = setdate +SQUEEZE = squeeze $@ +DATE = %zdy %mo %ce%yr +MODDATE = %dy %m3 %ce%yr +CRIGHT = © %ce%yr Straylight +FIXLINK = fixlink $@ + +#----- Default rules -------------------------------------------------------- + +.SUFFIXES: .o .c .s .bs +.c.o: + $(COMPILE) $< +.s.o: + $(ASSEMBLE) $< +.bs.o: + $(BAS) $< $@ + +#----- Compiling things ----------------------------------------------------- + +all: + submake *.Makefile + +install: + submake *.Makefile -- install + +clean: + submake *.Makefile -- clean + +#----- Dynamic dependencies ------------------------------------------------- + +# Dynamic dependencies: diff --git a/StraySrc/Dynamite/apcs/Makefile,fe1 b/StraySrc/Dynamite/apcs/Makefile,fe1 new file mode 100644 index 0000000..d557229 --- /dev/null +++ b/StraySrc/Dynamite/apcs/Makefile,fe1 @@ -0,0 +1,105 @@ +# +# Makefile +# +# © 1998 Straylight/Edgeware +# + +#----- Licensing note ------------------------------------------------------- +# +# This makefile is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This makefile is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this makefile. If not, write to the Free Software Foundation, +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#----- Compilation flags ---------------------------------------------------- + +# --- Uncomment to use the C4 tools --- + +# OLD = o- + +# --- C compilation --- + +CC = $(OLD)cc -c -o $@ +CFLAGS = -depend !Depend -throwback -ffah -Ilibs: -IC: +COMPILE = $(CC) $(CFLAGS) + +# --- Assembling --- + +AS = $(OLD)objasm -quit -to $@ +ASFLAGS = -stamp -depend !Depend -throwback +ASSEMBLE = $(AS) $(ASFLAGS) -from + +BAS = basasm + +# --- Linking --- + +LD = $(OLD)link -o $@ +LD_APP = $(LD) -aif +LD_UTIL = $(LD) -bin -base 0 +LD_MOD = $(LD) -bin -base 0 +LD_BIN = $(LD) -bin -base 0 +LD_DLL = $(LD) -rmf +LD_AOF = $(LD) -aof + +# --- Making libraries --- + +AR = $(OLD)libfile -o + +CDLL = cdll + +# --- Setting file types --- + +SET_APP = SetType $@ FF8 +SET_MOD = SetType $@ FFA +SET_UTIL = SetType $@ FFC +SET_DLL = SetType $@ FFD + +# --- Other maintenance things --- + +RM = ssrclean +INSTALL = inst +SETDATE = setdate +SQUEEZE = squeeze $@ +DATE = %zdy %mo %ce%yr +MODDATE = %dy %m3 %ce%yr +CRIGHT = © %ce%yr Straylight +FIXLINK = fixlink $@ + +#----- Default rules -------------------------------------------------------- + +.SUFFIXES: .o .c .s .bs +.c.o: + $(COMPILE) $< +.s.o: + $(ASSEMBLE) $< +.bs.o: + $(BAS) $< $@ + +#----- Compiling things ----------------------------------------------------- + +all: o.dynamite + +o.dynamite: o.dyn_apcs + $(AR) -c o.dynamite o.dyn_apcs + +install: o.dynamite + +clean: + -$(RM) o.* + +#----- Dynamic dependencies ------------------------------------------------- + +# Dynamic dependencies: +o.dyn_apcs: s.dyn_apcs +o.dyn_apcs: libs:header +o.dyn_apcs: libs:swis +o.dyn_apcs: libs:stream diff --git a/StraySrc/Dynamite/apcs/h/dynamite b/StraySrc/Dynamite/apcs/h/dynamite new file mode 100644 index 0000000..7eb8c1a --- /dev/null +++ b/StraySrc/Dynamite/apcs/h/dynamite @@ -0,0 +1,377 @@ +/* + * dynamite.h + * + * Interface to Dynamite SWIs + * + * © 1997 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Dynamite + * + * Dynamite is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Dynamite is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Dynamite. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __dynamite_h +#define __dynamite_h + +/*----- Notes -------------------------------------------------------------* + * + * The interfaces to Dynamite have been written in assembler. This has the + * benefit of making them very small and minimising procedure call overhead. + * It also has the disadvantage of not setting _kernel_last_oserror() + * properly. If this is important, you should use _kernel_swi() directly. + * + * The SWI interface routines are safe to call from SVC mode (e.g. in a + * C module). + */ + +#ifdef __cplusplus + extern "C" { +#endif + +/*------ Important types --------------------------------------------------*/ + +/* --- dynamite_anchor --- * + * + * This is the type of a Dynamite anchor. It should only be used within + * these declarations, since it exists to keep the compiler happy and make + * the declarations look neat. Your actual anchors will have various types + * depending on what you want to store in your Dynamite blocks. + * + * To avoid casts, we cheat horridly, and in the knowledge that we will only + * be dealing with the *address* of an anchor we macro dynamite_anchor to + * void, so that its address is a void *. + */ + +#define dynamite_anchor void + +/* --- dynamite_error --- * + * + * This is the type of error which Dynamite SWIs return. Depending on + * whether you're using RISC_OSLib or not, you may want these to return + * os_errors or _kernel_oserrors, or its own special type. All these error + * structures have the same format and member names -- it's just a matter of + * naming the structure. + * + * The way we sort all this out is by allowing the client to set up a macro + * to tell us what to do. + */ + +#if defined(dynamite_USE_OS_ERROR) + + #ifndef __os_h + #include "os.h" + #endif + + typedef os_error dynamite_error; + +#elif defined(dynamite_USE_KERNEL_OSERROR) + + #ifndef __kernel_h + #include "kernel.h" + #endif + + typedef _kernel_oserror dynamite_error; + +#elif !defined(dynamite_error) + + typedef struct dynamite_error + { + int errnum; /* Error number */ + char errmess[252]; /* Error message text */ + } + dynamite_error; + +#endif + +/* --- dynstr_blockInfo --- * + * + * This structure contains the information dynamite_blockInfo() returns. + */ + +typedef struct dynstr_blockInfo +{ + int size; /* Block size in bytes */ + int blockID; /* Block's ID number */ +} +dynstr_blockInfo; + +/* --- dynstr_describe --- * + * + * This structure contains the information dynamite_describe() returns. + */ + +typedef struct dynstr_describe +{ + int area; /* Dynamic area handle, or -1 */ + int size; /* Total size of Dynamite area */ + int unused; /* Space unused in Dynamite area */ +} +dynstr_describe; + +/*----- Interface functions -----------------------------------------------* + * + * Most of these return a pointer to a dynamite_error structure. If the + * call was successful, this pointer will be null. + * + * However, where errors are unlikely and a value return is more natural, + * this is not the case. + * + * To check for the existance of Dynamite you should check the return value + * of dynamite_describe() for an error. + */ + +/* --- dynamite_alloc --- * + * + * Arguments: anchor == address of the anchor to use + * size == the size to allocate, in bytes + * id == the id value to give to the block + * + * Returns: Pointer to possible error + * + * Use: Allocates memory from the Dynamite heap. If successful, + * *anchor on exit contains the address of the block allocated. + * Note that the anchor must *not* be in application space -- + * use dynamite_claimAnchor to get one from the RMA if you + * don't have other RMA data. + */ + +extern dynamite_error *dynamite_alloc(dynamite_anchor */*anchor*/, + int /*size*/, + int /*id*/); + +/* --- dynamite_free --- * + * + * Arguments: anchor == the address of block's anchor + * + * Returns: Pointer to possible error + * + * Use: Frees memory in the Dynamite heap. The memory is marked + * as being free, but no blocks are moved -- this makes freeing + * lots of blocks very fast. + */ + +extern dynamite_error *dynamite_free(dynamite_anchor */*anchor*/); + +/* --- dynamite_freeWithID --- * + * + * Arguments: id == the ID of the blocks to free + * + * Returns: Pointer to possible error + * + * Use: Frees all blocks with the given ID value. This allows + * applications and modules to free all their allocated blocks + * when they close down. + */ + +extern dynamite_error *dynamite_freeWithID(int /*id*/); + +/* --- dynamite_blockInfo --- * + * + * Arguments: anchor == address of block's anchor + * info == address of structure to fill in + * + * Returns: Pointer to possible error + * + * Use: Returns information about a Dynamite block. + */ + +extern dynamite_error *dynamite_blockInfo(dynamite_anchor */*anchor*/, + dynstr_blockInfo */*info*/); + +/* --- dynamite_changeID --- * + * + * Arguments: anchor == address of block's anchor, or 0 for all blocks + * newID == new ID to set for block or blocks + * oldID == optional old ID of blocks to change, if anchor == 0 + * + * Returns: Pointer to possible error + * + * Use: Changes the ID of a block or blocks. If you specify a single + * block by passing a nonzero anchor, you don't have to specify + * an oldID value. + */ + +extern dynamite_error *dynamite_changeID(dynamite_anchor */*anchor*/, + int /*newID*/,... + /* int oldID */); + +/* --- dynamite_resize --- * + * + * Arguments: anchor == address of block's anchor + * size == new size to make block + * + * Returns: Pointer to possible error + * + * Use: Changes a block's size. If you make the block larger, the + * data will be unchanged. If you reduce the size, data at the + * end will be deleted. The block will usually move as a + * result of this operation. + */ + +extern dynamite_error *dynamite_resize(dynamite_anchor */*anchor*/, + int /*size*/); + +/* --- dynamite_midExtend --- * + * + * Arguments: anchor == address of block's anchor + * at == offset within block at which to insert or remove bytes + * by == (signed) number of bytes to insert + * + * Returns: Pointer to possible error + * + * Use: Inserts or removes bytes in a block at a given offset. + * See the manual for a complete description of this call. + */ + +extern dynamite_error *dynamite_midExtend(dynamite_anchor */*anchor*/, + int /*at*/, + int /*by*/); + +/* --- dynamite_save --- * + * + * Arguments: value == value to save on the relocation stack + * + * Returns: Pointer to possible error + * + * Use: Saves a value on the Dynamite relocation stack. You can + * only save one value at a time through this interface. + */ + +extern dynamite_error *dynamite_save(void */*value*/); + +/* --- dynamite_load --- * + * + * Arguments: -- + * + * Returns: The value from the top of the relocation stack. + * + * Use: Loads a value from Dynamite's relocation stack and returns + * it. You can only restore one value at a time through this + * interface. + */ + +extern void *dynamite_load(void); + +/* --- dynamite_reduce --- * + * + * Arguments: -- + * + * Returns: 0 if heap couldn't be compacted, non-0 if it could + * + * Use: Performs a partial compaction of the Dynamite heap. + */ + +extern int dynamite_reduce(void); + +/* --- dynamite_compact --- * + * + * Arguments: -- + * + * Returns: Pointer to possible error. + * + * Use: Fully compacts the Dynamite heap. This is equivalent to + * + * while (dynamite_reduce()) + * ; + */ + +extern dynamite_error *dynamite_compact(void); + +/* --- dynamite_lock --- * + * + * Arguments: -- + * + * Returns: Pointer to a possible error + * + * Use: Locks the heap, stopping any blocks not explicitly resized + * from being moved -- this basically just disables compaction. + * You *must* lock the heap while it is being used within a + * callback or SWI handler. + */ + +extern dynamite_error *dynamite_lock(void); + +/* --- dynamite_unlock --- * + * + * Arguments: -- + * + * Returns: Pointer to a possible error + * + * Use: Unlocks the heap, allowing compaction to take place again. + */ + +extern dynamite_error *dynamite_unlock(void); + +/* --- dynamite_claimAnchor --- * + * + * Arguments: ancptr == where to store the address of the anchor + * + * Returns: Pointer to a possible error + * + * Use: Allocates an anchor from the RMA and returns its address. + */ + +extern dynamite_error *dynamite_claimAnchor(dynamite_anchor **/*ancptr*/); + +/* --- dynamite_releaseAnchor --- * + * + * Arguments: anchor == address of anchor to release + * + * Returns: Pointer to possible error + * + * Use: Frees an anchor allocated by dynamite_claimAnchor. + */ + +extern dynamite_error *dynamite_releaseAnchor(dynamite_anchor */*anchor*/); + +/* --- dynamite_readSpriteSize --- * + * + * Arguments: -- + * + * Returns: Actual size of sprite area in bytes + * + * Use: Returns the real size of the sprite area -- before RISC OS + * 3.5, Dynamite has to fake the return value from + * OS_ReadDynamicArea so that you can no longer work out how + * much memory is free in the system. This call allows you + * to find the real sprite area size. + */ + +extern int dynamite_readSpriteSize(void); + +/* --- dynamite_describe --- * + * + * Arguments: desc == address of structure to fill in, or 0 + * + * Returns: Pointer to possible error + * + * Use: If desc is nonzero, this call will read some useful + * information about the Dynamite heap. If desc is 0, it will + * return an error if Dynamite is not loaded -- you can + * therefore test for Dynamite's presence. + */ + +extern dynamite_error *dynamite_describe(dynstr_describe */*desc*/); + +/*----- That's all, folks -------------------------------------------------*/ + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/StraySrc/Dynamite/apcs/s/dyn_apcs b/StraySrc/Dynamite/apcs/s/dyn_apcs new file mode 100644 index 0000000..02021d5 --- /dev/null +++ b/StraySrc/Dynamite/apcs/s/dyn_apcs @@ -0,0 +1,282 @@ +; +; dyn_apcs.s +; +; APCS interface to Dynamite SWIs +; +; © 1994-1998 Straylight +; + +;----- Licensing note ------------------------------------------------------- +; +; This file is part of Straylight's Dynamite +; +; Dynamite is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. +; +; Dynamite is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with Dynamite. If not, write to the Free Software Foundation, +; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +;----- Standard header ------------------------------------------------------ + + GET libs:header + GET libs:swis + + GET libs:stream + +;----- Main code ------------------------------------------------------------ + + AREA |C$$Code|,CODE,READONLY + +; --- dynamite_alloc --- +; +; On entry: a1 == address of anchor +; a2 == size of block, in bytes +; a3 == block ID +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_alloc +dynamite_alloc + MOV ip,lr + SWI XDynamite_Alloc + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_free --- +; +; On entry: a1 == address of anchor +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_free +dynamite_free + MOV ip,lr + SWI XDynamite_Free + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_freeWithID --- +; +; On entry: a1 == block ID (must be non-zero) +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_freeWithID +dynamite_freeWithID + MOV ip,lr + SWI XDynamite_FreeWithID + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_blockInfo --- +; +; On entry: a1 == address of block anchor +; a2 == address of structure to fill in +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_blockInfo +dynamite_blockInfo + STMFD sp!,{lr} + MOV ip,a2 + SWI XDynamite_BlockInfo + STMVCIA ip,{a3,a4} + MOVVC a1,#0 + LDMFD sp!,{pc}^ + +; --- dynamite_changeID --- +; +; On entry: a1 == address of anchor, or 0 +; a2 == new ID +; a3 == (optional) old ID +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_changeID +dynamite_changeID + MOV ip,lr + SWI XDynamite_ChangeID + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_resize --- +; +; On entry: a1 == address of anchor +; a2 == new size, in bytes +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_resize +dynamite_resize + MOV ip,lr + SWI XDynamite_Resize + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_midExtend --- +; +; On entry: a1 == address of anchor +; a2 == offset at which to extend +; a3 == number of bytes to add +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_midExtend +dynamite_midExtend + MOV ip,lr + SWI XDynamite_MidExtend + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_save --- +; +; On entry: a1 == value to save +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_save +dynamite_save + MOV ip,lr + MOV a2,a1 + MOV a1,#2 + SWI XDynamite_Save + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_load --- +; +; On entry: -- +; +; On exit: a1 == value loaded from relocation stack + + EXPORT dynamite_load +dynamite_load + MOV ip,lr + MOV a1,#1 + SWI XDynamite_Load + MOVS pc,ip + +; --- dynamite_reduce --- +; +; On entry: -- +; +; On exit: a1 == 0 if compaction not performed, nonzero otherwise + + EXPORT dynamite_reduce +dynamite_reduce + MOV ip,lr + SWI XDynamite_Reduce + MOVCC a1,#1 + MOVCS a1,#0 + MOVS pc,ip + +; --- dynamite_compact --- +; +; On entry: -- +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_compact +dynamite_compact + MOV ip,lr + SWI XDynamite_Compact + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_lock --- +; +; On entry: -- +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_lock +dynamite_lock + MOV ip,lr + SWI XDynamite_Lock + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_unlock --- +; +; On entry: -- +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_unlock +dynamite_unlock + MOV ip,lr + SWI XDynamite_Unlock + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_claimAnchor --- +; +; On entry: a1 == address of where to store anchor +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_claimAnchor +dynamite_claimAnchor + MOV ip,lr + MOV a2,a1 + SWI XDynamite_ClaimAnchor + STRVC a1,[a2,#0] + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_releaseAnchor --- +; +; On entry: a1 == address of anchor +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_releaseAnchor +dynamite_releaseAnchor + MOV ip,lr + SWI XDynamite_ReleaseAnchor + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_readSpriteSize --- +; +; On entry: a1 == where to store the sprite size +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_readSpriteSize +dynamite_readSpriteSize + MOV ip,lr + MOV a2,a1 + SWI XDynamite_ReadSpriteSize + STRVC a1,[a2,#0] + MOVVC a1,#0 + MOVS pc,ip + +; --- dynamite_describe --- +; +; On entry: a1 == address of a structure to fill in +; +; On exit: a1 == 0 or pointer to error + + EXPORT dynamite_describe +dynamite_describe + MOV ip,lr + MOV a4,a1 + SWI XDynamite_Describe + MOVVS pc,ip + CMP a4,#0 + STMNEIA a4,{a1-a3} + MOV a1,#0 + MOVS pc,ip + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/Makefile,fe1 b/StraySrc/Dynamite/dynamite/Makefile,fe1 new file mode 100644 index 0000000..7f5d72d --- /dev/null +++ b/StraySrc/Dynamite/dynamite/Makefile,fe1 @@ -0,0 +1,183 @@ +# +# Makefile +# +# © 1998 Straylight/Edgeware +# + +#----- Licensing note ------------------------------------------------------- +# +# This makefile is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This makefile is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this makefile. If not, write to the Free Software Foundation, +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#----- Compilation flags ---------------------------------------------------- + +# --- Uncomment to use the C4 tools --- + +# OLD = o- + +# --- C compilation --- + +CC = $(OLD)cc -c -o $@ +CFLAGS = -depend !Depend -throwback -ffah -Ilibs: -IC: +COMPILE = $(CC) $(CFLAGS) + +# --- Assembling --- + +AS = $(OLD)objasm -quit -to $@ +ASFLAGS = -stamp -depend !Depend -throwback +ASSEMBLE = $(AS) $(ASFLAGS) -from + +BAS = basasm + +# --- Linking --- + +LD = $(OLD)link -o $@ +LD_APP = $(LD) -aif +LD_UTIL = $(LD) -bin -base 0 +LD_MOD = $(LD) -bin -base 0 +LD_BIN = $(LD) -bin -base 0 +LD_DLL = $(LD) -rmf +LD_AOF = $(LD) -aof + +# --- Making libraries --- + +AR = $(OLD)libfile -o + +CDLL = cdll + +# --- Setting file types --- + +SET_APP = SetType $@ FF8 +SET_MOD = SetType $@ FFA +SET_UTIL = SetType $@ FFC +SET_DLL = SetType $@ FFD + +# --- Other maintenance things --- + +RM = ssrclean +INSTALL = inst +SETDATE = setdate +SQUEEZE = squeeze $@ +DATE = %zdy %mo %ce%yr +MODDATE = %dy %m3 %ce%yr +CRIGHT = © %ce%yr Straylight +FIXLINK = fixlink $@ + +#----- Default rules -------------------------------------------------------- + +.SUFFIXES: .o .c .s .bs +.c.o: + $(COMPILE) $< +.s.o: + $(ASSEMBLE) $< +.bs.o: + $(BAS) $< $@ + +#----- Object files --------------------------------------------------------- + +OBJS = \ + o.dynamite \ + o.dynAnchor o.dynArea o.dynHeap o.dynTask o.fastMove \ + o.messages + +#----- Compiling things ----------------------------------------------------- + +all: Dynamite + +Dynamite: $(OBJS) + $(SETDATE) o.version version="Dynamite\t1.21 ($(MODDATE)) $(CRIGHT)" + $(LD_MOD) $(OBJS) o.version + $(SET_MOD) + +o.messages: rsc.messages + msgaof rsc.messages o.messages sh.messages + +install: Dynamite + $(INSTALL) Dynamite + +clean: + -$(RM) o.* Dynamite + +#----- Dynamic dependencies ------------------------------------------------- + +# Dynamic dependencies: +o.dynamite: s.dynamite +o.dynamite: libs:header +o.dynamite: libs:swis +o.dynamite: libs:stream +o.dynamite: sh.dynAnchor +o.dynamite: sh.dynArea +o.dynamite: sh.dynHeap +o.dynamite: sh.dynTask +o.dynamite: sh.wSpace +o.dynamite: sh.messages +o.dynamite: s.dynamite +o.dynamite: libs:header +o.dynamite: libs:swis +o.dynamite: libs:stream +o.dynamite: sh.dynAnchor +o.dynamite: sh.dynArea +o.dynamite: sh.dynHeap +o.dynamite: sh.dynTask +o.dynamite: sh.wSpace +o.dynamite: sh.messages +o.dynamite: s.dynamite +o.dynamite: libs:header +o.dynamite: libs:swis +o.dynamite: libs:stream +o.dynamite: sh.dynAnchor +o.dynamite: sh.dynArea +o.dynamite: sh.dynHeap +o.dynamite: sh.dynTask +o.dynamite: sh.wSpace +o.dynamite: sh.messages +o.dynamite: s.dynamite +o.dynamite: libs:header +o.dynamite: libs:swis +o.dynamite: libs:stream +o.dynamite: sh.dynAnchor +o.dynamite: sh.dynArea +o.dynamite: sh.dynHeap +o.dynamite: sh.dynTask +o.dynamite: sh.wSpace +o.dynamite: sh.messages +o.dynAnchor: s.dynAnchor +o.dynAnchor: libs:header +o.dynAnchor: libs:swis +o.dynAnchor: sh.wSpace +o.dynArea: s.dynArea +o.dynArea: libs:header +o.dynArea: libs:swis +o.dynArea: libs:stream +o.dynArea: sh.wSpace +o.dynHeap: s.dynHeap +o.dynHeap: libs:header +o.dynHeap: libs:swis +o.dynHeap: libs:stream +o.dynHeap: libs:sh.fastMove +o.dynHeap: sh.dynArea +o.dynHeap: sh.dynTask +o.dynHeap: sh.wSpace +o.dynHeap: sh.messages +o.dynTask: s.dynTask +o.dynTask: libs:header +o.dynTask: libs:swis +o.dynTask: libs:stream +o.dynTask: sh.dynHeap +o.dynTask: sh.wSpace +o.dynTask: sh.messages +o.fastMove: s.fastMove +o.fastMove: libs:s.fastMove +o.fastMove: libs:header +o.fastMove: libs:swis diff --git a/StraySrc/Dynamite/dynamite/rsc/messages b/StraySrc/Dynamite/dynamite/rsc/messages new file mode 100644 index 0000000..3bfa575 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/rsc/messages @@ -0,0 +1,82 @@ +; +; Dynamite messages +; +; © 1995 Straylight +; + +;----- Miscellaneous messages ----------------------------------------------- + +; --- Heap dump messages --- + +dumpHpBase: Heap base: & +dumpHpSize: Heap size: & +dumpHpArSz: Area size: & + +dumpBlkAddr:Block address: & +dumpBlkSize:Block size : & +dumpBlkId: Block ID : & +dumpBlkAnch:Block anchor : & +dumpBlkFree:Block is free<&0D><&0A> + +;----- Error messages ------------------------------------------------------- + +; --- Finalisation errors --- + +errInUse:[1]Dynamite is in use and cannot close down +errRelease:[1]Dynamite cannot close down (couldn't release vector) + +; --- ChangeDynamicArea patch errors --- + +errTooBig:[&1C1]Unable to move memory + +; --- SWI handling errors --- + +errBadSWI:[&1E6]Unknown Dynamite operation + +; --- Page manager errors --- + +errNoPages:[1]No pages left + +; --- Heap manager errors --- + +errBadFreeAll:[&80D310]Can't free all blocks with ID 0 +errBadAnchor:[&80D301]Bad anchor passed to Dynamite +errNoMem:[&80D300]Couldn't allocate memory +errBadMid:[&80D302]Bad arguments passed to Dynamite_(Mid)Extend + +; --- Heap integrity errors --- + +errBadHeap1:[&80D312]Dynamite area corrupt: anchor or anchor address corrupted +errBadHeap2:[&80D312]Dynamite area corrupt: block length corrupted +errBadHeap3:[&80D312]Dynamite area corrupt: anchor address corrupted + +; --- Compactor task errors --- + +errDesk:[1]Use *Desktop to start the Dynamite compactor + +;----- Command help and syntax strings -------------------------------------- + +clear:{ + *Dynamite_Clear will empty the Dynamite heap, releasing all the \ + memory it was using. + Warning: No confirmation is requested; if applications are using \ + Dynaite, they will almost certainly crash. + | + Syntax: *Dynamite_Clear\ +} + +compactor:{ + The DynamiteCompactor task performs background compaction on the \ + Dynamite heap, reducing the amount of memory the area uses. + Do not use *Desktop_DynamiteCompactor; use *Desktop instead. + | + Syntax: *Desktop_DynamiteCompactor\ +} + +heapDump:{ + *Dynamite_HeapDump displays diagnostic information about the state of \ + Dynamite's memory area. This information may be of use to programmers \ + debugging applications which use Dynamite. + | + Syntax: *Dynamite_HeapDump\ +} diff --git a/StraySrc/Dynamite/dynamite/s/dynAnchor b/StraySrc/Dynamite/dynamite/s/dynAnchor new file mode 100644 index 0000000..e429dbe --- /dev/null +++ b/StraySrc/Dynamite/dynamite/s/dynAnchor @@ -0,0 +1,146 @@ +; +; dynAnchor.s +; +; Useful handle RMA allocation for dynamite +; +; © 1994-1998 Straylight +; +;----- Licensing note ------------------------------------------------------- +; +; This file is part of Straylight's Dynamite +; +; Dynamite is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. +; +; Dynamite is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with Dynamite. If not, write to the Free Software Foundation, +; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +;----- Standard header ------------------------------------------------------ + + GET libs:header + GET libs:swis + +;----- External dependencies ------------------------------------------------ + + GET sh.wSpace + +;----- Constants ------------------------------------------------------------ + +danc__chunk EQU 16 ;Number of handles to get + +;----- Main code ------------------------------------------------------------ + + AREA |Dynamite$$Code|,CODE,READONLY + +; --- danc_alloc --- +; +; On entry: -- +; +; On exit: R0 == pointer to block allocated, or V set and pointer to +; error +; +; Use: Allocates an anchor to use with dynamite from the RMA, +; in a very quick way indeed. + + EXPORT danc_alloc +danc_alloc ROUT + + STMFD R13!,{R1-R3,R14} + + ; --- Are there any free blocks? --- + + LDR R2,dyn_ancTable ;Get the free list offset + CMP R2,#0 ;Are there any free blocks? + BEQ %01danc_alloc ;No -- better allocate some + + ; --- Mess about with the free list and return --- + +00danc_alloc LDR R3,[R2] ;Get next pointer from block + STR R3,dyn_ancTable ;This is now first free block + MOV R0,R2 ;Point to the block + LDMFD R13!,{R1-R3,PC}^ ;Restore registers and return + + ; --- Create a big block --- + +01danc_alloc MOV R0,#6 ;Allocate memory please + MOV R3,#danc__chunk*4+4 ;Get the chunk size + SWI XOS_Module ;Allocate the big block then + LDMVSFD R13!,{R1-R3,PC} ;If it failed, return error + + LDR R14,dyn_ancList ;Load current list head + STR R2,dyn_ancList ;Save this as new list head + STR R14,[R2],#4 ;And save old list head + + ; --- Now set up the links for the free list --- + + MOV R0,#0 ;Next free pointer start at 0 + SUB R3,R3,#8 ;Offset to next field of sub +02danc_alloc STR R0,[R2,R3] ;Store in next field + ADD R0,R2,R3 ;Point to that block + SUBS R3,R3,#4 ;Point to previous block + BGE %02danc_alloc ;If more to do, continue... + + ; --- The links are set up -- now take off a block --- + + B %00danc_alloc ;Then allocate as normal + + LTORG + +; --- danc_free --- +; +; On entry: R0 == pointer to block +; +; On exit: Registers preserved +; +; Use: Frees an anchor allocated using danc_alloc. + + EXPORT danc_free +danc_free ROUT + + STMFD R13!,{R0,R1,R14} ;Preserve registers + + ; --- Mess about with the list --- + + LDR R1,dyn_ancTable ;Get current first block + STR R1,[R0] ;Store in newly freed block + STR R0,dyn_ancTable ;And insert new block in list + LDMFD R13!,{R0,R1,PC}^ ;Oh, and return to caller + + LTORG + +; --- danc_quit --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Frees everyone's anchors nicely when the module quits. + + EXPORT danc_quit +danc_quit ROUT + + STMFD R13!,{R0-R2,R14} ;Save some registers + LDR R2,dyn_ancList ;Load the list head + CMP R2,#0 ;Is there anything to do? + LDMEQFD R13!,{R0-R2,PC}^ ;No -- return then + MOV R0,#7 ;Free RMA block +00danc_quit LDR R1,[R2,#0] ;Load the next pointer + SWI XOS_Module ;Free the block + MOVS R2,R1 ;Point to next one + BNE %00danc_quit ;And loop round for more + LDMFD R13!,{R0-R2,PC}^ ;Return when all done + + LTORG + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/s/dynArea b/StraySrc/Dynamite/dynamite/s/dynArea new file mode 100644 index 0000000..3eaf733 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/s/dynArea @@ -0,0 +1,325 @@ +; +; dynArea.s +; +; The handling of the dynamic area itself +; +; © 1994-1998 Straylight +; +;----- Licensing note ------------------------------------------------------- +; +; This file is part of Straylight's Dynamite +; +; Dynamite is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. +; +; Dynamite is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with Dynamite. If not, write to the Free Software Foundation, +; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +;----- Standard header ------------------------------------------------------ + + GET libs:header + GET libs:swis + + GET libs:stream + +;----- External dependencies ------------------------------------------------ + + GET sh.wSpace + +;----- Main code ------------------------------------------------------------ + + AREA |Dynamite$$Code|,CODE,READONLY + +; --- da_findPage --- +; +; On entry: R2 == address of the page +; +; On exit: R0 == page number +; +; Use: Finds the page number of the page with the address given. + + EXPORT da_findPage +da_findPage ROUT + + STMFD R13!,{R1,R7-R9,R14} ;Stack the link + LDR R14,dyn_machine ;Load the machine type + CMP R14,#&A3 ;RISC OS 3? + BCS %10da_findPage ;Yes -- jump ahead then + + LDR R9,dyn_pageCount ;Load number of pages-1 + MOV R14,#&164 ;Find CAM map (RO 2 and 3!) + ADD R9,R14,R9,LSL #2 ;Last valid entry + MOV R8,R2,LSL #4 ;The address of interest << 4 + SUB R7,R14,#4 ;We're pre-indexing +00da_findPage CMP R7,R9 ;Have we finished? + LDRNE R1,[R7,#4]! ;Load out the entry + TEQNE R8,R1,LSL #4 ;Is this a match? + BNE %00da_findPage ;No -- keep on looking + TEQ R8,R1,LSL #4 ;Was that a match? + SUBEQ R7,R7,R14 ;Yes -- get offset from base + MOVEQ R0,R7,LSR #2 ;And turn into page number + MOVNE R0,#-1 ;Otherwise return -1 + LDMFD R13!,{R1,R7-R9,PC}^ ;Return to caller + + ; --- We are on RISC OS 3 --- + +10da_findPage MOV R1,#0 ;Start at this page + MOV R14,#-1 ;Get a terminator + STMDB R13!,{R1,R2,R3,R14} ;Store that in block + MOV R0,R13 ;Point to the block + SWI OS_FindMemMapEntries ;Find the page number + LDR R0,[R13],#16 ;Load the page number + LDMFD R13!,{R1,R7-R9,PC}^ ;Return to caller + + LTORG + +; --- da_addPages --- +; +; On entry: R0 == number of pages to add +; R12 == workspace address +; +; On exit: Possible error returned +; +; Use: Increases the size of the dynamic area by the number of +; pages given in R0 + + EXPORT da_addPages +da_addPages ROUT + + STMFD R13!,{R0-R9,R14} ;Save some registers + + LDR R9,dyn_machine ;What machine are we on? + CMP R9,#&A5 ;Is it a RISC PC? + BGE %50da_addPages ;Yes -- do things differently + + MOVS R9,R0 ;Remember this value + BEQ %10da_addPages ;Nothing to do -- return + LDR R14,dyn_sprSize ;Get address of spr area size + LDR R14,[R14] ;Get the size out + LDR R1,dyn_areaSize ;Find our area size + SUB R4,R14,R1 ;Find top of system sprites + ADD R2,R4,#&01400000 ;Top of sprite area + + LDR R3,dyn_log2PageSize ;Find page size of machine + MOV R5,R9,LSL R3 ;Find size in bytes + LDR R3,dyn_pageSize ;Find real page size + MOV R1,R5 ;We want this in R1 too + MOV R0,#3 ;Change sprite area size + SWI XOS_ChangeDynamicArea ;Yes... do it now! + BVS %99da_addPages ;Error -- return + + ; --- Make sure system sprite size remains the same --- + + MOV R14,#&01400000 ;Get address of sprite area + STR R4,[R14,#0] ;Get system sprite size + + ; --- Work out how big dynamite area is now --- + + LDR R14,dyn_areaSize ;Get the previous size + RSB R8,R14,#&01800000 ;Put new blocks here + ADD R14,R14,R5 ;The new size + STR R14,dyn_areaSize ;Save this size back + + ; --- Now we need to map up the area --- + + SUB R13,R13,#16 ;Get me a mem map block + MOV R14,#0 ;A nice 0 thing + STR R14,[R13,#8] ;Protection level + MOV R14,#-1 ;The terminator + STR R14,[R13,#12] ;Put that in the block +00da_addPages SUB R8,R8,R3 ;Next page goes here + BL da_findPage ;Find page number of R2 + STR R0,[R13,#0] ;Store the page number + STR R8,[R13,#4] ;Put that page here please + MOV R0,R13 ;Point to the block + SWI XOS_SetMemMapEntries ;Set mem map entries + SUBS R9,R9,#1 ;Reduce page count + ADD R2,R2,R3 ;Now move next page + BGT %00da_addPages ;Keep doing that then + ADD R13,R13,#16 ;Get the block back + + ; --- Phew! -- almost there --- + + CMP R4,#0 ;Is there a sprite area? + MOVNE R4,#&01400000 ;Yes -- get its address + MOV R14,#&1000 ;VDU driver workspace + STR R4,[R14,#1364] ;And store as sprite area ptr + +10da_addPages LDMFD R13!,{R0-R9,PC}^ ;Return to caller + + ; --- We are on a RISC PC --- + +50da_addPages LDR R1,dyn_log2PageSize ;Get the log 2 page size + MOV R1,R0,LSL R1 ;Work out increment + LDR R0,dyn_areaHandle ;Load the area handle + SWI XOS_ChangeDynamicArea ;And increase appropriately + LDRVC R14,dyn_areaSize ;Load the old area size + ADDVC R14,R14,R1 ;Apply our increment to it + STRVC R14,dyn_areaSize ;And save it back again + LDMVCFD R13!,{R0-R9,PC}^ ;Return to caller + +99da_addPages LDMFD R13!,{R0-R9,R14} ;Load back registers + ADR R0,da__noMem ;Point to error + ORRS PC,R14,#V_flag ;Return with error + +da__noMem DCD 1 + DCB "No pages left",0 + +; --- da_removePages --- +; +; On entry: R0 == number of pages to remove +; +; On exit: -- +; +; Use: Removes the given number of pages from the dynamite +; area. If the number of pages to remove is greater than +; the actual number of pages allocated, as many as possible +; are removed + + EXPORT da_removePages +da_removePages ROUT + + STMFD R13!,{R0-R10,R14} ;Stack some registers + + LDR R9,dyn_machine ;What machine are we on? + CMP R9,#&A5 ;Is it a RISC PC? + BGE %50da_removePages ;Yes -- do things differently + + MOV R9,R0 ;Remember this value + LDR R8,dyn_areaSize ;Get my area size + RSB R2,R8,#&01800000 ;The lowest page + + LDR R5,dyn_log2PageSize ;Get the page size + MOV R7,R8,LSR R5 ;Number of dynamite pages + CMP R9,R7 ;Are we in range? + MOVGT R9,R7 ;No -- we are now + CMP R9,#0 ;Are we removing 0 pages? + BEQ %99da_removePages ;Yes -- return now + + LDR R14,dyn_sprSize ;Get address of spr area size + LDR R14,[R14] ;Get the size out + LDR R1,dyn_areaSize ;Find our area size + SUB R10,R14,R1 ;Find top of system sprites + ADD R6,R10,#&01400000 ;Top of sprite area + + SUB R14,R8,R9,LSL R5 ;The new dynamite size + STR R14,dyn_areaSize ;Store this away nicely + + ; --- Now we need to map down the area --- + + LDR R3,dyn_pageSize ;Get the page size + MOV R4,R9 ;Look after the page count + SUB R13,R13,#16 ;Get me a mem map block + MOV R14,#0 ;A nice 0 thing + STR R14,[R13,#8] ;Protection level + MOV R14,#-1 ;The terminator + STR R14,[R13,#12] ;Put that in the block +00 BL da_findPage ;Find page number of R2 + STR R0,[R13,#0] ;Store the page number + STR R6,[R13,#4] ;Put that page here please + MOV R0,R13 ;Point to the block + SWI XOS_SetMemMapEntries ;Set mem map entries + ADD R2,R2,R3 ;Now move next page + ADD R6,R6,R3 ;Put the next one here + SUBS R9,R9,#1 ;Reduce page count + BGT %00da_removePages ;Keep doing that then + ADD R13,R13,#16 ;Get the block back + + CMP R10,#0 ;Was there an area before + BNE %10da_removePages ;Yes -- all ok then + LDR R6,dyn_sprSize ;Get address of spr area size + LDR R6,[R6] ;Get the size out + MOV R7,#0 ;Sprite area header + MOV R8,#16 + MOV R9,#16 + MOV R2,#&1400000 ;Point to sprite area + STMIA R2,{R6-R9} ;Store the header + +10 MOV R1,R4,LSL R5 ;We reduce by this amount + RSB R1,R1,#0 ;Make it negative + MOV R0,#3 ;Change sprite area size + SWI XOS_ChangeDynamicArea ;Remove those damn pages + B %99da_removePages ;Return to caller + + ; --- We're on a RISC PC --- + +50 LDR R1,dyn_log2PageSize ;Get the log 2 page size + MOV R1,R0,LSL R1 ;Work out increment + RSB R1,R1,#0 ;Negate it nicely + LDR R0,dyn_areaHandle ;Load the area handle + SWI XOS_ChangeDynamicArea ;And increase appropriately + LDR R14,dyn_areaSize ;Load the current size + SUB R14,R14,R1 ;How much was it altered by? + STR R14,dyn_areaSize ;And save that back + +99 LDMFD R13!,{R0-R10,PC}^ ;Return to caller + + LTORG + + +; --- da_readSize --- +; +; On entry: -- +; +; On exit: R0 == size of area +; +; Use: Returns the size of the sprite area (including the +; dynamite area). + + EXPORT da_readSize +da_readSize ROUT + + LDR R0,dyn_machine ;What machine are we on? + CMP R0,#&A5 ;Is it a RISC PC? + BGE %50da_readSize ;Yes -- do other things + + LDR R0,dyn_sprSize ;Get spr area size pointer + LDR R0,[R0,#0] ;Load out the size + MOVS PC,R14 ;And return to caller + + ; --- We're on a RISC PC --- + +50da_readSize STMFD R13!,{R1,R14} ;Stack some registers + MOV R0,#3 ;Read size of sprite area + SWI XOS_ReadDynamicArea ;Read things out then + MOV R0,R1 ;Put size in R0 + LDMFD R13!,{R1,PC}^ ;Return to caller + + LTORG + +; --- da_describe --- +; +; On entry: -- +; +; On exit: R0 == dynamic area number (3 == sprite area) +; R1 == size of area +; R2 == total free in area +; +; Use: Gives back som information on the dynamite area. + + EXPORT da_describe +da_describe ROUT + + LDR R0,dyn_machine ;Load out the machine type + CMP R0,#&A5 ;Is it a RISC PC? + LDRGE R0,dyn_areaHandle ;Yes -- load dynamic area hnd + MOVLT R0,#-1 ;No -- return a silly value + LDR R1,dyn_areaSize ;Put area size in R1 + LDR R2,dyn_heapSize ;And heap size in R2 + SUB R2,R1,R2 ;Get size of unused area + MOVS PC,R14 ;Return to caller + + LTORG + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/s/dynHeap b/StraySrc/Dynamite/dynamite/s/dynHeap new file mode 100644 index 0000000..50e6e5f --- /dev/null +++ b/StraySrc/Dynamite/dynamite/s/dynHeap @@ -0,0 +1,1198 @@ +; +; dynHeap.s +; +; New heap management for Dynamite +; +; © 1994-1998 Straylight +; +;----- Licensing note ------------------------------------------------------- +; +; This file is part of Straylight's Dynamite +; +; Dynamite is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. +; +; Dynamite is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with Dynamite. If not, write to the Free Software Foundation, +; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +;----- Standard header ------------------------------------------------------ + + GET libs:header + GET libs:swis + + GET libs:stream + +;----- External dependencies ------------------------------------------------ + + GET libs:sh.fastMove + + GET sh.dynArea + GET sh.dynTask + GET sh.wSpace + + GET sh.messages + +;----- Macros --------------------------------------------------------------- + + MACRO +$label DIR $reg +$label LDR $reg,dyn_machine ;Get the machine type + CMP $reg,#&A5 ;Is it a RISC PC? + MEND + +;----- Main code ------------------------------------------------------------ + + AREA |Dynamite$$Code|,CODE,READONLY + +; --- dh_alloc --- +; +; On entry: R0 == pointer to anchor +; R1 == size to allocate in bytes +; R2 == ID value to store +; +; On exit: R0 and R1 preserved +; R2 == address of block allocated +; +; Use: Allocates a block from the Dynamite heap. + + EXPORT dh_alloc +dh_alloc ROUT + + STMFD R13!,{R0,R1,R3,R14} ;Save some registers + MOV R3,R0 ;Keep anchor pointer + ADD R0,R1,#blk__oHead+15 ;Put size in R0... + BIC R0,R0,#15 ;...after mangling suitably + BL dh__ensure ;Ensure the memory's there + BVS %90dh_alloc ;If not there, return error + STR R1,[R0,#blk__size] ;Save the size in there + STR R3,[R0,#blk__anchor] ;And the anchor address + STR R2,[R0,#blk__id] ;Oh, and the ID value + ADD R2,R0,#blk__oHead ;Return correct address + STR R2,[R3,#0] ;And save address in anchor + LDMFD R13!,{R0,R1,R3,PC}^ ;And return to caller + +90dh_alloc ADD R13,R13,#4 ;Don't restore R0 on exit + LDMFD R13!,{R1,R3,R14} ;Unstack some registers + ORRS PC,R14,#V_flag ;And return the error + + LTORG + +; --- dh_free --- +; +; On entry: R0 == pointer to anchor of block to free +; +; On exit: -- +; +; Use: Frees a Dynamite block. + + EXPORT dh_free +dh_free ROUT + + STMFD R13!,{R1,R14} ;Save some registers + BL dh__checkAnchor ;Make sure the anchor's OK + MOVVC R14,#0 ;If so, clear block's anchor + STRVC R14,[R1,#blk__anchor] ;Zero the anchor (R14==0 !!) + BLVC dh__unCompact ;Say the heap is uncompact + LDMFD R13!,{R1,PC} ;Return to caller + + LTORG + +; --- dh_freeWithID --- +; +; On entry: R0 == ID of all blocks to free +; +; On exit: -- +; +; Use: Frees all allocated blocks with a given ID number. + + EXPORT dh_freeWithID +dh_freeWithID ROUT + + CMP R0,#0 ;Is he trying to free ID 0? + ADREQL R0,msg_errBadFreeAll ;Yes -- that's an error + ORREQS PC,R14,#V_flag ;So return it to him + + ; --- Do the freeing job --- + ; + ; We just tonk a 0 anchor over all blocks with a matching ID. + + STMFD R13!,{R0-R4,R14} ;Save some registers + LDR R2,dyn_heapSize ;Load the current heap size + DIR R14 ;Is it RISC PC? + LDRGE R1,dyn_areaBase ;Yes -- load the area base + RSBLT R1,R2,#&01800000 ;No -- find the base anyway + ADD R2,R2,R1 ;Find the heap end address + MOV R3,#0 ;Haven't freed anything yet + +00dh_freeWithID CMP R1,R2 ;Have we reached the end? + BGE %10dh_freeWithID ;Yes -- return then + LDR R14,[R1,#blk__id] ;Get the block's ID + SUBS R14,R14,R0 ;Is it a match? (=> R14==0) + STREQ R14,[R1,#blk__anchor] ;Yes -- blank out the anchor + MOVEQ R3,#1 ;And remember we done this + LDR R14,[R1,#blk__size] ;Load this block's size + ADD R14,R14,#blk__oHead+15 ;Add on the overhead size + BIC R14,R14,#15 ;And align to granularity + ADD R1,R1,R14 ;Move on to next block + B %00dh_freeWithID ;And go round again + + ; --- We finished -- tidy up and return --- + +10dh_freeWithID CMP R3,#0 ;Did we free anything? + BLNE dh__unCompact ;Yes -- then heap isn't tidy + LDMFD R13!,{R0-R4,PC}^ ;And return to caller + + LTORG + +; --- dh_blockInfo --- +; +; On entry: R0 == address of block anchor +; +; On exit: R0 preserved +; R1 == address of block +; R2 == size of block +; R3 == block ID +; +; Use: Returns information about a Dynamite block + + EXPORT dh_blockInfo +dh_blockInfo ROUT + + STMFD R13!,{R14} ;Save the link register + BL dh__checkAnchor ;Make sure anchor is kosher + LDMVCIB R1,{R2,R3} ;Yes -- load size and ID + ADDVC R1,R1,#blk__oHead ;Point to the block + LDMFD R13!,{PC} ;And return to caller + + LTORG + +; --- dh_changeID --- +; +; On entry: R0 == address of anchor block, or 0 for all +; R1 == new ID +; R2 == old ID (if R0 == 0) +; +; On exit: -- +; +; Use: This call is use to change the ID of either an individual +; block (R0 == address of anchor), or the ID of all the +; blocks with the ID passed in R2 (if R0 == 0). + + EXPORT dh_changeID +dh_changeID ROUT + + STMFD R13!,{R0-R3,R14} ;Stack some registers + CMP R0,#0 ;Just one block to change? + BEQ %50dh_changeID ;No -- jump ahead + + ; --- Change the ID of a specific block --- + + MOV R2,R1 ;Preserve the new ID + BL dh__checkAnchor ;Check the anchor + BVS %99dh_changeID ;It's garbish -- return error + STR R2,[R1,#blk__id] ;Store the new id + B %98dh_changeID ;And return to caller + + ; --- Change the ID of all blocks with ID R2 --- + +50dh_changeID LDR R3,dyn_heapSize ;Load the current heap size + DIR R14 ;Is it RISC PC? + LDRGE R0,dyn_areaBase ;Yes -- load the area base + RSBLT R0,R3,#&01800000 ;No -- find the base anyway + ADD R3,R3,R0 ;Find the heap end address + +60dh_changeID CMP R0,R3 ;Have we reached the end? + BGE %98dh_changeID ;Yes -- return then + LDR R14,[R0,#blk__id] ;Get the id of this block + CMP R14,R2 ;Do we want to change it? + STREQ R1,[R0,#blk__id] ;Yes -- make it so then + LDR R14,[R0,#blk__size] ;Get the block size + ADD R14,R14,#blk__oHead+15 ;Add on the block size + BIC R14,R14,#15 ;And word align + ADD R0,R0,R14 ;Point to the next block + B %60dh_changeID ;Keep on looking for blocks + +98dh_changeID LDMFD R13!,{R0-R3,PC}^ ;Return to caller + +99dh_changeID ADD R13,R13,#4 ;Don't unstack R0 + LDMFD R13!,{R1-R3,R14} ;Get back registers + ORRS PC,R14,#V_flag ;Return with error + + LTORG + +; --- dh__checkAnchor --- +; +; On entry: R0 == address of anchor to check +; +; On exit: R1 == address of block descriptor +; +; Use: Ensures that a given anchor is valid. + +dh__checkAnchor ROUT + + STMFD R13!,{R14} ;Save some registers + LDR R1,[R0,#0] ;Load the block address + SUB R1,R1,#blk__oHead ;Point to our information + LDR R14,[R1,#blk__anchor] ;Load the block's anchor + CMP R0,R14 ;Do they match up? + ADRNEL R0,msg_errBadAnchor ;No -- point to error message + LDMFD R13!,{R14} ;Restore registers + BICEQS PC,R14,#V_flag ;Anchor OK -- clear V on exit + ORRNES PC,R14,#V_flag ;Anchor duff -- return error + + LTORG + +; --- dh__ensure --- +; +; On entry: R0 == number of bytes required (multiple of 16) +; +; On exit: R0 == pointer to base of area allocated +; +; Use: Ensures that there are R0 bytes available in the heap. If +; there aren't R0 bytes available, it goes out of its way to +; ensure that there *are* by getting more. If there still +; isn't enough, it compacts the heap and tries some more. + +dh__ensure ROUT + + STMFD R13!,{R1-R5,R14} ;Save some registers + MOV R1,R0 ;Keep the size I want + + ; --- Try to find some space among the free blocks --- + + LDR R3,dyn_heapSize ;Load the current heap size + DIR R14 ;Is it RISC PC? + LDRGE R2,dyn_areaBase ;Yes -- load the area base + RSBLT R2,R3,#&01800000 ;No -- find the base anyway + ADD R3,R3,R2 ;Find the heap end address + MOV R5,#0 ;No bytes found yet + +00dh__ensure CMP R2,R3 ;Is there more to go? + BGE %05dh__ensure ;No -- then extend the heap + + LDR R0,[R2,#blk__size] ;Load this block's size + ADD R0,R0,#blk__oHead+15 ;Add on the overhead size + BIC R0,R0,#15 ;And align to granularity + LDR R14,[R2,#blk__anchor] ;Is the block free? + ADD R2,R2,R0 ;Bump on block pointer + CMP R14,#0 ;If so, anchor==0 + MOVNE R5,#0 ;If not, clear free size + BNE %00dh__ensure ;And loop round again + + ; --- Found a free block --- + + CMP R5,#0 ;Is there a free block size? + SUBEQ R4,R2,R0 ;No -- this is the start then + ADD R5,R5,R0 ;Add on the size of this blk + SUBS R14,R5,R1 ;Is this big enough? + BLT %00dh__ensure ;No -- keep on round + + ; --- Found a big enough space --- + + BEQ %03dh__ensure ;If no leftover, skip on + ADD R3,R4,R1 ;Point to bit left over + MOV R0,#0 ;This block is free + SUB R2,R14,#blk__oHead ;Subtract info overhead + STMIA R3,{R0,R2} ;Save this in the block + + ; --- Return address of this memory --- + +03dh__ensure MOV R0,R4 ;Point to the free block + LDMFD R13!,{R1-R5,R14} ;Unstack registers + BICS PC,R14,#V_flag ;And clear error indicator + + ; --- Main size ensuring loop --- + +05dh__ensure LDR R14,dyn_areaSize ;Get the dynamic area size + LDR R2,dyn_heapSize ;And the size we're using + SUB R3,R14,R2 ;How much do we have? + SUBS R3,R1,R3 ;And is it enough? + BLE %10dh__ensure ;Yes -- skip onwards + + ; --- Try to get some more pages --- + + LDR R14,dyn_pageSize ;Load machine page size + SUB R14,R14,#1 ;Subtract one -- round up + ADD R3,R3,R14 ;Add it on for rounding + LDR R4,dyn_log2PageSize ;Load the page size log + MOV R0,R3,LSR R4 ;How many do I need? + BL da_addPages ;Get some more + BVC %10dh__ensure ;It worked -- skip onwards + + ; --- Hmm... -- try compacting the heap --- + + BL dh_compact ;Try to compact the heap + BCC %05dh__ensure ;If it did, try again + + ADRL R0,msg_errNoMem ;Point to the error + LDMFD R13!,{R1-R5,R14} ;Restore the registers + ORRS PC,R14,#V_flag ;And return to caller + + ; --- Extend the heap and return the base address --- + +10dh__ensure ADD R14,R2,R1 ;Work out the new heap size + STR R14,dyn_heapSize ;Save this away for later + DIR R0 ;Get the heap's direcection + LDRGE R0,dyn_areaBase ;Yes -- load the area base + ADDGE R0,R0,R2 ;And add the old heap size + RSBLT R0,R14,#&01800000 ;Otherwise find the heap base + LDMFD R13!,{R1-R5,R14} ;Unstack registers + BICS PC,R14,#V_flag ;And clear error indicator + + LTORG + +; --- dh_reduce --- +; +; On entry: -- +; +; On exit: CS if there was nothing we could do +; +; Use: Tries to shunt the free space in the heap off the end and +; back into the operating system's free pool. It does it a +; little bit and then stops, rather like those workmen on the +; M40. + + EXPORT dh_reduce +dh_reduce ROUT + + STMFD R13!,{R14} ;Save some registers + LDR R14,dyn_hpFlags ;Load the heap's flags + TST R14,#hpFlag_tidy ;Is the heap tidy? + LDREQ R14,dyn_lockCount ;No -- then load lock count + CMPEQ R14,#0 ;Is the heap locked? + BNE %91dh_reduce ;Yes -- then return CS now + + ; --- Do search for free blocks --- + + STMFD R13!,{R0-R9} ;Save some more registers + LDR R1,dyn_heapSize ;Load the current heap size + DIR R14 ;Is it RISC PC? + LDRGE R5,dyn_areaBase ;Yes -- load the area base + RSBLT R5,R1,#&01800000 ;No -- find the base anyway + ADD R1,R1,R5 ;Find the heap end address + MOV R9,R5 ;Remember heap base address + + ; --- Find a free block --- + + MOV R7,#0 ;No previous block +00dh_reduce CMP R5,R1 ;Are we at the end yet? + BGE %04dh_reduce ;Yes -- jump ahead a little + + LDR R2,[R5,#blk__anchor] ;Get the block's anchor addr + CMP R2,#0 ;Is the block free? + LDR R2,[R5,#blk__size] ;Get the block size + ADD R2,R2,#blk__oHead+15 ;Add on the overhead bytes + BIC R2,R2,#15 ;And word align the size + MOVNE R7,R5 ;No -- remember where it is + ADDNE R5,R5,R2 ;...move on to next one + BNE %00dh_reduce ;...go round for another one + + ; --- We've found a free block --- + +01dh_reduce ADD R6,R5,R2 ;Point to the next block + CMP R6,R1 ;Is that the end of the heap? + MOVGE R8,R7 ;Yes -- set up prev pointer + SUBGE R2,R2,#blk__oHead ;...take off overhead + STRGE R2,[R5,#blk__size] ;...store overall block size + BGE %04dh_reduce ;...and jump ahead a little + + ; --- Check for two free blocks together --- + + LDR R0,[R6,#blk__anchor] ;Does this have an anchor? + CMP R0,#0 ;Check if it's free + SUBNE R2,R2,#blk__oHead ;Not -- take off overhead + STRNE R2,[R5,#blk__size] ;...store overall block size + BNE %02dh_reduce ;...jump ahead a little + + ; --- Join two adjacent free blocks together --- + + LDR R0,[R6,#blk__size] ;Yes -- get its size + ADD R2,R0,R2 ;Concatenate the two blocks + ADD R2,R2,#blk__oHead+15 ;Add on the overhead bytes + BIC R2,R2,#15 ;And word align the size + B %01dh_reduce ;And check again... + + ; --- We may be searching for the last block --- + +02dh_reduce + DIR R14 ;Get the heap direction + MOVLT R5,R6 ;Down -- point to next block + MOVLT R8,R7 ;...remember last block pos. + BLT %00dh_reduce ;...and keep on searching + + ; --- There's a block to bring down --- + + LDR R4,[R6,#blk__size] ;Get size of block to move + ADD R4,R4,#blk__oHead+15 ;Add the flex overhead + BIC R4,R4,#15 ;And word align the size + MOVS R2,R4 ;This is the size to move + MOV R0,R5 ;Where to move it to + MOV R1,R6 ;Where it is right now + BLNE dh__move ;Copy it down PDQ + ADD R0,R5,R4 ;Point after block we moved + MOV R1,#0 ;Block doesn't have an anchor + STR R1,[R0,#blk__anchor] ;Store that away for later + SUB R1,R6,R5 ;Find the difference here + SUB R1,R1,#blk__oHead ;Don't count this size here + STR R1,[R0,#blk__size] ;Store the old size in free + + ; --- We need to fix up the block we moved --- + + LDR R0,[R5,#blk__anchor] ;Get the anchor pointer + ADD R1,R5,#blk__oHead ;Point to the real data + STR R1,[R0] ;Store client's new anchor + + ; --- That's it -- return to caller --- + + B %10dh_reduce ;Return to caller + + ; --- We've reached the end of the heap --- + ; + ; Now things get a little more complicated: + ; + ; If the heap goes upwards, then there may be a free block + ; on the end that we can free (R5 < R1), otherwise the heap + ; is compacted. + ; + ; If the heap goes downwards, then R8 points to the block + ; immediately before the last free one. If R8 is 0, then + ; either the heap is compacted (the first block is not free) + ; or there is only on free block, and it's at the lower + ; end of the heap. + +04dh_reduce + DIR R14 ;Get the heap direction + BGE %05dh_reduce ;Upwards -- jump ahead + + CMP R8,#0 ;Was there a previous block? + BNE %07dh_reduce ;Yes -- compact heap then + + LDR R14,[R9,#blk__anchor] ;Get previous block anchor + CMP R14,#0 ;Is the first block free? + BNE %90dh_reduce ;No -- the heap is compacted + + LDR R14,[R9,#blk__size] ;Get the size of the free blk + ADD R14,R14,#blk__oHead+15 ;Add on the overhead + BIC R14,R14,#15 ;And correctly align + ADD R7,R9,R14 ;Point past the free block + + LDR R0,dyn_areaSize ;Get the area size + RSB R14,R0,#&01800000 ;Find the base address + SUB R5,R7,R14 ;Get size of unsused area + SUB R14,R0,R5 ;Get the area size left + STR R14,dyn_heapSize ;Store it away nicely + LDR R14,dyn_log2PageSize ;Get the log page size + MOVS R0,R5,LSR R14 ;How many pages can we free? + BLNE da_removePages ;More than 0 -- free them + B %20dh_reduce ;Return to caller + + ; --- Merge the last block with the free area --- + +05dh_reduce CMP R5,R1 ;Had we reached the end? + BGE %90dh_reduce ;Yes -- heaps compact then + + SUB R14,R5,R9 ;Get the used area size + STR R14,dyn_heapSize ;And store it away + LDR R0,dyn_pageSize ;Get the machine page size + SUB R0,R0,#1 ;Turn into a bitmask + ADD R5,R5,R0 ;Align this to page boundary + BIC R0,R5,R0 ;And finish off the align + LDR R1,dyn_areaSize ;Get the dyn area size + ADD R1,R1,R9 ;Point to end of area + SUBS R0,R1,R0 ;Are these different? + BEQ %10dh_reduce ;No -- return + LDR R14,dyn_log2PageSize ;Get the log page size + MOVS R0,R0,LSR R14 ;How many pages can we free? + BLNE da_removePages ;More than 0 -- free them + B %20dh_reduce ;Return to caller + + ; --- Move a block in a downwards heap --- + +07dh_reduce LDR R2,[R8,#blk__size] ;Get size of block to move + ADD R2,R2,#blk__oHead+15 ;Add the flex overhead + BIC R2,R2,#15 ;And word align the size + ADD R0,R8,R2 ;Point to the free block + LDR R4,[R0,#blk__size] ;Load out it's size + ADD R14,R4,#blk__oHead+15 ;Add the flex overhead + BIC R14,R14,#15 ;And word align the size + ADD R0,R0,R14 ;Point to the end of the blk + SUB R0,R0,R2 ;Copy the block to here + MOV R1,R8 ;Where it is right now + BLNE dh__move ;Copy it down PDQ + MOV R1,#0 ;Block doesn't have an anchor + STR R1,[R8,#blk__anchor] ;Store that away for later + STR R4,[R8,#blk__size] ;Store the old size in free + + ; --- We need to fix up the block we moved --- + + LDR R14,[R0,#blk__anchor] ;Get the anchor pointer + ADD R0,R0,#blk__oHead ;Point to the real data + STR R0,[R14] ;Store client's new anchor + + ; --- That's it -- return --- + +10dh_reduce LDMFD R13!,{R0-R9,R14} ;Load back registers + BICS PC,R14,#C_flag ;Return with C clear + + ; --- There wasn't anything to do -- we're compacted --- + +20dh_reduce LDR R0,dyn_hpFlags ;Load my flags + ORR R0,R0,#hpFlag_tidy ;We're compacted + STR R0,dyn_hpFlags ;Store back the flags + LDMFD R13!,{R0-R9,R14} ;Load back registers + BICS PC,R14,#C_flag ;Return with C clear + + ; --- Nothing could be done --- + +90dh_reduce LDMFD R13!,{R0-R9} ;Load back registers +91dh_reduce LDMFD R13!,{R14} ;And the link too + ORRS PC,R14,#C_flag ;Return with C set + + LTORG + +; --- dh_compact --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Does a full compaction of the heap. + + EXPORT dh_compact +dh_compact ROUT + + STMFD R13!,{R14} ;Stack the link register + BL dh_reduce ;Try to reduce the heap + LDMCSFD R13!,{PC} ;If it couldn't, return CS +00dh_compact BL dh_reduce ;Try to reduce the heap + BCC %00dh_compact ;Did something -- try again + LDMFD R13!,{R14} ;Return to caller... + BICS PC,R14,#C_flag ;... saying we did something + + LTORG + +; --- dh__unCompact --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Marks the heap as being uncompact. + +dh__unCompact ROUT + + STMFD R13!,{R14} ;Stack the link register + LDR R14,dyn_hpFlags ;Load the flags word + TST R14,#hpFlag_tidy ;Is the tidy bit on? + BICNE R14,R14,#hpFlag_tidy ;Clear the 'is tidy' bit + STRNE R14,dyn_hpFlags ;Store back the flags + BLNE dt_message ;Yes -- prod compactor + LDMFD R13!,{PC}^ ;Return to caller + + LTORG + +; --- dh_lock --- +; +; On entry: -- +; +; On exit: R10 corrupted (SWIs don't care about this) +; +; Use: Locks the heap, so that compaction entirely fails to happen. + + EXPORT dh_lock +dh_lock ROUT + + LDR R10,dyn_lockCount ;Load the old lock count + ADD R10,R10,#1 ;Bump the counter a little + STR R10,dyn_lockCount ;Store the counter back + MOVS PC,R14 ;And return to caller + + LTORG + +; --- dh_unlock --- +; +; On entry: -- +; +; On exit: R10 corrupted (SWIs don't care about this) +; +; Use: Unlocks the heap, so that compaction can happen again, maybe. + + EXPORT dh_unlock +dh_unlock ROUT + + LDR R10,dyn_lockCount ;Load the old lock count + SUBS R10,R10,#1 ;Knock the counter down + STRGE R10,dyn_lockCount ;Store the counter back + BEQ dt_message ;If now enabled, signal task + MOVS PC,R14 ;And return to caller + + LTORG + +; --- dh_save --- +; +; On entry: R0 == mask of registers to save +; +; On exit: R10, R11 corrupted +; +; Use: Saves a load of registers on the Dynamite relocation stack. +; The mask in R0 contains a bit set for each register to save: +; bit 3 set means save R3 etc. Since this is a SWI, only +; R1-R9 can be saved on the stack. + + EXPORT dh_save +dh_save ROUT + + ; --- StrongARM friendly version 1st October 1996 [mdw] --- + + LDR R10,dyn_stackPtr ;Load the stack pointer + + TST R0,#&03F + BEQ %f05 + MOVS R11,R0,LSL #31 + STRCS R1,[R10],#4 + TST R0,#&3FC + BEQ %f00 + MOVS R11,R0,LSL #29 + STRMI R2,[R10],#4 + STRCS R3,[R10],#4 + TST R0,#&3F0 + BEQ %f00 + MOVS R11,R0,LSL #27 + STRMI R4,[R10],#4 + STRCS R5,[R10],#4 + TST R0,#&3C0 + BEQ %f00 +05 MOVS R11,R0,LSL #25 + STRMI R6,[R10],#4 + STRCS R7,[R10],#4 + MOVS R11,R0,LSL #23 + STRMI R8,[R10],#4 + STRCS R9,[R10],#4 +00 + STR R10,dyn_stackPtr ;Save stack pointer back + MOVS PC,R14 ;And return to caller + + LTORG + +; --- dh_load --- +; +; On entry: R0 == mask of registers to load +; +; On exit: R10, R11 corrupted +; +; Use: Loads a load of registers on the Dynamite relocation stack. +; The mask in R0 contains a bit set for each register to load: +; bit 3 set means load R3 etc. Since this is a SWI, only +; R1-R9 can be read from the stack. + + EXPORT dh_load +dh_load ROUT + + ; --- StrongARM friendly version 1st October 1996 [mdw] --- + + LDR R10,dyn_stackPtr ;Load the stack pointer + + TST R0,#&3F0 + BEQ %f05 + MOVS R11,R0,LSL #23 + LDRCS R9,[R10,#-4]! + LDRMI R8,[R10,#-4]! + TST R0,#&0FF + BEQ %f00 + MOVS R11,R0,LSL #25 + LDRCS R7,[R10,#-4]! + LDRMI R6,[R10,#-4]! + TST R0,#&03F + BEQ %f00 + MOVS R11,R0,LSL #27 + LDRCS R5,[R10,#-4]! + LDRMI R4,[R10,#-4]! + TST R0,#&00F + BEQ %f00 +05 MOVS R11,R0,LSL #29 + LDRCS R3,[R10,#-4]! + LDRMI R2,[R10,#-4]! + MOVS R11,R0,LSL #31 + LDRCS R1,[R10,#4]! +00 + STR R10,dyn_stackPtr ;Save stack pointer back + MOVS PC,R14 ;And return to caller + + LTORG + +; --- dh_extend --- +; +; On entry: R0 == address of block anchor +; R1 == new size for block +; +; On exit: R0 preserved +; R1 == address of block, may have moved +; +; Use: Changes the size of a block. + + EXPORT dh_extend +dh_extend ROUT + + STMFD R13!,{R2,R14} ;Save some registers + MOV R2,R1 ;Keep the size safe a while + BL dh__checkAnchor ;Make sure anchor's kosher + LDRVC R1,[R1,#blk__size] ;Load the size word nicely + SUBVC R2,R2,R1 ;Get the `by' value I need + BLVC dh_midExtend ;Do the messing about + LDMFD R13!,{R2,PC} ;Return to caller + + LTORG + +; --- dh_midExtend --- +; +; On entry: R0 == address of block anchor +; R1 == byte offset from block start +; R2 == number of bytes to insert +; +; On exit: R0 preserved +; R1 == address of block, may have moved +; +; Use: Inserts or removes bytes at a given offset into a Dynamite +; heap block. + + EXPORT dh_midExtend +dh_midExtend ROUT + + STMFD R13!,{R0,R2-R9,R14} ;Save some registers + MOV R5,R0 ;Keep the anchor address + MOV R6,R1 ;And the byte offset + MOV R7,R2 ;And the size to insert + + ; --- To start with, some sanity checks --- + + BL dh__checkAnchor ;Make sure anchor is OK + BVS %90dh_midExtend ;If not, return error + CMP R7,#0 ;Are we growing the block? + ADDLT R14,R6,R7 ;No -- get lowest byte access + MOVGE R14,R6 ;Yes -- similarly + CMP R14,#0 ;Is this off the end? + ADRLTL R0,msg_errBadMid ;Yes -- point to error + BLT %90dh_midExtend ;And return to caller + LDR R4,[R1,#blk__size] ;Get the block's size + CMP R6,R4 ;Are we going too far here? + ADRGTL R0,msg_errBadMid ;Yes -- point to error + BGT %90dh_midExtend ;And return to caller + + ; --- Now do the correct extend job --- + + CMP R7,#0 ;Are we growing the block? + BEQ %85dh_midExtend ;Not changing -- return + BLT %50dh_midExtend ;Shrinking -- skip to do that + + ; --- Make a block bigger --- + ; + ; We do this in 3 stages: + ; + ; * Get the amount of dead space at the end of the block, and + ; see if this is enough. + ; + ; * If not, gather together the free blocks immediately + ; following the block and add this to the dead space. + ; + ; * If we still don't have enough, we ensure a block of the + ; required size (plus block descriptor) and copy the data + ; into there. + ; + ; Registers will be used as follows: + ; + ; R5-R7 are original arguments + ; R4 == current size of block + ; R3 == size of area we have found + ; R2 == base address of extension area + ; R1 == base address of block + + ADD R2,R1,R4 ;Find the end of the block + ADD R3,R4,#blk__oHead+15 ;Align block size to gran. + BIC R0,R3,#15 ;To get dead space too + SUB R3,R0,#blk__oHead ;But don't have the overhead + SUB R3,R3,R4 ;Get size of the dead space + CMP R3,R7 ;Is there enough for us? + BGE %30dh_midExtend ;Yes -- use it then + + ; --- Now we must gather free blocks together nicely --- + + STMFD R13!,{R8-R10} ;Save some more registers + ADD R8,R1,R0 ;Find start of next block + DIR R14 ;Which way is the heap going? + LDRGE R14,dyn_areaBase ;Upwards -- get base address + LDRGE R10,dyn_heapSize ;And the heap's size + ADDGE R10,R14,R10 ;To get the top of the heap + MOVLT R10,#&01800000 ;Downwards -- get heap top + +05dh_midExtend CMP R8,R10 ;Are we there yet? + BGE %10dh_midExtend ;Yes -- stop there then + LDR R14,[R8,#blk__anchor] ;Get the block's anchor + CMP R14,#0 ;Is it a free block? + BNE %10dh_midExtend ;No -- stop here then + LDR R9,[R8,#blk__size] ;Get the block's size + ADD R9,R9,#blk__oHead+15 ;Add information overhead + BIC R9,R9,#15 ;And align size nicely + ADD R8,R8,R9 ;Move on to next block + ADD R3,R3,R9 ;And increase available space + CMP R3,R7 ;Do we have enough yet? + BLT %05dh_midExtend ;No -- go round again + + LDMFD R13!,{R8-R10} ;Restore the stack pointer + B %30dh_midExtend ;And do the extend op + + ; --- Not enough space in free blocks --- + ; + ; We dh__ensure enough space in the heap, and copy the whole + ; lot. + +10dh_midExtend LDMFD R13!,{R8-R10} ;Restore the stack pointer + ADD R0,R4,R7 ;Get the required size + ADD R0,R0,#blk__oHead+15 ;Add information overhead + BIC R0,R0,#15 ;And align size nicely + BL dh__ensure ;Make the space available + BVS %90dh_midExtend ;If it failed, return error + LDR R1,[R5,#0] ;Reload anchor -- may move + SUB R1,R1,#blk__oHead ;And find real block base + ADD R2,R4,#blk__oHead ;Add on the info overhead + BL dh__move ;Copy the data over + ADD R14,R0,#blk__oHead ;Point to the usable area + STR R14,[R5,#0] ;Save client's new anchor + MOV R14,#0 ;Get a zero word + STR R14,[R1,#blk__anchor] ;To mark old block as free + BL dh__unCompact ;The heap is not compact now + + ; --- Set up registers for the resize op --- + + MOV R1,R0 ;Point at the new block base + ADD R2,R1,R4 ;Find area to extend from + MOV R3,R7 ;And the size we have found + + ; --- Perform the block resize --- + +30dh_midExtend ADD R14,R4,R7 ;Get the new block size + STR R14,[R1,#blk__size] ;And save it away + ADD R3,R3,R4 ;Get the total area size + ADD R14,R14,#blk__oHead+15 ;Add overhead to new size + BIC R14,R14,#15 ;And align nicely + + ; --- Increase the heap size if we need to --- + + ADD R0,R1,R14 ;Find the end of the area + LDR R9,dyn_heapSize ;Load the current heap size + DIR R8 ;Is it RISC PC? + LDRGE R8,dyn_areaBase ;Yes -- load the area base + RSBLT R8,R9,#&01800000 ;No -- find the base anyway + ADD R9,R9,R8 ;Find the heap end address + CMP R0,R9 ;Is end too high? + SUBGT R0,R0,R8 ;Yes -- get the heap size + STRGT R0,dyn_heapSize ;...and store it back again + + ADD R3,R3,#blk__oHead+15 ;Do the same for the whole... + BIC R3,R3,#15 ;... area size + SUBS R3,R3,R14 ;Get the space left at end + BLE %35dh_midExtend ;Perfect fit -- skip on + + ; --- Insert a free block here --- + + ADD R0,R1,R14 ;Find the end of the area + MOV R2,#0 ;No anchor -- it's free + SUB R3,R3,#blk__oHead ;Subtract overhead size + STMIA R0,{R2,R3} ;Save in descriptor block + + ; --- Now split the block as required --- + +35dh_midExtend ADD R1,R1,#blk__oHead ;Point at usable part of blk + ADD R1,R1,R6 ;Find the split offset + ADD R0,R1,R7 ;Find where to move to + SUBS R2,R4,R6 ;How much we have to move + BLNE dh__move ;Do the split op + B %85dh_midExtend ;And return happily to caller + + ; --- We have to reduce a block --- + +50dh_midExtend ADD R14,R4,R7 ;Get the new size + STR R14,[R1,#blk__size] ;This is the new size + ADD R1,R1,#blk__oHead ;Point at usable part of blk + ADD R1,R1,R6 ;Find the split offset + ADD R0,R1,R7 ;Find where to move to + SUBS R2,R4,R6 ;How much we have to move + BLNE dh__move ;Do the split op + + ; --- Now update the size and insert free block --- + + ADD R3,R4,R7 ;Find the new size + ADD R4,R4,#blk__oHead+15 ;Add overhead to new size + BIC R4,R4,#15 ;And align nicely + ADD R3,R3,#blk__oHead+15 ;Do the same for the whole... + BIC R3,R3,#15 ;... area size + SUBS R14,R4,R3 ;Get the space left at end + BEQ %85dh_midExtend ;Perfect fit -- skip onwards + + ; --- Insert a free block here --- + + LDR R1,[R5,#0] ;Load the block address + SUB R1,R1,#blk__oHead ;Point to the block descr. + ADD R0,R1,R3 ;Find the end of the area + MOV R2,#0 ;No anchor -- it's free + SUB R3,R14,#blk__oHead ;Subtract overhead size + STMIA R0,{R2,R3} ;Save in descriptor block + BL dh__unCompact ;The heap is not compact now + + ; --- Now everything is great --- + +85dh_midExtend LDR R1,[R5,#0] ;Load the block address + LDMFD R13!,{R0,R2-R9,R14} ;Unstack registers + BICS PC,R14,#V_flag ;And return to caller + + ; --- We failed miserably --- + +90dh_midExtend ADD R13,R13,#4 ;Don't restore R0 on exit + LDMFD R13!,{R2-R9,R14} ;Unstack registers + ORRS PC,R14,#V_flag ;And return to caller + + LTORG + +; --- dh__move --- +; +; On entry: R0 == destination of movement +; R1 == base of block to move +; R2 == size of block to move +; +; On exit: -- +; +; Use: Shunts memory around in the heap, relocating everything that +; needs relocation. + +dh__move ROUT + + STMFD R13!,{R3,R4,R14} ;Save some registers + BL fastMove ;Do the memory movement + + ; --- Now relocate entries on the stack --- + +10dh__move LDR R4,dyn_stackPtr ;Find the stack pointer now + ADR R3,dyn_stack ;Point to the stack base +15dh__move CMP R3,R4 ;Have we finished yet? + BGE %20dh__move ;Yes -- return then + LDR R14,[R3],#4 ;Load next entry from stack + SUB R14,R14,R1 ;Subtract source address + CMP R14,R2 ;Is it in the block? + ADDLO R14,R14,R0 ;Yes -- relocate + STRLO R14,[R3,#-4] ;And store back in stack + B %15dh__move ;And carry on relocating + +20dh__move LDMFD R13!,{R3,R4,PC}^ ;Return to caller + + LTORG + +; --- dh_checkHeap --- +; +; On entry: -- +; +; On exit: May return an error +; +; Use: Checks the current internal format of the heap to make +; sure that it hasn't been corrupted in any way. +; If the integrity check fails then an error is returned. + + EXPORT dh_checkHeap +dh_checkHeap ROUT + + STMFD R13!,{R0-R7,R14} ;Save some registers + + ; --- Start going throught the blocks --- + + LDR R6,dyn_heapSize ;Load the current heap size + DIR R14 ;Is it RISC PC? + LDRGE R5,dyn_areaBase ;Yes -- load the area base + RSBLT R5,R6,#&01800000 ;No -- find the base anyway + ADD R6,R6,R5 ;Find the heap end address + MOV R9,R5 ;Remember heap base address + + ; --- Find a block --- + + MOV R7,R5 ;Previous block +00dh_checkHeap CMP R5,R6 ;Are we at the end yet? + ADRGTL R0,msg_errBadHeap2 ;Oops -- must have a bad len + BGT %90dh_checkHeap ;Gone past -- oops + BEQ %50dh_checkHeap ;Yes -- jump ahead a little + + MOV R0,R5 ;Get the base of area to chk + ADD R1,R0,#blk__oHead ;Get the overhead size + SWI OS_ValidateAddress ;Make sure this is kosher + ADRCSL R0,msg_errBadHeap2 ;No -- must have a bad len + BCS %90dh_checkHeap ;If not, moan at client + LDR R2,[R5,#blk__anchor] ;Get the block's anchor addr + CMP R2,#0 ;Is the block free? + BEQ %10dh_checkHeap ;Yes -- jump ahead + + ; --- Make sure the anchor checks OK --- + + MOV R7,R5 ;This block could be wrong + MOV R0,R2 ;Get the base of area to chk + ADD R1,R0,#4 ;Just check one word + SWI OS_ValidateAddress ;Make sure this is kosher + ADRCSL R0,msg_errBadHeap3 ;Address must be dead then + BCS %90dh_checkHeap ;If not, moan at client + + LDR R0,[R2,#0] ;Load the anchors value + ADD R14,R5,#blk__oHead ;This is what R0 should be + CMP R0,R14 ;Do they match? + ADRNEL R0,msg_errBadHeap1 ;No -- point to the error + BNE %90dh_checkHeap ;And return it joyfully + + ; --- Go round for more then --- + +10dh_checkHeap LDR R3,[R5,#blk__size] ;Get the block size + ADD R3,R3,#blk__oHead+15 ;Add on the overhead bytes + BIC R3,R3,#15 ;And word align the size + ADD R5,R5,R3 ;Yes -- move on to next one + B %00dh_checkHeap ;...go round for another one + +50dh_checkHeap LDMFD R13!,{R0-R7,R14} ;Load registers back + BICS PC,R14,#V_flag ;Return without error + +90dh_checkHeap ADD R13,R13,#4 + STR R7,[R0,#0] ;Store as the error number! + LDMFD R13!,{R1-R7,R14} ;Load registers back + ORRS PC,R14,#V_flag ;Return with error + + LTORG + +; --- dh_changeAnchor --- +; +; On entry: R0 == pointer to anchor for block +; R1 == address of new anchor +; +; On exit: -- +; +; Use: Adjusts a block's anchor, in case it moves. + + EXPORT dh_changeAnchor +dh_changeAnchor ROUT + + STMFD R13!,{R2,R14} ;Save a register + MOV R2,R1 ;Remember this value + BL dh__checkAnchor ;Make sure the anchor's OK + STRVC R2,[R1,#blk__anchor] ;Save the new anchor pointer + ADDVC R14,R1,#blk__oHead ;Skip onto the actual data + STRVC R14,[R2,#0] ;And set the new anchor up + LDMFD R13!,{R2,PC} ;Return to caller + + LTORG + +; --- dh_dump --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Outputs a textual description of the dynamite heap, giving +; details of each block within it. + +dh__preDump LDR R12,[R12] + + EXPORT dh_dump +dh_dump ROUT + + STMFD R13!,{R0-R4,R14} ;Stack some registers + + LDR R4,dyn_heapSize ;Get the current heap size + DIR R14 ;Which direction does it go? + LDRGE R2,dyn_areaBase ;Up -- find the base then + RSBLT R2,R4,#&1800000 ;Down -- start below the RMA + ADD R3,R2,R4 ;Find the heap limit address + + ; --- Display information about the heap in general --- + + ADRL R0,msg_dumpHpBase ;Find the message + MOV R1,R2 ;Get the heap base address + BL dh__writeHex ;And display it + + MOV R1,R4 ;Get the heap size + ADRL R0,msg_dumpHpSize ;Find the message + BL dh__writeHex ;And display it + + LDR R1,dyn_areaSize ;Get the dynamic area size + ADRL R0,msg_dumpHpArSz ;Find the message + BL dh__writeHex ;And display it + + ; --- Now start on the loop --- + +00 CMP R2,R3 ;Have we finished yet? + LDMCSFD R13!,{R0-R4,PC}^ ;Yes -- then return + + SWI OS_NewLine ;Start a new line here + + ADRL R0,msg_dumpBlkAddr ;Point to the message + ADD R1,R2,#blk__oHead ;Point to the current block + BL dh__writeHex ;Display it + + ADRL R0,msg_dumpBlkSize ;Point at the message + MOV R0,R0 ;No-op to prevent objasm bug! + LDR R1,[R2,#blk__size] ;Get the block's size + BL dh__writeHex ;Display it + + LDR R1,[R2,#blk__id] ;Load the magic ID + ADRL R0,msg_dumpBlkId ;Point at the message + BL dh__writeHex ;Display it nicely + + LDR R1,[R2,#blk__anchor] ;Find the anchor address + CMP R1,#0 ;Is the block free? + ADREQL R0,msg_dumpBlkFree ;Yes -- point to the message + SWIEQ XOS_Write0 ;And display it on screen + ADRNEL R0,msg_dumpBlkAnch ;Otherwise show anchor addr + BLNE dh__writeHex ;And move on to next block + + LDR R14,[R2,#blk__size] ;Load the block size again + ADD R14,R14,#blk__oHead+15 ;Add overhead and align + BIC R14,R14,#15 ;To find the next block + ADD R2,R2,R14 ;Move onto the next block + B %b00 ;And skip back into the loop + +dh__writeHex STMFD R13!,{R2,R14} ;Save some registers + SWI XOS_Write0 ;Display the string + SUB R13,R13,#12 ;Make a small buffer + MOV R0,R1 ;Get the number to display + MOV R1,R13 ;Point to the buffer + MOV R2,#12 ;The buffer size, sir + SWI XOS_ConvertHex8 ;Convert it into ASCII + SWI XOS_Write0 ;Display that too + SWI XOS_NewLine ;Move on to a new line + ADD R13,R13,#12 ;Restore the stack pointer + LDMFD R13!,{R2,PC}^ ;And return to caller + + LTORG + +;----- * Commands ----------------------------------------------------------- + + AREA |Dynamite$$Commands|,CODE,READONLY + + DCB "Dynamite_HeapDump",0 + DCD dh__preDump + DCD 0 + DCD synt_heapDump + DCD help_heapDump + +;----- Data structures ------------------------------------------------------ + +; --- Block descriptors --- + + ^ 0 +blk__anchor # 4 ;Address of block's anchor +blk__size # 4 ;Block's size, as allocated +blk__id # 4 ;Client's magic ID number +blk__oHead # 0 ;Overhead on allocated blocks + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/s/dynTask b/StraySrc/Dynamite/dynamite/s/dynTask new file mode 100644 index 0000000..6d3e5e3 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/s/dynTask @@ -0,0 +1,305 @@ +; +; dynTask.s +; +; The background compacting WIMP task +; +; © 1994-1998 Straylight +; +;----- Licensing note ------------------------------------------------------- +; +; This file is part of Straylight's Dynamite +; +; Dynamite is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. +; +; Dynamite is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with Dynamite. If not, write to the Free Software Foundation, +; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +;----- Standard header ------------------------------------------------------ + + GET libs:header + GET libs:swis + + GET libs:stream + +;----- External dependencies ------------------------------------------------ + + GET sh.dynHeap + GET sh.wSpace + + GET sh.messages + + IMPORT dyn_base + +;----- Main code ------------------------------------------------------------ + + AREA |Dynamite$$Code|,CODE,READONLY + +; --- dt_service --- +; +; On entry: R1 == service call number +; Other registers depend on R1 +; +; On exit: Depends on service call +; +; Use: Handles service calls for Dynamite + + EXPORT dt_service +dt_service ROUT + + ; --- Get rid of unwanted services quickly --- + + CMP R1,#&4A + CMPNE R1,#&27 + CMPNE R1,#&49 + MOVNES PC,R14 + + ; --- Now dispatch wanted services --- + + LDR R12,[R12,#0] ;Get my workspace pointer + STMFD R13!,{R14} ;Save some useful registers + + CMP R1,#&27 ;Service_Reset... + BEQ %20dt_service + + CMP R1,#&4A ;Service_StartedWimp + BEQ %10dt_service + + ; --- Service_StartWimp --- + + LDR R14,dyn_taskHandle ;Get my task handle + CMP R14,#0 ;Am I already running? + MOVEQ R14,#-1 ;I'm trying to start up + STREQ R14,dyn_taskHandle ;Store as my task handle + ADREQL R0,dt__commands ;Point to the command string + MOVEQ R1,#0 ;Claim the service call + LDMFD R13!,{PC}^ ;Return to RISC OS + + ; --- Service_StartedWimp --- + +10dt_service LDR R14,dyn_taskHandle ;Get my task handle + CMP R14,#-1 ;Am I already running? + MOVEQ R14,#0 ;No -- blank out task handle + STREQ R14,dyn_taskHandle ;Store it over the old one + LDMFD R13!,{PC}^ ;Return happily + + ; --- Service_Reset --- + +20dt_service MOV R14,#0 ;Blank out my task handle + STR R14,dyn_taskHandle ;Store it over the old one + LDMFD R13!,{PC}^ ;Return to RISC OS now + + LTORG + +; --- dt__startTask --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Starts up the Dynamite application from a *Command. + +dt__startTask ROUT + + LDR R12,[R12] ;Load my workspace address + LDR R0,dyn_taskHandle ;Get my task handle variable + CMP R0,#-1 ;Am I waiting to start? + ADRNEL R0,msg_errDesk ;No -- moan at stupid user + ORRNES PC,R14,#V_flag ;And return the error + MOV R0,#1 ;We're launching the app + STR R0,dyn_launch ;So set the launch flag + STMFD R13!,{R14} ;Save a register nicely + MOV R0,#2 ;Start my module up + ADR R1,dt__myName ;Point to the module name + SWI XOS_Module ;Start up the task proper + LDMFD R13!,{PC} ;And return to caller + +dt__myName DCB "Dynamite",0 + + LTORG + +; --- dt_quit --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Closes down Dynamite's WIMP task (used for background +; compaction of the heap). + + EXPORT dt_quit +dt_quit ROUT + + STMFD R13!,{R0,R1,R14} ;Save some registers + LDR R0,dyn_taskHandle ;Find my task handle + LDR R1,=&4B534154 ;The magic number thing + SWI XWimp_CloseDown ;Close down the application + MOV R14,#0 ;Now we don't have a task + STR R14,dyn_taskHandle ;So zap my task handle + LDMFD R13!,{R0,R1,PC}^ ;And return to caller + + LTORG + +; --- dt_run --- +; +; On entry: R12 == address of module private word +; +; On exit: Via OS_Exit +; +; Use: Runs the Dynamite WIMP task. + + EXPORT dt_run +dt_run ROUT + + LDR R12,[R12] ;Find my workspace address + ADR R13,dyn_pollBlk+256 ;Make a microstack + + ; --- Is it worth doing anything? --- + + MOV R0,#0 ;How many Wimp tasks? + SWI Wimp_ReadSysInfo ;Read the number back + CMP R0,#0 ;Are there any running? + SWIEQ OS_Exit ;Nope: then don't bother + + ; --- Handle the ultra-weird launch sequence --- + + LDR R14,dyn_launch ;Load the launch flag + CMP R14,#0 ;Are we launching? + BEQ %50dt_run ;No -- launch then + + ; --- Start up the WIMP thing --- + + MOV R0,#200 ;Make it run under RISC OS 2 + LDR R1,=&4B534154 ;Get the magic number thing + ADR R2,dt__taskName ;Point to the task name + SWI Wimp_Initialise ;Start up the WindowManager + STR R1,dyn_taskHandle ;Save the task handle + + ; --- Remove my name from the Switcher's list --- + + ADR R1,dyn_pollBlk ;Point to the poll block + MOV R0,#20 ;Minimum message size + STR R0,[R1,#0] ;Save in position 0 + MOV R2,#0 ;This is not a reply + MOV R3,#&40000 ;The TaskCloseDown message + ORR R3,R3,#&000C3 ;It comes in two episodes + ADD R0,R1,#12 ;Point to bit of message blk + STMIA R0,{R2,R3} ;Build the message in there + MOV R0,#17 ;Don't get a reply + MOV R2,#0 ;Give everyone a shot at it + SWI XWimp_SendMessage ;Send it the message + + ; --- Now do the main loop --- + +00dt_run LDR R14,dyn_hpFlags ;Load the heap's flags + TST R14,#hpFlag_tidy ;Is the heap tidy? + LDREQ R14,dyn_lockCount ;No -- then load lock count + CMPEQ R14,#0 ;Is the heap locked? + MOVNE R0,#1 ;Tidy or locked, so be nice + MOVEQ R0,#0 ;Otherwise use idles + ADR R1,dyn_pollBlk ;Point to my pollblock + ADD R13,R1,#256 ;Make a bogus stack + SWI Wimp_Poll ;Do the poll thing + CMP R0,#0 ;Is it an idle event? + SWIEQ Dynamite_Reduce ;Yes -- then reduce the heap + CMP R0,#17 ;Is it a message + CMPNE R0,#18 ;Of either type + LDREQ R0,[R1,#16] ;Get the message type + CMPEQ R0,#0 ;Is it a Message_Quit + LDRNE R14,dyn_hpFlags ;No -- load the flags + BICNE R14,R14,#hpFlag_mSent ;...clear the message sent + STRNE R14,dyn_hpFlags ;...save the flags back + BNE %00dt_run ;...loop round again + + ; --- I've been told to quit --- + ; + ; Seeing as I've viciously and nastily removed myself from + ; the TaskManager's task table, I know this must have been + ; a broadcast quit, so I hari-kiri with wanton abandon. + + SWI Wimp_CloseDown ;Close down the task + MOV R0,#0 ;No task handle any more + STR R0,dyn_taskHandle ;So zero it then + SWI OS_Exit ;Farewell, cruel world + +dt__taskName DCB "DynamiteCompactor",0 + + ; --- Launch the Compactor task --- + +50dt_run MOV R0,#200 ;Make it run under RISC OS 2 + LDR R1,=&4B534154 ;Get the magic number thing + ADR R2,dt__launchName ;Point to the task name + SWI Wimp_Initialise ;Start up the WindowManager + + MOV R0,#-1 ;Fake a startup sequence + STR R0,dyn_taskHandle ;Save this as my task handle + LDR R0,=dt__commands ;Point to my main command + BL dyn_base ;Find the module base + ADD R0,R14,R0 ;Relocate the address + SWI Wimp_StartTask ;Start it up nicely + + SWI Wimp_CloseDown ;Tell WIMP to get knotted + SWI OS_Exit ;And kill self evilly + +dt__launchName DCB "DynamiteLauncher",0 + + LTORG + +; --- dt_message --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Sends a silly message to the Compactor task so that it gets +; control again if it disabled idle events. + + EXPORT dt_message +dt_message ROUT + + STMFD R13!,{R0-R3,R14} ;Save some registers + LDR R14,dyn_taskHandle ;Load my task handle + CMP R14,#0 ;Is it vaguely sensible? + LDMLEFD R13!,{R0-R3,PC}^ ;No -- don't bother then + LDR R14,dyn_hpFlags ;Load the flags + TST R14,#hpFlag_mSent ;Has a message been sent? + LDMNEFD R13!,{R0-R3,PC}^ ;Yes -- then return + ORR R14,R14,#hpFlag_mSent ;Set the flag + STR R14,dyn_hpFlags ;And save the flags back + ADR R1,dyn_pollBlk ;Point to the poll block + MOV R0,#20 ;Minimum message size + STR R0,[R1,#0] ;Save in position 0 + MOV R2,#0 ;This is not a reply + MOV R3,#&4A000 ;A bogus message number + ORR R3,R3,#&003C0 ;(My SWI chunk base) + ADD R0,R1,#12 ;Point to bit of message blk + STMIA R0,{R2,R3} ;Build the message in there + MOV R0,#17 ;Don't get a reply + MOV R2,R14 ;Get my task handle + SWI XWimp_SendMessage ;Send it the message + LDMFD R13!,{R0-R3,PC}^ ;And return to caller + + LTORG + + ; --- *Commands --- + + AREA |Dynamite$$Commands|,CODE,READONLY + +dt__commands DCB "Desktop_DynamiteCompactor",0 + DCD dt__startTask + DCD 0 + DCD synt_compactor + DCD help_compactor + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/s/dynamite b/StraySrc/Dynamite/dynamite/s/dynamite new file mode 100644 index 0000000..2024e17 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/s/dynamite @@ -0,0 +1,608 @@ +; +; dynamite.s +; +; Memory management in a dynamic area +; +; © 1994-1998 Straylight + +;----- Licensing note ------------------------------------------------------- +; +; This file is part of Straylight's Dynamite +; +; Dynamite is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. +; +; Dynamite is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with Dynamite. If not, write to the Free Software Foundation, +; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +;----- Standard header ------------------------------------------------------ + + GET libs:header + GET libs:swis + + GET libs:stream + +;----- External dependencies ------------------------------------------------ + + GET sh.dynAnchor + GET sh.dynArea + GET sh.dynHeap + GET sh.dynTask + GET sh.wSpace + + GET sh.messages + + IMPORT version + IMPORT |Dynamite$$Commands$$Base| + +;----- Module header -------------------------------------------------------- + + AREA |!!!Module$$Header|,CODE,READONLY + +dyn__base DCD dt_run ;Application code + DCD dyn__init ;Initialisation + DCD dyn__quit ;Finalisation + DCD dt_service ;Service call handling + DCD dyn__name ;Module title string + DCD version ;Module help string + DCD |Dynamite$$Commands$$Base| ;Command table + DCD &4A3C0 ;SWI chunk number + DCD dyn__swis ;SWI handler code + DCD dyn__swiNames ;SWI name table + DCD 0 ;SWI name-number code + +dyn__name DCB "Dynamite",0 + +;----- Main module code ----------------------------------------------------- + + AREA |Dynamite$$Code|,CODE,READONLY + +; --- dyn_base --- +; +; On entry: -- +; +; On exit: R14 == base address of module +; +; Use: Finds the base address of the module. + + EXPORT dyn_base +dyn_base ROUT + + STMFD R13!,{R14} + ADR R14,dyn__base + LDMFD R13!,{PC}^ + + LTORG + +; --- dyn__init --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Claims some memory, and intercepts OS_ChangeDynamicArea. + +dyn__init ROUT + + STMFD R13!,{R7,R8,R14} ;Save some registers + + ; --- Allocate module workspace --- + + MOV R0,#6 ;Claim RMA workspace + LDR R3,=dyn_wSize ;Get my workspace size + SWI XOS_Module ;Allocate the workspace + LDMVSFD R13!,{R7,R8,PC} ;If it failed, return error + STR R2,[R12,#0] ;Save workspace address + MOV R12,R2 ;Point to workspace nicely + STR R12,dyn__wsAddr ;Store for my patch code + + MOV R0,#0 ;Initialise some workspace + STR R0,dyn_areaSize ;Dynamic area not created yet + STR R0,dyn_heapSize ;No data in the heap + STR R0,dyn_lockCount ;And clear the lock counter + STR R0,dyn_launch ;Make RMRun do clever stuff + STR R0,dyn_taskHandle ;And make the task handle 0 + STR R0,dyn_ancTable ;Clear the free anchor table + STR R0,dyn_ancList ;And the anchor block list + MOV R0,#hpFlag_tidy ;We are compacted now + STR R0,dyn_hpFlags ;So make a note of this + + ADR R14,dyn_stack ;Point to reloc stack base + STR R14,dyn_stackPtr ;Save as the stack pointer + + ; --- Claim OS_ChangeDynamicArea --- + ; + ; We trap this in the kernel branch table, rather than at + ; the SWI vector, because it's so much easier. + + SWI XOS_ReadMemMapInfo ;Read nice things + STR R0,dyn_pageSize ;Save the page size + SUB R1,R1,#1 ;Chop one off for da_findPage + STR R1,dyn_pageCount ;And the number of them + MOV R14,#0 ;Log 2 of page size +00dyn__init TST R0,#1 ;Is bottom bit set yet? + MOVEQ R0,R0,LSR#1 ;No -- shift along a bit + ADDEQ R14,R14,#1 ;Add to the log + BEQ %00dyn__init ;And keep on going + STR R14,dyn_log2PageSize ;And store this away + + MOV R0,#129 ;The OS_Byte number + MOV R1,#0 ;Lovely... + MOV R2,#255 ;...jubbly! + SWI XOS_Byte ;Get OS Version number + STR R1,dyn_machine ;Store this away + CMP R1,#&A5 ;Is this a RISC PC? + BGE %50dyn__init ;Yes -- jump ahead then + CMP R1,#&A3 ;Is it RISC OS 2? + LDRLT R0,=&ABC ;Yes --- this is sprarea size + LDRGE R0,=&ACC ;No -- this is then + STR R0,dyn_sprSize ;Save in the workspace + + MOV R6,PC ;Get the current status + TST R6,#IRQ_disable ;Are IRQs enabled? + TEQEQP R6,#IRQ_disable ;Yes -- disable them then + + LDR R0,=&01F033FC ;Find the kernel dispatcher + LDR R14,[R0,#OS_ChangeDynamicArea*4] + STR R14,dyn_oldChnArea ;Save this in my workspace + ADR R14,dyn__patch ;Point to my patch routine + STR R14,[R0,#OS_ChangeDynamicArea*4] + + LDR R14,[R0,#OS_ReadDynamicArea*4] + STR R14,dyn_oldReadArea ;Save this in my workspace + ADR R14,dyn__readPatch ;Point to my patch routine + STR R14,[R0,#OS_ReadDynamicArea*4] + + LDR R14,[R0,#OS_ValidateAddress*4] + STR R14,dyn_oldValidate ;Save this in my workspace + ADR R14,dyn__valPatch ;Point to my patch routine + STR R14,[R0,#OS_ValidateAddress*4] + TEQP R6,#0 ;Restore interrupt status + MOV R0,R0 ;Shut the assembler up + + ; --- Find the TaskManager and WindowManager addresses --- + + ADR R6,dyn_switchBase ;Point to bit of workspace + MOV R0,#18 ;Look up modules by name + ADR R1,dyn__switcher ;Point to the Switcher's name + SWI XOS_Module ;Try and find its address + MOVVS R3,#0 ;If not there, dummy address + MOVVS R4,#0 ;For that and the end + LDRVC R4,[R3,#-4] ;Otherwise load module length + STMIA R6!,{R3,R4} ;Save them in workspace + + ADR R1,dyn__wimp ;Point to the Wimp's name + SWI XOS_Module ;Try and find its address + MOVVS R3,#0 ;If not there, dummy address + MOVVS R4,#0 ;For that and the end + LDRVC R4,[R3,#-4] ;Otherwise load module length + STMIA R6!,{R3,R4} ;Save them in workspace + LDMFD R13!,{R7,R8,PC}^ ;Return to caller + + ; --- The machine is a RISC PC -- lucky sod! --- + +50dyn__init MOV R0,#0 ;Create dynamic area + MOV R1,#-1 ;No particular number + MOV R2,#0 ;Initial size of area + MOV R3,#-1 ;No particular base address + MOV R4,#&80 ;The area flags + MOV R5,#-1 ;No maximum size please + MOV R6,#0 ;No handler needed + MOV R7,#0 ;Workspace to pass to handler + ADR R8,dyn__areaName ;Dynamic area name + SWI XOS_DynamicArea ;Create the area + STRVC R1,dyn_areaHandle ;Store the handle + STRVC R3,dyn_areaBase ;And the base address + + LDMFD R13!,{R7,R8,PC} ;Return to caller + +dyn__switcher DCB "TaskManager",0 +dyn__wimp DCB "WindowManager",0 +dyn__areaName DCB "Dynamite",0 + + LTORG + +dyn__wsAddr DCD 0 ;Yuk -- address of workspace + +; --- dyn__quit --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Tries to close Dynamite down. + +dyn__quit ROUT + + STMFD R13!,{R12,R14} ;Save a register + LDR R12,[R12] ;Find my workspace address + + ; --- Make sure we're not needed --- + + BL dh_compact ;Compact the heap first + LDR R14,dyn_areaSize ;How much space are we using? + CMP R14,#0 ;Is it 0? + BNE %45dyn__quit ;No -- people might want them + LDR R14,dyn_stackPtr ;Load the stack pointer + ADR R0,dyn_stack ;Point to the stack base + CMP R14,R0 ;Are these equal? + BNE %45dyn__quit ;No -- we're still used then + + ; --- Close down the compactor --- + + LDR R14,dyn_taskHandle ;Get the task handle + CMP R14,#0 ;Is it a sensible one? + BLGT dt_quit ;Yes -- kill the task then + BL danc_quit ;Free all anchor blocks + + ; --- Get rid of all used pages --- + + LDR R0,dyn_areaSize ;Get the area size + LDR R1,dyn_log2PageSize ;And log 2 of page size + MOV R0,R0,LSR R1 ;Number of pages in area + BL da_removePages ;Remove pages + + LDR R0,dyn_machine ;Get the machine type + CMP R0,#&A5 ;Is it a RISC PC? + BGE %60dyn__quit ;Yes -- jump ahead + + ; --- First, try to release OS_ChangeDynamicArea --- + + LDR R0,=&01F033FC ;Find the kernel dispatcher + LDR R1,[R0,#OS_ChangeDynamicArea*4] + ADR R14,dyn__patch ;Point to my patch routine + CMP R1,R14 ;Can I release it safely? + BNE %50dyn__quit ;No -- report an error + + LDR R1,[R0,#OS_ReadDynamicArea*4] + ADR R14,dyn__readPatch ;Point to my patch routine + CMP R1,R14 ;Can I release it safely? + BNE %50dyn__quit ;No -- report an error + + LDR R1,[R0,#OS_ValidateAddress*4] + ADR R14,dyn__valPatch ;Point to my patch routine + CMP R1,R14 ;Can I release it safely? + BNE %50dyn__quit ;No -- report an error + + LDR R14,dyn_oldChnArea ;Load the previous value + STR R14,[R0,#OS_ChangeDynamicArea*4] + LDR R14,dyn_oldReadArea ;Load the previous value + STR R14,[R0,#OS_ReadDynamicArea*4] + LDR R14,dyn_oldValidate ;Load the previous value + STR R14,[R0,#OS_ValidateAddress*4] + + ; --- Free the workspace I claimed --- + +40dyn__quit MOV R0,#7 ;Free RMA workspace + MOV R2,R12 ;Point to my workspace + SWI XOS_Module ;Try to free it nicely + LDR R0,[R13],#4 ;Load private word address + MOV R14,#0 ;Clear private word value + STR R14,[R0,#0] ;To stop OS doing this too... + LDMFD R13!,{PC}^ ;Return to caller + + ; --- We have handles or relocation entries --- + +45dyn__quit ADRL R0,msg_errInUse ;Point to error message + LDMFD R13!,{R12,R14} ;Unstack some registers + ORRS PC,R14,#V_flag ;Return to caller with error + + ; --- We couldn't release OS_ChangeDynamicArea --- + +50dyn__quit ADRL R0,msg_errRelease ;Point to error message + LDMFD R13!,{R12,R14} ;Unstack some registers + ORRS PC,R14,#V_flag ;Return to caller with error + + ; --- We're on a RISC PC --- + +60dyn__quit MOV R0,#1 ;Remove dynamic area + LDR R1,dyn_areaHandle ;Get the area handle + SWI XOS_DynamicArea ;Remove it then + B %40dyn__quit ;Now free workspace etc. + + LTORG + +; --- dyn__patch --- +; +; On entry: As for ChangeDynamicArea +; +; On exit: Ditto +; +; Use: Mangles ChangeDynamicArea when being used on the system +; sprite area. + +dyn__patch ROUT + + LDR R12,dyn__wsAddr ;Find my workspace address + CMP R0,#3 ;Is it the sprite area? + LDRNE PC,dyn_oldChnArea ;No -- continue as normal + + ; --- Mangle the `remembered' size of the sprite area --- + + STMFD R13!,{R14} ;Save another register + LDR R11,dyn_sprSize ;Find the size word + LDR R14,[R11,#0] ;Load total sprite area size + ADD R10,R14,R1 ;How much does he want? + CMP R10,#4*1024*1024 ;More than 4 megs? + BGT %90dyn__patch ;Yes -- that's an error + LDR R10,dyn_areaSize ;Load my area's size + SUB R14,R14,R10 ;Get the size of the sprites + STR R14,[R11,#0] ;Save that for the duration + + ; --- This is nasty and complicated --- + ; + ; Post processing on kernel SWIs is not something normally + ; to be enjoyed. The way things will have to be done is as + ; follows: + ; + ; * We save R14 and the value &2002A (XOS_ChangeDynamicArea) + ; on the stack. The SWI value is so that we regain control + ; if something went sadly amiss. + ; + ; * We call the previous OS_ChangeDynamicArea routine, having + ; set a suitably bogus return address. + ; + ; * We mangle the system sprite area in a manner in keeping + ; with the aim of the program. + ; + ; * Then we examine the status returned to us, and if V was + ; set AND the X bit of the R11 saved on the stack before + ; we were entered at the top was clear we call + ; OS_GenerateError. + + MOV R11,#OS_ChangeDynamicArea ;Get the SWI number + ORR R11,R11,#&20000 ;Set the X bit nicely + STMFD R13!,{R10-R12} ;Save other registers here + STMFD R13!,{R11} ;And the obviously bogus R11 + MOV R14,PC ;Set up a return address + LDR PC,dyn_oldChnArea ;And let it rip... + + ; --- We have now done a ChangeDynamicArea --- + ; + ; R14 saved above is on the stack, along with the caller's + ; R10-R12 from the OS SWI dispatcher. + + LDR R11,dyn_sprSize ;Find the size word + LDR R14,[R11,#0] ;Load the new area size + ADD R14,R14,R10 ;Add the old difference + STR R14,[R11,#0] ;And save it back again + +50dyn__patch LDMFD R13!,{R14} ;Get his return address + LDMFD R13!,{R11} ;Get the SWI number too + LDMVCFD R13!,{R10-R12} ;Restore his registers + BICVCS PC,R14,#V_flag ;And return control to him + + TST R11,#&20000 ;Was the X bit set? + SWIEQ OS_GenerateError ;No -- do error like things + + LDMFD R13!,{R10-R12} ;Restore his registers + ORRS PC,R14,#V_flag ;And return the error + + ; --- He wanted too much memory --- + +90dyn__patch ADRL R0,msg_errTooBig ;Point to the error + CMP R0,#&80000000 ;Create an overflow + B %50dyn__patch ;Make it look like it came + ;from ChangeDynamicArea + LTORG + +; --- dyn__readPatch --- +; +; On entry: R0 == dynamic area to read, and flags etc. +; +; On exit: R1 == size of dynamic area, R2 == optional maximum size +; +; Use: Reads the size of a dynamic area. If the caller is +; interested in the sprite area AND they're not either the +; TaskManager or the WindowManager, we mangle the result so +; they think that the sprite area doesn't contain our clever +; heap. + +dyn__readPatch ROUT + + LDR R12,dyn__wsAddr ;Find my workspace address + BIC R10,R0,#&80 ;Clear the clever flag bit + CMP R10,#3 ;Is it the sprite area? + LDRNE PC,dyn_oldReadArea ;No -- continue as normal + + ; --- Do all the work then --- + ; + ; Seeing as we know all there is to know about the sprite + ; area, we can do all this here without the yukkiness of + ; postprocessing. + + STMFD R13!,{R2,R14} ;Save the link register + ADR R11,dyn_switchBase ;Find module addresses + BIC R10,R14,#&FC000003 ;Find caller's address + LDMIA R11!,{R1,R2} ;Load switcher base/size + SUB R14,R10,R1 ;Subtract switcher base + CMP R14,R2 ;Is it within switcher? + LDMHSIA R11!,{R1,R2} ;No -- load wimp base/size + SUBHS R14,R10,R1 ;Subtract wimp base + CMPHS R14,R2 ;Is it within wimp? + LDMFD R13!,{R2,R14} ;Unstack registers again + + LDR R1,dyn_sprSize ;Find sprite area size word + LDR R1,[R1,#0] ;Load current sprite size + LDRHS R10,dyn_areaSize ;If caller is pleb, mangle it + SUBHS R1,R1,R10 ;By subtracting our heap size + TST R0,#&80 ;Does he want max size? + MOVNE R2,#4*1024*1024 ;Yes -- that's 4MB + MOV R0,#&01400000 ;Point to sprite area start + + ADD R13,R13,#4 ;Skip past stacked R11 + LDMFD R13!,{R10-R12} ;Unstack caller's registers + BICS PC,R14,#V_flag ;And return to caller + + LTORG + +; --- dyn__valPatch --- +; +; On entry: As for OS_ValidateAddress +; +; On exit: As for OS_ValidateAddress +; +; Use: Mangles OS_ValidateAddress so that it gets our somewhat +; rearranged sprite area correct. This is necessary due to +; braindead implementation of OS_ValidateAddress. I'd like to +; be able to do the job properly by hacking the CAM map, but +; the Mysterious Background Address Validator assumes that the +; SWI works in the way Acorn wrote it, so that's put the +; kybosh on that plan. + +dyn__valPatch ROUT + + LDR R12,dyn__wsAddr ;Find my workspace address + + STMFD R13!,{R14} ;Save the link register + MOV R10,#&01400000 ;Get base of the sprite area + MOV R11,#&01800000 ;Get limit too + CMP R0,R10 ;Is it in there? + CMPCS R11,R0 + CMPCS R1,R10 + CMPCS R11,R1 + LDMCCFD R13!,{R14} ;No -- restore link + LDRCC PC,dyn_oldValidate ;And let OS_VA do it then + + ; --- Check for weird sprite area thing and Dynamite area --- + + LDR R11,dyn_sprSize ;Get address of sprite size + LDR R11,[R11,#0] ;Load size of sprite area + LDR R14,dyn_areaSize ;Load our area size + ADD R11,R10,R11 ;Find end of sprite area + SUB R10,R11,R14 ;Taking our area into account + MOV R11,#&01800000 ;Find top of sprite slot + SUB R11,R11,R14 ;Find bottom of our area + CMP R11,R0 ;This is deep -- think about + CMPHI R1,R10 ;it for a while. + LDMFD R13!,{R14} ;If it isn't invalid... + ADD R13,R13,#4 + LDMFD R13!,{R10-R12} + ORRHIS PC,R14,#C_flag + BICLSS PC,R14,#C_flag + + LTORG + +; --- dyn__swis --- +; +; On entry: R11 == SWI index +; +; On exit: Depends on the SWI +; +; Use: Dispatches SWIs to other routines + +dyn__swis ROUT + + LDR R12,[R12] ;Find my module workspace + + CMP R11,#&3F + BEQ dh_dump + + CMP R11,#(%10-%00)/4 ;Is the SWI in range? + ADDLO PC,PC,R11,LSL #2 ;Yes -- dispatch it then + B %10dyn__swis ;Otherwise report the error + +00dyn__swis B dh_alloc ;Dynamite_Claim + B dh_free ;Dynamite_Free + B dh_freeWithID ;Dynamite_FreeWithID + B dh_blockInfo ;Dynamite_BlockInfo + B dh_changeID ;Dynamite_ChangeID + B dh_extend ;Dynamite_Resize + B dh_midExtend ;Dynamite_MidExtend + B dh_save ;Dynamite_Save + B dh_load ;Dynamite_Load + B dh_reduce ;Dynamite_Reduce + B dh_compact ;Dynamite_Compact + B dh_lock ;Dynamite_Lock + B dh_unlock ;Dynamite_Unlock + B danc_alloc ;Dynamite_ClaimAnchor + B danc_free ;Dynamite_ReleaseAnchor + B da_readSize ;Dynamite_ReadSpriteSize + B da_describe ;Dynamite_Describe + B dh_checkHeap ;Dynamite_IntegrityCheck + B dh_changeAnchor ;Dynamite_ChangeAnchor + +10dyn__swis ADRL R0,msg_errBadSWI ;Point at the error + ORRS PC,R14,#V_flag ;And return it back + +dyn__swiNames DCB "Dynamite",0 + DCB "Alloc",0 + DCB "Free",0 + DCB "FreeWithID",0 + DCB "BlockInfo",0 + DCB "ChangeID",0 + DCB "Resize",0 + DCB "MidExtend",0 + DCB "Save",0 + DCB "Load",0 + DCB "Reduce",0 + DCB "Compact",0 + DCB "Lock",0 + DCB "Unlock",0 + DCB "ClaimAnchor",0 + DCB "ReleaseAnchor",0 + DCB "ReadSpriteSize",0 + DCB "Describe",0 + DCB "IntegrityCheck",0 + DCB "ChangeAnchor",0 + DCB 0 + + LTORG + +; --- *Dynamite_Clear --- + +dyn__clear ROUT + + STMFD R13!,{R14} ;Save a register + LDR R12,[R12] ;Load the workspace address + + ; --- Empty the heap --- + + LDR R0,dyn_areaSize ;Get the area size + LDR R1,dyn_log2PageSize ;And log 2 of page size + MOV R0,R0,LSR R1 ;Number of pages in area + BL da_removePages ;Remove pages + + ; --- Free all the anchors --- + + BL danc_quit ;Free all allocated anchors + + ; --- Reset the heap variables --- + + MOV R0,#0 ;Initialise some workspace + STR R0,dyn_areaSize ;Dynamic area not created yet + STR R0,dyn_heapSize ;No data in the heap + STR R0,dyn_lockCount ;And clear the lock counter + STR R0,dyn_ancTable ;Clear the free anchor table + STR R0,dyn_ancList ;And the anchor block list + MOV R0,#hpFlag_tidy ;We are compacted now + STR R0,dyn_hpFlags ;So make a note of this + + LDMFD R13!,{PC}^ ;And return to caller + + LTORG + + ; --- *Commands --- + + AREA |Dynamite$$Commands|,CODE,READONLY + + DCB "Dynamite_Clear",0 + DCD dyn__clear + DCD 0 + DCD synt_clear + DCD help_clear + + AREA |Dynamite$$Commands_End|,CODE,READONLY + DCD 0 + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/s/fastMove b/StraySrc/Dynamite/dynamite/s/fastMove new file mode 100644 index 0000000..6e9b1f0 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/s/fastMove @@ -0,0 +1 @@ + LNK libs:s.fastMove diff --git a/StraySrc/Dynamite/dynamite/sh/dynAnchor b/StraySrc/Dynamite/dynamite/sh/dynAnchor new file mode 100644 index 0000000..49f1439 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/sh/dynAnchor @@ -0,0 +1,51 @@ +; +; dynAnchor.sh +; +; Useful handle RMA allocation for dynamite +; +; © 1994 Straylight +; + +;----- Overview ------------------------------------------------------------- +; +; Functions provided: +; +; danc_alloc +; danc_free +; danc_quit + +; --- danc_alloc --- +; +; On entry: -- +; +; On exit: R0 == pointer to block allocated, or V set and pointer to +; error +; +; Use: Allocates an anchor to use with dynamite from the RMA, +; in a very quick way indeed. + + IMPORT danc_alloc + +; --- danc_free --- +; +; On entry: R0 == pointer to block +; +; On exit: Registers preserved +; +; Use: Frees an anchor allocated using danc_alloc. + + IMPORT danc_free + +; --- danc_quit --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Frees everyone's anchors nicely when the module quits. + + IMPORT danc_quit + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/sh/dynArea b/StraySrc/Dynamite/dynamite/sh/dynArea new file mode 100644 index 0000000..3edf5a9 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/sh/dynArea @@ -0,0 +1,79 @@ +; +; dynArea.sh +; +; The handling of the dynamic area itself +; +; © 1994 Straylight +; + +;----- Overview ------------------------------------------------------------- +; +; Functions provided: +; +; da_findPage +; da_addPages +; da_removePages +; da_readSize +; da_describe + +; --- da_findPage --- +; +; On entry: R2 == address of the page +; +; On exit: R0 == page number +; +; Use: Finds the page number of the page with the address given. + + IMPORT da_findPage + +; --- da_addPages --- +; +; On entry: R0 == number of pages to add +; R12 == workspace address +; +; On exit: Possible error returned +; +; Use: Increases the size of the dynamic area by the number of +; pages given in R0 + + IMPORT da_addPages + +; --- da_removePages --- +; +; On entry: R0 == number of pages to remove +; +; On exit: -- +; +; Use: Removes the given number of pages from the dynamite +; area. If the number of pages to remove is greater than +; the actual number of pages allocated, as many as possible +; are removed + + IMPORT da_removePages + +; --- da_readSize --- +; +; On entry: -- +; +; On exit: R0 == size of area +; +; Use: Returns the size of the sprite area (including the +; dynamite area). + + IMPORT da_readSize + +; --- da_describe --- +; +; On entry: -- +; +; On exit: R0 == dynamic area number (3 == sprite area) +; R1 == size of area +; R2 == total free in area +; +; Use: Gives back som information on the dynamite area. + + IMPORT da_describe + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/sh/dynHeap b/StraySrc/Dynamite/dynamite/sh/dynHeap new file mode 100644 index 0000000..ac4c3b6 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/sh/dynHeap @@ -0,0 +1,226 @@ +; +; dynHeap.sh +; +; New heap management for Dynamite +; +; © 1994 Straylight +; + +;----- Overview ------------------------------------------------------------- +; +; Functions provided: +; +; dh_alloc +; dh_free +; dh_freeWithID +; dh_blockInfo +; dh_changeID +; dh_reduce +; dh_compact +; dh_lock +; dh_unlock +; dh_save +; dh_load +; dh_extend +; dh_midExtend +; dh_checkHeap +; dh_changeAnchor +; dh_dump + + [ :LNOT::DEF:dynHeap__dfn + GBLL dynHeap__dfn + +; --- dh_alloc --- +; +; On entry: R0 == pointer to anchor +; R1 == size to allocate in bytes +; R2 == ID value to store +; +; On exit: R0 and R1 preserved +; R2 == address of block allocated +; +; Use: Allocates a block from the Dynamite heap. + + IMPORT dh_alloc + +; --- dh_free --- +; +; On entry: R0 == pointer to anchor of block to free +; +; On exit: -- +; +; Use: Frees a Dynamite block. + + IMPORT dh_free + +; --- dh_freeWithID --- +; +; On entry: R0 == ID of all blocks to free +; +; On exit: -- +; +; Use: Frees all allocated blocks with a given ID number. + + IMPORT dh_freeWithID + +; --- dh_blockInfo --- +; +; On entry: R0 == address of block anchor +; +; On exit: R0 preserved +; R1 == address of block +; R2 == size of block +; R3 == block ID +; +; Use: Returns information about a Dynamite block + + IMPORT dh_blockInfo + +; --- dh_changeID --- +; +; On entry: R0 == address of anchor block, or 0 for all +; R1 == new ID +; R2 == old ID (if R0 == 0) +; +; On exit: -- +; +; Use: This call is use to change the ID of either an individual +; block (R0 == address of anchor), or the ID of all the +; blocks with the ID passed in R2 (if R0 == 0). + + IMPORT dh_changeID + +; --- dh_reduce --- +; +; On entry: -- +; +; On exit: CS if there was nothing we could do +; +; Use: Tries to shunt the free space in the heap off the end and +; back into the operating system's free pool. It does it a +; little bit and then stops, rather like those workmen on the +; M40. + + IMPORT dh_reduce + +; --- dh_compact --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Does a full compaction of the heap. + + IMPORT dh_compact + +; --- dh_lock --- +; +; On entry: -- +; +; On exit: R10 corrupted (SWIs don't care about this) +; +; Use: Locks the heap, so that compaction entirely fails to happen. + + IMPORT dh_lock + +; --- dh_unlock --- +; +; On entry: -- +; +; On exit: R10 corrupted (SWIs don't care about this) +; +; Use: Unlocks the heap, so that compaction can happen again, maybe. + + IMPORT dh_unlock + +; --- dh_save --- +; +; On entry: R0 == mask of registers to save +; +; On exit: R10, R11 corrupted +; +; Use: Saves a load of registers on the Dynamite relocation stack. +; The mask in R0 contains a bit set for each register to save: +; bit 3 set means save R3 etc. Since this is a SWI, only +; R1-R9 can be saved on the stack. + + IMPORT dh_save + +; --- dh_load --- +; +; On entry: R0 == mask of registers to load +; +; On exit: R10, R11 corrupted +; +; Use: Loads a load of registers on the Dynamite relocation stack. +; The mask in R0 contains a bit set for each register to load: +; bit 3 set means load R3 etc. Since this is a SWI, only +; R1-R9 can be read from the stack. + + IMPORT dh_load + +; --- dh_extend --- +; +; On entry: R0 == address of block anchor +; R1 == new size for block +; +; On exit: R0 preserved +; R1 == address of block, may have moved +; +; Use: Changes the size of a block. + + IMPORT dh_extend + +; --- dh_midExtend --- +; +; On entry: R0 == address of block anchor +; R1 == byte offset from block start +; R2 == number of bytes to insert +; +; On exit: R0 preserved +; R1 == address of block, may have moved +; +; Use: Inserts or removes bytes at a given offset into a Dynamite +; heap block. + + IMPORT dh_midExtend + +; --- dh_checkHeap --- +; +; On entry: -- +; +; On exit: May return an error +; +; Use: Checks the current internal format of the heap to make +; sure that it hasn't been corrupted in any way. +; If the integrity check fails then an error is returned. + + IMPORT dh_checkHeap + +; --- dh_changeAnchor --- +; +; On entry: R0 == pointer to anchor for block +; R1 == address of new anchor +; +; On exit: -- +; +; Use: Adjusts a block's anchor, in case it moves. + + IMPORT dh_changeAnchor + +; --- dh_dump --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Outputs a textual description of the dynamite heap, giving +; details of each block within it. + + IMPORT dh_dump + + ] + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/sh/dynTask b/StraySrc/Dynamite/dynamite/sh/dynTask new file mode 100644 index 0000000..5a395a4 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/sh/dynTask @@ -0,0 +1,63 @@ +; +; dynTask.sh +; +; The background compacting WIMP task +; +; © 1994 Straylight +; + +;----- Overview ------------------------------------------------------------- +; +; Functions provided: +; +; dt_run +; dt_service +; dt_quit +; dt_message + +; --- dt_service --- +; +; On entry: R1 == service call number +; Other registers depend on R1 +; +; On exit: Depends on service call +; +; Use: Handles service calls for Dynamite + + IMPORT dt_service + +; --- dt_quit --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Closes down Dynamite's WIMP task (used for background +; compaction of the heap). + + IMPORT dt_quit + +; --- dt_run --- +; +; On entry: R12 == address of module private word +; +; On exit: Via OS_Exit +; +; Use: Runs the Dynamite WIMP task. + + IMPORT dt_run + +; --- dt_message --- +; +; On entry: -- +; +; On exit: -- +; +; Use: Sends a silly message to the Compactor task so that it gets +; control again if it disabled idle events. + + IMPORT dt_message + +;----- That's all, folks ---------------------------------------------------- + + END diff --git a/StraySrc/Dynamite/dynamite/sh/messages b/StraySrc/Dynamite/dynamite/sh/messages new file mode 100644 index 0000000..674b91a --- /dev/null +++ b/StraySrc/Dynamite/dynamite/sh/messages @@ -0,0 +1,38 @@ +; +; Message symbols [generated by msgAOF] +; + + [ :LNOT::DEF:msg__dfn + GBLL msg__dfn + + IMPORT msg_dumpHpBase + IMPORT msg_dumpHpSize + IMPORT msg_dumpHpArSz + IMPORT msg_dumpBlkAddr + IMPORT msg_dumpBlkSize + IMPORT msg_dumpBlkId + IMPORT msg_dumpBlkAnch + IMPORT msg_dumpBlkFree + IMPORT msg_errInUse + IMPORT msg_errRelease + IMPORT msg_errTooBig + IMPORT msg_errBadSWI + IMPORT msg_errNoPages + IMPORT msg_errBadFreeAll + IMPORT msg_errBadAnchor + IMPORT msg_errNoMem + IMPORT msg_errBadMid + IMPORT msg_errBadHeap1 + IMPORT msg_errBadHeap2 + IMPORT msg_errBadHeap3 + IMPORT msg_errDesk + IMPORT help_clear + IMPORT synt_clear + IMPORT help_compactor + IMPORT synt_compactor + IMPORT help_heapDump + IMPORT synt_heapDump + + ] + + END diff --git a/StraySrc/Dynamite/dynamite/sh/wSpace b/StraySrc/Dynamite/dynamite/sh/wSpace new file mode 100644 index 0000000..46c4c07 --- /dev/null +++ b/StraySrc/Dynamite/dynamite/sh/wSpace @@ -0,0 +1,66 @@ +; +; wSpace.sh +; +; Dynamite workspace layout +; +; © 1994 Straylight +; + + ^ 0,R12 +dyn__wStart # 0 + + ; --- Information about the Dynamite area --- + +dyn_machine # 4 ;Machine version number +dyn_areaHandle # 0 ;Handle of dynamic area or... +dyn_oldChnArea # 4 ;Old ChangeDynArea address +dyn_areaBase # 0 ;Base addr of area or... +dyn_oldReadArea # 4 ;Old ReadDynArea address +dyn_oldValidate # 4 ;Old ValidateAddress vector + + ; --- Variables for ReadDynamicArea hackery --- + +dyn_switchBase # 4 ;Base of TaskManager module +dyn_switchSize # 4 ;Size of TaskManager module +dyn_wimpBase # 4 ;Base of WindowManager module +dyn_wimpSize # 4 ;Size of WindowManager module + + ; --- Low-level heap details --- + +dyn_areaSize # 4 ;Current size of area +dyn_sprSize # 4 ;Address of size of spr area +dyn_pageSize # 4 ;The page size of the machine +dyn_log2PageSize # 4 ;Make a good guess +dyn_pageCount # 4 ;Number of pages + + ; --- Heap variables --- + +dyn_heapSize # 4 ;Space actually used in heap +dyn_lockCount # 4 ;How often we've been locked +dyn_hpFlags # 4 ;Some interesting heap flags + +hpFlag_tidy EQU (1<<0) ;The heap is nice and tidy +hpFlag_mSent EQU (1<<1) ;A message has been sent + + ; --- Anchor allocation --- + +dyn_ancTable # 4 ;Pointer to the free handles +dyn_ancList # 4 ;List of big anchor blocks + + ; --- Background compactor variables --- + +dyn_taskHandle # 4 ;The compactor's task handle +dyn_launch # 4 ;Whether we're launching + + ; --- Relocation stack --- + +dyn_stackPtr # 4 ;The stack pointer + + ; --- Big buffers and stuff --- + +dyn_pollBlk # 256 ;The poll block thing +dyn_stack # 4*256 ;The stack area + +dyn_wSize EQU {VAR}-dyn__wStart + + END diff --git a/StraySrc/Glass/!Glass/!Boot,feb b/StraySrc/Glass/!Glass/!Boot,feb new file mode 100644 index 0000000..4b9569f --- /dev/null +++ b/StraySrc/Glass/!Glass/!Boot,feb @@ -0,0 +1,12 @@ +| +| Glass 1.xx !Boot file +| +| © 1993 Straylight +| +| This file version 1.00 (25 March 1993) +| + +Set Glass$Dir +IconSprites .!Sprites +Set Alias$Glass Run .!Run %%*0 +Set Alias$@RunType_FEC Run .!Run %%*0 diff --git a/StraySrc/Glass/!Glass/!Help b/StraySrc/Glass/!Glass/!Help new file mode 100644 index 0000000..6ed30a1 --- /dev/null +++ b/StraySrc/Glass/!Glass/!Help @@ -0,0 +1,132 @@ + ____ + / ___ ___ ___ + / ___ | /___\ (___ (___ + \______/ |___ | | ____) ____) + + © 1 9 9 5 S t r a y l i g h t +___________________________________________________________ + + We would like Glass to be the *BEST* user interface + design program available. In order to do this, we need + *your* comments and suggestions for new features. Please + send any requests, comments or anything else about this + program to Straylight at the address given at the bottom + of this file. +___________________________________________________________ + + Program credits + +Glass's executable `!RunImage' contains code from the +following sources: + + * Compiled Glass source code, written by Straylight + * SharedCLibrary stubs, written by Straylight + * Steel DLL stubs, generated by Straylight's DLL system + * Anything else link threw in, by ARM ltd and Acorn + +Most of the Glass code was compiled using Acorn ANSI C. The +rest was assembled using Acorn ARM AOF Macro Assembler +(objasm), or autogenerated using Straylight AOF producing +tools. + +Glass application icon drawn in Paint by Straylight (but +thanks to Mike Geller for the old one). Other graphics by +Straylight, with the aid of the following software: + + Paint by Acorn Computers Limited + Snippet by 4Mation + ArtWorks by Computer Concepts Limited + ChangeFSI by Acorn Computers Limited + +Glass window templates designed by Straylight using +WindowEd by Armen Software for the original set, and using +Glass enough of it had been completed. + +Also included in the Glass distribution are: + + * Interface, by Simon Huntingdon + * WimpExtension, by Jon Ribbens of DoggySoft + * DLLManager module and other parts of the Straylight + Dynamic Linking System, by Straylight + * The `Steel' library, by Straylight + * Scuptrix, by Straylight + +With grateful thanks. + +___________________________________________________________ + + Special thanks + +Thanks to Dom Symes, for Zap, which I used for all of the +Glass source, and large chunks of Steel. + +Thanks to Gary Partis at Morley, for getting my SCSI system +going. + +Thanks also to Jon Ribbens (of DoggySoft) for some very +constructive comments during test stage 1. The orange +buttons are done specially for you (in Zap :-) ). Oh, and +also for the lift down to Acorn World. + +Thanks to Steve Haeck for the lift back :-). + +Thanks to all them at Armen Software. They know who they +are, and why. + +Thanks to all of the rest of the test team, both offical +and unofficial. + +Finally, I'd like to thank Acorn Computers Limited, not +only for all the software given in the list above, but also +for their operating system, and the hardware than runs it. +It sometimes feels like a losing battle trying to make +RISC OS do clever things, but there's always a way, and +it's always worth it in the end. +___________________________________________________________ + + Revision history + +Version Date Event + +1.00 Finished initial version. Time to + fix the bugs :-( +___________________________________________________________ + + Things to beware of + +There's a tiny problem with Simon Huntingdon's Interface +module which you should be aware of. If you have an icon +which contains anti-aliased fonts and a validation string +which contains instructions to change the background colour +when the icon is clicked, Interface can become confused and +mangle the font data in the mistaken belief that it's icon +colours. I've worked around this by forcing the font +information back into the icon, but while it's pressed in, +the icon may appear strange (maybe the text will disappear, +or be in a completely different font). Be warned. There's +not an awful lot I can do about this. + +WimpExtension doesn't have this problem (which is lucky, +because it would be much more difficult to work around). + +Beware of using the Toolbox on windows that start drags +when you click on them -- they can leave the drags +incomplete, and the application gets very confused, usually +terminally. I could try sending them a User_Drag_Box +event, but I'm not sure that won't just cause more +problems. Grab icon used to have this problem too, but +I've stopped using Wimp_DragBox for that now. + +I may consider restricting the Toolbox to Glass's own +windows. This feature, while not making any strictly +illegal calls, still does somewhat strange things, and +applications which aren't built to stand them will behave +in ways which are unfortunately far too predicatable. + +There appears to be a problem in some versions of the +WindowManager which causes an Address exception when you +have an icon which is both anti-aliased and word-wrapped. +The work-around for this is fairly simple: don't have these +sorts of icons. This is the first Wimp bug I haven't +managed to bodge my way around somehow. +___________________________________________________________ diff --git a/StraySrc/Glass/!Glass/!Run,feb b/StraySrc/Glass/!Glass/!Run,feb new file mode 100644 index 0000000..9f28c9a --- /dev/null +++ b/StraySrc/Glass/!Glass/!Run,feb @@ -0,0 +1,62 @@ +| +| Glass 1.xx !Run file +| +| © 1994 Straylight +| +| This file version 1.00 (20 March 1994) +| + +Set Glass$Dir +IconSprites .!Sprites +Set Alias$Glass Run .!Run %%*0 +Set Alias$@RunType_FEC Run .!Run %%*0 + +/.setSlot -appName Glass 320K 4K + +Set Alias$IfUnset If "|<%%0>"="" %%*1 +Set Alias$TrySet IfUnset %%0 Then /|.test -file %%1 -isDir -then "Run %%1" + +TrySet System$Path .Resources.!System +TrySet System$Path $.!System +IfUnset System$Path Then Error 0 System resources could not be found. Please double-click a !System folder and reload. + +TrySet Wimp$Scrap .^.!Scrap +IfUnset Wimp$Scrap Then Error 0 Couldn't find Scrap folder. Please double click a !Scrap folder (or !System if you don't have !Scrap) and reload. + +TrySet DLL$Path .^.!DLLs +IfUnset DLL$Path Then Error 0 Couldn't find Dynamic Link libraries. Please double click a !DLLs folder and reload. + +Unset Alias$IfUnset +Unset Alias$TrySet + +Set Alias$_RMEnsure RMEnsure %%0 0.00 RMLoad %%2 |m RMEnsure %%0 %%1 + +_RMEnsure SharedCLibrary 3.75 System:Modules.CLib +_RMEnsure Sculptrix 2.01 .Modules.Sculptrix +_RMEnsure InterfaceManager 2.00 .Modules.Interface +_RMEnsure WimpExtension 2.18 .Modules.WimpExt +_RMEnsure FPEmulator 2.80 System:Modules.FPEmulator +_RMEnsure DLLManager 1.14 .DLLManager +_RMEnsure ColourTrans 0.51 System:Modules.Colours + +Unset Alias$_RMEnsure + +DLLEnsure Steel 1.00 + +/.setSlot -appName Glass 320K 4K + +Set Alias$AddCLI If "%%*0"<>"" Then Set Glass$CLI | %%*0 +Set Alias$IfRun /.test -file %%0 -isFile -then "Run %%*0" + +Set Glass$CLI "" +Set Glass$Image .!RunImage +IfRun .Setup %*0 +If ""="" Then Set Glass$CLI "%*0" + +Unset Alias$IfRun +Unset Alias$AddCLI + +Set Alias$_Glass Unset Alias$_Glass |m Run +Unset Glass$CLI +Unset Glass$Image +_Glass \ No newline at end of file diff --git a/StraySrc/Glass/!Glass/!Sprites,ff9 b/StraySrc/Glass/!Glass/!Sprites,ff9 new file mode 100644 index 0000000000000000000000000000000000000000..39c050323834e8f6f3d57838a54757f26545e928 GIT binary patch literal 1860 zcmeHIv2NQi5WO}5v=mSX1aQ`5(UL8LGqp>G4*7?o=ui|$fH)e?QxYJ9I7zerrF$3u zMFzKvV8Da9sqc=WNGr&eB|r|KkMF%Z9w|!aJt8{5_?i)2?GqjUy!u|2AYgkK$2udL zz@K7Vek3}C=U|n!_v~nv;>wZX>6x0fZf+Ygvxu$7n-10hSZ77w5UoeJ>yR!HUSE%J zpT4z6szcW00><)^KCi4%{W;d~vN{U-4#xH+{k*J<>LZK;k9gTKqkN1nKM<`RUIxc>n5#D|>xEt~YF?pFH5<{rd53=-g=I+S5fwTi3oVz55eJ z@{#%}xZ?H%E$Tw;(3s-(g*XJIrg4*@@v~^m$OTuNFh-%=Wahb0TH>bi7o!3^O+`|U x2QFhtm$=C33ZvYDmw(udYb>+Cq1bHc4K@7!5)L)|IfT>obuU94=wL5Cm;c>*dnW(@ literal 0 HcmV?d00001 diff --git a/StraySrc/Glass/!Glass/Choices b/StraySrc/Glass/!Glass/Choices new file mode 100644 index 0000000..24e41e3 --- /dev/null +++ b/StraySrc/Glass/!Glass/Choices @@ -0,0 +1,70 @@ +; +; Glass preferences +; + +Autosave_TimeUnits=minutes +Autosave_Time=5 +Autosave_Alterations=0 +Autosave_Prompt=false + +Interface_DisplayBorders=false +Interface_SlabIcons=true +Interface_DragboxAroundBorder=true +Interface_SlabOnMenu=false + +WimpExtension_DisplayBorders=false +WimpExtension_KeyPress=true +WimpExtension_DragboxAroundBorder=true + +Sculptrix_DisplayBorders=true +Sculptrix_SlabIcons=true +Sculptrix_DragboxAroundBorder=true +Sculptrix_SlabOnMenu=false + +Sprites_LoadSprites=true +Sprites_Load!Sprites=true +Sprites_LoadDefaults=false + +Files_IconSize=small +Files_SortBy name + +Grid_Display=false +Grid_Lock=false +Grid_Width=16 +Grid_Height=16 +Grid_DrawLines=false +Grid_GridColour=8 +Grid_GuideColour=3 +Grid_SelectedGuideColour=3 + +Select_DrawBorder=true +Select_DottedBorder=true +Select_BorderColour=3 +Select_EdgeHandles=true +Select_HandleSize=4 +Select_HandleColour=7 +Select_SpecialColour=11 + +Confirm_Quit=true +Confirm_Close=true +Confirm_DelWind=true +Confirm_DelIcon=false +Confirm_TestCloseEdit=false +Confirm_Overwrite=true + +Toolbar_Display=true +Toolbar_Floating=false +Toolbar_Position=-18,0 +Toolbar_OnLeft=true + +Infobar_Display=true +Infobar_Floating=false +Infobar_Position=0,-16 +Infobar_Underneath=true + +Misc_DrawHatch=false +Misc_BlinkCursor=true +Misc_VisibleInWork=true +Misc_CreateOnTop=true +Misc_RenumberOnDelete=true +Misc_ControlToEdit=false diff --git a/StraySrc/Glass/!Glass/Defaults/Templates,fec b/StraySrc/Glass/!Glass/Defaults/Templates,fec new file mode 100644 index 0000000000000000000000000000000000000000..eacdf855eeeaea9351a613a0c6b655c9c163755b GIT binary patch literal 842 zcmZXS&ui2`6vt<`=++-2tvzf7e+0Y;25i+!yINXU)Pq7X7LR7qWZOVYLUzJN=^vmM zK~U(S9s~~_6k6DW2N4fFdeDEsQ;!}hc$CJ^bhEVJz{~f|_w(kxOh{Rlr8u-~^7A7? z)KEX@s65hgq;_(@qF)zc44{t)u}wZ)v?%MsDjW4iZCES*(w923j+w{Qpr=W1EX6w1 zQQ*%>afI zFTySpqp(S0lfFCX6#NY5ufS%B6L`DkPWaE*zegvwMDq^$;vv3?|CGJyKf(DG@|ZC5 z&Bq$UPtkdFye^t|l@~;_Qb_POVh#TT{2e;|TQtn9mxTGU+r(%5KKvItQxnbCus0Pi z@GbmX?60Helo)?Y{;}c@I3IDpHR?7{bAAi*63fCc9~88TG}YOo$Jq8Y`>J&J3%p!2UpmiQ+~B{GrPNYcmh_~Pr*=0_rQ1$= M@zC?h?XG#sf2@%GP5=M^ literal 0 HcmV?d00001 diff --git a/StraySrc/Glass/!Glass/Makefile,fe1 b/StraySrc/Glass/!Glass/Makefile,fe1 new file mode 100644 index 0000000..a0105ea --- /dev/null +++ b/StraySrc/Glass/!Glass/Makefile,fe1 @@ -0,0 +1,1188 @@ +# +# Makefile +# +# © 1998 Straylight/Edgeware +# + +#----- Licensing note ------------------------------------------------------- +# +# This makefile is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This makefile is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this makefile. If not, write to the Free Software Foundation, +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#----- Compilation flags ---------------------------------------------------- + +# --- Uncomment to use the C4 tools --- + +# OLD = o- + +# --- C compilation --- + +CC = $(OLD)cc -c -o $@ +CFLAGS = -depend !Depend -throwback -ffah -Ilibs: -IC: +COMPILE = $(CC) $(CFLAGS) + +# --- Assembling --- + +AS = $(OLD)objasm -quit -to $@ +ASFLAGS = -stamp -depend !Depend -throwback +ASSEMBLE = $(AS) $(ASFLAGS) -from + +BAS = basasm + +# --- Linking --- + +LD = $(OLD)link -o $@ +LD_APP = $(LD) -aif +LD_UTIL = $(LD) -bin -base 0 +LD_MOD = $(LD) -bin -base 0 +LD_BIN = $(LD) -bin -base 0 +LD_DLL = $(LD) -rmf +LD_AOF = $(LD) -aof + +# --- Making libraries --- + +AR = $(OLD)libfile -o + +CDLL = cdll + +# --- Setting file types --- + +SET_APP = SetType $@ FF8 +SET_MOD = SetType $@ FFA +SET_UTIL = SetType $@ FFC +SET_DLL = SetType $@ FFD + +# --- Other maintenance things --- + +RM = ssrclean +INSTALL = inst +SETDATE = setdate +SQUEEZE = squeeze $@ +DATE = %zdy %mo %ce%yr +MODDATE = %dy %m3 %ce%yr +CRIGHT = © 1994-%ce%yr Straylight +FIXLINK = fixlink $@ + +#----- Default rules -------------------------------------------------------- + +.SUFFIXES: .o .c .s .bs +.c.o: + $(COMPILE) $< +.s.o: + $(ASSEMBLE) $< +.bs.o: + $(BAS) $< $@ + +#----- Object files --------------------------------------------------------- + +OBJ = \ + o.glass \ + o.align o.colSelect o.toolbox \ + o.editIcon o.editWin o.gPrefs o.tearEdit \ + o.gSprite o.tfile \ + o.iconData o.indir o.intMsgs o.toolSupprt \ + o.wDragging o.wGrab o.wGraph o.wIcons o.window o.wMenus \ + o.wMousePtr o.wPalette o.wRedraw o.wSelect o.wToolbars \ + o.wWindows o.wWinEvent + +LIBS = libs:o.astubs libs:lib.steeldll libs:o.dlllib libs:o.swiv + +#----- Compiling things ----------------------------------------------------- + +all: !RunImage Modules.Sculptrix setSlot test + +install: + +clean: + -$(RM) o.* !RunImage Modules.Sculptrix setSlot test + +#----- Nitty Gritty Bitties ------------------------------------------------- + +!RunImage: $(OBJ) $(LIBS) + $(SETDATE) o.version date="$(DATE)" cright="$(CRIGHT)" + $(LD_APP) $(OBJ) o.version $(LIBS) + $(SQUEEZE) + $(SET_APP) + +Modules.Sculptrix: .Sculptrix + $(INSTALL) .Sculptrix Modules + +setSlot: .setSlot + $(INSTALL) .setSlot @ + +test: .test + $(INSTALL) .test @ + +#----- Dynamic dependencies ------------------------------------------------- + +# Dynamic dependencies: +o.tearEdit: c.tearEdit +o.tearEdit: libs:steel.h.Steel +o.tearEdit: libs:steel.h.wimp +o.tearEdit: libs:steel.h.wimpstruct +o.tearEdit: libs:steel.h.os +o.tearEdit: C:h.kernel +o.tearEdit: libs:steel.h.sprite +o.tearEdit: libs:steel.h.wimpt +o.tearEdit: libs:steel.h.win +o.tearEdit: libs:steel.h.event +o.tearEdit: libs:steel.h.menu +o.tearEdit: libs:steel.h.ibicon +o.tearEdit: libs:steel.h.res +o.tearEdit: libs:steel.h.resspr +o.tearEdit: libs:steel.h.template +o.tearEdit: libs:steel.h.dbox +o.tearEdit: libs:steel.h.mem +o.tearEdit: libs:steel.h.visdelay +o.tearEdit: libs:steel.h.help +o.tearEdit: libs:steel.h.exception +o.tearEdit: libs:h.dll +o.tearEdit: libs:steel.h.msgs +o.tearEdit: libs:steel.h.utils +o.tearEdit: libs:steel.h.stddbox +o.tearEdit: libs:steel.h.xfersend +o.tearEdit: libs:steel.h.werr +o.tearEdit: libs:steel.h.buttons +o.tearEdit: libs:steel.h.akbd +o.tearEdit: libs:steel.h.buffer +o.tearEdit: libs:steel.h.colourtran +o.tearEdit: libs:steel.h.font +o.tearEdit: C:h.drawmod +o.tearEdit: libs:steel.h.tearoff +o.tearEdit: h.gStruct +o.tearEdit: h.gPrefs +o.tearEdit: h.glass +o.tearEdit: libs:steel.h.viewer +o.tearEdit: libs:steel.h.pane +o.tearEdit: libs:steel.h.listbox +o.tearEdit: h.glass +o.tearEdit: h.window +o.tearEdit: h.tfile +o.tearEdit: h.indir +o.tearEdit: h.tearEdit +o.tearEdit: h.gStruct +o.iconData: c.iconData +o.iconData: libs:steel.h.Steel +o.iconData: libs:steel.h.wimp +o.iconData: libs:steel.h.wimpstruct +o.iconData: libs:steel.h.os +o.iconData: C:h.kernel +o.iconData: libs:steel.h.sprite +o.iconData: libs:steel.h.wimpt +o.iconData: libs:steel.h.win +o.iconData: libs:steel.h.event +o.iconData: libs:steel.h.menu +o.iconData: libs:steel.h.ibicon +o.iconData: libs:steel.h.res +o.iconData: libs:steel.h.resspr +o.iconData: libs:steel.h.template +o.iconData: libs:steel.h.dbox +o.iconData: libs:steel.h.mem +o.iconData: libs:steel.h.visdelay +o.iconData: libs:steel.h.help +o.iconData: libs:steel.h.exception +o.iconData: libs:h.dll +o.iconData: libs:steel.h.msgs +o.iconData: libs:steel.h.utils +o.iconData: libs:steel.h.stddbox +o.iconData: libs:steel.h.xfersend +o.iconData: libs:steel.h.werr +o.iconData: libs:h.swis +o.iconData: h.gStruct +o.iconData: h.gPrefs +o.iconData: h.glass +o.iconData: libs:steel.h.viewer +o.iconData: libs:steel.h.pane +o.iconData: libs:steel.h.listbox +o.iconData: h.glass +o.iconData: h.iconData +o.iconData: h.indir +o.intMsgs: c.intMsgs +o.intMsgs: libs:steel.h.Steel +o.intMsgs: libs:steel.h.wimp +o.intMsgs: libs:steel.h.wimpstruct +o.intMsgs: libs:steel.h.os +o.intMsgs: C:h.kernel +o.intMsgs: libs:steel.h.sprite +o.intMsgs: libs:steel.h.wimpt +o.intMsgs: libs:steel.h.win +o.intMsgs: libs:steel.h.event +o.intMsgs: libs:steel.h.menu +o.intMsgs: libs:steel.h.ibicon +o.intMsgs: libs:steel.h.res +o.intMsgs: libs:steel.h.resspr +o.intMsgs: libs:steel.h.template +o.intMsgs: libs:steel.h.dbox +o.intMsgs: libs:steel.h.mem +o.intMsgs: libs:steel.h.visdelay +o.intMsgs: libs:steel.h.help +o.intMsgs: libs:steel.h.exception +o.intMsgs: libs:h.dll +o.intMsgs: libs:steel.h.msgs +o.intMsgs: libs:steel.h.utils +o.intMsgs: libs:steel.h.stddbox +o.intMsgs: libs:steel.h.xfersend +o.intMsgs: libs:steel.h.werr +o.intMsgs: h.glass +o.intMsgs: h.intMsgs +o.intMsgs: h.gStruct +o.intMsgs: h.gPrefs +o.intMsgs: libs:steel.h.viewer +o.intMsgs: libs:steel.h.pane +o.intMsgs: libs:steel.h.listbox +o.toolSupprt: s.toolSupprt +o.toolSupprt: libs:Header +o.toolSupprt: libs:SWIs +o.window: c.window +o.window: h.window +o.window: h.gStruct +o.window: h.gPrefs +o.window: h.glass +o.window: libs:steel.h.wimp +o.window: libs:steel.h.wimpstruct +o.window: libs:steel.h.os +o.window: C:h.kernel +o.window: libs:steel.h.sprite +o.window: libs:steel.h.dbox +o.window: libs:steel.h.event +o.window: libs:steel.h.menu +o.window: libs:steel.h.viewer +o.window: libs:steel.h.pane +o.window: libs:steel.h.listbox +o.window: h._window +o.window: h.gStruct +o.glass: c.glass +o.glass: libs:h.dll +o.glass: libs:h.os +o.glass: C:h.kernel +o.glass: libs:h.wimp +o.glass: libs:h.wimpstruct +o.glass: libs:h.sprite +o.glass: libs:steel.h.Steel +o.glass: libs:steel.h.wimpt +o.glass: libs:steel.h.win +o.glass: libs:steel.h.event +o.glass: libs:steel.h.menu +o.glass: libs:steel.h.ibicon +o.glass: libs:steel.h.res +o.glass: libs:steel.h.resspr +o.glass: libs:steel.h.template +o.glass: libs:steel.h.dbox +o.glass: libs:steel.h.mem +o.glass: libs:steel.h.visdelay +o.glass: libs:steel.h.help +o.glass: libs:steel.h.exception +o.glass: libs:steel.h.msgs +o.glass: libs:steel.h.utils +o.glass: libs:steel.h.stddbox +o.glass: libs:steel.h.xfersend +o.glass: libs:steel.h.werr +o.glass: libs:steel.h.xferrecv +o.glass: libs:steel.h.flex +o.glass: libs:steel.h.saveas +o.glass: libs:h.swis +o.glass: libs:steel.h.viewer +o.glass: libs:steel.h.mem +o.glass: libs:steel.h.caretptr +o.glass: libs:steel.h.pointer +o.glass: libs:steel.h.buttons +o.glass: libs:steel.h.sculptrix +o.glass: libs:steel.h.flex +o.glass: h.gStruct +o.glass: h.gPrefs +o.glass: h.glass +o.glass: libs:steel.h.pane +o.glass: libs:steel.h.listbox +o.glass: h.gIcons +o.glass: h.gMenus +o.glass: h.glass +o.glass: h.toolbox +o.glass: h.tfile +o.glass: h.intMsgs +o.glass: h.gPrefs +o.glass: h.gSprite +o.glass: h.indir +o.glass: h.window +o.glass: h.tearEdit +o.glass: h.gStruct +o.align: c.align +o.align: libs:steel.h.Steel +o.align: libs:steel.h.wimp +o.align: libs:steel.h.wimpstruct +o.align: libs:steel.h.os +o.align: C:h.kernel +o.align: libs:steel.h.sprite +o.align: libs:steel.h.wimpt +o.align: libs:steel.h.win +o.align: libs:steel.h.event +o.align: libs:steel.h.menu +o.align: libs:steel.h.ibicon +o.align: libs:steel.h.res +o.align: libs:steel.h.resspr +o.align: libs:steel.h.template +o.align: libs:steel.h.dbox +o.align: libs:steel.h.mem +o.align: libs:steel.h.visdelay +o.align: libs:steel.h.help +o.align: libs:steel.h.exception +o.align: libs:h.dll +o.align: libs:steel.h.msgs +o.align: libs:steel.h.utils +o.align: libs:steel.h.stddbox +o.align: libs:steel.h.xfersend +o.align: libs:steel.h.werr +o.align: h.gIcons +o.align: h.glass +o.align: h.window +o.align: h.gStruct +o.align: h.gPrefs +o.align: libs:steel.h.viewer +o.align: libs:steel.h.pane +o.align: libs:steel.h.listbox +o.align: h.align +o.align: h.tfile +o.colSelect: c.colSelect +o.colSelect: libs:steel.h.Steel +o.colSelect: libs:steel.h.wimp +o.colSelect: libs:steel.h.wimpstruct +o.colSelect: libs:steel.h.os +o.colSelect: C:h.kernel +o.colSelect: libs:steel.h.sprite +o.colSelect: libs:steel.h.wimpt +o.colSelect: libs:steel.h.win +o.colSelect: libs:steel.h.event +o.colSelect: libs:steel.h.menu +o.colSelect: libs:steel.h.ibicon +o.colSelect: libs:steel.h.res +o.colSelect: libs:steel.h.resspr +o.colSelect: libs:steel.h.template +o.colSelect: libs:steel.h.dbox +o.colSelect: libs:steel.h.mem +o.colSelect: libs:steel.h.visdelay +o.colSelect: libs:steel.h.help +o.colSelect: libs:steel.h.exception +o.colSelect: libs:h.dll +o.colSelect: libs:steel.h.msgs +o.colSelect: libs:steel.h.utils +o.colSelect: libs:steel.h.stddbox +o.colSelect: libs:steel.h.xfersend +o.colSelect: libs:steel.h.werr +o.colSelect: libs:steel.h.akbd +o.colSelect: libs:steel.h.colourtran +o.colSelect: libs:steel.h.font +o.colSelect: C:h.drawmod +o.colSelect: h.gIcons +o.colSelect: h.glass +o.colSelect: h.colSelect +o.toolbox: c.toolbox +o.toolbox: libs:steel.h.Steel +o.toolbox: libs:steel.h.wimp +o.toolbox: libs:steel.h.wimpstruct +o.toolbox: libs:steel.h.os +o.toolbox: C:h.kernel +o.toolbox: libs:steel.h.sprite +o.toolbox: libs:steel.h.wimpt +o.toolbox: libs:steel.h.win +o.toolbox: libs:steel.h.event +o.toolbox: libs:steel.h.menu +o.toolbox: libs:steel.h.ibicon +o.toolbox: libs:steel.h.res +o.toolbox: libs:steel.h.resspr +o.toolbox: libs:steel.h.template +o.toolbox: libs:steel.h.dbox +o.toolbox: libs:steel.h.mem +o.toolbox: libs:steel.h.visdelay +o.toolbox: libs:steel.h.help +o.toolbox: libs:steel.h.exception +o.toolbox: libs:h.dll +o.toolbox: libs:steel.h.msgs +o.toolbox: libs:steel.h.utils +o.toolbox: libs:steel.h.stddbox +o.toolbox: libs:steel.h.xfersend +o.toolbox: libs:steel.h.werr +o.toolbox: libs:steel.h.sculptrix +o.toolbox: libs:steel.h.pointer +o.toolbox: libs:steel.h.bbc +o.toolbox: h.gIcons +o.toolbox: h.glass +o.toolbox: h.toolbox +o.editIcon: c.editIcon +o.editIcon: libs:steel.h.Steel +o.editIcon: libs:steel.h.wimp +o.editIcon: libs:steel.h.wimpstruct +o.editIcon: libs:steel.h.os +o.editIcon: C:h.kernel +o.editIcon: libs:steel.h.sprite +o.editIcon: libs:steel.h.wimpt +o.editIcon: libs:steel.h.win +o.editIcon: libs:steel.h.event +o.editIcon: libs:steel.h.menu +o.editIcon: libs:steel.h.ibicon +o.editIcon: libs:steel.h.res +o.editIcon: libs:steel.h.resspr +o.editIcon: libs:steel.h.template +o.editIcon: libs:steel.h.dbox +o.editIcon: libs:steel.h.mem +o.editIcon: libs:steel.h.visdelay +o.editIcon: libs:steel.h.help +o.editIcon: libs:steel.h.exception +o.editIcon: libs:h.dll +o.editIcon: libs:steel.h.msgs +o.editIcon: libs:steel.h.utils +o.editIcon: libs:steel.h.stddbox +o.editIcon: libs:steel.h.xfersend +o.editIcon: libs:steel.h.werr +o.editIcon: libs:h.swis +o.editIcon: libs:steel.h.buttons +o.editIcon: libs:steel.h.fontMenu +o.editIcon: libs:steel.h.akbd +o.editIcon: libs:steel.h.bbc +o.editIcon: libs:steel.h.buffer +o.editIcon: libs:steel.h.font +o.editIcon: C:h.drawmod +o.editIcon: h.gStruct +o.editIcon: h.gPrefs +o.editIcon: h.glass +o.editIcon: libs:steel.h.viewer +o.editIcon: libs:steel.h.pane +o.editIcon: libs:steel.h.listbox +o.editIcon: h.gMenus +o.editIcon: h.gIcons +o.editIcon: h.glass +o.editIcon: h.tfile +o.editIcon: h.window +o.editIcon: h.intMsgs +o.editIcon: h.editIcon +o.editIcon: h.colSelect +o.editIcon: h.indir +o.editIcon: h.gPrefs +o.editWin: c.editWin +o.editWin: libs:steel.h.Steel +o.editWin: libs:steel.h.wimp +o.editWin: libs:steel.h.wimpstruct +o.editWin: libs:steel.h.os +o.editWin: C:h.kernel +o.editWin: libs:steel.h.sprite +o.editWin: libs:steel.h.wimpt +o.editWin: libs:steel.h.win +o.editWin: libs:steel.h.event +o.editWin: libs:steel.h.menu +o.editWin: libs:steel.h.ibicon +o.editWin: libs:steel.h.res +o.editWin: libs:steel.h.resspr +o.editWin: libs:steel.h.template +o.editWin: libs:steel.h.dbox +o.editWin: libs:steel.h.mem +o.editWin: libs:steel.h.visdelay +o.editWin: libs:steel.h.help +o.editWin: libs:steel.h.exception +o.editWin: libs:h.dll +o.editWin: libs:steel.h.msgs +o.editWin: libs:steel.h.utils +o.editWin: libs:steel.h.stddbox +o.editWin: libs:steel.h.xfersend +o.editWin: libs:steel.h.werr +o.editWin: libs:h.swis +o.editWin: libs:steel.h.buttons +o.editWin: libs:steel.h.fontMenu +o.editWin: libs:steel.h.akbd +o.editWin: libs:steel.h.buffer +o.editWin: libs:steel.h.font +o.editWin: C:h.drawmod +o.editWin: h.glass +o.editWin: h.tfile +o.editWin: h.gStruct +o.editWin: h.gPrefs +o.editWin: libs:steel.h.viewer +o.editWin: libs:steel.h.pane +o.editWin: libs:steel.h.listbox +o.editWin: h.window +o.editWin: h.intMsgs +o.editWin: h.editWin +o.editWin: h.colSelect +o.editWin: h.indir +o.editWin: h.gPrefs +o.editWin: h.gStruct +o.editWin: h.gMenus +o.editWin: h.gIcons +o.gPrefs: c.gPrefs +o.gPrefs: libs:steel.h.Steel +o.gPrefs: libs:steel.h.wimp +o.gPrefs: libs:steel.h.wimpstruct +o.gPrefs: libs:steel.h.os +o.gPrefs: C:h.kernel +o.gPrefs: libs:steel.h.sprite +o.gPrefs: libs:steel.h.wimpt +o.gPrefs: libs:steel.h.win +o.gPrefs: libs:steel.h.event +o.gPrefs: libs:steel.h.menu +o.gPrefs: libs:steel.h.ibicon +o.gPrefs: libs:steel.h.res +o.gPrefs: libs:steel.h.resspr +o.gPrefs: libs:steel.h.template +o.gPrefs: libs:steel.h.dbox +o.gPrefs: libs:steel.h.mem +o.gPrefs: libs:steel.h.visdelay +o.gPrefs: libs:steel.h.help +o.gPrefs: libs:steel.h.exception +o.gPrefs: libs:h.dll +o.gPrefs: libs:steel.h.msgs +o.gPrefs: libs:steel.h.utils +o.gPrefs: libs:steel.h.stddbox +o.gPrefs: libs:steel.h.xfersend +o.gPrefs: libs:steel.h.werr +o.gPrefs: libs:steel.h.prefs +o.gPrefs: libs:steel.h.pane +o.gPrefs: libs:steel.h.listbox +o.gPrefs: libs:steel.h.blinkC +o.gPrefs: libs:steel.h.buttons +o.gPrefs: libs:steel.h.akbd +o.gPrefs: h.gIcons +o.gPrefs: h.gMenus +o.gPrefs: h.glass +o.gPrefs: h.gPrefs +o.gPrefs: h.intMsgs +o.gPrefs: h.gStruct +o.gPrefs: libs:steel.h.viewer +o.gPrefs: h.colSelect +o.gPrefs: h.window +o.gSprite: c.gSprite +o.gSprite: libs:steel.h.Steel +o.gSprite: libs:steel.h.wimp +o.gSprite: libs:steel.h.wimpstruct +o.gSprite: libs:steel.h.os +o.gSprite: C:h.kernel +o.gSprite: libs:steel.h.sprite +o.gSprite: libs:steel.h.wimpt +o.gSprite: libs:steel.h.win +o.gSprite: libs:steel.h.event +o.gSprite: libs:steel.h.menu +o.gSprite: libs:steel.h.ibicon +o.gSprite: libs:steel.h.res +o.gSprite: libs:steel.h.resspr +o.gSprite: libs:steel.h.template +o.gSprite: libs:steel.h.dbox +o.gSprite: libs:steel.h.mem +o.gSprite: libs:steel.h.visdelay +o.gSprite: libs:steel.h.help +o.gSprite: libs:steel.h.exception +o.gSprite: libs:h.dll +o.gSprite: libs:steel.h.msgs +o.gSprite: libs:steel.h.utils +o.gSprite: libs:steel.h.stddbox +o.gSprite: libs:steel.h.xfersend +o.gSprite: libs:steel.h.werr +o.gSprite: libs:steel.h.xferrecv +o.gSprite: libs:steel.h.flex +o.gSprite: libs:steel.h.saveas +o.gSprite: libs:h.swis +o.gSprite: libs:steel.h.viewer +o.gSprite: libs:steel.h.flex +o.gSprite: libs:steel.h.akbd +o.gSprite: libs:steel.h.bbc +o.gSprite: libs:steel.h.choices +o.gSprite: libs:steel.h.colourtran +o.gSprite: libs:steel.h.font +o.gSprite: C:h.drawmod +o.gSprite: h.gStruct +o.gSprite: h.gPrefs +o.gSprite: h.glass +o.gSprite: libs:steel.h.pane +o.gSprite: libs:steel.h.listbox +o.gSprite: h.gMenus +o.gSprite: h.gIcons +o.gSprite: h.glass +o.gSprite: h.intMsgs +o.gSprite: h.gSprite +o.gSprite: h.gPrefs +o.gSprite: h.indir +o.gSprite: h.window +o.gSprite: h.tfile +o.tfile: c.tfile +o.tfile: libs:steel.h.Steel +o.tfile: libs:steel.h.wimp +o.tfile: libs:steel.h.wimpstruct +o.tfile: libs:steel.h.os +o.tfile: C:h.kernel +o.tfile: libs:steel.h.sprite +o.tfile: libs:steel.h.wimpt +o.tfile: libs:steel.h.win +o.tfile: libs:steel.h.event +o.tfile: libs:steel.h.menu +o.tfile: libs:steel.h.ibicon +o.tfile: libs:steel.h.res +o.tfile: libs:steel.h.resspr +o.tfile: libs:steel.h.template +o.tfile: libs:steel.h.dbox +o.tfile: libs:steel.h.mem +o.tfile: libs:steel.h.visdelay +o.tfile: libs:steel.h.help +o.tfile: libs:steel.h.exception +o.tfile: libs:h.dll +o.tfile: libs:steel.h.msgs +o.tfile: libs:steel.h.utils +o.tfile: libs:steel.h.stddbox +o.tfile: libs:steel.h.xfersend +o.tfile: libs:steel.h.werr +o.tfile: libs:steel.h.xferrecv +o.tfile: libs:steel.h.flex +o.tfile: libs:steel.h.saveas +o.tfile: libs:h.swis +o.tfile: libs:steel.h.viewer +o.tfile: libs:steel.h.mem +o.tfile: libs:steel.h.nopoll +o.tfile: libs:steel.h.flex +o.tfile: libs:steel.h.akbd +o.tfile: libs:steel.h.alarm +o.tfile: libs:steel.h.bbc +o.tfile: libs:steel.h.buffer +o.tfile: libs:steel.h.font +o.tfile: C:h.drawmod +o.tfile: h.gStruct +o.tfile: h.gPrefs +o.tfile: h.glass +o.tfile: libs:steel.h.pane +o.tfile: libs:steel.h.listbox +o.tfile: h.gIcons +o.tfile: h.gMenus +o.tfile: h.glass +o.tfile: h.toolbox +o.tfile: h.intMsgs +o.tfile: h.tfile +o.tfile: h.gPrefs +o.tfile: h.gSprite +o.tfile: h.indir +o.tfile: h.window +o.tfile: h.editWin +o.tfile: h.iconData +o.indir: c.indir +o.indir: libs:steel.h.Steel +o.indir: libs:steel.h.wimp +o.indir: libs:steel.h.wimpstruct +o.indir: libs:steel.h.os +o.indir: C:h.kernel +o.indir: libs:steel.h.sprite +o.indir: libs:steel.h.wimpt +o.indir: libs:steel.h.win +o.indir: libs:steel.h.event +o.indir: libs:steel.h.menu +o.indir: libs:steel.h.ibicon +o.indir: libs:steel.h.res +o.indir: libs:steel.h.resspr +o.indir: libs:steel.h.template +o.indir: libs:steel.h.dbox +o.indir: libs:steel.h.mem +o.indir: libs:steel.h.visdelay +o.indir: libs:steel.h.help +o.indir: libs:steel.h.exception +o.indir: libs:h.dll +o.indir: libs:steel.h.msgs +o.indir: libs:steel.h.utils +o.indir: libs:steel.h.stddbox +o.indir: libs:steel.h.xfersend +o.indir: libs:steel.h.werr +o.indir: libs:steel.h.buttons +o.indir: libs:steel.h.bbc +o.indir: h.gIcons +o.indir: h.glass +o.indir: libs:h.heap +o.indir: h.indir +o.wDragging: c.wDragging +o.wDragging: libs:steel.h.Steel +o.wDragging: libs:steel.h.wimp +o.wDragging: libs:steel.h.wimpstruct +o.wDragging: libs:steel.h.os +o.wDragging: C:h.kernel +o.wDragging: libs:steel.h.sprite +o.wDragging: libs:steel.h.wimpt +o.wDragging: libs:steel.h.win +o.wDragging: libs:steel.h.event +o.wDragging: libs:steel.h.menu +o.wDragging: libs:steel.h.ibicon +o.wDragging: libs:steel.h.res +o.wDragging: libs:steel.h.resspr +o.wDragging: libs:steel.h.template +o.wDragging: libs:steel.h.dbox +o.wDragging: libs:steel.h.mem +o.wDragging: libs:steel.h.visdelay +o.wDragging: libs:steel.h.help +o.wDragging: libs:steel.h.exception +o.wDragging: libs:h.dll +o.wDragging: libs:steel.h.msgs +o.wDragging: libs:steel.h.utils +o.wDragging: libs:steel.h.stddbox +o.wDragging: libs:steel.h.xfersend +o.wDragging: libs:steel.h.werr +o.wDragging: libs:h.swis +o.wDragging: libs:steel.h.akbd +o.wDragging: libs:steel.h.coords +o.wDragging: libs:steel.h.wimp +o.wDragging: libs:steel.h.bbc +o.wDragging: h.gStruct +o.wDragging: h.gPrefs +o.wDragging: h.glass +o.wDragging: libs:steel.h.viewer +o.wDragging: libs:steel.h.pane +o.wDragging: libs:steel.h.listbox +o.wDragging: h.gMenus +o.wDragging: h.gIcons +o.wDragging: h.glass +o.wDragging: h.gPrefs +o.wDragging: h.tfile +o.wDragging: h.window +o.wDragging: h._window +o.wDragging: h.gStruct +o.wDragging: h.editIcon +o.wDragging: h.editWin +o.wGrab: c.wGrab +o.wGrab: libs:steel.h.Steel +o.wGrab: libs:steel.h.wimp +o.wGrab: libs:steel.h.wimpstruct +o.wGrab: libs:steel.h.os +o.wGrab: C:h.kernel +o.wGrab: libs:steel.h.sprite +o.wGrab: libs:steel.h.wimpt +o.wGrab: libs:steel.h.win +o.wGrab: libs:steel.h.event +o.wGrab: libs:steel.h.menu +o.wGrab: libs:steel.h.ibicon +o.wGrab: libs:steel.h.res +o.wGrab: libs:steel.h.resspr +o.wGrab: libs:steel.h.template +o.wGrab: libs:steel.h.dbox +o.wGrab: libs:steel.h.mem +o.wGrab: libs:steel.h.visdelay +o.wGrab: libs:steel.h.help +o.wGrab: libs:steel.h.exception +o.wGrab: libs:h.dll +o.wGrab: libs:steel.h.msgs +o.wGrab: libs:steel.h.utils +o.wGrab: libs:steel.h.stddbox +o.wGrab: libs:steel.h.xfersend +o.wGrab: libs:steel.h.werr +o.wGrab: libs:h.swis +o.wGrab: libs:steel.h.pointer +o.wGrab: libs:steel.h.bbc +o.wGrab: libs:steel.h.buffer +o.wGrab: h.gStruct +o.wGrab: h.gPrefs +o.wGrab: h.glass +o.wGrab: libs:steel.h.viewer +o.wGrab: libs:steel.h.pane +o.wGrab: libs:steel.h.listbox +o.wGrab: h.gMenus +o.wGrab: h.gIcons +o.wGrab: h.glass +o.wGrab: h.gPrefs +o.wGrab: h.tfile +o.wGrab: h.window +o.wGrab: h._window +o.wGrab: h.gStruct +o.wGrab: h.iconData +o.wGraph: c.wGraph +o.wGraph: libs:steel.h.Steel +o.wGraph: libs:steel.h.wimp +o.wGraph: libs:steel.h.wimpstruct +o.wGraph: libs:steel.h.os +o.wGraph: C:h.kernel +o.wGraph: libs:steel.h.sprite +o.wGraph: libs:steel.h.wimpt +o.wGraph: libs:steel.h.win +o.wGraph: libs:steel.h.event +o.wGraph: libs:steel.h.menu +o.wGraph: libs:steel.h.ibicon +o.wGraph: libs:steel.h.res +o.wGraph: libs:steel.h.resspr +o.wGraph: libs:steel.h.template +o.wGraph: libs:steel.h.dbox +o.wGraph: libs:steel.h.mem +o.wGraph: libs:steel.h.visdelay +o.wGraph: libs:steel.h.help +o.wGraph: libs:steel.h.exception +o.wGraph: libs:h.dll +o.wGraph: libs:steel.h.msgs +o.wGraph: libs:steel.h.utils +o.wGraph: libs:steel.h.stddbox +o.wGraph: libs:steel.h.xfersend +o.wGraph: libs:steel.h.werr +o.wGraph: libs:h.swis +o.wGraph: libs:steel.h.bbc +o.wGraph: libs:steel.h.colourtran +o.wGraph: libs:steel.h.font +o.wGraph: C:h.drawmod +o.wGraph: h.gStruct +o.wGraph: h.gPrefs +o.wGraph: h.glass +o.wGraph: libs:steel.h.viewer +o.wGraph: libs:steel.h.pane +o.wGraph: libs:steel.h.listbox +o.wGraph: h.gMenus +o.wGraph: h.gIcons +o.wGraph: h.glass +o.wGraph: h.gPrefs +o.wGraph: h.window +o.wGraph: h._window +o.wGraph: h.gStruct +o.wIcons: c.wIcons +o.wIcons: libs:steel.h.Steel +o.wIcons: libs:steel.h.wimp +o.wIcons: libs:steel.h.wimpstruct +o.wIcons: libs:steel.h.os +o.wIcons: C:h.kernel +o.wIcons: libs:steel.h.sprite +o.wIcons: libs:steel.h.wimpt +o.wIcons: libs:steel.h.win +o.wIcons: libs:steel.h.event +o.wIcons: libs:steel.h.menu +o.wIcons: libs:steel.h.ibicon +o.wIcons: libs:steel.h.res +o.wIcons: libs:steel.h.resspr +o.wIcons: libs:steel.h.template +o.wIcons: libs:steel.h.dbox +o.wIcons: libs:steel.h.mem +o.wIcons: libs:steel.h.visdelay +o.wIcons: libs:steel.h.help +o.wIcons: libs:steel.h.exception +o.wIcons: libs:h.dll +o.wIcons: libs:steel.h.msgs +o.wIcons: libs:steel.h.utils +o.wIcons: libs:steel.h.stddbox +o.wIcons: libs:steel.h.xfersend +o.wIcons: libs:steel.h.werr +o.wIcons: libs:h.swis +o.wIcons: libs:steel.h.interface +o.wIcons: libs:steel.h.sculptrix +o.wIcons: libs:steel.h.flex +o.wIcons: libs:steel.h.bbc +o.wIcons: libs:steel.h.font +o.wIcons: C:h.drawmod +o.wIcons: h.gStruct +o.wIcons: h.gPrefs +o.wIcons: h.glass +o.wIcons: libs:steel.h.viewer +o.wIcons: libs:steel.h.pane +o.wIcons: libs:steel.h.listbox +o.wIcons: h.gMenus +o.wIcons: h.gIcons +o.wIcons: h.glass +o.wIcons: h.gPrefs +o.wIcons: h.tfile +o.wIcons: h.window +o.wIcons: h._window +o.wIcons: h.gStruct +o.wIcons: h.editIcon +o.wIcons: h.indir +o.wIcons: h.iconData +o.wIcons: h.tearEdit +o.wIcons: h.gStruct +o.wMousePtr: c.wMousePtr +o.wMousePtr: libs:steel.h.Steel +o.wMousePtr: libs:steel.h.wimp +o.wMousePtr: libs:steel.h.wimpstruct +o.wMousePtr: libs:steel.h.os +o.wMousePtr: C:h.kernel +o.wMousePtr: libs:steel.h.sprite +o.wMousePtr: libs:steel.h.wimpt +o.wMousePtr: libs:steel.h.win +o.wMousePtr: libs:steel.h.event +o.wMousePtr: libs:steel.h.menu +o.wMousePtr: libs:steel.h.ibicon +o.wMousePtr: libs:steel.h.res +o.wMousePtr: libs:steel.h.resspr +o.wMousePtr: libs:steel.h.template +o.wMousePtr: libs:steel.h.dbox +o.wMousePtr: libs:steel.h.mem +o.wMousePtr: libs:steel.h.visdelay +o.wMousePtr: libs:steel.h.help +o.wMousePtr: libs:steel.h.exception +o.wMousePtr: libs:h.dll +o.wMousePtr: libs:steel.h.msgs +o.wMousePtr: libs:steel.h.utils +o.wMousePtr: libs:steel.h.stddbox +o.wMousePtr: libs:steel.h.xfersend +o.wMousePtr: libs:steel.h.werr +o.wMousePtr: libs:h.swis +o.wMousePtr: libs:steel.h.pointer +o.wMousePtr: h.gStruct +o.wMousePtr: h.gPrefs +o.wMousePtr: h.glass +o.wMousePtr: libs:steel.h.viewer +o.wMousePtr: libs:steel.h.pane +o.wMousePtr: libs:steel.h.listbox +o.wMousePtr: h.gMenus +o.wMousePtr: h.gIcons +o.wMousePtr: h.glass +o.wMousePtr: h.gPrefs +o.wMousePtr: h.window +o.wMousePtr: h._window +o.wMousePtr: h.gStruct +o.wRedraw: c.wRedraw +o.wRedraw: libs:steel.h.Steel +o.wRedraw: libs:steel.h.wimp +o.wRedraw: libs:steel.h.wimpstruct +o.wRedraw: libs:steel.h.os +o.wRedraw: C:h.kernel +o.wRedraw: libs:steel.h.sprite +o.wRedraw: libs:steel.h.wimpt +o.wRedraw: libs:steel.h.win +o.wRedraw: libs:steel.h.event +o.wRedraw: libs:steel.h.menu +o.wRedraw: libs:steel.h.ibicon +o.wRedraw: libs:steel.h.res +o.wRedraw: libs:steel.h.resspr +o.wRedraw: libs:steel.h.template +o.wRedraw: libs:steel.h.dbox +o.wRedraw: libs:steel.h.mem +o.wRedraw: libs:steel.h.visdelay +o.wRedraw: libs:steel.h.help +o.wRedraw: libs:steel.h.exception +o.wRedraw: libs:h.dll +o.wRedraw: libs:steel.h.msgs +o.wRedraw: libs:steel.h.utils +o.wRedraw: libs:steel.h.stddbox +o.wRedraw: libs:steel.h.xfersend +o.wRedraw: libs:steel.h.werr +o.wRedraw: libs:h.swis +o.wRedraw: libs:steel.h.interface +o.wRedraw: libs:steel.h.sculptrix +o.wRedraw: libs:steel.h.bbc +o.wRedraw: libs:steel.h.coords +o.wRedraw: libs:steel.h.wimp +o.wRedraw: h.gStruct +o.wRedraw: h.gPrefs +o.wRedraw: h.glass +o.wRedraw: libs:steel.h.viewer +o.wRedraw: libs:steel.h.pane +o.wRedraw: libs:steel.h.listbox +o.wRedraw: h.gMenus +o.wRedraw: h.gIcons +o.wRedraw: h.glass +o.wRedraw: h.gPrefs +o.wRedraw: h.window +o.wRedraw: h._window +o.wRedraw: h.gStruct +o.wRedraw: h.tearEdit +o.wRedraw: h.gStruct +o.wToolbars: c.wToolbars +o.wToolbars: libs:steel.h.Steel +o.wToolbars: libs:steel.h.wimp +o.wToolbars: libs:steel.h.wimpstruct +o.wToolbars: libs:steel.h.os +o.wToolbars: C:h.kernel +o.wToolbars: libs:steel.h.sprite +o.wToolbars: libs:steel.h.wimpt +o.wToolbars: libs:steel.h.win +o.wToolbars: libs:steel.h.event +o.wToolbars: libs:steel.h.menu +o.wToolbars: libs:steel.h.ibicon +o.wToolbars: libs:steel.h.res +o.wToolbars: libs:steel.h.resspr +o.wToolbars: libs:steel.h.template +o.wToolbars: libs:steel.h.dbox +o.wToolbars: libs:steel.h.mem +o.wToolbars: libs:steel.h.visdelay +o.wToolbars: libs:steel.h.help +o.wToolbars: libs:steel.h.exception +o.wToolbars: libs:h.dll +o.wToolbars: libs:steel.h.msgs +o.wToolbars: libs:steel.h.utils +o.wToolbars: libs:steel.h.stddbox +o.wToolbars: libs:steel.h.xfersend +o.wToolbars: libs:steel.h.werr +o.wToolbars: libs:h.swis +o.wToolbars: libs:steel.h.interface +o.wToolbars: libs:steel.h.sculptrix +o.wToolbars: libs:steel.h.buttons +o.wToolbars: libs:steel.h.caretPtr +o.wToolbars: libs:steel.h.pointer +o.wToolbars: libs:steel.h.flex +o.wToolbars: libs:steel.h.akbd +o.wToolbars: libs:steel.h.coords +o.wToolbars: libs:steel.h.wimp +o.wToolbars: libs:steel.h.pointer +o.wToolbars: libs:steel.h.bbc +o.wToolbars: libs:steel.h.colourtran +o.wToolbars: libs:steel.h.font +o.wToolbars: C:h.drawmod +o.wToolbars: libs:steel.h.font +o.wToolbars: h.gStruct +o.wToolbars: h.gPrefs +o.wToolbars: h.glass +o.wToolbars: libs:steel.h.viewer +o.wToolbars: libs:steel.h.pane +o.wToolbars: libs:steel.h.listbox +o.wToolbars: h.gMenus +o.wToolbars: h.gIcons +o.wToolbars: h.glass +o.wToolbars: h.gPrefs +o.wToolbars: h.tfile +o.wToolbars: h.window +o.wToolbars: h._window +o.wToolbars: h.gStruct +o.wToolbars: h.intMsgs +o.wToolbars: h.toolbox +o.wToolbars: h.editIcon +o.wToolbars: h.editWin +o.wToolbars: h.indir +o.wToolbars: h.align +o.wToolbars: h.iconData +o.wToolbars: h.tearEdit +o.wToolbars: h.gStruct +o.wWindows: c.wWindows +o.wWindows: libs:steel.h.Steel +o.wWindows: libs:steel.h.wimp +o.wWindows: libs:steel.h.wimpstruct +o.wWindows: libs:steel.h.os +o.wWindows: C:h.kernel +o.wWindows: libs:steel.h.sprite +o.wWindows: libs:steel.h.wimpt +o.wWindows: libs:steel.h.win +o.wWindows: libs:steel.h.event +o.wWindows: libs:steel.h.menu +o.wWindows: libs:steel.h.ibicon +o.wWindows: libs:steel.h.res +o.wWindows: libs:steel.h.resspr +o.wWindows: libs:steel.h.template +o.wWindows: libs:steel.h.dbox +o.wWindows: libs:steel.h.mem +o.wWindows: libs:steel.h.visdelay +o.wWindows: libs:steel.h.help +o.wWindows: libs:steel.h.exception +o.wWindows: libs:h.dll +o.wWindows: libs:steel.h.msgs +o.wWindows: libs:steel.h.utils +o.wWindows: libs:steel.h.stddbox +o.wWindows: libs:steel.h.xfersend +o.wWindows: libs:steel.h.werr +o.wWindows: libs:h.swis +o.wWindows: libs:steel.h.flex +o.wWindows: h.gStruct +o.wWindows: h.gPrefs +o.wWindows: h.glass +o.wWindows: libs:steel.h.viewer +o.wWindows: libs:steel.h.pane +o.wWindows: libs:steel.h.listbox +o.wWindows: h.gMenus +o.wWindows: h.gIcons +o.wWindows: h.glass +o.wWindows: h.tfile +o.wWindows: h.window +o.wWindows: h._window +o.wWindows: h.gStruct +o.wWindows: h.editWin +o.wWinEvent: c.wWinEvent +o.wWinEvent: libs:steel.h.Steel +o.wWinEvent: libs:steel.h.wimp +o.wWinEvent: libs:steel.h.wimpstruct +o.wWinEvent: libs:steel.h.os +o.wWinEvent: C:h.kernel +o.wWinEvent: libs:steel.h.sprite +o.wWinEvent: libs:steel.h.wimpt +o.wWinEvent: libs:steel.h.win +o.wWinEvent: libs:steel.h.event +o.wWinEvent: libs:steel.h.menu +o.wWinEvent: libs:steel.h.ibicon +o.wWinEvent: libs:steel.h.res +o.wWinEvent: libs:steel.h.resspr +o.wWinEvent: libs:steel.h.template +o.wWinEvent: libs:steel.h.dbox +o.wWinEvent: libs:steel.h.mem +o.wWinEvent: libs:steel.h.visdelay +o.wWinEvent: libs:steel.h.help +o.wWinEvent: libs:steel.h.exception +o.wWinEvent: libs:h.dll +o.wWinEvent: libs:steel.h.msgs +o.wWinEvent: libs:steel.h.utils +o.wWinEvent: libs:steel.h.stddbox +o.wWinEvent: libs:steel.h.xfersend +o.wWinEvent: libs:steel.h.werr +o.wWinEvent: libs:h.swis +o.wWinEvent: libs:steel.h.interface +o.wWinEvent: libs:steel.h.sculptrix +o.wWinEvent: libs:steel.h.caretPtr +o.wWinEvent: libs:steel.h.pointer +o.wWinEvent: libs:steel.h.akbd +o.wWinEvent: libs:steel.h.bbc +o.wWinEvent: h.gStruct +o.wWinEvent: h.gPrefs +o.wWinEvent: h.glass +o.wWinEvent: libs:steel.h.viewer +o.wWinEvent: libs:steel.h.pane +o.wWinEvent: libs:steel.h.listbox +o.wWinEvent: h.gMenus +o.wWinEvent: h.gIcons +o.wWinEvent: h.glass +o.wWinEvent: h.gPrefs +o.wWinEvent: h.tfile +o.wWinEvent: h.window +o.wWinEvent: h._window +o.wWinEvent: h.gStruct +o.wWinEvent: h.intMsgs +o.wWinEvent: h.toolbox +o.wWinEvent: h.editIcon +o.wWinEvent: h.editWin +o.wWinEvent: h.tearEdit +o.wWinEvent: h.gStruct +o.wMenus: c.wMenus +o.wMenus: libs:steel.h.Steel +o.wMenus: libs:steel.h.wimp +o.wMenus: libs:steel.h.wimpstruct +o.wMenus: libs:steel.h.os +o.wMenus: C:h.kernel +o.wMenus: libs:steel.h.sprite +o.wMenus: libs:steel.h.wimpt +o.wMenus: libs:steel.h.win +o.wMenus: libs:steel.h.event +o.wMenus: libs:steel.h.menu +o.wMenus: libs:steel.h.ibicon +o.wMenus: libs:steel.h.res +o.wMenus: libs:steel.h.resspr +o.wMenus: libs:steel.h.template +o.wMenus: libs:steel.h.dbox +o.wMenus: libs:steel.h.mem +o.wMenus: libs:steel.h.visdelay +o.wMenus: libs:steel.h.help +o.wMenus: libs:steel.h.exception +o.wMenus: libs:h.dll +o.wMenus: libs:steel.h.msgs +o.wMenus: libs:steel.h.utils +o.wMenus: libs:steel.h.stddbox +o.wMenus: libs:steel.h.xfersend +o.wMenus: libs:steel.h.werr +o.wMenus: libs:h.swis +o.wMenus: libs:steel.h.buttons +o.wMenus: libs:steel.h.choices +o.wMenus: libs:steel.h.bbc +o.wMenus: libs:steel.h.buffer +o.wMenus: libs:steel.h.tearoff +o.wMenus: h.gStruct +o.wMenus: h.gPrefs +o.wMenus: h.glass +o.wMenus: libs:steel.h.viewer +o.wMenus: libs:steel.h.pane +o.wMenus: libs:steel.h.listbox +o.wMenus: h.gMenus +o.wMenus: h.gIcons +o.wMenus: h.glass +o.wMenus: h.gPrefs +o.wMenus: h.tfile +o.wMenus: h.window +o.wMenus: h._window +o.wMenus: h.gStruct +o.wMenus: h.editIcon +o.wMenus: h.editWin +o.wMenus: h.align +o.wMenus: h.iconData +o.wMenus: h.tearEdit +o.wMenus: h.gStruct diff --git a/StraySrc/Glass/!Glass/Resources/LoadSpr,ff9 b/StraySrc/Glass/!Glass/Resources/LoadSpr,ff9 new file mode 100644 index 0000000000000000000000000000000000000000..308c483941e0d1cecac2ae2744c38627d36d70f7 GIT binary patch literal 11732 zcmeHNU27ZJ86G93)L^O^WebIdj%MU#WALU(qYL|@P)kEQ3uRr{6zi&`O=&2Uwlv*1 zH!W;5Vs%ll)AfxYKcPRup|^p(=tX;-E^Qagps};17cR5U^PV#wvNX0O!=@C!l1Asu zoacSsuk&FgHw?ot@%h`^hOz#pVLbT7j~_n#_0R9)mQls$9X22~KI{1Wsb&}}_>QhF z?{+UEZHhlR^6x_a?(U+Z@X^Bs@o#D0Qv-f>X;FllK8k)T{T=Vp@;(76eH8srGw7=e9o^N zr_I!b3oH=%2VA%-7-|)X z1)hN4?tjyAw*4UUKFaW%o&OewzFYE|{yvZn%;0hz)Kv;$MgFJcAllmV^0$_YaJC6k9!ra;Rb^z}u zq8Fv{hwD1_;&>qd;yy2+zg2I&7rt4rUh|(=hAmlFw$uJhSUwO~@Ih!bx5M7Qrtuzf zuM%!nV^(lX10aCn&DbSLy!TbJ6^7wIX5cZ=rRH$Klp|P3sYptPy&nx~@ss}G@g%-b ze+Z#ng#r=s6Q!*{yT4j*b%WmSBwodznJ1iO&z7x}$Q4k&w}-dr{o|Q&S}I8#4eRx#{R`58goK_l9Tjx_+ec7a*4$f?uc zs2}&k5bNhG|KT&J0mr)_j3FxzxeMPw= z@!E8uhxvQqs?!a_jWWCy$G2fVHY*X!{uOuBe}8P_h2Y2ifZh*YmEha2Jg@EjH{V5n z_vpdyqumF8l{<~@HoV8O6L`~j`hTGe1FLm!ICv}rr~SVOzZ2Zys@GHFCh@|5!SNvo zoK`;!dKd;3lXz7>x#u%l-QGs?i9Zb6cvg}>?*A)?hw2Q0l`IvROM8KJ4ESfLYwrKE z_<^+Ya|f#sWuR+dt9Qrg-s=UtG0m^)FWvvKdH{&2Bi~*Q;UP4}DCca{u8y1oYUtxDw#a zX@E)53^uUl55iZXtjvFP>@naq*~t%fnNoY9i`<6;dSA{j^tj08gGEsI8Sw3U8(8(i z;A`w8IDgE}AMrQ>MHEIL_p7XY)DE1#z<-=K0f)^1q5;M@4#Vb?eh_RB&HzmNuh&0vlNmu^ z__+x{4fc#4W7KJ?A@)oo9x*9v#&*JR!U^{_vS@%lSiDA3v=e9z~!R_5`j$!8!4dG52N8Xn5?b z93CCLv?TaoR!&UkU-{3Zlb?o5>TLVD@mzw>EgY$X{Wt?o`!DnV1i^>z2)$?!6Dsw$ zqIHQqx-@{6l<}XU@bj~u;EnGe-8}`4Cr>($?^*oH{^vL-Aki2I`Iwig@ySsQEgm66 z3zS-C_*?j4fq#MTw7E5UfAQYVch5h6`=}*%^II73tw+1N-@#82>JOm%=WP66YMl2} z?V*fanRuPDC%mulzbPNGj{WhH+KAu@E;w+VMpVQ07C)f(B^%MI(^WFK9qUzaTz~-)oCNn!rUP_`30V z1{W*AJcA42bNa>RU{1dfzCiz4@CEZ1;V+uM2);BRpWn+pSJ?9*S}%`UbTMajsE}A{GZ?U z6rpM;?alxF|A8;o(HGu+_GSHlr8M(b@NMb#*YVB&EA`VQ^?#*Ci;JP5%UZRuKSFc= zQVJCoK>W0>&hYb-=Lcp^ayo3cI|9NKg?>a$R6u7k0WX9A3hW z?g9MqyqmnOnjW7X2=8dbC<+)_6qX=5Ml8N4#HQK6FhrMhqfLUfC~RBw$*rzIyF|ne z)$Fu2cC_g?TCRF^+G}nLPuAd;yt)T#szo30jIUPLUrMnUsnh2BNS9pdOfcnO^p0xy zAB~DlWwRJQ_eF)_YS(Okt@5ZhdGMbp(dU5ADpP$$oT)7gDtez%6&|Ch jv6EmKTDT?g(71w{6k8Zcg`zcMk!dNtNzXIzB8|@hMZA|E literal 0 HcmV?d00001 diff --git a/StraySrc/Glass/!Glass/Resources/LoadTpl,fec b/StraySrc/Glass/!Glass/Resources/LoadTpl,fec new file mode 100644 index 0000000000000000000000000000000000000000..1d7e7dea936338e6da9330073aa42f06e594114d GIT binary patch literal 645 zcmYk4JxfAi6vxl?2DhL`vLG|)1u`(Gu$Q4Enx%qXu&ALh)8vAvcpV%X9HO}o(9qD> z(AF1eXljT)K!aoS^gDV3A2`oB{(t9<=W4CB(sve#&mtlYzEZm^`qi?T6dBQ!Q*06N zJ|Hsas?s~Oun}?FUc_@;XSgdSf30nkr)Nm7bg!p|TgTO=->j61+aghZYg&r@8-gEt zB^-I3V24Dw$0+;-USReYoPE4<W3G4`Fj`rCn*;Pb`W;#mKjlblhj=%v zf5dD32VUz}T#4@!AB6lfG9Ajh5H?4y28@nr#J+5xlt literal 0 HcmV?d00001 diff --git a/StraySrc/Glass/!Glass/Resources/Messages b/StraySrc/Glass/!Glass/Resources/Messages new file mode 100644 index 0000000..560547b --- /dev/null +++ b/StraySrc/Glass/!Glass/Resources/Messages @@ -0,0 +1,269 @@ +; +; Glass 1.xx messages +; + +;----- Main Glass messages -------------------------------------------------- + +; --- Miscellaneous standard messages --- + +yes:Yes +no:No + +; --- Alignment dialogue --- + +alNEM:Not enough memory to align icons +alNOHC:No horizontal container icon. The icons have not been moved horizontally. +alNOVC:No vertical container icon. The icons have not been moved vertically. + +alBATH:(align__horizCompare): Bad alignment type +alBATV:(align__vertCompare): Bad alignment type + +; --- Edit window/icon dialogues --- + +teNEMUI/eiNEMUI:Not enough memory to update icon +ewNEMUW:Not enough memory to update window + +eiNEM:Not enough memory to edit icon +ewNEM:Not enough memory to edit window + +eiCFF:Couldn't find font '%s'. The icon will not be antialiased. Colours may appear strange. +ewCFF:Couldn't find font '%s'. The title will not be antialiased. + +eiCDIP/ewCDWP:Delete +eiCDI:Are you sure you want to delete this icon? +ewCDW:Are you sure you want to delete this window? + +eiSPRGONE:Sprite '%s' not found: can't calculate size + +eiFGC:Icon foreground +eiBGC:Icon background + +ewTBFG:Title foreground +ewTBBG:Title background +ewWAFG:Work area foreground +ewWABG:Work area background +ewSCFG:Scroll bar foreground +ewSCBG:Scroll bar background +ewTBHI:Title highlight + +; --- Button type menus --- + +eiBTMT:Button type +eiBTYPE0/ewBTYPE0:Never +eiBTYPE1/ewBTYPE1:Always +eiBTYPE2/ewBTYPE2:Auto-repeat +eiBTYPE3/ewBTYPE3/ewBTYPE9:Debounced +eiBTYPE4/ewBTYPE4:Release +eiBTYPE5/ewBTYPE5:Double click +eiBTYPE6/ewBTYPE6/ewBTYPE11:Click/drag +eiBTYPE7/ewBTYPE7:Release/drag +eiBTYPE8/ewBTYPE8:Double/drag +eiBTYPE9:'Menu' icon +eiBTYPE10/ewBTYPE10:Click/double/drag +eiBTYPE11:Select/drag +eiBTYPE12/ewBTYPE12:Type 12 +eiBTYPE13/ewBTYPE13:Type 13 +eiBTYPE14:Click/write/drag +ewBTYPE14:Type 14 +eiBTYPE15/ewBTYPE15:Writable + +; --- Template file management --- + +tfUNT: + +; --- Initialisation messages --- + +wePUR:Free template editor +weIBM:>Info...|Preferences...,Toolbox...,Heap info...|Quit + +weILM:Loading messages +weILW:Loading windows +weLDF:Loading defaults +weIRP:Reading preferences +weILD:Loading document +weIFI:Initialised OK + +; --- Preferences messages --- + +prBTU:Bad time unit '%s' at line %i (must be 'hours', 'minutes' or 'seconds') +prHR:hours +prMI:minutes +prSE:seconds +prUNITT:Units +prUNIT:Hours,Minutes,Seconds + +prBIS:Bad icon size '%s' at line %i (must be 'large' or 'small') +prBST:Bad sort type '%s' at line %i (must be 'name', 'size', 'icons' or 'noSort') + +prSILT:An invalid autosave time has been entered. A default of %i has been substituted. + +prSILC:An invalid autosave count has been entered. A default of %i has been substituted. + +prGCOL:Grid colour +prGDCOL:Guide colour +prSGDCOL:Selected guide colour +prSBCOL:Select border colour +prSHCOL:Drag handle colour +prSSCOL:Special handle colour + +; --- Sprite handling --- + +spVT:%s sprites +spBANR:Template file sprites window + +spELD:Error loading default sprites: %s +spNEMLD:Not enough memory to load default sprites + +spNEMC:Not enough memory to create sprite area. Using the WIMP sprite area for this template file. Sprites may not appear correctly. + +spNEMM:Not enough memory to merge sprites +spEMF:Error merging file: %s + +spSPR:Sprite +spM:>Info... ‹F1,+_,Select all ^A,Clear selection ^Z,>Save... F3,Grab sprites... ^G +spSS:>Info... ^F1,>Copy... ^C,>Rename... ^R,>Save... ‹F3,Delete ^X + +spNAE:Sprite '%s' already exists +spNEMCPY:Not enough memory to copy sprite +spSVSPR:Save sprites + +spCGS:Can't grab sprites from the background or icon bar +spNEMGS:Not enough memory to grab sprites +spNAUSA:This window doesn't have a user sprite area +spGRB:Grabbed + +spESS:Error saving sprites: %s +spNEMSLSV:Not enough memory to save selection + +; --- Internel broadcast system --- + +imSMT:(intMsgs_send, caller fault): Bad message number + +; --- Tearoff icon editor --- + +teNEMUI:Not enough memory to update icon +teFG:Foreground +teBG:Background + +teEIMT:Edit icon +teEIM:Data,Appearance,Actions,Colours,>Position...,>Size... +teEIDT:Data +teEID:>Edit data...,>Indirected...,Text,Sprite +teAPMT:Appearance +teAPM:Horizontally centred,Vertically centred,Right aligned|Border,Filled background,Half-size sprite,Needs help +teACMT:Actions +teACM:Button type,>ESG...,Adjust toggles,Selected,Shaded +teCMT:Colours +teCM:>Foreground...,>Background... + +; --- Template file handling --- + +tfNEMTF:Not enough memory to create new template file. +tfBANR:Template file window + +tfNEMTL:Not enough memory to load template file +tfELF:Error loading file: %s +tfCFF:Some fonts used in this template file could not be found. Icons with such fonts will not be anti-aliased. +tfUTEC:Unrecognised template entry code found. Some information may be lost if you save this file. + +tfNAE:Window '%s' already exists + +tfNEMCRT:Not enough memory for new window +tfFERC:Font error while creating window +tfNEMGW:Not enough memory to grab window +tfFERG:Font error while grabbing window: some icons may not appear correctly +tfNEMCW:Not enough memory for copy. +tfFERCP:Font error while copying window: some icons may not appear correctly + +tfTMP:Templates +tfSVTIT:Save templates +tfSVWTIT:Save window +tfSVSEL/spSVSEL:Save selection +tfSEL/spSEL:Selection + +tfCSID:Can't save in Glass demo +tfNEMST:Not enough memory to save templates +tfERT:Error saving templates: %s + +tfSOFP/spSOFP:Replace +tfSOF/spSOF:File '%s' already exists. Are you sure you want to replace it? + +tfCOPY/spCOPY:Copy +tfREN/spREN:Rename +tfDELWP:Delete +tfDELW:Are you sure you want to delete the selected windows? + +tfCRT:Create +tfGRAB:Grab + +tfM:>Info... ‹F1,Display,+_,Select all ^A,Clear selection ^Z,>Save... F3,>Create... ^N,>Grab window... ^G,Show sprites ^S + +tfDSPT:Display +tfDSPM:Large icons F5,Small icons ‹F5|Sort by name F6,Sort by size ‹F6,Sort by no. of icons ^F6,Don't sort ‹^F6 + +tfWS:>Info... ^F1,Edit... ^E,>Copy... ^C,>Rename... ^R,>Save... ‹F3,Delete ^X + +tfWIN:Window + +tfOTQP:Quit +tfOTQ1:%i file modified but unsaved in Glass. Are you sure you want to quit? +tfOTQM:%i files modified but unsaved in Glass. Are you sure you want to quit? + +; --- Grabbing icons --- + +wdFERGI:Font error while grabbing icon. Icon may not appear correctly. +wdNITG:No icon to grab +wdCGI:Can't grab icons from this window +wdAGRB:Already in grab mode + +; --- Other icon manipulation --- + +wdNEMCI:Not enough memory to create icon +wdFERCPY:Font error while copying icons. Some icons may not appear correctly. +wdNEMCP:Not enough memory for copy +wdIIRN:Bad icon renumber: icon has not been renumbered + +; --- Main window menu --- + +wdTCRP/wdTCEP:Continue +wdTCE:Entering test mode will cancel any currently open edit dialogues for this window. Are you sure you want to continue? +wdTCR:Entering renumber mode will cancel any currently open edit dialogues for this window. Are you sure you want to continue? +wdCDIP:Delete +wdCDI:Are you sure you want to delete the selected icons? + +wdFERCI:Font error while creating icon. Icon may not appear correctly. + +wdTMG:You can only create %i guides in a window + +wdCRTMT:New icon + +wdWMT:Window +wdWM:Misc,>Save...#F3,Select,Create icon,>Edit icon,>Grid...,Guides + +wdMISCMT:Window +wdMISCM:>Info...#^F1|Edit window...#^W,Test mode#^T,Remove deleted icons,Bring back icons|Close window#^F2 + +wdSELMT:Select +wdSELM:Select all#^A,Clear selection#^Z,Copy#^C,Delete#^X|Reorder#^R,Bring to front#‹^F,Raise#^F,Lower#^B,Put to back#‹^B|Pull onto grid#^P,Align...#^L|Edit...#^E,Button type + +wdICNMT:Create icon +wdICNM:New icon#^N,Show palette,Grab icon#^G + +wdGDEMT:Guides +wdGDEM:Select all,Clear selection,Delete selection|Create horizontal,Create vertical + +; --- Icon palette handling --- + +wdNEMIP:Not enough memory to open icon palette +wdIPT:Icon palette +wdERIP:Error creating icon palette: %s + +; --- Toolbar handling --- + +wdBACKG:Back + +;----- Help messages -------------------------------------------------------- + +;----- STEEL messages ------------------------------------------------------- + +;---------------------------------------------------------------------------- diff --git a/StraySrc/Glass/!Glass/Resources/Sprites,ff9 b/StraySrc/Glass/!Glass/Resources/Sprites,ff9 new file mode 100644 index 0000000000000000000000000000000000000000..3bb4179bf1cd64496dcb0c8d6b73e6c2fd3c9ed9 GIT binary patch literal 20420 zcmeHPUuaxcdOs77|Il?~jcmt_3u|j+aG@oYGy?UZ4`X>~N=c~#R=UwkD_gQ7uVTwH zN+wOyIu8q(E^X{WLhJ3a`ywTsA%;*2%c9bS-G}XiAN#Nv3d>^XZa2)zr64bTnErm> zpL5S0$;voMmpb&wbHDTbJ?DJiIp>~p?!BH2Aq?U7FMkliB;fhw`72)r>`!|@_znEV z@H=SC&0eqfQ6Yp2S6BXI>B7}3BvbB}jeiJ`ItL*`oo1HyQ)G(*fmV8o_YQ?ap?B+6 z#L2qV?cP%U`~P&G?(>963DeE9(7-Ypj4;RQmBKZu~x6#G&o>fJ@eK zX9&)5y|B2vI7qD3Epip#eA03KdUL<}-iCGac2jXi!G|^|TGCX7sj(7*=BB0^m8nJp z-f6u?i3C5;dH|`&=eTY;AM*q>9;~Pl7$lA)h4A9umXYAT5(JlBaac+D>Tin;I{^9t zuWH!GA^HkaFxX>vk)(9?9hT~Pif49+)07uOEtZtWGj;MA>&1no)j{TPsR}Qx)`Ql8 zh;gpG(aO*r*_#>v?FTvSA9h_^-QK^rVTAJR8H*3G3W3s=#%2bjaB8cD2q$9pS@^;o5HI$`sU z7}@6Ax4oyFE;IdThgfSzl7L98)ysl2);1=I{}AX@f_J+Z*@kDaRDB=Pr|XLM^OcG# zJ@yG=t&Uc0kEPvE%_tPfKu$e@}vLJ(D2pN*y!<#mKs*uUU3Rau0 z5a|?uzWJ;xL^>rK&1S(AoG#X{H7^xR!RZtaGtFm%m0)xc4=0;X1*?+LMLdL8iom4= zrK@-dtE5W_N;mOvQcx;L#>HnYzCfG`LU-|cvk4bV2||Z}z~`HPh-p_81mEywPD#ix zq^l%xaQ-6l;P<8cGD(ECU)X!liTacD${iR<|4LOKQ4bo2sx>!sy+S^p4! z62B5NNWY37$GVJnz|tpA1yj{N3R^?$u0sPERNY+pg+c2gx+rHP{*CVeHZnRu$<)8(a=2VBhVn3-4XXT|Ju+lDDm#^V{Dwx#Bh#=1dnd~y6DYTQCJdFeT_fe`Bc<_) z%ETz7P{McxdGN+nw?L_37(tcFW#}Tv0W>tY2*TMTXio*916i{ba*s&4r4qd;%Alz( zm9!$|vurC8bv+sotC{XNl`X06q}UVES(c(n>Y>@`Nz*Nj*G4DG`Zql}Ql0>31kIAa zvqwfW$2Ne+zlpO5AAQ9%Qn9erY6zEHPBOquM@nZjQ#)Krv#zTa9_?CKgBMm->wk2q zK7XDbVV~eU!<5c3T+MNE6$lP0}?ER z8CGv*4kZJwcaT7E-1(3e`L9EUWxTw2x|(XYOaUjdx>V&0K)_R+`HtWx3#SUh}0@5QrG44(hJDb9frm#t*dvP_GPu; z{d1{(RN^}O?wr^x%(T~4;$7*4>?Mk;g;-|&{4#5_TbYcN>becJ>1BACUI(v}*U`1P zm#d=>zI=XB+PT|a&i6j78rFq=JP(zTKRDevS zf>p!#HalyWbQ>%47rs1yX_00)_x_67lXE22>&K`p>&12>p(o@MJEXFD*Z&5OVKlK- z9Q-LSV{sx#dD>q$7zna*dgOfv8{;p4RmaTIug5(zT6h{GV;is6-;F8F+`G9G!}W-^-1m9Vn$Q|F1!cmA9Gi58pT!*Bg_%1bJbrsedK zHgDI%0qK)r><2QqQ@o9!}P!k+spF?IZWzF1tcGl#_^5+dP>GeWZwfZg~<; zy~M_P<}u`Pov?cTwey&zrS`k62_c}pKen^ft`t3uF7JxT!|{&kpwi=kbQb0v%41wGgpB-Z-e2(c{nS}pc_T;;eH8BaaNwx5sD)5A|L!Y5*hxC}A75cdad*dR0v z7cS_IAEWv%c)z?Iwu*jSd{D?-B4b!DxUzAYB({za%DB%6!iSB#zWbR_R1$?>JZ|Iq z<*TpCu-^3zTbR zETJDH_JKc0%iF?>%e|EU;6Fh~^nbHVLQ=mn2;6RIebFH~cPl?G7In6Qgw50c*Kr*g zS$%n{;n?u{EB~KB;B)zx=C3RuE6>Q~m=Jl!o&B0WebzOL9MZWZeL-Yx2`>a7tu4)A z8AtdvK7Ts5u5iuadmW*#y~npLLU;$yA_#8+Qf~&3Ta9YFqfh+TJC}h{P+u*$+0k-l zX0=>lhVW}py1KG@_2NY(a7-RC9;4%Rcbc&>P(@Z&r?_x|`k3dl^>ql@GCT9r6>Ir! zeoFOXz6g81dx4Ds^L#Q^F01_ic3x{YVBOH19n){aG4=U{rK{GX=qK-R{tnS3`rMBF zX)G~09;bUue|Q3E3411I@Z~&bu-6$w-q|yTc1B?+Sv8c57s!fX3{Qk5q3@1yONIn8 zo(?JlWM>H37(!Ntk%eJoG9np_NCu;54I%KBFwene$;jOoK@jB)VUe~PRM(RJ}q?1p%uRuQ9otOZY&1b3I z!=UeG*X<7i`|I!l=F3-Bq-eRYd-!1U_ftOtZO1t^*HMz*G&GUTK6vG}D3-@C*Ou7j zC1ENYF%6kLO+)5LW!R)D3?ZwA&$T5mjEw2InB7}zxx5vZfwlu~Nt|R`>wTmkD9OSgHHPP?az7TRMZc z%{@O|9P_UNMleBDjKO!ejX|b*pG^RyFG)8LBlvLrn?3TtxO@jE@NX7s$ zfdmZVn^Y$Capq)1D>7)@G$e?|&@zQ#K^KNs1q>tS`$*b%vR#~Oh46L6YI*UZPZzRo z*SEK`_rC8ze1~ymj31v_L%E&Pk^yx`055lx>JJZ)em&J z%Bh5eK=hFF2th*VASjIUm&d4&A0w-Dvq#5M-^!CX7z(I?brOl*5v2RK;hZ9B5CuOaX)jgaw;2{q&^i7InTou?GG=WY^zdj0ZW3w)=8)f>9l zOy@m;I20kwzHN9%ai_zv!bevffmEzBzIjON{6+9i;Fs1JsC=R#(9c|E?Cd41>lsY7 zO;{}`y$WZ^S3&#MFAMyg_S^#bbDgIIeyy{2hB$(+P}^U%Pm4%ran+6zes>l}I$U=& zl11Wf>kfIC^PF4{%C+`g0?9vDtHgZmUU}5$&(*rmc)oV8+nxBH$b;PNJ~JVClEL^c z>}nd1sc)xMR|72#xWHY$d#3{bWjMJ3Df2$QgAPc49s6T zaoJ7H7@X#ep*J_x5VA6iET)W1MkIp~$zTkUkCj43VwEfscZ(HwwU(0esA9-`_GCEq zBljQoq?Ug&6l)X42-RY3vMh`zL#>EUK83;c0rtGq0Gav8Q82jqMIH#qShF(^Q}XCp z@{@a{Dw3}~0SS{)NxPB?`XIhZWl|q!PDU6bgPt@EiLNo!!NRbh3q#4G;e8?3M+R9V zHj+gmN8ZEMA=>2FesNN*M%NFn7aeTn@I2;oA%!ERy2o4p695Nar#W~(2Vk$4=OanuD7!&&v2jDiYG%UrUpj@|W zbbLDV84Dd;x-_8lXLfiJ2uUC$K_CbMK~VUMTO)peI$XTEyZ|7H3vpYWhhxa|9=ePl zCvz;LdGcB*$@e*x0EoQe`-`x)QRkZ{TNjrsX; z1txO9Q#q>$DkSp~CoOrN2n|+V{vu5pD3#9SuqX3B$gwT)#cAYsZwtID?;*jJ_{Z_X y7?7s!*E98mCS>}=e6OK1UGzZv&wbb$RE7yvW;ay#+x{`530Wp;VOdyA_kRElka2|o literal 0 HcmV?d00001 diff --git a/StraySrc/Glass/!Glass/Resources/Templates,fec b/StraySrc/Glass/!Glass/Resources/Templates,fec new file mode 100644 index 0000000000000000000000000000000000000000..d6310c7d3118def7da6dc99b3a99cd75cb01763d GIT binary patch literal 35326 zcmds=51f=&dGFs4!eYvsO9IV6g6R+mLA$|SSP1`;vVYl4mfdw{_$x+ccV>6T3_FvV zS$0XOVx$ojEh<%1wA%zD%|#n6O|hl9m{O&dD(2FN5iKfJ>ZKMVH=<(pet+jZ@9w)Z zvm`Zodp~zR`|Nq=`JLzdKhJs2pZCnr(9n<*_*@+CIIGJX=PG!yRIz(bU_OcJViOi{m_I`Q6!MoG6{+@Ed13&QEPPJ&9Px_>Vbd%U|O-*VyzVNlSHS zKAG;#xs9_O=O;EjhM&nKVp-Q&_PdVLZNm}2*5obc?kjhkgMo1BV)>ZjUR&Wfw*~yS zr2F%3E$K6&jRF>T0CT137O z;nC?$=M#$a1AH03*m1U6|Cwx}t2W)+rE=c3)NxMObc&zICVD#)Ik)ZisIP$k2Fg@n zO{{U8FWPdD{}n3J7l(#UG&s(C0{o_~SZBgb^lrGDJXZpIPZR=L7LZ zVw)3gZ$5nd4UTg;$fuPg;^F>ds~qQHTRw_6lF25?U02&0$C(-kKblUb+_`hZ@pX># z=fnQf-KKuaBZ;YRbex~t^2sUA+7$H|&Q0FnIPbOo#a|Q4_PXJ4c<@b*^IJCjTq0$H zfgL{ZX2NHw`G8ALwzMX*L|guaB&7BkAm}q~q)khSSs=PiEcptQ74w=wA(MVR_xOUdQ>@ zAm22sh1WV6$N8Gir!3X3>Pgng2k1vZetN*YueSW|tvSb8X8HY;S+cj=og02n!=XHS z!{^g?Yx?qedUkU1X2p|RIW2w1pjd&I7M2fU*&|RgWUuvPE?+=6aM#c z58+O!oEe%2whX$~;v3*E#Pbe=Ulm#nmVi*lM!p>WKJc{`e;e2zL#ST|)#-%c?**5u z_&*EwImnOy9O?TI{-zrFTSHHR{S8DFIOieZ19S5DPvV}%ol-e2 zbO~$-QvM|`d^7Sselr2jge0%@9ROGQgPD&c=aP{9(s*% zV@s>MI+4vMJCX9trZGHLH@krd;>lb-o9yUgWE;bOT~j2gbYf9m`WKi8IwRT+A=Ka#mA0fik~R^{l3Ph9h{% z%2_>9Ini`xjFd-P+uWKogW;wzJk+#CqbsjmH>*wEG$yW4!;ST(icL#-8MU+e<<`#X zms2~dRXgZ3^?&tY`dTA>)c>HehQ>MJZNYIh4)3t_Q#h_JTh*IS=2MCI-QKuKa83{Y zWuIQgow3om*~!Ox`3Cuqlwnt4F~#uBrSqCwl@?`R#(g4}H59y?+w-F7$3BP(RgPu_nS9Z*nNx-z#9F zj`LkT)vF@atLsOpWW$wGHojxIxpU`I%;;**`|9e5TiucF%ZKx6zus)1|Cw5|!8J5B z*Sk&y`56zrn|#b6PyR>cz}M|w`}Kg+aP($ z_d@(Rvn)P{>*K2d-UO-sGLY)01$otv!E};U`A$JLd;*rLP%$x%Ef*E2;vx z_`>~oz}GAY;NlA(#8o`t-3tS__`(&x#ry9J;EI0+_;TwH`L{0$;NlDS;{pHh;s7qb z@IhR~13p+;;aDBz8oqGFZ}BH8D@Sm}uliYzD}Ts;sdC;3F1~O-9`LVM&L6?W7e0t< z<$q9FHG+#TT=84{rCS9Al?pT0 zggWo<&dQvS5?$JekNUbMGuEeFCc2rtY%MuhT7c2^>XyjTfm}2j>&;~_E3nSKPrA=S znoFD`jsAzEGM{rs>D|lNhc{?I;Zr#7D9>g(hqWnte1QCgDKE|c+HlqH1_=N6Ay@{N zohn@RtZ?b*_d@Eol9#B|zmzQL(OQ%6z3`vLJ!bLW0lPhb zr{HU@yvO3zVD~^OJIODDuk`g;JPsz^r1WV9eUNlX{w(hGola;w7>`4;=a-Yo6Fm3g zUckMX^ab0M@ckA)X7NXn-v_CD&OjQE%K35zxAG@W+2_Ij22%Wa@+w^Om2rhi~ zSjzqQxD&}&8{c>1Z#sIDh(l+8dxCQw^4obLS=i3u zsGZl*BQWjFumy`{Fwcgq?MbI|3D+#~l(3%VwK`huR+}|PO;bvlj`*r>Yjgbt%hKUg z*JAeDrIpe?YFnFK)`*f?_8cRcw$_Mi)>TS}5NTRp?>4at67KEW)RD-dHX?nQ@?2kL zDJE-AQ%l_{I23trc~1X*Zk@Zxt**FZ@zQ~gexJ7njg!nr@>{UJj8V0XdXPP&zCD?G z@IO>X(OQk_YT!zJ+pBrgw@(vRIsVt;e*S$k!dpe+%;aE#3_#ohIF=@SEX( z5qH4i9|Zdt%Wv3{<$z9^}p; zCmXARH2EKrt~CHVhmr>JY@-LQpTarRA;OW2=I_!+(ifv_)NxK(OKekOiK}%2cjy6& zYcIykk(i@uU*pG67|fIv;c0zB<#;{v+Qc!96n&w&>~{DW z=Our&Q#Kxq$06xM$qSdfaLNBR&tWUS6+h$QEB-3UAV15>YknX)B7U0Q-1S0ZZHhyv3La;dGZZ#d7$lGQ<5k zyOyHWmp6AMI$fukG-|EmAf3TqFCxjN+(+6Ip7^B5Uym}xr_i?7zNKT=Kcm!zf<2=f7jZ{CEO{W4Tt^#?8^{;2H$J(V-|lNz~6hj5kGD4H7DDK ztMN@~Aj_<uUDZ}#Wg2c>>zbBPcBbKKgfX?zW7brI7OU`eCBs@*GOTq9%WX9z&yPaVo3anLTl^rd@K3?}oR8y2xWX4My(HU;N3(t<`8u8zejZoyU*uW3 zRpD!V6E1n-lK*F(c^uN7BgYe*X*_FuF2{X!%(?z7&;DLCu(3}oM8izkWF}d6QvbZb1d7P$mPQwDcT*4 zWS}GMHlz{*;dtMs4Bt56agum4#50+CzsR%yA<07<3)Z~1l0K~g>Qh+nf%Own@Bn(|2kaZOTjgsX$=T3&O?yw4TUfLqq#Ll6P7sI>7g`l!BY?XX51aP z(l6SV)R-oD;ma+)(c;owjTZklexyII#oqvK<@cPj`@l9r($C7@CCc*x_$+Yg=QNnc zKZP&+n97?k(ox;CFm`2%DxYfh6 z<9aEYLglDMfVz9oj7{CW>1-lQ6@;0H!&?=JhC7wuTq&VQeY1o#X=lXuR_+q2sxiAl)*J zx>ch+164rugTUIQJEXdw1D%J~mcS8PG2HyZLe$SM5l) z{4b#2wz%479(uXN1<-(Ya;E-=lbWwWX;O{0A&ezjM{uQjp+r1)=v zo`C->UrwtXR)#~H!Tt!6?fV)i5C8AL_u(#{?}W6D`y_M|*h%=p)sKa%pZ-sZd;ma+44Z2R}R)lM9 zuL6FUFKcmS2fP|A49RZog0J|$i)-SqU~ehSwpz~9W2&Et%sW&*=Wta%^O3Ex;j4TH z;ZH^WIIimFZm@eHwL9S%_(#F_TD$}7L1>!Am%~>%r3}s*BiQ4R%2)D}Exyd+UjTc~ z;&f%E@7g%mNvDx*X1~_oNWP+1Z)?|_B%)ubM%cq2z3NRLZ&!Er z)()##BDsS->{yQeYC5ncW!`i&pY(y^AR1cPqisxY;*>(VckW7-+4?q(rN+ET^%b;O zLy;0|h?LS|4H2WpnB9+B=xc}=U8bUK&G)eB-xy;y&0&IUTqgjEvR~8MUT6IhqT(~EZ%E-X%NQASAcsAD0 znrKmS8k^hN>)KuC5^d@t?MH1@`vU$4H88aCR~-8_C!YYFVa(rwI~iSBIQH+fxaNeV z@G5YP&6jbv;>xCKV05tiEJI6>6F!bK`?zNDKK`)c1%Dj33U~2Lr+*PL*nXzZ?^L|- zHRrT=*-D+?j+oiKL#>+OOPlu#GIxSAaN-vGDX3(26V`78Wj0%}GmYH$QzPif! zx`J|k)qy$VDCbdQ%P#ux%Nbjwccd@(kiHaj3@RL3gdef^g%bEw!Z-@wp&ZZSR({7R zTg&riwFUAj{jYM8Zrg=B9o_m4p0`85Mn5&e5A#K~v)NYz`x8jA(q9_?HiD}hrTd-) zI|gZ7kss+sg@1;$D*S)ZGo(Ym@50@VJ2EzS=I~zl z(&^`Lx8WMyj%*l`ZhsNVz}H-I7p}&R`CwI$;uo&5MYun<)PprxT9HrIZk7YsIZ9(5+3LZVeikO(k`6Q>3nib-Yw(pU$w5h?r86aaS{j z5IfsJVI59m)GN;5>gGCk{k-zZ^2!C}Rpk|W&;pLPjk8+H{X>-RVT$<~%6d6%&i~Mi zjc&XuaK`rK&WluSuT(c`T|{lIiZop!E$F7Hhv3a1y>Z-VkB+G%v`U|2;Px%!a3M=5#l{I4?I> z3#eH2on5kDWS3-cf1UG3-|<3HbB)BHgIIe;?0p z4&dh~XW(gZ~2VN#Vr*JkOUQjTQ7b=G58;(O!buhwwp*A2&F51-zWawTFHf{#U5CGq|j2 zhIYZ@(X5?mOcQ=9^(9>S|2X)cLW+OX5r(CWtSC3ttZ8a-7tGf#Cx@I2r>VA(v$nv; zI`bwDr_kdiw|Gq`=CD*$ibD0eFO4OC2k$&2g^Nb`HfOmsFvl2xwIP+xZV7Kr zCi*@KtYXEv~tl|6ZH$%Y-ZYdyd7mzjYYm z&#c`a2cO87OSlSOYrx+R;CtauBflDBg}Xdo2l?_T_{aI8d4}-d8g8NCn926kHoRd~ zQxAz6scvfNT*(}y;hw>9?NI6sincyTg-`6ia8+D!m)gMVN!4VsH1Jv+plXZ zQF~J#&C?Ek)v-kVQT<8h3l69~(H{4Z){j8^nYE&g@F(zPC+-y9QGcB0Cn2@E*|@^B zU*_Z51C~uLT;Vs8Muo3_sqnRzD7%tB(_fT_8~HNPgg-9yD*WCE`TbG)Xe#(AT)i7Q zA53cpKE4&cY{LB(-vE|})E7m~@GsyFSX}23_CnGZbcF75doE3SKIfXvUGMGPF>18A zeMP++*%afbx+hZN03GcuveF*w<+W^$X*&BxBhii&6cJ#;g z8CgH<(OPkwpSfbP+M_Zt>(afq=fgQtGj`a#AorWFf%NW67j-d%`qmkfW~k7{5w3P4 zT=iCnt6fb4Q@c8jt9G@BzQsF8!|iq(eChcExLO0$`eFo9ySW9vaLpBbTsn1&#bqN^ zfp5c&<6h4>9rF?-^9`NTISs!JzV@LrxXg9SK7i~8Ay@`idl%klah*^9q{VmQXA%5k zxavPzLp==k6vWW#+<=_om)+*a@4e`^#9`fG$vOCnU;V_7|7*x<4g%x|SNy{L_`e5s z*5c~pivJ|8AHUv5|0SgORlc(*_YL6Za8V99Z7sZv|JnH1|D*t9R?EUC>JnYCz7z|?qYg3^ESsV!I0?mpCwJ5-rjoum z?Swh$pAnE`@$n|ZEjp59xMp{4lz8!pCV4DA(PX$r+*|P0#Vr`+!3`UEX|F5VvKe7} z<1-e0w^z?s5brMMGzA*7+im9M-?2tkqHAXQ+~#c?msY~~Y126@UysQaD>43#+AF%u z99DZL`V`vJBXdfxkMvUa>SyXpYoS6tB|HiV-;P^|tDjwhf06cd3P0*++ACTI!7}Fn zcEKOui{^uxOLc?w1aS4=kAm;CxbpYM0lWhK!{C}TO8)P_js|dbnuFlw7XLBW^A=b7 zX4v$pA1HmdQiiXA5Hac724Cq@e^>Ymz!nDZHu#EP>SNe2bK)BZ1 z?tpyxsqmFPofiWctMat#u{Y z>(V8kp{@J6WG&C@ApVR!FI`f>7hjjWhiBO+J}zBy3%bMCC4UK^xq^?MAU|jLa@qFv zAMyMj0bJ`|vgMCk{56C%%jzPfF9ZJ+xW;Dn#noVIEMB6yu566fHqz#qWTw1jrJh*6 zvxjZFJYBYA3tw5&tRuxWsbuf{T95HsZK(#ga&^-heBPT#WLQ2NxzIvgt3RE+-+Nc5 zRH|ytT30PcB3bz{#=3fYKAq9w_jIcGz#V;kC39S28(yp(7K?jt6Bfk7vRFQwx+89m zDBfXC{AtNki&V0IHQ#yyw}v)2Ncs66s_$1`+muaqntFMq^HJHouO>|=aJ4?Phv$#j zI-WrsJK*ml{ReSn*FOsOdB~it2XBUd1a~X0?9zG`+1MvA?}N-hZW;W0aMgyjNA)#i zpRwT|xAGIgl@HnFKLGnTh@$fLgRT5_EB`aFpIiBj$jRP5jXQw5nDBoK!6}f|f6iN6 zYo)@Mg3kuiyR|^Z?v`Du{Hrf1|C+a~u(K#)5O;W>V6K{ckP}VSt?BD8Iw*NLId%4KNT-H%=I9C>G$pgCzZB@%k;X3}& z$M`>--cIl96;o_(ttm=yZDE3IODDKg8ML*xX(igbW|6Z9EJO1Slex3xH!_FU8CUgn z^&#~$^~plp_9FNWXg8SJN+B-Wt_@6cFyHn)#IyP`&BNTCwhR1|d^wD(w(^f)-+|QE zUkxe#*Mcj4jR)$76KP9YD_sqLJ$&sqzZ>^@_B*|o6q#c(gLw|V#=94B)t4)0I(N=Q z_Ey^#l|I>~N?#aUwr3^SJd2lu9|r$2?s;5=@4qsQy2*)u68;Uyt1oK~S&Qr{NV-zE z`q)p=z9-O8KZ<;@!XGoZc|oil5_KDT(T%z`myH;Y^h z^PCDTd4QBojJLX0bJ8kpR>S#jC$MG)+Ree9-nbUIYtvaSq0+0JafVP{{upD?tgd}U zZGGLa_jGS+tTk=iZfW_gO0J+v@wW<_KXL%kyQj#b@z+ z8|35CDQEd|23PXh2aZ_0gpQ0f>w=KxbSxg8$rTEzx&G!vNxy9co@ZXsw=6RgvUg`x z+*|mu2mEq@^@m?)J;-jF?2MY+mekq%Dqta|b9j+_C1 zAKzv7s2<+U^B^Q0t?=X2kHS}dDtyfc{tDvHoU`8xU*R7!^%xH6od)R~KYZyJg)beX z@XzrqoulwQd%?e;)LIPoYq460M(bSjZdX?-jX{ESpTC0N25)@Vm7?bQQ!jLF44HkQ z(dWPElEtB4$!~+Zne@vZY(wAa-4FjmG3uS@QS(6Q_vbW@@F_f3p|uamXiV06mC9UY z^=15IWEn?B(J&@uC^oj zy(Lm1Sy|i#N8@+&OCmL=N~}wr~48%ujYHSK=sy@Rz~Yx_t^)z$$NENUV zNBvj(4bttU;y-W0m!4GkZ^!SuAcY^;p*J_$dH00GUEMov^pk(H0+vrF_Zm_==Kk=7 z$nQa3@01Pl?0<+N&=%EOz4Dz%`t>Pni++9Roi?RMdmBdyLv8mWuJ%$<4XQ8 z&peua9mxxqyl~0?6VKm(eEIS4C0`{OzmGoJNbc1=Jxcs8ciK}%dr zFkc#DX`|i?YG~3SKF?0YxBtrU{85)51ig-&>3?azBT<|69{)y!U~uL5x_|7ETH*uhJ@cl2}zig4Y5BAmU~ zP%B~R9+5EELEJj{dGNe&%3AMaY=%_UJ0Rgt@Ljm->Or1)G;K}t+j*A!L0rk}4BH+^ zxgooz@4p-O2>4A`Ic0mn_%ry6xRO`+l2`hxz1NU+`^2cawl9Q%y3+qIb*X2icQ3_A z?Rc+p=*Egs)$ZxnuCB%E8~*sA%!h3qz&80Utfx!pj3=$1!ah3Oj<4fc=O~n}?Uawo>HC3lGV@H=JJiqZ_1f^)Ey$QOg$=o;mtOD#or9x3aK3kud{d_S9kQsi$Vw z7`lzEUIG6Zo-g1|XMXfGFn>K-w(t@7%PqbL`=;=YR^igok_QhJ-q9+2a0D;9qgD8c z5&X`=J6d;vF9(-D!Y{g`Rk-4}c+nlL!Usq2qB~lJD}F0qbVut(@a5q0NBnOuyrWgP z;A}7KcB1k-c;X|Js|>oJ8$f_UOkTwdl->={Gw@|gJddlj)PLdm3`BAa{S-r}UHcQ&=v(?TMjk&Ogq>pW4@FaMiw4 zE{BNAzwb&mhUQ0?;GH60)4}z-PDddAoG`Qt{xQC&zO_E|Ri1wUO#@T8X#MD|xLa}A zkFsmnp6#phZiBCS8Nk&V^e>TBBhxtXL#PM-G8!k1fI{YUt1V6!b= zgD1uRU0lVl{OPQ_?!>wl*;$bKpXLa1mA@vid#wCS@C)Q$YhE+JmA@7+)q%?9b_o0*UHNITLRh_HPs@?eb zUW=>E2p<60V)1VyC;f35cbCQg2yBI&d+?@l`L39AyXtwJ zEeG+`cj|D@;VzAhz9U4q>OuIR#UDU68<3x7ap?%jKLqxU0IvNg$xpWU2f=m+aILiq zKZYy$N5CEp;L9z(&EkInCYyynlPCSwkmMIx{AmE~X$W`ql4rCgS|bB3#%(7Z1D$$( z&3^4PM}oA}V;SDzo&cjWo!Jujs`EVFs|8j-i~v6T78-Hu{PYI;?j#1*^SJ(pVo=}J zU4+B$9cSRlKGG*>L!5GUIeI^a3kw|XS9Kawf0$H zw?mUi+pRWz+sL!(3E9x^f-Qp7P=agaR$mq^lb^(22Jd=T;iBa1N9C}wU{6i^3d?Ny z2HUtqf_h7K=vw^A|8uwpa9QUcb?;)E#Wim)g{%B$lLpzjt8rN`G5g(0m*zdsSzPNS z!e#SltP4T1Gp{9F$!oqPTzyP;TWUP!&-qpECDc{mSH71}J~(1b0{wD5$6y>R*HZWR z>E3AB=lWc!TxIWRelUqnzZZ8IZeh7TVR5a`l)_~@oS-~j#Fg%leXjM<>5$6B*cR{~ zpY;^-33VVFO|Q>Bb^b_8KPE5eMWc+ z{$cPv7T0@Bn<33_l>c)0FM_WXPX6_d(r!rc3)lOkZG4$y@qYmOasb!;dN+YBZVRvI%}Km{;!F zi+(Q9^VeSA#?OQ3V16gXHm0|_dJKr-%<2dbDPP4)19}W^j-^PPc_+Qo{@On!8^one(gKP29dG9#?uzv9M?hEtkXMHrVW@g@R6RtDnJ|4XDPHB*SIDjjAQ|lMr zPbcUMh->DoRTht1e9g$&?;)}}bcuhGpJQ>`auk4B>ppDp^SBDXk(-7130ZD@bj|vf zY?rB|e-G}`nWNti`V4&G&sco%Oy_p(J80b>meCK3to#OC@cxIu-eGac3zxibh5uo& zJpuX4q)YLKJ^4|;MI?FQlDGJsUqJThK=@iO7p^lM#Q&vd!M<+sjqs)SJmQJRG07>DHUdRQSXz@dYR*)_6s!DAN%>x&_lSFa0|!7kHS9=|5^&?atU1RwTk#O-bmk5 zo@LsT@XyrV0X_-7*5?-CPNBTN1bzn6zOTk(>HE{TM&DP4L%#sK27RybMEG8C*&WAl zbuaDBV6TIQ&uhUS1m9!vYOpoXjaGgc{B7Vp7Egoe{P|RHrGE$MQuc`8$r&;;?z2~*+-oIEhGHP^AcUgHM`Z*{O} z)Ni%P6Zf_RuFTb_YJc{vl;_48e*DJ2GxsI@u9jbu#g+uOybfov*Z+3K+_luNxpMAW z{M?O^u@+^F-vMP}IF=7HPt*W2mIpJ#jHbK0?Qf8b1+06&)?{w{ke(t`=8>j~q_XdeF#^sW{&y?hI5ocKyS9=Z@Q0Fm}b!(JyB%r?KOe z+G^5|M<^$y?SjgSIqm>$PJ5pU`yNQ=Nsm*0`@uD~>9kj9K#@plSWYrua2rn_|{FMOND2Q7XS?C&iu-TgZFOK{g){F`8U=RxxA z7FYUx{CTjSSo}ErS;*-eOcYo7n}lAT3aKq>j;ipF;`;Kh0h?uY_i2m&Jb*6&TWWEo z|1{;J{K+O${-R*30{A|QAGLS_tjppWUv|Mifvd4c<)`1x+5xHj_7Sc>HXEGqKLNH6 zQvGP(L~Ent@t48XnGlU#WXYU$oeaMY{s!C>uJ%Zu20sd^KMcT^yy{Q#i(^jcS+H+I zDj$(-5{0k1s=_}HrtsBv6u#!N3V)Uj|1$WCkRQI}6~5#Z{$zk@kiu3NdRJVwht@E( zFLN8%Y=|Ju*u53L%6UJo=E8Mgt&nU3mAi1&kB`3ztP7HDU~ZN{sj|eV$zFYwi)5r^ z+1IJ8sNl9-{_&O5xBU8{t`3#AX#41wz{D!vH->5UjSH?T?eA$ezX8wNDx+^J1@M0R z-Tn}JFje|x@1k(p#|o$23n#F#&7x7M1lE`Y-eGcT{ugDnrde4nSxPIDy~#~|o0#Y8 z_7!)em`oXQ+0+`hwlB+KcYZi0wX53O*Kk9VC)i_u(5G0kv6Q6wJ^SwR_P!3?i^v&V z-R~Tp)80CtrGV6y*9L~((KgGlrBcAYM4QmQ;XUYr6t4eK+Z|VMc3irr-TEmUL-!yk z8TCh+siS#-blMW!bGXtekHG&VL{z3v9)^FG=d-w#>_z?=&yPbILz{H2!(3NAvIEuc F{vQ(Q>S6!@ literal 0 HcmV?d00001 diff --git a/StraySrc/Glass/!Glass/c/align b/StraySrc/Glass/!Glass/c/align new file mode 100644 index 0000000..4b36069 --- /dev/null +++ b/StraySrc/Glass/!Glass/c/align @@ -0,0 +1,810 @@ +/* + * align.c + * + * The alignment dialogue box + * + * © 1994-1998 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Glass. + * + * Glass is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Glass is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Glass. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Header files ------------------------------------------------------*/ + +/* + * ANSI standard headers + */ + +#include +#include + +/* + * Steel headers + */ + +#define _STDAPP +#include "steel/Steel.h" + +/* + * Glass headers + */ + +#include "gIcons.h" + +#include "glass.h" +#include "window.h" +#include "align.h" +#include "tfile.h" + +/*----- Type definitions --------------------------------------------------*/ + +typedef struct +{ + wimp_box box; + int i; +} +align__iconstr; + +typedef enum +{ + align__MIN, + align__CENTRE, + align__MAX +} +align__order; + +/*----- Static global variables -------------------------------------------*/ + +static dbox align__dbox; +static align__order align__sortOrder; + +/*----- Support routines --------------------------------------------------*/ + +/* + * int align__horizCompare(const void *a,const void *b) + * + * Use + * Compares two icons for horizontal alignment. Used as a compare for + * qsort. + */ + +static int align__horizCompare(const void *a,const void *b) +{ + const align__iconstr *x=a; + const align__iconstr *y=b; + int result=0; + switch (align__sortOrder) + { + case align__MIN: + result=x->box.x0-y->box.x0; + break; + case align__MAX: + result=x->box.x1-y->box.x1; + break; + case align__CENTRE: + result=x->box.x1+x->box.x0-y->box.x0-y->box.x1; + break; + default: + werr(TRUE,msgs_lookup("alBATH")); + break; + } + return (result); +} + +/* + * int align__vertCompare(const void *a,const void *b) + * + * Use + * Compares two icons for vertical alignment. Used as a compare for + * qsort. + */ + +static int align__vertCompare(const void *a,const void *b) +{ + const align__iconstr *x=a; + const align__iconstr *y=b; + int result=0; + switch (align__sortOrder) + { + case align__MIN: + result=x->box.y0-y->box.y0; + break; + case align__MAX: + result=x->box.y1-y->box.y1; + break; + case align__CENTRE: + result=x->box.y1+x->box.y0-y->box.y0-y->box.y1; + break; + default: + werr(TRUE,msgs_lookup("alBATV")); + break; + } + return (result); +} + +/* + * void align__doAlign(void) + * + * Use + * Does an align on the currently selected icons, wherever they may be. + * The settings are read from the dialogue box, and processed. + */ + +static void align__doAlign(void) +{ + align__iconstr *a; /* Array of icons to align */ + glass_windPointer *w=window_selectionOwner(); /* Window containing icons */ + wimp_box bound; /* Bounding box of the selection */ + int width=0; /* Total width of all the icons */ + int height=0; /* Total height of all the icons */ + + int xcont=-1; /* Index/icon of horizontal container */ + int ycont=-1; /* Index/icon of vertical container */ + + int num; /* Number of selected icons */ + + /* --- Loop variables --- */ + + int i; + int j; + + /* --- Ensure that we have something to do --- */ + + if (!w) + return; + if (!w->selno) + return; + + num=w->selno; + + /* --- Put the icons into an array for sorting etc. --- * + * + * We also keep track of the bounding box of the selected icons, their + * total width and their total height, and which, if any, are containers. + */ + + { + BOOL started=FALSE; + + /* --- Allocate memory for the array --- */ + + if (a=mem_alloc(num*sizeof(align__iconstr)),!a) + { + werr(FALSE,msgs_lookup("alNEM")); + return; + } + + j=0; + for (i=0;idef->desc.w.nicons;i++) + { + if (w->def->i[i].selected) + { + a[j].i=i; + window_boundingBox(w,i,&a[j].box); + width+=a[j].box.x1-a[j].box.x0; + height+=a[j].box.y1-a[j].box.y0; + if (!started) + { + bound=a[j].box; + started=TRUE; + xcont=ycont=j; + } + else + { + if (bound.x0>a[j].box.x0) + { + bound.x0=a[j].box.x0; + if (bound.x1a[j].box.y0) + { + bound.y0=a[j].box.y0; + if (bound.y1def->desc.w.scx+ + (w->def->desc.w.box.x1-w->def->desc.w.box.x0)/2; + } + + for (i=0;iselno,sizeof(align__iconstr),align__horizCompare); + + if (dbox_selecticon(align__dbox,glass_AHLEFT,dbox_READSTATE)) + { + int space=a[num-1].box.x0-a[0].box.x0; + int anchor=a[0].box.x0; + int thisBit; + + for (i=0;idef->desc.w.box.x1-w->def->desc.w.box.x0-width; + int icwidth; + int thisBit; + int anchor=w->def->desc.w.scx; /* This anchor also moves */ + + for (i=0;idef->desc.w.scy- + (w->def->desc.w.box.y1-w->def->desc.w.box.y0)/2; + } + + for (i=0;iselno,sizeof(align__iconstr),align__vertCompare); + + if (dbox_selecticon(align__dbox,glass_AVBOTTOM,dbox_READSTATE)) + { + int space=a[num-1].box.y0-a[0].box.y0; + int anchor=a[0].box.y0; + int thisBit; + + for (i=0;idef->desc.w.box.y1-w->def->desc.w.box.y0; + int icheight; + int thisBit; + int anchor=w->def->desc.w.scy-space; /* This anchor also moves */ + space-=height; + + for (i=0;it); + + for (i=0;iselno;i++) + window_setBox(w,a[i].i,&a[i].box); + + mem_free(a); +} + +/*----- Event handlers ----------------------------------------------------*/ + +/* + * void align__dboxHandler(dbox d,dbox_field f,void *handle) + * + * Use + * Handles events for the Alignment dialogue box. + * + * Parameters + * dbox d == the dbox handle (align__dbox) + * dbox_field f == what happened (usually a mouse click) + * void *handle == a pointer (ignored) + */ + +static void align__dboxHandler(dbox d,dbox_field f,void *handle) +{ + BOOL shadeBox; + unused(handle); + switch (f) + { + case dbox_CLOSE: + dbox_delete(d); + align__dbox=0; + break; + case glass_AOK: + dbox_clickicon(d,f); + align__doAlign(); + if (!dbox_wasAdjustClick()) + dbox_hide(d); + dbox_unclick(); + if (!dbox_wasAdjustClick()) + { + dbox_delete(d); + align__dbox=0; + } + break; + case glass_ACANCEL: + dbox_clickicon(d,f); + dbox_hide(d); + dbox_unclick(); + dbox_delete(d); + align__dbox=0; + break; + case glass_AHNONE: + dbox_clickicon(d,f); + dbox_shadeicon(d,glass_AHLEFT,TRUE); + dbox_shadeicon(d,glass_AHRIGHT,TRUE); + dbox_shadeicon(d,glass_AHCENTRE,TRUE); + dbox_shadeicon(d,glass_AHWIDTH,TRUE); + dbox_shadeicon(d,glass_AHBOUND,TRUE); + dbox_shadeicon(d,glass_AHVISAREA,TRUE); + dbox_shadeicon(d,glass_AHCONTAIN,TRUE); + dbox_unclick(); + break; + case glass_AHALIGN: + dbox_clickicon(d,f); + dbox_shadeicon(d,glass_AHLEFT,FALSE); + dbox_shadeicon(d,glass_AHRIGHT,FALSE); + dbox_shadeicon(d,glass_AHCENTRE,FALSE); + dbox_shadeicon(d,glass_AHWIDTH,TRUE); + if (dbox_selecticon(d,glass_AHWIDTH,dbox_READSTATE)) + { + dbox_selecticon(d,glass_AHWIDTH,FALSE); + dbox_selecticon(d,glass_AHCENTRE,TRUE); + } + shadeBox=!dbox_selecticon(d,glass_AHCENTRE,dbox_READSTATE); + dbox_shadeicon(d,glass_AHBOUND,shadeBox); + dbox_shadeicon(d,glass_AHVISAREA,shadeBox); + dbox_shadeicon(d,glass_AHCONTAIN,TRUE); + if (dbox_selecticon(d,glass_AHCONTAIN,dbox_READSTATE)) + { + dbox_selecticon(d,glass_AHCONTAIN,FALSE); + dbox_selecticon(d,glass_AHBOUND,TRUE); + } + dbox_unclick(); + break; + case glass_AHDISTRIB: + dbox_clickicon(d,f); + dbox_shadeicon(d,glass_AHLEFT,FALSE); + dbox_shadeicon(d,glass_AHRIGHT,FALSE); + dbox_shadeicon(d,glass_AHCENTRE,FALSE); + dbox_shadeicon(d,glass_AHWIDTH,FALSE); + shadeBox=!dbox_selecticon(d,glass_AHWIDTH,dbox_READSTATE); + dbox_shadeicon(d,glass_AHBOUND,shadeBox); + dbox_shadeicon(d,glass_AHVISAREA,shadeBox); + dbox_shadeicon(d,glass_AHCONTAIN,shadeBox); + dbox_unclick(); + break; + case glass_AVNONE: + dbox_clickicon(d,f); + dbox_shadeicon(d,glass_AVTOP,TRUE); + dbox_shadeicon(d,glass_AVBOTTOM,TRUE); + dbox_shadeicon(d,glass_AVCENTRE,TRUE); + dbox_shadeicon(d,glass_AVHEIGHT,TRUE); + dbox_shadeicon(d,glass_AVBOUND,TRUE); + dbox_shadeicon(d,glass_AVVISAREA,TRUE); + dbox_shadeicon(d,glass_AVCONTAIN,TRUE); + dbox_unclick(); + break; + case glass_AVALIGN: + dbox_clickicon(d,f); + dbox_shadeicon(d,glass_AVTOP,FALSE); + dbox_shadeicon(d,glass_AVBOTTOM,FALSE); + dbox_shadeicon(d,glass_AVCENTRE,FALSE); + dbox_shadeicon(d,glass_AVHEIGHT,TRUE); + if (dbox_selecticon(d,glass_AVHEIGHT,dbox_READSTATE)) + { + dbox_selecticon(d,glass_AVHEIGHT,FALSE); + dbox_selecticon(d,glass_AVCENTRE,TRUE); + } + shadeBox=!dbox_selecticon(d,glass_AVCENTRE,dbox_READSTATE); + dbox_shadeicon(d,glass_AVBOUND,shadeBox); + dbox_shadeicon(d,glass_AVVISAREA,shadeBox); + dbox_shadeicon(d,glass_AVCONTAIN,TRUE); + if (dbox_selecticon(d,glass_AVCONTAIN,dbox_READSTATE)) + { + dbox_selecticon(d,glass_AVCONTAIN,FALSE); + dbox_selecticon(d,glass_AVBOUND,TRUE); + } + dbox_unclick(); + break; + case glass_AVDISTRIB: + dbox_clickicon(d,f); + dbox_shadeicon(d,glass_AVTOP,FALSE); + dbox_shadeicon(d,glass_AVBOTTOM,FALSE); + dbox_shadeicon(d,glass_AVCENTRE,FALSE); + dbox_shadeicon(d,glass_AVHEIGHT,FALSE); + shadeBox=!dbox_selecticon(d,glass_AVHEIGHT,dbox_READSTATE); + dbox_shadeicon(d,glass_AVBOUND,shadeBox); + dbox_shadeicon(d,glass_AVVISAREA,shadeBox); + dbox_shadeicon(d,glass_AVCONTAIN,shadeBox); + dbox_unclick(); + break; + case glass_AHLEFT: + case glass_AHRIGHT: + case glass_AHCENTRE: + case glass_AHWIDTH: + case glass_AHBOUND: + case glass_AHVISAREA: + case glass_AHCONTAIN: + dbox_clickicon(d,f); + if (dbox_selecticon(d,glass_AHALIGN,dbox_READSTATE)) + shadeBox=!dbox_selecticon(d,glass_AHCENTRE,dbox_READSTATE); + else + shadeBox=!dbox_selecticon(d,glass_AHWIDTH,dbox_READSTATE); + dbox_shadeicon(d,glass_AHBOUND,shadeBox); + dbox_shadeicon(d,glass_AHVISAREA,shadeBox); + dbox_shadeicon(d, + glass_AHCONTAIN, + !dbox_selecticon(d,glass_AHWIDTH,dbox_READSTATE)); + dbox_unclick(); + break; + case glass_AVTOP: + case glass_AVBOTTOM: + case glass_AVCENTRE: + case glass_AVHEIGHT: + case glass_AVBOUND: + case glass_AVVISAREA: + case glass_AVCONTAIN: + dbox_clickicon(d,f); + if (dbox_selecticon(d,glass_AVALIGN,dbox_READSTATE)) + shadeBox=!dbox_selecticon(d,glass_AVCENTRE,dbox_READSTATE); + else + shadeBox=!dbox_selecticon(d,glass_AVHEIGHT,dbox_READSTATE); + dbox_shadeicon(d,glass_AVBOUND,shadeBox); + dbox_shadeicon(d,glass_AVVISAREA,shadeBox); + dbox_shadeicon(d, + glass_AVCONTAIN, + !dbox_selecticon(d,glass_AVHEIGHT,dbox_READSTATE)); + dbox_unclick(); + break; + } +} + +/*----- External routines -------------------------------------------------*/ + +/* + * void align(void) + * + * Use + * Opens the align dialogue box. There can only be one selection, ergo + * there can only be one align box. + */ + +void align(void) +{ + if (!align__dbox) + { + align__dbox=dbox_create("align"); + if (!align__dbox) + return; + + dbox_shadeicon(align__dbox,glass_AHLEFT,TRUE); + dbox_shadeicon(align__dbox,glass_AHRIGHT,TRUE); + dbox_shadeicon(align__dbox,glass_AHCENTRE,TRUE); + dbox_shadeicon(align__dbox,glass_AHWIDTH,TRUE); + dbox_shadeicon(align__dbox,glass_AHBOUND,TRUE); + dbox_shadeicon(align__dbox,glass_AHVISAREA,TRUE); + dbox_shadeicon(align__dbox,glass_AHCONTAIN,TRUE); + + dbox_shadeicon(align__dbox,glass_AVTOP,TRUE); + dbox_shadeicon(align__dbox,glass_AVBOTTOM,TRUE); + dbox_shadeicon(align__dbox,glass_AVCENTRE,TRUE); + dbox_shadeicon(align__dbox,glass_AVHEIGHT,TRUE); + dbox_shadeicon(align__dbox,glass_AVBOUND,TRUE); + dbox_shadeicon(align__dbox,glass_AVVISAREA,TRUE); + dbox_shadeicon(align__dbox,glass_AVCONTAIN,TRUE); + + dbox_eventHandler(align__dbox,align__dboxHandler,0); + } + dbox_display(align__dbox,dbox_STATIC_LASTPOS); +} diff --git a/StraySrc/Glass/!Glass/c/colSelect b/StraySrc/Glass/!Glass/c/colSelect new file mode 100644 index 0000000..1c5d6b4 --- /dev/null +++ b/StraySrc/Glass/!Glass/c/colSelect @@ -0,0 +1,347 @@ +/* + * colSelect.c + * + * Handling of a colour button + * + * © 1994-1998 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Glass. + * + * Glass is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Glass is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Glass. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Header files ------------------------------------------------------*/ + +/* + * ANSI standard headers + */ + +#include + +/* + * Steel headers + */ + +#define _STDAPP +#include "steel/Steel.h" +#include "steel/akbd.h" +#include "steel/colourtran.h" + +/* + * Glass headers + */ + +#include "gIcons.h" + +#include "glass.h" +#include "colSelect.h" + +/*----- Support routines --------------------------------------------------*/ + +/* + * void colSelect__addBorder(dbox d,int colour) + * + * Use + * Adds a border to an icon in the colour dbox. It chooses the most + * suitable colour for the border as being the nearest colour available in + * the WIMP palette to either black or white, whichever contrasts most + * with the colour to border. + * + * Parameters + * dbox d == the colour dbox handle + * int colour == the colour to border + */ + +static void colSelect__addBorder(dbox d,int colour) +{ + static wimp_paletteword blacknwhite[]={0,0,0,0, 0,255,255,255,}; + static wimp_palettestr wimppal; + int col; + wimpt_noerr(wimp_readpalette(&wimppal)); + wimpt_noerr(colourtran_return_Oppcolourformode(wimppal.c[colour],0, + blacknwhite,&col)); + wimpt_noerr(colourtran_return_colourformode(blacknwhite[col],12, + wimppal.c,&col)); + /* --- We now have the correctly contrasting colour in col --- */ + wimpt_noerr(wimp_set_icon_state(dbox_syshandle(d), + colour+glass_CSCOLOURS,5+(col<<24),0x0f000005)); +} + +/* + * void colSelect__removeBorder(dbox d,int colour) + * + * Use + * Removes the 'selected' border from the colour specified. + * + * Parameters + * dbox d == the colour dbox handle + * int colour == the colour to unborder + */ + +static void colSelect__removeBorder(dbox d,int colour) +{ + wimpt_noerr(wimp_set_icon_state(dbox_syshandle(d), + colour+glass_CSCOLOURS,0,0x0f000005)); +} + +/*----- External routines -------------------------------------------------*/ + +/* + * void colSelect_setColourButton(dbox d,dbox_field f,int colour) + * + * Use + * Sets a colour button to show a colour + * + * Parameters + * dbox d == dbox containing button + * dbox_field f == the icon which is the button + * int colour == colour to set the button. 255 means transparent + */ + +void colSelect_setColourButton(dbox d,dbox_field f,int colour) +{ + if (colour==255) + { + wimpt_noerr(wimp_set_icon_state(dbox_syshandle(d),f, + 0x10000003,0xf0000003)); + } + else + { + wimpt_noerr(wimp_set_icon_state(dbox_syshandle(d),f, + 0x00000001+(colour<<28),0xf0000003)); + } +} + +/* + * BOOL colSelect__raw(dbox d,wimp_eventstr *e,void *handle) + * + * Use + * Handles raw events (keypresses in particular) in the Glass colour box. + * + * Parameters + * dbox d == the dialogue box handle in question + * wimp_eventstr *e == the wimp event block + * void *handle == pointer to colour value + * + * Returns + * Whether the event was interesting or not. + */ + +static BOOL colSelect__raw(dbox d,wimp_eventstr *e,void *handle) +{ + int *c = handle; + BOOL handled = FALSE; + switch (e->e) + { + case wimp_EKEY: { + unsigned mask = 0; + int offset = 0; + int ncol; + if (dbox_selecticon(d,glass_CSTRANS,dbox_READSTATE)) + break; + switch (e->data.key.chcode) + { + case key_Left: + mask = 0xC; + offset = -1; + break; + case key_Right: + mask = 0xC; + offset = 1; + break; + case key_Up: + mask = ~0xC; + offset = -4; + break; + case key_Down: + mask = ~0xC; + offset = 4; + break; + } + if (!mask) + break; + handled = TRUE; + ncol = *c + offset; + if ((ncol ^ *c) & mask) + break; + colSelect__removeBorder(d,*c); + colSelect__addBorder(d,ncol); + *c = ncol; + break; + } + } + return (handled); +} + +/* + * void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing, + * BOOL allowTrans,colSelect_proc proc,void *handle) + * + * Use + * Handles mouse events on a colour button. + * + * Parameters + * dbox d == the dialogue containing the colour button + * dbox_field f == the icon which is the colour button + * wimp_bbits bbits == button status that prompted this + * char *editing == what we're editing (for dialogue) + * BOOL allowTrans == whether we're allowed transparent colour + * colSelect_proc proc == routine to take notice of any changes + * void *handle == pointer to pass to the proc + */ + +void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing, + BOOL allowTrans,colSelect_proc proc,void *handle) +{ + int curcol; + wimp_icon ic; + dbox cs; + dbox_field cf; + BOOL done=FALSE; + wimpt_noerr(wimp_get_icon_info(dbox_syshandle(d),f,&ic)); + curcol=(ic.flags>>28) & 15; + if (ic.flags & 2) + curcol=255; + switch (bbits) + { + case wimp_BLEFT: + switch (curcol) + { + case 255: + curcol=0; + break; + case 15: + curcol=(allowTrans ? 255 : 0); + break; + default: + curcol++; + break; + } + colSelect_setColourButton(d,f,curcol); + proc(d,f,curcol,handle); + break; + case wimp_BRIGHT: + switch (curcol) + { + case 255: + curcol=15; + break; + case 0: + curcol=(allowTrans ? 255 : 15); + break; + default: + curcol--; + break; + } + colSelect_setColourButton(d,f,curcol); + proc(d,f,curcol,handle); + break; + case wimp_BMID: + if (cs=dbox_create("colourSel"),!cs) + return; + if (!allowTrans) + wimpt_noerr(wimp_set_icon_state(dbox_syshandle(cs),glass_CSTRANS, + 1<<23,1<<23)); + if (curcol==255) + { + dbox_selecticon(cs,glass_CSTRANS,TRUE); + curcol=7; + } + else + { + dbox_selecticon(cs,glass_CSTRANS,FALSE); + colSelect__addBorder(cs,curcol); + } + dbox_setfield(cs,glass_CSEDITING,"%s",editing); + dbox_rawEventHandler(cs,colSelect__raw,&curcol); + dbox_display(cs,dbox_MENU_OVERPTR); + { + wimp_caretstr c; + c.w = dbox_syshandle(cs); + c.i = -1; + c.x = -500; + c.y = 0; + c.height = 40; + c.index = -1; + wimp_set_caret_pos(&c); + } + while (!done) + { + cf=dbox_fillin(cs); + switch (cf) + { + case dbox_CLOSE: + dbox_delete(cs); + done=TRUE; + break; + case dbox_HELP: + help_startHelp(); + help_addLine(msgs_lookup("cshCSDB")); + help_readFromIcon(); + help_endHelp(); + break; + case glass_CSCANCEL: + dbox_clickicon(cs,cf); + dbox_hide(cs); + dbox_unclick(); + dbox_delete(cs); + done=TRUE; + break; + case glass_CSOK: + dbox_clickicon(cs,cf); + if (dbox_selecticon(cs,glass_CSTRANS,dbox_READSTATE)) + { + colSelect_setColourButton(d,f,255); + proc(d,f,255,handle); + } + else + { + colSelect_setColourButton(d,f,curcol); + proc(d,f,curcol,handle); + } + if (!dbox_wasAdjustClick()) + dbox_hide(cs); + dbox_unclick(); + if (!dbox_wasAdjustClick()) + { + dbox_delete(cs); + done=TRUE; + } + break; + case glass_CSTRANS: + if (dbox_selecticon(cs,glass_CSTRANS,dbox_READSTATE)) + colSelect__removeBorder(cs,curcol); + else + colSelect__addBorder(cs,curcol); + break; + default: + cf-=glass_CSCOLOURS; + if (cf>=0 && cf<=15 && (cf!=curcol || + dbox_selecticon(cs,glass_CSTRANS,dbox_READSTATE))) + { + if (!dbox_selecticon(cs,glass_CSTRANS,FALSE)) + colSelect__removeBorder(cs,curcol); + colSelect__addBorder(cs,cf); + curcol=cf; + } + break; + } + } + break; + } +} diff --git a/StraySrc/Glass/!Glass/c/editIcon b/StraySrc/Glass/!Glass/c/editIcon new file mode 100644 index 0000000..74d7f83 --- /dev/null +++ b/StraySrc/Glass/!Glass/c/editIcon @@ -0,0 +1,1690 @@ +/* + * editIcon.c + * + * Edit icon dialogue box + * + * © 1994-1998 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Glass. + * + * Glass is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Glass is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Glass. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Header files ------------------------------------------------------*/ + +/* + * ANSI standard headers + */ + +#include +#include +#include + +/* + * Steel headers + */ + +#define _STDAPP +#define _LOWLVL +#include "steel/Steel.h" + +#include "steel/buttons.h" +#include "steel/fontMenu.h" +#include "steel/akbd.h" +#include "steel/bbc.h" +#include "steel/buffer.h" +#include "steel/font.h" + +/* + * Glass headers + */ + +#include "gStruct.h" +#include "gMenus.h" +#include "gIcons.h" + +#include "glass.h" +#include "tfile.h" +#include "window.h" +#include "intMsgs.h" +#include "editIcon.h" +#include "colSelect.h" +#include "indir.h" +#include "gPrefs.h" + +/*----- Static variables --------------------------------------------------*/ + +static char *editIcon__panels[]= +{ + "iconData", + "iconAppear", + "iconActions", + "iconColours", + "iconPos", + "iconSize", +}; + +/*----- Support routines --------------------------------------------------*/ + +#define max2(a,b) ((a)>(b) ? (a) : (b)) +#define min2(a,b) ((a)<(b) ? (a) : (b)) + +/* + * void editIcon__setupPanel(glass_editIcon *ed) + * + * Use + * Sets up a panel from the icon description given. + * + * Parameters + * glass_editIcon *ed == the edit to handle. + */ + +static void editIcon__setupPanel(glass_editIcon *ed) +{ + char *p; + + switch (ed->e.panel) + { + case glass_EIDATA: + dbox_setfield(ed->e.pd,glass_EIDVALSTRING,"%s",ed->valid); + dbox_setfield(ed->e.pd,glass_EIDDATA,"%s",ed->data); + if (!(ed->idef.flags&3)) + { + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDDATA,TRUE); + dbox_selecticon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + dbox_setfield(ed->e.pd,glass_EIDINDSIZE,"%i",12); + } + else if (ed->idef.flags & wimp_INDIRECT) + { + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_selecticon(ed->e.pd,glass_EIDVALID,ed->hasValid); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,!ed->hasValid); + dbox_shadeicon(ed->e.pd,glass_EIDVALID, + !(ed->idef.flags&wimp_ITEXT)); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,FALSE); + dbox_setfield(ed->e.pd,glass_EIDINDSIZE,"%i",ed->indLen); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + dbox_setfield(ed->e.pd,glass_EIDINDSIZE,"%i",12); + } + dbox_selecticon(ed->e.pd,glass_EIDTEXT, + !!(ed->idef.flags&wimp_ITEXT)); + dbox_selecticon(ed->e.pd,glass_EIDSPRITE, + !!(ed->idef.flags&wimp_ISPRITE)); + break; + case glass_EIAPPEARANCE: + dbox_setfield(ed->e.pd,glass_EIAFONTNAME,"%.%s",ed->font); + dbox_setfield(ed->e.pd,glass_EIAFSIZEWRITE,"%i",ed->fontSize); + if (ed->idef.flags & wimp_ITEXT) + { + if (ed->idef.flags & wimp_IFONT) + { + dbox_selecticon(ed->e.pd,glass_EIAFONT,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTNAME,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTMENU,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEWRITE,FALSE); + } + else + { + dbox_selecticon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTNAME,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTMENU,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEWRITE,TRUE); + } + } + else + { + dbox_selecticon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONT,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTNAME,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTMENU,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEWRITE,TRUE); + } + dbox_selecticon(ed->e.pd,glass_EIAHCENTRE, + !!(ed->idef.flags & wimp_IHCENTRE)); + dbox_selecticon(ed->e.pd,glass_EIAVCENTRE, + !!(ed->idef.flags & wimp_IVCENTRE)); + dbox_selecticon(ed->e.pd,glass_EIARALIGN, + !!(ed->idef.flags & wimp_IRJUST)); + dbox_selecticon(ed->e.pd,glass_EIABORDER, + !!(ed->idef.flags & wimp_IBORDER)); + dbox_selecticon(ed->e.pd,glass_EIAFILL, + !!(ed->idef.flags & wimp_IFILLED)); + if (ed->idef.flags & wimp_ISPRITE) + { + dbox_selecticon(ed->e.pd,glass_EIAHALFSIZE, + !!(ed->idef.flags & wimp_IHALVESPRITE)); + dbox_shadeicon(ed->e.pd,glass_EIAHALFSIZE,FALSE); + } + else + { + dbox_selecticon(ed->e.pd,glass_EIAHALFSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAHALFSIZE,TRUE); + } + dbox_selecticon(ed->e.pd,glass_EIANEEDSHELP, + !!(ed->idef.flags & wimp_IREDRAW)); + break; + case glass_EIACTIONS: + p=buffer_find(); + sprintf(p,"eiBTYPE%i",(ed->idef.flags>>12) & 0x0f); + dbox_setfield(ed->e.pd,glass_EIABTYPE,"%s",msgs_lookup(p)); + dbox_setfield(ed->e.pd,glass_EIAESGWRITE,"%i", + (ed->idef.flags>>16) & 0x1f); + dbox_selecticon(ed->e.pd,glass_EIAADJUST, + !!(ed->idef.flags & wimp_IESG_NOC)); + dbox_selecticon(ed->e.pd,glass_EIASELECT, + !!(ed->idef.flags & wimp_ISELECTED)); + dbox_selecticon(ed->e.pd,glass_EIASHADE, + !!(ed->idef.flags & wimp_INOSELECT)); + break; + case glass_EICOLOURS: + colSelect_setColourButton(ed->e.pd,glass_EICFORE, + (ed->idef.flags>>24) & 15); + colSelect_setColourButton(ed->e.pd,glass_EICBACK, + (ed->idef.flags>>28) & 15); + break; + case glass_EISIZE: + dbox_setfield(ed->e.pd, + glass_EIPWRITE, + "%i,%i", + ed->idef.box.x1-ed->idef.box.x0, + ed->idef.box.y1-ed->idef.box.y0); + dbox_shadeicon(ed->e.pd,glass_EIPSETSIZE,!(ed->idef.flags & 3)); + break; + case glass_EIPOSITION: + dbox_setfield(ed->e.pd, + glass_EIPWRITE, + "%i,%i", + ed->idef.box.x0, + ed->idef.box.y0); + break; + } +} + +/* + * BOOL editIcon__getSpriteSize(char *name,sprite_area *a,int *x,int *y) + * + * Use + * Attempts to read the size of a sprite in OS units. + * + * Returns + * TRUE if it really worked + */ + +static BOOL editIcon__getSpriteSize(char *name,sprite_area *a,int *x,int *y) +{ + os_error *e; + os_regset r; + + /* --- First look in the given area --- */ + + e=os_swivr(OS_SpriteOp,&r,40+256,a,name); + + /* --- Now, OS version permitting, look in the WIMP area --- */ + + if (e && wimpt_getVersion()>=300) + e=os_swivr(Wimp_SpriteOp,&r,40,0,name); + + /* --- If it worked, read out all the info and return it --- */ + + if (!e) + { + *x=r.r[3]<e.pd,glass_EIPWRITE,"%d,%d",&w,&h); + + /* --- Find out if this is going to be easy --- */ + + switch (ed->idef.flags & 3) + { + /* --- No icon data -- ignore this operation --- */ + + case 0: + break; + + /* --- Only text -- work it out (assuming system font size) --- */ + + case 1: + h=48; + w=16*(strlen(ed->data)+1); + break; + + /* --- Only a sprite -- use the size of the sprite --- */ + + case 2: + if (!editIcon__getSpriteSize(ed->data,ed->w->t->s,&w,&h)) + note(msgs_lookup("eiSPRGONE"),ed->data); + break; + + /* --- Text and sprite together --- */ + + case 3: + sprname=ed->data; + + if ((ed->idef.flags & 0x100) && ed->hasValid) + { + /* --- Parse the validation string to find the sprite name --- */ + + int state=1; + char *p=ed->valid; + char *q=sname; + + for (;*p>31 && state!=3;p++) + { + switch (*p) + { + case '\\': + if (p[1]>31) + p++; + if (state==1) + state=0; + else if (state==2) + *q++=*p; + break; + case ';': + if (state>1) + { + *q++=0; + state=3; + } + else + state=1; + break; + case 'S': + case 's': + if (state==1) + state=2; + else if (state==2) + *q++=*p; + break; + case ',': + switch (state) + { + case 2: + *q++=0; + state++; + } + break; + default: + switch (state) + { + case 1: + state=0; + break; + case 2: + *q++=*p; + break; + } + break; + } + } + + if (state==2) + { + *q++=0; + state=3; + } + + if (state==3) + sprname=sname; + } + + if (editIcon__getSpriteSize(sprname,ed->w->t->s,&sw,&sh)) + { + if (ed->data[0]) + { + h=48; + w=16*(strlen(ed->data)+1); + + f=posns[(tst(ed->idef.flags,3)<<2) | + (tst(ed->idef.flags,4)<<1) | + (tst(ed->idef.flags,9)<<0)]; + + if (f & 2) + h=max2(h,sh); + else + h+=sh; + + if (f & 1) + w=max2(w,sw); + else + w+=sw; + } + else + { + h=sh; + w=sw; + } + } + else + note(msgs_lookup("eiSPRGONE"),sprname); + break; + } + + dbox_setfield(ed->e.pd,glass_EIPWRITE,"%i,%i",w,h); +} + +/* + * void editIcon__closePanel(glass_editIcon *ed) + * + * Use + * Records the settings in a panel for future reference, for example when + * the panel is being replaced by a different one. + * + * Parameters + * glass_editIcon *ed == the edit box we're talking about + */ + +#define Q dbox_READSTATE + +static void editIcon__closePanel(glass_editIcon *ed) +{ + int esg; + int x,y; + switch (ed->e.panel) + { + case glass_EIDATA: + dbox_getfield(ed->e.pd,glass_EIDDATA,ed->data,256); + dbox_getfield(ed->e.pd,glass_EIDVALSTRING,ed->valid,256); + dbox_scanfield(ed->e.pd,glass_EIDINDSIZE,"%d",&ed->indLen); + ed->hasValid=dbox_selecticon(ed->e.pd,glass_EIDVALID,Q); + ed->idef.flags&=~0x00000103; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIDTEXT,Q)<<0; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIDSPRITE,Q)<<1; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIDINDIR,Q)<<8; + break; + case glass_EIAPPEARANCE: + ed->idef.flags&=~0x00000afc; + dbox_scanfield(ed->e.pd,glass_EIAFSIZEWRITE,"%d",&ed->fontSize); + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIAHCENTRE,Q)<<3; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIAVCENTRE,Q)<<4; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIABORDER,Q)<<2; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIAFILL,Q)<<5; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIAFONT,Q)<<6; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIANEEDSHELP,Q)<<7; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIARALIGN,Q)<<9; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIAHALFSIZE,Q)<<11; + break; + case glass_EIACTIONS: + ed->idef.flags&=~0x007f0400; + dbox_scanfield(ed->e.pd,glass_EIAESGWRITE,"%d",&esg); + ed->idef.flags|=esg<<16; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIAADJUST,Q)<<10; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIASELECT,Q)<<21; + ed->idef.flags|=dbox_selecticon(ed->e.pd,glass_EIASHADE,Q)<<22; + break; + case glass_EISIZE: + dbox_scanfield(ed->e.pd,glass_EIPWRITE,"%d,%d",&x,&y); + ed->idef.box.x1=ed->idef.box.x0+x; + ed->idef.box.y1=ed->idef.box.y0+y; + break; + case glass_EIPOSITION: + dbox_scanfield(ed->e.pd,glass_EIPWRITE,"%d,%d",&x,&y); + ed->idef.box.x1+=x-ed->idef.box.x0; + ed->idef.box.y1+=y-ed->idef.box.y0; + ed->idef.box.x0=x; + ed->idef.box.y0=y; + break; + } +} + +#undef Q + +/* + * void editIcon__setPanel(glass_editIcon *ed,dbox_field f) + * + * Use + * Creates a new panel based on a radio button click or some-such. + * + * Parameters + * glass_editIcon *ed == the edit window to change panel + * dbox_field f == the radio button associated with the desired panel + */ + +static void editIcon__panelHandler(dbox d,dbox_field f,void *handle); +static BOOL editIcon__panelRaw(dbox d,wimp_eventstr *e,void *handle); + +static void editIcon__setPanel(glass_editIcon *ed,dbox_field f) +{ + dbox d; + wimp_wstate s; + wimp_icon i; + int width,height; + int ox,oy; + wimp_w behind; + wimp_caretstr c; + BOOL ownCaret=TRUE; + if (f==ed->e.panel) + return; + editIcon__closePanel(ed); + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(ed->e.d),&s)); + wimpt_noerr(wimp_get_icon_info(dbox_syshandle(ed->e.d), + glass_EIPOSN,&i)); + ox=s.o.box.x0-s.o.x; + oy=s.o.box.y1-s.o.y; + mem_useUser(indir_alloc,indir_free); + if (f==-1) + d=dbox_create("iconNowt"); + else + d=dbox_create(editIcon__panels[f-glass_EIDATA]); + if (!d) + { + mem_useMalloc(); + return; + } + dbox_eventHandler(d,editIcon__panelHandler,ed); + dbox_rawEventHandler(d,editIcon__panelRaw,ed); + if (ed->e.panel) + { + wimpt_noerr(wimp_get_caret_pos(&c)); + ownCaret=(c.w==dbox_syshandle(ed->e.pd)); + dbox_selecticon(ed->e.d,ed->e.panel,dbox_RESETSTATE); + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(ed->e.pd),&s)); + pane_removePane(ed->e.p,dbox_syshandle(ed->e.pd)); + dbox_delete(ed->e.pd); + } + dbox_selecticon(ed->e.d,f,dbox_SETSTATE); + behind=s.o.behind; + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(d),&s)); + width=s.o.box.x1-s.o.box.x0; + height=s.o.box.y1-s.o.box.y0; + s.o.box.x0=i.box.x0+ox+wimpt_dx(); + s.o.box.y0=i.box.y0+oy+wimpt_dy(); + s.o.box.x1=s.o.box.x0+width; + s.o.box.y1=s.o.box.y0+height; + s.o.y=10000; + s.o.behind=behind; + ed->e.pd=d; + ed->e.panel=f; + editIcon__setupPanel(ed); + wimpt_noerr(wimp_open_wind(&s.o)); + if (ownCaret) + { + c.w=dbox_syshandle(d); + c.i=-1; + c.x=-500000; + c.y=0; + c.height=0x02000000; + wimpt_noerr(wimp_set_caret_pos(&c)); + } + pane_addPane(ed->e.p,dbox_syshandle(d)); + mem_useMalloc(); +} + +/* + * void editIcon__recreate(glass_editIcon *ed) + * + * Use + * Recreates the icon from the dialogue box settings + * + * Parameters + * glass_editIcon *ed == info about the edit + */ + +static void editIcon__recreate(glass_editIcon *ed) +{ + char *p=0; + char *q=0; + int inum; + int fhandle; + ed->w->def->i[ed->i].edit=0; /* Delink temporarily */ + window_redrawIcon(ed->w,ed->i); /* Force redraw of old icon */ + + if (!(ed->idef.flags & wimp_INDIRECT)) + { + ed->indLen=12; + ed->hasValid=FALSE; + } + if (strlen(ed->data)>=ed->indLen) + { + ed->idef.flags|=wimp_INDIRECT; + ed->indLen=strlen(ed->data)+1; + } + if (ed->idef.flags & wimp_INDIRECT) + { + if (p=indir_alloc(ed->indLen),!p) + { + werr(FALSE,msgs_lookup("eiNEMUI")); + return; + } + if (ed->hasValid && (ed->idef.flags & wimp_ITEXT)) + { + if (q=indir_alloc(strlen(ed->valid)+1),!q) + { + indir_free(p); + werr(FALSE,msgs_lookup("eiNEMUI")); + return; + } + strcpy(q,ed->valid); + ed->w->size+=strlen(ed->valid)+1; + } + strcpy(p,ed->data); + ed->w->size+=ed->indLen; + } + + if (ed->w->def->i[ed->i].i.flags & wimp_IFONT) /* Was old anti? */ + { + fhandle=(ed->w->def->i[ed->i].i.flags >> 24) & 255; + wimpt_noerr(font_lose(fhandle)); + ed->w->fonts[fhandle]--; + } + if (ed->idef.flags & wimp_IFONT) /* Is new icon antialiased? */ + { + if (font_find(ed->font,ed->fontSize*16,ed->fontSize*16,0,0,&fhandle)) + { + werr(FALSE,msgs_lookup("eiCFF"),ed->font); + ed->idef.flags&=~wimp_IFONT; + } + else + { + ed->w->antiAliased=TRUE; + ed->w->fonts[fhandle]++; + ed->idef.flags=(ed->idef.flags & 0x00ffffff) | (fhandle<<24); + } + } + + if (ed->w->def->i[ed->i].i.flags & wimp_INDIRECT) + { + indir_free(ed->w->def->i[ed->i].i.data.indirecttext.buffer); + ed->w->size-=ed->w->def->i[ed->i].i.data.indirecttext.bufflen; + if ((ed->w->def->i[ed->i].i.flags & wimp_ITEXT) && + (ed->w->def->i[ed->i].i.data.indirecttext.validstring!=(char *)-1)) + { + utils_ctermToNterm(ed->w->def->i[ed->i]. + i.data.indirecttext.validstring); + ed->w->size-= + strlen(ed->w->def->i[ed->i].i.data.indirecttext.validstring)+1; + indir_free(ed->w->def->i[ed->i].i.data.indirecttext.validstring); + } + } + + if (p) + { + ed->idef.data.indirecttext.buffer=p; + ed->idef.data.indirecttext.bufflen=ed->indLen; + if (q) + ed->idef.data.indirecttext.validstring=q; + else if (ed->idef.flags & wimp_ITEXT) + ed->idef.data.indirecttext.validstring=(char *)-1; + else + ed->idef.data.indirectsprite.spritearea=ed->w->t->s; + } + else + memcpy(ed->idef.data.text,ed->data,12); + + ed->w->def->i[ed->i].i=ed->idef; + dbox_scanfield(ed->e.d,glass_EINUMWRITE,"%d",&inum); + if (!window_renumber(ed->w,ed->i,inum)) + dbox_setfield(ed->e.d,glass_EINUMWRITE,"%i",ed->i); + else + ed->i=inum; + + window_redrawIcon(ed->w,ed->i); /* Force redraw of new icon */ + ed->w->def->i[ed->i].edit=ed; /* Relink again */ + tfile_markAsAltered(ed->w->t); +} + +/* + * void editIcon__nextPanel(glass_editIcon *ed,int dir) + * + * Use + * Changes panel to the next one in the given direction. Skips shaded + * panels and handles everything nicely. + * + * Parameters + * glass_editIcon *ed == the edit dialogue box to move about in + * int dir == the direction (-1 for up, 1 for down) + */ + +static void editIcon__nextPanel(glass_editIcon *ed,int dir) +{ + int i=ed->e.panel; + + if (i==-1) + i=(dir==1 ? glass_EIDATA : glass_EISIZE); + else + i+=dir; + + for (;i>=glass_EIDATA && i<=glass_EISIZE;i+=dir) + { + if (!dbox_shadeicon(ed->e.d,i,dbox_READSTATE)) + { + editIcon__setPanel(ed,i); + break; + } + } +} + +/*----- Event handlers ----------------------------------------------------*/ + +/* + * void editIcon__dboxHandler(dbox d,dbox_field f,void *handle) + * + * Use + * Handles any and all events directed at the dbox. Well, almost all... + * + * Parameters + * dbox d == the dbox handle + * dbox_field f == the event that happened + * void *handle == pointer to the dialogue box control info + */ + +static void editIcon__dboxHandler(dbox d,dbox_field f,void *handle) +{ + glass_editIcon *ed=handle; + buttons_simpleArrow sa={0,9999,FALSE}; + + switch (f) + { + case dbox_CLOSE: + if (ed->e.pd) + dbox_deleteNoUpdate(ed->e.pd); + pane_delete(ed->e.p); + dbox_delete(ed->e.d); + ed->w->def->i[ed->i].edit=0; + mem_free(ed); + break; + case dbox_HELP: + help_startHelp(); + help_addLine(msgs_lookup("eihEIDB")); + help_readFromIcon(); + help_endHelp(); + break; + case glass_EICAN: + dbox_clickicon(d,f); + if (!dbox_wasAdjustClick()) + pane_close(ed->e.p); + else + { + /* --- set up for old icon --- */ + ed->idef=ed->w->def->i[ed->i].i; + editIcon_readData(ed->w,ed->i); + dbox_setfield(ed->e.d,glass_EINUMWRITE,"%i",ed->i); + editIcon__setupPanel(ed); + } + dbox_unclick(); + if (!dbox_wasAdjustClick()) + editIcon_close(ed->w,ed->i); + break; + case glass_EIOK: + dbox_clickicon(d,f); + editIcon__closePanel(ed); + if (!dbox_wasAdjustClick()) + { + pane_close(ed->e.p); + editIcon__recreate(ed); + dbox_unclick(); + editIcon_close(ed->w,ed->i); + } + else + { + editIcon__recreate(ed); + editIcon_readData(ed->w,ed->i); + editIcon__setupPanel(ed); + dbox_unclick(); + } + break; + case glass_EIDELETE: + dbox_clickicon(d,f); + if (gPrefs_current()->cDelIcon) + { + if (!warning(msgs_lookup("eiCDIP"), + msgs_lookup("eiCDI"))) + { + dbox_unclick(); + return; + } + } + pane_close(ed->e.p); + dbox_unclick(); + window_deleteIcon(ed->w,ed->i); /* Closes the edit for us */ + break; + case glass_EIDATA: + case glass_EIAPPEARANCE: + case glass_EIACTIONS: + case glass_EICOLOURS: + case glass_EIPOSITION: + case glass_EISIZE: + editIcon__setPanel(ed,f); + break; + case glass_EINUMUP: + buttons_arrow(d,f,d,glass_EINUMWRITE,0,+1,&sa); + break; + case glass_EINUMDOWN: + buttons_arrow(d,f,d,glass_EINUMWRITE,0,-1,&sa); + break; + } +} + +/* + * BOOL editIcon__dboxRaw(dbox d,wimp_eventstr *e,void *handle) + * + * Use + * Handles open window requests and things for the main Preferences dbox. + * + * Parameters + * dbox d == the dbox handle + * wimp_eventstr *e == the event that happened + * void *handle == a unused pointer + * + * Returns + * TRUE if the event has been handled; + */ + +static BOOL editIcon__dboxRaw(dbox d,wimp_eventstr *e,void *handle) +{ + BOOL handled=FALSE; + glass_editIcon *ed=handle; + glass_intMsgstr *m; + unused(d); + switch (e->e) + { + case wimp_EOPEN: + pane_moved(ed->e.p); + handled=TRUE; + break; + case wimp_EKEY: + switch (e->data.key.chcode) + { + case akbd_UpK+akbd_Sh: + editIcon__nextPanel(ed,-1); + handled=TRUE; + break; + case akbd_DownK+akbd_Sh: + editIcon__nextPanel(ed,+1); + handled=TRUE; + break; + } + break; + case wimp_ESEND: + case wimp_ESENDWANTACK: + switch (e->data.msg.hdr.action) + { + case wimp_MINTERNAL: + m=intMsgs_receive(e); + switch(e->data.msg.data.words[0]) + { + case glass_DELETEFILE: + if (m->df.t==ed->w->t) + editIcon_close(ed->w,ed->i); + break; + case glass_DELETEWINDOW: + if (m->dw.w==ed->w) + editIcon_close(ed->w,ed->i); + break; + case glass_RENAME: + if (m->rn.w==ed->w) + dbox_setfield(ed->e.d,glass_EIWINDISP,"%s",ed->w->id); + break; + } + break; + } + break; + } + return (handled); +} + +/* + * menu editIcon__fontMaker(void *handle) + * + * Use + * Sets up the font menu. + * + * Parameters + * void *handle == pointer to this edit + * + * Returns + * A menu to display + */ + +static menu editIcon__fontMaker(void *handle) +{ + glass_editIcon *ed=handle; + menu m=fontMenu_createFontMenu(FALSE); + fontMenu_tickGivenName(ed->font); + return (m); +} + +/* + * void editIcon__fontHandler(int hit[],void *handle) + * + * Use + * Gets the font chosen from the font menu. + * + * Parameters + * int hit[] == the hit string + * void *handle == pointer to this edit + */ + +static void editIcon__fontHandler(int hit[],void *handle) +{ + glass_editIcon *ed=handle; + if (hit[0]) + { + strcpy(ed->font,fontMenu_fontname(hit[0],hit[1])); + dbox_setfield(ed->e.pd,glass_EIAFONTNAME,"%.%s",ed->font); + } +} + +/* + * void editIcon__fontHelp(int hit[],void *handle) + * + * Use + * Gives help on a font menu item + * + * Parameters + * int hit[] == the hit string + * void *handle == pointer to this edit + */ + +static void editIcon__fontHelp(int hit[],void *handle) +{ + unused(handle); + if (hit[0]) + { + help_startHelp(); + help_addLine(msgs_lookup("eimhFONT"),fontMenu_fontname(hit[0],hit[1])); + help_endHelp(); + } +} + +/* + * menu editIcon__btypeMaker(void *handle) + * + * Use + * Generates and sets up a button type menu for an edit dialogue box + * + * Parameters + * void *handle == pointer to the edit + * + * Returns + * The menu to use + */ + +static menu editIcon__btypeMaker(void *handle) +{ + static menu m; + static int ticked; + glass_editIcon *ed=handle; + int i; + char *buf=buffer_find(); + if (!m) + { + m=menu_new(msgs_lookup("eiBTMT"),msgs_lookup("eiBTYPE0")); + for (i=1;i<=15;i++) + { + sprintf(buf,"eiBTYPE%i",i); + menu_extend(m,msgs_lookup(buf)); + } + } + if (ticked) + menu_setflags(m,ticked,FALSE,FALSE); + ticked=((ed->idef.flags>>12)&0x0f)+1; + menu_setflags(m,ticked,TRUE,FALSE); + return (m); +} + +/* + * void editIcon__btypeHandler(int hit[],void *handle) + * + * Use + * Handles a click on the button type menu. + * + * Parameters + * int hit[] == the mouse click info + * void *handle == pointer to edit information + */ + +static void editIcon__btypeHandler(int hit[],void *handle) +{ + glass_editIcon *ed=handle; + char *buf=buffer_find(); + if (hit[0]) + { + ed->idef.flags&=~0x0000f000; + ed->idef.flags+=(hit[0]-1)<<12; + sprintf(buf,"eiBTYPE%i",hit[0]-1); + dbox_setfield(ed->e.pd,glass_EIABTYPE,"%s",msgs_lookup(buf)); + } +} + +/* + * void editIcon__colProc(dbox d,dbox_field f,int colour, void *handle) + * + * Use + * This routine is called when a colour is selected in the colours panel. + * + * Parameters + * dbox d == the panel's handle + * dbox_field f == the colour button that has changed + * int colour == the new colour for the button + * void *handle == pointer to this edit + */ + +static void editIcon__colProc(dbox d,dbox_field f,int colour,void *handle) +{ + glass_editIcon *ed=handle; + unused(d); + switch (f) + { + case glass_EICFORE: + ed->idef.flags=(ed->idef.flags & ~0x0f000000)+(colour<<24); + break; + case glass_EICBACK: + ed->idef.flags=(ed->idef.flags & ~0xf0000000)+(colour<<28); + break; + } +} + +/* + * void editIcon__btypeHelp(int hit[],void *handle) + * + * Use + * Handles a help request for the button type menu. + * + * Parameters + * int hit[] == the helpq info + * void *handle == pointer to edit information + */ + +static void editIcon__btypeHelp(int hit[],void *handle) +{ + char *buf=buffer_find(); + unused(handle); + if (hit[0]) + { + help_startHelp(); + sprintf(buf,"eiBTYPE%i",hit[0]-1); + help_addLine(msgs_lookup("eimhBTYPE"),msgs_lookup(buf)); + help_endHelp(); + } +} + +/* + * void editIcon__posSizeArrows(dbox d,dbox_field f,int diff,void *handle) + * + * Use + * Handles a click event on one of the position or size arrow buttons in + * the dialogue box. See the structure definition below for a description + * of the data structure required. + */ + +typedef struct +{ + BOOL xOrY; + BOOL sizing; +} +editIcon__posSizeArrowstr; + +static void editIcon__posSizeArrows(dbox d, + dbox_field f, + int diff, + void *handle) +{ + editIcon__posSizeArrowstr *s=handle; + int x,y; + int *v; + + dbox_scanfield(d,f,"%d,%d",&x,&y); + v=s->xOrY ? &x : &y; + *v+=diff; + if (s->sizing && *v<0) + *v=0; + dbox_setfield(d,f,"%i,%i",x,y); +} + +/* + * void editIcon__panelHandler(dbox d,dbox_field f,void *handle) + * + * Use + * Handles simple click events for the current panel in an edit dbox + * + * Parameters + * dbox d == the panel's dbox handle + * dbox_field f == the icon that was clicked + * void *handle == pointer to edit information + */ + +static void editIcon__panelHandler(dbox d,dbox_field f,void *handle) +{ + glass_editIcon *ed=handle; + buttons_simpleArrow sa={0,9999,FALSE}; + buttons_simpleArrow esga={0,31,FALSE}; + editIcon__posSizeArrowstr psa={0,FALSE}; + BOOL indon; + + switch (f) + { + case dbox_CLOSE: + case dbox_HELP: + case glass_EIOK: + case glass_EICAN: + editIcon__dboxHandler(ed->e.d,f,ed); + return; + break; + } + switch (ed->e.panel) + { + case glass_EIDATA: + switch (f) + { + case glass_EIDINDIR: + if (dbox_selecticon(d,f,dbox_READSTATE)) + { + if (dbox_selecticon(ed->e.pd,glass_EIDTEXT,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd, + glass_EIDVALSTRING, + !dbox_selecticon(ed->e.pd, + glass_EIDVALID, + dbox_READSTATE)); + } + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,FALSE); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + } + break; + case glass_EIDINDUP: + buttons_arrow(ed->e.pd,f,ed->e.pd,glass_EIDINDSIZE,0,+1,&sa); + break; + case glass_EIDINDDOWN: + buttons_arrow(ed->e.pd,f,ed->e.pd,glass_EIDINDSIZE,0,-1,&sa); + break; + case glass_EIDVALID: + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,dbox_TOGGLESTATE); + break; + case glass_EIDMINIMISE: + dbox_clickicon(d,f); + dbox_getfield(d,glass_EIDDATA,ed->data,256); + dbox_setfield(d,glass_EIDINDSIZE,"%i",strlen(ed->data)+1); + dbox_unclick(); + break; + case glass_EIDTEXT: + if (dbox_selecticon(ed->e.pd,glass_EIDTEXT,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + if (dbox_selecticon(d,glass_EIDINDIR,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING, + !dbox_selecticon(ed->e.pd,glass_EIDVALID,dbox_READSTATE)); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,FALSE); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + } + dbox_shadeicon(ed->e.d,glass_EICOLOURS, + !!(ed->idef.flags & wimp_IFONT)); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + if (dbox_selecticon(d,glass_EIDSPRITE,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + indon=dbox_selecticon(d,glass_EIDINDIR,dbox_READSTATE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,!indon); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + } + dbox_shadeicon(ed->e.d,glass_EICOLOURS,FALSE); + } + break; + case glass_EIDSPRITE: + if (dbox_selecticon(ed->e.pd,glass_EIDSPRITE,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + indon=dbox_selecticon(d,glass_EIDINDIR,dbox_READSTATE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,!indon); + } + else if (!dbox_selecticon(ed->e.pd,glass_EIDTEXT,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + } + break; + } + break; + case glass_EIAPPEARANCE: + switch (f) + { + case glass_EIAFONT: + if (dbox_selecticon(d,f,dbox_READSTATE) || + fontMenu_createFontMenu(FALSE)) + { + dbox_selecticon(d,f,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFONTNAME,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFONTMENU,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFSIZEUP,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFSIZEDOWN,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFSIZEWRITE,dbox_TOGGLESTATE); + dbox_shadeicon(ed->e.d,glass_EICOLOURS,dbox_TOGGLESTATE); + } + break; + case glass_EIAFSIZEUP: + buttons_arrow(ed->e.pd,f,ed->e.pd,glass_EIAFSIZEWRITE,0,+1,&sa); + break; + case glass_EIAFSIZEDOWN: + buttons_arrow(ed->e.pd,f,ed->e.pd,glass_EIAFSIZEWRITE,0,-1,&sa); + break; + } + break; + case glass_EIACTIONS: + switch (f) + { + case glass_EIAESGUP: + buttons_arrow(d,f,d,glass_EIAESGWRITE,0,+1,&esga); + break; + case glass_EIAESGDOWN: + buttons_arrow(d,f,d,glass_EIAESGWRITE,0,-1,&esga); + break; + } + break; + case glass_EICOLOURS: + /* Nothin' doing */ + break; + case glass_EISIZE: + psa.sizing=TRUE; + /* Drop through */ + case glass_EIPOSITION: + switch (f) + { + case glass_EIPUP: + psa.xOrY=FALSE; + buttons_arrow(d,f,d,glass_EIPWRITE, + editIcon__posSizeArrows, + +wimpt_dy(), + &psa); + break; + case glass_EIPDOWN: + psa.xOrY=FALSE; + buttons_arrow(d,f,d,glass_EIPWRITE, + editIcon__posSizeArrows, + -wimpt_dy(), + &psa); + break; + case glass_EIPLEFT: + psa.xOrY=TRUE; + buttons_arrow(d,f,d,glass_EIPWRITE, + editIcon__posSizeArrows, + -wimpt_dx(), + &psa); + break; + case glass_EIPRIGHT: + psa.xOrY=TRUE; + buttons_arrow(d,f,d,glass_EIPWRITE, + editIcon__posSizeArrows, + +wimpt_dx(), + &psa); + break; + case glass_EIPSETSIZE: + dbox_clickicon(d,f); + editIcon__setSize(ed); + dbox_unclick(); + break; + } + break; + } +} + +/* + * BOOL editIcon__panelRaw(dbox d,wimp_eventstr *e,void *handle) + * + * Use + * Handles the more wierd events for a particular panel. + * + * Parameters + * dbox d == the dbox handle of the panel + * wimp_eventstr *e == the event to look at + * void *handle == pointer to the current edit + * + * Returns + * TRUE if the event is dead (long live the event...) + */ + +static BOOL editIcon__panelRaw(dbox d,wimp_eventstr *e,void *handle) +{ + BOOL handled=FALSE; + glass_editIcon *ed=handle; + BOOL cursor=FALSE; + if (e->e==wimp_EKEY) + { + switch (e->data.key.chcode) + { + case akbd_UpK+akbd_Sh: + editIcon__nextPanel(ed,-1); + handled=TRUE; + break; + case akbd_DownK+akbd_Sh: + editIcon__nextPanel(ed,+1); + handled=TRUE; + break; + } + } + if (!handled) switch (ed->e.panel) + { + case glass_EIDATA: + /* Nothin' doing */ + break; + case glass_EIAPPEARANCE: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_EIAFONTNAME: + menu_make(editIcon__fontMaker,editIcon__fontHandler, + editIcon__fontHelp,ed); + handled=TRUE; + break; + case glass_EIAFONTMENU: + dbox_clickicon(d,glass_EIAFONTMENU); + menu_make(editIcon__fontMaker,editIcon__fontHandler, + editIcon__fontHelp,ed); + dbox_unclick(); + handled=TRUE; + break; + } + break; + } + break; + case glass_EIACTIONS: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_EIABTYPE: + menu_make(editIcon__btypeMaker,editIcon__btypeHandler, + editIcon__btypeHelp,ed); + handled=TRUE; + break; + case glass_EIABTMENU: + dbox_clickicon(d,glass_EIABTMENU); + menu_make(editIcon__btypeMaker,editIcon__btypeHandler, + editIcon__btypeHelp,ed); + dbox_unclick(); + handled=TRUE; + break; + } + break; + case wimp_EKEY: + switch (e->data.key.c.i) + { + case glass_EIAESGWRITE: + switch (e->data.key.chcode) + { + case akbd_DownK: + case akbd_UpK: + case akbd_TabK: + case akbd_TabK+akbd_Sh: + case akbd_UpK+akbd_Ctl: + case akbd_DownK+akbd_Ctl: + cursor=TRUE; + break; + } + handled=buttons_insertChar(d,e->data.key.chcode,'0','9'); + if (handled || cursor) + buttons_arrowClick(d,glass_EIAESGWRITE,0,31,0,FALSE); + break; + } + break; + } + break; + case glass_EICOLOURS: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_EICFORE: + colSelect(ed->e.pd,glass_EICFORE,e->data.but.m.bbits, + msgs_lookup("eiFGC"),FALSE, + editIcon__colProc,ed); + break; + case glass_EICBACK: + colSelect(ed->e.pd,glass_EICBACK,e->data.but.m.bbits, + msgs_lookup("eiBGC"),FALSE, + editIcon__colProc,ed); + break; + } + break; + } + break; + case glass_EISIZE: + case glass_EIPOSITION: + /* Nothin' doin' */ + break; + } + return (FALSE); +} + +/*----- External routines -------------------------------------------------*/ + +/* + * void editIcon_renumber(glass_windPointer *w,int icon,int new) + * + * Use + * Informs an edit dialogue that an icon has been renumbered. + * + * Parameters + * glass_windPointer *w == the window containing the icon + * int icon == the icon number + * int new == the new number for the icon + */ + +void editIcon_renumber(glass_windPointer *w,int icon,int new) +{ + glass_editIcon *ed=w->def->i[icon].edit; + if (!ed) + return; + ed->i=new; + dbox_setfield(ed->e.d,glass_EINUMWRITE,"%i",new); +} + +/* + * void editIcon_iconMoved(glass_windPointer *w,int icon) + * + * Use + * Informs an edit dialogue that an icon has been moved. + * + * Parameters + * glass_windPointer *w == the window containing the icon + * int icon == the icon number. This may not be the same during the edit... + */ + +void editIcon_iconMoved(glass_windPointer *w,int icon) +{ + glass_editIcon *ed=w->def->i[icon].edit; + if (!ed) + return; + ed->idef.box=ed->w->def->i[ed->i].i.box; + if (ed->e.panel==glass_EIPOSITION || ed->e.panel==glass_EISIZE) + editIcon__setupPanel(ed); +} + +/* + * void editIcon_readData(glass_windPointer *w,int icon) + * + * Use + * Forces a re-read of the icon data for the given icon edit + * + * Parameters + * glass_windPointer *w == the window containing the icon + * int icon == the icon number. This may not be the same during the edit... + */ + +void editIcon_readData(glass_windPointer *w,int icon) +{ + glass_editIcon *ed=w->def->i[icon].edit; + if (!ed) + return; + ed->idef.data=ed->w->def->i[ed->i].i.data; + if (ed->idef.flags & wimp_INDIRECT) + { + utils_ctermToNterm(ed->idef.data.indirecttext.buffer); + strcpy(ed->data,ed->idef.data.indirecttext.buffer); + ed->indLen=ed->idef.data.indirecttext.bufflen; + if (ed->idef.flags & wimp_ITEXT && + ed->idef.data.indirecttext.validstring!=(char *)-1) + { + utils_ctermToNterm(ed->idef.data.indirecttext.validstring); + strcpy(ed->valid,ed->idef.data.indirecttext.validstring); + ed->hasValid=TRUE; + } + else + { + ed->valid[0]=0; + ed->hasValid=FALSE; + } + } + else + { + ed->data[12]=0; + memcpy(ed->data,ed->idef.data.text,12); + utils_ctermToNterm(ed->data); + ed->valid[0]=0; + ed->indLen=12; + } + if (ed->e.panel==glass_EIDATA) + editIcon__setupPanel(ed); + if (ed->idef.flags & wimp_IFONT) + { + if (ed->e.panel==glass_EICOLOURS) + editIcon__setPanel(ed,-1); + dbox_shadeicon(ed->e.d,glass_EICOLOURS,TRUE); + } + else + dbox_shadeicon(ed->e.d,glass_EICOLOURS,FALSE); +} + +/* + * void editIcon_close(glass_windPointer *w,int icon) + * + * Use + * Closes an edit window + * + * Parameters + * glass_windPointer *w == the window containing the icon + * int icon == the icon number. This may not be the same during the edit... + */ + +void editIcon_close(glass_windPointer *w,int icon) +{ + glass_editIcon *ed=w->def->i[icon].edit; + if (ed) + { + if (ed->e.pd) + dbox_deleteNoUpdate(ed->e.pd); + pane_delete(ed->e.p); + dbox_deleteNoUpdate(ed->e.d); + ed->w->def->i[ed->i].edit=0; + mem_free(ed); + } +} + +/* + * void editIcon(glass_windPointer *w,int icon) + * + * Use + * Edits the given icon in a dialogue box. + * + * Parameters + * glass_windPointer *w == the window containing the icon + * int icon == the icon number. This may not be the same during the edit... + */ + +void editIcon(glass_windPointer *w,int icon) +{ + glass_editIcon *ed; + os_regset r; + if (w->def->i[icon].edit) + { + dbox_display(w->def->i[icon].edit->e.d,TRUE); + pane_front(w->def->i[icon].edit->e.p); + return; + } + mem_useUser(indir_alloc,indir_free); + ed=mem_alloc(sizeof(glass_editIcon)); + if (!ed) + { + werr(FALSE,msgs_lookup("eiNEM")); + mem_useMalloc(); + return; + } + if (ed->e.d=dbox_create("editIcon"),!ed->e.d) + { + mem_free(ed); + mem_useMalloc(); + return; + } + if (ed->e.p=pane_create(dbox_syshandle(ed->e.d)),!ed->e.p) + { + dbox_delete(ed->e.d); + mem_free(ed); + mem_useMalloc(); + return; + } + mem_useMalloc(); + ed->w=w; + ed->i=icon; + ed->idef=w->def->i[icon].i; + w->def->i[icon].edit=ed; + ed->e.panel=0; + + /* --- Set up icon data now --- */ + editIcon_readData(w,icon); + if (ed->idef.flags & wimp_IFONT) + { + r.r[0]=ed->idef.flags >> 24; + r.r[1]=(int)(ed->font); + wimpt_noerr(os_swix(XFont_ReadDefn,&r)); + utils_ctermToNterm(ed->font); + ed->fontSize=r.r[2]/16; + dbox_shadeicon(ed->e.d,glass_EICOLOURS,TRUE); + } + else + { + strcpy(ed->font,"Homerton.Medium"); + ed->fontSize=12; + dbox_shadeicon(ed->e.d,glass_EICOLOURS,FALSE); + } + + /* --- Now do handlers, and final setting up --- */ + dbox_setfield(ed->e.d,glass_EINUMWRITE,"%i",icon); + dbox_setfield(ed->e.d,glass_EIWINDISP,"%s",w->id); + dbox_eventHandler(ed->e.d,editIcon__dboxHandler,ed); + dbox_rawEventHandler(ed->e.d,editIcon__dboxRaw,ed); + dbox_openDisplaced(ed->e.d); + editIcon__setPanel(ed,glass_EIDATA); +} diff --git a/StraySrc/Glass/!Glass/c/editWin b/StraySrc/Glass/!Glass/c/editWin new file mode 100644 index 0000000..835bd8e --- /dev/null +++ b/StraySrc/Glass/!Glass/c/editWin @@ -0,0 +1,1934 @@ +/* + * editWindow.c + * + * Edit window dialogue box + * + * © 1994-1998 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Glass. + * + * Glass is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Glass is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Glass. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Header files ------------------------------------------------------*/ + +/* + * ANSI standard headers + */ + +#include +#include +#include + +/* + * Steel headers + */ + +#define _STDAPP +#define _LOWLVL +#include "steel/Steel.h" + +#include "steel/buttons.h" +#include "steel/fontMenu.h" +#include "steel/akbd.h" +#include "steel/buffer.h" +#include "steel/font.h" + +/* + * Glass headers + */ + +#include "glass.h" +#include "tfile.h" +#include "window.h" +#include "intMsgs.h" +#include "editWin.h" +#include "colSelect.h" +#include "indir.h" +#include "gPrefs.h" + +#include "gStruct.h" +#include "gMenus.h" +#include "gIcons.h" + +/*----- Static variables --------------------------------------------------*/ + +static char *editWindow__panels[]= +{ + "windChars", + "windGadgets", + "windButton", + "iconData", + "iconAppear", + "windColours", + "windSize", +}; + +#define editWindow__ICAPPHEIGHT -504 + +/*----- New RISC OS 3 window flags ----------------------------------------*/ + +#define wimp_WONSCREEN (1<<13) +#define wimp_WRUBBERH (1<<14) +#define wimp_WRUBBERV (1<<15) + +/*----- Support routines --------------------------------------------------*/ + +#define max2(a,b) ((a)>(b) ? (a) : (b)) +#define min2(a,b) ((a)<(b) ? (a) : (b)) + +/* + * void editWindow__checkExtents(glass_editWindow *ed,BOOL redraw, + * BOOL read) + * + * Use + * Ensures that the window extents are correctly set according to window + * size etc. + * + * Parameters + * glass_editWindow *ed == the edit + * BOOL rbl == whether to redraw the bottom left setting + * BOOL rtr == whether to redraw the top right setting + * BOOL read == whether to read settings from dbox + */ + +static void editWindow__checkExtents(glass_editWindow *ed,BOOL rbl, + BOOL rtr,BOOL read) +{ + BOOL bl=rbl; + BOOL tr=rtr; + int x,y; + if (ed->e.panel==glass_EWWORKAREA && read) + { + dbox_scanfield(ed->e.pd, + glass_EWSBOTTOMLEFT, + "%d,%d", + &ed->wdef.ex.x0, + &ed->wdef.ex.y0); + dbox_scanfield(ed->e.pd, + glass_EWSTOPRIGHT, + "%d,%d", + &ed->wdef.ex.x1, + &ed->wdef.ex.y1); + } + if (ed->e.panel==glass_EWWORKAREA) + { + dbox_scanfield(ed->e.pd,glass_EWSMINWIDTH,"%d",&x); + dbox_scanfield(ed->e.pd,glass_EWSMINHEIGHT,"%d",&y); + } + else + { + x=ed->wdef.minsize & 0xffff; + y=(ed->wdef.minsize>>16) & 0xffff; + } + + if (gPrefs_current()->mVisInWork) + { + if (ed->wdef.ex.x0>ed->w->def->desc.w.scx) + { + ed->wdef.ex.x0=ed->w->def->desc.w.scx; + bl=TRUE; + } + if (ed->wdef.ex.y0>ed->w->def->desc.w.scy+ + ed->w->def->desc.w.box.y0- + ed->w->def->desc.w.box.y1) + { + ed->wdef.ex.y0=ed->w->def->desc.w.scy+ + ed->w->def->desc.w.box.y0- + ed->w->def->desc.w.box.y1; + bl=TRUE; + } + if (ed->wdef.ex.x1w->def->desc.w.scx+ + ed->w->def->desc.w.box.x1- + ed->w->def->desc.w.box.x0) + { + ed->wdef.ex.x1=ed->w->def->desc.w.scx+ + ed->w->def->desc.w.box.x1- + ed->w->def->desc.w.box.x0; + tr=TRUE; + } + if (ed->wdef.ex.y1w->def->desc.w.scy) + { + ed->wdef.ex.y1=ed->w->def->desc.w.scy; + tr=TRUE; + } + } + if (bl && ed->e.panel==glass_EWWORKAREA) + { + dbox_setfield(ed->e.pd, + glass_EWSBOTTOMLEFT, + "%i,%i", + ed->wdef.ex.x0, + ed->wdef.ex.y0); + } + if (tr && ed->e.panel==glass_EWWORKAREA) + { + dbox_setfield(ed->e.pd, + glass_EWSTOPRIGHT, + "%i,%i", + ed->wdef.ex.x1, + ed->wdef.ex.y1); + } + bl=rbl; + tr=rtr; + if (gPrefs_current()->mVisInWork) + { + if (x>ed->w->def->desc.w.box.x1-ed->w->def->desc.w.box.x0) + { + x=ed->w->def->desc.w.box.x1-ed->w->def->desc.w.box.x0; + bl=TRUE; + } + if (y>ed->w->def->desc.w.box.y1-ed->w->def->desc.w.box.y0) + { + y=ed->w->def->desc.w.box.y1-ed->w->def->desc.w.box.y0; + tr=TRUE; + } + } + else + { + if (x>ed->wdef.ex.x1-ed->wdef.ex.x0) + { + x=ed->wdef.ex.x1-ed->wdef.ex.x0; + bl=TRUE; + } + if (y>ed->wdef.ex.y1-ed->wdef.ex.y0) + { + y=ed->wdef.ex.y1-ed->wdef.ex.y0; + tr=TRUE; + } + } + ed->wdef.minsize=x+(y<<16); + if (bl && ed->e.panel==glass_EWWORKAREA) + dbox_setfield(ed->e.pd,glass_EWSMINWIDTH,"%i",x); + if (tr && ed->e.panel==glass_EWWORKAREA) + dbox_setfield(ed->e.pd,glass_EWSMINHEIGHT,"%i",y); +} + +/* + * void editWindow__setupPanel(glass_editWindow *ed) + * + * Use + * Sets up a panel from the icon description given. + * + * Parameters + * glass_editWindow *ed == the edit to handle. + */ + +static void editWindow__setupPanel(glass_editWindow *ed) +{ + char *buf=buffer_find(); + + switch (ed->e.panel) + { + case glass_EWCHARS: + dbox_selecticon(ed->e.pd, + glass_EWCMOVE, + !!(ed->wdef.flags & wimp_WMOVEABLE)); + dbox_selecticon(ed->e.pd, + glass_EWCREDRAW, + !!(ed->wdef.flags & wimp_REDRAW_OK)); + dbox_selecticon(ed->e.pd, + glass_EWCPANE, + !!(ed->wdef.flags & wimp_WPANE)); + dbox_selecticon(ed->e.pd, + glass_EWCNOBOUNDS, + !!(ed->wdef.flags & wimp_WTRESPASS)); + dbox_selecticon(ed->e.pd, + glass_EWCONSCREEN, + !!(ed->wdef.flags & wimp_WONSCREEN)); + if (ed->wdef.flags & wimp_WSCROLL_R1) + { + dbox_selecticon(ed->e.pd,glass_EWCSCRLREP,TRUE); + dbox_selecticon(ed->e.pd,glass_EWCSCRLDEB,FALSE); + dbox_selecticon(ed->e.pd,glass_EWCSCRLQ,FALSE); + } + else if (ed->wdef.flags & wimp_SCROLL_R2) + { + dbox_selecticon(ed->e.pd,glass_EWCSCRLREP,FALSE); + dbox_selecticon(ed->e.pd,glass_EWCSCRLDEB,TRUE); + dbox_selecticon(ed->e.pd,glass_EWCSCRLQ,FALSE); + } + else + { + dbox_selecticon(ed->e.pd,glass_EWCSCRLREP,FALSE); + dbox_selecticon(ed->e.pd,glass_EWCSCRLDEB,FALSE); + dbox_selecticon(ed->e.pd,glass_EWCSCRLQ,TRUE); + } + dbox_selecticon(ed->e.pd, + glass_EWCGCOL, + !!(ed->wdef.flags & wimp_REAL_COLOURS)); + dbox_selecticon(ed->e.pd, + glass_EWCBACK, + !!(ed->wdef.flags & wimp_BACK_WINDOW)); + dbox_selecticon(ed->e.pd, + glass_EWCHOTKEYS, + !!(ed->wdef.flags & wimp_HOT_KEYS)); + break; + case glass_EWGADGETS: + if (tst(ed->wdef.flags,31)) + { + dbox_shadeicon(ed->e.pd,glass_EWGOTITLE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGOCLOSEBACK,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGOHORIZ,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGOVERT,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGNTITLE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EWGNHORIZ,FALSE); + dbox_shadeicon(ed->e.pd,glass_EWGNVERT,FALSE); + dbox_selecticon(ed->e.pd,glass_EWGNEW,TRUE); + dbox_selecticon(ed->e.pd,glass_EWGOLD,FALSE); + dbox_selecticon(ed->e.pd,glass_EWGOTITLE,tst(ed->wdef.flags,26)); + dbox_selecticon(ed->e.pd, + glass_EWGOCLOSEBACK, + tst(ed->wdef.flags,24) || tst(ed->wdef.flags,25)); + dbox_selecticon(ed->e.pd,glass_EWGOHORIZ,tst(ed->wdef.flags,30)); + dbox_selecticon(ed->e.pd,glass_EWGOVERT,tst(ed->wdef.flags,28)); + dbox_selecticon(ed->e.pd,glass_EWGNTITLE,tst(ed->wdef.flags,26)); + dbox_selecticon(ed->e.pd,glass_EWGNCLOSE,tst(ed->wdef.flags,25)); + dbox_shadeicon(ed->e.pd,glass_EWGNCLOSE,!tst(ed->wdef.flags,26)); + dbox_selecticon(ed->e.pd,glass_EWGNRESIZE,tst(ed->wdef.flags,29)); + dbox_shadeicon(ed->e.pd, + glass_EWGNRESIZE, + !(tst(ed->wdef.flags,28) || tst(ed->wdef.flags,30))); + dbox_selecticon(ed->e.pd,glass_EWGNBACK,tst(ed->wdef.flags,24)); + dbox_shadeicon(ed->e.pd,glass_EWGNBACK,!tst(ed->wdef.flags,26)); + dbox_selecticon(ed->e.pd,glass_EWGNTOGGLE,tst(ed->wdef.flags,27)); + dbox_shadeicon(ed->e.pd, + glass_EWGNTOGGLE, + !(tst(ed->wdef.flags,26) || tst(ed->wdef.flags,28))); + dbox_selecticon(ed->e.pd,glass_EWGNHORIZ,tst(ed->wdef.flags,30)); + dbox_selecticon(ed->e.pd,glass_EWGNVERT,tst(ed->wdef.flags,28)); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EWGOTITLE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EWGOHORIZ,FALSE); + dbox_shadeicon(ed->e.pd,glass_EWGOVERT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EWGNTITLE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGNCLOSE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGNRESIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGNBACK,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGNTOGGLE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGNHORIZ,TRUE); + dbox_shadeicon(ed->e.pd,glass_EWGNVERT,TRUE); + dbox_selecticon(ed->e.pd,glass_EWGNEW,FALSE); + dbox_selecticon(ed->e.pd,glass_EWGOLD,TRUE); + dbox_selecticon(ed->e.pd,glass_EWGOTITLE,tst(ed->wdef.flags,0)); + dbox_selecticon(ed->e.pd, + glass_EWGOCLOSEBACK, + !tst(ed->wdef.flags,7)); + dbox_shadeicon(ed->e.pd, + glass_EWGOCLOSEBACK, + !tst(ed->wdef.flags,0)); + dbox_selecticon(ed->e.pd,glass_EWGOHORIZ,tst(ed->wdef.flags,3)); + dbox_selecticon(ed->e.pd,glass_EWGOVERT,tst(ed->wdef.flags,2)); + dbox_selecticon(ed->e.pd,glass_EWGNTITLE,tst(ed->wdef.flags,0)); + dbox_selecticon(ed->e.pd,glass_EWGNCLOSE,!tst(ed->wdef.flags,7)); + dbox_selecticon(ed->e.pd, + glass_EWGNRESIZE, + tst(ed->wdef.flags,2) || tst(ed->wdef.flags,3)); + dbox_selecticon(ed->e.pd,glass_EWGNBACK,!tst(ed->wdef.flags,7)); + dbox_selecticon(ed->e.pd,glass_EWGNTOGGLE,tst(ed->wdef.flags,2)); + dbox_selecticon(ed->e.pd,glass_EWGNHORIZ,tst(ed->wdef.flags,3)); + dbox_selecticon(ed->e.pd,glass_EWGNVERT,tst(ed->wdef.flags,2)); + } + break; + case glass_EWBTYPE: + sprintf(buf,"ewBTYPE%i",(ed->wdef.workflags>>12) & 0x0f); + dbox_setfield(ed->e.pd,glass_EWBBTDISP,"%s",msgs_lookup(buf)); + break; + case glass_EWTDATA: + dbox_setfield(ed->e.pd,glass_EIDVALSTRING,"%s",ed->valid); + dbox_setfield(ed->e.pd,glass_EIDDATA,"%s",ed->data); + if (!(ed->wdef.titleflags & 3)) + { + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDDATA,TRUE); + dbox_selecticon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + dbox_setfield(ed->e.pd,glass_EIDINDSIZE,"%i",12); + } + else if (ed->wdef.titleflags & wimp_INDIRECT) + { + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_selecticon(ed->e.pd,glass_EIDVALID,ed->hasValid); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,!ed->hasValid); + dbox_shadeicon(ed->e.pd, + glass_EIDVALID, + !(ed->wdef.titleflags&wimp_ITEXT)); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,FALSE); + dbox_setfield(ed->e.pd,glass_EIDINDSIZE,"%i",ed->indLen); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDINDIR,FALSE); + dbox_selecticon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + dbox_setfield(ed->e.pd,glass_EIDINDSIZE,"%i",12); + } + dbox_selecticon(ed->e.pd, + glass_EIDTEXT, + !!(ed->wdef.titleflags&wimp_ITEXT)); + dbox_selecticon(ed->e.pd, + glass_EIDSPRITE, + !!(ed->wdef.titleflags&wimp_ISPRITE)); + break; + case glass_EWTAPPEAR: + dbox_setfield(ed->e.pd,glass_EIAFONTNAME,"%.%s",ed->font); + dbox_setfield(ed->e.pd,glass_EIAFSIZEWRITE,"%i",ed->fontSize); + if (ed->wdef.titleflags & wimp_ITEXT) + { + if (ed->wdef.titleflags & wimp_IFONT) + { + dbox_selecticon(ed->e.pd,glass_EIAFONT,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTNAME,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTMENU,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEWRITE,FALSE); + } + else + { + dbox_selecticon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTNAME,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTMENU,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEWRITE,TRUE); + } + } + else + { + dbox_selecticon(ed->e.pd,glass_EIAFONT,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAFONT,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTNAME,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFONTMENU,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFSIZEWRITE,TRUE); + } + dbox_selecticon(ed->e.pd, + glass_EIAHCENTRE, + !!(ed->wdef.titleflags & wimp_IHCENTRE)); + dbox_selecticon(ed->e.pd, + glass_EIAVCENTRE, + !!(ed->wdef.titleflags & wimp_IVCENTRE)); + dbox_selecticon(ed->e.pd, + glass_EIARALIGN, + !!(ed->wdef.titleflags & wimp_IRJUST)); + if (ed->wdef.titleflags & wimp_ISPRITE) + { + dbox_selecticon(ed->e.pd, + glass_EIAHALFSIZE, + !!(ed->wdef.titleflags & wimp_IHALVESPRITE)); + dbox_shadeicon(ed->e.pd,glass_EIAHALFSIZE,FALSE); + } + else + { + dbox_selecticon(ed->e.pd,glass_EIAHALFSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIAHALFSIZE,TRUE); + } + dbox_selecticon(ed->e.pd,glass_EIABORDER,FALSE); + dbox_selecticon(ed->e.pd,glass_EIAFILL,FALSE); + dbox_selecticon(ed->e.pd,glass_EIANEEDSHELP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIABORDER,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIAFILL,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIANEEDSHELP,TRUE); + /* The above aren't relevant to a window title */ + break; + case glass_EWCOLOURS: + colSelect_setColourButton(ed->e.pd, + glass_EWCTBFORE, + ed->wdef.colours[0]); + colSelect_setColourButton(ed->e.pd, + glass_EWCTBBACK, + ed->wdef.colours[1]); + colSelect_setColourButton(ed->e.pd, + glass_EWCWAFORE, + ed->wdef.colours[2]); + colSelect_setColourButton(ed->e.pd, + glass_EWCWABACK, + ed->wdef.colours[3]); + colSelect_setColourButton(ed->e.pd, + glass_EWCSCFORE, + ed->wdef.colours[5]); + colSelect_setColourButton(ed->e.pd, + glass_EWCSCBACK, + ed->wdef.colours[4]); + colSelect_setColourButton(ed->e.pd, + glass_EWCHIGH, + ed->wdef.colours[6]); + break; + case glass_EWWORKAREA: + dbox_setfield(ed->e.pd, + glass_EWSMINWIDTH, + "%i", + ed->wdef.minsize & 0xffff); + dbox_setfield(ed->e.pd, + glass_EWSMINHEIGHT, + "%i", + (ed->wdef.minsize>>16) & 0xffff); + editWindow__checkExtents(ed,TRUE,TRUE,FALSE); + dbox_selecticon(ed->e.pd, + glass_EWSRUBBERH, + !!(ed->wdef.flags & wimp_WRUBBERH)); + dbox_selecticon(ed->e.pd, + glass_EWSRUBBERV, + !!(ed->wdef.flags & wimp_WRUBBERV)); + break; + } +} + +/* + * void editWindow__closePanel(glass_editWindow *ed) + * + * Use + * Records the settings in a panel for future reference, for example when + * the panel is being replaced by a different one. + * + * Parameters + * glass_editWindow *ed == the edit box we're talking about + */ + +#define Q dbox_READSTATE + +static void editWindow__closePanel(glass_editWindow *ed) +{ + switch (ed->e.panel) + { + case glass_EWCHARS: + ed->wdef.flags&=~0x00003f72; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCMOVE,Q)<<1; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCREDRAW,Q)<<4; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCPANE,Q)<<5; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCNOBOUNDS,Q)<<6; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCONSCREEN,Q)<<13; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCSCRLREP,Q)<<8; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCSCRLDEB,Q)<<9; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCGCOL,Q)<<10; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCBACK,Q)<<11; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWCHOTKEYS,Q)<<12; + break; + case glass_EWGADGETS: + ed->wdef.flags&=~0xff00008d; + if (dbox_selecticon(ed->e.pd,glass_EWGOLD,Q)) + { + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGOTITLE,Q)<<0; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGOVERT,Q)<<2; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGOHORIZ,Q)<<3; + ed->wdef.flags|=(!dbox_selecticon(ed->e.pd, + glass_EWGOCLOSEBACK, + Q))<<7; + } + else + { + ed->wdef.flags|=wimp_WNEW; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGNBACK,Q)<<24; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGNCLOSE,Q)<<25; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGNTITLE,Q)<<26; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGNTOGGLE,Q)<<27; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGNVERT,Q)<<28; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGNRESIZE,Q)<<29; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWGNHORIZ,Q)<<30; + } + break; + case glass_EWTDATA: + dbox_getfield(ed->e.pd,glass_EIDDATA,ed->data,256); + dbox_getfield(ed->e.pd,glass_EIDVALSTRING,ed->valid,256); + dbox_scanfield(ed->e.pd,glass_EIDINDSIZE,"%d",&ed->indLen); + ed->hasValid=dbox_selecticon(ed->e.pd,glass_EIDVALID,Q); + ed->wdef.titleflags&=~0x00000103; + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd,glass_EIDTEXT,Q)<<0; + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd,glass_EIDSPRITE,Q)<<1; + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd,glass_EIDINDIR,Q)<<8; + break; + case glass_EWTAPPEAR: + ed->wdef.titleflags&=~0x00000afc; + dbox_scanfield(ed->e.pd,glass_EIAFSIZEWRITE,"%d",&ed->fontSize); + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd, + glass_EIAHCENTRE, + Q)<<3; + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd,glass_EIAVCENTRE,Q)<<4; + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd,glass_EIAFONT,Q)<<6; + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd,glass_EIARALIGN,Q)<<9; + ed->wdef.titleflags|=dbox_selecticon(ed->e.pd,glass_EIAHALFSIZE,Q)<<11; + break; + case glass_EWWORKAREA: + ed->wdef.flags&=~0x0000c000; + editWindow__checkExtents(ed,FALSE,FALSE,TRUE); + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWSRUBBERH,Q)<<14; + ed->wdef.flags|=dbox_selecticon(ed->e.pd,glass_EWSRUBBERV,Q)<<15; + break; + } +} + +#undef Q + +/* + * void editWindow__setPanel(glass_editWindow *ed,dbox_field f) + * + * Use + * Creates a new panel based on a radio button click or some-such. + * + * Parameters + * glass_editWindow *ed == the edit window to change panel + * dbox_field f == the radio button associated with the desired panel + */ + +static void editWindow__panelHandler(dbox d,dbox_field f,void *handle); +static BOOL editWindow__panelRaw(dbox d,wimp_eventstr *e,void *handle); + +static void editWindow__setPanel(glass_editWindow *ed,dbox_field f) +{ + dbox d; + wimp_wstate s; + wimp_icon i; + int width,height; + int ox,oy; + wimp_w behind; + wimp_caretstr c; + wimp_redrawstr r; + BOOL ownCaret=TRUE; + + if (f==ed->e.panel) + return; + editWindow__closePanel(ed); + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(ed->e.d),&s)); + wimpt_noerr(wimp_get_icon_info(dbox_syshandle(ed->e.d), + glass_EWPOSN,&i)); + ox=s.o.box.x0-s.o.x; + oy=s.o.box.y1-s.o.y; + mem_useUser(indir_alloc,indir_free); + if (f==-1) + d=dbox_create("iconNowt"); + else + d=dbox_create(editWindow__panels[f-glass_EWCHARS]); + if (!d) + { + mem_useMalloc(); + return; + } + dbox_eventHandler(d,editWindow__panelHandler,ed); + dbox_rawEventHandler(d,editWindow__panelRaw,ed); + if (ed->e.panel) + { + wimpt_noerr(wimp_get_caret_pos(&c)); + ownCaret=(c.w==dbox_syshandle(ed->e.pd)); + dbox_selecticon(ed->e.d,ed->e.panel,dbox_RESETSTATE); + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(ed->e.pd),&s)); + pane_removePane(ed->e.p,dbox_syshandle(ed->e.pd)); + dbox_delete(ed->e.pd); + } + dbox_selecticon(ed->e.d,f,dbox_SETSTATE); + behind=s.o.behind; + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(d),&s)); + width=s.o.box.x1-s.o.box.x0; + height=s.o.box.y1-s.o.box.y0; + s.o.box.x0=i.box.x0+ox+wimpt_dx(); + s.o.box.y0=i.box.y0+oy+wimpt_dy(); + s.o.box.x1=s.o.box.x0+width; + s.o.box.y1=s.o.box.y0+height; + s.o.y=10000; + s.o.behind=behind; + ed->e.pd=d; + ed->e.panel=f; + editWindow__setupPanel(ed); + if (f==glass_EWTAPPEAR) + { + r.w=s.o.w; + r.box.x0=0; + r.box.x1=s.o.box.x1-s.o.box.x0; + r.box.y1=0; + r.box.y0=editWindow__ICAPPHEIGHT; + wimpt_noerr(wimp_set_extent(&r)); + } + wimpt_noerr(wimp_open_wind(&s.o)); + if (ownCaret) + { + c.w=dbox_syshandle(d); + c.i=-1; + c.x=-500000; + c.y=0; + c.height=0x02000000; + wimpt_noerr(wimp_set_caret_pos(&c)); + } + pane_addPane(ed->e.p,dbox_syshandle(d)); + mem_useMalloc(); +} + +/* + * void editWindow__recreate(glass_editWindow *ed) + * + * Use + * Recreates the icon from the dialogue box settings + * + * Parameters + * glass_editWindow *ed == info about the edit + */ + +static void editWindow__recreate(glass_editWindow *ed) +{ + char *p=0; + char *q=0; + char newname[15]; + int fhandle; + ed->w->edit=0; /* Delink temporarily */ + + editWindow__checkExtents(ed,FALSE,FALSE,TRUE); + if (!(ed->wdef.titleflags & wimp_INDIRECT)) + { + ed->indLen=12; + ed->hasValid=FALSE; + } + if (strlen(ed->data)>=ed->indLen) + { + ed->wdef.titleflags|=wimp_INDIRECT; + ed->indLen=strlen(ed->data)+1; + } + if (ed->wdef.titleflags & wimp_INDIRECT) + { + if (p=indir_alloc(ed->indLen),!p) + { + werr(FALSE,msgs_lookup("ewNEMUW")); + return; + } + if (ed->hasValid && (ed->wdef.titleflags & wimp_ITEXT)) + { + if (q=indir_alloc(strlen(ed->valid)+1),!q) + { + indir_free(p); + werr(FALSE, + msgs_lookup("ewNEMUW")); + return; + } + strcpy(q,ed->valid); + ed->w->size+=strlen(ed->valid)+1; + } + strcpy(p,ed->data); + ed->w->size+=ed->indLen; + } + + if (ed->w->def->desc.w.titleflags & wimp_IFONT) /* Was old antialiased? */ + { + fhandle=(ed->w->def->desc.w.titleflags >> 24) & 255; + wimpt_noerr(font_lose(fhandle)); + ed->w->fonts[fhandle]--; + } + if (ed->wdef.titleflags & wimp_IFONT) /* Is new title antialiased? */ + { + if (font_find(ed->font,ed->fontSize*16,ed->fontSize*16,0,0,&fhandle)) + { + werr(FALSE,msgs_lookup("ewCFF"),ed->font); + ed->wdef.titleflags&=~wimp_IFONT; + } + else + { + ed->w->antiAliased=TRUE; + ed->w->fonts[fhandle]++; + ed->wdef.titleflags=(ed->wdef.titleflags & 0x00ffffff) | (fhandle<<24); + } + } + + if (ed->w->def->desc.w.titleflags & wimp_INDIRECT) + { + indir_free(ed->w->def->desc.w.title.indirecttext.buffer); + ed->w->size-=ed->w->def->desc.w.title.indirecttext.bufflen; + if ((ed->w->def->desc.w.titleflags & wimp_ITEXT) && + (ed->w->def->desc.w.title.indirecttext.validstring!=(char *)-1)) + { + ed->w->size-= + strlen(ed->w->def->desc.w.title.indirecttext.validstring)+1; + indir_free(ed->w->def->desc.w.title.indirecttext.validstring); + } + } + + if (p) + { + ed->wdef.title.indirecttext.buffer=p; + ed->wdef.title.indirecttext.bufflen=ed->indLen; + if (q) + ed->wdef.title.indirecttext.validstring=q; + else if (ed->wdef.titleflags & wimp_ITEXT) + ed->wdef.title.indirecttext.validstring=(char *)-1; + else + ed->wdef.title.indirectsprite.spritearea=ed->w->t->s; + } + else + memcpy(ed->wdef.title.text,ed->data,12); + + ed->wdef.box=ed->w->def->desc.w.box; + ed->wdef.scx=ed->w->def->desc.w.scx; + ed->wdef.scy=ed->w->def->desc.w.scy; + ed->wdef.behind=ed->w->def->desc.w.behind; + ed->wdef.nicons=ed->w->def->desc.w.nicons; + ed->w->def->desc.w=ed->wdef; + dbox_getfield(ed->e.d,glass_EWIDWRITE,newname,15); + tfile_rename(newname,ed->w); + dbox_setfield(ed->e.d,glass_EWIDWRITE,"%s",ed->w->id); + + ed->w->edit=ed; /* Relink again */ + window_recreate(ed->w); + tfile_markAsAltered(ed->w->t); +} + +/* + * void editWindow__nextPanel(glass_editWindow *ed,int dir) + * + * Use + * Changes panel to the next one in the given direction. Skips shaded + * panels and handles everything nicely. + * + * Parameters + * glass_editWindow *ed == the edit dialogue box to move about in + * int dir == the direction (-1 for up, 1 for down) + */ + +static void editWindow__nextPanel(glass_editWindow *ed,int dir) +{ + int i=ed->e.panel; + + if (i==-1) + i=(dir==1 ? glass_EWCHARS : glass_EWWORKAREA); + else + i+=dir; + + for (;i>=glass_EWCHARS && i<=glass_EWWORKAREA;i+=dir) + { + if (!dbox_shadeicon(ed->e.d,i,dbox_READSTATE)) + { + editWindow__setPanel(ed,i); + break; + } + } +} + +/*----- Event handlers ----------------------------------------------------*/ + +/* + * void editWindow__dboxHandler(dbox d,dbox_field f,void *handle) + * + * Use + * Handles any and all events directed at the dbox. Well, almost all... + * + * Parameters + * dbox d == the dbox handle + * dbox_field f == the event that happened + * void *handle == pointer to the dialogue box control info + */ + +static void editWindow__dboxHandler(dbox d,dbox_field f,void *handle) +{ + glass_editWindow *ed=handle; + switch (f) + { + case dbox_CLOSE: + editWindow_close(ed->w); + break; + case dbox_HELP: + help_startHelp(); + help_addLine(msgs_lookup("ewhEIDB")); + help_readFromIcon(); + help_endHelp(); + break; + case glass_EWCAN: + dbox_clickicon(d,f); + if (!dbox_wasAdjustClick()) + pane_close(ed->e.p); + else + { + /* --- set up for old window --- */ + ed->wdef=ed->w->def->desc.w; + editWindow_readData(ed->w); + dbox_setfield(ed->e.d,glass_EWIDWRITE,"%s",ed->w->id); + editWindow__setupPanel(ed); + } + dbox_unclick(); + if (!dbox_wasAdjustClick()) + editWindow_close(ed->w); + break; + case glass_EWOK: + dbox_clickicon(d,f); + editWindow__closePanel(ed); + if (!dbox_wasAdjustClick()) + { + pane_close(ed->e.p); + editWindow__recreate(ed); + dbox_unclick(); + editWindow_close(ed->w); + } + else + { + editWindow__recreate(ed); + editWindow_readData(ed->w); + editWindow__setupPanel(ed); + dbox_unclick(); + } + break; + case glass_EWDEL: + dbox_clickicon(d,f); + if (gPrefs_current()->cDelWind) + { + if (!warning(msgs_lookup("ewCDWP"), + msgs_lookup("ewCDW"))) + { + dbox_unclick(); + return; + } + } + pane_close(ed->e.p); + dbox_unclick(); + tfile_markAsAltered(ed->w->t); + tfile_deleteWindow(ed->w->i,ed->w); /* This causes a close for us */ + break; + case glass_EWSAVE: + dbox_clickicon(d,f); + dbox_unclick(); + tfile_saveWindow(ed->w); + break; + case glass_EWCHARS: + case glass_EWGADGETS: + case glass_EWBTYPE: + case glass_EWTDATA: + case glass_EWTAPPEAR: + case glass_EWCOLOURS: + case glass_EWWORKAREA: + editWindow__setPanel(ed,f); + break; + } +} + +/* + * BOOL editWindow__dboxRaw(dbox d,wimp_eventstr *e,void *handle) + * + * Use + * Handles open window requests and things for the main Preferences dbox. + * + * Parameters + * dbox d == the dbox handle + * wimp_eventstr *e == the event that happened + * void *handle == a unused pointer + * + * Returns + * TRUE if the event has been handled; + */ + +static BOOL editWindow__dboxRaw(dbox d,wimp_eventstr *e,void *handle) +{ + BOOL handled=FALSE; + glass_editWindow *ed=handle; + glass_intMsgstr *m; + unused(d); + switch (e->e) + { + case wimp_EOPEN: + pane_moved(ed->e.p); + handled=TRUE; + break; + case wimp_EKEY: + switch (e->data.key.chcode) + { + case akbd_UpK+akbd_Sh: + editWindow__nextPanel(ed,-1); + handled=TRUE; + break; + case akbd_DownK+akbd_Sh: + editWindow__nextPanel(ed,+1); + handled=TRUE; + break; + } + break; + case wimp_ESEND: + case wimp_ESENDWANTACK: + switch (e->data.msg.hdr.action) + { + case wimp_MINTERNAL: + m=intMsgs_receive(e); + switch(e->data.msg.data.words[0]) + { + case glass_DELETEFILE: + if (m->df.t==ed->w->t) + editWindow_close(ed->w); + break; + case glass_SAVEFILE: + if (m->df.t==ed->w->t) + dbox_setfield(ed->e.d,glass_EWFILEDISP,"%.%s", + ed->w->t->filename); + break; + case glass_DELETEWINDOW: + if (m->dw.w==ed->w) + editWindow_close(ed->w); + break; + case glass_RENAME: + if (m->rn.w==ed->w) + dbox_setfield(ed->e.d,glass_EWIDWRITE,"%s",ed->w->id); + break; + } + break; + } + break; + } + return (handled); +} + +/* + * menu editWindow__fontMaker(void *handle) + * + * Use + * Sets up the font menu. + * + * Parameters + * void *handle == pointer to this edit + * + * Returns + * A menu to display + */ + +static menu editWindow__fontMaker(void *handle) +{ + glass_editWindow *ed=handle; + menu m=fontMenu_createFontMenu(FALSE); + fontMenu_tickGivenName(ed->font); + return (m); +} + +/* + * void editWindow__fontHandler(int hit[],void *handle) + * + * Use + * Gets the font chosen from the font menu. + * + * Parameters + * int hit[] == the hit string + * void *handle == pointer to this edit + */ + +static void editWindow__fontHandler(int hit[],void *handle) +{ + glass_editWindow *ed=handle; + if (hit[0]) + { + strcpy(ed->font,fontMenu_fontname(hit[0],hit[1])); + dbox_setfield(ed->e.pd,glass_EIAFONTNAME,"%.%s",ed->font); + } +} + +/* + * void editWindow__fontHelp(int hit[],void *handle) + * + * Use + * Gives help on a font menu item + * + * Parameters + * int hit[] == the hit string + * void *handle == pointer to this edit + */ + +static void editWindow__fontHelp(int hit[],void *handle) +{ + unused(handle); + if (hit[0]) + { + help_startHelp(); + help_addLine(msgs_lookup("ewmhFONT"),fontMenu_fontname(hit[0],hit[1])); + help_endHelp(); + } +} + +/* + * menu editWindow__btypeMaker(void *handle) + * + * Use + * Generates and sets up a button type menu for an edit dialogue box + * + * Parameters + * void *handle == pointer to the edit + * + * Returns + * The menu to use + */ + +static menu editWindow__btypeMaker(void *handle) +{ + static menu m; + static int ticked; + glass_editWindow *ed=handle; + int i; + char *buf=buffer_find(); + + if (!m) + { + m=menu_new(msgs_lookup("eiBTMT"),msgs_lookup("ewBTYPE0")); + for (i=1;i<=15;i++) + { + sprintf(buf,"ewBTYPE%i",i); + menu_extend(m,msgs_lookup(buf)); + } + } + if (ticked) + menu_setflags(m,ticked,FALSE,FALSE); + ticked=((ed->wdef.workflags>>12)&0x0f)+1; + menu_setflags(m,ticked,TRUE,FALSE); + return (m); +} + +/* + * void editWindow__btypeHandler(int hit[],void *handle) + * + * Use + * Handles a click on the button type menu. + * + * Parameters + * int hit[] == the mouse click info + * void *handle == pointer to edit information + */ + +static void editWindow__btypeHandler(int hit[],void *handle) +{ + glass_editWindow *ed=handle; + char *buf=buffer_find(); + + if (hit[0]) + { + ed->wdef.workflags&=~0x0000f000; + ed->wdef.workflags+=(hit[0]-1)<<12; + sprintf(buf,"ewBTYPE%i",hit[0]-1); + dbox_setfield(ed->e.pd,glass_EIABTYPE,"%s",msgs_lookup(buf)); + } +} + +/* + * void editWindow__colProc(dbox d,dbox_field f,int colour, void *handle) + * + * Use + * This routine is called when a colour is selected in the colours panel. + * + * Parameters + * dbox d == the panel's handle + * dbox_field f == the colour button that has changed + * int colour == the new colour for the button + * void *handle == pointer to this edit + */ + +static void editWindow__colProc(dbox d,dbox_field f,int colour,void *handle) +{ + glass_editWindow *ed=handle; + unused(d); + switch (f) + { + case glass_EWCTBFORE: + ed->wdef.colours[0]=colour; + dbox_shadeicon(ed->e.d,glass_EWGADGETS,colour==255); + if ((tst(ed->wdef.flags,31) && tst(ed->wdef.flags,26)) + || (!tst(ed->wdef.flags,31) && tst(ed->wdef.flags,0))) + { + dbox_shadeicon(ed->e.d,glass_EWTDATA,colour==255); + dbox_shadeicon(ed->e.d,glass_EWTAPPEAR,colour==255); + } + break; + case glass_EWCTBBACK: + ed->wdef.colours[1]=colour; + break; + case glass_EWCWAFORE: + ed->wdef.colours[2]=colour; + break; + case glass_EWCWABACK: + ed->wdef.colours[3]=colour; + break; + case glass_EWCSCFORE: + ed->wdef.colours[5]=colour; + break; + case glass_EWCSCBACK: + ed->wdef.colours[4]=colour; + break; + case glass_EWCHIGH: + ed->wdef.colours[6]=colour; + break; + } +} + +/* + * void editWindow__btypeHelp(int hit[],void *handle) + * + * Use + * Handles a help request for the button type menu. + * + * Parameters + * int hit[] == the helpq info + * void *handle == pointer to edit information + */ + +static void editWindow__btypeHelp(int hit[],void *handle) +{ + char *buf=buffer_find(); + unused(handle); + if (hit[0]) + { + help_startHelp(); + sprintf(buf,"ewBTYPE%i",hit[0]-1); + help_addLine(msgs_lookup("ewmhBTYPE"),msgs_lookup(buf)); + help_endHelp(); + } +} + +/* + * void editWindow__extArrows(dbox d,dbox_field f,int diff,void *handle) + * + * Use + * Handles a click on one of the (many!) arrow buttons in the extends panel. + */ + +typedef struct +{ + BOOL xOrY; + BOOL topOrBottom; + glass_editWindow *ed; +} +editWindow__extArrowstr; + +static void editWindow__extArrows(dbox d,dbox_field f,int diff,void *handle) +{ + editWindow__extArrowstr *a=handle; + wimp_box *b=&a->ed->wdef.ex; + int *v; + unused(f); + + if (a->xOrY) + v=(a->topOrBottom ? &b->x1 : &b->x0); + else + v=(a->topOrBottom ? &b->y1 : &b->y0); + + dbox_scanfield(d,glass_EWSBOTTOMLEFT,"%d,%d",&b->x0,&b->y0); + dbox_scanfield(d,glass_EWSTOPRIGHT,"%d,%d",&b->x1,&b->y1); + + *v+=diff; + + editWindow__checkExtents(a->ed,!a->topOrBottom,a->topOrBottom,FALSE); +} + +/* + * void editWindow__panelHandler(dbox d,dbox_field f,void *handle) + * + * Use + * Handles simple click events for the current panel in an edit dbox + * + * Parameters + * dbox d == the panel's dbox handle + * dbox_field f == the icon that was clicked + * void *handle == pointer to edit information + */ + +static void editWindow__panelHandler(dbox d,dbox_field f,void *handle) +{ + glass_editWindow *ed=handle; + int on; + buttons_simpleArrow sa={0,9999,FALSE}; + editWindow__extArrowstr eas; + BOOL indon; + + switch (f) + { + case dbox_CLOSE: + case dbox_HELP: + case glass_EIOK: + case glass_EICAN: + editWindow__dboxHandler(ed->e.d,f,ed); + return; + break; + } + switch (ed->e.panel) + { + case glass_EWGADGETS: + on=!dbox_selecticon(d,f,dbox_READSTATE); + switch (f) + { + case glass_EWGOLD: + if (on) + { + dbox_selecticon(d,glass_EWGOLD,TRUE); + dbox_selecticon(d,glass_EWGNEW,FALSE); + dbox_shadeicon(d,glass_EWGOTITLE,FALSE); + dbox_shadeicon(d,glass_EWGOCLOSEBACK, + !dbox_selecticon(d,glass_EWGOTITLE,dbox_READSTATE)); + dbox_shadeicon(d,glass_EWGOHORIZ,FALSE); + dbox_shadeicon(d,glass_EWGOVERT,FALSE); + dbox_shadeicon(d,glass_EWGNTITLE,TRUE); + dbox_shadeicon(d,glass_EWGNCLOSE,TRUE); + dbox_shadeicon(d,glass_EWGNBACK,TRUE); + dbox_shadeicon(d,glass_EWGNTOGGLE,TRUE); + dbox_shadeicon(d,glass_EWGNRESIZE,TRUE); + dbox_shadeicon(d,glass_EWGNHORIZ,TRUE); + dbox_shadeicon(d,glass_EWGNVERT,TRUE); + } + break; + case glass_EWGNEW: + if (on) + { + dbox_selecticon(d,glass_EWGOLD,FALSE); + dbox_selecticon(d,glass_EWGNEW,TRUE); + dbox_shadeicon(d,glass_EWGOTITLE,TRUE); + dbox_shadeicon(d,glass_EWGOCLOSEBACK,TRUE); + dbox_shadeicon(d,glass_EWGOHORIZ,TRUE); + dbox_shadeicon(d,glass_EWGOVERT,TRUE); + dbox_shadeicon(d,glass_EWGNTITLE,FALSE); + dbox_shadeicon(d,glass_EWGNCLOSE, + !dbox_selecticon(d,glass_EWGNTITLE,dbox_READSTATE)); + dbox_shadeicon(d,glass_EWGNBACK, + !dbox_selecticon(d,glass_EWGNTITLE,dbox_READSTATE)); + dbox_shadeicon(d,glass_EWGNTOGGLE, + !(dbox_selecticon(d,glass_EWGNTITLE,dbox_READSTATE) + || dbox_selecticon(d,glass_EWGNVERT,dbox_READSTATE))); + dbox_shadeicon(d,glass_EWGNRESIZE, + !(dbox_selecticon(d,glass_EWGNHORIZ,dbox_READSTATE) + || dbox_selecticon(d,glass_EWGNVERT,dbox_READSTATE))); + dbox_shadeicon(d,glass_EWGNHORIZ,FALSE); + dbox_shadeicon(d,glass_EWGNVERT,FALSE); + } + break; + case glass_EWGOTITLE: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGNTITLE,on); + dbox_shadeicon(d,glass_EWGOCLOSEBACK,!on); + dbox_shadeicon(ed->e.d,glass_EWTDATA,!on); + dbox_shadeicon(ed->e.d,glass_EWTAPPEAR,!on); + break; + case glass_EWGOCLOSEBACK: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGNCLOSE,on); + dbox_selecticon(d,glass_EWGNBACK,on); + break; + case glass_EWGOHORIZ: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGNHORIZ,on); + dbox_selecticon(d,glass_EWGNRESIZE, + (on || dbox_selecticon(d,glass_EWGOVERT,dbox_READSTATE))); + break; + case glass_EWGOVERT: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGNVERT,on); + dbox_selecticon(d,glass_EWGNTOGGLE,on); + dbox_selecticon(d,glass_EWGNRESIZE, + (on || dbox_selecticon(d,glass_EWGOHORIZ,dbox_READSTATE))); + break; + case glass_EWGNTITLE: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGOTITLE,on); + dbox_shadeicon(d,glass_EWGNCLOSE,!on); + dbox_shadeicon(d,glass_EWGNBACK,!on); + dbox_shadeicon(d,glass_EWGNTOGGLE, + !(on || dbox_selecticon(d,glass_EWGNVERT,dbox_READSTATE))); + dbox_shadeicon(ed->e.d,glass_EWTDATA,!on); + dbox_shadeicon(ed->e.d,glass_EWTAPPEAR,!on); + break; + case glass_EWGNCLOSE: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGOCLOSEBACK, + (on || dbox_selecticon(d,glass_EWGNBACK,dbox_READSTATE))); + break; + case glass_EWGNBACK: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGOCLOSEBACK, + (on || dbox_selecticon(d,glass_EWGNCLOSE,dbox_READSTATE))); + break; + case glass_EWGNTOGGLE: + case glass_EWGNRESIZE: + dbox_selecticon(d,f,on); + break; + case glass_EWGNHORIZ: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGOHORIZ,on); + dbox_shadeicon(d,glass_EWGNRESIZE, + !(on || dbox_selecticon(d,glass_EWGNVERT,dbox_READSTATE))); + break; + case glass_EWGNVERT: + dbox_selecticon(d,f,on); + dbox_selecticon(d,glass_EWGOVERT,on); + dbox_shadeicon(d,glass_EWGNRESIZE, + !(on || dbox_selecticon(d,glass_EWGNHORIZ,dbox_READSTATE))); + dbox_shadeicon(d,glass_EWGNTOGGLE, + !(on || dbox_selecticon(d,glass_EWGNTITLE,dbox_READSTATE))); + break; + } + break; + case glass_EWTDATA: + switch (f) + { + case glass_EIDINDIR: + if (dbox_selecticon(d,f,dbox_READSTATE)) + { + if (dbox_selecticon(ed->e.pd,glass_EIDTEXT,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING, + !dbox_selecticon(ed->e.pd,glass_EIDVALID,dbox_READSTATE)); + } + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,FALSE); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + } + break; + case glass_EIDINDUP: + buttons_arrow(d,f,d,glass_EIDINDSIZE,0,+1,&sa); + break; + case glass_EIDINDDOWN: + buttons_arrow(d,f,d,glass_EIDINDSIZE,0,-1,&sa); + break; + case glass_EIDVALID: + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,dbox_TOGGLESTATE); + break; + case glass_EIDMINIMISE: + dbox_clickicon(d,f); + dbox_getfield(d,glass_EIDDATA,ed->data,256); + dbox_setfield(d,glass_EIDINDSIZE,"%i",strlen(ed->data)+1); + dbox_unclick(); + break; + case glass_EIDTEXT: + if (dbox_selecticon(ed->e.pd,glass_EIDTEXT,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + if (dbox_selecticon(d,glass_EIDINDIR,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING, + !dbox_selecticon(ed->e.pd,glass_EIDVALID,dbox_READSTATE)); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,FALSE); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + } + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDVALID,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDVALSTRING,TRUE); + if (dbox_selecticon(d,glass_EIDSPRITE,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + indon=dbox_selecticon(d,glass_EIDINDIR,dbox_READSTATE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,!indon); + } + else + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + } + } + break; + case glass_EIDSPRITE: + if (dbox_selecticon(ed->e.pd,glass_EIDSPRITE,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,FALSE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,FALSE); + indon=dbox_selecticon(d,glass_EIDINDIR,dbox_READSTATE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,!indon); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,!indon); + } + else if (!dbox_selecticon(ed->e.pd,glass_EIDTEXT,dbox_READSTATE)) + { + dbox_shadeicon(ed->e.pd,glass_EIDDATA,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDIR,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDSIZE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDUP,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDDOWN,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDMINIMISE,TRUE); + dbox_shadeicon(ed->e.pd,glass_EIDINDPART,TRUE); + } + break; + } + break; + case glass_EWTAPPEAR: + switch (f) + { + case glass_EIAFONT: + if (dbox_selecticon(d,f,dbox_READSTATE) || + fontMenu_createFontMenu(FALSE)) + { + dbox_selecticon(d,f,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFONTNAME,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFONTMENU,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFSIZEUP,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFSIZEDOWN,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_EIAFSIZEWRITE,dbox_TOGGLESTATE); + } + break; + case glass_EIAFSIZEUP: + buttons_arrow(d,f,d,glass_EIAFSIZEWRITE,0,+1,&sa); + break; + case glass_EIAFSIZEDOWN: + buttons_arrow(d,f,d,glass_EIAFSIZEWRITE,0,-1,&sa); + break; + } + break; + case glass_EWWORKAREA: + eas.ed=ed; + switch (f) + { + case glass_EWSTOPUP: + eas.xOrY=FALSE; + eas.topOrBottom=TRUE; + buttons_arrow(d,f,d,0,editWindow__extArrows,+wimpt_dy(),&eas); + break; + case glass_EWSTOPDOWN: + eas.xOrY=FALSE; + eas.topOrBottom=TRUE; + buttons_arrow(d,f,d,0,editWindow__extArrows,-wimpt_dy(),&eas); + break; + case glass_EWSLEFTLEFT: + eas.xOrY=TRUE; + eas.topOrBottom=FALSE; + buttons_arrow(d,f,d,0,editWindow__extArrows,-wimpt_dx(),&eas); + break; + case glass_EWSLEFTRIGHT: + eas.xOrY=TRUE; + eas.topOrBottom=FALSE; + buttons_arrow(d,f,d,0,editWindow__extArrows,+wimpt_dx(),&eas); + break; + case glass_EWSRIGHTLEFT: + eas.xOrY=TRUE; + eas.topOrBottom=TRUE; + buttons_arrow(d,f,d,0,editWindow__extArrows,-wimpt_dx(),&eas); + break; + case glass_EWSRIGHTRIGHT: + eas.xOrY=TRUE; + eas.topOrBottom=TRUE; + buttons_arrow(d,f,d,0,editWindow__extArrows,+wimpt_dx(),&eas); + break; + case glass_EWSBOTTOMUP: + eas.xOrY=FALSE; + eas.topOrBottom=FALSE; + buttons_arrow(d,f,d,0,editWindow__extArrows,+wimpt_dy(),&eas); + break; + case glass_EWSBOTTOMDOWN: + eas.xOrY=FALSE; + eas.topOrBottom=FALSE; + buttons_arrow(d,f,d,0,editWindow__extArrows,-wimpt_dy(),&eas); + break; + case glass_EWSEXTLOCK: + dbox_clickicon(d,f); + ed->wdef.ex.x0=ed->w->def->desc.w.scx; + ed->wdef.ex.x1=ed->w->def->desc.w.scx+ + ed->w->def->desc.w.box.x1-ed->w->def->desc.w.box.x0; + ed->wdef.ex.y0=ed->w->def->desc.w.scy+ + ed->w->def->desc.w.box.y0-ed->w->def->desc.w.box.y1; + ed->wdef.ex.y1=ed->w->def->desc.w.scy; + editWindow__checkExtents(ed,TRUE,TRUE,FALSE); + dbox_unclick(); + break; + case glass_EWSTLLARGE: + dbox_clickicon(d,f); + ed->wdef.ex.x0=(ed->wdef.ex.x0 - 2000) / 2000 * 2000; + ed->wdef.ex.y1=(ed->wdef.ex.y1 + 2000) / 2000 * 2000; + editWindow__checkExtents(ed,TRUE,TRUE,FALSE); + dbox_unclick(); + break; + case glass_EWSBRLARGE: + dbox_clickicon(d,f); + ed->wdef.ex.x1=(ed->wdef.ex.x1 + 2000) / 2000 * 2000; + ed->wdef.ex.y0=(ed->wdef.ex.y0 - 2000) / 2000 * 2000; + editWindow__checkExtents(ed,TRUE,TRUE,FALSE); + dbox_unclick(); + break; + case glass_EWSMINWSET: + dbox_clickicon(d,f); + dbox_setfield(d,glass_EWSMINWIDTH,"%i", + ed->w->def->desc.w.box.x1-ed->w->def->desc.w.box.x0); + dbox_unclick(); + break; + case glass_EWSMINHSET: + dbox_clickicon(d,f); + dbox_setfield(d,glass_EWSMINHEIGHT,"%i", + ed->w->def->desc.w.box.y1-ed->w->def->desc.w.box.y0); + dbox_unclick(); + break; + } + break; + } +} + +/* + * BOOL editWindow__panelRaw(dbox d,wimp_eventstr *e,void *handle) + * + * Use + * Handles the more wierd events for a particular panel. + * + * Parameters + * dbox d == the dbox handle of the panel + * wimp_eventstr *e == the event to look at + * void *handle == pointer to the current edit + * + * Returns + * TRUE if the event is dead (long live the event...) + */ + +static BOOL editWindow__panelRaw(dbox d,wimp_eventstr *e,void *handle) +{ + BOOL handled=FALSE; + glass_editWindow *ed=handle; + if (e->e==wimp_EKEY) + { + switch (e->data.key.chcode) + { + case akbd_UpK+akbd_Sh: + editWindow__nextPanel(ed,-1); + handled=TRUE; + break; + case akbd_DownK+akbd_Sh: + editWindow__nextPanel(ed,+1); + handled=TRUE; + break; + } + } + if (!handled) switch (ed->e.panel) + { + case glass_EWTDATA: + /* Nothin' doing */ + break; + case glass_EWTAPPEAR: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_EIAFONTNAME: + menu_make(editWindow__fontMaker,editWindow__fontHandler, + editWindow__fontHelp,ed); + handled=TRUE; + break; + case glass_EIAFONTMENU: + dbox_clickicon(d,glass_EIAFONTMENU); + menu_make(editWindow__fontMaker,editWindow__fontHandler, + editWindow__fontHelp,ed); + dbox_unclick(); + handled=TRUE; + break; + } + break; + } + break; + case glass_EWBTYPE: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_EWBBTDISP: + menu_make(editWindow__btypeMaker,editWindow__btypeHandler, + editWindow__btypeHelp,ed); + handled=TRUE; + break; + case glass_EWBBTMENU: + dbox_clickicon(d,glass_EWBBTMENU); + menu_make(editWindow__btypeMaker,editWindow__btypeHandler, + editWindow__btypeHelp,ed); + dbox_unclick(); + handled=TRUE; + break; + } + break; + } + break; + case glass_EWCOLOURS: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_EWCTBFORE: + colSelect(ed->e.pd,glass_EWCTBFORE,e->data.but.m.bbits, + msgs_lookup("ewTBFG"),TRUE,editWindow__colProc,ed); + break; + case glass_EWCTBBACK: + colSelect(ed->e.pd,glass_EWCTBBACK,e->data.but.m.bbits, + msgs_lookup("ewTBBG"),FALSE,editWindow__colProc,ed); + break; + case glass_EWCWAFORE: + colSelect(ed->e.pd,glass_EWCWAFORE,e->data.but.m.bbits, + msgs_lookup("ewWAFG"),FALSE,editWindow__colProc,ed); + break; + case glass_EWCWABACK: + colSelect(ed->e.pd,glass_EWCWABACK,e->data.but.m.bbits, + msgs_lookup("ewWABG"),TRUE,editWindow__colProc,ed); + break; + case glass_EWCSCFORE: + colSelect(ed->e.pd,glass_EWCSCFORE,e->data.but.m.bbits, + msgs_lookup("ewSCFG"),FALSE,editWindow__colProc,ed); + break; + case glass_EWCSCBACK: + colSelect(ed->e.pd,glass_EWCSCBACK,e->data.but.m.bbits, + msgs_lookup("ewSCBG"),FALSE,editWindow__colProc,ed); + break; + case glass_EWCHIGH: + colSelect(ed->e.pd,glass_EWCHIGH,e->data.but.m.bbits, + msgs_lookup("ewTBHI"),FALSE,editWindow__colProc,ed); + } + break; + } + break; + } + return (FALSE); +} + +/*----- External routines -------------------------------------------------*/ + +/* + * void editWindow_windowMoved(glass_windPointer *w) + * + * Use + * Informs an edit dialogue that a window has been moved. + * + * Parameters + * glass_windPointer *w == the window containing the icon + */ + +void editWindow_windowMoved(glass_windPointer *w) +{ + glass_editWindow *ed=w->edit; + if (!ed) + return; + editWindow__checkExtents(ed,FALSE,FALSE,TRUE); +} + +/* + * void editWindow_readData(glass_windPointer *w) + * + * Use + * Forces a re-read of the title data for the given window edit. Since + * this is called on setting up an edit and cancelling one, it also does + * some + * + * Parameters + * glass_windPointer *w == the window containing the icon + */ + +void editWindow_readData(glass_windPointer *w) +{ + glass_editWindow *ed=w->edit; + if (!ed) + return; + ed->wdef.title=ed->w->def->desc.w.title; + if (ed->wdef.titleflags & wimp_INDIRECT) + { + utils_ctermToNterm(ed->wdef.title.indirecttext.buffer); + strcpy(ed->data,ed->wdef.title.indirecttext.buffer); + ed->indLen=ed->wdef.title.indirecttext.bufflen; + if (ed->wdef.titleflags & wimp_ITEXT && + ed->wdef.title.indirecttext.validstring!=(char *)-1) + { + utils_ctermToNterm(ed->wdef.title.indirecttext.validstring); + strcpy(ed->valid,ed->wdef.title.indirecttext.validstring); + ed->hasValid=TRUE; + } + else + { + ed->valid[0]=0; + ed->hasValid=FALSE; + } + } + else + { + ed->data[12]=0; + memcpy(ed->data,ed->wdef.title.text,12); + utils_ctermToNterm(ed->data); + ed->valid[0]=0; + ed->indLen=12; + } + + if (ed->wdef.colours[0]==255) /* If no system area */ + { + dbox_shadeicon(ed->e.d,glass_EWTDATA,TRUE); + dbox_shadeicon(ed->e.d,glass_EWTAPPEAR,TRUE); + dbox_shadeicon(ed->e.d,glass_EWGADGETS,TRUE); + if (ed->e.panel==glass_EWTDATA + || ed->e.panel==glass_EWTAPPEAR + || ed->e.panel==glass_EWGADGETS) + editWindow__setPanel(ed,-1); + } + else if ((tst(ed->wdef.flags,31) && !tst(ed->wdef.flags,26)) + || (!tst(ed->wdef.flags,31) && !tst(ed->wdef.flags,0))) + { + dbox_shadeicon(ed->e.d,glass_EWTDATA,TRUE); + dbox_shadeicon(ed->e.d,glass_EWTAPPEAR,TRUE); + dbox_shadeicon(ed->e.d,glass_EWGADGETS,FALSE); + if (ed->e.panel==glass_EWTDATA + || ed->e.panel==glass_EWTAPPEAR) + editWindow__setPanel(ed,-1); + } + else + { + dbox_shadeicon(ed->e.d,glass_EWTDATA,FALSE); + dbox_shadeicon(ed->e.d,glass_EWTAPPEAR,FALSE); + dbox_shadeicon(ed->e.d,glass_EWGADGETS,FALSE); + } + + if (ed->e.panel==glass_EWTDATA) + editWindow__setupPanel(ed); +} + +/* + * void editWindow_close(glass_windPointer *w) + * + * Use + * Closes an edit window + * + * Parameters + * glass_windPointer *w == the window containing the icon + */ + +void editWindow_close(glass_windPointer *w) +{ + glass_editWindow *ed=w->edit; + if (ed) + { + if (ed->e.pd) + dbox_deleteNoUpdate(ed->e.pd); + pane_delete(ed->e.p); + dbox_deleteNoUpdate(ed->e.d); + ed->w->edit=0; + mem_free(ed); + } +} + +/* + * void editWindow(glass_windPointer *w) + * + * Use + * Edits the given window in a dialogue box. + * + * Parameters + * glass_windPointer *w == the window to edit + */ + +void editWindow(glass_windPointer *w) +{ + glass_editWindow *ed; + os_regset r; + if (w->edit) + { + dbox_display(w->edit->e.d,TRUE); + pane_front(w->edit->e.p); + return; + } + mem_useUser(indir_alloc,indir_free); + ed=mem_alloc(sizeof(glass_editWindow)); + if (!ed) + { + mem_useMalloc(); + werr(FALSE,msgs_lookup("ewNEM")); + return; + } + if (ed->e.d=dbox_create("editWindow"),!ed->e.d) + { + mem_free(ed); + mem_useMalloc(); + return; + } + if (ed->e.p=pane_create(dbox_syshandle(ed->e.d)),!ed->e.p) + { + dbox_delete(ed->e.d); + mem_useMalloc(); + mem_free(ed); + return; + } + ed->w=w; + ed->wdef=w->def->desc.w; + w->edit=ed; + ed->e.panel=0; + + /* --- Set up icon data now --- */ + editWindow_readData(w); + if (ed->wdef.titleflags & wimp_IFONT) + { + r.r[0]=ed->wdef.titleflags >> 24; + r.r[1]=(int)(ed->font); + wimpt_noerr(os_swix(XFont_ReadDefn,&r)); + utils_ctermToNterm(ed->font); + ed->fontSize=r.r[2]/16; + } + else + { + strcpy(ed->font,"Homerton.Medium"); + ed->fontSize=12; + } + + /* --- Now do handlers, and final setting up --- */ + dbox_setfield(ed->e.d,glass_EWIDWRITE,"%s",w->id); + dbox_setfield(ed->e.d,glass_EWFILEDISP,"%.%s",w->t->filename); + dbox_eventHandler(ed->e.d,editWindow__dboxHandler,ed); + dbox_rawEventHandler(ed->e.d,editWindow__dboxRaw,ed); + dbox_openDisplaced(ed->e.d); + editWindow__setPanel(ed,glass_EWCHARS); + mem_useMalloc(); +} diff --git a/StraySrc/Glass/!Glass/c/gPrefs b/StraySrc/Glass/!Glass/c/gPrefs new file mode 100644 index 0000000..0fa4874 --- /dev/null +++ b/StraySrc/Glass/!Glass/c/gPrefs @@ -0,0 +1,1703 @@ +/* + * gPrefs.h + * + * Loading, saving, alteration and setting of preferences + * + * © 1994-1998 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Glass. + * + * Glass is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Glass is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Glass. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Header files ------------------------------------------------------*/ + +/* + * ANSI standard headers + */ + +/* + * Steel headers + */ + +#define _STDAPP +#include "steel/Steel.h" + +#include "steel/prefs.h" +#include "steel/pane.h" +#include "steel/blinkC.h" +#include "steel/buttons.h" +#include "steel/akbd.h" + +/* + * Glass headers + */ + +#include "gIcons.h" +#include "gMenus.h" + +#include "glass.h" +#include "gPrefs.h" +#include "intMsgs.h" +#include "colSelect.h" +#include "window.h" + +/*----- Macros ------------------------------------------------------------*/ + +#define gPrefs__DEFAULTTIME 5 +#define gPrefs__DEFAULTCOUNT 50 + +/*----- Static global variables -------------------------------------------*/ + +static gPrefs_prefs gPrefs__current= +{ + gPrefs_MINUTES, /* Autosave_TimeUnits */ + 10, /* Autosave_Time */ + 0, /* Autosave_Alterations */ + TRUE, /* Autosave_Prompt */ + + TRUE, /* Interface_DisplayBorders */ + TRUE, /* Interface_SlabIcons */ + TRUE, /* Interface_DragboxAroundBorder*/ + FALSE, /* Interface_SlabMenu */ + + TRUE, /* WimpExt_DisplayBorders */ + TRUE, /* WimpExt_KeyPress */ + TRUE, /* WimpExt_DragboxAroundBorder */ + + TRUE, /* Sculptrix_DisplayBorders */ + TRUE, /* Sculptrix_SlabIcons */ + TRUE, /* Sculptrix_DragboxAroundBorder*/ + FALSE, /* Sculptrix_SlabMenu */ + + TRUE, /* Sprites_LoadSprites */ + TRUE, /* Sprites_Load!Sprites */ + TRUE, /* Sprites_LoadDefaults */ + + gPrefs_SMALL, /* Files_IconSize */ + gPrefs_NAME, /* Files_SortBy */ + + FALSE, /* Grid_Display */ + FALSE, /* Grid_Lock */ + 16, /* Grid_Width */ + 16, /* Grid_Height */ + FALSE, /* Grid_DrawLines */ + 8, /* Grid_GridColour */ + 14, /* Grid_GuideColour */ + 13, /* Grid_SelectedGuideColour */ + + TRUE, /* Select_DrawBorder */ + TRUE, /* Select_DottedBorder */ + 3, /* Select_BorderColour */ + TRUE, /* Select_EdgeHandles */ + 4, /* Select_HandleSize */ + 7, /* Select_HandleColour */ + 11, /* Select_SpecialColour */ + + TRUE, /* Confirm_Quit */ + TRUE, /* Confirm_Close */ + TRUE, /* Confirm_DelWind */ + FALSE, /* Confirm_DelIcon */ + FALSE, /* Confirm_TestCloseEdit */ + TRUE, /* Confirm_Overwrite */ + + TRUE, /* Toolbar_Display */ + FALSE, /* Toolbar_Floating */ + {0,0}, /* Toolbar_Position */ + TRUE, /* Toolbar_OnLeft */ + + TRUE, /* Infobar_Display */ + FALSE, /* Infobar_Floating */ + {0,0}, /* Infobar_Position */ + TRUE, /* Infobar_Underneath */ + + FALSE, /* Misc_DrawHatch */ + TRUE, /* Misc_BlinkCursor */ + TRUE, /* Misc_VisibleInWork */ + TRUE, /* Misc_CreateOnTop */ + TRUE, /* Misc_RenumberOnDelete */ + FALSE, /* Misc_ControlToEdit */ +}; + +static gPrefs_prefs gPrefs__new; +static dbox gPrefs__dbox; +static pane gPrefs__pane; +static dbox gPrefs__panel; +static dbox_field gPrefs__currentPanel; + +/*----- Interpreters for new preferences data types -----------------------*/ + +static char *gPrefs__readUnit(char *tag,char *args,void *handle); +static char *gPrefs__writeUnit(char *tag,FILE *fp,void *handle); +static char *gPrefs__readIconSize(char *tag,char *args,void *handle); +static char *gPrefs__writeIconSize(char *tag,FILE *fp,void *handle); +static char *gPrefs__readSort(char *tag,char *args,void *handle); +static char *gPrefs__writeSort(char *tag,FILE *fp,void *handle); +static char *gPrefs__readCoords(char *tag,char *args,void *handle); +static char *gPrefs__writeCoords(char *tag,FILE *fp,void *handle); + +/*----- Preferences file description --------------------------------------*/ + +static prefs_prefstr gPrefs__prefs[]= +{ + ";\n" + "; Glass preferences\n" + ";\n" + "\n", + 0, + 0, + 0, + + "Autosave_TimeUnits", + gPrefs__readUnit, + gPrefs__writeUnit, + &gPrefs__current.aUnit, + "Autosave_Time", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.aTime, + "Autosave_Alterations", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.aAlts, + "Autosave_Prompt", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.aPrompt, + "\n", + 0, + 0, + 0, + + "Interface_DisplayBorders", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.iDispBorders, + "Interface_SlabIcons", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.iSlabIcons, + "Interface_DragboxAroundBorder", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.iIncBorder, + "Interface_SlabOnMenu", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.iSlabMenu, + "\n", + 0, + 0, + 0, + + "WimpExtension_DisplayBorders", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.wDispBorders, + "WimpExtension_KeyPress", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.wKeyPress, + "WimpExtension_DragboxAroundBorder", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.wIncBorder, + "\n", + 0, + 0, + 0, + + "Sculptrix_DisplayBorders", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sDispBorders, + "Sculptrix_SlabIcons", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sSlabIcons, + "Sculptrix_DragboxAroundBorder", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sIncBorder, + "Sculptrix_SlabOnMenu", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sSlabMenu, + "\n", + 0, + 0, + 0, + + "Sprites_LoadSprites", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sLoadSpr, + "Sprites_Load!Sprites", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sLoadPSpr, + "Sprites_LoadDefaults", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sLoadDef, + "\n", + 0, + 0, + 0, + + "Files_IconSize", + gPrefs__readIconSize, + gPrefs__writeIconSize, + &gPrefs__current.fIcons, + "Files_SortBy", + gPrefs__readSort, + gPrefs__writeSort, + &gPrefs__current.fSort, + "\n", + 0, + 0, + 0, + + "Grid_Display", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.gDisp, + "Grid_Lock", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.gLock, + "Grid_Width", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.gWidth, + "Grid_Height", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.gHeight, + "Grid_DrawLines", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.gLines, + "Grid_GridColour", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.gGridCol, + "Grid_GuideColour", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.gGdeCol, + "Grid_SelectedGuideColour", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.gGdeSelCol, + "\n", + 0, + 0, + 0, + + "Select_DrawBorder", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sBorder, + "Select_DottedBorder", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sDotted, + "Select_BorderColour", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.sBColour, + "Select_EdgeHandles", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.sEdgeHandles, + "Select_HandleSize", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.sHandSize, + "Select_HandleColour", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.sHColour, + "Select_SpecialColour", + prefs_readNumeric, + prefs_writeNumeric, + &gPrefs__current.sSColour, + "\n", + 0, + 0, + 0, + + "Confirm_Quit", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.cQuit, + "Confirm_Close", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.cClose, + "Confirm_DelWind", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.cDelWind, + "Confirm_DelIcon", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.cDelIcon, + "Confirm_TestCloseEdit", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.cTest, + "Confirm_Overwrite", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.cSave, + "\n", + 0, + 0, + 0, + + "Toolbar_Display", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.tDisplay, + "Toolbar_Floating", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.tFloating, + "Toolbar_Position", + gPrefs__readCoords, + gPrefs__writeCoords, + &gPrefs__current.tPosn, + "Toolbar_OnLeft", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.tLeft, + "\n", + 0, + 0, + 0, + + "Infobar_Display", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.iDisplay, + "Infobar_Floating", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.iFloating, + "Infobar_Position", + gPrefs__readCoords, + gPrefs__writeCoords, + &gPrefs__current.iPosn, + "Infobar_Underneath", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.iUnder, + "\n", + 0, + 0, + 0, + + "Misc_DrawHatch", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.mDrawHatch, + "Misc_BlinkCursor", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.mBlink, + "Misc_VisibleInWork", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.mVisInWork, + "Misc_CreateOnTop", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.mCreateTop, + "Misc_RenumberOnDelete", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.mDeleteRenum, + "Misc_ControlToEdit", + prefs_readBoolean, + prefs_writeBoolean, + &gPrefs__current.mCtrlEdit, + 0, + 0, + 0, + 0, +}; + +/*----- Miscelaneous tables -----------------------------------------------*/ + +static char *gPrefs__panels[]= +{ + "prefSave", + "prefIface", + "prefSprite", + "prefFile", + "prefGrid", + "prefSel", + "prefConf", + "prefTool", + "prefMisc", +}; + +static char *gPrefs__units[]= +{ + 0, + "prHR", + "prMI", + "prSE", +}; + +/*----- Support routines --------------------------------------------------*/ + +#define max2(a,b) ((a)>(b) ? (a) : (b)) +#define min2(a,b) ((a)<(b) ? (a) : (b)) + +/* + * char *gPrefs__readUnit(char *tag,char *args,void *handle) + * + * Use + * Interprets a time unit variable in preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * char *args == pointer to args string to interpret + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__readUnit(char *tag,char *args,void *handle) +{ + unused(tag); + if (utils_caselessCmp(args,"hours")==0) + *(gPrefs_autoUnits *)handle=gPrefs_HOURS; + else if (utils_caselessCmp(args,"minutes")==0) + *(gPrefs_autoUnits *)handle=gPrefs_MINUTES; + else if (utils_caselessCmp(args,"seconds")==0) + *(gPrefs_autoUnits *)handle=gPrefs_SECONDS; + else + { + return (msgs_lookup("prBTU")); + } + return (0); +} + +/* + * char *gPrefs__writeUnit(char *tag,FILE *fp,void *handle) + * + * Use + * Writes a time unit variable to preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * FILE *fp == the file handle for the file + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__writeUnit(char *tag,FILE *fp,void *handle) +{ + static char *units[]={0,"hours","minutes","seconds"}; + fprintf(fp,"%s=%s\n",tag,units[*(gPrefs_autoUnits *)handle]); + return (0); +} + +/* + * char *gPrefs__readIconSize(char *tag,char *args,void *handle) + * + * Use + * Interprets an icon size variable in preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * char *args == pointer to args string to interpret + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__readIconSize(char *tag,char *args,void *handle) +{ + unused(tag); + if (utils_caselessCmp(args,"large")==0) + *(gPrefs_iconSize *)handle=gPrefs_LARGE; + else if (utils_caselessCmp(args,"small")==0) + *(gPrefs_iconSize *)handle=gPrefs_SMALL; + else + { + return (msgs_lookup("prBIS")); + } + return (0); +} + +/* + * char *gPrefs__writeIconSize(char *tag,FILE *fp,void *handle) + * + * Use + * Writes an icon size variable to preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * FILE *fp == the file handle for the file + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__writeIconSize(char *tag,FILE *fp,void *handle) +{ + static char *units[]={0,"large","small"}; + fprintf(fp,"%s=%s\n",tag,units[*(gPrefs_iconSize *)handle]); + return (0); +} + +/* + * char *gPrefs__readSort(char *tag,char *args,void *handle) + * + * Use + * Interprets a sort type variable in preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * char *args == pointer to args string to interpret + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__readSort(char *tag,char *args,void *handle) +{ + unused(tag); + if (utils_caselessCmp(args,"name")==0) + *(gPrefs_sortType *)handle=gPrefs_NAME; + else if (utils_caselessCmp(args,"size")==0) + *(gPrefs_sortType *)handle=gPrefs_SIZE; + else if (utils_caselessCmp(args,"icons")==0) + *(gPrefs_sortType *)handle=gPrefs_ICONS; + else if (utils_caselessCmp(args,"noSort")==0) + *(gPrefs_sortType *)handle=gPrefs_NOSORT; + else + { + return (msgs_lookup("prBST")); + } + return (0); +} + +/* + * char *gPrefs__writeSort(char *tag,FILE *fp,void *handle) + * + * Use + * Writes a sort type variable to preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * FILE *fp == the file handle for the file + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__writeSort(char *tag,FILE *fp,void *handle) +{ + static char *units[]={0,"name","size","icons","noSort"}; + fprintf(fp,"%s %s\n",tag,units[*(gPrefs_sortType *)handle]); + return (0); +} + +/* + * char *gPrefs__readCoords(char *tag,char *args,void *handle) + * + * Use + * Interprets a coordinates type variable in preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * char *args == pointer to args string to interpret + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__readCoords(char *tag,char *args,void *handle) +{ + gPrefs_coords *c=handle; + unused(tag); + sscanf(args,"%d,%d",&c->x,&c->y); + return (0); +} + +/* + * char *gPrefs__writeCoords(char *tag,FILE *fp,void *handle) + * + * Use + * Writes a sort type variable to preferences file. + * + * Parameters + * char *tag == the name of the tag to interpret + * FILE *fp == the file handle for the file + * void *handle == pointer to approriately typed variable + * + * Returns + * 0 for success, or pointer to an error string. + */ + +static char *gPrefs__writeCoords(char *tag,FILE *fp,void *handle) +{ + gPrefs_coords *c=handle; + fprintf(fp,"%s=%i,%i\n",tag,c->x,c->y); + return (0); +} + +/* + * void gPrefs__setupPanel(void) + * + * Use + * Reads the settings in a panel before it is closed. + */ + +static void gPrefs__setupPanel(void) +{ + dbox d=gPrefs__panel; + switch (gPrefs__currentPanel) + { + case glass_PMAUTOSAVE: + if (gPrefs__new.aTime) + { + dbox_selecticon(d,glass_PATIMED,dbox_SETSTATE); + dbox_shadeicon(d,glass_PATIMEDOWN,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PATIMEWRITE,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PATIMEUP,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PAUNITSDISP,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PAUNITSMENU,dbox_RESETSTATE); + dbox_setfield(d,glass_PATIMEWRITE,"%i",gPrefs__new.aTime); + } + else + { + dbox_selecticon(d,glass_PATIMED,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PATIMEDOWN,dbox_SETSTATE); + dbox_shadeicon(d,glass_PATIMEWRITE,dbox_SETSTATE); + dbox_shadeicon(d,glass_PATIMEUP,dbox_SETSTATE); + dbox_shadeicon(d,glass_PAUNITSDISP,dbox_SETSTATE); + dbox_shadeicon(d,glass_PAUNITSMENU,dbox_SETSTATE); + dbox_setfield(d,glass_PATIMEWRITE,"%i",gPrefs__DEFAULTTIME); + } + dbox_setfield(d,glass_PAUNITSDISP,"%s", + msgs_lookup(gPrefs__units[gPrefs__new.aUnit])); + if (gPrefs__new.aAlts) + { + dbox_selecticon(d,glass_PACOUNTED,dbox_SETSTATE); + dbox_shadeicon(d,glass_PACOUNTDOWN,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PACOUNTWRITE,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PACOUNTUP,dbox_RESETSTATE); + dbox_setfield(d,glass_PACOUNTWRITE,"%i",gPrefs__new.aAlts); + } + else + { + dbox_selecticon(d,glass_PACOUNTED,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PACOUNTDOWN,dbox_SETSTATE); + dbox_shadeicon(d,glass_PACOUNTWRITE,dbox_SETSTATE); + dbox_shadeicon(d,glass_PACOUNTUP,dbox_SETSTATE); + dbox_setfield(d,glass_PACOUNTWRITE,"%i",gPrefs__DEFAULTCOUNT); + } + dbox_selecticon(d,glass_PAPROMPT,gPrefs__new.aPrompt); + break; + case glass_PMINTERFACE: + dbox_selecticon(d,glass_PIDISPBORDER,gPrefs__new.iDispBorders); + dbox_selecticon(d,glass_PIMOUSECLICK,gPrefs__new.iSlabIcons); + dbox_selecticon(d,glass_PIMENUCLICK,gPrefs__new.iSlabMenu); + dbox_shadeicon(d,glass_PIMENUCLICK,!gPrefs__new.iSlabIcons); + dbox_selecticon(d,glass_PIINCBORDER,gPrefs__new.iIncBorder); + + dbox_selecticon(d,glass_PWDISPBORDER,gPrefs__new.wDispBorders); + dbox_selecticon(d,glass_PWKEYPRESS,gPrefs__new.wKeyPress); + dbox_selecticon(d,glass_PWINCBORDER,gPrefs__new.wIncBorder); + + dbox_selecticon(d,glass_PSDISPBORDER,gPrefs__new.sDispBorders); + dbox_selecticon(d,glass_PSMOUSECLICK,gPrefs__new.sSlabIcons); + dbox_selecticon(d,glass_PSMENUCLICK,gPrefs__new.sSlabMenu); + dbox_shadeicon(d,glass_PSMENUCLICK,!gPrefs__new.sSlabIcons); + dbox_selecticon(d,glass_PSINCBORDER,gPrefs__new.sIncBorder); + + break; + case glass_PMSPRITES: + dbox_selecticon(d,glass_PSSPRITES,gPrefs__new.sLoadSpr); + dbox_selecticon(d,glass_PSPSPRITES,gPrefs__new.sLoadPSpr); + dbox_selecticon(d,glass_PSDEFAULTS,gPrefs__new.sLoadDef); + break; + case glass_PMFILEDISP: + dbox_selecticon(d,glass_PFLARGE,gPrefs__new.fIcons==gPrefs_LARGE); + dbox_selecticon(d,glass_PFSMALL,gPrefs__new.fIcons==gPrefs_SMALL); + dbox_selecticon(d,glass_PFNAME,gPrefs__new.fSort==gPrefs_NAME); + dbox_selecticon(d,glass_PFSIZE,gPrefs__new.fSort==gPrefs_SIZE); + dbox_selecticon(d,glass_PFICONS,gPrefs__new.fSort==gPrefs_ICONS); + dbox_selecticon(d,glass_PFNOSORT,gPrefs__new.fSort==gPrefs_NOSORT); + break; + case glass_PMGRID: + dbox_selecticon(d,glass_PGDISP,gPrefs__new.gDisp); + dbox_selecticon(d,glass_PGLOCK,gPrefs__new.gLock); + dbox_setfield(d,glass_PGWWRITE,"%i",gPrefs__new.gWidth); + dbox_setfield(d,glass_PGHWRITE,"%i",gPrefs__new.gHeight); + dbox_selecticon(d,glass_PGLINES,gPrefs__new.gLines); + dbox_selecticon(d,glass_PGPOINTS,!gPrefs__new.gLines); + colSelect_setColourButton(d,glass_PGGRIDCOL,gPrefs__new.gGridCol); + colSelect_setColourButton(d,glass_PGGUIDECOL,gPrefs__new.gGdeCol); + colSelect_setColourButton(d, + glass_PGGDESELCOL, + gPrefs__new.gGdeSelCol); + break; + case glass_PMSELECTION: + dbox_selecticon(d,glass_PSBORDER,gPrefs__new.sBorder); + dbox_shadeicon(d,glass_PSDOTTED,!gPrefs__new.sBorder); + dbox_shadeicon(d,glass_PSBCOLLABEL,!gPrefs__new.sBorder); + dbox_shadeicon(d,glass_PSBCOLOUR,!gPrefs__new.sBorder); + dbox_selecticon(d,glass_PSDOTTED,gPrefs__new.sDotted); + colSelect_setColourButton(d,glass_PSBCOLOUR,gPrefs__new.sBColour); + dbox_selecticon(d,glass_PSCORNEDGE,gPrefs__new.sEdgeHandles); + dbox_selecticon(d,glass_PSCORNONLY,!gPrefs__new.sEdgeHandles); + dbox_setfield(d,glass_PSSIZEWRITE,"%i",gPrefs__new.sHandSize); + colSelect_setColourButton(d,glass_PSHCOLOUR,gPrefs__new.sHColour); + colSelect_setColourButton(d,glass_PSSCOLOUR,gPrefs__new.sSColour); + break; + case glass_PMCONFIRM: + dbox_selecticon(d,glass_PCQUIT,gPrefs__new.cQuit); + dbox_selecticon(d,glass_PCCLOSE,gPrefs__new.cClose); + dbox_selecticon(d,glass_PCDELWIN,gPrefs__new.cDelWind); + dbox_selecticon(d,glass_PCDELICON,gPrefs__new.cDelIcon); + dbox_selecticon(d,glass_PCTEST,gPrefs__new.cTest); + dbox_selecticon(d,glass_PCOVERWRITE,gPrefs__new.cSave); + break; + case glass_PMTOOLINFO: + if (gPrefs__new.tDisplay) + { + dbox_selecticon(d,glass_PTTOOLDISP,dbox_SETSTATE); + dbox_shadeicon(d,glass_PTTOOLFLOAT,dbox_RESETSTATE); + } + else + { + dbox_selecticon(d,glass_PTTOOLDISP,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PTTOOLFLOAT,dbox_SETSTATE); + } + dbox_selecticon(d,glass_PTTOOLFLOAT,gPrefs__new.tFloating); + if (gPrefs__new.iDisplay) + { + dbox_selecticon(d,glass_PTINFODISP,dbox_SETSTATE); + dbox_shadeicon(d,glass_PTINFOFLOAT,dbox_RESETSTATE); + } + else + { + dbox_selecticon(d,glass_PTINFODISP,dbox_RESETSTATE); + dbox_shadeicon(d,glass_PTINFOFLOAT,dbox_SETSTATE); + } + dbox_selecticon(d,glass_PTINFOFLOAT,gPrefs__new.iFloating); + break; + case glass_PMMISC: + dbox_selecticon(d,glass_PMHATCH,gPrefs__new.mDrawHatch); + dbox_selecticon(d,glass_PMBLINK,gPrefs__new.mBlink); + dbox_selecticon(d,glass_PMVISINWORK,gPrefs__new.mVisInWork); + dbox_selecticon(d,glass_PMNEWONTOP,gPrefs__new.mCreateTop); + dbox_selecticon(d,glass_PMRENDEL,gPrefs__new.mDeleteRenum); + dbox_selecticon(d,glass_PMCTRLEDIT,gPrefs__new.mCtrlEdit); + break; + } +} + +/* + * void gPrefs__closePanel(void) + * + * Use + * Reads the settings in a panel before it is closed. + */ + +#define Q dbox_READSTATE + +static void gPrefs__closePanel(void) +{ + dbox d=gPrefs__panel; + switch (gPrefs__currentPanel) + { + case glass_PMAUTOSAVE: + if (dbox_selecticon(d,glass_PATIMED,Q)) + { + dbox_scanfield(d,glass_PATIMEWRITE,"%d",&gPrefs__new.aTime); + if (!gPrefs__new.aTime) + { + gPrefs__new.aTime=gPrefs__DEFAULTTIME; + dbox_setfield(d,glass_PATIMEWRITE,"%i",gPrefs__new.aTime); + note(msgs_lookup("prSILT"), + gPrefs__DEFAULTTIME); + } + } + else + gPrefs__new.aTime=0; + if (dbox_selecticon(d,glass_PACOUNTED,Q)) + { + dbox_scanfield(d,glass_PACOUNTWRITE,"%d",&gPrefs__new.aAlts); + if (!gPrefs__new.aAlts) + { + gPrefs__new.aAlts=gPrefs__DEFAULTCOUNT; + dbox_setfield(d,glass_PACOUNTWRITE,"%i",gPrefs__new.aTime); + note(msgs_lookup("prSILC"), + gPrefs__DEFAULTCOUNT); + } + } + else + gPrefs__new.aAlts=0; + gPrefs__new.aPrompt=dbox_selecticon(d,glass_PAPROMPT,Q); + break; + case glass_PMINTERFACE: + gPrefs__new.iDispBorders=dbox_selecticon(d,glass_PIDISPBORDER,Q); + gPrefs__new.iSlabIcons=dbox_selecticon(d,glass_PIMOUSECLICK,Q); + if (gPrefs__new.iSlabIcons) + gPrefs__new.iSlabMenu=dbox_selecticon(d,glass_PIMENUCLICK,Q); + else + gPrefs__new.iSlabMenu=FALSE; + gPrefs__new.iIncBorder=dbox_selecticon(d,glass_PIINCBORDER,Q); + + gPrefs__new.wDispBorders=dbox_selecticon(d,glass_PWDISPBORDER,Q); + gPrefs__new.wKeyPress=dbox_selecticon(d,glass_PWKEYPRESS,Q); + gPrefs__new.wIncBorder=dbox_selecticon(d,glass_PWINCBORDER,Q); + + gPrefs__new.sDispBorders=dbox_selecticon(d,glass_PSDISPBORDER,Q); + gPrefs__new.sSlabIcons=dbox_selecticon(d,glass_PSMOUSECLICK,Q); + if (gPrefs__new.sSlabIcons) + gPrefs__new.sSlabMenu=dbox_selecticon(d,glass_PSMENUCLICK,Q); + else + gPrefs__new.sSlabMenu=FALSE; + gPrefs__new.sIncBorder=dbox_selecticon(d,glass_PSINCBORDER,Q); + + break; + case glass_PMSPRITES: + gPrefs__new.sLoadSpr=dbox_selecticon(d,glass_PSSPRITES,Q); + gPrefs__new.sLoadPSpr=dbox_selecticon(d,glass_PSPSPRITES,Q); + gPrefs__new.sLoadDef=dbox_selecticon(d,glass_PSDEFAULTS,Q); + break; + case glass_PMFILEDISP: + if (dbox_selecticon(d,glass_PFLARGE,Q)) + gPrefs__new.fIcons=gPrefs_LARGE; + else + gPrefs__new.fIcons=gPrefs_SMALL; + if (dbox_selecticon(d,glass_PFNAME,Q)) + gPrefs__new.fSort=gPrefs_NAME; + else if (dbox_selecticon(d,glass_PFSIZE,Q)) + gPrefs__new.fSort=gPrefs_SIZE; + else if (dbox_selecticon(d,glass_PFICONS,Q)) + gPrefs__new.fSort=gPrefs_ICONS; + else + gPrefs__new.fSort=gPrefs_NOSORT; + break; + case glass_PMGRID: + gPrefs__new.gDisp=dbox_selecticon(d,glass_PGDISP,Q); + gPrefs__new.gLock=dbox_selecticon(d,glass_PGLOCK,Q); + dbox_scanfield(d,glass_PGWWRITE,"%d",&gPrefs__new.gWidth); + dbox_scanfield(d,glass_PGHWRITE,"%d",&gPrefs__new.gHeight); + gPrefs__new.gLines=dbox_selecticon(d,glass_PGLINES,Q); + break; + case glass_PMSELECTION: + gPrefs__new.sBorder=dbox_selecticon(d,glass_PSBORDER,Q); + gPrefs__new.sDotted=dbox_selecticon(d,glass_PSDOTTED,Q); + gPrefs__new.sEdgeHandles=dbox_selecticon(d,glass_PSCORNEDGE,Q); + dbox_scanfield(d,glass_PSSIZEWRITE,"%d",&gPrefs__new.sHandSize); + break; + case glass_PMCONFIRM: + gPrefs__new.cQuit=dbox_selecticon(d,glass_PCQUIT,Q); + gPrefs__new.cClose=dbox_selecticon(d,glass_PCCLOSE,Q); + gPrefs__new.cDelWind=dbox_selecticon(d,glass_PCDELWIN,Q); + gPrefs__new.cDelIcon=dbox_selecticon(d,glass_PCDELICON,Q); + gPrefs__new.cTest=dbox_selecticon(d,glass_PCTEST,Q); + gPrefs__new.cSave=dbox_selecticon(d,glass_PCOVERWRITE,Q); + break; + case glass_PMTOOLINFO: + gPrefs__new.tDisplay=dbox_selecticon(d,glass_PTTOOLDISP,Q); + gPrefs__new.tFloating=dbox_selecticon(d,glass_PTTOOLFLOAT,Q); + gPrefs__new.iDisplay=dbox_selecticon(d,glass_PTINFODISP,Q); + gPrefs__new.iFloating=dbox_selecticon(d,glass_PTINFOFLOAT,Q); + break; + case glass_PMMISC: + gPrefs__new.mDrawHatch=dbox_selecticon(d,glass_PMHATCH,Q); + gPrefs__new.mBlink=dbox_selecticon(d,glass_PMBLINK,Q); + gPrefs__new.mVisInWork=dbox_selecticon(d,glass_PMVISINWORK,Q); + gPrefs__new.mCreateTop=dbox_selecticon(d,glass_PMNEWONTOP,Q); + gPrefs__new.mDeleteRenum=dbox_selecticon(d,glass_PMRENDEL,Q); + gPrefs__new.mCtrlEdit=dbox_selecticon(d,glass_PMCTRLEDIT,Q); + break; + } +} + +#undef Q + +/* + * void gPrefs__setPanel(dbox_field f) + * + * Use + * Creates a new panel based on a radio button click or some-such. + * + * Parameters + * dbox_field f == the radio button associated with the desired panel + */ + +static void gPrefs__panelHandler(dbox d,dbox_field f,void *handle); +static BOOL gPrefs__panelRaw(dbox d,wimp_eventstr *e,void *handle); + +static void gPrefs__setPanel(dbox_field f) +{ + dbox d; + wimp_wstate s; + wimp_icon i; + int width,height; + int ox,oy; + wimp_w behind; + wimp_caretstr c; + BOOL ownCaret=TRUE; + if (f==gPrefs__currentPanel) + return; + gPrefs__closePanel(); + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(gPrefs__dbox),&s)); + wimpt_noerr(wimp_get_icon_info(dbox_syshandle(gPrefs__dbox), + glass_PMPOSN,&i)); + ox=s.o.box.x0-s.o.x; + oy=s.o.box.y1-s.o.y; + if (d=dbox_create(gPrefs__panels[f-glass_PMAUTOSAVE]),!d) + return; + dbox_eventHandler(d,gPrefs__panelHandler,0); + dbox_rawEventHandler(d,gPrefs__panelRaw,0); + if (gPrefs__currentPanel) + { + wimpt_noerr(wimp_get_caret_pos(&c)); + ownCaret=(c.w==dbox_syshandle(gPrefs__dbox) || + c.w==dbox_syshandle(gPrefs__panel)); + dbox_selecticon(gPrefs__dbox,gPrefs__currentPanel,dbox_RESETSTATE); + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(gPrefs__panel),&s)); + pane_removePane(gPrefs__pane,dbox_syshandle(gPrefs__panel)); + dbox_delete(gPrefs__panel); + } + dbox_selecticon(gPrefs__dbox,f,dbox_SETSTATE); + behind=s.o.behind; + wimpt_noerr(wimp_get_wind_state(dbox_syshandle(d),&s)); + width=s.o.box.x1-s.o.box.x0; + height=s.o.box.y1-s.o.box.y0; + s.o.box.x0=i.box.x0+ox+wimpt_dx(); + s.o.box.y0=i.box.y0+oy+wimpt_dy(); + s.o.box.x1=s.o.box.x0+width; + s.o.box.y1=s.o.box.y0+height; + s.o.y=10000; + s.o.behind=behind; + gPrefs__panel=d; + gPrefs__currentPanel=f; + gPrefs__setupPanel(); + wimpt_noerr(wimp_open_wind(&s.o)); + if (ownCaret) + { + c.w=dbox_syshandle(d); + c.i=-1; + c.x=-500000; + c.y=0; + c.height=0x02000000; + wimpt_noerr(wimp_set_caret_pos(&c)); + } + pane_addPane(gPrefs__pane,dbox_syshandle(d)); +} + +/*----- Event handlers ----------------------------------------------------*/ + +/* + * void gPrefs__dboxHandler(dbox d,dbox_field f,void *handle) + * + * Use + * Handles any and all events directed at the dbox. Well, almost all... + * + * Parameters + * dbox d == the dbox handle (gPrefs__dbox) + * dbox_field f == the event that happened + * void *handle == unused data handle + */ + +static void gPrefs__dboxHandler(dbox d,dbox_field f,void *handle) +{ + BOOL redraw=FALSE; + int oldTime; + BOOL toolbar=FALSE; + BOOL adjust; + unused(handle); + switch (f) + { + case dbox_CLOSE: + if (gPrefs__panel) + dbox_deleteNoUpdate(gPrefs__panel); + pane_delete(gPrefs__pane); + dbox_delete(gPrefs__dbox); + gPrefs__dbox=0; + gPrefs__currentPanel=0; + break; + case dbox_HELP: + help_startHelp(); + help_addLine(msgs_lookup("prhPREFS")); + help_readFromIcon(); + help_endHelp(); + break; + case glass_PMCANCEL: + dbox_clickicon(d,f); + if (!dbox_wasAdjustClick()) + pane_close(gPrefs__pane); + else + { + gPrefs__new=gPrefs__current; + gPrefs__setupPanel(); + } + dbox_unclick(); + if (!dbox_wasAdjustClick()) + { + dbox_deleteNoUpdate(gPrefs__panel); + pane_delete(gPrefs__pane); + dbox_delete(gPrefs__dbox); + gPrefs__dbox=0; + gPrefs__currentPanel=0; + } + break; + case glass_PMOK: + case glass_PMSAVE: + dbox_clickicon(d,f); + adjust=dbox_wasAdjustClick(); + gPrefs__closePanel(); + oldTime=gPrefs_autoTiming(); + if + ( + (gPrefs__new.iDispBorders!=gPrefs__current.iDispBorders) || + (gPrefs__new.iIncBorder!=gPrefs__current.iIncBorder) || + (gPrefs__new.wDispBorders!=gPrefs__current.wDispBorders) || + (gPrefs__new.wIncBorder!=gPrefs__current.wIncBorder) || + (gPrefs__new.sDispBorders!=gPrefs__current.sDispBorders) || + (gPrefs__new.sIncBorder!=gPrefs__current.sIncBorder) || + (gPrefs__new.mDrawHatch!=gPrefs__current.mDrawHatch) || + (gPrefs__new.sBorder!=gPrefs__current.sBorder) || + (gPrefs__new.sDotted!=gPrefs__current.sDotted) || + (gPrefs__new.sEdgeHandles!=gPrefs__current.sEdgeHandles) || + (gPrefs__new.sHandSize!=gPrefs__current.sHandSize) || + (gPrefs__new.sBColour!=gPrefs__current.sBColour) || + (gPrefs__new.sHColour!=gPrefs__current.sHColour) || + (gPrefs__new.sSColour!=gPrefs__current.sSColour) || + (gPrefs__new.gLines!=gPrefs__current.gLines) || + (gPrefs__new.gGridCol!=gPrefs__current.gGridCol) || + (gPrefs__new.gGdeCol!=gPrefs__current.gGdeCol) || + (gPrefs__new.gGdeSelCol!=gPrefs__current.gGdeSelCol) + ) + redraw=TRUE; + if + ( + (gPrefs__new.tDisplay!=gPrefs__current.tDisplay) || + (gPrefs__new.tFloating!=gPrefs__current.tFloating) || + (gPrefs__new.iDisplay!=gPrefs__current.iDisplay) || + (gPrefs__new.iFloating!=gPrefs__current.iFloating) + ) + toolbar=TRUE; + if (gPrefs__new.aAlts!=gPrefs__current.aAlts) + oldTime=-1; + gPrefs__current=gPrefs__new; + if (redraw) + intMsgs_send(glass_REDRAW,0); + if (gPrefs_autoTiming()!=oldTime) + intMsgs_send(glass_AUTOSAVE,gPrefs_autoTiming()); + if (toolbar) + window_updateToolbar(); + blinkCursor(gPrefs__current.mBlink); + if (f==glass_PMSAVE) + prefs_write(); + if (!adjust) + pane_close(gPrefs__pane); + dbox_unclick(); + if (!adjust) + { + dbox_deleteNoUpdate(gPrefs__panel); + pane_delete(gPrefs__pane); + dbox_delete(gPrefs__dbox); + gPrefs__dbox=0; + gPrefs__currentPanel=0; + } + break; + case glass_PMAUTOSAVE: + case glass_PMINTERFACE: + case glass_PMSPRITES: + case glass_PMFILEDISP: + case glass_PMGRID: + case glass_PMSELECTION: + case glass_PMCONFIRM: + case glass_PMTOOLINFO: + case glass_PMMISC: + gPrefs__setPanel(f); + break; + } +} + +/* + * BOOL gPrefs__dboxRaw(dbox d,wimp_eventstr *e,void *handle) + * + * Use + * Handles open window requests and things for the main Preferences dbox. + * + * Parameters + * dbox d == the dbox handle + * wimp_eventstr *e == the event that happened + * void *handle == a unused pointer + * + * Returns + * TRUE if the event has been handled; + */ + +static BOOL gPrefs__dboxRaw(dbox d,wimp_eventstr *e,void *handle) +{ + BOOL handled=FALSE; + unused(d); + unused(handle); + switch (e->e) + { + case wimp_EOPEN: + pane_moved(gPrefs__pane); + handled=TRUE; + break; + case wimp_EKEY: + switch (e->data.key.chcode) + { + case akbd_UpK+akbd_Sh: + gPrefs__setPanel(max2(gPrefs__currentPanel-1,glass_PMAUTOSAVE)); + handled=TRUE; + break; + case akbd_DownK+akbd_Sh: + gPrefs__setPanel(min2(gPrefs__currentPanel+1,glass_PMMISC)); + handled=TRUE; + break; + } + break; + } + return (handled); +} + +/* + * void gPrefs__panelHandler(dbox d,dbox_field f,void *handle) + * + * Use + * Handles normal dbox-type events for the preferences panel. + * + * Parameters + * dbox d == the dbox handle for the panel + * dbox_field f == the event type + * void *handle == nothing in particular + */ + +static void gPrefs__panelHandler(dbox d,dbox_field f,void *handle) +{ + buttons_simpleArrow ast={1,59,FALSE}; + buttons_simpleArrow asc={1,999,FALSE}; + buttons_simpleArrow sa={0,999,FALSE}; + unused(handle); + + switch (f) + { + case dbox_CLOSE: + case dbox_HELP: + case glass_PMOK: + case glass_PMCANCEL: + gPrefs__dboxHandler(gPrefs__dbox,f,0); + return; + } + switch (gPrefs__currentPanel) + { + case glass_PMAUTOSAVE: + switch (f) + { + case glass_PATIMED: + dbox_shadeicon(d,glass_PATIMEDOWN,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PATIMEUP,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PATIMEWRITE,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PAUNITSDISP,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PAUNITSMENU,dbox_TOGGLESTATE); + break; + case glass_PACOUNTED: + dbox_shadeicon(d,glass_PACOUNTUP,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PACOUNTDOWN,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PACOUNTWRITE,dbox_TOGGLESTATE); + break; + case glass_PATIMEDOWN: + buttons_arrow(d,f,d,glass_PATIMEWRITE,0,-1,&ast); + break; + case glass_PATIMEUP: + buttons_arrow(d,f,d,glass_PATIMEWRITE,0,+1,&ast); + break; + case glass_PACOUNTDOWN: + buttons_arrow(d,f,d,glass_PACOUNTWRITE,0,-1,&asc); + break; + case glass_PACOUNTUP: + buttons_arrow(d,f,d,glass_PACOUNTWRITE,0,+1,&asc); + break; + } + break; + case glass_PMINTERFACE: + switch (f) + { + case glass_PIMOUSECLICK: + dbox_shadeicon(d,glass_PIMENUCLICK,dbox_TOGGLESTATE); + break; + case glass_PSMOUSECLICK: + dbox_shadeicon(d,glass_PSMENUCLICK,dbox_TOGGLESTATE); + break; + } + break; + case glass_PMTOOLINFO: + switch (f) + { + case glass_PTTOOLDISP: + dbox_shadeicon(d,glass_PTTOOLFLOAT,dbox_TOGGLESTATE); + break; + case glass_PTINFODISP: + dbox_shadeicon(d,glass_PTINFOFLOAT,dbox_TOGGLESTATE); + break; + } + break; + case glass_PMGRID: + switch (f) + { + case glass_PGWUP: + buttons_arrow(d,f,d,glass_PGWWRITE,0,+1,&sa); + break; + case glass_PGWDOWN: + buttons_arrow(d,f,d,glass_PGWWRITE,0,-1,&sa); + break; + case glass_PGHUP: + buttons_arrow(d,f,d,glass_PGHWRITE,0,+1,&sa); + break; + case glass_PGHDOWN: + buttons_arrow(d,f,d,glass_PGHWRITE,0,-1,&sa); + break; + } + break; + case glass_PMSELECTION: + switch (f) + { + case glass_PSSIZEUP: + buttons_arrow(d,f,d,glass_PSSIZEWRITE,0,+1,&sa); + break; + case glass_PSSIZEDOWN: + buttons_arrow(d,f,d,glass_PSSIZEWRITE,0,-1,&sa); + break; + case glass_PSBORDER: + dbox_shadeicon(d,glass_PSDOTTED,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PSBCOLLABEL,dbox_TOGGLESTATE); + dbox_shadeicon(d,glass_PSBCOLOUR,dbox_TOGGLESTATE); + break; + } + break; + } +} + +/* + * menu gPrefs__unitsMaker(void *handle) + * + * Use + * Generates the units menu for the autosave panel and put a tick in the + * right place. + * + * Parameters + * void *handle == something pointless. + * + * Returns + * A pointer to the menu. + */ + +static menu gPrefs__unitsMaker(void *handle) +{ + static menu m; + unused(handle); + if (!m) + m=menu_new(msgs_lookup("prUNITT"), + msgs_lookup("prUNIT")); + menu_setflags(m,glass_PUHOURS,FALSE,FALSE); + menu_setflags(m,glass_PUMINUTES,FALSE,FALSE); + menu_setflags(m,glass_PUSECONDS,FALSE,FALSE); + menu_setflags(m,gPrefs__new.aUnit,TRUE,FALSE); + return (m); +} + +/* + * void gPrefs__unitsHandler(int hit[],void *handle) + * + * Use + * Responds to menu clicks on the units menu + * + * Parameters + * int hit[] == the menu hits + * void *handle == an unused data pointer + */ + +static void gPrefs__unitsHandler(int hit[],void *handle) +{ + unused(handle); + switch (hit[0]) + { + case glass_PUHOURS: + case glass_PUMINUTES: + case glass_PUSECONDS: + gPrefs__new.aUnit=hit[0]; + if (gPrefs__currentPanel==glass_PMAUTOSAVE) + dbox_setfield(gPrefs__panel, + glass_PAUNITSDISP, + "%s", + msgs_lookup(gPrefs__units[hit[0]])); + break; + } +} + +/* + * void gPrefs__unitsHelp(int hit[],void *handle) + * + * Use + * Responds to help requests for the units menu + * + * Parameters + * int hit[] == the menu hits + * void *handle == an unused data pointer + */ + +static void gPrefs__unitsHelp(int hit[],void *handle) +{ + unused(handle); + help_startHelp(); + help_readFromMenu("prhmUN",hit); + help_endHelp(); +} + +/* + * void gPrefs__colourHandler(dbox d,dbox_field f,int colour,void *handle) + * + * Use + * Handles the colour buttons in the Preferences dialogue (all of them) + * + * Parameters + * dbox d == irrelevant dbox handle + * dbox_field f == which colour button has been prodded + * int colour == what it has been prodded to + * void *handle == a pointer (ignored) + */ + +static void gPrefs__colourHandler(dbox d, + dbox_field f, + int colour, + void *handle) +{ + unused(d); + unused(handle); + switch (gPrefs__currentPanel) + { + case glass_PMGRID: + switch (f) + { + case glass_PGGRIDCOL: + gPrefs__new.gGridCol=colour; + break; + case glass_PGGUIDECOL: + gPrefs__new.gGdeCol=colour; + break; + case glass_PGGDESELCOL: + gPrefs__new.gGdeSelCol=colour; + break; + } + break; + case glass_PMSELECTION: + switch (f) + { + case glass_PSBCOLOUR: + gPrefs__new.sBColour=colour; + break; + case glass_PSHCOLOUR: + gPrefs__new.sHColour=colour; + break; + case glass_PSSCOLOUR: + gPrefs__new.sSColour=colour; + break; + } + break; + } +} + +/* + * BOOL gPrefs__panelRaw(dbox d,wimp_eventstr *e,void *handle) + * + * Use + * Handles more unusual events concerned with dialogue boxes. + * + * Parameters + * dbox d == the panel's handle + * wimp_eventstr *e == the full event + * void *handle == an unused handle + * + * Returns + * TRUE if the event has been handled + */ + +static BOOL gPrefs__panelRaw(dbox d,wimp_eventstr *e,void *handle) +{ + BOOL handled=FALSE; + BOOL cursor=FALSE; + unused(handle); + if (e->e==wimp_EKEY) + { + switch (e->data.key.chcode) + { + case akbd_UpK+akbd_Sh: + gPrefs__setPanel(max2(gPrefs__currentPanel-1,glass_PMAUTOSAVE)); + handled=TRUE; + break; + case akbd_DownK+akbd_Sh: + gPrefs__setPanel(min2(gPrefs__currentPanel+1,glass_PMMISC)); + handled=TRUE; + break; + } + } + if (!handled) switch (gPrefs__currentPanel) + { + case glass_PMAUTOSAVE: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_PAUNITSDISP: + menu_make(gPrefs__unitsMaker, + gPrefs__unitsHandler, + gPrefs__unitsHelp,0); + break; + case glass_PAUNITSMENU: + dbox_clickicon(d,glass_PAUNITSMENU); + menu_make(gPrefs__unitsMaker, + gPrefs__unitsHandler, + gPrefs__unitsHelp,0); + dbox_unclick(); + break; + } + break; + case wimp_EKEY: + switch (e->data.key.c.i) + { + case glass_PATIMEWRITE: + switch (e->data.key.chcode) + { + case akbd_DownK: + case akbd_UpK: + case akbd_TabK: + case akbd_TabK+akbd_Sh: + case akbd_UpK+akbd_Ctl: + case akbd_DownK+akbd_Ctl: + cursor=TRUE; + break; + } + handled=buttons_insertChar(d,e->data.key.chcode,'0','9'); + if (handled || cursor) + buttons_arrowClick(d,glass_PATIMEWRITE,1,59,0,FALSE); + break; + case glass_PACOUNTWRITE: + switch (e->data.key.chcode) + { + case akbd_DownK: + case akbd_UpK: + case akbd_TabK: + case akbd_TabK+akbd_Sh: + case akbd_UpK+akbd_Ctl: + case akbd_DownK+akbd_Ctl: + cursor=TRUE; + break; + } + handled=buttons_insertChar(d,e->data.key.chcode,'0','9'); + if (handled || cursor) + buttons_arrowClick(d,glass_PACOUNTWRITE,1,999,0,FALSE); + break; + } + break; + } + break; + case glass_PMGRID: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_PGGRIDCOL: + colSelect(d, + e->data.but.m.i, + e->data.but.m.bbits, + msgs_lookup("prGCOL"), + FALSE, + gPrefs__colourHandler, + 0); + handled=TRUE; + break; + case glass_PGGUIDECOL: + colSelect(d, + e->data.but.m.i, + e->data.but.m.bbits, + msgs_lookup("prGDCOL"), + FALSE, + gPrefs__colourHandler, + 0); + handled=TRUE; + break; + case glass_PGGDESELCOL: + colSelect(d, + e->data.but.m.i, + e->data.but.m.bbits, + msgs_lookup("prSGDCOL"), + FALSE, + gPrefs__colourHandler, + 0); + handled=TRUE; + break; + } + break; + } + break; + case glass_PMSELECTION: + switch (e->e) + { + case wimp_EBUT: + switch (e->data.but.m.i) + { + case glass_PSBCOLOUR: + colSelect(d, + e->data.but.m.i, + e->data.but.m.bbits, + msgs_lookup("prSBCOL"), + FALSE, + gPrefs__colourHandler, + 0); + handled=TRUE; + break; + case glass_PSHCOLOUR: + colSelect(d, + e->data.but.m.i, + e->data.but.m.bbits, + msgs_lookup("prSHCOL"), + FALSE, + gPrefs__colourHandler, + 0); + handled=TRUE; + break; + case glass_PSSCOLOUR: + colSelect(d, + e->data.but.m.i, + e->data.but.m.bbits, + msgs_lookup("prSSCOL"), + FALSE, + gPrefs__colourHandler, + 0); + handled=TRUE; + break; + } + break; + } + break; + } + return (handled); +} + +/*----- External routines -------------------------------------------------*/ + +/* + * void gPrefs_init(void) + * + * Use + * Reads preferences file and initialises things accordingly + */ + +void gPrefs_init(void) +{ + prefs_preferences(gPrefs__prefs); + prefs_read(); + blink_init(); + blinkCursor(gPrefs__current.mBlink); +} + +/* + * gPrefs_prefs *gPrefs_current(void) + * + * Use + * Returns the current preferences settings. + * + * Returns + * A pointer to the structure as defined above. + */ + +gPrefs_prefs *gPrefs_current(void) +{ + return (&gPrefs__current); +} + +/* + * int gPrefs_autoTiming(void) + * + * Use + * Returns the current autosave time in centiseconds, or 0 for no timed + * autosave. + */ + +int gPrefs_autoTiming(void) +{ + static int mult[]={0,360000,6000,100}; + return (gPrefs__current.aTime*mult[gPrefs__current.aUnit]); +} + +/* + * void gPrefs_edit(void) + * + * Use + * Opens the preferences dialogue box to allow editing of preferences. + */ + +void gPrefs_edit(void) +{ + if (gPrefs__dbox) + { + dbox_display(gPrefs__dbox,dbox_STATIC_LASTPOS); + pane_front(gPrefs__pane); + } + else + { + if (gPrefs__dbox=dbox_create("preferences"),!gPrefs__dbox) + return; + else if (gPrefs__pane=pane_create(dbox_syshandle(gPrefs__dbox)), + !gPrefs__pane) + { + dbox_delete(gPrefs__dbox); + gPrefs__dbox=0; + return; + } + gPrefs__new=gPrefs__current; + dbox_eventHandler(gPrefs__dbox,gPrefs__dboxHandler,0); + dbox_rawEventHandler(gPrefs__dbox,gPrefs__dboxRaw,0); + dbox_display(gPrefs__dbox,dbox_STATIC_LASTPOS); + gPrefs__setPanel(glass_PMAUTOSAVE); + } +} diff --git a/StraySrc/Glass/!Glass/c/gSprite b/StraySrc/Glass/!Glass/c/gSprite new file mode 100644 index 0000000..29c31e5 --- /dev/null +++ b/StraySrc/Glass/!Glass/c/gSprite @@ -0,0 +1,1786 @@ +/* + * gSprite.c + * + * Handling of template file sprite windows and areas + * + * © 1994-1998 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Glass. + * + * Glass is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Glass is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Glass. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Header files ------------------------------------------------------*/ + +/* + * ANSI standard headers + */ + +#include +#include + +/* + * Steel headers + */ + +#define _STDAPP +#define _XFER +#define _LOWLVL +#include "steel/Steel.h" + +#include "steel/viewer.h" +#include "steel/flex.h" +#include "steel/akbd.h" +#include "steel/bbc.h" +#include "steel/choices.h" +#include "steel/colourtran.h" + +/* + * Glass headers + */ + +#include "gStruct.h" +#include "gMenus.h" +#include "gIcons.h" + +#include "glass.h" +#include "intMsgs.h" +#include "gSprite.h" +#include "gPrefs.h" +#include "indir.h" +#include "window.h" +#include "tfile.h" + +/*----- Macros ------------------------------------------------------------*/ + +#define gSprite__FILEHEIGHT 872 /* Height to open first sprite window */ +#define gSprite__FILEX 220 /* x position of sprite windows */ +#define gSprite__FILETOP 920 /* Height after files wrap around */ +#define gSprite__CHUNK 2048 /* Size in bytes to allocate areas by */ +#define gSprite__WINDHEIGHT 852 /* Height for individual sprite window */ +#define gSprite__WINDX 240 /* x position of individual sprite window */ +#define gSprite__WINDTOP 900 /* Height after wrap around */ +#define gSprite__WINDMINX 340 /* Minimum width of a sprite window */ +#define gSprite__WINDMINY 150 /* Minimum height of a sprite window */ +#define gSprite__BOXX 200 /* Size of the box for sprite display (x) */ +#define gSprite__BOXY 148 /* Size of the box for sprite display (y) */ + +/*----- Type definitions --------------------------------------------------*/ + +typedef struct +{ + glass_tfile *t; /* Template file owner */ + int serial; /* Order the icons were created in */ + char name[15]; /* Name of the sprite */ + viewer_icon i; /* My viewer icon */ + wimp_w w; /* My window handle */ +} +gSprite__data; + +/*----- Static variables --------------------------------------------------*/ + +static int gSprite__fileHeight=gSprite__FILEHEIGHT; + /* Height to open next sprite window */ +static int gSprite__windHeight=gSprite__WINDHEIGHT; + +static int gSprite__size; /* Count up sprite sizes */ +static void **gSprite__flex; /* The flex block for saving selections */ +static sprite_area *gSprite__default; /* Default sprite file */ +static int gSprite__serial; /* Monotonic time counter */ +static glass_tfile *gSprite__selOwner; /* Which window owns selection? */ + +/*----- Support routines --------------------------------------------------*/ + +/* + * BOOL gSprite__getMemory(glass_tfile *t,int size) + * + * Use + * Ensures that the specified quantity of memory is available in the sprite + * area given. If the memory is not there, it is allocated and the pointer + * is placed in the appropriate place. Messages are sent round as + * applicable. + * + * Parameters + * glass_tfile *t == the template file to alllcate memory in + * int size == the quantity of memory required to add to the area + * + * Returns + * TRUE if the operation succeeded, or FALSE for not enough memory available + */ + +static BOOL gSprite__getMemory(glass_tfile *t,int size) +{ + int aligned; + sprite_area *s; + if (t->s->freeoff+sizes->size) /* Check that the memory is there */ + return (TRUE); + aligned=(t->s->freeoff+size+gSprite__CHUNK-1) & ~(gSprite__CHUNK-1); + /* Qunatise by the chunk size */ + if (s=indir_realloc(t->s,aligned),!s) /* Allocate memory required */ + return (FALSE); /* Say we failed if we did */ + s->size=aligned; /* Insert the new sprite area size */ + t->s=s; /* And change the pointers to the new one */ + return (TRUE); +} + +/* + * void gSprite__minimise(glass_tfile *t) + * + * Use + * Attempts to minimise the space taken up by template file t's sprite area + * if wasteful operations took upn too much memory, or sprites have been + * deleted. Ironically, this requires memory... However, failure to + * allocate sufficient memory is ignored. + * + * Parameters + * glass_tfile *t == the template file to minimise + */ + +static void gSprite__minimise(glass_tfile *t) +{ + sprite_area *s; + int aligned=(t->s->freeoff+gSprite__CHUNK-1) & ~(gSprite__CHUNK-1); + /* Get the size the area should be */ + if (t->s->size==aligned) + return; + if (s=indir_realloc(t->s,aligned),!s) + return; + s->size=aligned; + t->s=s; +} + +/* + * int gSprite__compare(void *a,void *b) + * + * Use + * Compares creation times of two icons + * + * Parameters + * both pointers to data attached to icons + */ + +static int gSprite__compare(void *a,void *b) +{ + gSprite__data *x=a; + gSprite__data *y=b; + return (x->serial-y->serial); +} + +/* + * void gSprite__gainSelection(glass_tfile *t) + * + * Use + * Hands the current sprite selection and the input focus to the specified + * template file sprite viewer. + * + * Note that the selection model here is more complex than it is in window, + * since the focus tfile may not coincide with the selection owner (since + * menu clicks move the selection owner, but not the focus). + * + * Parameters + * glass_tfile *t == the sprite viewer to which we give the selection + */ + +static void gSprite__gainSelection(glass_tfile *t) +{ + wimp_caretstr c; + if (t!=gSprite__selOwner) + { + if (gSprite__selOwner) + viewer_selectAll(gSprite__selOwner->vs,FALSE); + gSprite__selOwner=t; + } + if (t) + { + c.w=viewer_syshandle(t->vs); + c.i=-1; + c.x=-250; + c.y=0; + c.index=-1; + c.height=0x02000000; + wimpt_noerr(wimp_set_caret_pos(&c)); + } +} + +/* + * void gSprite__closeWindows(void *handle) + * + * Use + * Destroys any windows open when the template file dies + * + * Parameters + * void *handle == pointer to window data + */ + +static void gSprite__closeWindows(void *handle) +{ + gSprite__data *d=handle; + if (d->w) + { + win_register_event_handler(d->w,0,0); + wimpt_noerr(wimp_delete_wind(d->w)); + win_activedec(); + } + mem_free(d); +} + +/* + * void gSprite__sizes(viewer_icon i,void *handle) + * + * Use + * Adds the size of the given sprite to the total in gSprite__size. + * + * Parameters + * viewer_icon i == the icon number of the sprite (ignored) + * void *handle == pointer to sprite data + */ + +static void gSprite__sizes(viewer_icon i,void *handle) +{ + sprite_id sid; + sprite_header *hdr; + gSprite__data *d=handle; + unused(i); + sid.s.name=d->name; + sid.tag=0; + wimpt_noerr(sprite_select_rp(d->t->s,&sid,(sprite_ptr *)&hdr)); + gSprite__size+=hdr->next; +} + +/* + * char *gSprite__lower(char *s) + * + * Use + * Translates the string given to lower case + * + * Parameters + * char *s == the string to convert + * + * Returns + * A pointer to the string + */ + +static char *gSprite__lower(char *s) +{ + char *p=s; + while (*p) + { + *p=tolower(*p); + p++; + } + return (s); +} + +/* + * BOOL gSprite__saveArea(void *handle,char *filename) + * + * Use + * Saves a sprite area to disk + * + * Parameters + * char *filename == the filename to save to + * void *handle == pointer to owning template file + * + * Returns + * TRUE for success + */ + +static BOOL gSprite__saveArea(char *filename,void *handle) +{ + glass_tfile *t=handle; + if (gPrefs_current()->cSave && + saveas_file_is_safe() && + res_fileExists(filename)) + { + if (!warning(msgs_lookup("spSOFP"),msgs_lookup("spSOF"),filename)) + return (FALSE); + } + if (utils_complain(sprite_area_save(t->s,filename),msgs_lookup("spESS"))) + return (FALSE); + else + return (TRUE); +} + +/* + * BOOL gSprite__sendArea(void *handle,int *maxbuf) + * + * Use + * Sends a sprite area via RAM transfer + * + * Parameters + * void *handle == pointer to owning template file + * int *maxbuf == pointer to buffer size of other application + */ + +static BOOL gSprite__sendArea(void *handle,int *maxbuf) +{ + glass_tfile *t=handle; + return (xfersend_sendBlock(&t->s->number,t->s->freeoff-4,maxbuf)); +} + +/* + * void gSprite__addToSelSave(viewer_icon i,void *handle) + * + * Use + * Adds the given sprite to the sprite area held in gSprite__flex + * + * Parameters + * viewer_icon i == the icon number of the sprite to add (ignored) + * void *handle == pointer to sprite data + */ + +static void gSprite__addToSelSave(viewer_icon i,void *handle) +{ + gSprite__data *d=handle; + sprite_header *hdr; + sprite_id sid; + void *p=charptr(*gSprite__flex,0)+ + _ptr(sprite_area,*gSprite__flex,0)->freeoff; + unused(i); + sid.s.name=d->name; + sid.tag=0; + wimpt_noerr(sprite_select_rp(d->t->s,&sid,(sprite_ptr *)&hdr)); + memcpy(p,hdr,hdr->next); + _ptr(sprite_area,*gSprite__flex,0)->freeoff+=hdr->next; +} + +/* + * BOOL gSprite__setupSelSave(glass_tfile *t,void **p) + * + * Use + * Sets up a sprite area to save in a flex block anchored on p. The flex + * block is allocaed here. The caller must free the block itself. + * + * Parameters + * glass_tfile *t == the template file owning the selection + * void **p == pointer to a flex anchor + * + * Returns + * TRUE if successful + */ + +static BOOL gSprite__setupSelSave(glass_tfile *t,void **p) +{ + if (!flex_alloc(p,gSprite__size+16)) + { + werr(FALSE,msgs_lookup("spNEMSLSV")); + return (FALSE); + } + gSprite__flex=p; + _ptr(sprite_area,*p,0)->size=gSprite__size+16; + _ptr(sprite_area,*p,0)->number=viewer_selected(t->vs); + _ptr(sprite_area,*p,0)->freeoff=16; + _ptr(sprite_area,*p,0)->sproff=16; + viewer_doForIcons(t->vs,TRUE,gSprite__addToSelSave); + return (TRUE); +} + +/* + * BOOL gSprite__saveSelection(char *filename,void *handle) + * + * Use + * Saves a selection of sprite to a file + * + * Parameters + * char *filename == the file to save to + * void *handle == pointer to the owning template file + * + * Returns + * TRUE for success + */ + +static BOOL gSprite__saveSelection(char *filename,void *handle) +{ + glass_tfile *t=handle; + void *p; + if (gPrefs_current()->cSave && + saveas_file_is_safe() && + res_fileExists(filename)) + { + if (!warning(msgs_lookup("spSOFP"),msgs_lookup("spSOF"),filename)) + return (FALSE); + } + if (!gSprite__setupSelSave(t,&p)) + return (FALSE); + if (utils_complain(sprite_area_save((sprite_area *)p,filename), + msgs_lookup("spESS"))) + { + flex_free(&p); + return (FALSE); + } + else + { + flex_free(&p); + return (TRUE); + } +} + +/* + * BOOL gSprite__sendSelection(void *handle,int *maxbuf) + * + * Use + * Sends a selection of sprite to another application in memory + * + * Parameters + * void *handle == pointer to the owning template file + * int *maxbuf == the size of the receiving application's buffer + * + * Returns + * TRUE for success + */ + +static BOOL gSprite__sendSelection(void *handle,int *maxbuf) +{ + glass_tfile *t=handle; + void *p; + if (!gSprite__setupSelSave(t,&p)) + return (FALSE); + if (!xfersend_sendBlock((char *)p+4,gSprite__size+12,maxbuf)) + { + flex_free(&p); + return (FALSE); + } + else + { + flex_free(&p); + return (TRUE); + } +} + +/* + * BOOL gSprite__saveGrabbed(void *handle,char *filename) + * + * Use + * Saves a sprite area to disk + * + * Parameters + * char *filename == the filename to save to + * void *handle == pointer-to-pointer to sprite area + * + * Returns + * TRUE for success + */ + +static BOOL gSprite__saveGrabbed(char *filename,void *handle) +{ + sprite_area **s=handle; + if (gPrefs_current()->cSave && + saveas_file_is_safe() && + res_fileExists(filename)) + { + if (!warning(msgs_lookup("spSOFP"),msgs_lookup("spSOF"),filename)) + return (FALSE); + } + if (utils_complain(sprite_area_save(*s,filename),msgs_lookup("spESS"))) + return (FALSE); + else + return (TRUE); +} + +/* + * BOOL gSprite__sendGrabbed(void *handle,int *maxbuf) + * + * Use + * Sends a sprite area via RAM transfer + * + * Parameters + * void *handle == pointer-to-pointer to sprite area + * int *maxbuf == pointer to buffer size of other application + */ + +static BOOL gSprite__sendGrabbed(void *handle,int *maxbuf) +{ + sprite_area **s=handle; + return (xfersend_sendBlock(&(*s)->number,(*s)->freeoff-4,maxbuf)); +} + +/* + * void gSprite__grab(wimp_mousestr *m,void *handle) + * + * Use + * Grabs a sprite area from a given window + * + * Parameters + * wimp_mousestr *m == info about the window/icon the pointer is over + * void *handle == a pointer (ignored) + */ + +static void gSprite__grab(wimp_mousestr *m,void *handle) +{ + wimp_winfo *w; + os_regset r; + void *p; + void *q; + sprite_area s; + wimp_msgstr msg; + unused(handle); + switch (m->w) + { + case -1: + case -2: + werr(FALSE,msgs_lookup("spCGS")); + return; + } + if (wimpt_getVersion()>=300) /* RISC OS 3 allows 'safe' GetWindowInfos */ + w=mem_alloc(sizeof(wimp_winfo)); + else + w=mem_alloc(sizeof(wimp_winfo)+200*sizeof(wimp_icon)); + if (!w) + { + werr(FALSE,msgs_lookup("spNEMGS")); + return; + } + w->w=m->w; + r.r[1]=(int)w; + if (wimpt_getVersion()>=300) + r.r[1]+=1; /* RO3 - only window header, not icons */ + wimpt_noerr(os_swix(XWimp_GetWindowInfo,&r)); /* Get the information */ + q=w->info.spritearea; /* Get the window's sprite area */ + mem_free(w); /* No longer needed */ + if ((int)q<0x8000) + { + note(msgs_lookup("spNAUSA")); + return; + } + else if ((int)q>=0x01800000) + { + saveas(msgs_lookup("spSVSPR"), + msgs_lookup("spGRB"), + 0xff9, + s.freeoff, + gSprite__saveGrabbed, + gSprite__sendGrabbed, + 0, + &q); + } + else + { + msg.hdr.size=20; + msg.hdr.your_ref=0; + r.r[0]=19; + r.r[1]=(int)&msg; + r.r[2]=m->w; + r.r[3]=m->i; + wimpt_noerr(os_swix(XWimp_SendMessage,&r)); /* Find the task's handle */ + wimpt_noerr(wimp_transferblock(r.r[2], + q, + wimpt_task(), + (char *)&s, + sizeof(sprite_area))); + if (!flex_alloc(&p,s.freeoff)) + { + werr(FALSE,msgs_lookup("spNEMGS")); + return; + } + wimpt_noerr(wimp_transferblock(r.r[2],q,wimpt_task(),p,s.freeoff)); + saveas(msgs_lookup("spSVSPR"), + msgs_lookup("spGRB"), + 0xff9, + s.freeoff, + gSprite__saveGrabbed, + gSprite__sendGrabbed, + 0, + &p); + flex_free(&p); + } +} + +/* + * BOOL gSprite__copy(char *buff,void *handle) + * + * Use + * Copies a sprite, ensuring that the name hasn't been duplicated etc. + * + * Parameters + * char *buff == pointer to the new name + * void *handle == pointer to data for the sprite + * + * Returns + * TRUE if everything went OK + */ + +static BOOL gSprite__copy(char *buff,void *handle) +{ + gSprite__data *d=handle; + gSprite__data *new; + sprite_id sid; + sprite_header *hdr; + viewer_icon i=viewer_findIcon(d->t->vs,buff); + sid.s.name=d->name; + sid.tag=0; + gSprite__lower(buff); + if (i==viewer_NOICON || i==d->i) + { + mem_useUser(indir_alloc,indir_free); + if (new=mem_alloc(sizeof(gSprite__data)),!new) + { + werr(FALSE,msgs_lookup("spNEMCPY")); + mem_useMalloc(); + return (FALSE); + } + wimpt_noerr(sprite_select_rp(d->t->s,&sid,(sprite_ptr *)&hdr)); + if (!gSprite__getMemory(d->t,hdr->next+50)) + { + mem_free(new); + mem_useMalloc(); + werr(FALSE,msgs_lookup("spNEMCPY")); + return (FALSE); + } + wimpt_noerr(sprite_copy(d->t->s,&sid,buff)); + gSprite__minimise(d->t); + strcpy(new->name,buff); + new->serial=gSprite__serial++; + new->i=viewer_addIcon(d->t->vs,buff,buff,TRUE,new); + viewer_setFiletype(new->i,0xff9); + mem_useMalloc(); + new->w=0; + new->t=d->t; + if (!dbox_wasAdjustClick()) + viewer_clickSelect(d->t->vs,viewer_NOICON,wimp_BMID); + intMsgs_send(glass_SPRITECHANGE,d->t); + return (TRUE); + } + note(msgs_lookup("spNAE"), + viewer_textOfIcon(i)); + return (FALSE); + +} + +/* + * BOOL gSprite__rename(char *buff,void *handle) + * + * Use + * Renames a sprite, ensuring that the name hasn't been duplicated etc. + * + * Parameters + * char *buff == pointer to the new name + * void *handle == pointer to data for the sprite + * + * Returns + * TRUE if everything went OK + */ + +static BOOL gSprite__rename(char *buff,void *handle) +{ + gSprite__data *d=handle; + sprite_id sid; + viewer_icon i=viewer_findIcon(d->t->vs,buff); + sid.s.name=d->name; + sid.tag=0; + gSprite__lower(buff); + if (i==viewer_NOICON || i==d->i) + { + mem_useUser(indir_alloc,indir_free); + i=viewer_addIcon(d->t->vs,buff,buff,TRUE,d); + mem_useMalloc(); + if (!i) + return (FALSE); + viewer_setFiletype(i,0xff9); + wimpt_noerr(sprite_rename(d->t->s,&sid,buff)); + viewer_removeIcon(d->i); + d->i=i; + strcpy(d->name,buff); + intMsgs_send(glass_SPRITECHANGE,d->t); + if (!dbox_wasAdjustClick()) + viewer_clickSelect(d->t->vs,viewer_NOICON,wimp_BMID); + event_clear_current_menu(); + return (TRUE); + } + note(msgs_lookup("spNAE"), + viewer_textOfIcon(i)); + return (FALSE); +} + +/* + * void gSprite__delSprites(viewer_icon i,void *handle) + * + * Use + * Deletes the given sprite. + * + * Parameters + * viewer_icon i == the icon handle that it is + * void *handle == the sprite data pointer + */ + +static void gSprite__delSprites(viewer_icon i,void *handle) +{ + sprite_id sid; + gSprite__data *d=handle; + unused(i); + sid.s.name=d->name; + sid.tag=0; + wimpt_noerr(sprite_delete(d->t->s,&sid)); + viewer_removeIcon(d->i); + if (d->w) + { + win_register_event_handler(d->w,0,0); + win_activedec(); + wimpt_noerr(wimp_delete_wind(d->w)); + } + mem_free(d); +} + +/* + * void gSprite__createWindow(viewer_icon i,void *handle) + * + * Use + * Opens a window to display a given sprite. + * + * Parameters + * viewer_icon i == the icon representing the sprite + * void *handle == the information to add to the window + */ + +static void gSprite__windowHandler(wimp_eventstr *e,void *handle); + +static void gSprite__createWindow(viewer_icon i,void *handle) +{ + wimp_wstate s; + gSprite__data *d=handle; + wimp_wind w= + { + 0,0,0,0, 0,0, -1, + wimp_WMOVEABLE | + wimp_WNEW | + wimp_WTITLE | + wimp_WTOGGLE | + wimp_WVSCR | + wimp_WHSCR | + wimp_WSIZE | + wimp_WBACK | + wimp_WQUIT, + 7,2,7,1,3,1,12,0, + 0,0,gSprite__WINDMINX,gSprite__WINDMINY, + wimp_ITEXT | wimp_IHCENTRE, + 0, + 0, + 0x00010001, + "", + 0, + }; + sprite_id sid; + sprite_info info; + unused(i); + if (!d->w) + { + strcpy(w.title.text,d->name); + sid.s.name=d->name; + sid.tag=0; + wimpt_noerr(sprite_readsize(d->t->s,&sid,&info)); + info.width <<= bbc_modevar(info.mode,bbc_XEigFactor); + info.height <<= bbc_modevar(info.mode,bbc_YEigFactor); + if (info.width>gSprite__WINDMINX) + w.ex.x1=info.width; + if (info.height>gSprite__WINDMINY) + w.ex.y1=info.height; + w.box.x0=gSprite__WINDX; + w.box.x1=gSprite__WINDX+w.ex.x1; + w.box.y1=gSprite__windHeight; + w.box.y0=gSprite__windHeight-w.ex.y1; + if (w.ex.x1>500) + w.box.x1=gSprite__WINDX+500; + if (w.ex.y1>500) + w.box.y0=gSprite__windHeight-500; + if (wimpt_complain(wimp_create_wind(&w,&d->w))) + return; + win_register_event_handler(d->w,gSprite__windowHandler,d); + win_activeinc(); + gSprite__windHeight-=48; + if (gSprite__windHeight<612) + gSprite__windHeight=gSprite__WINDTOP; + } + wimpt_noerr(wimp_get_wind_state(d->w,&s)); + wimpt_noerr(wimp_open_wind(&s.o)); +} + +/*----- Event handlers ----------------------------------------------------*/ + +/* + * BOOL tfile__dragUnknowns(wimp_eventstr *e,void *handle) + * + * Use + * Handles unknown events during the period of dragging viewer icons + * around. It will respond to the following drags: + * + * A drag to a blank area of icon bar will open the windows. + * + * Otherwise, a selection save will be started, and the windows packaged + * off to another application. + * + * Parameters + * wimp_eventstr *e == the event to look at + * void *handle == the template file whose sprite area we're dragging from + * + * Returns + * TRUE if the drag has been processed + */ + +static BOOL gSprite__dragUnknowns(wimp_eventstr *e,void *handle) +{ + glass_tfile *t=handle; + wimp_mousestr m; + BOOL handled=FALSE; + switch (e->e) + { + case wimp_EUSERDRAG: + handled=TRUE; + win_remove_unknown_event_processor(gSprite__dragUnknowns,t); + wimpt_noerr(wimp_get_point_info(&m)); + if (m.w==viewer_syshandle(t->vs)) + break; + if (m.w==-2 && m.i==-1) + viewer_doForIcons(t->vs,TRUE,gSprite__createWindow); + else + { + gSprite__size=0; + viewer_doForIcons(t->vs,TRUE,gSprite__sizes); + wimpt_fake_event(e); /* Fool xfersend to send data */ + xfersend(0xFF9, + msgs_lookup("spSEL"), + gSprite__size+16, + gSprite__saveSelection, + gSprite__sendSelection, + 0, + e, + t); + } + viewer_selectAll(t->vs,FALSE); + break; + } + return (handled); +} + +/* + * void gSprite__viewerRedraw(viewer_icon i, + * wimp_redrawstr *r, + * wimp_box *box, + * char *text, + * char *sprite, + * BOOL selected, + * void *handle) + * + * Use + * Redraws an icon in the sprite viewer. + * + * Parameters + * viewer_icon i == the icon I'm redrawing + * wimp_redrawstr *r == the redraw structure + * wimp_box *box == the box to fit it in + * char *text == the text to draw + * char *sprite == the sprite to draw (ignored) + * BOOL selected == whether the icon is selected + * void *handle == pointer to the template file + */ + +static void gSprite__viewerRedraw(viewer_icon i, + wimp_redrawstr *r, + wimp_box *box, + char *text, + char *sprite, + BOOL selected, + void *handle) +{ + int ox=r->box.x0-r->scx; + int oy=r->box.y1-r->scy; + sprite_id sid; + sprite_header *hdr; + sprite_pixtrans colbuff[256]; /* Colour translation table */ + sprite_factors zoom; /* Zoomage table */ + sprite_info info; /* Info about the sprite */ + glass_tfile *t=handle; + int newy; /* Bodged height of the sprite */ + int xoff,yoff; /* x and y offsets to display sprite */ + wimp_icon spname; /* Virtual icon for sprite name */ + unused(i); + unused(sprite); + + spname.box.x0=box->x0; + spname.box.x1=box->x1; + spname.box.y0=box->y0; + spname.box.y1=box->y0+40; + spname.flags=0x1700010b+(selected<<21); + spname.data.indirecttext.buffer=text; + spname.data.indirecttext.validstring="Sblank"; + wimpt_noerr(wimp_ploticon(&spname)); + + sid.s.name=text; + sid.tag=0; + wimpt_noerr(sprite_select_rp(t->s,&sid,(sprite_ptr *)&hdr)); + sid.s.addr=hdr; + sid.tag=sprite_id_addr; + wimpt_noerr(sprite_readsize(t->s,&sid,&info)); + if (bbc_modevar(info.mode,bbc_NColour)==63) /* 256 colour mode - handle */ + colourtran_select_table(info.mode,0,-1,(wimp_paletteword *)-1,colbuff); + else + wimpt_noerr(wimp_readpixtrans(t->s,&sid,&zoom,colbuff)); + zoom.xmag=zoom.ymag=zoom.xdiv=zoom.ydiv=1; + info.width <<= bbc_modevar(info.mode,bbc_XEigFactor); /* Now OS units */ + info.height <<= bbc_modevar(info.mode,bbc_YEigFactor); + + /* --- Bodge the multipliers to fit the sprite in --- */ + + newy=info.height; + if (info.width>gSprite__BOXX) + { + zoom.xmag*=gSprite__BOXX; + zoom.ymag*=gSprite__BOXX; + zoom.xdiv*=info.width; + zoom.ydiv*=info.width; + newy=(newy*gSprite__BOXX)/info.width+1; + } + + if (newy>gSprite__BOXY) + { + zoom.xmag*=gSprite__BOXY; + zoom.ymag*=gSprite__BOXY; + zoom.xdiv*=newy; + zoom.ydiv*=newy; + } + + info.width=info.width*zoom.xmag/zoom.xdiv; + info.height=info.height*zoom.ymag/zoom.ydiv; + xoff=(gSprite__BOXX-info.width)/2; + yoff=(gSprite__BOXY-info.height)/2+48; + zoom.xmag <<= bbc_modevar(info.mode,bbc_XEigFactor); + zoom.ymag <<= bbc_modevar(info.mode,bbc_YEigFactor); + zoom.xdiv <<= bbc_vduvar(bbc_XEigFactor); + zoom.ydiv <<= bbc_vduvar(bbc_YEigFactor); + + wimpt_noerr(sprite_put_scaled(t->s, + &sid, + 8, + ox+box->x0+xoff, + oy+box->y0+yoff, + &zoom, + colbuff)); +} + +/* + * void gSprite__windowHandler(wimp_eventstr *e,void *handle) + * + * Use + * Handles events for individual sprite windows + * + * Parameters + * wimp_eventstr *e == the event to handle + * void *handle == pointer to data structure + */ + +static void gSprite__windowHandler(wimp_eventstr *e,void *handle) +{ + gSprite__data *d=handle; + wimp_redrawstr r; + int ox,oy; + BOOL more; + sprite_id sid; + sprite_factors zoom; + sprite_pixtrans colbuff[256]; + sprite_header *hdr; + sprite_info info; + + switch (e->e) + { + case wimp_EREDRAW: + r.w=d->w; + wimpt_noerr(wimp_redraw_wind(&r,&more)); + ox=r.box.x0-r.scx; + oy=r.box.y1-r.scy; + while (more) + { + sid.s.name=d->name; + sid.tag=0; + wimpt_noerr(sprite_select_rp(d->t->s,&sid,(sprite_ptr *)&hdr)); + sid.s.addr=hdr; + sid.tag=sprite_id_addr; + wimpt_noerr(sprite_readsize(d->t->s,&sid,&info)); + if (bbc_modevar(info.mode,bbc_NColour)==63) + { + colourtran_select_table(info.mode, + 0, + -1, + (wimp_paletteword *)-1, + colbuff); + } + else + wimpt_noerr(wimp_readpixtrans(d->t->s,&sid,&zoom,colbuff)); + zoom.xmag=zoom.ymag=zoom.xdiv=zoom.ydiv=1; + info.width <<= bbc_modevar(info.mode,bbc_XEigFactor); + info.height <<= bbc_modevar(info.mode,bbc_YEigFactor); + + info.width=info.width*zoom.xmag/zoom.xdiv; + info.height=info.height*zoom.ymag/zoom.ydiv; + zoom.xmag <<= bbc_modevar(info.mode,bbc_XEigFactor); + zoom.ymag <<= bbc_modevar(info.mode,bbc_YEigFactor); + zoom.xdiv <<= bbc_vduvar(bbc_XEigFactor); + zoom.ydiv <<= bbc_vduvar(bbc_YEigFactor); + + wimpt_noerr(sprite_put_scaled(d->t->s,&sid,8,ox,oy,&zoom,colbuff)); + + wimpt_noerr(wimp_get_rectangle(&r,&more)); + } + break; + case wimp_EOPEN: + wimpt_noerr(wimp_open_wind(&e->data.o)); + break; + case wimp_ECLOSE: + win_register_event_handler(d->w,0,0); + win_activedec(); + wimpt_noerr(wimp_delete_wind(d->w)); + d->w=0; + break; + case wimp_ESEND: + case wimp_ESENDWANTACK: + switch (e->data.msg.hdr.action) + { + case wimp_MHELPREQUEST: + help_startHelp(); + help_addLine(msgs_lookup("sphSPDW"),d->name); + help_endHelp(); + break; + } + break; + } +} + +/* + * void gSprite__menuHelp(int hit[],void *handle) + * + * Use + * Responds to help requests for the sprite viewer menu + * + * Parameters + * int hit[] == array of menu selections + * void *handle == pointer to owning template file (unused) + */ + +static void gSprite__menuHelp(int hit[],void *handle) +{ + unused(handle); + help_startHelp(); + help_readFromMenu("spmhSPM",hit); + help_endHelp(); +} + +/* + * void gSprite__menuHandler(int hit[],void *handle) + * + * Use + * Responds to menu selections from the sprite viewer menu + * + * Parameters + * int hit[] == array of menu selections + * void *handle == pointer to owning template file + */ + +static void gSprite__menuHandler(int hit[],void *handle) +{ + glass_tfile *t=handle; + wimp_mousestr m; + char buff[50]; + dbox d; + sprite_id sid; + sprite_info info; + sprite_header *hdr; + switch (hit[0]) + { + case 0: + viewer_clickSelect(t->vs,viewer_NOICON,wimp_BMID); + break; + case glass_SPINFO: + if (d=dbox_create("sprFileInfo"),d) + { + dbox_setfield(d,glass_SAOWNER,"%.%s",t->filename); + dbox_setfield(d, + glass_SASIZE, + "%s", + utils_cvtSize(t->s->freeoff-4)); + dbox_setfield(d,glass_SASPRITES,"%i",t->s->number); + mbox(d,"sphSAINF"); + } + break; + case glass_SPSEL: + switch (hit[1]) + { + case glass_SPSELINFO: + if (viewer_selected(t->vs)==1) + { + if (d=dbox_create("spriteInfo"),d) + { + sid.s.name=((gSprite__data *) + viewer_iconHandle(viewer_firstSelected(t->vs)))->name; + sid.tag=0; + wimpt_noerr(sprite_readsize(t->s,&sid,&info)); + wimpt_noerr(sprite_select_rp(t->s,&sid,(sprite_ptr *)&hdr)); + dbox_setfield(d,glass_SPNAME,"%s",sid.s.name); + dbox_setfield(d,glass_SPMODE,"%i",info.mode); + dbox_setfield(d,glass_SPWIDTH,"%i",info.width); + dbox_setfield(d,glass_SPHEIGHT,"%i",info.height); + dbox_setfield(d, + glass_SPSIZE, + "%s", + utils_cvtSize(hdr->next+16)); + dbox_setfield(d, + glass_SPMASK, + "%s", + msgs_lookup(info.mask ? "yes" : "no")); + dbox_setfield(d, + glass_SPPALETTE, + "%s", + msgs_lookup(hdr->image!=0x2c ? "yes" : "no")); + mbox(d,"sphSPINF"); + } + } + else + { + if (d=dbox_create("sprSelInfo"),d) + { + dbox_setfield(d,glass_SSNUM,"%i",viewer_selected(t->vs)); + gSprite__size=0; + viewer_doForIcons(t->vs,TRUE,gSprite__sizes); + dbox_setfield(d, + glass_SPSIZE, + "%s", + utils_cvtSize(gSprite__size+16)); + mbox(d,"sphSSINF"); + } + } + break; + case glass_SPSELCOPY: + writable + ( + msgs_lookup("spCOPY"), + viewer_textOfIcon(viewer_firstSelected(t->vs)), + buff, + gSprite__copy, + viewer_iconHandle(viewer_firstSelected(t->vs)) + ); + break; + case glass_SPSELRENAME: + writable(msgs_lookup("spREN"), + viewer_textOfIcon(viewer_firstSelected(t->vs)), + buff, + gSprite__rename, + viewer_iconHandle(viewer_firstSelected(t->vs))); + break; + case glass_SPSELSAVE: + gSprite__size=0; + viewer_doForIcons(t->vs,TRUE,gSprite__sizes); + saveas(msgs_lookup("spSVSEL"), + msgs_lookup("spSEL"), + 0xff9, + gSprite__size+16, + gSprite__saveSelection, + gSprite__sendSelection, + 0, + t); + break; + case glass_SPSELDELETE: + viewer_doForIcons(t->vs,TRUE,gSprite__delSprites); + gSprite__minimise(t); + intMsgs_send(glass_SPRITECHANGE,t); + break; + } + break; + case glass_SPSELALL: + viewer_selectAll(t->vs,TRUE); + break; + case glass_SPCLRSEL: + viewer_selectAll(t->vs,FALSE); + break; + case glass_SPSAVE: + saveas(msgs_lookup("spSVSPR"), + "Sprites", + 0xff9, + t->s->freeoff-4, + gSprite__saveArea, + gSprite__sendArea, + 0, + t); + break; + case glass_SPGRAB: + window_grab(gSprite__grab,0); + break; + } + if (wimpt_last_event()->e==wimp_EMENU) + { + wimpt_noerr(wimp_get_point_info(&m)); + if (m.bbits!=wimp_BRIGHT) + viewer_clickSelect(t->vs,viewer_NOICON,wimp_BMID); + } +} + +/* + * menu gSprite__menuMaker(void *handle) + * + * Use + * Creates a menu for the sprite file viewer + * + * Parameters + * void *handle == pointer to owning template file + * + * Returns + * Pointer to the menu it has set up + */ + +static menu gSprite__menuMaker(void *handle) +{ + static menu m; /* The main menu pointer */ + static menu sprsm; /* Submenu for sprite options */ + static char sprName[50]; /* Buffer for sprite name */ + glass_tfile *t=handle; + if (!m) /* Do we have to create the menu? */ + { + m=menu_new("Sprites",msgs_lookup("spM")); + sprsm=menu_new("_",msgs_lookup("spSS")); + menu_submenu(m,glass_SPSEL,sprsm); + menu_redirectItem(m,glass_SPSEL,sprName,50,0); + } + menu_minWidth(m,0); + viewer_setupMenu(t->vs, + msgs_lookup("spSPR"), + m, + glass_SPSEL, + sprName); + switch (viewer_selected(t->vs)) + { + case 0: + menu_setflags(m,glass_SPCLRSEL,FALSE,TRUE); + menu_setflags(m,glass_SPSELALL,FALSE,!viewer_icons(t->vs)); + menu_settitle(sprsm,msgs_lookup("spSPR")); + menu_setflags(sprsm,glass_SPSELINFO,FALSE,TRUE); + menu_setflags(sprsm,glass_SPSELCOPY,FALSE,TRUE); + menu_setflags(sprsm,glass_SPSELRENAME,FALSE,TRUE); + menu_setflags(sprsm,glass_SPSELSAVE,FALSE,TRUE); + menu_setflags(sprsm,glass_SPSELDELETE,FALSE,TRUE); + break; + case 1: + menu_setflags(m,glass_SPCLRSEL,FALSE,FALSE); + menu_setflags(m,glass_SPSELALL,FALSE,FALSE); + menu_settitle(sprsm,msgs_lookup("spSPR")); + menu_setflags(sprsm,glass_SPSELINFO,FALSE,FALSE); + menu_setflags(sprsm,glass_SPSELCOPY,FALSE,FALSE); + menu_setflags(sprsm,glass_SPSELRENAME,FALSE,FALSE); + menu_setflags(sprsm,glass_SPSELSAVE,FALSE,FALSE); + menu_setflags(sprsm,glass_SPSELDELETE,FALSE,FALSE); + break; + default: + menu_setflags(m,glass_SPCLRSEL,FALSE,FALSE); + menu_setflags(m,glass_SPSELALL,FALSE,FALSE); + menu_settitle(sprsm,msgs_lookup("spSEL")); + menu_setflags(sprsm,glass_SPSELINFO,FALSE,FALSE); + menu_setflags(sprsm,glass_SPSELCOPY,FALSE,TRUE); + menu_setflags(sprsm,glass_SPSELRENAME,FALSE,TRUE); + menu_setflags(sprsm,glass_SPSELSAVE,FALSE,FALSE); + menu_setflags(sprsm,glass_SPSELDELETE,FALSE,FALSE); + break; + } + menu_setflags(m,glass_SPGRAB,FALSE,window_grabbing()); + return (m); +} + +/* + * void gSprite__simMenu(glass_tfile *t,int hit1,int hit2) + * + * Use + * Simulates a menu hit on a template file window + * + * Parameters + * glass_tfile *t == the template file the event is destined for + * int hit1 == the main menu entry number + * int hit2 == the submenu entry number + */ + +static void gSprite__simMenu(glass_tfile *t,int hit1,int hit2) +{ + wimp_menustr *m=menu_syshandle(gSprite__menuMaker(t)); + wimp_menuitem *i=(wimp_menuitem *)(m+1)+(hit1-1); + int mnu[3]; + mnu[0]=hit1; + mnu[1]=hit2; + mnu[2]=0; + + if ((int)i->submenu==-1 || hit2==0) + { + if (i->iconflags & wimp_INOSELECT) + { + bbc_vdu(7); + return; + } + else + mnu[1]=0; + } + else + { + i=(wimp_menuitem *)(i->submenu+1)+(hit2-1); + if (i->iconflags & wimp_INOSELECT) + { + bbc_vdu(7); + return; + } + } + gSprite__menuHandler(mnu,t); +} + +/* + * BOOL gSprite__viewerRaw(viewer v,wimp_eventstr *e,void *handle) + * + * Use + * Handles raw events destined for the viewer window, and picks out + * interesting ones. + * + * Parameters + * viewer v == the viewer its going for + * wimp_eventstr *e == what it is + * void *handle == pointer to owning template file + * + * Returns + * TRUE if the event was worth waiting for + */ + +static BOOL gSprite__viewerRaw(viewer v,wimp_eventstr *e,void *handle) +{ + glass_tfile *t=handle; + char *filename; + int filetype; + int estsize; + void *p; + BOOL handled=FALSE; + unused(v); + switch (e->e) + { + case wimp_EKEY: + switch (e->data.key.chcode) + { + case akbd_Fn+1+akbd_Sh: /* sF1 */ + gSprite__simMenu(t,glass_SPINFO,0); + handled=TRUE; + break; + case 1: /* ^A */ + gSprite__simMenu(t,glass_SPSELALL,0); + handled=TRUE; + break; + case 26: /* ^Z */ + gSprite__simMenu(t,glass_SPCLRSEL,0); + handled=TRUE; + break; + case akbd_Fn+3: /* F3 */ + gSprite__simMenu(t,glass_SPSAVE,0); + handled=TRUE; + break; + case 7: /* ^G */ + gSprite__simMenu(t,glass_SPGRAB,0); + handled=TRUE; + break; + + case akbd_Fn+1+akbd_Ctl:/* ^F1 */ + gSprite__simMenu(t,glass_SPSEL,glass_SPSELINFO); + handled=TRUE; + break; + case 3: /* ^C */ + gSprite__simMenu(t,glass_SPSEL,glass_SPSELCOPY); + handled=TRUE; + break; + case 18: /* ^R */ + gSprite__simMenu(t,glass_SPSEL,glass_SPSELRENAME); + handled=TRUE; + break; + case akbd_Fn+3+akbd_Sh: /* sF3 */ + gSprite__simMenu(t,glass_SPSEL,glass_SPSELSAVE); + handled=TRUE; + break; + case 24: /* ^X */ + gSprite__simMenu(t,glass_SPSEL,glass_SPSELDELETE); + handled=TRUE; + break; + + case akbd_Fn+2+akbd_Ctl:/* ^F2 */ + viewer_hide(v); + handled=TRUE; + break; + } + break; + + case wimp_ESEND: + case wimp_ESENDWANTACK: + switch (e->data.msg.hdr.action) + { + case wimp_MDATASAVE: + filetype=xferrecv_checkimport(&estsize); + switch (filetype) + { + case 0xff9: + if (xferrecv_returnImportedBlock(&p)!=-1) + { + gSprite_mergeFromMemory(t,&p); + flex_free(&p); + } + break; + } + handled=TRUE; + break; + case wimp_MDATALOAD: + filetype=xferrecv_checkinsert(&filename); + switch (filetype) + { + case 0xff9: + gSprite_mergeFromFile(t,filename); + xferrecv_insertfileok(); + break; + } + handled=TRUE; + break; + } + break; + } + return (handled); +} + +/* + * void gSprite__viewerHandler(viewer v, + * viewer_icon i, + * wimp_bbits b, + * void *vhandle, + * void *ihandle) + * + * Use + * Handles events in a sprite viewer + * + * Parameters + * viewer v == the handle for the viewer that got the event + * viewer_icon i == the icon handle that was 'evented', or an event code + * wimp_bbits b == the mouse button status, if relevant + * void *vhandle == pointer to the owning template file + * void *ihandle == an unused pointer + */ + +static void gSprite__viewerHandler(viewer v, + viewer_icon i, + wimp_bbits b, + void *vhandle, + void *ihandle) +{ + glass_tfile *t=vhandle; + unused(ihandle); + switch ((int)i) + { + case (int)viewer_CLOSE: + viewer_hide(v); + break; + case (int)viewer_HELP: + help_startHelp(); + help_addLine(msgs_lookup("sphMVW")); + help_endHelp(); + break; + default: + if (b!=wimp_BMID) + { + gSprite__gainSelection(t); + viewer_clickSelect(v,i,b); + } + switch (b) + { + case wimp_BMID: + if (t==gSprite__selOwner || + !gSprite__selOwner || + !viewer_selected(gSprite__selOwner->vs)) + { + gSprite__selOwner=t; + viewer_clickSelect(v,i,b); + } + menu_make(gSprite__menuMaker, + gSprite__menuHandler, + gSprite__menuHelp, + t); + break; + case wimp_BLEFT: + case wimp_BRIGHT: + if (i!=viewer_NOICON) + { + gSprite__createWindow(i,viewer_iconHandle(i)); + viewer_selectIcon(i,FALSE); + } + break; + case wimp_BDRAGLEFT: + case wimp_BDRAGRIGHT: + if (i!=viewer_NOICON) + { + tfile_dragSelected(i,b,"spackage"); + win_add_unknown_event_processor(gSprite__dragUnknowns,t); + } + break; + } + break; + } +} + +/*----- External routines -------------------------------------------------*/ + +/* + * void gSprite_kill(glass_tfile *t) + * + * Use + * Closes the sprite viewer and frees the sprite area + * + * Parameters + * glass_tfile *t == the template file that's closing + */ + +void gSprite_kill(glass_tfile *t) +{ + if (t->vs) + viewer_delete(t->vs,gSprite__closeWindows); + indir_free(t->s); +} + +/* + * void gSprite_display(glass_tfile *t) + * + * Use + * Displays the sprite viewer for the specified template file. + * + * glass_tfile *t == the template file whose sprites we want to see + */ + +void gSprite_display(glass_tfile *t) +{ + viewer_selectAll(t->vs,FALSE); + viewer_display(t->vs); +} + +/* + * void gSprite_mergeFromMemory(glass_tfile *t,void **p) + * + * Use + * Merges a sprite file which is stored in memory. This is so I can do + * in-memory transfer of sprites. + * + * Parameters + * glass_tfile *t == the template file owner of the sprite area + * void **p == the flex block stroing the sprite file + */ + +void gSprite_mergeFromMemory(glass_tfile *t,void **p) +{ + int sprites=_ptr(sprite_area,*p,-4)->number; + int i; + int h=_ptr(sprite_area,*p,-4)->sproff-4; + int length; + sprite_id sid; + viewer_icon icn; + char buff[15]; + gSprite__data *d; + if (!gSprite__getMemory(t,_ptr(sprite_area,*p,-4)->freeoff)) + { + werr(FALSE,msgs_lookup("spNEMM")); + return; + } + for (i=1;i<=sprites;i++) + { + length=_ptr(sprite_header,*p,h)->next; + buff[12]=0; + memcpy(buff,_ptr(sprite_header,*p,h)->name,12); + sid.s.name=buff; + sid.tag=0; + + /* --- Slight problem --- * + * + * viewer is deadly cunning, because it uses a nice case-insensitive + * string-compare for all this, which handles annoying things like + * accents. Unfortunately, the RISC OS sprite system isn't as cunning, + * and so, when viewer says that `Élite' and `élite' are the same, + * RISC OS moans that it can't find the sprite when you delete it. + * + * Hence we place the sprite deletion in there as a check that it really + * does exist in there. Note that it only deletes the sprite if it + * found the icon. + */ + + if (icn=viewer_findIcon(t->vs,sid.s.name), + icn && !sprite_delete(t->s,&sid)) + { + d=viewer_iconHandle(icn); + if (d->w) + { + win_register_event_handler(d->w,0,0); + wimpt_noerr(wimp_delete_wind(d->w)); + d->w=0; + } + mem_free(d); + viewer_removeIcon(icn); + } + mem_useUser(indir_alloc,indir_free); + if (d=mem_alloc(sizeof(gSprite__data)),!d) + { + mem_useMalloc(); + werr(FALSE,msgs_lookup("spNEMM")); + return; + } + strcpy(d->name,sid.s.name); + d->t=t; + d->w=0; + d->serial=gSprite__serial++; + if (d->i=viewer_addIcon(t->vs,sid.s.name,sid.s.name,TRUE,d),!d->i) + { + mem_useMalloc(); + mem_free(d); + return; + } + mem_useMalloc(); + viewer_setFiletype(d->i,0xff9); + memcpy(((char *)t->s)+t->s->freeoff,_ptr(sprite_header,*p,h),length); + t->s->freeoff+=length; + t->s->number++; + h+=length; + } + gSprite__minimise(t); + intMsgs_send(glass_SPRITECHANGE,t); +} + +/* + * void gSprite_mergeFromFile(glass_tfile *t,char *name) + * + * Use + * Merges the given file into the sprite area specified. + * + * Parameters + * glass_tfile *t == the template file that we're going to load for + * char *name == the name of the file to load + */ + +void gSprite_mergeFromFile(glass_tfile *t,char *name) +{ + os_filestr f; /* Going to make some OS_File calls */ + void *p; /* p will point to the file in memory */ + f.action=17; /* Read catalogue information for file */ + f.name=name; /* Point to file name to find out about */ + if (utils_complain(os_file(&f),msgs_lookup("spEMF"))) + return; + if (!flex_alloc(&p,f.start)) + { + werr(FALSE,msgs_lookup("spNEMM")); + return; + } + f.action=16; /* Load the file */ + f.loadaddr=(int)p; /* Where to load the file */ + f.execaddr=0; /* Load it there!!! */ + if (utils_complain(os_file(&f),msgs_lookup("spEMF"))) + { + flex_free(&p); + return; + } + gSprite_mergeFromMemory(t,&p); /* Now do the merge */ + flex_free(&p); +} + +/* + * void gSprite_new(glass_tfile *t) + * + * Use + * Creates a sprite file for the given template file. Initially, the file + * is blank. On failure, an error is generated and sprite area 1 (WIMP + * pool) is used instead. Note that at present, this section uses indir + * for allocation of sprite areas. + * + * Parameters + * glass_tfile *t == the file to use + */ + +void gSprite_new(glass_tfile *t) +{ + char buff[256]; + void *def; + if (t->s=indir_alloc(gSprite__CHUNK),!t->s) + { + werr(FALSE,msgs_lookup("spNEMC")); + t->s=(sprite_area *)1; /* Set the WIMP sprite area */ + t->vs=0; /* Tell the world something's wrong */ + return; + } + sprintf(buff,msgs_lookup("spVT"),t->filename); + mem_useUser(indir_alloc,indir_free); + t->vs=viewer_create(gSprite__FILEX, + gSprite__fileHeight, + gSprite__BOXX, + gSprite__BOXY+48, + resspr_area(), + buff, + msgs_lookup("spBANR")); + mem_useMalloc(); + if (!t->vs) + return; + viewer_setCompare(t->vs,gSprite__compare); + gSprite__fileHeight-=48; + if (gSprite__fileHeight<632) + gSprite__fileHeight=gSprite__FILETOP; + viewer_eventHandler(t->vs,gSprite__viewerHandler,t); + viewer_rawEventHandler(t->vs,gSprite__viewerRaw,t); + viewer_redrawHandler(t->vs,gSprite__viewerRedraw,t); + t->s->size=gSprite__CHUNK; + t->s->number=0; + t->s->sproff=16; + t->s->freeoff=16; + if (gPrefs_current()->sLoadDef && gSprite__default) + { + def=&gSprite__default->number; + gSprite_mergeFromMemory(t,&def); + } +} + +/* + * sprite_area *gSprite_area(void) + * + * Use + * Returns the address of the Glass default sprite file, or 1 for the + * WIMP sprite area if no default sprites are loaded + */ + +sprite_area *gSprite_area(void) +{ + return (gSprite__default ? gSprite__default : (sprite_area *)1); +} + +/* + * void gSprite_init(void) + * + * Use + * Loads the Glass default sprite area into memory. + */ + +void gSprite_init(void) +{ + os_filestr f; /* Going to make some OS_File calls */ + f.action=17; /* Read catalogue information for file */ + f.name=choices_name("Defaults.Sprites",FALSE); + if (utils_complain(os_file(&f),msgs_lookup("spELD"))) + return; + if (f.action==0) + return; + if (gSprite__default=mem_alloc(f.start+4),!gSprite__default) + { + werr(FALSE,msgs_lookup("spNEMLD")); + return; + } + gSprite__default->size=f.start+4; + gSprite__default->number=0; + gSprite__default->sproff=16; + gSprite__default->freeoff=16; + if (utils_complain(sprite_area_load(gSprite__default, + choices_name("Defaults.Sprites",FALSE)), + msgs_lookup("spELD"))) + gSprite__default=0; +} diff --git a/StraySrc/Glass/!Glass/c/glass b/StraySrc/Glass/!Glass/c/glass new file mode 100644 index 0000000..8e46c69 --- /dev/null +++ b/StraySrc/Glass/!Glass/c/glass @@ -0,0 +1,601 @@ +/* + * glass.c + * + * Main control section and user interface + * + * © 1994-1998 Straylight + */ + +/*----- Licensing note ----------------------------------------------------* + * + * This file is part of Straylight's Glass. + * + * Glass is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Glass is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Glass. If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Header files ------------------------------------------------------*/ + +/* + * ANSI standard headers + */ + +#include +#include +#include +#include +#include + +#include "dll.h" + +/* + * Steel headers + */ + +#define _STDAPP +#define _XFER +#define _LOWLVL +#include "steel/Steel.h" + +#include "steel/viewer.h" +#include "steel/mem.h" +#include "steel/caretptr.h" +#include "steel/buttons.h" +#include "steel/sculptrix.h" +#include "steel/flex.h" + +/* + * Glass headers + */ + +#include "gStruct.h" +#include "gIcons.h" +#include "gMenus.h" + +#include "glass.h" +#include "toolbox.h" +#include "tfile.h" +#include "intMsgs.h" +#include "gPrefs.h" +#include "gSprite.h" +#include "indir.h" +#include "window.h" +#include "tearEdit.h" + +/*----- External dependencies ---------------------------------------------*/ + +extern char date[], cright[]; +#define VERSION 100 + +/*----- Static global variables -------------------------------------------*/ + +static BOOL glass_genDump; /* Send timings to dump (stderr) */ +static BOOL glass_noWindow; /* Turn off the nice intro window */ + +/*----- Icon bar handlers -------------------------------------------------*/ + +/* + * BOOL glass_unknowns(wimp_eventstr *e,void *handle) + * + * Use + * Vets unknown events. The important ones at the moment are + * Message_DataOpen and Message_PreQuit. Glass 1.xx supports the RISC + * OS 3 prequit convention to avoid the old misunderstanding. This may + * cause problems under RISC OS 2. If so, they'll just have to upgrade... + * + * Parameters + * wimp_eventstr *e == the event in question + * void *handle == 0 + * + * Returns + * TRUE if the event has now been processed. + */ + +static BOOL glass_unknowns(wimp_eventstr *e,void *handle) +{ + BOOL handled=FALSE; + int filetype; + char *filename; + char buff[256]; + os_regset r; + unused(handle); + switch (e->e) + { + case wimp_ESEND: + case wimp_ESENDWANTACK: + switch (e->data.msg.hdr.action) + { + case wimp_MDATAOPEN: + filetype=xferrecv_checkinsert(&filename); + switch (filetype) + { + case 0xfec: /* Template file */ + xferrecv_insertfileok(); + tfile_loadFromFile(filename,xferrecv_nameToImport()); + handled=TRUE; + break; + } + break; + case wimp_MPREQUIT: + if (tfile_okToQuit(TRUE)) + intMsgs_send(glass_KILLFILES); + else + { + e->data.msg.hdr.your_ref=e->data.msg.hdr.my_ref; + wimpt_noerr(wimp_sendmessage(wimp_EACK, + &e->data.msg, + e->data.msg.hdr.task)); + } + handled=TRUE; + break; + case wimp_MMODECHANGE: + intMsgs_send(glass_MODECHANGE); + break; + case wimp_SAVEDESK: + sprintf(buff,"Run %s\n",getenv("Glass$Dir")); + r.r[0]=2; + r.r[1]=e->data.msg.data.savedesk.filehandle; + r.r[2]=(int)buff; + r.r[3]=strlen(buff); + wimpt_noerr(os_swix(XOS_GBPB,&r)); + handled=TRUE; + break; + } + break; + } + return (handled); +} + +/* + * void glass_ibarHandler(ibicon i,ibicon_eventType e,void *handle) + * + * Use + * Handles events for the icon bar icon (such as help requests, load and + * save messages, and of course mouse clicks). + * + * Parameters + * ibicon i == the handle of the icon + * ibicon_eventType e == what has happened + * void *handle == a dummy handle + */ + +static void glass_ibarHandler(ibicon i,ibicon_eventType e,void *handle) +{ + int filetype; /* Filetype of a file to import */ + char *filename; /* Filename of a file */ + int estsize; /* Estimated size of a file to import */ + void *p; /* Pointer to loaded file */ + unused(i); /* Not actually interested in the icon */ + unused(handle); /* Not at all interested in the handle */ + switch (e) /* Find out what's going on */ + { + case ibicon_LEFTCLICK: /* Clicked with select */ + { + glass_tfile *t; + if (t=tfile_createTemplateFile(msgs_lookup("tfUNT")),t) + viewer_display(t->v); + } + break; + case ibicon_RIGHTCLICK: /* Clicked with adjust */ + break; /* Ignore it and hope it goes away */ + case ibicon_LOAD: /* Load request from Filer */ + filetype=xferrecv_checkinsert(&filename); /* Get information */ + switch (filetype) + { + case 0xfec: /* Template file */ + tfile_loadFromFile(filename,xferrecv_nameToImport()); + xferrecv_insertfileok(); + break; + } + break; + case ibicon_SAVE: /* Save from another application */ + filetype=xferrecv_checkimport(&estsize); /* Get information */ + switch (filetype) + { + case 0xfec: /* Template file */ + if (xferrecv_returnImportedBlock(&p)!=-1) + { + tfile_loadFromMemory(&p,xferrecv_nameToImport()); + flex_free(&p); + flex_compact(); + } + break; + } + break; + case ibicon_HELP: /* Help request */ + help_startHelp(); /* Start a help reply */ + help_addLine(msgs_lookup("wehIB")); + help_endHelp(); /* Send the message back */ + break; + } +} + +/* + * void glass_ibarMenuHandler(int hit[],void *handle) + * + * Use + * Processes menu clicks for the icon bar menu. + * + * Parameters + * int hit[] == array of menu hits + * void *handle == 0 (dummy handle) + */ + +static void glass_ibarMenuHandler(int hit[],void *handle) +{ + unused(handle); /* This menu not attached to data struct */ + switch (hit[0]) /* Check which item was chosen */ + { + case glass_IBARINFO: /* About this program */ + progInfo("Glass", + msgs_lookup("wePUR"), + cright, + VERSION, + date); + break; + case glass_IBARPREFS: /* Preferences dialogue */ + gPrefs_edit(); /* Edit the preferences... */ + break; + case glass_IBARTBOX: /* Toolbox (window manipulation) */ + toolbox(); /* Handles it all... */ + break; + case glass_IBARHEAPINFO: /* Heap info display */ + indir_heapInfo(); /* Display */ + break; + case glass_IBARQUIT: /* Quit program */ + if (tfile_okToQuit(TRUE)) /* Check the user is sure about this */ + exit(0); /* End Glass and announce success */ + break; + } +} + +/* + * void glass_ibarMenuHelp(int hit[],void *handle) + * + * Use + * Help processor for icon bar menu. + * + * Parameters + * int hit[] == the item to give help for + * void *handle == a dummy handle + */ + +static void glass_ibarMenuHelp(int hit[],void *handle) +{ + unused(handle); + help_startHelp(); + help_readFromMenu("wemhIB",hit); + help_endHelp(); +} + +/*----- Initialisation ----------------------------------------------------*/ + +/* + * void glass_exit(void) + * + * Use + * Exit handler, creates internal broadcast to close down everything. + */ + +static void glass_exit(void) +{ + intMsgs_send(glass_CLOSEDOWN); +} + +/* + * void glass_iconbar(void) + * + * Use + * Sets up the icon bar during Glass initialisation. Essentially, it + * installs an icon bar, attaches a menu to it, and gives it a handler. + * It also establishes a handler for loading and mouse clicks. + */ + +static void glass_iconbar(void) +{ + ibicon i; /* Handle for the icon we will create */ + menu m; /* The menu to attach to the icon */ + m=menu_new("Glass",msgs_lookup("weIBM")); + i=ibicon_create(ibicon_RIGHT,"!glass",ibicon_WIMPAREA,0,0); + ibicon_attachMenu(i,m,glass_ibarMenuHandler,glass_ibarMenuHelp,0); + ibicon_eventHandler(i,glass_ibarHandler,0); +} + +/* + * void glass_scanCLI(int argc,char *argv[],BOOL inited) + * + * Use + * Scans command line string and loads relevant files + * + * Parameters + * int argc == the number of words in the string + * char *argv[] == the words, as an array of strings + * BOOL inited == whether we have initialised the WIMP + */ + +static void glass_scanCLI(int argc,char *argv[],BOOL inited) +{ + int i; + for (i=1;i | ]...\n" + "\n" + " == file name to load\n" + "