[gtk/wip/chergert/quartz4u: 74/120] macos: implement get_geometry



commit 16775ac73972342f9552e2d5a2b2ba699f6d62ba
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 19 17:00:39 2020 -0700

    macos: implement get_geometry
    
    This doesn't really seem to be used, but might as well implement it.

 gdk/macos/gdkmacossurface.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
---
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index f47c55c962..66482d698c 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -236,6 +236,28 @@ gdk_macos_surface_get_device_state (GdkSurface      *surface,
   return TRUE;
 }
 
+static void
+gdk_macos_surface_get_geometry (GdkSurface *surface,
+                                int        *x,
+                                int        *y,
+                                int        *width,
+                                int        *height)
+{
+  g_assert (GDK_IS_MACOS_SURFACE (surface));
+
+  if (x != NULL)
+    *x = surface->x;
+
+  if (y != NULL)
+    *y = surface->y;
+
+  if (width != NULL)
+    *width = surface->width;
+
+  if (height != NULL)
+    *height = surface->height;
+}
+
 static void
 gdk_macos_surface_destroy (GdkSurface *surface,
                            gboolean    foreign_destroy)
@@ -340,6 +362,7 @@ gdk_macos_surface_class_init (GdkMacosSurfaceClass *klass)
 
   surface_class->destroy = gdk_macos_surface_destroy;
   surface_class->get_device_state = gdk_macos_surface_get_device_state;
+  surface_class->get_geometry = gdk_macos_surface_get_geometry;
   surface_class->get_root_coords = gdk_macos_surface_get_root_coords;
   surface_class->get_scale_factor = gdk_macos_surface_get_scale_factor;
   surface_class->hide = gdk_macos_surface_hide;


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