30 #ifndef _CEGUIWindow_h_
31 #define _CEGUIWindow_h_
33 #include "CEGUIBase.h"
34 #include "CEGUIString.h"
35 #include "CEGUIVector.h"
36 #include "CEGUIRect.h"
37 #include "CEGUISize.h"
38 #include "CEGUIEventSet.h"
39 #include "CEGUIPropertySet.h"
40 #include "CEGUISystem.h"
41 #include "CEGUIInputEvent.h"
42 #include "CEGUIWindowProperties.h"
43 #include "CEGUIUDim.h"
44 #include "CEGUIWindowRenderer.h"
45 #include "CEGUITextUtils.h"
46 #include "CEGUIBasicRenderedStringParser.h"
47 #include "CEGUIDefaultRenderedStringParser.h"
53 # pragma warning(push)
54 # pragma warning(disable : 4251)
504 const String& getType(
void)
const;
549 bool isDisabled(
bool localOnly =
false)
const;
567 bool isVisible(
bool localOnly =
false)
const;
583 bool isActive(
void)
const;
603 uint
getID(
void)
const {
return d_ID;}
628 bool isChild(
const String& name)
const;
646 bool isChild(uint ID)
const;
668 bool isChildRecursive(uint ID)
const;
681 bool isChild(
const Window* window)
const;
727 Window* getChild(uint ID)
const;
775 Window* getChildRecursive(uint ID)
const;
804 Window* getActiveChild(
void);
805 const Window* getActiveChild(
void)
const;
820 bool isAncestor(
const String& name)
const;
835 bool isAncestor(uint ID)
const;
849 bool isAncestor(
const Window* window)
const;
864 Font* getFont(
bool useDefault =
true)
const;
876 const String& getTextVisual()
const;
916 float getEffectiveAlpha(
void)
const;
923 Rect getUnclippedOuterRect()
const;
930 Rect getUnclippedInnerRect()
const;
943 Rect getUnclippedRect(
const bool inner)
const;
957 Rect getOuterRectClipper()
const;
971 Rect getInnerRectClipper()
const;
991 Rect getClipRect(
const bool non_client =
false)
const;
1003 Rect getHitTestRect()
const;
1024 Rect getChildWindowContentArea(
const bool non_client =
false)
const;
1042 virtual Rect getUnclippedInnerRect_impl(
void)
const;
1073 bool isCapturedByAncestor(
void)
const
1074 {
return isAncestor(getCaptureWindow());}
1102 virtual bool isHit(
const Vector2& position,
1103 const bool allow_disabled =
false)
const;
1137 const bool allow_disabled =
false)
const;
1163 const Image* getMouseCursor(
bool useDefault =
true)
const;
1222 bool isZOrderingEnabled(
void)
const;
1234 bool wantsMultiClickEvents(
void)
const;
1247 bool isMouseAutoRepeatEnabled(
void)
const;
1257 float getAutoRepeatDelay(
void)
const;
1268 float getAutoRepeatRate(
void)
const;
1279 bool distributesCapturedInputs(
void)
const;
1290 bool isUsingDefaultTooltip(
void)
const;
1301 Tooltip* getTooltip(
void)
const;
1311 String getTooltipType(
void)
const;
1320 const String& getTooltipText(
void)
const;
1333 bool inheritsTooltipText(
void)
const;
1368 bool testClassName(
const String& class_name)
const
1369 {
return testClassName_impl(class_name);}
1412 const String& getLookNFeel()
const;
1421 bool getModalState(
void)
const
1450 bool isUserStringDefined(
const String& name)
const;
1467 Window* getActiveSibling();
1478 Size getParentPixelSize(
void)
const;
1489 float getParentPixelWidth(
void)
const;
1500 float getParentPixelHeight(
void)
const;
1584 bool isDragDropTarget()
const;
1621 bool isUsingAutoRenderingSurface()
const;
1633 const Window* getRootWindow()
const;
1637 const Vector3& getRotation()
const;
1653 bool isNonClientWindow()
const;
1665 void rename(
const String& new_name);
1693 void setDestroyedByParent(
bool setting);
1707 void setAlwaysOnTop(
bool setting);
1721 void setEnabled(
bool setting);
1758 void setVisible(
bool setting);
1772 void show(
void) {setVisible(
true);}
1784 void hide(
void) {setVisible(
false);}
1794 void activate(
void);
1805 void deactivate(
void);
1819 void setClippedByParent(
bool setting);
1832 void setID(uint ID);
1844 void setText(
const String& text);
1870 void appendText(
const String& text);
1883 void setFont(
Font* font);
1899 void setFont(
const String& name);
1919 void addChildWindow(
const String& name);
1937 void addChildWindow(
Window* window);
1950 void removeChildWindow(
const String& name);
1963 void removeChildWindow(
Window* window);
1978 void removeChildWindow(uint ID);
2024 void moveInFront(
const Window*
const window);
2040 void moveBehind(
const Window*
const window);
2051 bool captureInput(
void);
2061 void releaseInput(
void);
2081 void setRestoreCapture(
bool setting);
2103 void setAlpha(
float alpha);
2116 void setInheritsAlpha(
bool setting);
2129 void invalidate(
void);
2146 void invalidate(
const bool recursive);
2159 void setMouseCursor(
const Image* image);
2192 void setMouseCursor(
const String& imageset,
const String& image_name);
2232 void setZOrderingEnabled(
bool setting);
2247 void setWantsMultiClickEvents(
bool setting);
2261 void setMouseAutoRepeatEnabled(
bool setting);
2274 void setAutoRepeatDelay(
float delay);
2288 void setAutoRepeatRate(
float rate);
2299 void setDistributesCapturedInputs(
bool setting);
2335 virtual void destroy(
void);
2352 void setTooltip(
Tooltip* tooltip);
2372 void setTooltipType(
const String& tooltipType);
2385 void setTooltipText(
const String& tip);
2401 void setInheritsTooltipText(
bool setting);
2474 virtual void setLookNFeel(
const String& look);
2489 void setModalState(
bool state);
2501 virtual void performChildWindowLayout();
2516 void setUserString(
const String& name,
const String& value);
2544 void setArea(
const UDim& xpos,
const UDim& ypos,
const UDim& width,
const UDim& height);
2586 void setArea(
const URect& area);
2606 void setPosition(
const UVector2& pos);
2625 void setXPosition(
const UDim& x);
2644 void setYPosition(
const UDim& y);
2660 void setSize(
const UVector2& size);
2676 void setWidth(
const UDim& width);
2692 void setHeight(
const UDim& height);
2710 void setMaxSize(
const UVector2& size);
2728 void setMinSize(
const UVector2& size);
2747 const URect& getArea()
const;
2766 const UVector2& getPosition()
const;
2785 const UDim& getXPosition()
const;
2804 const UDim& getYPosition()
const;
2836 UDim getWidth()
const;
2852 UDim getHeight()
const;
2870 const UVector2& getMaxSize()
const;
2888 const UVector2& getMinSize()
const;
2918 virtual void update(
float elapsed);
2930 virtual void writeXMLToStream(
XMLSerializer& xml_stream)
const;
2974 void setWindowRenderer(
const String& name);
2995 String getWindowRendererName(
void)
const;
3013 void notifyScreenAreaChanged(
bool recursive =
true);
3026 void setFalagardType(
const String& type,
const String& rendererType =
"");
3037 void setDragDropTarget(
bool setting);
3067 void invalidateRenderingSurface();
3110 void setUsingAutoRenderingSurface(
bool setting);
3113 void setRotation(
const Vector3& rotation);
3129 void setNonClientWindow(
const bool setting);
3140 bool isTextParsingEnabled()
const;
3142 void setTextParsingEnabled(
const bool setting);
3145 virtual void setMargin(
const UBox& margin);
3147 const UBox& getMargin()
const;
3154 {
return d_bidiVisualMapping;}
3157 void banPropertyFromXML(
const String& property_name);
3160 void unbanPropertyFromXML(
const String& property_name);
3163 bool isPropertyBannedFromXML(
const String& property_name)
const;
3166 void banPropertyFromXML(
const Property* property);
3169 void unbanPropertyFromXML(
const Property* property);
3172 bool isPropertyBannedFromXML(
const Property* property)
const;
3222 void setMouseInputPropagationEnabled(
const bool enabled);
3234 bool isMouseInputPropagationEnabled()
const;
3250 Window* clone(
const String& newName,
const bool deepCopy =
true)
const;
3253 virtual void clonePropertiesTo(
Window& target)
const;
3255 virtual void cloneChildWidgetsTo(
Window& target)
const;
3269 size_t getZIndex()
const;
3280 bool isInFront(
const Window& wnd)
const;
3291 bool isBehind(
const Window& wnd)
const;
3870 virtual void updateSelf(
float elapsed);
3928 virtual bool testClassName_impl(
const String& class_name)
const
3930 if (class_name ==
"Window")
return true;
3945 void setParent(
Window* parent);
3947 Size getSize_impl(
const Window* window)
const;
3963 virtual bool validateWindowRenderer(
const String& name)
const;
3971 bool isPropertyAtDefault(
const Property* property)
const;
3978 void notifyClippingChanged(
void);
3981 void allocateRenderingWindow();
3984 void releaseRenderingWindow();
3993 virtual void cleanupChildren(
void);
3999 virtual void addChild_impl(
Window* wnd);
4005 virtual void removeChild_impl(
Window* wnd);
4011 virtual void onZChange_impl(
void);
4017 void addStandardProperties(
void);
4027 virtual bool moveToFront_impl(
bool wasClicked);
4060 bool topLeftSizing =
false,
bool fireEvents =
true);
4081 void addWindowToDrawList(
Window& wnd,
bool at_back =
false);
4094 void removeWindowFromDrawList(
const Window& wnd);
4107 bool isTopOfZOrder()
const;
4114 void updateGeometryRenderSettings();
4117 void transferChildSurfaces();
4120 Rect getParentElementClipIntersection(
const Rect& unclipped_area)
const;
4123 void invalidate_impl(
const bool recursive);
4126 bool isInnerRectSizeChanged()
const;
4134 const Window* getWindowAttachedToCommonAncestor(
const Window& wnd)
const;
4137 virtual Rect getUnclippedOuterRect_impl()
const;
4139 virtual Rect getOuterRectClipper_impl()
const;
4141 virtual Rect getInnerRectClipper_impl()
const;
4143 virtual Rect getHitTestRect_impl()
const;
4145 virtual Rect getNonClientChildWindowContentArea_impl()
const;
4147 virtual Rect getClientChildWindowContentArea_impl()
const;
4149 virtual int writePropertiesXML(
XMLSerializer& xml_stream)
const;
4150 virtual int writeChildWindowsXML(
XMLSerializer& xml_stream)
const;
4151 virtual bool writeAutoChildWindowXML(
XMLSerializer& xml_stream)
const;
4154 bool constrainUVector2ToMinSize(
const Size& base_sz,
UVector2& sz);
4156 bool constrainUVector2ToMaxSize(
const Size& base_sz,
UVector2& sz);
4158 void markAllCachedRectsInvalid();
4160 void calculatePixelSize();
4162 void fireAreaChangeEvents(
const bool moved,
const bool sized);
4387 mutable bool d_outerUnclippedRectValid;
4388 mutable bool d_innerUnclippedRectValid;
4389 mutable bool d_outerRectClipperValid;
4390 mutable bool d_innerRectClipperValid;
4391 mutable bool d_hitTestRectValid;
4410 #if defined(_MSC_VER)
4411 # pragma warning(pop)
4414 #endif // end of guard _CEGUIWindow_h_