1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = gdk3-Windows.html 27 * outPack = gdk 28 * outFile = Window 29 * strct = GdkWindow 30 * realStrct= 31 * ctorStrct= 32 * clss = Window 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gdk_window_ 41 * - gdk_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - cairo.Pattern 49 * - cairo.Region 50 * - cairo.Surface 51 * - glib.ListG 52 * - gdk.Color 53 * - gdk.Cursor 54 * - gdk.Device 55 * - gdk.Display 56 * - gdk.FrameClock 57 * - gdk.Rectangle 58 * - gdk.RGBA 59 * - gdk.Screen 60 * - gdk.Visual 61 * structWrap: 62 * - CairoSurface* -> Surface 63 * - GList* -> ListG 64 * - GdkColor* -> Color 65 * - GdkCursor* -> Cursor 66 * - GdkDevice* -> Device 67 * - GdkDisplay* -> Display 68 * - GdkFrameClock* -> FrameClock 69 * - GdkRGBA* -> RGBA 70 * - GdkScreen* -> Screen 71 * - GdkVisual* -> Visual 72 * - GdkWindow* -> Window 73 * - cairo_pattern_t* -> Pattern 74 * - cairo_region_t* -> Region 75 * - cairo_surface_t* -> Surface 76 * module aliases: 77 * local aliases: 78 * overrides: 79 */ 80 81 module gdk.Window; 82 83 public import gtkc.gdktypes; 84 85 private import gtkc.gdk; 86 private import glib.ConstructionException; 87 private import gobject.ObjectG; 88 89 private import gobject.Signals; 90 public import gtkc.gdktypes; 91 92 private import glib.Str; 93 private import cairo.Pattern; 94 private import cairo.Region; 95 private import cairo.Surface; 96 private import glib.ListG; 97 private import gdk.Color; 98 private import gdk.Cursor; 99 private import gdk.Device; 100 private import gdk.Display; 101 private import gdk.FrameClock; 102 private import gdk.Rectangle; 103 private import gdk.RGBA; 104 private import gdk.Screen; 105 private import gdk.Visual; 106 107 108 109 private import gobject.ObjectG; 110 111 /** 112 * A GdkWindow is a (usually) rectangular region on the screen. 113 * It's a low-level object, used to implement high-level objects such as 114 * GtkWidget and GtkWindow on the GTK+ level. A GtkWindow is a toplevel 115 * window, the thing a user might think of as a "window" with a titlebar and 116 * so on; a GtkWindow may contain many GdkWindows. For example, each 117 * GtkButton has a GdkWindow associated with it. 118 * 119 * Composited Windows 120 * 121 * Normally, the windowing system takes care of rendering the contents of a 122 * child window onto its parent window. This mechanism can be intercepted by 123 * calling gdk_window_set_composited() on the child window. For a 124 * composited window it is the responsibility of the 125 * application to render the window contents at the right spot. 126 * 127 * <hr> 128 * 129 * Offscreen Windows 130 * 131 * Offscreen windows are more general than composited windows, since they allow 132 * not only to modify the rendering of the child window onto its parent, but 133 * also to apply coordinate transformations. 134 * 135 * To integrate an offscreen window into a window hierarchy, one has to call 136 * gdk_offscreen_window_set_embedder() and handle a number of signals. The 137 * "pick-embedded-child" signal on the embedder window is used to 138 * select an offscreen child at given coordinates, and the 139 * "to-embedder" and "from-embedder" signals on the 140 * offscreen window are used to translate coordinates between the embedder and 141 * the offscreen window. 142 * 143 * For rendering an offscreen window onto its embedder, the contents of the 144 * offscreen window are available as a surface, via 145 * gdk_offscreen_window_get_surface(). 146 */ 147 public class Window : ObjectG 148 { 149 150 /** the main Gtk struct */ 151 protected GdkWindow* gdkWindow; 152 153 154 public GdkWindow* getWindowStruct() 155 { 156 return gdkWindow; 157 } 158 159 160 /** the main Gtk struct as a void* */ 161 protected override void* getStruct() 162 { 163 return cast(void*)gdkWindow; 164 } 165 166 /** 167 * Sets our main struct and passes it to the parent class 168 */ 169 public this (GdkWindow* gdkWindow) 170 { 171 super(cast(GObject*)gdkWindow); 172 this.gdkWindow = gdkWindow; 173 } 174 175 protected override void setStruct(GObject* obj) 176 { 177 super.setStruct(obj); 178 gdkWindow = cast(GdkWindow*)obj; 179 } 180 181 /** 182 * Create a new surface that is as compatible as possible with the 183 * given window. For example the new surface will have the same 184 * fallback resolution and font options as window. Generally, the new 185 * surface will also use the same backend as window, unless that is 186 * not possible for some reason. The type of the returned surface may 187 * be examined with cairo_surface_get_type(). 188 * Initially the surface contents are all 0 (transparent if contents 189 * have transparency, black otherwise.) 190 * Since 2.22 191 * Params: 192 * window = window to make new surface similar to 193 * content = the content for the new surface 194 * width = width of the new surface 195 * height = height of the new surface 196 * Returns: a pointer to the newly allocated surface. The caller owns the surface and should call cairo_surface_destroy() when done with it. This function always returns a valid pointer, but it will return a pointer to a "nil" surface if other is already in an error state or any other error occurs. 197 */ 198 public Surface createSimilarSurface(CairoContent content, int width, int height) 199 { 200 // cairo_surface_t * gdk_window_create_similar_surface (GdkWindow *window, cairo_content_t content, int width, int height); 201 auto p = gdk_window_create_similar_surface(gdkWindow, content, width, height); 202 if(p is null) 203 { 204 return null; 205 } 206 return new Surface(cast(cairo_surface_t*) p); 207 } 208 209 /** 210 */ 211 int[string] connectedSignals; 212 213 Surface delegate(gint, gint, Window)[] onCreateSurfaceListeners; 214 /** 215 * The ::create-surface signal is emitted when an offscreen window 216 * needs its surface (re)created, which happens either when the the 217 * window is first drawn to, or when the window is being 218 * resized. The first signal handler that returns a non-NULL 219 * surface will stop any further signal emission, and its surface 220 * will be used. 221 * Note that it is not possible to access the window's previous 222 * surface from within any callback of this signal. Calling 223 * gdk_offscreen_window_get_surface() will lead to a crash. 224 * Since 3.0 225 */ 226 void addOnCreateSurface(Surface delegate(gint, gint, Window) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 227 { 228 if ( !("create-surface" in connectedSignals) ) 229 { 230 Signals.connectData( 231 getStruct(), 232 "create-surface", 233 cast(GCallback)&callBackCreateSurface, 234 cast(void*)this, 235 null, 236 connectFlags); 237 connectedSignals["create-surface"] = 1; 238 } 239 onCreateSurfaceListeners ~= dlg; 240 } 241 extern(C) static void callBackCreateSurface(GdkWindow* windowStruct, gint width, gint height, Window _window) 242 { 243 foreach ( Surface delegate(gint, gint, Window) dlg ; _window.onCreateSurfaceListeners ) 244 { 245 dlg(width, height, _window); 246 } 247 } 248 249 void delegate(gdouble, gdouble, void*, void*, Window)[] onFromEmbedderListeners; 250 /** 251 * The ::from-embedder signal is emitted to translate coordinates 252 * in the embedder of an offscreen window to the offscreen window. 253 * See also "to-embedder". 254 * Since 2.18 255 */ 256 void addOnFromEmbedder(void delegate(gdouble, gdouble, void*, void*, Window) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 257 { 258 if ( !("from-embedder" in connectedSignals) ) 259 { 260 Signals.connectData( 261 getStruct(), 262 "from-embedder", 263 cast(GCallback)&callBackFromEmbedder, 264 cast(void*)this, 265 null, 266 connectFlags); 267 connectedSignals["from-embedder"] = 1; 268 } 269 onFromEmbedderListeners ~= dlg; 270 } 271 extern(C) static void callBackFromEmbedder(GdkWindow* windowStruct, gdouble embedderX, gdouble embedderY, void* offscreenX, void* offscreenY, Window _window) 272 { 273 foreach ( void delegate(gdouble, gdouble, void*, void*, Window) dlg ; _window.onFromEmbedderListeners ) 274 { 275 dlg(embedderX, embedderY, offscreenX, offscreenY, _window); 276 } 277 } 278 279 Window delegate(gdouble, gdouble, Window)[] onPickEmbeddedChildListeners; 280 /** 281 * The ::pick-embedded-child signal is emitted to find an embedded 282 * child at the given position. 283 * Since 2.18 284 */ 285 void addOnPickEmbeddedChild(Window delegate(gdouble, gdouble, Window) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 286 { 287 if ( !("pick-embedded-child" in connectedSignals) ) 288 { 289 Signals.connectData( 290 getStruct(), 291 "pick-embedded-child", 292 cast(GCallback)&callBackPickEmbeddedChild, 293 cast(void*)this, 294 null, 295 connectFlags); 296 connectedSignals["pick-embedded-child"] = 1; 297 } 298 onPickEmbeddedChildListeners ~= dlg; 299 } 300 extern(C) static void callBackPickEmbeddedChild(GdkWindow* windowStruct, gdouble x, gdouble y, Window _window) 301 { 302 foreach ( Window delegate(gdouble, gdouble, Window) dlg ; _window.onPickEmbeddedChildListeners ) 303 { 304 dlg(x, y, _window); 305 } 306 } 307 308 void delegate(gdouble, gdouble, void*, void*, Window)[] onToEmbedderListeners; 309 /** 310 * The ::to-embedder signal is emitted to translate coordinates 311 * in an offscreen window to its embedder. 312 * See also "from-embedder". 313 * Since 2.18 314 */ 315 void addOnToEmbedder(void delegate(gdouble, gdouble, void*, void*, Window) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 316 { 317 if ( !("to-embedder" in connectedSignals) ) 318 { 319 Signals.connectData( 320 getStruct(), 321 "to-embedder", 322 cast(GCallback)&callBackToEmbedder, 323 cast(void*)this, 324 null, 325 connectFlags); 326 connectedSignals["to-embedder"] = 1; 327 } 328 onToEmbedderListeners ~= dlg; 329 } 330 extern(C) static void callBackToEmbedder(GdkWindow* windowStruct, gdouble offscreenX, gdouble offscreenY, void* embedderX, void* embedderY, Window _window) 331 { 332 foreach ( void delegate(gdouble, gdouble, void*, void*, Window) dlg ; _window.onToEmbedderListeners ) 333 { 334 dlg(offscreenX, offscreenY, embedderX, embedderY, _window); 335 } 336 } 337 338 339 /** 340 * Creates a new GdkWindow using the attributes from 341 * attributes. See GdkWindowAttr and GdkWindowAttributesType for 342 * more details. Note: to use this on displays other than the default 343 * display, parent must be specified. 344 * Params: 345 * parent = a GdkWindow, or NULL to create the window as a child of 346 * the default root window for the default display. [allow-none] 347 * attributes = attributes of the new window 348 * attributesMask = mask indicating which 349 * fields in attributes are valid. [type GdkWindowAttributesType] 350 * Throws: ConstructionException GTK+ fails to create the object. 351 */ 352 public this (Window parent, GdkWindowAttr* attributes, int attributesMask) 353 { 354 // GdkWindow * gdk_window_new (GdkWindow *parent, GdkWindowAttr *attributes, gint attributes_mask); 355 auto p = gdk_window_new((parent is null) ? null : parent.getWindowStruct(), attributes, attributesMask); 356 if(p is null) 357 { 358 throw new ConstructionException("null returned by gdk_window_new((parent is null) ? null : parent.getWindowStruct(), attributes, attributesMask)"); 359 } 360 this(cast(GdkWindow*) p); 361 } 362 363 /** 364 * Destroys the window system resources associated with window and decrements window's 365 * reference count. The window system resources for all children of window are also 366 * destroyed, but the children's reference counts are not decremented. 367 * Note that a window will not be destroyed automatically when its reference count 368 * reaches zero. You must call this function yourself before that happens. 369 */ 370 public void destroy() 371 { 372 // void gdk_window_destroy (GdkWindow *window); 373 gdk_window_destroy(gdkWindow); 374 } 375 376 /** 377 * Gets the type of the window. See GdkWindowType. 378 * Returns: type of window 379 */ 380 public GdkWindowType getWindowType() 381 { 382 // GdkWindowType gdk_window_get_window_type (GdkWindow *window); 383 return gdk_window_get_window_type(gdkWindow); 384 } 385 386 /** 387 * Gets the GdkDisplay associated with a GdkWindow. 388 * Since 2.24 389 * Returns: the GdkDisplay associated with window. [transfer none] 390 */ 391 public Display getDisplay() 392 { 393 // GdkDisplay * gdk_window_get_display (GdkWindow *window); 394 auto p = gdk_window_get_display(gdkWindow); 395 396 if(p is null) 397 { 398 return null; 399 } 400 401 return ObjectG.getDObject!(Display)(cast(GdkDisplay*) p); 402 } 403 404 /** 405 * Gets the GdkScreen associated with a GdkWindow. 406 * Since 2.24 407 * Returns: the GdkScreen associated with window. [transfer none] 408 */ 409 public Screen getScreen() 410 { 411 // GdkScreen * gdk_window_get_screen (GdkWindow *window); 412 auto p = gdk_window_get_screen(gdkWindow); 413 414 if(p is null) 415 { 416 return null; 417 } 418 419 return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p); 420 } 421 422 /** 423 * Gets the GdkVisual describing the pixel format of window. 424 * Since 2.24 425 * Returns: a GdkVisual. [transfer none] 426 */ 427 public Visual getVisual() 428 { 429 // GdkVisual * gdk_window_get_visual (GdkWindow *window); 430 auto p = gdk_window_get_visual(gdkWindow); 431 432 if(p is null) 433 { 434 return null; 435 } 436 437 return ObjectG.getDObject!(Visual)(cast(GdkVisual*) p); 438 } 439 440 /** 441 * Warning 442 * gdk_window_at_pointer has been deprecated since version 3.0 and should not be used in newly-written code. Use gdk_device_get_window_at_position() instead. 443 * Obtains the window underneath the mouse pointer, returning the 444 * location of that window in win_x, win_y. Returns NULL if the 445 * window under the mouse pointer is not known to GDK (if the window 446 * belongs to another application and a GdkWindow hasn't been created 447 * for it with gdk_window_foreign_new()) 448 * NOTE: For multihead-aware widgets or applications use 449 * gdk_display_get_window_at_pointer() instead. 450 * Params: 451 * winX = return location for origin of the window under the pointer. [out][allow-none] 452 * winY = return location for origin of the window under the pointer. [out][allow-none] 453 * Returns: window under the mouse pointer. [transfer none] 454 */ 455 public static Window atPointer(out int winX, out int winY) 456 { 457 // GdkWindow * gdk_window_at_pointer (gint *win_x, gint *win_y); 458 auto p = gdk_window_at_pointer(&winX, &winY); 459 460 if(p is null) 461 { 462 return null; 463 } 464 465 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 466 } 467 468 /** 469 * Like gdk_window_show_unraised(), but also raises the window to the 470 * top of the window stack (moves the window to the front of the 471 * Z-order). 472 * This function maps a window so it's visible onscreen. Its opposite 473 * is gdk_window_hide(). 474 * When implementing a GtkWidget, you should call this function on the widget's 475 * GdkWindow as part of the "map" method. 476 */ 477 public void show() 478 { 479 // void gdk_window_show (GdkWindow *window); 480 gdk_window_show(gdkWindow); 481 } 482 483 /** 484 * Shows a GdkWindow onscreen, but does not modify its stacking 485 * order. In contrast, gdk_window_show() will raise the window 486 * to the top of the window stack. 487 * On the X11 platform, in Xlib terms, this function calls 488 * XMapWindow() (it also updates some internal GDK state, which means 489 * that you can't really use XMapWindow() directly on a GDK window). 490 */ 491 public void showUnraised() 492 { 493 // void gdk_window_show_unraised (GdkWindow *window); 494 gdk_window_show_unraised(gdkWindow); 495 } 496 497 /** 498 * For toplevel windows, withdraws them, so they will no longer be 499 * known to the window manager; for all windows, unmaps them, so 500 * they won't be displayed. Normally done automatically as 501 * part of gtk_widget_hide(). 502 */ 503 public void hide() 504 { 505 // void gdk_window_hide (GdkWindow *window); 506 gdk_window_hide(gdkWindow); 507 } 508 509 /** 510 * Check to see if a window is destroyed.. 511 * Since 2.18 512 * Returns: TRUE if the window is destroyed 513 */ 514 public int isDestroyed() 515 { 516 // gboolean gdk_window_is_destroyed (GdkWindow *window); 517 return gdk_window_is_destroyed(gdkWindow); 518 } 519 520 /** 521 * Checks whether the window has been mapped (with gdk_window_show() or 522 * gdk_window_show_unraised()). 523 * Returns: TRUE if the window is mapped 524 */ 525 public int isVisible() 526 { 527 // gboolean gdk_window_is_visible (GdkWindow *window); 528 return gdk_window_is_visible(gdkWindow); 529 } 530 531 /** 532 * Check if the window and all ancestors of the window are 533 * mapped. (This is not necessarily "viewable" in the X sense, since 534 * we only check as far as we have GDK window parents, not to the root 535 * window.) 536 * Returns: TRUE if the window is viewable 537 */ 538 public int isViewable() 539 { 540 // gboolean gdk_window_is_viewable (GdkWindow *window); 541 return gdk_window_is_viewable(gdkWindow); 542 } 543 544 /** 545 * Determines whether or not the window is an input only window. 546 * Since 2.22 547 * Returns: TRUE if window is input only 548 */ 549 public int isInputOnly() 550 { 551 // gboolean gdk_window_is_input_only (GdkWindow *window); 552 return gdk_window_is_input_only(gdkWindow); 553 } 554 555 /** 556 * Determines whether or not the window is shaped. 557 * Since 2.22 558 * Returns: TRUE if window is shaped 559 */ 560 public int isShaped() 561 { 562 // gboolean gdk_window_is_shaped (GdkWindow *window); 563 return gdk_window_is_shaped(gdkWindow); 564 } 565 566 /** 567 * Gets the bitwise OR of the currently active window state flags, 568 * from the GdkWindowState enumeration. 569 * Returns: window state bitfield 570 */ 571 public GdkWindowState getState() 572 { 573 // GdkWindowState gdk_window_get_state (GdkWindow *window); 574 return gdk_window_get_state(gdkWindow); 575 } 576 577 /** 578 * Withdraws a window (unmaps it and asks the window manager to forget about it). 579 * This function is not really useful as gdk_window_hide() automatically 580 * withdraws toplevel windows before hiding them. 581 */ 582 public void withdraw() 583 { 584 // void gdk_window_withdraw (GdkWindow *window); 585 gdk_window_withdraw(gdkWindow); 586 } 587 588 /** 589 * Asks to iconify (minimize) window. The window manager may choose 590 * to ignore the request, but normally will honor it. Using 591 * gtk_window_iconify() is preferred, if you have a GtkWindow widget. 592 * This function only makes sense when window is a toplevel window. 593 */ 594 public void iconify() 595 { 596 // void gdk_window_iconify (GdkWindow *window); 597 gdk_window_iconify(gdkWindow); 598 } 599 600 /** 601 * Attempt to deiconify (unminimize) window. On X11 the window manager may 602 * choose to ignore the request to deiconify. When using GTK+, 603 * use gtk_window_deiconify() instead of the GdkWindow variant. Or better yet, 604 * you probably want to use gtk_window_present(), which raises the window, focuses it, 605 * unminimizes it, and puts it on the current desktop. 606 */ 607 public void deiconify() 608 { 609 // void gdk_window_deiconify (GdkWindow *window); 610 gdk_window_deiconify(gdkWindow); 611 } 612 613 /** 614 * "Pins" a window such that it's on all workspaces and does not scroll 615 * with viewports, for window managers that have scrollable viewports. 616 * (When using GtkWindow, gtk_window_stick() may be more useful.) 617 * On the X11 platform, this function depends on window manager 618 * support, so may have no effect with many window managers. However, 619 * GDK will do the best it can to convince the window manager to stick 620 * the window. For window managers that don't support this operation, 621 * there's nothing you can do to force it to happen. 622 */ 623 public void stick() 624 { 625 // void gdk_window_stick (GdkWindow *window); 626 gdk_window_stick(gdkWindow); 627 } 628 629 /** 630 * Reverse operation for gdk_window_stick(); see gdk_window_stick(), 631 * and gtk_window_unstick(). 632 */ 633 public void unstick() 634 { 635 // void gdk_window_unstick (GdkWindow *window); 636 gdk_window_unstick(gdkWindow); 637 } 638 639 /** 640 * Maximizes the window. If the window was already maximized, then 641 * this function does nothing. 642 * On X11, asks the window manager to maximize window, if the window 643 * manager supports this operation. Not all window managers support 644 * this, and some deliberately ignore it or don't have a concept of 645 * "maximized"; so you can't rely on the maximization actually 646 * happening. But it will happen with most standard window managers, 647 * and GDK makes a best effort to get it to happen. 648 * On Windows, reliably maximizes the window. 649 */ 650 public void maximize() 651 { 652 // void gdk_window_maximize (GdkWindow *window); 653 gdk_window_maximize(gdkWindow); 654 } 655 656 /** 657 * Unmaximizes the window. If the window wasn't maximized, then this 658 * function does nothing. 659 * On X11, asks the window manager to unmaximize window, if the 660 * window manager supports this operation. Not all window managers 661 * support this, and some deliberately ignore it or don't have a 662 * concept of "maximized"; so you can't rely on the unmaximization 663 * actually happening. But it will happen with most standard window 664 * managers, and GDK makes a best effort to get it to happen. 665 * On Windows, reliably unmaximizes the window. 666 */ 667 public void unmaximize() 668 { 669 // void gdk_window_unmaximize (GdkWindow *window); 670 gdk_window_unmaximize(gdkWindow); 671 } 672 673 /** 674 * Moves the window into fullscreen mode. This means the 675 * window covers the entire screen and is above any panels 676 * or task bars. 677 * If the window was already fullscreen, then this function does nothing. 678 * On X11, asks the window manager to put window in a fullscreen 679 * state, if the window manager supports this operation. Not all 680 * window managers support this, and some deliberately ignore it or 681 * don't have a concept of "fullscreen"; so you can't rely on the 682 * fullscreenification actually happening. But it will happen with 683 * most standard window managers, and GDK makes a best effort to get 684 * it to happen. 685 * Since 2.2 686 */ 687 public void fullscreen() 688 { 689 // void gdk_window_fullscreen (GdkWindow *window); 690 gdk_window_fullscreen(gdkWindow); 691 } 692 693 /** 694 * Moves the window out of fullscreen mode. If the window was not 695 * fullscreen, does nothing. 696 * On X11, asks the window manager to move window out of the fullscreen 697 * state, if the window manager supports this operation. Not all 698 * window managers support this, and some deliberately ignore it or 699 * don't have a concept of "fullscreen"; so you can't rely on the 700 * unfullscreenification actually happening. But it will happen with 701 * most standard window managers, and GDK makes a best effort to get 702 * it to happen. 703 * Since 2.2 704 */ 705 public void unfullscreen() 706 { 707 // void gdk_window_unfullscreen (GdkWindow *window); 708 gdk_window_unfullscreen(gdkWindow); 709 } 710 711 /** 712 * Obtains the GdkFullscreenMode of the window. 713 * Returns: The GdkFullscreenMode applied to the window when fullscreen. Since 3.8 714 */ 715 public GdkFullscreenMode getFullscreenMode() 716 { 717 // GdkFullscreenMode gdk_window_get_fullscreen_mode (GdkWindow *window); 718 return gdk_window_get_fullscreen_mode(gdkWindow); 719 } 720 721 /** 722 * Specifies whether the window should span over all monitors (in a multi-head 723 * setup) or only the current monitor when in fullscreen mode. 724 * The mode argument is from the GdkFullscreenMode enumeration. 725 * If GDK_FULLSCREEN_ON_ALL_MONITORS is specified, the fullscreen window will 726 * span over all monitors from the GdkScreen. 727 * On X11, searches through the list of monitors from the GdkScreen the ones 728 * which delimit the 4 edges of the entire GdkScreen and will ask the window 729 * manager to span the window over these monitors. 730 * If the XINERAMA extension is not available or not usable, this function 731 * has no effect. 732 * Not all window managers support this, so you can't rely on the fullscreen 733 * window to span over the multiple monitors when GDK_FULLSCREEN_ON_ALL_MONITORS 734 * is specified. 735 * Params: 736 * mode = fullscreen mode 737 * Since 3.8 738 */ 739 public void setFullscreenMode(GdkFullscreenMode mode) 740 { 741 // void gdk_window_set_fullscreen_mode (GdkWindow *window, GdkFullscreenMode mode); 742 gdk_window_set_fullscreen_mode(gdkWindow, mode); 743 } 744 745 /** 746 * Set if window must be kept above other windows. If the 747 * window was already above, then this function does nothing. 748 * On X11, asks the window manager to keep window above, if the window 749 * manager supports this operation. Not all window managers support 750 * this, and some deliberately ignore it or don't have a concept of 751 * "keep above"; so you can't rely on the window being kept above. 752 * But it will happen with most standard window managers, 753 * and GDK makes a best effort to get it to happen. 754 * Since 2.4 755 * Params: 756 * setting = whether to keep window above other windows 757 */ 758 public void setKeepAbove(int setting) 759 { 760 // void gdk_window_set_keep_above (GdkWindow *window, gboolean setting); 761 gdk_window_set_keep_above(gdkWindow, setting); 762 } 763 764 /** 765 * Set if window must be kept below other windows. If the 766 * window was already below, then this function does nothing. 767 * On X11, asks the window manager to keep window below, if the window 768 * manager supports this operation. Not all window managers support 769 * this, and some deliberately ignore it or don't have a concept of 770 * "keep below"; so you can't rely on the window being kept below. 771 * But it will happen with most standard window managers, 772 * and GDK makes a best effort to get it to happen. 773 * Since 2.4 774 * Params: 775 * setting = whether to keep window below other windows 776 */ 777 public void setKeepBelow(int setting) 778 { 779 // void gdk_window_set_keep_below (GdkWindow *window, gboolean setting); 780 gdk_window_set_keep_below(gdkWindow, setting); 781 } 782 783 /** 784 * Set window to render as partially transparent, 785 * with opacity 0 being fully transparent and 1 fully opaque. (Values 786 * of the opacity parameter are clamped to the [0,1] range.) 787 * For toplevel windows this depends on support from the windowing system 788 * that may not always be there. For instance, On X11, this works only on 789 * X screens with a compositing manager running. 790 * For child windows this function only works for non-native windows. 791 * For setting up per-pixel alpha topelevels, see gdk_screen_get_rgba_visual(), 792 * and for non-toplevels, see gdk_window_set_composited(). 793 * Support for non-toplevel windows was added in 3.8. 794 * Since 2.12 795 * Params: 796 * opacity = opacity 797 */ 798 public void setOpacity(double opacity) 799 { 800 // void gdk_window_set_opacity (GdkWindow *window, gdouble opacity); 801 gdk_window_set_opacity(gdkWindow, opacity); 802 } 803 804 /** 805 * Sets a GdkWindow as composited, or unsets it. Composited 806 * windows do not automatically have their contents drawn to 807 * the screen. Drawing is redirected to an offscreen buffer 808 * and an expose event is emitted on the parent of the composited 809 * window. It is the responsibility of the parent's expose handler 810 * to manually merge the off-screen content onto the screen in 811 * whatever way it sees fit. See ??? 812 * for an example. 813 * It only makes sense for child windows to be composited; see 814 * gdk_window_set_opacity() if you need translucent toplevel 815 * windows. 816 * An additional effect of this call is that the area of this 817 * window is no longer clipped from regions marked for 818 * invalidation on its parent. Draws done on the parent 819 * window are also no longer clipped by the child. 820 * This call is only supported on some systems (currently, 821 * only X11 with new enough Xcomposite and Xdamage extensions). 822 * You must call gdk_display_supports_composite() to check if 823 * setting a window as composited is supported before 824 * attempting to do so. 825 * Since 2.12 826 * Params: 827 * composited = TRUE to set the window as composited 828 */ 829 public void setComposited(int composited) 830 { 831 // void gdk_window_set_composited (GdkWindow *window, gboolean composited); 832 gdk_window_set_composited(gdkWindow, composited); 833 } 834 835 /** 836 * Determines whether window is composited. 837 * See gdk_window_set_composited(). 838 * Since 2.22 839 * Returns: TRUE if the window is composited. 840 */ 841 public int getComposited() 842 { 843 // gboolean gdk_window_get_composited (GdkWindow *window); 844 return gdk_window_get_composited(gdkWindow); 845 } 846 847 /** 848 * Repositions a window relative to its parent window. 849 * For toplevel windows, window managers may ignore or modify the move; 850 * you should probably use gtk_window_move() on a GtkWindow widget 851 * anyway, instead of using GDK functions. For child windows, 852 * the move will reliably succeed. 853 * If you're also planning to resize the window, use gdk_window_move_resize() 854 * to both move and resize simultaneously, for a nicer visual effect. 855 * Params: 856 * x = X coordinate relative to window's parent 857 * y = Y coordinate relative to window's parent 858 */ 859 public void move(int x, int y) 860 { 861 // void gdk_window_move (GdkWindow *window, gint x, gint y); 862 gdk_window_move(gdkWindow, x, y); 863 } 864 865 /** 866 * Resizes window; for toplevel windows, asks the window manager to resize 867 * the window. The window manager may not allow the resize. When using GTK+, 868 * use gtk_window_resize() instead of this low-level GDK function. 869 * Windows may not be resized below 1x1. 870 * If you're also planning to move the window, use gdk_window_move_resize() 871 * to both move and resize simultaneously, for a nicer visual effect. 872 * Params: 873 * width = new width of the window 874 * height = new height of the window 875 */ 876 public void resize(int width, int height) 877 { 878 // void gdk_window_resize (GdkWindow *window, gint width, gint height); 879 gdk_window_resize(gdkWindow, width, height); 880 } 881 882 /** 883 * Equivalent to calling gdk_window_move() and gdk_window_resize(), 884 * except that both operations are performed at once, avoiding strange 885 * visual effects. (i.e. the user may be able to see the window first 886 * move, then resize, if you don't use gdk_window_move_resize().) 887 * Params: 888 * x = new X position relative to window's parent 889 * y = new Y position relative to window's parent 890 * width = new width 891 * height = new height 892 */ 893 public void moveResize(int x, int y, int width, int height) 894 { 895 // void gdk_window_move_resize (GdkWindow *window, gint x, gint y, gint width, gint height); 896 gdk_window_move_resize(gdkWindow, x, y, width, height); 897 } 898 899 /** 900 * Scroll the contents of window, both pixels and children, by the 901 * given amount. window itself does not move. Portions of the window 902 * that the scroll operation brings in from offscreen areas are 903 * invalidated. The invalidated region may be bigger than what would 904 * strictly be necessary. 905 * For X11, a minimum area will be invalidated if the window has no 906 * subwindows, or if the edges of the window's parent do not extend 907 * beyond the edges of the window. In other cases, a multi-step process 908 * is used to scroll the window which may produce temporary visual 909 * artifacts and unnecessary invalidations. 910 * Params: 911 * dx = Amount to scroll in the X direction 912 * dy = Amount to scroll in the Y direction 913 */ 914 public void scroll(int dx, int dy) 915 { 916 // void gdk_window_scroll (GdkWindow *window, gint dx, gint dy); 917 gdk_window_scroll(gdkWindow, dx, dy); 918 } 919 920 /** 921 * Move the part of window indicated by region by dy pixels in the Y 922 * direction and dx pixels in the X direction. The portions of region 923 * that not covered by the new position of region are invalidated. 924 * Child windows are not moved. 925 * Since 2.8 926 * Params: 927 * region = The cairo_region_t to move 928 * dx = Amount to move in the X direction 929 * dy = Amount to move in the Y direction 930 */ 931 public void moveRegion(Region region, int dx, int dy) 932 { 933 // void gdk_window_move_region (GdkWindow *window, const cairo_region_t *region, gint dx, gint dy); 934 gdk_window_move_region(gdkWindow, (region is null) ? null : region.getRegionStruct(), dx, dy); 935 } 936 937 /** 938 * Flush all outstanding cached operations on a window, leaving the 939 * window in a state which reflects all that has been drawn before. 940 * Gdk uses multiple kinds of caching to get better performance and 941 * nicer drawing. For instance, during exposes all paints to a window 942 * using double buffered rendering are keep on a surface until the last 943 * window has been exposed. 944 * Normally this should be completely invisible to applications, as 945 * we automatically flush the windows when required, but this might 946 * be needed if you for instance mix direct native drawing with 947 * gdk drawing. For Gtk widgets that don't use double buffering this 948 * will be called automatically before sending the expose event. 949 * Since 2.18 950 */ 951 public void flush() 952 { 953 // void gdk_window_flush (GdkWindow *window); 954 gdk_window_flush(gdkWindow); 955 } 956 957 /** 958 * Checks whether the window has a native window or not. Note that 959 * you can use gdk_window_ensure_native() if a native window is needed. 960 * Since 2.22 961 * Returns: TRUE if the window has a native window, FALSE otherwise. 962 */ 963 public int hasNative() 964 { 965 // gboolean gdk_window_has_native (GdkWindow *window); 966 return gdk_window_has_native(gdkWindow); 967 } 968 969 /** 970 * Tries to ensure that there is a window-system native window for this 971 * GdkWindow. This may fail in some situations, returning FALSE. 972 * Offscreen window and children of them can never have native windows. 973 * Some backends may not support native child windows. 974 * Since 2.18 975 * Returns: TRUE if the window has a native window, FALSE otherwise 976 */ 977 public int ensureNative() 978 { 979 // gboolean gdk_window_ensure_native (GdkWindow *window); 980 return gdk_window_ensure_native(gdkWindow); 981 } 982 983 /** 984 * Reparents window into the given new_parent. The window being 985 * reparented will be unmapped as a side effect. 986 * Params: 987 * newParent = new parent to move window into 988 * x = X location inside the new parent 989 * y = Y location inside the new parent 990 */ 991 public void reparent(Window newParent, int x, int y) 992 { 993 // void gdk_window_reparent (GdkWindow *window, GdkWindow *new_parent, gint x, gint y); 994 gdk_window_reparent(gdkWindow, (newParent is null) ? null : newParent.getWindowStruct(), x, y); 995 } 996 997 /** 998 * Raises window to the top of the Z-order (stacking order), so that 999 * other windows with the same parent window appear below window. 1000 * This is true whether or not the windows are visible. 1001 * If window is a toplevel, the window manager may choose to deny the 1002 * request to move the window in the Z-order, gdk_window_raise() only 1003 * requests the restack, does not guarantee it. 1004 */ 1005 public void raise() 1006 { 1007 // void gdk_window_raise (GdkWindow *window); 1008 gdk_window_raise(gdkWindow); 1009 } 1010 1011 /** 1012 * Lowers window to the bottom of the Z-order (stacking order), so that 1013 * other windows with the same parent window appear above window. 1014 * This is true whether or not the other windows are visible. 1015 * If window is a toplevel, the window manager may choose to deny the 1016 * request to move the window in the Z-order, gdk_window_lower() only 1017 * requests the restack, does not guarantee it. 1018 * Note that gdk_window_show() raises the window again, so don't call this 1019 * function before gdk_window_show(). (Try gdk_window_show_unraised().) 1020 */ 1021 public void lower() 1022 { 1023 // void gdk_window_lower (GdkWindow *window); 1024 gdk_window_lower(gdkWindow); 1025 } 1026 1027 /** 1028 * Changes the position of window in the Z-order (stacking order), so that 1029 * it is above sibling (if above is TRUE) or below sibling (if above is 1030 * FALSE). 1031 * If sibling is NULL, then this either raises (if above is TRUE) or 1032 * lowers the window. 1033 * If window is a toplevel, the window manager may choose to deny the 1034 * request to move the window in the Z-order, gdk_window_restack() only 1035 * requests the restack, does not guarantee it. 1036 * Since 2.18 1037 * Params: 1038 * sibling = a GdkWindow that is a sibling of window, or NULL. [allow-none] 1039 * above = a boolean 1040 */ 1041 public void restack(Window sibling, int above) 1042 { 1043 // void gdk_window_restack (GdkWindow *window, GdkWindow *sibling, gboolean above); 1044 gdk_window_restack(gdkWindow, (sibling is null) ? null : sibling.getWindowStruct(), above); 1045 } 1046 1047 /** 1048 * Sets keyboard focus to window. In most cases, gtk_window_present() 1049 * should be used on a GtkWindow, rather than calling this function. 1050 * Params: 1051 * timestamp = timestamp of the event triggering the window focus 1052 */ 1053 public void focus(uint timestamp) 1054 { 1055 // void gdk_window_focus (GdkWindow *window, guint32 timestamp); 1056 gdk_window_focus(gdkWindow, timestamp); 1057 } 1058 1059 /** 1060 * Registers a window as a potential drop destination. 1061 */ 1062 public void registerDnd() 1063 { 1064 // void gdk_window_register_dnd (GdkWindow *window); 1065 gdk_window_register_dnd(gdkWindow); 1066 } 1067 1068 /** 1069 * Begins a window resize operation (for a toplevel window). 1070 * This function assumes that the drag is controlled by the 1071 * client pointer device, use gdk_window_begin_resize_drag_for_device() 1072 * to begin a drag with a different device. 1073 * Params: 1074 * edge = the edge or corner from which the drag is started 1075 * button = the button being used to drag 1076 * rootX = root window X coordinate of mouse click that began the drag 1077 * rootY = root window Y coordinate of mouse click that began the drag 1078 * timestamp = timestamp of mouse click that began the drag (use gdk_event_get_time()) 1079 */ 1080 public void beginResizeDrag(GdkWindowEdge edge, int button, int rootX, int rootY, uint timestamp) 1081 { 1082 // void gdk_window_begin_resize_drag (GdkWindow *window, GdkWindowEdge edge, gint button, gint root_x, gint root_y, guint32 timestamp); 1083 gdk_window_begin_resize_drag(gdkWindow, edge, button, rootX, rootY, timestamp); 1084 } 1085 1086 /** 1087 * Begins a window resize operation (for a toplevel window). 1088 * You might use this function to implement a "window resize grip," for 1089 * example; in fact GtkStatusbar uses it. The function works best 1090 * with window managers that support the Extended Window Manager Hints, but has a 1091 * fallback implementation for other window managers. 1092 * Params: 1093 * edge = the edge or corner from which the drag is started 1094 * device = the device used for the operation 1095 * button = the button being used to drag 1096 * rootX = root window X coordinate of mouse click that began the drag 1097 * rootY = root window Y coordinate of mouse click that began the drag 1098 * timestamp = timestamp of mouse click that began the drag (use gdk_event_get_time()) 1099 * Since 3.4 1100 */ 1101 public void beginResizeDragForDevice(GdkWindowEdge edge, Device device, int button, int rootX, int rootY, uint timestamp) 1102 { 1103 // void gdk_window_begin_resize_drag_for_device (GdkWindow *window, GdkWindowEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); 1104 gdk_window_begin_resize_drag_for_device(gdkWindow, edge, (device is null) ? null : device.getDeviceStruct(), button, rootX, rootY, timestamp); 1105 } 1106 1107 /** 1108 * Begins a window move operation (for a toplevel window). 1109 * This function assumes that the drag is controlled by the 1110 * client pointer device, use gdk_window_begin_move_drag_for_device() 1111 * to begin a drag with a different device. 1112 * Params: 1113 * button = the button being used to drag 1114 * rootX = root window X coordinate of mouse click that began the drag 1115 * rootY = root window Y coordinate of mouse click that began the drag 1116 * timestamp = timestamp of mouse click that began the drag 1117 */ 1118 public void beginMoveDrag(int button, int rootX, int rootY, uint timestamp) 1119 { 1120 // void gdk_window_begin_move_drag (GdkWindow *window, gint button, gint root_x, gint root_y, guint32 timestamp); 1121 gdk_window_begin_move_drag(gdkWindow, button, rootX, rootY, timestamp); 1122 } 1123 1124 /** 1125 * Begins a window move operation (for a toplevel window). 1126 * You might use this function to implement a "window move grip," for 1127 * example. The function works best with window managers that support 1128 * the Extended 1129 * Window Manager Hints, but has a fallback implementation for 1130 * other window managers. 1131 * Params: 1132 * device = the device used for the operation 1133 * button = the button being used to drag 1134 * rootX = root window X coordinate of mouse click that began the drag 1135 * rootY = root window Y coordinate of mouse click that began the drag 1136 * timestamp = timestamp of mouse click that began the drag 1137 * Since 3.4 1138 */ 1139 public void beginMoveDragForDevice(Device device, int button, int rootX, int rootY, uint timestamp) 1140 { 1141 // void gdk_window_begin_move_drag_for_device (GdkWindow *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); 1142 gdk_window_begin_move_drag_for_device(gdkWindow, (device is null) ? null : device.getDeviceStruct(), button, rootX, rootY, timestamp); 1143 } 1144 1145 /** 1146 * Constrains a desired width and height according to a 1147 * set of geometry hints (such as minimum and maximum size). 1148 * Params: 1149 * geometry = a GdkGeometry structure 1150 * flags = a mask indicating what portions of geometry are set 1151 * width = desired width of window 1152 * height = desired height of the window 1153 * newWidth = location to store resulting width. [out] 1154 * newHeight = location to store resulting height. [out] 1155 */ 1156 public static void constrainSize(ref GdkGeometry geometry, uint flags, int width, int height, out int newWidth, out int newHeight) 1157 { 1158 // void gdk_window_constrain_size (GdkGeometry *geometry, guint flags, gint width, gint height, gint *new_width, gint *new_height); 1159 gdk_window_constrain_size(&geometry, flags, width, height, &newWidth, &newHeight); 1160 } 1161 1162 /** 1163 * Emits a short beep associated to window in the appropriate 1164 * display, if supported. Otherwise, emits a short beep on 1165 * the display just as gdk_display_beep(). 1166 * Since 2.12 1167 */ 1168 public void beep() 1169 { 1170 // void gdk_window_beep (GdkWindow *window); 1171 gdk_window_beep(gdkWindow); 1172 } 1173 1174 /** 1175 * Returns the internal scale factor that maps from window coordiantes 1176 * to the actual device pixels. On traditional systems this is 1, but 1177 * on very high density outputs this can be a higher value (often 2). 1178 * A higher value means that drawing is automatically scaled up to 1179 * a higher resolution, so any code doing drawing will automatically look 1180 * nicer. However, if you are supplying pixel-based data the scale 1181 * value can be used to determine whether to use a pixel resource 1182 * with higher resolution data. 1183 * The scale of a window may change during runtime, if this happens 1184 * a configure event will be sent to the toplevel window. 1185 * Returns: the scale factor Since 3.10 1186 */ 1187 public int getScaleFactor() 1188 { 1189 // gint gdk_window_get_scale_factor (GdkWindow *window); 1190 return gdk_window_get_scale_factor(gdkWindow); 1191 } 1192 1193 /** 1194 * For optimizization purposes, compositing window managers may 1195 * like to not draw obscured regions of windows, or turn off blending 1196 * during for these regions. With RGB windows with no transparency, 1197 * this is just the shape of the window, but with ARGB32 windows, the 1198 * compositor does not know what regions of the window are transparent 1199 * or not. 1200 * This function only works for toplevel windows. 1201 * GTK+ will automatically update this property automatically if 1202 * the window background is opaque, as we know where the opaque regions 1203 * are. If your window background is not opaque, please update this 1204 * property in your "style_updated" handler. 1205 * Params: 1206 * region = a region 1207 * Since 3.10 1208 */ 1209 public void setOpaqueRegion(Region region) 1210 { 1211 // void gdk_window_set_opaque_region (GdkWindow *window, cairo_region_t *region); 1212 gdk_window_set_opaque_region(gdkWindow, (region is null) ? null : region.getRegionStruct()); 1213 } 1214 1215 /** 1216 * Computes the region of a window that potentially can be written 1217 * to by drawing primitives. This region may not take into account 1218 * other factors such as if the window is obscured by other windows, 1219 * but no area outside of this region will be affected by drawing 1220 * primitives. 1221 * Returns: a cairo_region_t. This must be freed with cairo_region_destroy() when you are done. 1222 */ 1223 public Region getClipRegion() 1224 { 1225 // cairo_region_t * gdk_window_get_clip_region (GdkWindow *window); 1226 auto p = gdk_window_get_clip_region(gdkWindow); 1227 1228 if(p is null) 1229 { 1230 return null; 1231 } 1232 1233 return ObjectG.getDObject!(Region)(cast(cairo_region_t*) p); 1234 } 1235 1236 /** 1237 * A convenience wrapper around gdk_window_begin_paint_region() which 1238 * creates a rectangular region for you. See 1239 * gdk_window_begin_paint_region() for details. 1240 * Params: 1241 * rectangle = rectangle you intend to draw to 1242 */ 1243 public void beginPaintRect(ref Rectangle rectangle) 1244 { 1245 // void gdk_window_begin_paint_rect (GdkWindow *window, const GdkRectangle *rectangle); 1246 gdk_window_begin_paint_rect(gdkWindow, &rectangle); 1247 } 1248 1249 /** 1250 * Indicates that you are beginning the process of redrawing region. 1251 * A backing store (offscreen buffer) large enough to contain region 1252 * will be created. The backing store will be initialized with the 1253 * background color or background surface for window. Then, all 1254 * drawing operations performed on window will be diverted to the 1255 * backing store. When you call gdk_window_end_paint(), the backing 1256 * store will be copied to window, making it visible onscreen. Only 1257 * the part of window contained in region will be modified; that is, 1258 * drawing operations are clipped to region. 1259 * The net result of all this is to remove flicker, because the user 1260 * sees the finished product appear all at once when you call 1261 * gdk_window_end_paint(). If you draw to window directly without 1262 * calling gdk_window_begin_paint_region(), the user may see flicker 1263 * as individual drawing operations are performed in sequence. The 1264 * clipping and background-initializing features of 1265 * gdk_window_begin_paint_region() are conveniences for the 1266 * programmer, so you can avoid doing that work yourself. 1267 * When using GTK+, the widget system automatically places calls to 1268 * gdk_window_begin_paint_region() and gdk_window_end_paint() around 1269 * emissions of the expose_event signal. That is, if you're writing an 1270 * expose event handler, you can assume that the exposed area in 1271 * GdkEventExpose has already been cleared to the window background, 1272 * is already set as the clip region, and already has a backing store. 1273 * Therefore in most cases, application code need not call 1274 * gdk_window_begin_paint_region(). (You can disable the automatic 1275 * calls around expose events on a widget-by-widget basis by calling 1276 * gtk_widget_set_double_buffered().) 1277 * If you call this function multiple times before calling the 1278 * matching gdk_window_end_paint(), the backing stores are pushed onto 1279 * a stack. gdk_window_end_paint() copies the topmost backing store 1280 * onscreen, subtracts the topmost region from all other regions in 1281 * the stack, and pops the stack. All drawing operations affect only 1282 * the topmost backing store in the stack. One matching call to 1283 * gdk_window_end_paint() is required for each call to 1284 * gdk_window_begin_paint_region(). 1285 * Params: 1286 * region = region you intend to draw to 1287 */ 1288 public void beginPaintRegion(Region region) 1289 { 1290 // void gdk_window_begin_paint_region (GdkWindow *window, const cairo_region_t *region); 1291 gdk_window_begin_paint_region(gdkWindow, (region is null) ? null : region.getRegionStruct()); 1292 } 1293 1294 /** 1295 * Indicates that the backing store created by the most recent call to 1296 * gdk_window_begin_paint_region() should be copied onscreen and 1297 * deleted, leaving the next-most-recent backing store or no backing 1298 * store at all as the active paint region. See 1299 * gdk_window_begin_paint_region() for full details. It is an error to 1300 * call this function without a matching 1301 * gdk_window_begin_paint_region() first. 1302 */ 1303 public void endPaint() 1304 { 1305 // void gdk_window_end_paint (GdkWindow *window); 1306 gdk_window_end_paint(gdkWindow); 1307 } 1308 1309 /** 1310 * Computes the region of the window that is potentially visible. 1311 * This does not necessarily take into account if the window is 1312 * obscured by other windows, but no area outside of this region 1313 * is visible. 1314 * Returns: a cairo_region_t. This must be freed with cairo_region_destroy() when you are done. 1315 */ 1316 public Region getVisibleRegion() 1317 { 1318 // cairo_region_t * gdk_window_get_visible_region (GdkWindow *window); 1319 auto p = gdk_window_get_visible_region(gdkWindow); 1320 1321 if(p is null) 1322 { 1323 return null; 1324 } 1325 1326 return ObjectG.getDObject!(Region)(cast(cairo_region_t*) p); 1327 } 1328 1329 /** 1330 * Registers an invalidate handler for a specific window. This 1331 * will get called whenever a region in the window or its children 1332 * is invalidated. 1333 * This can be used to record the invalidated region, which is 1334 * useful if you are keeping an offscreen copy of some region 1335 * and want to keep it up to date. You can also modify the 1336 * invalidated region in case you're doing some effect where 1337 * e.g. a child widget appears in multiple places. 1338 * Params: 1339 * handler = a GdkWindowInvalidateHandlerFunc callback function 1340 * Since 3.10 1341 */ 1342 public void setInvalidateHandler(GdkWindowInvalidateHandlerFunc handler) 1343 { 1344 // void gdk_window_set_invalidate_handler (GdkWindow *window, GdkWindowInvalidateHandlerFunc handler); 1345 gdk_window_set_invalidate_handler(gdkWindow, handler); 1346 } 1347 1348 /** 1349 * A convenience wrapper around gdk_window_invalidate_region() which 1350 * invalidates a rectangular region. See 1351 * gdk_window_invalidate_region() for details. 1352 * Params: 1353 * rect = rectangle to invalidate or NULL to invalidate the whole 1354 * window. [allow-none] 1355 * invalidateChildren = whether to also invalidate child windows 1356 */ 1357 public void invalidateRect(Rectangle* rect, int invalidateChildren) 1358 { 1359 // void gdk_window_invalidate_rect (GdkWindow *window, const GdkRectangle *rect, gboolean invalidate_children); 1360 gdk_window_invalidate_rect(gdkWindow, rect, invalidateChildren); 1361 } 1362 1363 /** 1364 * Adds region to the update area for window. The update area is the 1365 * region that needs to be redrawn, or "dirty region." The call 1366 * gdk_window_process_updates() sends one or more expose events to the 1367 * window, which together cover the entire update area. An 1368 * application would normally redraw the contents of window in 1369 * response to those expose events. 1370 * GDK will call gdk_window_process_all_updates() on your behalf 1371 * whenever your program returns to the main loop and becomes idle, so 1372 * normally there's no need to do that manually, you just need to 1373 * invalidate regions that you know should be redrawn. 1374 * The invalidate_children parameter controls whether the region of 1375 * each child window that intersects region will also be invalidated. 1376 * If FALSE, then the update area for child windows will remain 1377 * unaffected. See gdk_window_invalidate_maybe_recurse if you need 1378 * fine grained control over which children are invalidated. 1379 * Params: 1380 * region = a cairo_region_t 1381 * invalidateChildren = TRUE to also invalidate child windows 1382 */ 1383 public void invalidateRegion(Region region, int invalidateChildren) 1384 { 1385 // void gdk_window_invalidate_region (GdkWindow *window, const cairo_region_t *region, gboolean invalidate_children); 1386 gdk_window_invalidate_region(gdkWindow, (region is null) ? null : region.getRegionStruct(), invalidateChildren); 1387 } 1388 1389 /** 1390 * Adds region to the update area for window. The update area is the 1391 * region that needs to be redrawn, or "dirty region." The call 1392 * gdk_window_process_updates() sends one or more expose events to the 1393 * window, which together cover the entire update area. An 1394 * application would normally redraw the contents of window in 1395 * response to those expose events. 1396 * GDK will call gdk_window_process_all_updates() on your behalf 1397 * whenever your program returns to the main loop and becomes idle, so 1398 * normally there's no need to do that manually, you just need to 1399 * invalidate regions that you know should be redrawn. 1400 * The child_func parameter controls whether the region of 1401 * each child window that intersects region will also be invalidated. 1402 * Only children for which child_func returns TRUE will have the area 1403 * invalidated. 1404 * Params: 1405 * region = a cairo_region_t 1406 * childFunc = function to use to decide if to 1407 * recurse to a child, NULL means never recurse. [scope call][allow-none] 1408 * userData = data passed to child_func 1409 */ 1410 public void invalidateMaybeRecurse(Region region, GdkWindowChildFunc childFunc, void* userData) 1411 { 1412 // void gdk_window_invalidate_maybe_recurse (GdkWindow *window, const cairo_region_t *region, GdkWindowChildFunc child_func, gpointer user_data); 1413 gdk_window_invalidate_maybe_recurse(gdkWindow, (region is null) ? null : region.getRegionStruct(), childFunc, userData); 1414 } 1415 1416 /** 1417 * Transfers ownership of the update area from window to the caller 1418 * of the function. That is, after calling this function, window will 1419 * no longer have an invalid/dirty region; the update area is removed 1420 * from window and handed to you. If a window has no update area, 1421 * gdk_window_get_update_area() returns NULL. You are responsible for 1422 * calling cairo_region_destroy() on the returned region if it's non-NULL. 1423 * Returns: the update area for window 1424 */ 1425 public Region getUpdateArea() 1426 { 1427 // cairo_region_t * gdk_window_get_update_area (GdkWindow *window); 1428 auto p = gdk_window_get_update_area(gdkWindow); 1429 1430 if(p is null) 1431 { 1432 return null; 1433 } 1434 1435 return ObjectG.getDObject!(Region)(cast(cairo_region_t*) p); 1436 } 1437 1438 /** 1439 * Temporarily freezes a window such that it won't receive expose 1440 * events. The window will begin receiving expose events again when 1441 * gdk_window_thaw_updates() is called. If gdk_window_freeze_updates() 1442 * has been called more than once, gdk_window_thaw_updates() must be called 1443 * an equal number of times to begin processing exposes. 1444 */ 1445 public void freezeUpdates() 1446 { 1447 // void gdk_window_freeze_updates (GdkWindow *window); 1448 gdk_window_freeze_updates(gdkWindow); 1449 } 1450 1451 /** 1452 * Thaws a window frozen with gdk_window_freeze_updates(). 1453 */ 1454 public void thawUpdates() 1455 { 1456 // void gdk_window_thaw_updates (GdkWindow *window); 1457 gdk_window_thaw_updates(gdkWindow); 1458 } 1459 1460 /** 1461 * Calls gdk_window_process_updates() for all windows (see GdkWindow) 1462 * in the application. 1463 */ 1464 public static void processAllUpdates() 1465 { 1466 // void gdk_window_process_all_updates (void); 1467 gdk_window_process_all_updates(); 1468 } 1469 1470 /** 1471 * Sends one or more expose events to window. The areas in each 1472 * expose event will cover the entire update area for the window (see 1473 * gdk_window_invalidate_region() for details). Normally GDK calls 1474 * gdk_window_process_all_updates() on your behalf, so there's no 1475 * need to call this function unless you want to force expose events 1476 * to be delivered immediately and synchronously (vs. the usual 1477 * case, where GDK delivers them in an idle handler). Occasionally 1478 * this is useful to produce nicer scrolling behavior, for example. 1479 * Params: 1480 * updateChildren = whether to also process updates for child windows 1481 */ 1482 public void processUpdates(int updateChildren) 1483 { 1484 // void gdk_window_process_updates (GdkWindow *window, gboolean update_children); 1485 gdk_window_process_updates(gdkWindow, updateChildren); 1486 } 1487 1488 /** 1489 * With update debugging enabled, calls to 1490 * gdk_window_invalidate_region() clear the invalidated region of the 1491 * screen to a noticeable color, and GDK pauses for a short time 1492 * before sending exposes to windows during 1493 * gdk_window_process_updates(). The net effect is that you can see 1494 * the invalid region for each window and watch redraws as they 1495 * occur. This allows you to diagnose inefficiencies in your application. 1496 * In essence, because the GDK rendering model prevents all flicker, 1497 * if you are redrawing the same region 400 times you may never 1498 * notice, aside from noticing a speed problem. Enabling update 1499 * debugging causes GTK to flicker slowly and noticeably, so you can 1500 * see exactly what's being redrawn when, in what order. 1501 * The --gtk-debug=updates command line option passed to GTK+ programs 1502 * enables this debug option at application startup time. That's 1503 * usually more useful than calling gdk_window_set_debug_updates() 1504 * yourself, though you might want to use this function to enable 1505 * updates sometime after application startup time. 1506 * Params: 1507 * setting = TRUE to turn on update debugging 1508 */ 1509 public static void setDebugUpdates(int setting) 1510 { 1511 // void gdk_window_set_debug_updates (gboolean setting); 1512 gdk_window_set_debug_updates(setting); 1513 } 1514 1515 /** 1516 * Warning 1517 * gdk_window_enable_synchronized_configure has been deprecated since version 3.8 and should not be used in newly-written code. this function is no longer needed 1518 * Does nothing, present only for compatiblity. 1519 * Since 2.6 1520 */ 1521 public void enableSynchronizedConfigure() 1522 { 1523 // void gdk_window_enable_synchronized_configure (GdkWindow *window); 1524 gdk_window_enable_synchronized_configure(gdkWindow); 1525 } 1526 1527 /** 1528 * Warning 1529 * gdk_window_configure_finished has been deprecated since version 3.8 and should not be used in newly-written code. this function is no longer needed 1530 * Does nothing, present only for compatiblity. 1531 * Since 2.6 1532 */ 1533 public void configureFinished() 1534 { 1535 // void gdk_window_configure_finished (GdkWindow *window); 1536 gdk_window_configure_finished(gdkWindow); 1537 } 1538 1539 /** 1540 * Gets the frame clock for the window. The frame clock for a window 1541 * never changes unless the window is reparented to a new toplevel 1542 * window. 1543 * Returns: the frame clock. [transfer none] Since 3.8 1544 */ 1545 public FrameClock getFrameClock() 1546 { 1547 // GdkFrameClock * gdk_window_get_frame_clock (GdkWindow *window); 1548 auto p = gdk_window_get_frame_clock(gdkWindow); 1549 1550 if(p is null) 1551 { 1552 return null; 1553 } 1554 1555 return ObjectG.getDObject!(FrameClock)(cast(GdkFrameClock*) p); 1556 } 1557 1558 /** 1559 * For most purposes this function is deprecated in favor of 1560 * g_object_set_data(). However, for historical reasons GTK+ stores 1561 * the GtkWidget that owns a GdkWindow as user data on the 1562 * GdkWindow. So, custom widget implementations should use 1563 * this function for that. If GTK+ receives an event for a GdkWindow, 1564 * and the user data for the window is non-NULL, GTK+ will assume the 1565 * user data is a GtkWidget, and forward the event to that widget. 1566 * Params: 1567 * userData = user data. [allow-none][type GObject.Object] 1568 */ 1569 public void setUserData(void* userData) 1570 { 1571 // void gdk_window_set_user_data (GdkWindow *window, gpointer user_data); 1572 gdk_window_set_user_data(gdkWindow, userData); 1573 } 1574 1575 /** 1576 * An override redirect window is not under the control of the window manager. 1577 * This means it won't have a titlebar, won't be minimizable, etc. - it will 1578 * be entirely under the control of the application. The window manager 1579 * can't see the override redirect window at all. 1580 * Override redirect should only be used for short-lived temporary 1581 * windows, such as popup menus. GtkMenu uses an override redirect 1582 * window in its implementation, for example. 1583 * Params: 1584 * overrideRedirect = TRUE if window should be override redirect 1585 */ 1586 public void setOverrideRedirect(int overrideRedirect) 1587 { 1588 // void gdk_window_set_override_redirect (GdkWindow *window, gboolean override_redirect); 1589 gdk_window_set_override_redirect(gdkWindow, overrideRedirect); 1590 } 1591 1592 /** 1593 * Setting accept_focus to FALSE hints the desktop environment that the 1594 * window doesn't want to receive input focus. 1595 * On X, it is the responsibility of the window manager to interpret this 1596 * hint. ICCCM-compliant window manager usually respect it. 1597 * Since 2.4 1598 * Params: 1599 * acceptFocus = TRUE if the window should receive input focus 1600 */ 1601 public void setAcceptFocus(int acceptFocus) 1602 { 1603 // void gdk_window_set_accept_focus (GdkWindow *window, gboolean accept_focus); 1604 gdk_window_set_accept_focus(gdkWindow, acceptFocus); 1605 } 1606 1607 /** 1608 * Determines whether or not the desktop environment shuld be hinted that 1609 * the window does not want to receive input focus. 1610 * Since 2.22 1611 * Returns: whether or not the window should receive input focus. 1612 */ 1613 public int getAcceptFocus() 1614 { 1615 // gboolean gdk_window_get_accept_focus (GdkWindow *window); 1616 return gdk_window_get_accept_focus(gdkWindow); 1617 } 1618 1619 /** 1620 * Setting focus_on_map to FALSE hints the desktop environment that the 1621 * window doesn't want to receive input focus when it is mapped. 1622 * focus_on_map should be turned off for windows that aren't triggered 1623 * interactively (such as popups from network activity). 1624 * On X, it is the responsibility of the window manager to interpret 1625 * this hint. Window managers following the freedesktop.org window 1626 * manager extension specification should respect it. 1627 * Since 2.6 1628 * Params: 1629 * focusOnMap = TRUE if the window should receive input focus when mapped 1630 */ 1631 public void setFocusOnMap(int focusOnMap) 1632 { 1633 // void gdk_window_set_focus_on_map (GdkWindow *window, gboolean focus_on_map); 1634 gdk_window_set_focus_on_map(gdkWindow, focusOnMap); 1635 } 1636 1637 /** 1638 * Determines whether or not the desktop environment should be hinted that the 1639 * window does not want to receive input focus when it is mapped. 1640 * Since 2.22 1641 * Returns: whether or not the window wants to receive input focus when it is mapped. 1642 */ 1643 public int getFocusOnMap() 1644 { 1645 // gboolean gdk_window_get_focus_on_map (GdkWindow *window); 1646 return gdk_window_get_focus_on_map(gdkWindow); 1647 } 1648 1649 /** 1650 * Adds an event filter to window, allowing you to intercept events 1651 * before they reach GDK. This is a low-level operation and makes it 1652 * easy to break GDK and/or GTK+, so you have to know what you're 1653 * doing. Pass NULL for window to get all events for all windows, 1654 * instead of events for a specific window. 1655 * If you are interested in X GenericEvents, bear in mind that 1656 * XGetEventData() has been already called on the event, and 1657 * XFreeEventData() must not be called within function. 1658 * Params: 1659 * data = data to pass to filter callback 1660 */ 1661 public void addFilter(GdkFilterFunc funct, void* data) 1662 { 1663 // void gdk_window_add_filter (GdkWindow *window, GdkFilterFunc function, gpointer data); 1664 gdk_window_add_filter(gdkWindow, funct, data); 1665 } 1666 1667 /** 1668 * Remove a filter previously added with gdk_window_add_filter(). 1669 * Params: 1670 * data = user data for previously-added filter function 1671 */ 1672 public void removeFilter(GdkFilterFunc funct, void* data) 1673 { 1674 // void gdk_window_remove_filter (GdkWindow *window, GdkFilterFunc function, gpointer data); 1675 gdk_window_remove_filter(gdkWindow, funct, data); 1676 } 1677 1678 /** 1679 * Makes pixels in window outside shape_region be transparent, 1680 * so that the window may be nonrectangular. 1681 * If shape_region is NULL, the shape will be unset, so the whole 1682 * window will be opaque again. offset_x and offset_y are ignored 1683 * if shape_region is NULL. 1684 * On the X11 platform, this uses an X server extension which is 1685 * widely available on most common platforms, but not available on 1686 * very old X servers, and occasionally the implementation will be 1687 * buggy. On servers without the shape extension, this function 1688 * will do nothing. 1689 * This function works on both toplevel and child windows. 1690 * Params: 1691 * shapeRegion = region of window to be non-transparent. [allow-none] 1692 * offsetX = X position of shape_region in window coordinates 1693 * offsetY = Y position of shape_region in window coordinates 1694 */ 1695 public void shapeCombineRegion(Region shapeRegion, int offsetX, int offsetY) 1696 { 1697 // void gdk_window_shape_combine_region (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); 1698 gdk_window_shape_combine_region(gdkWindow, (shapeRegion is null) ? null : shapeRegion.getRegionStruct(), offsetX, offsetY); 1699 } 1700 1701 /** 1702 * Sets the shape mask of window to the union of shape masks 1703 * for all children of window, ignoring the shape mask of window 1704 * itself. Contrast with gdk_window_merge_child_shapes() which includes 1705 * the shape mask of window in the masks to be merged. 1706 */ 1707 public void setChildShapes() 1708 { 1709 // void gdk_window_set_child_shapes (GdkWindow *window); 1710 gdk_window_set_child_shapes(gdkWindow); 1711 } 1712 1713 /** 1714 * Merges the shape masks for any child windows into the 1715 * shape mask for window. i.e. the union of all masks 1716 * for window and its children will become the new mask 1717 * for window. See gdk_window_shape_combine_region(). 1718 * This function is distinct from gdk_window_set_child_shapes() 1719 * because it includes window's shape mask in the set of shapes to 1720 * be merged. 1721 */ 1722 public void mergeChildShapes() 1723 { 1724 // void gdk_window_merge_child_shapes (GdkWindow *window); 1725 gdk_window_merge_child_shapes(gdkWindow); 1726 } 1727 1728 /** 1729 * Like gdk_window_shape_combine_region(), but the shape applies 1730 * only to event handling. Mouse events which happen while 1731 * the pointer position corresponds to an unset bit in the 1732 * mask will be passed on the window below window. 1733 * An input shape is typically used with RGBA windows. 1734 * The alpha channel of the window defines which pixels are 1735 * invisible and allows for nicely antialiased borders, 1736 * and the input shape controls where the window is 1737 * "clickable". 1738 * On the X11 platform, this requires version 1.1 of the 1739 * shape extension. 1740 * On the Win32 platform, this functionality is not present and the 1741 * function does nothing. 1742 * Since 2.10 1743 * Params: 1744 * shapeRegion = region of window to be non-transparent 1745 * offsetX = X position of shape_region in window coordinates 1746 * offsetY = Y position of shape_region in window coordinates 1747 */ 1748 public void inputShapeCombineRegion(Region shapeRegion, int offsetX, int offsetY) 1749 { 1750 // void gdk_window_input_shape_combine_region (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); 1751 gdk_window_input_shape_combine_region(gdkWindow, (shapeRegion is null) ? null : shapeRegion.getRegionStruct(), offsetX, offsetY); 1752 } 1753 1754 /** 1755 * Sets the input shape mask of window to the union of input shape masks 1756 * for all children of window, ignoring the input shape mask of window 1757 * itself. Contrast with gdk_window_merge_child_input_shapes() which includes 1758 * the input shape mask of window in the masks to be merged. 1759 * Since 2.10 1760 */ 1761 public void setChildInputShapes() 1762 { 1763 // void gdk_window_set_child_input_shapes (GdkWindow *window); 1764 gdk_window_set_child_input_shapes(gdkWindow); 1765 } 1766 1767 /** 1768 * Merges the input shape masks for any child windows into the 1769 * input shape mask for window. i.e. the union of all input masks 1770 * for window and its children will become the new input mask 1771 * for window. See gdk_window_input_shape_combine_region(). 1772 * This function is distinct from gdk_window_set_child_input_shapes() 1773 * because it includes window's input shape mask in the set of 1774 * shapes to be merged. 1775 * Since 2.10 1776 */ 1777 public void mergeChildInputShapes() 1778 { 1779 // void gdk_window_merge_child_input_shapes (GdkWindow *window); 1780 gdk_window_merge_child_input_shapes(gdkWindow); 1781 } 1782 1783 /** 1784 * Set the bit gravity of the given window to static, and flag it so 1785 * all children get static subwindow gravity. This is used if you are 1786 * implementing scary features that involve deep knowledge of the 1787 * windowing system. Don't worry about it unless you have to. 1788 * Params: 1789 * useStatic = TRUE to turn on static gravity 1790 * Returns: TRUE if the server supports static gravity 1791 */ 1792 public int setStaticGravities(int useStatic) 1793 { 1794 // gboolean gdk_window_set_static_gravities (GdkWindow *window, gboolean use_static); 1795 return gdk_window_set_static_gravities(gdkWindow, useStatic); 1796 } 1797 1798 /** 1799 * Sets the title of a toplevel window, to be displayed in the titlebar. 1800 * If you haven't explicitly set the icon name for the window 1801 * (using gdk_window_set_icon_name()), the icon name will be set to 1802 * title as well. title must be in UTF-8 encoding (as with all 1803 * user-readable strings in GDK/GTK+). title may not be NULL. 1804 * Params: 1805 * title = title of window 1806 */ 1807 public void setTitle(string title) 1808 { 1809 // void gdk_window_set_title (GdkWindow *window, const gchar *title); 1810 gdk_window_set_title(gdkWindow, Str.toStringz(title)); 1811 } 1812 1813 /** 1814 * Warning 1815 * gdk_window_set_background has been deprecated since version 3.4 and should not be used in newly-written code. Use gdk_window_set_background_rgba() instead. 1816 * Sets the background color of window. (However, when using GTK+, 1817 * set the background of a widget with gtk_widget_modify_bg() - if 1818 * you're an application - or gtk_style_set_background() - if you're 1819 * implementing a custom widget.) 1820 * See also gdk_window_set_background_pattern(). 1821 * Params: 1822 * color = a GdkColor 1823 */ 1824 public void setBackground(Color color) 1825 { 1826 // void gdk_window_set_background (GdkWindow *window, const GdkColor *color); 1827 gdk_window_set_background(gdkWindow, (color is null) ? null : color.getColorStruct()); 1828 } 1829 1830 /** 1831 * Sets the background color of window. 1832 * See also gdk_window_set_background_pattern(). 1833 * Params: 1834 * rgba = a GdkRGBA color 1835 */ 1836 public void setBackgroundRgba(RGBA rgba) 1837 { 1838 // void gdk_window_set_background_rgba (GdkWindow *window, const GdkRGBA *rgba); 1839 gdk_window_set_background_rgba(gdkWindow, (rgba is null) ? null : rgba.getRGBAStruct()); 1840 } 1841 1842 /** 1843 * Sets the background of window. 1844 * A background of NULL means that the window will inherit its 1845 * background form its parent window. 1846 * The windowing system will normally fill a window with its background 1847 * when the window is obscured then exposed. 1848 * Params: 1849 * pattern = a pattern to use, or NULL. [allow-none] 1850 */ 1851 public void setBackgroundPattern(Pattern pattern) 1852 { 1853 // void gdk_window_set_background_pattern (GdkWindow *window, cairo_pattern_t *pattern); 1854 gdk_window_set_background_pattern(gdkWindow, (pattern is null) ? null : pattern.getPatternStruct()); 1855 } 1856 1857 /** 1858 * Gets the pattern used to clear the background on window. If window 1859 * does not have its own background and reuses the parent's, NULL is 1860 * returned and you'll have to query it yourself. 1861 * Since 2.22 1862 * Returns: The pattern to use for the background or NULL to use the parent's background. [transfer none] 1863 */ 1864 public Pattern getBackgroundPattern() 1865 { 1866 // cairo_pattern_t * gdk_window_get_background_pattern (GdkWindow *window); 1867 auto p = gdk_window_get_background_pattern(gdkWindow); 1868 1869 if(p is null) 1870 { 1871 return null; 1872 } 1873 1874 return ObjectG.getDObject!(Pattern)(cast(cairo_pattern_t*) p); 1875 } 1876 1877 /** 1878 * Sets the default mouse pointer for a GdkWindow. Use gdk_cursor_new_for_display() 1879 * or gdk_cursor_new_from_pixbuf() to create the cursor. To make the cursor 1880 * invisible, use GDK_BLANK_CURSOR. Passing NULL for the cursor argument 1881 * to gdk_window_set_cursor() means that window will use the cursor of its 1882 * parent window. Most windows should use this default. 1883 * Params: 1884 * cursor = a cursor. [allow-none] 1885 */ 1886 public void setCursor(Cursor cursor) 1887 { 1888 // void gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor); 1889 gdk_window_set_cursor(gdkWindow, (cursor is null) ? null : cursor.getCursorStruct()); 1890 } 1891 1892 /** 1893 * Retrieves a GdkCursor pointer for the cursor currently set on the 1894 * specified GdkWindow, or NULL. If the return value is NULL then 1895 * there is no custom cursor set on the specified window, and it is 1896 * using the cursor for its parent window. 1897 * Since 2.18 1898 * Returns: a GdkCursor, or NULL. The returned object is owned by the GdkWindow and should not be unreferenced directly. Use gdk_window_set_cursor() to unset the cursor of the window. [transfer none] 1899 */ 1900 public Cursor getCursor() 1901 { 1902 // GdkCursor * gdk_window_get_cursor (GdkWindow *window); 1903 auto p = gdk_window_get_cursor(gdkWindow); 1904 1905 if(p is null) 1906 { 1907 return null; 1908 } 1909 1910 return ObjectG.getDObject!(Cursor)(cast(GdkCursor*) p); 1911 } 1912 1913 /** 1914 * Retrieves the user data for window, which is normally the widget 1915 * that window belongs to. See gdk_window_set_user_data(). 1916 * Params: 1917 * data = return location for user data. [out] 1918 */ 1919 public void getUserData(void** data) 1920 { 1921 // void gdk_window_get_user_data (GdkWindow *window, gpointer *data); 1922 gdk_window_get_user_data(gdkWindow, data); 1923 } 1924 1925 /** 1926 * Any of the return location arguments to this function may be NULL, 1927 * if you aren't interested in getting the value of that field. 1928 * The X and Y coordinates returned are relative to the parent window 1929 * of window, which for toplevels usually means relative to the 1930 * window decorations (titlebar, etc.) rather than relative to the 1931 * root window (screen-size background window). 1932 * On the X11 platform, the geometry is obtained from the X server, 1933 * so reflects the latest position of window; this may be out-of-sync 1934 * with the position of window delivered in the most-recently-processed 1935 * GdkEventConfigure. gdk_window_get_position() in contrast gets the 1936 * position from the most recent configure event. 1937 * Note 1938 * If window is not a toplevel, it is much better 1939 * to call gdk_window_get_position(), gdk_window_get_width() and 1940 * gdk_window_get_height() instead, because it avoids the roundtrip to 1941 * the X server and because these functions support the full 32-bit 1942 * coordinate space, whereas gdk_window_get_geometry() is restricted to 1943 * the 16-bit coordinates of X11. 1944 * Params: 1945 * x = return location for X coordinate of window (relative to its parent). [out][allow-none] 1946 * y = return location for Y coordinate of window (relative to its parent). [out][allow-none] 1947 * width = return location for width of window. [out][allow-none] 1948 * height = return location for height of window. [out][allow-none] 1949 */ 1950 public void getGeometry(out int x, out int y, out int width, out int height) 1951 { 1952 // void gdk_window_get_geometry (GdkWindow *window, gint *x, gint *y, gint *width, gint *height); 1953 gdk_window_get_geometry(gdkWindow, &x, &y, &width, &height); 1954 } 1955 1956 /** 1957 * Sets the geometry hints for window. Hints flagged in geom_mask 1958 * are set, hints not flagged in geom_mask are unset. 1959 * To unset all hints, use a geom_mask of 0 and a geometry of NULL. 1960 * This function provides hints to the windowing system about 1961 * acceptable sizes for a toplevel window. The purpose of 1962 * this is to constrain user resizing, but the windowing system 1963 * will typically (but is not required to) also constrain the 1964 * current size of the window to the provided values and 1965 * constrain programatic resizing via gdk_window_resize() or 1966 * gdk_window_move_resize(). 1967 * Note that on X11, this effect has no effect on windows 1968 * of type GDK_WINDOW_TEMP or windows where override redirect 1969 * has been turned on via gdk_window_set_override_redirect() 1970 * since these windows are not resizable by the user. 1971 * Since you can't count on the windowing system doing the 1972 * constraints for programmatic resizes, you should generally 1973 * call gdk_window_constrain_size() yourself to determine 1974 * appropriate sizes. 1975 * Params: 1976 * geometry = geometry hints 1977 * geomMask = bitmask indicating fields of geometry to pay attention to 1978 */ 1979 public void setGeometryHints(ref GdkGeometry geometry, GdkWindowHints geomMask) 1980 { 1981 // void gdk_window_set_geometry_hints (GdkWindow *window, const GdkGeometry *geometry, GdkWindowHints geom_mask); 1982 gdk_window_set_geometry_hints(gdkWindow, &geometry, geomMask); 1983 } 1984 1985 /** 1986 * Returns the width of the given window. 1987 * On the X11 platform the returned size is the size reported in the 1988 * most-recently-processed configure event, rather than the current 1989 * size on the X server. 1990 * Since 2.24 1991 * Returns: The width of window 1992 */ 1993 public int getWidth() 1994 { 1995 // int gdk_window_get_width (GdkWindow *window); 1996 return gdk_window_get_width(gdkWindow); 1997 } 1998 1999 /** 2000 * Returns the height of the given window. 2001 * On the X11 platform the returned size is the size reported in the 2002 * most-recently-processed configure event, rather than the current 2003 * size on the X server. 2004 * Since 2.24 2005 * Returns: The height of window 2006 */ 2007 public int getHeight() 2008 { 2009 // int gdk_window_get_height (GdkWindow *window); 2010 return gdk_window_get_height(gdkWindow); 2011 } 2012 2013 /** 2014 * Sets a list of icons for the window. One of these will be used 2015 * to represent the window when it has been iconified. The icon is 2016 * usually shown in an icon box or some sort of task bar. Which icon 2017 * size is shown depends on the window manager. The window manager 2018 * can scale the icon but setting several size icons can give better 2019 * image quality since the window manager may only need to scale the 2020 * icon by a small amount or not at all. 2021 * Params: 2022 * pixbufs = A list of pixbufs, of different sizes. [transfer none][element-type GdkPixbuf] 2023 */ 2024 public void setIconList(ListG pixbufs) 2025 { 2026 // void gdk_window_set_icon_list (GdkWindow *window, GList *pixbufs); 2027 gdk_window_set_icon_list(gdkWindow, (pixbufs is null) ? null : pixbufs.getListGStruct()); 2028 } 2029 2030 /** 2031 * The application can use this hint to tell the window manager 2032 * that a certain window has modal behaviour. The window manager 2033 * can use this information to handle modal windows in a special 2034 * way. 2035 * You should only use this on windows for which you have 2036 * previously called gdk_window_set_transient_for() 2037 * Params: 2038 * modal = TRUE if the window is modal, FALSE otherwise. 2039 */ 2040 public void setModalHint(int modal) 2041 { 2042 // void gdk_window_set_modal_hint (GdkWindow *window, gboolean modal); 2043 gdk_window_set_modal_hint(gdkWindow, modal); 2044 } 2045 2046 /** 2047 * Determines whether or not the window manager is hinted that window 2048 * has modal behaviour. 2049 * Since 2.22 2050 * Returns: whether or not the window has the modal hint set. 2051 */ 2052 public int getModalHint() 2053 { 2054 // gboolean gdk_window_get_modal_hint (GdkWindow *window); 2055 return gdk_window_get_modal_hint(gdkWindow); 2056 } 2057 2058 /** 2059 * The application can use this call to provide a hint to the window 2060 * manager about the functionality of a window. The window manager 2061 * can use this information when determining the decoration and behaviour 2062 * of the window. 2063 * The hint must be set before the window is mapped. 2064 * Params: 2065 * hint = A hint of the function this window will have 2066 */ 2067 public void setTypeHint(GdkWindowTypeHint hint) 2068 { 2069 // void gdk_window_set_type_hint (GdkWindow *window, GdkWindowTypeHint hint); 2070 gdk_window_set_type_hint(gdkWindow, hint); 2071 } 2072 2073 /** 2074 * This function returns the type hint set for a window. 2075 * Since 2.10 2076 * Returns: The type hint set for window 2077 */ 2078 public GdkWindowTypeHint getTypeHint() 2079 { 2080 // GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window); 2081 return gdk_window_get_type_hint(gdkWindow); 2082 } 2083 2084 /** 2085 * Toggles whether a window should appear in a task list or window 2086 * list. If a window's semantic type as specified with 2087 * gdk_window_set_type_hint() already fully describes the window, this 2088 * function should not be called in addition, 2089 * instead you should allow the window to be treated according to 2090 * standard policy for its semantic type. 2091 * Since 2.2 2092 * Params: 2093 * skipsTaskbar = TRUE to skip the taskbar 2094 */ 2095 public void setSkipTaskbarHint(int skipsTaskbar) 2096 { 2097 // void gdk_window_set_skip_taskbar_hint (GdkWindow *window, gboolean skips_taskbar); 2098 gdk_window_set_skip_taskbar_hint(gdkWindow, skipsTaskbar); 2099 } 2100 2101 /** 2102 * Toggles whether a window should appear in a pager (workspace 2103 * switcher, or other desktop utility program that displays a small 2104 * thumbnail representation of the windows on the desktop). If a 2105 * window's semantic type as specified with gdk_window_set_type_hint() 2106 * already fully describes the window, this function should 2107 * not be called in addition, instead you should 2108 * allow the window to be treated according to standard policy for 2109 * its semantic type. 2110 * Since 2.2 2111 * Params: 2112 * skipsPager = TRUE to skip the pager 2113 */ 2114 public void setSkipPagerHint(int skipsPager) 2115 { 2116 // void gdk_window_set_skip_pager_hint (GdkWindow *window, gboolean skips_pager); 2117 gdk_window_set_skip_pager_hint(gdkWindow, skipsPager); 2118 } 2119 2120 /** 2121 * Toggles whether a window needs the user's 2122 * urgent attention. 2123 * Since 2.8 2124 * Params: 2125 * urgent = TRUE if the window is urgent 2126 */ 2127 public void setUrgencyHint(int urgent) 2128 { 2129 // void gdk_window_set_urgency_hint (GdkWindow *window, gboolean urgent); 2130 gdk_window_set_urgency_hint(gdkWindow, urgent); 2131 } 2132 2133 /** 2134 * Obtains the position of the window as reported in the 2135 * most-recently-processed GdkEventConfigure. Contrast with 2136 * gdk_window_get_geometry() which queries the X server for the 2137 * current window position, regardless of which events have been 2138 * received or processed. 2139 * The position coordinates are relative to the window's parent window. 2140 * Params: 2141 * x = X coordinate of window. [out][allow-none] 2142 * y = Y coordinate of window. [out][allow-none] 2143 */ 2144 public void getPosition(out int x, out int y) 2145 { 2146 // void gdk_window_get_position (GdkWindow *window, gint *x, gint *y); 2147 gdk_window_get_position(gdkWindow, &x, &y); 2148 } 2149 2150 /** 2151 * Obtains the top-left corner of the window manager frame in root 2152 * window coordinates. 2153 * Params: 2154 * x = return location for X position of window frame. [out] 2155 * y = return location for Y position of window frame. [out] 2156 */ 2157 public void getRootOrigin(out int x, out int y) 2158 { 2159 // void gdk_window_get_root_origin (GdkWindow *window, gint *x, gint *y); 2160 gdk_window_get_root_origin(gdkWindow, &x, &y); 2161 } 2162 2163 /** 2164 * Obtains the bounding box of the window, including window manager 2165 * titlebar/borders if any. The frame position is given in root window 2166 * coordinates. To get the position of the window itself (rather than 2167 * the frame) in root window coordinates, use gdk_window_get_origin(). 2168 * Params: 2169 * rect = rectangle to fill with bounding box of the window frame. [out] 2170 */ 2171 public void getFrameExtents(out Rectangle rect) 2172 { 2173 // void gdk_window_get_frame_extents (GdkWindow *window, GdkRectangle *rect); 2174 gdk_window_get_frame_extents(gdkWindow, &rect); 2175 } 2176 2177 /** 2178 * Obtains the position of a window in root window coordinates. 2179 * (Compare with gdk_window_get_position() and 2180 * gdk_window_get_geometry() which return the position of a window 2181 * relative to its parent window.) 2182 * Params: 2183 * x = return location for X coordinate. [out][allow-none] 2184 * y = return location for Y coordinate. [out][allow-none] 2185 * Returns: not meaningful, ignore 2186 */ 2187 public int getOrigin(out int x, out int y) 2188 { 2189 // gint gdk_window_get_origin (GdkWindow *window, gint *x, gint *y); 2190 return gdk_window_get_origin(gdkWindow, &x, &y); 2191 } 2192 2193 /** 2194 * Obtains the position of a window position in root 2195 * window coordinates. This is similar to 2196 * gdk_window_get_origin() but allows you go pass 2197 * in any position in the window, not just the origin. 2198 * Since 2.18 2199 * Params: 2200 * x = X coordinate in window 2201 * y = Y coordinate in window 2202 * rootX = return location for X coordinate. [out] 2203 * rootY = return location for Y coordinate. [out] 2204 */ 2205 public void getRootCoords(int x, int y, out int rootX, out int rootY) 2206 { 2207 // void gdk_window_get_root_coords (GdkWindow *window, gint x, gint y, gint *root_x, gint *root_y); 2208 gdk_window_get_root_coords(gdkWindow, x, y, &rootX, &rootY); 2209 } 2210 2211 /** 2212 * Warning 2213 * gdk_window_get_pointer has been deprecated since version 3.0 and should not be used in newly-written code. Use gdk_window_get_device_position() instead. 2214 * Obtains the current pointer position and modifier state. 2215 * The position is given in coordinates relative to the upper left 2216 * corner of window. 2217 * Params: 2218 * x = return location for X coordinate of pointer or NULL to not 2219 * return the X coordinate. [out][allow-none] 2220 * y = return location for Y coordinate of pointer or NULL to not 2221 * return the Y coordinate. [out][allow-none] 2222 * mask = return location for modifier mask or NULL to not return the 2223 * modifier mask. [out][allow-none] 2224 * Returns: the window containing the pointer (as with gdk_window_at_pointer()), or NULL if the window containing the pointer isn't known to GDK. [transfer none] 2225 */ 2226 public Window getPointer(out int x, out int y, out GdkModifierType mask) 2227 { 2228 // GdkWindow * gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask); 2229 auto p = gdk_window_get_pointer(gdkWindow, &x, &y, &mask); 2230 2231 if(p is null) 2232 { 2233 return null; 2234 } 2235 2236 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2237 } 2238 2239 /** 2240 * Obtains the current device position and modifier state. 2241 * The position is given in coordinates relative to the upper left 2242 * corner of window. 2243 * Use gdk_window_get_device_position_double() if you need subpixel precision. 2244 * Params: 2245 * device = pointer GdkDevice to query to. 2246 * x = return location for the X coordinate of device, or NULL. [out][allow-none] 2247 * y = return location for the Y coordinate of device, or NULL. [out][allow-none] 2248 * mask = return location for the modifier mask, or NULL. [out][allow-none] 2249 * Returns: The window underneath device (as with gdk_device_get_window_at_position()), or NULL if the window is not known to GDK. [transfer none] Since 3.0 2250 */ 2251 public Window getDevicePosition(Device device, out int x, out int y, out GdkModifierType mask) 2252 { 2253 // GdkWindow * gdk_window_get_device_position (GdkWindow *window, GdkDevice *device, gint *x, gint *y, GdkModifierType *mask); 2254 auto p = gdk_window_get_device_position(gdkWindow, (device is null) ? null : device.getDeviceStruct(), &x, &y, &mask); 2255 2256 if(p is null) 2257 { 2258 return null; 2259 } 2260 2261 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2262 } 2263 2264 /** 2265 * Obtains the current device position in doubles and modifier state. 2266 * The position is given in coordinates relative to the upper left 2267 * corner of window. 2268 * Params: 2269 * device = pointer GdkDevice to query to. 2270 * x = return location for the X coordinate of device, or NULL. [out][allow-none] 2271 * y = return location for the Y coordinate of device, or NULL. [out][allow-none] 2272 * mask = return location for the modifier mask, or NULL. [out][allow-none] 2273 * Returns: The window underneath device (as with gdk_device_get_window_at_position()), or NULL if the window is not known to GDK. [transfer none] Since 3.10 2274 */ 2275 public Window getDevicePositionDouble(Device device, out double x, out double y, out GdkModifierType mask) 2276 { 2277 // GdkWindow * gdk_window_get_device_position_double (GdkWindow *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask); 2278 auto p = gdk_window_get_device_position_double(gdkWindow, (device is null) ? null : device.getDeviceStruct(), &x, &y, &mask); 2279 2280 if(p is null) 2281 { 2282 return null; 2283 } 2284 2285 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2286 } 2287 2288 /** 2289 * Obtains the parent of window, as known to GDK. Does not query the 2290 * X server; thus this returns the parent as passed to gdk_window_new(), 2291 * not the actual parent. This should never matter unless you're using 2292 * Xlib calls mixed with GDK calls on the X11 platform. It may also 2293 * matter for toplevel windows, because the window manager may choose 2294 * to reparent them. 2295 * Note that you should use gdk_window_get_effective_parent() when 2296 * writing generic code that walks up a window hierarchy, because 2297 * gdk_window_get_parent() will most likely not do what you expect if 2298 * there are offscreen windows in the hierarchy. 2299 * Returns: parent of window. [transfer none] 2300 */ 2301 public Window getParent() 2302 { 2303 // GdkWindow * gdk_window_get_parent (GdkWindow *window); 2304 auto p = gdk_window_get_parent(gdkWindow); 2305 2306 if(p is null) 2307 { 2308 return null; 2309 } 2310 2311 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2312 } 2313 2314 /** 2315 * Gets the toplevel window that's an ancestor of window. 2316 * Any window type but GDK_WINDOW_CHILD is considered a 2317 * toplevel window, as is a GDK_WINDOW_CHILD window that 2318 * has a root window as parent. 2319 * Note that you should use gdk_window_get_effective_toplevel() when 2320 * you want to get to a window's toplevel as seen on screen, because 2321 * gdk_window_get_toplevel() will most likely not do what you expect 2322 * if there are offscreen windows in the hierarchy. 2323 * Returns: the toplevel window containing window. [transfer none] 2324 */ 2325 public Window getToplevel() 2326 { 2327 // GdkWindow * gdk_window_get_toplevel (GdkWindow *window); 2328 auto p = gdk_window_get_toplevel(gdkWindow); 2329 2330 if(p is null) 2331 { 2332 return null; 2333 } 2334 2335 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2336 } 2337 2338 /** 2339 * Gets the list of children of window known to GDK. 2340 * This function only returns children created via GDK, 2341 * so for example it's useless when used with the root window; 2342 * it only returns windows an application created itself. 2343 * The returned list must be freed, but the elements in the 2344 * list need not be. 2345 * Returns: list of child windows inside window. [transfer container][element-type GdkWindow] 2346 */ 2347 public ListG getChildren() 2348 { 2349 // GList * gdk_window_get_children (GdkWindow *window); 2350 auto p = gdk_window_get_children(gdkWindow); 2351 2352 if(p is null) 2353 { 2354 return null; 2355 } 2356 2357 return ObjectG.getDObject!(ListG)(cast(GList*) p); 2358 } 2359 2360 /** 2361 * Gets the list of children of window known to GDK with a 2362 * particular user_data set on it. 2363 * The returned list must be freed, but the elements in the 2364 * list need not be. 2365 * The list is returned in (relative) stacking order, i.e. the 2366 * lowest window is first. 2367 * Params: 2368 * userData = user data to look for 2369 * Returns: list of child windows inside window. [transfer container][element-type GdkWindow] Since 3.10 2370 */ 2371 public ListG getChildrenWithUserData(void* userData) 2372 { 2373 // GList * gdk_window_get_children_with_user_data (GdkWindow *window, gpointer user_data); 2374 auto p = gdk_window_get_children_with_user_data(gdkWindow, userData); 2375 2376 if(p is null) 2377 { 2378 return null; 2379 } 2380 2381 return ObjectG.getDObject!(ListG)(cast(GList*) p); 2382 } 2383 2384 /** 2385 * Like gdk_window_get_children(), but does not copy the list of 2386 * children, so the list does not need to be freed. 2387 * Returns: a reference to the list of child windows in window. [transfer none][element-type GdkWindow] 2388 */ 2389 public ListG peekChildren() 2390 { 2391 // GList * gdk_window_peek_children (GdkWindow *window); 2392 auto p = gdk_window_peek_children(gdkWindow); 2393 2394 if(p is null) 2395 { 2396 return null; 2397 } 2398 2399 return ObjectG.getDObject!(ListG)(cast(GList*) p); 2400 } 2401 2402 /** 2403 * Gets the event mask for window for all master input devices. See 2404 * gdk_window_set_events(). 2405 * Returns: event mask for window 2406 */ 2407 public GdkEventMask getEvents() 2408 { 2409 // GdkEventMask gdk_window_get_events (GdkWindow *window); 2410 return gdk_window_get_events(gdkWindow); 2411 } 2412 2413 /** 2414 * The event mask for a window determines which events will be reported 2415 * for that window from all master input devices. For example, an event mask 2416 * including GDK_BUTTON_PRESS_MASK means the window should report button 2417 * press events. The event mask is the bitwise OR of values from the 2418 * GdkEventMask enumeration. 2419 * Params: 2420 * eventMask = event mask for window 2421 */ 2422 public void setEvents(GdkEventMask eventMask) 2423 { 2424 // void gdk_window_set_events (GdkWindow *window, GdkEventMask event_mask); 2425 gdk_window_set_events(gdkWindow, eventMask); 2426 } 2427 2428 /** 2429 * Windows may have a name used while minimized, distinct from the 2430 * name they display in their titlebar. Most of the time this is a bad 2431 * idea from a user interface standpoint. But you can set such a name 2432 * with this function, if you like. 2433 * After calling this with a non-NULL name, calls to gdk_window_set_title() 2434 * will not update the icon title. 2435 * Using NULL for name unsets the icon title; further calls to 2436 * gdk_window_set_title() will again update the icon title as well. 2437 * Params: 2438 * name = name of window while iconified (minimized). [allow-none] 2439 */ 2440 public void setIconName(string name) 2441 { 2442 // void gdk_window_set_icon_name (GdkWindow *window, const gchar *name); 2443 gdk_window_set_icon_name(gdkWindow, Str.toStringz(name)); 2444 } 2445 2446 /** 2447 * Indicates to the window manager that window is a transient dialog 2448 * associated with the application window parent. This allows the 2449 * window manager to do things like center window on parent and 2450 * keep window above parent. 2451 * See gtk_window_set_transient_for() if you're using GtkWindow or 2452 * GtkDialog. 2453 * Params: 2454 * parent = another toplevel GdkWindow 2455 */ 2456 public void setTransientFor(Window parent) 2457 { 2458 // void gdk_window_set_transient_for (GdkWindow *window, GdkWindow *parent); 2459 gdk_window_set_transient_for(gdkWindow, (parent is null) ? null : parent.getWindowStruct()); 2460 } 2461 2462 /** 2463 * When using GTK+, typically you should use gtk_window_set_role() instead 2464 * of this low-level function. 2465 * The window manager and session manager use a window's role to 2466 * distinguish it from other kinds of window in the same application. 2467 * When an application is restarted after being saved in a previous 2468 * session, all windows with the same title and role are treated as 2469 * interchangeable. So if you have two windows with the same title 2470 * that should be distinguished for session management purposes, you 2471 * should set the role on those windows. It doesn't matter what string 2472 * you use for the role, as long as you have a different role for each 2473 * non-interchangeable kind of window. 2474 * Params: 2475 * role = a string indicating its role 2476 */ 2477 public void setRole(string role) 2478 { 2479 // void gdk_window_set_role (GdkWindow *window, const gchar *role); 2480 gdk_window_set_role(gdkWindow, Str.toStringz(role)); 2481 } 2482 2483 /** 2484 * When using GTK+, typically you should use gtk_window_set_startup_id() 2485 * instead of this low-level function. 2486 * Since 2.12 2487 * Params: 2488 * startupId = a string with startup-notification identifier 2489 */ 2490 public void setStartupId(string startupId) 2491 { 2492 // void gdk_window_set_startup_id (GdkWindow *window, const gchar *startup_id); 2493 gdk_window_set_startup_id(gdkWindow, Str.toStringz(startupId)); 2494 } 2495 2496 /** 2497 * Sets the group leader window for window. By default, 2498 * GDK sets the group leader for all toplevel windows 2499 * to a global window implicitly created by GDK. With this function 2500 * you can override this default. 2501 * The group leader window allows the window manager to distinguish 2502 * all windows that belong to a single application. It may for example 2503 * allow users to minimize/unminimize all windows belonging to an 2504 * application at once. You should only set a non-default group window 2505 * if your application pretends to be multiple applications. 2506 * Params: 2507 * leader = group leader window, or NULL to restore the default group leader window. [allow-none] 2508 */ 2509 public void setGroup(Window leader) 2510 { 2511 // void gdk_window_set_group (GdkWindow *window, GdkWindow *leader); 2512 gdk_window_set_group(gdkWindow, (leader is null) ? null : leader.getWindowStruct()); 2513 } 2514 2515 /** 2516 * Returns the group leader window for window. See gdk_window_set_group(). 2517 * Since 2.4 2518 * Returns: the group leader window for window. [transfer none] 2519 */ 2520 public Window getGroup() 2521 { 2522 // GdkWindow * gdk_window_get_group (GdkWindow *window); 2523 auto p = gdk_window_get_group(gdkWindow); 2524 2525 if(p is null) 2526 { 2527 return null; 2528 } 2529 2530 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2531 } 2532 2533 /** 2534 * "Decorations" are the features the window manager adds to a toplevel GdkWindow. 2535 * This function sets the traditional Motif window manager hints that tell the 2536 * window manager which decorations you would like your window to have. 2537 * Usually you should use gtk_window_set_decorated() on a GtkWindow instead of 2538 * using the GDK function directly. 2539 * The decorations argument is the logical OR of the fields in 2540 * the GdkWMDecoration enumeration. If GDK_DECOR_ALL is included in the 2541 * mask, the other bits indicate which decorations should be turned off. 2542 * If GDK_DECOR_ALL is not included, then the other bits indicate 2543 * which decorations should be turned on. 2544 * Most window managers honor a decorations hint of 0 to disable all decorations, 2545 * but very few honor all possible combinations of bits. 2546 * Params: 2547 * decorations = decoration hint mask 2548 */ 2549 public void setDecorations(GdkWMDecoration decorations) 2550 { 2551 // void gdk_window_set_decorations (GdkWindow *window, GdkWMDecoration decorations); 2552 gdk_window_set_decorations(gdkWindow, decorations); 2553 } 2554 2555 /** 2556 * Returns the decorations set on the GdkWindow with 2557 * gdk_window_set_decorations(). 2558 * Params: 2559 * decorations = The window decorations will be written here. [out] 2560 * Returns: TRUE if the window has decorations set, FALSE otherwise. 2561 */ 2562 public int getDecorations(out GdkWMDecoration decorations) 2563 { 2564 // gboolean gdk_window_get_decorations (GdkWindow *window, GdkWMDecoration *decorations); 2565 return gdk_window_get_decorations(gdkWindow, &decorations); 2566 } 2567 2568 /** 2569 * Sets hints about the window management functions to make available 2570 * via buttons on the window frame. 2571 * On the X backend, this function sets the traditional Motif window 2572 * manager hint for this purpose. However, few window managers do 2573 * anything reliable or interesting with this hint. Many ignore it 2574 * entirely. 2575 * The functions argument is the logical OR of values from the 2576 * GdkWMFunction enumeration. If the bitmask includes GDK_FUNC_ALL, 2577 * then the other bits indicate which functions to disable; if 2578 * it doesn't include GDK_FUNC_ALL, it indicates which functions to 2579 * enable. 2580 * Params: 2581 * functions = bitmask of operations to allow on window 2582 */ 2583 public void setFunctions(GdkWMFunction functions) 2584 { 2585 // void gdk_window_set_functions (GdkWindow *window, GdkWMFunction functions); 2586 gdk_window_set_functions(gdkWindow, functions); 2587 } 2588 2589 /** 2590 * Obtains the root window (parent all other windows are inside) 2591 * for the default display and screen. 2592 * Returns: the default root window. [transfer none] 2593 */ 2594 public static Window getDefaultRootWindow() 2595 { 2596 // GdkWindow * gdk_get_default_root_window (void); 2597 auto p = gdk_get_default_root_window(); 2598 2599 if(p is null) 2600 { 2601 return null; 2602 } 2603 2604 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2605 } 2606 2607 /** 2608 * Returns TRUE if the window is aware of the existence of multiple 2609 * devices. 2610 * Returns: TRUE if the window handles multidevice features. Since 3.0 2611 */ 2612 public int getSupportMultidevice() 2613 { 2614 // gboolean gdk_window_get_support_multidevice (GdkWindow *window); 2615 return gdk_window_get_support_multidevice(gdkWindow); 2616 } 2617 2618 /** 2619 * This function will enable multidevice features in window. 2620 * Multidevice aware windows will need to handle properly multiple, 2621 * per device enter/leave events, device grabs and grab ownerships. 2622 * Params: 2623 * supportMultidevice = TRUE to enable multidevice support in window. 2624 * Since 3.0 2625 */ 2626 public void setSupportMultidevice(int supportMultidevice) 2627 { 2628 // void gdk_window_set_support_multidevice (GdkWindow *window, gboolean support_multidevice); 2629 gdk_window_set_support_multidevice(gdkWindow, supportMultidevice); 2630 } 2631 2632 /** 2633 * Retrieves a GdkCursor pointer for the device currently set on the 2634 * specified GdkWindow, or NULL. If the return value is NULL then 2635 * there is no custom cursor set on the specified window, and it is 2636 * using the cursor for its parent window. 2637 * Params: 2638 * device = a master, pointer GdkDevice. 2639 * Returns: a GdkCursor, or NULL. The returned object is owned by the GdkWindow and should not be unreferenced directly. Use gdk_window_set_cursor() to unset the cursor of the window. [transfer none] Since 3.0 2640 */ 2641 public Cursor getDeviceCursor(Device device) 2642 { 2643 // GdkCursor * gdk_window_get_device_cursor (GdkWindow *window, GdkDevice *device); 2644 auto p = gdk_window_get_device_cursor(gdkWindow, (device is null) ? null : device.getDeviceStruct()); 2645 2646 if(p is null) 2647 { 2648 return null; 2649 } 2650 2651 return ObjectG.getDObject!(Cursor)(cast(GdkCursor*) p); 2652 } 2653 2654 /** 2655 * Sets a specific GdkCursor for a given device when it gets inside window. 2656 * Use gdk_cursor_new_for_display() or gdk_cursor_new_from_pixbuf() to create 2657 * the cursor. To make the cursor invisible, use GDK_BLANK_CURSOR. Passing 2658 * NULL for the cursor argument to gdk_window_set_cursor() means that 2659 * window will use the cursor of its parent window. Most windows should 2660 * use this default. 2661 * Params: 2662 * device = a master, pointer GdkDevice 2663 * cursor = a GdkCursor 2664 * Since 3.0 2665 */ 2666 public void setDeviceCursor(Device device, Cursor cursor) 2667 { 2668 // void gdk_window_set_device_cursor (GdkWindow *window, GdkDevice *device, GdkCursor *cursor); 2669 gdk_window_set_device_cursor(gdkWindow, (device is null) ? null : device.getDeviceStruct(), (cursor is null) ? null : cursor.getCursorStruct()); 2670 } 2671 2672 /** 2673 * Returns the event mask for window corresponding to an specific device. 2674 * Params: 2675 * device = a GdkDevice. 2676 * Returns: device event mask for window Since 3.0 2677 */ 2678 public GdkEventMask getDeviceEvents(Device device) 2679 { 2680 // GdkEventMask gdk_window_get_device_events (GdkWindow *window, GdkDevice *device); 2681 return gdk_window_get_device_events(gdkWindow, (device is null) ? null : device.getDeviceStruct()); 2682 } 2683 2684 /** 2685 * Sets the event mask for a given device (Normally a floating device, not 2686 * attached to any visible pointer) to window. For example, an event mask 2687 * including GDK_BUTTON_PRESS_MASK means the window should report button 2688 * press events. The event mask is the bitwise OR of values from the 2689 * GdkEventMask enumeration. 2690 * Params: 2691 * device = GdkDevice to enable events for. 2692 * eventMask = event mask for window 2693 * Since 3.0 2694 */ 2695 public void setDeviceEvents(Device device, GdkEventMask eventMask) 2696 { 2697 // void gdk_window_set_device_events (GdkWindow *window, GdkDevice *device, GdkEventMask event_mask); 2698 gdk_window_set_device_events(gdkWindow, (device is null) ? null : device.getDeviceStruct(), eventMask); 2699 } 2700 2701 /** 2702 * Returns the event mask for window corresponding to the device class specified 2703 * by source. 2704 * Params: 2705 * source = a GdkInputSource to define the source class. 2706 * Returns: source event mask for window 2707 */ 2708 public GdkEventMask getSourceEvents(GdkInputSource source) 2709 { 2710 // GdkEventMask gdk_window_get_source_events (GdkWindow *window, GdkInputSource source); 2711 return gdk_window_get_source_events(gdkWindow, source); 2712 } 2713 2714 /** 2715 * Sets the event mask for any floating device (i.e. not attached to any 2716 * visible pointer) that has the source defined as source. This event 2717 * mask will be applied both to currently existing, newly added devices 2718 * after this call, and devices being attached/detached. 2719 * Params: 2720 * source = a GdkInputSource to define the source class. 2721 * eventMask = event mask for window 2722 * Since 3.0 2723 */ 2724 public void setSourceEvents(GdkInputSource source, GdkEventMask eventMask) 2725 { 2726 // void gdk_window_set_source_events (GdkWindow *window, GdkInputSource source, GdkEventMask event_mask); 2727 gdk_window_set_source_events(gdkWindow, source, eventMask); 2728 } 2729 2730 /** 2731 * Gets the offscreen surface that an offscreen window renders into. 2732 * If you need to keep this around over window resizes, you need to 2733 * add a reference to it. 2734 * Returns: The offscreen surface, or NULL if not offscreen. [transfer none] 2735 */ 2736 public Surface offscreenWindowGetSurface() 2737 { 2738 // cairo_surface_t * gdk_offscreen_window_get_surface (GdkWindow *window); 2739 auto p = gdk_offscreen_window_get_surface(gdkWindow); 2740 2741 if(p is null) 2742 { 2743 return null; 2744 } 2745 2746 return ObjectG.getDObject!(Surface)(cast(cairo_surface_t*) p); 2747 } 2748 2749 /** 2750 * Sets window to be embedded in embedder. 2751 * To fully embed an offscreen window, in addition to calling this 2752 * function, it is also necessary to handle the "pick-embedded-child" 2753 * signal on the embedder and the "to-embedder" and 2754 * "from-embedder" signals on window. 2755 * Since 2.18 2756 * Params: 2757 * embedder = the GdkWindow that window gets embedded in 2758 */ 2759 public void offscreenWindowSetEmbedder(Window embedder) 2760 { 2761 // void gdk_offscreen_window_set_embedder (GdkWindow *window, GdkWindow *embedder); 2762 gdk_offscreen_window_set_embedder(gdkWindow, (embedder is null) ? null : embedder.getWindowStruct()); 2763 } 2764 2765 /** 2766 * Gets the window that window is embedded in. 2767 * Since 2.18 2768 * Returns: the embedding GdkWindow, or NULL if window is not an mbedded offscreen window. [transfer none] 2769 */ 2770 public Window offscreenWindowGetEmbedder() 2771 { 2772 // GdkWindow * gdk_offscreen_window_get_embedder (GdkWindow *window); 2773 auto p = gdk_offscreen_window_get_embedder(gdkWindow); 2774 2775 if(p is null) 2776 { 2777 return null; 2778 } 2779 2780 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2781 } 2782 2783 /** 2784 * This function informs GDK that the geometry of an embedded 2785 * offscreen window has changed. This is necessary for GDK to keep 2786 * track of which offscreen window the pointer is in. 2787 * Since 2.18 2788 */ 2789 public void geometryChanged() 2790 { 2791 // void gdk_window_geometry_changed (GdkWindow *window); 2792 gdk_window_geometry_changed(gdkWindow); 2793 } 2794 2795 /** 2796 * Transforms window coordinates from a parent window to a child 2797 * window, where the parent window is the normal parent as returned by 2798 * gdk_window_get_parent() for normal windows, and the window's 2799 * embedder as returned by gdk_offscreen_window_get_embedder() for 2800 * offscreen windows. 2801 * For normal windows, calling this function is equivalent to subtracting 2802 * the return values of gdk_window_get_position() from the parent coordinates. 2803 * For offscreen windows however (which can be arbitrarily transformed), 2804 * this function calls the GdkWindow::from-embedder: signal to translate 2805 * the coordinates. 2806 * You should always use this function when writing generic code that 2807 * walks down a window hierarchy. 2808 * See also: gdk_window_coords_to_parent() 2809 * Since 2.22 2810 * Params: 2811 * parentX = X coordinate in parent's coordinate system 2812 * parentY = Y coordinate in parent's coordinate system 2813 * x = return location for X coordinate in child's coordinate system. [out][allow-none] 2814 * y = return location for Y coordinate in child's coordinate system. [out][allow-none] 2815 */ 2816 public void coordsFromParent(double parentX, double parentY, out double x, out double y) 2817 { 2818 // void gdk_window_coords_from_parent (GdkWindow *window, gdouble parent_x, gdouble parent_y, gdouble *x, gdouble *y); 2819 gdk_window_coords_from_parent(gdkWindow, parentX, parentY, &x, &y); 2820 } 2821 2822 /** 2823 * Transforms window coordinates from a child window to its parent 2824 * window, where the parent window is the normal parent as returned by 2825 * gdk_window_get_parent() for normal windows, and the window's 2826 * embedder as returned by gdk_offscreen_window_get_embedder() for 2827 * offscreen windows. 2828 * For normal windows, calling this function is equivalent to adding 2829 * the return values of gdk_window_get_position() to the child coordinates. 2830 * For offscreen windows however (which can be arbitrarily transformed), 2831 * this function calls the GdkWindow::to-embedder: signal to translate 2832 * the coordinates. 2833 * You should always use this function when writing generic code that 2834 * walks up a window hierarchy. 2835 * See also: gdk_window_coords_from_parent() 2836 * Since 2.22 2837 * Params: 2838 * x = X coordinate in child's coordinate system 2839 * y = Y coordinate in child's coordinate system 2840 * parentX = return location for X coordinate 2841 * in parent's coordinate system, or NULL. [out][allow-none] 2842 * parentY = return location for Y coordinate 2843 * in parent's coordinate system, or NULL. [out][allow-none] 2844 */ 2845 public void coordsToParent(double x, double y, out double parentX, out double parentY) 2846 { 2847 // void gdk_window_coords_to_parent (GdkWindow *window, gdouble x, gdouble y, gdouble *parent_x, gdouble *parent_y); 2848 gdk_window_coords_to_parent(gdkWindow, x, y, &parentX, &parentY); 2849 } 2850 2851 /** 2852 * Obtains the parent of window, as known to GDK. Works like 2853 * gdk_window_get_parent() for normal windows, but returns the 2854 * window's embedder for offscreen windows. 2855 * See also: gdk_offscreen_window_get_embedder() 2856 * Since 2.22 2857 * Returns: effective parent of window. [transfer none] 2858 */ 2859 public Window getEffectiveParent() 2860 { 2861 // GdkWindow * gdk_window_get_effective_parent (GdkWindow *window); 2862 auto p = gdk_window_get_effective_parent(gdkWindow); 2863 2864 if(p is null) 2865 { 2866 return null; 2867 } 2868 2869 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2870 } 2871 2872 /** 2873 * Gets the toplevel window that's an ancestor of window. 2874 * Works like gdk_window_get_toplevel(), but treats an offscreen window's 2875 * embedder as its parent, using gdk_window_get_effective_parent(). 2876 * See also: gdk_offscreen_window_get_embedder() 2877 * Since 2.22 2878 * Returns: the effective toplevel window containing window. [transfer none] 2879 */ 2880 public Window getEffectiveToplevel() 2881 { 2882 // GdkWindow * gdk_window_get_effective_toplevel (GdkWindow *window); 2883 auto p = gdk_window_get_effective_toplevel(gdkWindow); 2884 2885 if(p is null) 2886 { 2887 return null; 2888 } 2889 2890 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 2891 } 2892 }