Crazy Eddie's GUI System
0.8.4
|
00001 /*********************************************************************** 00002 created: 21/2/2004 00003 author: Paul D Turner 00004 00005 purpose: Defines abstract base class for Window objects 00006 *************************************************************************/ 00007 /*************************************************************************** 00008 * Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team 00009 * 00010 * Permission is hereby granted, free of charge, to any person obtaining 00011 * a copy of this software and associated documentation files (the 00012 * "Software"), to deal in the Software without restriction, including 00013 * without limitation the rights to use, copy, modify, merge, publish, 00014 * distribute, sublicense, and/or sell copies of the Software, and to 00015 * permit persons to whom the Software is furnished to do so, subject to 00016 * the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be 00019 * included in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00022 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00023 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00024 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00025 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00026 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00027 * OTHER DEALINGS IN THE SOFTWARE. 00028 ***************************************************************************/ 00029 00030 #ifndef _CEGUIWindow_h_ 00031 #define _CEGUIWindow_h_ 00032 00033 #include "CEGUI/Base.h" 00034 #include "CEGUI/NamedElement.h" 00035 #include "CEGUI/Vector.h" 00036 #include "CEGUI/Quaternion.h" 00037 #include "CEGUI/Rect.h" 00038 #include "CEGUI/Size.h" 00039 #include "CEGUI/EventSet.h" 00040 #include "CEGUI/PropertySet.h" 00041 #include "CEGUI/TplWindowProperty.h" 00042 #include "CEGUI/System.h" 00043 #include "CEGUI/GUIContext.h" 00044 #include "CEGUI/InputEvent.h" 00045 #include "CEGUI/UDim.h" 00046 #include "CEGUI/WindowRenderer.h" 00047 #include "CEGUI/TextUtils.h" 00048 #include "CEGUI/BasicRenderedStringParser.h" 00049 #include "CEGUI/DefaultRenderedStringParser.h" 00050 #include <vector> 00051 #include <set> 00052 00053 #if defined(_MSC_VER) 00054 # pragma warning(push) 00055 # pragma warning(disable : 4251) 00056 #endif 00057 00058 // Start of CEGUI namespace section 00059 namespace CEGUI 00060 { 00061 00070 enum WindowUpdateMode 00071 { 00073 WUM_ALWAYS, 00075 WUM_NEVER, 00077 WUM_VISIBLE 00078 }; 00079 00080 template<> 00081 class PropertyHelper<WindowUpdateMode> 00082 { 00083 public: 00084 typedef WindowUpdateMode return_type; 00085 typedef return_type safe_method_return_type; 00086 typedef WindowUpdateMode pass_type; 00087 typedef String string_return_type; 00088 00089 static const String& getDataTypeName() 00090 { 00091 static String type("WindowUpdateMode"); 00092 00093 return type; 00094 } 00095 00096 static return_type fromString(const String& str) 00097 { 00098 00099 if (str == "Always") 00100 { 00101 return WUM_ALWAYS; 00102 } 00103 else if (str == "Never") 00104 { 00105 return WUM_NEVER; 00106 } 00107 else 00108 { 00109 return WUM_VISIBLE; 00110 } 00111 } 00112 00113 static string_return_type toString(pass_type val) 00114 { 00115 if (val == WUM_ALWAYS) 00116 { 00117 return "Always"; 00118 } 00119 else if (val == WUM_NEVER) 00120 { 00121 return "Never"; 00122 } 00123 else if (val == WUM_VISIBLE) 00124 { 00125 return "Visible"; 00126 } 00127 else 00128 { 00129 assert(false && "Invalid Window Update Mode"); 00130 return "Always"; 00131 } 00132 } 00133 }; 00134 00135 00149 class CEGUIEXPORT Window : 00150 public NamedElement 00151 { 00152 public: 00153 /************************************************************************* 00154 Event name constants 00155 *************************************************************************/ 00157 static const String EventNamespace; 00158 00159 // generated internally by Window 00163 static const String EventUpdated; 00164 00169 static const String EventTextChanged; 00174 static const String EventFontChanged; 00179 static const String EventAlphaChanged; 00184 static const String EventIDChanged; 00191 static const String EventActivated; 00198 static const String EventDeactivated; 00203 static const String EventShown; 00208 static const String EventHidden; 00213 static const String EventEnabled; 00219 static const String EventDisabled; 00225 static const String EventClippedByParentChanged; 00231 static const String EventDestroyedByParentChanged; 00237 static const String EventInheritsAlphaChanged; 00243 static const String EventAlwaysOnTopChanged; 00248 static const String EventInputCaptureGained; 00257 static const String EventInputCaptureLost; 00267 static const String EventInvalidated; 00275 static const String EventRenderingStarted; 00283 static const String EventRenderingEnded; 00288 static const String EventDestructionStarted; 00296 static const String EventDragDropItemEnters; 00304 static const String EventDragDropItemLeaves; 00311 static const String EventDragDropItemDropped; 00317 static const String EventWindowRendererAttached; 00323 static const String EventWindowRendererDetached; 00330 static const String EventTextParsingChanged; 00336 static const String EventMarginChanged; 00337 00338 // generated externally (inputs) 00343 static const String EventMouseEntersArea; 00348 static const String EventMouseLeavesArea; 00359 static const String EventMouseEntersSurface; 00370 static const String EventMouseLeavesSurface; 00375 static const String EventMouseMove; 00381 static const String EventMouseWheel; 00386 static const String EventMouseButtonDown; 00391 static const String EventMouseButtonUp; 00398 static const String EventMouseClick; 00404 static const String EventMouseDoubleClick; 00410 static const String EventMouseTripleClick; 00419 static const String EventKeyDown; 00428 static const String EventKeyUp; 00436 static const String EventCharacterKey; 00437 00438 /************************************************************************* 00439 Child Widget name suffix constants 00440 *************************************************************************/ 00442 static const String TooltipNameSuffix; 00443 00444 // XML element and attribute names that relate to Window. 00445 static const String WindowXMLElementName; 00446 static const String AutoWindowXMLElementName; 00447 static const String UserStringXMLElementName; 00448 static const String WindowTypeXMLAttributeName; 00449 static const String WindowNameXMLAttributeName; 00450 static const String AutoWindowNamePathXMLAttributeName; 00451 static const String UserStringNameXMLAttributeName; 00452 static const String UserStringValueXMLAttributeName; 00453 00464 Window(const String& type, const String& name); 00465 00470 virtual ~Window(void); 00471 00479 const String& getType(void) const; 00480 00490 bool isDestroyedByParent(void) const {return d_destroyedByParent;} 00491 00501 bool isAlwaysOnTop(void) const {return d_alwaysOnTop;} 00502 00515 bool isDisabled() const; 00516 00529 bool isEffectiveDisabled() const; 00530 00547 bool isVisible() const; 00548 00565 bool isEffectiveVisible() const; 00566 00581 bool isActive(void) const; 00582 00592 bool isClippedByParent(void) const {return d_clippedByParent;} 00593 00601 uint getID(void) const {return d_ID;} 00602 00603 using NamedElement::isChild; 00620 bool isChild(uint ID) const; 00621 00642 bool isChildRecursive(uint ID) const; 00643 00644 00659 inline Window* getChildAtIdx(size_t idx) const 00660 { 00661 return static_cast<Window*>(getChildElementAtIdx(idx)); 00662 } 00663 00687 inline Window* getChild(const String& name_path) const 00688 { 00689 return static_cast<Window*>(getChildElement(name_path)); 00690 } 00691 00713 inline Window* getChildRecursive(const String& name) const 00714 { 00715 return static_cast<Window*>(getChildElementRecursive(name)); 00716 } 00717 00739 Window* getChild(uint ID) const; 00740 00762 Window* getChildRecursive(uint ID) const; 00763 00776 Window* getActiveChild(void); 00777 const Window* getActiveChild(void) const; 00778 00779 using NamedElement::isAncestor; 00793 bool isAncestor(uint ID) const; 00794 00808 const Font* getFont(bool useDefault = true) const; 00809 00817 const String& getText(void) const {return d_textLogical;} 00818 00820 const String& getTextVisual() const; 00821 00830 bool inheritsAlpha(void) const {return d_inheritsAlpha;} 00831 00849 float getAlpha(void) const {return d_alpha;} 00850 00860 float getEffectiveAlpha(void) const; 00861 00874 const Rectf& getOuterRectClipper() const; 00875 00888 const Rectf& getInnerRectClipper() const; 00889 00908 const Rectf& getClipRect(const bool non_client = false) const; 00909 00920 const Rectf& getHitTestRect() const; 00921 00930 Window* getCaptureWindow() const 00931 {return getGUIContext().getInputCaptureWindow();} 00932 00941 bool isCapturedByThis(void) const {return getCaptureWindow() == this;} 00942 00952 bool isCapturedByAncestor(void) const 00953 {return isAncestor(getCaptureWindow());} 00954 00963 bool isCapturedByChild(void) const {return isChild(getCaptureWindow());} 00964 00981 virtual bool isHit(const Vector2f& position, 00982 const bool allow_disabled = false) const; 00983 00996 Window* getChildAtPosition(const Vector2f& position) const; 00997 01015 Window* getTargetChildAtPosition(const Vector2f& position, 01016 const bool allow_disabled = false) const; 01017 01026 inline Window* getParent() const 01027 { 01028 return static_cast<Window*>(getParentElement()); 01029 } 01030 01045 const Image* getMouseCursor(bool useDefault = true) const; 01046 01058 void* getUserData(void) const {return d_userData;} 01059 01074 bool restoresOldCapture(void) const {return d_restoreOldCapture;} 01075 01095 bool isZOrderingEnabled(void) const; 01096 01107 bool wantsMultiClickEvents(void) const; 01108 01120 bool isMouseAutoRepeatEnabled(void) const; 01121 01130 float getAutoRepeatDelay(void) const; 01131 01141 float getAutoRepeatRate(void) const; 01142 01152 bool distributesCapturedInputs(void) const; 01153 01163 bool isUsingDefaultTooltip(void) const; 01164 01174 Tooltip* getTooltip(void) const; 01175 01184 String getTooltipType(void) const; 01185 01193 const String& getTooltipText(void) const; 01194 01206 bool inheritsTooltipText(void) const; 01207 01228 bool isRiseOnClickEnabled(void) const { return d_riseOnClick; } 01229 01237 GeometryBuffer& getGeometryBuffer(); 01238 01247 const String& getLookNFeel() const; 01248 01256 bool getModalState(void) const 01257 {return(getGUIContext().getModalWindow() == this);} 01258 01272 const String& getUserString(const String& name) const; 01273 01285 bool isUserStringDefined(const String& name) const; 01286 01302 Window* getActiveSibling(); 01303 01314 bool isMousePassThroughEnabled(void) const {return d_mousePassThroughEnabled;} 01315 01323 bool isAutoWindow(void) const {return d_autoWindow;} 01324 01329 bool isWritingXMLAllowed(void) const {return d_allowWriteXML;} 01330 01340 bool isDragDropTarget() const; 01341 01347 void getRenderingContext(RenderingContext& ctx) const; 01348 01350 virtual void getRenderingContext_impl(RenderingContext& ctx) const; 01351 01357 RenderingSurface* getRenderingSurface() const; 01358 01364 RenderingSurface& getTargetRenderingSurface() const; 01365 01377 bool isUsingAutoRenderingSurface() const; 01378 01389 const Window* getRootWindow() const; 01390 Window* getRootWindow(); 01391 01403 virtual void initialiseComponents(void) {} 01404 01418 void setDestroyedByParent(bool setting); 01419 01432 void setAlwaysOnTop(bool setting); 01433 01446 void setEnabled(bool setting); 01447 01460 void setDisabled(bool setting); 01461 01469 void enable(void) {setEnabled(true);} 01470 01478 void disable(void) {setEnabled(false);} 01479 01497 void setVisible(bool setting); 01498 01511 void show(void) {setVisible(true);} 01512 01523 void hide(void) {setVisible(false);} 01524 01533 void activate(void); 01534 01544 void deactivate(void); 01545 01558 void setClippedByParent(bool setting); 01559 01571 void setID(uint ID); 01572 01583 void setText(const String& text); 01584 01598 void insertText(const String& text, const String::size_type position); 01599 01609 void appendText(const String& text); 01610 01622 void setFont(const Font* font); 01623 01638 void setFont(const String& name); 01639 01640 using NamedElement::removeChild; 01654 void removeChild(uint ID); 01655 01671 Window* createChild(const String& type, const String& name = ""); 01672 01680 void destroyChild(Window* wnd); 01681 01689 void destroyChild(const String& name_path); 01690 01704 void moveToFront(); 01705 01720 void moveToBack(); 01721 01735 void moveInFront(const Window* const window); 01736 01751 void moveBehind(const Window* const window); 01752 01765 size_t getZIndex() const; 01766 01776 bool isInFront(const Window& wnd) const; 01777 01787 bool isBehind(const Window& wnd) const; 01788 01798 bool captureInput(void); 01799 01808 void releaseInput(void); 01809 01828 void setRestoreOldCapture(bool setting); 01829 01850 void setAlpha(const float alpha); 01851 01863 void setInheritsAlpha(bool setting); 01864 01876 void invalidate(void); 01877 01893 void invalidate(const bool recursive); 01894 01906 void setMouseCursor(const Image* image); 01907 01925 void setMouseCursor(const String& name); 01926 01941 void setUserData(void* user_data) {d_userData = user_data;} 01942 01965 void setZOrderingEnabled(bool setting); 01966 01980 void setWantsMultiClickEvents(bool setting); 01981 01994 void setMouseAutoRepeatEnabled(bool setting); 01995 02007 void setAutoRepeatDelay(float delay); 02008 02021 void setAutoRepeatRate(float rate); 02022 02032 void setDistributesCapturedInputs(bool setting); 02033 02039 void notifyDragDropItemEnters(DragContainer* item); 02040 02046 void notifyDragDropItemLeaves(DragContainer* item); 02047 02053 void notifyDragDropItemDropped(DragContainer* item); 02054 02068 virtual void destroy(void); 02069 02085 void setTooltip(Tooltip* tooltip); 02086 02105 void setTooltipType(const String& tooltipType); 02106 02118 void setTooltipText(const String& tip); 02119 02134 void setInheritsTooltipText(bool setting); 02135 02159 void setRiseOnClickEnabled(bool setting) { d_riseOnClick = setting; } 02160 02192 virtual void setLookNFeel(const String& look); 02193 02207 void setModalState(bool state); 02208 02238 virtual void performChildWindowLayout(bool nonclient_sized_hint = false, 02239 bool client_sized_hint = false); 02240 02254 void setUserString(const String& name, const String& value); 02255 02264 void render(); 02265 02284 virtual void update(float elapsed); 02285 02296 virtual bool performCopy(Clipboard& clipboard); 02297 02308 virtual bool performCut(Clipboard& clipboard); 02309 02320 virtual bool performPaste(Clipboard& clipboard); 02321 02332 virtual void writeXMLToStream(XMLSerializer& xml_stream) const; 02333 02342 virtual void beginInitialisation(void) {d_initialising = true;} 02343 02351 virtual void endInitialisation(void) {d_initialising = false;} 02352 02363 void setMousePassThroughEnabled(bool setting) {d_mousePassThroughEnabled = setting;} 02364 02379 void setWindowRenderer(const String& name); 02380 02389 WindowRenderer* getWindowRenderer(void) const; 02390 02400 const String& getWindowRendererName() const; 02401 02406 void setWritingXMLAllowed(bool allow) {d_allowWriteXML = allow;} 02407 02418 virtual void notifyScreenAreaChanged(bool recursive = true); 02419 02431 void setFalagardType(const String& type, const String& rendererType = ""); 02432 02442 void setDragDropTarget(bool setting); 02443 02464 void setRenderingSurface(RenderingSurface* surface); 02465 02472 void invalidateRenderingSurface(); 02473 02515 void setUsingAutoRenderingSurface(bool setting); 02516 02518 const RenderedString& getRenderedString() const; 02520 RenderedStringParser* getCustomRenderedStringParser() const; 02522 void setCustomRenderedStringParser(RenderedStringParser* parser); 02524 virtual RenderedStringParser& getRenderedStringParser() const; 02526 bool isTextParsingEnabled() const; 02528 void setTextParsingEnabled(const bool setting); 02529 02531 virtual void setMargin(const UBox& margin); 02533 const UBox& getMargin() const; 02534 02536 Vector2f getUnprojectedPosition(const Vector2f& pos) const; 02537 02539 const BidiVisualMapping* getBidiVisualMapping() const 02540 {return d_bidiVisualMapping;} 02541 02553 void banPropertyFromXML(const String& property_name); 02554 02556 void unbanPropertyFromXML(const String& property_name); 02557 02566 bool isPropertyBannedFromXML(const String& property_name) const; 02567 02569 void banPropertyFromXML(const Property* property); 02570 02572 void unbanPropertyFromXML(const Property* property); 02573 02582 bool isPropertyBannedFromXML(const Property* property) const; 02583 02601 void setUpdateMode(const WindowUpdateMode mode); 02602 02620 WindowUpdateMode getUpdateMode() const; 02621 02632 void setMouseInputPropagationEnabled(const bool enabled); 02633 02644 bool isMouseInputPropagationEnabled() const; 02645 02656 Window* clone(const bool deepCopy = true) const; 02657 02659 virtual void clonePropertiesTo(Window& target) const; 02661 virtual void cloneChildWidgetsTo(Window& target) const; 02662 02664 GUIContext& getGUIContext() const; 02666 void setGUIContext(GUIContext* context); 02667 02669 void syncTargetSurface(); 02670 02678 void setAutoWindow(bool is_auto); 02679 02690 bool isMouseContainedInArea() const; 02691 02692 // overridden from Element 02693 const Sizef& getRootContainerSize() const; 02694 02695 protected: 02696 // friend classes for construction / initialisation purposes (for now) 02697 friend class System; 02698 friend class WindowManager; 02699 friend class GUIContext; 02700 02701 /************************************************************************* 02702 Event trigger methods 02703 *************************************************************************/ 02713 virtual void onSized(ElementEventArgs& e); 02714 02724 virtual void onMoved(ElementEventArgs& e); 02725 02726 virtual void onRotated(ElementEventArgs& e); 02727 02737 virtual void onTextChanged(WindowEventArgs& e); 02738 02748 virtual void onFontChanged(WindowEventArgs& e); 02749 02759 virtual void onAlphaChanged(WindowEventArgs& e); 02760 02770 virtual void onIDChanged(WindowEventArgs& e); 02771 02781 virtual void onShown(WindowEventArgs& e); 02782 02792 virtual void onHidden(WindowEventArgs& e); 02793 02803 virtual void onEnabled(WindowEventArgs& e); 02804 02814 virtual void onDisabled(WindowEventArgs& e); 02815 02826 virtual void onClippingChanged(WindowEventArgs& e); 02827 02838 virtual void onParentDestroyChanged(WindowEventArgs& e); 02839 02850 virtual void onInheritsAlphaChanged(WindowEventArgs& e); 02851 02861 virtual void onAlwaysOnTopChanged(WindowEventArgs& e); 02862 02872 virtual void onCaptureGained(WindowEventArgs& e); 02873 02883 virtual void onCaptureLost(WindowEventArgs& e); 02884 02894 virtual void onInvalidated(WindowEventArgs& e); 02895 02905 virtual void onRenderingStarted(WindowEventArgs& e); 02906 02916 virtual void onRenderingEnded(WindowEventArgs& e); 02917 02927 virtual void onZChanged(WindowEventArgs& e); 02928 02938 virtual void onDestructionStarted(WindowEventArgs& e); 02939 02948 virtual void onActivated(ActivationEventArgs& e); 02949 02959 virtual void onDeactivated(ActivationEventArgs& e); 02960 02972 virtual void onParentSized(ElementEventArgs& e); 02973 02982 virtual void onChildAdded(ElementEventArgs& e); 02983 02992 virtual void onChildRemoved(ElementEventArgs& e); 02993 03001 virtual void onMouseEntersArea(MouseEventArgs& e); 03002 03010 virtual void onMouseLeavesArea(MouseEventArgs& e); 03011 03026 virtual void onMouseEnters(MouseEventArgs& e); 03027 03042 virtual void onMouseLeaves(MouseEventArgs& e); 03043 03052 virtual void onMouseMove(MouseEventArgs& e); 03053 03062 virtual void onMouseWheel(MouseEventArgs& e); 03063 03072 virtual void onMouseButtonDown(MouseEventArgs& e); 03073 03082 virtual void onMouseButtonUp(MouseEventArgs& e); 03083 03092 virtual void onMouseClicked(MouseEventArgs& e); 03093 03102 virtual void onMouseDoubleClicked(MouseEventArgs& e); 03103 03112 virtual void onMouseTripleClicked(MouseEventArgs& e); 03113 03125 virtual void onKeyDown(KeyEventArgs& e); 03126 03138 virtual void onKeyUp(KeyEventArgs& e); 03139 03151 virtual void onCharacter(KeyEventArgs& e); 03152 03163 virtual void onDragDropItemEnters(DragDropEventArgs& e); 03164 03175 virtual void onDragDropItemLeaves(DragDropEventArgs& e); 03176 03187 virtual void onDragDropItemDropped(DragDropEventArgs& e); 03188 03198 virtual void onWindowRendererAttached(WindowEventArgs& e); 03199 03209 virtual void onWindowRendererDetached(WindowEventArgs& e); 03210 03221 virtual void onTextParsingChanged(WindowEventArgs& e); 03222 03223 virtual void onMarginChanged(WindowEventArgs& e); 03224 03225 /************************************************************************* 03226 Implementation Functions 03227 *************************************************************************/ 03239 virtual void updateSelf(float elapsed); 03240 03252 virtual void drawSelf(const RenderingContext& ctx); 03253 03264 void bufferGeometry(const RenderingContext& ctx); 03265 03276 void queueGeometry(const RenderingContext& ctx); 03277 03284 virtual void populateGeometryBuffer() {} 03285 03297 virtual void setParent(Element* parent); 03298 03303 void generateAutoRepeatEvent(MouseButton button); 03304 03316 virtual bool validateWindowRenderer(const WindowRenderer* renderer) const; 03317 03324 bool isPropertyAtDefault(const Property* property) const; 03325 03331 void notifyClippingChanged(void); 03332 03334 void allocateRenderingWindow(); 03335 03337 void releaseRenderingWindow(); 03338 03340 void initialiseClippers(const RenderingContext& ctx); 03341 03343 virtual void setArea_impl(const UVector2& pos, const USize& size, bool topLeftSizing = false, bool fireEvents = true); 03344 03349 virtual void cleanupChildren(void); 03350 03354 virtual void addChild_impl(Element* element); 03355 03359 virtual void removeChild_impl(Element* element); 03360 03365 virtual void onZChange_impl(void); 03366 03371 void addWindowProperties(void); 03372 03381 virtual bool moveToFront_impl(bool wasClicked); 03382 03402 void addWindowToDrawList(Window& wnd, bool at_back = false); 03403 03415 void removeWindowFromDrawList(const Window& wnd); 03416 03428 bool isTopOfZOrder() const; 03429 03435 void updateGeometryRenderSettings(); 03436 03438 void transferChildSurfaces(); 03439 03441 Rectf getParentElementClipIntersection(const Rectf& unclipped_area) const; 03442 03444 void invalidate_impl(const bool recursive); 03445 03452 const Window* getWindowAttachedToCommonAncestor(const Window& wnd) const; 03453 03454 virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const; 03456 virtual Rectf getOuterRectClipper_impl() const; 03458 virtual Rectf getInnerRectClipper_impl() const; 03460 virtual Rectf getHitTestRect_impl() const; 03461 03462 virtual int writePropertiesXML(XMLSerializer& xml_stream) const; 03463 virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const; 03464 virtual bool writeAutoChildWindowXML(XMLSerializer& xml_stream) const; 03465 03466 virtual void banPropertiesForAutoWindow(); 03467 03469 virtual bool handleFontRenderSizeChange(const EventArgs& args); 03470 03471 // mark the rect caches defined on Window invalid (does not affect Element) 03472 void markCachedWindowRectsInvalid(); 03473 void layoutLookNFeelChildWidgets(); 03474 03475 Window* getChildAtPosition(const Vector2f& position, 03476 bool (Window::*hittestfunc)(const Vector2f&, bool) const, 03477 bool allow_disabled = false) const; 03478 03479 bool isHitTargetWindow(const Vector2f& position, bool allow_disabled) const; 03480 03481 /************************************************************************* 03482 Properties for Window base class 03483 *************************************************************************/ 03484 03496 static 03497 class WindowRendererProperty : public TplWindowProperty<Window, String> 03498 { 03499 public: 03500 WindowRendererProperty(); 03501 void writeXMLToStream(const PropertyReceiver* receiver, 03502 XMLSerializer& xml_stream) const; 03503 } d_windowRendererProperty; 03504 03516 static 03517 class LookNFeelProperty : public TplWindowProperty<Window, String> 03518 { 03519 public: 03520 LookNFeelProperty(); 03521 void writeXMLToStream(const PropertyReceiver* receiver, 03522 XMLSerializer& xml_stream) const; 03523 } d_lookNFeelProperty; 03524 03525 /************************************************************************* 03526 Implementation Data 03527 *************************************************************************/ 03529 typedef std::vector<Window* 03530 CEGUI_VECTOR_ALLOC(Window*)> ChildDrawList; 03532 typedef std::map<String, String, StringFastLessCompare 03533 CEGUI_MAP_ALLOC(String, String)> UserStringMap; 03535 typedef std::set<String, StringFastLessCompare 03536 CEGUI_SET_ALLOC(String)> BannedXMLPropertySet; 03537 03539 const String d_type; 03541 String d_falagardType; 03543 bool d_autoWindow; 03544 03546 bool d_initialising; 03548 bool d_destructionStarted; 03550 bool d_enabled; 03552 bool d_visible; 03554 bool d_active; 03555 03557 ChildDrawList d_drawList; 03559 bool d_destroyedByParent; 03560 03562 bool d_clippedByParent; 03563 03565 String d_lookName; 03567 WindowRenderer* d_windowRenderer; 03569 GeometryBuffer* d_geometry; 03571 RenderingSurface* d_surface; 03573 mutable bool d_needsRedraw; 03575 bool d_autoRenderingWindow; 03576 03578 const Image* d_mouseCursor; 03579 03581 float d_alpha; 03583 bool d_inheritsAlpha; 03584 03586 Window* d_oldCapture; 03588 bool d_restoreOldCapture; 03590 bool d_distCapturedInputs; 03591 03593 const Font* d_font; 03595 String d_textLogical; 03597 BidiVisualMapping* d_bidiVisualMapping; 03599 mutable bool d_bidiDataValid; 03601 mutable RenderedString d_renderedString; 03603 mutable bool d_renderedStringValid; 03605 static BasicRenderedStringParser d_basicStringParser; 03607 static DefaultRenderedStringParser d_defaultStringParser; 03609 RenderedStringParser* d_customStringParser; 03611 bool d_textParsingEnabled; 03612 03614 UBox d_margin; 03615 03617 uint d_ID; 03619 void* d_userData; 03621 UserStringMap d_userStrings; 03622 03624 bool d_alwaysOnTop; 03626 bool d_riseOnClick; 03628 bool d_zOrderingEnabled; 03629 03631 bool d_wantsMultiClicks; 03633 bool d_mousePassThroughEnabled; 03635 bool d_autoRepeat; 03637 float d_repeatDelay; 03639 float d_repeatRate; 03641 MouseButton d_repeatButton; 03643 bool d_repeating; 03645 float d_repeatElapsed; 03646 03648 bool d_dragDropTarget; 03649 03651 String d_tooltipText; 03653 Tooltip* d_customTip; 03655 bool d_weOwnTip; 03657 bool d_inheritsTipText; 03658 03660 bool d_allowWriteXML; 03662 BannedXMLPropertySet d_bannedXMLProperties; 03663 03665 mutable Rectf d_outerRectClipper; 03667 mutable Rectf d_innerRectClipper; 03669 mutable Rectf d_hitTestRect; 03670 03671 mutable bool d_outerRectClipperValid; 03672 mutable bool d_innerRectClipperValid; 03673 mutable bool d_hitTestRectValid; 03674 03676 WindowUpdateMode d_updateMode; 03677 03679 bool d_propagateMouseInputs; 03680 03682 GUIContext* d_guiContext; 03683 03685 bool d_containsMouse; 03686 03687 private: 03688 /************************************************************************* 03689 May not copy or assign Window objects 03690 *************************************************************************/ 03691 Window(const Window&): NamedElement() {} 03692 Window& operator=(const Window&) {return *this;} 03693 03695 const Font* property_getFont() const; 03697 const Image* property_getMouseCursor() const; 03698 03700 Event::ScopedConnection d_fontRenderSizeChangeConnection; 03701 }; 03702 03703 } // End of CEGUI namespace section 03704 03705 03706 #if defined(_MSC_VER) 03707 # pragma warning(pop) 03708 #endif 03709 03710 #endif // end of guard _CEGUIWindow_h_ 03711