Crazy Eddies GUI System
0.7.6
|
00001 /*********************************************************************** 00002 filename: CEGUIWindow.h 00003 created: 21/2/2004 00004 author: Paul D Turner 00005 00006 purpose: Defines abstract base class for Window objects 00007 *************************************************************************/ 00008 /*************************************************************************** 00009 * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining 00012 * a copy of this software and associated documentation files (the 00013 * "Software"), to deal in the Software without restriction, including 00014 * without limitation the rights to use, copy, modify, merge, publish, 00015 * distribute, sublicense, and/or sell copies of the Software, and to 00016 * permit persons to whom the Software is furnished to do so, subject to 00017 * the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be 00020 * included in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00023 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00024 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00025 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00026 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00027 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00028 * OTHER DEALINGS IN THE SOFTWARE. 00029 ***************************************************************************/ 00030 #ifndef _CEGUIWindow_h_ 00031 #define _CEGUIWindow_h_ 00032 00033 #include "CEGUIBase.h" 00034 #include "CEGUIString.h" 00035 #include "CEGUIVector.h" 00036 #include "CEGUIRect.h" 00037 #include "CEGUISize.h" 00038 #include "CEGUIEventSet.h" 00039 #include "CEGUIPropertySet.h" 00040 #include "CEGUISystem.h" 00041 #include "CEGUIInputEvent.h" 00042 #include "CEGUIWindowProperties.h" 00043 #include "CEGUIUDim.h" 00044 #include "CEGUIWindowRenderer.h" 00045 #include "CEGUITextUtils.h" 00046 #include "CEGUIBasicRenderedStringParser.h" 00047 #include "CEGUIDefaultRenderedStringParser.h" 00048 #include <vector> 00049 #include <set> 00050 00051 00052 #if defined(_MSC_VER) 00053 # pragma warning(push) 00054 # pragma warning(disable : 4251) 00055 #endif 00056 00057 00058 // Start of CEGUI namespace section 00059 namespace CEGUI 00060 { 00065 enum VerticalAlignment 00066 { 00071 VA_TOP, 00076 VA_CENTRE, 00081 VA_BOTTOM 00082 }; 00083 00088 enum HorizontalAlignment 00089 { 00094 HA_LEFT, 00099 HA_CENTRE, 00104 HA_RIGHT 00105 }; 00106 00115 enum WindowUpdateMode 00116 { 00118 WUM_ALWAYS, 00120 WUM_NEVER, 00122 WUM_VISIBLE 00123 }; 00124 00138 class CEGUIEXPORT Window : public PropertySet, public EventSet 00139 { 00140 public: 00141 /************************************************************************* 00142 Event name constants 00143 *************************************************************************/ 00145 static const String EventNamespace; 00146 00147 // generated internally by Window 00151 static const String EventWindowUpdated; 00157 static const String EventParentSized; 00162 static const String EventSized; 00167 static const String EventMoved; 00172 static const String EventTextChanged; 00177 static const String EventFontChanged; 00182 static const String EventAlphaChanged; 00187 static const String EventIDChanged; 00194 static const String EventActivated; 00201 static const String EventDeactivated; 00206 static const String EventShown; 00211 static const String EventHidden; 00216 static const String EventEnabled; 00222 static const String EventDisabled; 00228 static const String EventClippedByParentChanged; 00234 static const String EventDestroyedByParentChanged; 00240 static const String EventInheritsAlphaChanged; 00246 static const String EventAlwaysOnTopChanged; 00251 static const String EventInputCaptureGained; 00260 static const String EventInputCaptureLost; 00268 static const String EventRenderingStarted; 00276 static const String EventRenderingEnded; 00281 static const String EventChildAdded; 00286 static const String EventChildRemoved; 00291 static const String EventDestructionStarted; 00297 static const String EventZOrderChanged; 00305 static const String EventDragDropItemEnters; 00313 static const String EventDragDropItemLeaves; 00320 static const String EventDragDropItemDropped; 00326 static const String EventVerticalAlignmentChanged; 00332 static const String EventHorizontalAlignmentChanged; 00338 static const String EventWindowRendererAttached; 00344 static const String EventWindowRendererDetached; 00349 static const String EventRotated; 00355 static const String EventNonClientChanged; 00362 static const String EventTextParsingChanged; 00368 static const String EventMarginChanged; 00369 00370 // generated externally (inputs) 00375 static const String EventMouseEntersArea; 00380 static const String EventMouseLeavesArea; 00391 static const String EventMouseEnters; 00402 static const String EventMouseLeaves; 00407 static const String EventMouseMove; 00413 static const String EventMouseWheel; 00418 static const String EventMouseButtonDown; 00423 static const String EventMouseButtonUp; 00430 static const String EventMouseClick; 00436 static const String EventMouseDoubleClick; 00442 static const String EventMouseTripleClick; 00451 static const String EventKeyDown; 00460 static const String EventKeyUp; 00468 static const String EventCharacterKey; 00469 00470 /************************************************************************* 00471 Child Widget name suffix constants 00472 *************************************************************************/ 00474 static const String TooltipNameSuffix; 00476 static const String AutoWidgetNameSuffix; 00477 00478 00489 Window(const String& type, const String& name); 00490 00495 virtual ~Window(void); 00496 00504 const String& getType(void) const; 00505 00513 const String& getName(void) const {return d_name;} 00514 00524 bool isDestroyedByParent(void) const {return d_destroyedByParent;} 00525 00535 bool isAlwaysOnTop(void) const {return d_alwaysOnTop;} 00536 00549 bool isDisabled(bool localOnly = false) const; 00550 00567 bool isVisible(bool localOnly = false) const; 00568 00583 bool isActive(void) const; 00584 00594 bool isClippedByParent(void) const {return d_clippedByParent;} 00595 00603 uint getID(void) const {return d_ID;} 00604 00614 size_t getChildCount(void) const {return d_children.size();} 00615 00628 bool isChild(const String& name) const; 00629 00646 bool isChild(uint ID) const; 00647 00668 bool isChildRecursive(uint ID) const; 00669 00681 bool isChild(const Window* window) const; 00682 00704 Window* getChild(const String& name) const; 00705 00727 Window* getChild(uint ID) const; 00728 00752 Window* getChildRecursive(const String& name) const; 00753 00775 Window* getChildRecursive(uint ID) const; 00776 00790 Window* getChildAtIdx(size_t idx) const {return d_children[idx];} 00791 00804 Window* getActiveChild(void); 00805 const Window* getActiveChild(void) const; 00806 00820 bool isAncestor(const String& name) const; 00821 00835 bool isAncestor(uint ID) const; 00836 00849 bool isAncestor(const Window* window) const; 00850 00864 Font* getFont(bool useDefault = true) const; 00865 00873 const String& getText(void) const {return d_textLogical;} 00874 00876 const String& getTextVisual() const; 00877 00886 bool inheritsAlpha(void) const {return d_inheritsAlpha;} 00887 00905 float getAlpha(void) const {return d_alpha;} 00906 00916 float getEffectiveAlpha(void) const; 00917 00923 Rect getUnclippedOuterRect() const; 00924 00930 Rect getUnclippedInnerRect() const; 00931 00943 Rect getUnclippedRect(const bool inner) const; 00944 00957 Rect getOuterRectClipper() const; 00958 00971 Rect getInnerRectClipper() const; 00972 00991 Rect getClipRect(const bool non_client = false) const; 00992 01003 Rect getHitTestRect() const; 01004 01024 Rect getChildWindowContentArea(const bool non_client = false) const; 01025 01042 virtual Rect getUnclippedInnerRect_impl(void) const; 01043 01052 static Window* getCaptureWindow(void) {return d_captureWindow;} 01053 01062 bool isCapturedByThis(void) const {return getCaptureWindow() == this;} 01063 01073 bool isCapturedByAncestor(void) const 01074 {return isAncestor(getCaptureWindow());} 01075 01084 bool isCapturedByChild(void) const {return isChild(getCaptureWindow());} 01085 01102 virtual bool isHit(const Vector2& position, 01103 const bool allow_disabled = false) const; 01104 01117 Window* getChildAtPosition(const Vector2& position) const; 01118 01136 Window* getTargetChildAtPosition(const Vector2& position, 01137 const bool allow_disabled = false) const; 01138 01147 Window* getParent(void) const {return d_parent;} 01148 01163 const Image* getMouseCursor(bool useDefault = true) const; 01164 01172 Size getPixelSize(void) const { return d_pixelSize; } 01173 01185 void* getUserData(void) const {return d_userData;} 01186 01201 bool restoresOldCapture(void) const {return d_restoreOldCapture;} 01202 01222 bool isZOrderingEnabled(void) const; 01223 01234 bool wantsMultiClickEvents(void) const; 01235 01247 bool isMouseAutoRepeatEnabled(void) const; 01248 01257 float getAutoRepeatDelay(void) const; 01258 01268 float getAutoRepeatRate(void) const; 01269 01279 bool distributesCapturedInputs(void) const; 01280 01290 bool isUsingDefaultTooltip(void) const; 01291 01301 Tooltip* getTooltip(void) const; 01302 01311 String getTooltipType(void) const; 01312 01320 const String& getTooltipText(void) const; 01321 01333 bool inheritsTooltipText(void) const; 01334 01355 bool isRiseOnClickEnabled(void) const { return d_riseOnClick; } 01356 01368 bool testClassName(const String& class_name) const 01369 {return testClassName_impl(class_name);} 01370 01381 VerticalAlignment getVerticalAlignment() const {return d_vertAlign;} 01382 01393 HorizontalAlignment getHorizontalAlignment() const {return d_horzAlign;} 01394 01402 GeometryBuffer& getGeometryBuffer(); 01403 01412 const String& getLookNFeel() const; 01413 01421 bool getModalState(void) const 01422 {return(System::getSingleton().getModalTarget() == this);} 01423 01437 const String& getUserString(const String& name) const; 01438 01450 bool isUserStringDefined(const String& name) const; 01451 01467 Window* getActiveSibling(); 01468 01478 Size getParentPixelSize(void) const; 01479 01489 float getParentPixelWidth(void) const; 01490 01500 float getParentPixelHeight(void) const; 01501 01512 bool isMousePassThroughEnabled(void) const {return d_mousePassThroughEnabled;} 01513 01519 bool isAutoWindow(void) const {return d_autoWindow;} 01520 01525 bool isWritingXMLAllowed(void) const {return d_allowWriteXML;} 01526 01551 EventSet::Iterator getEventIterator() const; 01552 01573 PropertySet::Iterator getPropertyIterator() const; 01574 01584 bool isDragDropTarget() const; 01585 01591 void getRenderingContext(RenderingContext& ctx) const; 01592 01594 virtual void getRenderingContext_impl(RenderingContext& ctx) const; 01595 01601 RenderingSurface* getRenderingSurface() const; 01602 01608 RenderingSurface& getTargetRenderingSurface() const; 01609 01621 bool isUsingAutoRenderingSurface() const; 01622 01633 const Window* getRootWindow() const; 01634 Window* getRootWindow(); 01635 01637 const Vector3& getRotation() const; 01638 01653 bool isNonClientWindow() const; 01654 01665 void rename(const String& new_name); 01666 01678 virtual void initialiseComponents(void) {} 01679 01693 void setDestroyedByParent(bool setting); 01694 01707 void setAlwaysOnTop(bool setting); 01708 01721 void setEnabled(bool setting); 01722 01730 void enable(void) {setEnabled(true);} 01731 01739 void disable(void) {setEnabled(false);} 01740 01758 void setVisible(bool setting); 01759 01772 void show(void) {setVisible(true);} 01773 01784 void hide(void) {setVisible(false);} 01785 01794 void activate(void); 01795 01805 void deactivate(void); 01806 01819 void setClippedByParent(bool setting); 01820 01832 void setID(uint ID); 01833 01844 void setText(const String& text); 01845 01859 void insertText(const String& text, const String::size_type position); 01860 01870 void appendText(const String& text); 01871 01883 void setFont(Font* font); 01884 01899 void setFont(const String& name); 01900 01919 void addChildWindow(const String& name); 01920 01937 void addChildWindow(Window* window); 01938 01950 void removeChildWindow(const String& name); 01951 01963 void removeChildWindow(Window* window); 01964 01978 void removeChildWindow(uint ID); 01979 01993 void moveToFront(); 01994 02009 void moveToBack(); 02010 02024 void moveInFront(const Window* const window); 02025 02040 void moveBehind(const Window* const window); 02041 02051 bool captureInput(void); 02052 02061 void releaseInput(void); 02062 02081 void setRestoreCapture(bool setting); 02082 02103 void setAlpha(float alpha); 02104 02116 void setInheritsAlpha(bool setting); 02117 02129 void invalidate(void); 02130 02146 void invalidate(const bool recursive); 02147 02159 void setMouseCursor(const Image* image); 02160 02171 void setMouseCursor(MouseCursorImage image); 02172 02192 void setMouseCursor(const String& imageset, const String& image_name); 02193 02208 void setUserData(void* user_data) {d_userData = user_data;} 02209 02232 void setZOrderingEnabled(bool setting); 02233 02247 void setWantsMultiClickEvents(bool setting); 02248 02261 void setMouseAutoRepeatEnabled(bool setting); 02262 02274 void setAutoRepeatDelay(float delay); 02275 02288 void setAutoRepeatRate(float rate); 02289 02299 void setDistributesCapturedInputs(bool setting); 02300 02306 void notifyDragDropItemEnters(DragContainer* item); 02307 02313 void notifyDragDropItemLeaves(DragContainer* item); 02314 02320 void notifyDragDropItemDropped(DragContainer* item); 02321 02335 virtual void destroy(void); 02336 02352 void setTooltip(Tooltip* tooltip); 02353 02372 void setTooltipType(const String& tooltipType); 02373 02385 void setTooltipText(const String& tip); 02386 02401 void setInheritsTooltipText(bool setting); 02402 02426 void setRiseOnClickEnabled(bool setting) { d_riseOnClick = setting; } 02427 02441 void setVerticalAlignment(const VerticalAlignment alignment); 02442 02456 void setHorizontalAlignment(const HorizontalAlignment alignment); 02457 02474 virtual void setLookNFeel(const String& look); 02475 02489 void setModalState(bool state); 02490 02501 virtual void performChildWindowLayout(); 02502 02516 void setUserString(const String& name, const String& value); 02517 02544 void setArea(const UDim& xpos, const UDim& ypos, const UDim& width, const UDim& height); 02545 02567 void setArea(const UVector2& pos, const UVector2& size); 02568 02586 void setArea(const URect& area); 02587 02606 void setPosition(const UVector2& pos); 02607 02625 void setXPosition(const UDim& x); 02626 02644 void setYPosition(const UDim& y); 02645 02660 void setSize(const UVector2& size); 02661 02676 void setWidth(const UDim& width); 02677 02692 void setHeight(const UDim& height); 02693 02710 void setMaxSize(const UVector2& size); 02711 02728 void setMinSize(const UVector2& size); 02729 02747 const URect& getArea() const; 02748 02766 const UVector2& getPosition() const; 02767 02785 const UDim& getXPosition() const; 02786 02804 const UDim& getYPosition() const; 02805 02820 UVector2 getSize() const; 02821 02836 UDim getWidth() const; 02837 02852 UDim getHeight() const; 02853 02870 const UVector2& getMaxSize() const; 02871 02888 const UVector2& getMinSize() const; 02889 02898 void render(); 02899 02918 virtual void update(float elapsed); 02919 02930 virtual void writeXMLToStream(XMLSerializer& xml_stream) const; 02931 02940 virtual void beginInitialisation(void) {d_initialising = true;} 02941 02949 virtual void endInitialisation(void) {d_initialising = false;} 02950 02961 void setMousePassThroughEnabled(bool setting) {d_mousePassThroughEnabled = setting;} 02962 02974 void setWindowRenderer(const String& name); 02975 02984 WindowRenderer* getWindowRenderer(void) const; 02985 02995 String getWindowRendererName(void) const; 02996 03001 void setWritingXMLAllowed(bool allow) {d_allowWriteXML = allow;} 03002 03013 void notifyScreenAreaChanged(bool recursive = true); 03014 03026 void setFalagardType(const String& type, const String& rendererType = ""); 03027 03037 void setDragDropTarget(bool setting); 03038 03059 void setRenderingSurface(RenderingSurface* surface); 03060 03067 void invalidateRenderingSurface(); 03068 03110 void setUsingAutoRenderingSurface(bool setting); 03111 03113 void setRotation(const Vector3& rotation); 03114 03129 void setNonClientWindow(const bool setting); 03130 03132 const RenderedString& getRenderedString() const; 03134 RenderedStringParser* getCustomRenderedStringParser() const; 03136 void setCustomRenderedStringParser(RenderedStringParser* parser); 03138 virtual RenderedStringParser& getRenderedStringParser() const; 03140 bool isTextParsingEnabled() const; 03142 void setTextParsingEnabled(const bool setting); 03143 03145 virtual void setMargin(const UBox& margin); 03147 const UBox& getMargin() const; 03148 03150 Vector2 getUnprojectedPosition(const Vector2& pos) const; 03151 03153 const BiDiVisualMapping* getBiDiVisualMapping() const 03154 {return d_bidiVisualMapping;} 03155 03157 void banPropertyFromXML(const String& property_name); 03158 03160 void unbanPropertyFromXML(const String& property_name); 03161 03163 bool isPropertyBannedFromXML(const String& property_name) const; 03164 03166 void banPropertyFromXML(const Property* property); 03167 03169 void unbanPropertyFromXML(const Property* property); 03170 03172 bool isPropertyBannedFromXML(const Property* property) const; 03173 03191 void setUpdateMode(const WindowUpdateMode mode); 03192 03210 WindowUpdateMode getUpdateMode() const; 03211 03222 void setMouseInputPropagationEnabled(const bool enabled); 03223 03234 bool isMouseInputPropagationEnabled() const; 03235 03250 Window* clone(const String& newName, const bool deepCopy = true) const; 03251 03253 virtual void clonePropertiesTo(Window& target) const; 03255 virtual void cloneChildWidgetsTo(Window& target) const; 03256 03269 size_t getZIndex() const; 03270 03280 bool isInFront(const Window& wnd) const; 03281 03291 bool isBehind(const Window& wnd) const; 03292 03293 protected: 03294 // friend classes for construction / initialisation purposes (for now) 03295 friend class System; 03296 friend class WindowManager; 03297 03298 /************************************************************************* 03299 Event trigger methods 03300 *************************************************************************/ 03310 virtual void onSized(WindowEventArgs& e); 03311 03321 virtual void onMoved(WindowEventArgs& e); 03322 03332 virtual void onTextChanged(WindowEventArgs& e); 03333 03343 virtual void onFontChanged(WindowEventArgs& e); 03344 03354 virtual void onAlphaChanged(WindowEventArgs& e); 03355 03365 virtual void onIDChanged(WindowEventArgs& e); 03366 03376 virtual void onShown(WindowEventArgs& e); 03377 03387 virtual void onHidden(WindowEventArgs& e); 03388 03398 virtual void onEnabled(WindowEventArgs& e); 03399 03409 virtual void onDisabled(WindowEventArgs& e); 03410 03421 virtual void onClippingChanged(WindowEventArgs& e); 03422 03433 virtual void onParentDestroyChanged(WindowEventArgs& e); 03434 03445 virtual void onInheritsAlphaChanged(WindowEventArgs& e); 03446 03456 virtual void onAlwaysOnTopChanged(WindowEventArgs& e); 03457 03467 virtual void onCaptureGained(WindowEventArgs& e); 03468 03478 virtual void onCaptureLost(WindowEventArgs& e); 03479 03489 virtual void onRenderingStarted(WindowEventArgs& e); 03490 03500 virtual void onRenderingEnded(WindowEventArgs& e); 03501 03511 virtual void onZChanged(WindowEventArgs& e); 03512 03522 virtual void onDestructionStarted(WindowEventArgs& e); 03523 03532 virtual void onActivated(ActivationEventArgs& e); 03533 03543 virtual void onDeactivated(ActivationEventArgs& e); 03544 03556 virtual void onParentSized(WindowEventArgs& e); 03557 03566 virtual void onChildAdded(WindowEventArgs& e); 03567 03576 virtual void onChildRemoved(WindowEventArgs& e); 03577 03585 virtual void onMouseEntersArea(MouseEventArgs& e); 03586 03594 virtual void onMouseLeavesArea(MouseEventArgs& e); 03595 03610 virtual void onMouseEnters(MouseEventArgs& e); 03611 03626 virtual void onMouseLeaves(MouseEventArgs& e); 03627 03636 virtual void onMouseMove(MouseEventArgs& e); 03637 03646 virtual void onMouseWheel(MouseEventArgs& e); 03647 03656 virtual void onMouseButtonDown(MouseEventArgs& e); 03657 03666 virtual void onMouseButtonUp(MouseEventArgs& e); 03667 03676 virtual void onMouseClicked(MouseEventArgs& e); 03677 03686 virtual void onMouseDoubleClicked(MouseEventArgs& e); 03687 03696 virtual void onMouseTripleClicked(MouseEventArgs& e); 03697 03709 virtual void onKeyDown(KeyEventArgs& e); 03710 03722 virtual void onKeyUp(KeyEventArgs& e); 03723 03735 virtual void onCharacter(KeyEventArgs& e); 03736 03747 virtual void onDragDropItemEnters(DragDropEventArgs& e); 03748 03759 virtual void onDragDropItemLeaves(DragDropEventArgs& e); 03760 03771 virtual void onDragDropItemDropped(DragDropEventArgs& e); 03772 03783 virtual void onVerticalAlignmentChanged(WindowEventArgs& e); 03784 03795 virtual void onHorizontalAlignmentChanged(WindowEventArgs& e); 03796 03806 virtual void onWindowRendererAttached(WindowEventArgs& e); 03807 03817 virtual void onWindowRendererDetached(WindowEventArgs& e); 03818 03828 virtual void onRotated(WindowEventArgs& e); 03829 03840 virtual void onNonClientChanged(WindowEventArgs& e); 03841 03852 virtual void onTextParsingChanged(WindowEventArgs& e); 03853 03854 virtual void onMarginChanged(WindowEventArgs& e); 03855 03856 /************************************************************************* 03857 Implementation Functions 03858 *************************************************************************/ 03870 virtual void updateSelf(float elapsed); 03871 03883 virtual void drawSelf(const RenderingContext& ctx); 03884 03895 void bufferGeometry(const RenderingContext& ctx); 03896 03907 void queueGeometry(const RenderingContext& ctx); 03908 03915 virtual void populateGeometryBuffer() {} 03916 03928 virtual bool testClassName_impl(const String& class_name) const 03929 { 03930 if (class_name == "Window") return true; 03931 return false; 03932 } 03933 03945 void setParent(Window* parent); 03946 03947 Size getSize_impl(const Window* window) const; 03948 03953 void generateAutoRepeatEvent(MouseButton button); 03954 03963 virtual bool validateWindowRenderer(const String& name) const; 03964 03971 bool isPropertyAtDefault(const Property* property) const; 03972 03978 void notifyClippingChanged(void); 03979 03981 void allocateRenderingWindow(); 03982 03984 void releaseRenderingWindow(); 03985 03987 void initialiseClippers(const RenderingContext& ctx); 03988 03993 virtual void cleanupChildren(void); 03994 03999 virtual void addChild_impl(Window* wnd); 04000 04005 virtual void removeChild_impl(Window* wnd); 04006 04011 virtual void onZChange_impl(void); 04012 04017 void addStandardProperties(void); 04018 04027 virtual bool moveToFront_impl(bool wasClicked); 04028 04059 void setArea_impl(const UVector2& pos, const UVector2& size, 04060 bool topLeftSizing = false, bool fireEvents = true); 04061 04081 void addWindowToDrawList(Window& wnd, bool at_back = false); 04082 04094 void removeWindowFromDrawList(const Window& wnd); 04095 04107 bool isTopOfZOrder() const; 04108 04114 void updateGeometryRenderSettings(); 04115 04117 void transferChildSurfaces(); 04118 04120 Rect getParentElementClipIntersection(const Rect& unclipped_area) const; 04121 04123 void invalidate_impl(const bool recursive); 04124 04126 bool isInnerRectSizeChanged() const; 04127 04134 const Window* getWindowAttachedToCommonAncestor(const Window& wnd) const; 04135 04137 virtual Rect getUnclippedOuterRect_impl() const; 04139 virtual Rect getOuterRectClipper_impl() const; 04141 virtual Rect getInnerRectClipper_impl() const; 04143 virtual Rect getHitTestRect_impl() const; 04145 virtual Rect getNonClientChildWindowContentArea_impl() const; 04147 virtual Rect getClientChildWindowContentArea_impl() const; 04148 04149 virtual int writePropertiesXML(XMLSerializer& xml_stream) const; 04150 virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const; 04151 virtual bool writeAutoChildWindowXML(XMLSerializer& xml_stream) const; 04152 04153 // constrain given UVector2 to window's min size, return if size changed. 04154 bool constrainUVector2ToMinSize(const Size& base_sz, UVector2& sz); 04155 // constrain given UVector2 to window's max size, return if size changed. 04156 bool constrainUVector2ToMaxSize(const Size& base_sz, UVector2& sz); 04157 04158 /************************************************************************* 04159 Properties for Window base class 04160 *************************************************************************/ 04161 static WindowProperties::Alpha d_alphaProperty; 04162 static WindowProperties::AlwaysOnTop d_alwaysOnTopProperty; 04163 static WindowProperties::ClippedByParent d_clippedByParentProperty; 04164 static WindowProperties::DestroyedByParent d_destroyedByParentProperty; 04165 static WindowProperties::Disabled d_disabledProperty; 04166 static WindowProperties::Font d_fontProperty; 04167 static WindowProperties::ID d_IDProperty; 04168 static WindowProperties::InheritsAlpha d_inheritsAlphaProperty; 04169 static WindowProperties::MouseCursorImage d_mouseCursorProperty; 04170 static WindowProperties::RestoreOldCapture d_restoreOldCaptureProperty; 04171 static WindowProperties::Text d_textProperty; 04172 static WindowProperties::Visible d_visibleProperty; 04173 static WindowProperties::ZOrderChangeEnabled d_zOrderChangeProperty; 04174 static WindowProperties::WantsMultiClickEvents d_wantsMultiClicksProperty; 04175 static WindowProperties::MouseButtonDownAutoRepeat d_autoRepeatProperty; 04176 static WindowProperties::AutoRepeatDelay d_autoRepeatDelayProperty; 04177 static WindowProperties::AutoRepeatRate d_autoRepeatRateProperty; 04178 static WindowProperties::DistributeCapturedInputs d_distInputsProperty; 04179 static WindowProperties::CustomTooltipType d_tooltipTypeProperty; 04180 static WindowProperties::Tooltip d_tooltipProperty; 04181 static WindowProperties::InheritsTooltipText d_inheritsTooltipProperty; 04182 static WindowProperties::RiseOnClick d_riseOnClickProperty; 04183 static WindowProperties::VerticalAlignment d_vertAlignProperty; 04184 static WindowProperties::HorizontalAlignment d_horzAlignProperty; 04185 static WindowProperties::UnifiedAreaRect d_unifiedAreaRectProperty; 04186 static WindowProperties::UnifiedPosition d_unifiedPositionProperty; 04187 static WindowProperties::UnifiedXPosition d_unifiedXPositionProperty; 04188 static WindowProperties::UnifiedYPosition d_unifiedYPositionProperty; 04189 static WindowProperties::UnifiedSize d_unifiedSizeProperty; 04190 static WindowProperties::UnifiedWidth d_unifiedWidthProperty; 04191 static WindowProperties::UnifiedHeight d_unifiedHeightProperty; 04192 static WindowProperties::UnifiedMinSize d_unifiedMinSizeProperty; 04193 static WindowProperties::UnifiedMaxSize d_unifiedMaxSizeProperty; 04194 static WindowProperties::MousePassThroughEnabled d_mousePassThroughEnabledProperty; 04195 static WindowProperties::WindowRenderer d_windowRendererProperty; 04196 static WindowProperties::LookNFeel d_lookNFeelProperty; 04197 static WindowProperties::DragDropTarget d_dragDropTargetProperty; 04198 static WindowProperties::AutoRenderingSurface d_autoRenderingSurfaceProperty; 04199 static WindowProperties::Rotation d_rotationProperty; 04200 static WindowProperties::XRotation d_xRotationProperty; 04201 static WindowProperties::YRotation d_yRotationProperty; 04202 static WindowProperties::ZRotation d_zRotationProperty; 04203 static WindowProperties::NonClient d_nonClientProperty; 04204 static WindowProperties::TextParsingEnabled d_textParsingEnabledProperty; 04205 static WindowProperties::Margin d_marginProperty; 04206 static WindowProperties::UpdateMode d_updateModeProperty; 04207 static WindowProperties::MouseInputPropagationEnabled d_mouseInputPropagationProperty; 04208 04209 /************************************************************************* 04210 Implementation Data 04211 *************************************************************************/ 04213 typedef std::vector<Window*> ChildList; 04215 typedef std::map<String, String, String::FastLessCompare> UserStringMap; 04217 typedef std::set<String, String::FastLessCompare> BannedXMLPropertySet; 04218 04220 const String d_type; 04222 String d_name; 04224 String d_falagardType; 04226 bool d_autoWindow; 04227 04229 bool d_initialising; 04231 bool d_destructionStarted; 04233 bool d_enabled; 04235 bool d_visible; 04237 bool d_active; 04238 04240 ChildList d_children; 04242 ChildList d_drawList; 04244 Window* d_parent; 04246 bool d_destroyedByParent; 04247 04249 bool d_clippedByParent; 04251 bool d_nonClientContent; 04252 04254 String d_lookName; 04256 WindowRenderer* d_windowRenderer; 04258 GeometryBuffer* d_geometry; 04260 RenderingSurface* d_surface; 04262 mutable bool d_needsRedraw; 04264 bool d_autoRenderingWindow; 04265 04267 const Image* d_mouseCursor; 04268 04270 float d_alpha; 04272 bool d_inheritsAlpha; 04273 04275 static Window* d_captureWindow; 04277 Window* d_oldCapture; 04279 bool d_restoreOldCapture; 04281 bool d_distCapturedInputs; 04282 04284 Font* d_font; 04286 String d_textLogical; 04288 BiDiVisualMapping* d_bidiVisualMapping; 04290 mutable bool d_bidiDataValid; 04292 mutable RenderedString d_renderedString; 04294 mutable bool d_renderedStringValid; 04296 static BasicRenderedStringParser d_basicStringParser; 04298 static DefaultRenderedStringParser d_defaultStringParser; 04300 RenderedStringParser* d_customStringParser; 04302 bool d_textParsingEnabled; 04303 04305 UBox d_margin; 04306 04308 uint d_ID; 04310 void* d_userData; 04312 UserStringMap d_userStrings; 04313 04315 bool d_alwaysOnTop; 04317 bool d_riseOnClick; 04319 bool d_zOrderingEnabled; 04320 04322 bool d_wantsMultiClicks; 04324 bool d_mousePassThroughEnabled; 04326 bool d_autoRepeat; 04328 float d_repeatDelay; 04330 float d_repeatRate; 04332 MouseButton d_repeatButton; 04334 bool d_repeating; 04336 float d_repeatElapsed; 04337 04339 bool d_dragDropTarget; 04340 04342 String d_tooltipText; 04344 Tooltip* d_customTip; 04346 bool d_weOwnTip; 04348 bool d_inheritsTipText; 04349 04351 bool d_allowWriteXML; 04353 BannedXMLPropertySet d_bannedXMLProperties; 04354 04356 URect d_area; 04358 Size d_pixelSize; 04360 UVector2 d_minSize; 04362 UVector2 d_maxSize; 04364 HorizontalAlignment d_horzAlign; 04366 VerticalAlignment d_vertAlign; 04368 Vector3 d_rotation; 04369 04371 mutable Rect d_outerUnclippedRect; 04373 mutable Rect d_innerUnclippedRect; 04375 mutable Rect d_outerRectClipper; 04377 mutable Rect d_innerRectClipper; 04379 mutable Rect d_hitTestRect; 04380 04381 mutable bool d_outerUnclippedRectValid; 04382 mutable bool d_innerUnclippedRectValid; 04383 mutable bool d_outerRectClipperValid; 04384 mutable bool d_innerRectClipperValid; 04385 mutable bool d_hitTestRectValid; 04386 04388 WindowUpdateMode d_updateMode; 04390 bool d_propagateMouseInputs; 04391 04392 04393 private: 04394 /************************************************************************* 04395 May not copy or assign Window objects 04396 *************************************************************************/ 04397 Window(const Window&) : PropertySet(), EventSet() {} 04398 Window& operator=(const Window&) {return *this;} 04399 }; 04400 04401 } // End of CEGUI namespace section 04402 04403 04404 #if defined(_MSC_VER) 04405 # pragma warning(pop) 04406 #endif 04407 04408 #endif // end of guard _CEGUIWindow_h_ 04409