TkGS Specification - Devices

Introduction

TkGS graphics model is device-independent. Drawing operations can be performed transparently on any kind of device: windows, full screen, printers, plotters, metafiles... For each type of device, one needs to write a device driver that acts as a translator between device-independent TkGS structures and calls and the underlying device-specific structures and calls (Win32, MacOS Toolbox, Xlib, DirectX, OpenGL, PostScript...).

TkGS provides an installable device driver model. Device drivers need to register themselves to TkGS by passing a driver descriptor (ie a function pointer table). Access to drawables will be done through this descriptor. However drawable creation will need device-specific routines (see Porting Tk code to TkGS)

Structures


TkGS_Device
Description
Every drawable belongs to a physical device described by a TkGS_Device. Each device exposes its capabilities such as color depth and size. It is an opaque token.
Structure
TkGS_Device is an opaque token that is used to query device capabilities. It points to the private structure TkGS_Device_ (notice the trailing underscore) holding function pointers used by all drawing operations.

Functions


TkGS_GetDeviceCap
Description
This function is used to query the capability of a given TkGS_Device.
Status
Not yet implemented.
Declaration
int TkGS_GetDeviceCap(
    TkGS_Device device,
    int         capability
);
Arguments
device: the TkGS_Device we want to query.
capability: the capability.
Returned value
The value of the given capability.
Side effects
None.

TODO