Make compositor private a GObject than a void pointer

Requiring the compositor private object to be a GObject allows the
return value of meta_window_get_compositor_private() to be used
via gobject-introspection, since the type and memory management
can be determined.

This allows a reverse mapping from MetaWindow to MutterWindow.

- Change meta_window_get/set_compositor_private to use GObject
  rather than void *
- Adapt code in compositor-mutter.c to match.
This commit is contained in:
Dan Winship
2009-02-02 15:16:05 -05:00
parent c3884e9900
commit f4ecc9bab8
4 changed files with 25 additions and 17 deletions

View File

@ -360,7 +360,7 @@ struct _MetaWindow
MetaGroup *group;
#ifdef HAVE_COMPOSITE_EXTENSIONS
void *compositor_private;
GObject *compositor_private;
#endif
};

View File

@ -8707,7 +8707,15 @@ meta_window_get_description (MetaWindow *window)
return window->desc;
}
void *
/**
* meta_window_get_compositor_private:
* @window: a #MetaWindow
*
* Gets the compositor's wrapper object for @window.
*
* Return value: (transfer none): the wrapper object.
**/
GObject *
meta_window_get_compositor_private (MetaWindow *window)
{
if (!window)
@ -8716,7 +8724,7 @@ meta_window_get_compositor_private (MetaWindow *window)
}
void
meta_window_set_compositor_private (MetaWindow *window, void *priv)
meta_window_set_compositor_private (MetaWindow *window, GObject *priv)
{
if (!window)
return;