Crazy Eddie's GUI System  ${CEGUI_VERSION}
debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h
1 /***********************************************************************
2  created: 21/2/2004
3  author: Paul D Turner
4 
5  purpose: Defines abstract base class for Window objects
6 *************************************************************************/
7 /***************************************************************************
8  * Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining
11  * a copy of this software and associated documentation files (the
12  * "Software"), to deal in the Software without restriction, including
13  * without limitation the rights to use, copy, modify, merge, publish,
14  * distribute, sublicense, and/or sell copies of the Software, and to
15  * permit persons to whom the Software is furnished to do so, subject to
16  * the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27  * OTHER DEALINGS IN THE SOFTWARE.
28  ***************************************************************************/
29 
30 #ifndef _CEGUIWindow_h_
31 #define _CEGUIWindow_h_
32 
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"
50 #include <vector>
51 #include <set>
52 
53 #if defined(_MSC_VER)
54 # pragma warning(push)
55 # pragma warning(disable : 4251)
56 #endif
57 
58 // Start of CEGUI namespace section
59 namespace CEGUI
60 {
61 
71 {
73  WUM_ALWAYS,
75  WUM_NEVER,
78 };
79 
80 template<>
81 class PropertyHelper<WindowUpdateMode>
82 {
83 public:
84  typedef WindowUpdateMode return_type;
85  typedef return_type safe_method_return_type;
86  typedef WindowUpdateMode pass_type;
87  typedef String string_return_type;
88 
89  static const String& getDataTypeName()
90  {
91  static String type("WindowUpdateMode");
92 
93  return type;
94  }
95 
96  static return_type fromString(const String& str)
97  {
98 
99  if (str == "Always")
100  {
101  return WUM_ALWAYS;
102  }
103  else if (str == "Never")
104  {
105  return WUM_NEVER;
106  }
107  else
108  {
109  return WUM_VISIBLE;
110  }
111  }
112 
113  static string_return_type toString(pass_type val)
114  {
115  if (val == WUM_ALWAYS)
116  {
117  return "Always";
118  }
119  else if (val == WUM_NEVER)
120  {
121  return "Never";
122  }
123  else if (val == WUM_VISIBLE)
124  {
125  return "Visible";
126  }
127  else
128  {
129  assert(false && "Invalid Window Update Mode");
130  return "Always";
131  }
132  }
133 };
134 
135 
149 class CEGUIEXPORT Window :
150  public NamedElement
151 {
152 public:
153  /*************************************************************************
154  Event name constants
155  *************************************************************************/
157  static const String EventNamespace;
158 
159  // generated internally by Window
163  static const String EventUpdated;
164 
169  static const String EventTextChanged;
174  static const String EventFontChanged;
179  static const String EventAlphaChanged;
184  static const String EventIDChanged;
191  static const String EventActivated;
198  static const String EventDeactivated;
203  static const String EventShown;
208  static const String EventHidden;
213  static const String EventEnabled;
219  static const String EventDisabled;
225  static const String EventClippedByParentChanged;
231  static const String EventDestroyedByParentChanged;
237  static const String EventInheritsAlphaChanged;
243  static const String EventAlwaysOnTopChanged;
248  static const String EventInputCaptureGained;
257  static const String EventInputCaptureLost;
267  static const String EventInvalidated;
275  static const String EventRenderingStarted;
283  static const String EventRenderingEnded;
288  static const String EventDestructionStarted;
296  static const String EventDragDropItemEnters;
304  static const String EventDragDropItemLeaves;
311  static const String EventDragDropItemDropped;
317  static const String EventWindowRendererAttached;
323  static const String EventWindowRendererDetached;
330  static const String EventTextParsingChanged;
336  static const String EventMarginChanged;
337 
338  // generated externally (inputs)
343  static const String EventMouseEntersArea;
348  static const String EventMouseLeavesArea;
359  static const String EventMouseEntersSurface;
370  static const String EventMouseLeavesSurface;
375  static const String EventMouseMove;
381  static const String EventMouseWheel;
386  static const String EventMouseButtonDown;
391  static const String EventMouseButtonUp;
398  static const String EventMouseClick;
404  static const String EventMouseDoubleClick;
410  static const String EventMouseTripleClick;
419  static const String EventKeyDown;
428  static const String EventKeyUp;
436  static const String EventCharacterKey;
437 
438  /*************************************************************************
439  Child Widget name suffix constants
440  *************************************************************************/
442  static const String TooltipNameSuffix;
443 
444  // XML element and attribute names that relate to Window.
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;
453 
464  Window(const String& type, const String& name);
465 
470  virtual ~Window(void);
471 
479  const String& getType(void) const;
480 
490  bool isDestroyedByParent(void) const {return d_destroyedByParent;}
491 
501  bool isAlwaysOnTop(void) const {return d_alwaysOnTop;}
502 
515  bool isDisabled() const;
516 
529  bool isEffectiveDisabled() const;
530 
547  bool isVisible() const;
548 
565  bool isEffectiveVisible() const;
566 
581  bool isActive(void) const;
582 
592  bool isClippedByParent(void) const {return d_clippedByParent;}
593 
601  uint getID(void) const {return d_ID;}
602 
603  using NamedElement::isChild;
620  bool isChild(uint ID) const;
621 
642  bool isChildRecursive(uint ID) const;
643 
644 
659  inline Window* getChildAtIdx(size_t idx) const
660  {
661  return static_cast<Window*>(getChildElementAtIdx(idx));
662  }
663 
687  inline Window* getChild(const String& name_path) const
688  {
689  return static_cast<Window*>(getChildElement(name_path));
690  }
691 
713  inline Window* getChildRecursive(const String& name) const
714  {
715  return static_cast<Window*>(getChildElementRecursive(name));
716  }
717 
739  Window* getChild(uint ID) const;
740 
762  Window* getChildRecursive(uint ID) const;
763 
776  Window* getActiveChild(void);
777  const Window* getActiveChild(void) const;
778 
793  bool isAncestor(uint ID) const;
794 
808  const Font* getFont(bool useDefault = true) const;
809 
817  const String& getText(void) const {return d_textLogical;}
818 
820  const String& getTextVisual() const;
821 
830  bool inheritsAlpha(void) const {return d_inheritsAlpha;}
831 
849  float getAlpha(void) const {return d_alpha;}
850 
860  float getEffectiveAlpha(void) const;
861 
874  const Rectf& getOuterRectClipper() const;
875 
888  const Rectf& getInnerRectClipper() const;
889 
908  const Rectf& getClipRect(const bool non_client = false) const;
909 
920  const Rectf& getHitTestRect() const;
921 
931  {return getGUIContext().getInputCaptureWindow();}
932 
941  bool isCapturedByThis(void) const {return getCaptureWindow() == this;}
942 
952  bool isCapturedByAncestor(void) const
953  {return isAncestor(getCaptureWindow());}
954 
963  bool isCapturedByChild(void) const {return isChild(getCaptureWindow());}
964 
981  virtual bool isHit(const Vector2f& position,
982  const bool allow_disabled = false) const;
983 
996  Window* getChildAtPosition(const Vector2f& position) const;
997 
1015  Window* getTargetChildAtPosition(const Vector2f& position,
1016  const bool allow_disabled = false) const;
1017 
1026  inline Window* getParent() const
1027  {
1028  return static_cast<Window*>(getParentElement());
1029  }
1030 
1045  const Image* getMouseCursor(bool useDefault = true) const;
1046 
1058  void* getUserData(void) const {return d_userData;}
1059 
1074  bool restoresOldCapture(void) const {return d_restoreOldCapture;}
1075 
1095  bool isZOrderingEnabled(void) const;
1096 
1107  bool wantsMultiClickEvents(void) const;
1108 
1120  bool isMouseAutoRepeatEnabled(void) const;
1121 
1130  float getAutoRepeatDelay(void) const;
1131 
1141  float getAutoRepeatRate(void) const;
1142 
1152  bool distributesCapturedInputs(void) const;
1153 
1163  bool isUsingDefaultTooltip(void) const;
1164 
1174  Tooltip* getTooltip(void) const;
1175 
1184  String getTooltipType(void) const;
1185 
1193  const String& getTooltipText(void) const;
1194 
1206  bool inheritsTooltipText(void) const;
1207 
1228  bool isRiseOnClickEnabled(void) const { return d_riseOnClick; }
1229 
1237  GeometryBuffer& getGeometryBuffer();
1238 
1247  const String& getLookNFeel() const;
1248 
1256  bool getModalState(void) const
1257  {return(getGUIContext().getModalWindow() == this);}
1258 
1272  const String& getUserString(const String& name) const;
1273 
1285  bool isUserStringDefined(const String& name) const;
1286 
1302  Window* getActiveSibling();
1303 
1314  bool isMousePassThroughEnabled(void) const {return d_mousePassThroughEnabled;}
1315 
1323  bool isAutoWindow(void) const {return d_autoWindow;}
1324 
1329  bool isWritingXMLAllowed(void) const {return d_allowWriteXML;}
1330 
1340  bool isDragDropTarget() const;
1341 
1347  void getRenderingContext(RenderingContext& ctx) const;
1348 
1350  virtual void getRenderingContext_impl(RenderingContext& ctx) const;
1351 
1357  RenderingSurface* getRenderingSurface() const;
1358 
1364  RenderingSurface& getTargetRenderingSurface() const;
1365 
1377  bool isUsingAutoRenderingSurface() const;
1378 
1389  const Window* getRootWindow() const;
1390  Window* getRootWindow();
1391 
1403  virtual void initialiseComponents(void) {}
1404 
1418  void setDestroyedByParent(bool setting);
1419 
1432  void setAlwaysOnTop(bool setting);
1433 
1446  void setEnabled(bool setting);
1447 
1460  void setDisabled(bool setting);
1461 
1469  void enable(void) {setEnabled(true);}
1470 
1478  void disable(void) {setEnabled(false);}
1479 
1497  void setVisible(bool setting);
1498 
1511  void show(void) {setVisible(true);}
1512 
1523  void hide(void) {setVisible(false);}
1524 
1533  void activate(void);
1534 
1544  void deactivate(void);
1545 
1558  void setClippedByParent(bool setting);
1559 
1571  void setID(uint ID);
1572 
1583  void setText(const String& text);
1584 
1598  void insertText(const String& text, const String::size_type position);
1599 
1609  void appendText(const String& text);
1610 
1622  void setFont(const Font* font);
1623 
1638  void setFont(const String& name);
1639 
1654  void removeChild(uint ID);
1655 
1671  Window* createChild(const String& type, const String& name = "");
1672 
1680  void destroyChild(Window* wnd);
1681 
1689  void destroyChild(const String& name_path);
1690 
1704  void moveToFront();
1705 
1720  void moveToBack();
1721 
1735  void moveInFront(const Window* const window);
1736 
1751  void moveBehind(const Window* const window);
1752 
1765  size_t getZIndex() const;
1766 
1776  bool isInFront(const Window& wnd) const;
1777 
1787  bool isBehind(const Window& wnd) const;
1788 
1798  bool captureInput(void);
1799 
1808  void releaseInput(void);
1809 
1828  void setRestoreOldCapture(bool setting);
1829 
1850  void setAlpha(const float alpha);
1851 
1863  void setInheritsAlpha(bool setting);
1864 
1876  void invalidate(void);
1877 
1893  void invalidate(const bool recursive);
1894 
1906  void setMouseCursor(const Image* image);
1907 
1925  void setMouseCursor(const String& name);
1926 
1941  void setUserData(void* user_data) {d_userData = user_data;}
1942 
1965  void setZOrderingEnabled(bool setting);
1966 
1980  void setWantsMultiClickEvents(bool setting);
1981 
1994  void setMouseAutoRepeatEnabled(bool setting);
1995 
2007  void setAutoRepeatDelay(float delay);
2008 
2021  void setAutoRepeatRate(float rate);
2022 
2032  void setDistributesCapturedInputs(bool setting);
2033 
2039  void notifyDragDropItemEnters(DragContainer* item);
2040 
2046  void notifyDragDropItemLeaves(DragContainer* item);
2047 
2053  void notifyDragDropItemDropped(DragContainer* item);
2054 
2068  virtual void destroy(void);
2069 
2085  void setTooltip(Tooltip* tooltip);
2086 
2105  void setTooltipType(const String& tooltipType);
2106 
2118  void setTooltipText(const String& tip);
2119 
2134  void setInheritsTooltipText(bool setting);
2135 
2159  void setRiseOnClickEnabled(bool setting) { d_riseOnClick = setting; }
2160 
2192  virtual void setLookNFeel(const String& look);
2193 
2207  void setModalState(bool state);
2208 
2238  virtual void performChildWindowLayout(bool nonclient_sized_hint = false,
2239  bool client_sized_hint = false);
2240 
2254  void setUserString(const String& name, const String& value);
2255 
2264  void render();
2265 
2284  virtual void update(float elapsed);
2285 
2296  virtual bool performCopy(Clipboard& clipboard);
2297 
2308  virtual bool performCut(Clipboard& clipboard);
2309 
2320  virtual bool performPaste(Clipboard& clipboard);
2321 
2332  virtual void writeXMLToStream(XMLSerializer& xml_stream) const;
2333 
2342  virtual void beginInitialisation(void) {d_initialising = true;}
2343 
2351  virtual void endInitialisation(void) {d_initialising = false;}
2352 
2363  void setMousePassThroughEnabled(bool setting) {d_mousePassThroughEnabled = setting;}
2364 
2379  void setWindowRenderer(const String& name);
2380 
2389  WindowRenderer* getWindowRenderer(void) const;
2390 
2400  const String& getWindowRendererName() const;
2401 
2406  void setWritingXMLAllowed(bool allow) {d_allowWriteXML = allow;}
2407 
2418  virtual void notifyScreenAreaChanged(bool recursive = true);
2419 
2431  void setFalagardType(const String& type, const String& rendererType = "");
2432 
2442  void setDragDropTarget(bool setting);
2443 
2464  void setRenderingSurface(RenderingSurface* surface);
2465 
2472  void invalidateRenderingSurface();
2473 
2515  void setUsingAutoRenderingSurface(bool setting);
2516 
2518  const RenderedString& getRenderedString() const;
2520  RenderedStringParser* getCustomRenderedStringParser() const;
2522  void setCustomRenderedStringParser(RenderedStringParser* parser);
2524  virtual RenderedStringParser& getRenderedStringParser() const;
2526  bool isTextParsingEnabled() const;
2528  void setTextParsingEnabled(const bool setting);
2529 
2531  virtual void setMargin(const UBox& margin);
2533  const UBox& getMargin() const;
2534 
2536  Vector2f getUnprojectedPosition(const Vector2f& pos) const;
2537 
2540  {return d_bidiVisualMapping;}
2541 
2553  void banPropertyFromXML(const String& property_name);
2554 
2556  void unbanPropertyFromXML(const String& property_name);
2557 
2566  bool isPropertyBannedFromXML(const String& property_name) const;
2567 
2569  void banPropertyFromXML(const Property* property);
2570 
2572  void unbanPropertyFromXML(const Property* property);
2573 
2582  bool isPropertyBannedFromXML(const Property* property) const;
2583 
2601  void setUpdateMode(const WindowUpdateMode mode);
2602 
2620  WindowUpdateMode getUpdateMode() const;
2621 
2632  void setMouseInputPropagationEnabled(const bool enabled);
2633 
2644  bool isMouseInputPropagationEnabled() const;
2645 
2656  Window* clone(const bool deepCopy = true) const;
2657 
2659  virtual void clonePropertiesTo(Window& target) const;
2661  virtual void cloneChildWidgetsTo(Window& target) const;
2662 
2664  GUIContext& getGUIContext() const;
2666  void setGUIContext(GUIContext* context);
2667 
2669  void syncTargetSurface();
2670 
2678  void setAutoWindow(bool is_auto);
2679 
2690  bool isMouseContainedInArea() const;
2691 
2692  // overridden from Element
2693  const Sizef& getRootContainerSize() const;
2694 
2695 protected:
2696  // friend classes for construction / initialisation purposes (for now)
2697  friend class System;
2698  friend class WindowManager;
2699  friend class GUIContext;
2700 
2701  /*************************************************************************
2702  Event trigger methods
2703  *************************************************************************/
2713  virtual void onSized(ElementEventArgs& e);
2714 
2724  virtual void onMoved(ElementEventArgs& e);
2725 
2726  virtual void onRotated(ElementEventArgs& e);
2727 
2737  virtual void onTextChanged(WindowEventArgs& e);
2738 
2748  virtual void onFontChanged(WindowEventArgs& e);
2749 
2759  virtual void onAlphaChanged(WindowEventArgs& e);
2760 
2770  virtual void onIDChanged(WindowEventArgs& e);
2771 
2781  virtual void onShown(WindowEventArgs& e);
2782 
2792  virtual void onHidden(WindowEventArgs& e);
2793 
2803  virtual void onEnabled(WindowEventArgs& e);
2804 
2814  virtual void onDisabled(WindowEventArgs& e);
2815 
2826  virtual void onClippingChanged(WindowEventArgs& e);
2827 
2838  virtual void onParentDestroyChanged(WindowEventArgs& e);
2839 
2850  virtual void onInheritsAlphaChanged(WindowEventArgs& e);
2851 
2861  virtual void onAlwaysOnTopChanged(WindowEventArgs& e);
2862 
2872  virtual void onCaptureGained(WindowEventArgs& e);
2873 
2883  virtual void onCaptureLost(WindowEventArgs& e);
2884 
2894  virtual void onInvalidated(WindowEventArgs& e);
2895 
2905  virtual void onRenderingStarted(WindowEventArgs& e);
2906 
2916  virtual void onRenderingEnded(WindowEventArgs& e);
2917 
2927  virtual void onZChanged(WindowEventArgs& e);
2928 
2938  virtual void onDestructionStarted(WindowEventArgs& e);
2939 
2948  virtual void onActivated(ActivationEventArgs& e);
2949 
2959  virtual void onDeactivated(ActivationEventArgs& e);
2960 
2972  virtual void onParentSized(ElementEventArgs& e);
2973 
2982  virtual void onChildAdded(ElementEventArgs& e);
2983 
2992  virtual void onChildRemoved(ElementEventArgs& e);
2993 
3001  virtual void onMouseEntersArea(MouseEventArgs& e);
3002 
3010  virtual void onMouseLeavesArea(MouseEventArgs& e);
3011 
3026  virtual void onMouseEnters(MouseEventArgs& e);
3027 
3042  virtual void onMouseLeaves(MouseEventArgs& e);
3043 
3052  virtual void onMouseMove(MouseEventArgs& e);
3053 
3062  virtual void onMouseWheel(MouseEventArgs& e);
3063 
3072  virtual void onMouseButtonDown(MouseEventArgs& e);
3073 
3082  virtual void onMouseButtonUp(MouseEventArgs& e);
3083 
3092  virtual void onMouseClicked(MouseEventArgs& e);
3093 
3102  virtual void onMouseDoubleClicked(MouseEventArgs& e);
3103 
3112  virtual void onMouseTripleClicked(MouseEventArgs& e);
3113 
3125  virtual void onKeyDown(KeyEventArgs& e);
3126 
3138  virtual void onKeyUp(KeyEventArgs& e);
3139 
3151  virtual void onCharacter(KeyEventArgs& e);
3152 
3163  virtual void onDragDropItemEnters(DragDropEventArgs& e);
3164 
3175  virtual void onDragDropItemLeaves(DragDropEventArgs& e);
3176 
3187  virtual void onDragDropItemDropped(DragDropEventArgs& e);
3188 
3198  virtual void onWindowRendererAttached(WindowEventArgs& e);
3199 
3209  virtual void onWindowRendererDetached(WindowEventArgs& e);
3210 
3221  virtual void onTextParsingChanged(WindowEventArgs& e);
3222 
3223  virtual void onMarginChanged(WindowEventArgs& e);
3224 
3225  /*************************************************************************
3226  Implementation Functions
3227  *************************************************************************/
3239  virtual void updateSelf(float elapsed);
3240 
3252  virtual void drawSelf(const RenderingContext& ctx);
3253 
3264  void bufferGeometry(const RenderingContext& ctx);
3265 
3276  void queueGeometry(const RenderingContext& ctx);
3277 
3284  virtual void populateGeometryBuffer() {}
3285 
3297  virtual void setParent(Element* parent);
3298 
3303  void generateAutoRepeatEvent(MouseButton button);
3304 
3316  virtual bool validateWindowRenderer(const WindowRenderer* renderer) const;
3317 
3324  bool isPropertyAtDefault(const Property* property) const;
3325 
3331  void notifyClippingChanged(void);
3332 
3334  void allocateRenderingWindow();
3335 
3337  void releaseRenderingWindow();
3338 
3340  void initialiseClippers(const RenderingContext& ctx);
3341 
3343  virtual void setArea_impl(const UVector2& pos, const USize& size, bool topLeftSizing = false, bool fireEvents = true);
3344 
3349  virtual void cleanupChildren(void);
3350 
3354  virtual void addChild_impl(Element* element);
3355 
3359  virtual void removeChild_impl(Element* element);
3360 
3365  virtual void onZChange_impl(void);
3366 
3371  void addWindowProperties(void);
3372 
3381  virtual bool moveToFront_impl(bool wasClicked);
3382 
3402  void addWindowToDrawList(Window& wnd, bool at_back = false);
3403 
3415  void removeWindowFromDrawList(const Window& wnd);
3416 
3428  bool isTopOfZOrder() const;
3429 
3435  void updateGeometryRenderSettings();
3436 
3438  void transferChildSurfaces();
3439 
3441  Rectf getParentElementClipIntersection(const Rectf& unclipped_area) const;
3442 
3444  void invalidate_impl(const bool recursive);
3445 
3452  const Window* getWindowAttachedToCommonAncestor(const Window& wnd) const;
3453 
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;
3461 
3462  virtual int writePropertiesXML(XMLSerializer& xml_stream) const;
3463  virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const;
3464  virtual bool writeAutoChildWindowXML(XMLSerializer& xml_stream) const;
3465 
3466  virtual void banPropertiesForAutoWindow();
3467 
3469  virtual bool handleFontRenderSizeChange(const EventArgs& args);
3470 
3471  // mark the rect caches defined on Window invalid (does not affect Element)
3472  void markCachedWindowRectsInvalid();
3473  void layoutLookNFeelChildWidgets();
3474 
3475  Window* getChildAtPosition(const Vector2f& position,
3476  bool (Window::*hittestfunc)(const Vector2f&, bool) const,
3477  bool allow_disabled = false) const;
3478 
3479  bool isHitTargetWindow(const Vector2f& position, bool allow_disabled) const;
3480 
3481  /*************************************************************************
3482  Properties for Window base class
3483  *************************************************************************/
3484 
3496  static
3497  class WindowRendererProperty : public TplWindowProperty<Window, String>
3498  {
3499  public:
3500  WindowRendererProperty();
3501  void writeXMLToStream(const PropertyReceiver* receiver,
3502  XMLSerializer& xml_stream) const;
3503  } d_windowRendererProperty;
3504 
3516  static
3517  class LookNFeelProperty : public TplWindowProperty<Window, String>
3518  {
3519  public:
3520  LookNFeelProperty();
3521  void writeXMLToStream(const PropertyReceiver* receiver,
3522  XMLSerializer& xml_stream) const;
3523  } d_lookNFeelProperty;
3524 
3525  /*************************************************************************
3526  Implementation Data
3527  *************************************************************************/
3529  typedef std::vector<Window*
3530  CEGUI_VECTOR_ALLOC(Window*)> ChildDrawList;
3532  typedef std::map<String, String, StringFastLessCompare
3533  CEGUI_MAP_ALLOC(String, String)> UserStringMap;
3535  typedef std::set<String, StringFastLessCompare
3536  CEGUI_SET_ALLOC(String)> BannedXMLPropertySet;
3537 
3539  const String d_type;
3541  String d_falagardType;
3543  bool d_autoWindow;
3544 
3546  bool d_initialising;
3548  bool d_destructionStarted;
3550  bool d_enabled;
3552  bool d_visible;
3554  bool d_active;
3555 
3557  ChildDrawList d_drawList;
3559  bool d_destroyedByParent;
3560 
3562  bool d_clippedByParent;
3563 
3565  String d_lookName;
3567  WindowRenderer* d_windowRenderer;
3569  GeometryBuffer* d_geometry;
3571  RenderingSurface* d_surface;
3573  mutable bool d_needsRedraw;
3575  bool d_autoRenderingWindow;
3576 
3578  const Image* d_mouseCursor;
3579 
3581  float d_alpha;
3583  bool d_inheritsAlpha;
3584 
3586  Window* d_oldCapture;
3588  bool d_restoreOldCapture;
3590  bool d_distCapturedInputs;
3591 
3593  const Font* d_font;
3595  String d_textLogical;
3597  BidiVisualMapping* d_bidiVisualMapping;
3599  mutable bool d_bidiDataValid;
3601  mutable RenderedString d_renderedString;
3603  mutable bool d_renderedStringValid;
3605  static BasicRenderedStringParser d_basicStringParser;
3607  static DefaultRenderedStringParser d_defaultStringParser;
3609  RenderedStringParser* d_customStringParser;
3611  bool d_textParsingEnabled;
3612 
3614  UBox d_margin;
3615 
3617  uint d_ID;
3619  void* d_userData;
3621  UserStringMap d_userStrings;
3622 
3624  bool d_alwaysOnTop;
3626  bool d_riseOnClick;
3628  bool d_zOrderingEnabled;
3629 
3631  bool d_wantsMultiClicks;
3633  bool d_mousePassThroughEnabled;
3635  bool d_autoRepeat;
3637  float d_repeatDelay;
3639  float d_repeatRate;
3641  MouseButton d_repeatButton;
3643  bool d_repeating;
3645  float d_repeatElapsed;
3646 
3648  bool d_dragDropTarget;
3649 
3651  String d_tooltipText;
3653  Tooltip* d_customTip;
3655  bool d_weOwnTip;
3657  bool d_inheritsTipText;
3658 
3660  bool d_allowWriteXML;
3662  BannedXMLPropertySet d_bannedXMLProperties;
3663 
3665  mutable Rectf d_outerRectClipper;
3667  mutable Rectf d_innerRectClipper;
3669  mutable Rectf d_hitTestRect;
3670 
3671  mutable bool d_outerRectClipperValid;
3672  mutable bool d_innerRectClipperValid;
3673  mutable bool d_hitTestRectValid;
3674 
3676  WindowUpdateMode d_updateMode;
3677 
3679  bool d_propagateMouseInputs;
3680 
3682  GUIContext* d_guiContext;
3683 
3685  bool d_containsMouse;
3686 
3687 private:
3688  /*************************************************************************
3689  May not copy or assign Window objects
3690  *************************************************************************/
3691  Window(const Window&): NamedElement() {}
3692  Window& operator=(const Window&) {return *this;}
3693 
3695  const Font* property_getFont() const;
3697  const Image* property_getMouseCursor() const;
3698 
3700  Event::ScopedConnection d_fontRenderSizeChangeConnection;
3701 };
3702 
3703 } // End of CEGUI namespace section
3704 
3705 
3706 #if defined(_MSC_VER)
3707 # pragma warning(pop)
3708 #endif
3709 
3710 #endif // end of guard _CEGUIWindow_h_
3711 
Window * getChildAtIdx(size_t idx) const
returns a pointer to the child window at the specified index. Idx is the index of the window in the c...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:659
bool isAncestor(const String &name) const
Return true if the specified element name is a name of some ancestor of this Element.
Definition: cegui/src/NamedElement.cpp:120
Definition: cegui/include/CEGUI/GUIContext.h:68
bool isCapturedByAncestor(void) const
return true if an ancestor window has captured inputs.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:952
virtual void endInitialisation(void)
Sets the internal 'initialising' flag to false. This is called automatically by the layout XML handle...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:2351
Functor that can be used as comparator in a std::map with String keys. It's faster than using the def...
Definition: cegui/include/CEGUI/String.h:5579
Definition: cegui/include/CEGUI/TplWindowProperty.h:37
void hide(void)
hide the Window.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1523
Generic drag & drop enabled window class.
Definition: cegui/include/CEGUI/widgets/DragContainer.h:45
Adds name to the Element class, including name path traversal.
Definition: cegui/include/CEGUI/NamedElement.h:74
bool isMousePassThroughEnabled(void) const
Returns whether this window should ignore mouse event and pass them through to and other windows behi...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1314
virtual void beginInitialisation(void)
Sets the internal 'initialising' flag to true. This can be use to optimize initialisation of some wid...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:2342
Interface for Image.
Definition: cegui/include/CEGUI/Image.h:158
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
A positioned and sized rectangular node in a tree graph.
Definition: cegui/include/CEGUI/Element.h:242
EventArgs based class used for certain drag/drop notifications.
Definition: cegui/include/CEGUI/InputEvent.h:341
Window * getParent() const
return the parent of this Window.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1026
Effectively a 'null' parser that returns a RenderedString representation that will draw the input tex...
Definition: cegui/include/CEGUI/DefaultRenderedStringParser.h:40
size_t size_type
Unsigned type used for size values and indices.
Definition: cegui/include/CEGUI/String.h:70
float getAlpha(void) const
return the current alpha value set for this Window
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:849
void * getUserData(void) const
Return the user data set for this Window.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1058
Base class used as the argument to all subscribers Event object.
Definition: cegui/include/CEGUI/EventArgs.h:49
Base class for Tooltip widgets.
Definition: cegui/include/CEGUI/widgets/Tooltip.h:79
bool isCapturedByChild(void) const
return true if a child window has captured inputs.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:963
bool isClippedByParent(void) const
return true if this Window is clipped so that its rendering will not pass outside of its parent Windo...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:592
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: cegui/include/CEGUI/GeometryBuffer.h:42
struct that holds some context relating to a RenderingSurface object.
Definition: cegui/include/CEGUI/RenderingContext.h:39
bool restoresOldCapture(void) const
Return whether this window is set to restore old input capture when it loses input capture...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1074
std::map< String, String, StringFastLessCompare CEGUI_MAP_ALLOC(String, String)> UserStringMap
definition of type used for the UserString dictionary.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:3533
std::set< String, StringFastLessCompare CEGUI_SET_ALLOC(String)> BannedXMLPropertySet
definition of type used to track properties banned from writing XML.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:3536
MouseButton
Enumeration of mouse buttons.
Definition: cegui/include/CEGUI/InputEvent.h:209
void disable(void)
disable the Window to prevent interaction.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1478
Always call the Window::update function for this window.
Definition: cegui/include/CEGUI/Window.h:73
The WindowManager class describes an object that manages creation and lifetime of Window objects...
Definition: cegui/include/CEGUI/WindowManager.h:60
bool isChild(const String &name_path) const
Checks whether given name path references a NamedElement that is attached to this Element...
Definition: cegui/src/NamedElement.cpp:108
bool isAlwaysOnTop(void) const
returns whether or not this Window is an always on top Window. Also known as a top-most window...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:501
Abstract class to wrap a Bidi visual mapping of a text string.
Definition: cegui/include/CEGUI/BidiVisualMapping.h:50
Class representing a rendered string of entities.
Definition: cegui/include/CEGUI/RenderedString.h:50
uint getID(void) const
return the ID code currently assigned to this Window by client code.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:601
Base-class for the assignable WindowRenderer object.
Definition: cegui/include/CEGUI/WindowRenderer.h:50
void show(void)
show the Window.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1511
virtual void initialiseComponents(void)
Initialises the Window based object ready for use.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1403
Defines a clipboard handling class.
Definition: cegui/include/CEGUI/Clipboard.h:82
bool isAutoWindow(void) const
Returns whether this window is an auto window.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1323
Only call the Window::update function for this window if it is visible.
Definition: cegui/include/CEGUI/Window.h:77
EventArgs based class that is used for objects passed to input event handlers concerning keyboard inp...
Definition: cegui/include/CEGUI/InputEvent.h:314
bool isWritingXMLAllowed(void) const
Returns whether this window is allowed to write XML.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1329
Class encapsulating the 'Unified Box' - this is usually used for margin.
Definition: cegui/include/CEGUI/UDim.h:247
const BidiVisualMapping * getBidiVisualMapping() const
return the pointer to the BidiVisualMapping for this window, if any.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:2539
Class that encapsulates a typeface.
Definition: cegui/include/CEGUI/Font.h:58
void setWritingXMLAllowed(bool allow)
Sets whether this window is allowed to write XML.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:2406
Window * getChildRecursive(const String &name) const
return a pointer to the first attached child window with the specified name. Children are traversed r...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:713
Dummy base class to ensure correct casting of receivers.
Definition: cegui/include/CEGUI/Property.h:45
void enable(void)
enable the Window to allow interaction.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1469
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: cegui/include/CEGUI/Window.h:149
const String & getText(void) const
return the current text for the Window
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:817
void setUserData(void *user_data)
Set the user data set for this Window.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1941
void removeChild(const String &name_path)
Remove the Element referenced by the given name path from this Element's child list.
Definition: cegui/src/NamedElement.cpp:160
bool inheritsAlpha(void) const
return true if the Window inherits alpha from its parent(s).
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:830
Class that represents a surface that can have geometry based imagery drawn to it. ...
Definition: cegui/include/CEGUI/RenderingSurface.h:108
Basic RenderedStringParser class that offers support for the following tags:
Definition: cegui/include/CEGUI/BasicRenderedStringParser.h:64
Window * getChild(const String &name_path) const
return the attached child window that the given name path references.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:687
void setMousePassThroughEnabled(bool setting)
Sets whether this window should ignore mouse events and pass them through to any windows behind it...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:2363
void setRiseOnClickEnabled(bool setting)
Set whether this window will rise to the top of the z-order when clicked with the left mouse button...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:2159
Never call the Window::update function for this window.
Definition: cegui/include/CEGUI/Window.h:75
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: cegui/include/CEGUI/Element.h:210
Specifies interface for classes that parse text into RenderedString objects.
Definition: cegui/include/CEGUI/RenderedStringParser.h:37
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: cegui/include/CEGUI/InputEvent.h:251
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: cegui/include/CEGUI/InputEvent.h:280
An abstract class that defines the interface to access object properties by name. ...
Definition: cegui/include/CEGUI/Property.h:60
bool isRiseOnClickEnabled(void) const
Return whether this window will rise to the top of the z-order when clicked with the left mouse butto...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1228
bool isCapturedByThis(void) const
return true if this Window has input captured.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:941
WindowUpdateMode
Enumerated type used for specifying Window::update mode to be used. Note that the setting specified w...
Definition: cegui/include/CEGUI/Window.h:70
The System class is the CEGUI class that provides access to all other elements in this system...
Definition: cegui/include/CEGUI/System.h:65
bool getModalState(void) const
Get whether or not this Window is the modal target.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:1256
Class used to create XML Document.
Definition: cegui/include/CEGUI/XMLSerializer.h:85
std::vector< Window *CEGUI_VECTOR_ALLOC(Window *)> ChildDrawList
definition of type used for the list of child windows to be drawn
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:3530
Window * getCaptureWindow() const
return the Window that currently has inputs captured.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:930
virtual void populateGeometryBuffer()
Update the rendering cache.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:3284
EventArgs based class that is used for Activated and Deactivated window events.
Definition: cegui/include/CEGUI/InputEvent.h:329
Class encapsulating operations on a Rectangle.
Definition: cegui/include/CEGUI/ForwardRefs.h:89
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62
bool isDestroyedByParent(void) const
returns whether or not this Window is set to be destroyed when its parent window is destroyed...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Window.h:490