Add vfuncs for keyval and window property functions
The keyval functions should really be generic, and the window property api should be completely revisited, but for now this will allow us to proceed.
This commit is contained in:
@ -531,70 +531,17 @@ gdk_x11_get_xatom_name (Atom xatom)
|
||||
return get_atom_name (gdk_x11_xatom_to_atom (xatom));
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_property_get:
|
||||
* @window: a #GdkWindow.
|
||||
* @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 @actual_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.
|
||||
* @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
|
||||
* @actual_length / sizeof(glong) to ensure portability to
|
||||
* 64 bit systems.
|
||||
* @data: location to store a pointer to the data. The retrieved
|
||||
* data should be freed with g_free() when you are finished
|
||||
* using it.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* <note>
|
||||
* <para>
|
||||
* The XGetWindowProperty() function that gdk_property_get()
|
||||
* uses has a very confusing and complicated set of semantics.
|
||||
* Unfortunately, gdk_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
|
||||
* gdk_property_get()
|
||||
* is provided.
|
||||
* </para>
|
||||
* </note>
|
||||
*
|
||||
* Returns: %TRUE if data was successfully received and stored
|
||||
* in @data, otherwise %FALSE.
|
||||
*/
|
||||
gboolean
|
||||
gdk_property_get (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gulong offset,
|
||||
gulong length,
|
||||
gint pdelete,
|
||||
GdkAtom *actual_property_type,
|
||||
gint *actual_format_type,
|
||||
gint *actual_length,
|
||||
guchar **data)
|
||||
_gdk_x11_window_get_property (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gulong offset,
|
||||
gulong length,
|
||||
gint pdelete,
|
||||
GdkAtom *actual_property_type,
|
||||
gint *actual_format_type,
|
||||
gint *actual_length,
|
||||
guchar **data)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
Atom ret_prop_type;
|
||||
@ -730,34 +677,14 @@ gdk_property_get (GdkWindow *window,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_property_change:
|
||||
* @window: a #GdkWindow.
|
||||
* @property: the property to change.
|
||||
* @type: the new type for the property. If @mode is
|
||||
* %GDK_PROP_MODE_PREPEND or %GDK_PROP_MODE_APPEND, then this
|
||||
* must match the existing type or an error will occur.
|
||||
* @format: the new format for the property. If @mode is
|
||||
* %GDK_PROP_MODE_PREPEND or %GDK_PROP_MODE_APPEND, then this
|
||||
* must match the existing format or an error will occur.
|
||||
* @mode: a value describing how the new data is to be combined
|
||||
* with the current data.
|
||||
* @data: the data (a <literal>guchar *</literal>
|
||||
* <literal>gushort *</literal>, or <literal>gulong *</literal>,
|
||||
* depending on @format), cast to a <literal>guchar *</literal>.
|
||||
* @nelements: the number of elements of size determined by the format,
|
||||
* contained in @data.
|
||||
*
|
||||
* Changes the contents of a property on a window.
|
||||
*/
|
||||
void
|
||||
gdk_property_change (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
const guchar *data,
|
||||
gint nelements)
|
||||
_gdk_x11_window_change_property (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
const guchar *data,
|
||||
gint nelements)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
Window xwindow;
|
||||
@ -813,16 +740,9 @@ gdk_property_change (GdkWindow *window,
|
||||
xtype, format, mode, (guchar *)data, nelements);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_property_delete:
|
||||
* @window: a #GdkWindow.
|
||||
* @property: the property to delete.
|
||||
*
|
||||
* Deletes a property from a window.
|
||||
*/
|
||||
void
|
||||
gdk_property_delete (GdkWindow *window,
|
||||
GdkAtom property)
|
||||
_gdk_x11_window_delete_property (GdkWindow *window,
|
||||
GdkAtom property)
|
||||
{
|
||||
g_return_if_fail (!window || GDK_WINDOW_IS_X11 (window));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user