To anybody:

One problem I had with extensions is that it didn't have 
a way of loading the extension dynamically.  In other words,
I have this:

fnt_font_t fntInitFTFont(FT_Face ftface)
{
        /* some code using freetype  */
}

fnt_font_t fntInitXFont(XFont xfont)
{
        /* some code using X  */
}

Which makes the whole library depend on Freetype and X

I want :

struct {
        fnt_font_t (*init_ft_font)(FT_Face ftface);   
        fnt_font_t (*init_x_font)(XFont xfont);
} fnt_api;

#define fntInitFTFont(ftface)   fnt_api->init_ft_font(ftface)
#define fntInitXFont(xfont)             fnt_api->init_x_font(xfont)

This way the user can still use the extension even if he doesn't have
both X and Freetype.   With the other extensions this isn't a problem because 
they only have one library they depend on ( either libart or libxmi ) so if
the user doesn't have that library then they simply don't use the extension. But
if an extension brings one api to multiple libraries then the user is stuck with
all or nothing.  

Does this make sense?   I am (now) convinced that the extension concept is a
good one maybe it can be taken further so that not only are the functions
attached to the visual are loaded dynamically, but the other functions as well.

Maybe,  you think this idea sucks.  I'm just putting it out there. 

-- 
Lee Brown Jr.
[EMAIL PROTECTED]

Reply via email to