GSF Reference Manual: GsfClipData

## GsfClipData GsfClipData |

## Functions

GsfClipData * | gsf_clip_data_new ()
GsfClipFormat | gsf_clip_data_get_format ()
GsfBlob * | gsf_clip_data_get_data_blob ()
GsfClipFormatWindows | gsf_clip_data_get_windows_clipboard_format ()
gconstpointer | gsf_clip_data_peek_real_data ()

## Types and Values

enum | GsfClipFormat
enum | GsfClipFormatWindows
struct | GsfClipData
| GsfClipDataClass

## Object Hierarchy

        GObject
        ╰── GsfClipData

## Description

## Functions

### gsf_clip_data_new ()

    GsfClipData *
    gsf_clip_data_new (GsfClipFormat format,
                       GsfBlob *data_blob);

Creates a new GsfClipData object. This function acquires a reference to the `data_blob` , so you should unref the blob on your own if you no longer need it directly.

#### Parameters

format | Format for the data inside the `data_blob` |
data_blob | Object which holds the binary contents for the GsfClipData |

#### Returns

A newly-created GsfClipData.

### gsf_clip_data_get_format ()

    GsfClipFormat
    gsf_clip_data_get_format (GsfClipData *clip_data);

Queries the clipboard data format of a GsfClipData. The format refers to the data blob inside the `clip_data` ; use `gsf_clip_data_get_data_blob()` to get that data blob.

#### Parameters

clip_data | A GsfClipData. |

#### Returns

The format in which the GsfClipData's data blob is stored.

### gsf_clip_data_get_data_blob ()

    GsfBlob *
    gsf_clip_data_get_data_blob (GsfClipData *clip_data);

Queries the data blob that actually stores a GsfClipData's binary data.

#### Parameters

clip_data | A GsfClipData. |

#### Returns

A new reference to the GsfBlob that stores this `clip_data` 's binary data. You must use `g_object_unref()` to dispose of that data blob when you are done with it.

[transfer full]

### gsf_clip_data_get_windows_clipboard_format ()

    GsfClipFormatWindows
    gsf_clip_data_get_windows_clipboard_format
                                   (GsfClipData *clip_data,
                                    GError **error);

Queries the Windows clipboard data format for a GsfClipData. The `clip_data` must have been created with GSF_CLIP_FORMAT_WINDOWS_CLIPBOARD.

#### Parameters

clip_data | A GsfClipData. |
error | Location to store error, or `NULL` |

#### Returns

A GsfClipFormatWindows value.

Possible errors: GSF_ERROR_INVALID_DATA if the data blob in the `clip_data` is smaller than it should be; in this case GSF_CLIP_FORMAT_WINDOWS_ERROR will be returned.

### gsf_clip_data_peek_real_data ()

    gconstpointer
    gsf_clip_data_peek_real_data (GsfClipData *clip_data,
                                  gsize *ret_size,
                                  GError **error);

Queries a pointer directly to the clipboard data of a GsfClipData. The resulting pointer is not necessarily the same data pointer that was passed to `gsf_blob_new()` prior to creating the `clip_data` . For example, if the data is in GSF_CLIP_FORMAT_WINDOWS_CLIPBOARD format, then it will have extra header bytes in front of the actual metafile data. This function will skip over those header bytes if necessary and return a pointer to the "real" data.

#### Parameters

clip_data | A GsfClipData. |
ret_size | Location to return the size of the returned data buffer. |
error | Location to store error, or `NULL`. |

#### Returns

Pointer to the real clipboard data. The size in bytes of this buffer is returned in the `ret_size` argument.

[transfer none]

## Types and Values

### enum GsfClipFormat

#### Members

GSF_CLIP_FORMAT_WINDOWS_CLIPBOARD | Windows clipboard format |
GSF_CLIP_FORMAT_MACINTOSH_CLIPBOARD | Macintosh clipboard format |
GSF_CLIP_FORMAT_GUID | GUID that contains a format identifier |
GSF_CLIP_FORMAT_NO_DATA | No clipboard data |
GSF_CLIP_FORMAT_CLIPBOARD_FORMAT_NAME | Custom clipboard format |
GSF_CLIP_FORMAT_UNKNOWN | Unknown clipboard type or invalid data |

### enum GsfClipFormatWindows

#### Members

GSF_CLIP_FORMAT_WINDOWS_ERROR | error |
GSF_CLIP_FORMAT_WINDOWS_UNKNOWN | unknown |
GSF_CLIP_FORMAT_WINDOWS_METAFILE | CF_METAFILEPICT |
GSF_CLIP_FORMAT_WINDOWS_DIB | CF_DIB |
GSF_CLIP_FORMAT_WINDOWS_ENHANCED_METAFILE | CF_ENHMETAFILE |

### struct GsfClipData

    struct GsfClipData;

### GsfClipDataClass

    typedef struct _GsfClipDataClass GsfClipDataClass;