property_get


Description:


public bool property_get (Window window, Atom property, Atom type, ulong offset, ulong length, int pdelete, out Atom actual_property_type, out int actual_format, out uint8[] data)

Retrieves a portion of the contents of a property.

If the property does not exist, then the function returns false, and gdk_none will be stored in actual_property_type.

The XGetWindowProperty function that property_get uses has a very confusing and complicated set of semantics. Unfortunately, property_get makes the situation worse instead of better (the semantics should be considered undefined), and also prints warnings to stderr in cases where it should return a useful error to the program. You are advised to use XGetWindowProperty directly until a replacement function for property_get is provided.

Parameters:

window

a Window

property

the property to retrieve

type

the desired property type, or gdk_none, if any type of data is acceptable. If this does not match the actual type, then actual_format and data.length will be filled in, a warning will be printed to stderr and no data will be returned.

offset

the offset into the property at which to begin retrieving data, in 4 byte units.

length

the length of the data to retrieve in bytes. Data is considered to be retrieved in 4 byte chunks, so length will be rounded up to the next highest 4 byte boundary (so be careful not to pass a value that might overflow when rounded up).

pdelete

if true, delete the property after retrieving the data.

actual_property_type

location to store the actual type of the property.

actual_format

location to store the actual return format of the data; either 8, 16 or 32 bits.

data

location to store a pointer to the data. The retrieved data should be freed with g_free when you are finished using it.

actual_length

location to store the length of the retrieved data, in bytes. Data returned in the 32 bit format is stored in a long variable, so the actual number of 32 bit elements should be be calculated via data.length / sizeof(glong) to ensure portability to 64 bit systems.

Returns:

true if data was successfully received and stored in data, otherwise false.


Namespace: Gdk
Package: gdk-3.0