Commit b0ad6831 authored by Steve Revill's avatar Steve Revill
Browse files

UK Res file tweaks.

Now detects the version of fontmanager running and adjusts the step size
of the cache limits from 4k to 64k accordingly.

Version 0.07. Tagged as 'FontSetup-0_07'
parent c4ba1ef6
......@@ -55,6 +55,7 @@ ELIB = Tbox:o.eventlib
TLIB = Tbox:o.toolboxlib
WLIB = Tbox:o.wimplib
CONLIB = <Lib$Dir>.ConfigLib.o.ConfigLib
RMVSN = C:RMVersion.o.RMVersion
#
# Include files
......@@ -114,7 +115,7 @@ clean:
# Static dependencies:
#
${RDIR}.!RunImage: ${OBJS} ${CONLIB} ${ELIB} ${TLIB} ${WLIB} ${CLIB}
${LD} ${LDFLAGS} -o $@ ${OBJS} ${CONLIB} ${ELIB} ${TLIB} ${WLIB} ${CLIB}
${LD} ${LDFLAGS} -o $@ ${OBJS} ${RMVSN} ${CONLIB} ${ELIB} ${TLIB} ${WLIB} ${CLIB}
${SQUEEZE} $@
#---------------------------------------------------------------------------
......
_TaskName:Fonts Setup
_Purpose:Configuring fonts
_Author: Acorn Computers Ltd, 1998
_Version:0.05 (28-Aug-98)
_Version:0.07 (19-Dec-02)
_ConfigText:Fonts
_ConfigHelp:Click SELECT to open the font configuration window.
_ConfigSprite:co_fonts
......
No preview for this file type
/* (0.06)
/* (0.07)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 0.06
#define Module_MajorVersion_CMHG 0.07
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Dec 2002
#define Module_Date_CMHG 19 Dec 2002
#define Module_MajorVersion "0.06"
#define Module_Version 6
#define Module_MajorVersion "0.07"
#define Module_Version 7
#define Module_MinorVersion ""
#define Module_Date "14 Dec 2002"
#define Module_Date "19 Dec 2002"
#define Module_ApplicationDate "14-Dec-02"
#define Module_ApplicationDate "19-Dec-02"
#define Module_ComponentName "FontSetup"
#define Module_ComponentPath "RiscOS/Sources/SystemRes/Configure2/PlugIns/FontSetup"
#define Module_FullVersion "0.06"
#define Module_HelpVersion "0.06 (14 Dec 2002)"
#define Module_LibraryVersionInfo "0:6"
#define Module_FullVersion "0.07"
#define Module_HelpVersion "0.07 (19 Dec 2002)"
#define Module_LibraryVersionInfo "0:7"
......@@ -41,6 +41,8 @@ Date Who Change
#include "cmos.h"
#include "misc.h"
#include "str.h"
/* Support */
#include "RMVersion/RMVersion.h"
/* local headers */
#include "DeskFont.h"
#include "Main.h"
......@@ -51,9 +53,38 @@ const cmos cmos_details [7] = { { 0x8C, 1, 4 }, /* WimpFont */
{ 0xCB, 0, 8 }, /* FontMax3 EOR 24 */
{ 0xCC, 0, 8 }, /* FontMax4 */
{ 0xCD, 0, 8 }, /* FontMax5 */
{ 0x86, 0, 8 }, /* FontSize / 4K */
{ 0xC8, 0, 8 } }; /* FontMax / 4K */
{ 0x86, 0, 8 }, /* FontSize / fontstepsizeK */
{ 0xC8, 0, 8 } }; /* FontMax / fontstepsizeK */
/* Global variables */
unsigned int fontstepsize = 4;
/****** setup_gadgets_by_fontmanager() ************************************\
Purpose: Different versions of the Font Manager module place different
interpretations upon the CMOS values for the configured font
cache size and maximum size. For example, versions < 3.42
multiply the stored value by 4 KB whereas versions >= 4.32
will multiply it by 64 KB.
In: -
Out: -
\**************************************************************************/
void setup_gadgets_by_fontmanager (void)
{
unsigned int version;
/* Font cache size is defined in multiples of n KB depending upon FontManager version */
throw (rmversion (rmversion_RAM, "FontManager", &version));
if (version >= 0x34200)
fontstepsize = 64;
else
fontstepsize = 4;
throw (numberrange_set_bounds (0x7, mainwindow_id, mainwindow_cacheinit, 0, 255*fontstepsize, fontstepsize, 0));
throw (numberrange_set_bounds (0x7, mainwindow_id, mainwindow_cachelimit, 0, 255*fontstepsize, fontstepsize, 0));
}
/****** settings_read() ***************************************************\
......@@ -117,10 +148,10 @@ void settings_read (int(*get)(cmos item, void *messages))
}
throw (numberrange_set_value (0, mainwindow_id, mainwindow_vertaa, fontmax5));
value = get (FontSize, &messages) * 4;
value = get (FontSize, &messages) * fontstepsize;
throw (numberrange_set_value (0, mainwindow_id, mainwindow_cacheinit, value));
value = get (FontMax, &messages) * 4;
value = get (FontMax, &messages) * fontstepsize;
throw (numberrange_set_value (0, mainwindow_id, mainwindow_cachelimit, value));
}
......@@ -173,7 +204,7 @@ BOOL settings_write (void)
DeskFont_Set (status_file, string);
throw (numberrange_get_value (0, mainwindow_id, mainwindow_cachelimit, &fontmax));
fontmax >>= 2;
fontmax /= fontstepsize;
cmos_write (FontMax, fontmax);
fontmax1 = _swi (Font_ReadFontMax, _RETURN(1)); /* remember current setting of FontMax1 */
......@@ -211,7 +242,7 @@ BOOL settings_write (void)
_swi (Font_SetFontMax, _INR(0,7), fontmax, fontmax1, fontmax2, fontmax3, fontmax4, fontmax5, 0, 0);
throw (numberrange_get_value (0, mainwindow_id, mainwindow_cacheinit, &fontsize));
cmos_write (FontSize, fontsize >> 2);
cmos_write (FontSize, fontsize / fontstepsize );
sprintf (string, "ChangeDynamicArea -FontSize %dK", fontsize);
_swix (OS_CLI, _IN(0), string);
......
......@@ -179,6 +179,7 @@ static int toolboxe_objectautocreated (int event_code, ToolboxEvent *event, IdBl
{
mainwindow_id = id_block->self_id;
misc_openwindow (mainwindow_id, TRUE);
setup_gadgets_by_fontmanager ();
settings_read (cmos_read);
if (!(2 & _swi (OS_File, _INR(0,1)|_RETURN(0), 17, "<FontSetup$Dir>.!FontMerge")))
misc_shadecomponents (TRUE, mainwindow_id, mainwindow_fontinstall, mainwindow_fontinstall);
......
......@@ -75,10 +75,12 @@ Date Who Change
/* Global variables */
extern const cmos cmos_details [];
extern unsigned int fontstepsize;
/* Prototypes */
extern void settings_read (int(*get)(cmos item, void *messages));
extern BOOL settings_write (void);
extern void setup_gadgets_by_fontmanager (void);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment