mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
Merge branch 'wip/chergert/macos-add-window-accessor' into 'main'
macos: add getter for NSWindow with macOS windowing See merge request GNOME/gtk!4509
This commit is contained in:
commit
c76b4bdc77
@ -526,6 +526,11 @@ gdk_macos_surface_class_init (GdkMacosSurfaceClass *klass)
|
||||
surface_class->set_input_region = gdk_macos_surface_set_input_region;
|
||||
surface_class->set_opaque_region = gdk_macos_surface_set_opaque_region;
|
||||
|
||||
/**
|
||||
* GdkMacosSurface:native: (attributes org.gtk.Property.get=gdk_macos_surface_get_native_window)
|
||||
*
|
||||
* The "native" property contains the underlying NSWindow.
|
||||
*/
|
||||
properties [PROP_NATIVE] =
|
||||
g_param_spec_pointer ("native",
|
||||
"Native",
|
||||
@ -686,6 +691,27 @@ _gdk_macos_surface_get_native (GdkMacosSurface *self)
|
||||
return (NSWindow *)self->window;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_macos_surface_get_native_window: (attributes org.gtk.Method.get_property=native)
|
||||
* @self: a #GdkMacosSurface
|
||||
*
|
||||
* Gets the underlying NSWindow used by the surface.
|
||||
*
|
||||
* The NSWindow's contentView is an implementation detail and may change
|
||||
* between releases of GTK.
|
||||
*
|
||||
* Returns: (nullable): a #NSWindow or %NULL
|
||||
*
|
||||
* Since: 4.8
|
||||
*/
|
||||
gpointer
|
||||
gdk_macos_surface_get_native_window (GdkMacosSurface *self)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_MACOS_SURFACE (self), NULL);
|
||||
|
||||
return _gdk_macos_surface_get_native (self);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_macos_surface_set_geometry_hints (GdkMacosSurface *self,
|
||||
const GdkGeometry *geometry,
|
||||
|
@ -37,6 +37,8 @@ typedef struct _GdkMacosSurfaceClass GdkMacosSurfaceClass;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_macos_surface_get_type (void);
|
||||
GDK_AVAILABLE_IN_4_8
|
||||
gpointer gdk_macos_surface_get_native_window (GdkMacosSurface *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user