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;
660 inline Window* getChildAtIdx(
size_t idx)
const
662 return static_cast<Window*
>(getChildElementAtIdx(idx));
690 return static_cast<Window*
>(getChildElement(name_path));
716 return static_cast<Window*
>(getChildElementRecursive(name));
740 Window* getChild(uint ID)
const;
763 Window* getChildRecursive(uint ID)
const;
777 Window* getActiveChild(
void);
778 const Window* getActiveChild(
void)
const;
794 bool isAncestor(uint ID)
const;
809 const Font* getFont(
bool useDefault =
true)
const;
821 const String& getTextVisual()
const;
861 float getEffectiveAlpha(
void)
const;
875 const Rectf& getOuterRectClipper()
const;
889 const Rectf& getInnerRectClipper()
const;
909 const Rectf& getClipRect(
const bool non_client =
false)
const;
921 const Rectf& getHitTestRect()
const;
932 {
return getGUIContext().getInputCaptureWindow();}
953 bool isCapturedByAncestor(
void)
const
954 {
return isAncestor(getCaptureWindow());}
982 virtual bool isHit(
const Vector2f& position,
983 const bool allow_disabled =
false)
const;
1017 const bool allow_disabled =
false)
const;
1029 return static_cast<Window*
>(getParentElement());
1046 const Image* getMouseCursor(
bool useDefault =
true)
const;
1096 bool isZOrderingEnabled(
void)
const;
1108 bool wantsMultiClickEvents(
void)
const;
1121 bool isMouseAutoRepeatEnabled(
void)
const;
1131 float getAutoRepeatDelay(
void)
const;
1142 float getAutoRepeatRate(
void)
const;
1153 bool distributesCapturedInputs(
void)
const;
1164 bool isUsingDefaultTooltip(
void)
const;
1175 Tooltip* getTooltip(
void)
const;
1185 String getTooltipType(
void)
const;
1194 const String& getTooltipText(
void)
const;
1207 bool inheritsTooltipText(
void)
const;
1248 const String& getLookNFeel()
const;
1257 bool getModalState(
void)
const
1258 {
return(getGUIContext().getModalWindow() ==
this);}
1286 bool isUserStringDefined(
const String& name)
const;
1303 Window* getActiveSibling();
1341 bool isDragDropTarget()
const;
1378 bool isUsingAutoRenderingSurface()
const;
1390 const Window* getRootWindow()
const;
1419 void setDestroyedByParent(
bool setting);
1433 void setAlwaysOnTop(
bool setting);
1447 void setEnabled(
bool setting);
1461 void setDisabled(
bool setting);
1498 void setVisible(
bool setting);
1512 void show(
void) {setVisible(
true);}
1524 void hide(
void) {setVisible(
false);}
1534 void activate(
void);
1545 void deactivate(
void);
1559 void setClippedByParent(
bool setting);
1572 void setID(uint ID);
1584 void setText(
const String& text);
1610 void appendText(
const String& text);
1623 void setFont(
const Font* font);
1639 void setFont(
const String& name);
1655 void removeChild(uint ID);
1681 void destroyChild(
Window* wnd);
1690 void destroyChild(
const String& name_path);
1736 void moveInFront(
const Window*
const window);
1752 void moveBehind(
const Window*
const window);
1766 size_t getZIndex()
const;
1777 bool isInFront(
const Window& wnd)
const;
1788 bool isBehind(
const Window& wnd)
const;
1799 bool captureInput(
void);
1809 void releaseInput(
void);
1829 void setRestoreOldCapture(
bool setting);
1851 void setAlpha(
const float alpha);
1864 void setInheritsAlpha(
bool setting);
1877 void invalidate(
void);
1894 void invalidate(
const bool recursive);
1907 void setMouseCursor(
const Image* image);
1926 void setMouseCursor(
const String& name);
1966 void setZOrderingEnabled(
bool setting);
1981 void setWantsMultiClickEvents(
bool setting);
1995 void setMouseAutoRepeatEnabled(
bool setting);
2008 void setAutoRepeatDelay(
float delay);
2022 void setAutoRepeatRate(
float rate);
2033 void setDistributesCapturedInputs(
bool setting);
2069 virtual void destroy(
void);
2086 void setTooltip(
Tooltip* tooltip);
2106 void setTooltipType(
const String& tooltipType);
2119 void setTooltipText(
const String& tip);
2135 void setInheritsTooltipText(
bool setting);
2193 virtual void setLookNFeel(
const String& look);
2208 void setModalState(
bool state);
2239 virtual void performChildWindowLayout(
bool nonclient_sized_hint =
false,
2240 bool client_sized_hint =
false);
2255 void setUserString(
const String& name,
const String& value);
2285 virtual void update(
float elapsed);
2297 virtual bool performCopy(
Clipboard& clipboard);
2309 virtual bool performCut(
Clipboard& clipboard);
2321 virtual bool performPaste(
Clipboard& clipboard);
2333 virtual void writeXMLToStream(
XMLSerializer& xml_stream)
const;
2380 void setWindowRenderer(
const String& name);
2401 const String& getWindowRendererName()
const;
2419 virtual void notifyScreenAreaChanged(
bool recursive =
true);
2432 void setFalagardType(
const String& type,
const String& rendererType =
"");
2443 void setDragDropTarget(
bool setting);
2473 void invalidateRenderingSurface();
2516 void setUsingAutoRenderingSurface(
bool setting);
2527 bool isTextParsingEnabled()
const;
2529 void setTextParsingEnabled(
const bool setting);
2532 virtual void setMargin(
const UBox& margin);
2534 const UBox& getMargin()
const;
2541 {
return d_bidiVisualMapping;}
2554 void banPropertyFromXML(
const String& property_name);
2557 void unbanPropertyFromXML(
const String& property_name);
2567 bool isPropertyBannedFromXML(
const String& property_name)
const;
2570 void banPropertyFromXML(
const Property* property);
2573 void unbanPropertyFromXML(
const Property* property);
2583 bool isPropertyBannedFromXML(
const Property* property)
const;
2633 void setMouseInputPropagationEnabled(
const bool enabled);
2645 bool isMouseInputPropagationEnabled()
const;
2657 Window* clone(
const bool deepCopy =
true)
const;
2660 virtual void clonePropertiesTo(
Window& target)
const;
2662 virtual void cloneChildWidgetsTo(
Window& target)
const;
2670 void syncTargetSurface();
2679 void setAutoWindow(
bool is_auto);
2691 bool isMouseContainedInArea()
const;
2694 const Sizef& getRootContainerSize()
const;
3240 virtual void updateSelf(
float elapsed);
3298 virtual void setParent(
Element* parent);
3317 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
3325 bool isPropertyAtDefault(
const Property* property)
const;
3332 void notifyClippingChanged(
void);
3335 void allocateRenderingWindow();
3338 void releaseRenderingWindow();
3344 virtual void setArea_impl(
const UVector2& pos,
const USize& size,
bool topLeftSizing =
false,
bool fireEvents =
true);
3350 virtual void cleanupChildren(
void);
3355 virtual void addChild_impl(
Element* element);
3360 virtual void removeChild_impl(
Element* element);
3366 virtual void onZChange_impl(
void);
3372 void addWindowProperties(
void);
3382 virtual bool moveToFront_impl(
bool wasClicked);
3403 void addWindowToDrawList(
Window& wnd,
bool at_back =
false);
3416 void removeWindowFromDrawList(
const Window& wnd);
3429 bool isTopOfZOrder()
const;
3436 void updateGeometryRenderSettings();
3439 void transferChildSurfaces();
3442 Rectf getParentElementClipIntersection(
const Rectf& unclipped_area)
const;
3445 void invalidate_impl(
const bool recursive);
3453 const Window* getWindowAttachedToCommonAncestor(
const Window& wnd)
const;
3455 virtual Rectf getUnclippedInnerRect_impl(
bool skipAllPixelAlignment)
const;
3457 virtual Rectf getOuterRectClipper_impl()
const;
3459 virtual Rectf getInnerRectClipper_impl()
const;
3461 virtual Rectf getHitTestRect_impl()
const;
3463 virtual int writePropertiesXML(
XMLSerializer& xml_stream)
const;
3464 virtual int writeChildWindowsXML(
XMLSerializer& xml_stream)
const;
3465 virtual bool writeAutoChildWindowXML(
XMLSerializer& xml_stream)
const;
3467 virtual void banPropertiesForAutoWindow();
3470 virtual bool handleFontRenderSizeChange(
const EventArgs& args);
3473 void markCachedWindowRectsInvalid();
3474 void layoutLookNFeelChildWidgets();
3478 bool allow_disabled =
false)
const;
3480 bool isHitTargetWindow(
const Vector2f& position,
bool allow_disabled)
const;
3504 } d_windowRendererProperty;
3524 } d_lookNFeelProperty;
3530 typedef std::vector<
Window*
3672 mutable bool d_outerRectClipperValid;
3673 mutable bool d_innerRectClipperValid;
3674 mutable bool d_hitTestRectValid;
3696 const Font* property_getFont()
const;
3698 const Image* property_getMouseCursor()
const;
3701 Event::ScopedConnection d_fontRenderSizeChangeConnection;
3707 #if defined(_MSC_VER)
3708 # pragma warning(pop)
3711 #endif // end of guard _CEGUIWindow_h_