The library to be known officially as "DeskLib 2.30 [RM/32]" is a 32bit version of DeskLib version 2.30.

 

I cannot take credit for DeskLib. It was originally written by Julian Smith and other people. I have simply made this version 32bit and (finally) incorporated all the stuff I kept meaning to add... :-)

 

 

Why DeskLib 2.30? That's ancient!

 

Yup. That's right.

However... Since DeskLib v3.20 and the later "Desk" library required all of the functions and globals to be prefixed "Desk_", I never bothered to do an upgrade.

I later discovered that DeskLib 3.20 (& Desk) attempt to use a central error handling mechanism. This is good in that it'll catch stuff that I (or you?) might miss, but it'd royally screw up my own error handling. I don't mind upgrading to newer versions of libraries, but I don't fancy rewriting half of my applications in order to do so. So, I stayed with DeskLib v2.30.

 

 

Don't you suffer name clashes?

 

Not a single one!

 

I see people with DeskLib, RISC_OSLib, OSLib, ThisLib, ThatLib, and even SomeOtherDamnLib... WHY!? I can understand UnixLib if you're into porting stuff, and I've used Jason Tribbeck's ROVLib when working on NewsAgent, but I myself (or "moi-même" in French, I think that's cute) only use DeskLib.

Indeed, all of these libraries offer the same RISC OS functionality for stuff like Wimp, SYS calls, and all the cruft that you wouldn't ever find in a 'standard' C library. Apart from the supposed "typing", how does OSLib differ from DeskLib when you get down to it? My logic? Pick one and go with it. I have. DeskLib.

Actually, DeskLib may be better (than OSLib) as the library itself offers routines for attaching events to windows, icons, and the like.

 

If you are like me and you use SharedCLib and DeskLib only, you'll have no problem.

 

If you use a billion libraries that all do pretty much the same thing, you might run into all sorts of chaos.

 

 

How to use it

 

For you, and for me, if you use DeskLib 2.30, simply recompile with this library!

It is called "DeskLib32" so you can bung it in your DeskLib.o directory and use it alongside the older 26bit version, should that be necessary. Note that you will come unstuck if you try using 26bit code in a 26/32 neutral application...

Simply alter your MakeFile as required.

 

 

Is it really that simple?

 

Yes. When my !OvHTML went 32bit, the library stuff was 'converted' simply by changing the library "DeskLib" in the MakeFile to "DeskLib32". Obviously some of the assembler in the project needed alteration, but so far as the library support it concerned, it wasn't difficult.

 

 

There's already a 32bit DeskLib!

 

Version 2.30?

There is, if I remember correctly, a 32bit version of Desk. I believe Peter Naull's website links to it (sorry, I don't have the URL to hand).

 

 

What new stuff is in this version?

 

Turn the page...

API changes:

 

It may be assumed that if nothing is mentioned, then the details in the existing DeskLib v2.30 header applies...i.e. no API change.

 

In all cases, if you are calling any of these functions, or any other DeskLib function, from assembler - please be aware that flags are not restored on function exit.

BackTrace (new - based on DeskLib 3.20):

Added "BackTrace_OutputToStdErr".

Added "BackTrace_OutputToStreamWithPrefix".

Added "BackTrace_GetNestingDepth".

Added "BackTrace_GetFrameInfo".

Added "BackTrace_GetFunctionName".

Added "BackTrace_GetCurrentFunctions".

Added "BackTrace_OutputToFFunctionWithPrefix".

 

Note that file pointers, if required, are standard library file pointers (i.e., the "fopen(..)" kind), not the DeskLib ("File_Open(..)") kind.

 

ColourTrans (updated):

Added "ColourTrans_ReturnColourNumber";

returns '-1' on error.

Added "ColourTrans_ReturnGCOL";

returns '-1' on error.

 

These return '-1' and not '0' as '0' is a valid colour/GCOL.

 

Added macros "ColourTrans_RGB",

"ColourTrans_SetGCOL2", and

"ColourTrans_SetGCOL3" from DeskLib 3.20.

 

 

CPU (new):

Added "CPU_Mode".

Added "CPU_ID".

Added "CPU_Type".

Added "CPU_Class".

 

These functions return the expected results on an ARM710 RiscPC, and may need testing on other machines. Note that the 32bit library appears to make you believe you're running in 32bit.

 

 

Dialog (bug fix):

 

Fatal bug which caused crash (of entire machine...) should be fixed. This occurred if you click the close icon of a dialog displayed as a menu, i.e., one that hasn't been opened 'static'. Was fixed in DeskLib 3.20 (and later) sources, but present in 2.30...

 

 

DynamArea (new - based on DeskLib 3.20):

Added "DynamicArea_Create".

Added "DynamicArea_Delete".

Added "DynamicArea_DeleteAll".

Added "DynamicArea_SetSize".

 

 

File (updated):

Added "File_CreateDirectory";

returns '0' if failed.

 

 

Hourglass (updated):

Added "Hourglass_LEDs".

 

 

KernelSWIs (partially based on DeskLib 3.20):

Added "OS_ReadVarVal_GetLength_Raw".

Added "OS_ReadCMOS".

Added "OS_WriteCMOS".

 

 

Menu (updated):

Added "Menu_Recreate".

 

Misc (new):

Added "Misc_WordAlign".

Added "Misc_PageAlign".

Added "Misc_PageSize".

Added "Misc_PageCount".

Added "Misc_MemorySize".

 

 

Module (updated):

Added "Module_Lookup".

Added "Module_LookupAddress".

Added "Module_LookupAddresses".

 

 

 

Resource (updated):

Added "Resource_SetResDir".

 

The variable "resource_pathname" is now longer, to allow for this.

 

Str (updated):

Added "strcattcr";

like "strcatcr", but allows TAB characters.

Added "strcpytcr";

like "strcpycr", but allows TAB characters.

 

 

Terri (new, incomplete)

char *Terri_ReturnPath(char *resource_path);

This function only really exists to support "Resource_SetResDir", it is described here for completeness and in case you need it...

 

The "Terri" module will eventually include a variety of other Territory-specific functions.

 

 

Wimp (updated):

Added "Wimp_PlotIcon2".

 

Window (updated):

Added "Window_Open".

Added "Window_ShowCentred".

Added "Window_ShowWherever"

(and "Window_ShowWhereever" alias).

 

 

This is a work-in-progress, though I've not worked on it for a while (other things to do, you see!), however I hope before too long to have the following included within DeskLib v2.30 [RM/32]:

 

 Support for the serial blockdrivers

 Support for sounds, possibly PlayIt veneers

 Territory support (like, given a number, format

it as a currency value, 1234.56 ® "£1,234.56")

 Time conversions and validations

 etc...

 

If you have any ideas, please let me know!

http://www.heyrick.co.uk/software/desklib.html

 


Copyright © 2004