drwimpc001003.jpg drwimpc001004.jpg
drwimpc001002.jpg
Downloads
Welcome to the home of !DrWimpC - a C development tool for RISC OS computers with RISC OS 4 or higher.
!DrWimpC
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.
!DRWDEF
!MyOLE
An Acknowledgement. Examples
drwimpc001005.gif
Two principal acknowlegements towards the creation of DrWimpC should be made.

Firstly, to Andrew Ayre for his initial development of the BASIC DrWimp library.

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 DrWimpC 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.
External Dependency Links for !DrWimpC.
drwimpc001007.gif
OSLib.
GCCSDK.
!StrongEd
!Zap.
!WinEd.
ResFind/ResConf
drwimpc001006.gif
In addition, thanks are due for the efforts of the GCCSDK 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.
Introduction.
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 operates in the same way. So, there is no need to register event handler functions as is typical of other C libraries that provide an interface to the wimp environment.

The DrWimpC Library has 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 collected 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.

A new application, ready to build and run, is created in a few mouse clicks. A standard skeleton application is created which when built and run will have a main window, icon bar icon and default icon bar menu. C files for standard events such as mouse clicks, window opening, etc are automatically created. Further user files are be created when additional wimp actions are introduced using the 'Wimp Lib Action' menu. These can then be edited to place the required functionality into each application.

In addition to the matched user/wimp function interface, !DrWimpC implements a powerful alternative. Using the 'N' validation code for icons, C functions can be linked directly to an icon by name, The icons dont need to be referred to by number, so the window definition can be edited without icon renumbering affecting the C source. The 'granularity' of the C functions is a wimp action or event. A function can be individually identified with an icon/mouse click or key press, etc, at the source code level. The DrWimpC library calls the functions automatically where the corresponding user function would be called. The code is 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.
Dependencies.
The important bit. What do you need to start using !DrWimpC. There are a number of support programs listed in the 'External Dependency List for !DrWimpC' section of this page. OSLib is required because as !DrWimpC is a C library it requires a safe C SWI interface to RISC OS. When I began converting !DrWimpC I chose OSLib because it provides a mostly complete interface, is being actively maintained, and I could use its structure and name definitions for !DrWimpC instead of inventing names (reinventing the wheel). Currently this has resulted in a, hopefully temporary, limitation that there is no ELF release of OSLib., and no shared version. GCC (4) has become the main C compiler for RISC OS, and !DrWimpC takes advantage of shared libraries, so now it uses only the OSLib header files as a guide to how the SWIs should be called from C, and resorts to the _swix() function to call each SWI used in the !DrWimpC library. So,!DrWimpC is only dependent on the OSLib header files, but not the library code. You still need to download at least the header files for OSLib 6.90. Of course, you can still use the OSLib functions in a !DrWimpC program if you want to, and select static linking. If you are using the ROOL Development Tools then you will be using the shared C library which produces AOF format,, so the static OSLib release 6.90 is the one to choose.

!DrWimpC uses the external edit protocol to communicate with source code editors so the choice of source code editor is between !Zap and !StrongEd.


If you choose !StrongEd, I recommend editing the C ModeWhen file by placing - fff,(*).** at the start of the Includes Rule section and saving it as the External mode's ModeWhen file for use with !DrWimpC so you get the C syntax colouring.

!DrWimpC uses RISC OS template files for automatically loading window definitions, and identifying windows and icons by name. Any template editor can be used to produce the template files. !WinEd is the most sutiable although it is not currently being actively maintained. !TemplEd may be an alternative. !DrWimpC uses the OLE protocol to open templates in a template editor, so !TemplEd needs to handle that situation. (The OLESupport module is used to handle the edit. Or, if that crashes as has happened on my system, there is an alternaitve I developed that can handle such OLE edits - !MyOLE available for download from this site.

RESFIND/RESCONF.are used to cope with internationalisation. Calls to RESFIND are placed into the !Run file when it is generated at application creation..
GCC 4 and Shared Libraries.
When I began the !DrWimpC project the Norcroft C tools was still the first choice for developing aplications using the C programming language. GCC was in its infancy on Risc Os - version 2.95.2. Static linking and the AOF object file format was the norm. Now, after much valuable effort by the GCCSDK developers the ELF object file format is the standard output for GCC, and shared dynamically linked code libraries can be built with GCC defaulting to linking applications to shared libraries when they are present. This first release of !DrWimpC concentrates on using GCC 4 and where appropriate, shared libraries.

The DrWimpC library is supplied in three forms - a shared version - libdrwlib32Gs/so/1/1/1, a staic 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 the ELF loader and !Sharedlibs packages available for sownload from the packaged software section of the riscos.info site. The advice in the GCCSDK is to direct users to the site to download the latest, up to date versions. The ELF loader is part of the SharedLibs package and for C support the SharedLibs-C package is also required.

The benefit of using shared libraries to !DrWimpC is in the development of reusable 'template code' libraries.

There is an illustration of this 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.
Conditons 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.
Features.
  •  DrWimpC includes all the features of the BASIC DrWimp Library.  In additon it also provides:
  • RAM transfer, OLE, External Edit protocol implemented using the same matched user/wimp function method as used in the BASIC DrWimp library (non Iyonix systems)..
  •  Standard application Scrap File and Choices handling by a simple function interface.
  •  Language Support using the RISC OS standard method provided by RESFIND/RESCONF.
  •  Definition of Menus, submenus and links to window definitions via an easy to use GUI.
  •  Automatic loading of windows and menus at application start up.  (Implemented as an option).
  •  Association of Icon mouse clicks with a window definition in a template file.
  •  Direct association of C functions to windows menus and icons by template/window/icon names.
  •  Easy grouping of icons by icon name into reusable 'template objects', including arrays of template objects.
  •  Easy creation, edit and maintenance of the C source files for an application created using !DrWimpC.
  •  Automation of the build/compile process with support for the ROOL C and GCC 4 compiler tools.
  •  Automated creation of an initial application distribution.
  •  Interaction with !Zap and !StrongEd using the external edit protocol to aid editing of the C source code .
  •  Support for building shared libraries by the reusable 'template objects' mechanism .
Limitations of this release.
  • Coding for the drag and drop mechanism has been included in this release but is not available for use due to later developmants in RISC OS 5, and testing has been postponed to a later release. 
  • Most functions are of beta quality, but the linking of windows/icons to C wimp functions and events was to be implemented in two stages has ahd to be completed in one stage in a redesign of the user function mechanism due to shared libraries requiring position independent code. This means that the BASIC DrWimp method of calling application user functnios by the DrWimp library cannot be used because the user functions in the C program would be statically compiled and linked for each application. This redesign requires further testing, but the main function types of mouse click, wuindow opening, redraw, etc, and menu functions are well tested to at least beta quality.
  • 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' mechanis.
Package Contents.
  • The Main !DrWimpC application supplied with two !RunImage files one compiled with GCC linked with UnixLib and the other compiled  with the Castle C tools that reqiures the 32bit 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.
  • StrongHelp DrWimpC API documentation. HTML Manual, Getting Started Documentation.
  • 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. !!DeepKeys (also comes with !Zap) for extended key info.
Downloads.
drwimpc001001.gif
!DrWimpC.
The DrWimpC Application Builder.
The DrWimpC Libraries and Resources. The archive is split into three parts because the Drobe site has a maximum upload file size that would be exceeded if a single file was used. Al three parts are required to run DrWimpC App Builder.
drwimpc001001.gif
!DRWDEF.
drwimpc001001.gif
!MyOLE.
Alternative OLE support module..
drwimpc001001.gif
Examples.
DrWimp example programs in C.
To run this version of !DrWimpC you will need !DRWDEF which contains the DrWimpC shared library and resources used by !DrWimpC..
Contact.
By Email. My old tiscali address is suitable it is my initials pd followed by a dot and my surname miller then the digit 1 at tiscali's dot co dot uk domain. If you can't contact me by email then I regularly look at c.s.a.programming and the other c.s.a news groups, so I woud eventually notice a post to them.
History.
20120418 Preparation for first beta release into the wild.
Programs.
Programs written using !DrWimpC. Since !DrWimpC is new this will have more entries in due course.
mydesk.gif !MyDesk. An unobtrusive Virtual Screen Manager that uses a menu system and control panel instead of a main viewer/micro view mechanism to navigate between desktops and access windows. Provides unlimited virtual screens in user arranged order. Windows can be organised to appear on one or more of the screens and accessed using menus which list them by screen or task or all windows on all screens. The usual facilites to hide, show, get, fetch, move, copy a window or group of windows are possible. Backdrop and pinboard configurations can be associated with a virtual screen. A small configuration script language allows windows and window types to be ignored, or included in a screen, and alerts issued.

The program has been written as a test of DrWimpC App Builder. It has been updated to use the Shared DrWimpC library.
Next: Getting Started.