gtk/docs/reference/gdk/tmpl/windows.sgml
Havoc Pennington 230b35251a docs
2001-10-02  Havoc Pennington  <hp@redhat.com>

	* gdk/x11/gdkwindow-x11.c: docs

	* tests/testtextbuffer.c (logical_motion_tests): add sentence
	boundary tests

2001-10-02  Havoc Pennington  <hp@redhat.com>

	* gtk/tree_widget.sgml: s/empahsis/emphasis/

	* gtk/tmpl/gtkobject.sgml: update docs
2001-10-02 19:40:54 +00:00

1172 lines
17 KiB
Plaintext

<!-- ##### SECTION Title ##### -->
Windows
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### STRUCT GdkWindowAttr ##### -->
<para>
</para>
@title:
@event_mask:
@x:
@y:
@width:
@height:
@wclass:
@visual:
@colormap:
@window_type:
@cursor:
@wmclass_name:
@wmclass_class:
@override_redirect:
<!-- ##### STRUCT GdkWindow ##### -->
<para>
</para>
@user_data:
<!-- ##### ENUM GdkWindowType ##### -->
<para>
</para>
@GDK_WINDOW_ROOT:
@GDK_WINDOW_TOPLEVEL:
@GDK_WINDOW_CHILD:
@GDK_WINDOW_DIALOG:
@GDK_WINDOW_TEMP:
@GDK_WINDOW_FOREIGN:
<!-- ##### ENUM GdkWindowClass ##### -->
<para>
</para>
@GDK_INPUT_OUTPUT:
@GDK_INPUT_ONLY:
<!-- ##### ENUM GdkWindowAttributesType ##### -->
<para>
</para>
@GDK_WA_TITLE:
@GDK_WA_X:
@GDK_WA_Y:
@GDK_WA_CURSOR:
@GDK_WA_COLORMAP:
@GDK_WA_VISUAL:
@GDK_WA_WMCLASS:
@GDK_WA_NOREDIR:
<!-- ##### ENUM GdkWindowHints ##### -->
<para>
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.
</para>
@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
<!-- ##### STRUCT GdkGeometry ##### -->
<para>
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.
</para>
<para>
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.
</para>
<para>
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.
</para>
<para>
Here's an example of how the terminal example would be implemented, assuming
a terminal area widget called "terminal" and a toplevel window "toplevel":
<programlisting>
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);
</programlisting>
</para>
<para>
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.
</para>
@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)
@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()
<!-- ##### ENUM GdkGravity ##### -->
<para>
</para>
@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:
<!-- ##### ENUM GdkWindowEdge ##### -->
<para>
</para>
@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:
<!-- ##### ENUM GdkWindowTypeHint ##### -->
<para>
</para>
@GDK_WINDOW_TYPE_HINT_NORMAL:
@GDK_WINDOW_TYPE_HINT_DIALOG:
@GDK_WINDOW_TYPE_HINT_MENU:
@GDK_WINDOW_TYPE_HINT_TOOLBAR:
<!-- ##### FUNCTION gdk_window_new ##### -->
<para>
</para>
@parent:
@attributes:
@attributes_mask:
@Returns:
<!-- ##### FUNCTION gdk_window_destroy ##### -->
<para>
</para>
@window:
<!-- ##### MACRO gdk_window_ref ##### -->
<para>
</para>
@Returns:
<!-- # Unused Parameters # -->
@window:
<!-- ##### MACRO gdk_window_unref ##### -->
<para>
</para>
<!-- # Unused Parameters # -->
@window:
<!-- ##### FUNCTION gdk_window_get_window_type ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_at_pointer ##### -->
<para>
</para>
@win_x:
@win_y:
@Returns:
<!-- ##### FUNCTION gdk_window_show ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_hide ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_is_visible ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_is_viewable ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_get_state ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_withdraw ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_iconify ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_deiconify ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_stick ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_unstick ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_maximize ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_unmaximize ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_move ##### -->
<para>
</para>
@window:
@x:
@y:
<!-- ##### FUNCTION gdk_window_resize ##### -->
<para>
</para>
@window:
@width:
@height:
<!-- ##### FUNCTION gdk_window_move_resize ##### -->
<para>
</para>
@window:
@x:
@y:
@width:
@height:
<!-- ##### FUNCTION gdk_window_scroll ##### -->
<para>
</para>
@window:
@dx:
@dy:
<!-- ##### FUNCTION gdk_window_reparent ##### -->
<para>
</para>
@window:
@new_parent:
@x:
@y:
<!-- ##### FUNCTION gdk_window_clear ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_clear_area ##### -->
<para>
</para>
@window:
@x:
@y:
@width:
@height:
<!-- ##### FUNCTION gdk_window_clear_area_e ##### -->
<para>
</para>
@window:
@x:
@y:
@width:
@height:
<!-- ##### MACRO gdk_window_copy_area ##### -->
<para>
</para>
@drawable:
@gc:
@x:
@y:
@source_drawable:
@source_x:
@source_y:
@width:
@height:
<!-- # Unused Parameters # -->
@window:
@source_window:
<!-- ##### FUNCTION gdk_window_raise ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_lower ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_focus ##### -->
<para>
</para>
@window:
@timestamp:
<!-- ##### FUNCTION gdk_window_register_dnd ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_begin_resize_drag ##### -->
<para>
</para>
@window:
@edge:
@button:
@root_x:
@root_y:
@timestamp:
<!-- ##### FUNCTION gdk_window_begin_move_drag ##### -->
<para>
</para>
@window:
@button:
@root_x:
@root_y:
@timestamp:
<!-- ##### FUNCTION gdk_window_constrain_size ##### -->
<para>
</para>
@geometry:
@flags:
@width:
@height:
@new_width:
@new_height:
<!-- ##### FUNCTION gdk_window_begin_paint_rect ##### -->
<para>
</para>
@window:
@rectangle:
<!-- ##### FUNCTION gdk_window_begin_paint_region ##### -->
<para>
</para>
@window:
@region:
<!-- ##### FUNCTION gdk_window_end_paint ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_invalidate_rect ##### -->
<para>
</para>
@window:
@rect:
@invalidate_children:
<!-- ##### FUNCTION gdk_window_invalidate_region ##### -->
<para>
</para>
@window:
@region:
@invalidate_children:
<!-- ##### FUNCTION gdk_window_get_update_area ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_freeze_updates ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_thaw_updates ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_process_all_updates ##### -->
<para>
</para>
<!-- ##### FUNCTION gdk_window_process_updates ##### -->
<para>
</para>
@window:
@update_children:
<!-- ##### FUNCTION gdk_window_set_debug_updates ##### -->
<para>
</para>
@setting:
<!-- ##### FUNCTION gdk_window_set_user_data ##### -->
<para>
</para>
@window:
@user_data:
<!-- ##### FUNCTION gdk_window_set_override_redirect ##### -->
<para>
</para>
@window:
@override_redirect:
<!-- ##### FUNCTION gdk_window_add_filter ##### -->
<para>
</para>
@window:
@function:
@data:
<!-- ##### FUNCTION gdk_window_remove_filter ##### -->
<para>
</para>
@window:
@function:
@data:
<!-- ##### USER_FUNCTION GdkFilterFunc ##### -->
<para>
</para>
@xevent:
@event:
@data:
@Returns:
<!-- ##### ENUM GdkFilterReturn ##### -->
<para>
</para>
@GDK_FILTER_CONTINUE:
@GDK_FILTER_TRANSLATE:
@GDK_FILTER_REMOVE:
<!-- ##### TYPEDEF GdkXEvent ##### -->
<para>
</para>
<!-- ##### FUNCTION gdk_window_shape_combine_mask ##### -->
<para>
</para>
@window:
@shape_mask:
@offset_x:
@offset_y:
<!-- ##### FUNCTION gdk_window_shape_combine_region ##### -->
<para>
</para>
@window:
@shape_region:
@offset_x:
@offset_y:
<!-- ##### FUNCTION gdk_window_set_child_shapes ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_merge_child_shapes ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_set_static_gravities ##### -->
<para>
</para>
@window:
@use_static:
@Returns:
<!-- ##### FUNCTION gdk_window_set_hints ##### -->
<para>
</para>
@window:
@x:
@y:
@min_width:
@min_height:
@max_width:
@max_height:
@flags:
<!-- ##### FUNCTION gdk_window_set_title ##### -->
<para>
</para>
@window:
@title:
<!-- ##### FUNCTION gdk_window_set_background ##### -->
<para>
</para>
@window:
@color:
<!-- ##### FUNCTION gdk_window_set_back_pixmap ##### -->
<para>
</para>
@window:
@pixmap:
@parent_relative:
<!-- ##### MACRO GDK_PARENT_RELATIVE ##### -->
<para>
</para>
<!-- ##### FUNCTION gdk_window_set_cursor ##### -->
<para>
</para>
@window:
@cursor:
<!-- ##### MACRO gdk_window_set_colormap ##### -->
<para>
</para>
<!-- # Unused Parameters # -->
@window:
@colormap:
<!-- ##### FUNCTION gdk_window_get_user_data ##### -->
<para>
</para>
@window:
@data:
<!-- ##### FUNCTION gdk_window_get_geometry ##### -->
<para>
</para>
@window:
@x:
@y:
@width:
@height:
@depth:
<!-- ##### FUNCTION gdk_window_set_geometry_hints ##### -->
<para>
</para>
@window:
@geometry:
@flags:
<!-- ##### FUNCTION gdk_window_set_icon_list ##### -->
<para>
</para>
@window:
@pixbufs:
<!-- # Unused Parameters # -->
@Returns:
<!-- ##### FUNCTION gdk_window_set_modal_hint ##### -->
<para>
</para>
@window:
@modal:
<!-- ##### FUNCTION gdk_window_set_type_hint ##### -->
<para>
</para>
@window:
@hint:
<!-- ##### FUNCTION gdk_window_get_position ##### -->
<para>
</para>
@window:
@x:
@y:
<!-- ##### FUNCTION gdk_window_get_root_origin ##### -->
<para>
</para>
@window:
@x:
@y:
<!-- ##### FUNCTION gdk_window_get_frame_extents ##### -->
<para>
</para>
@window:
@rect:
<!-- ##### MACRO gdk_window_get_size ##### -->
<para>
</para>
<!-- # Unused Parameters # -->
@window:
@width:
@height:
<!-- ##### MACRO gdk_window_get_visual ##### -->
<para>
</para>
@Returns:
<!-- # Unused Parameters # -->
@window:
<!-- ##### MACRO gdk_window_get_colormap ##### -->
<para>
</para>
@Returns:
<!-- # Unused Parameters # -->
@window:
<!-- ##### MACRO gdk_window_get_type ##### -->
<para>
</para>
@Returns:
<!-- # Unused Parameters # -->
@window:
<!-- ##### FUNCTION gdk_window_get_origin ##### -->
<para>
</para>
@window:
@x:
@y:
@Returns:
<!-- ##### FUNCTION gdk_window_get_deskrelative_origin ##### -->
<para>
</para>
@window:
@x:
@y:
@Returns:
<!-- ##### FUNCTION gdk_window_get_pointer ##### -->
<para>
</para>
@window:
@x:
@y:
@mask:
@Returns:
<!-- ##### ENUM GdkModifierType ##### -->
<para>
</para>
@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:
<!-- ##### FUNCTION gdk_window_get_parent ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_get_toplevel ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_get_children ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_peek_children ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_get_events ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_set_events ##### -->
<para>
</para>
@window:
@event_mask:
<!-- ##### FUNCTION gdk_window_set_icon ##### -->
<para>
</para>
@window:
@icon_window:
@pixmap:
@mask:
<!-- ##### FUNCTION gdk_window_set_icon_name ##### -->
<para>
</para>
@window:
@name:
<!-- ##### FUNCTION gdk_window_set_transient_for ##### -->
<para>
</para>
@window:
@leader:
<!-- ##### FUNCTION gdk_window_set_role ##### -->
<para>
</para>
@window:
@role:
<!-- ##### FUNCTION gdk_window_set_group ##### -->
<para>
</para>
@window:
@leader:
<!-- ##### FUNCTION gdk_window_set_decorations ##### -->
<para>
</para>
@window:
@decorations:
<!-- ##### FUNCTION gdk_window_get_decorations ##### -->
<para>
</para>
@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.
<!-- ##### ENUM GdkWMDecoration ##### -->
<para>
</para>
@GDK_DECOR_ALL:
@GDK_DECOR_BORDER:
@GDK_DECOR_RESIZEH:
@GDK_DECOR_TITLE:
@GDK_DECOR_MENU:
@GDK_DECOR_MINIMIZE:
@GDK_DECOR_MAXIMIZE:
<!-- ##### FUNCTION gdk_window_set_functions ##### -->
<para>
</para>
@window:
@functions:
<!-- ##### ENUM GdkWMFunction ##### -->
<para>
</para>
@GDK_FUNC_ALL:
@GDK_FUNC_RESIZE:
@GDK_FUNC_MOVE:
@GDK_FUNC_MINIMIZE:
@GDK_FUNC_MAXIMIZE:
@GDK_FUNC_CLOSE:
<!-- ##### FUNCTION gdk_window_get_toplevels ##### -->
<para>
</para>
@Returns: