31 #ifndef _CEGUIWindow_h_
32 #define _CEGUIWindow_h_
34 #include "CEGUI/Base.h"
35 #include "CEGUI/NamedElement.h"
36 #include "CEGUI/Vector.h"
37 #include "CEGUI/Quaternion.h"
38 #include "CEGUI/Rect.h"
39 #include "CEGUI/Size.h"
40 #include "CEGUI/EventSet.h"
41 #include "CEGUI/PropertySet.h"
42 #include "CEGUI/TplWindowProperty.h"
43 #include "CEGUI/System.h"
44 #include "CEGUI/GUIContext.h"
45 #include "CEGUI/InputEvent.h"
46 #include "CEGUI/UDim.h"
47 #include "CEGUI/WindowRenderer.h"
48 #include "CEGUI/TextUtils.h"
49 #include "CEGUI/BasicRenderedStringParser.h"
50 #include "CEGUI/DefaultRenderedStringParser.h"
55 # pragma warning(push)
56 # pragma warning(disable : 4251)
90 static const String& getDataTypeName()
92 static String type(
"WindowUpdateMode");
104 else if (str ==
"Never")
130 assert(
false &&
"Invalid Window Update Mode");
446 static const String WindowXMLElementName;
447 static const String AutoWindowXMLElementName;
448 static const String UserStringXMLElementName;
449 static const String WindowTypeXMLAttributeName;
450 static const String WindowNameXMLAttributeName;
451 static const String AutoWindowNamePathXMLAttributeName;
452 static const String UserStringNameXMLAttributeName;
453 static const String UserStringValueXMLAttributeName;
480 const String& getType(
void)
const;
516 bool isDisabled()
const;
530 bool isEffectiveDisabled()
const;
548 bool isVisible()
const;
566 bool isEffectiveVisible()
const;
582 bool isActive(
void)
const;
602 uint
getID(
void)
const {
return d_ID;}
621 bool isChild(uint ID)
const;
643 bool isChildRecursive(uint ID)
const;
645 inline Window* getChildAtIdx(
size_t idx)
const
647 return static_cast<Window*
>(getChildElementAtIdx(idx));
675 return static_cast<Window*
>(getChildElement(name_path));
701 return static_cast<Window*
>(getChildElementRecursive(name));
725 Window* getChild(uint ID)
const;
748 Window* getChildRecursive(uint ID)
const;
762 Window* getActiveChild(
void);
763 const Window* getActiveChild(
void)
const;
779 bool isAncestor(uint ID)
const;
794 const Font* getFont(
bool useDefault =
true)
const;
806 const String& getTextVisual()
const;
846 float getEffectiveAlpha(
void)
const;
860 const Rectf& getOuterRectClipper()
const;
874 const Rectf& getInnerRectClipper()
const;
894 const Rectf& getClipRect(
const bool non_client =
false)
const;
906 const Rectf& getHitTestRect()
const;
917 {
return getGUIContext().getInputCaptureWindow();}
938 bool isCapturedByAncestor(
void)
const
939 {
return isAncestor(getCaptureWindow());}
967 virtual bool isHit(
const Vector2f& position,
968 const bool allow_disabled =
false)
const;
1002 const bool allow_disabled =
false)
const;
1014 return static_cast<Window*
>(getParentElement());
1031 const Image* getMouseCursor(
bool useDefault =
true)
const;
1081 bool isZOrderingEnabled(
void)
const;
1093 bool wantsMultiClickEvents(
void)
const;
1106 bool isMouseAutoRepeatEnabled(
void)
const;
1116 float getAutoRepeatDelay(
void)
const;
1127 float getAutoRepeatRate(
void)
const;
1138 bool distributesCapturedInputs(
void)
const;
1149 bool isUsingDefaultTooltip(
void)
const;
1160 Tooltip* getTooltip(
void)
const;
1170 String getTooltipType(
void)
const;
1179 const String& getTooltipText(
void)
const;
1192 bool inheritsTooltipText(
void)
const;
1233 const String& getLookNFeel()
const;
1242 bool getModalState(
void)
const
1243 {
return(getGUIContext().getModalWindow() ==
this);}
1271 bool isUserStringDefined(
const String& name)
const;
1288 Window* getActiveSibling();
1326 bool isDragDropTarget()
const;
1363 bool isUsingAutoRenderingSurface()
const;
1375 const Window* getRootWindow()
const;
1404 void setDestroyedByParent(
bool setting);
1418 void setAlwaysOnTop(
bool setting);
1432 void setEnabled(
bool setting);
1446 void setDisabled(
bool setting);
1483 void setVisible(
bool setting);
1497 void show(
void) {setVisible(
true);}
1509 void hide(
void) {setVisible(
false);}
1519 void activate(
void);
1530 void deactivate(
void);
1544 void setClippedByParent(
bool setting);
1557 void setID(uint ID);
1569 void setText(
const String& text);
1595 void appendText(
const String& text);
1608 void setFont(
const Font* font);
1624 void setFont(
const String& name);
1640 void removeChild(uint ID);
1666 void destroyChild(
Window* wnd);
1675 void destroyChild(
const String& name_path);
1721 void moveInFront(
const Window*
const window);
1737 void moveBehind(
const Window*
const window);
1751 size_t getZIndex()
const;
1762 bool isInFront(
const Window& wnd)
const;
1773 bool isBehind(
const Window& wnd)
const;
1784 bool captureInput(
void);
1794 void releaseInput(
void);
1814 void setRestoreOldCapture(
bool setting);
1836 void setAlpha(
const float alpha);
1849 void setInheritsAlpha(
bool setting);
1862 void invalidate(
void);
1879 void invalidate(
const bool recursive);
1892 void setMouseCursor(
const Image* image);
1911 void setMouseCursor(
const String& name);
1951 void setZOrderingEnabled(
bool setting);
1966 void setWantsMultiClickEvents(
bool setting);
1980 void setMouseAutoRepeatEnabled(
bool setting);
1993 void setAutoRepeatDelay(
float delay);
2007 void setAutoRepeatRate(
float rate);
2018 void setDistributesCapturedInputs(
bool setting);
2054 virtual void destroy(
void);
2071 void setTooltip(
Tooltip* tooltip);
2091 void setTooltipType(
const String& tooltipType);
2104 void setTooltipText(
const String& tip);
2120 void setInheritsTooltipText(
bool setting);
2178 virtual void setLookNFeel(
const String& look);
2193 void setModalState(
bool state);
2224 virtual void performChildWindowLayout(
bool nonclient_sized_hint =
false,
2225 bool client_sized_hint =
false);
2240 void setUserString(
const String& name,
const String& value);
2270 virtual void update(
float elapsed);
2282 virtual bool performCopy(
Clipboard& clipboard);
2294 virtual bool performCut(
Clipboard& clipboard);
2306 virtual bool performPaste(
Clipboard& clipboard);
2318 virtual void writeXMLToStream(
XMLSerializer& xml_stream)
const;
2365 void setWindowRenderer(
const String& name);
2386 const String& getWindowRendererName()
const;
2404 virtual void notifyScreenAreaChanged(
bool recursive =
true);
2417 void setFalagardType(
const String& type,
const String& rendererType =
"");
2428 void setDragDropTarget(
bool setting);
2458 void invalidateRenderingSurface();
2501 void setUsingAutoRenderingSurface(
bool setting);
2512 bool isTextParsingEnabled()
const;
2514 void setTextParsingEnabled(
const bool setting);
2517 virtual void setMargin(
const UBox& margin);
2519 const UBox& getMargin()
const;
2526 {
return d_bidiVisualMapping;}
2539 void banPropertyFromXML(
const String& property_name);
2542 void unbanPropertyFromXML(
const String& property_name);
2552 bool isPropertyBannedFromXML(
const String& property_name)
const;
2555 void banPropertyFromXML(
const Property* property);
2558 void unbanPropertyFromXML(
const Property* property);
2568 bool isPropertyBannedFromXML(
const Property* property)
const;
2618 void setMouseInputPropagationEnabled(
const bool enabled);
2630 bool isMouseInputPropagationEnabled()
const;
2642 Window* clone(
const bool deepCopy =
true)
const;
2645 virtual void clonePropertiesTo(
Window& target)
const;
2647 virtual void cloneChildWidgetsTo(
Window& target)
const;
2655 void syncTargetSurface();
2664 void setAutoWindow(
bool is_auto);
2676 bool isMouseContainedInArea()
const;
2679 const Sizef& getRootContainerSize()
const;
3225 virtual void updateSelf(
float elapsed);
3283 virtual void setParent(
Element* parent);
3302 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
3310 bool isPropertyAtDefault(
const Property* property)
const;
3317 void notifyClippingChanged(
void);
3320 void allocateRenderingWindow();
3323 void releaseRenderingWindow();
3329 virtual void setArea_impl(
const UVector2& pos,
const USize& size,
bool topLeftSizing =
false,
bool fireEvents =
true);
3335 virtual void cleanupChildren(
void);
3340 virtual void addChild_impl(
Element* element);
3345 virtual void removeChild_impl(
Element* element);
3351 virtual void onZChange_impl(
void);
3357 void addWindowProperties(
void);
3367 virtual bool moveToFront_impl(
bool wasClicked);
3388 void addWindowToDrawList(
Window& wnd,
bool at_back =
false);
3401 void removeWindowFromDrawList(
const Window& wnd);
3414 bool isTopOfZOrder()
const;
3421 void updateGeometryRenderSettings();
3424 void transferChildSurfaces();
3427 Rectf getParentElementClipIntersection(
const Rectf& unclipped_area)
const;
3430 void invalidate_impl(
const bool recursive);
3438 const Window* getWindowAttachedToCommonAncestor(
const Window& wnd)
const;
3440 virtual Rectf getUnclippedInnerRect_impl(
bool skipAllPixelAlignment)
const;
3442 virtual Rectf getOuterRectClipper_impl()
const;
3444 virtual Rectf getInnerRectClipper_impl()
const;
3446 virtual Rectf getHitTestRect_impl()
const;
3448 virtual int writePropertiesXML(
XMLSerializer& xml_stream)
const;
3449 virtual int writeChildWindowsXML(
XMLSerializer& xml_stream)
const;
3450 virtual bool writeAutoChildWindowXML(
XMLSerializer& xml_stream)
const;
3452 virtual void banPropertiesForAutoWindow();
3455 virtual bool handleFontRenderSizeChange(
const EventArgs& args);
3458 void markCachedWindowRectsInvalid();
3459 void layoutLookNFeelChildWidgets();
3463 bool allow_disabled =
false)
const;
3465 bool isHitTargetWindow(
const Vector2f& position,
bool allow_disabled)
const;
3489 } d_windowRendererProperty;
3509 } d_lookNFeelProperty;
3515 typedef std::vector<
Window*
3657 mutable bool d_outerRectClipperValid;
3658 mutable bool d_innerRectClipperValid;
3659 mutable bool d_hitTestRectValid;
3681 const Font* property_getFont()
const;
3683 const Image* property_getMouseCursor()
const;
3686 Event::ScopedConnection d_fontRenderSizeChangeConnection;
3692 #if defined(_MSC_VER)
3693 # pragma warning(pop)
3696 #endif // end of guard _CEGUIWindow_h_