[gtk/present-toplevel-2: 18/71] Drop redundant toplevel api



commit d7111c31a370edd77be00d58dc26ea2c28b130c4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 29 12:05:42 2020 -0500

    Drop redundant toplevel api
    
    The toplevel functionality to keep is moving to
    GdkToplevel, and unused functions can go.

 gdk/gdksurface.c | 271 +------------------------------------------------------
 gdk/gdksurface.h |  31 -------
 2 files changed, 5 insertions(+), 297 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 843ebc3b3a..be87e3490a 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1793,120 +1793,12 @@ gdk_surface_show_internal (GdkSurface *surface, gboolean raise)
     }
 }
 
-/**
- * gdk_surface_show_unraised:
- * @surface: a #GdkSurface
- *
- * Shows a #GdkSurface onscreen, but does not modify its stacking
- * order. In contrast, gdk_surface_show() will raise the surface
- * to the top of the surface stack.
- *
- * On the X11 platform, in Xlib terms, this function calls
- * XMapWindow() (it also updates some internal GDK state, which means
- * that you can’t really use XMapWindow() directly on a GDK surface).
- */
-void
-gdk_surface_show_unraised (GdkSurface *surface)
-{
-  gdk_surface_show_internal (surface, FALSE);
-}
-
-/**
- * gdk_surface_raise:
- * @surface: a #GdkSurface
- *
- * Raises @surface to the top of the Z-order (stacking order), so that
- * other surfaces with the same parent surface appear below @surface.
- * This is true whether or not the surfaces are visible.
- *
- * If @surface is a toplevel, the window manager may choose to deny the
- * request to move the surface in the Z-order, gdk_surface_raise() only
- * requests the restack, does not guarantee it.
- */
-void
-gdk_surface_raise (GdkSurface *surface)
-{
-  g_return_if_fail (GDK_IS_SURFACE (surface));
-
-  if (surface->destroyed)
-    return;
-
-  gdk_surface_raise_internal (surface);
-}
-
 static void
 gdk_surface_lower_internal (GdkSurface *surface)
 {
   GDK_SURFACE_GET_CLASS (surface)->lower (surface);
 }
 
-/**
- * gdk_surface_lower:
- * @surface: a #GdkSurface
- *
- * Lowers @surface to the bottom of the Z-order (stacking order), so that
- * other surfaces with the same parent surface appear above @surface.
- * This is true whether or not the other surfaces are visible.
- *
- * If @surface is a toplevel, the window manager may choose to deny the
- * request to move the surface in the Z-order, gdk_surface_lower() only
- * requests the restack, does not guarantee it.
- *
- * Note that gdk_surface_show() raises the surface again, so don’t call this
- * function before gdk_surface_show(). (Try gdk_surface_show_unraised().)
- */
-void
-gdk_surface_lower (GdkSurface *surface)
-{
-  g_return_if_fail (GDK_IS_SURFACE (surface));
-
-  if (surface->destroyed)
-    return;
-
-  /* Keep children in (reverse) stacking order */
-  gdk_surface_lower_internal (surface);
-}
-
-/**
- * gdk_surface_restack:
- * @surface: a #GdkSurface
- * @sibling: (allow-none): a #GdkSurface that is a sibling of @surface, or %NULL
- * @above: a boolean
- *
- * Changes the position of  @surface in the Z-order (stacking order), so that
- * it is above @sibling (if @above is %TRUE) or below @sibling (if @above is
- * %FALSE).
- *
- * If @sibling is %NULL, then this either raises (if @above is %TRUE) or
- * lowers the surface.
- *
- * If @surface is a toplevel, the window manager may choose to deny the
- * request to move the surface in the Z-order, gdk_surface_restack() only
- * requests the restack, does not guarantee it.
- */
-void
-gdk_surface_restack (GdkSurface     *surface,
-                     GdkSurface     *sibling,
-                     gboolean       above)
-{
-  g_return_if_fail (GDK_IS_SURFACE (surface));
-  g_return_if_fail (sibling == NULL || GDK_IS_SURFACE (sibling));
-
-  if (surface->destroyed)
-    return;
-
-  if (sibling == NULL)
-    {
-      if (above)
-        gdk_surface_raise (surface);
-      else
-        gdk_surface_lower (surface);
-      return;
-    }
-
-  GDK_SURFACE_GET_CLASS (surface)->restack_toplevel (surface, sibling, above);
-}
-
 /**
  * gdk_surface_show:
  * @surface: a #GdkSurface
@@ -2102,14 +1994,14 @@ gdk_toplevel_surface_present (GdkToplevel       *toplevel,
                                     &geometry.max_width,
                                     &geometry.max_height);
   mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
-  gdk_surface_set_geometry_hints (surface, &geometry, mask); 
+  GDK_SURFACE_GET_CLASS (surface)->set_geometry_hints (surface, &geometry, mask);
   gdk_surface_constrain_size (&geometry, mask, width, height, &width, &height);
   GDK_SURFACE_GET_CLASS (surface)->toplevel_resize (surface, width, height);
 
   if (gdk_toplevel_layout_get_maximized (layout))
-    gdk_surface_maximize (surface);
+    GDK_SURFACE_GET_CLASS (surface)->maximize (surface);
   else
-    gdk_surface_unmaximize (surface);
+    GDK_SURFACE_GET_CLASS (surface)->unmaximize (surface);
 
   if (gdk_toplevel_layout_get_fullscreen (layout))
     {
@@ -2122,8 +2014,8 @@ gdk_toplevel_surface_present (GdkToplevel       *toplevel,
   else
     gdk_surface_unfullscreen (surface);
 
-  gdk_surface_set_modal_hint (surface, gdk_toplevel_layout_get_modal (layout));
-  gdk_surface_set_type_hint (surface, gdk_toplevel_layout_get_type_hint (layout));
+  GDK_SURFACE_GET_CLASS (surface)->set_modal_hint (surface, gdk_toplevel_layout_get_modal (layout));
+  GDK_SURFACE_GET_CLASS (surface)->set_type_hint (surface, gdk_toplevel_layout_get_type_hint (layout));
 
   if (gdk_toplevel_layout_get_raise (layout))
     {
@@ -2487,23 +2379,6 @@ gdk_surface_input_shape_combine_region (GdkSurface       *surface,
   GDK_SURFACE_GET_CLASS (surface)->input_shape_combine_region (surface, surface->input_shape, 0, 0);
 }
 
-/**
- * gdk_surface_get_modal_hint:
- * @surface: A toplevel #GdkSurface.
- *
- * Determines whether or not the window manager is hinted that @surface
- * has modal behaviour.
- *
- * Returns: whether or not the surface has the modal hint set.
- */
-gboolean
-gdk_surface_get_modal_hint (GdkSurface *surface)
-{
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
-
-  return surface->modal_hint;
-}
-
 /**
  * gdk_surface_get_accept_focus:
  * @surface: a toplevel #GdkSurface.
@@ -2820,96 +2695,6 @@ gdk_surface_focus (GdkSurface *surface,
   GDK_SURFACE_GET_CLASS (surface)->focus (surface, timestamp);
 }
 
-/**
- * gdk_surface_set_type_hint:
- * @surface: A toplevel #GdkSurface
- * @hint: A hint of the function this surface will have
- *
- * The application can use this call to provide a hint to the surface
- * manager about the functionality of a surface. The window manager
- * can use this information when determining the decoration and behaviour
- * of the surface.
- *
- * The hint must be set before the surface is mapped.
- **/
-void
-gdk_surface_set_type_hint (GdkSurface        *surface,
-                           GdkSurfaceTypeHint hint)
-{
-  GDK_SURFACE_GET_CLASS (surface)->set_type_hint (surface, hint);
-}
-
-/**
- * gdk_surface_get_type_hint:
- * @surface: A toplevel #GdkSurface
- *
- * This function returns the type hint set for a surface.
- *
- * Returns: The type hint set for @surface
- **/
-GdkSurfaceTypeHint
-gdk_surface_get_type_hint (GdkSurface *surface)
-{
-  return GDK_SURFACE_GET_CLASS (surface)->get_type_hint (surface);
-}
-
-/**
- * gdk_surface_set_modal_hint:
- * @surface: A toplevel #GdkSurface
- * @modal: %TRUE if the surface is modal, %FALSE otherwise.
- *
- * The application can use this hint to tell the window manager
- * that a certain surface has modal behaviour. The window manager
- * can use this information to handle modal surfaces in a special
- * way.
- *
- * You should only use this on surfaces for which you have
- * previously called gdk_surface_set_transient_for()
- **/
-void
-gdk_surface_set_modal_hint (GdkSurface *surface,
-                            gboolean   modal)
-{
-  GDK_SURFACE_GET_CLASS (surface)->set_modal_hint (surface, modal);
-}
-
-/**
- * gdk_surface_set_geometry_hints:
- * @surface: a toplevel #GdkSurface
- * @geometry: geometry hints
- * @geom_mask: bitmask indicating fields of @geometry to pay attention to
- *
- * Sets the geometry hints for @surface. Hints flagged in @geom_mask
- * are set, hints not flagged in @geom_mask are unset.
- * To unset all hints, use a @geom_mask of 0 and a @geometry of %NULL.
- *
- * This function provides hints to the surfaceing system about
- * acceptable sizes for a toplevel surface. The purpose of
- * this is to constrain user resizing, but the windowing system
- * will typically  (but is not required to) also constrain the
- * current size of the surface to the provided values and
- * constrain programatic resizing via gdk_surface_resize().
- *
- * Note that on X11, this effect has no effect on surfaces
- * of type %GDK_SURFACE_TEMP since these surfaces are not resizable
- * by the user.
- *
- * Since you can’t count on the windowing system doing the
- * constraints for programmatic resizes, you should generally
- * call gdk_surface_constrain_size() yourself to determine
- * appropriate sizes.
- *
- **/
-void
-gdk_surface_set_geometry_hints (GdkSurface         *surface,
-                                const GdkGeometry *geometry,
-                                GdkSurfaceHints     geom_mask)
-{
-  g_return_if_fail (geometry != NULL || geom_mask == 0);
-
-  GDK_SURFACE_GET_CLASS (surface)->set_geometry_hints (surface, geometry, geom_mask);
-}
-
 /**
  * gdk_surface_set_title:
  * @surface: a toplevel #GdkSurface
@@ -3129,52 +2914,6 @@ gdk_surface_unstick (GdkSurface *surface)
   GDK_SURFACE_GET_CLASS (surface)->unstick (surface);
 }
 
-/**
- * gdk_surface_maximize:
- * @surface: a toplevel #GdkSurface
- *
- * Maximizes the surface. If the surface was already maximized, then
- * this function does nothing.
- *
- * On X11, asks the window manager to maximize @surface, if the window
- * manager supports this operation. Not all window managers support
- * this, and some deliberately ignore it or don’t have a concept of
- * “maximized”; so you can’t rely on the maximization actually
- * happening. But it will happen with most standard window managers,
- * and GDK makes a best effort to get it to happen.
- *
- * On Windows, reliably maximizes the surface.
- *
- **/
-void
-gdk_surface_maximize (GdkSurface *surface)
-{
-  GDK_SURFACE_GET_CLASS (surface)->maximize (surface);
-}
-
-/**
- * gdk_surface_unmaximize:
- * @surface: a toplevel #GdkSurface
- *
- * Unmaximizes the surface. If the surface wasn’t maximized, then this
- * function does nothing.
- *
- * On X11, asks the window manager to unmaximize @surface, if the
- * window manager supports this operation. Not all window managers
- * support this, and some deliberately ignore it or don’t have a
- * concept of “maximized”; so you can’t rely on the unmaximization
- * actually happening. But it will happen with most standard window
- * managers, and GDK makes a best effort to get it to happen.
- *
- * On Windows, reliably unmaximizes the surface.
- *
- **/
-void
-gdk_surface_unmaximize (GdkSurface *surface)
-{
-  GDK_SURFACE_GET_CLASS (surface)->unmaximize (surface);
-}
-
 /**
  * gdk_surface_fullscreen:
  * @surface: a toplevel #GdkSurface
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index 14bf19d8cb..f61e42a301 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -357,21 +357,11 @@ void          gdk_surface_show                  (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_hide                  (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
-void          gdk_surface_show_unraised         (GdkSurface     *surface);
-GDK_AVAILABLE_IN_ALL
 void          gdk_surface_resize                (GdkSurface     *surface,
                                                  gint           width,
                                                  gint           height);
 
 GDK_AVAILABLE_IN_ALL
-void          gdk_surface_raise                 (GdkSurface     *surface);
-GDK_AVAILABLE_IN_ALL
-void          gdk_surface_lower                 (GdkSurface     *surface);
-GDK_AVAILABLE_IN_ALL
-void          gdk_surface_restack               (GdkSurface     *surface,
-                                                 GdkSurface     *sibling,
-                                                 gboolean       above);
-GDK_AVAILABLE_IN_ALL
 void          gdk_surface_focus                 (GdkSurface     *surface,
                                                  guint32        timestamp);
 GDK_AVAILABLE_IN_ALL
@@ -400,23 +390,6 @@ gboolean      gdk_surface_get_mapped   (GdkSurface *surface);
 GDK_AVAILABLE_IN_ALL
 GdkSurfaceState gdk_surface_get_state (GdkSurface *surface);
 
-GDK_AVAILABLE_IN_ALL
-void              gdk_surface_set_type_hint (GdkSurface        *surface,
-                                             GdkSurfaceTypeHint hint);
-GDK_AVAILABLE_IN_ALL
-GdkSurfaceTypeHint gdk_surface_get_type_hint (GdkSurface        *surface);
-
-GDK_AVAILABLE_IN_ALL
-gboolean      gdk_surface_get_modal_hint   (GdkSurface       *surface);
-GDK_AVAILABLE_IN_ALL
-void          gdk_surface_set_modal_hint   (GdkSurface       *surface,
-                                            gboolean         modal);
-
-GDK_AVAILABLE_IN_ALL
-void          gdk_surface_set_geometry_hints (GdkSurface          *surface,
-                                              const GdkGeometry  *geometry,
-                                              GdkSurfaceHints      geom_mask);
-
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_set_title         (GdkSurface   *surface,
                                              const gchar  *title);
@@ -492,10 +465,6 @@ void          gdk_surface_stick           (GdkSurface       *surface);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_unstick         (GdkSurface       *surface);
 GDK_AVAILABLE_IN_ALL
-void          gdk_surface_maximize        (GdkSurface       *surface);
-GDK_AVAILABLE_IN_ALL
-void          gdk_surface_unmaximize      (GdkSurface       *surface);
-GDK_AVAILABLE_IN_ALL
 void          gdk_surface_fullscreen      (GdkSurface       *surface);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_fullscreen_on_monitor (GdkSurface      *surface,


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