CD_CLIPBOARD - Clipboard Driver (cdclipbd.h)

This driver allows the access to a Clipboard area. It is greatly dependent on the system. In Win32, it creates an Enhanced Metafile, a Bitmap or a CD Metafile; in X-Windows and with GDK it creates only a CD Metafile.


The canvas is created by means of a call to function cdCreateCanvas(CD_CLIPBOARD, Data), after which other functions in the CD library can be called as usual. The Data parameter string is platform-dependent and varies according to the metafile created. See each metafile's documentation, but remember to exclude parameter "filename".

"widthxheight [resolution] [-b]"     or in C "%dx%d %g"   (Windows Only)  (internally EMF or BMP)
[width_mmxheight_mm] [resolution] -m"  or in C "%gx%g %g" (Windows Only)  (internally CD_METAFILE)
"display [width_mmxheight_mm] [resolution]"               (X-Windows Only)(internally CD_METAFILE)
"gtk_clipboard [width_mmxheight_mm] [resolution]"         (GDK)           (internally CD_METAFILE)

In the Windows environment, if the string "-b" is present at the end, it means that a Bitmap must be created instead of a metafile, and, if the string "-m" is present at the end, a CD Metafile will be created. For a Bitmap the remaining string must contains the bitmap size and optionally its resolution: "widthxheight [resolution] -b" or in C "%dx%d %g -b", the resolution default is the screen resolution.

In the X-Windows environment, the Display ("%p") where the data will be stored must be passed as a parameter before the CD Metafile parameters. This environment's driver is used only for applications that use CD to communicate with each other, because only CD Metafiles are created.

Any amount of such canvases may exist simultaneously. It is important to note that a call to function cdKillCanvas is required to properly copy the data to the Clipboard.

You can interpret the data from the Clipboard using function cdPlay. In the X-Windows environment, the parameter "data" for the cdPlay function is the pointer to the Display where the metafile will be obtained. The cdRegisterCallback must be called for the driver that will interpret the file, except for bitmaps that the CD_CLIPBOARD driver must be used.

Behavior of Functions

This driver is very platform-dependent.

For further detail, see the Behavior of Functions in each base driver: GDI, GDK and X-Win. To use this driver with a context plus base driver is necessary to call cdUseContextPlus(1) before creating the canvas, see the GDI+Cairo and XRender base drivers.