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