[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Graphics] More convenient backend access
From: |
Michael Goffioul |
Subject: |
Re: [Graphics] More convenient backend access |
Date: |
Fri, 25 Jan 2008 15:51:26 +0100 |
On Jan 25, 2008 3:07 PM, Shai Ayal <address@hidden> wrote:
> > src/ChangeLog
> >
> > 2008-01-23 Michael Goffioul <address@hidden>
> >
> > * graphics.h.in (base_properties::get_backend,
> > base_graphics_object::get_backend, graphics_backend::get_backend):
> > New methods for convenient access to the backend.
> > (figure::get_backend, figure::set_backend): Remove.
> > * graphics.cc (base_properties::get_backend): New method.
> > (Fdrawnow): Use graphics_object::get_backend to simplify code.
> >
Note: the above patch was to provide convenient access to
the backend from C++ code, not for the user.
> Michael, I'm not sure I understand how this works:
> How does a new backend register?
graphics_backend::register_backend (to be called when the
new backend is loaded; for instance in an initialization
function called from PKG_ADD).
> How can the backend for a figure be set (by the user)?
> How can the backend for a figure be read (get) by the user?
There's no interface for this yet. My initial idea was to have
a global variable (for instance "__backend__", or
"default_backend") holding a string that would be used by
graphics_backend::default_backend() to return the currently
selected default backend. I didn't think yet about the
possibility to change the backend dynamically. I guess
this shouldn't be that hard to do; you just have to take care
about closing the figure window before changing the backend.
Michael.