surface: Drop redundant toplevel api

The toplevel functionality to keep is moving to
GdkToplevel, and unused functions can go.
This commit is contained in:
Matthias Clasen 2020-02-29 12:05:42 -05:00
parent c67d426dc4
commit 3a4e647b2d
3 changed files with 16 additions and 915 deletions

View File

@ -282,6 +282,12 @@ void gdk_seat_ungrab (GdkSeat *seat);
GdkSurface * gdk_surface_new_temp (GdkDisplay *display,
const GdkRectangle *position);
void gdk_surface_set_fullscreen_mode (GdkSurface *surface,
GdkFullscreenMode mode);
GdkFullscreenMode gdk_surface_get_fullscreen_mode (GdkSurface *surface);
G_END_DECLS
#endif /* __GDK_INTERNALS_H__ */

View File

@ -642,22 +642,26 @@ gdk_surface_set_property (GObject *object,
break;
case LAST_PROP + GDK_POPUP_NUM_PROPERTIES + GDK_TOPLEVEL_PROP_TITLE:
gdk_surface_set_title (surface, g_value_get_string (value));
GDK_SURFACE_GET_CLASS (surface)->set_title (surface, g_value_get_string (value));
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
break;
case LAST_PROP + GDK_POPUP_NUM_PROPERTIES + GDK_TOPLEVEL_PROP_STARTUP_ID:
gdk_surface_set_startup_id (surface, g_value_get_string (value));
GDK_SURFACE_GET_CLASS (surface)->set_startup_id (surface, g_value_get_string (value));
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
break;
case LAST_PROP + GDK_POPUP_NUM_PROPERTIES + GDK_TOPLEVEL_PROP_TRANSIENT_FOR:
gdk_surface_set_transient_for (surface, g_value_get_object (value));
GDK_SURFACE_GET_CLASS (surface)->set_transient_for (surface, g_value_get_object (value));
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
break;
case LAST_PROP + GDK_POPUP_NUM_PROPERTIES + GDK_TOPLEVEL_PROP_MODAL:
GDK_SURFACE_GET_CLASS (surface)->set_modal_hint (surface, g_value_get_boolean (value));
break;
case LAST_PROP + GDK_POPUP_NUM_PROPERTIES + GDK_TOPLEVEL_PROP_ICON_LIST:
gdk_surface_set_icon_list (surface, g_value_get_pointer (value));
GDK_SURFACE_GET_CLASS (surface)->set_icon_list (surface, g_value_get_pointer (value));
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
break;
case LAST_PROP + GDK_POPUP_NUM_PROPERTIES + GDK_TOPLEVEL_PROP_STICKY:
@ -1120,23 +1124,6 @@ gdk_surface_is_viewable (GdkSurface *surface)
return surface->viewable;
}
/**
* gdk_surface_get_state:
* @surface: a #GdkSurface
*
* Gets the bitwise OR of the currently active surface state flags,
* from the #GdkSurfaceState enumeration.
*
* Returns: surface state bitfield
**/
GdkSurfaceState
gdk_surface_get_state (GdkSurface *surface)
{
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
return surface->state;
}
GdkGLContext *
gdk_surface_get_shared_data_gl_context (GdkSurface *surface)
{
@ -1904,120 +1891,6 @@ 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 cant 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 dont 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
@ -2226,9 +2099,9 @@ gdk_toplevel_surface_present (GdkToplevel *toplevel,
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))
{
@ -2638,58 +2511,6 @@ gdk_surface_set_input_region (GdkSurface *surface,
GDK_SURFACE_GET_CLASS (surface)->set_input_region (surface, surface->input_region);
}
/**
* 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.
*
* Determines whether or not the desktop environment shuld be hinted that
* the surface does not want to receive input focus.
*
* Returns: whether or not the surface should receive input focus.
*/
gboolean
gdk_surface_get_accept_focus (GdkSurface *surface)
{
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
return surface->accept_focus;
}
/**
* gdk_surface_get_focus_on_map:
* @surface: a toplevel #GdkSurface.
*
* Determines whether or not the desktop environment should be hinted that the
* surface does not want to receive input focus when it is mapped.
*
* Returns: whether or not the surface wants to receive input focus when
* it is mapped.
*/
gboolean
gdk_surface_get_focus_on_map (GdkSurface *surface)
{
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
return surface->focus_on_map;
}
static void
update_cursor (GdkDisplay *display,
GdkDevice *device)
@ -2955,455 +2776,6 @@ gdk_surface_create_similar_surface (GdkSurface * surface,
return similar_surface;
}
/**
* gdk_surface_focus:
* @surface: a #GdkSurface
* @timestamp: timestamp of the event triggering the surface focus
*
* Sets keyboard focus to @surface. In most cases, gtk_window_present_with_time()
* should be used on a #GtkWindow, rather than calling this function.
*
**/
void
gdk_surface_focus (GdkSurface *surface,
guint32 timestamp)
{
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 cant 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
* @title: title of @surface
*
* Sets the title of a toplevel surface, to be displayed in the titlebar.
* If you havent explicitly set the icon name for the surface
* (using gdk_surface_set_icon_name()), the icon name will be set to
* @title as well. @title must be in UTF-8 encoding (as with all
* user-readable strings in GDK and GTK). @title may not be %NULL.
**/
void
gdk_surface_set_title (GdkSurface *surface,
const gchar *title)
{
GDK_SURFACE_GET_CLASS (surface)->set_title (surface, title);
}
/**
* gdk_surface_set_startup_id:
* @surface: a toplevel #GdkSurface
* @startup_id: a string with startup-notification identifier
*
* When using GTK, typically you should use gtk_window_set_startup_id()
* instead of this low-level function.
**/
void
gdk_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
{
GDK_SURFACE_GET_CLASS (surface)->set_startup_id (surface, startup_id);
g_object_notify (G_OBJECT (surface), "startup-id");
}
/**
* gdk_surface_set_transient_for:
* @surface: a toplevel #GdkSurface
* @parent: another toplevel #GdkSurface
*
* Indicates to the window manager that @surface is a transient dialog
* associated with the application surface @parent. This allows the
* window manager to do things like center @surface on @parent and
* keep @surface above @parent.
*
* See gtk_window_set_transient_for() if youre using #GtkWindow or
* #GtkDialog.
**/
void
gdk_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent)
{
surface->transient_for = parent;
GDK_SURFACE_GET_CLASS (surface)->set_transient_for (surface, parent);
g_object_notify (G_OBJECT (surface), "transient-for");
}
/**
* gdk_surface_set_accept_focus:
* @surface: a toplevel #GdkSurface
* @accept_focus: %TRUE if the surface should receive input focus
*
* Setting @accept_focus to %FALSE hints the desktop environment that the
* surface doesnt want to receive input focus.
*
* On X, it is the responsibility of the window manager to interpret this
* hint. ICCCM-compliant window manager usually respect it.
**/
void
gdk_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus)
{
GDK_SURFACE_GET_CLASS (surface)->set_accept_focus (surface, accept_focus);
}
/**
* gdk_surface_set_focus_on_map:
* @surface: a toplevel #GdkSurface
* @focus_on_map: %TRUE if the surface should receive input focus when mapped
*
* Setting @focus_on_map to %FALSE hints the desktop environment that the
* surface doesnt want to receive input focus when it is mapped.
* focus_on_map should be turned off for surfaces that arent triggered
* interactively (such as popups from network activity).
*
* On X, it is the responsibility of the window manager to interpret
* this hint. Window managers following the freedesktop.org window
* manager extension specification should respect it.
**/
void
gdk_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map)
{
GDK_SURFACE_GET_CLASS (surface)->set_focus_on_map (surface, focus_on_map);
}
/**
* gdk_surface_set_icon_list:
* @surface: The #GdkSurface toplevel surface to set the icon of.
* @surfaces: (transfer none) (element-type GdkTexture):
* A list of image surfaces, of different sizes.
*
* Sets a list of icons for the surface. One of these will be used
* to represent the surface when it has been iconified. The icon is
* usually shown in an icon box or some sort of task bar. Which icon
* size is shown depends on the window manager. The window manager
* can scale the icon but setting several size icons can give better
* image quality since the window manager may only need to scale the
* icon by a small amount or not at all.
*
* Note that some platforms don't support surface icons.
*/
void
gdk_surface_set_icon_list (GdkSurface *surface,
GList *textures)
{
GDK_SURFACE_GET_CLASS (surface)->set_icon_list (surface, textures);
g_object_notify (G_OBJECT (surface), "icon-list");
}
/**
* gdk_surface_set_icon_name:
* @surface: a toplevel #GdkSurface
* @name: (allow-none): name of surface while iconified (minimized)
*
* Surfaces may have a name used while minimized, distinct from the
* name they display in their titlebar. Most of the time this is a bad
* idea from a user interface standpoint. But you can set such a name
* with this function, if you like.
*
* After calling this with a non-%NULL @name, calls to gdk_surface_set_title()
* will not update the icon title.
*
* Using %NULL for @name unsets the icon title; further calls to
* gdk_surface_set_title() will again update the icon title as well.
*
* Note that some platforms don't support surface icons.
**/
void
gdk_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
{
GDK_SURFACE_GET_CLASS (surface)->set_icon_name (surface, name);
}
/**
* gdk_surface_minimize:
* @surface: a toplevel #GdkSurface
*
* Asks to minimize the @surface.
*
* The windowing system may choose to ignore the request.
*
* You can track the result of this request by using the #GdkSurface:state
* property.
*
* This function only makes sense when @surface is a toplevel surface.
*/
void
gdk_surface_minimize (GdkSurface *surface)
{
g_return_if_fail (GDK_IS_SURFACE (surface));
GDK_SURFACE_GET_CLASS (surface)->minimize (surface);
}
/**
* gdk_surface_unminimize:
* @surface: a toplevel #GdkSurface
*
* Asks to unminimize the @surface.
*
* The windowing system may choose to ignore the request.
*
* You can track the result of this request by using the #GdkSurface:state
* property.
*
* This function only makes sense when @surface is a toplevel surface.
*/
void
gdk_surface_unminimize (GdkSurface *surface)
{
g_return_if_fail (GDK_IS_SURFACE (surface));
GDK_SURFACE_GET_CLASS (surface)->unminimize (surface);
}
/**
* gdk_surface_stick:
* @surface: a toplevel #GdkSurface
*
* Pins a surface such that its on all workspaces and does not scroll
* with viewports, for window managers that have scrollable viewports.
* (When using #GtkWindow, gtk_window_stick() may be more useful.)
*
* On the X11 platform, this function depends on window manager
* support, so may have no effect with many window managers. However,
* GDK will do the best it can to convince the window manager to stick
* the surface. For window managers that dont support this operation,
* theres nothing you can do to force it to happen.
*
**/
void
gdk_surface_stick (GdkSurface *surface)
{
GDK_SURFACE_GET_CLASS (surface)->stick (surface);
}
/**
* gdk_surface_unstick:
* @surface: a toplevel #GdkSurface
*
* Reverse operation for gdk_surface_stick(); see gdk_surface_stick(),
* and gtk_window_unstick().
*
**/
void
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 dont have a concept of
* maximized; so you cant 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 wasnt 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 dont have a
* concept of maximized; so you cant 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
*
* Moves the surface into fullscreen mode. This means the
* surface covers the entire screen and is above any panels
* or task bars.
*
* If the surface was already fullscreen, then this function does nothing.
*
* On X11, asks the window manager to put @surface in a fullscreen
* state, if the window manager supports this operation. Not all
* window managers support this, and some deliberately ignore it or
* dont have a concept of fullscreen; so you cant rely on the
* fullscreenification actually happening. But it will happen with
* most standard window managers, and GDK makes a best effort to get
* it to happen.
**/
void
gdk_surface_fullscreen (GdkSurface *surface)
{
GDK_SURFACE_GET_CLASS (surface)->fullscreen (surface);
}
/**
* gdk_surface_fullscreen_on_monitor:
* @surface: a toplevel #GdkSurface
* @monitor: Which monitor to display fullscreen on.
*
* Moves the surface into fullscreen mode on the given monitor. This means
* the surface covers the entire screen and is above any panels or task bars.
*
* If the surface was already fullscreen, then this function does nothing.
**/
void
gdk_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
{
g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (GDK_IS_MONITOR (monitor));
g_return_if_fail (gdk_monitor_get_display (monitor) == surface->display);
g_return_if_fail (gdk_monitor_is_valid (monitor));
if (GDK_SURFACE_GET_CLASS (surface)->fullscreen_on_monitor != NULL)
GDK_SURFACE_GET_CLASS (surface)->fullscreen_on_monitor (surface, monitor);
else
GDK_SURFACE_GET_CLASS (surface)->fullscreen (surface);
}
/**
* gdk_surface_set_fullscreen_mode:
* @surface: a toplevel #GdkSurface
* @mode: fullscreen mode
*
* Specifies whether the @surface should span over all monitors (in a multi-head
* setup) or only the current monitor when in fullscreen mode.
*
* The @mode argument is from the #GdkFullscreenMode enumeration.
* If #GDK_FULLSCREEN_ON_ALL_MONITORS is specified, the fullscreen @surface will
* span over all monitors of the display.
*
* On X11, searches through the list of monitors display the ones
* which delimit the 4 edges of the entire display and will ask the window
* manager to span the @surface over these monitors.
*
* If the XINERAMA extension is not available or not usable, this function
* has no effect.
*
* Not all window managers support this, so you cant rely on the fullscreen
* surface to span over the multiple monitors when #GDK_FULLSCREEN_ON_ALL_MONITORS
* is specified.
**/
void
gdk_surface_set_fullscreen_mode (GdkSurface *surface,
GdkFullscreenMode mode)
@ -3419,14 +2791,6 @@ gdk_surface_set_fullscreen_mode (GdkSurface *surface,
}
}
/**
* gdk_surface_get_fullscreen_mode:
* @surface: a toplevel #GdkSurface
*
* Obtains the #GdkFullscreenMode of the @surface.
*
* Returns: The #GdkFullscreenMode applied to the surface when fullscreen.
**/
GdkFullscreenMode
gdk_surface_get_fullscreen_mode (GdkSurface *surface)
{
@ -3435,143 +2799,6 @@ gdk_surface_get_fullscreen_mode (GdkSurface *surface)
return surface->fullscreen_mode;
}
/**
* gdk_surface_unfullscreen:
* @surface: a toplevel #GdkSurface
*
* Moves the surface out of fullscreen mode. If the surface was not
* fullscreen, does nothing.
*
* On X11, asks the window manager to move @surface out of the fullscreen
* state, if the window manager supports this operation. Not all
* window managers support this, and some deliberately ignore it or
* dont have a concept of fullscreen; so you cant rely on the
* unfullscreenification actually happening. But it will happen with
* most standard window managers, and GDK makes a best effort to get
* it to happen.
**/
void
gdk_surface_unfullscreen (GdkSurface *surface)
{
GDK_SURFACE_GET_CLASS (surface)->unfullscreen (surface);
}
/**
* gdk_surface_set_keep_above:
* @surface: a toplevel #GdkSurface
* @setting: whether to keep @surface above other surfaces
*
* Set if @surface must be kept above other surfaces. If the
* surface was already above, then this function does nothing.
*
* On X11, asks the window manager to keep @surface above, if the window
* manager supports this operation. Not all window managers support
* this, and some deliberately ignore it or dont have a concept of
* keep above; so you cant rely on the surface being kept above.
* But it will happen with most standard window managers,
* and GDK makes a best effort to get it to happen.
**/
void
gdk_surface_set_keep_above (GdkSurface *surface,
gboolean setting)
{
GDK_SURFACE_GET_CLASS (surface)->set_keep_above (surface, setting);
}
/**
* gdk_surface_set_keep_below:
* @surface: a toplevel #GdkSurface
* @setting: whether to keep @surface below other surfaces
*
* Set if @surface must be kept below other surfaces. If the
* surface was already below, then this function does nothing.
*
* On X11, asks the window manager to keep @surface below, if the window
* manager supports this operation. Not all window managers support
* this, and some deliberately ignore it or dont have a concept of
* keep below; so you cant rely on the surface being kept below.
* But it will happen with most standard window managers,
* and GDK makes a best effort to get it to happen.
**/
void
gdk_surface_set_keep_below (GdkSurface *surface,
gboolean setting)
{
GDK_SURFACE_GET_CLASS (surface)->set_keep_below (surface, setting);
}
/**
* gdk_surface_set_decorations:
* @surface: a toplevel #GdkSurface
* @decorations: decoration hint mask
*
* Decorations are the features the window manager adds to a toplevel #GdkSurface.
* This function sets the traditional Motif window manager hints that tell the
* window manager which decorations you would like your surface to have.
* Usually you should use gtk_window_set_decorated() on a #GtkWindow instead of
* using the GDK function directly.
*
* The @decorations argument is the logical OR of the fields in
* the #GdkWMDecoration enumeration. If #GDK_DECOR_ALL is included in the
* mask, the other bits indicate which decorations should be turned off.
* If #GDK_DECOR_ALL is not included, then the other bits indicate
* which decorations should be turned on.
*
* Most window managers honor a decorations hint of 0 to disable all decorations,
* but very few honor all possible combinations of bits.
*
**/
void
gdk_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
{
GDK_SURFACE_GET_CLASS (surface)->set_decorations (surface, decorations);
}
/**
* gdk_surface_get_decorations:
* @surface: The toplevel #GdkSurface to get the decorations from
* @decorations: (out): The surface decorations will be written here
*
* Returns the decorations set on the GdkSurface with
* gdk_surface_set_decorations().
*
* Returns: %TRUE if the surface has decorations set, %FALSE otherwise.
**/
gboolean
gdk_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations)
{
return GDK_SURFACE_GET_CLASS (surface)->get_decorations (surface, decorations);
}
/**
* gdk_surface_set_functions:
* @surface: a toplevel #GdkSurface
* @functions: bitmask of operations to allow on @surface
*
* Sets hints about the window management functions to make available
* via buttons on the window frame.
*
* On the X backend, this function sets the traditional Motif window
* manager hint for this purpose. However, few window managers do
* anything reliable or interesting with this hint. Many ignore it
* entirely.
*
* The @functions argument is the logical OR of values from the
* #GdkWMFunction enumeration. If the bitmask includes #GDK_FUNC_ALL,
* then the other bits indicate which functions to disable; if
* it doesnt include #GDK_FUNC_ALL, it indicates which functions to
* enable.
*
**/
void
gdk_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
{
GDK_SURFACE_GET_CLASS (surface)->set_functions (surface, functions);
}
/**
* gdk_surface_begin_resize_drag:
* @surface: a toplevel #GdkSurface
@ -3972,35 +3199,6 @@ gdk_surface_set_shadow_width (GdkSurface *surface,
class->set_shadow_width (surface, left, right, top, bottom);
}
/**
* gdk_surface_show_window_menu:
* @surface: a #GdkSurface
* @event: a #GdkEvent to show the menu for
*
* Asks the windowing system to show the window menu. The window menu
* is the menu shown when right-clicking the titlebar on traditional
* windows managed by the window manager. This is useful for windows
* using client-side decorations, activating it with a right-click
* on the window decorations.
*
* Returns: %TRUE if the window menu was shown and %FALSE otherwise.
*/
gboolean
gdk_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event)
{
GdkSurfaceClass *class;
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), FALSE);
class = GDK_SURFACE_GET_CLASS (surface);
if (class->show_window_menu)
return class->show_window_menu (surface, event);
else
return FALSE;
}
gboolean
gdk_surface_supports_edge_constraints (GdkSurface *surface)
{

View File

@ -357,34 +357,10 @@ 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
gboolean gdk_surface_get_accept_focus (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus);
GDK_AVAILABLE_IN_ALL
gboolean gdk_surface_get_focus_on_map (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_input_region (GdkSurface *surface,
cairo_region_t *region);
@ -395,36 +371,6 @@ gboolean gdk_surface_is_viewable (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
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);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_cursor (GdkSurface *surface,
GdkCursor *cursor);
@ -456,21 +402,6 @@ void gdk_surface_get_device_position (GdkSurface *surface,
double *x,
double *y,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_icon_list (GdkSurface *surface,
GList *surfaces);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_icon_name (GdkSurface *surface,
const gchar *name);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations);
GDK_AVAILABLE_IN_ALL
gboolean gdk_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions);
GDK_AVAILABLE_IN_ALL
cairo_surface_t *
@ -482,37 +413,6 @@ cairo_surface_t *
GDK_AVAILABLE_IN_ALL
void gdk_surface_beep (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_minimize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_unminimize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
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,
GdkMonitor *monitor);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_fullscreen_mode (GdkSurface *surface,
GdkFullscreenMode mode);
GDK_AVAILABLE_IN_ALL
GdkFullscreenMode
gdk_surface_get_fullscreen_mode (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_unfullscreen (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_keep_above (GdkSurface *surface,
gboolean setting);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_keep_below (GdkSurface *surface,
gboolean setting);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_opacity (GdkSurface *surface,
gdouble opacity);
@ -568,9 +468,6 @@ void gdk_surface_set_shadow_width (GdkSurface *surface,
gint right,
gint top,
gint bottom);
GDK_AVAILABLE_IN_ALL
gboolean gdk_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkCairoContext *gdk_surface_create_cairo_context(GdkSurface *surface);