DeskLib: Difference between revisions

From RISC OS
Jump to navigationJump to search
m (→‎Medium Priority: Debug changes done)
 
(15 intermediate revisions by 3 users not shown)
Line 3: Line 3:
==Introduction==
==Introduction==


DeskLib is a fully-sourced, general-purpose freeware C library for writing desktop applications for RISC OS. It provides comprehensive support for window and icon manipulation, menu creation, graphics routines, message handling, filing operations, font handling, string manipulation and much more. High level event management functions are provided in order to build coherent and powerful code.
DeskLib is a general-purpose freeware C library for writing desktop applications for RISC OS. It provides comprehensive support for window and icon manipulation, menu creation, graphics routines, message handling, filing operations, font handling, string manipulation and much more. High level event management functions are provided in order to build coherent and powerful code. DeskLib provides numerous examples for novice programmers, and avoids having to worry about details of low-level RISC OS programming.


==Download==
==Download==


===Latest Release===
===Current Release===

The current version of DeskLib is 2.80, released in July 2007. It is available for installation using [[RiscPkg]] or can be downloaded from here:
The current version is 3.00, and is ELF-only for use with latest versions of [[GCC]]
*[http://www.riscos.info/downloads/DeskLib-2.80/core.zip Core] contains everything needed to use the library, including documentation.

*[http://www.riscos.info/downloads/DeskLib-2.80/examples.zip Examples] has practical examples on how to use the different parts of DeskLib.
* Coming soon
*[http://www.riscos.info/downloads/DeskLib-2.80/source.zip Source] contains the C and assembler source which makes up the library functions. (Note: this part is not included in the RiscPkg package.)

===Older Releases===

The last AOF release, for use with older versions of GCC (3.4.6) and the Castle C/C++ compiler is 2.80:

* [http://www.riscos.info/downloads/desklib/DeskLib-2.80/core.zip Core] contains everything needed to use the library, including documentation.
* [http://www.riscos.info/downloads/desklib/DeskLib-2.80/examples.zip Examples] has practical examples on how to use the different parts of DeskLib.
* [http://www.riscos.info/downloads/desklib/DeskLib-2.80/source.zip Source] contains the C and assembler source which makes up the library functions. (Note: this part is not included in the RiscPkg package.)


===Changes===
===Changes===
Changes since version 2.70 include:
* Several important bugfixes, optimisations and a couple of API changes in Sprite.
* Provided 'sprite by pointer' in addition to 'sprite by name' routines (named as Sprite_*P()).
* Added Sprite_SetPointerShape()/Sprite_SetPointerShapeP().
* Some extra examples
* Tinct support
* Rationalised documentation including an updated StrongHelp manual
* Minor additions to the Icon and Window modules


For older changes, see the [[DeskLib Changes|changes]] page.
* Full list of [[DeskLib Changes]]


==Documentation==
==Documentation==
Line 36: Line 36:


===Source===
===Source===
The sources for DeskLib are held in a [[Source_repositories_overview#DeskLib|subversion repository]] on riscos.info. Read access is available to all, either by checking out the project with svn or by viewing via the [http://www.riscos.info/websvn/listing.php?repname=DeskLib&path=%2F&sc=0 WebSVN] web interface.
The sources for DeskLib are held in a [[Source_repositories_overview#DeskLib|subversion repository]] on riscos.info. Read access is available to all, either by checking out the project with svn or by viewing via the [http://www.riscos.info/websvn/listing.php?repname=DeskLib&path=%2F&sc=0 WebSVN] web interface. The trunk should always build, though there is no guarantee that the ABI of any new functionality will remain constant.


To make contributions, post to the [http://groups.google.co.uk/group/desklib?hl=en DeskLib mailing list] with patches or a request for svn write access.
To make contributions, post to the [http://groups.google.co.uk/group/desklib?hl=en DeskLib mailing list] with patches or a request for svn write access.
Line 56: Line 56:


====Compiling under RISC OS====
====Compiling under RISC OS====
To compile under RISC OS using GCC, set the current directory to <code>!DLSources</code> and either run the <code>MakeDeskLib</code> file or open a taskwindow and type:
To compile under RISC OS using GCC, either run the <code>MakeDeskLib</code> file (found inside <code>!DLSources</code>) or set the current directory to <code>!DLSources</code>, then open a taskwindow and type:
* make
* make


Line 67: Line 67:
*'''ELF''': Move to ELF format with GCC 4.x <br>''Status'': In progress (see <code>trunk</code> in svn repository)
*'''ELF''': Move to ELF format with GCC 4.x <br>''Status'': In progress (see <code>trunk</code> in svn repository)


*'''Documentation''': Cleaning up and rationalisation. For instance, 10-year old notes need bringing up to date or removing.<br>''Status'': Provisional changes checked in to AOF branch
*'''Namespace''': Prefix all DeskLib objects with <code>dl_</code>. Create a "compatibility" header file with a set of macros to map old names to new scheme along with an automated tool to permanently change source code to use the new scheme.<br>''Status'': -

*'''Documentation''': Cleaning up and rationalisation. For instance, 10-year old notes need bringing up to date or removing.<br>''Status'': -


*'''OSLib Integration''': Use OSLib SWI calls in DeskLib.<br>''Status'': -
*'''OSLib Integration''': Use OSLib SWI calls in DeskLib.<br>''Status'': -
Line 76: Line 74:
*'''Multi-tasking message windows''': Provide standard message windows, perhaps with a set of handlers to deal with simple yes/no input from end user.<br>''Status'': -
*'''Multi-tasking message windows''': Provide standard message windows, perhaps with a set of handlers to deal with simple yes/no input from end user.<br>''Status'': -


*'''New error handling routines''': Re-think how DeskLib handles run-time errors. See old notes in current documentation and the changes made to Desk.<br>''Status'': -
*'''New error handling routines''': Re-think how DeskLib handles run-time errors. See old notes in current documentation and the changes made to Desk. Possibly just add a Error_Initialise function which takes an error handler, then call that from the Error routines.<br>''Status'': -


*'''Wimp_ReportError Updates''': Update the Error functions to use the extensions included in RISC OS 3.6 - for instance including the program icon in the error window.<br>''Status'': -
*'''Wimp_ReportError Updates''': Update the Error functions to use the extensions included in RISC OS 3.6 - for instance including the program icon in the error window.<br>''Status'': -


*'''Initialisation Routines''': Rationalise some of the "init" functions, for instance in the Template and Resource modules. Possibly create a new framework to create a skeleton app with just one set-up function.<br>''Status'': In progress (AR)
*'''Initialisation Routines''': Rationalise some of the "init" functions, for instance in the Template and Resource modules.<br>''Status'': Changes checked in to AOF branch


*'''Parameter Checking''': Values passed to DeskLib functions should be checked that they are not invalid and dealt with accordingly, to improve stability.<br>''Status'': -
*'''Parameter Checking''': Values passed to DeskLib functions should be checked that they are not invalid and dealt with accordingly, to improve stability.<br>''Status'': -


*'''Build to C99 Standard''': Build library to C99 and make use of new functions such as <code>snprintf</code> (rather than <code>sprintf</code>) throughout to improve stability.<br>''Status'': -
*'''Build to C99 Standard''': Build library to C99 and make use of new functions such as <code>snprintf</code> (rather than <code>sprintf</code>) throughout to improve stability.<br>''Status'': Changes checked in to AOF branch


*'''SysLog''': Add SysLog functionality (& possibly include in a Debug library). (Wait for conclusion to priority scheme as noted on GCCDSK mailing list.)<br>''Status'': In progress (AR)
*'''SysLog''': Add SysLog functionality.<br>''Status'': Changes checked in to AOF branch (in Environment module)


*'''Makefiles QA''': The various makefiles have been amended and adapted over time and need checking/re-writing.<br>''Status'': -
*'''Makefiles QA''': The various makefiles have been amended and adapted over time and need checking/re-writing.<br>''Status'': -


*'''Code Audit''': Examine existing code to determine its status - for instance, the Tinct module is written, but has no documentation; the clipboard module is half-written; some code can be retired as it's only needed for RISC OS 2; etc.<br>''Status'': -
*'''Code Audit''': Examine existing code to determine its status - for instance, the Tinct module is written, but has no documentation; the clipboard module is half-written; some code can be retired as it's only needed for RISC OS 2; etc.<br>''Status'': CSV database checked in to AOF branch (AR)


*'''Debug Library Changes''': Move the debug functions into the main library binary and alter <code>Debug_Initialise</code> to accept some parameter to determine which set of debug functionality is used. (As this will alter the API, need to ensure the namespace-change task, above, copes with it.)<br>''Status'': Complete. Checked in to AOF branch.
*'''Debug Library Changes''': Move the debug functions into the main library binary and alter <code>Debug_Initialise</code> to accept some parameter to determine which set of debug functionality is used. (As this will alter the API, need to ensure the namespace-change task, above, copes with it.)<br>''Status'': Provisional changes checked in to AOF branch.

*'''Module Rationalisation''': Some modules are only present for compatibility reasons, others could be merged (e.g. ColourMenu module only has one function which ought to fit neatly in the Menu module and the several of the KernelSWIs functions would fit better elsewhere). Tidy up these issues.<br>''Status'': Changes checked in to AOF branch


====Low Priority====
====Low Priority====
Line 106: Line 106:
*'''Internal Debugging''': Create internal debugging messages - for instance, see Menu2 module.<br>''Status'': -
*'''Internal Debugging''': Create internal debugging messages - for instance, see Menu2 module.<br>''Status'': -


*'''Environment Module''': Create new module to include functions such as manipulating system variables, listing running tasks, modules etc<br>''Status'': In progress (AR)
*'''Environment Module''': Create new module to include functions such as manipulating system variables, listing running tasks, modules etc<br>''Status'': First draft checked in to AOF branch


*'''Reporter Debug Library''': Create debug library which makes use of the Reporter module.<br>''Status'': In progress (AR)
*'''Reporter Debug Library''': Create debug library which makes use of the Reporter module.<br>''Status'': Checked in to AOF branch.


*'''ZapRedraw Support''': New module to interface to ZapRedraw<br>''Status'': -
*'''ZapRedraw Support''': New module to interface to ZapRedraw<br>''Status'': -
Line 114: Line 114:
*'''Tabs''': Tabbed window support.<br>''Status'': -
*'''Tabs''': Tabbed window support.<br>''Status'': -


*'''Writable Icons''': Provide means to intelligently check input to writable icons. This could be done by using A in the validation string then claiming all keypresses, allowing things like only allowing any number between x and y, including decimal parts; converting all characters to lower/upper case; any other validation function you choose.<br>''Status'':-
*'''KernelSWIs Module''': This module currently provides a slightly random set of functions based on <code>OS*</code> SWIs. The functionality would be better placed in other modules, based on function rather than SWI name. A KernelSWIs header file containing <code>#include</code>s for the new locations could be created for backwards compatibility.<br>''Status'': -

*'''Window Opening''': Expand the number of window_OPENPOSs to include things like opening: not over the caret, in spare screen space, centred over another window. Could also deal intelligently with multiple monitor setups.<br>''Status'':-


==Support==
==Support==
If you have questions either about the use of DeskLib or about building it, please either ask on the [http://groups.google.co.uk/group/comp.sys.acorn.programmer/topics?hl=en comp.sys.acorn.programmer usenet group] or the [http://groups.google.co.uk/group/desklib?hl=en DeskLib mailing list]. (The mailing list can be joined by sending an email to [mailto:desklib-subscribe@googlegroups.com desklib-subscribe@googlegroups.com].)
If you have questions either about the use of DeskLib or about building it, please either ask on the [http://groups.google.co.uk/group/comp.sys.acorn.programmer/topics?hl=en comp.sys.acorn.programmer Usenet group] or the [http://groups.google.co.uk/group/desklib?hl=en DeskLib mailing list]. (The mailing list can be joined by sending an email to [mailto:desklib-subscribe@googlegroups.com desklib-subscribe@googlegroups.com].)

Latest revision as of 22:37, 22 November 2015

C Wimp Library for RISC OS

Introduction

DeskLib is a general-purpose freeware C library for writing desktop applications for RISC OS. It provides comprehensive support for window and icon manipulation, menu creation, graphics routines, message handling, filing operations, font handling, string manipulation and much more. High level event management functions are provided in order to build coherent and powerful code. DeskLib provides numerous examples for novice programmers, and avoids having to worry about details of low-level RISC OS programming.

Download

Current Release

The current version is 3.00, and is ELF-only for use with latest versions of GCC

  • Coming soon

Older Releases

The last AOF release, for use with older versions of GCC (3.4.6) and the Castle C/C++ compiler is 2.80:

  • Core contains everything needed to use the library, including documentation.
  • Examples has practical examples on how to use the different parts of DeskLib.
  • Source contains the C and assembler source which makes up the library functions. (Note: this part is not included in the RiscPkg package.)

Changes

Documentation

Manuals

Descriptions of the functions, structures, types etc are included with the Core download in StrongHelp format, or you can browse an unofficial online HTML version. The download also includes various notes and updates which can be accessed from the Help option on the filer menu for the applications.

Tutorials & Examples

Development

Source

The sources for DeskLib are held in a subversion repository on riscos.info. Read access is available to all, either by checking out the project with svn or by viewing via the WebSVN web interface. The trunk should always build, though there is no guarantee that the ABI of any new functionality will remain constant.

To make contributions, post to the DeskLib mailing list with patches or a request for svn write access.

Properties

Subversion allows 'properties' to be set for files in the repository and a number of conventions should be followed when creating or modifying files:

  • svn:executable should be unset for all files
  • svn:mime-type should be set equal to some non-text value (for instance application/octet-stream) for binary files
  • svn:eol-style should be set to native for all text-based files, and should not be set for binary files

Building

DeskLib is built, as standard, using GCC, though it should still build using other compilers. It can be built using the GCC cross-compiler; natively using GCC; or using the GCCSDK autobuilder.

Cross-compiling using GCCSDK

To build from the sources using GCCSDK, make sure the current work directory is !DLSources and use:

$ make -f Makefile.unix

(Remember to escape the !s - e.g. cd \!DLSources.) Note that for the cross-compile build to be successful, the environment variable GCCSDK_INSTALL_CROSSBIN needs to be present. If you don't have this set already and you've followed the standard installation instructions for GCCSDK then adding the line:

GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin

to the start of the makefile will set the variable for you (if it's unset).

Compiling under RISC OS

To compile under RISC OS using GCC, either run the MakeDeskLib file (found inside !DLSources) or set the current directory to !DLSources, then open a taskwindow and type:

* make  

Roadmap

The next major release of DeskLib will be version 3.0 and will be ELF-based, requiring GCC 4.x. The following is a list of potential work which could be done on DeskLib. Items with "low" priority may not be implimented. Items with "high" priority need to be completed for version 3.0. If you'd like to help out, please get in touch.

High Priority

  • ELF: Move to ELF format with GCC 4.x
    Status: In progress (see trunk in svn repository)
  • Documentation: Cleaning up and rationalisation. For instance, 10-year old notes need bringing up to date or removing.
    Status: Provisional changes checked in to AOF branch
  • OSLib Integration: Use OSLib SWI calls in DeskLib.
    Status: -

Medium Priority

  • Multi-tasking message windows: Provide standard message windows, perhaps with a set of handlers to deal with simple yes/no input from end user.
    Status: -
  • New error handling routines: Re-think how DeskLib handles run-time errors. See old notes in current documentation and the changes made to Desk. Possibly just add a Error_Initialise function which takes an error handler, then call that from the Error routines.
    Status: -
  • Wimp_ReportError Updates: Update the Error functions to use the extensions included in RISC OS 3.6 - for instance including the program icon in the error window.
    Status: -
  • Initialisation Routines: Rationalise some of the "init" functions, for instance in the Template and Resource modules.
    Status: Changes checked in to AOF branch
  • Parameter Checking: Values passed to DeskLib functions should be checked that they are not invalid and dealt with accordingly, to improve stability.
    Status: -
  • Build to C99 Standard: Build library to C99 and make use of new functions such as snprintf (rather than sprintf) throughout to improve stability.
    Status: Changes checked in to AOF branch
  • SysLog: Add SysLog functionality.
    Status: Changes checked in to AOF branch (in Environment module)
  • Makefiles QA: The various makefiles have been amended and adapted over time and need checking/re-writing.
    Status: -
  • Code Audit: Examine existing code to determine its status - for instance, the Tinct module is written, but has no documentation; the clipboard module is half-written; some code can be retired as it's only needed for RISC OS 2; etc.
    Status: CSV database checked in to AOF branch (AR)
  • Debug Library Changes: Move the debug functions into the main library binary and alter Debug_Initialise to accept some parameter to determine which set of debug functionality is used. (As this will alter the API, need to ensure the namespace-change task, above, copes with it.)
    Status: Provisional changes checked in to AOF branch.
  • Module Rationalisation: Some modules are only present for compatibility reasons, others could be merged (e.g. ColourMenu module only has one function which ought to fit neatly in the Menu module and the several of the KernelSWIs functions would fit better elsewhere). Tidy up these issues.
    Status: Changes checked in to AOF branch

Low Priority

  • Internationalisation: Provide structure to allow internationalisation of DeskLib error messages.
    Status: -
  • License Change: Change license to MIT for clarity and simplicity
    Status: -
  • Back-ports: Port back changes made to Desk and to Richard Murray's branch of DeskLib. Probably only need to make list of potential changes and port when required.
    Status:-
  • Scrap: Routines to set up/use the scrap directory (in Resource module)
    Status: -
  • Internal Debugging: Create internal debugging messages - for instance, see Menu2 module.
    Status: -
  • Environment Module: Create new module to include functions such as manipulating system variables, listing running tasks, modules etc
    Status: First draft checked in to AOF branch
  • Reporter Debug Library: Create debug library which makes use of the Reporter module.
    Status: Checked in to AOF branch.
  • ZapRedraw Support: New module to interface to ZapRedraw
    Status: -
  • Tabs: Tabbed window support.
    Status: -
  • Writable Icons: Provide means to intelligently check input to writable icons. This could be done by using A in the validation string then claiming all keypresses, allowing things like only allowing any number between x and y, including decimal parts; converting all characters to lower/upper case; any other validation function you choose.
    Status:-
  • Window Opening: Expand the number of window_OPENPOSs to include things like opening: not over the caret, in spare screen space, centred over another window. Could also deal intelligently with multiple monitor setups.
    Status:-

Support

If you have questions either about the use of DeskLib or about building it, please either ask on the comp.sys.acorn.programmer Usenet group or the DeskLib mailing list. (The mailing list can be joined by sending an email to desklib-subscribe@googlegroups.com.)