/src/wrappers/gdk/library/gdk_window.e
Specman e | 1189 lines | 62 code | 321 blank | 806 comment | 4 complexity | 323838a0115d392c773e7f831d955f9d MD5 | raw file
Large files files are truncated, but you can click here to view the full file
1indexing 2 description: "Windows -- Onscreen display areas in the target window system." 3 copyright: "[ 4 Copyright (C) 2006 eiffel-libraries team, GTK+ team 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public License 8 as published by the Free Software Foundation; either version 2.1 of 9 the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 02110-1301 USA 20 ]" 21class GDK_WINDOW 22 -- A GdkWindow is a rectangular region on the screen. It's a low-level 23 -- object, used to implement high-level objects such as GtkWidget and 24 -- GtkWindow on the GTK+ level. A GtkWindow is a toplevel window, the thing 25 -- a user might think of as a "window" with a titlebar and so on; a 26 -- GtkWindow may contain many GdkWindow. For example, each GtkButton has a 27 -- GdkWindow associated with it. 28 29inherit GDK_DRAWABLE 30 31insert 32 GDK_WINDOW_EXTERNALS 33 GDK_MODIFIER_TYPE 34 35creation {WRAPPER, WRAPPER_HANDLER} from_external_pointer, secondary_wrapper_from 36 37feature -- size 38 struct_size: INTEGER is 39 external "C inline use <gdk/gdk.h>" 40 alias "sizeof(GdkWindow)" 41 end 42 43feature 44 45 set_cursor (a_cursor: GDK_CURSOR) is 46 require 47 a_cursor /= Void 48 do 49 gdk_window_set_cursor (handle, a_cursor.handle) 50 end 51 52 unset_cursor is 53 do 54 gdk_window_set_cursor (handle, default_pointer) 55 end 56 57 get_pointer: TUPLE [GDK_WINDOW, INTEGER, INTEGER, INTEGER] is 58 -- GdkWindow* gdk_window_get_pointer (GdkWindow *window, 59 -- gint *x, 60 -- gint *y, 61 -- GdkModifierType *mask); 62 local 63 res: POINTER 64 window: GDK_WINDOW 65 x, y, mask: INTEGER 66 factory: G_OBJECT_EXPANDED_FACTORY [GDK_WINDOW] 67 do 68 res := gdk_window_get_pointer (handle, $x, $y, $mask) 69 if res.is_not_null then 70 window := factory.existant_wrapper (res) 71 if window=Void then 72 create window.from_external_pointer (res) 73 end 74 end 75 mask := mask & gdk_modifier_mask 76 Result := [window, x, y, mask] 77 ensure 78 Result /= Void implies is_valid_gdk_modifier_type (Result.fourth) 79 end 80 81 children: G_LIST [GDK_WINDOW] is 82 do 83 create {G_OBJECT_LIST[GDK_WINDOW]} Result.from_external_pointer(gdk_window_get_children(handle)) 84 end 85 86 -- GList* gdk_window_peek_children (GdkWindow *window); 87 -- GdkEventMask gdk_window_get_events (GdkWindow *window); 88 -- void gdk_window_set_events (GdkWindow *window, 89 -- GdkEventMask event_mask); 90 -- void gdk_window_set_icon (GdkWindow *window, 91 -- GdkWindow *icon_window, 92 -- GdkPixmap *pixmap, 93 -- GdkBitmap *mask); 94 -- void gdk_window_set_icon_name (GdkWindow *window, 95 -- const gchar *name); 96 -- void gdk_window_set_transient_for (GdkWindow *window, 97 -- GdkWindow *parent); 98 -- void gdk_window_set_role (GdkWindow *window, 99 -- const gchar *role); 100 -- void gdk_window_set_group (GdkWindow *window, 101 -- GdkWindow *leader); 102 -- GdkWindow* gdk_window_get_group (GdkWindow *window); 103 -- void gdk_window_set_decorations (GdkWindow *window, 104 -- GdkWMDecoration decorations); 105 -- gboolean gdk_window_get_decorations (GdkWindow *window, 106 -- GdkWMDecoration *decorations); 107 -- enum GdkWMDecoration; 108 -- void gdk_window_set_functions (GdkWindow *window, 109 -- GdkWMFunction functions); 110 -- enum GdkWMFunction; 111 -- GList* gdk_window_get_toplevels (void); 112 -- GdkWindow* gdk_get_default_root_window (void); 113 114 -- GdkPointerHooks; 115 -- GdkPointerHooks* gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); 116 117 -- An opaque structure representing an onscreen drawable. Pointers to structures of type GdkPixmap, GdkBitmap, and GdkWindow, can often be used interchangeably. The type GdkDrawable refers generically to any of these types. 118 -- enum GdkWindowType 119 120 -- typedef enum 121 -- { 122 -- GDK_WINDOW_ROOT, 123 -- GDK_WINDOW_TOPLEVEL, 124 -- GDK_WINDOW_CHILD, 125 -- GDK_WINDOW_DIALOG, 126 -- GDK_WINDOW_TEMP, 127 -- GDK_WINDOW_FOREIGN 128 -- } GdkWindowType; 129 130 -- Describes the kind of window. 131 -- GDK_WINDOW_ROOT root window; this window has no parent, covers the entire screen, and is created by the window system 132 -- GDK_WINDOW_TOPLEVEL toplevel window (used to implement GtkWindow) 133 -- GDK_WINDOW_CHILD child window (used to implement e.g. GtkButton) 134 -- GDK_WINDOW_DIALOG useless/deprecated compatibility type 135 -- GDK_WINDOW_TEMP override redirect temporary window (used to implement GtkMenu) 136 -- GDK_WINDOW_FOREIGN foreign window (see gdk_window_foreign_new()) 137 -- enum GdkWindowClass 138 139 -- typedef enum 140 -- { 141 -- GDK_INPUT_OUTPUT, 142 -- GDK_INPUT_ONLY 143 -- } GdkWindowClass; 144 145 -- 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. 146 -- GDK_INPUT_OUTPUT window for graphics and events 147 -- GDK_INPUT_ONLY window for events only 148 -- enum GdkWindowHints 149 150 -- typedef enum 151 -- { 152 -- GDK_HINT_POS = 1 < < 0, 153 -- GDK_HINT_MIN_SIZE = 1 < < 1, 154 -- GDK_HINT_MAX_SIZE = 1 < < 2, 155 -- GDK_HINT_BASE_SIZE = 1 < < 3, 156 -- GDK_HINT_ASPECT = 1 < < 4, 157 -- GDK_HINT_RESIZE_INC = 1 < < 5, 158 -- GDK_HINT_WIN_GRAVITY = 1 < < 6, 159 -- GDK_HINT_USER_POS = 1 < < 7, 160 -- GDK_HINT_USER_SIZE = 1 < < 8 161 -- } GdkWindowHints; 162 163 -- 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. 164 -- GDK_HINT_POS indicates that the program has positioned the window 165 -- GDK_HINT_MIN_SIZE min size fields are set 166 -- GDK_HINT_MAX_SIZE max size fields are set 167 -- GDK_HINT_BASE_SIZE base size fields are set 168 -- GDK_HINT_ASPECT aspect ratio fields are set 169 -- GDK_HINT_RESIZE_INC resize increment fields are set 170 -- GDK_HINT_WIN_GRAVITY window gravity field is set 171 -- GDK_HINT_USER_POS indicates that the window's position was explicitly set by the user 172 -- GDK_HINT_USER_SIZE indicates that the window's size was explicitly set by the user 173 -- GdkGeometry 174 175 -- typedef struct { 176 -- gint min_width; 177 -- gint min_height; 178 -- gint max_width; 179 -- gint max_height; 180 -- gint base_width; 181 -- gint base_height; 182 -- gint width_inc; 183 -- gint height_inc; 184 -- gdouble min_aspect; 185 -- gdouble max_aspect; 186 -- GdkGravity win_gravity; 187 -- } GdkGeometry; 188 189 -- 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. 190 191 -- 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. 192 193 -- 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. 194 195 -- Here's an example of how the terminal example would be implemented, assuming a terminal area widget called "terminal" and a toplevel window "toplevel": 196 197 -- GdkGeometry hints; 198 199 -- hints.base_width = terminal->char_width; 200 -- hints.base_height = terminal->char_height; 201 -- hints.min_width = terminal->char_width; 202 -- hints.min_height = terminal->char_height; 203 -- hints.width_inc = terminal->char_width; 204 -- hints.height_inc = terminal->char_height; 205 206 -- gtk_window_set_geometry_hints (GTK_WINDOW (toplevel), 207 -- GTK_WIDGET (terminal), 208 -- &hints, 209 -- GDK_HINT_RESIZE_INC | 210 -- GDK_HINT_MIN_SIZE | 211 -- GDK_HINT_BASE_SIZE); 212 213 -- 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. 214 -- gint 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) 215 -- gint min_height; 216 -- gint max_width; maximum width of window (or -1 to use requisition, with GtkWindow only) 217 -- gint max_height; maximum height of window (or -1 to use requisition, with GtkWindow only) 218 -- gint base_width; allowed window widths are base_width + width_inc * N where N is any integer (-1 allowed with GtkWindow) 219 -- gint base_height; allowed window widths are base_height + height_inc * N where N is any integer (-1 allowed with GtkWindow) 220 -- gint width_inc; width resize increment 221 -- gint height_inc; height resize increment 222 -- gdouble min_aspect; minimum width/height ratio 223 -- gdouble max_aspect; maximum width/height ratio 224 -- GdkGravity win_gravity; window gravity, see gtk_window_set_gravity() 225 -- enum GdkGravity 226 227 -- typedef enum 228 -- { 229 -- GDK_GRAVITY_NORTH_WEST = 1, 230 -- GDK_GRAVITY_NORTH, 231 -- GDK_GRAVITY_NORTH_EAST, 232 -- GDK_GRAVITY_WEST, 233 -- GDK_GRAVITY_CENTER, 234 -- GDK_GRAVITY_EAST, 235 -- GDK_GRAVITY_SOUTH_WEST, 236 -- GDK_GRAVITY_SOUTH, 237 -- GDK_GRAVITY_SOUTH_EAST, 238 -- GDK_GRAVITY_STATIC 239 -- } GdkGravity; 240 241 -- Defines the reference point of a window 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. 242 -- GDK_GRAVITY_NORTH_WEST the reference point is at the top left corner. 243 -- GDK_GRAVITY_NORTH the reference point is in the middle of the top edge. 244 -- GDK_GRAVITY_NORTH_EAST the reference point is at the top right corner. 245 -- GDK_GRAVITY_WEST the reference point is at the middle of the left edge. 246 -- GDK_GRAVITY_CENTER the reference point is at the center of the window. 247 -- GDK_GRAVITY_EAST the reference point is at the middle of the right edge. 248 -- GDK_GRAVITY_SOUTH_WEST the reference point is at the lower left corner. 249 -- GDK_GRAVITY_SOUTH the reference point is at the middle of the lower edge. 250 -- GDK_GRAVITY_SOUTH_EAST the reference point is at the lower right corner. 251 -- GDK_GRAVITY_STATIC the reference point is at the top left corner of the window itself, ignoring window manager decorations. 252 -- enum GdkWindowEdge 253 254 -- typedef enum 255 -- { 256 -- GDK_WINDOW_EDGE_NORTH_WEST, 257 -- GDK_WINDOW_EDGE_NORTH, 258 -- GDK_WINDOW_EDGE_NORTH_EAST, 259 -- GDK_WINDOW_EDGE_WEST, 260 -- GDK_WINDOW_EDGE_EAST, 261 -- GDK_WINDOW_EDGE_SOUTH_WEST, 262 -- GDK_WINDOW_EDGE_SOUTH, 263 -- GDK_WINDOW_EDGE_SOUTH_EAST 264 -- } GdkWindowEdge; 265 266 -- Determines a window edge or corner. 267 -- GDK_WINDOW_EDGE_NORTH_WEST the top left corner. 268 -- GDK_WINDOW_EDGE_NORTH the top edge. 269 -- GDK_WINDOW_EDGE_NORTH_EAST the top right corner. 270 -- GDK_WINDOW_EDGE_WEST the left edge. 271 -- GDK_WINDOW_EDGE_EAST the right edge. 272 -- GDK_WINDOW_EDGE_SOUTH_WEST the lower left corner. 273 -- GDK_WINDOW_EDGE_SOUTH the lower edge. 274 -- GDK_WINDOW_EDGE_SOUTH_EAST the lower right corner. 275 -- enum GdkWindowTypeHint 276 277 -- typedef enum 278 -- { 279 -- GDK_WINDOW_TYPE_HINT_NORMAL, 280 -- GDK_WINDOW_TYPE_HINT_DIALOG, 281 -- GDK_WINDOW_TYPE_HINT_MENU, 282 -- GDK_WINDOW_TYPE_HINT_TOOLBAR, 283 -- GDK_WINDOW_TYPE_HINT_SPLASHSCREEN, 284 -- GDK_WINDOW_TYPE_HINT_UTILITY, 285 -- GDK_WINDOW_TYPE_HINT_DOCK, 286 -- GDK_WINDOW_TYPE_HINT_DESKTOP 287 -- } GdkWindowTypeHint; 288 289 -- 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. 290 291 -- See the Extended Window Manager Hints specification for more details about window types. 292 -- GDK_WINDOW_TYPE_HINT_NORMAL Normal toplevel window. 293 -- GDK_WINDOW_TYPE_HINT_DIALOG Dialog window. 294 -- GDK_WINDOW_TYPE_HINT_MENU Window used to implement a menu. 295 -- GDK_WINDOW_TYPE_HINT_TOOLBAR Window used to implement toolbars. 296 -- GDK_WINDOW_TYPE_HINT_SPLASHSCREEN Window used to display a splash screen during application startup. 297 -- GDK_WINDOW_TYPE_HINT_UTILITY Utility windows which are not detached toolbars or dialogs. 298 -- GDK_WINDOW_TYPE_HINT_DOCK Used for creating dock or panel windows. 299 -- GDK_WINDOW_TYPE_HINT_DESKTOP Used for creating the desktop background window. 300 -- GdkWindowAttr 301 302 -- typedef struct { 303 -- gchar *title; 304 -- gint event_mask; 305 -- gint x, y; 306 -- gint width; 307 -- gint height; 308 -- GdkWindowClass wclass; 309 -- GdkVisual *visual; 310 -- GdkColormap *colormap; 311 -- GdkWindowType window_type; 312 -- GdkCursor *cursor; 313 -- gchar *wmclass_name; 314 -- gchar *wmclass_class; 315 -- gboolean override_redirect; 316 -- } GdkWindowAttr; 317 318 -- Attributes to use for a newly-created window. 319 -- gchar *title; title of the window (for toplevel windows) 320 -- gint event_mask; event mask (see gdk_window_set_events()) 321 -- gint x; X coordinate relative to parent window (see gdk_window_move()) 322 -- gint y; Y coordinate relative to parent window (see gdk_window_move()) 323 -- gint width; width of window 324 -- gint height; height of window 325 -- GdkWindowClass wclass; GDK_INPUT_OUTPUT (normal window) or GDK_INPUT_ONLY (invisible window that receives events) 326 -- GdkVisual *visual; GdkVisual for window 327 -- GdkColormap *colormap; GdkColormap for window 328 -- GdkWindowType window_type; type of window 329 -- GdkCursor *cursor; cursor for the window (see gdk_window_set_cursor()) 330 -- gchar *wmclass_name; don't use (see gtk_window_set_wmclass()) 331 -- gchar *wmclass_class; don't use (see gtk_window_set_wmclass()) 332 -- gboolean override_redirect; TRUE to bypass the window manager 333 -- enum GdkWindowAttributesType 334 335 -- typedef enum 336 -- { 337 -- GDK_WA_TITLE = 1 < < 1, 338 -- GDK_WA_X = 1 < < 2, 339 -- GDK_WA_Y = 1 < < 3, 340 -- GDK_WA_CURSOR = 1 < < 4, 341 -- GDK_WA_COLORMAP = 1 < < 5, 342 -- GDK_WA_VISUAL = 1 < < 6, 343 -- GDK_WA_WMCLASS = 1 < < 7, 344 -- GDK_WA_NOREDIR = 1 < < 8 345 -- } GdkWindowAttributesType; 346 347 -- 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. 348 -- GDK_WA_TITLE Honor the title field 349 -- GDK_WA_X Honor the X coordinate field 350 -- GDK_WA_Y Honor the Y coordinate field 351 -- GDK_WA_CURSOR Honor the cursor field 352 -- GDK_WA_COLORMAP Honor the colormap field 353 -- GDK_WA_VISUAL Honor the visual field 354 -- GDK_WA_WMCLASS Honor the wmclass_class and wmclass_name fields 355 -- GDK_WA_NOREDIR Honor the override_redirect field 356 -- gdk_window_new () 357 358 -- GdkWindow* gdk_window_new (GdkWindow *parent, 359 -- GdkWindowAttr *attributes, 360 -- gint attributes_mask); 361 362 -- Creates a new GdkWindow using the attributes from attributes. See GdkWindowAttr and GdkWindowAttributesType for more details. Note: to use this on displays other than the default display, parent must be specified. 363 364 -- parent : a GdkWindow, or NULL to create the window as a child of the default root window for the default display. 365 -- attributes : attributes of the new window 366 -- attributes_mask : mask indicating which fields in attributes are valid 367 -- Returns : the new GdkWindow 368 -- gdk_window_destroy () 369 370 -- void gdk_window_destroy (GdkWindow *window); 371 372 -- Destroys the window system resources associated with window and decrements window's reference count. The window system resources for all children of window are also destroyed, but the children's reference counts are not decremented. 373 374 -- Note that a window will not be destroyed automatically when its reference count reaches zero. You must call this function yourself before that happens. 375 376 -- window : a GdkWindow 377 -- gdk_window_ref 378 379 -- #define gdk_window_ref gdk_drawable_ref 380 381 -- Warning 382 383 -- gdk_window_ref is deprecated and should not be used in newly-written code. 384 385 -- Deprecated equivalent of g_object_ref() 386 -- Returns : the window 387 -- gdk_window_unref 388 389 -- #define gdk_window_unref gdk_drawable_unref 390 391 -- Warning 392 393 -- gdk_window_unref is deprecated and should not be used in newly-written code. 394 395 -- Deprecated equivalent of g_object_unref() 396 -- gdk_window_get_window_type () 397 398 -- GdkWindowType gdk_window_get_window_type (GdkWindow *window); 399 400 -- Gets the type of the window. See GdkWindowType. 401 402 -- window : a GdkWindow 403 -- Returns : type of window 404 -- gdk_window_at_pointer () 405 406 -- GdkWindow* gdk_window_at_pointer (gint *win_x, 407 -- gint *win_y); 408 409 -- Obtains the window underneath the mouse pointer, returning the location of that window in win_x, win_y. Returns NULL if the window under the mouse pointer is not known to GDK (if the window belongs to another application and a GdkWindow hasn't been created for it with gdk_window_foreign_new()) 410 411 -- NOTE: For multihead-aware widgets or applications use gdk_display_get_window_at_pointer() instead. 412 413 -- win_x : return location for origin of the window under the pointer 414 -- win_y : return location for origin of the window under the pointer 415 -- Returns : window under the mouse pointer 416 -- gdk_window_show () 417 418 -- void gdk_window_show (GdkWindow *window); 419 420 -- Like gdk_window_show_unraised(), but also raises the window to the top of the window stack (moves the window to the front of the Z-order). 421 422 -- This function maps a window so it's visible onscreen. Its opposite is gdk_window_hide(). 423 424 -- When implementing a GtkWidget, you should call this function on the widget's GdkWindow as part of the "map" method. 425 426 -- window : a GdkWindow 427 -- gdk_window_show_unraised () 428 429 -- void gdk_window_show_unraised (GdkWindow *window); 430 431 -- Shows a GdkWindow onscreen, but does not modify its stacking order. In contrast, gdk_window_show() will raise the window to the top of the window stack. 432 433 -- 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 window). 434 435 -- window : a GdkWindow 436 -- gdk_window_hide () 437 438 -- void gdk_window_hide (GdkWindow *window); 439 440 -- For toplevel windows, withdraws them, so they will no longer be known to the window manager; for all windows, unmaps them, so they won't be displayed. Normally done automatically as part of gtk_widget_hide(). 441 442 -- window : a GdkWindow 443 -- gdk_window_is_visible () 444 445 -- gboolean gdk_window_is_visible (GdkWindow *window); 446 447 -- Checks whether the window has been mapped (with gdk_window_show() or gdk_window_show_unraised()). 448 449 -- window : a GdkWindow 450 -- Returns : TRUE if the window is mapped 451 -- gdk_window_is_viewable () 452 453 -- gboolean gdk_window_is_viewable (GdkWindow *window); 454 455 -- Check if the window and all ancestors of the window are mapped. (This is not necessarily "viewable" in the X sense, since we only check as far as we have GDK window parents, not to the root window.) 456 457 -- window : a GdkWindow 458 -- Returns : TRUE if the window is viewable 459 -- gdk_window_get_state () 460 461 -- GdkWindowState gdk_window_get_state (GdkWindow *window); 462 463 -- Gets the bitwise OR of the currently active window state flags, from the GdkWindowState enumeration. 464 465 -- window : a GdkWindow 466 -- Returns : window state bitfield 467 -- gdk_window_withdraw () 468 469 -- void gdk_window_withdraw (GdkWindow *window); 470 471 -- Withdraws a window (unmaps it and asks the window manager to forget about it). This function is not really useful as gdk_window_hide() automatically withdraws toplevel windows before hiding them. 472 473 -- window : a toplevel GdkWindow 474 -- gdk_window_iconify () 475 476 -- void gdk_window_iconify (GdkWindow *window); 477 478 -- Asks to iconify (minimize) window. 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. 479 480 -- This function only makes sense when window is a toplevel window. 481 482 -- window : a toplevel GdkWindow 483 -- gdk_window_deiconify () 484 485 -- void gdk_window_deiconify (GdkWindow *window); 486 487 -- Attempt to deiconify (unminimize) window. On X11 the window manager may choose to ignore the request to deiconify. When using GTK+, use gtk_window_deiconify() instead of the GdkWindow variant. Or better yet, you probably want to use gtk_window_present(), which raises the window, focuses it, unminimizes it, and puts it on the current desktop. 488 489 -- window : a toplevel GdkWindow 490 -- gdk_window_stick () 491 492 -- void gdk_window_stick (GdkWindow *window); 493 494 -- "Pins" a window 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.) 495 496 -- 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 window. For window managers that don't support this operation, there's nothing you can do to force it to happen. 497 498 -- window : a toplevel GdkWindow 499 -- gdk_window_unstick () 500 501 -- void gdk_window_unstick (GdkWindow *window); 502 503 -- Reverse operation for gdk_window_stick(); see gdk_window_stick(), and gtk_window_unstick(). 504 505 -- window : a toplevel GdkWindow 506 -- gdk_window_maximize () 507 508 -- void gdk_window_maximize (GdkWindow *window); 509 510 -- Maximizes the window. If the window was already maximized, then this function does nothing. 511 512 -- On X11, asks the window manager to maximize window, 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. 513 514 -- On Windows, reliably maximizes the window. 515 516 -- window : a toplevel GdkWindow 517 -- gdk_window_unmaximize () 518 519 -- void gdk_window_unmaximize (GdkWindow *window); 520 521 -- Unmaximizes the window. If the window wasn't maximized, then this function does nothing. 522 523 -- On X11, asks the window manager to unmaximize window, 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. 524 525 -- On Windows, reliably unmaximizes the window. 526 527 -- window : a toplevel GdkWindow 528 -- gdk_window_fullscreen () 529 530 -- void gdk_window_fullscreen (GdkWindow *window); 531 532 -- Moves the window into fullscreen mode. This means the window covers the entire screen and is above any panels or task bars. 533 534 -- If the window was already fullscreen, then this function does nothing. 535 536 -- On X11, asks the window manager to put window 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. 537 538 -- window : a toplevel GdkWindow 539 540 -- Since 2.2 541 -- gdk_window_unfullscreen () 542 543 -- void gdk_window_unfullscreen (GdkWindow *window); 544 545 -- Moves the window out of fullscreen mode. If the window was not fullscreen, does nothing. 546 547 -- On X11, asks the window manager to move window 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. 548 549 -- window : a toplevel GdkWindow 550 551 -- Since 2.2 552 -- gdk_window_set_keep_above () 553 554 -- void gdk_window_set_keep_above (GdkWindow *window, 555 -- gboolean setting); 556 557 -- Set if window must be kept above other windows. If the window was already above, then this function does nothing. 558 559 -- On X11, asks the window manager to keep window 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 window being kept above. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. 560 561 -- window : a toplevel GdkWindow 562 -- setting : whether to keep window above other windows 563 564 -- Since 2.4 565 -- gdk_window_set_keep_below () 566 567 -- void gdk_window_set_keep_below (GdkWindow *window, 568 -- gboolean setting); 569 570 -- Set if window must be kept below other windows. If the window was already below, then this function does nothing. 571 572 -- On X11, asks the window manager to keep window 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 window being kept below. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. 573 574 -- window : a toplevel GdkWindow 575 -- setting : whether to keep window below other windows 576 577 -- Since 2.4 578 -- gdk_window_move () 579 580 -- void gdk_window_move (GdkWindow *window, 581 -- gint x, 582 -- gint y); 583 584 -- Repositions a window relative to its parent window. For toplevel windows, 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 windows, the move will reliably succeed. 585 586 -- If you're also planning to resize the window, use gdk_window_move_resize() to both move and resize simultaneously, for a nicer visual effect. 587 588 -- window : a GdkWindow 589 -- x : X coordinate relative to window's parent 590 -- y : Y coordinate relative to window's parent 591 -- gdk_window_resize () 592 593 -- void gdk_window_resize (GdkWindow *window, 594 -- gint width, 595 -- gint height); 596 597 -- Resizes window; for toplevel windows, asks the window manager to resize the window. The window manager may not allow the resize. When using GTK+, use gtk_window_resize() instead of this low-level GDK function. 598 599 -- Windows may not be resized below 1x1. 600 601 -- If you're also planning to move the window, use gdk_window_move_resize() to both move and resize simultaneously, for a nicer visual effect. 602 603 -- window : a GdkWindow 604 -- width : new width of the window 605 -- height : new height of the window 606 -- gdk_window_move_resize () 607 608 -- void gdk_window_move_resize (GdkWindow *window, 609 -- gint x, 610 -- gint y, 611 -- gint width, 612 -- gint height); 613 614 -- Equivalent to calling gdk_window_move() and gdk_window_resize(), except that both operations are performed at once, avoiding strange visual effects. (i.e. the user may be able to see the window first move, then resize, if you don't use gdk_window_move_resize().) 615 616 -- window : a GdkWindow 617 -- x : new X position relative to window's parent 618 -- y : new Y position relative to window's parent 619 -- width : new width 620 -- height : new height 621 -- gdk_window_scroll () 622 623 -- void gdk_window_scroll (GdkWindow *window, 624 -- gint dx, 625 -- gint dy); 626 627 -- Scroll the contents of window, both pixels and children, by the given amount. window itself does not move. Portions of the window that the scroll operation brings in from offscreen areas are invalidated. The invalidated region may be bigger than what would strictly be necessary. (For X11, a minimum area will be invalidated if the window has no subwindows, or if the edges of the window's parent do not extend beyond the edges of the window. In other cases, a multi-step process is used to scroll the window which may produce temporary visual artifacts and unnecessary invalidations.) 628 629 -- window : a GdkWindow 630 -- dx : Amount to scroll in the X direction 631 -- dy : Amount to scroll in the Y direction 632 -- gdk_window_move_region () 633 634 -- void gdk_window_move_region (GdkWindow *window, 635 -- GdkRegion *region, 636 -- gint dx, 637 -- gint dy); 638 639 -- Move the part of window indicated by region by dy pixels in the Y direction and dx pixels in the X direction. The portions of region that not covered by the new position of region are invalidated. 640 641 -- Child windows are not moved. 642 643 -- window : a GdkWindow 644 -- region : The GdkRegion to move 645 -- dx : Amount to move in the X direction 646 -- dy : Amount to move in the Y direction 647 648 -- Since 2.8 649 -- gdk_window_reparent () 650 651 -- void gdk_window_reparent (GdkWindow *window, 652 -- GdkWindow *new_parent, 653 -- gint x, 654 -- gint y); 655 656 -- Reparents window into the given new_parent. The window being reparented will be unmapped as a side effect. 657 658 -- window : a GdkWindow 659 -- new_parent : new parent to move window into 660 -- x : X location inside the new parent 661 -- y : Y location inside the new parent 662 -- gdk_window_clear () 663 664 -- void gdk_window_clear (GdkWindow *window); 665 666 -- Clears an entire window to the background color or background pixmap. 667 668 -- window : a GdkWindow 669 -- gdk_window_clear_area () 670 671 -- void gdk_window_clear_area (GdkWindow *window, 672 -- gint x, 673 -- gint y, 674 -- gint width, 675 -- gint height); 676 677 -- Clears an area of window to the background color or background pixmap. 678 679 -- window : a GdkWindow 680 -- x : x coordinate of rectangle to clear 681 -- y : y coordinate of rectangle to clear 682 -- width : width of rectangle to clear 683 -- height : height of rectangle to clear 684 -- gdk_window_clear_area_e () 685 686 -- void gdk_window_clear_area_e (GdkWindow *window, 687 -- gint x, 688 -- gint y, 689 -- gint width, 690 -- gint height); 691 692 -- Like gdk_window_clear_area(), but also generates an expose event for the cleared area. 693 694 -- This function has a stupid name because it dates back to the mists time, pre-GDK-1.0. 695 696 -- window : a GdkWindow 697 -- x : x coordinate of rectangle to clear 698 -- y : y coordinate of rectangle to clear 699 -- width : width of rectangle to clear 700 -- height : height of rectangle to clear 701 -- gdk_window_copy_area() 702 703 -- #define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) 704 705 -- Warning 706 707 -- gdk_window_copy_area is deprecated and should not be used in newly-written code. 708 709 -- Deprecated equivalent to gdk_draw_drawable(), see that function for docs 710 -- drawable : a GdkDrawable 711 -- gc : a GdkGC sharing the drawable's visual and colormap 712 -- x : X position in drawable where the rectangle should be drawn 713 -- y : Y position in drawable where the rectangle should be drawn 714 -- source_drawable : the source GdkDrawable, which may be the same as drawable 715 -- source_x : X position in src of rectangle to draw 716 -- source_y : Y position in src of rectangle to draw 717 -- width : width of rectangle to draw, or -1 for entire src width 718 -- height : height of rectangle to draw, or -1 for entire src height 719 -- gdk_window_raise () 720 721 -- void gdk_window_raise (GdkWindow *window); 722 723 -- Raises window to the top of the Z-order (stacking order), so that other windows with the same parent window appear below window. This is true whether or not the windows are visible. 724 725 -- If window is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, gdk_window_raise() only requests the restack, does not guarantee it. 726 727 -- window : a GdkWindow 728 -- gdk_window_lower () 729 730 -- void gdk_window_lower (GdkWindow *window); 731 732 -- Lowers window to the bottom of the Z-order (stacking order), so that other windows with the same parent window appear above window. This is true whether or not the other windows are visible. 733 734 -- If window is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, gdk_window_lower() only requests the restack, does not guarantee it. 735 736 -- Note that gdk_window_show() raises the window again, so don't call this function before gdk_window_show(). (Try gdk_window_show_unraised().) 737 738 -- window : a GdkWindow 739 -- gdk_window_focus () 740 741 -- void gdk_window_focus (GdkWindow *window, 742 -- guint32 timestamp); 743 744 -- Sets keyboard focus to window. In most cases, gtk_window_present() should be used on a GtkWindow, rather than calling this function. 745 746 -- window : a GdkWindow 747 -- timestamp : timestamp of the event triggering the window focus 748 -- gdk_window_register_dnd () 749 750 -- void gdk_window_register_dnd (GdkWindow *window); 751 752 -- Registers a window as a potential drop destination. 753 -- window : a GdkWindow. 754 -- gdk_window_begin_resize_drag () 755 756 -- void gdk_window_begin_resize_drag (GdkWindow *window, 757 -- GdkWindowEdge edge, 758 -- gint button, 759 -- gint root_x, 760 -- gint root_y, 761 -- guint32 timestamp); 762 763 -- Begins a window resize operation (for a toplevel window). You might use this function to implement a "window resize grip," for example; in fact GtkStatusbar uses it. The function works best with window managers that support the Extended Window Manager Hints, but has a fallback implementation for other window managers. 764 765 -- window : a toplevel GdkWindow 766 -- edge : the edge or corner from which the drag is started 767 -- button : the button being used to drag 768 -- root_x : root window X coordinate of mouse click that began the drag 769 -- root_y : root window Y coordinate of mouse click that began the drag 770 -- timestamp : timestamp of mouse click that began the drag (use gdk_event_get_time()) 771 -- gdk_window_begin_move_drag () 772 773 -- void gdk_window_begin_move_drag (GdkWindow *window, 774 -- gint button, 775 -- gint root_x, 776 -- gint root_y, 777 -- guint32 timestamp); 778 779 -- Begins a window move operation (for a toplevel window). You might use this function to implement a "window move grip," for example. The function works best with window managers that support the Extended Window Manager Hints, but has a fallback implementation for other window managers. 780 781 -- window : a toplevel GdkWindow 782 -- button : the button being used to drag 783 -- root_x : root window X coordinate of mouse click that began the drag 784 -- root_y : root window Y coordinate of mouse click that began the drag 785 -- timestamp : timestamp of mouse click that began the drag 786 -- gdk_window_constrain_size () 787 788 -- void gdk_window_constrain_size (GdkGeometry *geometry, 789 -- guint flags, 790 -- gint width, 791 -- gint height, 792 -- gint *new_width, 793 -- gint *new_height); 794 795 -- Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size). 796 797 -- geometry : a GdkGeometry structure 798 -- flags : a mask indicating what portions of geometry are set 799 -- width : desired width of window 800 -- height : desired height of the window 801 -- new_width : location to store resulting width 802 -- new_height : location to store resulting height 803 -- gdk_window_begin_paint_rect () 804 805 -- void gdk_window_begin_paint_rect (GdkWindow *window, 806 -- GdkRectangle *rectangle); 807 808 -- A convenience wrapper around gdk_window_begin_paint_region() which creates a rectangular region for you. See gdk_window_begin_paint_region() for details. 809 810 -- window : a GdkWindow 811 -- rectangle : rectangle you intend to draw to 812 -- gdk_window_begin_paint_region () 813 814 -- void gdk_window_begin_paint_region (GdkWindow *window, 815 -- GdkRegion *region); 816 817 -- Indicates that you are beginning the process of redrawing region. A backing store (offscreen buffer) large enough to contain region will be created. The backing store will be initialized with the background color or background pixmap for window. Then, all drawing operations performed on window will be diverted to the backing store. When you call gdk_window_end_paint(), the backing store will be copied to window, making it visible onscreen. Only the part of window contained in region will be modified; that is, drawing operations are clipped to region. 818 819 -- The net result of all this is to remove flicker, because the user sees the finished product appear all at once when you call gdk_window_end_paint(). If you draw to window directly without calling gdk_window_begin_paint_region(), the user may see flicker as individual drawing operations are performed in sequence. The clipping and background-initializing features of gdk_window_begin_paint_region() are conveniences for the programmer, so you can avoid doing that work yourself. 820 821 -- When using GTK+, the widget system automatically places calls to gdk_window_begin_paint_region() and gdk_window_end_paint() around emissions of the expose_event signal. That is, if you're writing an expose event handler, you can assume that the exposed area in GdkEventExpose has already been cleared to the window background, is already set as the clip region, and already has a backing store. Therefore in most cases, application code need not call gdk_window_begin_paint_region(). (You can disable the automatic calls around expose events on a widget-by-widget basis by calling gtk_widget_set_double_buffered().) 822 823 -- If you call this function multiple times before calling the matching gdk_window_end_paint(), the backing stores are pushed onto a stack. gdk_window_end_paint() copies the topmost backing store onscreen, subtracts the topmost region from all other regions in the stack, and pops the stack. All drawing operations affect only the topmost backing store in the stack. One matching call to gdk_window_end_paint() is required for each call to gdk_window_begin_paint_region(). 824 825 -- window : a GdkWindow 826 -- region : region you intend to draw to 827 -- gdk_window_end_paint () 828 829 -- void gdk_window_end_paint (GdkWindow *window); 830 831 -- Indicates that the backing store created by the most recent call to gdk_window_begin_paint_region() should be copied onscreen and deleted, leaving the next-most-recent backing store or no backing store at all as the active paint region. See gdk_window_begin_paint_region() for full details. It is an error to call this function without a matching gdk_window_begin_paint_region() first. 832 833 -- window : a GdkWindow 834 -- gdk_window_invalidate_rect () 835 836 -- void gdk_window_invalidate_rect (GdkWindow *window, 837 -- GdkRectangle *rect, 838 -- gboolean invalidate_children); 839 840 -- A convenience wrapper around gdk_window_invalidate_region() which invalidates a rectangular region. See gdk_window_invalidate_region() for details. 841 842 -- window : a GdkWindow 843 -- rect : rectangle to invalidate 844 -- invalidate_children : whether to also invalidate child windows 845 -- gdk_window_invalidate_region () 846 847 -- void gdk_window_invalidate_region (GdkWindow *window, 848 -- GdkRegion *region, 849 -- gboolean invalidate_children); 850 851 -- Adds region to the update area for window. The update area is the region that needs to be redrawn, or "dirty region." The call gdk_window_process_updates() sends one or more expose events to the window, which together cover the entire update area. An application would normally redraw the contents of window in response to those expose events. 852 853 -- GDK will call gdk_window_process_all_updates() on your behalf whenever your program returns to the main loop and becomes idle, so normally there's no need to do that manually, you just need to invalidate regions that you know should be redrawn. 854 855 -- The invalidate_children parameter controls whether the region of each child window that intersects region will also be invalidated. If FALSE, then the update area for child windows will remain unaffected. See gdk_window_invalidate_maybe_recurse if you need fine grained control over which children are invalidated. 856 857 -- window : a GdkWindow 858 -- region : a GdkRegion 859 -- invalidate_children : TRUE to also invalidate child windows 860 -- gdk_window_invalidate_maybe_recurse () 861 862 -- void gdk_window_invalidate_maybe_recurse 863 -- (GdkWindow *window, 864 -- GdkRegion *region, 865 -- gboolean (*child_func) (GdkWindow *, gpointer), 866 -- gpointer user_data); 867 868 -- Adds region to the update area for window. The update area is the region that needs to be redrawn, or "dirty region." The call gdk_window_process_updates() sends one or more expose events to the window, which together cover the entire update area. An application would normally redraw the contents of window in response to those expose events. 869 870 -- GDK will call gdk_window_process_all_updates() on your behalf whenever your program returns to the main loop and becomes idle, so normally there's no need to do that manually, you just need to invalidate regions that you know should be redrawn. 871 872 -- The child_func parameter controls whether the region of each child window that intersects region will also be invalidated. Only children for which child_func returns TRUE will have the area invalidated. 873 874 -- window : a GdkWindow 875 -- region : a GdkRegion 876 -- child_func : function to use to decide if to recurse to a child, NULL means never recurse. 877 -- user_data : data passed to child_func 878 -- gdk_window_get_update_area () 879 880 -- GdkRegion* gdk_window_get_update_area (GdkWindow *window); 881 882 -- Transfers ownership of the update area from window to the caller of the function. That is, after calling this function, window will no longer have an invalid/dirty region; the update area is removed from window and handed to you. If a window has no update area, gdk_window_get_update_area() returns NULL. You are responsible for calling gdk_region_destroy() on the returned region if it's non-NULL. 883 884 -- window : a GdkWindow 885 -- Returns : the update area for window 886 -- gdk_window_freeze_updates () 887 888 -- void gdk_window_freeze_updates (GdkWindow *window); 889 890 -- Temporarily freezes a window such that it won't receive expose events. The window will begin receiving expose events again when gdk_window_thaw_updates() is called. If gdk_window_freeze_updates() has been called more than once, gdk_window_thaw_updates() must be called an equal number of times to begin processing exposes. 891 892 -- window : a GdkWindow 893 -- gdk_window_thaw_updates () 894 895 -- void gdk_window_thaw_updates (GdkWindow *window); 896 897 -- Thaws a window frozen with gdk_window_freeze_updates(). 898 899 -- window : a GdkWindow 900 -- gdk_window_process_all_updates () 901 902 -- void gdk_window_process_all_updates (void); 903 904 -- Calls gdk_window_process_updates() for all windows (see GdkWindow) in the application. 905 906 -- gdk_window_process_updates () 907 908 -- void gdk_window_process_updates (GdkWindow *window, 909 -- gboolean update_children); 910 911 -- Sends one or more expose events to window. The areas in each expose event will cover the entire update area for the window (see gdk_window_invalidate_region() for details). Normally GDK calls gdk_window_process_all_updates() on your behalf, so there's no need to call this function unless you want to force expose events to be delivered immediately and synchronously (vs. the usual case, where GDK delivers them in an idle handler). Occasionally this is useful to produce nicer scrolling behavior, for example. 912 913 -- window : a GdkWindow 914 -- update_children : whether to also process updates for child windows 915 -- gdk_window_set_debug_updates () 916 917 -- void gdk_window_set_debug_updates (gboolean setting); 918 919 -- With update debugging enabled, calls to gdk_window_invalidate_region() clear the invalidated region of the screen to a noticeable color, and GDK pauses for a short time before sending exposes to windows during gdk_window_process_updates(). The net effect is that you can see the invalid region for each window and watch redraws as they occur. This allows you to diagnose inefficiencies in your application. 920 921 -- In essence, because the GDK rendering model prevents all flicker, if you are redrawing the same region 400 times you may never notice, aside from noticing a speed problem. Enabling update debugging causes GTK to flicker slowly and noticeably, so you can see exactly what's being redrawn when, in what order. 922 923 -- The --gtk-debug=updates command line option passed to GTK+ programs enables this debug option at application startup time. That's usually more useful than calling gdk_window_set_debug_updat…
Large files files are truncated, but you can click here to view the full file