![]() |
![]() |
![]() |
![]() |
GdkCursor * | cursor | Read / Write |
GdkDisplay * | display | Read / Write / Construct Only |
GdkFrameClock * | frame-clock | Read / Write / Construct Only |
gboolean | mapped | Read |
GdkSurfaceState | state | Read |
GdkSurface | |
enum | GdkSurfaceType |
enum | GdkSurfaceHints |
struct | GdkGeometry |
enum | GdkGravity |
enum | GdkAnchorHints |
enum | GdkSurfaceEdge |
enum | GdkSurfaceTypeHint |
enum | GdkSurfaceState |
enum | GdkFullscreenMode |
#define | GDK_PARENT_RELATIVE |
enum | GdkModifierType |
enum | GdkModifierIntent |
enum | GdkWMDecoration |
enum | GdkWMFunction |
A GdkSurface is a (usually) rectangular region on the screen. It’s a low-level object, used to implement high-level objects such as GtkWidget and GtkWindow on the GTK level. A GtkWindow is a toplevel surface, the thing a user might think of as a “window” with a titlebar and so on; a GtkWindow may contain many sub-GdkSurfaces.
GdkSurface * gdk_surface_new_toplevel (GdkDisplay *display
,int width
,int height
);
Creates a new toplevel surface. The surface will be managed by the surface manager.
[constructor]
GdkSurface * gdk_surface_new_popup (GdkDisplay *display
,const GdkRectangle *position
);
Creates a new toplevel popup surface. The surface will bypass surface management.
[constructor]
GdkSurface *
gdk_surface_new_temp (GdkDisplay *display
);
Creates a new toplevel temporary surface. The surface will be situated off-screen and not handle output.
You most likely do not want to use this function.
[constructor]
GdkSurface * gdk_surface_new_child (GdkSurface *parent
,const GdkRectangle *position
);
Creates a new client-side child surface.
[constructor]
void
gdk_surface_destroy (GdkSurface *surface
);
Destroys the window system resources associated with surface
and decrements surface
's
reference count. The window system resources for all children of surface
are also
destroyed, but the children’s reference counts are not decremented.
Note that a surface will not be destroyed automatically when its reference count reaches zero. You must call this function yourself before that happens.
GdkSurfaceType
gdk_surface_get_surface_type (GdkSurface *surface
);
Gets the type of the surface. See GdkSurfaceType.
GdkDisplay *
gdk_surface_get_display (GdkSurface *surface
);
Gets the GdkDisplay associated with a GdkSurface.
void
gdk_surface_show (GdkSurface *surface
);
Like gdk_surface_show_unraised()
, but also raises the surface to the
top of the surface stack (moves the surface to the front of the
Z-order).
This function maps a surface so it’s visible onscreen. Its opposite
is gdk_surface_hide()
.
When implementing a GtkWidget, you should call this function on the widget's GdkSurface as part of the “map” method.
void
gdk_surface_show_unraised (GdkSurface *surface
);
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_hide (GdkSurface *surface
);
For toplevel surfaces, withdraws them, so they will no longer be
known to the window manager; for all surfaces, unmaps them, so
they won’t be displayed. Normally done automatically as
part of gtk_widget_hide()
.
gboolean
gdk_surface_is_destroyed (GdkSurface *surface
);
Check to see if a surface is destroyed..
gboolean
gdk_surface_is_visible (GdkSurface *surface
);
Checks whether the surface has been mapped (with gdk_surface_show()
or
gdk_surface_show_unraised()
).
gboolean
gdk_surface_is_viewable (GdkSurface *surface
);
Check if the surface and all ancestors of the surface are mapped. (This is not necessarily "viewable" in the X sense, since we only check as far as we have GDK surface parents, not to the root surface.)
gboolean
gdk_surface_is_input_only (GdkSurface *surface
);
Determines whether or not the surface is an input only surface.
GdkSurfaceState
gdk_surface_get_state (GdkSurface *surface
);
Gets the bitwise OR of the currently active surface state flags, from the GdkSurfaceState enumeration.
void
gdk_surface_iconify (GdkSurface *surface
);
Asks to iconify (minimize) surface
. The window manager may choose
to ignore the request, but normally will honor it. Using
gtk_window_iconify()
is preferred, if you have a GtkWindow widget.
This function only makes sense when surface
is a toplevel surface.
void
gdk_surface_deiconify (GdkSurface *surface
);
Attempt to deiconify (unminimize) surface
. On X11 the window manager may
choose to ignore the request to deiconify. When using GTK,
use gtk_window_deiconify()
instead of the GdkSurface variant. Or better yet,
you probably want to use gtk_window_present_with_time()
, which raises the surface, focuses it,
unminimizes it, and puts it on the current desktop.
void
gdk_surface_stick (GdkSurface *surface
);
“Pins” a surface such that it’s 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 don’t support this operation, there’s nothing you can do to force it to happen.
void
gdk_surface_unstick (GdkSurface *surface
);
Reverse operation for gdk_surface_stick()
; see gdk_surface_stick()
,
and gtk_window_unstick()
.
void
gdk_surface_maximize (GdkSurface *surface
);
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_unmaximize (GdkSurface *surface
);
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_fullscreen (GdkSurface *surface
);
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
don’t have a concept of “fullscreen”; so you can’t 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_on_monitor (GdkSurface *surface
,GdkMonitor *monitor
);
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_unfullscreen (GdkSurface *surface
);
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
don’t have a concept of “fullscreen”; so you can’t 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.
GdkFullscreenMode
gdk_surface_get_fullscreen_mode (GdkSurface *surface
);
Obtains the GdkFullscreenMode of the surface
.
void gdk_surface_set_fullscreen_mode (GdkSurface *surface
,GdkFullscreenMode 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 can’t rely on the fullscreen surface to span over the multiple monitors when GDK_FULLSCREEN_ON_ALL_MONITORS is specified.
void gdk_surface_set_keep_above (GdkSurface *surface
,gboolean setting
);
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 don’t have a concept of
“keep above”; so you can’t 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_below (GdkSurface *surface
,gboolean setting
);
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 don’t have a concept of
“keep below”; so you can’t 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_opacity (GdkSurface *surface
,gdouble opacity
);
Set surface
to render as partially transparent,
with opacity 0 being fully transparent and 1 fully opaque. (Values
of the opacity parameter are clamped to the [0,1] range.)
For toplevel surfaces this depends on support from the windowing system
that may not always be there. For instance, On X11, this works only on
X screens with a compositing manager running. On Wayland, there is no
per-surface opacity value that the compositor would apply. Instead, use
gdk_surface_set_opaque_region (surface, NULL)
to tell the compositor
that the entire surface is (potentially) non-opaque, and draw your content
with alpha, or use gtk_widget_set_opacity()
to set an overall opacity
for your widgets.
Support for non-toplevel surfaces was added in 3.8.
void gdk_surface_set_pass_through (GdkSurface *surface
,gboolean pass_through
);
Sets whether input to the surface is passed through to the surface below.
The default value of this is FALSE
, which means that pointer
events that happen inside the surface are send first to the surface,
but if the event is not selected by the event mask then the event
is sent to the parent surface, and so on up the hierarchy.
If pass_through
is TRUE
then such pointer events happen as if the
surface wasn't there at all, and thus will be sent first to any
surfaces below surface
. This is useful if the surface is used in a
transparent fashion. In the terminology of the web this would be called
"pointer-events: none".
Note that a surface with pass_through
TRUE
can still have a subsurface
without pass through, so you can get events on a subset of a surface. And in
that cases you would get the in-between related events such as the pointer
enter/leave events on its way to the destination surface.
gboolean
gdk_surface_get_pass_through (GdkSurface *surface
);
Returns whether input to the surface is passed through to the surface below.
See gdk_surface_set_pass_through()
for details
void gdk_surface_move (GdkSurface *surface
,gint x
,gint y
);
Repositions a surface relative to its parent surface.
For toplevel surfaces, window managers may ignore or modify the move;
you should probably use gtk_window_move()
on a GtkWindow widget
anyway, instead of using GDK functions. For child surfaces,
the move will reliably succeed.
If you’re also planning to resize the surface, use gdk_surface_move_resize()
to both move and resize simultaneously, for a nicer visual effect.
void gdk_surface_resize (GdkSurface *surface
,gint width
,gint height
);
Resizes surface
; for toplevel surfaces, asks the window manager to resize
the surface. The window manager may not allow the resize. When using GTK,
use gtk_window_resize()
instead of this low-level GDK function.
Surfaces may not be resized below 1x1.
If you’re also planning to move the surface, use gdk_surface_move_resize()
to both move and resize simultaneously, for a nicer visual effect.
void gdk_surface_move_resize (GdkSurface *surface
,gint x
,gint y
,gint width
,gint height
);
Equivalent to calling gdk_surface_move()
and gdk_surface_resize()
,
except that both operations are performed at once, avoiding strange
visual effects. (i.e. the user may be able to see the surface first
move, then resize, if you don’t use gdk_surface_move_resize()
.)
void gdk_surface_move_to_rect (GdkSurface *surface
,const GdkRectangle *rect
,GdkGravity rect_anchor
,GdkGravity surface_anchor
,GdkAnchorHints anchor_hints
,gint rect_anchor_dx
,gint rect_anchor_dy
);
Moves surface
to rect
, aligning their anchor points.
rect
is relative to the top-left corner of the surface that surface
is
transient for. rect_anchor
and surface_anchor
determine anchor points on
rect
and surface
to pin together. rect
's anchor point can optionally be
offset by rect_anchor_dx
and rect_anchor_dy
, which is equivalent to
offsetting the position of surface
.
anchor_hints
determines how surface
will be moved if the anchor points cause
it to move off-screen. For example, GDK_ANCHOR_FLIP_X
will replace
GDK_GRAVITY_NORTH_WEST
with GDK_GRAVITY_NORTH_EAST
and vice versa if
surface
extends beyond the left or right edges of the monitor.
Connect to the “moved-to-rect” signal to find out how it was actually positioned.
surface |
the GdkSurface to move |
|
rect |
the destination GdkRectangle to align |
[not nullable] |
rect_anchor |
the point on |
|
surface_anchor |
the point on |
|
anchor_hints |
positioning hints to use when limited on space |
|
rect_anchor_dx |
horizontal offset to shift |
|
rect_anchor_dy |
vertical offset to shift |
gboolean
gdk_surface_has_native (GdkSurface *surface
);
Checks whether the surface has a native surface or not.
void
gdk_surface_raise (GdkSurface *surface
);
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_lower (GdkSurface *surface
);
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_restack (GdkSurface *surface
,GdkSurface *sibling
,gboolean above
);
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.
surface |
||
sibling |
a GdkSurface that is a sibling of |
[allow-none] |
above |
a boolean |
void gdk_surface_focus (GdkSurface *surface
,guint32 timestamp
);
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_register_dnd (GdkSurface *surface
);
Registers a surface as a potential drop destination.
void gdk_surface_begin_resize_drag (GdkSurface *surface
,GdkSurfaceEdge edge
,gint button
,gint x
,gint y
,guint32 timestamp
);
Begins a surface resize operation (for a toplevel surface).
This function assumes that the drag is controlled by the
client pointer device, use gdk_surface_begin_resize_drag_for_device()
to begin a drag with a different device.
surface |
a toplevel GdkSurface |
|
edge |
the edge or corner from which the drag is started |
|
button |
the button being used to drag, or 0 for a keyboard-initiated drag |
|
x |
surface X coordinate of mouse click that began the drag |
|
y |
surface Y coordinate of mouse click that began the drag |
|
timestamp |
timestamp of mouse click that began the drag (use |
void gdk_surface_begin_resize_drag_for_device (GdkSurface *surface
,GdkSurfaceEdge edge
,GdkDevice *device
,gint button
,gint x
,gint y
,guint32 timestamp
);
Begins a surface resize operation (for a toplevel surface). You might use this function to implement a “window resize grip,”
surface |
a toplevel GdkSurface |
|
edge |
the edge or corner from which the drag is started |
|
device |
the device used for the operation |
|
button |
the button being used to drag, or 0 for a keyboard-initiated drag |
|
x |
surface X coordinate of mouse click that began the drag |
|
y |
surface Y coordinate of mouse click that began the drag |
|
timestamp |
timestamp of mouse click that began the drag (use |
void gdk_surface_begin_move_drag (GdkSurface *surface
,gint button
,gint x
,gint y
,guint32 timestamp
);
Begins a surface move operation (for a toplevel surface).
This function assumes that the drag is controlled by the
client pointer device, use gdk_surface_begin_move_drag_for_device()
to begin a drag with a different device.
surface |
a toplevel GdkSurface |
|
button |
the button being used to drag, or 0 for a keyboard-initiated drag |
|
x |
surface X coordinate of mouse click that began the drag |
|
y |
surface Y coordinate of mouse click that began the drag |
|
timestamp |
timestamp of mouse click that began the drag |
void gdk_surface_begin_move_drag_for_device (GdkSurface *surface
,GdkDevice *device
,gint button
,gint x
,gint y
,guint32 timestamp
);
Begins a surface move operation (for a toplevel surface).
surface |
a toplevel GdkSurface |
|
device |
the device used for the operation |
|
button |
the button being used to drag, or 0 for a keyboard-initiated drag |
|
x |
surface X coordinate of mouse click that began the drag |
|
y |
surface Y coordinate of mouse click that began the drag |
|
timestamp |
timestamp of mouse click that began the drag |
gboolean gdk_surface_show_window_menu (GdkSurface *surface
,GdkEvent *event
);
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.
void gdk_surface_constrain_size (GdkGeometry *geometry
,GdkSurfaceHints flags
,gint width
,gint height
,gint *new_width
,gint *new_height
);
Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size).
geometry |
a GdkGeometry structure |
|
flags |
a mask indicating what portions of |
|
width |
desired width of surface |
|
height |
desired height of the surface |
|
new_width |
location to store resulting width. |
[out] |
new_height |
location to store resulting height. |
[out] |
void
gdk_surface_beep (GdkSurface *surface
);
Emits a short beep associated to surface
in the appropriate
display, if supported. Otherwise, emits a short beep on
the display just as gdk_display_beep()
.
gint
gdk_surface_get_scale_factor (GdkSurface *surface
);
Returns the internal scale factor that maps from surface coordiantes to the actual device pixels. On traditional systems this is 1, but on very high density outputs this can be a higher value (often 2).
A higher value means that drawing is automatically scaled up to a higher resolution, so any code doing drawing will automatically look nicer. However, if you are supplying pixel-based data the scale value can be used to determine whether to use a pixel resource with higher resolution data.
The scale of a surface may change during runtime, if this happens a configure event will be sent to the toplevel surface.
void gdk_surface_set_opaque_region (GdkSurface *surface
,cairo_region_t *region
);
For optimisation purposes, compositing window managers may like to not draw obscured regions of surfaces, or turn off blending during for these regions. With RGB windows with no transparency, this is just the shape of the window, but with ARGB32 windows, the compositor does not know what regions of the window are transparent or not.
This function only works for toplevel surfaces.
GTK will update this property automatically if
the surface
background is opaque, as we know where the opaque regions
are. If your surface background is not opaque, please update this
property in your “style-updated” handler.
GdkGLContext * gdk_surface_create_gl_context (GdkSurface *surface
,GError **error
);
Creates a new GdkGLContext matching the framebuffer format to the visual of the GdkSurface. The context is disconnected from any particular surface or surface.
If the creation of the GdkGLContext failed, error
will be set.
Before using the returned GdkGLContext, you will need to
call gdk_gl_context_make_current()
or gdk_gl_context_realize()
.
GdkVulkanContext * gdk_surface_create_vulkan_context (GdkSurface *surface
,GError **error
);
Creates a new GdkVulkanContext for rendering on surface
.
If the creation of the GdkVulkanContext failed, error
will be set.
GdkCairoContext *
gdk_surface_create_cairo_context (GdkSurface *surface
);
Creates a new GdkCairoContext for rendering on surface
.
void
gdk_surface_queue_expose (GdkSurface *surface
);
Forces an expose event for surface
to be scheduled.
If the invalid area of surface
is empty, an expose event will
still be emitted. Its invalid region will be empty.
This function is useful for implementations that track invalid regions on their own.
void
gdk_surface_freeze_updates (GdkSurface *surface
);
Temporarily freezes a surface such that it won’t receive expose
events. The surface will begin receiving expose events again when
gdk_surface_thaw_updates()
is called. If gdk_surface_freeze_updates()
has been called more than once, gdk_surface_thaw_updates()
must be called
an equal number of times to begin processing exposes.
void
gdk_surface_thaw_updates (GdkSurface *surface
);
Thaws a surface frozen with gdk_surface_freeze_updates()
.
GdkFrameClock *
gdk_surface_get_frame_clock (GdkSurface *surface
);
Gets the frame clock for the surface. The frame clock for a surface never changes unless the surface is reparented to a new toplevel surface.
void gdk_surface_set_accept_focus (GdkSurface *surface
,gboolean accept_focus
);
Setting accept_focus
to FALSE
hints the desktop environment that the
surface doesn’t 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.
surface |
a toplevel GdkSurface |
|
accept_focus |
|
gboolean
gdk_surface_get_accept_focus (GdkSurface *surface
);
Determines whether or not the desktop environment shuld be hinted that the surface does not want to receive input focus.
void gdk_surface_set_focus_on_map (GdkSurface *surface
,gboolean focus_on_map
);
Setting focus_on_map
to FALSE
hints the desktop environment that the
surface doesn’t want to receive input focus when it is mapped.
focus_on_map should be turned off for surfaces that aren’t 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.
surface |
a toplevel GdkSurface |
|
focus_on_map |
|
gboolean
gdk_surface_get_focus_on_map (GdkSurface *surface
);
Determines whether or not the desktop environment should be hinted that the surface does not want to receive input focus when it is mapped.
void gdk_surface_input_shape_combine_region (GdkSurface *surface
,const cairo_region_t *shape_region
,gint offset_x
,gint offset_y
);
Like gdk_surface_shape_combine_region()
, but the shape applies
only to event handling. Mouse events which happen while
the pointer position corresponds to an unset bit in the
mask will be passed on the surface below surface
.
An input shape is typically used with RGBA surfaces. The alpha channel of the surface defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the surface is “clickable”.
On the X11 platform, this requires version 1.1 of the shape extension.
On the Win32 platform, this functionality is not present and the function does nothing.
void
gdk_surface_set_child_input_shapes (GdkSurface *surface
);
Sets the input shape mask of surface
to the union of input shape masks
for all children of surface
, ignoring the input shape mask of surface
itself. Contrast with gdk_surface_merge_child_input_shapes()
which includes
the input shape mask of surface
in the masks to be merged.
void
gdk_surface_merge_child_input_shapes (GdkSurface *surface
);
Merges the input shape masks for any child surfaces into the
input shape mask for surface
. i.e. the union of all input masks
for surface
and its children will become the new input mask
for surface
. See gdk_surface_input_shape_combine_region()
.
This function is distinct from gdk_surface_set_child_input_shapes()
because it includes surface
’s input shape mask in the set of
shapes to be merged.
void gdk_surface_set_title (GdkSurface *surface
,const gchar *title
);
Sets the title of a toplevel surface, to be displayed in the titlebar.
If you haven’t 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_cursor (GdkSurface *surface
,GdkCursor *cursor
);
Sets the default mouse pointer for a GdkSurface.
Note that cursor
must be for the same display as surface
.
Use gdk_cursor_new_from_name()
or gdk_cursor_new_from_texture()
to
create the cursor. To make the cursor invisible, use GDK_BLANK_CURSOR
.
Passing NULL
for the cursor
argument to gdk_surface_set_cursor()
means
that surface
will use the cursor of its parent surface. Most surfaces
should use this default.
GdkCursor *
gdk_surface_get_cursor (GdkSurface *surface
);
Retrieves a GdkCursor pointer for the cursor currently set on the
specified GdkSurface, or NULL
. If the return value is NULL
then
there is no custom cursor set on the specified surface, and it is
using the cursor for its parent surface.
a GdkCursor, or NULL
. The
returned object is owned by the GdkSurface and should not be
unreferenced directly. Use gdk_surface_set_cursor()
to unset the
cursor of the surface.
[nullable][transfer none]
void gdk_surface_get_geometry (GdkSurface *surface
,gint *x
,gint *y
,gint *width
,gint *height
);
Any of the return location arguments to this function may be NULL
,
if you aren’t interested in getting the value of that field.
The X and Y coordinates returned are relative to the parent surface
of surface
, which for toplevels usually means relative to the
surface decorations (titlebar, etc.) rather than relative to the
root window (screen-size background window).
On the X11 platform, the geometry is obtained from the X server,
so reflects the latest position of surface
; this may be out-of-sync
with the position of surface
delivered in the most-recently-processed
GdkEventConfigure. gdk_surface_get_position()
in contrast gets the
position from the most recent configure event.
Note: If surface
is not a toplevel, it is much better
to call gdk_surface_get_position()
, gdk_surface_get_width()
and
gdk_surface_get_height()
instead, because it avoids the roundtrip to
the X server and because these functions support the full 32-bit
coordinate space, whereas gdk_surface_get_geometry()
is restricted to
the 16-bit coordinates of X11.
surface |
||
x |
return location for X coordinate of surface (relative to its parent). |
[out][allow-none] |
y |
return location for Y coordinate of surface (relative to its parent). |
[out][allow-none] |
width |
return location for width of surface. |
[out][allow-none] |
height |
return location for height of surface. |
[out][allow-none] |
void gdk_surface_set_geometry_hints (GdkSurface *surface
,const GdkGeometry *geometry
,GdkSurfaceHints geom_mask
);
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()
or
gdk_surface_move_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.
surface |
a toplevel GdkSurface |
|
geometry |
geometry hints |
|
geom_mask |
bitmask indicating fields of |
int
gdk_surface_get_width (GdkSurface *surface
);
Returns the width of the given surface
.
On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.
int
gdk_surface_get_height (GdkSurface *surface
);
Returns the height of the given surface
.
On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.
void gdk_surface_set_icon_list (GdkSurface *surface
,GList *surfaces
);
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.
surface |
The GdkSurface toplevel surface to set the icon of. |
|
surfaces |
A list of image surfaces, of different sizes. |
[transfer none][element-type GdkTexture] |
void gdk_surface_set_modal_hint (GdkSurface *surface
,gboolean modal
);
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()
gboolean
gdk_surface_get_modal_hint (GdkSurface *surface
);
Determines whether or not the window manager is hinted that surface
has modal behaviour.
void gdk_surface_set_type_hint (GdkSurface *surface
,GdkSurfaceTypeHint hint
);
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.
GdkSurfaceTypeHint
gdk_surface_get_type_hint (GdkSurface *surface
);
This function returns the type hint set for a surface.
void gdk_surface_set_shadow_width (GdkSurface *surface
,gint left
,gint right
,gint top
,gint bottom
);
Newer GTK windows using client-side decorations use extra geometry around their frames for effects like shadows and invisible borders. Window managers that want to maximize windows or snap to edges need to know where the extents of the actual frame lie, so that users don’t feel like windows are snapping against random invisible edges.
Note that this property is automatically updated by GTK, so this function should only be used by applications which do not use GTK to create toplevel surfaces.
void gdk_surface_get_position (GdkSurface *surface
,gint *x
,gint *y
);
Obtains the position of the surface as reported in the
most-recently-processed GdkEventConfigure. Contrast with
gdk_surface_get_geometry()
which queries the X server for the
current surface position, regardless of which events have been
received or processed.
The position coordinates are relative to the surface’s parent surface.
void gdk_surface_get_root_origin (GdkSurface *surface
,gint *x
,gint *y
);
Obtains the top-left corner of the window manager frame in root surface coordinates.
surface |
a toplevel GdkSurface |
|
x |
return location for X position of surface frame. |
[out] |
y |
return location for Y position of surface frame. |
[out] |
void gdk_surface_get_frame_extents (GdkSurface *surface
,GdkRectangle *rect
);
Obtains the bounding box of the surface, including window manager
titlebar/borders if any. The frame position is given in root window
coordinates. To get the position of the surface itself (rather than
the frame) in root window coordinates, use gdk_surface_get_origin()
.
surface |
a toplevel GdkSurface |
|
rect |
rectangle to fill with bounding box of the surface frame. |
[out] |
gint gdk_surface_get_origin (GdkSurface *surface
,gint *x
,gint *y
);
Obtains the position of a surface in root window coordinates.
(Compare with gdk_surface_get_position()
and
gdk_surface_get_geometry()
which return the position of a surface
relative to its parent surface.)
void gdk_surface_get_root_coords (GdkSurface *surface
,gint x
,gint y
,gint *root_x
,gint *root_y
);
Obtains the position of a surface position in root
window coordinates. This is similar to
gdk_surface_get_origin()
but allows you to pass
in any position in the surface, not just the origin.
GdkSurface * gdk_surface_get_device_position (GdkSurface *surface
,GdkDevice *device
,double *x
,double *y
,GdkModifierType *mask
);
Obtains the current device position in doubles and modifier state.
The position is given in coordinates relative to the upper left
corner of surface
.
surface |
a GdkSurface. |
|
device |
pointer GdkDevice to query to. |
|
x |
return location for the X coordinate of |
[out][allow-none] |
y |
return location for the Y coordinate of |
[out][allow-none] |
mask |
return location for the modifier mask, or |
[out][allow-none] |
The surface underneath device
(as with gdk_device_get_surface_at_position()
), or NULL
if the
surface is not known to GDK.
[nullable][transfer none]
GdkSurface *
gdk_surface_get_parent (GdkSurface *surface
);
Obtains the parent of surface
, as known to GDK. Does not query the
X server; thus this returns the parent as passed to gdk_surface_new()
,
not the actual parent. This should never matter unless you’re using
Xlib calls mixed with GDK calls on the X11 platform. It may also
matter for toplevel windows, because the window manager may choose
to reparent them.
GdkSurface *
gdk_surface_get_toplevel (GdkSurface *surface
);
Gets the toplevel surface that’s an ancestor of surface
.
Any surface type but GDK_SURFACE_CHILD
is considered a
toplevel surface, as is a GDK_SURFACE_CHILD
surface that
has a root surface as parent.
GList *
gdk_surface_get_children (GdkSurface *surface
);
Gets the list of children of surface
known to GDK.
This function only returns children created via GDK,
so for example it’s useless when used with the root window;
it only returns surfaces an application created itself.
The returned list must be freed, but the elements in the list need not be.
GList *
gdk_surface_peek_children (GdkSurface *surface
);
Like gdk_surface_get_children()
, but does not copy the list of
children, so the list does not need to be freed.
void gdk_surface_set_icon_name (GdkSurface *surface
,const gchar *name
);
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.
surface |
a toplevel GdkSurface |
|
name |
name of surface while iconified (minimized). |
[allow-none] |
void gdk_surface_set_transient_for (GdkSurface *surface
,GdkSurface *parent
);
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 you’re using GtkWindow or
GtkDialog.
void gdk_surface_set_startup_id (GdkSurface *surface
,const gchar *startup_id
);
When using GTK, typically you should use gtk_window_set_startup_id()
instead of this low-level function.
void gdk_surface_set_decorations (GdkSurface *surface
,GdkWMDecoration decorations
);
“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.
gboolean gdk_surface_get_decorations (GdkSurface *surface
,GdkWMDecoration *decorations
);
Returns the decorations set on the GdkSurface with
gdk_surface_set_decorations()
.
surface |
The toplevel GdkSurface to get the decorations from |
|
decorations |
The surface decorations will be written here. |
[out] |
void gdk_surface_set_functions (GdkSurface *surface
,GdkWMFunction functions
);
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 doesn’t include GDK_FUNC_ALL, it indicates which functions to
enable.
gboolean
gdk_surface_get_support_multidevice (GdkSurface *surface
);
Returns TRUE
if the surface is aware of the existence of multiple
devices.
void gdk_surface_set_support_multidevice (GdkSurface *surface
,gboolean support_multidevice
);
This function will enable multidevice features in surface
.
Multidevice aware surfaces will need to handle properly multiple, per device enter/leave events, device grabs and grab ownerships.
surface |
a GdkSurface. |
|
support_multidevice |
|
GdkCursor * gdk_surface_get_device_cursor (GdkSurface *surface
,GdkDevice *device
);
Retrieves a GdkCursor pointer for the device
currently set on the
specified GdkSurface, or NULL
. If the return value is NULL
then
there is no custom cursor set on the specified surface, and it is
using the cursor for its parent surface.
a GdkCursor, or NULL
. The
returned object is owned by the GdkSurface and should not be
unreferenced directly. Use gdk_surface_set_cursor()
to unset the
cursor of the surface.
[nullable][transfer none]
void gdk_surface_set_device_cursor (GdkSurface *surface
,GdkDevice *device
,GdkCursor *cursor
);
Sets a specific GdkCursor for a given device when it gets inside surface
.
Use gdk_cursor_new_fromm_name()
or gdk_cursor_new_from_texture()
to create
the cursor. To make the cursor invisible, use GDK_BLANK_CURSOR
. Passing
NULL
for the cursor
argument to gdk_surface_set_cursor()
means that
surface
will use the cursor of its parent surface. Most surfaces should
use this default.
void gdk_surface_coords_from_parent (GdkSurface *surface
,gdouble parent_x
,gdouble parent_y
,gdouble *x
,gdouble *y
);
Transforms surface coordinates from a parent surface to a child surface.
Calling this function is equivalent to subtracting the return
values of gdk_surface_get_position()
from the parent coordinates.
See also: gdk_surface_coords_to_parent()
surface |
a child surface |
|
parent_x |
X coordinate in parent’s coordinate system |
|
parent_y |
Y coordinate in parent’s coordinate system |
|
x |
return location for X coordinate in child’s coordinate system. |
[out][allow-none] |
y |
return location for Y coordinate in child’s coordinate system. |
[out][allow-none] |
void gdk_surface_coords_to_parent (GdkSurface *surface
,gdouble x
,gdouble y
,gdouble *parent_x
,gdouble *parent_y
);
Transforms surface coordinates from a child surface to its parent
surface. Calling this function is equivalent to adding the return
values of gdk_surface_get_position()
to the child coordinates.
See also: gdk_surface_coords_from_parent()
surface |
a child surface |
|
x |
X coordinate in child’s coordinate system |
|
y |
Y coordinate in child’s coordinate system |
|
parent_x |
return location for X coordinate
in parent’s coordinate system, or |
[out][allow-none] |
parent_y |
return location for Y coordinate
in parent’s coordinate system, or |
[out][allow-none] |
typedef struct _GdkSurface GdkSurface;
The GdkSurface struct contains only private fields and should not be accessed directly.
Used to indicate which fields of a GdkGeometry struct should be paid
attention to. Also, the presence/absence of GDK_HINT_POS
,
GDK_HINT_USER_POS
, and GDK_HINT_USER_SIZE
is significant, though they don't
directly refer to GdkGeometry fields. GDK_HINT_USER_POS
will be set
automatically by GtkWindow if you call gtk_window_move()
.
GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE
should be set if the user
specified a size/position using a --geometry command-line argument;
gtk_window_parse_geometry()
automatically sets these flags.
indicates that the program has positioned the surface |
||
min size fields are set |
||
max size fields are set |
||
base size fields are set |
||
aspect ratio fields are set |
||
resize increment fields are set |
||
surface gravity field is set |
||
indicates that the surface’s position was explicitly set by the user |
||
indicates that the surface’s size was explicitly set by the user |
struct GdkGeometry { gint min_width; gint min_height; gint max_width; gint max_height; gint base_width; gint base_height; gint width_inc; gint height_inc; gdouble min_aspect; gdouble max_aspect; GdkGravity win_gravity; };
The GdkGeometry struct gives the window manager information about
a surface’s geometry constraints. Normally you would set these on
the GTK+ level using gtk_window_set_geometry_hints()
. GtkWindow
then sets the hints on the GdkSurface it creates.
gdk_surface_set_geometry_hints() expects the hints to be fully valid already
and simply passes them to the window manager; in contrast,
gtk_window_set_geometry_hints()
performs some interpretation. For example,
GtkWindow will apply the hints to the geometry widget instead of the
toplevel window, if you set a geometry widget. Also, the
min_width
/min_height
/max_width
/max_height
fields may be set to -1, and
GtkWindow will substitute the size request of the surface or geometry widget.
If the minimum size hint is not provided, GtkWindow will use its requisition
as the minimum size. If the minimum size is provided and a geometry widget is
set, GtkWindow will take the minimum size as the minimum size of the
geometry widget rather than the entire surface. The base size is treated
similarly.
The canonical use-case for gtk_window_set_geometry_hints()
is to get a
terminal widget to resize properly. Here, the terminal text area should be
the geometry widget; GtkWindow will then automatically set the base size to
the size of other widgets in the terminal window, such as the menubar and
scrollbar. Then, the width_inc
and height_inc
fields should be set to the
size of one character in the terminal. Finally, the base size should be set
to the size of one character. The net effect is that the minimum size of the
terminal will have a 1x1 character terminal area, and only terminal sizes on
the “character grid” will be allowed.
Here’s an example of how the terminal example would be implemented, assuming a terminal area widget called “terminal” and a toplevel window “toplevel”:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
GdkGeometry hints; hints.base_width = terminal->char_width; hints.base_height = terminal->char_height; hints.min_width = terminal->char_width; hints.min_height = terminal->char_height; hints.width_inc = terminal->char_width; hints.height_inc = terminal->char_height; gtk_window_set_geometry_hints (GTK_WINDOW (toplevel), GTK_WIDGET (terminal), &hints, GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE); |
The other useful fields are the min_aspect
and max_aspect
fields; these
contain a width/height ratio as a floating point number. If a geometry widget
is set, the aspect applies to the geometry widget rather than the entire
window. The most common use of these hints is probably to set min_aspect
and
max_aspect
to the same value, thus forcing the window to keep a constant
aspect ratio.
gint |
minimum width of surface (or -1 to use requisition, with GtkWindow only) |
|
gint |
minimum height of surface (or -1 to use requisition, with GtkWindow only) |
|
gint |
maximum width of surface (or -1 to use requisition, with GtkWindow only) |
|
gint |
maximum height of surface (or -1 to use requisition, with GtkWindow only) |
|
gint |
allowed surface widths are |
|
gint |
allowed surface widths are |
|
gint |
width resize increment |
|
gint |
height resize increment |
|
gdouble |
minimum width/height ratio |
|
gdouble |
maximum width/height ratio |
|
GdkGravity |
surface gravity, see |
Defines the reference point of a surface and the meaning of coordinates
passed to gtk_window_move()
. See gtk_window_move()
and the "implementation
notes" section of the
Extended Window Manager Hints
specification for more details.
the reference point is at the top left corner. |
||
the reference point is in the middle of the top edge. |
||
the reference point is at the top right corner. |
||
the reference point is at the middle of the left edge. |
||
the reference point is at the center of the surface. |
||
the reference point is at the middle of the right edge. |
||
the reference point is at the lower left corner. |
||
the reference point is at the middle of the lower edge. |
||
the reference point is at the lower right corner. |
||
the reference point is at the top left corner of the surface itself, ignoring window manager decorations. |
Positioning hints for aligning a surface relative to a rectangle.
These hints determine how the surface should be positioned in the case that the surface would fall off-screen if placed in its ideal position.
For example, GDK_ANCHOR_FLIP_X
will replace GDK_GRAVITY_NORTH_WEST
with
GDK_GRAVITY_NORTH_EAST
and vice versa if the surface extends beyond the left
or right edges of the monitor.
If GDK_ANCHOR_SLIDE_X
is set, the surface can be shifted horizontally to fit
on-screen. If GDK_ANCHOR_RESIZE_X
is set, the surface can be shrunken
horizontally to fit.
In general, when multiple flags are set, flipping should take precedence over sliding, which should take precedence over resizing.
allow flipping anchors horizontally |
||
allow flipping anchors vertically |
||
allow sliding surface horizontally |
||
allow sliding surface vertically |
||
allow resizing surface horizontally |
||
allow resizing surface vertically |
||
allow flipping anchors on both axes |
||
allow sliding surface on both axes |
||
allow resizing surface on both axes |
Determines a surface edge or corner.
These are hints for the window manager that indicate what type of function the window has. The window manager can use this when determining decoration and behaviour of the window. The hint must be set before mapping the window.
See the Extended Window Manager Hints specification for more details about window types.
Normal toplevel window. |
||
Dialog window. |
||
Window used to implement a menu; GTK uses this hint only for torn-off menus, see GtkTearoffMenuItem. |
||
Window used to implement toolbars. |
||
Window used to display a splash screen during application startup. |
||
Utility windows which are not detached toolbars or dialogs. |
||
Used for creating dock or panel windows. |
||
Used for creating the desktop background window. |
||
A menu that belongs to a menubar. |
||
A menu that does not belong to a menubar, e.g. a context menu. |
||
A tooltip. |
||
A notification - typically a “bubble” that belongs to a status icon. |
||
A popup from a combo box. |
||
A window that is used to implement a DND cursor. |
Specifies the state of a toplevel surface.
On platforms that support information about individual edges, the GDK_SURFACE_STATE_TILED
state will be set whenever any of the individual tiled states is set. On platforms
that lack that support, the tiled state will give an indication of tiledness without
any of the per-edge states being set.
the surface is not shown |
||
the surface is minimized |
||
the surface is maximized |
||
the surface is sticky |
||
the surface is maximized without decorations |
||
the surface is kept above other surfaces |
||
the surface is kept below other surfaces |
||
the surface is presented as focused (with active decorations) |
||
the surface is in a tiled state |
||
whether the top edge is tiled |
||
whether the top edge is resizable |
||
whether the right edge is tiled |
||
whether the right edge is resizable |
||
whether the bottom edge is tiled |
||
whether the bottom edge is resizable |
||
whether the left edge is tiled |
||
whether the left edge is resizable |
Indicates which monitor (in a multi-head setup) a surface should span over when in fullscreen mode.
#define GDK_PARENT_RELATIVE 1L
A special value, indicating that the background for a surface should be inherited from the parent surface.
A set of bit-flags to indicate the state of modifier keys and mouse buttons in various event types. Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.
GDK recognizes which of the Meta, Super or Hyper keys are mapped
to Mod2 - Mod5, and indicates this by setting GDK_SUPER_MASK
,
GDK_HYPER_MASK
or GDK_META_MASK
in the state field of key events.
Note that GDK may add internal values to events which include
reserved values such as GDK_MODIFIER_RESERVED_13_MASK
. Your code
should preserve and ignore them. You can use GDK_MODIFIER_MASK
to
remove all reserved values.
Also note that the GDK X backend interprets button press events for button
4-7 as scroll events, so GDK_BUTTON4_MASK
and GDK_BUTTON5_MASK
will never
be set.
the Shift key. |
||
a Lock key (depending on the modifier mapping of the X server this may either be CapsLock or ShiftLock). |
||
the Control key. |
||
the fourth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier, but normally it is the Alt key). |
||
the fifth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
||
the sixth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
||
the seventh modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
||
the eighth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
||
the first mouse button. |
||
the second mouse button. |
||
the third mouse button. |
||
the fourth mouse button. |
||
the fifth mouse button. |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
A reserved bit flag; do not use in your own code |
||
the Super modifier |
||
the Hyper modifier |
||
the Meta modifier |
||
A reserved bit flag; do not use in your own code |
||
not used in GDK itself. GTK uses it to differentiate between (keyval, modifiers) pairs from key press and release events. |
||
a mask covering all modifier types. |
This enum is used with gdk_keymap_get_modifier_mask()
in order to determine what modifiers the
currently used windowing system backend uses for particular
purposes. For example, on X11/Windows, the Control key is used for
invoking menu shortcuts (accelerators), whereas on Apple computers
it’s the Command key (which correspond to GDK_CONTROL_MASK
and
GDK_MOD2_MASK
, respectively).
the primary modifier used to invoke menu accelerators. |
||
the modifier used to invoke context menus. Note that mouse button 3 always triggers context menus. When this modifier is not 0, it additionally triggers context menus when used with mouse button 1. |
||
the modifier used to extend selections
using |
||
the modifier used to modify selections, which in most cases means toggling the clicked item into or out of the selection. |
||
when any of these modifiers is pressed, the key event cannot produce a symbol directly. This is meant to be used for input methods, and for use cases like typeahead search. |
||
the modifier that switches between keyboard groups (AltGr on X11/Windows and Option/Alt on OS X). |
||
The set of modifier masks accepted as modifiers in accelerators. Needed because Command is mapped to MOD2 on OSX, which is widely used, but on X11 MOD2 is NumLock and using that for a mod key is problematic at best. Ref: https://bugzilla.gnome.org/show_bug.cgi?id=736125. |
These are hints originally defined by the Motif toolkit. The window manager can use them when determining how to decorate the surface. The hint must be set before mapping the surface.
“cursor”
property“cursor” GdkCursor *
The mouse pointer for a GdkSurface. See gdk_surface_set_cursor()
and
gdk_surface_get_cursor()
for details.
Owner: GdkSurface
Flags: Read / Write
“display”
property“display” GdkDisplay *
The GdkDisplay connection of the surface. See gdk_surface_get_display()
for details.
Owner: GdkSurface
Flags: Read / Write / Construct Only
“frame-clock”
property“frame-clock” GdkFrameClock *
Frame Clock.
Owner: GdkSurface
Flags: Read / Write / Construct Only
“state”
property“state” GdkSurfaceState
State.
Owner: GdkSurface
Flags: Read
Default value: GDK_SURFACE_STATE_WITHDRAWN
“event”
signalgboolean user_function (GdkSurface *surface, GdkEvent *event, gpointer user_data)
Emitted when GDK receives an input event for surface
.
surface |
the GdkSurface |
|
event |
an input event |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“moved-to-rect”
signalvoid user_function (GdkSurface *surface, gpointer flipped_rect, gpointer final_rect, gboolean flipped_x, gboolean flipped_y, gpointer user_data)
Emitted when the position of surface
is finalized after being moved to a
destination rectangle.
surface
might be flipped over the destination rectangle in order to keep
it on-screen, in which case flipped_x
and flipped_y
will be set to TRUE
accordingly.
flipped_rect
is the ideal position of surface
after any possible
flipping, but before any possible sliding. final_rect
is flipped_rect
,
but possibly translated in the case that flipping is still ineffective in
keeping surface
on-screen.
surface |
the GdkSurface that moved |
|
flipped_rect |
the position of |
[nullable] |
final_rect |
the final position of |
[nullable] |
flipped_x |
|
|
flipped_y |
|
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Stability Level: Private
“render”
signalgboolean user_function (GdkSurface *surface, CairoRegion *region, gpointer user_data)
Emitted when part of the surface needs to be redrawn.
surface |
the GdkSurface |
|
region |
the region that needs to be redrawn |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“size-changed”
signalvoid user_function (GdkSurface *surface, gint width, gint height, gpointer user_data)
Emitted when the size of surface
is changed.
surface |
the GdkSurface |
|
width |
the new width |
|
height |
the new height |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First