Commit 9dd4aca5 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

Merge of multiple versions of RISC_OSLib.

Detail:
  This work may be incomplete - hence import on a branch.
  It has NOT been tested.
Admin:
  Might even build.


Version 5.33, 4.50.2.1. Tagged as 'RISC_OSLib-5_33-4_50_2_1'
parent 8159da18
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "5.33" Module_MajorVersion SETS "5.33"
Module_Version SETA 533 Module_Version SETA 533
Module_MinorVersion SETS "" Module_MinorVersion SETS "4.50.2.1"
Module_Date SETS "10 May 2001" Module_Date SETS "02 Jul 2001"
Module_ApplicationDate2 SETS "10-May-01" Module_ApplicationDate2 SETS "02-Jul-01"
Module_ApplicationDate4 SETS "10-May-2001" Module_ApplicationDate4 SETS "02-Jul-2001"
Module_ComponentName SETS "RISC_OSLib" Module_ComponentName SETS "RISC_OSLib"
Module_ComponentPath SETS "RiscOS/Sources/Lib/RISC_OSLib" Module_ComponentPath SETS "RiscOS/Sources/Lib/RISC_OSLib"
Module_FullVersion SETS "5.33" Module_FullVersion SETS "5.33 (4.50.2.1)"
Module_HelpVersion SETS "5.33 (10 May 2001)" Module_HelpVersion SETS "5.33 (02 Jul 2001) 4.50.2.1"
END END
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
* *
*/ */
#define Module_MajorVersion_CMHG 5.33 #define Module_MajorVersion_CMHG 5.33
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG 4.50.2.1
#define Module_Date_CMHG 10 May 2001 #define Module_Date_CMHG 02 Jul 2001
#define Module_MajorVersion "5.33" #define Module_MajorVersion "5.33"
#define Module_Version 533 #define Module_Version 533
#define Module_MinorVersion "" #define Module_MinorVersion "4.50.2.1"
#define Module_Date "10 May 2001" #define Module_Date "02 Jul 2001"
#define Module_ApplicationDate2 "10-May-01" #define Module_ApplicationDate2 "02-Jul-01"
#define Module_ApplicationDate4 "10-May-2001" #define Module_ApplicationDate4 "02-Jul-2001"
#define Module_ComponentName "RISC_OSLib" #define Module_ComponentName "RISC_OSLib"
#define Module_ComponentPath "RiscOS/Sources/Lib/RISC_OSLib" #define Module_ComponentPath "RiscOS/Sources/Lib/RISC_OSLib"
#define Module_FullVersion "5.33" #define Module_FullVersion "5.33 (4.50.2.1)"
#define Module_HelpVersion "5.33 (10 May 2001)" #define Module_HelpVersion "5.33 (02 Jul 2001) (4.50.2.1)"
/* 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.
*/
/************************************************************************/
/* © Acorn Computers Ltd, 1992. */
/* */
/* This file forms part of an unsupported source release of RISC_OSLib. */
/* */
/* It may be freely used to create executable images for saleable */
/* products but cannot be sold in source form or as an object library */
/* without the prior written consent of Acorn Computers Ltd. */
/* */
/* If this file is re-distributed (even if modified) it should retain */
/* this copyright notice. */
/* */
/************************************************************************/
/* Copyright 1996 Acorn Computers Ltd /* Copyright 1996 Acorn Computers Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -15,19 +44,14 @@ ...@@ -15,19 +44,14 @@
/* /*
* Title: akbd.c * Title: akbd.c
* Purpose: Access to Archimedes keyboard under the Wimp. * Purpose: Access to Archimedes keyboard under the Wimp.
* Author: W. Stoye * History: IDJ: 05-Feb-92: prepared for source release
* Status: Arthur-specific
* History:
* 13-Oct-87: started
* 13-Dec-87: converted to C.
* 11-May-91: ECN: turned stack checking off
*/ */
#include "h.os" #include "h.os"
#include "h.trace" #include "h.trace"
#include "h.akbd" #include "h.akbd"
/* see page 58 of June 9th Reference Manual, OSBYTE &81 (129) */ /* see page 58 of Programmer's Reference Manual, OSBYTE &81 (129) */
#pragma -s1 #pragma -s1
int akbd_pollsh(void) int akbd_pollsh(void)
...@@ -54,24 +78,24 @@ int akbd_pollkey(int *keycode /*out*/) ...@@ -54,24 +78,24 @@ int akbd_pollkey(int *keycode /*out*/)
int y = 0; int y = 0;
(void) os_byte(129, &x, &y); (void) os_byte(129, &x, &y);
tracef2("PollKey returns %i %i.\n", x, y); tracef2("PollKey returns %i %i.\n", x, y);
if (y==0 && x==0) { if ((x + y) == 0)
{
/* it's a function key: 0, followed by the actual code. */ /* it's a function key: 0, followed by the actual code. */
x = 0;
y = 0;
(void) os_byte(129, &x, &y); (void) os_byte(129, &x, &y);
if (y==0 && x>=128) { if (y==0 && x>=128)
{
/* bona fide function key */ /* bona fide function key */
*keycode = 256 + x; *keycode = 256 + x;
} else { } else {
/* he's typing ahead with a control-@: sorry boy, you loose /* he's typing ahead with a control-@: sorry boy, you loose
the next key. */ the next key. */
*keycode = 0; *keycode = 0;
}; }
return(1); return(1);
} else { } else {
*keycode = x; *keycode = x;
return(y==0); return(y==0);
}; }
} }
#pragma -s0 #pragma -s0
......
/* 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.
*/
/************************************************************************/
/* Acorn Computers Ltd, 1992. */
/* */
/* This file forms part of an unsupported source release of RISC_OSLib. */
/* */
/* It may be freely used to create executable images for saleable */
/* products but cannot be sold in source form or as an object library */
/* without the prior written consent of Acorn Computers Ltd. */
/* */
/* If this file is re-distributed (even if modified) it should retain */
/* this copyright notice. */
/* */
/************************************************************************/
/* Copyright 1996 Acorn Computers Ltd /* Copyright 1996 Acorn Computers Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -17,14 +44,8 @@ ...@@ -17,14 +44,8 @@
* Title: alarm.c * Title: alarm.c
* Purpose: alarm facilities for wimp programs, using non-busy waiting * Purpose: alarm facilities for wimp programs, using non-busy waiting
* for idle events * for idle events
* Author: IDJ * History: IDJ: 05-Feb-92: prepared for source release
* Status: under development *
* History: 20-Mar-89 IDJ created
* 21-Mar-89 IDJ modified kludge to alarm_timedifference
* 21-Mar-89 IDJ added alarm__laterthan macro
* 08-May-91 ECN #ifndefed out unused ROM functions
* 09-May-91 ECN use swi names instead of nos.
* 14-Jun-91 IDJ timedifference put back in
*/ */
#include <stdlib.h> #include <stdlib.h>
......
/* 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.
*/
/************************************************************************/
/* Acorn Computers Ltd, 1992. */
/* */
/* This file forms part of an unsupported source release of RISC_OSLib. */
/* */
/* It may be freely used to create executable images for saleable */
/* products but cannot be sold in source form or as an object library */
/* without the prior written consent of Acorn Computers Ltd. */
/* */
/* If this file is re-distributed (even if modified) it should retain */
/* this copyright notice. */
/* */
/************************************************************************/
/* Copyright 1996 Acorn Computers Ltd /* Copyright 1996 Acorn Computers Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -15,20 +43,8 @@ ...@@ -15,20 +43,8 @@
/* /*
* Title: baricon.c * Title: baricon.c
* Purpose: Support placing of an icon on the icon bar. * Purpose: Support placing of an icon on the icon bar.
* History: * History: IDJ: 05-Feb-92: prepared for source release
* 21-Mar-88 WRS extracted from ArcEdit *
* 14-Apr-89 IDJ fixed Cast problem in baricon__win_event_handler
* usr function was passed in via void *handle. It is now
* (under C3.00), illegal to cast it back to func ptr.
* 6-Jun-89 IDJ last minute hack - added baricon_newsprite
* 7-Jun-89 IDJ extra hack. Roger says redraw of icon bar not good,
* so do horrible grubbies to stop this
* 13-Mar-90 IDJ allow multiple calls to baricon (ie remove some statics).
* set icon size correctly (thanks for help from Neil)
* 24-Apr-90 IDJ added baricon_text_and_sprite()
* 23-Jul-90 LDS/IDJ added baricon_left (split baricon into do_baricon)
* 08-May-91 ECN #ifndefed out unused ROM functions
* 09-May-91 ECN use swi names instead of nos.
*/ */
#include <string.h> #include <string.h>
...@@ -57,13 +73,15 @@ static void baricon__win_event_handler(wimp_eventstr *e, void *handle) ...@@ -57,13 +73,15 @@ static void baricon__win_event_handler(wimp_eventstr *e, void *handle)
handle = handle; handle = handle;
tracef1("icon bar event %i.\n", e->e); tracef1("icon bar event %i.\n", e->e);
if (e->e == wimp_EBUT) { /* key click */ if (e->e == wimp_EBUT)
if ((e->data.but.m.bbits & wimp_BLEFT) != 0) { { /* key click */
if ((e->data.but.m.bbits & wimp_BLEFT) != 0)
{
/* left click : call registered handler */ /* left click : call registered handler */
tracef0("icon bar left click.\n"); tracef0("icon bar left click.\n");
(*baricon__leftclickproc)(e->data.c.i); (*baricon__leftclickproc)(e->data.c.i);
}; }
}; }
} }
static wimp_icreate baricon__i; /* icon structure */ static wimp_icreate baricon__i; /* icon structure */
...@@ -76,11 +94,9 @@ static wimp_i do_baricon( ...@@ -76,11 +94,9 @@ static wimp_i do_baricon(
char *spritename, int spritearea, baricon_clickproc proc, int L_or_R) char *spritename, int spritearea, baricon_clickproc proc, int L_or_R)
{ {
/* 13-Mar-90: IDJ added code to set icon size correctly */
sprite_info result; sprite_info result;
os_regset r; os_regset r;
/* don't use sprite.c 'cos it's rubbish */
r.r[0] = 40; /* read sprite info */ r.r[0] = 40; /* read sprite info */
if (spritearea != 0 && spritearea != 1) /* not system/wimp sprite pool */ if (spritearea != 0 && spritearea != 1) /* not system/wimp sprite pool */
r.r[0] += 256; r.r[0] += 256;
...@@ -138,12 +154,10 @@ static wimp_i do_baricon_textandsprite(char *spritename, char *text, ...@@ -138,12 +154,10 @@ static wimp_i do_baricon_textandsprite(char *spritename, char *text,
int bufflen, int spritearea, baricon_clickproc proc, int L_or_R) int bufflen, int spritearea, baricon_clickproc proc, int L_or_R)
{ {
/* 13-Mar-90: IDJ added code to set icon size correctly */
sprite_info result; sprite_info result;
os_regset r; os_regset r;
wimpt_checkmode(); wimpt_checkmode();
/* don't use sprite.c 'cos it's rubbish */
r.r[0] = 40; /* read sprite info */ r.r[0] = 40; /* read sprite info */
if (spritearea != 0 && spritearea != 1) /* not system/wimp sprite pool */ if (spritearea != 0 && spritearea != 1) /* not system/wimp sprite pool */
r.r[0] += 256; r.r[0] += 256;
......
...@@ -12,31 +12,24 @@ ...@@ -12,31 +12,24 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/**************************************************************************** /************************************************************************/
* This source file was written by Acorn Computers Limited. It is part of * /* Acorn Computers Ltd, 1992. */
* the "cwimp" library for writing applications in C for RISC OS. It may be * /* */
* used freely in the creation of programs for Archimedes. It should be * /* This file forms part of an unsupported source release of RISC_OSLib. */
* used with Acorn's C Compiler Release 2 or later. * /* */
* * /* It may be freely used to create executable images for saleable */
* No support can be given to programmers using this code and, while we * /* products but cannot be sold in source form or as an object library */
* believe that it is correct, no correspondence can be entered into * /* without the prior written consent of Acorn Computers Ltd. */
* concerning behaviour or bugs. * /* */
* * /* If this file is re-distributed (even if modified) it should retain */
* Upgrades of this code may or may not appear, and while every effort will * /* this copyright notice. */
* be made to keep such upgrades upwards compatible, no guarantees can be * /* */
* given. * /************************************************************************/
***************************************************************************/
/* /*
* Title : c.bbc * Title : c.bbc
* Purpose: provides bbc-style graphics and mouse/keyboard control * Purpose: provides bbc-style graphics and mouse/keyboard control
* Version: 0.1 * History: IDJ: 05-Feb-92: prepared for source release
* 0.2 RCM all bbc_xxxx routines now return ->os_error
* 0.3 SKS tidied up. Fixed bbc_soundoff AGAIN (someone had UNfixed it)
* fixed bbc_adval to be useful.
* 12-Apr-89 IDJ Fixed header name
* 13-Mar-90 IDJ fixed bbc_vpos
* 08-May-91 ECN #ifndefed out unused ROM functions
*/ */
#define BOOL int #define BOOL int
...@@ -141,7 +134,7 @@ int bbc_modevar (int mode, int varno) ...@@ -141,7 +134,7 @@ int bbc_modevar (int mode, int varno)
{ int flags, result; { int flags, result;
if (_swix (OS_ReadModeVariable, _IN (0) | _IN (1) | _OUT (2) | _OUT (_FLAGS), if (_swix (OS_ReadModeVariable, _INR(0,1)|_OUT(2)| _OUT(_FLAGS),
mode, varno, &result, &flags) != NULL || (flags & _C) != 0) mode, varno, &result, &flags) != NULL || (flags & _C) != 0)
return -1; return -1;
...@@ -552,7 +545,7 @@ int bbc_adval(int x) ...@@ -552,7 +545,7 @@ int bbc_adval(int x)
int dmy; int dmy;
os_byte(0x80, &x, &dmy); os_byte(0x80, &x, &dmy);
return x; return x;
}; }
} }
#endif #endif
......
/* 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.
*/
/************************************************************************/
/* © Acorn Computers Ltd, 1992. */
/* */
/* This file forms part of an unsupported source release of RISC_OSLib. */
/* */
/* It may be freely used to create executable images for saleable */
/* products but cannot be sold in source form or as an object library */
/* without the prior written consent of Acorn Computers Ltd. */
/* */
/* If this file is re-distributed (even if modified) it should retain */
/* this copyright notice. */
/* */
/************************************************************************/
/* Copyright 1996 Acorn Computers Ltd /* Copyright 1996 Acorn Computers Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -15,9 +43,8 @@ ...@@ -15,9 +43,8 @@
/* /*
* Title: colourmenu.c * Title: colourmenu.c
* Purpose: create a wimp colour setting menu * Purpose: create a wimp colour setting menu
* Status: system_independent * History: IDJ: 05-Feb-92: prepared for source release
* History: *
* 22-Sep-88: DAHE: created (based loosely on some old ArcDraw codes)
*/ */
#define BOOL int #define BOOL int
...@@ -41,7 +68,8 @@ ...@@ -41,7 +68,8 @@
*/ */
menu colourmenu_make(char *title, BOOL includeNone) menu colourmenu_make(char *title, BOOL includeNone)
{ menu m; {
menu m;
wimp_menuhdr *dptr; wimp_menuhdr *dptr;
wimp_menuitem *iptr; /* Very mode dependent */ wimp_menuitem *iptr; /* Very mode dependent */
wimp_palettestr palette; wimp_palettestr palette;
......
/* 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.
*/
/************************************************************************/
/* Acorn Computers Ltd, 1992. */
/* */
/* This file forms part of an unsupported source release of RISC_OSLib. */
/* */
/* It may be freely used to create executable images for saleable */
/* products but cannot be sold in source form or as an object library */
/* without the prior written consent of Acorn Computers Ltd. */
/* */
/* If this file is re-distributed (even if modified) it should retain */
/* this copyright notice. */
/* */
/************************************************************************/
/* Copyright 1996 Acorn Computers Ltd /* Copyright 1996 Acorn Computers Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -15,17 +43,11 @@ ...@@ -15,17 +43,11 @@
/* /*
* Title: colourtran.c * Title: colourtran.c
* Purpose: C interface to the ColourTrans SWIs * Purpose: C interface to the ColourTrans SWIs
* Author: IDJ * History: IDJ: 05-Feb-92: prepared for source release
* History: *
* 10-Apr-89 IDJ Created
* 08-May-91 ECN #ifndefed out unused functions
* 17-Jun-91: IDJ: return_GCOLformode put back for paint
* 28-Oct-94: AMcC: Include colourtran_return_colourformode in ROM (for Paint)
*/ */
#ifndef __stddef_h
#include <stddef.h> #include <stddef.h>
#endif
#include "colourtran.h" #include "colourtran.h"
#include "os.h" #include "os.h"
#include "wimp.h" #include "wimp.h"
......
...@@ -12,8 +12,26 @@ ...@@ -12,8 +12,26 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* ->c.wimpextra */ /************************************************************************/
/* Extra routine for common wimpish things */ /* Acorn Computers Ltd, 1992. */
/* */
/* This file forms part of an unsupported source release of RISC_OSLib. */
/* */
/* It may be freely used to create executable images for saleable */
/* products but cannot be sold in source form or as an object library */
/* without the prior written consent of Acorn Computers Ltd. */
/* */
/* If this file is re-distributed (even if modified) it should retain */
/* this copyright notice. */
/* */
/************************************************************************/
/*
* Title: coords.c
* Purpose: mapping of screen/window coords
* History: IDJ: 05-Feb-92: prepared for source release
*
*/
#include "h.wimp" #include "h.wimp"
...@@ -69,111 +87,6 @@ void coords_point_toworkarea(coords_pointstr *point, coords_cvtstr *cvt) ...@@ -69,111 +87,6 @@ void coords_point_toworkarea(coords_pointstr *point, coords_cvtstr *cvt)
point->y = coords_y_toworkarea(point->y, cvt); point->y = coords_y_toworkarea(point->y, cvt);
} }
#if FALSE
/*
Function : point_to_workarea_by_handle
Purpose : convert a point from screen to workarea coordinates
Parameters : IN/OUT: pointer to point
window handle
Returns : void
Description :
*/
void point_to_workarea_by_handle(pointstr *point, wimp_w handle)
{ wimp_wstate windowState;
/* Read window state */
wimpt_complain(wimp_get_wind_state(handle, &windowState));
/* Do conversion */
point->x = x_to_workarea(point->x, Convert(windowState.o));
point->y = y_to_workarea(point->y, Convert(windowState.o));
}
/*
Function : box_to_workarea_by_handle
Purpose : convert a box from screen to workarea given window handle
Parameters : pointer to box
window handle
Returns : void
Description :
*/
void box_to_workarea_by_handle(wimp_box *box, wimp_w handle)
{ wimp_wstate windowState;
/* Read window state */
wimpt_complain(wimp_get_wind_state(handle, &windowState));
/* Do conversion */
box_to_workarea(box, Convert(windowState.o));
}
/*----------------------- Mode and palette routines -------------------------*/
/*
Data Group : static mode and palette data
Description :
*/
/* Data block for recording the palette - set up on a mode or palette change */
static wimp_palettestr palette;
static struct
{