drwimpc001012.png
drwimpc001011.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.22
(2014-03-10)
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
drwimpc001001.gif
Dependencies
Details
Features
!DrWimpC 1.22
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 Topical Pi News Visit
Recent Changes
Conditions of Use
drwimpc001004.png
My Pi Setup: Running DrWimpC Application Builder on the Raspberry Pi
Contact
An Acknowledgement.
drwimpc001008.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
drwimpc001005.png
!drwdef Part 1
drwimpc001005.png
Defined Menus
!drwdef Part 2
drwimpc001005.png
!drwdef Part 3
Template Functions.
Additonal Support Application Downloads for DrWimpC
Template Functions Part 2.
Template Functions Part 3.
Linking Templates and Menus, and
defining and linking shortcuts.
drwimpc001003.gif
!MyOLE
Examples
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.
drwimpc001009.gif
External Help Buttons.
External Dependency Links for !DrWimpC.
External Help Buttons Part 2.
drwimpc001013.gif
Introduction.
OSLib.
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.
GCCSDK.
Programs
!StrongEd
Running DrWimpC Application Builder on the Raspberry Pi
drwimpc001010.gif
!Zap.
Tailoring Template Objects.
!WinEd.
ResFind/ResConf
Back to TOP
ResFinder
drwimpc001006.gif
!StrongHelp
drwimpc001002.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 the DrWimpCAPI. 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-03-10)
drwimpc001007.png
!DrWimpC 1.22
The DrWimpC Application Builder.
drwimpc001005.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
drwimpc001007.png
!DRWDEF.
drwimpc001005.png
!drwdef Part 2
drwimpc001005.png
!drwdef Part 3
drwimpc001007.png
!MyOLE.
ROOL C RunImages
Alternative OLE support module..
drwimpc001007.png
drwimpc001007.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.
By email to (pdmiller followed by an at (@) drwimpc dot co dot uk). I regularly look at c.s.a.programmer and the other c.s.a news groups, so if you can't contact me by email I would eventually notice a post to a c.s.a. news group. c.s.a.programmer or apps would be a logical place to post.
Recent Changes.
Latest Change 2014-03-10.
2014-03-10 Update Version 1.22
  • 2014/03/10 Enhanced the application Options window Resources section to show either a list of country names or territory names. Added StrongHelp pages for the application Options and Run Time Options windows. Added a Resources section to the Run Time Application Options window. Added StrongHelp a page to the New Application window. Fixed a bug in DrWimpC library caused by changes in the previous version. See the_readme/txt file for details. Udpated archives drwdef/zip drwdef1/zip, drwdef2/zip and drwdef3/zip.
  • 2014/02/24 With permission from GAG includes and uses ResFind v3.00 in distribution.
  • 2014/02/17 - Added a context menu to the NewApp dialogue to allow the choice of resource path constructor program of either the GAG version of ResFind or the new ResFinder program. Improved the handling of Defined Menus to allow both defined menus and application created menus to be used ona window/icon. Removed the requirement that defined menus need the presence of a tempate menu identification function in order to be detected and used by DrWimpC library in an application.  Adjusted  IconSprite command in the new app generated !Boot  file to use <App>Res$Path. Updated archives drwimpc/zip, drwdef/zip, drfwdef1/zip,drwdef2/zip and drwdef3/zip.
  • 2014/01/12 - Corrected !DrWimpC.!Run Wimpslot values to 2048k from the incorrect  25148K which is for a full debug version. drwimpc/zip updated.  Made one or two corrections to the Running DrWimpC on a Raspberry Pi web pages of the site.
  • Completed New StrongHelp Manual Part 1. This documents many of the DrWimpC library functions and has articles on various topics  such as the template functions, the wimp lib actions, adding application help and compiling,  linking and distributing applications. There is still plenty to document -  e.g the Wimp Lib Action and template function categories. These have stub pages or titles only in Part 1 of  the manual. Please use  !StrongHelp 2.87 or later. To open the StrongHelp manul either press F1 when the mouse pointer is in the main DrWimpC Application Builder AppList window, or use the DrWimpC Application Builder icon bar menu Help item sub menu, or the Help item from a !DrWimpC icon in a filer window, or the Help menu item of a !DrWimpC icon on the RO 5.21 pinboard.
  • Integrated use of the F1 key as a standard help button in DrWimpC library. This is documented in the StrongHelp Manual. It is used in the !DrWimpC application - for example in the main Project window to launch the DrWimpC Functional API StrongHelp manual and for some of the icons (e.g. Compile, Touch) to launch the StrongHelp pages of the relevant topic for their facility).
  •  Allow applications to output *StrongHelp help strings through drw_u_help and drw_u_menuhelp (and the corresponding template functions) so that applications can provide StrongHelp pages for menu items and icons.
  • Web site page and file URL links corrected.  New web page added describing the addition of  *StrongHelp commands by drw_u_help and drw_u_menuhelp.
  • Fixed a bug in the DrWimpC library's own dynamic memory heap manager which was causing occasional crashes during a compilation process invoked from !DrWimpC. Now documented as part of the DrWimpC library API in the memory allocations pages.
Next: Getting Started.