GitLab has been upgraded to 13.7.4 If you encounter any issues mail code@riscosopen.org

Commit 32d4c01a authored by Neil Turton's avatar Neil Turton

Import from cleaned 360 CD

parents
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
cdir <Obey$Dir>.!Edit
amu_machine install INSTDIR=<Obey$Dir>.!Edit
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine module
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
s/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
awk/** gitlab-language=awk linguist-language=awk linguist-detectable=true
*,ffb gitlab-language=bbcbasic linguist-language=bbcbasic linguist-detectable=true
c/** gitlab-language=c linguist-language=c linguist-detectable=true
h/** gitlab-language=c linguist-language=c linguist-detectable=true
Notes about !Edit's sources
---------------------------
Author: William Stoye
History:
22-May-89: 0.01: started.
13-June-89: 0.02: move to 330 compiler.
26-Sep-89: stuff added to make module form too.
The presence of adfs:$.RISC_OSLib is assumed (but only in MakeFile).
The presence of the following tools is assumed:
cc
link
amu
(release 330 or later).
When developing, make !Edit your current directory.
The file MakeFile is an AMU file. for putting everything together.
When making releases, compile everything using -c -Ff. Release by going
*RelObjTo $.releases.!Edit_xxx
(or wherever you want a normal "image" directory to appear).
When releasing, ensure that the Version file is true and correct, (which
will recompile c.editv). This ensures that the version string in the Info
box is correct. RelObjTo gets it right on the ReadMe file and the !Run file.
When playing with a newly released image, check that it can open several
(e.g. 8) text windows. Without this, it's lacking in malloc space and will
need a larger *WimpSlot in its !Run file.
For serious debugging,
compile using -c (thus you'll get procedure names for backtraces),
set TRACE in h.trace in cwimp to TRUE so that the tracef statements
appear as something,
recompile trace and wimpt in this form.
call trace_on() somewhere near the start, e.g. in
main in c.edit.
When c.txtedit is compiled with TRACE=TRUE, you get two extra menu entries
on the misc menu to turn tracing on and off. See c.wimpt for the
generation of stack backtrace info when a crash occurs.
The program fbash is currently broken. It is used for bashing the innards of
txt1 (the main text buffer handling).
These sources can also make the !Edit module, for inclusion in the RISC OS+
ROM. In order to do this, all parts of the program need to be recompiled
with different compiler flags. "amu EditModule" will do all of this, doing
the compilation as a once-off, deleting the o. files, and reinstating the
old ones.
# Control file for Edit
ctl IconControl # define control machine for icon on icon bar
menu Create create
entry "New Text file" newtextfile
entry "New Data file" newdatafile
entry "New Command file" newcommandfile
entry "New Obey file" newobeyfile
entry "New Task window" newtaskwindow
endmenu
dbox proginfo progInfo
onopen proginfo_setversion
enddbox
menu Edit edit
entry Info dbox proginfo
entry Create submenu create
entry Quit edit_quit
endmenu
ctl Control # control for main window
menu Misc misc
entry Info dbox proginfo
entry File dbox fileinfo
entry "New view" txtedit_newview
entry "Column tab (sh-f3)" txtedit_coltab
entry "Overwrite (sh-f1)" txtedit_overwrite
entry "Wordwrap (ctl_f5)" txtedit_wordwrap
entry "Trace" trace
entry "No trace" notrace
endmenu
dbox indent selindent
onentry indent_init
icon 0 indent_do
enddbox
menu Select select
entry Save sel_save
entry "Copy (ctl-C)" sel_copy
entry "Move (ctl-V)" sel_move
entry "Delete (ctl-X)" sel_delete
entry "Clear (ctl-Z)" sel_clear
entry "Indent" dbox indent
menu "Format width" formatwidth
entry "" format # will be filled in by program
endmenu
menu Edit edit
entry "Find (f4)" dbox edit_find
entry "Goto (f5)" dbox edit_goto
entry "Undo (f8)" edit_undo
entry "Redo (f9)" edit_redo
entry "CR<->LF" edit_crlf
entry "Expand tabs" edit_tabs
entry "Format text" submenu formatwidth
menu Display display
entry Font fontmenu
entry "Font size" submenu fontsize
entry "Font height" submenu fontheight
entry "Line spacing" submenu linespacing
entry "Margin" submenu margin
entry "Invert" invert
entry "Wrap" wrap
entry "Foreground" fcolour
entry "Background" bcolour
endmenu
menu Edit main
entry Misc submenu misc
entry Save save
entry Select submenu select
entry Edit submenu edit
entry Display submenu display
endmenu
Control Files
=============
Author: William Stoye
History:
0.01
0.02
0.03 - 19-June-89 - remarks about help, and icons.
0.04 - 04-July-89 - ctl_make becomes ctl_init()
0.05 - 11-July-89 - more updates
0.06 - 12-July-89 - more updates
The 'ctl' module is a set of library facilities, written in C, allowing a
program to put a great deal of user event decoding into a resource file.
This file controls the mapping of menu, dialogue box and key events into
textually named actions, which are then executed by the program. It makes
programs easier to contruct, and means that the result is customisable (to
some extent) by the user.
The is always called Control, and is a resource file within an application
directory.
File Syntax
-----------
# starts a comment line. Blank lines are ignored.
Each line is split into symbols, separated by spaces.
A symbol is any character sequence in matching quote marks, OR any
alphanumeric char sequence (underscore is also allowed, and the first
character may not be a number). Escape sequences within quoted symbols are
currently not supported.
Examples: hello
delete_file
"Hello there"
'Say "boo"'
Symbol comparison is case-sensitive. Conventionally all keywords within a
Control file are entirely in lower case.
In the ensueing descriptions, items in angle brackets (unless otherwise
stated) are all symbols.
Actions and Action sequences
----------------------------
An action sequence is just a sequence of one or more symbols. Each symbol
is the name of an operation that the application supports, the actual
set of operations available is defined by the application.
It's also possible for an action to take arguments, if an action
requires an argument then the next symbol in the action sequence is
interpreted as this.
The following built-in actions are always available:
error <error message> -- produce the specified error message,
in the standard Wimp error message
window.
opendbox <dbox name> -- cancel the current menu and show
this dialogue box. This can only occur
at the end of an action sequence.
closedbox -- close the current dialogue box.
This should occur at the end of an
action sequence whose normal operation
is to close the dialogue box. A
right-click will override this,
leaving the dialogue box open.
A control object header
-----------------------
Syntax: ctl <logical control object name>
This starts entries in a named control object.
A menu header
-------------
Syntax: menu <menu text> <menu name>
Used to start the declaration of a menu.
A menu entry
------------
Syntax: entry <entry text> <action sequence>
OR entry <entry text> submenu <submenu name>
OR entry <entry text> submenu <submenu name> action <action sequence>
An entry statement describes an entry in a menu.
The first form indicates a conventional menu entry, with the sequence
of actions that should be performed if the user clicks on that menu
entry.
The second form indicates a non-leaf menu entry. The submenu name
must refer to a previously defined menu, and matches the menu name given
in the menu header.
The third form indicates a non-leaf menu which can also lead to some action
when clicked.
The end of a menu
-----------------
Syntax: endmenu
This should appear at the end of a menu description. Menu descriptions
cannot be nested.
A dialogue box header
---------------------
Syntax: dbox <dbox name> <template name>
Used to start the declaration of a dbox. The correspondingly named template
(typically in the resource file Templates) will be used to describe the
visual appearance of the dialogue box.
A dialogue box open action
--------------------------
Syntax: onopen <action sequence>
This describes the actions to be obeyed every time a dialogue box is opened
(and just before it is first displayed).
A dialogue box close action
---------------------------
Syntax: onclose <action sequence>
This describes the actions to be obeyed every time a dialogue box is closed.
A dialogue box icon action
--------------------------
Syntax: icon <icon number> <action sequence>
This describes the action to be taken when a hit occurs on the specified
icon.
The end of a dbox
-----------------
Syntax: enddbox
This should appear at the end of a dbox description. Dialogue box
descriptions cannot be nested.
(key definitions)
(complete example)
(error messages)
Keystrokes
----------
(WRS: not yet done)
keycode <key code> <action sequence>
fnkey <fn key number> <action sequence>
shfnkey <fn key number> <action sequence>
ctlfnkey <fn key number> <action sequence>
shctlfnkey <fn key number> <action sequence>
key <character> <action sequence>
ctlkey <character> <action sequence>
An example file (incomplete)
----------------------------
# Control file for Edit
ctl IconControl # define control machine for icon on icon bar
menu Create create
entry "New Text file" newtextfile
entry "New Data file" newdatafile
entry "New Command file" newcommandfile
entry "New Obey file" newobeyfile
entry "New Task window" newtaskwindow
endmenu
dbox proginfo progInfo
onopen proginfo_setversion
enddbox
menu Edit edit
entry Info dbox proginfo
entry Create submenu create
entry Quit edit_quit
endmenu
ctl Control # control for main window
menu Misc misc
entry Info dbox proginfo
entry File dbox fileinfo
entry "New view" txtedit_newview
entry "Column tab (sh-f3)" txtedit_coltab
entry "Overwrite (sh-f1)" txtedit_overwrite
entry "Wordwrap (ctl_f5)" txtedit_wordwrap
entry "Trace" trace
entry "No trace" notrace
endmenu
dbox indent selindent
onentry indent_init
icon 0 indent_do
enddbox
menu Select select
entry Save sel_save
entry "Copy (ctl-C)" sel_copy
entry "Move (ctl-V)" sel_move
entry "Delete (ctl-X)" sel_delete
entry "Clear (ctl-Z)" sel_clear
entry "Indent" dbox indent
menu "Format width" formatwidth
entry "" format # will be filled in by program
endmenu
menu Edit edit
entry "Find (f4)" dbox edit_find
entry "Goto (f5)" dbox edit_goto
entry "Undo (f8)" edit_undo
entry "Redo (f9)" edit_redo
entry "CR<->LF" edit_crlf
entry "Expand tabs" edit_tabs
entry "Format text" submenu formatwidth
menu Display display
entry Font fontmenu
entry "Font size" submenu fontsize
entry "Font height" submenu fontheight
entry "Line spacing" submenu linespacing
entry "Margin" submenu margin
entry "Invert" invert
entry "Wrap" wrap
entry "Foreground" fcolour
entry "Background" bcolour
endmenu
menu Edit main
entry Misc submenu misc
entry Save save
entry Select submenu select
entry Edit submenu edit
entry Display submenu display
endmenu
Module Structure of ArcEdit.
===========================
The underlying RISC_OSLib structure is assumed here.
The low level stuff is h.txt and everything below it (txt, txt1, txt3,
txtar). Some other interfaces (txtwin, txtundo) provide extensions to the
txt interface.
h.txt is the main central abstraction of a text buffer.
c.txt1 is the main host-independent management of text buffers. h.txt1
explains its data structures.
c.txtar is the main RISC OS-dependent implementation of graphics calls
needed by txt1.
c.txt is just a trivial switch between txt1 and txtar.
txt3 manipulates multiple txtar windows, and is pretty small and simple.
txtundo provides the undo buffer which is attatched to each txt buffer.
Then there are various modules that provide services in terms of txt.
txtmisc is various facilities, e.g. tabbing.
txtfind is finding strings in a txt.
txtfile is loading/saving files to/from txts.
scrap provides a single central selection between several txts.
txtoptmenu provides a generic user interface to the display options provided
by txtar.
Then there is the editor itself, which provdes the user interface:
txtedit is the main editor
message/shell/slist is the task window
editv is the version box
edit is startup, and icon bar handling.
!Edit implementation change Log
-------------------------------
(This is the implementor's log. The file PublicLog is what should
be available for the public to read, near to a release.)
0.56 - 04th Oct 88
!Run - minor cleanup
txtfind - search past char 0xFF crashed.
txt1 - auto-repeat-page-up/down on v. big files used
to crash with "fatal t1-1", now fixed.
(due to multi-page call to movevertical)
txtar - window title buffer increased from 64 to 260 chars
txtedit - made use of xfersend_file_is_safe
new incompatible xfersend (printing stuff) ignored
cwimp.c.resspr - rebuilt stuff for surviving no Sprites file
edit - experimented with making renaming of !Edit possible -
ended up taking it out.
txtedit - fixed bug that made long filenames crash (in settexttitle)
0.58 released - 2nd Nov 88
txtedit - bug in shift-right-click on close on text window
(used to chop off leaf name, now fixed).
07-Nov-88: cwimp.c.bbc - minor fix to bbc_move, for DSeal.
07-Nov-88: c.txtedit - minor fix to txtedit__goto, using
dbox_persist wrong, ADJ outside box caused
a crash, fixed.
07-Nov-88: c.edit - check inserted for txtedit_new returning 0 (malloc fail)
when creating typed files.
07-Nov-88: c.txtedit - Create->Text menu entry used to produce garbage
datestamp, due to uninit variable in
txtedit_newwithoptions. fixed.
07-Nov-88: c.txtedit - Create now gives sensible default names to
weird types of files.
07-Nov-88: c.txtedit - r-click-on-close reviewed:
if file modified, now just does open-parent.
07-Nov-88: c.txtar - 2-pixel kludge when using fonts on line height.
worst example I could find - 15-point Trintity.Standard
in mode 12 (underline over B-circumflex), requires this much.
Many examples require one pixel, below the baseline,
as a kludge.
08-Nov-88: templates: spurious "OK" button renamed as "",
preventing mysterious meaning of "o" in the Info box.
0.59 released - 9th November 88
09-Nov-88: c.event - crash if malloc failed, fixed.
09-Nov-88: c.eventv, templates: copyright message.
0.60 released with debugging in, 10th Nov 88:
to chase BCockburn's mysterious crashes.
16-Nov-88: task module - new version, better with ESC.
16-Nov-88: c.message - better checking for when malloc fails.
16-Nov-88: c.txtoptmenu - width/height/margin/spacing not too big.
16-Nov-88: c.txtar - char 127 in system font is OK now.
16-Nov-88: c.txtedit - drag file -> Edit icon -> used not to
update title of target to show modified bit.
17-Nov-88: c.txt1 - redraw bug when at top of text, with cursorx!=0
17-Nov-88: c.txtfind - bug in case-sensitive find, could crash.
18-Nov-88: c.txtedit - slight space leak on task deletion fixed
rare crash from NGardner in 0.60 - in txtedit_findnamedtxt.
Extra test inserted in txtedit_dispose.
Window deletion rationalised a little
c.dboxquery, c.edit - dboxquery cannot fail for lack of
space.
c.txtedit - rationalise menu use, so that clicking
on non-leaves does not pull up the dboxes.
c.txtedit - further tweak to r-click-on-close
(no parent detectable -> do not close the window instead)
relobjto - automated construction of !Run file with
copy of Version file in the header.
c.txtedit - (optional) overwrite mode
c.txtedit - (optional) format para on RETURN/click in para width field
does not contradict wording of user guide.
c.txtedit, c.txtmisc (optional)
tab column switch, late extension to spec.
c.txtedit - found occasional crash!
in newwithoptions, if file present but load fails,
incorrect deletion of semi-created txtedit object.
0.63 released, 20-Nov-88
21-Nov-88:
New task module, suspended killed task
continues until any system calls are over.
c.dbox: let keystrokes through as though harmless,
e.g. for Info box of Edit/Paint...
c.txtmisc: if large move/copy could make first copy but
not second, superfluous second error message removed.
Error message removed to not mention move/copy.
c/h.txtmisc, c.txtedit: word tab removed, col tab used instead.
c.txtedit: click on Save -> does nothing if no name.
c.txtar: (*) bug hunt for set-extent not working on multiple views.
22-Nov-88:
c.txtar: (*) debugging error msg taken out on multiple pending setsize.
tryfont: test for bum font files removed.
h/c.txtmisc, c.txtedit: col tab taken out.
c.message: missing break stt after TaskInput menu entry, fixed.
c.dbox: keystroke interception put back again.
caused problems with keyboard answering of Y/N questions.
c.txtmisc: bug in indent-block with negative argument and
non-null lines less than that, fixed.
c.txtedit: bug in newwithoptions that caused occasional crashes,
the fix hadn't been put in! Fixed now.
0.64 released, 23-Nov-88
25-Nov-88:
c.txtedit: simple bug in clicking Save fixed.
experimentation with desktop-closedown mysterious bug.
29-Nov-88:
c.txtedit: further problem with clicking Save, fixed.
(txtedit_saverprocsafe created)
various problems with xfersend save of 0-length file
solved, by claiming there was 1 byte to send.
c.txtmisc: format-para bug fixed, where if last line of para
fitted exactly, all did not go well.
c.txtedit: overwrite (controlled by sh-f1) put back in.
0.65 released, 01-Dec-88
07-Dec-88:
c.txtedit: error message about not enough space/too many windows improved.
new cwimp stuff folded in.
ReadMe file added.
0.66 released, 07-Dec-88
09-Dec-88:
txtedit: buffers carefully not modified if null file dragged in.
12-Dec-88:
txtfile: bug in _insert, if the thing you're inserting is bigger than
what Edit takes up already, and there is not enough space, I
read that many bytes from location 0 and get an address exception.
0.67 released, 13-Dec-88
14-Dec-88:
edit: check failure to create txtedit object when dragging to icon bar.
dbox: prequit message is now considered harmful.
20-Dec-88:
txtar: all fonts tagged italic, after complaints about quality.
txtar: negative linesep on system font counts as zero.
txtedit: Go or Count in find, with null search string, ignored.
txtundo: prevent_undo zeros ptr, otherwise ReDo can get confused.
1.00 released, 20-Dec-88.
04-Jan-88:
txtedit: EDIT2 variable to control wordwrap, overwrite, col tab.
control of these three flags added to Misc menu.
_paraend updated for the \n\n problem.