[comp.windows.x] Toolkit Nomenclature

gdykes@batcomputer.tn.cornell.edu (Gene Dykes) (08/16/89)

A few months ago, I posted a proposal for Toolkit Nomenclature.  Since
then, some interested individuals got together at a Birds-of-a-Feather
meeting at Xhibition '89 and discussed the issue.  We looked at both
Open Look and Motif nomenclature, and we decided that we would recommend
that toolkit designers use the Motif conventions.

A toolkit uses a special prefix with all its widgets.  In the case of
Motif, this prefix is "m".  Using that prefix and a hypothetical Label
widget as an example, the conventions are as follows:

    Toolkit Library Name :                   libXm.a

    Widget Class Name :                      XmLabel

    Include Directives :                     <Xm/Label.h>

    class_name field in the core structure : "Label"

    enumerated resource values :             XmCAPITALIZED_WORDS

    public function names :                  XmLabelFunctionName()

    Truncated include file names :
	Strip the lower case letters a word at a time until the basename
	is 9 characters or fewer (but strip as few letters as possible
	from the initial word).

	<Xm/VeryLongWidgetName.h> -> <Xm/VeryLWN.h>
	<Xm/Verylongwidgetname.h> -> <Xm/Verylongw.h>

    (Motif also has rules for gadgets, which I won't include here...)

Open Look is similar, but seriously errs, we believe, with a
decision to leave the prefixes off the widget class name.

If the Motif conventions are followed by all toolkits, then it will be
much easier for programmers to move from toolkit to toolkit without
needing to constantly refer to manuals to figure out how to properly
name these items.  It will also make it possible for automatic code
generators, such as the one in the Xcu toolkit, to work with lots
of widgets without making special modifications for any toolkit but
the Athena toolkit (sigh).

I have converted the Xcu toolkit to use these conventions, and it is
now available on expo, as discussed in another posting.

I am also going to propose to Robert Scheifler that toolkit prefixes be
included in the registry that is maintained by the X Consortium.

-- 
Gene Dykes, gdykes@tcgould.tn.cornell.edu

gabe@hpcvlx.HP.COM (Gabe Begeddov) (08/16/89)

   / hpcvlx:comp.windows.x / gdykes@batcomputer.tn.cornell.edu (Gene Dykes) /  6:52 pm  Aug 15, 1989 /
   
   A few months ago, I posted a proposal for Toolkit Nomenclature.  Since
   then, some interested individuals got together at a Birds-of-a-Feather
   meeting at Xhibition '89 and discussed the issue.  We looked at both
   Open Look and Motif nomenclature, and we decided that we would recommend
   that toolkit designers use the Motif conventions.

Glad to hear it. Dana Laursen came up with most of the conventions, and 
more importantly, went to alot of effort to see that they were followed.

       class_name field in the core structure : "Label"

We were also consistent with the class_name and prefixed that with 
"Xm" as in "XmLabel".
   
   I am also going to propose to Robert Scheifler that toolkit prefixes be
   included in the registry that is maintained by the X Consortium.

Sounds like a good idea.
   
   -- 
   Gene Dykes, gdykes@tcgould.tn.cornell.edu
   ----------
   
Gabe Beged-Dov gabe%hp-pcd@hplabs.hp.com