NetBSD/dist/cdk/EXPANDING
garbled 5940edcfb4 Initial import of CDK 4.9.9. The work to port this was performed by
Charles Hannum, and that is the version being imported:
cdk-4.9.9-20000407-myc3
2001-01-04 19:57:58 +00:00

77 lines
3.3 KiB
Plaintext

Cdk New Widget Guide
Copyright Mike Glover, 1995, 1996, 1997, 1998, 1999
-------------------------------------------------------------------------------
If you want to create a new widget for Cdk, and want it in the standard
dist of Cdk, you will have to follow some requisites that I have. I state
these because Cdk has been worked on for quite some time and I finally
got it to a state where the functions calls are somewhat consistent. Any new
widgets should adhere to this. The requirements are as follows:
* The function names should be like:
newCDKXXX, destroyCDKXXX, setCDKXXX, drawCDKXX,...
Any widgets with functions not in this format should be 'private'.
If this is not the case one of three things will happen:
1) The widget will not get accepted
2) I will mail you back asking you to follow the standards.
3) I will do it myself. (HIGHLY unlikely)
* The first parameter of the newCDKXXX function should be of type
CDKSCREEN.
* If applicable, the next two parameters should be xpos and ypos in
that order.
* If applicable, the next two parameters should be the height and
width of the widget.
* If the widget has a title, the next parameter should be a char *
for the title.
* If the widget has a label, the next parameter should be a char *
for the label.
* The last two parameters of the newCDKXXX function should be:
Boolean box, Boolean shadow if the parameters apply.
* The drawCDKXXX function should only have the pointer to the object and
a Boolean box as it's parameters. (in that order)
* The first parameters of any other function relating to the widget
should be a pointer to the widget type. ie: CDKRADIO *, CDKFSELECT *...
* A destroyCDKXXX function has to be provided as well as a drawCDKXXX
function.
* Try to contain anything specific to the widget in a single file. This
keeps the overhead of misc. files from floating around.
* Create a standalone header file which includes cdk.h if needed.
If you follow the guidelines, then the files you need to change to sew the new
widget into Cdk, are:
cdkscreen.c So this widget will get refreshed on a refreshCDKScreen
function call.
binding.c To allow key bindings for the widget. If it is possible
to have key bindings I stress that this be incorporated.
cdk.h To add in the function def's to the header file. (ie:
include the newly created header file.)
Makefile Add in the new widget files.
If you have done all of this then what I need from you is the following:
* A diff of all the files from the dist. that you modified. Use
patch, I prefer it. If you haven't got it, get it and use it. It makes
life easy.
* A copy of the new widget file.
* tar this up and send it to me at
glover@credit.erin.utoronto.ca or at mike@vexus.ca
I will mail you back when I get it and I will tell you if everything is
OK or not.
I hate to be such a nit pick, but if we follow the above standards, Cdk will
evolve into a very nice library, with a lot of really nice widgets.
If you want to get a hold of me mail me at one of the following:
glover@credit.erin.utoronto.ca
mike@vexus.ca
The CDK Web page has several homes. They are:
http://www.vexus.ca/CDK.html (official)
http://www.datasoft.on.ca/~cdk (Sponsored by the nice folks at Datasoft)
ttfn,
Mike