On Friday 12 July 2002 1:21 am, John Levon wrote:
> Angus what should we do about getPixmap() of Image class ?
>
> Can't xforms code do the standard static_cast to xformsImage
> so Image doesn't need to ahve getPixmap() ? A bit ugly ...

I didn't try and think about an elegant solution at the time.

Why not:
class grfx::Pixmap {
};

class grfx::Image {
public:
        grfx::Pixmap & getPixmap();
};

where grfx::Pixmap is an abstract base class. Daughter classes would contain 
the Pixmap proper (X) or QPixmap?

I have no real ideas to be honest.

> Also, is boost::bind() idempotent ? lyx_gui::init_graphics() gets
> called a lot

It shouldn't. Once is enough:

Cache & Cache::get()
{
        static bool start = true;
        if (start) {
                start = false;
                lyx_gui::init_graphics();
        }

        // Now return the cache
        static Cache singleton;
        return singleton;
}

Maybe you could track that down?
Angus

Reply via email to