[Gs-devel] Forwarding devices
raph at levien.com
Tue Feb 27 09:20:27 PST 2001
On Tue, Feb 27, 2001 at 03:41:42PM +0100, Juliusz Chroboczek wrote:
> Given a gx_device, how do I find out if it's a forwarding device?
> Explanation: in the DPS extension, X-specific data (such as which
> window to render to) is held in the gx_device_dps. There are some PS
> operators that can be used to find out this data.
> This works fine if the current device is a DPS device. However, the
> current device may be a forwarding device that points at a DPS device.
> How do I find out the underlying device in that case?
> Unless there's already a way to do that, I'm thinking of adding a new
> field to gx_device_common.
> By the way, please note that I'm working with 6.01.
This code should work:
const gx_device_procs *procs = dev->static_procs;
if (procs == 0)
procs = &dev->procs;
if (procs->get_xfont_procs == gx_forward_get_xfont_procs)
That fragment is taken from gx_device_make_struct_type() in gsdevice.c,
so it's "official".
More information about the gs-devel