ColourTrans_SetGCOL

Tony van der Hoff tony at vanderhoff.org
Tue Jan 2 14:13:41 GMT 2007


On 30 Oct at 12:30 Tony van der Hoff <tony at vanderhoff.org> wrote in message
<gemini.j7y82w0v1dp0001ni.tony at vanderhoff.org>

> On 28 Oct at 3:22 Christian Ludlam <christian at recoil.org> wrote in message
> <5ffcab7c4e.christian at venice.lab>
> 
> > Hi,
> > 
> > colourtrans_gcol_flags, as used in R3 in colourtrans_set_gcol() should
> > have bit 7 meaning "set background colour" as well as the ECF flag in
> > bit 8.
> > 
> 
> Woo, there's a bug lurking undiscovered since the dawn of time:
> 

OK, in the absence of constructive suggestions, this is what I've done, for
better or worse :(

>From the ChangeLog:
   - ColourTrans.swi: Renamed GCOL constants ColourTrans_SetFG, 
        ColourTrans_SetBG, ColourTrans_UseECFS, ColourTrans_SetText to
        ColourTrans_SetFG_GCol, ColourTrans_SetBG_GCol,
        ColourTrans_UseECFS_GCol, ColourTrans_SetText_GCol
        respectively to avoid clash with similarly named SetColour and
        SetTextColour constants.
        Renamed SetColour constants ColourTrans_SetFG, ColourTrans_SetBG,
        ColourTrans_SetText to ColourTrans_SetFGCol, ColourTrans_SetBGCol,
        ColourTrans_SetTextCol respectively for consistency.
        Renamed SetTextColour constants ColourTrans_SetFG, ColourTrans_SetBG
        to ColourTrans_SetFGTextCol, ColourTrans_SetBGTextCol respectively
        for consistency.
        (20070102-1, Christian Ludlam)

This results in the C definitions:
#define colourtrans_SET_FG_GCOL      ((colourtrans_gcol_flags) 0x0u)
#define colourtrans_SET_BG_GCOL      ((colourtrans_gcol_flags) 0x80u)
#define colourtrans_USE_ECFS_GCOL    ((colourtrans_gcol_flags) 0x100u)
#define colourtrans_SET_TEXT_GCOL    ((colourtrans_gcol_flags) 0x200u)
#define colourtrans_SET_FG_COL       ((colourtrans_colour_flags) 0x0u)
#define colourtrans_SET_BG_COL       ((colourtrans_colour_flags) 0x80u)
#define colourtrans_SET_TEXT_COL     ((colourtrans_colour_flags) 0x200u)
#define colourtrans_SET_FG_TEXT_COL  ((colourtrans_text_colour_flags) 0x0u)
#define colourtrans_SET_BG_TEXT_COL  ((colourtrans_text_colour_flags) 0x80u)

And HDR definitions:
ColourTrans_SetFG_GCol          *       &0
ColourTrans_SetBG_GCol          *       &80
ColourTrans_UseECFS_GCol        *       &100
ColourTrans_SetText_GCol        *       &200
ColourTrans_SetFGCol            *       &0
ColourTrans_SetBGCol            *       &80
ColourTrans_SetTextCol          *       &200
ColourTrans_SetFGTextCol        *       &0
ColourTrans_SetBGTextCol        *       &80

I appreciate this breaks compatiblility, but seeing as most of them didn't
work anyway, and no-one had ever noticed in 12 years of OSLib I can't
imagine too many cries of derision.

OSLib 6.90 can be found at http://ro-oslib.sourceforge.net/690/. Enjoy!

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



More information about the oslib-user mailing list