Manual: reference to wimp_ICON_BUTTON_TYPE_SHIFT

Tony van der Hoff tony at vanderhoff.org
Fri Jan 27 17:04:58 GMT 2006


Erik Groenhuis <e.groenhuis at xs4all.nl> wrote in message
<767addef4d.root at vertus.xs4all.nl>

> As Tony van der Hoff <tony at vanderhoff.org> wrote:
> 
[snip]
> > 
> > I meant to add: the solution is exremely unlikely to be trivial.
> > 
> 
> Crikey. And I thought it was just an oversight that could be fixed with a
> small change in some .swi file.
> 
To put some more flesh on that; Wimp.swi contains, amongst other things:

//Icon flags bits
TYPE Wimp_IconFlags = .Bits;
CONST
   Wimp_IconButtonTypeShift= .Int: 12, //shift
   Wimp_IconButtonType     = Wimp_IconFlags: 0b1111000000000000
                        "shift button bits by Wimp_IconButtonTypeShift",

Wimp_IconButtonTypeShift is declared as a CONST, but its use is described in
a comment field.

When DefMod generates the C headers, for anything defined as CONST, it
performs the appropriate action on the name, thus: 
Wimp_IconButtonTypeShift becomes wimp_ICON_BUTTON_TYPE_SHIFT. 

It performs different renaming tactics on other parts of the code, and, of
course, assembler headers are left unmangled.

However, it presently does not perform any action on comments, so in this
case the Wimp_IconButtonTypeShift remains unmangled. 

So, in one respect you are right; the comments could be changed manually
throughout OSLib to match the C case; but then they'd be wrong for the
assembler case. DefMod is designed to be language-independant, and if, say,
a Pascal header module was added (unlikely, I acknowkedge), it would most
likely be wrong in that case. It would therefore break the design philosophy
of DefMod. It would be a mammouth task, in any case. Not very nice, then.

A programmatic solution is therefore desirable, and I guess feasable within
file scope, but as DefMod only processes a single file at a time, and some
of these things span multiple files, it would be a very nasty hack to catch
all cases.

I think I'll shift my position from "not trivial" to "near impossible" :-(

-- 
Tony van der Hoff        | mailto:tony at vanderhoff.org
Buckinghamshire, England 



More information about the oslib-user mailing list