drwimpc001013.png
drwimpc001012.png
The DrWimp C Application Builder
Welcome to the home of !DrWimpC - a C development tool for RISC OS computers with RISC OS 4 or higher.
Downloads
Home
Acknowledgement
DrWimpC 1.23
(2014-09-14)
Features include the rapid creation of wimp applications, automatic generation of menus, and associated links to sub menus and menu help texts, linking of windows to menu items and icons, reusable objects designed using a standard template editor, and more. The two main C compilers for RISC OS of GCC and the ROOL C compiler are supported.
Introduction
drwimpc001004.gif
Dependencies
Details
Features
!DrWimpC 1.23
Package Contents
Downloads !DRWDEF
Getting Started Supported Hardware includes the Raspberry Pi. This has already proved worthwhile by testing on a real RISC OS machine I found an error which
accessed NULL pointers but got past my VirtualAcorn setup.
For RISCOS Hardware Visit
Recent Changes
Conditions of Use
drwimpc001007.png
My Pi Setup: Running DrWimpC Application Builder on the Raspberry Pi
Contact
An Acknowledgement.
drwimpc001009.gif
Quick Links
Two principal acknowledgements towards the creation of DrWimpC should be made. DRWDEF Split Downloads
Firstly, to Andrew Ayre for his initial development of the BASIC DrWimp library.
Getting Started
Secondly, and the reason for placing the acknowledgement prominently here, to
Ray Favre for maintaining and developing further the BASIC DrWimp library and
providing his permission, advice, ideas, programming and DrWimp expertise, and
time to read, digest and reply to my email enquiries. We enjoyed (or Ray endured)
several years of occasional email conversations on the subject, during which Ray indicated that he had wanted to produce a C version of DrWimp himself, although after trying to learn C and reading the GCC articles in Archive magazine he conceded that his time of life meant he was unlikely to be able to put sufficient energy into such a project.

The outcome of our email conversations was the production of a freeware C version of DrWimp. This took only a few months to complete, including some enhancements. I also said I would create a front end application generator in the !Fabricate style which has developed considerably into !DrWimpC - the DrWimp C Application Builder. Ray also wanted this project to be separate from the BASIC DrWimp library project. This site and contents is the result. If you find the program useful, use it as you like. Its conditions of use are the same as the BASIC DrWimp library, and OSLib.
WimpLib Actions
drwimpc001003.png
!drwdef Part 1
drwimpc001003.png
Defined Menus
!drwdef Part 2
drwimpc001003.png
!drwdef Part 3
Template Functions.
drwimpc001003.png
Documentation
Template Functions Part 2.
drwimpc001002.gif
Additonal Support Application Downloads for DrWimpC
Template Functions Part 3.
Linking Templates and Menus, and
defining and linking shortcuts.
drwimpc001006.gif
In addition, thanks are due for the efforts of the GCC developers, in particular for bringing ELF format and shared library support to RISC OS, and the OSLib developers and maintainers, and also the developers and maintainers of !StrongEd and !Zap, in particular for implementing the external edit protocol, and finally for the work done on
!WinEd.
!MyOLE
External Help Buttons.
Examples
drwimpc001010.gif
External Dependency Links for !DrWimpC.
External Help Buttons Part 2.
Introduction.
drwimpc001014.gif
Until now there has been no equivalent to the popular BASIC DrWimp Library available to C programmers. Now !DrWimpC fills that gap by providing a full conversion of that library into the C programming language, along with a front end project management tool for easy creation and maintenance of source code and application resources.

Emphasis is placed on interfacing to and using the current tools available to RISC OS, such as the source code editors !StrongEd and !Zap, compilers and make utilities. The native RISC OS application structure is used so that applications can also be compiled, edited, etc, independently of !DrWimpC. Any template editor can be used to design window definitions for use in an application.

The BASIC DrWimp library is a matched set of user and wimp functions. All wimp related application code is placed in the user functions which form the interface between the application and the DrWimp library which interacts with the wimp environment. The user functions are called by the DrWimp library according to the wimp events received. The DrWimpC library can operate in the same way, and implements an equivalent library function and user function for each FN and PROC defined in the BASIC DrWimp Library. A StrongHelp manual is provided that describes them. The user and wimp functions are arranged into source files according to wimp event/actions. Only the functions for the events used by an application are included into the final !RunImage file. This means that there is no need to register handler functions for wimp events as traditionally done in such libraries.

In addition to the matched user/wimp function interface, !DrWimpC implements a powerful alternative - the 'template code' functions. Using the 'N' validation code for icons, C functions can be linked directly to an icon by name. The icons don't need to be referred to by number, so the window definition can be edited without icon renumbering affecting the C source. The DrWimpC library will automatically call the function when it receives the wimp event or at the appropriate time during a wimp message protocol interaction. An incidental benefit of this mechanism is that only those functions necessary to your application's handling of a wimp event or protocol need to be defined. This is different from the matched user/wimp function arrangement where if one user function in a source file is used, the whole file of skeleton user functions is linked into the application.

The 'template code' functions are compiled into libraries with names of the template files containing the window definitions. Icons can be grouped together by name to form objects which can be reused in other applications. When an application is compiled the 'template code' libraries are automatically linked into the !RunImage file. Arrays of these template objects are also supported. Any menus and windows associated with the template objects are also automatically loaded. When compiled as shared libraries the code can be loaded once and reused by many applications. This means that 'template objects' to be defined in a template file within an application and its associated code can then be reused in another application simply by including the 'template object' in one of the application's template definitions by a simple template edit, and then compiling and linking the application. The 'template code' shared library. will be linked to the new application. 'Template objects' can be indexed so you can define a table of a number of the same template object type in a template without needing to compile and link the application again.

The 'template code' functions are further described in the Template functions pages on this site.
Programs
OSLib.
Running DrWimpC Application Builder on the Raspberry Pi
GCCSDK.
!StrongEd
drwimpc001011.gif
Tailoring Template Objects.
!Zap.
!WinEd.
Back to TOP
ResFind/ResConf
ResFinder
drwimpc001008.gif
!StrongHelp
drwimpc001005.gif
FuncProc v500
This web site without the zip files.
Back to TOP
Conditions of Use.
The Dr Wimp C package is distributed on an "As Is" basis, without warranty. No liability can be accepted for any consequential loss or damage, however caused, arising from the use of this package. The DrWimp C package is available under the same terms as the OSLib library. That is, you may use it to create freeware, shareware or commercial applications. You may acknowledge the use of !DrWimpC if you wish.

.
Dependencies.
1. OSlib 7.00 header files. DrWimpC uses the OSLib definitions for wimp constants, data types and structures.

2. An external edit capable text editor. So either !StrongEd or !Zap.

3. A RISC OS template editor, !WinEd recommended. !TemplEd is an alternative. !DrWimpC uses the OLE protocol to open template files in a template editor, so alternatives to !WinEd must be able to handle template files being opened in this way..

4. The OLE support module for (3) above. If you don't have a copy, or your version doesn't handle the template edit, you can use the !MyOLE application available from this site. !MyOLE defines an OLE server type variable of OLEServer$Type_... -N MyOLE -R /<MyOLE$Dir> which the DrWimpC library and !DrWimpC use to start an OLE session if the OLE support module is not available.

5. RESFIND/RESCONF.are used to cope with internationalization. Calls to RESFIND are placed into the !Run file when it is generated at application creation..

6. Optionally, !StrongHelp for viewing DrWimpCAPI - the Functional API manual. You may also find the FuncProc manual in the BASIC DrWimp library archive useful since the DrWimpC Functional API manual references the BASIC function description of equivalent functions in the BASIC DrWimp library.
Back to TOP
GCC 4 and Shared Libraries.
Initially, the !DrWimpC project used the Castle (now ROOL) C tools which were at that time the first choice for developing applications using the C programming language on RISC OS. Since then GCC has matured considerably. Several factors such as being freely available, the introduction of the ELF format for executables and shared libraries in GCC 4 have made GCC the RISC OS compiler of choice. It is also still being actively supported and developed.. !DrWimpC still supports the use of either compiler, but places more emphasis on GCC 4 mainly because of the ability to use the shared library facilities to build reusable code in the form of !DrWimpC 'template code' libraries of functions associated with a RISC OS template definition stored in an application template file.

The DrWimpC library is supplied in three forms - a shared version - libdrwlib32Gs/so/1/3/0, a static version - libdrwlib32Ga/a compiled with GCC 4 for use when linking applications using the static GCC libraries, and drwlib32 compiled with and for use with the ROOL Development C tools.

The !DrWimpC application is supplied in ELF format, linked with the shared DrWimpC library. This requires both the ELF loader and the standard GCC shared libraries. The ELF loader is part of the SharedLibs package. The advice in the GCC documentation is to direct users to download the lSharedLibs zip files to ensure you use up to date versions. They are available for download from the packaged software section of the riscos.info site. For C support the SharedLibs-C package is also required. If you prefer to use a Shared C library version of DrWimpC App Builder there is also a !RunImage compiled with the ROOL C Tools in !DrWimpC.ROOLCRunImage. Copy this into the !DrWimpC directory to use !DrWimpC without requiring the shared libraries. (Save the ELF !RunImage somewhere safe first if you are going to use it at some point), I recommend preserving the SetVars file too since the LD_LIBRARY_PATH is only required for the ELF Shared library version. If you compile using the ROOL C tools the SET LD_LIBRARY_PATH command is commented out. It is uncommented when you compile using GCC 4 with shared linking. If you find that you get a 'Can't load shared library ont application startup it may be because the SET LD_LIBRARY_PATH is still commented out due to a last compile being with the ROOL C tools, or GCC 4 with the static linking option ticked. If so, the application's !SetVars file can be manually edited to uncomment the command.

There is an illustration of !DrWimpC 'template code' libraries in the !bar and !bar2 applications supplied in the examples folder. See also the Template Functions topic for a more detailed description of the use of shared libraries in DrWimpC App Builder.
Back to TOP
Features Summary.
  • !DrWimpC includes all the features of the BASIC DrWimp library, and much more! E.g. RAM transfer, client external edit and OLE protocols are implemented.
  • Standard RISC OS application choices and scrap file management using a simple function interface.
  • Language support using the standard RISC OS method implemented using RESFIND and REASCONF.
  • Easy definition of menus and submenus and links to window and icon template definitions via an easy to use GUI. 
  • Optional automatic loading of windows from template file definitions at application startup.
  • Direct association of C functions to window/icon/menu/shortcut definitions with optional grouping into reusable 'template objects' including arrays of  'template objects' with support for shared libraries in GCC 4.
  • Use of the eternal edit protocol to create and edit source code and files. 
  • Automation of the compile/build process with support for the ROOL C tools and GCC 4  C compiler and linker.
  • Automated application initial distribution creation.
  • The printing examples are not complete. They will eventually be completed. My intention is to combine them into a shared library 'template object' instead of using the 'user function' mechanism.
Note that in this release the drag and drop mechanism is coded but not tested but will be supported in a future release. The print examples are not complete because they are being implemented as a reusable library which needs more coding and testing and has gone beyond the scope of a simple example.
Package Contents.
The Main !DrWimpC application supplied with two !RunImage files one compiled with GCC linked with UnixLib and the other compiled  with the ROOL C tools that requires the 32-bit Shared C Library.
The DrWimpC C library drwlib32 for use with the Shared C library and libdrwlib32Gs/so/1/1/1 and libdrwlib32Ga/a for use with UnixLib (shared and static versions).
StrongHelp DrWimpC API documentation. (OLD) HTML Manual, 
15 Example programs converted from the corresponding BASIC DrWimp Examples.
2 Example programs to illustrate the use and reuse of DrWimpC 'template objects'.
Support programs RESFIND 2.20/RESCONF 0.31
Can make use of !!DeepKeys (comes with !zap) for extended key info..
Back to TOP
Downloads.
The latest full version can be downloaded using the links below.
Details
Latest Version (2014-09-14)
drwimpc001001.png
!DrWimpC 1.23
The DrWimpC Application Builder.
drwimpc001003.png
The DrWimpC Libraries and Resources. The archive split into three parts to keep the maximum upload and download zip file sizes as small as possible. All three parts are required to run DrWimpC App Builder.
!drwdef Part 1
drwimpc001001.png
drwimpc001003.png
!DRWDEF.
!drwdef Part 2
drwimpc001003.png
!drwdef Part 3
drwimpc001001.png
Documentation.
A bare bones !DrWimpC containing the Resources directory and files to
set application variables so you can view the documentation in Resources.
drwimpc001001.png
!MyOLE.
ROOL C RunImages
Alternative OLE support module..
drwimpc001001.png
drwimpc001001.png
Examples.
DrWimp example programs in C.
To run !DrWimpC you will need !DRWDEF which contains the DrWimpC libraries and resources used by !DrWimpC and !MyOLE. If you prefer not to use a Shared C library version, !DrWimpC and !MyOLE contain a !RunImage compiled with the ROOL C tools in a sub directory ROOLCRunImage. To use them save the ELF !RunImage somewhere safe and then copy the Shared C library !RunImage in its place.
Contact.
The author of DrWimpC is not currently contactable.
Recent Changes.
Latest Change 2014-09-14.
2014-09-14 Update Version 1.23
  • 2014/09/14 Uploaded new versions of all zip files using corrected build process which placed the DrWimpC libraries in the wrong directory in drwdef2.zip and drwdef3.zip - They should be in !DRWDEF.DRW. Separate bare bones !DrWimpC provided with just the documentation in the Resources directory and !Boot, !Run and setvars obey files to set the relevant application variables to point to the bare bones !DrWimpC so that the documentation can be viewed by running the !Help file.
  • Added new Application feature to the Quit App menu item  lists all running DrWimpC applications so they can be selectively quit. Requires DrWimpC applications to be linked to version 1/4/0 of the DrWimpC library released with version 1.23 of  DrWimpC Application Builder.
  • Added sub menu to the Open App menu item to allow the Resources or specific language directory in Resources to be opened..
  • Altered how the size of  lines displayed in List Windows is calculated by avoiding rounding of intermediate results when using drw_wimp_lengthtoOS to calculate the height of the lines.
  • Added facility to run the !Help file of an application in the Projects window by pressing <CTRL> + F1.
  • Key press <CTRL>+F1 is passed to applications by the DrWimpC library so that they can respond to the key press with a Help response.
  • Internal DrWimpC library improvements and minor bug fixes including operation of the standard save window in a DrWimpC application, and a possible NULL pointer access when using mouse click template functions which may have associated Icon Click windows.
  • Dragging of sprite files to the Application Options window sprite icon now works correctly, as do the menus of the lists of Countries/ Territories available for language resources including matching country and territory numbers.
  • More documentation - Data transfer protocol including Data Save and Ram transfer, discard/ cancel/Save dialogues,  using the standard save window and partial documentation of DrWimpC List Windows. Documented as DrWimpC App Notes. Updated pogram distribution note.
  • New example application !Saver demonstrating the use of a standard save window.
  • Amended Application Creation to put the  application name in the default  document files (instead of !DRWDEF). 
  • The example and DrWimpC test program !MyDesk archive now includes its source code., with bug fix  for the Tab windows feature that  was causing a data abort if a new window was opened for a task and eindows selected for a task were subsequently tbbed through.
  • DrWimpC Application Builder version changed to 1.23. DrWimpC library version updated to 1/4/0.
Next: Getting Started.