[gtk/wip/chergert/quartz4u] macos: add view helper



commit 4be670f93748b77e37cda42ae61b55e37b2c539f
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 29 17:02:43 2020 -0700

    macos: add view helper

 gdk/macos/gdkmacossurface-private.h |  1 +
 gdk/macos/gdkmacossurface.c         | 11 +++++++++++
 2 files changed, 12 insertions(+)
---
diff --git a/gdk/macos/gdkmacossurface-private.h b/gdk/macos/gdkmacossurface-private.h
index aa0ebbffc4..1c5a4f6188 100644
--- a/gdk/macos/gdkmacossurface-private.h
+++ b/gdk/macos/gdkmacossurface-private.h
@@ -85,6 +85,7 @@ void               _gdk_macos_surface_get_shadow              (GdkMacosSurface
                                                                gint               *right,
                                                                gint               *bottom,
                                                                gint               *left);
+NSView            *_gdk_macos_surface_get_view                (GdkMacosSurface    *self);
 gboolean           _gdk_macos_surface_get_modal_hint          (GdkMacosSurface    *self);
 void               _gdk_macos_surface_set_modal_hint          (GdkMacosSurface    *self,
                                                                gboolean            modal_hint);
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index eb1544e602..03a3d9afc4 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -969,3 +969,14 @@ _gdk_macos_surface_get_best_monitor (GdkMacosSurface *self)
 
   return best;
 }
+
+NSView *
+_gdk_macos_surface_get_view (GdkMacosSurface *self)
+{
+  g_return_val_if_fail (GDK_IS_MACOS_SURFACE (self), NULL);
+
+  if (self->window == NULL)
+    return NULL;
+
+  return [self->window contentView];
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]