1 /*********************************************************************** 2 created: 21/2/2004 3 author: Paul D Turner 4 5 purpose: Defines abstract base class for Window objects 6 *************************************************************************/ 7 /*************************************************************************** 8 * Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team 9 * 10 * Permission is hereby granted, free of charge, to any person obtaining 11 * a copy of this software and associated documentation files (the 12 * "Software"), to deal in the Software without restriction, including 13 * without limitation the rights to use, copy, modify, merge, publish, 14 * distribute, sublicense, and/or sell copies of the Software, and to 15 * permit persons to whom the Software is furnished to do so, subject to 16 * the following conditions: 17 * 18 * The above copyright notice and this permission notice shall be 19 * included in all copies or substantial portions of the Software. 20 * 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 * OTHER DEALINGS IN THE SOFTWARE. 28 ***************************************************************************/ 29 30 #ifndef _CEGUIWindow_h_ 31 #define _CEGUIWindow_h_ 32 33 #include "CEGUI/Base.h" 34 #include "CEGUI/NamedElement.h" 35 #include "CEGUI/Vector.h" 36 #include "CEGUI/Quaternion.h" 37 #include "CEGUI/Rect.h" 38 #include "CEGUI/Size.h" 39 #include "CEGUI/EventSet.h" 40 #include "CEGUI/PropertySet.h" 41 #include "CEGUI/TplWindowProperty.h" 42 #include "CEGUI/System.h" 43 #include "CEGUI/GUIContext.h" 44 #include "CEGUI/InputEvent.h" 45 #include "CEGUI/UDim.h" 46 #include "CEGUI/WindowRenderer.h" 47 #include "CEGUI/TextUtils.h" 48 #include "CEGUI/BasicRenderedStringParser.h" 49 #include "CEGUI/DefaultRenderedStringParser.h" 50 #include <vector> 51 #include <set> 52 53 #if defined(_MSC_VER) 54 # pragma warning(push) 55 # pragma warning(disable : 4251) 56 #endif 57 58 59 namespace CEGUI 60 { 61 62 /*! 63 \brief 64 Enumerated type used for specifying Window::update mode to be used. Note 65 that the setting specified will also have an effect on child window 66 content; for WUM_NEVER and WUM_VISIBLE, if the parent's update function is 67 not called, then no child window will have it's update function called 68 either - even if it specifies WUM_ALWAYS as it's WindowUpdateMode. 69 */ 70 enum WindowUpdateMode 71 { 72 //! Always call the Window::update function for this window. 73 WUM_ALWAYS, 74 //! Never call the Window::update function for this window. 75 WUM_NEVER, 76 //! Only call the Window::update function for this window if it is visible. 77 WUM_VISIBLE 78 }; 79 80 template<> 81 class PropertyHelper<WindowUpdateMode> 82 { 83 public: 84 typedef WindowUpdateMode return_type; 85 typedef return_type safe_method_return_type; 86 typedef WindowUpdateMode pass_type; 87 typedef String string_return_type; 88 getDataTypeName()89 static const String& getDataTypeName() 90 { 91 static String type("WindowUpdateMode"); 92 93 return type; 94 } 95 fromString(const String & str)96 static return_type fromString(const String& str) 97 { 98 99 if (str == "Always") 100 { 101 return WUM_ALWAYS; 102 } 103 else if (str == "Never") 104 { 105 return WUM_NEVER; 106 } 107 else 108 { 109 return WUM_VISIBLE; 110 } 111 } 112 toString(pass_type val)113 static string_return_type toString(pass_type val) 114 { 115 if (val == WUM_ALWAYS) 116 { 117 return "Always"; 118 } 119 else if (val == WUM_NEVER) 120 { 121 return "Never"; 122 } 123 else if (val == WUM_VISIBLE) 124 { 125 return "Visible"; 126 } 127 else 128 { 129 assert(false && "Invalid Window Update Mode"); 130 return "Always"; 131 } 132 } 133 }; 134 135 136 /*! 137 \brief 138 An abstract base class providing common functionality and specifying the 139 required interface for derived classes. 140 141 The Window base class is core UI object class that the the system knows 142 about; for this reason, every other window, widget, or similar item within 143 the system must be derived from Window. 144 145 The base class provides the common functionality required by all UI objects, 146 and specifies the minimal interface required to be implemented by derived 147 classes. 148 */ 149 class CEGUIEXPORT Window : 150 public NamedElement 151 { 152 public: 153 /************************************************************************* 154 Property name constants 155 *************************************************************************/ 156 //! Name of property to access for the alpha value of the Window. 157 static const String AlphaPropertyName; 158 //! Name of property to access for the 'always on top' setting for the Window 159 static const String AlwaysOnTopPropertyName; 160 //! Name of property to access for the 'clipped by parent' setting for the Window 161 static const String ClippedByParentPropertyName; 162 //! Name of property to access for the 'destroyed by parent' setting for the Window 163 static const String DestroyedByParentPropertyName; 164 //! Name of property to access for the 'disabled state' setting for the Window 165 static const String DisabledPropertyName; 166 //! Name of property to access for the font for the Window. 167 static const String FontPropertyName; 168 //! Name of property to access for the ID value of the Window. 169 static const String IDPropertyName; 170 //! Name of property to access for the get/set the 'inherits alpha' setting for the Window. 171 static const String InheritsAlphaPropertyName; 172 //! Name of property to access for the the mouse cursor image for the Window. 173 static const String MouseCursorImagePropertyName; 174 //! Name of property to access for the the 'visible state' setting for the Window. 175 static const String VisiblePropertyName; 176 //! Name of property to access for the 'restore old capture' setting for the Window. 177 static const String RestoreOldCapturePropertyName; 178 //! Name of property to access for the text / caption for the Window. 179 static const String TextPropertyName; 180 //! Name of property to access for the 'z-order changing enabled' setting for the Window. 181 static const String ZOrderingEnabledPropertyName; 182 //! Name of property to access for whether the window will receive double-click and triple-click events. 183 static const String WantsMultiClickEventsPropertyName; 184 //! Name of property to access for whether the window will receive autorepeat mouse button down events. 185 static const String MouseAutoRepeatEnabledPropertyName; 186 //! Name of property to access for the autorepeat delay. 187 static const String AutoRepeatDelayPropertyName; 188 //! Name of property to access for the autorepeat rate. 189 static const String AutoRepeatRatePropertyName; 190 //! Name of property to access for the whether captured inputs are passed to child windows. 191 static const String DistributeCapturedInputsPropertyName; 192 //! Name of property to access for the custom tooltip for the window. 193 static const String TooltipTypePropertyName; 194 //! Name of property to access for the tooltip text for the window. 195 static const String TooltipTextPropertyName; 196 //! Name of property to access for the window inherits its parents tooltip text when it has none of its own. 197 static const String InheritsTooltipTextPropertyName; 198 //! Name of property to access for the window will come to the top of the Z-order when clicked. 199 static const String RiseOnClickEnabledPropertyName; 200 //! Name of property to access for the window ignores mouse events and pass them through to any windows behind it. 201 static const String MousePassThroughEnabledPropertyName; 202 //! Name of property to access for the Window will receive drag and drop related notifications. 203 static const String DragDropTargetPropertyName; 204 //! Name of property to access for the Window will automatically attempt to use a full imagery caching RenderingSurface (if supported by the renderer). 205 static const String AutoRenderingSurfacePropertyName; 206 //! Name of property to access for the text parsing setting for the Window. 207 static const String TextParsingEnabledPropertyName; 208 //! Name of property to access for the margin for the Window. 209 static const String MarginPropertyName; 210 //! Name of property to access for the window update mode setting. 211 static const String UpdateModePropertyName; 212 //! Name of property to access whether unhandled mouse inputs should be propagated back to the Window's parent. 213 static const String MouseInputPropagationEnabledPropertyName; 214 //! Name of property to access whether the system considers this window to be an automatically created sub-component window. 215 static const String AutoWindowPropertyName; 216 217 /************************************************************************* 218 Event name constants 219 *************************************************************************/ 220 //! Namespace for global events 221 static const String EventNamespace; 222 223 // generated internally by Window 224 /** Event fired as part of the time based update of the window. 225 * Handlers are passed a const UpdateEventArgs reference. 226 */ 227 static const String EventUpdated; 228 229 /** Event fired when the text string for the Window has changed. 230 * Handlers are passed a const WindowEventArgs reference with 231 * WindowEventArgs::window set to the Window whose text was changed. 232 */ 233 static const String EventTextChanged; 234 /** Event fired when the Font object for the Window has been changed. 235 * Handlers are passed a const WindowEventArgs reference with 236 * WindowEventArgs::window set to the Window whose font was changed. 237 */ 238 static const String EventFontChanged; 239 /** Event fired when the Alpha blend value for the Window has changed. 240 * Handlers are passed a const WindowEventArgs reference with 241 * WindowEventArgs::window set to the Window whose alpha value was changed. 242 */ 243 static const String EventAlphaChanged; 244 /** Event fired when the client assigned ID for the Window has changed. 245 * Handlers are passed a const WindowEventArgs reference with 246 * WindowEventArgs::window set to the Window whose ID was changed. 247 */ 248 static const String EventIDChanged; 249 /** Event fired when the Window has been activated and has input focus. 250 * Handlers are passed a const ActivationEventArgs reference with 251 * WindowEventArgs::window set to the Window that is gaining activation and 252 * ActivationEventArgs::otherWindow set to the Window that is losing 253 * activation (may be 0). 254 */ 255 static const String EventActivated; 256 /** Event fired when the Window has been deactivated, losing input focus. 257 * Handlers are passed a const ActivationEventArgs reference with 258 * WindowEventArgs::window set to the Window that is losing activation and 259 * ActivationEventArgs::otherWindow set to the Window that is gaining 260 * activation (may be 0). 261 */ 262 static const String EventDeactivated; 263 /** Event fired when the Window is shown (made visible). 264 * Handlers are passed a const WindowEventArgs reference with 265 * WindowEventArgs::window set to the Window that was shown. 266 */ 267 static const String EventShown; 268 /** Event fired when the Window is made hidden. 269 * Handlers are passed a const WindowEventArgs reference with 270 * WindowEventArgs::window set to the Window that was hidden. 271 */ 272 static const String EventHidden; 273 /** Event fired when the Window is enabled so interaction is possible. 274 * Handlers are passed a const WindowEventArgs reference with 275 * WindowEventArgs::window set to the Window that was enabled. 276 */ 277 static const String EventEnabled; 278 /** Event fired when the Window is disabled and interaction is no longer 279 * possible. 280 * Handlers are passed a const WindowEventArgs reference with 281 * WindowEventArgs::window set to the Window that was disabled. 282 */ 283 static const String EventDisabled; 284 /** Event fired when the Window clipping mode is modified. 285 * Handlers are passed a const WindowEventArgs reference with 286 * WindowEventArgs::window set to the Window whose clipping mode was 287 * changed. 288 */ 289 static const String EventClippedByParentChanged; 290 /** Event fired when the Window destruction mode is modified. 291 * Handlers are passed a const WindowEventArgs reference with 292 * WindowEventArgs::window set to the Window whose destruction mode was 293 * changed. 294 */ 295 static const String EventDestroyedByParentChanged; 296 /** Event fired when the Window mode controlling inherited alpha is changed. 297 * Handlers are passed a const WindowEventArgs reference with 298 * WindowEventArgs::window set to the Window whose alpha inheritence mode 299 * was changed. 300 */ 301 static const String EventInheritsAlphaChanged; 302 /** Event fired when the always on top setting for the Window is changed. 303 * Handlers are passed a const WindowEventArgs reference with 304 * WindowEventArgs::window set to the Window whose always on top setting 305 * was changed. 306 */ 307 static const String EventAlwaysOnTopChanged; 308 /** Event fired when the Window gains capture of mouse inputs. 309 * Handlers are passed a const WindowEventArgs reference with 310 * WindowEventArgs::window set to the Window that has captured mouse inputs. 311 */ 312 static const String EventInputCaptureGained; 313 /** Event fired when the Window loses capture of mouse inputs. 314 * Handlers are passed a const WindowEventArgs reference with 315 * WindowEventArgs::window set to either: 316 * - the Window that has lost capture of mouse inputs if that event was 317 * caused by the window itself releasing the capture. 318 * - the Window that is @gaining capture of mouse inputs if that is the 319 * cause of the previous window with capture losing that capture. 320 */ 321 static const String EventInputCaptureLost; 322 /** Event fired when the Window has been invalidated. 323 * When a window is invalidated its cached rendering geometry is cleared, 324 * the rendering surface that recieves the window's output is invalidated 325 * and the window's target GUIContext is marked as dirty; this causes all 326 * objects involved in the display of the window to be refreshed the next 327 * time that the GUIContext::draw function is called. 328 * Handlers are passed a const WindowEventArgs reference with 329 * WindowEventArgs::window set to the Window that has been invalidated. 330 */ 331 static const String EventInvalidated; 332 /** Event fired when rendering of the Window has started. In this context 333 * 'rendering' is the population of the GeometryBuffer with geometry for the 334 * window, not the actual rendering of that GeometryBuffer content to the 335 * display. 336 * Handlers are passed a const WindowEventArgs reference with 337 * WindowEventArgs::window set to the Window whose rendering has started. 338 */ 339 static const String EventRenderingStarted; 340 /** Event fired when rendering of the Window has ended. In this context 341 * 'rendering' is the population of the GeometryBuffer with geometry for the 342 * window, not the actual rendering of that GeometryBuffer content to the 343 * display. 344 * Handlers are passed a const WindowEventArgs reference with 345 * WindowEventArgs::window set to the Window whose rendering has ended. 346 */ 347 static const String EventRenderingEnded; 348 /** Event fired when destruction of the Window is about to begin. 349 * Handlers are passed a const WindowEventArgs reference with 350 * WindowEventArgs::window set to the Window that is about to be destroyed. 351 */ 352 static const String EventDestructionStarted; 353 /** Event fired when a DragContainer is dragged in to the window's area. 354 * Handlers are passed a const DragDropEventArgs reference with 355 * WindowEventArgs::window set to the window over which a DragContainer has 356 * been dragged (the receiving window) and DragDropEventArgs::dragDropItem 357 * set to the DragContainer that was dragged in to the receiving window's 358 * area. 359 */ 360 static const String EventDragDropItemEnters; 361 /** Event fired when a DragContainer is dragged out of the window's area. 362 * Handlers are passed a const DragDropEventArgs reference with 363 * WindowEventArgs::window set to the window over which a DragContainer has 364 * been dragged out of (the receiving window) and 365 * DragDropEventArgs::dragDropItem set to the DragContainer that was dragged 366 * out of the receiving window's area. 367 */ 368 static const String EventDragDropItemLeaves; 369 /** Event fired when a DragContainer is dropped within the window's area. 370 * Handlers are passed a const DragDropEventArgs reference with 371 * WindowEventArgs::window set to the window over which a DragContainer was 372 * dropped (the receiving window) and DragDropEventArgs::dragDropItem set to 373 * the DragContainer that was dropped within the receiving window's area. 374 */ 375 static const String EventDragDropItemDropped; 376 /** Event fired when a WindowRenderer object is attached to the window. 377 * Handlers are passed a const WindowEventArgs reference with 378 * WindowEventArgs::window set to the window that had the WindowRenderer 379 * attached to it. 380 */ 381 static const String EventWindowRendererAttached; 382 /** Event fired when a WindowRenderer object is detached from the window. 383 * Handlers are passed a const WindowEventArgs reference with 384 * WindowEventArgs::window set to the window that had the WindowRenderer 385 * detached from it. 386 */ 387 static const String EventWindowRendererDetached; 388 /** Event fired when the Window's setting controlling parsing of it's text 389 * string is changed. 390 * Handlers are passed a const WindowEventArgs reference with 391 * WindowEventArgs::window set to the Window whose text parsing setting was 392 * changed. 393 */ 394 static const String EventTextParsingChanged; 395 /** Event fired when the Window's margin has changed (any of the four margins) 396 * Handlers are passed a const WindowEventArgs reference with 397 * WindowEventArgs::window set to the Window whose margin was 398 * changed. 399 */ 400 static const String EventMarginChanged; 401 402 // generated externally (inputs) 403 /** Event fired when the mouse cursor has entered the Window's area. 404 * Handlers are passed a const MouseEventArgs reference with all fields 405 * valid. 406 */ 407 static const String EventMouseEntersArea; 408 /** Event fired when the mouse cursor has left the Window's area. 409 * Handlers are passed a const MouseEventArgs reference with all fields 410 * valid. 411 */ 412 static const String EventMouseLeavesArea; 413 /** Event fired when the mouse cursor enters the Window's area. 414 * Handlers are passed a const MouseEventArgs reference with all fields 415 * valid. 416 *\note This event is fired if - and only if - the mouse cursor is actually 417 * over some part of this Window's surface area, and will not fire for 418 * example if the location of the mouse is over some child window (even 419 * though the mouse is technically also within the area of this Window). 420 * For an alternative version of this event see the 421 * Window::EventMouseEntersArea event. 422 */ 423 static const String EventMouseEntersSurface; 424 /** Event fired when the mouse cursor is no longer over the Window's surface 425 * area. 426 * Handlers are passed a const MouseEventArgs reference with all fields 427 * valid. 428 *\note This event will fire whenever the mouse is no longer actually over 429 * some part of this Window's surface area, for example if the mouse is 430 * moved over some child window (even though technically the mouse has not 431 * actually 'left' this Window's area). For an alternative version of this 432 * event see the Window::EventMouseLeavesArea event. 433 */ 434 static const String EventMouseLeavesSurface; 435 /** Event fired when the mouse cursor moves within the area of the Window. 436 * Handlers are passed a const MouseEventArgs reference with all fields 437 * valid. 438 */ 439 static const String EventMouseMove; 440 /** Event fired when the mouse wheel is scrolled when the mouse cursor is 441 * within the Window's area. 442 * Handlers are passed a const MouseEventArgs reference with all fields 443 * valid. 444 */ 445 static const String EventMouseWheel; 446 /** Event fired when a mouse button is pressed down within the Window. 447 * Handlers are passed a const MouseEventArgs reference with all fields 448 * valid. 449 */ 450 static const String EventMouseButtonDown; 451 /** Event fired when a mouse button is released within the Window. 452 * Handlers are passed a const MouseEventArgs reference with all fields 453 * valid. 454 */ 455 static const String EventMouseButtonUp; 456 /** Event fired when a mouse button is clicked - that is, pressed down and 457 * released within a specific time interval - while the mouse cursor is 458 * within the Window's area. 459 * Handlers are passed a const MouseEventArgs reference with all fields 460 * valid. 461 */ 462 static const String EventMouseClick; 463 /** Event fired when a mouse button is double-clicked while the mouse cursor 464 * is within the Window's area. 465 * Handlers are passed a const MouseEventArgs reference with all fields 466 * valid. 467 */ 468 static const String EventMouseDoubleClick; 469 /** Event fired when a mouse button is triple-clicked while the mouse cursor 470 * is within the Window's area. 471 * Handlers are passed a const MouseEventArgs reference with all fields 472 * valid. 473 */ 474 static const String EventMouseTripleClick; 475 /** Event fired when a key on the keyboard was pressed down while the window 476 * had input focus. 477 * Handlers are passed a const KeyEventArgs reference with 478 * WindowEventArgs::window set to the Window receiving the key press, 479 * KeyEventArgs::scancode set to the Key::Scan value of the key that was 480 * pressed, and KeyEventArgs::sysKeys set to the combination of ::SystemKey 481 * values active when the key was pressed. 482 */ 483 static const String EventKeyDown; 484 /** Event fired when a key on the keyboard was released while the window 485 * had input focus. 486 * Handlers are passed a const KeyEventArgs reference with 487 * WindowEventArgs::window set to the Window receiving the key release, 488 * KeyEventArgs::scancode set to the Key::Scan value of the key that was 489 * released, and KeyEventArgs::sysKeys set to the combination of ::SystemKey 490 * values active when the key was released. 491 */ 492 static const String EventKeyUp; 493 /** Event fired when the Window receives a character key input event. 494 * Handlers are passed a const KeyEventArgs reference with 495 * WindowEventArgs::window set to the Window receiving the character input, 496 * KeyEventArgs::codepoint set to the Unicode UTF32 / UCS-4 value for the 497 * input, and KeyEventArgs::sysKeys set to the combination of ::SystemKey 498 * values active when the character input was received. 499 */ 500 static const String EventCharacterKey; 501 502 /************************************************************************* 503 Child Widget name suffix constants 504 *************************************************************************/ 505 //! Widget name suffix for automatically created tooltip widgets. 506 static const String TooltipNameSuffix; 507 508 // XML element and attribute names that relate to Window. 509 static const String WindowXMLElementName; 510 static const String AutoWindowXMLElementName; 511 static const String UserStringXMLElementName; 512 static const String WindowTypeXMLAttributeName; 513 static const String WindowNameXMLAttributeName; 514 static const String AutoWindowNamePathXMLAttributeName; 515 static const String UserStringNameXMLAttributeName; 516 static const String UserStringValueXMLAttributeName; 517 518 /*! 519 \brief 520 Constructor for Window base class 521 522 \param type 523 String object holding Window type (usually provided by WindowFactory). 524 525 \param name 526 String object holding unique name for the Window. 527 */ 528 Window(const String& type, const String& name); 529 530 /*! 531 \brief 532 Destructor for Window base class 533 */ 534 virtual ~Window(void); 535 536 /*! 537 \brief 538 return a String object holding the type name for this Window. 539 540 \return 541 String object holding the Window type. 542 */ 543 const String& getType(void) const; 544 545 /*! 546 \brief 547 returns whether or not this Window is set to be destroyed when its 548 parent window is destroyed. 549 550 \return 551 - true if the Window will be destroyed when its parent is destroyed. 552 - false if the Window will remain when its parent is destroyed. 553 */ isDestroyedByParent(void)554 bool isDestroyedByParent(void) const {return d_destroyedByParent;} 555 556 /*! 557 \brief 558 returns whether or not this Window is an always on top Window. Also 559 known as a top-most window. 560 561 \return 562 - true if this Window is always drawn on top of other normal windows. 563 - false if the Window has normal z-order behaviour. 564 */ isAlwaysOnTop(void)565 bool isAlwaysOnTop(void) const {return d_alwaysOnTop;} 566 567 /*! 568 \brief 569 return whether the Window is currently disabled 570 571 \note 572 Only checks the state set for this window, and does not 573 factor in inherited state from ancestor windows. 574 575 \return 576 - true if the window is disabled. 577 - false if the window is enabled. 578 */ 579 bool isDisabled() const; 580 581 /*! 582 \brief 583 return whether the Window is currently disabled 584 585 \note 586 Not only checks the state set for this window, but also 587 factors in inherited state from ancestor windows. 588 589 \return 590 - true if the window is disabled. 591 - false if the window is enabled. 592 */ 593 bool isEffectiveDisabled() const; 594 595 /*! 596 \brief 597 return true if the Window is currently visible. 598 599 When true is returned from this function does not mean that the window 600 is not completely obscured by other windows, just that the window will 601 be processed when rendering, and is not explicitly marked as hidden. 602 603 \note 604 Only checks the state set for this window, and does not 605 factor in inherited state from ancestor windows. 606 607 \return 608 - true if the window is set as visible. 609 - false if the window is set as hidden. 610 */ 611 bool isVisible() const; 612 613 /*! 614 \brief 615 return true if the Window is currently visible. 616 617 When true is returned from this function does not mean that the window 618 is not completely obscured by other windows, just that the window will 619 be processed when rendering, and is not explicitly marked as hidden. 620 621 \note 622 Does check the state set for this window, but also 623 factors in inherited state from ancestor windows. 624 625 \return 626 - true if the window will be drawn. 627 - false if the window is hidden and therefore ignored when rendering. 628 */ 629 bool isEffectiveVisible() const; 630 631 /*! 632 \brief 633 return true if this is the active Window. An active window is a window 634 that may receive user inputs. 635 636 Mouse events are always sent to the window containing the mouse cursor 637 regardless of what this function reports (unless a window has captured 638 inputs). The active state mainly determines where send other, for 639 example keyboard, inputs. 640 641 \return 642 - true if the window is active and may be sent inputs by the system. 643 - false if the window is inactive and will not be sent inputs. 644 */ 645 bool isActive(void) const; 646 647 /*! 648 \brief 649 return true if this Window is clipped so that its rendering will not 650 pass outside of its parent Window area. 651 652 \return 653 - true if the window will be clipped by its parent Window. 654 - false if the windows rendering may pass outside its parents area 655 */ isClippedByParent(void)656 bool isClippedByParent(void) const {return d_clippedByParent;} 657 658 /*! 659 \brief 660 return the ID code currently assigned to this Window by client code. 661 662 \return 663 uint value equal to the currently assigned ID code for this Window. 664 */ getID(void)665 uint getID(void) const {return d_ID;} 666 667 using NamedElement::isChild; 668 /*! 669 \brief 670 returns whether at least one window with the given ID code is attached 671 to this Window as a child. 672 673 \note 674 ID codes are client assigned and may or may not be unique, and as such, 675 the return from this function will only have meaning to the client code. 676 677 \param ID 678 uint ID code to look for. 679 680 \return 681 - true if at least one child window was found with the ID code \a ID 682 - false if no child window was found with the ID code \a ID. 683 */ 684 bool isChild(uint ID) const; 685 686 /*! 687 \brief 688 returns whether at least one window with the given ID code is attached 689 to this Window or any of it's children as a child. 690 691 \note 692 ID codes are client assigned and may or may not be unique, and as such, 693 the return from this function will only have meaning to the client code. 694 695 WARNING! This function can be very expensive and should only be used 696 when you have no other option available. If you decide to use it anyway, 697 make sure the window hierarchy from the entry point is small. 698 699 \param ID 700 uint ID code to look for. 701 702 \return 703 - true if at least one child window was found with the ID code \a ID 704 - false if no child window was found with the ID code \a ID. 705 */ 706 bool isChildRecursive(uint ID) const; 707 708 709 /*! 710 \brief 711 returns a pointer to the child window at the specified index. Idx is the 712 index of the window in the child window list. It is based on the order 713 in which the children were added and is stable. 714 715 \param idx 716 Index of the child window list position of the window that should be 717 returned.This value is not bounds checked, client code should ensure that 718 this is less than the value returned by getChildCount(). 719 720 \return 721 Pointer to the child window currently attached at index position \a idx 722 */ getChildAtIdx(size_t idx)723 inline Window* getChildAtIdx(size_t idx) const 724 { 725 return static_cast<Window*>(getChildElementAtIdx(idx)); 726 } 727 728 /*! 729 \brief 730 return the attached child window that the given name path references. 731 732 A name path is a string that describes a path down the window 733 hierarchy using window names and the forward slash '/' as a separator. 734 \par 735 For example, if this window has a child attached to it named "Panel" 736 which has its own children attached named "Okay" and "Cancel", 737 you can access the window "Okay" from this window by using the 738 name path "Panel/Okay". To access "Panel", you would simply pass the 739 name "Panel". 740 741 \param name_path 742 String object holding the name path of the child window to return. 743 744 \return 745 the Window object referenced by \a name_path. 746 747 \exception UnknownObjectException 748 thrown if \a name_path does not reference a Window attached to this 749 Window. 750 */ getChild(const String & name_path)751 inline Window* getChild(const String& name_path) const 752 { 753 return static_cast<Window*>(getChildElement(name_path)); 754 } 755 756 /*! 757 \brief 758 return a pointer to the first attached child window with the specified 759 name. Children are traversed recursively. 760 761 Contrary to the non recursive version of this function, this one will 762 not throw an exception, but return 0 in case no child was found. 763 764 \note 765 WARNING! This function can be very expensive and should only be used 766 when you have no other option available. If you decide to use it anyway, 767 make sure the window hierarchy from the entry point is small. 768 769 \param name 770 String object holding the name of the window to return a pointer to. 771 772 \return 773 Pointer to the (first) Window object attached to this window that has 774 the name \a name. 775 If no child is found with the name \a name, 0 is returned. 776 */ getChildRecursive(const String & name)777 inline Window* getChildRecursive(const String& name) const 778 { 779 return static_cast<Window*>(getChildElementRecursive(name)); 780 } 781 782 /*! 783 \brief 784 return a pointer to the first attached child window with the specified 785 ID value. 786 787 This function will throw an exception if no child object with the given 788 ID is attached. This decision was made (over returning NULL if no 789 window was found) so that client code can assume that if the call 790 returns it has a valid window pointer. We provide the isChild() 791 functions for checking if a given window is attached. 792 793 \param ID 794 uint value specifying the ID code of the window to return a pointer to. 795 796 \return 797 Pointer to the (first) Window object attached to this window that has 798 the ID code \a ID. 799 800 \exception UnknownObjectException 801 thrown if no window with the ID code \a ID is attached to this Window. 802 */ 803 Window* getChild(uint ID) const; 804 805 /*! 806 \brief 807 return a pointer to the first attached child window with the specified 808 ID value. Children are traversed recursively. 809 810 Contrary to the non recursive version of this function, this one will 811 not throw an exception, but return 0 in case no child was found. 812 813 \note 814 WARNING! This function can be very expensive and should only be used 815 when you have no other option available. If you decide to use it anyway, 816 make sure the window hierarchy from the entry point is small. 817 818 \param ID 819 uint value specifying the ID code of the window to return a pointer to. 820 821 \return 822 Pointer to the (first) Window object attached to this window that has 823 the ID code \a ID. 824 If no child is found with the ID code \a ID, 0 is returned. 825 */ 826 Window* getChildRecursive(uint ID) const; 827 828 /*! 829 \brief 830 return a pointer to the Window that currently has input focus starting 831 with this Window. 832 833 \return 834 Pointer to the window that is active (has input focus) starting at this 835 window. The function will return 'this' if this Window is active 836 and either no children are attached or if none of the attached children 837 are active. Returns NULL if this Window (and therefore all children) 838 are not active. 839 */ 840 Window* getActiveChild(void); 841 const Window* getActiveChild(void) const; 842 843 using NamedElement::isAncestor; 844 /*! 845 \brief 846 return true if any Window with the given ID is some ancestor of this 847 Window. 848 849 \param ID 850 uint value specifying the ID to look for. 851 852 \return 853 - true if an ancestor (parent, or parent of parent, etc) was found with 854 the ID code \a ID. 855 - false if no ancestor window has the ID code \a ID. 856 */ 857 bool isAncestor(uint ID) const; 858 859 /*! 860 \brief 861 return the active Font object for the Window. 862 863 \param useDefault 864 Specifies whether to return the default font if this Window has no 865 preferred font set. This is typically set to true but whenever we 866 want to know if a default font would be used, this will be set to 867 false, and if the returned Font is a zero pointer we know that this 868 means a default font would be used otherwise. 869 870 \return 871 Pointer to the Font being used by this Window. If the window has no 872 assigned font, and \a useDefault is true, then the default system font 873 is returned. 874 */ 875 /*! \deprecated This function is deprecated, as the parameter will be removed in the next major version. Separate functions 876 will be added with proper function names to replicate the functionality for useDefault=false. 877 */ 878 const Font* getFont(bool useDefault = true) const; 879 880 /*! 881 \brief 882 return the current text for the Window 883 884 \return 885 The String object that holds the current text for this Window. 886 */ getText(void)887 const String& getText(void) const {return d_textLogical;} 888 889 //! return text string with \e visual ordering of glyphs. 890 const String& getTextVisual() const; 891 892 /*! 893 \brief 894 return true if the Window inherits alpha from its parent(s). 895 896 \return 897 - true if the Window inherits alpha from its parent(s) 898 - false if the alpha for this Window is independant from its parents. 899 */ inheritsAlpha(void)900 bool inheritsAlpha(void) const {return d_inheritsAlpha;} 901 902 /*! 903 \brief 904 return the current alpha value set for this Window 905 906 \note 907 The alpha value set for any given window may or may not be the final 908 alpha value that is used when rendering. All window objects, by 909 default, inherit alpha from thier parent window(s) - this will blend 910 child windows, relatively, down the line of inheritance. This behaviour 911 can be overridden via the setInheritsAlpha() method. To return the true 912 alpha value that will be applied when rendering, use the 913 getEffectiveAlpha() method. 914 915 \return 916 the currently set alpha value for this Window. The value returned Will 917 be between 0.0f and 1.0f. 918 */ getAlpha(void)919 float getAlpha(void) const {return d_alpha;} 920 921 /*! 922 \brief 923 return the effective alpha value that will be used when rendering this 924 window, taking into account inheritance of parent window(s) alpha. 925 926 \return 927 the effective alpha that will be applied to this Window when rendering. 928 The value returned Will be between 0.0f and 1.0f. 929 */ 930 float getEffectiveAlpha(void) const; 931 932 /*! 933 \brief 934 Return a Rect that describes the rendering clipping rect based upon the 935 outer rect area of the window. 936 937 \note 938 The area returned by this function gives you the correct clipping rect 939 for rendering within the Window's outer rect area. The area described 940 may or may not correspond to the final visual clipping actually seen on 941 the display; this is intentional and neccessary due to the way that 942 imagery is cached under some configurations. 943 */ 944 const Rectf& getOuterRectClipper() const; 945 946 /*! 947 \brief 948 Return a Rect that describes the rendering clipping rect based upon the 949 inner rect area of the window. 950 951 \note 952 The area returned by this function gives you the correct clipping rect 953 for rendering within the Window's inner rect area. The area described 954 may or may not correspond to the final visual clipping actually seen on 955 the display; this is intentional and neccessary due to the way that 956 imagery is cached under some configurations. 957 */ 958 const Rectf& getInnerRectClipper() const; 959 960 /*! 961 \brief 962 Return a Rect that describes the rendering clipping rect for the Window. 963 964 This function can return the clipping rect for either the inner or outer 965 area dependant upon the boolean values passed in. 966 967 \note 968 The areas returned by this function gives you the correct clipping rects 969 for rendering within the Window's areas. The area described may or may 970 not correspond to the final visual clipping actually seen on the 971 display; this is intentional and neccessary due to the way that imagery 972 is cached under some configurations. 973 974 \param non_client 975 - true to return the non-client clipping area (based on outer rect). 976 - false to return the client clipping area (based on inner rect). 977 */ 978 const Rectf& getClipRect(const bool non_client = false) const; 979 980 /*! 981 \brief 982 Return the Rect that descibes the clipped screen area that is used for 983 determining whether this window has been hit by a certain point. 984 985 The area returned by this function may also be useful for certain 986 calculations that require the clipped Window area as seen on the display 987 as opposed to what is used for rendering (since the actual rendering 988 clipper rects should not to be used if reliable results are desired). 989 */ 990 const Rectf& getHitTestRect() const; 991 992 /*! 993 \brief 994 return the Window that currently has inputs captured. 995 996 \return 997 Pointer to the Window object that currently has inputs captured, or NULL 998 if no Window has captured input. 999 */ getCaptureWindow()1000 Window* getCaptureWindow() const 1001 {return getGUIContext().getInputCaptureWindow();} 1002 1003 /*! 1004 \brief 1005 return true if this Window has input captured. 1006 1007 \return 1008 - true if this Window has captured inputs. 1009 - false if some other Window, or no Window, has captured inputs. 1010 */ isCapturedByThis(void)1011 bool isCapturedByThis(void) const {return getCaptureWindow() == this;} 1012 1013 /*! 1014 \brief 1015 return true if an ancestor window has captured inputs. 1016 1017 \return 1018 - true if input is captured by a Window that is some ancestor (parent, 1019 parent of parent, etc) of this Window. 1020 - false if no ancestor of this window has captured input. 1021 */ isCapturedByAncestor(void)1022 bool isCapturedByAncestor(void) const 1023 {return isAncestor(getCaptureWindow());} 1024 1025 /*! 1026 \brief 1027 return true if a child window has captured inputs. 1028 1029 \return 1030 - true if input is captured by a Window that is a child of this Window. 1031 - false if no child of this window has not captured input. 1032 */ isCapturedByChild(void)1033 bool isCapturedByChild(void) const {return isChild(getCaptureWindow());} 1034 1035 /*! 1036 \brief 1037 check if the given pixel position would hit this window. 1038 1039 \param position 1040 Vector2 object describing the position to check. The position 1041 describes a pixel offset from the top-left corner of the display. 1042 1043 \param allow_disabled 1044 - true specifies that the window may be 'hit' if it is disabled. 1045 - false specifies that the window may only be hit if it is enabled. 1046 1047 \return 1048 - true if \a position hits this Window. 1049 - false if \a position does not hit this window. 1050 */ 1051 virtual bool isHit(const Vector2f& position, 1052 const bool allow_disabled = false) const; 1053 1054 /*! 1055 \brief 1056 return the child Window that is hit by the given pixel position 1057 1058 \param position 1059 Vector2 object describing the position to check. The position 1060 describes a pixel offset from the top-left corner of the display. 1061 1062 \return 1063 Pointer to the child Window that was hit according to the location 1064 \a position, or 0 if no child of this window was hit. 1065 */ 1066 Window* getChildAtPosition(const Vector2f& position) const; 1067 1068 /*! 1069 \brief 1070 return the child Window that is 'hit' by the given position, and is 1071 allowed to handle mouse events. 1072 1073 \param position 1074 Vector2 object describing the position to check. The position 1075 describes a pixel offset from the top-left corner of the display. 1076 1077 \param allow_disabled 1078 - true specifies that a disabled window may be returned as the target. 1079 - false specifies that only enabled windows may be returned. 1080 1081 \return 1082 Pointer to the child Window that was hit according to the location 1083 \a position, or 0 if no child of this window was hit. 1084 */ 1085 Window* getTargetChildAtPosition(const Vector2f& position, 1086 const bool allow_disabled = false) const; 1087 1088 /*! 1089 \brief 1090 return the parent of this Window. 1091 1092 \return 1093 Pointer to the Window object that is the parent of this Window. 1094 This value can be NULL, in which case the Window is a GUI sheet / root. 1095 */ getParent()1096 inline Window* getParent() const 1097 { 1098 return static_cast<Window*>(getParentElement()); 1099 } 1100 1101 /*! 1102 \brief 1103 Return a pointer to the mouse cursor image to use when the mouse cursor 1104 is within this window's area. 1105 1106 \param useDefault 1107 Sepcifies whether to return the default mouse cursor image if this 1108 window specifies no preferred mouse cursor image. 1109 1110 \return 1111 Pointer to the mouse cursor image that will be used when the mouse 1112 enters this window's area. May return NULL indicating no cursor will 1113 be drawn for this window. 1114 */ 1115 const Image* getMouseCursor(bool useDefault = true) const; 1116 1117 /*! 1118 \brief 1119 Return the user data set for this Window. 1120 1121 Each Window can have some client assigned data attached to it, this data 1122 is not used by the GUI system in any way. Interpretation of the data is 1123 entirely application specific. 1124 1125 \return 1126 pointer to the user data that is currently set for this window. 1127 */ getUserData(void)1128 void* getUserData(void) const {return d_userData;} 1129 1130 /*! 1131 \brief 1132 Return whether this window is set to restore old input capture when it 1133 loses input capture. 1134 1135 This is only really useful for certain sub-components for widget 1136 writers. 1137 1138 \return 1139 - true if the window will restore the previous capture window when it 1140 loses input capture. 1141 - false if the window will set the capture window to NULL when it loses 1142 input capture (this is the default behaviour). 1143 */ restoresOldCapture(void)1144 bool restoresOldCapture(void) const {return d_restoreOldCapture;} 1145 1146 /*! 1147 \brief 1148 Return whether z-order changes are enabled or disabled for this Window. 1149 1150 \note 1151 This is distinguished from the is/setRiseOnClickEnabled setting in that 1152 if rise on click is disabled it only affects the users ability to affect 1153 the z order of the Window by clicking the mouse; is still possible to 1154 programatically alter the Window z-order by calling the moveToFront, 1155 moveToBack, moveInFront and moveBehind member functions. Whereas if z 1156 ordering is disabled those functions are also precluded from affecting 1157 the Window z position. 1158 1159 \return 1160 - true if z-order changes are enabled for this window. 1161 moveToFront, moveToBack, moveInFront and moveBehind work normally. 1162 - false: z-order changes are disabled for this window. 1163 moveToFront, moveToBack, moveInFront and moveBehind are ignored. 1164 */ 1165 bool isZOrderingEnabled(void) const; 1166 1167 /*! 1168 \brief 1169 Return whether this window will receive multi-click events or multiple 1170 'down' events instead. 1171 1172 \return 1173 - true if the Window will receive double-click and triple-click events. 1174 - false if the Window will receive multiple mouse button down events 1175 instead of double/triple click events. 1176 */ 1177 bool wantsMultiClickEvents(void) const; 1178 1179 /*! 1180 \brief 1181 Return whether mouse button down event autorepeat is enabled for this 1182 window. 1183 1184 \return 1185 - true if autorepeat of mouse button down events is enabled for this 1186 window. 1187 - false if autorepeat of mouse button down events is not enabled for 1188 this window. 1189 */ 1190 bool isMouseAutoRepeatEnabled(void) const; 1191 1192 /*! 1193 \brief 1194 Return the current auto-repeat delay setting for this window. 1195 1196 \return 1197 float value indicating the delay, in seconds, defore the first repeat 1198 mouse button down event will be triggered when autorepeat is enabled. 1199 */ 1200 float getAutoRepeatDelay(void) const; 1201 1202 /*! 1203 \brief 1204 Return the current auto-repeat rate setting for this window. 1205 1206 \return 1207 float value indicating the rate, in seconds, at which repeat mouse 1208 button down events will be generated after the initial delay has 1209 expired. 1210 */ 1211 float getAutoRepeatRate(void) const; 1212 1213 /*! 1214 \brief 1215 Return whether the window wants inputs passed to its attached 1216 child windows when the window has inputs captured. 1217 1218 \return 1219 - true if System should pass captured input events to child windows. 1220 - false if System should pass captured input events to this window only. 1221 */ 1222 bool distributesCapturedInputs(void) const; 1223 1224 /*! 1225 \brief 1226 Return whether this Window is using the system default Tooltip for its 1227 Tooltip window. 1228 1229 \return 1230 - true if the Window will use the system default tooltip. 1231 - false if the window has a custom Tooltip object. 1232 */ 1233 bool isUsingDefaultTooltip(void) const; 1234 1235 /*! 1236 \brief 1237 Return a pointer to the Tooltip object used by this Window. The value 1238 returned may point to the system default Tooltip, a custom Window 1239 specific Tooltip, or be NULL. 1240 1241 \return 1242 Pointer to a Tooltip based object, or NULL. 1243 */ 1244 Tooltip* getTooltip(void) const; 1245 1246 /*! 1247 \brief 1248 Return the custom tooltip type. 1249 1250 \return 1251 String object holding the current custom tooltip window type, or an 1252 empty string if no custom tooltip is set. 1253 */ 1254 String getTooltipType(void) const; 1255 1256 /*! 1257 \brief 1258 Return the current tooltip text set for this Window. 1259 1260 \return 1261 String object holding the current tooltip text set for this window. 1262 */ 1263 const String& getTooltipText(void) const; 1264 1265 /*! 1266 \brief 1267 Return the current tooltip text set for this Window or the inherited one. 1268 If the tooltip text of this window is empty then the inherited value will 1269 be used instead. 1270 1271 \return 1272 String object holding the current tooltip text of this window or the 1273 tooltip text this window inherited. 1274 */ 1275 const String& getTooltipTextIncludingInheritance(void) const; 1276 1277 /*! 1278 \brief 1279 Return whether this window inherits Tooltip text from its parent when 1280 its own tooltip text is not set. 1281 1282 \return 1283 - true if the window inherits tooltip text from its parent when its own 1284 text is not set. 1285 - false if the window does not inherit tooltip text from its parent 1286 (and shows no tooltip when no text is set). 1287 */ 1288 bool inheritsTooltipText(void) const; 1289 1290 /*! 1291 \brief 1292 Return whether this window will rise to the top of the z-order when 1293 clicked with the left mouse button. 1294 1295 \note 1296 This is distinguished from the is/setZOrderingEnabled setting in that 1297 if rise on click is disabled it only affects the users ability to affect 1298 the z order of the Window by clicking the mouse; is still possible to 1299 programatically alter the Window z-order by calling the moveToFront, 1300 moveToBack, moveInFront and moveBehind member functions. Whereas if z 1301 ordering is disabled those functions are also precluded from affecting 1302 the Window z position. 1303 1304 \return 1305 - true if the window will come to the top of other windows when the left 1306 mouse button is pushed within its area. 1307 - false if the window does not change z-order position when the left 1308 mouse button is pushed within its area. 1309 */ isRiseOnClickEnabled(void)1310 bool isRiseOnClickEnabled(void) const { return d_riseOnClick; } 1311 1312 /*! 1313 \brief 1314 Return the GeometryBuffer object for this Window. 1315 1316 \return 1317 Reference to the GeometryBuffer object for this Window. 1318 */ 1319 GeometryBuffer& getGeometryBuffer(); 1320 1321 /*! 1322 \brief 1323 Get the name of the LookNFeel assigned to this window. 1324 1325 \return 1326 String object holding the name of the look assigned to this window. 1327 Returns the empty string if no look is assigned. 1328 */ 1329 const String& getLookNFeel() const; 1330 1331 /*! 1332 \brief 1333 Get whether or not this Window is the modal target. 1334 1335 \return 1336 Returns true if this Window is the modal target, otherwise false. 1337 */ getModalState(void)1338 bool getModalState(void) const 1339 {return(getGUIContext().getModalWindow() == this);} 1340 1341 /*! 1342 \brief 1343 Returns a named user string. 1344 1345 \param name 1346 String object holding the name of the string to be returned. 1347 1348 \return 1349 String object holding the data stored for the requested user string. 1350 1351 \exception UnknownObjectException 1352 thrown if a user string named \a name does not exist. 1353 */ 1354 const String& getUserString(const String& name) const; 1355 1356 /*! 1357 \brief 1358 Return whether a user string with the specified name exists. 1359 1360 \param name 1361 String object holding the name of the string to be checked. 1362 1363 \return 1364 - true if a user string named \a name exists. 1365 - false if no such user string exists. 1366 */ 1367 bool isUserStringDefined(const String& name) const; 1368 1369 /*! 1370 \brief 1371 Returns the active sibling window. 1372 1373 This searches the immediate children of this window's parent, and 1374 returns a pointer to the active window. The method will return this if 1375 we are the immediate child of our parent that is active. If our parent 1376 is not active, or if no immediate child of our parent is active then 0 1377 is returned. If this window has no parent, and this window is not 1378 active then 0 is returned, else this is returned. 1379 1380 \return 1381 A pointer to the immediate child window attached to our parent that is 1382 currently active, or 0 if no immediate child of our parent is active. 1383 */ 1384 Window* getActiveSibling(); 1385 1386 /*! 1387 \brief 1388 Returns whether this window should ignore mouse event and pass them 1389 through to and other windows behind it. In effect making the window 1390 transparent to the mouse. 1391 1392 \return 1393 true if mouse pass through is enabled. 1394 false if mouse pass through is not enabled. 1395 */ isMousePassThroughEnabled(void)1396 bool isMousePassThroughEnabled(void) const {return d_mousePassThroughEnabled;} 1397 1398 /*! 1399 \brief 1400 Returns whether this window is an auto window. 1401 1402 An auto window is typically a Window object created automatically by 1403 CEGUI - for example to form part of a multi-element 'compound' widget. 1404 */ isAutoWindow(void)1405 bool isAutoWindow(void) const {return d_autoWindow;} 1406 1407 /*! 1408 \brief 1409 Returns whether this window is allowed to write XML. 1410 */ isWritingXMLAllowed(void)1411 bool isWritingXMLAllowed(void) const {return d_allowWriteXML;} 1412 1413 /*! 1414 \brief 1415 Returns whether this Window object will receive events generated by 1416 the drag and drop support in the system. 1417 1418 \return 1419 - true if the Window is enabled as a drag and drop target. 1420 - false if the window is not enabled as a drag and drop target. 1421 */ 1422 bool isDragDropTarget() const; 1423 1424 /*! 1425 \brief 1426 Fill in the RenderingContext \a ctx with details of the RenderingSurface 1427 where this Window object should normally do it's rendering. 1428 */ 1429 void getRenderingContext(RenderingContext& ctx) const; 1430 1431 //! implementation of the default getRenderingContext logic. 1432 virtual void getRenderingContext_impl(RenderingContext& ctx) const; 1433 1434 /*! 1435 \brief 1436 return the RenderingSurface currently set for this window. May return 1437 0. 1438 */ 1439 RenderingSurface* getRenderingSurface() const; 1440 1441 /*! 1442 \brief 1443 return the RenderingSurface that will be used by this window as the 1444 target for rendering. 1445 */ 1446 RenderingSurface& getTargetRenderingSurface() const; 1447 1448 /*! 1449 \brief 1450 Returns whether \e automatic use of an imagery caching RenderingSurface 1451 (i.e. a RenderingWindow) is enabled for this window. The reason we 1452 emphasise 'automatic' is because the client may manually set a 1453 RenderingSurface that does exactly the same job. 1454 1455 \return 1456 - true if automatic use of a caching RenderingSurface is enabled. 1457 - false if automatic use of a caching RenderTarget is not enabled. 1458 */ 1459 bool isUsingAutoRenderingSurface() const; 1460 1461 /*! 1462 \brief 1463 Returns the window at the root of the hierarchy starting at this 1464 Window. The root window is defined as the first window back up the 1465 hierarchy that has no parent window. 1466 1467 \return 1468 A pointer to the root window of the hierarchy that this window is 1469 attached to. 1470 */ 1471 const Window* getRootWindow() const; 1472 Window* getRootWindow(); 1473 1474 /*! 1475 \brief 1476 Initialises the Window based object ready for use. 1477 1478 \note 1479 This must be called for every window created. Normally this is handled 1480 automatically by the WindowManager. 1481 1482 \return 1483 Nothing 1484 */ initialiseComponents(void)1485 virtual void initialiseComponents(void) {} 1486 1487 /*! 1488 \brief 1489 Set whether or not this Window will automatically be destroyed when its 1490 parent Window is destroyed. 1491 1492 \param setting 1493 - true to have the Window auto-destroyed when its parent is destroyed 1494 (default behaviour) 1495 - false to have the Window remain after its parent is destroyed. 1496 1497 \return 1498 Nothing 1499 */ 1500 void setDestroyedByParent(bool setting); 1501 1502 /*! 1503 \brief 1504 Set whether this window is always on top, or not. 1505 1506 \param setting 1507 - true to have the Window appear on top of all other non always on top 1508 windows 1509 - false to allow the window to be covered by other normal windows. 1510 1511 \return 1512 Nothing 1513 */ 1514 void setAlwaysOnTop(bool setting); 1515 1516 /*! 1517 \brief 1518 Set whether this window is enabled or disabled. A disabled window 1519 normally can not be interacted with, and may have different rendering. 1520 1521 \param setting 1522 - true to enable the Window 1523 - false to disable the Window. 1524 1525 \return 1526 Nothing 1527 */ 1528 void setEnabled(bool setting); 1529 1530 /*! 1531 \brief 1532 Set whether this window is enabled or disabled. A disabled window 1533 normally can not be interacted with, and may have different rendering. 1534 1535 \param setting 1536 - true to disable the Window 1537 - false to enable the Window. 1538 1539 \return 1540 Nothing 1541 */ 1542 void setDisabled(bool setting); 1543 1544 /*! 1545 \brief 1546 enable the Window to allow interaction. 1547 1548 \return 1549 Nothing 1550 */ enable(void)1551 void enable(void) {setEnabled(true);} 1552 1553 /*! 1554 \brief 1555 disable the Window to prevent interaction. 1556 1557 \return 1558 Nothing 1559 */ disable(void)1560 void disable(void) {setEnabled(false);} 1561 1562 /*! 1563 \brief 1564 Set whether the Window is visible or hidden. 1565 1566 \param setting 1567 - true to make the Window visible. 1568 - false to make the Window hidden. 1569 1570 \note 1571 Hiding the active window will cause that window to become deactivated. 1572 Showing a window does not, however, automatically cause that window to 1573 become the active window (call Window::activate after making the window 1574 visible to activate it). 1575 1576 \return 1577 Nothing 1578 */ 1579 void setVisible(bool setting); 1580 1581 /*! 1582 \brief 1583 show the Window. 1584 1585 \note 1586 Showing a window does not automatically activate the window. If you 1587 want the window to also become active you will need to call the 1588 Window::activate member also. 1589 1590 \return 1591 Nothing 1592 */ show(void)1593 void show(void) {setVisible(true);} 1594 1595 /*! 1596 \brief 1597 hide the Window. 1598 \note 1599 If the window is the active window, it will become deactivated as a 1600 result of being hidden. 1601 1602 \return 1603 Nothing 1604 */ hide(void)1605 void hide(void) {setVisible(false);} 1606 1607 /*! 1608 \brief 1609 Activate the Window giving it input focus and bringing it to the top of 1610 all windows with the same always-on-top settig as this Window. 1611 1612 \return 1613 Nothing 1614 */ 1615 void activate(void); 1616 1617 /*! 1618 \brief 1619 Deactivate the window. No further inputs will be received by the window 1620 until it is re-activated either programmatically or by the user 1621 interacting with the gui. 1622 1623 \return 1624 Nothing. 1625 */ 1626 void deactivate(void); 1627 1628 /*! 1629 \brief 1630 Set whether this Window will be clipped by its parent window(s). 1631 1632 \param setting 1633 - true to have the Window clipped so that rendering is constrained to 1634 within the area of its parent(s). 1635 - false to have rendering constrained to the screen only. 1636 1637 \return 1638 Nothing 1639 */ 1640 void setClippedByParent(bool setting); 1641 1642 /*! 1643 \brief 1644 Set the current ID for the Window. 1645 1646 \param ID 1647 Client assigned ID code for this Window. The GUI system assigns no 1648 meaning to any IDs, they are a device purely for client code usage. 1649 1650 \return 1651 Nothing 1652 */ 1653 void setID(uint ID); 1654 1655 /*! 1656 \brief 1657 Set the current text string for the Window. 1658 1659 \param text 1660 String object containing the text that is to be set as the Window text. 1661 1662 \return 1663 Nothing 1664 */ 1665 void setText(const String& text); 1666 1667 /*! 1668 \brief 1669 Insert the text string \a text into the current text string for the 1670 Window object at the position specified by \a position. 1671 1672 \param text 1673 String object holding the text that is to be inserted into the Window 1674 object's current text string. 1675 1676 \param position 1677 The characted index position where the string \a text should be 1678 inserted. 1679 */ 1680 void insertText(const String& text, const String::size_type position); 1681 1682 /*! 1683 \brief 1684 Append the string \a text to the currect text string for the Window 1685 object. 1686 1687 \param text 1688 String object holding the text that is to be appended to the Window 1689 object's current text string. 1690 */ 1691 void appendText(const String& text); 1692 1693 /*! 1694 \brief 1695 Set the font used by this Window. 1696 1697 \param font 1698 Pointer to the Font object to be used by this Window. 1699 If \a font is NULL, the default font will be used. 1700 1701 \return 1702 Nothing 1703 */ 1704 void setFont(const Font* font); 1705 1706 /*! 1707 \brief 1708 Set the font used by this Window. 1709 1710 \param name 1711 String object holding the name of the Font object to be used by this 1712 Window. If \a name == "", the default font will be used. 1713 1714 \return 1715 Nothing 1716 1717 \exception UnknownObjectException 1718 thrown if the specified Font is unknown within the system. 1719 */ 1720 void setFont(const String& name); 1721 1722 using NamedElement::removeChild; 1723 /*! 1724 \brief 1725 Remove the first child Window with the specified ID. If there is more 1726 than one attached Window objects with the specified ID, only the fist 1727 one encountered will be removed. 1728 1729 \param ID 1730 ID number assigned to the Window to be removed. If no Window with ID 1731 code \a ID is attached, nothing happens. 1732 1733 \return 1734 Nothing. 1735 */ 1736 void removeChild(uint ID); 1737 1738 /*! 1739 \brief 1740 Creates a child window attached to this window. 1741 1742 \param type 1743 String that describes the type of Window to be created. A valid 1744 WindowFactory for the specified type must be registered. 1745 1746 \param name 1747 String that holds the name that is to be given to the new window. If 1748 this string is empty, a name will be generated for the window. 1749 1750 \return 1751 Pointer to the newly created child Window object. 1752 */ 1753 Window* createChild(const String& type, const String& name = ""); 1754 1755 /*! 1756 \brief 1757 Destroys a child window of this window 1758 1759 \param wnd 1760 The child window to destroy 1761 */ 1762 void destroyChild(Window* wnd); 1763 1764 /*! 1765 \brief 1766 Destroys a child window of this window 1767 1768 \param name_path 1769 Name path that references the window to destroy 1770 */ 1771 void destroyChild(const String& name_path); 1772 1773 /*! 1774 \brief 1775 Move the Window to the top of the z order. 1776 1777 - If the Window is a non always-on-top window it is moved the the top of 1778 all other non always-on-top sibling windows, and the process repeated 1779 for all ancestors. 1780 - If the Window is an always-on-top window it is moved to the of of all 1781 sibling Windows, and the process repeated for all ancestors. 1782 1783 \return 1784 Nothing 1785 */ 1786 void moveToFront(); 1787 1788 /*! 1789 \brief 1790 Move the Window to the bottom of the Z order. 1791 1792 - If the window is non always-on-top the Window is sent to the very 1793 bottom of its sibling windows and the process repeated for all 1794 ancestors. 1795 - If the window is always-on-top, the Window is sent to the bottom of 1796 all sibling always-on-top windows and the process repeated for all 1797 ancestors. 1798 1799 \return 1800 Nothing 1801 */ 1802 void moveToBack(); 1803 1804 /*! 1805 \brief 1806 Move this window immediately above it's sibling \a window in the z order. 1807 1808 No action will be taken under the following conditions: 1809 - \a window is 0. 1810 - \a window is not a sibling of this window. 1811 - \a window and this window have different AlwaysOnTop settings. 1812 - z ordering is disabled for this window. 1813 1814 \param window 1815 The sibling window that this window will be moved in front of. 1816 */ 1817 void moveInFront(const Window* const window); 1818 1819 /*! 1820 \brief 1821 Move this window immediately behind it's sibling \a window in the z 1822 order. 1823 1824 No action will be taken under the following conditions: 1825 - \a window is 0. 1826 - \a window is not a sibling of this window. 1827 - \a window and this window have different AlwaysOnTop settings. 1828 - z ordering is disabled for this window. 1829 1830 \param window 1831 The sibling window that this window will be moved behind. 1832 */ 1833 void moveBehind(const Window* const window); 1834 1835 /*! 1836 \brief 1837 Return the (visual) z index of the window on it's parent. 1838 1839 The z index is a number that indicates the order that windows will be 1840 drawn (but is not a 'z co-ordinate', as such). Higher numbers are in 1841 front of lower numbers. 1842 1843 The number returned will not be stable, and generally should be used to 1844 compare with the z index of sibling windows (and only sibling windows) 1845 to discover the current z ordering of those windows. 1846 */ 1847 size_t getZIndex() const; 1848 1849 /*! 1850 \brief 1851 Return whether /a this Window is in front of the given window. 1852 1853 \note 1854 Here 'in front' just means that one window is drawn after the other, it 1855 is not meant to imply that the windows are overlapping nor that one 1856 window is obscured by the other. 1857 */ 1858 bool isInFront(const Window& wnd) const; 1859 1860 /*! 1861 \brief 1862 Return whether /a this Window is behind the given window. 1863 1864 \note 1865 Here 'behind' just means that one window is drawn before the other, it 1866 is not meant to imply that the windows are overlapping nor that one 1867 window is obscured by the other. 1868 */ 1869 bool isBehind(const Window& wnd) const; 1870 1871 /*! 1872 \brief 1873 Captures input to this window 1874 1875 \return 1876 - true if input was successfully captured to this window. 1877 - false if input could not be captured to this window 1878 (maybe because the window is not active). 1879 */ 1880 bool captureInput(void); 1881 1882 /*! 1883 \brief 1884 Releases input capture from this Window. If this Window does not have 1885 inputs captured, nothing happens. 1886 1887 \return 1888 Nothing 1889 */ 1890 void releaseInput(void); 1891 1892 /*! 1893 \brief 1894 Set whether this window will remember and restore the previous window 1895 that had inputs captured. 1896 1897 \param setting 1898 - true: The window will remember and restore the previous capture 1899 window. The CaptureLost event is not fired on the previous window 1900 when this window steals input capture. When this window releases 1901 capture, the old capture window is silently restored. 1902 1903 - false: Input capture works as normal, each window losing capture is 1904 signalled via CaptureLost, and upon the final release of capture, no 1905 previous setting is restored (this is the default behaviour). 1906 1907 \return 1908 Nothing 1909 */ 1910 void setRestoreOldCapture(bool setting); 1911 1912 /*! 1913 \brief 1914 Set the current alpha value for this window. 1915 1916 \note 1917 The alpha value set for any given window may or may not be the final 1918 alpha value that is used when rendering. All window objects, by 1919 default, inherit alpha from thier parent window(s) - this will blend 1920 child windows, relatively, down the line of inheritance. This behaviour 1921 can be overridden via the setInheritsAlpha() method. To return the true 1922 alpha value that will be applied when rendering, use the 1923 getEffectiveAlpha() method. 1924 1925 \param alpha 1926 The new alpha value for the window. 1927 Value should be between 0.0f and 1.0f. 1928 1929 \return 1930 Nothing 1931 */ 1932 void setAlpha(const float alpha); 1933 1934 /*! 1935 \brief 1936 Sets whether this Window will inherit alpha from its parent windows. 1937 1938 \param setting 1939 - true if the Window should use inherited alpha. 1940 - false if the Window should have an independant alpha value. 1941 1942 \return 1943 Nothing 1944 */ 1945 void setInheritsAlpha(bool setting); 1946 1947 /*! 1948 \brief 1949 Invalidate this window causing at least this window to be redrawn during 1950 the next rendering pass. 1951 1952 \return 1953 Nothing 1954 1955 \deprecated 1956 This function is deprecated in favour of the version taking a boolean. 1957 */ 1958 void invalidate(void); 1959 1960 /*! 1961 \brief 1962 Invalidate this window and - dependant upon \a recursive - all child 1963 content, causing affected windows to be redrawn during the next 1964 rendering pass. 1965 1966 \param recursive 1967 Boolean value indicating whether attached child content should also be 1968 invalidated. 1969 - true will cause all child content to be invalidated also. 1970 - false will just invalidate this single window. 1971 1972 \return 1973 Nothing 1974 */ 1975 void invalidate(const bool recursive); 1976 1977 /*! 1978 \brief 1979 Set the mouse cursor image to be used when the mouse enters this window. 1980 1981 \param image 1982 Pointer to the Image object to use as the mouse cursor image when the 1983 mouse enters the area for this Window. 1984 1985 \return 1986 Nothing. 1987 */ 1988 void setMouseCursor(const Image* image); 1989 1990 /*! 1991 \brief 1992 Set the mouse cursor image to be used when the mouse enters this window. 1993 1994 \param imageset 1995 String object that contains the name of the Imageset that contains the 1996 image to be used. 1997 1998 \param name 1999 String object that contains the name of the Image to use. 2000 2001 \return 2002 Nothing. 2003 2004 \exception UnknownObjectException 2005 thrown if no Image named \a name exists. 2006 */ 2007 void setMouseCursor(const String& name); 2008 2009 /*! 2010 \brief 2011 Set the user data set for this Window. 2012 2013 Each Window can have some client assigned data attached to it, this data 2014 is not used by the GUI system in any way. Interpretation of the data is 2015 entirely application specific. 2016 2017 \param user_data 2018 pointer to the user data that is to be set for this window. 2019 2020 \return 2021 Nothing. 2022 */ setUserData(void * user_data)2023 void setUserData(void* user_data) {d_userData = user_data;} 2024 2025 /*! 2026 \brief 2027 Set whether z-order changes are enabled or disabled for this Window. 2028 2029 \note 2030 This is distinguished from the is/setRiseOnClickEnabled setting in that 2031 if rise on click is disabled it only affects the users ability to affect 2032 the z order of the Window by clicking the mouse; is still possible to 2033 programatically alter the Window z-order by calling the moveToFront, 2034 moveToBack, moveInFront and moveBehind member functions. Whereas if z 2035 ordering is disabled those functions are also precluded from affecting 2036 the Window z position. 2037 2038 \param setting 2039 - true if z-order changes are enabled for this window. 2040 moveToFront, moveToBack, moveInFront and moveBehind work normally. 2041 - false: z-order changes are disabled for this window. 2042 moveToFront, moveToBack, moveInFront and moveBehind are ignored. 2043 2044 \return 2045 Nothing. 2046 */ 2047 void setZOrderingEnabled(bool setting); 2048 2049 /*! 2050 \brief 2051 Set whether this window will receive multi-click events or multiple 2052 'down' events instead. 2053 2054 \param setting 2055 - true if the Window will receive double-click and triple-click events. 2056 - false if the Window will receive multiple mouse button down events 2057 instead of double/triple click events. 2058 2059 \return 2060 Nothing. 2061 */ 2062 void setWantsMultiClickEvents(bool setting); 2063 2064 /*! 2065 \brief 2066 Set whether mouse button down event autorepeat is enabled for this 2067 window. 2068 2069 \param setting 2070 - true to enable autorepeat of mouse button down events. 2071 - false to disable autorepeat of mouse button down events. 2072 2073 \return 2074 Nothing. 2075 */ 2076 void setMouseAutoRepeatEnabled(bool setting); 2077 2078 /*! 2079 \brief 2080 Set the current auto-repeat delay setting for this window. 2081 2082 \param delay 2083 float value indicating the delay, in seconds, defore the first repeat 2084 mouse button down event should be triggered when autorepeat is enabled. 2085 2086 \return 2087 Nothing. 2088 */ 2089 void setAutoRepeatDelay(float delay); 2090 2091 /*! 2092 \brief 2093 Set the current auto-repeat rate setting for this window. 2094 2095 \param rate 2096 float value indicating the rate, in seconds, at which repeat mouse 2097 button down events should be generated after the initial delay has 2098 expired. 2099 2100 \return 2101 Nothing. 2102 */ 2103 void setAutoRepeatRate(float rate); 2104 2105 /*! 2106 \brief 2107 Set whether the window wants inputs passed to its attached 2108 child windows when the window has inputs captured. 2109 2110 \param setting 2111 - true if System should pass captured input events to child windows. 2112 - false if System should pass captured input events to this window only. 2113 */ 2114 void setDistributesCapturedInputs(bool setting); 2115 2116 /*! 2117 \brief 2118 Internal support method for drag & drop. You do not normally call 2119 this directly from client code. See the DragContainer class. 2120 */ 2121 void notifyDragDropItemEnters(DragContainer* item); 2122 2123 /*! 2124 \brief 2125 Internal support method for drag & drop. You do not normally call 2126 this directly from client code. See the DragContainer class. 2127 */ 2128 void notifyDragDropItemLeaves(DragContainer* item); 2129 2130 /*! 2131 \brief 2132 Internal support method for drag & drop. You do not normally call 2133 this directly from client code. See the DragContainer class. 2134 */ 2135 void notifyDragDropItemDropped(DragContainer* item); 2136 2137 /*! 2138 \brief 2139 Internal destroy method which actually just adds the window and any 2140 parent destructed child windows to the dead pool. 2141 2142 This is virtual to allow for specialised cleanup which may be required 2143 in some advanced cases. If you override this for the above reason, you 2144 MUST call this base class version. 2145 2146 \note 2147 You never have to call this method yourself, use WindowManager to 2148 destroy your Window objects (which will call this for you). 2149 */ 2150 virtual void destroy(void); 2151 2152 /*! 2153 \brief 2154 Set the custom Tooltip object for this Window. This value may be 0 to 2155 indicate that the Window should use the system default Tooltip object. 2156 2157 \param tooltip 2158 Pointer to a valid Tooltip based object which should be used as the 2159 tooltip for this Window, or 0 to indicate that the Window should use the 2160 system default Tooltip object. Note that when passing a pointer to a 2161 Tooltip object, ownership of the Tooltip does not pass to this Window 2162 object. 2163 2164 \return 2165 Nothing. 2166 */ 2167 void setTooltip(Tooltip* tooltip); 2168 2169 /*! 2170 \brief 2171 Set the custom Tooltip to be used by this Window by specifying a Window 2172 type. 2173 2174 The Window will internally attempt to create an instance of the 2175 specified window type (which must be derived from the base Tooltip 2176 class). If the Tooltip creation fails, the error is logged and the 2177 Window will revert to using either the existing custom Tooltip or the 2178 system default Tooltip. 2179 2180 \param tooltipType 2181 String object holding the name of the Tooltip based Window type which 2182 should be used as the Tooltip for this Window. 2183 2184 \return 2185 Nothing. 2186 */ 2187 void setTooltipType(const String& tooltipType); 2188 2189 /*! 2190 \brief 2191 Set the tooltip text for this window. 2192 2193 \param tip 2194 String object holding the text to be displayed in the tooltip for this 2195 Window. 2196 2197 \return 2198 Nothing. 2199 */ 2200 void setTooltipText(const String& tip); 2201 2202 /*! 2203 \brief 2204 Set whether this window inherits Tooltip text from its parent when its 2205 own tooltip text is not set. 2206 2207 \param setting 2208 - true if the window should inherit tooltip text from its parent when 2209 its own text is not set. 2210 - false if the window should not inherit tooltip text from its parent 2211 (and so show no tooltip when no text is set). 2212 2213 \return 2214 Nothing. 2215 */ 2216 void setInheritsTooltipText(bool setting); 2217 2218 /*! 2219 \brief 2220 Set whether this window will rise to the top of the z-order when clicked 2221 with the left mouse button. 2222 2223 \note 2224 This is distinguished from the is/setZOrderingEnabled setting in that 2225 if rise on click is disabled it only affects the users ability to affect 2226 the z order of the Window by clicking the mouse; is still possible to 2227 programatically alter the Window z-order by calling the moveToFront, 2228 moveToBack, moveInFront and moveBehind member functions. Whereas if z 2229 ordering is disabled those functions are also precluded from affecting 2230 the Window z position. 2231 2232 \param setting 2233 - true if the window should come to the top of other windows when the 2234 left mouse button is pushed within its area. 2235 - false if the window should not change z-order position when the left 2236 mouse button is pushed within its area. 2237 2238 \return 2239 Nothing. 2240 */ setRiseOnClickEnabled(bool setting)2241 void setRiseOnClickEnabled(bool setting) { d_riseOnClick = setting; } 2242 2243 /*! 2244 \brief 2245 Set the LookNFeel that shoule be used for this window. 2246 2247 \param look 2248 String object holding the name of the look to be assigned to the window. 2249 2250 \exception UnknownObjectException 2251 thrown if the look'n'feel specified by \a look does not exist. 2252 2253 \exception NullObjectException 2254 thrown if the Window does not have a WindowRenderer assigned to it. 2255 see Window::setWindowRenderer. 2256 2257 \note 2258 This is really intended as an internal function. The way that client 2259 code is supposed to use skins is by defining a Falagard mapping (either 2260 in a scheme xml file or in code) and then create instances of that 2261 mapped type via WindowManager. See 2262 WindowFactoryManager::addFalagardWindowMapping and \ref xml_scheme. 2263 With that being said, it is possible for client code to use this 2264 function so long as you are aware of the implications of doing so: 2265 - Automatically created child windows (AutoWindows) will be deleted, and 2266 references or pointers you hold to these will become invalid. 2267 - Aside from those absolutely required, there is not guarantee that the 2268 newly assigned look will create the same set of child windows, nor 2269 that any created windows will be of any given type. 2270 - Any properties set on automatically created child windows after their 2271 creation will be lost - even if the new look creates a child of the 2272 same type with the same name. 2273 */ 2274 virtual void setLookNFeel(const String& look); 2275 2276 /*! 2277 \brief 2278 Set the modal state for this Window. 2279 2280 \param state 2281 Boolean value defining if this Window should be the modal target. 2282 - true if this Window should be activated and set as the modal target. 2283 - false if the modal target should be cleared if this Window is 2284 currently the modal target. 2285 2286 \return 2287 Nothing. 2288 */ 2289 void setModalState(bool state); 2290 2291 /*! 2292 \brief 2293 Layout child window content. 2294 2295 Laying out of child content includes: 2296 - ensuring content specified in any assigned WidgetLook has its area 2297 rectangles sychronised. 2298 - assigned WindowRenderer given the opportunity to update child 2299 content areas as needed. 2300 - All content is then potentially updated via the onParentSized 2301 notification as required by changes in non-client and client area 2302 rectangles. 2303 2304 The system may call this at various times (like when a window is resized 2305 for example), and it may be invoked directly where required. 2306 2307 \param nonclient_sized_hint 2308 Hint that the non-client area rectangle has changed size. 2309 2310 \param client_sized_hint 2311 Hint that the client area rectangle has changed size. 2312 2313 \note 2314 The hint parameters are essentially a way to force onParentSized 2315 notifications for a given type (client / nonclient) of child window. 2316 Setting a hint to false does not mean a notification will not happen, 2317 instead it means that the function is to do its best to determine 2318 whether a given notification is required to be sent. 2319 */ 2320 virtual void performChildWindowLayout(bool nonclient_sized_hint = false, 2321 bool client_sized_hint = false); 2322 2323 /*! 2324 \brief 2325 Sets the value a named user string, creating it as required. 2326 2327 \param name 2328 String object holding the name of the string to be returned. 2329 2330 \param value 2331 String object holding the value to be assigned to the user string. 2332 2333 \return 2334 Nothing. 2335 */ 2336 void setUserString(const String& name, const String& value); 2337 2338 /*! 2339 \brief 2340 Causes the Window object to render itself and all of it's attached 2341 children 2342 2343 \return 2344 Nothing 2345 */ 2346 void render(); 2347 2348 /*! 2349 \brief 2350 Cause window to update itself and any attached children. Client code 2351 does not need to call this method; to ensure full, and proper updates, 2352 call the injectTimePulse methodname method provided by the System class. 2353 2354 \note 2355 The update order is such that 'this' window is updated prior to any 2356 child windows, this is so that child windows that access the parent in 2357 their update code get the correct updated state. 2358 2359 \param elapsed 2360 float value indicating the number of seconds passed since the last 2361 update. 2362 2363 \return 2364 Nothing. 2365 */ 2366 virtual void update(float elapsed); 2367 2368 /*! 2369 \brief 2370 Asks the widget to perform a clipboard copy to the provided clipboard 2371 2372 \param clipboard 2373 Target clipboard class 2374 2375 \return 2376 true if the copy was successful and allowed, false otherwise 2377 */ 2378 virtual bool performCopy(Clipboard& clipboard); 2379 2380 /*! 2381 \brief 2382 Asks the widget to perform a clipboard cut to the provided clipboard 2383 2384 \param clipboard 2385 Target clipboard class 2386 2387 \return 2388 true if the cut was successful and allowed, false otherwise 2389 */ 2390 virtual bool performCut(Clipboard& clipboard); 2391 2392 /*! 2393 \brief 2394 Asks the widget to perform a clipboard paste from the provided clipboard 2395 2396 \param clipboard 2397 Source clipboard class 2398 2399 \return 2400 true if the paste was successful and allowed, false otherwise 2401 */ 2402 virtual bool performPaste(Clipboard& clipboard); 2403 2404 /*! 2405 \brief 2406 Writes an xml representation of this window object to \a out_stream. 2407 2408 \param xml_stream 2409 Stream where xml data should be output. 2410 2411 \return 2412 Nothing. 2413 */ 2414 virtual void writeXMLToStream(XMLSerializer& xml_stream) const; 2415 2416 /*! 2417 \brief 2418 Sets the internal 'initialising' flag to true. 2419 This can be use to optimize initialisation of some widgets, and is called 2420 automatically by the layout XML handler when it has created a window. 2421 That is just after the window has been created, but before any children or 2422 properties are read. 2423 */ beginInitialisation(void)2424 virtual void beginInitialisation(void) {d_initialising = true;} 2425 2426 /*! 2427 \brief 2428 Sets the internal 'initialising' flag to false. 2429 This is called automatically by the layout XML handler when it is done 2430 creating a window. That is after all properties and children have been 2431 loaded and just before the next sibling gets created. 2432 */ endInitialisation(void)2433 virtual void endInitialisation(void) {d_initialising = false;} 2434 2435 /*! 2436 \brief 2437 Sets whether this window should ignore mouse events and pass them 2438 through to any windows behind it. In effect making the window 2439 transparent to the mouse. 2440 2441 \param setting 2442 true if mouse pass through is enabled. 2443 false if mouse pass through is not enabled. 2444 */ setMousePassThroughEnabled(bool setting)2445 void setMousePassThroughEnabled(bool setting) {d_mousePassThroughEnabled = setting;} 2446 2447 /*! 2448 \brief 2449 Assign the WindowRenderer type to be used when rendering this window. 2450 2451 \param name 2452 The factory name of the WindowRenderer to use. 2453 2454 \note 2455 This is really intended as an internal function. The way that client 2456 code is supposed to use skins is by defining a Falagard mapping (either 2457 in a scheme xml file or in code) and then create instances of that 2458 mapped type via WindowManager. See 2459 WindowFactoryManager::addFalagardWindowMapping and \ref xml_scheme. 2460 */ 2461 void setWindowRenderer(const String& name); 2462 2463 /*! 2464 \brief 2465 Get the currently assigned WindowRenderer. (Look'N'Feel specification). 2466 2467 \return 2468 A pointer to the assigned window renderer object. 2469 0 if no window renderer is assigned. 2470 */ 2471 WindowRenderer* getWindowRenderer(void) const; 2472 2473 /*! 2474 \brief 2475 Get the factory name of the currently assigned WindowRenderer. 2476 (Look'N'Feel specification). 2477 2478 \return 2479 The factory name of the currently assigned WindowRenderer. 2480 If no WindowRenderer is assigned an empty string is returned. 2481 */ 2482 const String& getWindowRendererName() const; 2483 2484 /*! 2485 \brief 2486 Sets whether this window is allowed to write XML 2487 */ setWritingXMLAllowed(bool allow)2488 void setWritingXMLAllowed(bool allow) {d_allowWriteXML = allow;} 2489 2490 /*! 2491 \brief 2492 Inform the window, and optionally all children, that screen area 2493 rectangles have changed. 2494 2495 \param recursive 2496 - true to recursively call notifyScreenAreaChanged on attached child 2497 Window objects. 2498 - false to just process \e this Window. 2499 */ 2500 virtual void notifyScreenAreaChanged(bool recursive = true); 2501 2502 /*! 2503 \brief 2504 Changes the widget's falagard type, thus changing its look'n'feel and optionally its 2505 renderer in the process. 2506 2507 \param type 2508 New look'n'feel of the widget 2509 2510 \param type 2511 New renderer of the widget 2512 */ 2513 void setFalagardType(const String& type, const String& rendererType = ""); 2514 2515 /*! 2516 \brief 2517 Specifies whether this Window object will receive events generated by 2518 the drag and drop support in the system. 2519 2520 \param setting 2521 - true to enable the Window as a drag and drop target. 2522 - false to disable the Window as a drag and drop target. 2523 */ 2524 void setDragDropTarget(bool setting); 2525 2526 /*! 2527 \brief 2528 Set the RenderingSurface to be associated with this Window, or 0 if 2529 none is required. 2530 \par 2531 If this function is called, and the option for automatic use of an 2532 imagery caching RenderingSurface is enabled, any automatically created 2533 RenderingSurface will be released, and the affore mentioned option will 2534 be disabled. 2535 \par 2536 If after having set a custom RenderingSurface you then subsequently 2537 enable the automatic use of an imagery caching RenderingSurface by 2538 calling setUsingAutoRenderingSurface, the previously set 2539 RenderingSurface will be disassociated from the Window. Note that the 2540 previous RenderingSurface is not destroyed or cleaned up at all - this 2541 is the job of whoever created that object initially. 2542 2543 \param target 2544 Pointer to the RenderingSurface object to be associated with the window. 2545 */ 2546 void setRenderingSurface(RenderingSurface* surface); 2547 2548 /*! 2549 \brief 2550 Invalidate the chain of rendering surfaces from this window backwards to 2551 ensure they get properly redrawn - but doing the minimum amount of work 2552 possibe - next render. 2553 */ 2554 void invalidateRenderingSurface(); 2555 2556 /*! 2557 \brief 2558 Sets whether \e automatic use of an imagery caching RenderingSurface 2559 (i.e. a RenderingWindow) is enabled for this window. The reason we 2560 emphasise 'atutomatic' is because the client may manually set a 2561 RenderingSurface that does exactlythe same job. 2562 \par 2563 Note that this setting really only controls whether the Window 2564 automatically creates and manages the RenderingSurface, as opposed to 2565 the \e use of the RenderingSurface. If a RenderingSurfaceis set for the 2566 Window it will be used regardless of this setting. 2567 \par 2568 Enabling this option will cause the Window to attempt to create a 2569 suitable RenderingSurface (which will actually be a RenderingWindow). 2570 If there is an existing RenderingSurface assocated with this Window, it 2571 will be removed as the Window's RenderingSurface 2572 <em>but not destroyed</em>; whoever created the RenderingSurface in the 2573 first place should take care of its destruction. 2574 \par 2575 Disabling this option will cause any automatically created 2576 RenderingSurface to be released. 2577 \par 2578 It is possible that the renderer in use may not support facilities for 2579 RenderingSurfaces that are suitable for full imagery caching. If this 2580 is the case, then calling getRenderingSurface after enabling this option 2581 will return 0. In these cases this option will still show as being 2582 'enabled', this is because Window \e settings should not be influenced 2583 by capabilities the renderer in use; for example, this enables correct 2584 XML layouts to be written from a Window on a system that does not 2585 support such RenderingSurfaces, so that the layout will function as 2586 preferred on systems that do. 2587 \par 2588 If this option is enabled, and the client subsequently assigns a 2589 different RenderingSurface to the Window, the existing automatically 2590 created RenderingSurface will be released and this setting will be 2591 disabled. 2592 2593 \param setting 2594 - true to enable automatic use of an imagery caching RenderingSurface. 2595 - false to disable automatic use of an imagery caching RenderingSurface. 2596 */ 2597 void setUsingAutoRenderingSurface(bool setting); 2598 2599 //! Return the parsed RenderedString object for this window. 2600 const RenderedString& getRenderedString() const; 2601 //! Return a pointer to any custom RenderedStringParser set, or 0 if none. 2602 RenderedStringParser* getCustomRenderedStringParser() const; 2603 //! Set a custom RenderedStringParser, or 0 to remove an existing one. 2604 void setCustomRenderedStringParser(RenderedStringParser* parser); 2605 //! return the active RenderedStringParser to be used 2606 virtual RenderedStringParser& getRenderedStringParser() const; 2607 //! return whether text parsing is enabled for this window. 2608 bool isTextParsingEnabled() const; 2609 //! set whether text parsing is enabled for this window. 2610 void setTextParsingEnabled(const bool setting); 2611 2612 //! set margin 2613 virtual void setMargin(const UBox& margin); 2614 //! retrieves currently set margin 2615 const UBox& getMargin() const; 2616 2617 //! return Vector2 \a pos after being fully unprojected for this Window. 2618 Vector2f getUnprojectedPosition(const Vector2f& pos) const; 2619 2620 //! return the pointer to the BidiVisualMapping for this window, if any. getBidiVisualMapping()2621 const BidiVisualMapping* getBidiVisualMapping() const 2622 {return d_bidiVisualMapping;} 2623 2624 /*! 2625 \brief 2626 Adds the named property to the XML ban list for this window 2627 Essentially a property that is banned from XML will never end up being saved to it. 2628 This is very useful if 2 properties overlap (XPosition and Position for example). 2629 2630 Please note that properties that are not writable (read-only properties) are 2631 implicitly/automatically banned from XML, no need to ban them manually. 2632 2633 \param property_name 2634 Name of the property you want to ban 2635 */ 2636 void banPropertyFromXML(const String& property_name); 2637 2638 /*! 2639 \brief 2640 Adds the named property to the XML ban list for this window and all of its child windows. 2641 Essentially a property that is banned from XML will never end up being saved to it. 2642 This is very useful if 2 properties overlap (XPosition and Position for example). 2643 2644 Please note that properties that are not writable (read-only properties) are 2645 implicitly/automatically banned from XML, no need to ban them manually. 2646 2647 \param property_name 2648 Name of the property you want to ban 2649 */ 2650 void banPropertyFromXMLRecursive(const String& property_name); 2651 2652 /*! 2653 \brief 2654 Removes the named property from the XML ban list for this window. 2655 Essentially a property that is banned from XML will never end up being saved to it. 2656 2657 Please note that properties that are not writable (read-only properties) are 2658 implicitly/automatically banned from XML. 2659 2660 \param property_name 2661 Name of the property you want to unban 2662 */ 2663 void unbanPropertyFromXML(const String& property_name); 2664 2665 /*! 2666 \brief 2667 Removes the named property from the XML ban list for this window and all of its child windows. 2668 Essentially a property that is banned from XML will never end up being saved to it. 2669 2670 Please note that properties that are not writable (read-only properties) are 2671 implicitly/automatically banned from XML. 2672 2673 \param property_name 2674 Name of the property you want to unban 2675 */ 2676 void unbanPropertyFromXMLRecursive(const String& property_name); 2677 2678 2679 /*! 2680 \brief 2681 Return whether the named property is banned from XML 2682 2683 \note 2684 Read-only properties and properties that can't write to XML streams 2685 are implicitly banned. This method will return true for them. 2686 */ 2687 bool isPropertyBannedFromXML(const String& property_name) const; 2688 2689 //! Add the given property to the XML ban list for this window. 2690 void banPropertyFromXML(const Property* property); 2691 2692 //! Remove the given property from the XML ban list for this window. 2693 void unbanPropertyFromXML(const Property* property); 2694 2695 /*! 2696 \brief 2697 Return whether given property is banned from XML 2698 2699 \note 2700 Read-only properties and properties that can't write to XML streams 2701 are implicitly banned. This method will return true for them. 2702 */ 2703 bool isPropertyBannedFromXML(const Property* property) const; 2704 2705 /*! 2706 \brief 2707 Set the window update mode. This mode controls the behaviour of the 2708 Window::update member function such that updates are processed for 2709 this window (and therefore it's child content) according to the set 2710 mode. 2711 2712 \note 2713 Disabling updates can have negative effects on the behaviour of CEGUI 2714 windows and widgets; updates should be disabled selectively and 2715 cautiously - if you are unsure of what you are doing, leave the mode 2716 set to WUM_ALWAYS. 2717 2718 \param mode 2719 One of the WindowUpdateMode enumerated values indicating the mode to 2720 set for this Window. 2721 */ 2722 void setUpdateMode(const WindowUpdateMode mode); 2723 2724 /*! 2725 \brief 2726 Return the current window update mode that is set for this Window. 2727 This mode controls the behaviour of the Window::update member function 2728 such that updates are processed for this window (and therefore it's 2729 child content) according to the set mode. 2730 2731 \note 2732 Disabling updates can have negative effects on the behaviour of CEGUI 2733 windows and widgets; updates should be disabled selectively and 2734 cautiously - if you are unsure of what you are doing, leave the mode 2735 set to WUM_ALWAYS. 2736 2737 \return 2738 One of the WindowUpdateMode enumerated values indicating the current 2739 mode set for this Window. 2740 */ 2741 WindowUpdateMode getUpdateMode() const; 2742 2743 /*! 2744 \brief 2745 Set whether mouse input that is not directly handled by this Window 2746 (including it's event subscribers) should be propagated back to the 2747 Window's parent. 2748 2749 \param enabled 2750 - true if unhandled mouse input should be propagated to the parent. 2751 - false if unhandled mouse input should not be propagated. 2752 */ 2753 void setMouseInputPropagationEnabled(const bool enabled); 2754 2755 /*! 2756 \brief 2757 Return whether mouse input that is not directly handled by this Window 2758 (including it's event subscribers) should be propagated back to the 2759 Window's parent. 2760 2761 \return 2762 - true if unhandled mouse input will be propagated to the parent. 2763 - false if unhandled mouse input will not be propagated. 2764 */ 2765 bool isMouseInputPropagationEnabled() const; 2766 2767 /*! 2768 \brief 2769 Clones this Window and returns the result 2770 2771 \param 2772 deepCopy if true, even children are copied 2773 2774 \return 2775 the cloned Window 2776 */ 2777 Window* clone(const bool deepCopy = true) const; 2778 2779 //! copies this widget's properties to given target widget 2780 virtual void clonePropertiesTo(Window& target) const; 2781 //! copies this widget's child widgets to given target widget 2782 virtual void cloneChildWidgetsTo(Window& target) const; 2783 2784 //! return the GUIContext this window is associated with. 2785 GUIContext& getGUIContext() const; 2786 //! function used internally. Do not call this from client code. 2787 void setGUIContext(GUIContext* context); 2788 2789 //! ensure that the window will be rendered to the correct target surface. 2790 void syncTargetSurface(); 2791 2792 /*! 2793 \brief 2794 Set whether this window is marked as an auto window. 2795 2796 An auto window is typically a Window object created automatically by 2797 CEGUI - for example to form part of a multi-element 'compound' widget. 2798 */ 2799 void setAutoWindow(bool is_auto); 2800 2801 /*! 2802 \brief 2803 Return whether Window thinks mouse is currently within its area. 2804 2805 \note 2806 If the mouse cursor has moved or Window's area has changed since the 2807 last time the GUIContext updated the window hit information, the value 2808 returned here may be inaccurate - this is not a bug, but is required 2809 to ensure correct handling of certain events. 2810 */ 2811 bool isMouseContainedInArea() const; 2812 2813 // overridden from Element 2814 const Sizef& getRootContainerSize() const; 2815 2816 protected: 2817 // friend classes for construction / initialisation purposes (for now) 2818 friend class System; 2819 friend class WindowManager; 2820 friend class GUIContext; 2821 2822 /************************************************************************* 2823 Event trigger methods 2824 *************************************************************************/ 2825 /*! 2826 \brief 2827 Handler called when the window's size changes. 2828 2829 \param e 2830 WindowEventArgs object whose 'window' pointer field is set to the window 2831 that triggered the event. For this event the trigger window is always 2832 'this'. 2833 */ 2834 virtual void onSized(ElementEventArgs& e); 2835 2836 /*! 2837 \brief 2838 Handler called when the window's position changes. 2839 2840 \param e 2841 WindowEventArgs object whose 'window' pointer field is set to the window 2842 that triggered the event. For this event the trigger window is always 2843 'this'. 2844 */ 2845 virtual void onMoved(ElementEventArgs& e); 2846 2847 virtual void onRotated(ElementEventArgs& e); 2848 2849 /*! 2850 \brief 2851 Handler called when the window's text is changed. 2852 2853 \param e 2854 WindowEventArgs object whose 'window' pointer field is set to the window 2855 that triggered the event. For this event the trigger window is always 2856 'this'. 2857 */ 2858 virtual void onTextChanged(WindowEventArgs& e); 2859 2860 /*! 2861 \brief 2862 Handler called when the window's font is changed. 2863 2864 \param e 2865 WindowEventArgs object whose 'window' pointer field is set to the window 2866 that triggered the event. For this event the trigger window is always 2867 'this'. 2868 */ 2869 virtual void onFontChanged(WindowEventArgs& e); 2870 2871 /*! 2872 \brief 2873 Handler called when the window's alpha blend value is changed. 2874 2875 \param e 2876 WindowEventArgs object whose 'window' pointer field is set to the window 2877 that triggered the event. For this event the trigger window is always 2878 'this'. 2879 */ 2880 virtual void onAlphaChanged(WindowEventArgs& e); 2881 2882 /*! 2883 \brief 2884 Handler called when the window's client assigned ID is changed. 2885 2886 \param e 2887 WindowEventArgs object whose 'window' pointer field is set to the window 2888 that triggered the event. For this event the trigger window is always 2889 'this'. 2890 */ 2891 virtual void onIDChanged(WindowEventArgs& e); 2892 2893 /*! 2894 \brief 2895 Handler called when the window is shown (made visible). 2896 2897 \param e 2898 WindowEventArgs object whose 'window' pointer field is set to the window 2899 that triggered the event. For this event the trigger window is always 2900 'this'. 2901 */ 2902 virtual void onShown(WindowEventArgs& e); 2903 2904 /*! 2905 \brief 2906 Handler called when the window is hidden. 2907 2908 \param e 2909 WindowEventArgs object whose 'window' pointer field is set to the window 2910 that triggered the event. For this event the trigger window is always 2911 'this'. 2912 */ 2913 virtual void onHidden(WindowEventArgs& e); 2914 2915 /*! 2916 \brief 2917 Handler called when the window is enabled. 2918 2919 \param e 2920 WindowEventArgs object whose 'window' pointer field is set to the window 2921 that triggered the event. For this event the trigger window is always 2922 'this'. 2923 */ 2924 virtual void onEnabled(WindowEventArgs& e); 2925 2926 /*! 2927 \brief 2928 Handler called when the window is disabled. 2929 2930 \param e 2931 WindowEventArgs object whose 'window' pointer field is set to the window 2932 that triggered the event. For this event the trigger window is always 2933 'this'. 2934 */ 2935 virtual void onDisabled(WindowEventArgs& e); 2936 2937 /*! 2938 \brief 2939 Handler called when the window's setting for being clipped by it's 2940 parent is changed. 2941 2942 \param e 2943 WindowEventArgs object whose 'window' pointer field is set to the window 2944 that triggered the event. For this event the trigger window is always 2945 'this'. 2946 */ 2947 virtual void onClippingChanged(WindowEventArgs& e); 2948 2949 /*! 2950 \brief 2951 Handler called when the window's setting for being destroyed 2952 automatically be it's parent is changed. 2953 2954 \param e 2955 WindowEventArgs object whose 'window' pointer field is set to the window 2956 that triggered the event. For this event the trigger window is always 2957 'this'. 2958 */ 2959 virtual void onParentDestroyChanged(WindowEventArgs& e); 2960 2961 /*! 2962 \brief 2963 Handler called when the window's setting for inheriting alpha-blending 2964 is changed. 2965 2966 \param e 2967 WindowEventArgs object whose 'window' pointer field is set to the window 2968 that triggered the event. For this event the trigger window is always 2969 'this'. 2970 */ 2971 virtual void onInheritsAlphaChanged(WindowEventArgs& e); 2972 2973 /*! 2974 \brief 2975 Handler called when the window's always-on-top setting is changed. 2976 2977 \param e 2978 WindowEventArgs object whose 'window' pointer field is set to the window 2979 that triggered the event. For this event the trigger window is always 2980 'this'. 2981 */ 2982 virtual void onAlwaysOnTopChanged(WindowEventArgs& e); 2983 2984 /*! 2985 \brief 2986 Handler called when this window gains capture of mouse inputs. 2987 2988 \param e 2989 WindowEventArgs object whose 'window' pointer field is set to the window 2990 that triggered the event. For this event the trigger window is always 2991 'this'. 2992 */ 2993 virtual void onCaptureGained(WindowEventArgs& e); 2994 2995 /*! 2996 \brief 2997 Handler called when this window loses capture of mouse inputs. 2998 2999 \param e 3000 WindowEventArgs object whose 'window' pointer field is set to the window 3001 that triggered the event. For this event the trigger window is always 3002 'this'. 3003 */ 3004 virtual void onCaptureLost(WindowEventArgs& e); 3005 3006 /*! 3007 \brief 3008 Handler called when this window gets invalidated. 3009 3010 \param e 3011 WindowEventArgs object whose 'window' pointer field is set to the window 3012 that triggered the event. For this event the trigger window is always 3013 'this'. 3014 */ 3015 virtual void onInvalidated(WindowEventArgs& e); 3016 3017 /*! 3018 \brief 3019 Handler called when rendering for this window has started. 3020 3021 \param e 3022 WindowEventArgs object whose 'window' pointer field is set to the window 3023 that triggered the event. For this event the trigger window is always 3024 'this'. 3025 */ 3026 virtual void onRenderingStarted(WindowEventArgs& e); 3027 3028 /*! 3029 \brief 3030 Handler called when rendering for this window has ended. 3031 3032 \param e 3033 WindowEventArgs object whose 'window' pointer field is set to the window 3034 that triggered the event. For this event the trigger window is always 3035 'this'. 3036 */ 3037 virtual void onRenderingEnded(WindowEventArgs& e); 3038 3039 /*! 3040 \brief 3041 Handler called when the z-order position of this window has changed. 3042 3043 \param e 3044 WindowEventArgs object whose 'window' pointer field is set to the window 3045 that triggered the event. For this event the trigger window is always 3046 'this'. 3047 */ 3048 virtual void onZChanged(WindowEventArgs& e); 3049 3050 /*! 3051 \brief 3052 Handler called when this window's destruction sequence has begun. 3053 3054 \param e 3055 WindowEventArgs object whose 'window' pointer field is set to the window 3056 that triggered the event. For this event the trigger window is always 3057 'this'. 3058 */ 3059 virtual void onDestructionStarted(WindowEventArgs& e); 3060 3061 /*! 3062 \brief 3063 Handler called when this window has become the active window. 3064 3065 \param e 3066 ActivationEventArgs class whose 'otherWindow' field is set to the window 3067 that previously was active, or NULL for none. 3068 */ 3069 virtual void onActivated(ActivationEventArgs& e); 3070 3071 /*! 3072 \brief 3073 Handler called when this window has lost input focus and has been 3074 deactivated. 3075 3076 \param e 3077 ActivationEventArgs object whose 'otherWindow' field is set to the 3078 window that has now become active, or NULL for none. 3079 */ 3080 virtual void onDeactivated(ActivationEventArgs& e); 3081 3082 /*! 3083 \brief 3084 Handler called when this window's parent window has been resized. If 3085 this window is the root / GUI Sheet window, this call will be made when 3086 the display size changes. 3087 3088 \param e 3089 WindowEventArgs object whose 'window' pointer field is set the the 3090 window that caused the event; this is typically either this window's 3091 parent window, or NULL to indicate the screen size has changed. 3092 */ 3093 virtual void onParentSized(ElementEventArgs& e); 3094 3095 /*! 3096 \brief 3097 Handler called when a child window is added to this window. 3098 3099 \param e 3100 WindowEventArgs object whose 'window' pointer field is set to the window 3101 that has been added. 3102 */ 3103 virtual void onChildAdded(ElementEventArgs& e); 3104 3105 /*! 3106 \brief 3107 Handler called when a child window is removed from this window. 3108 3109 \param e 3110 WindowEventArgs object whose 'window' pointer field is set the window 3111 that has been removed. 3112 */ 3113 virtual void onChildRemoved(ElementEventArgs& e); 3114 3115 /*! 3116 \brief 3117 Handler called when the mouse cursor has entered this window's area. 3118 3119 \param e 3120 MouseEventArgs object. All fields are valid. 3121 */ 3122 virtual void onMouseEntersArea(MouseEventArgs& e); 3123 3124 /*! 3125 \brief 3126 Handler called when the mouse cursor has left this window's area. 3127 3128 \param e 3129 MouseEventArgs object. All fields are valid. 3130 */ 3131 virtual void onMouseLeavesArea(MouseEventArgs& e); 3132 3133 /*! 3134 \brief 3135 Handler called when the mouse cursor has entered this window's area and 3136 is actually over some part of this windows surface and not, for 3137 instance over a child window - even though technically in those cases 3138 the mouse is also within this Window's area, the handler will not be 3139 called. 3140 3141 \param e 3142 MouseEventArgs object. All fields are valid. 3143 3144 \see 3145 Window::onMouseEntersArea 3146 */ 3147 virtual void onMouseEnters(MouseEventArgs& e); 3148 3149 /*! 3150 \brief 3151 Handler called when the mouse cursor is no longer over this window's 3152 surface area. This will be called when the mouse is not over a part 3153 of this Window's actual surface - even though technically the mouse is 3154 still within the Window's area, for example if the mouse moves over a 3155 child window. 3156 3157 \param e 3158 MouseEventArgs object. All fields are valid. 3159 3160 \see 3161 Window::onMouseLeavesArea 3162 */ 3163 virtual void onMouseLeaves(MouseEventArgs& e); 3164 3165 /*! 3166 \brief 3167 Handler called when the mouse cursor has been moved within this window's 3168 area. 3169 3170 \param e 3171 MouseEventArgs object. All fields are valid. 3172 */ 3173 virtual void onMouseMove(MouseEventArgs& e); 3174 3175 /*! 3176 \brief 3177 Handler called when the mouse wheel (z-axis) position changes within 3178 this window's area. 3179 3180 \param e 3181 MouseEventArgs object. All fields are valid. 3182 */ 3183 virtual void onMouseWheel(MouseEventArgs& e); 3184 3185 /*! 3186 \brief 3187 Handler called when a mouse button has been depressed within this 3188 window's area. 3189 3190 \param e 3191 MouseEventArgs object. All fields are valid. 3192 */ 3193 virtual void onMouseButtonDown(MouseEventArgs& e); 3194 3195 /*! 3196 \brief 3197 Handler called when a mouse button has been released within this 3198 window's area. 3199 3200 \param e 3201 MouseEventArgs object. All fields are valid. 3202 */ 3203 virtual void onMouseButtonUp(MouseEventArgs& e); 3204 3205 /*! 3206 \brief 3207 Handler called when a mouse button has been clicked (that is depressed 3208 and then released, within a specified time) within this window's area. 3209 3210 \param e 3211 MouseEventArgs object. All fields are valid. 3212 */ 3213 virtual void onMouseClicked(MouseEventArgs& e); 3214 3215 /*! 3216 \brief 3217 Handler called when a mouse button has been double-clicked within this 3218 window's area. 3219 3220 \param e 3221 MouseEventArgs object. All fields are valid. 3222 */ 3223 virtual void onMouseDoubleClicked(MouseEventArgs& e); 3224 3225 /*! 3226 \brief 3227 Handler called when a mouse button has been triple-clicked within this 3228 window's area. 3229 3230 \param e 3231 MouseEventArgs object. All fields are valid. 3232 */ 3233 virtual void onMouseTripleClicked(MouseEventArgs& e); 3234 3235 /*! 3236 \brief 3237 Handler called when a key as been depressed while this window has input 3238 focus. 3239 3240 \param e 3241 KeyEventArgs object whose 'scancode' field is set to the Key::Scan value 3242 representing the key that was pressed, and whose 'sysKeys' field 3243 represents the combination of SystemKey that were active when the event 3244 was generated. 3245 */ 3246 virtual void onKeyDown(KeyEventArgs& e); 3247 3248 /*! 3249 \brief 3250 Handler called when a key as been released while this window has input 3251 focus. 3252 3253 \param e 3254 KeyEventArgs object whose 'scancode' field is set to the Key::Scan value 3255 representing the key that was released, and whose 'sysKeys' field 3256 represents the combination of SystemKey that were active when the event 3257 was generated. All other fields should be considered as 'junk'. 3258 */ 3259 virtual void onKeyUp(KeyEventArgs& e); 3260 3261 /*! 3262 \brief 3263 Handler called when a character-key has been pressed while this window 3264 has input focus. 3265 3266 \param e 3267 KeyEventArgs object whose 'codepoint' field is set to the Unicode code 3268 point (encoded as utf32) for the character typed, and whose 'sysKeys' 3269 field represents the combination of SystemKey that were active when the 3270 event was generated. All other fields should be considered as 'junk'. 3271 */ 3272 virtual void onCharacter(KeyEventArgs& e); 3273 3274 /*! 3275 \brief 3276 Handler called when a DragContainer is dragged over this window. 3277 3278 \param e 3279 DragDropEventArgs object initialised as follows: 3280 - window field is normaly set to point to 'this' window. 3281 - dragDropItem is a pointer to a DragContainer window that triggered 3282 the event. 3283 */ 3284 virtual void onDragDropItemEnters(DragDropEventArgs& e); 3285 3286 /*! 3287 \brief 3288 Handler called when a DragContainer is dragged over this window. 3289 3290 \param e 3291 DragDropEventArgs object initialised as follows: 3292 - window field is normaly set to point to 'this' window. 3293 - dragDropItem is a pointer to a DragContainer window that triggered 3294 the event. 3295 */ 3296 virtual void onDragDropItemLeaves(DragDropEventArgs& e); 3297 3298 /*! 3299 \brief 3300 Handler called when a DragContainer is dragged over this window. 3301 3302 \param e 3303 DragDropEventArgs object initialised as follows: 3304 - window field is normaly set to point to 'this' window. 3305 - dragDropItem is a pointer to a DragContainer window that triggered 3306 the event. 3307 */ 3308 virtual void onDragDropItemDropped(DragDropEventArgs& e); 3309 3310 /*! 3311 \brief 3312 Handler called when a new window renderer object is attached. 3313 3314 \param e 3315 WindowEventArgs object initialised as follows: 3316 - window field is set to point to the Window object that just got a new 3317 window renderer attached. (typically 'this'). 3318 */ 3319 virtual void onWindowRendererAttached(WindowEventArgs& e); 3320 3321 /*! 3322 \brief 3323 Handler called when the currently attached window renderer object is detached. 3324 3325 \param e 3326 WindowEventArgs object initialised as follows: 3327 - window field is set to point to the Window object that just got lost its 3328 window renderer. (typically 'this'). 3329 */ 3330 virtual void onWindowRendererDetached(WindowEventArgs& e); 3331 3332 /*! 3333 \brief 3334 Handler called when the window's setting for whether text parsing is 3335 enabled is changed. 3336 3337 \param e 3338 WindowEventArgs object whose 'window' pointer field is set to the window 3339 that triggered the event. For this event the trigger window is always 3340 'this'. 3341 */ 3342 virtual void onTextParsingChanged(WindowEventArgs& e); 3343 3344 virtual void onMarginChanged(WindowEventArgs& e); 3345 3346 /************************************************************************* 3347 Implementation Functions 3348 *************************************************************************/ 3349 /*! 3350 \brief 3351 Perform actual update processing for this Window. 3352 3353 \param elapsed 3354 float value indicating the number of seconds elapsed since the last 3355 update call. 3356 3357 \return 3358 Nothing. 3359 */ 3360 virtual void updateSelf(float elapsed); 3361 3362 /*! 3363 \brief 3364 Perform the actual rendering for this Window. 3365 3366 \param ctx 3367 RenderingContext holding the details of the RenderingSurface to be 3368 used for the Window rendering operations. 3369 3370 \return 3371 Nothing 3372 */ 3373 virtual void drawSelf(const RenderingContext& ctx); 3374 3375 /*! 3376 \brief 3377 Perform drawing operations concerned with generating and buffering 3378 window geometry. 3379 3380 \note 3381 This function is a sub-function of drawSelf; it is provided to make it 3382 easier to override drawSelf without needing to duplicate large sections 3383 of the code from the default implementation. 3384 */ 3385 void bufferGeometry(const RenderingContext& ctx); 3386 3387 /*! 3388 \brief 3389 Perform drawing operations concerned with positioning, clipping and 3390 queueing of window geometry to RenderingSurfaces. 3391 3392 \note 3393 This function is a sub-function of drawSelf and is provided to make it 3394 easier to override drawSelf without needing to duplicate large sections 3395 of the code from the default implementation. 3396 */ 3397 void queueGeometry(const RenderingContext& ctx); 3398 3399 /*! 3400 \brief 3401 Update the rendering cache. 3402 3403 Populates the Window's GeometryBuffer ready for rendering. 3404 */ populateGeometryBuffer()3405 virtual void populateGeometryBuffer() {} 3406 3407 /*! 3408 \brief 3409 Set the parent window for this window object. 3410 3411 \param parent 3412 Pointer to a Window object that is to be assigned as the parent to this 3413 Window. 3414 3415 \return 3416 Nothing 3417 */ 3418 virtual void setParent(Element* parent); 3419 3420 /*! 3421 \brief 3422 Fires off a repeated mouse button down event for this window. 3423 */ 3424 void generateAutoRepeatEvent(MouseButton button); 3425 3426 /*! 3427 \brief 3428 Function used in checking if a WindowRenderer is valid for this window. 3429 3430 \param renderer 3431 Window renderer that will be checked (it can be null!) 3432 3433 \return 3434 Returns true if the given WindowRenderer class name is valid for this window. 3435 False if not. 3436 */ 3437 virtual bool validateWindowRenderer(const WindowRenderer* renderer) const; 3438 3439 /*! 3440 \brief 3441 Returns whether a property is at it's default value. 3442 This function is different from Property::isDefatult as it takes the assigned look'n'feel 3443 (if the is one) into account. 3444 */ 3445 bool isPropertyAtDefault(const Property* property) const; 3446 3447 /*! 3448 \brief 3449 Recursively inform all children that the clipping has changed and screen rects 3450 needs to be recached. 3451 */ 3452 void notifyClippingChanged(void); 3453 3454 //! helper to create and setup the auto RenderingWindow surface 3455 void allocateRenderingWindow(); 3456 3457 //! helper to clean up the auto RenderingWindow surface 3458 void releaseRenderingWindow(); 3459 3460 //! Helper to intialise the needed clipping for geometry and render surface. 3461 void initialiseClippers(const RenderingContext& ctx); 3462 3463 //! \copydoc Element::setArea_impl 3464 virtual void setArea_impl(const UVector2& pos, const USize& size, bool topLeftSizing = false, bool fireEvents = true); 3465 3466 /*! 3467 \brief 3468 Cleanup child windows 3469 */ 3470 virtual void cleanupChildren(void); 3471 3472 /*! 3473 \copydoc Element::addChild_impl 3474 */ 3475 virtual void addChild_impl(Element* element); 3476 3477 /*! 3478 \copydoc Element::removeChild_impl 3479 */ 3480 virtual void removeChild_impl(Element* element); 3481 3482 /*! 3483 \brief 3484 Notify 'this' and all siblings of a ZOrder change event 3485 */ 3486 virtual void onZChange_impl(void); 3487 3488 /*! 3489 \brief 3490 Add standard CEGUI::Window properties. 3491 */ 3492 void addWindowProperties(void); 3493 3494 /*! 3495 \brief 3496 Implements move to front behavior. 3497 3498 \return 3499 Should return true if some action was taken, or false if there was 3500 nothing to be done. 3501 */ 3502 virtual bool moveToFront_impl(bool wasClicked); 3503 3504 /*! 3505 \brief 3506 Add the given window to the drawing list at an appropriate position for 3507 it's settings and the required direction. Basically, when \a at_back 3508 is false, the window will appear in front of all other windows with the 3509 same 'always on top' setting. When \a at_back is true, the window will 3510 appear behind all other windows wih the same 'always on top' setting. 3511 3512 \param wnd 3513 Window object to be added to the drawing list. 3514 3515 \param at_back 3516 Indicates whether the window should be placed at the back of other 3517 windows in the same group. If this is false, the window is placed in 3518 front of other windows in the group. 3519 3520 \return 3521 Nothing. 3522 */ 3523 void addWindowToDrawList(Window& wnd, bool at_back = false); 3524 3525 /*! 3526 \brief 3527 Removes the window from the drawing list. If the window is not attached 3528 to the drawing list then nothing happens. 3529 3530 \param wnd 3531 Window object to be removed from the drawing list. 3532 3533 \return 3534 Nothing. 3535 */ 3536 void removeWindowFromDrawList(const Window& wnd); 3537 3538 /*! 3539 \brief 3540 Return whether the window is at the top of the Z-Order. This will 3541 correctly take into account 'Always on top' windows as needed. 3542 3543 \return 3544 - true if the Window is at the top of the z-order in relation to sibling 3545 windows with the same 'always on top' setting. 3546 - false if the Window is not at the top of the z-order in relation to 3547 sibling windows with the same 'always on top' setting. 3548 */ 3549 bool isTopOfZOrder() const; 3550 3551 /*! 3552 \brief 3553 Update position and clip region on this Windows geometry / rendering 3554 surface. 3555 */ 3556 void updateGeometryRenderSettings(); 3557 3558 //! transfer RenderingSurfaces to be owned by our target RenderingSurface. 3559 void transferChildSurfaces(); 3560 3561 //! helper function for calculating clipping rectangles. 3562 Rectf getParentElementClipIntersection(const Rectf& unclipped_area) const; 3563 3564 //! helper function to invalidate window and optionally child windows. 3565 void invalidate_impl(const bool recursive); 3566 3567 /*! 3568 \brief 3569 Helper function to return the ancestor Window of /a wnd that is attached 3570 as a child to a window that is also an ancestor of /a this. Returns 0 3571 if /a wnd and /a this are not part of the same hierachy. 3572 */ 3573 const Window* getWindowAttachedToCommonAncestor(const Window& wnd) const; 3574 3575 virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const; 3576 //! Default implementation of function to return Window outer clipper area. 3577 virtual Rectf getOuterRectClipper_impl() const; 3578 //! Default implementation of function to return Window inner clipper area. 3579 virtual Rectf getInnerRectClipper_impl() const; 3580 //! Default implementation of function to return Window hit-test area. 3581 virtual Rectf getHitTestRect_impl() const; 3582 3583 virtual int writePropertiesXML(XMLSerializer& xml_stream) const; 3584 virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const; 3585 virtual bool writeAutoChildWindowXML(XMLSerializer& xml_stream) const; 3586 3587 virtual void banPropertiesForAutoWindow(); 3588 3589 //! handler function for when font render size changes. 3590 virtual bool handleFontRenderSizeChange(const EventArgs& args); 3591 3592 // mark the rect caches defined on Window invalid (does not affect Element) 3593 void markCachedWindowRectsInvalid(); 3594 void layoutLookNFeelChildWidgets(); 3595 3596 Window* getChildAtPosition(const Vector2f& position, 3597 bool (Window::*hittestfunc)(const Vector2f&, bool) const, 3598 bool allow_disabled = false) const; 3599 3600 bool isHitTargetWindow(const Vector2f& position, bool allow_disabled) const; 3601 3602 /************************************************************************* 3603 Properties for Window base class 3604 *************************************************************************/ 3605 3606 /*! 3607 \brief 3608 Property to access/change the assigned window renderer object. 3609 3610 \par Usage: 3611 - Name: WindowRenderer 3612 - Format: "[windowRendererName]" 3613 3614 \par Where [windowRendererName] is the factory name of the window 3615 renderer type you wish to assign. 3616 */ 3617 static 3618 class WindowRendererProperty : public TplWindowProperty<Window, String> 3619 { 3620 public: 3621 WindowRendererProperty(); 3622 void writeXMLToStream(const PropertyReceiver* receiver, 3623 XMLSerializer& xml_stream) const; 3624 } d_windowRendererProperty; 3625 3626 /*! 3627 \brief 3628 Property to access/change the assigned look'n'feel. 3629 3630 \par Usage: 3631 - Name: LookNFeel 3632 - Format: "[LookNFeelName]" 3633 3634 \par Where [LookNFeelName] is the name of the look'n'feel you wish 3635 to assign. 3636 */ 3637 static 3638 class LookNFeelProperty : public TplWindowProperty<Window, String> 3639 { 3640 public: 3641 LookNFeelProperty(); 3642 void writeXMLToStream(const PropertyReceiver* receiver, 3643 XMLSerializer& xml_stream) const; 3644 } d_lookNFeelProperty; 3645 3646 /************************************************************************* 3647 Implementation Data 3648 *************************************************************************/ 3649 //! definition of type used for the list of child windows to be drawn 3650 typedef std::vector<Window* 3651 CEGUI_VECTOR_ALLOC(Window*)> ChildDrawList; 3652 //! definition of type used for the UserString dictionary. 3653 typedef std::map<String, String, StringFastLessCompare 3654 CEGUI_MAP_ALLOC(String, String)> UserStringMap; 3655 //! definition of type used to track properties banned from writing XML. 3656 typedef std::set<String, StringFastLessCompare 3657 CEGUI_SET_ALLOC(String)> BannedXMLPropertySet; 3658 3659 //! type of Window (also the name of the WindowFactory that created us) 3660 const String d_type; 3661 //! Type name of the window as defined in a Falagard mapping. 3662 String d_falagardType; 3663 //! true when this window is an auto-window 3664 bool d_autoWindow; 3665 3666 //! true when this window is currently being initialised (creating children etc) 3667 bool d_initialising; 3668 //! true when this window is being destroyed. 3669 bool d_destructionStarted; 3670 //! true when Window is enabled 3671 bool d_enabled; 3672 //! is window visible (i.e. it will be rendered, but may still be obscured) 3673 bool d_visible; 3674 //! true when Window is the active Window (receiving inputs). 3675 bool d_active; 3676 3677 //! Child window objects arranged in rendering order. 3678 ChildDrawList d_drawList; 3679 //! true when Window will be auto-destroyed by parent. 3680 bool d_destroyedByParent; 3681 3682 //! true when Window will be clipped by parent Window area Rect. 3683 bool d_clippedByParent; 3684 3685 //! Name of the Look assigned to this window (if any). 3686 String d_lookName; 3687 //! The WindowRenderer module that implements the Look'N'Feel specification 3688 WindowRenderer* d_windowRenderer; 3689 //! Object which acts as a cache of geometry drawn by this Window. 3690 GeometryBuffer* d_geometry; 3691 //! RenderingSurface owned by this window (may be 0) 3692 RenderingSurface* d_surface; 3693 //! true if window geometry cache needs to be regenerated. 3694 mutable bool d_needsRedraw; 3695 //! holds setting for automatic creation of of surface (RenderingWindow) 3696 bool d_autoRenderingWindow; 3697 3698 //! Holds pointer to the Window objects current mouse cursor image. 3699 const Image* d_mouseCursor; 3700 3701 //! Alpha transparency setting for the Window 3702 float d_alpha; 3703 //! true if the Window inherits alpha from the parent Window 3704 bool d_inheritsAlpha; 3705 3706 //! The Window that previously had capture (used for restoreOldCapture mode) 3707 Window* d_oldCapture; 3708 //! Restore capture to the previous capture window when releasing capture. 3709 bool d_restoreOldCapture; 3710 //! Whether to distribute captured inputs to child windows. 3711 bool d_distCapturedInputs; 3712 3713 //! Holds pointer to the Window objects current Font. 3714 const Font* d_font; 3715 //! Holds the text / label / caption for this Window. 3716 String d_textLogical; 3717 //! pointer to bidirection support object 3718 BidiVisualMapping* d_bidiVisualMapping; 3719 //! whether bidi visual mapping has been updated since last text change. 3720 mutable bool d_bidiDataValid; 3721 //! RenderedString representation of text string as ouput from a parser. 3722 mutable RenderedString d_renderedString; 3723 //! true if d_renderedString is valid, false if needs re-parse. 3724 mutable bool d_renderedStringValid; 3725 //! Shared instance of a parser to be used in most instances. 3726 static BasicRenderedStringParser d_basicStringParser; 3727 //! Shared instance of a parser to be used when rendering text verbatim. 3728 static DefaultRenderedStringParser d_defaultStringParser; 3729 //! Pointer to a custom (user assigned) RenderedStringParser object. 3730 RenderedStringParser* d_customStringParser; 3731 //! true if use of parser other than d_defaultStringParser is enabled 3732 bool d_textParsingEnabled; 3733 3734 //! Margin, only used when the Window is inside LayoutContainer class 3735 UBox d_margin; 3736 3737 //! User ID assigned to this Window 3738 uint d_ID; 3739 //! Holds pointer to some user assigned data. 3740 void* d_userData; 3741 //! Holds a collection of named user string values. 3742 UserStringMap d_userStrings; 3743 3744 //! true if Window will be drawn on top of all other Windows 3745 bool d_alwaysOnTop; 3746 //! whether window should rise in the z order when left clicked. 3747 bool d_riseOnClick; 3748 //! true if the Window responds to z-order change requests. 3749 bool d_zOrderingEnabled; 3750 3751 //! true if the Window wishes to hear about multi-click mouse events. 3752 bool d_wantsMultiClicks; 3753 //! whether (most) mouse events pass through this window 3754 bool d_mousePassThroughEnabled; 3755 //! whether pressed mouse button will auto-repeat the down event. 3756 bool d_autoRepeat; 3757 //! seconds before first repeat event is fired 3758 float d_repeatDelay; 3759 //! seconds between further repeats after delay has expired. 3760 float d_repeatRate; 3761 //! button we're tracking for auto-repeat purposes. 3762 MouseButton d_repeatButton; 3763 //! implements repeating - is true after delay has elapsed, 3764 bool d_repeating; 3765 //! implements repeating - tracks time elapsed. 3766 float d_repeatElapsed; 3767 3768 //! true if window will receive drag and drop related notifications 3769 bool d_dragDropTarget; 3770 3771 //! Text string used as tip for this window. 3772 String d_tooltipText; 3773 //! Possible custom Tooltip for this window. 3774 Tooltip* d_customTip; 3775 //! true if this Window created the custom Tooltip. 3776 bool d_weOwnTip; 3777 //! whether tooltip text may be inherited from parent. 3778 bool d_inheritsTipText; 3779 3780 //! true if this window is allowed to write XML, false if not 3781 bool d_allowWriteXML; 3782 //! collection of properties not to be written to XML for this window. 3783 BannedXMLPropertySet d_bannedXMLProperties; 3784 3785 //! outer area clipping rect in screen pixels 3786 mutable Rectf d_outerRectClipper; 3787 //! inner area clipping rect in screen pixels 3788 mutable Rectf d_innerRectClipper; 3789 //! area rect used for hit-testing against this window 3790 mutable Rectf d_hitTestRect; 3791 3792 mutable bool d_outerRectClipperValid; 3793 mutable bool d_innerRectClipperValid; 3794 mutable bool d_hitTestRectValid; 3795 3796 //! The mode to use for calling Window::update 3797 WindowUpdateMode d_updateMode; 3798 3799 //! specifies whether mouse inputs should be propagated to parent(s) 3800 bool d_propagateMouseInputs; 3801 3802 //! GUIContext. Set when this window is used as a root window. 3803 GUIContext* d_guiContext; 3804 3805 //! true when mouse is contained within this Window's area. 3806 bool d_containsMouse; 3807 3808 private: 3809 /************************************************************************* 3810 May not copy or assign Window objects 3811 *************************************************************************/ Window(const Window &)3812 Window(const Window&): NamedElement() {} 3813 Window& operator=(const Window&) {return *this;} 3814 3815 //! Not intended for public use, only used as a "Font" property getter 3816 const Font* property_getFont() const; 3817 //! Not intended for public use, only used as a "MouseCursor" property getter 3818 const Image* property_getMouseCursor() const; 3819 3820 //! connection for event listener for font render size changes. 3821 Event::ScopedConnection d_fontRenderSizeChangeConnection; 3822 }; 3823 3824 } // End of CEGUI namespace section 3825 3826 3827 #if defined(_MSC_VER) 3828 # pragma warning(pop) 3829 #endif 3830 3831 #endif // end of guard _CEGUIWindow_h_ 3832 3833