Windows
onscreen display areas in the target window system
A #GdkWindow is a 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 window, the thing a user might think of
as a "window" with a titlebar and so on; a #GtkWindow may contain many #GdkWindow.
For example, each #GtkButton has a #GdkWindow associated with it.
@user_data: used to store the #GtkWidget associated with this window
Describes the kind of window.
@GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire screen, and is created by the window system
@GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow)
@GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkButton)
@GDK_WINDOW_DIALOG: useless/deprecated compatibility type
@GDK_WINDOW_TEMP: override redirect temporary window (used to implement #GtkMenu)
@GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
@GDK_INPUT_OUTPUT windows are the standard kind of window you might expect.
@GDK_INPUT_ONLY windows are invisible; they are used to trap events, but
you can't draw on them.
@GDK_INPUT_OUTPUT: window for graphics and events
@GDK_INPUT_ONLY: window for events only
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.
@GDK_HINT_POS: indicates that the program has positioned the window
@GDK_HINT_MIN_SIZE: min size fields are set
@GDK_HINT_MAX_SIZE: max size fields are set
@GDK_HINT_BASE_SIZE: base size fields are set
@GDK_HINT_ASPECT: aspect ratio fields are set
@GDK_HINT_RESIZE_INC: resize increment fields are set
@GDK_HINT_WIN_GRAVITY: window gravity field is set
@GDK_HINT_USER_POS: indicates that the window's position was explicitly set by the user
@GDK_HINT_USER_SIZE: indicates that the window's size was explicitly set by the user
The #GdkGeometry struct gives the window manager information about
a window'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 #GdkWindow it creates.
gdk_window_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 window 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 window. 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":
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.
@min_width: minimum width of window (or -1 to use requisition, with #GtkWindow only)
@min_height minimum height of window (or -1 to use requisition, with #GtkWindow only)
@min_height:
@max_width: maximum width of window (or -1 to use requisition, with #GtkWindow only)
@max_height: maximum height of window (or -1 to use requisition, with #GtkWindow only)
@base_width: allowed window widths are base_width + width_inc * N where N is any integer (-1 allowed with #GtkWindow)
@base_height: allowed window widths are base_height + height_inc * N where N is any integer (-1 allowed with #GtkWindow)
@width_inc: width resize increment
@height_inc: height resize increment
@min_aspect: minimum width/height ratio
@max_aspect: maximum width/height ratio
@win_gravity: window gravity, see gtk_window_set_gravity()
@GDK_GRAVITY_NORTH_WEST:
@GDK_GRAVITY_NORTH:
@GDK_GRAVITY_NORTH_EAST:
@GDK_GRAVITY_WEST:
@GDK_GRAVITY_CENTER:
@GDK_GRAVITY_EAST:
@GDK_GRAVITY_SOUTH_WEST:
@GDK_GRAVITY_SOUTH:
@GDK_GRAVITY_SOUTH_EAST:
@GDK_GRAVITY_STATIC:
@GDK_WINDOW_EDGE_NORTH_WEST:
@GDK_WINDOW_EDGE_NORTH:
@GDK_WINDOW_EDGE_NORTH_EAST:
@GDK_WINDOW_EDGE_WEST:
@GDK_WINDOW_EDGE_EAST:
@GDK_WINDOW_EDGE_SOUTH_WEST:
@GDK_WINDOW_EDGE_SOUTH:
@GDK_WINDOW_EDGE_SOUTH_EAST:
@GDK_WINDOW_TYPE_HINT_NORMAL:
@GDK_WINDOW_TYPE_HINT_DIALOG:
@GDK_WINDOW_TYPE_HINT_MENU:
@GDK_WINDOW_TYPE_HINT_TOOLBAR:
Attributes to use for a newly-created window.
@title: title of the window (for toplevel windows)
@event_mask: event mask (see gdk_window_set_events())
@x: X coordinate relative to parent window (see gdk_window_move())
@y: Y coordinate relative to parent window (see gdk_window_move())
@width: width of window
@height: height of window
@wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible window that receives events)
@visual: #GdkVisual for window
@colormap: #GdkColormap for window
@window_type: type of window
@cursor: cursor for the window (see gdk_window_set_cursor())
@wmclass_name: don't use (see gtk_window_set_wmclass())
@wmclass_class: don't use (see gtk_window_set_wmclass())
@override_redirect: %TRUE to bypass the window manager
Used to indicate which fields in the #GdkWindowAttr struct should be
honored. For example, if you filled in the "cursor" and "x" fields of
#GdkWindowAttr, pass "@GDK_WA_X | @GDK_WA_CURSOR" to gdk_window_new(). Fields
in #GdkWindowAttr not covered by a bit in this enum are required; for example,
the width/height, wclass, and window_type fields are required, they have no
corresponding flag in #GdkWindowAttributesType.
@GDK_WA_TITLE: Honor the title field
@GDK_WA_X: Honor the X coordinate field
@GDK_WA_Y: Honor the Y coordinate field
@GDK_WA_CURSOR: Honor the cursor field
@GDK_WA_COLORMAP: Honor the colormap field
@GDK_WA_VISUAL: Honor the visual field
@GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields
@GDK_WA_NOREDIR: Honor the override_redirect field
@parent:
@attributes:
@attributes_mask:
@Returns:
@window:
Deprecated equivalent of g_object_ref()
@Returns:
@window:
Deprecated equivalent of g_object_unref()
@window:
@window:
@Returns:
@win_x:
@win_y:
@Returns:
@window:
@window:
@window:
@window:
@Returns:
@window:
@Returns:
@window:
@Returns:
@window:
@window:
@window:
@window:
@window:
@window:
@window:
@window:
@x:
@y:
@window:
@width:
@height:
@window:
@x:
@y:
@width:
@height:
@window:
@dx:
@dy:
@window:
@new_parent:
@x:
@y:
@window:
@window:
@x:
@y:
@width:
@height:
@window:
@x:
@y:
@width:
@height:
Deprecated equivalent to gdk_draw_drawable(), see that function for docs
@drawable:
@gc:
@x:
@y:
@source_drawable:
@source_x:
@source_y:
@width:
@height:
@window:
@window:
@window:
@timestamp:
@window:
@window:
@edge:
@button:
@root_x:
@root_y:
@timestamp:
@window:
@button:
@root_x:
@root_y:
@timestamp:
@geometry:
@flags:
@width:
@height:
@new_width:
@new_height:
@window:
@rectangle:
@window:
@region:
@window:
@window:
@rect:
@invalidate_children:
@window:
@region:
@invalidate_children:
@window:
@Returns:
@window:
@window:
@window:
@update_children:
@setting:
@window:
@real_drawable:
@x_offset:
@y_offset:
@window:
@user_data:
@window:
@override_redirect:
@window:
@function:
@data:
@window:
@function:
@data:
@xevent:
@event:
@data:
@Returns:
@GDK_FILTER_CONTINUE:
@GDK_FILTER_TRANSLATE:
@GDK_FILTER_REMOVE:
@window:
@shape_mask:
@offset_x:
@offset_y:
@window:
@shape_region:
@offset_x:
@offset_y:
@window:
@window:
@window:
@use_static:
@Returns:
@window:
@x:
@y:
@min_width:
@min_height:
@max_width:
@max_height:
@flags:
@window:
@title:
@window:
@color:
@window:
@pixmap:
@parent_relative:
@window:
@cursor:
Deprecated equivalent to gdk_drawable_set_colormap()
@window:
@colormap:
@window:
@data:
@window:
@x:
@y:
@width:
@height:
@depth:
@window:
@geometry:
@flags:
@window:
@pixbufs:
@Returns:
@window:
@modal:
@window:
@hint:
@window:
@x:
@y:
@window:
@x:
@y:
@window:
@rect:
Deprecated equivalent of gdk_drawable_get_size().
Deprecated equivalent of gdk_drawable_get_visual().
@Returns:
@window:
Deprecated equivalent of gdk_drawable_get_colormap().
@Returns: colormap for the window
Deprecated equivalent of gdk_drawable_get_type().
@Returns: type of drawable
@window:
@x:
@y:
@Returns:
@window:
@x:
@y:
@Returns:
@window:
@x:
@y:
@mask:
@Returns:
@GDK_SHIFT_MASK:
@GDK_LOCK_MASK:
@GDK_CONTROL_MASK:
@GDK_MOD1_MASK:
@GDK_MOD2_MASK:
@GDK_MOD3_MASK:
@GDK_MOD4_MASK:
@GDK_MOD5_MASK:
@GDK_BUTTON1_MASK:
@GDK_BUTTON2_MASK:
@GDK_BUTTON3_MASK:
@GDK_BUTTON4_MASK:
@GDK_BUTTON5_MASK:
@GDK_RELEASE_MASK:
@GDK_MODIFIER_MASK:
@window:
@Returns:
@window:
@Returns:
@window:
@Returns:
@window:
@Returns:
@window:
@Returns:
@window:
@event_mask:
@window:
@icon_window:
@pixmap:
@mask:
@window:
@name:
@window:
@leader:
@window:
@role:
@window:
@leader:
@window:
@decorations:
@window: The window to get the decorations from
@decorations: The window decorations will be written here
@Returns: TRUE if the window has decorations set, FALSE otherwise.
@GDK_DECOR_ALL:
@GDK_DECOR_BORDER:
@GDK_DECOR_RESIZEH:
@GDK_DECOR_TITLE:
@GDK_DECOR_MENU:
@GDK_DECOR_MINIMIZE:
@GDK_DECOR_MAXIMIZE:
@window:
@functions:
@GDK_FUNC_ALL:
@GDK_FUNC_RESIZE:
@GDK_FUNC_MOVE:
@GDK_FUNC_MINIMIZE:
@GDK_FUNC_MAXIMIZE:
@GDK_FUNC_CLOSE:
@Returns:
@Returns:
@get_pointer:
@window_at_pointer:
@new_hooks:
@Returns: