30 #ifndef _CEGUIWindow_h_
31 #define _CEGUIWindow_h_
33 #include "CEGUI/Base.h"
34 #include "CEGUI/NamedElement.h"
35 #include "CEGUI/Vector.h"
36 #include "CEGUI/Quaternion.h"
37 #include "CEGUI/Rect.h"
38 #include "CEGUI/Size.h"
39 #include "CEGUI/EventSet.h"
40 #include "CEGUI/PropertySet.h"
41 #include "CEGUI/TplWindowProperty.h"
42 #include "CEGUI/System.h"
43 #include "CEGUI/GUIContext.h"
44 #include "CEGUI/InputEvent.h"
45 #include "CEGUI/UDim.h"
46 #include "CEGUI/WindowRenderer.h"
47 #include "CEGUI/TextUtils.h"
48 #include "CEGUI/BasicRenderedStringParser.h"
49 #include "CEGUI/DefaultRenderedStringParser.h"
54 # pragma warning(push)
55 # pragma warning(disable : 4251)
89 static const String& getDataTypeName()
91 static String type(
"WindowUpdateMode");
103 else if (str ==
"Never")
129 assert(
false &&
"Invalid Window Update Mode");
445 static const String WindowXMLElementName;
446 static const String AutoWindowXMLElementName;
447 static const String UserStringXMLElementName;
448 static const String WindowTypeXMLAttributeName;
449 static const String WindowNameXMLAttributeName;
450 static const String AutoWindowNamePathXMLAttributeName;
451 static const String UserStringNameXMLAttributeName;
452 static const String UserStringValueXMLAttributeName;
479 const String& getType(
void)
const;
515 bool isDisabled()
const;
529 bool isEffectiveDisabled()
const;
547 bool isVisible()
const;
565 bool isEffectiveVisible()
const;
581 bool isActive(
void)
const;
601 uint
getID(
void)
const {
return d_ID;}
620 bool isChild(uint ID)
const;
642 bool isChildRecursive(uint ID)
const;
659 inline Window* getChildAtIdx(
size_t idx)
const
661 return static_cast<Window*
>(getChildElementAtIdx(idx));
689 return static_cast<Window*
>(getChildElement(name_path));
715 return static_cast<Window*
>(getChildElementRecursive(name));
739 Window* getChild(uint ID)
const;
762 Window* getChildRecursive(uint ID)
const;
776 Window* getActiveChild(
void);
777 const Window* getActiveChild(
void)
const;
793 bool isAncestor(uint ID)
const;
808 const Font* getFont(
bool useDefault =
true)
const;
820 const String& getTextVisual()
const;
860 float getEffectiveAlpha(
void)
const;
874 const Rectf& getOuterRectClipper()
const;
888 const Rectf& getInnerRectClipper()
const;
908 const Rectf& getClipRect(
const bool non_client =
false)
const;
920 const Rectf& getHitTestRect()
const;
931 {
return getGUIContext().getInputCaptureWindow();}
952 bool isCapturedByAncestor(
void)
const
953 {
return isAncestor(getCaptureWindow());}
981 virtual bool isHit(
const Vector2f& position,
982 const bool allow_disabled =
false)
const;
1016 const bool allow_disabled =
false)
const;
1028 return static_cast<Window*
>(getParentElement());
1045 const Image* getMouseCursor(
bool useDefault =
true)
const;
1095 bool isZOrderingEnabled(
void)
const;
1107 bool wantsMultiClickEvents(
void)
const;
1120 bool isMouseAutoRepeatEnabled(
void)
const;
1130 float getAutoRepeatDelay(
void)
const;
1141 float getAutoRepeatRate(
void)
const;
1152 bool distributesCapturedInputs(
void)
const;
1163 bool isUsingDefaultTooltip(
void)
const;
1174 Tooltip* getTooltip(
void)
const;
1184 String getTooltipType(
void)
const;
1193 const String& getTooltipText(
void)
const;
1206 bool inheritsTooltipText(
void)
const;
1247 const String& getLookNFeel()
const;
1256 bool getModalState(
void)
const
1257 {
return(getGUIContext().getModalWindow() ==
this);}
1285 bool isUserStringDefined(
const String& name)
const;
1302 Window* getActiveSibling();
1340 bool isDragDropTarget()
const;
1377 bool isUsingAutoRenderingSurface()
const;
1389 const Window* getRootWindow()
const;
1418 void setDestroyedByParent(
bool setting);
1432 void setAlwaysOnTop(
bool setting);
1446 void setEnabled(
bool setting);
1460 void setDisabled(
bool setting);
1497 void setVisible(
bool setting);
1511 void show(
void) {setVisible(
true);}
1523 void hide(
void) {setVisible(
false);}
1533 void activate(
void);
1544 void deactivate(
void);
1558 void setClippedByParent(
bool setting);
1571 void setID(uint ID);
1583 void setText(
const String& text);
1609 void appendText(
const String& text);
1622 void setFont(
const Font* font);
1638 void setFont(
const String& name);
1654 void removeChild(uint ID);
1680 void destroyChild(
Window* wnd);
1689 void destroyChild(
const String& name_path);
1735 void moveInFront(
const Window*
const window);
1751 void moveBehind(
const Window*
const window);
1765 size_t getZIndex()
const;
1776 bool isInFront(
const Window& wnd)
const;
1787 bool isBehind(
const Window& wnd)
const;
1798 bool captureInput(
void);
1808 void releaseInput(
void);
1828 void setRestoreOldCapture(
bool setting);
1850 void setAlpha(
const float alpha);
1863 void setInheritsAlpha(
bool setting);
1876 void invalidate(
void);
1893 void invalidate(
const bool recursive);
1906 void setMouseCursor(
const Image* image);
1925 void setMouseCursor(
const String& name);
1965 void setZOrderingEnabled(
bool setting);
1980 void setWantsMultiClickEvents(
bool setting);
1994 void setMouseAutoRepeatEnabled(
bool setting);
2007 void setAutoRepeatDelay(
float delay);
2021 void setAutoRepeatRate(
float rate);
2032 void setDistributesCapturedInputs(
bool setting);
2068 virtual void destroy(
void);
2085 void setTooltip(
Tooltip* tooltip);
2105 void setTooltipType(
const String& tooltipType);
2118 void setTooltipText(
const String& tip);
2134 void setInheritsTooltipText(
bool setting);
2192 virtual void setLookNFeel(
const String& look);
2207 void setModalState(
bool state);
2238 virtual void performChildWindowLayout(
bool nonclient_sized_hint =
false,
2239 bool client_sized_hint =
false);
2254 void setUserString(
const String& name,
const String& value);
2284 virtual void update(
float elapsed);
2296 virtual bool performCopy(
Clipboard& clipboard);
2308 virtual bool performCut(
Clipboard& clipboard);
2320 virtual bool performPaste(
Clipboard& clipboard);
2332 virtual void writeXMLToStream(
XMLSerializer& xml_stream)
const;
2379 void setWindowRenderer(
const String& name);
2400 const String& getWindowRendererName()
const;
2418 virtual void notifyScreenAreaChanged(
bool recursive =
true);
2431 void setFalagardType(
const String& type,
const String& rendererType =
"");
2442 void setDragDropTarget(
bool setting);
2472 void invalidateRenderingSurface();
2515 void setUsingAutoRenderingSurface(
bool setting);
2526 bool isTextParsingEnabled()
const;
2528 void setTextParsingEnabled(
const bool setting);
2531 virtual void setMargin(
const UBox& margin);
2533 const UBox& getMargin()
const;
2540 {
return d_bidiVisualMapping;}
2553 void banPropertyFromXML(
const String& property_name);
2556 void unbanPropertyFromXML(
const String& property_name);
2566 bool isPropertyBannedFromXML(
const String& property_name)
const;
2569 void banPropertyFromXML(
const Property* property);
2572 void unbanPropertyFromXML(
const Property* property);
2582 bool isPropertyBannedFromXML(
const Property* property)
const;
2632 void setMouseInputPropagationEnabled(
const bool enabled);
2644 bool isMouseInputPropagationEnabled()
const;
2656 Window* clone(
const bool deepCopy =
true)
const;
2659 virtual void clonePropertiesTo(
Window& target)
const;
2661 virtual void cloneChildWidgetsTo(
Window& target)
const;
2669 void syncTargetSurface();
2678 void setAutoWindow(
bool is_auto);
2690 bool isMouseContainedInArea()
const;
2693 const Sizef& getRootContainerSize()
const;
3239 virtual void updateSelf(
float elapsed);
3297 virtual void setParent(
Element* parent);
3316 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
3324 bool isPropertyAtDefault(
const Property* property)
const;
3331 void notifyClippingChanged(
void);
3334 void allocateRenderingWindow();
3337 void releaseRenderingWindow();
3343 virtual void setArea_impl(
const UVector2& pos,
const USize& size,
bool topLeftSizing =
false,
bool fireEvents =
true);
3349 virtual void cleanupChildren(
void);
3354 virtual void addChild_impl(
Element* element);
3359 virtual void removeChild_impl(
Element* element);
3365 virtual void onZChange_impl(
void);
3371 void addWindowProperties(
void);
3381 virtual bool moveToFront_impl(
bool wasClicked);
3402 void addWindowToDrawList(
Window& wnd,
bool at_back =
false);
3415 void removeWindowFromDrawList(
const Window& wnd);
3428 bool isTopOfZOrder()
const;
3435 void updateGeometryRenderSettings();
3438 void transferChildSurfaces();
3441 Rectf getParentElementClipIntersection(
const Rectf& unclipped_area)
const;
3444 void invalidate_impl(
const bool recursive);
3452 const Window* getWindowAttachedToCommonAncestor(
const Window& wnd)
const;
3454 virtual Rectf getUnclippedInnerRect_impl(
bool skipAllPixelAlignment)
const;
3456 virtual Rectf getOuterRectClipper_impl()
const;
3458 virtual Rectf getInnerRectClipper_impl()
const;
3460 virtual Rectf getHitTestRect_impl()
const;
3462 virtual int writePropertiesXML(
XMLSerializer& xml_stream)
const;
3463 virtual int writeChildWindowsXML(
XMLSerializer& xml_stream)
const;
3464 virtual bool writeAutoChildWindowXML(
XMLSerializer& xml_stream)
const;
3466 virtual void banPropertiesForAutoWindow();
3469 virtual bool handleFontRenderSizeChange(
const EventArgs& args);
3472 void markCachedWindowRectsInvalid();
3473 void layoutLookNFeelChildWidgets();
3477 bool allow_disabled =
false)
const;
3479 bool isHitTargetWindow(
const Vector2f& position,
bool allow_disabled)
const;
3503 } d_windowRendererProperty;
3523 } d_lookNFeelProperty;
3529 typedef std::vector<
Window*
3671 mutable bool d_outerRectClipperValid;
3672 mutable bool d_innerRectClipperValid;
3673 mutable bool d_hitTestRectValid;
3695 const Font* property_getFont()
const;
3697 const Image* property_getMouseCursor()
const;
3700 Event::ScopedConnection d_fontRenderSizeChangeConnection;
3706 #if defined(_MSC_VER)
3707 # pragma warning(pop)
3710 #endif // end of guard _CEGUIWindow_h_