Commit 19b01409 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

Merge of Ursula & Ursula_RiscPC branches.

The "final build" tag didn't build due to mistagging.
This is now fixed.
Moved to srccommit.

Version 3.09. Tagged as 'Help2-3_09'
parent dc945569
......@@ -20,19 +20,34 @@
# Date Name Description
# ---- ---- -----------
# 31-Mar-98 RML Created
# 27-Apr-98 RML ROM build rules added
# 01-May-98 RML Creates rm directory
#
# Program specific options:
#
COMPONENT = Help2
APP = !Help
RDIR = Resources
LDIR = ${RDIR}.${LOCALE}
COMPONENT = Help
APP = !Help
MODULE = rm.${COMPONENT}
ROM_MODULE = aof.${COMPONENT}
RDIR = Resources
LDIR = ${RDIR}.${LOCALE}
MODULE_NAME = !Help
MODULE_HELP = "!Help"
VERSION = 1.00
FILELIST = ${RDIR}.Filelist
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources.${COMPONENT}
RESAPP = <resource$dir>.Apps.${APP}
#
# Generic options:
#
MKDIR = cdir
MODGEN = modgen
CC = cc
LD = link
CP = copy
......@@ -41,7 +56,7 @@ SQUISH = squish
WIPE = -wipe
AFLAGS = ${THROWBACK} -depend !Depend -nocache -stamp -quit -module
CFLAGS = ${THROWBACK} -depend !Depend -ffah ${INCLUDES}
CFLAGS = ${THROWBACK} -depend !Depend -ffa ${INCLUDES}
CPFLAGS = ~cfr~v
SQFLAGS = -nolist
WFLAGS = ~c~v
......@@ -53,6 +68,7 @@ CLIB = CLib:o.stubs
EVENTLIB = tbox:o.eventlib
TOOLBOXLIB = tbox:o.toolboxlib
WIMPLIB = tbox:o.wimplib
WRAPPER = RISC_OSLib:s.ModuleWrap
#
# Include files
......@@ -74,6 +90,10 @@ OBJS =\
o.help \
o.common
# Resources to be included in the ROM module (not in Messages module}
#RESFILES =\
# ${RDIR}.!RunImage
#
# Rule patterns
#
......@@ -87,8 +107,12 @@ OBJS =\
# Main rules:
#
all: ${FILES}
@echo ${COMPONENT}: Application made.
rom: ${MODULE}
@echo ${COMPONENT}: rom module built
install_rom: ${MODULE}
${CP} ${MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom module installed
install: ${FILES}
@echo
......@@ -105,9 +129,30 @@ install: ${FILES}
@echo
@echo ${COMPONENT}: Application installed {Disc}
resources-ASM:
${MKDIR} ${RESAPP}
${MKDIR} ${RESDIR}
|
${CP} ${LDIR}.!Help ${RESAPP}.!Help ${CPFLAGS}
${CP} ${RDIR}.ROM.!Run ${RESAPP}.!Run ${CPFLAGS}
${CP} ${RDIR}.ROM.!Boot ${RESAPP}.!Boot ${CPFLAGS}
|
${CP} ${RDIR}.!Sprites22 ${RESDIR}.!Sprites22 ${CPFLAGS}
${CP} ${LDIR}.Res ${RESDIR}.Res ${CPFLAGS}
resources-RES:
${MKDIR} ${RESDIR}
resources: resources-${TYPE}
${CP} ${LDIR}.Messages ${RESDIR}.Messages ${CPFLAGS}
|
@echo ${COMPONENT}: resource files copied to Messages module
clean:
${WIPE} rm.* ${WFLAGS}
${WIPE} o.* ${WFLAGS}
${WIPE} ${APP}.*
${WIPE} ${APP}.* ${WFLAGS}
${RM} ${MODULE}
${RM} ${RDIR}.!RunImage
${RM} ${APP}
@echo ${COMPONENT}: cleaned
......@@ -117,7 +162,15 @@ clean:
#
Resources.!RunImage: ${OBJS} ${EVENTLIB} ${TOOLBOXLIB} ${WIMPLIB} ${CLIB}
${LD} -o $@ ${CLIB} ${EVENTLIB} ${TOOLBOXLIB} ${WIMPLIB} ${OBJS}
${LD} -o $@ ${OBJS} ${CLIB} ${EVENTLIB} ${TOOLBOXLIB} ${WIMPLIB}
${MODULE}: ${FILES} ${VERSION}
${MKDIR} rm
Do ${MODGEN} $@ ${MODULE_NAME} ${MODULE_HELP} <Help2$BuildVersion> -via ${FILELIST}
${VERSION}:
perl build:getversion Help2$BuildVersion
#---------------------------------------------------------------------------
# Dynamic dependencies:
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all THROWBACK=-throwback
......@@ -14,3 +14,4 @@
|
Dir <Obey$Dir>
amu_machine clean
stripdepnd Makefile
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine install INSTDIR=<obey$dir>
amu_machine install INSTDIR=<obey$dir> THROWBACK=-throwback
| Copyright 1998 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
No preview for this file type
Resources.!RunImage Resources.Help.!RunImage
| Allow other applications to start help by mentioning <Help$Start>,
| rather than giving the absolute pathname.
Set Help$Start <Obey$Dir>
| Load application sprites
Iconsprites <Help$Start>.!Sprites22
| !Run for !Help
| Check if Help is already running
If "<Help$Dir>"<>"" Then Error Help is already running
Set Help$Dir Resources:$.Resources.Help
| Ensure high enough OS version
RMEnsure UtilityModule 3.10 Error This version of Help requires RISC OS 3.1 or later.
| Ensure correct Toolbox modules
RMEnsure Toolbox 1.36 RMLoad System:modules.toolbox.toolbox
RMEnsure Toolbox 1.36 Error You need Toolbox 1.36 or later to run Help
RMEnsure Window 1.41 RMLoad System:modules.toolbox.window
RMEnsure Window 1.41 Error You need Window 1.41 or later to run Help.
RMEnsure Menu 0.28 RMLoad System:modules.toolbox.menu
RMEnsure Menu 0.28 Error You need Menu 0.28 or later to run Help.
RMEnsure Iconbar 1.13 RMLoad System:modules.toolbox.iconbar
RMEnsure Iconbar 1.13 Error You need Iconbar 1.13 or later to run Help.
RMEnsure ProgInfo 0.09 RMLoad System:modules.toolbox.proginfo
RMEnsure ProgInfo 0.09 Error You need ProgInfo 0.09 or later to run Help.
RMEnsure FontMenu 0.17 RMLoad System:modules.toolbox.fontmenu
RMEnsure FontMenu 0.17 Error You need FontMenu 0.17 or later to run Help.
| Start the application
Wimpslot -min 64k -max 64k
Run <Help$Dir>.!RunImage
\ No newline at end of file
# Messages file for Screen Configuration
# Messages file for !Help
_TaskName:Help
# Standard miscellaneous messages
......@@ -44,178 +44,3 @@ Td:Drag ADJUST to
Tw:window
Ts:SELECT
Ta:ADJUST
T0: for triangles (in multiples of the path width).
T1:ing
T2: in the
T3:ed
T4: the general public
T5:path element
T6:text line
T7:ress
T8:e the
T9:Click here or type
T@: the
TB:lick
TC: to
TE:select
TF:sprite
TH:directory
TI: object
TJ:change the
TK: this
TL:Click (or press
TM:tion
TN: and
TO:display
TP: the current
TQ:file
TU: information about
TV:This
TX:application
TY: of the
TZ:colour
T^:Move the pointer right
T_:character
Tb: or
Tc: this sprite, at the position you were pointing at when you pressed MENU.
Te: in
Tf: of
Tg:control
Th:number
Ti: a
Tj: operation
Tk:Double-click
Tl:path
Tm:To paint each
Tn: with
To:icon
Tp:ent
Tq:The Force option determines whether or not locked objects will be deleted.
Tr:e the sprite in the selected sprite file on the desktop background.
Tt: for
Tu:selected object
Tv: grid point
Tx: the disc in drive
Ty: file server
Tz:change
T€: entry mode
T:This option is shaded because
T‚: from
:Drag SELECT to copy the
T„:To paint each ellipse, click at its centre, at a point that gives the width at the centre, and at a point on the edge.
T…:sort the items in this directory by their
T†:all
T‡:Click for
:This line shows that
T‰: a save box
:paint
T‹:rectangle
: Either fill in the numerator and denominator, or click on the arrows, to use the given zoom factor.
T: click at the circle centre, and at the start and end of the
:: click on a preselected common value, or type in any value in the bottom field and press RETURN.
T: you
T:create a new
T‘:move the icon.
T’:n the
T“:Either drag from the file icon to a directory display, or fill in the name of a file and click on OK, to save as a
T”:Type a number and
T•:available
T–: to the
T—:distance between major grid points
T™: used for text lines (in points).
:These radio buttons control the
T›:determine whether or not
:name
T: is
: which
:hen
:inboard
:selection
:enter a new file type for
:width
:display the
:choose the
:drawing
:memory
:TinyDirs
:change the number of minor grid points per major grid point.
:disc
:horizontally
:line
: will
: the current colour’colour found when plotted.
:height
:t the
:toggle the presence
:string
:contents
:desktop
:screen
: information
: you want to
:amount by which line numbers used for text lines (in points). incremented for each new BASIC line.
:press Return
:RETURN
:SELECT to
:Move the pointer right (or press
T¿:width of the work used for text lines (in points).a of an Edit , in terms of system font characters.
:background
:grid
: this sprite
:To paint each circle, click at its centre and then at a point on the edge.
:Click or type
:answer the question.
:back up the disc in drive
:To paint each rectangle, click at two opposite corners of the rectangle within the sprite .
:selected
:determine the free space o
:This is
:search
:window
:To paint each parallelogram, click at three different corners.
: Manager
:make the machine auto-boot on reset if Shift is
:This displays
:show
:ther
:Drag a mode description file here to change the available modes.
:ing
:int
: mode.
:Type in the
:Double-click ADJUST to
:access
:new
:pattern
:pixels
:replac
:root directory
:scale factor
:task
:Use the full info display option to see current settings.
:ate
:text
:Drag
:The
:file being edited.
:allow the general public to read
:drive
:ope
:resolution
:centimetre
:enter
: file
: to be
: icon
:) to
: and click on OK
:set the
: or more occurrences of the next pattern element
: into
:size
:time stamp
: between the two matching paths in the selected group.
: contain
: on the
: of objects.
Tÿ: that
No preview for this file type
---------------------------------------------------------------------------
Project: Ursula
Module: Help2
Created: 14-Apr-98
By: Richard Leggett
First version: 3.00
Copyright: 1998, Acorn Computers Ltd., Cambridge, UK.
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Version 3.06 (Richard Leggett)
Tue 14-Apr-98
- Makefile changed so doesn't use !Make.
Thu 16-Apr-98
- Bug fixed so that \\ in a message displays \
Wed 29-Apr-98
- Made it ROM buildable.
Thu 07-May-98
- Changed so that if very long words (>1024 OS units) won't fit on a line,
they are split midway.
- If an application returns null strings, they are now ignored.
Checked into CVS.
---------------------------------------------------------------------------
Version 3.07 (Richard Leggett)
Tue 21-Jul-98
- Changed !Boot file so Help$Start points to correct place.
Checked in. Tagged as rleggett_Help2-3_07
Wed 05-Aug-98
- Only Select clicks on icon bar activate/de-activate help.
---------------------------------------------------------------------------
Version 3.08 (Kevin Bracey)
Mon 05-Oct-98
- Improved the amazing Leggett icon sizing method.
Checked in. Tagged as Help2-3_08
/* (3.08)
/* (3.09)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 3.08
#define Module_MajorVersion_CMHG 3.09
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 Aug 1999
#define Module_MajorVersion "3.08"
#define Module_Version 308
#define Module_MajorVersion "3.09"
#define Module_Version 309
#define Module_MinorVersion ""
#define Module_Date "27 Aug 1999"
#define Module_FullVersion "3.08"
#define Module_FullVersion "3.09"
......@@ -17,6 +17,9 @@
/* Purpose: Routines to deal with help strings. */
/* Author: Richard Leggett */
/* History: 15-Dec-97: RML: Created. */
/* 17-Apr-98: RML: Fixed bug with double \ tokens. */
/* 07-May-98: RML: Code changed to break up long words if won't fit */
/* on one line. */
/*---------------------------------------------------------------------------*/
/* Notes: */
/* - Bug in Font_ScanString means we have to use Font_StringWidth instead. */
......@@ -30,10 +33,10 @@
#include "common.h"
#include "help.h"
#define DesiredAspect 3.5 /* The aspect ratio we want */
#define MaxBoxWidth 1024 /* Maximum width of a help box, in OS units */
#define BackSlash 92 /* Backslash ASCII code */
#define DesiredAspect 3.5 /* The aspect ratio we want */
#define MaxBoxWidth 1024 /* Maximum width of a help box, in OS units */
#define BackSlash 92 /* Backslash ASCII code */
#define Flag_SplitLine 1
/* Global variables:
offset[] - an array of pointers which point to the start of each line in a help
......@@ -44,7 +47,7 @@
static char* offset[256];
static int num_strings;
static int line_spacing=40; /* Temporary value - will be changed later */
static int line_spacing = 40; /* Temporary value - will be changed later */
/*------------------------------------------------------------------------------------------*
* return_string_length *
......@@ -59,7 +62,8 @@ static int line_spacing=40; /* Temporary value - will be changed later */
int return_string_length(int font, char* string)
{
int width, current_font;
int width;
int current_font;
error_trap(_swix(Font_CurrentFont, _OUT(0), &current_font), 0);
error_trap(_swix(Font_SetFont, _IN(0), font), 0);
......@@ -87,55 +91,77 @@ int return_string_length(int font, char* string)
* Returns: number of lines the string will occupy. *
*------------------------------------------------------------------------------------------*/
int count_string_lines(int font, char* string, int width, char* buffer, int* max_width, int* bytes_out)
static int count_string_lines(int font, char *string, int width, char *buffer, int *max_width, int *bytes_out, int *flags)
{
char* current=string;
char* split=0;
char* end=string+(strlen(string));
int lines=0, more=1, line_width, current_font;
char *current = string;
char *split = 0;
char *end = string+(strlen(string));
int lines = 0;
int more = 1;
int line_width;
int current_font;
if (bytes_out) *bytes_out=0;
if (bytes_out) *bytes_out = 0;
*flags = 0;
while (more)
{
/* Find split and size of split section */
error_trap(_swix(Font_CurrentFont, _OUT(0), &current_font), 0);
error_trap(_swix(Font_SetFont, _IN(0), font), 0);
error_trap(_swix(Font_StringWidth, _INR(1, 5)|_OUTR(1, 2), current, width, 720000, 32, end-current,
&split, &line_width), 0);
error_trap(_swix(Font_SetFont, _IN(0), current_font), 0);
error_trap(_swix(Font_StringWidth, _INR(1, 5)|_OUTR(1, 2),
current,
width,
72000,
32,
end - current,
&split,
&line_width), 0);
/* If a word won't fit the maximum width (split = current != end), then split word */
if ( (split == current) && (current != end) )
{
error_trap(_swix(Font_StringWidth, _INR(1, 5)|_OUTR(1, 2),
current,
width,
72000,
-1,
end - current,
&split,
&line_width), 0);
*flags = Flag_SplitLine;
}
/* If a word won't fit the maximum width, then split = current before the end */
if ( (split==current) && (current!=end) ) return -1;
error_trap(_swix(Font_SetFont, _IN(0), current_font), 0);
/* Copy the next portion into our output buffer (if one was specified) */
if (buffer)
{
if (lines==0)
if (lines == 0)
{
sprintf(buffer, " ");
buffer+=2;
*bytes_out+=2;
buffer += 2;
*bytes_out += 2;
}
memcpy(buffer, current, split-current);
buffer[split-current]=0;
buffer+=(split-current+1);
*bytes_out+=(split-current+1);
buffer[split-current] = 0;
buffer += (split-current+1);
*bytes_out += (split-current+1);
}
/* Keep track of the largest width string we've had so far */
lines++;
if (line_width>*max_width) *max_width=line_width;
if (line_width > *max_width) *max_width = line_width;
/* Check for the end of the string */
if ((split>=end) || (split==current))
if ((split >= end) || (split == current))
{
more=0;
more = 0;
}
else
{
if (split[0]==' ') split++;
current=split;
current = split;
}
}
......@@ -156,14 +182,16 @@ int count_string_lines(int font, char* string, int width, char* buffer, int* max
int break_strings_down(int font, int width, char* buffer)
{
int lines=0;
int bytes_out=0;
int n, max_width;
int lines = 0;
int bytes_out = 0;
int max_width;
int flags;
int n;
for (n=0; n<num_strings; n++)
{
lines+=count_string_lines(font, offset[n], width, buffer, &max_width, &bytes_out);
buffer+=bytes_out;
lines += count_string_lines(font, offset[n], width, buffer, &max_width, &bytes_out, &flags);
buffer += bytes_out;
}
return lines;
......@@ -176,21 +204,22 @@ int break_strings_down(int font, int width, char* buffer)
* If a is nearer to c than b, return 1, else 0. *
*------------------------------------------------------------------------------------------*/
int a_nearer_to_c_than_b(double a, double b, double c)
static int a_nearer_to_c_than_b(double a, double b, double c)
{
double ad, bd;
double ad;
double bd;
ad=c-a; if (ad<0) ad=-ad;
bd=c-b; if (bd<0) bd=-bd;
ad = c - a; if (ad<0) ad = -ad;
bd = c - b; if (bd<0) bd = -bd;